././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1719958149.848793 borgbackup-1.4.0/0000755000076500000240000000000014641075206012215 5ustar00twstaff././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/.coveragerc0000644000076500000240000000074114641074756014351 0ustar00twstaff[run] branch = True disable_warnings = module-not-measured source = src/borg omit = */borg/__init__.py */borg/__main__.py */borg/_version.py */borg/fuse.py */borg/support/* */borg/testsuite/* */borg/hash_sizes.py [report] exclude_lines = pragma: no cover pragma: freebsd only pragma: unknown platform only def __repr__ raise AssertionError raise NotImplementedError if 0: if __name__ == .__main__.: ignore_errors = True ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/.pre-commit-config.yaml0000644000076500000240000000014414641074756016506 0ustar00twstaffrepos: - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.0.287 hooks: - id: ruff ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/.readthedocs.yaml0000644000076500000240000000125714641074756015462 0ustar00twstaff# .readthedocs.yaml - Read the Docs configuration file. # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details. version: 2 build: os: ubuntu-22.04 tools: python: "3.11" jobs: post_checkout: - git fetch --unshallow apt_packages: - build-essential - pkg-config - libacl1-dev - libssl-dev - liblz4-dev - libzstd-dev - libxxhash-dev python: install: - requirements: requirements.d/development.lock.txt - requirements: requirements.d/docs.txt - method: pip path: . sphinx: configuration: docs/conf.py formats: - htmlzip ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/AUTHORS0000644000076500000240000000353014641074756013277 0ustar00twstaffE-mail addresses listed here are not intended for support, please see the `support section`_ instead. .. _support section: https://borgbackup.readthedocs.io/en/stable/support.html Borg authors ("The Borg Collective") ------------------------------------ - Thomas Waldmann - Radek Podgorny - Yuri D'Elia - Michael Hanselmann - Teemu Toivanen - Marian Beermann - Martin Hostettler - Daniel Reichelt - Lauri Niskanen - Abdel-Rahman A. (Abogical) - Gu1nness - Andrey Andreyevich Bienkowski Retired ``````` - Antoine Beaupré Borg is a fork of Attic. Attic authors ------------- Attic is written and maintained by Jonas Borgström and various contributors: Attic Development Lead `````````````````````` - Jonas Borgström Attic Patches and Suggestions ````````````````````````````` - Brian Johnson - Cyril Roussillon - Dan Christensen - Jeremy Maitin-Shepard - Johann Klähn - Petros Moisiadis - Thomas Waldmann BLAKE2 ------ Borg includes BLAKE2: Copyright 2012, Samuel Neves , licensed under the terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0. Slicing CRC32 ------------- Borg includes a fast slice-by-8 implementation of CRC32, Copyright 2011-2015 Stephan Brumme, licensed under the terms of a zlib license. See http://create.stephan-brumme.com/crc32/ Folding CRC32 ------------- Borg includes an extremely fast folding implementation of CRC32, Copyright 2013 Intel Corporation, licensed under the terms of the zlib license. xxHash ------ XXH64, a fast non-cryptographic hash algorithm. Copyright 2012-2016 Yann Collet, licensed under a BSD 2-clause license. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/Brewfile0000644000076500000240000000043514641074756013712 0ustar00twstaffbrew 'pkg-config' brew 'zstd' brew 'lz4' brew 'xxhash' brew 'openssl@3.0' # osxfuse (aka macFUSE) is only required for "borg mount", # but won't work on github actions' workers. # it requires installing a kernel extension, so some users # may want it and some won't. #cask 'osxfuse' ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/CHANGES.rst0000644000076500000240000071047514641074756014046 0ustar00twstaff.. _important_notes: Important notes =============== This section provides information about security and corruption issues. .. _archives_tam_vuln: Pre-1.2.5 archives spoofing vulnerability (CVE-2023-36811) ---------------------------------------------------------- A flaw in the cryptographic authentication scheme in Borg allowed an attacker to fake archives and potentially indirectly cause backup data loss in the repository. The attack requires an attacker to be able to 1. insert files (with no additional headers) into backups 2. gain write access to the repository This vulnerability does not disclose plaintext to the attacker, nor does it affect the authenticity of existing archives. Creating plausible fake archives may be feasible for empty or small archives, but is unlikely for large archives. The fix enforces checking the TAM authentication tag of archives at critical places. Borg now considers archives without TAM as garbage or an attack. We are not aware of others having discovered, disclosed or exploited this vulnerability. Below, if we speak of borg 1.2.8, we mean a borg version >= 1.2.8 **or** a borg version that has the relevant patches for this vulnerability applied (could be also an older version in that case). Steps you must take to upgrade a repository (this applies to all kinds of repos no matter what encryption mode they use, including "none"): 1. Upgrade all clients using this repository to borg 1.2.8. Note: it is not required to upgrade a server, except if the server-side borg is also used as a client (and not just for "borg serve"). Do **not** run ``borg check`` with borg > 1.2.4 before completing the upgrade steps: - ``borg check`` would complain about archives without a valid archive TAM. - ``borg check --repair`` would remove such archives! 2. Do this step on every client using this repo: ``borg upgrade --show-rc --check-tam `` This will check the manifest TAM authentication setup in the repo and on this client. The command will exit with rc=0 if all is OK, otherwise with rc=1. a) If you get "Manifest authentication setup OK for this client and this repository." and rc=0, continue with 3. b) If you get some warnings and rc=1, run: ``borg upgrade --tam --force `` 3. Run: ``borg upgrade --show-rc --check-archives-tam `` This will create a report about the TAM status for all archives. In the last line(s) of the report, it will also report the overall status. The command will exit with rc=0 if all archives are TAM authenticated or with rc=1 if there are some archives with TAM issues. If there are no issues and all archives are TAM authenticated, continue with 5. Archive TAM issues are expected for: - archives created by borg <1.0.9. - archives resulting from a borg rename or borg recreate operation (see #7791) But, important, archive TAM issues could also come from archives created by an attacker. You should verify that archives with TAM issues are authentic and not malicious (== have good content, have correct timestamp, can be extracted successfully). In case you find crappy/malicious archives, you must delete them before proceeding. In low-risk, trusted environments, you may decide on your own risk to skip step 3 and just trust in everything being OK. 4. If there are no archives with TAM issues left at this point, you can skip this step. Run ``borg upgrade --archives-tam ``. This will unconditionally add a correct archive TAM to all archives not having one. ``borg check`` would consider TAM-less or invalid-TAM archives as garbage or a potential attack. To see that all archives are OK now, you can optionally repeat the command from step 3. 5. Done. Manifest and archives are TAM authenticated now. Vulnerability time line: * 2023-06-13: Vulnerability discovered during code review by Thomas Waldmann * 2023-06-13...: Work on fixing the issue, upgrade procedure, docs. * 2023-06-30: CVE was assigned via Github CNA * 2023-06-30 .. 2023-08-29: Fixed issue, code review, docs, testing. * 2023-08-30: Released fixed version 1.2.5 (broken upgrade procedure for some repos) * 2023-08-31: Released fixed version 1.2.6 (fixes upgrade procedure) .. _hashindex_set_bug: Pre-1.1.11 potential index corruption / data loss issue ------------------------------------------------------- A bug was discovered in our hashtable code, see issue #4829. The code is used for the client-side chunks cache and the server-side repo index. Although borg uses the hashtables very heavily, the index corruption did not happen too frequently, because it needed specific conditions to happen. Data loss required even more specific conditions, so it should be rare (and also detectable via borg check). You might be affected if borg crashed with / complained about: - AssertionError: Corrupted segment reference count - corrupted index or hints - ObjectNotFound: Object with key ... not found in repository ... - Index mismatch for key b'...'. (..., ...) != (-1, -1) - ValueError: stats_against: key contained in self but not in master_index. Advised procedure to fix any related issue in your indexes/caches: - install fixed borg code (on client AND server) - for all of your clients and repos remove the cache by: borg delete --cache-only YOURREPO (later, the cache will be re-built automatically) - for all your repos, rebuild the repo index by: borg check --repair YOURREPO This will also check all archives and detect if there is any data-loss issue. Affected branches / releases: - fd06497 introduced the bug into 1.1-maint branch - it affects all borg 1.1.x since 1.1.0b4. - fd06497 introduced the bug into master branch - it affects all borg 1.2.0 alpha releases. - c5cd882 introduced the bug into 1.0-maint branch - it affects all borg 1.0.x since 1.0.11rc1. The bug was fixed by: - 701159a fixes the bug in 1.1-maint branch - will be released with borg 1.1.11. - fa63150 fixes the bug in master branch - will be released with borg 1.2.0a8. - 7bb90b6 fixes the bug in 1.0-maint branch. Branch is EOL, no new release is planned as of now. .. _broken_validator: Pre-1.1.4 potential data corruption issue ----------------------------------------- A data corruption bug was discovered in borg check --repair, see issue #3444. This is a 1.1.x regression, releases < 1.1 (e.g. 1.0.x) are not affected. To avoid data loss, you must not run borg check --repair using an unfixed version of borg 1.1.x. The first official release that has the fix is 1.1.4. Package maintainers may have applied the fix to updated packages of 1.1.x (x<4) though, see the package maintainer's package changelog to make sure. If you never had missing item metadata chunks, the bug has not affected you even if you did run borg check --repair with an unfixed version. When borg check --repair tried to repair corrupt archives that miss item metadata chunks, the resync to valid metadata in still present item metadata chunks malfunctioned. This was due to a broken validator that considered all (even valid) item metadata as invalid. As they were considered invalid, borg discarded them. Practically, that means the affected files, directories or other fs objects were discarded from the archive. Due to the malfunction, the process was extremely slow, but if you let it complete, borg would have created a "repaired" archive that has lost a lot of items. If you interrupted borg check --repair because it was so strangely slow (killing borg somehow, e.g. Ctrl-C) the transaction was rolled back and no corruption occurred. The log message indicating the precondition for the bug triggering looks like: item metadata chunk missing [chunk: 001056_bdee87d...a3e50d] If you never had that in your borg check --repair runs, you're not affected. But if you're unsure or you actually have seen that, better check your archives. By just using "borg list repo::archive" you can see if all expected filesystem items are listed. .. _tam_vuln: Pre-1.0.9 manifest spoofing vulnerability (CVE-2016-10099) ---------------------------------------------------------- A flaw in the cryptographic authentication scheme in Borg allowed an attacker to spoof the manifest. The attack requires an attacker to be able to 1. insert files (with no additional headers) into backups 2. gain write access to the repository This vulnerability does not disclose plaintext to the attacker, nor does it affect the authenticity of existing archives. The vulnerability allows an attacker to create a spoofed manifest (the list of archives). Creating plausible fake archives may be feasible for small archives, but is unlikely for large archives. The fix adds a separate authentication tag to the manifest. For compatibility with prior versions this authentication tag is *not* required by default for existing repositories. Repositories created with 1.0.9 and later require it. Steps you should take: 1. Upgrade all clients to 1.0.9 or later. 2. Run ``borg upgrade --tam `` *on every client* for *each* repository. 3. This will list all archives, including archive IDs, for easy comparison with your logs. 4. Done. Prior versions can access and modify repositories with this measure enabled, however, to 1.0.9 or later their modifications are indiscernible from an attack and will raise an error until the below procedure is followed. We are aware that this can be annoying in some circumstances, but don't see a way to fix the vulnerability otherwise. In case a version prior to 1.0.9 is used to modify a repository where above procedure was completed, and now you get an error message from other clients: 1. ``borg upgrade --tam --force `` once with *any* client suffices. This attack is mitigated by: - Noting/logging ``borg list``, ``borg info``, or ``borg create --stats``, which contain the archive IDs. We are not aware of others having discovered, disclosed or exploited this vulnerability. Vulnerability time line: * 2016-11-14: Vulnerability and fix discovered during review of cryptography by Marian Beermann (@enkore) * 2016-11-20: First patch * 2016-12-20: Released fixed version 1.0.9 * 2017-01-02: CVE was assigned * 2017-01-15: Released fixed version 1.1.0b3 (fix was previously only available from source) .. _attic013_check_corruption: Pre-1.0.9 potential data loss ----------------------------- If you have archives in your repository that were made with attic <= 0.13 (and later migrated to borg), running borg check would report errors in these archives. See issue #1837. The reason for this is a invalid (and useless) metadata key that was always added due to a bug in these old attic versions. If you run borg check --repair, things escalate quickly: all archive items with invalid metadata will be killed. Due to that attic bug, that means all items in all archives made with these old attic versions. Pre-1.0.4 potential repo corruption ----------------------------------- Some external errors (like network or disk I/O errors) could lead to corruption of the backup repository due to issue #1138. A sign that this happened is if "E" status was reported for a file that can not be explained by problems with the source file. If you still have logs from "borg create -v --list", you can check for "E" status. Here is what could cause corruption and what you can do now: 1) I/O errors (e.g. repo disk errors) while writing data to repo. This could lead to corrupted segment files. Fix:: # check for corrupt chunks / segments: borg check -v --repository-only REPO # repair the repo: borg check -v --repository-only --repair REPO # make sure everything is fixed: borg check -v --repository-only REPO 2) Unreliable network / unreliable connection to the repo. This could lead to archive metadata corruption. Fix:: # check for corrupt archives: borg check -v --archives-only REPO # delete the corrupt archives: borg delete --force REPO::CORRUPT_ARCHIVE # make sure everything is fixed: borg check -v --archives-only REPO 3) In case you want to do more intensive checking. The best check that everything is ok is to run a dry-run extraction:: borg extract -v --dry-run REPO::ARCHIVE .. _upgradenotes: Upgrade Notes ============= borg 1.2.x to 1.4.x ------------------- If you currently use borg 1.2.5+: no upgrade steps needed (if you already did them when upgrading to that version, otherwise see below). If you currently use borg 1.2.0 .. 1.2.4, read and follow "Pre-1.2.5 archives spoofing vulnerability (CVE-2023-36811)" section, see the top of this changelog. Compatibility notes: By default, borg 1.4 will behave quite similar to borg 1.2 (it was forked off from 1.2-maint branch at 1.2.7). - the slashdot hack: be careful not to accidentally give paths containing /./ to "borg create" if you do not want to trigger this feature (which strips the left part of the path from archived items). - BORG_EXIT_CODES=modern is a feature that borg script, wrapper and GUI authors may want to use to get more specific error and warning return codes from borg. In that case, of course they will need to make sure to correctly deal with these new codes, see the internals/frontends docs. borg 1.1.x to 1.2.x ------------------- Some things can be recommended for the upgrade process from borg 1.1.x (please also read the important compatibility notes below): - first upgrade to a recent 1.1.x release - especially if you run some older 1.1.* or even 1.0.* borg release. - using that, run at least one `borg create` (your normal backup), `prune` and especially a `check` to see everything is in a good state. - check the output of `borg check` - if there is anything special, consider a `borg check --repair` followed by another `borg check`. - if everything is fine so far (borg check reports no issues), you can consider upgrading to 1.2.x. if not, please first fix any already existing issue. - if you want to play safer, first **create a backup of your borg repository**. - upgrade to latest borg 1.2.x release (you could use the fat binary from github releases page) - borg 1.2.6 has a security fix for the pre-1.2.5 archives spoofing vulnerability (CVE-2023-36811), see details and necessary upgrade procedure described above. - run `borg compact --cleanup-commits` to clean up a ton of 17 bytes long files in your repo caused by a borg 1.1 bug - run `borg check` again (now with borg 1.2.x) and check if there is anything special. - run `borg info` (with borg 1.2.x) to build the local pre12-meta cache (can take significant time, but after that it will be fast) - for more details see below. - check the compatibility notes (see below) and adapt your scripts, if needed. - if you run into any issues, please check the github issue tracker before posting new issues there or elsewhere. If you follow this procedure, you can help avoiding that we get a lot of "borg 1.2" issue reports that are not really 1.2 issues, but existed before and maybe just were not noticed. Compatibility notes: - matching of path patterns has been aligned with borg storing relative paths. Borg archives file paths without leading slashes. Previously, include/exclude patterns could contain leading slashes. You should check your patterns and remove leading slashes. - dropped support / testing for older Pythons, minimum requirement is 3.8. In case your OS does not provide Python >= 3.8, consider using our binary, which does not need an external Python interpreter. Or continue using borg 1.1.x, which is still supported. - freeing repository space only happens when "borg compact" is invoked. - mount: the default for --numeric-ids is False now (same as borg extract) - borg create --noatime is deprecated. Not storing atime is the default behaviour now (use --atime if you want to store the atime). - --prefix is deprecated, use -a / --glob-archives, see #6806 - list: corrected mix-up of "isomtime" and "mtime" formats. Previously, "isomtime" was the default but produced a verbose human format, while "mtime" produced a ISO-8601-like format. The behaviours have been swapped (so "mtime" is human, "isomtime" is ISO-like), and the default is now "mtime". "isomtime" is now a real ISO-8601 format ("T" between date and time, not a space). - create/recreate --list: file status for all files used to get announced *AFTER* the file (with borg < 1.2). Now, file status is announced *BEFORE* the file contents are processed. If the file status changes later (e.g. due to an error or a content change), the updated/final file status will be printed again. - removed deprecated-since-long stuff (deprecated since): - command "borg change-passphrase" (2017-02), use "borg key ..." - option "--keep-tag-files" (2017-01), use "--keep-exclude-tags" - option "--list-format" (2017-10), use "--format" - option "--ignore-inode" (2017-09), use "--files-cache" w/o "inode" - option "--no-files-cache" (2017-09), use "--files-cache=disabled" - removed BORG_HOSTNAME_IS_UNIQUE env var. to use borg you must implement one of these 2 scenarios: - 1) the combination of FQDN and result of uuid.getnode() must be unique and stable (this should be the case for almost everybody, except when having duplicate FQDN *and* MAC address or all-zero MAC address) - 2) if you are aware that 1) is not the case for you, you must set BORG_HOST_ID env var to something unique. - exit with 128 + signal number, #5161. if you have scripts expecting rc == 2 for a signal exit, you need to update them to check for >= 128. .. _changelog: Change Log ========== Version 1.4.0 (2024-07-03) -------------------------- For upgrade and compatibility hints, please also read the section "Upgrade Notes" above. Other changes: - vagrant: revive the buster64 box, RHEL8 has same glibc - tests: fix pytest_report_header, #8232 - docs: - mount: add examples using :: positional argument, #8255 - Installation: update Arch Linux repo name - update standalone binary section Version 1.4.0rc1 (2024-05-26) ----------------------------- Fixes: - setup.py: fix import error reporting for cythonize import, #8208 - setup.py: detect noexec build fs issue, #8208 Other changes: - changed insufficiently reserved length for log message, #8152 - use Python 3.11.9, Cython 3.0.10 and PyInstaller 6.7.0 for binary builds - docs: - use python 3.9 in cygwin install docs, fixes #8196 - recreate: remove experimental status - github CI: fix PKG_CONFIG_PATH for openssl 3.0 - vagrant: - add a ubuntu noble (24.04) VM - drop buster VM, fixes #8171 Version 1.4.0b2 (2024-03-31) ---------------------------- Fixes: - check: fix return code for index entry value discrepancies - benchmark: inherit options --rsh --remote-path, #8099 - sdist: dynamically compute readme (long_description) - create: deal with EBUSY, #8123 - No need to use OpenSSL 3.0 on OpenBSD, use LibreSSL. - fix Ctrl-C / SIGINT behaviour for pyinstaller-made binaries, #8155 New features: - create: add the slashdot hack, update docs, #4685 - upgrade --check-tam: check manifest TAM auth, exit with rc=1 if there are issues. - upgrade --check-archives-tam: check archives TAM auth, exit with rc=1 if there are issues. Other changes: - improve acl_get / acl_set error handling, improved/added tests, #8125 - remove bundled lz4/zstd/xxhash code (require the respective libs/headers), simplify setup.py, remove support for all BORG_USE_BUNDLED_*=YES, #8094 - require Cython 3.0.3 at least (fixes py312 memory leak), #8133 - allow msgpack 1.0.8, #8133 - init: better borg key export instructions - init: remove compatibility warning for borg <=1.0.8 The warning refers to a compatibility issue not relevant any more since borg 1.0.9 (released 2016-12). - locate libacl via pkgconfig - scripts/make.py: move clean, build_man, build_usage to there, so we do not need to invoke setup.py directly, update docs - docs: - how to run the testsuite using the dist package - add non-root deployment strategy (systemd / capabilities) - simplify TAM-related upgrade docs using the new commands - vagrant: - use python 3.11.8 - use pyinstaller 6.5.0 - add xxhash for macOS, add libxxhash-dev for debianoid systems - use openindiana/hipster box Version 1.4.0b1 (2024-01-21) ---------------------------- Fixes: - fix CommandError args, #8029 New features: - implement "borg version" (shows client and server version), #7829 Other changes: - better error msg for corrupted key data, #8016 - repository: give clean error msg for invalid nonce file, #7967 - check_can_create_repository: deal with PermissionErrors, #7016 - add ConnectionBrokenWithHint for BrokenPipeErrors and similar, #7016 - with-lock: catch exception, print error msg, #8022 - use cython 3.0.8 - modernize msgpack wrapper - docs: - add brew bundle instructions (macOS) - improve docs for borg with-lock, #8022 Version 1.4.0a1 (2024-01-01) ---------------------------- New features: - BORG_EXIT_CODES=modern: optional more specific return codes (for errors and warnings). The default value of this new environment variable is "legacy", which should result in a behaviour similar to borg 1.2 and older (only using rc 0, 1 and 2). "modern" exit codes are much more specific (see the internals/frontends docs). Fixes: - PATH: do not accept empty strings, #4221. This affects the cli interface of misc. commands (create, extract, diff, mount, ...) and they now will reject "" (empty string) given as a path. Other changes: - Python: require Python >= 3.9, drop support for 3.8, #6383 - Cython: require Cython >= 3.0, drop support for Cython 0.29.x, use 3str language level (default in cython3), #7978 - use pyinstaller 6.3.0 and python 3.11 for binary build, #7987 - msgpack: require >= 1.0.3, <= 1.0.7 - replace flake8 by ruff style/issue checker - tests: remove python-dateutil dependency - tests: move conftest.py to src/borg/testsuite, #6386 - move misc. config/metadata to pyproject.toml - vagrant: - use a freebsd 14 box, #6871 - use generic/openbsd7 box - use openssl 3 on macOS, FreeBSD, OpenBSD - remove ubuntu 20.04 "focal" box - remove debian 9 "stretch" box (remove stretch-based binary builds) - require recent setuptools and setuptools_scm - crypto: get rid of deprecated HMAC_* functions to avoid warnings. Instead, use hmac.digest from Python stdlib. Version 1.2.7 (2023-12-02) -------------------------- Fixes: - docs: CVE-2023-36811 upgrade steps: consider checkpoint archives, #7802 - check/compact: fix spurious reappearance of orphan chunks since borg 1.2, #6687 - this consists of 2 fixes: - for existing chunks: check --repair: recreate shadow index, #7897 #6687 - for newly created chunks: update shadow index when doing a double-put, #7896 #5661 If you have experienced issue #6687, you may want to run borg check --repair after upgrading to borg 1.2.7 to recreate the shadow index and get rid of the issue for existing chunks. - LockRoster.modify: no KeyError if element was already gone, #7937 - create --X-from-command: run subcommands with a clean environment, #7916 - list --sort-by: support "archive" as alias of "name", #7873 - fix rc and msg if arg parsing throws an exception, #7885 Other changes: - support and test on Python 3.12 - include unistd.h in _chunker.c (fix for Python 3.13) - allow msgpack 1.0.6 and 1.0.7 - TAM issues: show tracebacks, improve borg check logging, #7797 - replace "datetime.utcfromtimestamp" with custom helper to avoid deprecation warnings when using Python 3.12 - vagrant: - use generic/debian9 box, fixes #7579 - add VM with debian bookworm / test on OpenSSL 3.0.x. - docs: - not only attack/unsafe, can also be a fs issue, #7853 - point to CVE-2023-36811 upgrade steps from borg 1.1 to 1.2 upgrade steps, #7899 - upgrade steps needed for all kinds of repos (including "none" encryption mode), #7813 - upgrade steps: talk about consequences of borg check, #7816 - upgrade steps: remove period that could be interpreted as part of the command - automated-local.rst: use GPT UUID for consistent udev rule - create disk/partition sector backup by disk serial number, #7934 - update macOS hint about full disk access - clarify borg prune -a option description, #7871 - readthedocs: also build offline docs (HTMLzip), #7835 - frontends: add "check.rebuild_refcounts" message Version 1.2.6 (2023-08-31) -------------------------- Fixes: - The upgrade procedure docs as published with borg 1.2.5 did not work, if the repository had archives resulting from a borg rename or borg recreate operation. The updated docs now use BORG_WORKAROUNDS=ignore_invalid_archive_tam at some places to avoid that issue, #7791. See: fix pre-1.2.5 archives spoofing vulnerability (CVE-2023-36811), details and necessary upgrade procedure described above. Other changes: - updated 1.2.5 changelog entry: 1.2.5 already has the fix for rename/recreate. - remove cython restrictions. recommended is to build with cython 0.29.latest, because borg 1.2.x uses this since years and it is very stable. you can also try to build with cython 3.0.x, there is a good chance that it works. as a 3rd option, we also bundle the `*.c` files cython outputs in the release pypi package, so you can also just use these and not need cython at all. Version 1.2.5 (2023-08-30) -------------------------- Fixes: - Security: fix pre-1.2.5 archives spoofing vulnerability (CVE-2023-36811), see details and necessary upgrade procedure described above. - rename/recreate: correctly update resulting archive's TAM, see #7791 - create: do not try to read parent dir of recursion root, #7746 - extract: fix false warning about pattern never matching, #4110 - diff: remove surrogates before output, #7535 - compact: clear empty directories at end of compact process, #6823 - create --files-cache=size: fix crash, #7658 - keyfiles: improve key sanity check, #7561 - only warn about "invalid" chunker params, #7590 - ProgressIndicatorPercent: fix space computation for wide chars, #3027 - improve argparse validator error messages New features: - mount: make up volname if not given (macOS), #7690. macFUSE supports a volname mount option to give what finder displays on the desktop / in the directory view. if the user did not specify it, we make something up, because otherwise it would be "macFUSE Volume 0 (Python)" and hide the mountpoint directory name. - BORG_WORKAROUNDS=authenticated_no_key to extract from authenticated repos without key, #7700 Other changes: - add `utcnow()` helper function to avoid deprecated `datetime.utcnow()` - stay on latest Cython 0.29 (0.29.36) for borg 1.2.x (do not use Cython 3.0 yet) - docs: - move upgrade notes to own section, see #7546 - mount -olocal: how to show mount in finder's sidebar, #5321 - list: fix --pattern examples, #7611 - improve patterns help - incl./excl. options, path-from-stdin exclusiveness - obfuscation docs: markup fix, note about MAX_DATA_SIZE - --one-file-system: add macOS apfs notes, #4876 - improve --one-file-system help string, #5618 - rewrite borg check docs - improve the docs for --keep-within, #7687 - fix borg init command in environment.rst.inc - 1.1.x upgrade notes: more precise borg upgrade instructions, #3396 - tests: - fix repo reopen - avoid long ids in pytest output - check buzhash chunksize distribution, see #7586 Version 1.2.4 (2023-03-24) -------------------------- New features: - import-tar: add --ignore-zeros to process concatenated tars, #7432. - debug id-hash: computes file/chunk content id-hash, #7406 - diff: --content-only does not show mode/ctime/mtime changes, #7248 - diff: JSON strings in diff output are now sorted alphabetically Bug fixes: - xattrs: fix namespace processing on FreeBSD, #6997 - diff: fix path related bug seen when addressing deferred items. - debug get-obj/put-obj: always give chunkid as cli param, see #7290 (this is an incompatible change, see also borg debug id-hash) - extract: fix mtime when ResourceFork xattr is set (macOS specific), #7234 - recreate: without --chunker-params, do not re-chunk, #7337 - recreate: when --target is given, do not detect "nothing to do". use case: borg recreate -a src --target dst can be used to make a copy of an archive inside the same repository, #7254. - set .hardlink_master for ALL hardlinkable items, #7175 - locking: fix host, pid, tid order. tid (thread id) must be parsed as hex from lock file name. - update development.lock.txt, including a setuptools security fix, #7227 Other changes: - requirements: allow msgpack 1.0.5 also - upgrade Cython to 0.29.33 - hashindex minor fixes, refactor, tweaks, tests - use os.replace not os.rename - remove BORG_LIBB2_PREFIX (not used any more) - docs: - BORG_KEY_FILE: clarify docs, #7444 - update FAQ about locale/unicode issues, #6999 - improve mount options rendering, #7359 - make timestamps in manual pages reproducible - installation: update Fedora in distribution list, #7357 - tests: - fix test_size_on_disk_accurate for large st_blksize, #7250 - add same_ts_ns function and use it for relaxed timestamp comparisons - "auto" compressor tests: don't assume a specific size, do not assume zlib is better than lz4, #7363 - add test for extracted directory mtime - vagrant: - upgrade local freebsd 12.1 box -> generic/freebsd13 box (13.1) - use pythons > 3.8 which work on freebsd 13.1 - pyenv: also install python 3.11.1 for testing - pyenv: use python 3.10.1, 3.10.0 build is broken on freebsd Version 1.2.3 (2022-12-24) -------------------------- Fixes: - create: fix --list --dry-run output for directories, #7209 - diff/recreate: normalize chunker params before comparing them, #7079 - check: fix uninitialised variable if repo is completely empty, #7034 - xattrs: improve error handling, #6988 - fix args.paths related argparsing, #6994 - archive.save(): always use metadata from stats (e.g. nfiles, size, ...), #7072 - tar_filter: recognize .tar.zst as zstd, #7093 - get_chunker: fix missing sparse=False argument, #7056 - file_integrity.py: make sure file_fd is always closed on exit - repository: cleanup(): close segment before unlinking - repository: use os.replace instead of os.rename Other changes: - remove python < 3.7 compatibility code - do not use version_tuple placeholder in setuptools_scm template - CI: fix tox4 passenv issue, #7199 - vagrant: update to python 3.9.16, use the openbsd 7.1 box - misc. test suite and docs fixes / improvements - remove deprecated --prefix from docs, #7109 - Windows: use MSYS2 for Github CI, remove Appveyor CI Version 1.2.2 (2022-08-20) -------------------------- New features: - prune/delete --checkpoint-interval=1800 and ctrl-c/SIGINT support, #6284 Fixes: - SaveFile: use a custom mkstemp with mode support, #6933, #6400, #6786. This fixes umask/mode/ACL issues (and also "chmod not supported" exceptions seen in 1.2.1) of files updated using SaveFile, e.g. the repo config. - hashindex_compact: fix eval order (check idx before use), #5899 - create --paths-from-(stdin|command): normalize paths, #6778 - secure_erase: avoid collateral damage, #6768. If a hardlink copy of a repo was made and a new repo config shall be saved, do NOT fill in random garbage before deleting the previous repo config, because that would damage the hardlink copy. - list: fix {flags:} formatting, #6081 - check: try harder to create the key, #5719 - misc commands: ctrl-c must not kill other subprocesses, #6912 - borg create with a remote repo via ssh - borg create --content-from-command - borg create --paths-from-command - (de)compression filter process of import-tar / export-tar Other changes: - deprecate --prefix, use -a / --glob-archives, see #6806 - make setuptools happy ("package would be ignored"), #6874 - fix pyproject.toml to create a fixed _version.py file, compatible with both old and new setuptools_scm version, #6875 - automate asciinema screencasts - CI: test on macOS 12 without fuse / fuse tests (too troublesome on github CI due to kernel extensions needed by macFUSE) - tests: fix test_obfuscate byte accounting - repository: add debug logging for issue #6687 - _chunker.c: fix warnings on macOS - requirements.lock.txt: use the latest cython 0.29.32 - docs: - add info on man page installation, #6894 - update archive_progress json description about "finished", #6570 - json progress_percent: some values are optional, #4074 - FAQ: full quota / full disk, #5960 - correct shell syntax for installation using git Version 1.2.1 (2022-06-06) -------------------------- Fixes: - create: skip with warning if opening the parent dir of recursion root fails, #6374 - create: fix crash. metadata stream can produce all-zero chunks, #6587 - fix crash when computing stats, escape % chars in archive name, #6500 - fix transaction rollback: use files cache filename as found in txn.active/, #6353 - import-tar: kill filter process in case of borg exceptions, #6401 #6681 - import-tar: fix mtime type bug - ensure_dir: respect umask for created directory modes, #6400 - SaveFile: respect umask for final file mode, #6400 - check archive: improve error handling for corrupt archive metadata block, make robust_iterator more robust, #4777 - pre12-meta cache: do not use the cache if want_unique is True, #6612 - fix scp-style repo url parsing for ip v6 address, #6526 - mount -o versions: give clear error msg instead of crashing. it does not make sense to request versions view if you only look at 1 archive, but the code shall not crash in that case as it did, but give a clear error msg. - show_progress: add finished=true/false to archive_progress json, #6570 - delete/prune: fix --iec mode output (decimal vs. binary units), #6606 - info: fix authenticated mode repo to show "Encrypted: No", #6462 - diff: support presence change for blkdev, chrdev and fifo items, #6615 New features: - delete: add repository id and location to prompt, #6453 - borg debug dump-repo-objs --ghost: new --segment=S --offset=O options Other changes: - support python 3.11 - allow msgpack 1.0.4, #6716 - load_key: no key is same as empty key, #6441 - give a more helpful error msg for unsupported key formats, #6561 - better error msg for defect or unsupported repo configs, #6566 - docs: - document borg 1.2 pattern matching behavior change, #6407 Make clear that absolute paths always go into the matcher as if they are relative (without leading slash). Adapt all examples accordingly. - authentication primitives: improved security and performance infos - mention BORG_FILES_CACHE_SUFFIX as alternative to BORG_FILES_CACHE_TTL, #5602 - FAQ: add a hint about --debug-topic=files_cache - improve borg check --max-duration description - fix values of TAG bytes, #6515 - borg compact --cleanup-commits also runs a normal compaction, #6324 - virtualization speed tips - recommend umask for passphrase file perms - borg 1.2 is security supported - update link to ubuntu packages, #6485 - use --numeric-ids in pull mode docs - remove blake2 docs, blake2 code not bundled any more, #6371 - clarify on-disk order and size of segment file log entry fields, #6357 - docs building: do not transform --/--- to unicode dashes - tests: - check that borg does not require pytest for normal usage, fixes #6563 - fix OpenBSD symlink mode test failure, #2055 - vagrant: - darwin64: remove fakeroot, #6314 - update development.lock.txt - use pyinstaller 4.10 and python 3.9.13 for binary build - upgrade VMCPUS and xdistn from 4 to 16, maybe this speeds up the tests - crypto: - use hmac.compare_digest instead of ==, #6470 - hmac_sha256: replace own cython wrapper code by hmac.digest python stdlib (since py38) - hmac and blake2b minor optimizations and cleanups - removed some unused crypto related code, #6472 - avoid losing the key (potential use-after-free). this never could happen in 1.2 due to the way we use the code. The issue was discovered in master after other changes, so we also "fixed" it here before it bites us. - setup / build: - add pyproject.toml, fix sys.path, #6466 - setuptools_scm: also require it via pyproject.toml - allow extra compiler flags for every extension build - fix misc. C / Cython compiler warnings, deprecation warnings - fix zstd.h include for bundled zstd, #6369 - source using python 3.8 features: ``pyupgrade --py38-plus ./**/*.py`` Version 1.2.0 (2022-02-22 22:02:22 :-) -------------------------------------- Fixes: - diff: reduce memory consumption, fix is_hardlink_master, #6295 - compact: fix / improve freeable / freed space log output - derive really freed space from quota use before/after, #5679 - do not say "freeable", but "maybe freeable" (based on hint, unsure) - fix race conditions in internal SaveFile function, #6306 #6028 - implement internal safe_unlink (was: truncate_and_unlink) function more safely: usually it does not truncate any more, only under "disk full" circumstances and only if there is only one hardlink. see: https://github.com/borgbackup/borg/discussions/6286 Other changes: - info: use a pre12-meta cache to accelerate stats for borg < 1.2 archives. the first time borg info is invoked on a borg 1.1 repo, it can take a rather long time computing and caching some stats values for 1.1 archives, which borg 1.2 archives have in their archive metadata structure. be patient, esp. if you have lots of old archives. following invocations are much faster due to the cache. related change: add archive name to calc_stats progress display. - docs: - add borg 1.2 upgrade notes, #6217 - link to borg placeholders and borg patterns help - init: explain the encryption modes better - clarify usage of patternfile roots - put import-tar docs into same file as export-tar docs - explain the difference between a path that ends with or without a slash, #6297 Version 1.2.0rc1 (2022-02-05) ----------------------------- Fixes: - repo::archive location placeholder expansion fixes, #5826, #5998 - repository: fix intermediate commits, shall be at end of current segment - delete: don't commit if nothing was deleted, avoid cache sync, #6060 - argument parsing: accept some options only once, #6026 - disallow overwriting of existing keyfiles on init, #6036 - if ensure_dir() fails, give more informative error message, #5952 New features: - delete --force: do not ask when deleting a repo, #5941 Other changes: - requirements: exclude broken or incompatible-with-pyinstaller setuptools - add a requirements.d/development.lock.txt and use it for vagrant - tests: - added nonce-related tests - refactor: remove assert_true - vagrant: macos box tuning, netbsd box fixes, #5370, #5922 - docs: - update install docs / requirements docs, #6180 - borg mount / FUSE "versions" view is not experimental any more - --pattern* is not experimental any more, #6134 - impact of deleting path/to/repo/nonce, #5858 - key export: add examples, #6204 - ~/.config/borg/keys is not used for repokey keys, #6107 - excluded parent dir's metadata can't restore Version 1.2.0b4 (2022-01-23) ---------------------------- Fixes: - create: fix passing device nodes and symlinks to --paths-from-stdin, #6009 - create --dry-run: fix display of kept tagfile, #5834 - check --repair: fix missing parameter in "did not consistently fail" msg, #5822 - fix hardlinkable file type check, #6037 - list: remove placeholders for shake_* hashes, #6082 - prune: handle case of calling prune_split when there are no archives, #6015 - benchmark crud: make sure cleanup of borg-test-data files/dir happens, #5630 - do not show archive name in repository-related error msgs, #6014 - prettier error msg (no stacktrace) if exclude file is missing, #5734 - do not require BORG_CONFIG_DIR if BORG_{SECURITY,KEYS}_DIR are set, #5979 - fix pyinstaller detection for dir-mode, #5897 - atomically create the CACHE_TAG file, #6028 - deal with the SaveFile/SyncFile race, docs, see #6056 708a5853 - avoid expanding path into LHS of formatting operation + tests, #6064 #6063 - repository: quota / compactable computation fixes - info: emit repo info even if repo has 0 archives + test, #6120 New features: - check --repair: significantly speed up search for next valid object in segment, #6022 - check: add progress indicator for archive check, #5809 - create: add retry_erofs workaround for O_NOATIME issue on volume shadow copies in WSL1, #6024 - create: allow --files-cache=size (this is potentially dangerous, use on your own risk), #5686 - import-tar: implement import-tar to complement export-tar, #2233 - implement BORG_SELFTEST env variable (can be carefully used to speedup borg hosting), #5871 - key export: print key if path is '-' or not given, #6092 - list --format: Add command_line to format keys Other changes: - pypi metadata: alpha -> beta - require python 3.8+, #5975 - use pyinstaller 4.7 - allow msgpack 1.0.3 - upgrade to bundled xxhash to 0.8.1 - import-tar / export-tar: tar file related changes: - check for short tarfile extensions - add .lz4 and .zstd - fix docs about extensions and decompression commands - add github codeql analysis, #6148 - vagrant: - box updates / add new boxes / remove outdated and broken boxes - use Python 3.9.10 (incl. binary builds) and 3.10.0 - fix pyenv initialisation, #5798 - fix vagrant scp on macOS, #5921 - use macfuse instead of osxfuse - shell completions: - update shell completions to 1.1.17, #5923 - remove BORG_LIBC completion, since 9914968 borg no longer uses find_library(). - docs: - fixed readme.rst irc webchat link (we use libera chat now, not freenode) - fix exceptions thrown by `setup.py build_man` - check --repair: recommend checking hw before check --repair, #5855 - check --verify-data: clarify and document conflict with --repository-only, #5808 - serve: improve ssh forced commands docs, #6083 - list: improve docs for `borg list` --format, #6061 - list: remove --list-format from borg list - FAQ: fix manifest-timestamp path (inside security dir) - fix the broken link to .nix file - document behavior for filesystems with inconsistent inodes, #5770 - clarify user_id vs uid for fuse, #5723 - clarify pattern usage with commands, #5176 - clarify pp vs. pf pattern type, #5300 - update referenced freebsd/macOS versions used for binary build, #5942 - pull mode: add some warnings, #5827 - clarify "you will need key and passphrase" borg init warning, #4622 - add missing leading slashes in help patterns, #5857 - add info on renaming repositories, #5240 - check: add notice about defective hardware, #5753 - mention tar --compare (compare archive to fs files), #5880 - add note about grandfather-father-son backup retention policy / rotation scheme, #6006 - permissions note rewritten to make it less confusing - create github security policy - remove leftovers of BORG_HOSTNAME_IS_UNIQUE - excluded parent dir's metadata can't restore. (#6062) - if parent dir is not extracted, we do not have its metadata - clarify who starts the remote agent Version 1.2.0b3 (2021-05-12) ---------------------------- Fixes: - create: fix --progress --log-json, #4360#issuecomment-774580052 - do not load files cache for commands not using it, #5673 - fix repeated cache tag file writing bug New features: - create/recreate: print preliminary file status early, #5417 - create/extract: add --noxattrs and --noacls options, #3955 - create: verbose files cache logging via --debug-topic=files_cache, #5659 - mount: implement --numeric-ids (default: False!), #2377 - diff: add --json-lines option - info / create --stats: add --iec option to print sizes in powers of 1024. Other changes: - create: add --upload-(ratelimit|buffer), deprecate --remote-* options, #5611 - create/extract/mount: add --numeric-ids, deprecate --numeric-owner option, #5724 - config: accept non-int value for max_segment_size / storage_quota - use PyInstaller v4.3, #5671 - vagrant: use Python 3.9.5 to build binaries - tox.ini: modernize and enable execution without preinstalling deps - cleanup code style checks - get rid of distutils, use setuptools+packaging - github CI: test on Python 3.10-dev - check: missing / healed chunks: always tell chunk ID, #5704 - docs: - remove bad /var/cache exclusion in example commands, #5625 - misc. fixes and improvements, esp. for macOS - add unsafe workaround to use an old repo copy, #5722 Version 1.2.0b2 (2021-02-06) ---------------------------- Fixes: - create: do not recurse into duplicate roots, #5603 - create: only print stats if not ctrl-c'ed, fixes traceback, #5668 - extract: improve exception handling when setting xattrs, #5092. emit a warning message giving the path, xattr key and error message. continue trying to restore other xattrs and bsdflags of the same file after an exception with xattr-setting happened. - export-tar: fix memory leak with ssh: remote repository, #5568. fix potential memory leak with ssh: remote repository with partial extraction. - remove empty shadowed_segments lists, #5275 - fix bad default: manifest.archives.list(consider_checkpoints=False), fixes tracebacks / KeyErros for missing objects in ChunkIndex, #5668 New features: - create: improve sparse file support - create --sparse (detect sparse file holes) and file map support, only for the "fixed" chunker, #14 - detect all-zero chunks in read data in "buzhash" and "fixed" chunkers - cached_hash: use a small LRU cache to accelerate all-zero chunks hashing - use cached_hash also to generate all-zero replacement chunks - create --remote-buffer, add a upload buffer for remote repos, #5574 - prune: keep oldest archive when retention target not met Other changes: - use blake2 from python 3.6+ hashlib (this removes the requirement for libb2 and the bundled blake2 code) - also accept msgpack up to 1.0.2. exclude 1.0.1 though, which had some issues (not sure they affect borg). - create: add repository location to --stats output, #5491 - check: debug log the segment filename - delete: add a --list switch to borg delete, #5116 - borg debug dump-hints - implemented to e.g. to look at shadow_index - Tab completion support for additional archives for 'borg delete' - refactor: have one borg.constants.zero all-zero bytes object - refactor shadow_index updating repo.put/delete, #5661, #5636. - docs: - add another case of attempted hardlink usage - fix description of borg upgrade hardlink usage, #5518 - use HTTPS everywhere - add examples for --paths-from-stdin, --paths-from-command, --paths-separator, #5644 - fix typos/grammar - update docs for dev environment installation instructions - recommend running tests only on installed versions for setup - add badge with current status of package - vagrant: - use brew install --cask ..., #5557 - use Python 3.9.1 and PyInstaller 4.1 to build the borg binary Version 1.2.0b1 (2020-12-06) ---------------------------- Fixes: - BORG_CACHE_DIR crashing borg if empty, atomic handling of recursive directory creation, #5216 - fix --dry-run and --stats coexistence, #5415 - allow EIO with warning when trying to hardlink, #4336 - export-tar: set tar format to GNU_FORMAT explicitly, #5274 - use --timestamp for {utcnow} and {now} if given, #5189 - make timestamp helper timezone-aware New features: - create: implement --paths-from-stdin and --paths-from-command, see #5492. These switches read paths to archive from stdin. Delimiter can specified by --paths-delimiter=DELIM. Paths read will be added honoring every option but exclusion options and --one-file-system. borg won't recurse into directories. - 'obfuscate' pseudo compressor obfuscates compressed chunk size in repo - add pyfuse3 (successor of llfuse) as an alternative lowlevel fuse implementation to llfuse (deprecated), #5407. FUSE implementation can be switched via env var BORG_FUSE_IMPL. - allow appending to the files cache filename with BORG_FILES_CACHE_SUFFIX - create: implement --stdin-mode, --stdin-user and --stdin-group, #5333 Other changes: - split recursive directory walking/processing into directory walking and item processing. - fix warning by importing setuptools before distutils. - debug info: include infos about FUSE implementation, #5546 - testing: - add a test for the hashindex corruption bug, #5531 #4829 - move away from travis-ci, use github actions, #5528 #5467 - test both on fuse2 and fuse3 - upload coverage reports to codecov - fix spurious failure in test_cache_files, #5438 - add tests for Location.with_timestamp - tox: add a non-fuse env to the envlist - vagrant: - use python 3.7.latest and pyinstaller 4.0 for binary creation - pyinstaller: compute basepath from spec file location - vagrant: updates/fixes for archlinux box, #5543 - docs: - "filename with spaces" example added to exclude file, #5236 - add a hint about sleeping computer, #5301 - how to adjust macOS >= Catalina security settings, #5303 - process/policy for adding new compression algorithms - updated docs about hacked backup client, #5480 - improve ansible deployment docs, make it more generic - how to approach borg speed issues, give speed example, #5371 - fix mathematical inaccuracy about chunk size, #5336 - add example for excluding content using --pattern cli option - clarify borg create's '--one-file-system' option, #4009 - improve docs/FAQ about append-only remote repos, #5497 - fix reST markup issues, labels - add infos about contributor retirement status Version 1.2.0a9 (2020-10-05) ---------------------------- Fixes: - fix memory leak related to preloading, #5202 - check --repair: fix potential data loss, #5325 - persist shadow_index in between borg runs, #4830 - fix hardlinked CACHEDIR.TAG processing, #4911 - --read-special: .part files also should be regular files, #5217 - allow server side enforcing of umask, --umask is for the local borg process only (see docs), #4947 - exit with 128 + signal number, #5161 - borg config --list does not show last_segment_checked, #5159 - locking: - fix ExclusiveLock race condition bug, #4923 - fix race condition in lock migration, #4953 - fix locking on openindiana, #5271 New features: - --content-from-command: create archive using stdout of given command, #5174 - allow key-import + BORG_KEY_FILE to create key files - build directory-based binary for macOS to avoid Gatekeeper delays Other changes: - upgrade bundled zstd to 1.4.5 - upgrade bundled xxhash to 0.8.0, #5362 - if self test fails, also point to OS and hardware, #5334 - misc. shell completions fixes/updates, rewrite zsh completion - prettier error message when archive gets too big, #5307 - stop relying on `false` exiting with status code 1 - rephrase some warnings, #5164 - parseformat: unnecessary calls removed, #5169 - testing: - enable Python3.9 env for test suite and VMs, #5373 - drop python 3.5, #5344 - misc. vagrant fixes/updates - misc. testing fixes, #5196 - docs: - add ssh-agent pull backup method to doc, #5288 - mention double --force in prune docs - update Homebrew install instructions, #5185 - better description of how cache and rebuilds of it work and how the workaround applies to that - point to borg create --list item flags in recreate usage, #5165 - add a note to create from stdin regarding files cache, #5180 - add security faq explaining AES-CTR crypto issues, #5254 - clarify --exclude-if-present in recreate, #5193 - add socat pull mode, #5150, #900 - move content of resources doc page to community project, #2088 - explain hash collision, #4884 - clarify --recompress option, #5154 Version 1.2.0a8 (2020-04-22) ---------------------------- Fixes: - fixed potential index corruption / data loss issue due to bug in hashindex_set, #4829. Please read and follow the more detailed notes close to the top of this document. - fix crash when upgrading erroneous hints file, #4922 - commit-time free space calc: ignore bad compact map entries, #4796 - info: if the archive doesn't exist, print a pretty message, #4793 - --prefix / -P: fix processing, avoid argparse issue, #4769 - ignore EACCES (errno 13) when hardlinking, #4730 - add a try catch when formatting the info string, #4818 - check: do not stumble over invalid item key, #4845 - update prevalence of env vars to set config and cache paths - mount: fix FUSE low linear read speed on large files, #5032 - extract: fix confusing output of borg extract --list --strip-components, #4934 - recreate: support --timestamp option, #4745 - fix ProgressIndicator msgids (JSON output), #4935 - fuse: set f_namemax in statfs result, #2684 - accept absolute paths on windows - pyinstaller: work around issue with setuptools > 44 New features: - chunker speedup (plus regression test) - added --consider-checkpoints and related test, #4788 - added --noflags option, deprecate --nobsdflags option, #4489 - compact: add --threshold option, #4674 - mount: add birthtime to FUSE entries - support platforms with no os.link, #4901 - if we don't have os.link, we just extract another copy instead of making a hardlink. - move sync_file_range to its own extension for better platform compatibility. - new --bypass-lock option to bypass locking, e.g. for read-only repos - accept absolute paths by removing leading slashes in patterns of all sorts but re: style, #4029 - delete: new --keep-security-info option Other changes: - support msgpack 0.6.2 and 1.0.0, #5065 - upgrade bundled zstd to 1.4.4 - upgrade bundled lz4 to 1.9.2 - upgrade xxhash to 0.7.3 - require recent enough llfuse for birthtime support, #5064 - only store compressed data if the result actually is smaller, #4516 - check: improve error output for matching index size, see #4829 - ignore --stats when given with --dry-run, but continue, #4373 - replaced usage of os.statvfs with shutil.disk_usage (better cross-platform support). - fuse: remove unneeded version check and compat code, micro opts - docs: - improve description of path variables - document how to completely delete data, #2929 - add FAQ about Borg config dir, #4941 - add docs about errors not printed as JSON, #4073 - update usage_general.rst.inc - added "Will move with BORG_CONFIG_DIR variable unless specified." to BORG_SECURITY_DIR info. - put BORG_SECURITY_DIR immediately below BORG_CONFIG_DIR (and moved BORG_CACHE_DIR up before them). - add paragraph regarding cache security assumptions, #4900 - tell about borg cache security precautions - add FAQ describing difference between a local repo vs. repo on a server. - document how to test exclusion patterns without performing an actual backup - create: tell that "Calculating size" time and space needs are caused by --progress - fix/improve documentation for @api decorator, #4674 - add a pull backup / push restore how-to, #1552 - fix man pages creation, #4752 - more general FAQ for backup and retain original paths, #4532 - explain difference between --exclude and --pattern, #4118 - add FAQ for preventing SSH timeout in extract, #3866 - improve password FAQ (decrease pw length, add -w 0 option to base64 to prevent line wrap), #4591 - add note about patterns and stored paths, #4160 - add upgrade of tools to pip installation how-to, #5090 - document one cause of orphaned chunks in check command, #2295 - clean up the whole check usage paragraph - FAQ: linked recommended restrictions to ssh public keys on borg servers, #4946 - fixed "doc downplays severity of Nonce reuse issue", #4883 - borg repo restore instructions needed, #3428 - new FAQ: A repo is corrupt and must be replaced with an older repo. - clarify borg init's encryption modes - native windows port: - update README_WINDOWS.rst - updated pyinstaller spec file to support windows builds - testing / CI: - improved travis config / install script, improved macOS builds - allow osx builds to fail, #4955 - Windows 10 build on Appveyor CI - vagrant: - upgrade pyinstaller to v3.5 + patch - use py369 for binary build, add py380 for tests - fix issue in stretch VM hanging at grub installation - add a debian buster and a ubuntu focal VM - update darwin box to 10.12 - upgrade FreeBSD box to 12.1 - fix debianoid virtualenv packages - use pyenv in freebsd64 VM - remove the flake8 test - darwin: avoid error if pkg is already installed - debianoid: don't interactively ask questions Version 1.2.0a7 (2019-09-07) ---------------------------- Fixes: - slave hardlinks extraction issue, see #4350 - extract: fix KeyError for "partial" extraction, #4607 - preload chunks for hardlink slaves w/o preloaded master, #4350 - fix preloading for old remote servers, #4652 - fix partial extract for hardlinked contentless file types, #4725 - Repository.open: use stat() to check for repo dir, #4695 - Repository.check_can_create_repository: use stat() to check, ~ #4695. - SecurityManager.known(): check all files, #4614 - after double-force delete, warn about necessary repair, #4704 - cope with ANY error when importing pytest into borg.testsuite, #4652 - fix invalid archive error message - setup.py: fix detection of missing Cython - filter out selinux xattrs, #4574 - location arg - should it be optional? #4541 - enable placeholder usage in --comment, #4559 - use whitelist approach for borg serve, #4097 New features: - minimal native Windows support, see windows readme (work in progress) - create: first ctrl-c (SIGINT) triggers checkpoint and abort, #4606 - new BORG_WORKAROUNDS mechanism, basesyncfile, #4710 - remove WSL autodetection. if WSL still has this problem, you need to set BORG_WORKAROUNDS=basesyncfile in the borg process environment to work around it. - support xxh64 checksum in addition to the hashlib hashes in borg list - enable placeholder usage in all extra archive arguments - enable placeholder usage in --comment, #4559 - enable placeholder usage in --glob-archives, #4495 - ability to use a system-provided version of "xxhash" - create: - changed the default behaviour to not store the atime of fs items. atime is often rather not interesting and fragile - it easily changes even if nothing else has changed and, if stored into the archive, spoils deduplication of the archive metadata stream. - if you give the --noatime option, borg will output a deprecation warning because it is currently ignored / does nothing. Please remove the --noatime option when using borg 1.2. - added a --atime option for storing files' atime into an archive Other changes: - argparser: always use REPOSITORY in metavar - do not check python/libc for borg serve, #4483 - small borg compact improvements, #4522 - compact: log freed space at INFO level - tests: - tox / travis: add testing on py38-dev - fix broken test that relied on improper zlib assumptions - pure-py msgpack warning shall not make a lot of tests fail, #4558 - rename test_mount_hardlinks to test_fuse_mount_hardlinks (master) - vagrant: add up-to-date openindiana box (py35, openssl10) - get rid of confusing coverage warning, #2069 - docs: - reiterate that 'file cache names are absolute' in FAQ, mention bind mount solution, #4738 - add restore docs, #4670 - updated docs to cover use of temp directory on remote, #4545 - add a push-style example to borg-create(1), #4613 - timestamps in the files cache are now usually ctime, #4583 - benchmark crud: clarify that space is used until compact - update documentation of borg create, corrects a mention of borg 1.1 as a future version. - fix osxfuse github link in installation docs - how to supply a passphrase, use crypto devices, #4549 - extract: document limitation "needs empty destination", #4598 - update macOS Brew link - add note about software for automating backup - compact: improve docs, - README: new URL for funding options Version 1.2.0a6 (2019-04-22) ---------------------------- Fixes: - delete / prune: consider part files correctly for stats, #4507 - fix "all archives" stats considering part files, #4329 - create: only run stat_simple_attrs() once - create: --stats does not work with --dry-run, exit with error msg, #4373 - give "invalid repo" error msg if repo config not found, #4411 New features: - display msgpack version as part of sysinfo (e.g. in tracebacks) Other changes: - docs: - sdd "SSH Configuration" section, #4493, #3988, #636, #4485 - better document borg check --max-duration, #4473 - sorted commands help in multiple steps, #4471 - testing: - travis: use py 3.5.3 and 3.6.7 on macOS to get a pyenv-based python build with openssl 1.1 - vagrant: use py 3.5.3 and 3.6.8 on darwin64 VM to build python and borg with openssl 1.1 - pytest: -v and default XDISTN to 1, #4481 Version 1.2.0a5 (2019-03-21) ---------------------------- Fixes: - warn if a file has changed while being backed up, #1750 - lrucache: regularly remove old FDs, #4427 - borg command shall terminate with rc 2 for ImportErrors, #4424 - make freebsd xattr platform code api compatible with linux, #3952 Other changes: - major setup code refactoring (especially how libraries like openssl, liblz4, libzstd, libb2 are discovered and how it falls back to code bundled with borg), new: uses pkg-config now (and needs python "pkgconfig" package installed), #1925 if you are a borg package maintainer, please try packaging this (see comments in setup.py). - Vagrantfile: add zstd, reorder, build env vars, #4444 - travis: install script improvements - update shell completions - docs: - add a sample logging.conf in docs/misc, #4380 - fix spelling errors - update requirements / install docs, #4374 Version 1.2.0a4 (2019-03-11) ---------------------------- Fixes: - do not use O_NONBLOCK for special files, like FIFOs, block and char devices when using --read-special. fixes backing up FIFOs. fixes to test. #4394 - more LibreSSL build fixes: LibreSSL has HMAC_CTX_free and HMAC_CTX_new New features: - check: incremental repo check (only checks crc32 for segment entries), #1657 borg check --repository-only --max-duration SECONDS ... - delete: timestamp for borg delete --info added, #4359 Other changes: - redo stale lock handling, #3986 drop BORG_HOSTNAME_IS_UNIQUE (please use BORG_HOST_ID if needed). borg now always assumes it has a unique host id - either automatically from fqdn plus uuid.getnode() or overridden via BORG_HOST_ID. - docs: - added Alpine Linux to distribution list - elaborate on append-only mode docs - vagrant: - darwin: new 10.12 box - freebsd: new 12.0 box - openbsd: new 6.4 box - misc. updates / fixes Version 1.2.0a3 (2019-02-26) ---------------------------- Fixes: - LibreSSL build fixes, #4403 - dummy ACL/xattr code fixes (used by OpenBSD and others), #4403 - create: fix openat/statat issues for root directory, #4405 Version 1.2.0a2 and earlier (2019-02-24) ---------------------------------------- New features: - compact: "borg compact" needs to be used to free repository space by compacting the segments (reading sparse segments, rewriting still needed data to new segments, deleting the sparse segments). Borg < 1.2 invoked compaction automatically at the end of each repository writing command. Borg >= 1.2 does not do that any more to give better speed, more control, more segment file stability (== less stuff moving to newer segments) and more robustness. See the docs about "borg compact" for more details. - "borg compact --cleanup-commits" is to cleanup the tons of 17byte long commit-only segment files caused by borg 1.1.x issue #2850. Invoke this once after upgrading (the server side) borg to 1.2. Compaction now automatically removes unneeded commit-only segment files. - prune: Show which rule was applied to keep archive, #2886 - add fixed blocksize chunker (see --chunker-params docs), #1086 Fixes: - avoid stale filehandle issues, #3265 - use more FDs, avoid race conditions on active fs, #906, #908, #1038 - add O_NOFOLLOW to base flags, #908 - compact: - require >10% freeable space in a segment, #2985 - repository compaction now automatically removes unneeded 17byte commit-only segments, #2850 - make swidth available on all posix platforms, #2667 Other changes: - repository: better speed and less stuff moving around by using separate segment files for manifest DELETEs and PUTs, #3947 - use pyinstaller v3.3.1 to build binaries - update bundled zstd code to 1.3.8, #4210 - update bundled lz4 code to 1.8.3, #4209 - msgpack: - switch to recent "msgpack" pypi pkg name, #3890 - wrap msgpack to avoid future compat complications, #3632, #2738 - support msgpack 0.6.0 and 0.6.1, #4220, #4308 - llfuse: modernize / simplify llfuse version requirements - code refactorings / internal improvements: - include size/csize/nfiles[_parts] stats into archive, #3241 - calc_stats: use archive stats metadata, if available - crypto: refactored crypto to use an AEAD style API - crypto: new AES-OCB, CHACHA20-POLY1305 - create: use less syscalls by not using a python file obj, #906, #3962 - diff: refactor the diff functionality to new ItemDiff class, #2475 - archive: create FilesystemObjectProcessors class - helpers: make a package, split into smaller modules - xattrs: move to platform package, use cython instead ctypes, #2495 - xattrs/acls/bsdflags: misc. code/api optimizations - FUSE: separate creation of filesystem from implementation of llfuse funcs, #3042 - FUSE: use unpacker.tell() instead of deprecated write_bytes, #3899 - setup.py: move build_man / build_usage code to setup_docs.py - setup.py: update to use a newer Cython/setuptools API for compiling .pyx -> .c, #3788 - use python 3.5's os.scandir / os.set_blocking - multithreading preparations (not used yet): - item.to_optr(), Item.from_optr() - fix chunker holding the GIL during blocking I/O - C code portability / basic MSC compatibility, #4147, #2677 - testing: - vagrant: new VMs for linux/bsd/darwin, most with OpenSSL 1.1 and py36 Version 1.1.18 (2022-06-05) --------------------------- Compatibility notes: - When upgrading from borg 1.0.x to 1.1.x, please note: - read all the compatibility notes for 1.1.0*, starting from 1.1.0b1. - borg upgrade: you do not need to and you also should not run it. There is one exception though: If you upgrade from an unpatched borg < 1.0.9, please read that section above: "Pre-1.0.9 manifest spoofing vulnerability (CVE-2016-10099)" - borg might ask some security-related questions once after upgrading. You can answer them either manually or via environment variable. One known case is if you use unencrypted repositories, then it will ask about a unknown unencrypted repository one time. - your first backup with 1.1.x might be significantly slower (it might completely read, chunk, hash a lot files) - this is due to the --files-cache mode change (and happens every time you change mode). You can avoid the one-time slowdown by using the pre-1.1.0rc4-compatible mode (but that is less safe for detecting changed files than the default). See the --files-cache docs for details. - 1.1.11 removes WSL autodetection (Windows 10 Subsystem for Linux). If WSL still has a problem with sync_file_range, you need to set BORG_WORKAROUNDS=basesyncfile in the borg process environment to work around the WSL issue. - 1.1.14 changes return codes due to a bug fix: In case you have scripts expecting rc == 2 for a signal exit, you need to update them to check for >= 128 (as documented since long). - 1.1.15 drops python 3.4 support, minimum requirement is 3.5 now. - 1.1.17 install_requires the "packaging" pypi package now. New features: - check --repair: significantly speed up search for next valid object in segment, #6022 - create: add retry_erofs workaround for O_NOATIME issue on volume shadow copies in WSL1, #6024 - key export: display key if path is '-' or not given, #6092 - list --format: add command_line to format keys, #6108 Fixes: - check: improve error handling for corrupt archive metadata block, make robust_iterator more robust, #4777 - diff: support presence change for blkdev, chrdev and fifo items, #6483 - diff: reduce memory consumption, fix is_hardlink_master - init: disallow overwriting of existing keyfiles - info: fix authenticated mode repo to show "Encrypted: No", #6462 - info: emit repo info even if repo has 0 archives, #6120 - list: remove placeholders for shake_* hashes, #6082 - mount -o versions: give clear error msg instead of crashing - show_progress: add finished=true/false to archive_progress json, #6570 - fix hardlinkable file type check, #6037 - do not show archive name in error msgs referring to the repository, #6023 - prettier error msg (no stacktrace) if exclude file is missing, #5734 - do not require BORG_CONFIG_DIR if BORG_{SECURITY,KEYS}_DIR are set, #5979 - atomically create the CACHE_TAG file, #6028 - deal with the SaveFile/SyncFile race, docs, see #6176 5c5b59bc9 - avoid expanding path into LHS of formatting operation + tests, #6064 #6063 - repository: quota / compactable computation fixes, #6119. This is mainly to keep the repo code in sync with borg 1.2. As borg 1.1 compacts immediately, there was not really an issue with this in 1.1. - fix transaction rollback: use files cache filename as found in txn.active, #6353 - do not load files cache for commands not using it, fixes #5673 - fix scp repo url parsing for ip v6 addrs, #6526 - repo::archive location placeholder expansion fixes, #5826, #5998 - use expanded location for log output - support placeholder expansion for BORG_REPO env var - respect umask for created directory and file modes, #6400 - safer truncate_and_unlink implementation Other changes: - upgrade bundled xxhash code to 0.8.1 - fix xxh64 related build (setup.py and post-0.8.1 patch for static_assert). The patch was required to build the bundled xxhash code on FreeBSD, see https://github.com/Cyan4973/xxHash/pull/670 - msgpack build: remove endianness macro, #6105 - update and fix shell completions - fuse: remove unneeded version check and compat code - delete --force: do not ask when deleting a repo, #5941 - delete: don't commit if nothing was deleted, avoid cache sync, #6060 - delete: add repository id and location to prompt - compact segments: improve freeable / freed space log output, #5679 - if ensure_dir() fails, give more informative error message, #5952 - load_key: no key is same as empty key, #6441 - better error msg for defect or unsupported repo configs, #6566 - use hmac.compare_digest instead of ==, #6470 - implement more standard hashindex.setdefault behaviour - remove stray punctuation from secure-erase message - add development.lock.txt, use a real python 3.5 to generate frozen reqs - setuptools 60.7.0 breaks pyinstaller, #6246 - setup.py clean2 was added to work around some setuptools customizability limitation. - allow extra compiler flags for every extension build - C code: make switch fallthrough explicit - Cython code: fix "useless trailing comma" cython warnings - requirements.lock.txt: use the latest cython 0.29.30 - fix compilation warnings: ‘PyUnicode_AsUnicode’ is deprecated - docs: - ~/.config/borg/keys is not used for repokey keys, #6107 - excluded parent dir's metadata can't restore, #6062 - permissions note rewritten to make it less confusing, #5490 - add note about grandfather-father-son backup retention policy / rotation scheme - clarify who starts the remote agent (borg serve) - test/improve pull backup docs, #5903 - document the socat pull mode described in #900 #515ß - borg serve: improve ssh forced commands docs, #6083 - improve docs for borg list --format, #6080 - fix the broken link to .nix file - clarify pattern usage with commands, #5176 - clarify user_id vs uid for fuse, #5723 - fix binary build freebsd/macOS version, #5942 - FAQ: fix manifest-timestamp path, #6016 - remove duplicate faq entries, #5926 - fix sphinx warnings, #5919 - virtualisation speed tips - fix values of TAG bytes, #6515 - recommend umask for passphrase file perms - update link to ubuntu packages, #6485 - clarify on-disk order and size of log entry fields, #6357 - do not transform --/--- to unicode dashes - improve linking inside docs, link to borg_placeholders, link to borg_patterns - use same phrasing in misc. help texts - borg init: explain the encryption modes better - explain the difference between a path that ends with or without a slash, #6297 - clarify usage of patternfile roots, #6242 - borg key export: add examples - updates about features not experimental any more: FUSE "versions" view, --pattern*, #6134 - fix/update cygwin package requirements - impact of deleting path/to/repo/nonce, #5858 - warn about tampered server nonce - mention BORG_FILES_CACHE_SUFFIX as alternative to BORG_FILES_CACHE_TTL, #5602 - add a troubleshooting note about "is not a valid repository" to the FAQ - vagrant / CI / testing: - misc. fixes and updates, new python versions - macOS on github: re-enable fuse2 testing by downgrading to older macOS, #6099 - fix OpenBSD symlink mode test failure, #2055 - use the generic/openbsd6 box - strengthen the test: we can read data w/o nonces - add tests for path/to/repo/nonce deletion - darwin64: backport some tunings from master - darwin64: remove fakeroot, #6314 - darwin64: fix vagrant scp, #5921 - darwin64: use macfuse instead of osxfuse - add ubuntu "jammy" 22.04 LTS VM - adapt memory for openindiana64 and darwin64 Version 1.1.17 (2021-07-12) --------------------------- Compatibility notes: - When upgrading from borg 1.0.x to 1.1.x, please note: - read all the compatibility notes for 1.1.0*, starting from 1.1.0b1. - borg upgrade: you do not need to and you also should not run it. There is one exception though: If you upgrade from an unpatched borg < 1.0.9, please read that section above: "Pre-1.0.9 manifest spoofing vulnerability (CVE-2016-10099)" - borg might ask some security-related questions once after upgrading. You can answer them either manually or via environment variable. One known case is if you use unencrypted repositories, then it will ask about a unknown unencrypted repository one time. - your first backup with 1.1.x might be significantly slower (it might completely read, chunk, hash a lot files) - this is due to the --files-cache mode change (and happens every time you change mode). You can avoid the one-time slowdown by using the pre-1.1.0rc4-compatible mode (but that is less safe for detecting changed files than the default). See the --files-cache docs for details. - 1.1.11 removes WSL autodetection (Windows 10 Subsystem for Linux). If WSL still has a problem with sync_file_range, you need to set BORG_WORKAROUNDS=basesyncfile in the borg process environment to work around the WSL issue. - 1.1.14 changes return codes due to a bug fix: In case you have scripts expecting rc == 2 for a signal exit, you need to update them to check for >= 128 (as documented since long). - 1.1.15 drops python 3.4 support, minimum requirement is 3.5 now. - 1.1.17 install_requires the "packaging" pypi package now. Fixes: - pyinstaller dir-mode: fix pyi detection / LIBPATH treatment, #5897 - handle crash due to kill stale lock race, #5828 - fix BORG_CACHE_DIR crashing borg if empty, #5216 - create --dry-run: fix display of kept tagfile, #5834 - fix missing parameter in "did not consistently fail" msg, #5822 - missing / healed chunks: always tell chunk ID, #5704 - benchmark: make sure cleanup happens even on exceptions, #5630 New features: - implement BORG_SELFTEST env variable, #5871. this can be used to accelerate borg startup a bit. not recommended for normal usage, but borg mass hosters with a lot of borg invocations can save some resources with this. on my laptop, this saved ~100ms cpu time (sys+user) per borg command invocation. - implement BORG_LIBC env variable to give the libc filename, #5870. you can use this if a borg does not find your libc. - check: add progress indicator for archive check. - allow --files-cache=size (not recommended, make sure you know what you do) Other changes: - Python 3.10 now officially supported! we test on py310-dev on github CI since a while and now also on the vagrant machines, so it should work ok. - github CI: test on py310 (again) - get rid of distutils, use packaging and setuptools. distutils is deprecated and gives warnings on py 3.10. - setup.py: rename "clean" to "clean2" to avoid shadowing the "clean" command. - remove libc filename fallback for the BSDs (there is no "usual" name) - cleanup flake8 checks, fix some pep8 violations. - docs building: replace deprecated function ".add_stylesheet()" for Sphinx 4 compatibility - docs: - add a hint on sleeping computer and ssh connections, #5301 - update the documentation on hacked backup client, #5480 - improve docs/FAQ about append-only remote repos, #5497 - complement the documentation for pattern files and exclude files, #5520 - "filename with spaces" example added to exclude file, #5236 note: no whitespace escaping needed, processed by borg. - add info on renaming repositories, #5240 - clarify borg check --verify-data, #5808 - add notice about defective hardware to check documentation, #5753 - add paragraph added in #5855 to utility documentation source - add missing leading slashes in help patterns, #5857 - clarify "you will need key and passphrase" borg init warning, #4622 - pull mode: add some warnings, #5827 - mention tar --compare (compare archive to fs files), #5880 - fix typos, backport of #5597 - vagrant: - add py3.7.11 for binary build, also add 3.10-dev. - use latest Cython 0.29.23 for py310 compat fixes. - more RAM for openindiana upgrade plan resolver, it just hangs (swaps?) if there is too little RAM. - fix install_pyenv to adapt to recent changes in pyenv (same as in master now). - use generic/netbsd9 box, copied from master branch. Version 1.1.16 (2021-03-23) --------------------------- Fixes: - setup.py: add special openssl prefix for Apple M1 compatibility - do not recurse into duplicate roots, #5603 - remove empty shadowed_segments lists, #5275, #5614 - fix libpython load error when borg fat binary / dir-based binary is invoked via a symlink by upgrading pyinstaller to v4.2, #5688 - config: accept non-int value (like 500M or 100G) for max_segment_size or storage_quota, #5639. please note: when setting a non-int value for this in a repo config, using the repo will require borg >= 1.1.16. New features: - bundled msgpack: drop support for old buffer protocol to support Python 3.10 - verbose files cache logging via --debug-topic=files_cache, #5659. Use this if you suspect that borg does not detect unmodified files as expected. - create/extract: add --noxattrs and --noacls option, #3955. when given with borg create, borg will not get xattrs / ACLs from input files (and thus, it will not archive xattrs / ACLs). when given with borg extract, borg will not read xattrs / ACLs from archive and will not set xattrs / ACLs on extracted files. - diff: add --json-lines option, #3765 - check: debug log segment filename - borg debug dump-hints Other changes: - Tab completion support for additional archives for 'borg delete' - repository: deduplicate code of put and delete, no functional change - tests: fix result order issue (sporadic test failure on openindiana) - vagrant: - upgrade pyinstaller to v4.2, #5671 - avoid grub-install asking interactively for device - remove the xenial box - update freebsd box to 12.1 - docs: - update macOS install instructions, #5677 - use macFUSE (not osxfuse) for Apple M1 compatibility - update docs for dev environment installation instructions, #5643 - fix grammar in faq - recommend running tests only on installed versions for setup - add link back to git-installation - remove /var/cache exclusion in example commands, #5625. This is generally a poor idea and shouldn't be promoted through examples. - add repology.org badge with current packaging status - explain hash collision - add unsafe workaround to use an old repo copy, #5722 Version 1.1.15 (2020-12-25) --------------------------- Fixes: - extract: - improve exception handling when setting xattrs, #5092. - emit a warning message giving the path, xattr key and error message. - continue trying to restore other xattrs and bsdflags of the same file after an exception with xattr-setting happened. - export-tar: - set tar format to GNU_FORMAT explicitly, #5274 - fix memory leak with ssh: remote repository, #5568 - fix potential memory leak with ssh: remote repository with partial extraction - create: fix --dry-run and --stats coexistence, #5415 - use --timestamp for {utcnow} and {now} if given, #5189 New features: - create: implement --stdin-mode, --stdin-user and --stdin-group, #5333 - allow appending the files cache filename with BORG_FILES_CACHE_SUFFIX env var Other changes: - drop python 3.4 support, minimum requirement is 3.5 now. - enable using libxxhash instead of bundled xxh64 code - update llfuse requirements (1.3.8) - set cython language_level in some files to fix warnings - allow EIO with warning when trying to hardlink - PropDict: fail early if internal_dict is not a dict - update shell completions - tests / CI - add a test for the hashindex corruption bug, #5531 #4829 - fix spurious failure in test_cache_files, #5438 - added a github ci workflow - reduce testing on travis, no macOS, no py3x-dev, #5467 - travis: use newer dists, native py on dist - vagrant: - remove jessie and trusty boxes, #5348 #5383 - pyinstaller 4.0, build on py379 - binary build on stretch64, #5348 - remove easy_install based pip installation - docs: - clarify '--one-file-system' for btrfs, #5391 - add example for excluding content using the --pattern cmd line arg - complement the documentation for pattern files and exclude files, #5524 - made ansible playbook more generic, use package instead of pacman. also change state from "latest" to "present". - complete documentation on append-only remote repos, #5497 - internals: rather talk about target size than statistics, #5336 - new compression algorithm policy, #1633 #5505 - faq: add a hint on sleeping computer, #5301 - note requirements for full disk access on macOS Catalina, #5303 - fix/improve description of borg upgrade hardlink usage, #5518 - modernize 1.1 code: - drop code/workarounds only needed to support Python 3.4 - remove workaround for pre-release py37 argparse bug - removed some outdated comments/docstrings - requirements: remove some restrictions, lock on current versions Version 1.1.14 (2020-10-07) --------------------------- Fixes: - check --repair: fix potential data loss when interrupting it, #5325 - exit with 128 + signal number (as documented) when borg is killed by a signal, #5161 - fix hardlinked CACHEDIR.TAG processing, #4911 - create --read-special: .part files also should be regular files, #5217 - llfuse dependency: choose least broken 1.3.6/1.3.7. 1.3.6 is broken on python 3.9, 1.3.7 is broken on FreeBSD. Other changes: - upgrade bundled xxhash to 0.7.4 - self test: if it fails, also point to OS and hardware, #5334 - pyinstaller: compute basepath from spec file location - prettier error message when archive gets too big, #5307 - check/recreate are not "experimental" any more (but still potentially dangerous): - recreate: remove extra confirmation - rephrase some warnings, update docs, #5164 - shell completions: - misc. updates / fixes - support repositories in fish tab completion, #5256 - complete $BORG_RECREATE_I_KNOW_WHAT_I_AM_DOING - rewrite zsh completion: - completion for almost all optional and positional arguments - completion for Borg environment variables (parameters) - use "allow/deny list" instead of "white/black list" wording - declare "allow_cache_wipe" marker in setup.cfg to avoid pytest warning - vagrant / tests: - misc. fixes / updates - use python 3.5.10 for binary build - build directory-based binaries additionally to the single file binaries - add libffi-dev, required to build python - use cryptography<3.0, more recent versions break the jessie box - test on python 3.9 - do brew update with /dev/null redirect to avoid "too much log output" on travis-ci - docs: - add ssh-agent pull backup method docs, #5288 - how to approach borg speed issues, #5371 - mention double --force in prune docs - update Homebrew install instructions, #5185 - better description of how cache and rebuilds of it work - point to borg create --list item flags in recreate usage, #5165 - add security faq explaining AES-CTR crypto issues, #5254 - add a note to create from stdin regarding files cache, #5180 - fix borg.1 manpage generation regression, #5211 - clarify how exclude options work in recreate, #5193 - add section for retired contributors - hint about not misusing private email addresses of contributors for borg support Version 1.1.13 (2020-06-06) --------------------------- Compatibility notes: - When upgrading from borg 1.0.x to 1.1.x, please note: - read all the compatibility notes for 1.1.0*, starting from 1.1.0b1. - borg upgrade: you do not need to and you also should not run it. There is one exception though: If you upgrade from an unpatched borg < 1.0.9, please read that section above: "Pre-1.0.9 manifest spoofing vulnerability (CVE-2016-10099)" - borg might ask some security-related questions once after upgrading. You can answer them either manually or via environment variable. One known case is if you use unencrypted repositories, then it will ask about a unknown unencrypted repository one time. - your first backup with 1.1.x might be significantly slower (it might completely read, chunk, hash a lot files) - this is due to the --files-cache mode change (and happens every time you change mode). You can avoid the one-time slowdown by using the pre-1.1.0rc4-compatible mode (but that is less safe for detecting changed files than the default). See the --files-cache docs for details. - 1.1.11 removes WSL autodetection (Windows 10 Subsystem for Linux). If WSL still has a problem with sync_file_range, you need to set BORG_WORKAROUNDS=basesyncfile in the borg process environment to work around the WSL issue. Fixes: - rebuilt using a current Cython version, compatible with python 3.8, #5214 Version 1.1.12 (2020-06-06) --------------------------- Fixes: - fix preload-related memory leak, #5202. - mount / borgfs (FUSE filesystem): - fix FUSE low linear read speed on large files, #5067 - fix crash on old llfuse without birthtime attrs, #5064 - accidentally we required llfuse >= 1.3. Now also old llfuse works again. - set f_namemax in statfs result, #2684 - update precedence of env vars to set config and cache paths, #4894 - correctly calculate compression ratio, taking header size into account, too New features: - --bypass-lock option to bypass locking with read-only repositories Other changes: - upgrade bundled zstd to 1.4.5 - travis: adding comments and explanations to Travis config / install script, improve macOS builds. - tests: test_delete_force: avoid sporadic test setup issues, #5196 - misc. vagrant fixes - the binary for macOS is now built on macOS 10.12 - the binaries for Linux are now built on Debian 8 "Jessie", #3761 - docs: - PlaceholderError not printed as JSON, #4073 - "How important is Borg config?", #4941 - make Sphinx warnings break docs build, #4587 - some markup / warning fixes - add "updating borgbackup.org/releases" to release checklist, #4999 - add "rendering docs" to release checklist, #5000 - clarify borg init's encryption modes - add note about patterns and stored paths, #4160 - add upgrade of tools to pip installation how-to - document one cause of orphaned chunks in check command, #2295 - linked recommended restrictions to ssh public keys on borg servers in faq, #4946 Version 1.1.11 (2020-03-08) --------------------------- Compatibility notes: - When upgrading from borg 1.0.x to 1.1.x, please note: - read all the compatibility notes for 1.1.0*, starting from 1.1.0b1. - borg upgrade: you do not need to and you also should not run it. There is one exception though: If you upgrade from an unpatched borg < 1.0.9, please read that section above: "Pre-1.0.9 manifest spoofing vulnerability (CVE-2016-10099)" - borg might ask some security-related questions once after upgrading. You can answer them either manually or via environment variable. One known case is if you use unencrypted repositories, then it will ask about a unknown unencrypted repository one time. - your first backup with 1.1.x might be significantly slower (it might completely read, chunk, hash a lot files) - this is due to the --files-cache mode change (and happens every time you change mode). You can avoid the one-time slowdown by using the pre-1.1.0rc4-compatible mode (but that is less safe for detecting changed files than the default). See the --files-cache docs for details. - 1.1.11 removes WSL autodetection (Windows 10 Subsystem for Linux). If WSL still has a problem with sync_file_range, you need to set BORG_WORKAROUNDS=basesyncfile in the borg process environment to work around the WSL issue. Fixes: - fixed potential index corruption / data loss issue due to bug in hashindex_set, #4829. Please read and follow the more detailed notes close to the top of this document. - upgrade bundled xxhash to 0.7.3, #4891. 0.7.2 is the minimum requirement for correct operations on ARMv6 in non-fixup mode, where unaligned memory accesses cause bus errors. 0.7.3 adds some speedups and libxxhash 0.7.3 even has a pkg-config file now. - upgrade bundled lz4 to 1.9.2 - upgrade bundled zstd to 1.4.4 - fix crash when upgrading erroneous hints file, #4922 - extract: - fix KeyError for "partial" extraction, #4607 - fix "partial" extract for hardlinked contentless file types, #4725 - fix preloading for old (0.xx) remote servers, #4652 - fix confusing output of borg extract --list --strip-components, #4934 - delete: after double-force delete, warn about necessary repair, #4704 - create: give invalid repo error msg if repo config not found, #4411 - mount: fix FUSE mount missing st_birthtime, #4763 #4767 - check: do not stumble over invalid item key, #4845 - info: if the archive doesn't exist, print a pretty message, #4793 - SecurityManager.known(): check all files, #4614 - Repository.open: use stat() to check for repo dir, #4695 - Repository.check_can_create_repository: use stat() to check, #4695 - fix invalid archive error message - fix optional/non-optional location arg, #4541 - commit-time free space calc: ignore bad compact map entries, #4796 - ignore EACCES (errno 13) when hardlinking the old config, #4730 - --prefix / -P: fix processing, avoid argparse issue, #4769 New features: - enable placeholder usage in all extra archive arguments - new BORG_WORKAROUNDS mechanism, basesyncfile, #4710 - recreate: support --timestamp option, #4745 - support platforms without os.link (e.g. Android with Termux), #4901. if we don't have os.link, we just extract another copy instead of making a hardlink. - support linux platforms without sync_file_range (e.g. Android 7 with Termux), #4905 Other: - ignore --stats when given with --dry-run, but continue, #4373 - add some ProgressIndicator msgids to code / fix docs, #4935 - elaborate on "Calculating size" message - argparser: always use REPOSITORY in metavar, also use more consistent help phrasing. - check: improve error output for matching index size, see #4829 - docs: - changelog: add advisory about hashindex_set bug #4829 - better describe BORG_SECURITY_DIR, BORG_CACHE_DIR, #4919 - infos about cache security assumptions, #4900 - add FAQ describing difference between a local repo vs. repo on a server. - document how to test exclusion patterns without performing an actual backup - timestamps in the files cache are now usually ctime, #4583 - fix bad reference to borg compact (does not exist in 1.1), #4660 - create: borg 1.1 is not future any more - extract: document limitation "needs empty destination", #4598 - how to supply a passphrase, use crypto devices, #4549 - fix osxfuse github link in installation docs - add example of exclude-norecurse rule in help patterns - update macOS Brew link - add note about software for automating backups, #4581 - AUTHORS: mention copyright+license for bundled msgpack - fix various code blocks in the docs, #4708 - updated docs to cover use of temp directory on remote, #4545 - add restore docs, #4670 - add a pull backup / push restore how-to, #1552 - add FAQ how to retain original paths, #4532 - explain difference between --exclude and --pattern, #4118 - add FAQs for SSH connection issues, #3866 - improve password FAQ, #4591 - reiterate that 'file cache names are absolute' in FAQ - tests: - cope with ANY error when importing pytest into borg.testsuite, #4652 - fix broken test that relied on improper zlib assumptions - test_fuse: filter out selinux xattrs, #4574 - travis / vagrant: - misc python versions removed / changed (due to openssl 1.1 compatibility) or added (3.7 and 3.8, for better borg compatibility testing) - binary building is on python 3.5.9 now - vagrant: - add new boxes: ubuntu 18.04 and 20.04, debian 10 - update boxes: openindiana, darwin, netbsd - remove old boxes: centos 6 - darwin: updated osxfuse to 3.10.4 - use debian/ubuntu pip/virtualenv packages - rather use python 3.6.2 than 3.6.0, fixes coverage/sqlite3 issue - use requirements.d/development.lock.txt to avoid compat issues - travis: - darwin: backport some install code / order from master - remove deprecated keyword "sudo" from travis config - allow osx builds to fail, #4955 this is due to travis-ci frequently being so slow that the OS X builds just fail because they exceed 50 minutes and get killed by travis. Version 1.1.10 (2019-05-16) --------------------------- Fixes: - extract: hang on partial extraction with ssh: repo, when hardlink master is not matched/extracted and borg hangs on related slave hardlink, #4350 - lrucache: regularly remove old FDs, #4427 - avoid stale filehandle issues, #3265 - freebsd: make xattr platform code api compatible with linux, #3952 - use whitelist approach for borg serve, #4097 - borg command shall terminate with rc 2 for ImportErrors, #4424 - create: only run stat_simple_attrs() once, this increases backup with lots of unchanged files performance by ~ 5%. - prune: fix incorrect borg prune --stats output with --dry-run, #4373 - key export: emit user-friendly error if repo key is exported to a directory, #4348 New features: - bundle latest supported msgpack-python release (0.5.6), remove msgpack-python from setup.py install_requires - by default we use the bundled code now. optionally, we still support using an external msgpack (see hints in setup.py), but this requires solid requirements management within distributions and is not recommended. borgbackup will break if you upgrade msgpack to an unsupported version. - display msgpack version as part of sysinfo (e.g. in tracebacks) - timestamp for borg delete --info added, #4359 - enable placeholder usage in --comment and --glob-archives, #4559, #4495 Other: - serve: do not check python/libc for borg serve, #4483 - shell completions: borg diff second archive - release scripts: signing binaries with Qubes OS support - testing: - vagrant: upgrade openbsd box to 6.4 - travis-ci: lock test env to py 3.4 compatible versions, #4343 - get rid of confusing coverage warning, #2069 - rename test_mount_hardlinks to test_fuse_mount_hardlinks, so both can be excluded by "not test_fuse". - pure-py msgpack warning shall not make a lot of tests fail, #4558 - docs: - add "SSH Configuration" section to "borg serve", #3988, #636, #4485 - README: new URL for funding options - add a sample logging.conf in docs/misc, #4380 - elaborate on append-only mode docs, #3504 - installation: added Alpine Linux to distribution list, #4415 - usage.html: only modify window.location when redirecting, #4133 - add msgpack license to docs/3rd_party/msgpack - vagrant / binary builds: - use python 3.5.7 for builds - use osxfuse 3.8.3 Version 1.1.9 (2019-02-10) -------------------------- Compatibility notes: - When upgrading from borg 1.0.x to 1.1.x, please note: - read all the compatibility notes for 1.1.0*, starting from 1.1.0b1. - borg upgrade: you do not need to and you also should not run it. There is one exception though: If you upgrade from an unpatched borg < 1.0.9, please read that section above: "Pre-1.0.9 manifest spoofing vulnerability (CVE-2016-10099)" - borg might ask some security-related questions once after upgrading. You can answer them either manually or via environment variable. One known case is if you use unencrypted repositories, then it will ask about a unknown unencrypted repository one time. - your first backup with 1.1.x might be significantly slower (it might completely read, chunk, hash a lot files) - this is due to the --files-cache mode change (and happens every time you change mode). You can avoid the one-time slowdown by using the pre-1.1.0rc4-compatible mode (but that is less safe for detecting changed files than the default). See the --files-cache docs for details. Fixes: - security fix: configure FUSE with "default_permissions", #3903 "default_permissions" is now enforced by borg by default to let the kernel check uid/gid/mode based permissions. "ignore_permissions" can be given to not enforce "default_permissions". - make "hostname" short, even on misconfigured systems, #4262 - fix free space calculation on macOS (and others?), #4289 - config: quit with error message when no key is provided, #4223 - recover_segment: handle too small segment files correctly, #4272 - correctly release memoryview, #4243 - avoid diaper pattern in configparser by opening files, #4263 - add "# cython: language_level=3" directive to .pyx files, #4214 - info: consider part files for "This archive" stats, #3522 - work around Microsoft WSL issue #645 (sync_file_range), #1961 New features: - add --rsh command line option to complement BORG_RSH env var, #1701 - init: --make-parent-dirs parent1/parent2/repo_dir, #4235 Other: - add archive name to check --repair output, #3447 - check for unsupported msgpack versions - shell completions: - new shell completions for borg 1.1.9 - more complete shell completions for borg mount -o - added shell completions for borg help - option arguments for zsh tab completion - docs: - add FAQ regarding free disk space check, #3905 - update BORG_PASSCOMMAND example and clarify variable expansion, #4249 - FAQ regarding change of compression settings, #4222 - add note about BSD flags to changelog, #4246 - improve logging in example automation script - add note about files changing during backup, #4081 - work around the backslash issue, #4280 - update release workflow using twine (docs, scripts), #4213 - add warnings on repository copies to avoid future problems, #4272 - tests: - fix the homebrew 1.9 issues on travis-ci, #4254 - fix duplicate test method name, #4311 Version 1.1.8 (2018-12-09) -------------------------- Fixes: - enforce storage quota if set by serve-command, #4093 - invalid locations: give err msg containing parsed location, #4179 - list repo: add placeholders for hostname and username, #4130 - on linux, symlinks can't have ACLs, so don't try to set any, #4044 New features: - create: added PATH::archive output on INFO log level - read a passphrase from a file descriptor specified in the BORG_PASSPHRASE_FD environment variable. Other: - docs: - option --format is required for some expensive-to-compute values for json borg list by default does not compute expensive values except when they are needed. whether they are needed is determined by the format, in standard mode as well as in --json mode. - tell that our binaries are x86/x64 amd/intel, bauerj has ARM - fixed wrong archive name pattern in CRUD benchmark help - fixed link to cachedir spec in docs, #4140 - tests: - stop using fakeroot on travis, avoids sporadic EISDIR errors, #2482 - xattr key names must start with "user." on linux - fix code so flake8 3.6 does not complain - explicitly convert environment variable to str, #4136 - fix DeprecationWarning: Flags not at the start of the expression, #4137 - support pytest4, #4172 - vagrant: - use python 3.5.6 for builds Version 1.1.7 (2018-08-11) -------------------------- Compatibility notes: - added support for Python 3.7 Fixes: - cache lock: use lock_wait everywhere to fix infinite wait, see #3968 - don't archive tagged dir when recursing an excluded dir, #3991 - py37 argparse: work around bad default in py 3.7.0a/b/rc, #3996 - py37 remove loggerDict.clear() from tearDown method, #3805 - some fixes for bugs which likely did not result in problems in practice: - fixed logic bug in platform module API version check - fixed xattr/acl function prototypes, added missing ones New features: - init: add warning to store both key and passphrase at safe place(s) - BORG_HOST_ID env var to work around all-zero MAC address issue, #3985 - borg debug dump-repo-objs --ghost (dump everything from segment files, including deleted or superseded objects or commit tags) - borg debug search-repo-objs (search in repo objects for hex bytes or strings) Other changes: - add Python 3.7 support - updated shell completions - call socket.gethostname only once - locking: better logging, add some asserts - borg debug dump-repo-objs: - filename layout improvements - use repository.scan() to get on-disk order - docs: - update installation instructions for macOS - added instructions to install fuse via homebrew - improve diff docs - added note that checkpoints inside files requires 1.1+ - add link to tempfile module - remove row/column-spanning from docs source, #4000 #3990 - tests: - fetch less data via os.urandom - add py37 env for tox - travis: add 3.7, remove 3.6-dev (we test with -dev in master) - vagrant / binary builds: - use osxfuse 3.8.2 - use own (uptodate) openindiana box Version 1.1.6 (2018-06-11) -------------------------- Compatibility notes: - 1.1.6 changes: - also allow msgpack-python 0.5.6. Fixes: - fix borg exception handling on ENOSPC error with xattrs, #3808 - prune: fix/improve overall progress display - borg config repo ... does not need cache/manifest/key, #3802 - debug dump-repo-objs should not depend on a manifest obj - pypi package: - include .coveragerc, needed by tox.ini - fix package long description, #3854 New features: - mount: add uid, gid, umask mount options - delete: - only commit once, #3823 - implement --dry-run, #3822 - check: - show progress while rebuilding missing manifest, #3787 - more --repair output - borg config --list , #3612 Other changes: - update msgpack requirement, #3753 - update bundled zstd to 1.3.4, #3745 - update bundled lz4 code to 1.8.2, #3870 - docs: - describe what BORG_LIBZSTD_PREFIX does - fix and deduplicate encryption quickstart docs, #3776 - vagrant: - FUSE for macOS: upgrade 3.7.1 to 3.8.0 - exclude macOS High Sierra upgrade on the darwin64 machine - remove borgbackup.egg-info dir in fs_init (after rsync) - use pyenv-based build/test on jessie32/62 - use local 32 and 64bit debian jessie boxes - use "vagrant" as username for new xenial box - travis OS X: use xcode 8.3 (not broken) Version 1.1.5 (2018-04-01) -------------------------- Compatibility notes: - 1.1.5 changes: - require msgpack-python >= 0.4.6 and < 0.5.0. 0.5.0+ dropped python 3.4 testing and also caused some other issues because the python package was renamed to msgpack and emitted some FutureWarning. Fixes: - create --list: fix that it was never showing M status, #3492 - create: fix timing for first checkpoint (read files cache early, init checkpoint timer after that), see #3394 - extract: set rc=1 when extracting damaged files with all-zero replacement chunks or with size inconsistencies, #3448 - diff: consider an empty file as different to a non-existing file, #3688 - files cache: improve exception handling, #3553 - ignore exceptions in scandir_inorder() caused by an implicit stat(), also remove unneeded sort, #3545 - fixed tab completion problem where a space is always added after path even when it shouldn't - build: do .h file content checks in binary mode, fixes build issue for non-ascii header files on pure-ascii locale platforms, #3544 #3639 - borgfs: fix patterns/paths processing, #3551 - config: add some validation, #3566 - repository config: add validation for max_segment_size, #3592 - set cache previous_location on load instead of save - remove platform.uname() call which caused library mismatch issues, #3732 - add exception handler around deprecated platform.linux_distribution() call - use same datetime object for {now} and {utcnow}, #3548 New features: - create: implement --stdin-name, #3533 - add chunker_params to borg archive info (--json) - BORG_SHOW_SYSINFO=no to hide system information from exceptions Other changes: - updated zsh completions for borg 1.1.4 - files cache related code cleanups - be more helpful when parsing invalid --pattern values, #3575 - be more clear in secure-erase warning message, #3591 - improve getpass user experience, #3689 - docs build: unicode problem fixed when using a py27-based sphinx - docs: - security: explicitly note what happens OUTSIDE the attack model - security: add note about combining compression and encryption - security: describe chunk size / proximity issue, #3687 - quickstart: add note about permissions, borg@localhost, #3452 - quickstart: add introduction to repositories & archives, #3620 - recreate --recompress: add missing metavar, clarify description, #3617 - improve logging docs, #3549 - add an example for --pattern usage, #3661 - clarify path semantics when matching, #3598 - link to offline documentation from README, #3502 - add docs on how to verify a signed release with GPG, #3634 - chunk seed is generated per repository (not: archive) - better formatting of CPU usage documentation, #3554 - extend append-only repo rollback docs, #3579 - tests: - fix erroneously skipped zstd compressor tests, #3606 - skip a test if argparse is broken, #3705 - vagrant: - xenial64 box now uses username 'vagrant', #3707 - move cleanup steps to fs_init, #3706 - the boxcutter wheezy boxes are 404, use local ones - update to Python 3.5.5 (for binary builds) Version 1.1.4 (2017-12-31) -------------------------- Compatibility notes: - When upgrading from borg 1.0.x to 1.1.x, please note: - read all the compatibility notes for 1.1.0*, starting from 1.1.0b1. - borg upgrade: you do not need to and you also should not run it. There is one exception though: If you upgrade from an unpatched borg < 1.0.9, please read that section above: "Pre-1.0.9 manifest spoofing vulnerability (CVE-2016-10099)" - borg might ask some security-related questions once after upgrading. You can answer them either manually or via environment variable. One known case is if you use unencrypted repositories, then it will ask about a unknown unencrypted repository one time. - your first backup with 1.1.x might be significantly slower (it might completely read, chunk, hash a lot files) - this is due to the --files-cache mode change (and happens every time you change mode). You can avoid the one-time slowdown by using the pre-1.1.0rc4-compatible mode (but that is less safe for detecting changed files than the default). See the --files-cache docs for details. - borg 1.1.4 changes: - zstd compression is new in borg 1.1.4, older borg can't handle it. - new minimum requirements for the compression libraries - if the required versions (header and lib) can't be found at build time, bundled code will be used: - added requirement: libzstd >= 1.3.0 (bundled: 1.3.2) - updated requirement: liblz4 >= 1.7.0 / r129 (bundled: 1.8.0) Fixes: - check: data corruption fix: fix for borg check --repair malfunction, #3444. See the more detailed notes close to the top of this document. - delete: also delete security dir when deleting a repo, #3427 - prune: fix building the "borg prune" man page, #3398 - init: use given --storage-quota for local repo, #3470 - init: properly quote repo path in output - fix startup delay with dns-only own fqdn resolving, #3471 New features: - added zstd compression. try it! - added placeholder {reverse-fqdn} for fqdn in reverse notation - added BORG_BASE_DIR environment variable, #3338 Other changes: - list help topics when invalid topic is requested - fix lz4 deprecation warning, requires lz4 >= 1.7.0 (r129) - add parens for C preprocessor macro argument usages (did not cause malfunction) - exclude broken pytest 3.3.0 release - updated fish/bash completions - init: more clear exception messages for borg create, #3465 - docs: - add auto-generated docs for borg config - don't generate HTML docs page for borgfs, #3404 - docs update for lz4 b2 zstd changes - add zstd to compression help, readme, docs - update requirements and install docs about bundled lz4 and zstd - refactored build of the compress and crypto.low_level extensions, #3415: - move some lib/build related code to setup_{zstd,lz4,b2}.py - bundle lz4 1.8.0 (requirement: >= 1.7.0 / r129) - bundle zstd 1.3.2 (requirement: >= 1.3.0) - blake2 was already bundled - rename BORG_LZ4_PREFIX env var to BORG_LIBLZ4_PREFIX for better consistency: we also have BORG_LIBB2_PREFIX and BORG_LIBZSTD_PREFIX now. - add prefer_system_lib* = True settings to setup.py - by default the build will prefer a shared library over the bundled code, if library and headers can be found and meet the minimum requirements. Version 1.1.3 (2017-11-27) -------------------------- Fixes: - Security Fix for CVE-2017-15914: Incorrect implementation of access controls allows remote users to override repository restrictions in Borg servers. A user able to access a remote Borg SSH server is able to circumvent access controls post-authentication. Affected releases: 1.1.0, 1.1.1, 1.1.2. Releases 1.0.x are NOT affected. - crc32: deal with unaligned buffer, add tests - this broke borg on older ARM CPUs that can not deal with unaligned 32bit memory accesses and raise a bus error in such cases. the fix might also improve performance on some CPUs as all 32bit memory accesses by the crc32 code are properly aligned now. #3317 - mount: fixed support of --consider-part-files and do not show .borg_part_N files by default in the mounted FUSE filesystem. #3347 - fixed cache/repo timestamp inconsistency message, highlight that information is obtained from security dir (deleting the cache will not bypass this error in case the user knows this is a legitimate repo). - borgfs: don't show sub-command in borgfs help, #3287 - create: show an error when --dry-run and --stats are used together, #3298 New features: - mount: added exclusion group options and paths, #2138 Reused some code to support similar options/paths as borg extract offers - making good use of these to only mount a smaller subset of dirs/files can speed up mounting a lot and also will consume way less memory. borg mount [options] repo_or_archive mountpoint path [paths...] paths: you can just give some "root paths" (like for borg extract) to only partially populate the FUSE filesystem. new options: --exclude[-from], --pattern[s-from], --strip-components - create/extract: support st_birthtime on platforms supporting it, #3272 - add "borg config" command for querying/setting/deleting config values, #3304 Other changes: - clean up and simplify packaging (only package committed files, do not install .c/.h/.pyx files) - docs: - point out tuning options for borg create, #3239 - add instructions for using ntfsclone, zerofree, #81 - move image backup-related FAQ entries to a new page - clarify key aliases for borg list --format, #3111 - mention break-lock in checkpointing FAQ entry, #3328 - document sshfs rename workaround, #3315 - add FAQ about removing files from existing archives - add FAQ about different prune policies - usage and man page for borgfs, #3216 - clarify create --stats duration vs. wall time, #3301 - clarify encrypted key format for borg key export, #3296 - update release checklist about security fixes - document good and problematic option placements, fix examples, #3356 - add note about using --nobsdflags to avoid speed penalty related to bsdflags, #3239 - move most of support section to www.borgbackup.org Version 1.1.2 (2017-11-05) -------------------------- Fixes: - fix KeyError crash when talking to borg server < 1.0.7, #3244 - extract: set bsdflags last (include immutable flag), #3263 - create: don't do stat() call on excluded-norecurse directory, fix exception handling for stat() call, #3209 - create --stats: do not count data volume twice when checkpointing, #3224 - recreate: move chunks_healthy when excluding hardlink master, #3228 - recreate: get rid of chunks_healthy when rechunking (does not match), #3218 - check: get rid of already existing not matching chunks_healthy metadata, #3218 - list: fix stdout broken pipe handling, #3245 - list/diff: remove tag-file options (not used), #3226 New features: - bash, zsh and fish shell auto-completions, see scripts/shell_completions/ - added BORG_CONFIG_DIR env var, #3083 Other changes: - docs: - clarify using a blank passphrase in keyfile mode - mention "!" (exclude-norecurse) type in "patterns" help - document to first heal before running borg recreate to re-chunk stuff, because that will have to get rid of chunks_healthy metadata. - more than 23 is not supported for CHUNK_MAX_EXP, #3115 - borg does not respect nodump flag by default any more - clarify same-filesystem requirement for borg upgrade, #2083 - update / rephrase cygwin / WSL status, #3174 - improve docs about --stats, #3260 - vagrant: openindiana new clang package Already contained in 1.1.1 (last minute fix): - arg parsing: fix fallback function, refactor, #3205. This is a fixup for #3155, which was broken on at least python <= 3.4.2. Version 1.1.1 (2017-10-22) -------------------------- Compatibility notes: - The deprecated --no-files-cache is not a global/common option any more, but only available for borg create (it is not needed for anything else). Use --files-cache=disabled instead of --no-files-cache. - The nodump flag ("do not backup this file") is not honoured any more by default because this functionality (esp. if it happened by error or unexpected) was rather confusing and unexplainable at first to users. If you want that "do not backup NODUMP-flagged files" behaviour, use: borg create --exclude-nodump ... - If you are on Linux and do not need bsdflags archived, consider using ``--nobsdflags`` with ``borg create`` to avoid additional syscalls and speed up backup creation. Fixes: - borg recreate: correctly compute part file sizes. fixes cosmetic, but annoying issue as borg check complains about size inconsistencies of part files in affected archives. you can solve that by running borg recreate on these archives, see also #3157. - bsdflags support: do not open BLK/CHR/LNK files, avoid crashes and slowness, #3130 - recreate: don't crash on attic archives w/o time_end, #3109 - don't crash on repository filesystems w/o hardlink support, #3107 - don't crash in first part of truncate_and_unlink, #3117 - fix server-side IndexError crash with clients < 1.0.7, #3192 - don't show traceback if only a global option is given, show help, #3142 - cache: use SaveFile for more safety, #3158 - init: fix wrong encryption choices in command line parser, fix missing "authenticated-blake2", #3103 - move --no-files-cache from common to borg create options, #3146 - fix detection of non-local path (failed on ..filename), #3108 - logging with fileConfig: set json attr on "borg" logger, #3114 - fix crash with relative BORG_KEY_FILE, #3197 - show excluded dir with "x" for tagged dirs / caches, #3189 New features: - create: --nobsdflags and --exclude-nodump options, #3160 - extract: --nobsdflags option, #3160 Other changes: - remove annoying hardlinked symlinks warning, #3175 - vagrant: use self-made FreeBSD 10.3 box, #3022 - travis: don't brew update, hopefully fixes #2532 - docs: - readme: -e option is required in borg 1.1 - add example showing --show-version --show-rc - use --format rather than --list-format (deprecated) in example - update docs about hardlinked symlinks limitation Version 1.1.0 (2017-10-07) -------------------------- Compatibility notes: - borg command line: do not put options in between positional arguments This sometimes works (e.g. it worked in borg 1.0.x), but can easily stop working if we make positional arguments optional (like it happened for borg create's "paths" argument in 1.1). There are also places in borg 1.0 where we do that, so it doesn't work there in general either. #3356 Good: borg create -v --stats repo::archive path Good: borg create repo::archive path -v --stats Bad: borg create repo::archive -v --stats path Fixes: - fix LD_LIBRARY_PATH restoration for subprocesses, #3077 - "auto" compression: make sure expensive compression is actually better, otherwise store lz4 compressed data we already computed. Other changes: - docs: - FAQ: we do not implement futile attempts of ETA / progress displays - manpage: fix typos, update homepage - implement simple "issue" role for manpage generation, #3075 Version 1.1.0rc4 (2017-10-01) ----------------------------- Compatibility notes: - A borg server >= 1.1.0rc4 does not support borg clients 1.1.0b3-b5. #3033 - The files cache is now controlled differently and has a new default mode: - the files cache now uses ctime by default for improved file change detection safety. You can still use mtime for more speed and less safety. - --ignore-inode is deprecated (use --files-cache=... without "inode") - --no-files-cache is deprecated (use --files-cache=disabled) New features: - --files-cache - implement files cache mode control, #911 You can now control the files cache mode using this option: --files-cache={ctime,mtime,size,inode,rechunk,disabled} (only some combinations are supported). See the docs for details. Fixes: - remote progress/logging: deal with partial lines, #2637 - remote progress: flush json mode output - fix subprocess environments, #3050 (and more) Other changes: - remove client_supports_log_v3 flag, #3033 - exclude broken Cython 0.27(.0) in requirements, #3066 - vagrant: - upgrade to FUSE for macOS 3.7.1 - use Python 3.5.4 to build the binaries - docs: - security: change-passphrase only changes the passphrase, #2990 - fixed/improved borg create --compression examples, #3034 - add note about metadata dedup and --no[ac]time, #2518 - twitter account @borgbackup now, better visible, #2948 - simplified rate limiting wrapper in FAQ Version 1.1.0rc3 (2017-09-10) ----------------------------- New features: - delete: support naming multiple archives, #2958 Fixes: - repo cleanup/write: invalidate cached FDs, #2982 - fix datetime.isoformat() microseconds issues, #2994 - recover_segment: use mmap(), lower memory needs, #2987 Other changes: - with-lock: close segment file before invoking subprocess - keymanager: don't depend on optional readline module, #2976 - docs: - fix macOS keychain integration command - show/link new screencasts in README, #2936 - document utf-8 locale requirement for json mode, #2273 - vagrant: clean up shell profile init, user name, #2977 - test_detect_attic_repo: don't test mount, #2975 - add debug logging for repository cleanup Version 1.1.0rc2 (2017-08-28) ----------------------------- Compatibility notes: - list: corrected mix-up of "isomtime" and "mtime" formats. Previously, "isomtime" was the default but produced a verbose human format, while "mtime" produced a ISO-8601-like format. The behaviours have been swapped (so "mtime" is human, "isomtime" is ISO-like), and the default is now "mtime". "isomtime" is now a real ISO-8601 format ("T" between date and time, not a space). New features: - None. Fixes: - list: fix weird mixup of mtime/isomtime - create --timestamp: set start time, #2957 - ignore corrupt files cache, #2939 - migrate locks to child PID when daemonize is used - fix exitcode of borg serve, #2910 - only compare contents when chunker params match, #2899 - umount: try fusermount, then try umount, #2863 Other changes: - JSON: use a more standard ISO 8601 datetime format, #2376 - cache: write_archive_index: truncate_and_unlink on error, #2628 - detect non-upgraded Attic repositories, #1933 - delete various nogil and threading related lines - coala / pylint related improvements - docs: - renew asciinema/screencasts, #669 - create: document exclusion through nodump, #2949 - minor formatting fixes - tar: tarpipe example - improve "with-lock" and "info" docs, #2869 - detail how to use macOS/GNOME/KDE keyrings for repo passwords, #392 - travis: only short-circuit docs-only changes for pull requests - vagrant: - netbsd: bash is already installed - fix netbsd version in PKG_PATH - add exe location to PATH when we build an exe Version 1.1.0rc1 (2017-07-24) ----------------------------- Compatibility notes: - delete: removed short option for --cache-only New features: - support borg list repo --format {comment} {bcomment} {end}, #2081 - key import: allow reading from stdin, #2760 Fixes: - with-lock: avoid creating segment files that might be overwritten later, #1867 - prune: fix checkpoints processing with --glob-archives - FUSE: versions view: keep original file extension at end, #2769 - fix --last, --first: do not accept values <= 0, fix reversed archive ordering with --last - include testsuite data (attic.tar.gz) when installing the package - use limited unpacker for outer key, for manifest (both security precautions), #2174 #2175 - fix bashism in shell scripts, #2820, #2816 - cleanup endianness detection, create _endian.h, fixes build on alpine linux, #2809 - fix crash with --no-cache-sync (give known chunk size to chunk_incref), #2853 Other changes: - FUSE: versions view: linear numbering by archive time - split up interval parsing from filtering for --keep-within, #2610 - add a basic .editorconfig, #2734 - use archive creation time as mtime for FUSE mount, #2834 - upgrade FUSE for macOS (osxfuse) from 3.5.8 to 3.6.3, #2706 - hashindex: speed up by replacing modulo with "if" to check for wraparound - coala checker / pylint: fixed requirements and .coafile, more ignores - borg upgrade: name backup directories as 'before-upgrade', #2811 - add .mailmap - some minor changes suggested by lgtm.com - docs: - better explanation of the --ignore-inode option relevance, #2800 - fix openSUSE command and add openSUSE section - simplify ssh authorized_keys file using "restrict", add legacy note, #2121 - mount: show usage of archive filters - mount: add repository example, #2462 - info: update and add examples, #2765 - prune: include example - improved style / formatting - improved/fixed segments_per_dir docs - recreate: fix wrong "remove unwanted files" example - reference list of status chars in borg recreate --filter description - update source-install docs about doc build dependencies, #2795 - cleanup installation docs - file system requirements, update segs per dir - fix checkpoints/parts reference in FAQ, #2859 - code: - hashindex: don't pass side effect into macro - crypto low_level: don't mutate local bytes() - use dash_open function to open file or "-" for stdin/stdout - archiver: argparse cleanup / refactoring - shellpattern: add match_end arg - tests: added some additional unit tests, some fixes, #2700 #2710 - vagrant: fix setup of cygwin, add Debian 9 "stretch" - travis: don't perform full travis build on docs-only changes, #2531 Version 1.1.0b6 (2017-06-18) ---------------------------- Compatibility notes: - Running "borg init" via a "borg serve --append-only" server will *not* create an append-only repository anymore. Use "borg init --append-only" to initialize an append-only repository. - Repositories in the "repokey" and "repokey-blake2" modes with an empty passphrase are now treated as unencrypted repositories for security checks (e.g. BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK). Previously there would be no prompts nor messages if an unknown repository in one of these modes with an empty passphrase was encountered. This would allow an attacker to swap a repository, if one assumed that the lack of password prompts was due to a set BORG_PASSPHRASE. Since the "trick" does not work if BORG_PASSPHRASE is set, this does generally not affect scripts. - Repositories in the "authenticated" mode are now treated as the unencrypted repositories they are. - The client-side temporary repository cache now holds unencrypted data for better speed. - borg init: removed the short form of --append-only (-a). - borg upgrade: removed the short form of --inplace (-i). New features: - reimplemented the RepositoryCache, size-limited caching of decrypted repo contents, integrity checked via xxh64. #2515 - reduced space usage of chunks.archive.d. Existing caches are migrated during a cache sync. #235 #2638 - integrity checking using xxh64 for important files used by borg, #1101: - repository: index and hints files - cache: chunks and files caches, chunks.archive.d - improve cache sync speed, #1729 - create: new --no-cache-sync option - add repository mandatory feature flags infrastructure, #1806 - Verify most operations against SecurityManager. Location, manifest timestamp and key types are now checked for almost all non-debug commands. #2487 - implement storage quotas, #2517 - serve: add --restrict-to-repository, #2589 - BORG_PASSCOMMAND: use external tool providing the key passphrase, #2573 - borg export-tar, #2519 - list: --json-lines instead of --json for archive contents, #2439 - add --debug-profile option (and also "borg debug convert-profile"), #2473 - implement --glob-archives/-a, #2448 - normalize authenticated key modes for better naming consistency: - rename "authenticated" to "authenticated-blake2" (uses blake2b) - implement "authenticated" mode (uses hmac-sha256) Fixes: - hashindex: read/write indices >2 GiB on 32bit systems, better error reporting, #2496 - repository URLs: implement IPv6 address support and also more informative error message when parsing fails. - mount: check whether llfuse is installed before asking for passphrase, #2540 - mount: do pre-mount checks before opening repository, #2541 - FUSE: - fix crash if empty (None) xattr is read, #2534 - fix read(2) caching data in metadata cache - fix negative uid/gid crash (fix crash when mounting archives of external drives made on cygwin), #2674 - redo ItemCache, on top of object cache - use decrypted cache - remove unnecessary normpaths - serve: ignore --append-only when initializing a repository (borg init), #2501 - serve: fix incorrect type of exception_short for Errors, #2513 - fix --exclude and --exclude-from recursing into directories, #2469 - init: don't allow creating nested repositories, #2563 - --json: fix encryption[mode] not being the cmdline name - remote: propagate Error.traceback correctly - fix remote logging and progress, #2241 - implement --debug-topic for remote servers - remote: restore "Remote:" prefix (as used in 1.0.x) - rpc negotiate: enable v3 log protocol only for supported clients - fix --progress and logging in general for remote - fix parse_version, add tests, #2556 - repository: truncate segments (and also some other files) before unlinking, #2557 - recreate: keep timestamps as in original archive, #2384 - recreate: if single archive is not processed, exit 2 - patterns: don't recurse with ! / --exclude for pf:, #2509 - cache sync: fix n^2 behaviour in lookup_name - extract: don't write to disk with --stdout (affected non-regular-file items), #2645 - hashindex: implement KeyError, more tests Other changes: - remote: show path in PathNotAllowed - consider repokey w/o passphrase == unencrypted, #2169 - consider authenticated mode == unencrypted, #2503 - restrict key file names, #2560 - document follow_symlinks requirements, check libc, use stat and chown with follow_symlinks=False, #2507 - support common options on the main command, #2508 - support common options on mid-level commands (e.g. borg *key* export) - make --progress a common option - increase DEFAULT_SEGMENTS_PER_DIR to 1000 - chunker: fix invalid use of types (function only used by tests) - chunker: don't do uint32_t >> 32 - FUSE: - add instrumentation (--debug and SIGUSR1/SIGINFO) - reduced memory usage for repository mounts by lazily instantiating archives - improved archive load times - info: use CacheSynchronizer & HashIndex.stats_against (better performance) - docs: - init: document --encryption as required - security: OpenSSL usage - security: used implementations; note python libraries - security: security track record of OpenSSL and msgpack - patterns: document denial of service (regex, wildcards) - init: note possible denial of service with "none" mode - init: document SHA extension is supported in OpenSSL and thus SHA is faster on AMD Ryzen than blake2b. - book: use A4 format, new builder option format. - book: create appendices - data structures: explain repository compaction - data structures: add chunk layout diagram - data structures: integrity checking - data structures: demingle cache and repo index - Attic FAQ: separate section for attic stuff - FAQ: I get an IntegrityError or similar - what now? - FAQ: Can I use Borg on SMR hard drives?, #2252 - FAQ: specify "using inline shell scripts" - add systemd warning regarding placeholders, #2543 - xattr: document API - add docs/misc/borg-data-flow data flow chart - debugging facilities - README: how to help the project, #2550 - README: add bountysource badge, #2558 - fresh new theme + tweaking - logo: vectorized (PDF and SVG) versions - frontends: use headlines - you can link to them - mark --pattern, --patterns-from as experimental - highlight experimental features in online docs - remove regex based pattern examples, #2458 - nanorst for "borg help TOPIC" and --help - split deployment - deployment: hosting repositories - deployment: automated backups to a local hard drive - development: vagrant, windows10 requirements - development: update docs remarks - split usage docs, #2627 - usage: avoid bash highlight, [options] instead of - usage: add benchmark page - helpers: truncate_and_unlink doc - don't suggest to leak BORG_PASSPHRASE - internals: columnize rather long ToC [webkit fixup] internals: manifest & feature flags - internals: more HashIndex details - internals: fix ASCII art equations - internals: edited obj graph related sections a bit - internals: layers image + description - fix way too small figures in pdf - index: disable syntax highlight (bash) - improve options formatting, fix accidental block quotes - testing / checking: - add support for using coala, #1366 - testsuite: add ArchiverCorruptionTestCase - do not test logger name, #2504 - call setup_logging after destroying logging config - testsuite.archiver: normalise pytest.raises vs. assert_raises - add test for preserved intermediate folder permissions, #2477 - key: add round-trip test - remove attic dependency of the tests, #2505 - enable remote tests on cygwin - tests: suppress tar's future timestamp warning - cache sync: add more refcount tests - repository: add tests, including corruption tests - vagrant: - control VM cpus and pytest workers via env vars VMCPUS and XDISTN - update cleaning workdir - fix openbsd shell - add OpenIndiana - packaging: - binaries: don't bundle libssl - setup.py clean to remove compiled files - fail in borg package if version metadata is very broken (setuptools_scm) - repo / code structure: - create borg.algorithms and borg.crypto packages - algorithms: rename crc32 to checksums - move patterns to module, #2469 - gitignore: complete paths for src/ excludes - cache: extract CacheConfig class - implement IntegrityCheckedFile + Detached variant, #2502 #1688 - introduce popen_with_error_handling to handle common user errors Version 1.1.0b5 (2017-04-30) ---------------------------- Compatibility notes: - BORG_HOSTNAME_IS_UNIQUE is now on by default. - removed --compression-from feature - recreate: add --recompress flag, unify --always-recompress and --recompress Fixes: - catch exception for os.link when hardlinks are not supported, #2405 - borg rename / recreate: expand placeholders, #2386 - generic support for hardlinks (files, devices, FIFOs), #2324 - extract: also create parent dir for device files, if needed, #2358 - extract: if a hardlink master is not in the to-be-extracted subset, the "x" status was not displayed for it, #2351 - embrace y2038 issue to support 32bit platforms: clamp timestamps to int32, #2347 - verify_data: fix IntegrityError handling for defect chunks, #2442 - allow excluding parent and including child, #2314 Other changes: - refactor compression decision stuff - change global compression default to lz4 as well, to be consistent with --compression defaults. - placeholders: deny access to internals and other unspecified stuff - clearer error message for unrecognized placeholder - more clear exception if borg check does not help, #2427 - vagrant: upgrade FUSE for macOS to 3.5.8, #2346 - linux binary builds: get rid of glibc 2.13 dependency, #2430 - docs: - placeholders: document escaping - serve: env vars in original commands are ignored - tell what kind of hardlinks we support - more docs about compression - LICENSE: use canonical formulation ("copyright holders and contributors" instead of "author") - document borg init behaviour via append-only borg serve, #2440 - be clear about what buzhash is used for, #2390 - add hint about chunker params, #2421 - clarify borg upgrade docs, #2436 - FAQ to explain warning when running borg check --repair, #2341 - repository file system requirements, #2080 - pre-install considerations - misc. formatting / crossref fixes - tests: - enhance travis setuptools_scm situation - add extra test for the hashindex - fix invalid param issue in benchmarks These belong to 1.1.0b4 release, but did not make it into changelog by then: - vagrant: increase memory for parallel testing - lz4 compress: lower max. buffer size, exception handling - add docstring to do_benchmark_crud - patterns help: mention path full-match in intro Version 1.1.0b4 (2017-03-27) ---------------------------- Compatibility notes: - init: the --encryption argument is mandatory now (there are several choices) - moved "borg migrate-to-repokey" to "borg key migrate-to-repokey". - "borg change-passphrase" is deprecated, use "borg key change-passphrase" instead. - the --exclude-if-present option now supports tagging a folder with any filesystem object type (file, folder, etc), instead of expecting only files as tags, #1999 - the --keep-tag-files option has been deprecated in favor of the new --keep-exclude-tags, to account for the change mentioned above. - use lz4 compression by default, #2179 New features: - JSON API to make developing frontends and automation easier (see :ref:`json_output`) - add JSON output to commands: `borg create/list/info --json ...`. - add --log-json option for structured logging output. - add JSON progress information, JSON support for confirmations (yes()). - add two new options --pattern and --patterns-from as discussed in #1406 - new path full match pattern style (pf:) for very fast matching, #2334 - add 'debug dump-manifest' and 'debug dump-archive' commands - add 'borg benchmark crud' command, #1788 - new 'borg delete --force --force' to delete severely corrupted archives, #1975 - info: show utilization of maximum archive size, #1452 - list: add dsize and dcsize keys, #2164 - paperkey.html: Add interactive html template for printing key backups. - key export: add qr html export mode - securely erase config file (which might have old encryption key), #2257 - archived file items: add size to metadata, 'borg extract' and 'borg check' do check the file size for consistency, FUSE uses precomputed size from Item. Fixes: - fix remote speed regression introduced in 1.1.0b3, #2185 - fix regression handling timestamps beyond 2262 (revert bigint removal), introduced in 1.1.0b3, #2321 - clamp (nano)second values to unproblematic range, #2304 - hashindex: rebuild hashtable if we have too little empty buckets (performance fix), #2246 - Location regex: fix bad parsing of wrong syntax - ignore posix_fadvise errors in repository.py, #2095 - borg rpc: use limited msgpack.Unpacker (security precaution), #2139 - Manifest: Make sure manifest timestamp is strictly monotonically increasing. - create: handle BackupOSError on a per-path level in one spot - create: clarify -x option / meaning of "same filesystem" - create: don't create hard link refs to failed files - archive check: detect and fix missing all-zero replacement chunks, #2180 - files cache: update inode number when --ignore-inode is used, #2226 - fix decompression exceptions crashing ``check --verify-data`` and others instead of reporting integrity error, #2224 #2221 - extract: warning for unextracted big extended attributes, #2258, #2161 - mount: umount on SIGINT/^C when in foreground - mount: handle invalid hard link refs - mount: fix huge RAM consumption when mounting a repository (saves number of archives * 8 MiB), #2308 - hashindex: detect mingw byte order #2073 - hashindex: fix wrong skip_hint on hashindex_set when encountering tombstones, the regression was introduced in #1748 - fix ChunkIndex.__contains__ assertion for big-endian archs - fix borg key/debug/benchmark crashing without subcommand, #2240 - Location: accept //servername/share/path - correct/refactor calculation of unique/non-unique chunks - extract: fix missing call to ProgressIndicator.finish - prune: fix error msg, it is --keep-within, not --within - fix "auto" compression mode bug (not compressing), #2331 - fix symlink item fs size computation, #2344 Other changes: - remote repository: improved async exception processing, #2255 #2225 - with --compression auto,C, only use C if lz4 achieves at least 3% compression - PatternMatcher: only normalize path once, #2338 - hashindex: separate endian-dependent defs from endian detection - migrate-to-repokey: ask using canonical_path() as we do everywhere else. - SyncFile: fix use of fd object after close - make LoggedIO.close_segment reentrant - creating a new segment: use "xb" mode, #2099 - redo key_creator, key_factory, centralise key knowledge, #2272 - add return code functions, #2199 - list: only load cache if needed - list: files->items, clarifications - list: add "name" key for consistency with info cmd - ArchiveFormatter: add "start" key for compatibility with "info" - RemoteRepository: account rx/tx bytes - setup.py build_usage/build_man/build_api fixes - Manifest.in: simplify, exclude .so, .dll and .orig, #2066 - FUSE: get rid of chunk accounting, st_blocks = ceil(size / blocksize). - tests: - help python development by testing 3.6-dev - test for borg delete --force - vagrant: - freebsd: some fixes, #2067 - darwin64: use osxfuse 3.5.4 for tests / to build binaries - darwin64: improve VM settings - use python 3.5.3 to build binaries, #2078 - upgrade pyinstaller from 3.1.1+ to 3.2.1 - pyinstaller: use fixed AND freshly compiled bootloader, #2002 - pyinstaller: automatically builds bootloader if missing - docs: - create really nice man pages - faq: mention --remote-ratelimit in bandwidth limit question - fix caskroom link, #2299 - docs/security: reiterate that RPC in Borg does no networking - docs/security: counter tracking, #2266 - docs/development: update merge remarks - address SSH batch mode in docs, #2202 #2270 - add warning about running build_usage on Python >3.4, #2123 - one link per distro in the installation page - improve --exclude-if-present and --keep-exclude-tags, #2268 - improve automated backup script in doc, #2214 - improve remote-path description - update docs for create -C default change (lz4) - document relative path usage, #1868 - document snapshot usage, #2178 - corrected some stuff in internals+security - internals: move toctree to after the introduction text - clarify metadata kind, manifest ops - key enc: correct / clarify some stuff, link to internals/security - datas: enc: 1.1.x mas different MACs - datas: enc: correct factual error -- no nonce involved there. - make internals.rst an index page and edit it a bit - add "Cryptography in Borg" and "Remote RPC protocol security" sections - document BORG_HOSTNAME_IS_UNIQUE, #2087 - FAQ by categories as proposed by @anarcat in #1802 - FAQ: update Which file types, attributes, etc. are *not* preserved? - development: new branching model for git repository - development: define "ours" merge strategy for auto-generated files - create: move --exclude note to main doc - create: move item flags to main doc - fix examples using borg init without -e/--encryption - list: don't print key listings in fat (html + man) - remove Python API docs (were very incomplete, build problems on RTFD) - added FAQ section about backing up root partition Version 1.1.0b3 (2017-01-15) ---------------------------- Compatibility notes: - borg init: removed the default of "--encryption/-e", #1979 This was done so users do a informed decision about -e mode. Bug fixes: - borg recreate: don't rechunkify unless explicitly told so - borg info: fixed bug when called without arguments, #1914 - borg init: fix free space check crashing if disk is full, #1821 - borg debug delete/get obj: fix wrong reference to exception - fix processing of remote ~/ and ~user/ paths (regressed since 1.1.0b1), #1759 - posix platform module: only build / import on non-win32 platforms, #2041 New features: - new CRC32 implementations that are much faster than the zlib one used previously, #1970 - add blake2b key modes (use blake2b as MAC). This links against system libb2, if possible, otherwise uses bundled code - automatically remove stale locks - set BORG_HOSTNAME_IS_UNIQUE env var to enable stale lock killing. If set, stale locks in both cache and repository are deleted. #562 #1253 - borg info : print general repo information, #1680 - borg check --first / --last / --sort / --prefix, #1663 - borg mount --first / --last / --sort / --prefix, #1542 - implement "health" item formatter key, #1749 - BORG_SECURITY_DIR to remember security related infos outside the cache. Key type, location and manifest timestamp checks now survive cache deletion. This also means that you can now delete your cache and avoid previous warnings, since Borg can still tell it's safe. - implement BORG_NEW_PASSPHRASE, #1768 Other changes: - borg recreate: - remove special-cased --dry-run - update --help - remove bloat: interruption blah, autocommit blah, resuming blah - re-use existing checkpoint functionality - archiver tests: add check_cache tool - lints refcounts - fixed cache sync performance regression from 1.1.0b1 onwards, #1940 - syncing the cache without chunks.archive.d (see :ref:`disable_archive_chunks`) now avoids any merges and is thus faster, #1940 - borg check --verify-data: faster due to linear on-disk-order scan - borg debug-xxx commands removed, we use "debug xxx" subcommands now, #1627 - improve metadata handling speed - shortcut hashindex_set by having hashindex_lookup hint about address - improve / add progress displays, #1721 - check for index vs. segment files object count mismatch - make RPC protocol more extensible: use named parameters. - RemoteRepository: misc. code cleanups / refactors - clarify cache/repository README file - docs: - quickstart: add a comment about other (remote) filesystems - quickstart: only give one possible ssh url syntax, all others are documented in usage chapter. - mention file:// - document repo URLs / archive location - clarify borg diff help, #980 - deployment: synthesize alternative --restrict-to-path example - improve cache / index docs, esp. files cache docs, #1825 - document using "git merge 1.0-maint -s recursive -X rename-threshold=20%" for avoiding troubles when merging the 1.0-maint branch into master. - tests: - FUSE tests: catch ENOTSUP on freebsd - FUSE tests: test troublesome xattrs last - fix byte range error in test, #1740 - use monkeypatch to set env vars, but only on pytest based tests. - point XDG_*_HOME to temp dirs for tests, #1714 - remove all BORG_* env vars from the outer environment Version 1.1.0b2 (2016-10-01) ---------------------------- Bug fixes: - fix incorrect preservation of delete tags, leading to "object count mismatch" on borg check, #1598. This only occurred with 1.1.0b1 (not with 1.0.x) and is normally fixed by running another borg create/delete/prune. - fix broken --progress for double-cell paths (e.g. CJK), #1624 - borg recreate: also catch SIGHUP - FUSE: - fix hardlinks in versions view, #1599 - add parameter check to ItemCache.get to make potential failures more clear New features: - Archiver, RemoteRepository: add --remote-ratelimit (send data) - borg help compression, #1582 - borg check: delete chunks with integrity errors, #1575, so they can be "repaired" immediately and maybe healed later. - archives filters concept (refactoring/unifying older code) - covers --first/--last/--prefix/--sort-by options - currently used for borg list/info/delete Other changes: - borg check --verify-data slightly tuned (use get_many()) - change {utcnow} and {now} to ISO-8601 format ("T" date/time separator) - repo check: log transaction IDs, improve object count mismatch diagnostic - Vagrantfile: use TW's fresh-bootloader pyinstaller branch - fix module names in api.rst - hashindex: bump api_version Version 1.1.0b1 (2016-08-28) ---------------------------- New features: - new commands: - borg recreate: re-create existing archives, #787 #686 #630 #70, also see #757, #770. - selectively remove files/dirs from old archives - re-compress data - re-chunkify data, e.g. to have upgraded Attic / Borg 0.xx archives deduplicate with Borg 1.x archives or to experiment with chunker-params. - borg diff: show differences between archives - borg with-lock: execute a command with the repository locked, #990 - borg create: - Flexible compression with pattern matching on path/filename, and LZ4 heuristic for deciding compressibility, #810, #1007 - visit files in inode order (better speed, esp. for large directories and rotating disks) - in-file checkpoints, #1217 - increased default checkpoint interval to 30 minutes (was 5 minutes), #896 - added uuid archive format tag, #1151 - save mountpoint directories with --one-file-system, makes system restore easier, #1033 - Linux: added support for some BSD flags, #1050 - add 'x' status for excluded paths, #814 - also means files excluded via UF_NODUMP, #1080 - borg check: - will not produce the "Checking segments" output unless new --progress option is passed, #824. - --verify-data to verify data cryptographically on the client, #975 - borg list, #751, #1179 - removed {formatkeys}, see "borg list --help" - --list-format is deprecated, use --format instead - --format now also applies to listing archives, not only archive contents, #1179 - now supports the usual [PATH [PATHS…]] syntax and excludes - new keys: csize, num_chunks, unique_chunks, NUL - supports guaranteed_available hashlib hashes (to avoid varying functionality depending on environment), which includes the SHA1 and SHA2 family as well as MD5 - borg prune: - to better visualize the "thinning out", we now list all archives in reverse time order. rephrase and reorder help text. - implement --keep-last N via --keep-secondly N, also --keep-minutely. assuming that there is not more than 1 backup archive made in 1s, --keep-last N and --keep-secondly N are equivalent, #537 - cleanup checkpoints except the latest, #1008 - borg extract: - added --progress, #1449 - Linux: limited support for BSD flags, #1050 - borg info: - output is now more similar to borg create --stats, #977 - borg mount: - provide "borgfs" wrapper for borg mount, enables usage via fstab, #743 - "versions" mount option - when used with a repository mount, this gives a merged, versioned view of the files in all archives, #729 - repository: - added progress information to commit/compaction phase (often takes some time when deleting/pruning), #1519 - automatic recovery for some forms of repository inconsistency, #858 - check free space before going forward with a commit, #1336 - improved write performance (esp. for rotating media), #985 - new IO code for Linux - raised default segment size to approx 512 MiB - improved compaction performance, #1041 - reduced client CPU load and improved performance for remote repositories, #940 - options that imply output (--show-rc, --show-version, --list, --stats, --progress) don't need -v/--info to have that output displayed, #865 - add archive comments (via borg (re)create --comment), #842 - borg list/prune/delete: also output archive id, #731 - --show-version: shows/logs the borg version, #725 - added --debug-topic for granular debug logging, #1447 - use atomic file writing/updating for configuration and key files, #1377 - BORG_KEY_FILE environment variable, #1001 - self-testing module, #970 Bug fixes: - list: fixed default output being produced if --format is given with empty parameter, #1489 - create: fixed overflowing progress line with CJK and similar characters, #1051 - prune: fixed crash if --prefix resulted in no matches, #1029 - init: clean up partial repo if passphrase input is aborted, #850 - info: quote cmdline arguments that have spaces in them - fix hardlinks failing in some cases for extracting subtrees, #761 Other changes: - replace stdlib hmac with OpenSSL, zero-copy decrypt (10-15% increase in performance of hash-lists and extract). - improved chunker performance, #1021 - open repository segment files in exclusive mode (fail-safe), #1134 - improved error logging, #1440 - Source: - pass meta-data around, #765 - move some constants to new constants module - better readability and fewer errors with namedtuples, #823 - moved source tree into src/ subdirectory, #1016 - made borg.platform a package, #1113 - removed dead crypto code, #1032 - improved and ported parts of the test suite to py.test, #912 - created data classes instead of passing dictionaries around, #981, #1158, #1161 - cleaned up imports, #1112 - Docs: - better help texts and sphinx reproduction of usage help: - Group options - Nicer list of options in Sphinx - Deduplicate 'Common options' (including --help) - chunker: added some insights by "Voltara", #903 - clarify what "deduplicated size" means - fix / update / add package list entries - added a SaltStack usage example, #956 - expanded FAQ - new contributors in AUTHORS! - Tests: - vagrant: add ubuntu/xenial 64bit - this box has still some issues - ChunkBuffer: add test for leaving partial chunk in buffer, fixes #945 Version 1.0.13 (2019-02-15) --------------------------- Please note: this is very likely the last 1.0.x release, please upgrade to 1.1.x. Bug fixes: - security fix: configure FUSE with "default_permissions", #3903. "default_permissions" is now enforced by borg by default to let the kernel check uid/gid/mode based permissions. "ignore_permissions" can be given to not enforce "default_permissions". - xattrs: fix borg exception handling on ENOSPC error, #3808. New features: - Read a passphrase from a file descriptor specified in the BORG_PASSPHRASE_FD environment variable. Other changes: - acl platform code: fix acl set return type - xattr: - add linux {list,get,set}xattr ctypes prototypes - fix darwin flistxattr ctypes prototype - testing / travis-ci: - fix the homebrew 1.9 issues on travis-ci, #4254 - travis OS X: use xcode 8.3 (not broken) - tox.ini: lock requirements - unbreak 1.0-maint on travis, fixes #4123 - vagrant: - misc. fixes - FUSE for macOS: upgrade 3.7.1 to 3.8.3 - Python: upgrade 3.5.5 to 3.5.6 - docs: - Update installation instructions for macOS - update release workflow using twine (docs, scripts), #4213 Version 1.0.12 (2018-04-08) --------------------------- Bug fixes: - repository: cleanup/write: invalidate cached FDs, tests - serve: fix exitcode, #2910 - extract: set bsdflags last (include immutable flag), #3263 - create --timestamp: set start time, #2957 - create: show excluded dir with "x" for tagged dirs / caches, #3189 - migrate locks to child PID when daemonize is used - Buffer: fix wrong thread-local storage use, #2951 - fix detection of non-local path, #3108 - fix LDLP restoration for subprocesses, #3077 - fix subprocess environments (xattr module's fakeroot version check, borg umount, BORG_PASSCOMMAND), #3050 - remote: deal with partial lines, #2637 - get rid of datetime.isoformat, use safe parse_timestamp to parse timestamps, #2994 - build: do .h file content checks in binary mode, fixes build issue for non-ascii header files on pure-ascii locale platforms, #3544 #3639 - remove platform.uname() call which caused library mismatch issues, #3732 - add exception handler around deprecated platform.linux_distribution() call Other changes: - require msgpack-python >= 0.4.6 and < 0.5.0, see #3753 - add parens for C preprocessor macro argument usages (did not cause malfunction) - ignore corrupt files cache, #2939 - replace "modulo" with "if" to check for wraparound in hashmap - keymanager: don't depend on optional readline module, #2980 - exclude broken pytest 3.3.0 release - exclude broken Cython 0.27(.0) release, #3066 - flake8: add some ignores - docs: - create: document exclusion through nodump - document good and problematic option placements, fix examples, #3356 - update docs about hardlinked symlinks limitation - faq: we do not implement futile attempts of ETA / progress displays - simplified rate limiting wrapper in FAQ - twitter account @borgbackup, #2948 - add note about metadata dedup and --no[ac]time, #2518 - change-passphrase only changes the passphrase, #2990 - clarify encrypted key format for borg key export, #3296 - document sshfs rename workaround, #3315 - update release checklist about security fixes - docs about how to verify a signed release, #3634 - chunk seed is generated per /repository/ - vagrant: - use FUSE for macOS 3.7.1 to build the macOS binary - use python 3.5.5 to build the binaries - add exe location to PATH when we build an exe - use https pypi url for wheezy - netbsd: bash is already installed - netbsd: fix netbsd version in PKG_PATH - use self-made FreeBSD 10.3 box, #3022 - backport fs_init (including related updates) from 1.1 - the boxcutter wheezy boxes are 404, use local ones - travis: - don't perform full Travis build on docs-only changes, #2531 - only short-circuit docs-only changes for pull requests Version 1.0.11 (2017-07-21) --------------------------- Bug fixes: - use limited unpacker for outer key (security precaution), #2174 - fix paperkey import bug Other changes: - change --checkpoint-interval default from 600s to 1800s, #2841. this improves efficiency for big repositories a lot. - docs: fix OpenSUSE command and add OpenSUSE section - tests: add tests for split_lstring and paperkey - vagrant: - fix openbsd shell - backport cpu/ram setup from master - add stretch64 VM Version 1.0.11rc1 (2017-06-27) ------------------------------ Bug fixes: - performance: rebuild hashtable if we have too few empty buckets, #2246. this fixes some sporadic, but severe performance breakdowns. - Archive: allocate zeros when needed, #2308 fixes huge memory usage of mount (8 MiB × number of archives) - IPv6 address support also: Location: more informative exception when parsing fails - borg single-file binary: use pyinstaller v3.2.1, #2396 this fixes that the prelink cronjob on some distros kills the borg binary by stripping away parts of it. - extract: - warning for unextracted big extended attributes, #2258 - also create parent dir for device files, if needed. - don't write to disk with --stdout, #2645 - archive check: detect and fix missing all-zero replacement chunks, #2180 - fix (de)compression exceptions, #2224 #2221 - files cache: update inode number, #2226 - borg rpc: use limited msgpack.Unpacker (security precaution), #2139 - Manifest: use limited msgpack.Unpacker (security precaution), #2175 - Location: accept //servername/share/path - fix ChunkIndex.__contains__ assertion for big-endian archs (harmless) - create: handle BackupOSError on a per-path level in one spot - fix error msg, there is no --keep-last in borg 1.0.x, #2282 - clamp (nano)second values to unproblematic range, #2304 - fuse / borg mount: - fix st_blocks to be an integer (not float) value - fix negative uid/gid crash (they could come into archives e.g. when backing up external drives under cygwin), #2674 - fix crash if empty (None) xattr is read - do pre-mount checks before opening repository - check llfuse is installed before asking for passphrase - borg rename: expand placeholders, #2386 - borg serve: fix forced command lines containing BORG_* env vars - fix error msg, it is --keep-within, not --within - fix borg key/debug/benchmark crashing without subcommand, #2240 - chunker: fix invalid use of types, don't do uint32_t >> 32 - document follow_symlinks requirements, check libc, #2507 New features: - added BORG_PASSCOMMAND environment variable, #2573 - add minimal version of in repository mandatory feature flags, #2134 This should allow us to make sure older borg versions can be cleanly prevented from doing operations that are no longer safe because of repository format evolution. This allows more fine grained control than just incrementing the manifest version. So for example a change that still allows new archives to be created but would corrupt the repository when an old version tries to delete an archive or check the repository would add the new feature to the check and delete set but leave it out of the write set. - borg delete --force --force to delete severely corrupted archives, #1975 Other changes: - embrace y2038 issue to support 32bit platforms - be more clear that this is a "beyond repair" case, #2427 - key file names: limit to 100 characters and remove colons from host name - upgrade FUSE for macOS to 3.5.8, #2346 - split up parsing and filtering for --keep-within, better error message, #2610 - docs: - fix caskroom link, #2299 - address SSH batch mode, #2202 #2270 - improve remote-path description - document snapshot usage, #2178 - document relative path usage, #1868 - one link per distro in the installation page - development: new branching model in git repository - kill api page - added FAQ section about backing up root partition - add bountysource badge, #2558 - create empty docs.txt reequirements, #2694 - README: how to help the project - note -v/--verbose requirement on affected options, #2542 - document borg init behaviour via append-only borg serve, #2440 - be clear about what buzhash is used for (chunking) and want it is not used for (deduplication)- also say already in the readme that we use a cryptohash for dedupe, so people don't worry, #2390 - add hint about chunker params to borg upgrade docs, #2421 - clarify borg upgrade docs, #2436 - quickstart: delete problematic BORG_PASSPHRASE use, #2623 - faq: specify "using inline shell scripts" - document pattern denial of service, #2624 - tests: - remove attic dependency of the tests, #2505 - travis: - enhance travis setuptools_scm situation - install fakeroot for Linux - add test for borg delete --force - enable remote tests on cygwin (the cygwin issue that caused these tests to break was fixed in cygwin at least since cygwin 2.8, maybe even since 2.7.0). - remove skipping the noatime tests on GNU/Hurd, #2710 - fix borg import issue, add comment, #2718 - include attic.tar.gz when installing the package also: add include_package_data=True Version 1.0.10 (2017-02-13) --------------------------- Bug fixes: - Manifest timestamps are now monotonically increasing, this fixes issues when the system clock jumps backwards or is set inconsistently across computers accessing the same repository, #2115 - Fixed testing regression in 1.0.10rc1 that lead to a hard dependency on py.test >= 3.0, #2112 New features: - "key export" can now generate a printable HTML page with both a QR code and a human-readable "paperkey" representation (and custom text) through the ``--qr-html`` option. The same functionality is also available through `paperkey.html `_, which is the same HTML page generated by ``--qr-html``. It works with existing "key export" files and key files. Other changes: - docs: - language clarification - "borg create --one-file-system" option does not respect mount points, but considers different file systems instead, #2141 - setup.py: build_api: sort file list for determinism Version 1.0.10rc1 (2017-01-29) ------------------------------ Bug fixes: - borg serve: fix transmission data loss of pipe writes, #1268 This affects only the cygwin platform (not Linux, BSD, OS X). - Avoid triggering an ObjectiveFS bug in xattr retrieval, #1992 - When running out of buffer memory when reading xattrs, only skip the current file, #1993 - Fixed "borg upgrade --tam" crashing with unencrypted repositories. Since :ref:`the issue ` is not relevant for unencrypted repositories, it now does nothing and prints an error, #1981. - Fixed change-passphrase crashing with unencrypted repositories, #1978 - Fixed "borg check repo::archive" indicating success if "archive" does not exist, #1997 - borg check: print non-exit-code warning if --last or --prefix aren't fulfilled - fix bad parsing of wrong repo location syntax - create: don't create hard link refs to failed files, mount: handle invalid hard link refs, #2092 - detect mingw byte order, #2073 - creating a new segment: use "xb" mode, #2099 - mount: umount on SIGINT/^C when in foreground, #2082 Other changes: - binary: use fixed AND freshly compiled pyinstaller bootloader, #2002 - xattr: ignore empty names returned by llistxattr(2) et al - Enable the fault handler: install handlers for the SIGSEGV, SIGFPE, SIGABRT, SIGBUS and SIGILL signals to dump the Python traceback. - Also print a traceback on SIGUSR2. - borg change-passphrase: print key location (simplify making a backup of it) - officially support Python 3.6 (setup.py: add Python 3.6 qualifier) - tests: - vagrant / travis / tox: add Python 3.6 based testing - vagrant: fix openbsd repo, #2042 - vagrant: fix the freebsd64 machine, #2037 #2067 - vagrant: use python 3.5.3 to build binaries, #2078 - vagrant: use osxfuse 3.5.4 for tests / to build binaries vagrant: improve darwin64 VM settings - travis: fix osxfuse install (fixes OS X testing on Travis CI) - travis: require succeeding OS X tests, #2028 - travis: use latest pythons for OS X based testing - use pytest-xdist to parallelize testing - fix xattr test race condition, #2047 - setup.cfg: fix pytest deprecation warning, #2050 - docs: - language clarification - VM backup FAQ - borg create: document how to backup stdin, #2013 - borg upgrade: fix incorrect title levels - add CVE numbers for issues fixed in 1.0.9, #2106 - fix typos (taken from Debian package patch) - remote: include data hexdump in "unexpected RPC data" error message - remote: log SSH command line at debug level - API_VERSION: use numberspaces, #2023 - remove .github from pypi package, #2051 - add pip and setuptools to requirements file, #2030 - SyncFile: fix use of fd object after close (cosmetic) - Manifest.in: simplify, exclude \*.{so,dll,orig}, #2066 - ignore posix_fadvise errors in repository.py, #2095 (works around issues with docker on ARM) - make LoggedIO.close_segment reentrant, avoid reentrance Version 1.0.9 (2016-12-20) -------------------------- Security fixes: - A flaw in the cryptographic authentication scheme in Borg allowed an attacker to spoof the manifest. See :ref:`tam_vuln` above for the steps you should take. CVE-2016-10099 was assigned to this vulnerability. - borg check: When rebuilding the manifest (which should only be needed very rarely) duplicate archive names would be handled on a "first come first serve" basis, allowing an attacker to apparently replace archives. CVE-2016-10100 was assigned to this vulnerability. Bug fixes: - borg check: - rebuild manifest if it's corrupted - skip corrupted chunks during manifest rebuild - fix TypeError in integrity error handler, #1903, #1894 - fix location parser for archives with @ char (regression introduced in 1.0.8), #1930 - fix wrong duration/timestamps if system clock jumped during a create - fix progress display not updating if system clock jumps backwards - fix checkpoint interval being incorrect if system clock jumps Other changes: - docs: - add python3-devel as a dependency for cygwin-based installation - clarify extract is relative to current directory - FAQ: fix link to changelog - markup fixes - tests: - test_get\_(cache|keys)_dir: clean env state, #1897 - get back pytest's pretty assertion failures, #1938 - setup.py build_usage: - fixed build_usage not processing all commands - fixed build_usage not generating includes for debug commands Version 1.0.9rc1 (2016-11-27) ----------------------------- Bug fixes: - files cache: fix determination of newest mtime in backup set (which is used in cache cleanup and led to wrong "A" [added] status for unchanged files in next backup), #1860. - borg check: - fix incorrectly reporting attic 0.13 and earlier archives as corrupt - handle repo w/o objects gracefully and also bail out early if repo is *completely* empty, #1815. - fix tox/pybuild in 1.0-maint - at xattr module import time, loggers are not initialized yet New features: - borg umount exposed already existing umount code via the CLI api, so users can use it, which is more consistent than using borg to mount and fusermount -u (or umount) to un-mount, #1855. - implement borg create --noatime --noctime, fixes #1853 Other changes: - docs: - display README correctly on PyPI - improve cache / index docs, esp. files cache docs, fixes #1825 - different pattern matching for --exclude, #1779 - datetime formatting examples for {now} placeholder, #1822 - clarify passphrase mode attic repo upgrade, #1854 - clarify --umask usage, #1859 - clarify how to choose PR target branch - clarify prune behavior for different archive contents, #1824 - fix PDF issues, add logo, fix authors, headings, TOC - move security verification to support section - fix links in standalone README (:ref: tags) - add link to security contact in README - add FAQ about security - move fork differences to FAQ - add more details about resource usage - tests: skip remote tests on cygwin, #1268 - travis: - allow OS X failures until the brew cask osxfuse issue is fixed - caskroom osxfuse-beta gone, it's osxfuse now (3.5.3) - vagrant: - upgrade OSXfuse / FUSE for macOS to 3.5.3 - remove llfuse from tox.ini at a central place - do not try to install llfuse on centos6 - fix FUSE test for darwin, #1546 - add windows virtual machine with cygwin - Vagrantfile cleanup / code deduplication Version 1.0.8 (2016-10-29) -------------------------- Bug fixes: - RemoteRepository: Fix busy wait in call_many, #940 New features: - implement borgmajor/borgminor/borgpatch placeholders, #1694 {borgversion} was already there (full version string). With the new placeholders you can now also get e.g. 1 or 1.0 or 1.0.8. Other changes: - avoid previous_location mismatch, #1741 due to the changed canonicalization for relative paths in PR #1711 / #1655 (implement /./ relpath hack), there would be a changed repo location warning and the user would be asked if this is ok. this would break automation and require manual intervention, which is unwanted. thus, we automatically fix the previous_location config entry, if it only changed in the expected way, but still means the same location. - docs: - deployment.rst: do not use bare variables in ansible snippet - add clarification about append-only mode, #1689 - setup.py: add comment about requiring llfuse, #1726 - update usage.rst / api.rst - repo url / archive location docs + typo fix - quickstart: add a comment about other (remote) filesystems - vagrant / tests: - no chown when rsyncing (fixes boxes w/o vagrant group) - fix FUSE permission issues on linux/freebsd, #1544 - skip FUSE test for borg binary + fakeroot - ignore security.selinux xattrs, fixes tests on centos, #1735 Version 1.0.8rc1 (2016-10-17) ----------------------------- Bug fixes: - fix signal handling (SIGINT, SIGTERM, SIGHUP), #1620 #1593 Fixes e.g. leftover lock files for quickly repeated signals (e.g. Ctrl-C Ctrl-C) or lost connections or systemd sending SIGHUP. - progress display: adapt formatting to narrow screens, do not crash, #1628 - borg create --read-special - fix crash on broken symlink, #1584. also correctly processes broken symlinks. before this regressed to a crash (5b45385) a broken symlink would've been skipped. - process_symlink: fix missing backup_io() Fixes a chmod/chown/chgrp/unlink/rename/... crash race between getting dirents and dispatching to process_symlink. - yes(): abort on wrong answers, saying so, #1622 - fixed exception borg serve raised when connection was closed before repository was opened. Add an error message for this. - fix read-from-closed-FD issue, #1551 (this seems not to get triggered in 1.0.x, but was discovered in master) - hashindex: fix iterators (always raise StopIteration when exhausted) (this seems not to get triggered in 1.0.x, but was discovered in master) - enable relative paths in ssh:// repo URLs, via /./relpath hack, #1655 - allow repo paths with colons, #1705 - update changed repo location immediately after acceptance, #1524 - fix debug get-obj / delete-obj crash if object not found and remote repo, #1684 - pyinstaller: use a spec file to build borg.exe binary, exclude osxfuse dylib on Mac OS X (avoids mismatch lib <-> driver), #1619 New features: - add "borg key export" / "borg key import" commands, #1555, so users are able to backup / restore their encryption keys more easily. Supported formats are the keyfile format used by borg internally and a special "paper" format with by line checksums for printed backups. For the paper format, the import is an interactive process which checks each line as soon as it is input. - add "borg debug-refcount-obj" to determine a repo objects' referrer counts, #1352 Other changes: - add "borg debug ..." subcommands (borg debug-* still works, but will be removed in borg 1.1) - setup.py: Add subcommand support to build_usage. - remote: change exception message for unexpected RPC data format to indicate dataflow direction. - improved messages / error reporting: - IntegrityError: add placeholder for message, so that the message we give appears not only in the traceback, but also in the (short) error message, #1572 - borg.key: include chunk id in exception msgs, #1571 - better messages for cache newer than repo, #1700 - vagrant (testing/build VMs): - upgrade OSXfuse / FUSE for macOS to 3.5.2 - update Debian Wheezy boxes, #1686 - openbsd / netbsd: use own boxes, fixes misc rsync installation and FUSE/llfuse related testing issues, #1695 #1696 #1670 #1671 #1728 - docs: - add docs for "key export" and "key import" commands, #1641 - fix inconsistency in FAQ (pv-wrapper). - fix second block in "Easy to use" section not showing on GitHub, #1576 - add bestpractices badge - link reference docs and faq about BORG_FILES_CACHE_TTL, #1561 - improve borg info --help, explain size infos, #1532 - add release signing key / security contact to README, #1560 - add contribution guidelines for developers - development.rst: add sphinx_rtd_theme to the sphinx install command - adjust border color in borg.css - add debug-info usage help file - internals.rst: fix typos - setup.py: fix build_usage to always process all commands - added docs explaining multiple --restrict-to-path flags, #1602 - add more specific warning about write-access debug commands, #1587 - clarify FAQ regarding backup of virtual machines, #1672 - tests: - work around FUSE xattr test issue with recent fakeroot - simplify repo/hashindex tests - travis: test FUSE-enabled borg, use trusty to have a recent FUSE - re-enable FUSE tests for RemoteArchiver (no deadlocks any more) - clean env for pytest based tests, #1714 - fuse_mount contextmanager: accept any options Version 1.0.7 (2016-08-19) -------------------------- Security fixes: - borg serve: fix security issue with remote repository access, #1428 If you used e.g. --restrict-to-path /path/client1/ (with or without trailing slash does not make a difference), it acted like a path prefix match using /path/client1 (note the missing trailing slash) - the code then also allowed working in e.g. /path/client13 or /path/client1000. As this could accidentally lead to major security/privacy issues depending on the paths you use, the behaviour was changed to be a strict directory match. That means --restrict-to-path /path/client1 (with or without trailing slash does not make a difference) now uses /path/client1/ internally (note the trailing slash here!) for matching and allows precisely that path AND any path below it. So, /path/client1 is allowed, /path/client1/repo1 is allowed, but not /path/client13 or /path/client1000. If you willingly used the undocumented (dangerous) previous behaviour, you may need to rearrange your --restrict-to-path paths now. We are sorry if that causes work for you, but we did not want a potentially dangerous behaviour in the software (not even using a for-backwards-compat option). Bug fixes: - fixed repeated LockTimeout exceptions when borg serve tried to write into a already write-locked repo (e.g. by a borg mount), #502 part b) This was solved by the fix for #1220 in 1.0.7rc1 already. - fix cosmetics + file leftover for "not a valid borg repository", #1490 - Cache: release lock if cache is invalid, #1501 - borg extract --strip-components: fix leak of preloaded chunk contents - Repository, when a InvalidRepository exception happens: - fix spurious, empty lock.roster - fix repo not closed cleanly New features: - implement borg debug-info, fixes #1122 (just calls already existing code via cli, same output as below tracebacks) Other changes: - skip the O_NOATIME test on GNU Hurd, fixes #1315 (this is a very minor issue and the GNU Hurd project knows the bug) - document using a clean repo to test / build the release Version 1.0.7rc2 (2016-08-13) ----------------------------- Bug fixes: - do not write objects to repository that are bigger than the allowed size, borg will reject reading them, #1451. Important: if you created archives with many millions of files or directories, please verify if you can open them successfully, e.g. try a "borg list REPO::ARCHIVE". - lz4 compression: dynamically enlarge the (de)compression buffer, the static buffer was not big enough for archives with extremely many items, #1453 - larger item metadata stream chunks, raise archive item limit by 8x, #1452 - fix untracked segments made by moved DELETEs, #1442 Impact: Previously (metadata) segments could become untracked when deleting data, these would never be cleaned up. - extended attributes (xattrs) related fixes: - fixed a race condition in xattrs querying that led to the entire file not being backed up (while logging the error, exit code = 1), #1469 - fixed a race condition in xattrs querying that led to a crash, #1462 - raise OSError including the error message derived from errno, deal with path being a integer FD Other changes: - print active env var override by default, #1467 - xattr module: refactor code, deduplicate, clean up - repository: split object size check into too small and too big - add a transaction_id assertion, so borg init on a broken (inconsistent) filesystem does not look like a coding error in borg, but points to the real problem. - explain confusing TypeError caused by compat support for old servers, #1456 - add forgotten usage help file from build_usage - refactor/unify buffer code into helpers.Buffer class, add tests - docs: - document archive limitation, #1452 - improve prune examples Version 1.0.7rc1 (2016-08-05) ----------------------------- Bug fixes: - fix repo lock deadlocks (related to lock upgrade), #1220 - catch unpacker exceptions, resync, #1351 - fix borg break-lock ignoring BORG_REPO env var, #1324 - files cache performance fixes (fixes unnecessary re-reading/chunking/ hashing of unmodified files for some use cases): - fix unintended file cache eviction, #1430 - implement BORG_FILES_CACHE_TTL, update FAQ, raise default TTL from 10 to 20, #1338 - FUSE: - cache partially read data chunks (performance), #965, #966 - always create a root dir, #1125 - use an OrderedDict for helptext, making the build reproducible, #1346 - RemoteRepository init: always call close on exceptions, #1370 (cosmetic) - ignore stdout/stderr broken pipe errors (cosmetic), #1116 New features: - better borg versions management support (useful esp. for borg servers wanting to offer multiple borg versions and for clients wanting to choose a specific server borg version), #1392: - add BORG_VERSION environment variable before executing "borg serve" via ssh - add new placeholder {borgversion} - substitute placeholders in --remote-path - borg init --append-only option (makes using the more secure append-only mode more convenient. when used remotely, this requires 1.0.7+ also on the borg server), #1291. Other changes: - Vagrantfile: - darwin64: upgrade to FUSE for macOS 3.4.1 (aka osxfuse), #1378 - xenial64: use user "ubuntu", not "vagrant" (as usual), #1331 - tests: - fix FUSE tests on OS X, #1433 - docs: - FAQ: add backup using stable filesystem names recommendation - FAQ about glibc compatibility added, #491, glibc-check improved - FAQ: 'A' unchanged file; remove ambiguous entry age sentence. - OS X: install pkg-config to build with FUSE support, fixes #1400 - add notes about shell/sudo pitfalls with env. vars, #1380 - added platform feature matrix - implement borg debug-dump-repo-objs Version 1.0.6 (2016-07-12) -------------------------- Bug fixes: - Linux: handle multiple LD_PRELOAD entries correctly, #1314, #1111 - Fix crash with unclear message if the libc is not found, #1314, #1111 Other changes: - tests: - Fixed O_NOATIME tests for Solaris and GNU Hurd, #1315 - Fixed sparse file tests for (file) systems not supporting it, #1310 - docs: - Fixed syntax highlighting, #1313 - misc docs: added data processing overview picture Version 1.0.6rc1 (2016-07-10) ----------------------------- New features: - borg check --repair: heal damaged files if missing chunks re-appear (e.g. if the previously missing chunk was added again in a later backup archive), #148. (*) Also improved logging. Bug fixes: - sync_dir: silence fsync() failing with EINVAL, #1287 Some network filesystems (like smbfs) don't support this and we use this in repository code. - borg mount (FUSE): - fix directories being shadowed when contained paths were also specified, #1295 - raise I/O Error (EIO) on damaged files (unless -o allow_damaged_files is used), #1302. (*) - borg extract: warn if a damaged file is extracted, #1299. (*) - Added some missing return code checks (ChunkIndex._add, hashindex_resize). - borg check: fix/optimize initial hash table size, avoids resize of the table. Other changes: - tests: - add more FUSE tests, #1284 - deduplicate FUSE (u)mount code - fix borg binary test issues, #862 - docs: - changelog: added release dates to older borg releases - fix some sphinx (docs generator) warnings, #881 Notes: (*) Some features depend on information (chunks_healthy list) added to item metadata when a file with missing chunks was "repaired" using all-zero replacement chunks. The chunks_healthy list is generated since borg 1.0.4, thus borg can't recognize such "repaired" (but content-damaged) files if the repair was done with an older borg version. Version 1.0.5 (2016-07-07) -------------------------- Bug fixes: - borg mount: fix FUSE crash in xattr code on Linux introduced in 1.0.4, #1282 Other changes: - backport some FAQ entries from master branch - add release helper scripts - Vagrantfile: - centos6: no FUSE, don't build binary - add xz for redhat-like dists Version 1.0.4 (2016-07-07) -------------------------- New features: - borg serve --append-only, #1168 This was included because it was a simple change (append-only functionality was already present via repository config file) and makes better security now practically usable. - BORG_REMOTE_PATH environment variable, #1258 This was included because it was a simple change (--remote-path cli option was already present) and makes borg much easier to use if you need it. - Repository: cleanup incomplete transaction on "no space left" condition. In many cases, this can avoid a 100% full repo filesystem (which is very problematic as borg always needs free space - even to delete archives). Bug fixes: - Fix wrong handling and reporting of OSErrors in borg create, #1138. This was a serious issue: in the context of "borg create", errors like repository I/O errors (e.g. disk I/O errors, ssh repo connection errors) were handled badly and did not lead to a crash (which would be good for this case, because the repo transaction would be incomplete and trigger a transaction rollback to clean up). Now, error handling for source files is cleanly separated from every other error handling, so only problematic input files are logged and skipped. - Implement fail-safe error handling for borg extract. Note that this isn't nearly as critical as the borg create error handling bug, since nothing is written to the repo. So this was "merely" misleading error reporting. - Add missing error handler in directory attr restore loop. - repo: make sure write data hits disk before the commit tag (#1236) and also sync the containing directory. - FUSE: getxattr fail must use errno.ENOATTR, #1126 (fixes Mac OS X Finder malfunction: "zero bytes" file length, access denied) - borg check --repair: do not lose information about the good/original chunks. If we do not lose the original chunk IDs list when "repairing" a file (replacing missing chunks with all-zero chunks), we have a chance to "heal" the file back into its original state later, in case the chunks re-appear (e.g. in a fresh backup). Healing is not implemented yet, see #148. - fixes for --read-special mode: - ignore known files cache, #1241 - fake regular file mode, #1214 - improve symlinks handling, #1215 - remove passphrase from subprocess environment, #1105 - Ignore empty index file (will trigger index rebuild), #1195 - add missing placeholder support for --prefix, #1027 - improve exception handling for placeholder replacement - catch and format exceptions in arg parsing - helpers: fix "undefined name 'e'" in exception handler - better error handling for missing repo manifest, #1043 - borg delete: - make it possible to delete a repo without manifest - borg delete --forced allows one to delete corrupted archives, #1139 - borg check: - make borg check work for empty repo - fix resync and msgpacked item qualifier, #1135 - rebuild_manifest: fix crash if 'name' or 'time' key were missing. - better validation of item metadata dicts, #1130 - better validation of archive metadata dicts - close the repo on exit - even if rollback did not work, #1197. This is rather cosmetic, it avoids repo closing in the destructor. - tests: - fix sparse file test, #1170 - flake8: ignore new F405, #1185 - catch "invalid argument" on cygwin, #257 - fix sparseness assertion in test prep, #1264 Other changes: - make borg build/work on OpenSSL 1.0 and 1.1, #1187 - docs / help: - fix / clarify prune help, #1143 - fix "patterns" help formatting - add missing docs / help about placeholders - resources: rename atticmatic to borgmatic - document sshd settings, #545 - more details about checkpoints, add split trick, #1171 - support docs: add freenode web chat link, #1175 - add prune visualization / example, #723 - add note that Fnmatch is default, #1247 - make clear that lzma levels > 6 are a waste of cpu cycles - add a "do not edit" note to auto-generated files, #1250 - update cygwin installation docs - repository interoperability with borg master (1.1dev) branch: - borg check: read item metadata keys from manifest, #1147 - read v2 hints files, #1235 - fix hints file "unknown version" error handling bug - tests: add tests for format_line - llfuse: update version requirement for freebsd - Vagrantfile: - use openbsd 5.9, #716 - do not install llfuse on netbsd (broken) - update OSXfuse to version 3.3.3 - use Python 3.5.2 to build the binaries - glibc compatibility checker: scripts/glibc_check.py - add .eggs to .gitignore Version 1.0.3 (2016-05-20) -------------------------- Bug fixes: - prune: avoid that checkpoints are kept and completed archives are deleted in a prune run), #997 - prune: fix commandline argument validation - some valid command lines were considered invalid (annoying, but harmless), #942 - fix capabilities extraction on Linux (set xattrs last, after chown()), #1069 - repository: fix commit tags being seen in data - when probing key files, do binary reads. avoids crash when non-borg binary files are located in borg's key files directory. - handle SIGTERM and make a clean exit - avoids orphan lock files. - repository cache: don't cache large objects (avoid using lots of temp. disk space), #1063 Other changes: - Vagrantfile: OS X: update osxfuse / install lzma package, #933 - setup.py: add check for platform_darwin.c - setup.py: on freebsd, use a llfuse release that builds ok - docs / help: - update readthedocs URLs, #991 - add missing docs for "borg break-lock", #992 - borg create help: add some words to about the archive name - borg create help: document format tags, #894 Version 1.0.2 (2016-04-16) -------------------------- Bug fixes: - fix malfunction and potential corruption on (nowadays rather rare) big-endian architectures or bi-endian archs in (rare) BE mode. #886, #889 cache resync / index merge was malfunctioning due to this, potentially leading to data loss. borg info had cosmetic issues (displayed wrong values). note: all (widespread) little-endian archs (like x86/x64) or bi-endian archs in (widespread) LE mode (like ARMEL, MIPSEL, ...) were NOT affected. - add overflow and range checks for 1st (special) uint32 of the hashindex values, switch from int32 to uint32. - fix so that refcount will never overflow, but just stick to max. value after a overflow would have occurred. - borg delete: fix --cache-only for broken caches, #874 Makes --cache-only idempotent: it won't fail if the cache is already deleted. - fixed borg create --one-file-system erroneously traversing into other filesystems (if starting fs device number was 0), #873 - workaround a bug in Linux fadvise FADV_DONTNEED, #907 Other changes: - better test coverage for hashindex, incl. overflow testing, checking correct computations so endianness issues would be discovered. - reproducible doc for ProgressIndicator*, make the build reproducible. - use latest llfuse for vagrant machines - docs: - use /path/to/repo in examples, fixes #901 - fix confusing usage of "repo" as archive name (use "arch") Version 1.0.1 (2016-04-08) -------------------------- New features: Usually there are no new features in a bugfix release, but these were added due to their high impact on security/safety/speed or because they are fixes also: - append-only mode for repositories, #809, #36 (see docs) - borg create: add --ignore-inode option to make borg detect unmodified files even if your filesystem does not have stable inode numbers (like sshfs and possibly CIFS). - add options --warning, --error, --critical for missing log levels, #826. it's not recommended to suppress warnings or errors, but the user may decide this on his own. note: --warning is not given to borg serve so a <= 1.0.0 borg will still work as server (it is not needed as it is the default). do not use --error or --critical when using a <= 1.0.0 borg server. Bug fixes: - fix silently skipping EIO, #748 - add context manager for Repository (avoid orphan repository locks), #285 - do not sleep for >60s while waiting for lock, #773 - unpack file stats before passing to FUSE - fix build on illumos - don't try to backup doors or event ports (Solaris and derivatives) - remove useless/misleading libc version display, #738 - test suite: reset exit code of persistent archiver, #844 - RemoteRepository: clean up pipe if remote open() fails - Remote: don't print tracebacks for Error exceptions handled downstream, #792 - if BORG_PASSPHRASE is present but wrong, don't prompt for password, but fail instead, #791 - ArchiveChecker: move "orphaned objects check skipped" to INFO log level, #826 - fix capitalization, add ellipses, change log level to debug for 2 messages, #798 Other changes: - update llfuse requirement, llfuse 1.0 works - update OS / dist packages on build machines, #717 - prefer showing --info over -v in usage help, #859 - docs: - fix cygwin requirements (gcc-g++) - document how to debug / file filesystem issues, #664 - fix reproducible build of api docs - RTD theme: CSS !important overwrite, #727 - Document logo font. Recreate logo png. Remove GIMP logo file. Version 1.0.0 (2016-03-05) -------------------------- The major release number change (0.x -> 1.x) indicates bigger incompatible changes, please read the compatibility notes, adapt / test your scripts and check your backup logs. Compatibility notes: - drop support for python 3.2 and 3.3, require 3.4 or 3.5, #221 #65 #490 note: we provide binaries that include python 3.5.1 and everything else needed. they are an option in case you are stuck with < 3.4 otherwise. - change encryption to be on by default (using "repokey" mode) - moved keyfile keys from ~/.borg/keys to ~/.config/borg/keys, you can either move them manually or run "borg upgrade " - remove support for --encryption=passphrase, use borg migrate-to-repokey to switch to repokey mode, #97 - remove deprecated --compression , use --compression zlib, instead in case of 0, you could also use --compression none - remove deprecated --hourly/daily/weekly/monthly/yearly use --keep-hourly/daily/weekly/monthly/yearly instead - remove deprecated --do-not-cross-mountpoints, use --one-file-system instead - disambiguate -p option, #563: - -p now is same as --progress - -P now is same as --prefix - remove deprecated "borg verify", use "borg extract --dry-run" instead - cleanup environment variable semantics, #355 the environment variables used to be "yes sayers" when set, this was conceptually generalized to "automatic answerers" and they just give their value as answer (as if you typed in that value when being asked). See the "usage" / "Environment Variables" section of the docs for details. - change the builtin default for --chunker-params, create 2MiB chunks, #343 --chunker-params new default: 19,23,21,4095 - old default: 10,23,16,4095 one of the biggest issues with borg < 1.0 (and also attic) was that it had a default target chunk size of 64kiB, thus it created a lot of chunks and thus also a huge chunk management overhead (high RAM and disk usage). please note that the new default won't change the chunks that you already have in your repository. the new big chunks do not deduplicate with the old small chunks, so expect your repo to grow at least by the size of every changed file and in the worst case (e.g. if your files cache was lost / is not used) by the size of every file (minus any compression you might use). in case you want to immediately see a much lower resource usage (RAM / disk) for chunks management, it might be better to start with a new repo than continuing in the existing repo (with an existing repo, you'ld have to wait until all archives with small chunks got pruned to see a lower resource usage). if you used the old --chunker-params default value (or if you did not use --chunker-params option at all) and you'ld like to continue using small chunks (and you accept the huge resource usage that comes with that), just explicitly use borg create --chunker-params=10,23,16,4095. - archive timestamps: the 'time' timestamp now refers to archive creation start time (was: end time), the new 'time_end' timestamp refers to archive creation end time. This might affect prune if your backups take rather long. if you give a timestamp via cli this is stored into 'time', therefore it now needs to mean archive creation start time. New features: - implement password roundtrip, #695 Bug fixes: - remote end does not need cache nor keys directories, do not create them, #701 - added retry counter for passwords, #703 Other changes: - fix compiler warnings, #697 - docs: - update README.rst to new changelog location in docs/changes.rst - add Teemu to AUTHORS - changes.rst: fix old chunker params, #698 - FAQ: how to limit bandwidth Version 1.0.0rc2 (2016-02-28) ----------------------------- New features: - format options for location: user, pid, fqdn, hostname, now, utcnow, user - borg list --list-format - borg prune -v --list enables the keep/prune list output, #658 Bug fixes: - fix _open_rb noatime handling, #657 - add a simple archivename validator, #680 - borg create --stats: show timestamps in localtime, use same labels/formatting as borg info, #651 - llfuse compatibility fixes (now compatible with: 0.40, 0.41, 0.42) Other changes: - it is now possible to use "pip install borgbackup[fuse]" to automatically install the llfuse dependency using the correct version requirement for it. you still need to care about having installed the FUSE / build related OS package first, though, so that building llfuse can succeed. - Vagrant: drop Ubuntu Precise (12.04) - does not have Python >= 3.4 - Vagrant: use pyinstaller v3.1.1 to build binaries - docs: - borg upgrade: add to docs that only LOCAL repos are supported - borg upgrade also handles borg 0.xx -> 1.0 - use pip extras or requirements file to install llfuse - fix order in release process - updated usage docs and other minor / cosmetic fixes - verified borg examples in docs, #644 - freebsd dependency installation and FUSE configuration, #649 - add example how to restore a raw device, #671 - add a hint about the dev headers needed when installing from source - add examples for delete (and handle delete after list, before prune), #656 - update example for borg create -v --stats (use iso datetime format), #663 - added example to BORG_RSH docs - "connection closed by remote": add FAQ entry and point to issue #636 Version 1.0.0rc1 (2016-02-07) ----------------------------- New features: - borg migrate-to-repokey ("passphrase" -> "repokey" encryption key mode) - implement --short for borg list REPO, #611 - implement --list for borg extract (consistency with borg create) - borg serve: overwrite client's --restrict-to-path with ssh forced command's option value (but keep everything else from the client commandline), #544 - use $XDG_CONFIG_HOME/keys for keyfile keys (~/.config/borg/keys), #515 - "borg upgrade" moves the keyfile keys to the new location - display both archive creation start and end time in "borg info", #627 Bug fixes: - normalize trailing slashes for the repository path, #606 - Cache: fix exception handling in __init__, release lock, #610 Other changes: - suppress unneeded exception context (PEP 409), simpler tracebacks - removed special code needed to deal with imperfections / incompatibilities / missing stuff in py 3.2/3.3, simplify code that can be done simpler in 3.4 - removed some version requirements that were kept on old versions because newer did not support py 3.2 any more - use some py 3.4+ stdlib code instead of own/openssl/pypi code: - use os.urandom instead of own cython openssl RAND_bytes wrapper, #493 - use hashlib.pbkdf2_hmac from py stdlib instead of own openssl wrapper - use hmac.compare_digest instead of == operator (constant time comparison) - use stat.filemode instead of homegrown code - use "mock" library from stdlib, #145 - remove borg.support (with non-broken argparse copy), it is ok in 3.4+, #358 - Vagrant: copy CHANGES.rst as symlink, #592 - cosmetic code cleanups, add flake8 to tox/travis, #4 - docs / help: - make "borg -h" output prettier, #591 - slightly rephrase prune help - add missing example for --list option of borg create - quote exclude line that includes an asterisk to prevent shell expansion - fix dead link to license - delete Ubuntu Vivid, it is not supported anymore (EOL) - OS X binary does not work for older OS X releases, #629 - borg serve's special support for forced/original ssh commands, #544 - misc. updates and fixes Version 0.30.0 (2016-01-23) --------------------------- Compatibility notes: - you may need to use -v (or --info) more often to actually see output emitted at INFO log level (because it is suppressed at the default WARNING log level). See the "general" section in the usage docs. - for borg create, you need --list (additionally to -v) to see the long file list (was needed so you can have e.g. --stats alone without the long list) - see below about BORG_DELETE_I_KNOW_WHAT_I_AM_DOING (was: BORG_CHECK_I_KNOW_WHAT_I_AM_DOING) Bug fixes: - fix crash when using borg create --dry-run --keep-tag-files, #570 - make sure teardown with cleanup happens for Cache and RepositoryCache, avoiding leftover locks and TEMP dir contents, #285 (partially), #548 - fix locking KeyError, partial fix for #502 - log stats consistently, #526 - add abbreviated weekday to timestamp format, fixes #496 - strip whitespace when loading exclusions from file - unset LD_LIBRARY_PATH before invoking ssh, fixes strange OpenSSL library version warning when using the borg binary, #514 - add some error handling/fallback for C library loading, #494 - added BORG_DELETE_I_KNOW_WHAT_I_AM_DOING for check in "borg delete", #503 - remove unused "repair" rpc method name New features: - borg create: implement exclusions using regular expression patterns. - borg create: implement inclusions using patterns. - borg extract: support patterns, #361 - support different styles for patterns: - fnmatch (`fm:` prefix, default when omitted), like borg <= 0.29. - shell (`sh:` prefix) with `*` not matching directory separators and `**/` matching 0..n directories - path prefix (`pp:` prefix, for unifying borg create pp1 pp2 into the patterns system), semantics like in borg <= 0.29 - regular expression (`re:`), new! - --progress option for borg upgrade (#291) and borg delete - update progress indication more often (e.g. for borg create within big files or for borg check repo), #500 - finer chunker granularity for items metadata stream, #547, #487 - borg create --list now used (additionally to -v) to enable the verbose file list output - display borg version below tracebacks, #532 Other changes: - hashtable size (and thus: RAM and disk consumption) follows a growth policy: grows fast while small, grows slower when getting bigger, #527 - Vagrantfile: use pyinstaller 3.1 to build binaries, freebsd sqlite3 fix, fixes #569 - no separate binaries for centos6 any more because the generic linux binaries also work on centos6 (or in general: on systems with a slightly older glibc than debian7 - dev environment: require virtualenv<14.0 so we get a py32 compatible pip - docs: - add space-saving chunks.archive.d trick to FAQ - important: clarify -v and log levels in usage -> general, please read! - sphinx configuration: create a simple man page from usage docs - add a repo server setup example - disable unneeded SSH features in authorized_keys examples for security. - borg prune only knows "--keep-within" and not "--within" - add gource video to resources docs, #507 - add netbsd install instructions - authors: make it more clear what refers to borg and what to attic - document standalone binary requirements, #499 - rephrase the mailing list section - development docs: run build_api and build_usage before tagging release - internals docs: hash table max. load factor is 0.75 now - markup, typo, grammar, phrasing, clarifications and other fixes. - add gcc gcc-c++ to redhat/fedora/corora install docs, fixes #583 Version 0.29.0 (2015-12-13) --------------------------- Compatibility notes: - when upgrading to 0.29.0 you need to upgrade client as well as server installations due to the locking and commandline interface changes otherwise you'll get an error msg about a RPC protocol mismatch or a wrong commandline option. if you run a server that needs to support both old and new clients, it is suggested that you have a "borg-0.28.2" and a "borg-0.29.0" command. clients then can choose via e.g. "borg --remote-path=borg-0.29.0 ...". - the default waiting time for a lock changed from infinity to 1 second for a better interactive user experience. if the repo you want to access is currently locked, borg will now terminate after 1s with an error message. if you have scripts that shall wait for the lock for a longer time, use --lock-wait N (with N being the maximum wait time in seconds). Bug fixes: - hash table tuning (better chosen hashtable load factor 0.75 and prime initial size of 1031 gave ~1000x speedup in some scenarios) - avoid creation of an orphan lock for one case, #285 - --keep-tag-files: fix file mode and multiple tag files in one directory, #432 - fixes for "borg upgrade" (attic repo converter), #466 - remove --progress isatty magic (and also --no-progress option) again, #476 - borg init: display proper repo URL - fix format of umask in help pages, #463 New features: - implement --lock-wait, support timeout for UpgradableLock, #210 - implement borg break-lock command, #157 - include system info below traceback, #324 - sane remote logging, remote stderr, #461: - remote log output: intercept it and log it via local logging system, with "Remote: " prefixed to message. log remote tracebacks. - remote stderr: output it to local stderr with "Remote: " prefixed. - add --debug and --info (same as --verbose) to set the log level of the builtin logging configuration (which otherwise defaults to warning), #426 note: there are few messages emitted at DEBUG level currently. - optionally configure logging via env var BORG_LOGGING_CONF - add --filter option for status characters: e.g. to show only the added or modified files (and also errors), use "borg create -v --filter=AME ...". - more progress indicators, #394 - use ISO-8601 date and time format, #375 - "borg check --prefix" to restrict archive checking to that name prefix, #206 Other changes: - hashindex_add C implementation (speed up cache re-sync for new archives) - increase FUSE read_size to 1024 (speed up metadata operations) - check/delete/prune --save-space: free unused segments quickly, #239 - increase rpc protocol version to 2 (see also Compatibility notes), #458 - silence borg by default (via default log level WARNING) - get rid of C compiler warnings, #391 - upgrade OS X FUSE to 3.0.9 on the OS X binary build system - use python 3.5.1 to build binaries - docs: - new mailing list borgbackup@python.org, #468 - readthedocs: color and logo improvements - load coverage icons over SSL (avoids mixed content) - more precise binary installation steps - update release procedure docs about OS X FUSE - FAQ entry about unexpected 'A' status for unchanged file(s), #403 - add docs about 'E' file status - add "borg upgrade" docs, #464 - add developer docs about output and logging - clarify encryption, add note about client-side encryption - add resources section, with videos, talks, presentations, #149 - Borg moved to Arch Linux [community] - fix wrong installation instructions for archlinux Version 0.28.2 (2015-11-15) --------------------------- New features: - borg create --exclude-if-present TAGFILE - exclude directories that have the given file from the backup. You can additionally give --keep-tag-files to preserve just the directory roots and the tag-files (but not backup other directory contents), #395, attic #128, attic #142 Other changes: - do not create docs sources at build time (just have them in the repo), completely remove have_cython() hack, do not use the "mock" library at build time, #384 - avoid hidden import, make it easier for PyInstaller, easier fix for #218 - docs: - add description of item flags / status output, fixes #402 - explain how to regenerate usage and API files (build_api or build_usage) and when to commit usage files directly into git, #384 - minor install docs improvements Version 0.28.1 (2015-11-08) --------------------------- Bug fixes: - do not try to build api / usage docs for production install, fixes unexpected "mock" build dependency, #384 Other changes: - avoid using msgpack.packb at import time - fix formatting issue in changes.rst - fix build on readthedocs Version 0.28.0 (2015-11-08) --------------------------- Compatibility notes: - changed return codes (exit codes), see docs. in short: old: 0 = ok, 1 = error. now: 0 = ok, 1 = warning, 2 = error New features: - refactor return codes (exit codes), fixes #61 - add --show-rc option enable "terminating with X status, rc N" output, fixes 58, #351 - borg create backups atime and ctime additionally to mtime, fixes #317 - extract: support atime additionally to mtime - FUSE: support ctime and atime additionally to mtime - support borg --version - emit a warning if we have a slow msgpack installed - borg list --prefix=thishostname- REPO, fixes #205 - Debug commands (do not use except if you know what you do: debug-get-obj, debug-put-obj, debug-delete-obj, debug-dump-archive-items. Bug fixes: - setup.py: fix bug related to BORG_LZ4_PREFIX processing - fix "check" for repos that have incomplete chunks, fixes #364 - borg mount: fix unlocking of repository at umount time, fixes #331 - fix reading files without touching their atime, #334 - non-ascii ACL fixes for Linux, FreeBSD and OS X, #277 - fix acl_use_local_uid_gid() and add a test for it, attic #359 - borg upgrade: do not upgrade repositories in place by default, #299 - fix cascading failure with the index conversion code, #269 - borg check: implement 'cmdline' archive metadata value decoding, #311 - fix RobustUnpacker, it missed some metadata keys (new atime and ctime keys were missing, but also bsdflags). add check for unknown metadata keys. - create from stdin: also save atime, ctime (cosmetic) - use default_notty=False for confirmations, fixes #345 - vagrant: fix msgpack installation on centos, fixes #342 - deal with unicode errors for symlinks in same way as for regular files and have a helpful warning message about how to fix wrong locale setup, fixes #382 - add ACL keys the RobustUnpacker must know about Other changes: - improve file size displays, more flexible size formatters - explicitly commit to the units standard, #289 - archiver: add E status (means that an error occurred when processing this (single) item - do binary releases via "github releases", closes #214 - create: use -x and --one-file-system (was: --do-not-cross-mountpoints), #296 - a lot of changes related to using "logging" module and screen output, #233 - show progress display if on a tty, output more progress information, #303 - factor out status output so it is consistent, fix surrogates removal, maybe fixes #309 - move away from RawConfigParser to ConfigParser - archive checker: better error logging, give chunk_id and sequence numbers (can be used together with borg debug-dump-archive-items). - do not mention the deprecated passphrase mode - emit a deprecation warning for --compression N (giving a just a number) - misc .coverragerc fixes (and coverage measurement improvements), fixes #319 - refactor confirmation code, reduce code duplication, add tests - prettier error messages, fixes #307, #57 - tests: - add a test to find disk-full issues, #327 - travis: also run tests on Python 3.5 - travis: use tox -r so it rebuilds the tox environments - test the generated pyinstaller-based binary by archiver unit tests, #215 - vagrant: tests: announce whether fakeroot is used or not - vagrant: add vagrant user to fuse group for debianoid systems also - vagrant: llfuse install on darwin needs pkgconfig installed - vagrant: use pyinstaller from develop branch, fixes #336 - benchmarks: test create, extract, list, delete, info, check, help, fixes #146 - benchmarks: test with both the binary and the python code - archiver tests: test with both the binary and the python code, fixes #215 - make basic test more robust - docs: - moved docs to borgbackup.readthedocs.org, #155 - a lot of fixes and improvements, use mobile-friendly RTD standard theme - use zlib,6 compression in some examples, fixes #275 - add missing rename usage to docs, closes #279 - include the help offered by borg help in the usage docs, fixes #293 - include a list of major changes compared to attic into README, fixes #224 - add OS X install instructions, #197 - more details about the release process, #260 - fix linux glibc requirement (binaries built on debian7 now) - build: move usage and API generation to setup.py - update docs about return codes, #61 - remove api docs (too much breakage on rtd) - borgbackup install + basics presentation (asciinema) - describe the current style guide in documentation - add section about debug commands - warn about not running out of space - add example for rename - improve chunker params docs, fixes #362 - minor development docs update Version 0.27.0 (2015-10-07) --------------------------- New features: - "borg upgrade" command - attic -> borg one time converter / migration, #21 - temporary hack to avoid using lots of disk space for chunks.archive.d, #235: To use it: rm -rf chunks.archive.d ; touch chunks.archive.d - respect XDG_CACHE_HOME, attic #181 - add support for arbitrary SSH commands, attic #99 - borg delete --cache-only REPO (only delete cache, not REPO), attic #123 Bug fixes: - use Debian 7 (wheezy) to build pyinstaller borgbackup binaries, fixes slow down observed when running the Centos6-built binary on Ubuntu, #222 - do not crash on empty lock.roster, fixes #232 - fix multiple issues with the cache config version check, #234 - fix segment entry header size check, attic #352 plus other error handling improvements / code deduplication there. - always give segment and offset in repo IntegrityErrors Other changes: - stop producing binary wheels, remove docs about it, #147 - docs: - add warning about prune - generate usage include files only as needed - development docs: add Vagrant section - update / improve / reformat FAQ - hint to single-file pyinstaller binaries from README Version 0.26.1 (2015-09-28) --------------------------- This is a minor update, just docs and new pyinstaller binaries. - docs update about python and binary requirements - better docs for --read-special, fix #220 - re-built the binaries, fix #218 and #213 (glibc version issue) - update web site about single-file pyinstaller binaries Note: if you did a python-based installation, there is no need to upgrade. Version 0.26.0 (2015-09-19) --------------------------- New features: - Faster cache sync (do all in one pass, remove tar/compression stuff), #163 - BORG_REPO env var to specify the default repo, #168 - read special files as if they were regular files, #79 - implement borg create --dry-run, attic issue #267 - Normalize paths before pattern matching on OS X, #143 - support OpenBSD and NetBSD (except xattrs/ACLs) - support / run tests on Python 3.5 Bug fixes: - borg mount repo: use absolute path, attic #200, attic #137 - chunker: use off_t to get 64bit on 32bit platform, #178 - initialize chunker fd to -1, so it's not equal to STDIN_FILENO (0) - fix reaction to "no" answer at delete repo prompt, #182 - setup.py: detect lz4.h header file location - to support python < 3.2.4, add less buggy argparse lib from 3.2.6 (#194) - fix for obtaining ``char *`` from temporary Python value (old code causes a compile error on Mint 17.2) - llfuse 0.41 install troubles on some platforms, require < 0.41 (UnicodeDecodeError exception due to non-ascii llfuse setup.py) - cython code: add some int types to get rid of unspecific python add / subtract operations (avoid ``undefined symbol FPE_``... error on some platforms) - fix verbose mode display of stdin backup - extract: warn if a include pattern never matched, fixes #209, implement counters for Include/ExcludePatterns - archive names with slashes are invalid, attic issue #180 - chunker: add a check whether the POSIX_FADV_DONTNEED constant is defined - fixes building on OpenBSD. Other changes: - detect inconsistency / corruption / hash collision, #170 - replace versioneer with setuptools_scm, #106 - docs: - pkg-config is needed for llfuse installation - be more clear about pruning, attic issue #132 - unit tests: - xattr: ignore security.selinux attribute showing up - ext3 seems to need a bit more space for a sparse file - do not test lzma level 9 compression (avoid MemoryError) - work around strange mtime granularity issue on netbsd, fixes #204 - ignore st_rdev if file is not a block/char device, fixes #203 - stay away from the setgid and sticky mode bits - use Vagrant to do easy cross-platform testing (#196), currently: - Debian 7 "wheezy" 32bit, Debian 8 "jessie" 64bit - Ubuntu 12.04 32bit, Ubuntu 14.04 64bit - Centos 7 64bit - FreeBSD 10.2 64bit - OpenBSD 5.7 64bit - NetBSD 6.1.5 64bit - Darwin (OS X Yosemite) Version 0.25.0 (2015-08-29) --------------------------- Compatibility notes: - lz4 compression library (liblz4) is a new requirement (#156) - the new compression code is very compatible: as long as you stay with zlib compression, older borg releases will still be able to read data from a repo/archive made with the new code (note: this is not the case for the default "none" compression, use "zlib,0" if you want a "no compression" mode that can be read by older borg). Also the new code is able to read repos and archives made with older borg versions (for all zlib levels 0..9). Deprecations: - --compression N (with N being a number, as in 0.24) is deprecated. We keep the --compression 0..9 for now to not break scripts, but it is deprecated and will be removed later, so better fix your scripts now: --compression 0 (as in 0.24) is the same as --compression zlib,0 (now). BUT: if you do not want compression, you rather want --compression none (which is the default). --compression 1 (in 0.24) is the same as --compression zlib,1 (now) --compression 9 (in 0.24) is the same as --compression zlib,9 (now) New features: - create --compression none (default, means: do not compress, just pass through data "as is". this is more efficient than zlib level 0 as used in borg 0.24) - create --compression lz4 (super-fast, but not very high compression) - create --compression zlib,N (slower, higher compression, default for N is 6) - create --compression lzma,N (slowest, highest compression, default N is 6) - honor the nodump flag (UF_NODUMP) and do not backup such items - list --short just outputs a simple list of the files/directories in an archive Bug fixes: - fixed --chunker-params parameter order confusion / malfunction, fixes #154 - close fds of segments we delete (during compaction) - close files which fell out the lrucache - fadvise DONTNEED now is only called for the byte range actually read, not for the whole file, fixes #158. - fix issue with negative "all archives" size, fixes #165 - restore_xattrs: ignore if setxattr fails with EACCES, fixes #162 Other changes: - remove fakeroot requirement for tests, tests run faster without fakeroot (test setup does not fail any more without fakeroot, so you can run with or without fakeroot), fixes #151 and #91. - more tests for archiver - recover_segment(): don't assume we have an fd for segment - lrucache refactoring / cleanup, add dispose function, py.test tests - generalize hashindex code for any key length (less hardcoding) - lock roster: catch file not found in remove() method and ignore it - travis CI: use requirements file - improved docs: - replace hack for llfuse with proper solution (install libfuse-dev) - update docs about compression - update development docs about fakeroot - internals: add some words about lock files / locking system - support: mention BountySource and for what it can be used - theme: use a lighter green - add pypi, wheel, dist package based install docs - split install docs into system-specific preparations and generic instructions Version 0.24.0 (2015-08-09) --------------------------- Incompatible changes (compared to 0.23): - borg now always issues --umask NNN option when invoking another borg via ssh on the repository server. By that, it's making sure it uses the same umask for remote repos as for local ones. Because of this, you must upgrade both server and client(s) to 0.24. - the default umask is 077 now (if you do not specify via --umask) which might be a different one as you used previously. The default umask avoids that you accidentally give access permissions for group and/or others to files created by borg (e.g. the repository). Deprecations: - "--encryption passphrase" mode is deprecated, see #85 and #97. See the new "--encryption repokey" mode for a replacement. New features: - borg create --chunker-params ... to configure the chunker, fixes #16 (attic #302, attic #300, and somehow also #41). This can be used to reduce memory usage caused by chunk management overhead, so borg does not create a huge chunks index/repo index and eats all your RAM if you back up lots of data in huge files (like VM disk images). See docs/misc/create_chunker-params.txt for more information. - borg info now reports chunk counts in the chunk index. - borg create --compression 0..9 to select zlib compression level, fixes #66 (attic #295). - borg init --encryption repokey (to store the encryption key into the repo), fixes #85 - improve at-end error logging, always log exceptions and set exit_code=1 - LoggedIO: better error checks / exceptions / exception handling - implement --remote-path to allow non-default-path borg locations, #125 - implement --umask M and use 077 as default umask for better security, #117 - borg check: give a named single archive to it, fixes #139 - cache sync: show progress indication - cache sync: reimplement the chunk index merging in C Bug fixes: - fix segfault that happened for unreadable files (chunker: n needs to be a signed size_t), #116 - fix the repair mode, #144 - repo delete: add destroy to allowed rpc methods, fixes issue #114 - more compatible repository locking code (based on mkdir), maybe fixes #92 (attic #317, attic #201). - better Exception msg if no Borg is installed on the remote repo server, #56 - create a RepositoryCache implementation that can cope with >2GiB, fixes attic #326. - fix Traceback when running check --repair, attic #232 - clarify help text, fixes #73. - add help string for --no-files-cache, fixes #140 Other changes: - improved docs: - added docs/misc directory for misc. writeups that won't be included "as is" into the html docs. - document environment variables and return codes (attic #324, attic #52) - web site: add related projects, fix web site url, IRC #borgbackup - Fedora/Fedora-based install instructions added to docs - Cygwin-based install instructions added to docs - updated AUTHORS - add FAQ entries about redundancy / integrity - clarify that borg extract uses the cwd as extraction target - update internals doc about chunker params, memory usage and compression - added docs about development - add some words about resource usage in general - document how to backup a raw disk - add note about how to run borg from virtual env - add solutions for (ll)fuse installation problems - document what borg check does, fixes #138 - reorganize borgbackup.github.io sidebar, prev/next at top - deduplicate and refactor the docs / README.rst - use borg-tmp as prefix for temporary files / directories - short prune options without "keep-" are deprecated, do not suggest them - improved tox configuration - remove usage of unittest.mock, always use mock from pypi - use entrypoints instead of scripts, for better use of the wheel format and modern installs - add requirements.d/development.txt and modify tox.ini - use travis-ci for testing based on Linux and (new) OS X - use coverage.py, pytest-cov and codecov.io for test coverage support I forgot to list some stuff already implemented in 0.23.0, here they are: New features: - efficient archive list from manifest, meaning a big speedup for slow repo connections and "list ", "delete ", "prune" (attic #242, attic #167) - big speedup for chunks cache sync (esp. for slow repo connections), fixes #18 - hashindex: improve error messages Other changes: - explicitly specify binary mode to open binary files - some easy micro optimizations Version 0.23.0 (2015-06-11) --------------------------- Incompatible changes (compared to attic, fork related): - changed sw name and cli command to "borg", updated docs - package name (and name in urls) uses "borgbackup" to have fewer collisions - changed repo / cache internal magic strings from ATTIC* to BORG*, changed cache location to .cache/borg/ - this means that it currently won't accept attic repos (see issue #21 about improving that) Bug fixes: - avoid defect python-msgpack releases, fixes attic #171, fixes attic #185 - fix traceback when trying to do unsupported passphrase change, fixes attic #189 - datetime does not like the year 10.000, fixes attic #139 - fix "info" all archives stats, fixes attic #183 - fix parsing with missing microseconds, fixes attic #282 - fix misleading hint the fuse ImportError handler gave, fixes attic #237 - check unpacked data from RPC for tuple type and correct length, fixes attic #127 - fix Repository._active_txn state when lock upgrade fails - give specific path to xattr.is_enabled(), disable symlink setattr call that always fails - fix test setup for 32bit platforms, partial fix for attic #196 - upgraded versioneer, PEP440 compliance, fixes attic #257 New features: - less memory usage: add global option --no-cache-files - check --last N (only check the last N archives) - check: sort archives in reverse time order - rename repo::oldname newname (rename repository) - create -v output more informative - create --progress (backup progress indicator) - create --timestamp (utc string or reference file/dir) - create: if "-" is given as path, read binary from stdin - extract: if --stdout is given, write all extracted binary data to stdout - extract --sparse (simple sparse file support) - extra debug information for 'fread failed' - delete (deletes whole repo + local cache) - FUSE: reflect deduplication in allocated blocks - only allow whitelisted RPC calls in server mode - normalize source/exclude paths before matching - use posix_fadvise to not spoil the OS cache, fixes attic #252 - toplevel error handler: show tracebacks for better error analysis - sigusr1 / sigint handler to print current file infos - attic PR #286 - RPCError: include the exception args we get from remote Other changes: - source: misc. cleanups, pep8, style - docs and faq improvements, fixes, updates - cleanup crypto.pyx, make it easier to adapt to other AES modes - do os.fsync like recommended in the python docs - source: Let chunker optionally work with os-level file descriptor. - source: Linux: remove duplicate os.fsencode calls - source: refactor _open_rb code a bit, so it is more consistent / regular - source: refactor indicator (status) and item processing - source: use py.test for better testing, flake8 for code style checks - source: fix tox >=2.0 compatibility (test runner) - pypi package: add python version classifiers, add FreeBSD to platforms Attic Changelog --------------- Here you can see the full list of changes between each Attic release until Borg forked from Attic: Version 0.17 ~~~~~~~~~~~~ (bugfix release, released on X) - Fix hashindex ARM memory alignment issue (#309) - Improve hashindex error messages (#298) Version 0.16 ~~~~~~~~~~~~ (bugfix release, released on May 16, 2015) - Fix typo preventing the security confirmation prompt from working (#303) - Improve handling of systems with improperly configured file system encoding (#289) - Fix "All archives" output for attic info. (#183) - More user friendly error message when repository key file is not found (#236) - Fix parsing of iso 8601 timestamps with zero microseconds (#282) Version 0.15 ~~~~~~~~~~~~ (bugfix release, released on Apr 15, 2015) - xattr: Be less strict about unknown/unsupported platforms (#239) - Reduce repository listing memory usage (#163). - Fix BrokenPipeError for remote repositories (#233) - Fix incorrect behavior with two character directory names (#265, #268) - Require approval before accessing relocated/moved repository (#271) - Require approval before accessing previously unknown unencrypted repositories (#271) - Fix issue with hash index files larger than 2GB. - Fix Python 3.2 compatibility issue with noatime open() (#164) - Include missing pyx files in dist files (#168) Version 0.14 ~~~~~~~~~~~~ (feature release, released on Dec 17, 2014) - Added support for stripping leading path segments (#95) "attic extract --strip-segments X" - Add workaround for old Linux systems without acl_extended_file_no_follow (#96) - Add MacPorts' path to the default openssl search path (#101) - HashIndex improvements, eliminates unnecessary IO on low memory systems. - Fix "Number of files" output for attic info. (#124) - limit create file permissions so files aren't read while restoring - Fix issue with empty xattr values (#106) Version 0.13 ~~~~~~~~~~~~ (feature release, released on Jun 29, 2014) - Fix sporadic "Resource temporarily unavailable" when using remote repositories - Reduce file cache memory usage (#90) - Faster AES encryption (utilizing AES-NI when available) - Experimental Linux, OS X and FreeBSD ACL support (#66) - Added support for backup and restore of BSDFlags (OSX, FreeBSD) (#56) - Fix bug where xattrs on symlinks were not correctly restored - Added cachedir support. CACHEDIR.TAG compatible cache directories can now be excluded using ``--exclude-caches`` (#74) - Fix crash on extreme mtime timestamps (year 2400+) (#81) - Fix Python 3.2 specific lockf issue (EDEADLK) Version 0.12 ~~~~~~~~~~~~ (feature release, released on April 7, 2014) - Python 3.4 support (#62) - Various documentation improvements a new style - ``attic mount`` now supports mounting an entire repository not only individual archives (#59) - Added option to restrict remote repository access to specific path(s): ``attic serve --restrict-to-path X`` (#51) - Include "all archives" size information in "--stats" output. (#54) - Added ``--stats`` option to ``attic delete`` and ``attic prune`` - Fixed bug where ``attic prune`` used UTC instead of the local time zone when determining which archives to keep. - Switch to SI units (Power of 1000 instead 1024) when printing file sizes Version 0.11 ~~~~~~~~~~~~ (feature release, released on March 7, 2014) - New "check" command for repository consistency checking (#24) - Documentation improvements - Fix exception during "attic create" with repeated files (#39) - New "--exclude-from" option for attic create/extract/verify. - Improved archive metadata deduplication. - "attic verify" has been deprecated. Use "attic extract --dry-run" instead. - "attic prune --hourly|daily|..." has been deprecated. Use "attic prune --keep-hourly|daily|..." instead. - Ignore xattr errors during "extract" if not supported by the filesystem. (#46) Version 0.10 ~~~~~~~~~~~~ (bugfix release, released on Jan 30, 2014) - Fix deadlock when extracting 0 sized files from remote repositories - "--exclude" wildcard patterns are now properly applied to the full path not just the file name part (#5). - Make source code endianness agnostic (#1) Version 0.9 ~~~~~~~~~~~ (feature release, released on Jan 23, 2014) - Remote repository speed and reliability improvements. - Fix sorting of segment names to ignore NFS left over files. (#17) - Fix incorrect display of time (#13) - Improved error handling / reporting. (#12) - Use fcntl() instead of flock() when locking repository/cache. (#15) - Let ssh figure out port/user if not specified so we don't override .ssh/config (#9) - Improved libcrypto path detection (#23). Version 0.8.1 ~~~~~~~~~~~~~ (bugfix release, released on Oct 4, 2013) - Fix segmentation fault issue. Version 0.8 ~~~~~~~~~~~ (feature release, released on Oct 3, 2013) - Fix xattr issue when backing up sshfs filesystems (#4) - Fix issue with excessive index file size (#6) - Support access of read only repositories. - New syntax to enable repository encryption: attic init --encryption="none|passphrase|keyfile". - Detect and abort if repository is older than the cache. Version 0.7 ~~~~~~~~~~~ (feature release, released on Aug 5, 2013) - Ported to FreeBSD - Improved documentation - Experimental: Archives mountable as FUSE filesystems. - The "user." prefix is no longer stripped from xattrs on Linux Version 0.6.1 ~~~~~~~~~~~~~ (bugfix release, released on July 19, 2013) - Fixed an issue where mtime was not always correctly restored. Version 0.6 ~~~~~~~~~~~ First public release on July 9, 2013 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/LICENSE0000644000076500000240000000301714641074756013234 0ustar00twstaffCopyright (C) 2015-2024 The Borg Collective (see AUTHORS file) Copyright (C) 2010-2014 Jonas Borgström All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/MANIFEST.in0000644000076500000240000000073614641074756013772 0ustar00twstaff# stuff we need to include into the sdist is handled automatically by # setuptools_scm - it includes all git-committed files. # but we want to exclude some committed files/dirs not needed in the sdist: exclude .editorconfig .gitattributes .gitignore .mailmap Vagrantfile prune .github include src/borg/platform/darwin.c src/borg/platform/freebsd.c src/borg/platform/linux.c src/borg/platform/posix.c include src/borg/platform/syncfilerange.c include src/borg/platform/windows.c ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719958149.8484285 borgbackup-1.4.0/PKG-INFO0000644000076500000240000002034214641075206013313 0ustar00twstaffMetadata-Version: 2.1 Name: borgbackup Version: 1.4.0 Summary: Deduplicated, encrypted, authenticated and compressed backups Author: The Borg Collective (see AUTHORS file) Maintainer-email: Thomas Waldmann License: BSD Project-URL: Homepage, https://borgbackup.org/ Project-URL: Bug Tracker, https://github.com/borgbackup/borg/issues Project-URL: Documentation, https://borgbackup.readthedocs.io/ Project-URL: Repository, https://github.com/borgbackup/borg Project-URL: Changelog, https://github.com/borgbackup/borg/blob/1.4-maint/docs/changes.rst Keywords: backup,borgbackup Classifier: Development Status :: 4 - Beta Classifier: Environment :: Console Classifier: Intended Audience :: System Administrators Classifier: License :: OSI Approved :: BSD License Classifier: Operating System :: POSIX :: BSD :: FreeBSD Classifier: Operating System :: POSIX :: BSD :: OpenBSD Classifier: Operating System :: POSIX :: BSD :: NetBSD Classifier: Operating System :: MacOS :: MacOS X Classifier: Operating System :: POSIX :: Linux Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: 3.12 Classifier: Topic :: Security :: Cryptography Classifier: Topic :: System :: Archiving :: Backup Requires-Python: >=3.9 License-File: LICENSE License-File: AUTHORS Requires-Dist: msgpack<=1.1.0,>=1.0.3 Requires-Dist: packaging Provides-Extra: llfuse Requires-Dist: llfuse>=1.3.8; extra == "llfuse" Provides-Extra: pyfuse3 Requires-Dist: pyfuse3>=3.1.1; extra == "pyfuse3" Provides-Extra: nofuse What is BorgBackup? ------------------- BorgBackup (short: Borg) is a deduplicating backup program. Optionally, it supports compression and authenticated encryption. The main goal of Borg is to provide an efficient and secure way to backup data. The data deduplication technique used makes Borg suitable for daily backups since only changes are stored. The authenticated encryption technique makes it suitable for backups to not fully trusted targets. See the `installation manual`_ or, if you have already downloaded Borg, ``docs/installation.rst`` to get started with Borg. There is also an `offline documentation`_ available, in multiple formats. .. _installation manual: https://borgbackup.readthedocs.org/en/stable/installation.html .. _offline documentation: https://readthedocs.org/projects/borgbackup/downloads Main features ~~~~~~~~~~~~~ **Space efficient storage** Deduplication based on content-defined chunking is used to reduce the number of bytes stored: each file is split into a number of variable length chunks and only chunks that have never been seen before are added to the repository. A chunk is considered duplicate if its id_hash value is identical. A cryptographically strong hash or MAC function is used as id_hash, e.g. (hmac-)sha256. To deduplicate, all the chunks in the same repository are considered, no matter whether they come from different machines, from previous backups, from the same backup or even from the same single file. Compared to other deduplication approaches, this method does NOT depend on: * file/directory names staying the same: So you can move your stuff around without killing the deduplication, even between machines sharing a repo. * complete files or time stamps staying the same: If a big file changes a little, only a few new chunks need to be stored - this is great for VMs or raw disks. * The absolute position of a data chunk inside a file: Stuff may get shifted and will still be found by the deduplication algorithm. **Speed** * performance-critical code (chunking, compression, encryption) is implemented in C/Cython * local caching of files/chunks index data * quick detection of unmodified files **Data encryption** All data can be protected using 256-bit AES encryption, data integrity and authenticity is verified using HMAC-SHA256. Data is encrypted clientside. **Obfuscation** Optionally, borg can actively obfuscate e.g. the size of files / chunks to make fingerprinting attacks more difficult. **Compression** All data can be optionally compressed: * lz4 (super fast, low compression) * zstd (wide range from high speed and low compression to high compression and lower speed) * zlib (medium speed and compression) * lzma (low speed, high compression) **Off-site backups** Borg can store data on any remote host accessible over SSH. If Borg is installed on the remote host, big performance gains can be achieved compared to using a network filesystem (sshfs, nfs, ...). **Backups mountable as filesystems** Backup archives are mountable as userspace filesystems for easy interactive backup examination and restores (e.g. by using a regular file manager). **Easy installation on multiple platforms** We offer single-file binaries that do not require installing anything - you can just run them on these platforms: * Linux * Mac OS X * FreeBSD * OpenBSD and NetBSD (no xattrs/ACLs support or binaries yet) * Cygwin (experimental, no binaries yet) * Linux Subsystem of Windows 10 (experimental) **Free and Open Source Software** * security and functionality can be audited independently * licensed under the BSD (3-clause) license, see `License`_ for the complete license Easy to use ~~~~~~~~~~~ Initialize a new backup repository (see ``borg init --help`` for encryption options):: $ borg init -e repokey /path/to/repo Create a backup archive:: $ borg create /path/to/repo::Saturday1 ~/Documents Now doing another backup, just to show off the great deduplication:: $ borg create -v --stats /path/to/repo::Saturday2 ~/Documents ----------------------------------------------------------------------------- Archive name: Saturday2 Archive fingerprint: 622b7c53c... Time (start): Sat, 2016-02-27 14:48:13 Time (end): Sat, 2016-02-27 14:48:14 Duration: 0.88 seconds Number of files: 163 ----------------------------------------------------------------------------- Original size Compressed size Deduplicated size This archive: 6.85 MB 6.85 MB 30.79 kB <-- ! All archives: 13.69 MB 13.71 MB 6.88 MB Unique chunks Total chunks Chunk index: 167 330 ----------------------------------------------------------------------------- For a graphical frontend refer to our complementary project `BorgWeb `_. Helping, Donations and Bounties, becoming a Patron -------------------------------------------------- Your help is always welcome! Spread the word, give feedback, help with documentation, testing or development. You can also give monetary support to the project, see there for details: https://www.borgbackup.org/support/fund.html Links ----- * `Main Web Site `_ * `Releases `_, `PyPI packages `_ and `ChangeLog `_ * `Offline Documentation `_ * `GitHub `_ and `Issue Tracker `_. * `Web-Chat (IRC) `_ and `Mailing List `_ * `License `_ * `Security contact `_ Compatibility notes ------------------- EXPECT THAT WE WILL BREAK COMPATIBILITY REPEATEDLY WHEN MAJOR RELEASE NUMBER CHANGES (like when going from 0.x.y to 1.0.0 or from 1.x.y to 2.0.0). NOT RELEASED DEVELOPMENT VERSIONS HAVE UNKNOWN COMPATIBILITY PROPERTIES. THIS IS SOFTWARE IN DEVELOPMENT, DECIDE YOURSELF WHETHER IT FITS YOUR NEEDS. Security issues should be reported to the `Security contact`_ (or see ``docs/support.rst`` in the source distribution). ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/README.rst0000644000076500000240000001735614641074756013731 0ustar00twstaff|screencast_basic| More screencasts: `installation`_, `advanced usage`_ What is BorgBackup? ------------------- BorgBackup (short: Borg) is a deduplicating backup program. Optionally, it supports compression and authenticated encryption. The main goal of Borg is to provide an efficient and secure way to backup data. The data deduplication technique used makes Borg suitable for daily backups since only changes are stored. The authenticated encryption technique makes it suitable for backups to not fully trusted targets. See the `installation manual`_ or, if you have already downloaded Borg, ``docs/installation.rst`` to get started with Borg. There is also an `offline documentation`_ available, in multiple formats. .. _installation manual: https://borgbackup.readthedocs.org/en/stable/installation.html .. _offline documentation: https://readthedocs.org/projects/borgbackup/downloads Main features ~~~~~~~~~~~~~ **Space efficient storage** Deduplication based on content-defined chunking is used to reduce the number of bytes stored: each file is split into a number of variable length chunks and only chunks that have never been seen before are added to the repository. A chunk is considered duplicate if its id_hash value is identical. A cryptographically strong hash or MAC function is used as id_hash, e.g. (hmac-)sha256. To deduplicate, all the chunks in the same repository are considered, no matter whether they come from different machines, from previous backups, from the same backup or even from the same single file. Compared to other deduplication approaches, this method does NOT depend on: * file/directory names staying the same: So you can move your stuff around without killing the deduplication, even between machines sharing a repo. * complete files or time stamps staying the same: If a big file changes a little, only a few new chunks need to be stored - this is great for VMs or raw disks. * The absolute position of a data chunk inside a file: Stuff may get shifted and will still be found by the deduplication algorithm. **Speed** * performance-critical code (chunking, compression, encryption) is implemented in C/Cython * local caching of files/chunks index data * quick detection of unmodified files **Data encryption** All data can be protected using 256-bit AES encryption, data integrity and authenticity is verified using HMAC-SHA256. Data is encrypted clientside. **Obfuscation** Optionally, borg can actively obfuscate e.g. the size of files / chunks to make fingerprinting attacks more difficult. **Compression** All data can be optionally compressed: * lz4 (super fast, low compression) * zstd (wide range from high speed and low compression to high compression and lower speed) * zlib (medium speed and compression) * lzma (low speed, high compression) **Off-site backups** Borg can store data on any remote host accessible over SSH. If Borg is installed on the remote host, big performance gains can be achieved compared to using a network filesystem (sshfs, nfs, ...). **Backups mountable as filesystems** Backup archives are mountable as userspace filesystems for easy interactive backup examination and restores (e.g. by using a regular file manager). **Easy installation on multiple platforms** We offer single-file binaries that do not require installing anything - you can just run them on these platforms: * Linux * Mac OS X * FreeBSD * OpenBSD and NetBSD (no xattrs/ACLs support or binaries yet) * Cygwin (experimental, no binaries yet) * Linux Subsystem of Windows 10 (experimental) **Free and Open Source Software** * security and functionality can be audited independently * licensed under the BSD (3-clause) license, see `License`_ for the complete license Easy to use ~~~~~~~~~~~ Initialize a new backup repository (see ``borg init --help`` for encryption options):: $ borg init -e repokey /path/to/repo Create a backup archive:: $ borg create /path/to/repo::Saturday1 ~/Documents Now doing another backup, just to show off the great deduplication:: $ borg create -v --stats /path/to/repo::Saturday2 ~/Documents ----------------------------------------------------------------------------- Archive name: Saturday2 Archive fingerprint: 622b7c53c... Time (start): Sat, 2016-02-27 14:48:13 Time (end): Sat, 2016-02-27 14:48:14 Duration: 0.88 seconds Number of files: 163 ----------------------------------------------------------------------------- Original size Compressed size Deduplicated size This archive: 6.85 MB 6.85 MB 30.79 kB <-- ! All archives: 13.69 MB 13.71 MB 6.88 MB Unique chunks Total chunks Chunk index: 167 330 ----------------------------------------------------------------------------- For a graphical frontend refer to our complementary project `BorgWeb `_. Helping, Donations and Bounties, becoming a Patron -------------------------------------------------- Your help is always welcome! Spread the word, give feedback, help with documentation, testing or development. You can also give monetary support to the project, see there for details: https://www.borgbackup.org/support/fund.html Links ----- * `Main Web Site `_ * `Releases `_, `PyPI packages `_ and `ChangeLog `_ * `Offline Documentation `_ * `GitHub `_ and `Issue Tracker `_. * `Web-Chat (IRC) `_ and `Mailing List `_ * `License `_ * `Security contact `_ Compatibility notes ------------------- EXPECT THAT WE WILL BREAK COMPATIBILITY REPEATEDLY WHEN MAJOR RELEASE NUMBER CHANGES (like when going from 0.x.y to 1.0.0 or from 1.x.y to 2.0.0). NOT RELEASED DEVELOPMENT VERSIONS HAVE UNKNOWN COMPATIBILITY PROPERTIES. THIS IS SOFTWARE IN DEVELOPMENT, DECIDE YOURSELF WHETHER IT FITS YOUR NEEDS. Security issues should be reported to the `Security contact`_ (or see ``docs/support.rst`` in the source distribution). .. start-badges |doc| |build| |coverage| |bestpractices| .. |doc| image:: https://readthedocs.org/projects/borgbackup/badge/?version=stable :alt: Documentation :target: https://borgbackup.readthedocs.org/en/stable/ .. |build| image:: https://github.com/borgbackup/borg/workflows/CI/badge.svg?branch=master :alt: Build Status (master) :target: https://github.com/borgbackup/borg/actions .. |coverage| image:: https://codecov.io/github/borgbackup/borg/coverage.svg?branch=master :alt: Test Coverage :target: https://codecov.io/github/borgbackup/borg?branch=master .. |screencast_basic| image:: https://asciinema.org/a/133292.png :alt: BorgBackup Basic Usage :target: https://asciinema.org/a/133292?autoplay=1&speed=1 :width: 100% .. _installation: https://asciinema.org/a/133291?autoplay=1&speed=1 .. _advanced usage: https://asciinema.org/a/133293?autoplay=1&speed=1 .. |bestpractices| image:: https://bestpractices.coreinfrastructure.org/projects/271/badge :alt: Best Practices Score :target: https://bestpractices.coreinfrastructure.org/projects/271 .. end-badges ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/README_WINDOWS.rst0000644000076500000240000000407314641074756015133 0ustar00twstaffBorg Native on Windows ====================== Running borg natively on windows is in a early alpha stage. Expect many things to fail. Do not use the native windows build on any data which you do not want to lose! Build Requirements ------------------ - VC 14.0 Compiler - OpenSSL Library v1.1.1c, 64bit (available at https://github.com/python/cpython-bin-deps) Please use the `win-download-openssl.ps1` script to download and extract the library to the correct location. See also the OpenSSL section below. - Patience and a lot of coffee / beer What's working -------------- .. note:: The following examples assume that the `BORG_REPO` and `BORG_PASSPHRASE` environment variables are set if the repo or passphrase is not explicitly given. - Borg does not crash if called with ``borg`` - ``borg init --encryption repokey-blake2 ./demoRepo`` runs without an error/warning. Note that absolute paths only work if the protocol is explicitly set to file:// - ``borg create ::backup-{now} D:\DemoData`` works as expected. - ``borg list`` works as expected. - ``borg extract --strip-components 1 ::backup-XXXX`` works. If absolute paths are extracted, it's important to pass ``--strip-components 1`` as otherwise the data is restored to the original location! What's NOT working ------------------ - Extracting a backup which was created on windows machine on a non windows machine will fail. - And many things more. OpenSSL, Windows and Python --------------------------- Windows does not ship OpenSSL by default, so we need to get the library from somewhere else. However, a default python installation does include `libcrypto` which is required by borg. The only things which are missing to build borg are the header and `*.lib` files. Luckily the python developers provide all required files in a separate repository. The `win-download-openssl.ps1` script can be used to download the package from https://github.com/python/cpython-bin-deps and extract the files to the correct location. For Anaconda, the required libraries can be installed with `conda install -c anaconda openssl`. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/SECURITY.md0000644000076500000240000000070114641074756014015 0ustar00twstaff# Security Policy ## Supported Versions These borg releases are currently supported with security updates. | Version | Supported | |---------|------------------------| | 1.4.x | :x: (not released yet) | | 1.2.x | :white_check_mark: | | 1.1.x | :x: | | < 1.1 | :x: | ## Reporting a Vulnerability See there: https://borgbackup.readthedocs.io/en/latest/support.html#security-contact ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719958149.7486103 borgbackup-1.4.0/docs/0000755000076500000240000000000014641075206013145 5ustar00twstaff././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719958149.7488453 borgbackup-1.4.0/docs/3rd_party/0000755000076500000240000000000014641075206015054 5ustar00twstaff././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/3rd_party/README0000644000076500000240000000032714641074756015747 0ustar00twstaffHere we store 3rd party documentation, licenses, etc. Please note that all files inside the "borg" package directory (except the stuff excluded in setup.py) will be INSTALLED, so don't keep docs or licenses there. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719958149.7490668 borgbackup-1.4.0/docs/3rd_party/lz4/0000755000076500000240000000000014641075206015565 5ustar00twstaff././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/3rd_party/lz4/LICENSE0000644000076500000240000000243714641074756016611 0ustar00twstaffLZ4 Library Copyright (c) 2011-2016, Yann Collet All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719958149.7492926 borgbackup-1.4.0/docs/3rd_party/zstd/0000755000076500000240000000000014641075206016040 5ustar00twstaff././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/3rd_party/zstd/LICENSE0000644000076500000240000000277214641074756017066 0ustar00twstaffBSD License For Zstandard software Copyright (c) 2016-present, Facebook, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name Facebook nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/Makefile0000644000076500000240000001074614641074756014626 0ustar00twstaff# Makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = sphinx-build PAPER = BUILDDIR = _build # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest help: @echo "Please use \`make ' where is one of" @echo " html to make standalone HTML files" @echo " dirhtml to make HTML files named index.html in directories" @echo " singlehtml to make a single large HTML file" @echo " pickle to make pickle files" @echo " json to make JSON files" @echo " htmlhelp to make HTML files and a HTML help project" @echo " qthelp to make HTML files and a qthelp project" @echo " devhelp to make HTML files and a Devhelp project" @echo " epub to make an epub" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " latexpdf to make LaTeX files and run them through pdflatex" @echo " text to make text files" @echo " man to make manual pages" @echo " changes to make an overview of all changed/added/deprecated items" @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" clean: -rm -rf $(BUILDDIR)/* html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." dirhtml: $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." singlehtml: $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml @echo @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." pickle: $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle @echo @echo "Build finished; now you can process the pickle files." json: $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json @echo @echo "Build finished; now you can process the JSON files." htmlhelp: $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp @echo @echo "Build finished; now you can run HTML Help Workshop with the" \ ".hhp project file in $(BUILDDIR)/htmlhelp." qthelp: $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ ".qhcp project file in $(BUILDDIR)/qthelp, like this:" @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/borg.qhcp" @echo "To view the help file:" @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/borg.qhc" devhelp: $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp @echo @echo "Build finished." @echo "To view the help file:" @echo "# mkdir -p $$HOME/.local/share/devhelp/borg" @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/borg" @echo "# devhelp" epub: $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub @echo @echo "Build finished. The epub file is in $(BUILDDIR)/epub." latex: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." @echo "Run \`make' in that directory to run these through (pdf)latex" \ "(use \`make latexpdf' here to do that automatically)." latexpdf: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through pdflatex..." make -C $(BUILDDIR)/latex all-pdf @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." text: $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text @echo @echo "Build finished. The text files are in $(BUILDDIR)/text." man: $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man @echo @echo "Build finished. The manual pages are in $(BUILDDIR)/man." changes: $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes @echo @echo "The overview file is in $(BUILDDIR)/changes." linkcheck: $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck @echo @echo "Link check complete; look for any errors in the above output " \ "or in $(BUILDDIR)/linkcheck/output.txt." doctest: $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest @echo "Testing of doctests in the sources finished, look at the " \ "results in $(BUILDDIR)/doctest/output.txt." ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1719958149.751033 borgbackup-1.4.0/docs/_static/0000755000076500000240000000000014641075206014573 5ustar00twstaff././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/_static/Makefile0000644000076500000240000000030614641074756016243 0ustar00twstaff all: logo.pdf logo.png logo.pdf: logo.svg inkscape logo.svg --export-pdf=logo.pdf logo.png: logo.svg inkscape logo.svg --export-png=logo.png --export-dpi=72,72 clean: rm -f logo.pdf logo.png ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/_static/favicon.ico0000644000076500000240000011401614641074756016730 0ustar00twstaffRR m6RRFmRR"&u(R PP aaaa PPKL<M>>>>>>?BuL0i9iuL0i9iuL0i9iCuL%|cs] cvu"uL4uL4uL4uL<>>>4B\\\\\3uL0 4uL064uL0-4uL`* 3e`Q=Lf9CflFLg9 glHLh9 hlJL%|L0L0L0PP aaaa PP?@@@@@@?(R(R "%*-03469<=>?BCFHJKLMQ\]`cefghilsuv|S\\\\\\\\' R\\\\\\\\\\(\\\\\\\\\\\\) !Q\\\\\"G\\\\\6(\\\\\U\\\\\\\;3\\\\N\\\Q9\\\\\D3\\\UG\\\\\6(\\\\\U\\\\\\\\;3\\\\\N\\\\P 9\\\\\D3\\\\\UG\\\\\6(\\\\\U\\\\\\\\\;3\\\\\\N\\\\\P 9\\\\\D3\\\\\\\#G\\\\\6(\\\\\UEGGGW\\\\\8.\\\\\T5,>\\\\\N 9\\\\\D.\\\\\L76G\\\\\6(\\\\\U<\\\\\PD\\\\\@\\\\\\9\\\\\DD\\\\\<G\\\\\6(\\\\\U<\\\\\PD\\\\\@\\\\\\9\\\\\DD\\\\\<G\\\\\6(\\\\\U<\\\\\PD\\\\\@\\\\\\9\\\\\DD\\\\\<G\\\\\6(\\\\\U  A\\\\\?D\\\\\@\\\\\\9\\\\\D"+++++D\\\\\<G\\\\\6(\\\\\U\\\\\\\\\AD\\\\\@\\\\\\9\\\\\DF\\\\\<D\\\\\<G\\\\\6(\\\\\U\\\\\\\\\D\\\\\@\\\\\\9\\\\\DF\\\\\<D\\\\\<G\\\\\6(\\\\\U\\\\\\\\\XD\\\\\@\\\\\\9\\\\\DF\\\\\<D\\\\\<G\\\\\6(\\\\\U<\\\\\M-\\\\\YH=R\\\\\L 9\\\\\DIJZ\\\\\/-\\\\\<*JJ[\\\\\(\\\\\U<\\\\\P0\\\\\\N\\\\\N 9\\\\\D#\\\\\\\@0\\\\<4\\\\\\\$(\\\\\U<\\\\\P1\\\\\N\\\\O 9\\\\\DB\\\\\K 1\\\<4\\\\\\%(\\\\\U<\\\\\P2\\\\N\\\Q 9\\\\\DC\\\V2\\<4\\\\\&(\\\\\UEGGGW\\\\\8(\\\\\U\\\\\\\\\:(\\\\\U\\\\\\\\:(\\\\\U\\\\\\\:././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/_static/logo.pdf0000644000076500000240000000244414641074756016243 0ustar00twstaff%PDF-1.4 % 3 0 obj << /Length 4 0 R /Filter /FlateDecode >> stream x}TAr! _@PyB!{H5ʞi  '?ƏvI0&t=ގZ=N*Q,J|DP ? ÜA-\ $k@ֽdхY3ko6T_,30^'w4=BJ5~AƑ`3WhF%$ acܒļRx|k]MX)`xLpRZ:>4V'}8Y( G||⥾ hs?$ J}( VR%Že3鯵"4 5)`OĹ){-֗Y<˹uPm؎mmV)jVtn y"9C$.}_T~ԫwXx/QXj^}5Rx'b.n5}S endstream endobj 4 0 obj 430 endobj 2 0 obj << /ExtGState << /a0 << /CA 1 /ca 1 >> >> >> endobj 5 0 obj << /Type /Page /Parent 1 0 R /MediaBox [ 0 0 240 100 ] /Contents 3 0 R /Group << /Type /Group /S /Transparency /I true /CS /DeviceRGB >> /Resources 2 0 R >> endobj 1 0 obj << /Type /Pages /Kids [ 5 0 R ] /Count 1 >> endobj 6 0 obj << /Creator (cairo 1.14.8 (http://cairographics.org)) /Producer (cairo 1.14.8 (http://cairographics.org)) >> endobj 7 0 obj << /Type /Catalog /Pages 1 0 R >> endobj xref 0 8 0000000000 65535 f 0000000830 00000 n 0000000544 00000 n 0000000015 00000 n 0000000522 00000 n 0000000616 00000 n 0000000895 00000 n 0000001022 00000 n trailer << /Size 8 /Root 7 0 R /Info 6 0 R >> startxref 1074 %%EOF ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/_static/logo.png0000644000076500000240000000337514641074756016262 0ustar00twstaffPNG  IHDRdsBIT|d pHYs  tEXtSoftwarewww.inkscape.org<zIDATx]e񯛽iFeaFPPHIeIKA^EQAAwEEb/FQkJkn=E9Ywg8z؇S Hq X0,b1LE S")`a X0,b1LE S")`a X0,b1LE S"Zz.u^ǀcD/Áik3x+B V&"QF"~ E,Nq G|z+"/AKc01(b1/݀Ay~'`ee)* oq.%o7XwoT16 8zOb`v%pJ-(ιL/~x"~_x0xvb7Sr1=m1LO,a 1ś)19La pdoc~(B&F<x81Ǜ)!n/8_{bE#Gr.KE2tHwԽ͓.Hp61FE S")`a X0,b1,ObsgӎzE\ xν#86'ULo?O\7Jrܹ}2Ώ$ xN pfjl.\c n};IvNw"Ni獂,t7|UwTnÝ4=!i; zZhL@ -R,R,M`/Vbq&p_k,)^Pt;pSy7|4_?nKMEmƽUTr%-y͸%3LKZ&elnC]ha X0,b1LE S"S gGIENDB`././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/_static/logo.svg0000644000076500000240000000337614641074756016276 0ustar00twstaff ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/_static/logo_font.txt0000644000076500000240000000015714641074756017336 0ustar00twstaffBlack Ops One James Grieshaber SIL Open Font License, 1.1 https://www.google.com/fonts/specimen/Black+Ops+One ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719958149.7514093 borgbackup-1.4.0/docs/_templates/0000755000076500000240000000000014641075206015302 5ustar00twstaff././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/_templates/globaltoc.html0000644000076500000240000000117114641074756020147 0ustar00twstaff ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/_templates/logo-text.html0000644000076500000240000000024014641074756020117 0ustar00twstaff ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/authors.rst0000644000076500000240000000021314641074756015371 0ustar00twstaff.. include:: global.rst.inc Authors ======= .. include:: ../AUTHORS License ======= .. _license: .. include:: ../LICENSE :literal: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/book.rst0000644000076500000240000000062114641074756014641 0ustar00twstaff:orphan: .. include:: global.rst.inc Borg documentation ================== .. when you add an element here, do not forget to add it to index.rst .. Note: Some things are in appendices (see latex_appendices in conf.py) .. toctree:: :maxdepth: 2 introduction installation quickstart usage deployment faq support changes internals development authors ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1719958149.737818 borgbackup-1.4.0/docs/borg_theme/0000755000076500000240000000000014641075206015260 5ustar00twstaff././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719958149.7515824 borgbackup-1.4.0/docs/borg_theme/css/0000755000076500000240000000000014641075206016050 5ustar00twstaff././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/borg_theme/css/borg.css0000644000076500000240000000762114641074756017532 0ustar00twstaff@import url("theme.css"); dt code { font-weight: normal; } #internals .toctree-wrapper > ul { column-count: 3; -webkit-column-count: 3; } #internals .toctree-wrapper > ul > li { display: inline-block; font-weight: bold; } #internals .toctree-wrapper > ul > li > ul { font-weight: normal; } /* bootstrap has a .container class which clashes with docutils' container class. */ .docutils.container { width: auto; margin: 0; padding: 0; } /* the default (38px) produces a jumpy baseline in Firefox on Linux. */ h1 { font-size: 36px; } .text-logo { background-color: #000200; color: #00dd00; } .text-logo:hover, .text-logo:active, .text-logo:focus { color: #5afe57; } /* by default the top and bottom margins are unequal which looks a bit unbalanced. */ .sidebar-block { padding: 0; margin: 14px 0 24px 0; } #borg-documentation h1 + p .external img { width: 100%; } .container.experimental, #debugging-facilities { /* don't change text dimensions */ margin: 0 -30px; /* padding below + border width */ padding: 0 10px; /* 10 px visual margin between edge of text and the border */ /* fallback for browsers that don't have repeating-linear-gradient: thick, red lines */ border-left: 20px solid red; border-right: 20px solid red; /* fancy red stripes */ border-image: repeating-linear-gradient( -45deg,rgba(255,0,0,0.1) 0,rgba(255,0,0,0.75) 10px,rgba(0,0,0,0) 10px,rgba(0,0,0,0) 20px,rgba(255,0,0,0.75) 20px) 0 20 repeat; } .topic { margin: 0 1em; padding: 0 1em; /* #4e4a4a = background of the ToC sidebar */ border-left: 2px solid #4e4a4a;; border-right: 2px solid #4e4a4a;; } table.docutils:not(.footnote) td, table.docutils:not(.footnote) th { padding: .2em; } table.docutils:not(.footnote) { border-collapse: collapse; border: none; } table.docutils:not(.footnote) td, table.docutils:not(.footnote) th { border: 1px solid #ddd; } table.docutils:not(.footnote) tr:first-child th, table.docutils:not(.footnote) tr:first-child td { border-top: 0; } table.docutils:not(.footnote) tr:last-child td { border-bottom: 0; } table.docutils:not(.footnote) tr td:first-child, table.docutils:not(.footnote) tr th:first-child { border-left: 0; } table.docutils:not(.footnote) tr td:last-child, table.docutils:not(.footnote) tr th:last-child, table.docutils.borg-options-table tr td { border-right: 0; } table.docutils.option-list tr td, table.docutils.borg-options-table tr td { border-left: 0; border-right: 0; } table.docutils.borg-options-table tr td:first-child:not([colspan="3"]) { border-top: 0; border-bottom: 0; } .borg-options-table td[colspan="3"] p { margin: 0; } .borg-options-table { width: 100%; } kbd, /* used in usage pages for options */ code, .rst-content tt.literal, .rst-content tt.literal, .rst-content code.literal, .rst-content tt, .rst-content code, p .literal, p .literal span { border: none; padding: 0; color: black; /* slight contrast with #404040 of regular text */ background: none; } kbd { box-shadow: none; line-height: 23px; word-wrap: normal; font-size: 15px; font-family: Consolas, monospace; } .borg-options-table tr td:nth-child(2) .pre { white-space: nowrap; } .borg-options-table tr td:first-child { width: 2em; } cite { white-space: nowrap; color: black; /* slight contrast with #404040 of regular text */ font-family: Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace; font-style: normal; text-decoration: underline; } .borg-common-opt-ref { font-weight: bold; } .sidebar-toc ul li.toctree-l2 a, .sidebar-toc ul li.toctree-l3 a { padding-right: 25px; } #common-options .option { white-space: nowrap; } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/changes.rst0000644000076500000240000071047514641074756015336 0ustar00twstaff.. _important_notes: Important notes =============== This section provides information about security and corruption issues. .. _archives_tam_vuln: Pre-1.2.5 archives spoofing vulnerability (CVE-2023-36811) ---------------------------------------------------------- A flaw in the cryptographic authentication scheme in Borg allowed an attacker to fake archives and potentially indirectly cause backup data loss in the repository. The attack requires an attacker to be able to 1. insert files (with no additional headers) into backups 2. gain write access to the repository This vulnerability does not disclose plaintext to the attacker, nor does it affect the authenticity of existing archives. Creating plausible fake archives may be feasible for empty or small archives, but is unlikely for large archives. The fix enforces checking the TAM authentication tag of archives at critical places. Borg now considers archives without TAM as garbage or an attack. We are not aware of others having discovered, disclosed or exploited this vulnerability. Below, if we speak of borg 1.2.8, we mean a borg version >= 1.2.8 **or** a borg version that has the relevant patches for this vulnerability applied (could be also an older version in that case). Steps you must take to upgrade a repository (this applies to all kinds of repos no matter what encryption mode they use, including "none"): 1. Upgrade all clients using this repository to borg 1.2.8. Note: it is not required to upgrade a server, except if the server-side borg is also used as a client (and not just for "borg serve"). Do **not** run ``borg check`` with borg > 1.2.4 before completing the upgrade steps: - ``borg check`` would complain about archives without a valid archive TAM. - ``borg check --repair`` would remove such archives! 2. Do this step on every client using this repo: ``borg upgrade --show-rc --check-tam `` This will check the manifest TAM authentication setup in the repo and on this client. The command will exit with rc=0 if all is OK, otherwise with rc=1. a) If you get "Manifest authentication setup OK for this client and this repository." and rc=0, continue with 3. b) If you get some warnings and rc=1, run: ``borg upgrade --tam --force `` 3. Run: ``borg upgrade --show-rc --check-archives-tam `` This will create a report about the TAM status for all archives. In the last line(s) of the report, it will also report the overall status. The command will exit with rc=0 if all archives are TAM authenticated or with rc=1 if there are some archives with TAM issues. If there are no issues and all archives are TAM authenticated, continue with 5. Archive TAM issues are expected for: - archives created by borg <1.0.9. - archives resulting from a borg rename or borg recreate operation (see #7791) But, important, archive TAM issues could also come from archives created by an attacker. You should verify that archives with TAM issues are authentic and not malicious (== have good content, have correct timestamp, can be extracted successfully). In case you find crappy/malicious archives, you must delete them before proceeding. In low-risk, trusted environments, you may decide on your own risk to skip step 3 and just trust in everything being OK. 4. If there are no archives with TAM issues left at this point, you can skip this step. Run ``borg upgrade --archives-tam ``. This will unconditionally add a correct archive TAM to all archives not having one. ``borg check`` would consider TAM-less or invalid-TAM archives as garbage or a potential attack. To see that all archives are OK now, you can optionally repeat the command from step 3. 5. Done. Manifest and archives are TAM authenticated now. Vulnerability time line: * 2023-06-13: Vulnerability discovered during code review by Thomas Waldmann * 2023-06-13...: Work on fixing the issue, upgrade procedure, docs. * 2023-06-30: CVE was assigned via Github CNA * 2023-06-30 .. 2023-08-29: Fixed issue, code review, docs, testing. * 2023-08-30: Released fixed version 1.2.5 (broken upgrade procedure for some repos) * 2023-08-31: Released fixed version 1.2.6 (fixes upgrade procedure) .. _hashindex_set_bug: Pre-1.1.11 potential index corruption / data loss issue ------------------------------------------------------- A bug was discovered in our hashtable code, see issue #4829. The code is used for the client-side chunks cache and the server-side repo index. Although borg uses the hashtables very heavily, the index corruption did not happen too frequently, because it needed specific conditions to happen. Data loss required even more specific conditions, so it should be rare (and also detectable via borg check). You might be affected if borg crashed with / complained about: - AssertionError: Corrupted segment reference count - corrupted index or hints - ObjectNotFound: Object with key ... not found in repository ... - Index mismatch for key b'...'. (..., ...) != (-1, -1) - ValueError: stats_against: key contained in self but not in master_index. Advised procedure to fix any related issue in your indexes/caches: - install fixed borg code (on client AND server) - for all of your clients and repos remove the cache by: borg delete --cache-only YOURREPO (later, the cache will be re-built automatically) - for all your repos, rebuild the repo index by: borg check --repair YOURREPO This will also check all archives and detect if there is any data-loss issue. Affected branches / releases: - fd06497 introduced the bug into 1.1-maint branch - it affects all borg 1.1.x since 1.1.0b4. - fd06497 introduced the bug into master branch - it affects all borg 1.2.0 alpha releases. - c5cd882 introduced the bug into 1.0-maint branch - it affects all borg 1.0.x since 1.0.11rc1. The bug was fixed by: - 701159a fixes the bug in 1.1-maint branch - will be released with borg 1.1.11. - fa63150 fixes the bug in master branch - will be released with borg 1.2.0a8. - 7bb90b6 fixes the bug in 1.0-maint branch. Branch is EOL, no new release is planned as of now. .. _broken_validator: Pre-1.1.4 potential data corruption issue ----------------------------------------- A data corruption bug was discovered in borg check --repair, see issue #3444. This is a 1.1.x regression, releases < 1.1 (e.g. 1.0.x) are not affected. To avoid data loss, you must not run borg check --repair using an unfixed version of borg 1.1.x. The first official release that has the fix is 1.1.4. Package maintainers may have applied the fix to updated packages of 1.1.x (x<4) though, see the package maintainer's package changelog to make sure. If you never had missing item metadata chunks, the bug has not affected you even if you did run borg check --repair with an unfixed version. When borg check --repair tried to repair corrupt archives that miss item metadata chunks, the resync to valid metadata in still present item metadata chunks malfunctioned. This was due to a broken validator that considered all (even valid) item metadata as invalid. As they were considered invalid, borg discarded them. Practically, that means the affected files, directories or other fs objects were discarded from the archive. Due to the malfunction, the process was extremely slow, but if you let it complete, borg would have created a "repaired" archive that has lost a lot of items. If you interrupted borg check --repair because it was so strangely slow (killing borg somehow, e.g. Ctrl-C) the transaction was rolled back and no corruption occurred. The log message indicating the precondition for the bug triggering looks like: item metadata chunk missing [chunk: 001056_bdee87d...a3e50d] If you never had that in your borg check --repair runs, you're not affected. But if you're unsure or you actually have seen that, better check your archives. By just using "borg list repo::archive" you can see if all expected filesystem items are listed. .. _tam_vuln: Pre-1.0.9 manifest spoofing vulnerability (CVE-2016-10099) ---------------------------------------------------------- A flaw in the cryptographic authentication scheme in Borg allowed an attacker to spoof the manifest. The attack requires an attacker to be able to 1. insert files (with no additional headers) into backups 2. gain write access to the repository This vulnerability does not disclose plaintext to the attacker, nor does it affect the authenticity of existing archives. The vulnerability allows an attacker to create a spoofed manifest (the list of archives). Creating plausible fake archives may be feasible for small archives, but is unlikely for large archives. The fix adds a separate authentication tag to the manifest. For compatibility with prior versions this authentication tag is *not* required by default for existing repositories. Repositories created with 1.0.9 and later require it. Steps you should take: 1. Upgrade all clients to 1.0.9 or later. 2. Run ``borg upgrade --tam `` *on every client* for *each* repository. 3. This will list all archives, including archive IDs, for easy comparison with your logs. 4. Done. Prior versions can access and modify repositories with this measure enabled, however, to 1.0.9 or later their modifications are indiscernible from an attack and will raise an error until the below procedure is followed. We are aware that this can be annoying in some circumstances, but don't see a way to fix the vulnerability otherwise. In case a version prior to 1.0.9 is used to modify a repository where above procedure was completed, and now you get an error message from other clients: 1. ``borg upgrade --tam --force `` once with *any* client suffices. This attack is mitigated by: - Noting/logging ``borg list``, ``borg info``, or ``borg create --stats``, which contain the archive IDs. We are not aware of others having discovered, disclosed or exploited this vulnerability. Vulnerability time line: * 2016-11-14: Vulnerability and fix discovered during review of cryptography by Marian Beermann (@enkore) * 2016-11-20: First patch * 2016-12-20: Released fixed version 1.0.9 * 2017-01-02: CVE was assigned * 2017-01-15: Released fixed version 1.1.0b3 (fix was previously only available from source) .. _attic013_check_corruption: Pre-1.0.9 potential data loss ----------------------------- If you have archives in your repository that were made with attic <= 0.13 (and later migrated to borg), running borg check would report errors in these archives. See issue #1837. The reason for this is a invalid (and useless) metadata key that was always added due to a bug in these old attic versions. If you run borg check --repair, things escalate quickly: all archive items with invalid metadata will be killed. Due to that attic bug, that means all items in all archives made with these old attic versions. Pre-1.0.4 potential repo corruption ----------------------------------- Some external errors (like network or disk I/O errors) could lead to corruption of the backup repository due to issue #1138. A sign that this happened is if "E" status was reported for a file that can not be explained by problems with the source file. If you still have logs from "borg create -v --list", you can check for "E" status. Here is what could cause corruption and what you can do now: 1) I/O errors (e.g. repo disk errors) while writing data to repo. This could lead to corrupted segment files. Fix:: # check for corrupt chunks / segments: borg check -v --repository-only REPO # repair the repo: borg check -v --repository-only --repair REPO # make sure everything is fixed: borg check -v --repository-only REPO 2) Unreliable network / unreliable connection to the repo. This could lead to archive metadata corruption. Fix:: # check for corrupt archives: borg check -v --archives-only REPO # delete the corrupt archives: borg delete --force REPO::CORRUPT_ARCHIVE # make sure everything is fixed: borg check -v --archives-only REPO 3) In case you want to do more intensive checking. The best check that everything is ok is to run a dry-run extraction:: borg extract -v --dry-run REPO::ARCHIVE .. _upgradenotes: Upgrade Notes ============= borg 1.2.x to 1.4.x ------------------- If you currently use borg 1.2.5+: no upgrade steps needed (if you already did them when upgrading to that version, otherwise see below). If you currently use borg 1.2.0 .. 1.2.4, read and follow "Pre-1.2.5 archives spoofing vulnerability (CVE-2023-36811)" section, see the top of this changelog. Compatibility notes: By default, borg 1.4 will behave quite similar to borg 1.2 (it was forked off from 1.2-maint branch at 1.2.7). - the slashdot hack: be careful not to accidentally give paths containing /./ to "borg create" if you do not want to trigger this feature (which strips the left part of the path from archived items). - BORG_EXIT_CODES=modern is a feature that borg script, wrapper and GUI authors may want to use to get more specific error and warning return codes from borg. In that case, of course they will need to make sure to correctly deal with these new codes, see the internals/frontends docs. borg 1.1.x to 1.2.x ------------------- Some things can be recommended for the upgrade process from borg 1.1.x (please also read the important compatibility notes below): - first upgrade to a recent 1.1.x release - especially if you run some older 1.1.* or even 1.0.* borg release. - using that, run at least one `borg create` (your normal backup), `prune` and especially a `check` to see everything is in a good state. - check the output of `borg check` - if there is anything special, consider a `borg check --repair` followed by another `borg check`. - if everything is fine so far (borg check reports no issues), you can consider upgrading to 1.2.x. if not, please first fix any already existing issue. - if you want to play safer, first **create a backup of your borg repository**. - upgrade to latest borg 1.2.x release (you could use the fat binary from github releases page) - borg 1.2.6 has a security fix for the pre-1.2.5 archives spoofing vulnerability (CVE-2023-36811), see details and necessary upgrade procedure described above. - run `borg compact --cleanup-commits` to clean up a ton of 17 bytes long files in your repo caused by a borg 1.1 bug - run `borg check` again (now with borg 1.2.x) and check if there is anything special. - run `borg info` (with borg 1.2.x) to build the local pre12-meta cache (can take significant time, but after that it will be fast) - for more details see below. - check the compatibility notes (see below) and adapt your scripts, if needed. - if you run into any issues, please check the github issue tracker before posting new issues there or elsewhere. If you follow this procedure, you can help avoiding that we get a lot of "borg 1.2" issue reports that are not really 1.2 issues, but existed before and maybe just were not noticed. Compatibility notes: - matching of path patterns has been aligned with borg storing relative paths. Borg archives file paths without leading slashes. Previously, include/exclude patterns could contain leading slashes. You should check your patterns and remove leading slashes. - dropped support / testing for older Pythons, minimum requirement is 3.8. In case your OS does not provide Python >= 3.8, consider using our binary, which does not need an external Python interpreter. Or continue using borg 1.1.x, which is still supported. - freeing repository space only happens when "borg compact" is invoked. - mount: the default for --numeric-ids is False now (same as borg extract) - borg create --noatime is deprecated. Not storing atime is the default behaviour now (use --atime if you want to store the atime). - --prefix is deprecated, use -a / --glob-archives, see #6806 - list: corrected mix-up of "isomtime" and "mtime" formats. Previously, "isomtime" was the default but produced a verbose human format, while "mtime" produced a ISO-8601-like format. The behaviours have been swapped (so "mtime" is human, "isomtime" is ISO-like), and the default is now "mtime". "isomtime" is now a real ISO-8601 format ("T" between date and time, not a space). - create/recreate --list: file status for all files used to get announced *AFTER* the file (with borg < 1.2). Now, file status is announced *BEFORE* the file contents are processed. If the file status changes later (e.g. due to an error or a content change), the updated/final file status will be printed again. - removed deprecated-since-long stuff (deprecated since): - command "borg change-passphrase" (2017-02), use "borg key ..." - option "--keep-tag-files" (2017-01), use "--keep-exclude-tags" - option "--list-format" (2017-10), use "--format" - option "--ignore-inode" (2017-09), use "--files-cache" w/o "inode" - option "--no-files-cache" (2017-09), use "--files-cache=disabled" - removed BORG_HOSTNAME_IS_UNIQUE env var. to use borg you must implement one of these 2 scenarios: - 1) the combination of FQDN and result of uuid.getnode() must be unique and stable (this should be the case for almost everybody, except when having duplicate FQDN *and* MAC address or all-zero MAC address) - 2) if you are aware that 1) is not the case for you, you must set BORG_HOST_ID env var to something unique. - exit with 128 + signal number, #5161. if you have scripts expecting rc == 2 for a signal exit, you need to update them to check for >= 128. .. _changelog: Change Log ========== Version 1.4.0 (2024-07-03) -------------------------- For upgrade and compatibility hints, please also read the section "Upgrade Notes" above. Other changes: - vagrant: revive the buster64 box, RHEL8 has same glibc - tests: fix pytest_report_header, #8232 - docs: - mount: add examples using :: positional argument, #8255 - Installation: update Arch Linux repo name - update standalone binary section Version 1.4.0rc1 (2024-05-26) ----------------------------- Fixes: - setup.py: fix import error reporting for cythonize import, #8208 - setup.py: detect noexec build fs issue, #8208 Other changes: - changed insufficiently reserved length for log message, #8152 - use Python 3.11.9, Cython 3.0.10 and PyInstaller 6.7.0 for binary builds - docs: - use python 3.9 in cygwin install docs, fixes #8196 - recreate: remove experimental status - github CI: fix PKG_CONFIG_PATH for openssl 3.0 - vagrant: - add a ubuntu noble (24.04) VM - drop buster VM, fixes #8171 Version 1.4.0b2 (2024-03-31) ---------------------------- Fixes: - check: fix return code for index entry value discrepancies - benchmark: inherit options --rsh --remote-path, #8099 - sdist: dynamically compute readme (long_description) - create: deal with EBUSY, #8123 - No need to use OpenSSL 3.0 on OpenBSD, use LibreSSL. - fix Ctrl-C / SIGINT behaviour for pyinstaller-made binaries, #8155 New features: - create: add the slashdot hack, update docs, #4685 - upgrade --check-tam: check manifest TAM auth, exit with rc=1 if there are issues. - upgrade --check-archives-tam: check archives TAM auth, exit with rc=1 if there are issues. Other changes: - improve acl_get / acl_set error handling, improved/added tests, #8125 - remove bundled lz4/zstd/xxhash code (require the respective libs/headers), simplify setup.py, remove support for all BORG_USE_BUNDLED_*=YES, #8094 - require Cython 3.0.3 at least (fixes py312 memory leak), #8133 - allow msgpack 1.0.8, #8133 - init: better borg key export instructions - init: remove compatibility warning for borg <=1.0.8 The warning refers to a compatibility issue not relevant any more since borg 1.0.9 (released 2016-12). - locate libacl via pkgconfig - scripts/make.py: move clean, build_man, build_usage to there, so we do not need to invoke setup.py directly, update docs - docs: - how to run the testsuite using the dist package - add non-root deployment strategy (systemd / capabilities) - simplify TAM-related upgrade docs using the new commands - vagrant: - use python 3.11.8 - use pyinstaller 6.5.0 - add xxhash for macOS, add libxxhash-dev for debianoid systems - use openindiana/hipster box Version 1.4.0b1 (2024-01-21) ---------------------------- Fixes: - fix CommandError args, #8029 New features: - implement "borg version" (shows client and server version), #7829 Other changes: - better error msg for corrupted key data, #8016 - repository: give clean error msg for invalid nonce file, #7967 - check_can_create_repository: deal with PermissionErrors, #7016 - add ConnectionBrokenWithHint for BrokenPipeErrors and similar, #7016 - with-lock: catch exception, print error msg, #8022 - use cython 3.0.8 - modernize msgpack wrapper - docs: - add brew bundle instructions (macOS) - improve docs for borg with-lock, #8022 Version 1.4.0a1 (2024-01-01) ---------------------------- New features: - BORG_EXIT_CODES=modern: optional more specific return codes (for errors and warnings). The default value of this new environment variable is "legacy", which should result in a behaviour similar to borg 1.2 and older (only using rc 0, 1 and 2). "modern" exit codes are much more specific (see the internals/frontends docs). Fixes: - PATH: do not accept empty strings, #4221. This affects the cli interface of misc. commands (create, extract, diff, mount, ...) and they now will reject "" (empty string) given as a path. Other changes: - Python: require Python >= 3.9, drop support for 3.8, #6383 - Cython: require Cython >= 3.0, drop support for Cython 0.29.x, use 3str language level (default in cython3), #7978 - use pyinstaller 6.3.0 and python 3.11 for binary build, #7987 - msgpack: require >= 1.0.3, <= 1.0.7 - replace flake8 by ruff style/issue checker - tests: remove python-dateutil dependency - tests: move conftest.py to src/borg/testsuite, #6386 - move misc. config/metadata to pyproject.toml - vagrant: - use a freebsd 14 box, #6871 - use generic/openbsd7 box - use openssl 3 on macOS, FreeBSD, OpenBSD - remove ubuntu 20.04 "focal" box - remove debian 9 "stretch" box (remove stretch-based binary builds) - require recent setuptools and setuptools_scm - crypto: get rid of deprecated HMAC_* functions to avoid warnings. Instead, use hmac.digest from Python stdlib. Version 1.2.7 (2023-12-02) -------------------------- Fixes: - docs: CVE-2023-36811 upgrade steps: consider checkpoint archives, #7802 - check/compact: fix spurious reappearance of orphan chunks since borg 1.2, #6687 - this consists of 2 fixes: - for existing chunks: check --repair: recreate shadow index, #7897 #6687 - for newly created chunks: update shadow index when doing a double-put, #7896 #5661 If you have experienced issue #6687, you may want to run borg check --repair after upgrading to borg 1.2.7 to recreate the shadow index and get rid of the issue for existing chunks. - LockRoster.modify: no KeyError if element was already gone, #7937 - create --X-from-command: run subcommands with a clean environment, #7916 - list --sort-by: support "archive" as alias of "name", #7873 - fix rc and msg if arg parsing throws an exception, #7885 Other changes: - support and test on Python 3.12 - include unistd.h in _chunker.c (fix for Python 3.13) - allow msgpack 1.0.6 and 1.0.7 - TAM issues: show tracebacks, improve borg check logging, #7797 - replace "datetime.utcfromtimestamp" with custom helper to avoid deprecation warnings when using Python 3.12 - vagrant: - use generic/debian9 box, fixes #7579 - add VM with debian bookworm / test on OpenSSL 3.0.x. - docs: - not only attack/unsafe, can also be a fs issue, #7853 - point to CVE-2023-36811 upgrade steps from borg 1.1 to 1.2 upgrade steps, #7899 - upgrade steps needed for all kinds of repos (including "none" encryption mode), #7813 - upgrade steps: talk about consequences of borg check, #7816 - upgrade steps: remove period that could be interpreted as part of the command - automated-local.rst: use GPT UUID for consistent udev rule - create disk/partition sector backup by disk serial number, #7934 - update macOS hint about full disk access - clarify borg prune -a option description, #7871 - readthedocs: also build offline docs (HTMLzip), #7835 - frontends: add "check.rebuild_refcounts" message Version 1.2.6 (2023-08-31) -------------------------- Fixes: - The upgrade procedure docs as published with borg 1.2.5 did not work, if the repository had archives resulting from a borg rename or borg recreate operation. The updated docs now use BORG_WORKAROUNDS=ignore_invalid_archive_tam at some places to avoid that issue, #7791. See: fix pre-1.2.5 archives spoofing vulnerability (CVE-2023-36811), details and necessary upgrade procedure described above. Other changes: - updated 1.2.5 changelog entry: 1.2.5 already has the fix for rename/recreate. - remove cython restrictions. recommended is to build with cython 0.29.latest, because borg 1.2.x uses this since years and it is very stable. you can also try to build with cython 3.0.x, there is a good chance that it works. as a 3rd option, we also bundle the `*.c` files cython outputs in the release pypi package, so you can also just use these and not need cython at all. Version 1.2.5 (2023-08-30) -------------------------- Fixes: - Security: fix pre-1.2.5 archives spoofing vulnerability (CVE-2023-36811), see details and necessary upgrade procedure described above. - rename/recreate: correctly update resulting archive's TAM, see #7791 - create: do not try to read parent dir of recursion root, #7746 - extract: fix false warning about pattern never matching, #4110 - diff: remove surrogates before output, #7535 - compact: clear empty directories at end of compact process, #6823 - create --files-cache=size: fix crash, #7658 - keyfiles: improve key sanity check, #7561 - only warn about "invalid" chunker params, #7590 - ProgressIndicatorPercent: fix space computation for wide chars, #3027 - improve argparse validator error messages New features: - mount: make up volname if not given (macOS), #7690. macFUSE supports a volname mount option to give what finder displays on the desktop / in the directory view. if the user did not specify it, we make something up, because otherwise it would be "macFUSE Volume 0 (Python)" and hide the mountpoint directory name. - BORG_WORKAROUNDS=authenticated_no_key to extract from authenticated repos without key, #7700 Other changes: - add `utcnow()` helper function to avoid deprecated `datetime.utcnow()` - stay on latest Cython 0.29 (0.29.36) for borg 1.2.x (do not use Cython 3.0 yet) - docs: - move upgrade notes to own section, see #7546 - mount -olocal: how to show mount in finder's sidebar, #5321 - list: fix --pattern examples, #7611 - improve patterns help - incl./excl. options, path-from-stdin exclusiveness - obfuscation docs: markup fix, note about MAX_DATA_SIZE - --one-file-system: add macOS apfs notes, #4876 - improve --one-file-system help string, #5618 - rewrite borg check docs - improve the docs for --keep-within, #7687 - fix borg init command in environment.rst.inc - 1.1.x upgrade notes: more precise borg upgrade instructions, #3396 - tests: - fix repo reopen - avoid long ids in pytest output - check buzhash chunksize distribution, see #7586 Version 1.2.4 (2023-03-24) -------------------------- New features: - import-tar: add --ignore-zeros to process concatenated tars, #7432. - debug id-hash: computes file/chunk content id-hash, #7406 - diff: --content-only does not show mode/ctime/mtime changes, #7248 - diff: JSON strings in diff output are now sorted alphabetically Bug fixes: - xattrs: fix namespace processing on FreeBSD, #6997 - diff: fix path related bug seen when addressing deferred items. - debug get-obj/put-obj: always give chunkid as cli param, see #7290 (this is an incompatible change, see also borg debug id-hash) - extract: fix mtime when ResourceFork xattr is set (macOS specific), #7234 - recreate: without --chunker-params, do not re-chunk, #7337 - recreate: when --target is given, do not detect "nothing to do". use case: borg recreate -a src --target dst can be used to make a copy of an archive inside the same repository, #7254. - set .hardlink_master for ALL hardlinkable items, #7175 - locking: fix host, pid, tid order. tid (thread id) must be parsed as hex from lock file name. - update development.lock.txt, including a setuptools security fix, #7227 Other changes: - requirements: allow msgpack 1.0.5 also - upgrade Cython to 0.29.33 - hashindex minor fixes, refactor, tweaks, tests - use os.replace not os.rename - remove BORG_LIBB2_PREFIX (not used any more) - docs: - BORG_KEY_FILE: clarify docs, #7444 - update FAQ about locale/unicode issues, #6999 - improve mount options rendering, #7359 - make timestamps in manual pages reproducible - installation: update Fedora in distribution list, #7357 - tests: - fix test_size_on_disk_accurate for large st_blksize, #7250 - add same_ts_ns function and use it for relaxed timestamp comparisons - "auto" compressor tests: don't assume a specific size, do not assume zlib is better than lz4, #7363 - add test for extracted directory mtime - vagrant: - upgrade local freebsd 12.1 box -> generic/freebsd13 box (13.1) - use pythons > 3.8 which work on freebsd 13.1 - pyenv: also install python 3.11.1 for testing - pyenv: use python 3.10.1, 3.10.0 build is broken on freebsd Version 1.2.3 (2022-12-24) -------------------------- Fixes: - create: fix --list --dry-run output for directories, #7209 - diff/recreate: normalize chunker params before comparing them, #7079 - check: fix uninitialised variable if repo is completely empty, #7034 - xattrs: improve error handling, #6988 - fix args.paths related argparsing, #6994 - archive.save(): always use metadata from stats (e.g. nfiles, size, ...), #7072 - tar_filter: recognize .tar.zst as zstd, #7093 - get_chunker: fix missing sparse=False argument, #7056 - file_integrity.py: make sure file_fd is always closed on exit - repository: cleanup(): close segment before unlinking - repository: use os.replace instead of os.rename Other changes: - remove python < 3.7 compatibility code - do not use version_tuple placeholder in setuptools_scm template - CI: fix tox4 passenv issue, #7199 - vagrant: update to python 3.9.16, use the openbsd 7.1 box - misc. test suite and docs fixes / improvements - remove deprecated --prefix from docs, #7109 - Windows: use MSYS2 for Github CI, remove Appveyor CI Version 1.2.2 (2022-08-20) -------------------------- New features: - prune/delete --checkpoint-interval=1800 and ctrl-c/SIGINT support, #6284 Fixes: - SaveFile: use a custom mkstemp with mode support, #6933, #6400, #6786. This fixes umask/mode/ACL issues (and also "chmod not supported" exceptions seen in 1.2.1) of files updated using SaveFile, e.g. the repo config. - hashindex_compact: fix eval order (check idx before use), #5899 - create --paths-from-(stdin|command): normalize paths, #6778 - secure_erase: avoid collateral damage, #6768. If a hardlink copy of a repo was made and a new repo config shall be saved, do NOT fill in random garbage before deleting the previous repo config, because that would damage the hardlink copy. - list: fix {flags:} formatting, #6081 - check: try harder to create the key, #5719 - misc commands: ctrl-c must not kill other subprocesses, #6912 - borg create with a remote repo via ssh - borg create --content-from-command - borg create --paths-from-command - (de)compression filter process of import-tar / export-tar Other changes: - deprecate --prefix, use -a / --glob-archives, see #6806 - make setuptools happy ("package would be ignored"), #6874 - fix pyproject.toml to create a fixed _version.py file, compatible with both old and new setuptools_scm version, #6875 - automate asciinema screencasts - CI: test on macOS 12 without fuse / fuse tests (too troublesome on github CI due to kernel extensions needed by macFUSE) - tests: fix test_obfuscate byte accounting - repository: add debug logging for issue #6687 - _chunker.c: fix warnings on macOS - requirements.lock.txt: use the latest cython 0.29.32 - docs: - add info on man page installation, #6894 - update archive_progress json description about "finished", #6570 - json progress_percent: some values are optional, #4074 - FAQ: full quota / full disk, #5960 - correct shell syntax for installation using git Version 1.2.1 (2022-06-06) -------------------------- Fixes: - create: skip with warning if opening the parent dir of recursion root fails, #6374 - create: fix crash. metadata stream can produce all-zero chunks, #6587 - fix crash when computing stats, escape % chars in archive name, #6500 - fix transaction rollback: use files cache filename as found in txn.active/, #6353 - import-tar: kill filter process in case of borg exceptions, #6401 #6681 - import-tar: fix mtime type bug - ensure_dir: respect umask for created directory modes, #6400 - SaveFile: respect umask for final file mode, #6400 - check archive: improve error handling for corrupt archive metadata block, make robust_iterator more robust, #4777 - pre12-meta cache: do not use the cache if want_unique is True, #6612 - fix scp-style repo url parsing for ip v6 address, #6526 - mount -o versions: give clear error msg instead of crashing. it does not make sense to request versions view if you only look at 1 archive, but the code shall not crash in that case as it did, but give a clear error msg. - show_progress: add finished=true/false to archive_progress json, #6570 - delete/prune: fix --iec mode output (decimal vs. binary units), #6606 - info: fix authenticated mode repo to show "Encrypted: No", #6462 - diff: support presence change for blkdev, chrdev and fifo items, #6615 New features: - delete: add repository id and location to prompt, #6453 - borg debug dump-repo-objs --ghost: new --segment=S --offset=O options Other changes: - support python 3.11 - allow msgpack 1.0.4, #6716 - load_key: no key is same as empty key, #6441 - give a more helpful error msg for unsupported key formats, #6561 - better error msg for defect or unsupported repo configs, #6566 - docs: - document borg 1.2 pattern matching behavior change, #6407 Make clear that absolute paths always go into the matcher as if they are relative (without leading slash). Adapt all examples accordingly. - authentication primitives: improved security and performance infos - mention BORG_FILES_CACHE_SUFFIX as alternative to BORG_FILES_CACHE_TTL, #5602 - FAQ: add a hint about --debug-topic=files_cache - improve borg check --max-duration description - fix values of TAG bytes, #6515 - borg compact --cleanup-commits also runs a normal compaction, #6324 - virtualization speed tips - recommend umask for passphrase file perms - borg 1.2 is security supported - update link to ubuntu packages, #6485 - use --numeric-ids in pull mode docs - remove blake2 docs, blake2 code not bundled any more, #6371 - clarify on-disk order and size of segment file log entry fields, #6357 - docs building: do not transform --/--- to unicode dashes - tests: - check that borg does not require pytest for normal usage, fixes #6563 - fix OpenBSD symlink mode test failure, #2055 - vagrant: - darwin64: remove fakeroot, #6314 - update development.lock.txt - use pyinstaller 4.10 and python 3.9.13 for binary build - upgrade VMCPUS and xdistn from 4 to 16, maybe this speeds up the tests - crypto: - use hmac.compare_digest instead of ==, #6470 - hmac_sha256: replace own cython wrapper code by hmac.digest python stdlib (since py38) - hmac and blake2b minor optimizations and cleanups - removed some unused crypto related code, #6472 - avoid losing the key (potential use-after-free). this never could happen in 1.2 due to the way we use the code. The issue was discovered in master after other changes, so we also "fixed" it here before it bites us. - setup / build: - add pyproject.toml, fix sys.path, #6466 - setuptools_scm: also require it via pyproject.toml - allow extra compiler flags for every extension build - fix misc. C / Cython compiler warnings, deprecation warnings - fix zstd.h include for bundled zstd, #6369 - source using python 3.8 features: ``pyupgrade --py38-plus ./**/*.py`` Version 1.2.0 (2022-02-22 22:02:22 :-) -------------------------------------- Fixes: - diff: reduce memory consumption, fix is_hardlink_master, #6295 - compact: fix / improve freeable / freed space log output - derive really freed space from quota use before/after, #5679 - do not say "freeable", but "maybe freeable" (based on hint, unsure) - fix race conditions in internal SaveFile function, #6306 #6028 - implement internal safe_unlink (was: truncate_and_unlink) function more safely: usually it does not truncate any more, only under "disk full" circumstances and only if there is only one hardlink. see: https://github.com/borgbackup/borg/discussions/6286 Other changes: - info: use a pre12-meta cache to accelerate stats for borg < 1.2 archives. the first time borg info is invoked on a borg 1.1 repo, it can take a rather long time computing and caching some stats values for 1.1 archives, which borg 1.2 archives have in their archive metadata structure. be patient, esp. if you have lots of old archives. following invocations are much faster due to the cache. related change: add archive name to calc_stats progress display. - docs: - add borg 1.2 upgrade notes, #6217 - link to borg placeholders and borg patterns help - init: explain the encryption modes better - clarify usage of patternfile roots - put import-tar docs into same file as export-tar docs - explain the difference between a path that ends with or without a slash, #6297 Version 1.2.0rc1 (2022-02-05) ----------------------------- Fixes: - repo::archive location placeholder expansion fixes, #5826, #5998 - repository: fix intermediate commits, shall be at end of current segment - delete: don't commit if nothing was deleted, avoid cache sync, #6060 - argument parsing: accept some options only once, #6026 - disallow overwriting of existing keyfiles on init, #6036 - if ensure_dir() fails, give more informative error message, #5952 New features: - delete --force: do not ask when deleting a repo, #5941 Other changes: - requirements: exclude broken or incompatible-with-pyinstaller setuptools - add a requirements.d/development.lock.txt and use it for vagrant - tests: - added nonce-related tests - refactor: remove assert_true - vagrant: macos box tuning, netbsd box fixes, #5370, #5922 - docs: - update install docs / requirements docs, #6180 - borg mount / FUSE "versions" view is not experimental any more - --pattern* is not experimental any more, #6134 - impact of deleting path/to/repo/nonce, #5858 - key export: add examples, #6204 - ~/.config/borg/keys is not used for repokey keys, #6107 - excluded parent dir's metadata can't restore Version 1.2.0b4 (2022-01-23) ---------------------------- Fixes: - create: fix passing device nodes and symlinks to --paths-from-stdin, #6009 - create --dry-run: fix display of kept tagfile, #5834 - check --repair: fix missing parameter in "did not consistently fail" msg, #5822 - fix hardlinkable file type check, #6037 - list: remove placeholders for shake_* hashes, #6082 - prune: handle case of calling prune_split when there are no archives, #6015 - benchmark crud: make sure cleanup of borg-test-data files/dir happens, #5630 - do not show archive name in repository-related error msgs, #6014 - prettier error msg (no stacktrace) if exclude file is missing, #5734 - do not require BORG_CONFIG_DIR if BORG_{SECURITY,KEYS}_DIR are set, #5979 - fix pyinstaller detection for dir-mode, #5897 - atomically create the CACHE_TAG file, #6028 - deal with the SaveFile/SyncFile race, docs, see #6056 708a5853 - avoid expanding path into LHS of formatting operation + tests, #6064 #6063 - repository: quota / compactable computation fixes - info: emit repo info even if repo has 0 archives + test, #6120 New features: - check --repair: significantly speed up search for next valid object in segment, #6022 - check: add progress indicator for archive check, #5809 - create: add retry_erofs workaround for O_NOATIME issue on volume shadow copies in WSL1, #6024 - create: allow --files-cache=size (this is potentially dangerous, use on your own risk), #5686 - import-tar: implement import-tar to complement export-tar, #2233 - implement BORG_SELFTEST env variable (can be carefully used to speedup borg hosting), #5871 - key export: print key if path is '-' or not given, #6092 - list --format: Add command_line to format keys Other changes: - pypi metadata: alpha -> beta - require python 3.8+, #5975 - use pyinstaller 4.7 - allow msgpack 1.0.3 - upgrade to bundled xxhash to 0.8.1 - import-tar / export-tar: tar file related changes: - check for short tarfile extensions - add .lz4 and .zstd - fix docs about extensions and decompression commands - add github codeql analysis, #6148 - vagrant: - box updates / add new boxes / remove outdated and broken boxes - use Python 3.9.10 (incl. binary builds) and 3.10.0 - fix pyenv initialisation, #5798 - fix vagrant scp on macOS, #5921 - use macfuse instead of osxfuse - shell completions: - update shell completions to 1.1.17, #5923 - remove BORG_LIBC completion, since 9914968 borg no longer uses find_library(). - docs: - fixed readme.rst irc webchat link (we use libera chat now, not freenode) - fix exceptions thrown by `setup.py build_man` - check --repair: recommend checking hw before check --repair, #5855 - check --verify-data: clarify and document conflict with --repository-only, #5808 - serve: improve ssh forced commands docs, #6083 - list: improve docs for `borg list` --format, #6061 - list: remove --list-format from borg list - FAQ: fix manifest-timestamp path (inside security dir) - fix the broken link to .nix file - document behavior for filesystems with inconsistent inodes, #5770 - clarify user_id vs uid for fuse, #5723 - clarify pattern usage with commands, #5176 - clarify pp vs. pf pattern type, #5300 - update referenced freebsd/macOS versions used for binary build, #5942 - pull mode: add some warnings, #5827 - clarify "you will need key and passphrase" borg init warning, #4622 - add missing leading slashes in help patterns, #5857 - add info on renaming repositories, #5240 - check: add notice about defective hardware, #5753 - mention tar --compare (compare archive to fs files), #5880 - add note about grandfather-father-son backup retention policy / rotation scheme, #6006 - permissions note rewritten to make it less confusing - create github security policy - remove leftovers of BORG_HOSTNAME_IS_UNIQUE - excluded parent dir's metadata can't restore. (#6062) - if parent dir is not extracted, we do not have its metadata - clarify who starts the remote agent Version 1.2.0b3 (2021-05-12) ---------------------------- Fixes: - create: fix --progress --log-json, #4360#issuecomment-774580052 - do not load files cache for commands not using it, #5673 - fix repeated cache tag file writing bug New features: - create/recreate: print preliminary file status early, #5417 - create/extract: add --noxattrs and --noacls options, #3955 - create: verbose files cache logging via --debug-topic=files_cache, #5659 - mount: implement --numeric-ids (default: False!), #2377 - diff: add --json-lines option - info / create --stats: add --iec option to print sizes in powers of 1024. Other changes: - create: add --upload-(ratelimit|buffer), deprecate --remote-* options, #5611 - create/extract/mount: add --numeric-ids, deprecate --numeric-owner option, #5724 - config: accept non-int value for max_segment_size / storage_quota - use PyInstaller v4.3, #5671 - vagrant: use Python 3.9.5 to build binaries - tox.ini: modernize and enable execution without preinstalling deps - cleanup code style checks - get rid of distutils, use setuptools+packaging - github CI: test on Python 3.10-dev - check: missing / healed chunks: always tell chunk ID, #5704 - docs: - remove bad /var/cache exclusion in example commands, #5625 - misc. fixes and improvements, esp. for macOS - add unsafe workaround to use an old repo copy, #5722 Version 1.2.0b2 (2021-02-06) ---------------------------- Fixes: - create: do not recurse into duplicate roots, #5603 - create: only print stats if not ctrl-c'ed, fixes traceback, #5668 - extract: improve exception handling when setting xattrs, #5092. emit a warning message giving the path, xattr key and error message. continue trying to restore other xattrs and bsdflags of the same file after an exception with xattr-setting happened. - export-tar: fix memory leak with ssh: remote repository, #5568. fix potential memory leak with ssh: remote repository with partial extraction. - remove empty shadowed_segments lists, #5275 - fix bad default: manifest.archives.list(consider_checkpoints=False), fixes tracebacks / KeyErros for missing objects in ChunkIndex, #5668 New features: - create: improve sparse file support - create --sparse (detect sparse file holes) and file map support, only for the "fixed" chunker, #14 - detect all-zero chunks in read data in "buzhash" and "fixed" chunkers - cached_hash: use a small LRU cache to accelerate all-zero chunks hashing - use cached_hash also to generate all-zero replacement chunks - create --remote-buffer, add a upload buffer for remote repos, #5574 - prune: keep oldest archive when retention target not met Other changes: - use blake2 from python 3.6+ hashlib (this removes the requirement for libb2 and the bundled blake2 code) - also accept msgpack up to 1.0.2. exclude 1.0.1 though, which had some issues (not sure they affect borg). - create: add repository location to --stats output, #5491 - check: debug log the segment filename - delete: add a --list switch to borg delete, #5116 - borg debug dump-hints - implemented to e.g. to look at shadow_index - Tab completion support for additional archives for 'borg delete' - refactor: have one borg.constants.zero all-zero bytes object - refactor shadow_index updating repo.put/delete, #5661, #5636. - docs: - add another case of attempted hardlink usage - fix description of borg upgrade hardlink usage, #5518 - use HTTPS everywhere - add examples for --paths-from-stdin, --paths-from-command, --paths-separator, #5644 - fix typos/grammar - update docs for dev environment installation instructions - recommend running tests only on installed versions for setup - add badge with current status of package - vagrant: - use brew install --cask ..., #5557 - use Python 3.9.1 and PyInstaller 4.1 to build the borg binary Version 1.2.0b1 (2020-12-06) ---------------------------- Fixes: - BORG_CACHE_DIR crashing borg if empty, atomic handling of recursive directory creation, #5216 - fix --dry-run and --stats coexistence, #5415 - allow EIO with warning when trying to hardlink, #4336 - export-tar: set tar format to GNU_FORMAT explicitly, #5274 - use --timestamp for {utcnow} and {now} if given, #5189 - make timestamp helper timezone-aware New features: - create: implement --paths-from-stdin and --paths-from-command, see #5492. These switches read paths to archive from stdin. Delimiter can specified by --paths-delimiter=DELIM. Paths read will be added honoring every option but exclusion options and --one-file-system. borg won't recurse into directories. - 'obfuscate' pseudo compressor obfuscates compressed chunk size in repo - add pyfuse3 (successor of llfuse) as an alternative lowlevel fuse implementation to llfuse (deprecated), #5407. FUSE implementation can be switched via env var BORG_FUSE_IMPL. - allow appending to the files cache filename with BORG_FILES_CACHE_SUFFIX - create: implement --stdin-mode, --stdin-user and --stdin-group, #5333 Other changes: - split recursive directory walking/processing into directory walking and item processing. - fix warning by importing setuptools before distutils. - debug info: include infos about FUSE implementation, #5546 - testing: - add a test for the hashindex corruption bug, #5531 #4829 - move away from travis-ci, use github actions, #5528 #5467 - test both on fuse2 and fuse3 - upload coverage reports to codecov - fix spurious failure in test_cache_files, #5438 - add tests for Location.with_timestamp - tox: add a non-fuse env to the envlist - vagrant: - use python 3.7.latest and pyinstaller 4.0 for binary creation - pyinstaller: compute basepath from spec file location - vagrant: updates/fixes for archlinux box, #5543 - docs: - "filename with spaces" example added to exclude file, #5236 - add a hint about sleeping computer, #5301 - how to adjust macOS >= Catalina security settings, #5303 - process/policy for adding new compression algorithms - updated docs about hacked backup client, #5480 - improve ansible deployment docs, make it more generic - how to approach borg speed issues, give speed example, #5371 - fix mathematical inaccuracy about chunk size, #5336 - add example for excluding content using --pattern cli option - clarify borg create's '--one-file-system' option, #4009 - improve docs/FAQ about append-only remote repos, #5497 - fix reST markup issues, labels - add infos about contributor retirement status Version 1.2.0a9 (2020-10-05) ---------------------------- Fixes: - fix memory leak related to preloading, #5202 - check --repair: fix potential data loss, #5325 - persist shadow_index in between borg runs, #4830 - fix hardlinked CACHEDIR.TAG processing, #4911 - --read-special: .part files also should be regular files, #5217 - allow server side enforcing of umask, --umask is for the local borg process only (see docs), #4947 - exit with 128 + signal number, #5161 - borg config --list does not show last_segment_checked, #5159 - locking: - fix ExclusiveLock race condition bug, #4923 - fix race condition in lock migration, #4953 - fix locking on openindiana, #5271 New features: - --content-from-command: create archive using stdout of given command, #5174 - allow key-import + BORG_KEY_FILE to create key files - build directory-based binary for macOS to avoid Gatekeeper delays Other changes: - upgrade bundled zstd to 1.4.5 - upgrade bundled xxhash to 0.8.0, #5362 - if self test fails, also point to OS and hardware, #5334 - misc. shell completions fixes/updates, rewrite zsh completion - prettier error message when archive gets too big, #5307 - stop relying on `false` exiting with status code 1 - rephrase some warnings, #5164 - parseformat: unnecessary calls removed, #5169 - testing: - enable Python3.9 env for test suite and VMs, #5373 - drop python 3.5, #5344 - misc. vagrant fixes/updates - misc. testing fixes, #5196 - docs: - add ssh-agent pull backup method to doc, #5288 - mention double --force in prune docs - update Homebrew install instructions, #5185 - better description of how cache and rebuilds of it work and how the workaround applies to that - point to borg create --list item flags in recreate usage, #5165 - add a note to create from stdin regarding files cache, #5180 - add security faq explaining AES-CTR crypto issues, #5254 - clarify --exclude-if-present in recreate, #5193 - add socat pull mode, #5150, #900 - move content of resources doc page to community project, #2088 - explain hash collision, #4884 - clarify --recompress option, #5154 Version 1.2.0a8 (2020-04-22) ---------------------------- Fixes: - fixed potential index corruption / data loss issue due to bug in hashindex_set, #4829. Please read and follow the more detailed notes close to the top of this document. - fix crash when upgrading erroneous hints file, #4922 - commit-time free space calc: ignore bad compact map entries, #4796 - info: if the archive doesn't exist, print a pretty message, #4793 - --prefix / -P: fix processing, avoid argparse issue, #4769 - ignore EACCES (errno 13) when hardlinking, #4730 - add a try catch when formatting the info string, #4818 - check: do not stumble over invalid item key, #4845 - update prevalence of env vars to set config and cache paths - mount: fix FUSE low linear read speed on large files, #5032 - extract: fix confusing output of borg extract --list --strip-components, #4934 - recreate: support --timestamp option, #4745 - fix ProgressIndicator msgids (JSON output), #4935 - fuse: set f_namemax in statfs result, #2684 - accept absolute paths on windows - pyinstaller: work around issue with setuptools > 44 New features: - chunker speedup (plus regression test) - added --consider-checkpoints and related test, #4788 - added --noflags option, deprecate --nobsdflags option, #4489 - compact: add --threshold option, #4674 - mount: add birthtime to FUSE entries - support platforms with no os.link, #4901 - if we don't have os.link, we just extract another copy instead of making a hardlink. - move sync_file_range to its own extension for better platform compatibility. - new --bypass-lock option to bypass locking, e.g. for read-only repos - accept absolute paths by removing leading slashes in patterns of all sorts but re: style, #4029 - delete: new --keep-security-info option Other changes: - support msgpack 0.6.2 and 1.0.0, #5065 - upgrade bundled zstd to 1.4.4 - upgrade bundled lz4 to 1.9.2 - upgrade xxhash to 0.7.3 - require recent enough llfuse for birthtime support, #5064 - only store compressed data if the result actually is smaller, #4516 - check: improve error output for matching index size, see #4829 - ignore --stats when given with --dry-run, but continue, #4373 - replaced usage of os.statvfs with shutil.disk_usage (better cross-platform support). - fuse: remove unneeded version check and compat code, micro opts - docs: - improve description of path variables - document how to completely delete data, #2929 - add FAQ about Borg config dir, #4941 - add docs about errors not printed as JSON, #4073 - update usage_general.rst.inc - added "Will move with BORG_CONFIG_DIR variable unless specified." to BORG_SECURITY_DIR info. - put BORG_SECURITY_DIR immediately below BORG_CONFIG_DIR (and moved BORG_CACHE_DIR up before them). - add paragraph regarding cache security assumptions, #4900 - tell about borg cache security precautions - add FAQ describing difference between a local repo vs. repo on a server. - document how to test exclusion patterns without performing an actual backup - create: tell that "Calculating size" time and space needs are caused by --progress - fix/improve documentation for @api decorator, #4674 - add a pull backup / push restore how-to, #1552 - fix man pages creation, #4752 - more general FAQ for backup and retain original paths, #4532 - explain difference between --exclude and --pattern, #4118 - add FAQ for preventing SSH timeout in extract, #3866 - improve password FAQ (decrease pw length, add -w 0 option to base64 to prevent line wrap), #4591 - add note about patterns and stored paths, #4160 - add upgrade of tools to pip installation how-to, #5090 - document one cause of orphaned chunks in check command, #2295 - clean up the whole check usage paragraph - FAQ: linked recommended restrictions to ssh public keys on borg servers, #4946 - fixed "doc downplays severity of Nonce reuse issue", #4883 - borg repo restore instructions needed, #3428 - new FAQ: A repo is corrupt and must be replaced with an older repo. - clarify borg init's encryption modes - native windows port: - update README_WINDOWS.rst - updated pyinstaller spec file to support windows builds - testing / CI: - improved travis config / install script, improved macOS builds - allow osx builds to fail, #4955 - Windows 10 build on Appveyor CI - vagrant: - upgrade pyinstaller to v3.5 + patch - use py369 for binary build, add py380 for tests - fix issue in stretch VM hanging at grub installation - add a debian buster and a ubuntu focal VM - update darwin box to 10.12 - upgrade FreeBSD box to 12.1 - fix debianoid virtualenv packages - use pyenv in freebsd64 VM - remove the flake8 test - darwin: avoid error if pkg is already installed - debianoid: don't interactively ask questions Version 1.2.0a7 (2019-09-07) ---------------------------- Fixes: - slave hardlinks extraction issue, see #4350 - extract: fix KeyError for "partial" extraction, #4607 - preload chunks for hardlink slaves w/o preloaded master, #4350 - fix preloading for old remote servers, #4652 - fix partial extract for hardlinked contentless file types, #4725 - Repository.open: use stat() to check for repo dir, #4695 - Repository.check_can_create_repository: use stat() to check, ~ #4695. - SecurityManager.known(): check all files, #4614 - after double-force delete, warn about necessary repair, #4704 - cope with ANY error when importing pytest into borg.testsuite, #4652 - fix invalid archive error message - setup.py: fix detection of missing Cython - filter out selinux xattrs, #4574 - location arg - should it be optional? #4541 - enable placeholder usage in --comment, #4559 - use whitelist approach for borg serve, #4097 New features: - minimal native Windows support, see windows readme (work in progress) - create: first ctrl-c (SIGINT) triggers checkpoint and abort, #4606 - new BORG_WORKAROUNDS mechanism, basesyncfile, #4710 - remove WSL autodetection. if WSL still has this problem, you need to set BORG_WORKAROUNDS=basesyncfile in the borg process environment to work around it. - support xxh64 checksum in addition to the hashlib hashes in borg list - enable placeholder usage in all extra archive arguments - enable placeholder usage in --comment, #4559 - enable placeholder usage in --glob-archives, #4495 - ability to use a system-provided version of "xxhash" - create: - changed the default behaviour to not store the atime of fs items. atime is often rather not interesting and fragile - it easily changes even if nothing else has changed and, if stored into the archive, spoils deduplication of the archive metadata stream. - if you give the --noatime option, borg will output a deprecation warning because it is currently ignored / does nothing. Please remove the --noatime option when using borg 1.2. - added a --atime option for storing files' atime into an archive Other changes: - argparser: always use REPOSITORY in metavar - do not check python/libc for borg serve, #4483 - small borg compact improvements, #4522 - compact: log freed space at INFO level - tests: - tox / travis: add testing on py38-dev - fix broken test that relied on improper zlib assumptions - pure-py msgpack warning shall not make a lot of tests fail, #4558 - rename test_mount_hardlinks to test_fuse_mount_hardlinks (master) - vagrant: add up-to-date openindiana box (py35, openssl10) - get rid of confusing coverage warning, #2069 - docs: - reiterate that 'file cache names are absolute' in FAQ, mention bind mount solution, #4738 - add restore docs, #4670 - updated docs to cover use of temp directory on remote, #4545 - add a push-style example to borg-create(1), #4613 - timestamps in the files cache are now usually ctime, #4583 - benchmark crud: clarify that space is used until compact - update documentation of borg create, corrects a mention of borg 1.1 as a future version. - fix osxfuse github link in installation docs - how to supply a passphrase, use crypto devices, #4549 - extract: document limitation "needs empty destination", #4598 - update macOS Brew link - add note about software for automating backup - compact: improve docs, - README: new URL for funding options Version 1.2.0a6 (2019-04-22) ---------------------------- Fixes: - delete / prune: consider part files correctly for stats, #4507 - fix "all archives" stats considering part files, #4329 - create: only run stat_simple_attrs() once - create: --stats does not work with --dry-run, exit with error msg, #4373 - give "invalid repo" error msg if repo config not found, #4411 New features: - display msgpack version as part of sysinfo (e.g. in tracebacks) Other changes: - docs: - sdd "SSH Configuration" section, #4493, #3988, #636, #4485 - better document borg check --max-duration, #4473 - sorted commands help in multiple steps, #4471 - testing: - travis: use py 3.5.3 and 3.6.7 on macOS to get a pyenv-based python build with openssl 1.1 - vagrant: use py 3.5.3 and 3.6.8 on darwin64 VM to build python and borg with openssl 1.1 - pytest: -v and default XDISTN to 1, #4481 Version 1.2.0a5 (2019-03-21) ---------------------------- Fixes: - warn if a file has changed while being backed up, #1750 - lrucache: regularly remove old FDs, #4427 - borg command shall terminate with rc 2 for ImportErrors, #4424 - make freebsd xattr platform code api compatible with linux, #3952 Other changes: - major setup code refactoring (especially how libraries like openssl, liblz4, libzstd, libb2 are discovered and how it falls back to code bundled with borg), new: uses pkg-config now (and needs python "pkgconfig" package installed), #1925 if you are a borg package maintainer, please try packaging this (see comments in setup.py). - Vagrantfile: add zstd, reorder, build env vars, #4444 - travis: install script improvements - update shell completions - docs: - add a sample logging.conf in docs/misc, #4380 - fix spelling errors - update requirements / install docs, #4374 Version 1.2.0a4 (2019-03-11) ---------------------------- Fixes: - do not use O_NONBLOCK for special files, like FIFOs, block and char devices when using --read-special. fixes backing up FIFOs. fixes to test. #4394 - more LibreSSL build fixes: LibreSSL has HMAC_CTX_free and HMAC_CTX_new New features: - check: incremental repo check (only checks crc32 for segment entries), #1657 borg check --repository-only --max-duration SECONDS ... - delete: timestamp for borg delete --info added, #4359 Other changes: - redo stale lock handling, #3986 drop BORG_HOSTNAME_IS_UNIQUE (please use BORG_HOST_ID if needed). borg now always assumes it has a unique host id - either automatically from fqdn plus uuid.getnode() or overridden via BORG_HOST_ID. - docs: - added Alpine Linux to distribution list - elaborate on append-only mode docs - vagrant: - darwin: new 10.12 box - freebsd: new 12.0 box - openbsd: new 6.4 box - misc. updates / fixes Version 1.2.0a3 (2019-02-26) ---------------------------- Fixes: - LibreSSL build fixes, #4403 - dummy ACL/xattr code fixes (used by OpenBSD and others), #4403 - create: fix openat/statat issues for root directory, #4405 Version 1.2.0a2 and earlier (2019-02-24) ---------------------------------------- New features: - compact: "borg compact" needs to be used to free repository space by compacting the segments (reading sparse segments, rewriting still needed data to new segments, deleting the sparse segments). Borg < 1.2 invoked compaction automatically at the end of each repository writing command. Borg >= 1.2 does not do that any more to give better speed, more control, more segment file stability (== less stuff moving to newer segments) and more robustness. See the docs about "borg compact" for more details. - "borg compact --cleanup-commits" is to cleanup the tons of 17byte long commit-only segment files caused by borg 1.1.x issue #2850. Invoke this once after upgrading (the server side) borg to 1.2. Compaction now automatically removes unneeded commit-only segment files. - prune: Show which rule was applied to keep archive, #2886 - add fixed blocksize chunker (see --chunker-params docs), #1086 Fixes: - avoid stale filehandle issues, #3265 - use more FDs, avoid race conditions on active fs, #906, #908, #1038 - add O_NOFOLLOW to base flags, #908 - compact: - require >10% freeable space in a segment, #2985 - repository compaction now automatically removes unneeded 17byte commit-only segments, #2850 - make swidth available on all posix platforms, #2667 Other changes: - repository: better speed and less stuff moving around by using separate segment files for manifest DELETEs and PUTs, #3947 - use pyinstaller v3.3.1 to build binaries - update bundled zstd code to 1.3.8, #4210 - update bundled lz4 code to 1.8.3, #4209 - msgpack: - switch to recent "msgpack" pypi pkg name, #3890 - wrap msgpack to avoid future compat complications, #3632, #2738 - support msgpack 0.6.0 and 0.6.1, #4220, #4308 - llfuse: modernize / simplify llfuse version requirements - code refactorings / internal improvements: - include size/csize/nfiles[_parts] stats into archive, #3241 - calc_stats: use archive stats metadata, if available - crypto: refactored crypto to use an AEAD style API - crypto: new AES-OCB, CHACHA20-POLY1305 - create: use less syscalls by not using a python file obj, #906, #3962 - diff: refactor the diff functionality to new ItemDiff class, #2475 - archive: create FilesystemObjectProcessors class - helpers: make a package, split into smaller modules - xattrs: move to platform package, use cython instead ctypes, #2495 - xattrs/acls/bsdflags: misc. code/api optimizations - FUSE: separate creation of filesystem from implementation of llfuse funcs, #3042 - FUSE: use unpacker.tell() instead of deprecated write_bytes, #3899 - setup.py: move build_man / build_usage code to setup_docs.py - setup.py: update to use a newer Cython/setuptools API for compiling .pyx -> .c, #3788 - use python 3.5's os.scandir / os.set_blocking - multithreading preparations (not used yet): - item.to_optr(), Item.from_optr() - fix chunker holding the GIL during blocking I/O - C code portability / basic MSC compatibility, #4147, #2677 - testing: - vagrant: new VMs for linux/bsd/darwin, most with OpenSSL 1.1 and py36 Version 1.1.18 (2022-06-05) --------------------------- Compatibility notes: - When upgrading from borg 1.0.x to 1.1.x, please note: - read all the compatibility notes for 1.1.0*, starting from 1.1.0b1. - borg upgrade: you do not need to and you also should not run it. There is one exception though: If you upgrade from an unpatched borg < 1.0.9, please read that section above: "Pre-1.0.9 manifest spoofing vulnerability (CVE-2016-10099)" - borg might ask some security-related questions once after upgrading. You can answer them either manually or via environment variable. One known case is if you use unencrypted repositories, then it will ask about a unknown unencrypted repository one time. - your first backup with 1.1.x might be significantly slower (it might completely read, chunk, hash a lot files) - this is due to the --files-cache mode change (and happens every time you change mode). You can avoid the one-time slowdown by using the pre-1.1.0rc4-compatible mode (but that is less safe for detecting changed files than the default). See the --files-cache docs for details. - 1.1.11 removes WSL autodetection (Windows 10 Subsystem for Linux). If WSL still has a problem with sync_file_range, you need to set BORG_WORKAROUNDS=basesyncfile in the borg process environment to work around the WSL issue. - 1.1.14 changes return codes due to a bug fix: In case you have scripts expecting rc == 2 for a signal exit, you need to update them to check for >= 128 (as documented since long). - 1.1.15 drops python 3.4 support, minimum requirement is 3.5 now. - 1.1.17 install_requires the "packaging" pypi package now. New features: - check --repair: significantly speed up search for next valid object in segment, #6022 - create: add retry_erofs workaround for O_NOATIME issue on volume shadow copies in WSL1, #6024 - key export: display key if path is '-' or not given, #6092 - list --format: add command_line to format keys, #6108 Fixes: - check: improve error handling for corrupt archive metadata block, make robust_iterator more robust, #4777 - diff: support presence change for blkdev, chrdev and fifo items, #6483 - diff: reduce memory consumption, fix is_hardlink_master - init: disallow overwriting of existing keyfiles - info: fix authenticated mode repo to show "Encrypted: No", #6462 - info: emit repo info even if repo has 0 archives, #6120 - list: remove placeholders for shake_* hashes, #6082 - mount -o versions: give clear error msg instead of crashing - show_progress: add finished=true/false to archive_progress json, #6570 - fix hardlinkable file type check, #6037 - do not show archive name in error msgs referring to the repository, #6023 - prettier error msg (no stacktrace) if exclude file is missing, #5734 - do not require BORG_CONFIG_DIR if BORG_{SECURITY,KEYS}_DIR are set, #5979 - atomically create the CACHE_TAG file, #6028 - deal with the SaveFile/SyncFile race, docs, see #6176 5c5b59bc9 - avoid expanding path into LHS of formatting operation + tests, #6064 #6063 - repository: quota / compactable computation fixes, #6119. This is mainly to keep the repo code in sync with borg 1.2. As borg 1.1 compacts immediately, there was not really an issue with this in 1.1. - fix transaction rollback: use files cache filename as found in txn.active, #6353 - do not load files cache for commands not using it, fixes #5673 - fix scp repo url parsing for ip v6 addrs, #6526 - repo::archive location placeholder expansion fixes, #5826, #5998 - use expanded location for log output - support placeholder expansion for BORG_REPO env var - respect umask for created directory and file modes, #6400 - safer truncate_and_unlink implementation Other changes: - upgrade bundled xxhash code to 0.8.1 - fix xxh64 related build (setup.py and post-0.8.1 patch for static_assert). The patch was required to build the bundled xxhash code on FreeBSD, see https://github.com/Cyan4973/xxHash/pull/670 - msgpack build: remove endianness macro, #6105 - update and fix shell completions - fuse: remove unneeded version check and compat code - delete --force: do not ask when deleting a repo, #5941 - delete: don't commit if nothing was deleted, avoid cache sync, #6060 - delete: add repository id and location to prompt - compact segments: improve freeable / freed space log output, #5679 - if ensure_dir() fails, give more informative error message, #5952 - load_key: no key is same as empty key, #6441 - better error msg for defect or unsupported repo configs, #6566 - use hmac.compare_digest instead of ==, #6470 - implement more standard hashindex.setdefault behaviour - remove stray punctuation from secure-erase message - add development.lock.txt, use a real python 3.5 to generate frozen reqs - setuptools 60.7.0 breaks pyinstaller, #6246 - setup.py clean2 was added to work around some setuptools customizability limitation. - allow extra compiler flags for every extension build - C code: make switch fallthrough explicit - Cython code: fix "useless trailing comma" cython warnings - requirements.lock.txt: use the latest cython 0.29.30 - fix compilation warnings: ‘PyUnicode_AsUnicode’ is deprecated - docs: - ~/.config/borg/keys is not used for repokey keys, #6107 - excluded parent dir's metadata can't restore, #6062 - permissions note rewritten to make it less confusing, #5490 - add note about grandfather-father-son backup retention policy / rotation scheme - clarify who starts the remote agent (borg serve) - test/improve pull backup docs, #5903 - document the socat pull mode described in #900 #515ß - borg serve: improve ssh forced commands docs, #6083 - improve docs for borg list --format, #6080 - fix the broken link to .nix file - clarify pattern usage with commands, #5176 - clarify user_id vs uid for fuse, #5723 - fix binary build freebsd/macOS version, #5942 - FAQ: fix manifest-timestamp path, #6016 - remove duplicate faq entries, #5926 - fix sphinx warnings, #5919 - virtualisation speed tips - fix values of TAG bytes, #6515 - recommend umask for passphrase file perms - update link to ubuntu packages, #6485 - clarify on-disk order and size of log entry fields, #6357 - do not transform --/--- to unicode dashes - improve linking inside docs, link to borg_placeholders, link to borg_patterns - use same phrasing in misc. help texts - borg init: explain the encryption modes better - explain the difference between a path that ends with or without a slash, #6297 - clarify usage of patternfile roots, #6242 - borg key export: add examples - updates about features not experimental any more: FUSE "versions" view, --pattern*, #6134 - fix/update cygwin package requirements - impact of deleting path/to/repo/nonce, #5858 - warn about tampered server nonce - mention BORG_FILES_CACHE_SUFFIX as alternative to BORG_FILES_CACHE_TTL, #5602 - add a troubleshooting note about "is not a valid repository" to the FAQ - vagrant / CI / testing: - misc. fixes and updates, new python versions - macOS on github: re-enable fuse2 testing by downgrading to older macOS, #6099 - fix OpenBSD symlink mode test failure, #2055 - use the generic/openbsd6 box - strengthen the test: we can read data w/o nonces - add tests for path/to/repo/nonce deletion - darwin64: backport some tunings from master - darwin64: remove fakeroot, #6314 - darwin64: fix vagrant scp, #5921 - darwin64: use macfuse instead of osxfuse - add ubuntu "jammy" 22.04 LTS VM - adapt memory for openindiana64 and darwin64 Version 1.1.17 (2021-07-12) --------------------------- Compatibility notes: - When upgrading from borg 1.0.x to 1.1.x, please note: - read all the compatibility notes for 1.1.0*, starting from 1.1.0b1. - borg upgrade: you do not need to and you also should not run it. There is one exception though: If you upgrade from an unpatched borg < 1.0.9, please read that section above: "Pre-1.0.9 manifest spoofing vulnerability (CVE-2016-10099)" - borg might ask some security-related questions once after upgrading. You can answer them either manually or via environment variable. One known case is if you use unencrypted repositories, then it will ask about a unknown unencrypted repository one time. - your first backup with 1.1.x might be significantly slower (it might completely read, chunk, hash a lot files) - this is due to the --files-cache mode change (and happens every time you change mode). You can avoid the one-time slowdown by using the pre-1.1.0rc4-compatible mode (but that is less safe for detecting changed files than the default). See the --files-cache docs for details. - 1.1.11 removes WSL autodetection (Windows 10 Subsystem for Linux). If WSL still has a problem with sync_file_range, you need to set BORG_WORKAROUNDS=basesyncfile in the borg process environment to work around the WSL issue. - 1.1.14 changes return codes due to a bug fix: In case you have scripts expecting rc == 2 for a signal exit, you need to update them to check for >= 128 (as documented since long). - 1.1.15 drops python 3.4 support, minimum requirement is 3.5 now. - 1.1.17 install_requires the "packaging" pypi package now. Fixes: - pyinstaller dir-mode: fix pyi detection / LIBPATH treatment, #5897 - handle crash due to kill stale lock race, #5828 - fix BORG_CACHE_DIR crashing borg if empty, #5216 - create --dry-run: fix display of kept tagfile, #5834 - fix missing parameter in "did not consistently fail" msg, #5822 - missing / healed chunks: always tell chunk ID, #5704 - benchmark: make sure cleanup happens even on exceptions, #5630 New features: - implement BORG_SELFTEST env variable, #5871. this can be used to accelerate borg startup a bit. not recommended for normal usage, but borg mass hosters with a lot of borg invocations can save some resources with this. on my laptop, this saved ~100ms cpu time (sys+user) per borg command invocation. - implement BORG_LIBC env variable to give the libc filename, #5870. you can use this if a borg does not find your libc. - check: add progress indicator for archive check. - allow --files-cache=size (not recommended, make sure you know what you do) Other changes: - Python 3.10 now officially supported! we test on py310-dev on github CI since a while and now also on the vagrant machines, so it should work ok. - github CI: test on py310 (again) - get rid of distutils, use packaging and setuptools. distutils is deprecated and gives warnings on py 3.10. - setup.py: rename "clean" to "clean2" to avoid shadowing the "clean" command. - remove libc filename fallback for the BSDs (there is no "usual" name) - cleanup flake8 checks, fix some pep8 violations. - docs building: replace deprecated function ".add_stylesheet()" for Sphinx 4 compatibility - docs: - add a hint on sleeping computer and ssh connections, #5301 - update the documentation on hacked backup client, #5480 - improve docs/FAQ about append-only remote repos, #5497 - complement the documentation for pattern files and exclude files, #5520 - "filename with spaces" example added to exclude file, #5236 note: no whitespace escaping needed, processed by borg. - add info on renaming repositories, #5240 - clarify borg check --verify-data, #5808 - add notice about defective hardware to check documentation, #5753 - add paragraph added in #5855 to utility documentation source - add missing leading slashes in help patterns, #5857 - clarify "you will need key and passphrase" borg init warning, #4622 - pull mode: add some warnings, #5827 - mention tar --compare (compare archive to fs files), #5880 - fix typos, backport of #5597 - vagrant: - add py3.7.11 for binary build, also add 3.10-dev. - use latest Cython 0.29.23 for py310 compat fixes. - more RAM for openindiana upgrade plan resolver, it just hangs (swaps?) if there is too little RAM. - fix install_pyenv to adapt to recent changes in pyenv (same as in master now). - use generic/netbsd9 box, copied from master branch. Version 1.1.16 (2021-03-23) --------------------------- Fixes: - setup.py: add special openssl prefix for Apple M1 compatibility - do not recurse into duplicate roots, #5603 - remove empty shadowed_segments lists, #5275, #5614 - fix libpython load error when borg fat binary / dir-based binary is invoked via a symlink by upgrading pyinstaller to v4.2, #5688 - config: accept non-int value (like 500M or 100G) for max_segment_size or storage_quota, #5639. please note: when setting a non-int value for this in a repo config, using the repo will require borg >= 1.1.16. New features: - bundled msgpack: drop support for old buffer protocol to support Python 3.10 - verbose files cache logging via --debug-topic=files_cache, #5659. Use this if you suspect that borg does not detect unmodified files as expected. - create/extract: add --noxattrs and --noacls option, #3955. when given with borg create, borg will not get xattrs / ACLs from input files (and thus, it will not archive xattrs / ACLs). when given with borg extract, borg will not read xattrs / ACLs from archive and will not set xattrs / ACLs on extracted files. - diff: add --json-lines option, #3765 - check: debug log segment filename - borg debug dump-hints Other changes: - Tab completion support for additional archives for 'borg delete' - repository: deduplicate code of put and delete, no functional change - tests: fix result order issue (sporadic test failure on openindiana) - vagrant: - upgrade pyinstaller to v4.2, #5671 - avoid grub-install asking interactively for device - remove the xenial box - update freebsd box to 12.1 - docs: - update macOS install instructions, #5677 - use macFUSE (not osxfuse) for Apple M1 compatibility - update docs for dev environment installation instructions, #5643 - fix grammar in faq - recommend running tests only on installed versions for setup - add link back to git-installation - remove /var/cache exclusion in example commands, #5625. This is generally a poor idea and shouldn't be promoted through examples. - add repology.org badge with current packaging status - explain hash collision - add unsafe workaround to use an old repo copy, #5722 Version 1.1.15 (2020-12-25) --------------------------- Fixes: - extract: - improve exception handling when setting xattrs, #5092. - emit a warning message giving the path, xattr key and error message. - continue trying to restore other xattrs and bsdflags of the same file after an exception with xattr-setting happened. - export-tar: - set tar format to GNU_FORMAT explicitly, #5274 - fix memory leak with ssh: remote repository, #5568 - fix potential memory leak with ssh: remote repository with partial extraction - create: fix --dry-run and --stats coexistence, #5415 - use --timestamp for {utcnow} and {now} if given, #5189 New features: - create: implement --stdin-mode, --stdin-user and --stdin-group, #5333 - allow appending the files cache filename with BORG_FILES_CACHE_SUFFIX env var Other changes: - drop python 3.4 support, minimum requirement is 3.5 now. - enable using libxxhash instead of bundled xxh64 code - update llfuse requirements (1.3.8) - set cython language_level in some files to fix warnings - allow EIO with warning when trying to hardlink - PropDict: fail early if internal_dict is not a dict - update shell completions - tests / CI - add a test for the hashindex corruption bug, #5531 #4829 - fix spurious failure in test_cache_files, #5438 - added a github ci workflow - reduce testing on travis, no macOS, no py3x-dev, #5467 - travis: use newer dists, native py on dist - vagrant: - remove jessie and trusty boxes, #5348 #5383 - pyinstaller 4.0, build on py379 - binary build on stretch64, #5348 - remove easy_install based pip installation - docs: - clarify '--one-file-system' for btrfs, #5391 - add example for excluding content using the --pattern cmd line arg - complement the documentation for pattern files and exclude files, #5524 - made ansible playbook more generic, use package instead of pacman. also change state from "latest" to "present". - complete documentation on append-only remote repos, #5497 - internals: rather talk about target size than statistics, #5336 - new compression algorithm policy, #1633 #5505 - faq: add a hint on sleeping computer, #5301 - note requirements for full disk access on macOS Catalina, #5303 - fix/improve description of borg upgrade hardlink usage, #5518 - modernize 1.1 code: - drop code/workarounds only needed to support Python 3.4 - remove workaround for pre-release py37 argparse bug - removed some outdated comments/docstrings - requirements: remove some restrictions, lock on current versions Version 1.1.14 (2020-10-07) --------------------------- Fixes: - check --repair: fix potential data loss when interrupting it, #5325 - exit with 128 + signal number (as documented) when borg is killed by a signal, #5161 - fix hardlinked CACHEDIR.TAG processing, #4911 - create --read-special: .part files also should be regular files, #5217 - llfuse dependency: choose least broken 1.3.6/1.3.7. 1.3.6 is broken on python 3.9, 1.3.7 is broken on FreeBSD. Other changes: - upgrade bundled xxhash to 0.7.4 - self test: if it fails, also point to OS and hardware, #5334 - pyinstaller: compute basepath from spec file location - prettier error message when archive gets too big, #5307 - check/recreate are not "experimental" any more (but still potentially dangerous): - recreate: remove extra confirmation - rephrase some warnings, update docs, #5164 - shell completions: - misc. updates / fixes - support repositories in fish tab completion, #5256 - complete $BORG_RECREATE_I_KNOW_WHAT_I_AM_DOING - rewrite zsh completion: - completion for almost all optional and positional arguments - completion for Borg environment variables (parameters) - use "allow/deny list" instead of "white/black list" wording - declare "allow_cache_wipe" marker in setup.cfg to avoid pytest warning - vagrant / tests: - misc. fixes / updates - use python 3.5.10 for binary build - build directory-based binaries additionally to the single file binaries - add libffi-dev, required to build python - use cryptography<3.0, more recent versions break the jessie box - test on python 3.9 - do brew update with /dev/null redirect to avoid "too much log output" on travis-ci - docs: - add ssh-agent pull backup method docs, #5288 - how to approach borg speed issues, #5371 - mention double --force in prune docs - update Homebrew install instructions, #5185 - better description of how cache and rebuilds of it work - point to borg create --list item flags in recreate usage, #5165 - add security faq explaining AES-CTR crypto issues, #5254 - add a note to create from stdin regarding files cache, #5180 - fix borg.1 manpage generation regression, #5211 - clarify how exclude options work in recreate, #5193 - add section for retired contributors - hint about not misusing private email addresses of contributors for borg support Version 1.1.13 (2020-06-06) --------------------------- Compatibility notes: - When upgrading from borg 1.0.x to 1.1.x, please note: - read all the compatibility notes for 1.1.0*, starting from 1.1.0b1. - borg upgrade: you do not need to and you also should not run it. There is one exception though: If you upgrade from an unpatched borg < 1.0.9, please read that section above: "Pre-1.0.9 manifest spoofing vulnerability (CVE-2016-10099)" - borg might ask some security-related questions once after upgrading. You can answer them either manually or via environment variable. One known case is if you use unencrypted repositories, then it will ask about a unknown unencrypted repository one time. - your first backup with 1.1.x might be significantly slower (it might completely read, chunk, hash a lot files) - this is due to the --files-cache mode change (and happens every time you change mode). You can avoid the one-time slowdown by using the pre-1.1.0rc4-compatible mode (but that is less safe for detecting changed files than the default). See the --files-cache docs for details. - 1.1.11 removes WSL autodetection (Windows 10 Subsystem for Linux). If WSL still has a problem with sync_file_range, you need to set BORG_WORKAROUNDS=basesyncfile in the borg process environment to work around the WSL issue. Fixes: - rebuilt using a current Cython version, compatible with python 3.8, #5214 Version 1.1.12 (2020-06-06) --------------------------- Fixes: - fix preload-related memory leak, #5202. - mount / borgfs (FUSE filesystem): - fix FUSE low linear read speed on large files, #5067 - fix crash on old llfuse without birthtime attrs, #5064 - accidentally we required llfuse >= 1.3. Now also old llfuse works again. - set f_namemax in statfs result, #2684 - update precedence of env vars to set config and cache paths, #4894 - correctly calculate compression ratio, taking header size into account, too New features: - --bypass-lock option to bypass locking with read-only repositories Other changes: - upgrade bundled zstd to 1.4.5 - travis: adding comments and explanations to Travis config / install script, improve macOS builds. - tests: test_delete_force: avoid sporadic test setup issues, #5196 - misc. vagrant fixes - the binary for macOS is now built on macOS 10.12 - the binaries for Linux are now built on Debian 8 "Jessie", #3761 - docs: - PlaceholderError not printed as JSON, #4073 - "How important is Borg config?", #4941 - make Sphinx warnings break docs build, #4587 - some markup / warning fixes - add "updating borgbackup.org/releases" to release checklist, #4999 - add "rendering docs" to release checklist, #5000 - clarify borg init's encryption modes - add note about patterns and stored paths, #4160 - add upgrade of tools to pip installation how-to - document one cause of orphaned chunks in check command, #2295 - linked recommended restrictions to ssh public keys on borg servers in faq, #4946 Version 1.1.11 (2020-03-08) --------------------------- Compatibility notes: - When upgrading from borg 1.0.x to 1.1.x, please note: - read all the compatibility notes for 1.1.0*, starting from 1.1.0b1. - borg upgrade: you do not need to and you also should not run it. There is one exception though: If you upgrade from an unpatched borg < 1.0.9, please read that section above: "Pre-1.0.9 manifest spoofing vulnerability (CVE-2016-10099)" - borg might ask some security-related questions once after upgrading. You can answer them either manually or via environment variable. One known case is if you use unencrypted repositories, then it will ask about a unknown unencrypted repository one time. - your first backup with 1.1.x might be significantly slower (it might completely read, chunk, hash a lot files) - this is due to the --files-cache mode change (and happens every time you change mode). You can avoid the one-time slowdown by using the pre-1.1.0rc4-compatible mode (but that is less safe for detecting changed files than the default). See the --files-cache docs for details. - 1.1.11 removes WSL autodetection (Windows 10 Subsystem for Linux). If WSL still has a problem with sync_file_range, you need to set BORG_WORKAROUNDS=basesyncfile in the borg process environment to work around the WSL issue. Fixes: - fixed potential index corruption / data loss issue due to bug in hashindex_set, #4829. Please read and follow the more detailed notes close to the top of this document. - upgrade bundled xxhash to 0.7.3, #4891. 0.7.2 is the minimum requirement for correct operations on ARMv6 in non-fixup mode, where unaligned memory accesses cause bus errors. 0.7.3 adds some speedups and libxxhash 0.7.3 even has a pkg-config file now. - upgrade bundled lz4 to 1.9.2 - upgrade bundled zstd to 1.4.4 - fix crash when upgrading erroneous hints file, #4922 - extract: - fix KeyError for "partial" extraction, #4607 - fix "partial" extract for hardlinked contentless file types, #4725 - fix preloading for old (0.xx) remote servers, #4652 - fix confusing output of borg extract --list --strip-components, #4934 - delete: after double-force delete, warn about necessary repair, #4704 - create: give invalid repo error msg if repo config not found, #4411 - mount: fix FUSE mount missing st_birthtime, #4763 #4767 - check: do not stumble over invalid item key, #4845 - info: if the archive doesn't exist, print a pretty message, #4793 - SecurityManager.known(): check all files, #4614 - Repository.open: use stat() to check for repo dir, #4695 - Repository.check_can_create_repository: use stat() to check, #4695 - fix invalid archive error message - fix optional/non-optional location arg, #4541 - commit-time free space calc: ignore bad compact map entries, #4796 - ignore EACCES (errno 13) when hardlinking the old config, #4730 - --prefix / -P: fix processing, avoid argparse issue, #4769 New features: - enable placeholder usage in all extra archive arguments - new BORG_WORKAROUNDS mechanism, basesyncfile, #4710 - recreate: support --timestamp option, #4745 - support platforms without os.link (e.g. Android with Termux), #4901. if we don't have os.link, we just extract another copy instead of making a hardlink. - support linux platforms without sync_file_range (e.g. Android 7 with Termux), #4905 Other: - ignore --stats when given with --dry-run, but continue, #4373 - add some ProgressIndicator msgids to code / fix docs, #4935 - elaborate on "Calculating size" message - argparser: always use REPOSITORY in metavar, also use more consistent help phrasing. - check: improve error output for matching index size, see #4829 - docs: - changelog: add advisory about hashindex_set bug #4829 - better describe BORG_SECURITY_DIR, BORG_CACHE_DIR, #4919 - infos about cache security assumptions, #4900 - add FAQ describing difference between a local repo vs. repo on a server. - document how to test exclusion patterns without performing an actual backup - timestamps in the files cache are now usually ctime, #4583 - fix bad reference to borg compact (does not exist in 1.1), #4660 - create: borg 1.1 is not future any more - extract: document limitation "needs empty destination", #4598 - how to supply a passphrase, use crypto devices, #4549 - fix osxfuse github link in installation docs - add example of exclude-norecurse rule in help patterns - update macOS Brew link - add note about software for automating backups, #4581 - AUTHORS: mention copyright+license for bundled msgpack - fix various code blocks in the docs, #4708 - updated docs to cover use of temp directory on remote, #4545 - add restore docs, #4670 - add a pull backup / push restore how-to, #1552 - add FAQ how to retain original paths, #4532 - explain difference between --exclude and --pattern, #4118 - add FAQs for SSH connection issues, #3866 - improve password FAQ, #4591 - reiterate that 'file cache names are absolute' in FAQ - tests: - cope with ANY error when importing pytest into borg.testsuite, #4652 - fix broken test that relied on improper zlib assumptions - test_fuse: filter out selinux xattrs, #4574 - travis / vagrant: - misc python versions removed / changed (due to openssl 1.1 compatibility) or added (3.7 and 3.8, for better borg compatibility testing) - binary building is on python 3.5.9 now - vagrant: - add new boxes: ubuntu 18.04 and 20.04, debian 10 - update boxes: openindiana, darwin, netbsd - remove old boxes: centos 6 - darwin: updated osxfuse to 3.10.4 - use debian/ubuntu pip/virtualenv packages - rather use python 3.6.2 than 3.6.0, fixes coverage/sqlite3 issue - use requirements.d/development.lock.txt to avoid compat issues - travis: - darwin: backport some install code / order from master - remove deprecated keyword "sudo" from travis config - allow osx builds to fail, #4955 this is due to travis-ci frequently being so slow that the OS X builds just fail because they exceed 50 minutes and get killed by travis. Version 1.1.10 (2019-05-16) --------------------------- Fixes: - extract: hang on partial extraction with ssh: repo, when hardlink master is not matched/extracted and borg hangs on related slave hardlink, #4350 - lrucache: regularly remove old FDs, #4427 - avoid stale filehandle issues, #3265 - freebsd: make xattr platform code api compatible with linux, #3952 - use whitelist approach for borg serve, #4097 - borg command shall terminate with rc 2 for ImportErrors, #4424 - create: only run stat_simple_attrs() once, this increases backup with lots of unchanged files performance by ~ 5%. - prune: fix incorrect borg prune --stats output with --dry-run, #4373 - key export: emit user-friendly error if repo key is exported to a directory, #4348 New features: - bundle latest supported msgpack-python release (0.5.6), remove msgpack-python from setup.py install_requires - by default we use the bundled code now. optionally, we still support using an external msgpack (see hints in setup.py), but this requires solid requirements management within distributions and is not recommended. borgbackup will break if you upgrade msgpack to an unsupported version. - display msgpack version as part of sysinfo (e.g. in tracebacks) - timestamp for borg delete --info added, #4359 - enable placeholder usage in --comment and --glob-archives, #4559, #4495 Other: - serve: do not check python/libc for borg serve, #4483 - shell completions: borg diff second archive - release scripts: signing binaries with Qubes OS support - testing: - vagrant: upgrade openbsd box to 6.4 - travis-ci: lock test env to py 3.4 compatible versions, #4343 - get rid of confusing coverage warning, #2069 - rename test_mount_hardlinks to test_fuse_mount_hardlinks, so both can be excluded by "not test_fuse". - pure-py msgpack warning shall not make a lot of tests fail, #4558 - docs: - add "SSH Configuration" section to "borg serve", #3988, #636, #4485 - README: new URL for funding options - add a sample logging.conf in docs/misc, #4380 - elaborate on append-only mode docs, #3504 - installation: added Alpine Linux to distribution list, #4415 - usage.html: only modify window.location when redirecting, #4133 - add msgpack license to docs/3rd_party/msgpack - vagrant / binary builds: - use python 3.5.7 for builds - use osxfuse 3.8.3 Version 1.1.9 (2019-02-10) -------------------------- Compatibility notes: - When upgrading from borg 1.0.x to 1.1.x, please note: - read all the compatibility notes for 1.1.0*, starting from 1.1.0b1. - borg upgrade: you do not need to and you also should not run it. There is one exception though: If you upgrade from an unpatched borg < 1.0.9, please read that section above: "Pre-1.0.9 manifest spoofing vulnerability (CVE-2016-10099)" - borg might ask some security-related questions once after upgrading. You can answer them either manually or via environment variable. One known case is if you use unencrypted repositories, then it will ask about a unknown unencrypted repository one time. - your first backup with 1.1.x might be significantly slower (it might completely read, chunk, hash a lot files) - this is due to the --files-cache mode change (and happens every time you change mode). You can avoid the one-time slowdown by using the pre-1.1.0rc4-compatible mode (but that is less safe for detecting changed files than the default). See the --files-cache docs for details. Fixes: - security fix: configure FUSE with "default_permissions", #3903 "default_permissions" is now enforced by borg by default to let the kernel check uid/gid/mode based permissions. "ignore_permissions" can be given to not enforce "default_permissions". - make "hostname" short, even on misconfigured systems, #4262 - fix free space calculation on macOS (and others?), #4289 - config: quit with error message when no key is provided, #4223 - recover_segment: handle too small segment files correctly, #4272 - correctly release memoryview, #4243 - avoid diaper pattern in configparser by opening files, #4263 - add "# cython: language_level=3" directive to .pyx files, #4214 - info: consider part files for "This archive" stats, #3522 - work around Microsoft WSL issue #645 (sync_file_range), #1961 New features: - add --rsh command line option to complement BORG_RSH env var, #1701 - init: --make-parent-dirs parent1/parent2/repo_dir, #4235 Other: - add archive name to check --repair output, #3447 - check for unsupported msgpack versions - shell completions: - new shell completions for borg 1.1.9 - more complete shell completions for borg mount -o - added shell completions for borg help - option arguments for zsh tab completion - docs: - add FAQ regarding free disk space check, #3905 - update BORG_PASSCOMMAND example and clarify variable expansion, #4249 - FAQ regarding change of compression settings, #4222 - add note about BSD flags to changelog, #4246 - improve logging in example automation script - add note about files changing during backup, #4081 - work around the backslash issue, #4280 - update release workflow using twine (docs, scripts), #4213 - add warnings on repository copies to avoid future problems, #4272 - tests: - fix the homebrew 1.9 issues on travis-ci, #4254 - fix duplicate test method name, #4311 Version 1.1.8 (2018-12-09) -------------------------- Fixes: - enforce storage quota if set by serve-command, #4093 - invalid locations: give err msg containing parsed location, #4179 - list repo: add placeholders for hostname and username, #4130 - on linux, symlinks can't have ACLs, so don't try to set any, #4044 New features: - create: added PATH::archive output on INFO log level - read a passphrase from a file descriptor specified in the BORG_PASSPHRASE_FD environment variable. Other: - docs: - option --format is required for some expensive-to-compute values for json borg list by default does not compute expensive values except when they are needed. whether they are needed is determined by the format, in standard mode as well as in --json mode. - tell that our binaries are x86/x64 amd/intel, bauerj has ARM - fixed wrong archive name pattern in CRUD benchmark help - fixed link to cachedir spec in docs, #4140 - tests: - stop using fakeroot on travis, avoids sporadic EISDIR errors, #2482 - xattr key names must start with "user." on linux - fix code so flake8 3.6 does not complain - explicitly convert environment variable to str, #4136 - fix DeprecationWarning: Flags not at the start of the expression, #4137 - support pytest4, #4172 - vagrant: - use python 3.5.6 for builds Version 1.1.7 (2018-08-11) -------------------------- Compatibility notes: - added support for Python 3.7 Fixes: - cache lock: use lock_wait everywhere to fix infinite wait, see #3968 - don't archive tagged dir when recursing an excluded dir, #3991 - py37 argparse: work around bad default in py 3.7.0a/b/rc, #3996 - py37 remove loggerDict.clear() from tearDown method, #3805 - some fixes for bugs which likely did not result in problems in practice: - fixed logic bug in platform module API version check - fixed xattr/acl function prototypes, added missing ones New features: - init: add warning to store both key and passphrase at safe place(s) - BORG_HOST_ID env var to work around all-zero MAC address issue, #3985 - borg debug dump-repo-objs --ghost (dump everything from segment files, including deleted or superseded objects or commit tags) - borg debug search-repo-objs (search in repo objects for hex bytes or strings) Other changes: - add Python 3.7 support - updated shell completions - call socket.gethostname only once - locking: better logging, add some asserts - borg debug dump-repo-objs: - filename layout improvements - use repository.scan() to get on-disk order - docs: - update installation instructions for macOS - added instructions to install fuse via homebrew - improve diff docs - added note that checkpoints inside files requires 1.1+ - add link to tempfile module - remove row/column-spanning from docs source, #4000 #3990 - tests: - fetch less data via os.urandom - add py37 env for tox - travis: add 3.7, remove 3.6-dev (we test with -dev in master) - vagrant / binary builds: - use osxfuse 3.8.2 - use own (uptodate) openindiana box Version 1.1.6 (2018-06-11) -------------------------- Compatibility notes: - 1.1.6 changes: - also allow msgpack-python 0.5.6. Fixes: - fix borg exception handling on ENOSPC error with xattrs, #3808 - prune: fix/improve overall progress display - borg config repo ... does not need cache/manifest/key, #3802 - debug dump-repo-objs should not depend on a manifest obj - pypi package: - include .coveragerc, needed by tox.ini - fix package long description, #3854 New features: - mount: add uid, gid, umask mount options - delete: - only commit once, #3823 - implement --dry-run, #3822 - check: - show progress while rebuilding missing manifest, #3787 - more --repair output - borg config --list , #3612 Other changes: - update msgpack requirement, #3753 - update bundled zstd to 1.3.4, #3745 - update bundled lz4 code to 1.8.2, #3870 - docs: - describe what BORG_LIBZSTD_PREFIX does - fix and deduplicate encryption quickstart docs, #3776 - vagrant: - FUSE for macOS: upgrade 3.7.1 to 3.8.0 - exclude macOS High Sierra upgrade on the darwin64 machine - remove borgbackup.egg-info dir in fs_init (after rsync) - use pyenv-based build/test on jessie32/62 - use local 32 and 64bit debian jessie boxes - use "vagrant" as username for new xenial box - travis OS X: use xcode 8.3 (not broken) Version 1.1.5 (2018-04-01) -------------------------- Compatibility notes: - 1.1.5 changes: - require msgpack-python >= 0.4.6 and < 0.5.0. 0.5.0+ dropped python 3.4 testing and also caused some other issues because the python package was renamed to msgpack and emitted some FutureWarning. Fixes: - create --list: fix that it was never showing M status, #3492 - create: fix timing for first checkpoint (read files cache early, init checkpoint timer after that), see #3394 - extract: set rc=1 when extracting damaged files with all-zero replacement chunks or with size inconsistencies, #3448 - diff: consider an empty file as different to a non-existing file, #3688 - files cache: improve exception handling, #3553 - ignore exceptions in scandir_inorder() caused by an implicit stat(), also remove unneeded sort, #3545 - fixed tab completion problem where a space is always added after path even when it shouldn't - build: do .h file content checks in binary mode, fixes build issue for non-ascii header files on pure-ascii locale platforms, #3544 #3639 - borgfs: fix patterns/paths processing, #3551 - config: add some validation, #3566 - repository config: add validation for max_segment_size, #3592 - set cache previous_location on load instead of save - remove platform.uname() call which caused library mismatch issues, #3732 - add exception handler around deprecated platform.linux_distribution() call - use same datetime object for {now} and {utcnow}, #3548 New features: - create: implement --stdin-name, #3533 - add chunker_params to borg archive info (--json) - BORG_SHOW_SYSINFO=no to hide system information from exceptions Other changes: - updated zsh completions for borg 1.1.4 - files cache related code cleanups - be more helpful when parsing invalid --pattern values, #3575 - be more clear in secure-erase warning message, #3591 - improve getpass user experience, #3689 - docs build: unicode problem fixed when using a py27-based sphinx - docs: - security: explicitly note what happens OUTSIDE the attack model - security: add note about combining compression and encryption - security: describe chunk size / proximity issue, #3687 - quickstart: add note about permissions, borg@localhost, #3452 - quickstart: add introduction to repositories & archives, #3620 - recreate --recompress: add missing metavar, clarify description, #3617 - improve logging docs, #3549 - add an example for --pattern usage, #3661 - clarify path semantics when matching, #3598 - link to offline documentation from README, #3502 - add docs on how to verify a signed release with GPG, #3634 - chunk seed is generated per repository (not: archive) - better formatting of CPU usage documentation, #3554 - extend append-only repo rollback docs, #3579 - tests: - fix erroneously skipped zstd compressor tests, #3606 - skip a test if argparse is broken, #3705 - vagrant: - xenial64 box now uses username 'vagrant', #3707 - move cleanup steps to fs_init, #3706 - the boxcutter wheezy boxes are 404, use local ones - update to Python 3.5.5 (for binary builds) Version 1.1.4 (2017-12-31) -------------------------- Compatibility notes: - When upgrading from borg 1.0.x to 1.1.x, please note: - read all the compatibility notes for 1.1.0*, starting from 1.1.0b1. - borg upgrade: you do not need to and you also should not run it. There is one exception though: If you upgrade from an unpatched borg < 1.0.9, please read that section above: "Pre-1.0.9 manifest spoofing vulnerability (CVE-2016-10099)" - borg might ask some security-related questions once after upgrading. You can answer them either manually or via environment variable. One known case is if you use unencrypted repositories, then it will ask about a unknown unencrypted repository one time. - your first backup with 1.1.x might be significantly slower (it might completely read, chunk, hash a lot files) - this is due to the --files-cache mode change (and happens every time you change mode). You can avoid the one-time slowdown by using the pre-1.1.0rc4-compatible mode (but that is less safe for detecting changed files than the default). See the --files-cache docs for details. - borg 1.1.4 changes: - zstd compression is new in borg 1.1.4, older borg can't handle it. - new minimum requirements for the compression libraries - if the required versions (header and lib) can't be found at build time, bundled code will be used: - added requirement: libzstd >= 1.3.0 (bundled: 1.3.2) - updated requirement: liblz4 >= 1.7.0 / r129 (bundled: 1.8.0) Fixes: - check: data corruption fix: fix for borg check --repair malfunction, #3444. See the more detailed notes close to the top of this document. - delete: also delete security dir when deleting a repo, #3427 - prune: fix building the "borg prune" man page, #3398 - init: use given --storage-quota for local repo, #3470 - init: properly quote repo path in output - fix startup delay with dns-only own fqdn resolving, #3471 New features: - added zstd compression. try it! - added placeholder {reverse-fqdn} for fqdn in reverse notation - added BORG_BASE_DIR environment variable, #3338 Other changes: - list help topics when invalid topic is requested - fix lz4 deprecation warning, requires lz4 >= 1.7.0 (r129) - add parens for C preprocessor macro argument usages (did not cause malfunction) - exclude broken pytest 3.3.0 release - updated fish/bash completions - init: more clear exception messages for borg create, #3465 - docs: - add auto-generated docs for borg config - don't generate HTML docs page for borgfs, #3404 - docs update for lz4 b2 zstd changes - add zstd to compression help, readme, docs - update requirements and install docs about bundled lz4 and zstd - refactored build of the compress and crypto.low_level extensions, #3415: - move some lib/build related code to setup_{zstd,lz4,b2}.py - bundle lz4 1.8.0 (requirement: >= 1.7.0 / r129) - bundle zstd 1.3.2 (requirement: >= 1.3.0) - blake2 was already bundled - rename BORG_LZ4_PREFIX env var to BORG_LIBLZ4_PREFIX for better consistency: we also have BORG_LIBB2_PREFIX and BORG_LIBZSTD_PREFIX now. - add prefer_system_lib* = True settings to setup.py - by default the build will prefer a shared library over the bundled code, if library and headers can be found and meet the minimum requirements. Version 1.1.3 (2017-11-27) -------------------------- Fixes: - Security Fix for CVE-2017-15914: Incorrect implementation of access controls allows remote users to override repository restrictions in Borg servers. A user able to access a remote Borg SSH server is able to circumvent access controls post-authentication. Affected releases: 1.1.0, 1.1.1, 1.1.2. Releases 1.0.x are NOT affected. - crc32: deal with unaligned buffer, add tests - this broke borg on older ARM CPUs that can not deal with unaligned 32bit memory accesses and raise a bus error in such cases. the fix might also improve performance on some CPUs as all 32bit memory accesses by the crc32 code are properly aligned now. #3317 - mount: fixed support of --consider-part-files and do not show .borg_part_N files by default in the mounted FUSE filesystem. #3347 - fixed cache/repo timestamp inconsistency message, highlight that information is obtained from security dir (deleting the cache will not bypass this error in case the user knows this is a legitimate repo). - borgfs: don't show sub-command in borgfs help, #3287 - create: show an error when --dry-run and --stats are used together, #3298 New features: - mount: added exclusion group options and paths, #2138 Reused some code to support similar options/paths as borg extract offers - making good use of these to only mount a smaller subset of dirs/files can speed up mounting a lot and also will consume way less memory. borg mount [options] repo_or_archive mountpoint path [paths...] paths: you can just give some "root paths" (like for borg extract) to only partially populate the FUSE filesystem. new options: --exclude[-from], --pattern[s-from], --strip-components - create/extract: support st_birthtime on platforms supporting it, #3272 - add "borg config" command for querying/setting/deleting config values, #3304 Other changes: - clean up and simplify packaging (only package committed files, do not install .c/.h/.pyx files) - docs: - point out tuning options for borg create, #3239 - add instructions for using ntfsclone, zerofree, #81 - move image backup-related FAQ entries to a new page - clarify key aliases for borg list --format, #3111 - mention break-lock in checkpointing FAQ entry, #3328 - document sshfs rename workaround, #3315 - add FAQ about removing files from existing archives - add FAQ about different prune policies - usage and man page for borgfs, #3216 - clarify create --stats duration vs. wall time, #3301 - clarify encrypted key format for borg key export, #3296 - update release checklist about security fixes - document good and problematic option placements, fix examples, #3356 - add note about using --nobsdflags to avoid speed penalty related to bsdflags, #3239 - move most of support section to www.borgbackup.org Version 1.1.2 (2017-11-05) -------------------------- Fixes: - fix KeyError crash when talking to borg server < 1.0.7, #3244 - extract: set bsdflags last (include immutable flag), #3263 - create: don't do stat() call on excluded-norecurse directory, fix exception handling for stat() call, #3209 - create --stats: do not count data volume twice when checkpointing, #3224 - recreate: move chunks_healthy when excluding hardlink master, #3228 - recreate: get rid of chunks_healthy when rechunking (does not match), #3218 - check: get rid of already existing not matching chunks_healthy metadata, #3218 - list: fix stdout broken pipe handling, #3245 - list/diff: remove tag-file options (not used), #3226 New features: - bash, zsh and fish shell auto-completions, see scripts/shell_completions/ - added BORG_CONFIG_DIR env var, #3083 Other changes: - docs: - clarify using a blank passphrase in keyfile mode - mention "!" (exclude-norecurse) type in "patterns" help - document to first heal before running borg recreate to re-chunk stuff, because that will have to get rid of chunks_healthy metadata. - more than 23 is not supported for CHUNK_MAX_EXP, #3115 - borg does not respect nodump flag by default any more - clarify same-filesystem requirement for borg upgrade, #2083 - update / rephrase cygwin / WSL status, #3174 - improve docs about --stats, #3260 - vagrant: openindiana new clang package Already contained in 1.1.1 (last minute fix): - arg parsing: fix fallback function, refactor, #3205. This is a fixup for #3155, which was broken on at least python <= 3.4.2. Version 1.1.1 (2017-10-22) -------------------------- Compatibility notes: - The deprecated --no-files-cache is not a global/common option any more, but only available for borg create (it is not needed for anything else). Use --files-cache=disabled instead of --no-files-cache. - The nodump flag ("do not backup this file") is not honoured any more by default because this functionality (esp. if it happened by error or unexpected) was rather confusing and unexplainable at first to users. If you want that "do not backup NODUMP-flagged files" behaviour, use: borg create --exclude-nodump ... - If you are on Linux and do not need bsdflags archived, consider using ``--nobsdflags`` with ``borg create`` to avoid additional syscalls and speed up backup creation. Fixes: - borg recreate: correctly compute part file sizes. fixes cosmetic, but annoying issue as borg check complains about size inconsistencies of part files in affected archives. you can solve that by running borg recreate on these archives, see also #3157. - bsdflags support: do not open BLK/CHR/LNK files, avoid crashes and slowness, #3130 - recreate: don't crash on attic archives w/o time_end, #3109 - don't crash on repository filesystems w/o hardlink support, #3107 - don't crash in first part of truncate_and_unlink, #3117 - fix server-side IndexError crash with clients < 1.0.7, #3192 - don't show traceback if only a global option is given, show help, #3142 - cache: use SaveFile for more safety, #3158 - init: fix wrong encryption choices in command line parser, fix missing "authenticated-blake2", #3103 - move --no-files-cache from common to borg create options, #3146 - fix detection of non-local path (failed on ..filename), #3108 - logging with fileConfig: set json attr on "borg" logger, #3114 - fix crash with relative BORG_KEY_FILE, #3197 - show excluded dir with "x" for tagged dirs / caches, #3189 New features: - create: --nobsdflags and --exclude-nodump options, #3160 - extract: --nobsdflags option, #3160 Other changes: - remove annoying hardlinked symlinks warning, #3175 - vagrant: use self-made FreeBSD 10.3 box, #3022 - travis: don't brew update, hopefully fixes #2532 - docs: - readme: -e option is required in borg 1.1 - add example showing --show-version --show-rc - use --format rather than --list-format (deprecated) in example - update docs about hardlinked symlinks limitation Version 1.1.0 (2017-10-07) -------------------------- Compatibility notes: - borg command line: do not put options in between positional arguments This sometimes works (e.g. it worked in borg 1.0.x), but can easily stop working if we make positional arguments optional (like it happened for borg create's "paths" argument in 1.1). There are also places in borg 1.0 where we do that, so it doesn't work there in general either. #3356 Good: borg create -v --stats repo::archive path Good: borg create repo::archive path -v --stats Bad: borg create repo::archive -v --stats path Fixes: - fix LD_LIBRARY_PATH restoration for subprocesses, #3077 - "auto" compression: make sure expensive compression is actually better, otherwise store lz4 compressed data we already computed. Other changes: - docs: - FAQ: we do not implement futile attempts of ETA / progress displays - manpage: fix typos, update homepage - implement simple "issue" role for manpage generation, #3075 Version 1.1.0rc4 (2017-10-01) ----------------------------- Compatibility notes: - A borg server >= 1.1.0rc4 does not support borg clients 1.1.0b3-b5. #3033 - The files cache is now controlled differently and has a new default mode: - the files cache now uses ctime by default for improved file change detection safety. You can still use mtime for more speed and less safety. - --ignore-inode is deprecated (use --files-cache=... without "inode") - --no-files-cache is deprecated (use --files-cache=disabled) New features: - --files-cache - implement files cache mode control, #911 You can now control the files cache mode using this option: --files-cache={ctime,mtime,size,inode,rechunk,disabled} (only some combinations are supported). See the docs for details. Fixes: - remote progress/logging: deal with partial lines, #2637 - remote progress: flush json mode output - fix subprocess environments, #3050 (and more) Other changes: - remove client_supports_log_v3 flag, #3033 - exclude broken Cython 0.27(.0) in requirements, #3066 - vagrant: - upgrade to FUSE for macOS 3.7.1 - use Python 3.5.4 to build the binaries - docs: - security: change-passphrase only changes the passphrase, #2990 - fixed/improved borg create --compression examples, #3034 - add note about metadata dedup and --no[ac]time, #2518 - twitter account @borgbackup now, better visible, #2948 - simplified rate limiting wrapper in FAQ Version 1.1.0rc3 (2017-09-10) ----------------------------- New features: - delete: support naming multiple archives, #2958 Fixes: - repo cleanup/write: invalidate cached FDs, #2982 - fix datetime.isoformat() microseconds issues, #2994 - recover_segment: use mmap(), lower memory needs, #2987 Other changes: - with-lock: close segment file before invoking subprocess - keymanager: don't depend on optional readline module, #2976 - docs: - fix macOS keychain integration command - show/link new screencasts in README, #2936 - document utf-8 locale requirement for json mode, #2273 - vagrant: clean up shell profile init, user name, #2977 - test_detect_attic_repo: don't test mount, #2975 - add debug logging for repository cleanup Version 1.1.0rc2 (2017-08-28) ----------------------------- Compatibility notes: - list: corrected mix-up of "isomtime" and "mtime" formats. Previously, "isomtime" was the default but produced a verbose human format, while "mtime" produced a ISO-8601-like format. The behaviours have been swapped (so "mtime" is human, "isomtime" is ISO-like), and the default is now "mtime". "isomtime" is now a real ISO-8601 format ("T" between date and time, not a space). New features: - None. Fixes: - list: fix weird mixup of mtime/isomtime - create --timestamp: set start time, #2957 - ignore corrupt files cache, #2939 - migrate locks to child PID when daemonize is used - fix exitcode of borg serve, #2910 - only compare contents when chunker params match, #2899 - umount: try fusermount, then try umount, #2863 Other changes: - JSON: use a more standard ISO 8601 datetime format, #2376 - cache: write_archive_index: truncate_and_unlink on error, #2628 - detect non-upgraded Attic repositories, #1933 - delete various nogil and threading related lines - coala / pylint related improvements - docs: - renew asciinema/screencasts, #669 - create: document exclusion through nodump, #2949 - minor formatting fixes - tar: tarpipe example - improve "with-lock" and "info" docs, #2869 - detail how to use macOS/GNOME/KDE keyrings for repo passwords, #392 - travis: only short-circuit docs-only changes for pull requests - vagrant: - netbsd: bash is already installed - fix netbsd version in PKG_PATH - add exe location to PATH when we build an exe Version 1.1.0rc1 (2017-07-24) ----------------------------- Compatibility notes: - delete: removed short option for --cache-only New features: - support borg list repo --format {comment} {bcomment} {end}, #2081 - key import: allow reading from stdin, #2760 Fixes: - with-lock: avoid creating segment files that might be overwritten later, #1867 - prune: fix checkpoints processing with --glob-archives - FUSE: versions view: keep original file extension at end, #2769 - fix --last, --first: do not accept values <= 0, fix reversed archive ordering with --last - include testsuite data (attic.tar.gz) when installing the package - use limited unpacker for outer key, for manifest (both security precautions), #2174 #2175 - fix bashism in shell scripts, #2820, #2816 - cleanup endianness detection, create _endian.h, fixes build on alpine linux, #2809 - fix crash with --no-cache-sync (give known chunk size to chunk_incref), #2853 Other changes: - FUSE: versions view: linear numbering by archive time - split up interval parsing from filtering for --keep-within, #2610 - add a basic .editorconfig, #2734 - use archive creation time as mtime for FUSE mount, #2834 - upgrade FUSE for macOS (osxfuse) from 3.5.8 to 3.6.3, #2706 - hashindex: speed up by replacing modulo with "if" to check for wraparound - coala checker / pylint: fixed requirements and .coafile, more ignores - borg upgrade: name backup directories as 'before-upgrade', #2811 - add .mailmap - some minor changes suggested by lgtm.com - docs: - better explanation of the --ignore-inode option relevance, #2800 - fix openSUSE command and add openSUSE section - simplify ssh authorized_keys file using "restrict", add legacy note, #2121 - mount: show usage of archive filters - mount: add repository example, #2462 - info: update and add examples, #2765 - prune: include example - improved style / formatting - improved/fixed segments_per_dir docs - recreate: fix wrong "remove unwanted files" example - reference list of status chars in borg recreate --filter description - update source-install docs about doc build dependencies, #2795 - cleanup installation docs - file system requirements, update segs per dir - fix checkpoints/parts reference in FAQ, #2859 - code: - hashindex: don't pass side effect into macro - crypto low_level: don't mutate local bytes() - use dash_open function to open file or "-" for stdin/stdout - archiver: argparse cleanup / refactoring - shellpattern: add match_end arg - tests: added some additional unit tests, some fixes, #2700 #2710 - vagrant: fix setup of cygwin, add Debian 9 "stretch" - travis: don't perform full travis build on docs-only changes, #2531 Version 1.1.0b6 (2017-06-18) ---------------------------- Compatibility notes: - Running "borg init" via a "borg serve --append-only" server will *not* create an append-only repository anymore. Use "borg init --append-only" to initialize an append-only repository. - Repositories in the "repokey" and "repokey-blake2" modes with an empty passphrase are now treated as unencrypted repositories for security checks (e.g. BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK). Previously there would be no prompts nor messages if an unknown repository in one of these modes with an empty passphrase was encountered. This would allow an attacker to swap a repository, if one assumed that the lack of password prompts was due to a set BORG_PASSPHRASE. Since the "trick" does not work if BORG_PASSPHRASE is set, this does generally not affect scripts. - Repositories in the "authenticated" mode are now treated as the unencrypted repositories they are. - The client-side temporary repository cache now holds unencrypted data for better speed. - borg init: removed the short form of --append-only (-a). - borg upgrade: removed the short form of --inplace (-i). New features: - reimplemented the RepositoryCache, size-limited caching of decrypted repo contents, integrity checked via xxh64. #2515 - reduced space usage of chunks.archive.d. Existing caches are migrated during a cache sync. #235 #2638 - integrity checking using xxh64 for important files used by borg, #1101: - repository: index and hints files - cache: chunks and files caches, chunks.archive.d - improve cache sync speed, #1729 - create: new --no-cache-sync option - add repository mandatory feature flags infrastructure, #1806 - Verify most operations against SecurityManager. Location, manifest timestamp and key types are now checked for almost all non-debug commands. #2487 - implement storage quotas, #2517 - serve: add --restrict-to-repository, #2589 - BORG_PASSCOMMAND: use external tool providing the key passphrase, #2573 - borg export-tar, #2519 - list: --json-lines instead of --json for archive contents, #2439 - add --debug-profile option (and also "borg debug convert-profile"), #2473 - implement --glob-archives/-a, #2448 - normalize authenticated key modes for better naming consistency: - rename "authenticated" to "authenticated-blake2" (uses blake2b) - implement "authenticated" mode (uses hmac-sha256) Fixes: - hashindex: read/write indices >2 GiB on 32bit systems, better error reporting, #2496 - repository URLs: implement IPv6 address support and also more informative error message when parsing fails. - mount: check whether llfuse is installed before asking for passphrase, #2540 - mount: do pre-mount checks before opening repository, #2541 - FUSE: - fix crash if empty (None) xattr is read, #2534 - fix read(2) caching data in metadata cache - fix negative uid/gid crash (fix crash when mounting archives of external drives made on cygwin), #2674 - redo ItemCache, on top of object cache - use decrypted cache - remove unnecessary normpaths - serve: ignore --append-only when initializing a repository (borg init), #2501 - serve: fix incorrect type of exception_short for Errors, #2513 - fix --exclude and --exclude-from recursing into directories, #2469 - init: don't allow creating nested repositories, #2563 - --json: fix encryption[mode] not being the cmdline name - remote: propagate Error.traceback correctly - fix remote logging and progress, #2241 - implement --debug-topic for remote servers - remote: restore "Remote:" prefix (as used in 1.0.x) - rpc negotiate: enable v3 log protocol only for supported clients - fix --progress and logging in general for remote - fix parse_version, add tests, #2556 - repository: truncate segments (and also some other files) before unlinking, #2557 - recreate: keep timestamps as in original archive, #2384 - recreate: if single archive is not processed, exit 2 - patterns: don't recurse with ! / --exclude for pf:, #2509 - cache sync: fix n^2 behaviour in lookup_name - extract: don't write to disk with --stdout (affected non-regular-file items), #2645 - hashindex: implement KeyError, more tests Other changes: - remote: show path in PathNotAllowed - consider repokey w/o passphrase == unencrypted, #2169 - consider authenticated mode == unencrypted, #2503 - restrict key file names, #2560 - document follow_symlinks requirements, check libc, use stat and chown with follow_symlinks=False, #2507 - support common options on the main command, #2508 - support common options on mid-level commands (e.g. borg *key* export) - make --progress a common option - increase DEFAULT_SEGMENTS_PER_DIR to 1000 - chunker: fix invalid use of types (function only used by tests) - chunker: don't do uint32_t >> 32 - FUSE: - add instrumentation (--debug and SIGUSR1/SIGINFO) - reduced memory usage for repository mounts by lazily instantiating archives - improved archive load times - info: use CacheSynchronizer & HashIndex.stats_against (better performance) - docs: - init: document --encryption as required - security: OpenSSL usage - security: used implementations; note python libraries - security: security track record of OpenSSL and msgpack - patterns: document denial of service (regex, wildcards) - init: note possible denial of service with "none" mode - init: document SHA extension is supported in OpenSSL and thus SHA is faster on AMD Ryzen than blake2b. - book: use A4 format, new builder option format. - book: create appendices - data structures: explain repository compaction - data structures: add chunk layout diagram - data structures: integrity checking - data structures: demingle cache and repo index - Attic FAQ: separate section for attic stuff - FAQ: I get an IntegrityError or similar - what now? - FAQ: Can I use Borg on SMR hard drives?, #2252 - FAQ: specify "using inline shell scripts" - add systemd warning regarding placeholders, #2543 - xattr: document API - add docs/misc/borg-data-flow data flow chart - debugging facilities - README: how to help the project, #2550 - README: add bountysource badge, #2558 - fresh new theme + tweaking - logo: vectorized (PDF and SVG) versions - frontends: use headlines - you can link to them - mark --pattern, --patterns-from as experimental - highlight experimental features in online docs - remove regex based pattern examples, #2458 - nanorst for "borg help TOPIC" and --help - split deployment - deployment: hosting repositories - deployment: automated backups to a local hard drive - development: vagrant, windows10 requirements - development: update docs remarks - split usage docs, #2627 - usage: avoid bash highlight, [options] instead of - usage: add benchmark page - helpers: truncate_and_unlink doc - don't suggest to leak BORG_PASSPHRASE - internals: columnize rather long ToC [webkit fixup] internals: manifest & feature flags - internals: more HashIndex details - internals: fix ASCII art equations - internals: edited obj graph related sections a bit - internals: layers image + description - fix way too small figures in pdf - index: disable syntax highlight (bash) - improve options formatting, fix accidental block quotes - testing / checking: - add support for using coala, #1366 - testsuite: add ArchiverCorruptionTestCase - do not test logger name, #2504 - call setup_logging after destroying logging config - testsuite.archiver: normalise pytest.raises vs. assert_raises - add test for preserved intermediate folder permissions, #2477 - key: add round-trip test - remove attic dependency of the tests, #2505 - enable remote tests on cygwin - tests: suppress tar's future timestamp warning - cache sync: add more refcount tests - repository: add tests, including corruption tests - vagrant: - control VM cpus and pytest workers via env vars VMCPUS and XDISTN - update cleaning workdir - fix openbsd shell - add OpenIndiana - packaging: - binaries: don't bundle libssl - setup.py clean to remove compiled files - fail in borg package if version metadata is very broken (setuptools_scm) - repo / code structure: - create borg.algorithms and borg.crypto packages - algorithms: rename crc32 to checksums - move patterns to module, #2469 - gitignore: complete paths for src/ excludes - cache: extract CacheConfig class - implement IntegrityCheckedFile + Detached variant, #2502 #1688 - introduce popen_with_error_handling to handle common user errors Version 1.1.0b5 (2017-04-30) ---------------------------- Compatibility notes: - BORG_HOSTNAME_IS_UNIQUE is now on by default. - removed --compression-from feature - recreate: add --recompress flag, unify --always-recompress and --recompress Fixes: - catch exception for os.link when hardlinks are not supported, #2405 - borg rename / recreate: expand placeholders, #2386 - generic support for hardlinks (files, devices, FIFOs), #2324 - extract: also create parent dir for device files, if needed, #2358 - extract: if a hardlink master is not in the to-be-extracted subset, the "x" status was not displayed for it, #2351 - embrace y2038 issue to support 32bit platforms: clamp timestamps to int32, #2347 - verify_data: fix IntegrityError handling for defect chunks, #2442 - allow excluding parent and including child, #2314 Other changes: - refactor compression decision stuff - change global compression default to lz4 as well, to be consistent with --compression defaults. - placeholders: deny access to internals and other unspecified stuff - clearer error message for unrecognized placeholder - more clear exception if borg check does not help, #2427 - vagrant: upgrade FUSE for macOS to 3.5.8, #2346 - linux binary builds: get rid of glibc 2.13 dependency, #2430 - docs: - placeholders: document escaping - serve: env vars in original commands are ignored - tell what kind of hardlinks we support - more docs about compression - LICENSE: use canonical formulation ("copyright holders and contributors" instead of "author") - document borg init behaviour via append-only borg serve, #2440 - be clear about what buzhash is used for, #2390 - add hint about chunker params, #2421 - clarify borg upgrade docs, #2436 - FAQ to explain warning when running borg check --repair, #2341 - repository file system requirements, #2080 - pre-install considerations - misc. formatting / crossref fixes - tests: - enhance travis setuptools_scm situation - add extra test for the hashindex - fix invalid param issue in benchmarks These belong to 1.1.0b4 release, but did not make it into changelog by then: - vagrant: increase memory for parallel testing - lz4 compress: lower max. buffer size, exception handling - add docstring to do_benchmark_crud - patterns help: mention path full-match in intro Version 1.1.0b4 (2017-03-27) ---------------------------- Compatibility notes: - init: the --encryption argument is mandatory now (there are several choices) - moved "borg migrate-to-repokey" to "borg key migrate-to-repokey". - "borg change-passphrase" is deprecated, use "borg key change-passphrase" instead. - the --exclude-if-present option now supports tagging a folder with any filesystem object type (file, folder, etc), instead of expecting only files as tags, #1999 - the --keep-tag-files option has been deprecated in favor of the new --keep-exclude-tags, to account for the change mentioned above. - use lz4 compression by default, #2179 New features: - JSON API to make developing frontends and automation easier (see :ref:`json_output`) - add JSON output to commands: `borg create/list/info --json ...`. - add --log-json option for structured logging output. - add JSON progress information, JSON support for confirmations (yes()). - add two new options --pattern and --patterns-from as discussed in #1406 - new path full match pattern style (pf:) for very fast matching, #2334 - add 'debug dump-manifest' and 'debug dump-archive' commands - add 'borg benchmark crud' command, #1788 - new 'borg delete --force --force' to delete severely corrupted archives, #1975 - info: show utilization of maximum archive size, #1452 - list: add dsize and dcsize keys, #2164 - paperkey.html: Add interactive html template for printing key backups. - key export: add qr html export mode - securely erase config file (which might have old encryption key), #2257 - archived file items: add size to metadata, 'borg extract' and 'borg check' do check the file size for consistency, FUSE uses precomputed size from Item. Fixes: - fix remote speed regression introduced in 1.1.0b3, #2185 - fix regression handling timestamps beyond 2262 (revert bigint removal), introduced in 1.1.0b3, #2321 - clamp (nano)second values to unproblematic range, #2304 - hashindex: rebuild hashtable if we have too little empty buckets (performance fix), #2246 - Location regex: fix bad parsing of wrong syntax - ignore posix_fadvise errors in repository.py, #2095 - borg rpc: use limited msgpack.Unpacker (security precaution), #2139 - Manifest: Make sure manifest timestamp is strictly monotonically increasing. - create: handle BackupOSError on a per-path level in one spot - create: clarify -x option / meaning of "same filesystem" - create: don't create hard link refs to failed files - archive check: detect and fix missing all-zero replacement chunks, #2180 - files cache: update inode number when --ignore-inode is used, #2226 - fix decompression exceptions crashing ``check --verify-data`` and others instead of reporting integrity error, #2224 #2221 - extract: warning for unextracted big extended attributes, #2258, #2161 - mount: umount on SIGINT/^C when in foreground - mount: handle invalid hard link refs - mount: fix huge RAM consumption when mounting a repository (saves number of archives * 8 MiB), #2308 - hashindex: detect mingw byte order #2073 - hashindex: fix wrong skip_hint on hashindex_set when encountering tombstones, the regression was introduced in #1748 - fix ChunkIndex.__contains__ assertion for big-endian archs - fix borg key/debug/benchmark crashing without subcommand, #2240 - Location: accept //servername/share/path - correct/refactor calculation of unique/non-unique chunks - extract: fix missing call to ProgressIndicator.finish - prune: fix error msg, it is --keep-within, not --within - fix "auto" compression mode bug (not compressing), #2331 - fix symlink item fs size computation, #2344 Other changes: - remote repository: improved async exception processing, #2255 #2225 - with --compression auto,C, only use C if lz4 achieves at least 3% compression - PatternMatcher: only normalize path once, #2338 - hashindex: separate endian-dependent defs from endian detection - migrate-to-repokey: ask using canonical_path() as we do everywhere else. - SyncFile: fix use of fd object after close - make LoggedIO.close_segment reentrant - creating a new segment: use "xb" mode, #2099 - redo key_creator, key_factory, centralise key knowledge, #2272 - add return code functions, #2199 - list: only load cache if needed - list: files->items, clarifications - list: add "name" key for consistency with info cmd - ArchiveFormatter: add "start" key for compatibility with "info" - RemoteRepository: account rx/tx bytes - setup.py build_usage/build_man/build_api fixes - Manifest.in: simplify, exclude .so, .dll and .orig, #2066 - FUSE: get rid of chunk accounting, st_blocks = ceil(size / blocksize). - tests: - help python development by testing 3.6-dev - test for borg delete --force - vagrant: - freebsd: some fixes, #2067 - darwin64: use osxfuse 3.5.4 for tests / to build binaries - darwin64: improve VM settings - use python 3.5.3 to build binaries, #2078 - upgrade pyinstaller from 3.1.1+ to 3.2.1 - pyinstaller: use fixed AND freshly compiled bootloader, #2002 - pyinstaller: automatically builds bootloader if missing - docs: - create really nice man pages - faq: mention --remote-ratelimit in bandwidth limit question - fix caskroom link, #2299 - docs/security: reiterate that RPC in Borg does no networking - docs/security: counter tracking, #2266 - docs/development: update merge remarks - address SSH batch mode in docs, #2202 #2270 - add warning about running build_usage on Python >3.4, #2123 - one link per distro in the installation page - improve --exclude-if-present and --keep-exclude-tags, #2268 - improve automated backup script in doc, #2214 - improve remote-path description - update docs for create -C default change (lz4) - document relative path usage, #1868 - document snapshot usage, #2178 - corrected some stuff in internals+security - internals: move toctree to after the introduction text - clarify metadata kind, manifest ops - key enc: correct / clarify some stuff, link to internals/security - datas: enc: 1.1.x mas different MACs - datas: enc: correct factual error -- no nonce involved there. - make internals.rst an index page and edit it a bit - add "Cryptography in Borg" and "Remote RPC protocol security" sections - document BORG_HOSTNAME_IS_UNIQUE, #2087 - FAQ by categories as proposed by @anarcat in #1802 - FAQ: update Which file types, attributes, etc. are *not* preserved? - development: new branching model for git repository - development: define "ours" merge strategy for auto-generated files - create: move --exclude note to main doc - create: move item flags to main doc - fix examples using borg init without -e/--encryption - list: don't print key listings in fat (html + man) - remove Python API docs (were very incomplete, build problems on RTFD) - added FAQ section about backing up root partition Version 1.1.0b3 (2017-01-15) ---------------------------- Compatibility notes: - borg init: removed the default of "--encryption/-e", #1979 This was done so users do a informed decision about -e mode. Bug fixes: - borg recreate: don't rechunkify unless explicitly told so - borg info: fixed bug when called without arguments, #1914 - borg init: fix free space check crashing if disk is full, #1821 - borg debug delete/get obj: fix wrong reference to exception - fix processing of remote ~/ and ~user/ paths (regressed since 1.1.0b1), #1759 - posix platform module: only build / import on non-win32 platforms, #2041 New features: - new CRC32 implementations that are much faster than the zlib one used previously, #1970 - add blake2b key modes (use blake2b as MAC). This links against system libb2, if possible, otherwise uses bundled code - automatically remove stale locks - set BORG_HOSTNAME_IS_UNIQUE env var to enable stale lock killing. If set, stale locks in both cache and repository are deleted. #562 #1253 - borg info : print general repo information, #1680 - borg check --first / --last / --sort / --prefix, #1663 - borg mount --first / --last / --sort / --prefix, #1542 - implement "health" item formatter key, #1749 - BORG_SECURITY_DIR to remember security related infos outside the cache. Key type, location and manifest timestamp checks now survive cache deletion. This also means that you can now delete your cache and avoid previous warnings, since Borg can still tell it's safe. - implement BORG_NEW_PASSPHRASE, #1768 Other changes: - borg recreate: - remove special-cased --dry-run - update --help - remove bloat: interruption blah, autocommit blah, resuming blah - re-use existing checkpoint functionality - archiver tests: add check_cache tool - lints refcounts - fixed cache sync performance regression from 1.1.0b1 onwards, #1940 - syncing the cache without chunks.archive.d (see :ref:`disable_archive_chunks`) now avoids any merges and is thus faster, #1940 - borg check --verify-data: faster due to linear on-disk-order scan - borg debug-xxx commands removed, we use "debug xxx" subcommands now, #1627 - improve metadata handling speed - shortcut hashindex_set by having hashindex_lookup hint about address - improve / add progress displays, #1721 - check for index vs. segment files object count mismatch - make RPC protocol more extensible: use named parameters. - RemoteRepository: misc. code cleanups / refactors - clarify cache/repository README file - docs: - quickstart: add a comment about other (remote) filesystems - quickstart: only give one possible ssh url syntax, all others are documented in usage chapter. - mention file:// - document repo URLs / archive location - clarify borg diff help, #980 - deployment: synthesize alternative --restrict-to-path example - improve cache / index docs, esp. files cache docs, #1825 - document using "git merge 1.0-maint -s recursive -X rename-threshold=20%" for avoiding troubles when merging the 1.0-maint branch into master. - tests: - FUSE tests: catch ENOTSUP on freebsd - FUSE tests: test troublesome xattrs last - fix byte range error in test, #1740 - use monkeypatch to set env vars, but only on pytest based tests. - point XDG_*_HOME to temp dirs for tests, #1714 - remove all BORG_* env vars from the outer environment Version 1.1.0b2 (2016-10-01) ---------------------------- Bug fixes: - fix incorrect preservation of delete tags, leading to "object count mismatch" on borg check, #1598. This only occurred with 1.1.0b1 (not with 1.0.x) and is normally fixed by running another borg create/delete/prune. - fix broken --progress for double-cell paths (e.g. CJK), #1624 - borg recreate: also catch SIGHUP - FUSE: - fix hardlinks in versions view, #1599 - add parameter check to ItemCache.get to make potential failures more clear New features: - Archiver, RemoteRepository: add --remote-ratelimit (send data) - borg help compression, #1582 - borg check: delete chunks with integrity errors, #1575, so they can be "repaired" immediately and maybe healed later. - archives filters concept (refactoring/unifying older code) - covers --first/--last/--prefix/--sort-by options - currently used for borg list/info/delete Other changes: - borg check --verify-data slightly tuned (use get_many()) - change {utcnow} and {now} to ISO-8601 format ("T" date/time separator) - repo check: log transaction IDs, improve object count mismatch diagnostic - Vagrantfile: use TW's fresh-bootloader pyinstaller branch - fix module names in api.rst - hashindex: bump api_version Version 1.1.0b1 (2016-08-28) ---------------------------- New features: - new commands: - borg recreate: re-create existing archives, #787 #686 #630 #70, also see #757, #770. - selectively remove files/dirs from old archives - re-compress data - re-chunkify data, e.g. to have upgraded Attic / Borg 0.xx archives deduplicate with Borg 1.x archives or to experiment with chunker-params. - borg diff: show differences between archives - borg with-lock: execute a command with the repository locked, #990 - borg create: - Flexible compression with pattern matching on path/filename, and LZ4 heuristic for deciding compressibility, #810, #1007 - visit files in inode order (better speed, esp. for large directories and rotating disks) - in-file checkpoints, #1217 - increased default checkpoint interval to 30 minutes (was 5 minutes), #896 - added uuid archive format tag, #1151 - save mountpoint directories with --one-file-system, makes system restore easier, #1033 - Linux: added support for some BSD flags, #1050 - add 'x' status for excluded paths, #814 - also means files excluded via UF_NODUMP, #1080 - borg check: - will not produce the "Checking segments" output unless new --progress option is passed, #824. - --verify-data to verify data cryptographically on the client, #975 - borg list, #751, #1179 - removed {formatkeys}, see "borg list --help" - --list-format is deprecated, use --format instead - --format now also applies to listing archives, not only archive contents, #1179 - now supports the usual [PATH [PATHS…]] syntax and excludes - new keys: csize, num_chunks, unique_chunks, NUL - supports guaranteed_available hashlib hashes (to avoid varying functionality depending on environment), which includes the SHA1 and SHA2 family as well as MD5 - borg prune: - to better visualize the "thinning out", we now list all archives in reverse time order. rephrase and reorder help text. - implement --keep-last N via --keep-secondly N, also --keep-minutely. assuming that there is not more than 1 backup archive made in 1s, --keep-last N and --keep-secondly N are equivalent, #537 - cleanup checkpoints except the latest, #1008 - borg extract: - added --progress, #1449 - Linux: limited support for BSD flags, #1050 - borg info: - output is now more similar to borg create --stats, #977 - borg mount: - provide "borgfs" wrapper for borg mount, enables usage via fstab, #743 - "versions" mount option - when used with a repository mount, this gives a merged, versioned view of the files in all archives, #729 - repository: - added progress information to commit/compaction phase (often takes some time when deleting/pruning), #1519 - automatic recovery for some forms of repository inconsistency, #858 - check free space before going forward with a commit, #1336 - improved write performance (esp. for rotating media), #985 - new IO code for Linux - raised default segment size to approx 512 MiB - improved compaction performance, #1041 - reduced client CPU load and improved performance for remote repositories, #940 - options that imply output (--show-rc, --show-version, --list, --stats, --progress) don't need -v/--info to have that output displayed, #865 - add archive comments (via borg (re)create --comment), #842 - borg list/prune/delete: also output archive id, #731 - --show-version: shows/logs the borg version, #725 - added --debug-topic for granular debug logging, #1447 - use atomic file writing/updating for configuration and key files, #1377 - BORG_KEY_FILE environment variable, #1001 - self-testing module, #970 Bug fixes: - list: fixed default output being produced if --format is given with empty parameter, #1489 - create: fixed overflowing progress line with CJK and similar characters, #1051 - prune: fixed crash if --prefix resulted in no matches, #1029 - init: clean up partial repo if passphrase input is aborted, #850 - info: quote cmdline arguments that have spaces in them - fix hardlinks failing in some cases for extracting subtrees, #761 Other changes: - replace stdlib hmac with OpenSSL, zero-copy decrypt (10-15% increase in performance of hash-lists and extract). - improved chunker performance, #1021 - open repository segment files in exclusive mode (fail-safe), #1134 - improved error logging, #1440 - Source: - pass meta-data around, #765 - move some constants to new constants module - better readability and fewer errors with namedtuples, #823 - moved source tree into src/ subdirectory, #1016 - made borg.platform a package, #1113 - removed dead crypto code, #1032 - improved and ported parts of the test suite to py.test, #912 - created data classes instead of passing dictionaries around, #981, #1158, #1161 - cleaned up imports, #1112 - Docs: - better help texts and sphinx reproduction of usage help: - Group options - Nicer list of options in Sphinx - Deduplicate 'Common options' (including --help) - chunker: added some insights by "Voltara", #903 - clarify what "deduplicated size" means - fix / update / add package list entries - added a SaltStack usage example, #956 - expanded FAQ - new contributors in AUTHORS! - Tests: - vagrant: add ubuntu/xenial 64bit - this box has still some issues - ChunkBuffer: add test for leaving partial chunk in buffer, fixes #945 Version 1.0.13 (2019-02-15) --------------------------- Please note: this is very likely the last 1.0.x release, please upgrade to 1.1.x. Bug fixes: - security fix: configure FUSE with "default_permissions", #3903. "default_permissions" is now enforced by borg by default to let the kernel check uid/gid/mode based permissions. "ignore_permissions" can be given to not enforce "default_permissions". - xattrs: fix borg exception handling on ENOSPC error, #3808. New features: - Read a passphrase from a file descriptor specified in the BORG_PASSPHRASE_FD environment variable. Other changes: - acl platform code: fix acl set return type - xattr: - add linux {list,get,set}xattr ctypes prototypes - fix darwin flistxattr ctypes prototype - testing / travis-ci: - fix the homebrew 1.9 issues on travis-ci, #4254 - travis OS X: use xcode 8.3 (not broken) - tox.ini: lock requirements - unbreak 1.0-maint on travis, fixes #4123 - vagrant: - misc. fixes - FUSE for macOS: upgrade 3.7.1 to 3.8.3 - Python: upgrade 3.5.5 to 3.5.6 - docs: - Update installation instructions for macOS - update release workflow using twine (docs, scripts), #4213 Version 1.0.12 (2018-04-08) --------------------------- Bug fixes: - repository: cleanup/write: invalidate cached FDs, tests - serve: fix exitcode, #2910 - extract: set bsdflags last (include immutable flag), #3263 - create --timestamp: set start time, #2957 - create: show excluded dir with "x" for tagged dirs / caches, #3189 - migrate locks to child PID when daemonize is used - Buffer: fix wrong thread-local storage use, #2951 - fix detection of non-local path, #3108 - fix LDLP restoration for subprocesses, #3077 - fix subprocess environments (xattr module's fakeroot version check, borg umount, BORG_PASSCOMMAND), #3050 - remote: deal with partial lines, #2637 - get rid of datetime.isoformat, use safe parse_timestamp to parse timestamps, #2994 - build: do .h file content checks in binary mode, fixes build issue for non-ascii header files on pure-ascii locale platforms, #3544 #3639 - remove platform.uname() call which caused library mismatch issues, #3732 - add exception handler around deprecated platform.linux_distribution() call Other changes: - require msgpack-python >= 0.4.6 and < 0.5.0, see #3753 - add parens for C preprocessor macro argument usages (did not cause malfunction) - ignore corrupt files cache, #2939 - replace "modulo" with "if" to check for wraparound in hashmap - keymanager: don't depend on optional readline module, #2980 - exclude broken pytest 3.3.0 release - exclude broken Cython 0.27(.0) release, #3066 - flake8: add some ignores - docs: - create: document exclusion through nodump - document good and problematic option placements, fix examples, #3356 - update docs about hardlinked symlinks limitation - faq: we do not implement futile attempts of ETA / progress displays - simplified rate limiting wrapper in FAQ - twitter account @borgbackup, #2948 - add note about metadata dedup and --no[ac]time, #2518 - change-passphrase only changes the passphrase, #2990 - clarify encrypted key format for borg key export, #3296 - document sshfs rename workaround, #3315 - update release checklist about security fixes - docs about how to verify a signed release, #3634 - chunk seed is generated per /repository/ - vagrant: - use FUSE for macOS 3.7.1 to build the macOS binary - use python 3.5.5 to build the binaries - add exe location to PATH when we build an exe - use https pypi url for wheezy - netbsd: bash is already installed - netbsd: fix netbsd version in PKG_PATH - use self-made FreeBSD 10.3 box, #3022 - backport fs_init (including related updates) from 1.1 - the boxcutter wheezy boxes are 404, use local ones - travis: - don't perform full Travis build on docs-only changes, #2531 - only short-circuit docs-only changes for pull requests Version 1.0.11 (2017-07-21) --------------------------- Bug fixes: - use limited unpacker for outer key (security precaution), #2174 - fix paperkey import bug Other changes: - change --checkpoint-interval default from 600s to 1800s, #2841. this improves efficiency for big repositories a lot. - docs: fix OpenSUSE command and add OpenSUSE section - tests: add tests for split_lstring and paperkey - vagrant: - fix openbsd shell - backport cpu/ram setup from master - add stretch64 VM Version 1.0.11rc1 (2017-06-27) ------------------------------ Bug fixes: - performance: rebuild hashtable if we have too few empty buckets, #2246. this fixes some sporadic, but severe performance breakdowns. - Archive: allocate zeros when needed, #2308 fixes huge memory usage of mount (8 MiB × number of archives) - IPv6 address support also: Location: more informative exception when parsing fails - borg single-file binary: use pyinstaller v3.2.1, #2396 this fixes that the prelink cronjob on some distros kills the borg binary by stripping away parts of it. - extract: - warning for unextracted big extended attributes, #2258 - also create parent dir for device files, if needed. - don't write to disk with --stdout, #2645 - archive check: detect and fix missing all-zero replacement chunks, #2180 - fix (de)compression exceptions, #2224 #2221 - files cache: update inode number, #2226 - borg rpc: use limited msgpack.Unpacker (security precaution), #2139 - Manifest: use limited msgpack.Unpacker (security precaution), #2175 - Location: accept //servername/share/path - fix ChunkIndex.__contains__ assertion for big-endian archs (harmless) - create: handle BackupOSError on a per-path level in one spot - fix error msg, there is no --keep-last in borg 1.0.x, #2282 - clamp (nano)second values to unproblematic range, #2304 - fuse / borg mount: - fix st_blocks to be an integer (not float) value - fix negative uid/gid crash (they could come into archives e.g. when backing up external drives under cygwin), #2674 - fix crash if empty (None) xattr is read - do pre-mount checks before opening repository - check llfuse is installed before asking for passphrase - borg rename: expand placeholders, #2386 - borg serve: fix forced command lines containing BORG_* env vars - fix error msg, it is --keep-within, not --within - fix borg key/debug/benchmark crashing without subcommand, #2240 - chunker: fix invalid use of types, don't do uint32_t >> 32 - document follow_symlinks requirements, check libc, #2507 New features: - added BORG_PASSCOMMAND environment variable, #2573 - add minimal version of in repository mandatory feature flags, #2134 This should allow us to make sure older borg versions can be cleanly prevented from doing operations that are no longer safe because of repository format evolution. This allows more fine grained control than just incrementing the manifest version. So for example a change that still allows new archives to be created but would corrupt the repository when an old version tries to delete an archive or check the repository would add the new feature to the check and delete set but leave it out of the write set. - borg delete --force --force to delete severely corrupted archives, #1975 Other changes: - embrace y2038 issue to support 32bit platforms - be more clear that this is a "beyond repair" case, #2427 - key file names: limit to 100 characters and remove colons from host name - upgrade FUSE for macOS to 3.5.8, #2346 - split up parsing and filtering for --keep-within, better error message, #2610 - docs: - fix caskroom link, #2299 - address SSH batch mode, #2202 #2270 - improve remote-path description - document snapshot usage, #2178 - document relative path usage, #1868 - one link per distro in the installation page - development: new branching model in git repository - kill api page - added FAQ section about backing up root partition - add bountysource badge, #2558 - create empty docs.txt reequirements, #2694 - README: how to help the project - note -v/--verbose requirement on affected options, #2542 - document borg init behaviour via append-only borg serve, #2440 - be clear about what buzhash is used for (chunking) and want it is not used for (deduplication)- also say already in the readme that we use a cryptohash for dedupe, so people don't worry, #2390 - add hint about chunker params to borg upgrade docs, #2421 - clarify borg upgrade docs, #2436 - quickstart: delete problematic BORG_PASSPHRASE use, #2623 - faq: specify "using inline shell scripts" - document pattern denial of service, #2624 - tests: - remove attic dependency of the tests, #2505 - travis: - enhance travis setuptools_scm situation - install fakeroot for Linux - add test for borg delete --force - enable remote tests on cygwin (the cygwin issue that caused these tests to break was fixed in cygwin at least since cygwin 2.8, maybe even since 2.7.0). - remove skipping the noatime tests on GNU/Hurd, #2710 - fix borg import issue, add comment, #2718 - include attic.tar.gz when installing the package also: add include_package_data=True Version 1.0.10 (2017-02-13) --------------------------- Bug fixes: - Manifest timestamps are now monotonically increasing, this fixes issues when the system clock jumps backwards or is set inconsistently across computers accessing the same repository, #2115 - Fixed testing regression in 1.0.10rc1 that lead to a hard dependency on py.test >= 3.0, #2112 New features: - "key export" can now generate a printable HTML page with both a QR code and a human-readable "paperkey" representation (and custom text) through the ``--qr-html`` option. The same functionality is also available through `paperkey.html `_, which is the same HTML page generated by ``--qr-html``. It works with existing "key export" files and key files. Other changes: - docs: - language clarification - "borg create --one-file-system" option does not respect mount points, but considers different file systems instead, #2141 - setup.py: build_api: sort file list for determinism Version 1.0.10rc1 (2017-01-29) ------------------------------ Bug fixes: - borg serve: fix transmission data loss of pipe writes, #1268 This affects only the cygwin platform (not Linux, BSD, OS X). - Avoid triggering an ObjectiveFS bug in xattr retrieval, #1992 - When running out of buffer memory when reading xattrs, only skip the current file, #1993 - Fixed "borg upgrade --tam" crashing with unencrypted repositories. Since :ref:`the issue ` is not relevant for unencrypted repositories, it now does nothing and prints an error, #1981. - Fixed change-passphrase crashing with unencrypted repositories, #1978 - Fixed "borg check repo::archive" indicating success if "archive" does not exist, #1997 - borg check: print non-exit-code warning if --last or --prefix aren't fulfilled - fix bad parsing of wrong repo location syntax - create: don't create hard link refs to failed files, mount: handle invalid hard link refs, #2092 - detect mingw byte order, #2073 - creating a new segment: use "xb" mode, #2099 - mount: umount on SIGINT/^C when in foreground, #2082 Other changes: - binary: use fixed AND freshly compiled pyinstaller bootloader, #2002 - xattr: ignore empty names returned by llistxattr(2) et al - Enable the fault handler: install handlers for the SIGSEGV, SIGFPE, SIGABRT, SIGBUS and SIGILL signals to dump the Python traceback. - Also print a traceback on SIGUSR2. - borg change-passphrase: print key location (simplify making a backup of it) - officially support Python 3.6 (setup.py: add Python 3.6 qualifier) - tests: - vagrant / travis / tox: add Python 3.6 based testing - vagrant: fix openbsd repo, #2042 - vagrant: fix the freebsd64 machine, #2037 #2067 - vagrant: use python 3.5.3 to build binaries, #2078 - vagrant: use osxfuse 3.5.4 for tests / to build binaries vagrant: improve darwin64 VM settings - travis: fix osxfuse install (fixes OS X testing on Travis CI) - travis: require succeeding OS X tests, #2028 - travis: use latest pythons for OS X based testing - use pytest-xdist to parallelize testing - fix xattr test race condition, #2047 - setup.cfg: fix pytest deprecation warning, #2050 - docs: - language clarification - VM backup FAQ - borg create: document how to backup stdin, #2013 - borg upgrade: fix incorrect title levels - add CVE numbers for issues fixed in 1.0.9, #2106 - fix typos (taken from Debian package patch) - remote: include data hexdump in "unexpected RPC data" error message - remote: log SSH command line at debug level - API_VERSION: use numberspaces, #2023 - remove .github from pypi package, #2051 - add pip and setuptools to requirements file, #2030 - SyncFile: fix use of fd object after close (cosmetic) - Manifest.in: simplify, exclude \*.{so,dll,orig}, #2066 - ignore posix_fadvise errors in repository.py, #2095 (works around issues with docker on ARM) - make LoggedIO.close_segment reentrant, avoid reentrance Version 1.0.9 (2016-12-20) -------------------------- Security fixes: - A flaw in the cryptographic authentication scheme in Borg allowed an attacker to spoof the manifest. See :ref:`tam_vuln` above for the steps you should take. CVE-2016-10099 was assigned to this vulnerability. - borg check: When rebuilding the manifest (which should only be needed very rarely) duplicate archive names would be handled on a "first come first serve" basis, allowing an attacker to apparently replace archives. CVE-2016-10100 was assigned to this vulnerability. Bug fixes: - borg check: - rebuild manifest if it's corrupted - skip corrupted chunks during manifest rebuild - fix TypeError in integrity error handler, #1903, #1894 - fix location parser for archives with @ char (regression introduced in 1.0.8), #1930 - fix wrong duration/timestamps if system clock jumped during a create - fix progress display not updating if system clock jumps backwards - fix checkpoint interval being incorrect if system clock jumps Other changes: - docs: - add python3-devel as a dependency for cygwin-based installation - clarify extract is relative to current directory - FAQ: fix link to changelog - markup fixes - tests: - test_get\_(cache|keys)_dir: clean env state, #1897 - get back pytest's pretty assertion failures, #1938 - setup.py build_usage: - fixed build_usage not processing all commands - fixed build_usage not generating includes for debug commands Version 1.0.9rc1 (2016-11-27) ----------------------------- Bug fixes: - files cache: fix determination of newest mtime in backup set (which is used in cache cleanup and led to wrong "A" [added] status for unchanged files in next backup), #1860. - borg check: - fix incorrectly reporting attic 0.13 and earlier archives as corrupt - handle repo w/o objects gracefully and also bail out early if repo is *completely* empty, #1815. - fix tox/pybuild in 1.0-maint - at xattr module import time, loggers are not initialized yet New features: - borg umount exposed already existing umount code via the CLI api, so users can use it, which is more consistent than using borg to mount and fusermount -u (or umount) to un-mount, #1855. - implement borg create --noatime --noctime, fixes #1853 Other changes: - docs: - display README correctly on PyPI - improve cache / index docs, esp. files cache docs, fixes #1825 - different pattern matching for --exclude, #1779 - datetime formatting examples for {now} placeholder, #1822 - clarify passphrase mode attic repo upgrade, #1854 - clarify --umask usage, #1859 - clarify how to choose PR target branch - clarify prune behavior for different archive contents, #1824 - fix PDF issues, add logo, fix authors, headings, TOC - move security verification to support section - fix links in standalone README (:ref: tags) - add link to security contact in README - add FAQ about security - move fork differences to FAQ - add more details about resource usage - tests: skip remote tests on cygwin, #1268 - travis: - allow OS X failures until the brew cask osxfuse issue is fixed - caskroom osxfuse-beta gone, it's osxfuse now (3.5.3) - vagrant: - upgrade OSXfuse / FUSE for macOS to 3.5.3 - remove llfuse from tox.ini at a central place - do not try to install llfuse on centos6 - fix FUSE test for darwin, #1546 - add windows virtual machine with cygwin - Vagrantfile cleanup / code deduplication Version 1.0.8 (2016-10-29) -------------------------- Bug fixes: - RemoteRepository: Fix busy wait in call_many, #940 New features: - implement borgmajor/borgminor/borgpatch placeholders, #1694 {borgversion} was already there (full version string). With the new placeholders you can now also get e.g. 1 or 1.0 or 1.0.8. Other changes: - avoid previous_location mismatch, #1741 due to the changed canonicalization for relative paths in PR #1711 / #1655 (implement /./ relpath hack), there would be a changed repo location warning and the user would be asked if this is ok. this would break automation and require manual intervention, which is unwanted. thus, we automatically fix the previous_location config entry, if it only changed in the expected way, but still means the same location. - docs: - deployment.rst: do not use bare variables in ansible snippet - add clarification about append-only mode, #1689 - setup.py: add comment about requiring llfuse, #1726 - update usage.rst / api.rst - repo url / archive location docs + typo fix - quickstart: add a comment about other (remote) filesystems - vagrant / tests: - no chown when rsyncing (fixes boxes w/o vagrant group) - fix FUSE permission issues on linux/freebsd, #1544 - skip FUSE test for borg binary + fakeroot - ignore security.selinux xattrs, fixes tests on centos, #1735 Version 1.0.8rc1 (2016-10-17) ----------------------------- Bug fixes: - fix signal handling (SIGINT, SIGTERM, SIGHUP), #1620 #1593 Fixes e.g. leftover lock files for quickly repeated signals (e.g. Ctrl-C Ctrl-C) or lost connections or systemd sending SIGHUP. - progress display: adapt formatting to narrow screens, do not crash, #1628 - borg create --read-special - fix crash on broken symlink, #1584. also correctly processes broken symlinks. before this regressed to a crash (5b45385) a broken symlink would've been skipped. - process_symlink: fix missing backup_io() Fixes a chmod/chown/chgrp/unlink/rename/... crash race between getting dirents and dispatching to process_symlink. - yes(): abort on wrong answers, saying so, #1622 - fixed exception borg serve raised when connection was closed before repository was opened. Add an error message for this. - fix read-from-closed-FD issue, #1551 (this seems not to get triggered in 1.0.x, but was discovered in master) - hashindex: fix iterators (always raise StopIteration when exhausted) (this seems not to get triggered in 1.0.x, but was discovered in master) - enable relative paths in ssh:// repo URLs, via /./relpath hack, #1655 - allow repo paths with colons, #1705 - update changed repo location immediately after acceptance, #1524 - fix debug get-obj / delete-obj crash if object not found and remote repo, #1684 - pyinstaller: use a spec file to build borg.exe binary, exclude osxfuse dylib on Mac OS X (avoids mismatch lib <-> driver), #1619 New features: - add "borg key export" / "borg key import" commands, #1555, so users are able to backup / restore their encryption keys more easily. Supported formats are the keyfile format used by borg internally and a special "paper" format with by line checksums for printed backups. For the paper format, the import is an interactive process which checks each line as soon as it is input. - add "borg debug-refcount-obj" to determine a repo objects' referrer counts, #1352 Other changes: - add "borg debug ..." subcommands (borg debug-* still works, but will be removed in borg 1.1) - setup.py: Add subcommand support to build_usage. - remote: change exception message for unexpected RPC data format to indicate dataflow direction. - improved messages / error reporting: - IntegrityError: add placeholder for message, so that the message we give appears not only in the traceback, but also in the (short) error message, #1572 - borg.key: include chunk id in exception msgs, #1571 - better messages for cache newer than repo, #1700 - vagrant (testing/build VMs): - upgrade OSXfuse / FUSE for macOS to 3.5.2 - update Debian Wheezy boxes, #1686 - openbsd / netbsd: use own boxes, fixes misc rsync installation and FUSE/llfuse related testing issues, #1695 #1696 #1670 #1671 #1728 - docs: - add docs for "key export" and "key import" commands, #1641 - fix inconsistency in FAQ (pv-wrapper). - fix second block in "Easy to use" section not showing on GitHub, #1576 - add bestpractices badge - link reference docs and faq about BORG_FILES_CACHE_TTL, #1561 - improve borg info --help, explain size infos, #1532 - add release signing key / security contact to README, #1560 - add contribution guidelines for developers - development.rst: add sphinx_rtd_theme to the sphinx install command - adjust border color in borg.css - add debug-info usage help file - internals.rst: fix typos - setup.py: fix build_usage to always process all commands - added docs explaining multiple --restrict-to-path flags, #1602 - add more specific warning about write-access debug commands, #1587 - clarify FAQ regarding backup of virtual machines, #1672 - tests: - work around FUSE xattr test issue with recent fakeroot - simplify repo/hashindex tests - travis: test FUSE-enabled borg, use trusty to have a recent FUSE - re-enable FUSE tests for RemoteArchiver (no deadlocks any more) - clean env for pytest based tests, #1714 - fuse_mount contextmanager: accept any options Version 1.0.7 (2016-08-19) -------------------------- Security fixes: - borg serve: fix security issue with remote repository access, #1428 If you used e.g. --restrict-to-path /path/client1/ (with or without trailing slash does not make a difference), it acted like a path prefix match using /path/client1 (note the missing trailing slash) - the code then also allowed working in e.g. /path/client13 or /path/client1000. As this could accidentally lead to major security/privacy issues depending on the paths you use, the behaviour was changed to be a strict directory match. That means --restrict-to-path /path/client1 (with or without trailing slash does not make a difference) now uses /path/client1/ internally (note the trailing slash here!) for matching and allows precisely that path AND any path below it. So, /path/client1 is allowed, /path/client1/repo1 is allowed, but not /path/client13 or /path/client1000. If you willingly used the undocumented (dangerous) previous behaviour, you may need to rearrange your --restrict-to-path paths now. We are sorry if that causes work for you, but we did not want a potentially dangerous behaviour in the software (not even using a for-backwards-compat option). Bug fixes: - fixed repeated LockTimeout exceptions when borg serve tried to write into a already write-locked repo (e.g. by a borg mount), #502 part b) This was solved by the fix for #1220 in 1.0.7rc1 already. - fix cosmetics + file leftover for "not a valid borg repository", #1490 - Cache: release lock if cache is invalid, #1501 - borg extract --strip-components: fix leak of preloaded chunk contents - Repository, when a InvalidRepository exception happens: - fix spurious, empty lock.roster - fix repo not closed cleanly New features: - implement borg debug-info, fixes #1122 (just calls already existing code via cli, same output as below tracebacks) Other changes: - skip the O_NOATIME test on GNU Hurd, fixes #1315 (this is a very minor issue and the GNU Hurd project knows the bug) - document using a clean repo to test / build the release Version 1.0.7rc2 (2016-08-13) ----------------------------- Bug fixes: - do not write objects to repository that are bigger than the allowed size, borg will reject reading them, #1451. Important: if you created archives with many millions of files or directories, please verify if you can open them successfully, e.g. try a "borg list REPO::ARCHIVE". - lz4 compression: dynamically enlarge the (de)compression buffer, the static buffer was not big enough for archives with extremely many items, #1453 - larger item metadata stream chunks, raise archive item limit by 8x, #1452 - fix untracked segments made by moved DELETEs, #1442 Impact: Previously (metadata) segments could become untracked when deleting data, these would never be cleaned up. - extended attributes (xattrs) related fixes: - fixed a race condition in xattrs querying that led to the entire file not being backed up (while logging the error, exit code = 1), #1469 - fixed a race condition in xattrs querying that led to a crash, #1462 - raise OSError including the error message derived from errno, deal with path being a integer FD Other changes: - print active env var override by default, #1467 - xattr module: refactor code, deduplicate, clean up - repository: split object size check into too small and too big - add a transaction_id assertion, so borg init on a broken (inconsistent) filesystem does not look like a coding error in borg, but points to the real problem. - explain confusing TypeError caused by compat support for old servers, #1456 - add forgotten usage help file from build_usage - refactor/unify buffer code into helpers.Buffer class, add tests - docs: - document archive limitation, #1452 - improve prune examples Version 1.0.7rc1 (2016-08-05) ----------------------------- Bug fixes: - fix repo lock deadlocks (related to lock upgrade), #1220 - catch unpacker exceptions, resync, #1351 - fix borg break-lock ignoring BORG_REPO env var, #1324 - files cache performance fixes (fixes unnecessary re-reading/chunking/ hashing of unmodified files for some use cases): - fix unintended file cache eviction, #1430 - implement BORG_FILES_CACHE_TTL, update FAQ, raise default TTL from 10 to 20, #1338 - FUSE: - cache partially read data chunks (performance), #965, #966 - always create a root dir, #1125 - use an OrderedDict for helptext, making the build reproducible, #1346 - RemoteRepository init: always call close on exceptions, #1370 (cosmetic) - ignore stdout/stderr broken pipe errors (cosmetic), #1116 New features: - better borg versions management support (useful esp. for borg servers wanting to offer multiple borg versions and for clients wanting to choose a specific server borg version), #1392: - add BORG_VERSION environment variable before executing "borg serve" via ssh - add new placeholder {borgversion} - substitute placeholders in --remote-path - borg init --append-only option (makes using the more secure append-only mode more convenient. when used remotely, this requires 1.0.7+ also on the borg server), #1291. Other changes: - Vagrantfile: - darwin64: upgrade to FUSE for macOS 3.4.1 (aka osxfuse), #1378 - xenial64: use user "ubuntu", not "vagrant" (as usual), #1331 - tests: - fix FUSE tests on OS X, #1433 - docs: - FAQ: add backup using stable filesystem names recommendation - FAQ about glibc compatibility added, #491, glibc-check improved - FAQ: 'A' unchanged file; remove ambiguous entry age sentence. - OS X: install pkg-config to build with FUSE support, fixes #1400 - add notes about shell/sudo pitfalls with env. vars, #1380 - added platform feature matrix - implement borg debug-dump-repo-objs Version 1.0.6 (2016-07-12) -------------------------- Bug fixes: - Linux: handle multiple LD_PRELOAD entries correctly, #1314, #1111 - Fix crash with unclear message if the libc is not found, #1314, #1111 Other changes: - tests: - Fixed O_NOATIME tests for Solaris and GNU Hurd, #1315 - Fixed sparse file tests for (file) systems not supporting it, #1310 - docs: - Fixed syntax highlighting, #1313 - misc docs: added data processing overview picture Version 1.0.6rc1 (2016-07-10) ----------------------------- New features: - borg check --repair: heal damaged files if missing chunks re-appear (e.g. if the previously missing chunk was added again in a later backup archive), #148. (*) Also improved logging. Bug fixes: - sync_dir: silence fsync() failing with EINVAL, #1287 Some network filesystems (like smbfs) don't support this and we use this in repository code. - borg mount (FUSE): - fix directories being shadowed when contained paths were also specified, #1295 - raise I/O Error (EIO) on damaged files (unless -o allow_damaged_files is used), #1302. (*) - borg extract: warn if a damaged file is extracted, #1299. (*) - Added some missing return code checks (ChunkIndex._add, hashindex_resize). - borg check: fix/optimize initial hash table size, avoids resize of the table. Other changes: - tests: - add more FUSE tests, #1284 - deduplicate FUSE (u)mount code - fix borg binary test issues, #862 - docs: - changelog: added release dates to older borg releases - fix some sphinx (docs generator) warnings, #881 Notes: (*) Some features depend on information (chunks_healthy list) added to item metadata when a file with missing chunks was "repaired" using all-zero replacement chunks. The chunks_healthy list is generated since borg 1.0.4, thus borg can't recognize such "repaired" (but content-damaged) files if the repair was done with an older borg version. Version 1.0.5 (2016-07-07) -------------------------- Bug fixes: - borg mount: fix FUSE crash in xattr code on Linux introduced in 1.0.4, #1282 Other changes: - backport some FAQ entries from master branch - add release helper scripts - Vagrantfile: - centos6: no FUSE, don't build binary - add xz for redhat-like dists Version 1.0.4 (2016-07-07) -------------------------- New features: - borg serve --append-only, #1168 This was included because it was a simple change (append-only functionality was already present via repository config file) and makes better security now practically usable. - BORG_REMOTE_PATH environment variable, #1258 This was included because it was a simple change (--remote-path cli option was already present) and makes borg much easier to use if you need it. - Repository: cleanup incomplete transaction on "no space left" condition. In many cases, this can avoid a 100% full repo filesystem (which is very problematic as borg always needs free space - even to delete archives). Bug fixes: - Fix wrong handling and reporting of OSErrors in borg create, #1138. This was a serious issue: in the context of "borg create", errors like repository I/O errors (e.g. disk I/O errors, ssh repo connection errors) were handled badly and did not lead to a crash (which would be good for this case, because the repo transaction would be incomplete and trigger a transaction rollback to clean up). Now, error handling for source files is cleanly separated from every other error handling, so only problematic input files are logged and skipped. - Implement fail-safe error handling for borg extract. Note that this isn't nearly as critical as the borg create error handling bug, since nothing is written to the repo. So this was "merely" misleading error reporting. - Add missing error handler in directory attr restore loop. - repo: make sure write data hits disk before the commit tag (#1236) and also sync the containing directory. - FUSE: getxattr fail must use errno.ENOATTR, #1126 (fixes Mac OS X Finder malfunction: "zero bytes" file length, access denied) - borg check --repair: do not lose information about the good/original chunks. If we do not lose the original chunk IDs list when "repairing" a file (replacing missing chunks with all-zero chunks), we have a chance to "heal" the file back into its original state later, in case the chunks re-appear (e.g. in a fresh backup). Healing is not implemented yet, see #148. - fixes for --read-special mode: - ignore known files cache, #1241 - fake regular file mode, #1214 - improve symlinks handling, #1215 - remove passphrase from subprocess environment, #1105 - Ignore empty index file (will trigger index rebuild), #1195 - add missing placeholder support for --prefix, #1027 - improve exception handling for placeholder replacement - catch and format exceptions in arg parsing - helpers: fix "undefined name 'e'" in exception handler - better error handling for missing repo manifest, #1043 - borg delete: - make it possible to delete a repo without manifest - borg delete --forced allows one to delete corrupted archives, #1139 - borg check: - make borg check work for empty repo - fix resync and msgpacked item qualifier, #1135 - rebuild_manifest: fix crash if 'name' or 'time' key were missing. - better validation of item metadata dicts, #1130 - better validation of archive metadata dicts - close the repo on exit - even if rollback did not work, #1197. This is rather cosmetic, it avoids repo closing in the destructor. - tests: - fix sparse file test, #1170 - flake8: ignore new F405, #1185 - catch "invalid argument" on cygwin, #257 - fix sparseness assertion in test prep, #1264 Other changes: - make borg build/work on OpenSSL 1.0 and 1.1, #1187 - docs / help: - fix / clarify prune help, #1143 - fix "patterns" help formatting - add missing docs / help about placeholders - resources: rename atticmatic to borgmatic - document sshd settings, #545 - more details about checkpoints, add split trick, #1171 - support docs: add freenode web chat link, #1175 - add prune visualization / example, #723 - add note that Fnmatch is default, #1247 - make clear that lzma levels > 6 are a waste of cpu cycles - add a "do not edit" note to auto-generated files, #1250 - update cygwin installation docs - repository interoperability with borg master (1.1dev) branch: - borg check: read item metadata keys from manifest, #1147 - read v2 hints files, #1235 - fix hints file "unknown version" error handling bug - tests: add tests for format_line - llfuse: update version requirement for freebsd - Vagrantfile: - use openbsd 5.9, #716 - do not install llfuse on netbsd (broken) - update OSXfuse to version 3.3.3 - use Python 3.5.2 to build the binaries - glibc compatibility checker: scripts/glibc_check.py - add .eggs to .gitignore Version 1.0.3 (2016-05-20) -------------------------- Bug fixes: - prune: avoid that checkpoints are kept and completed archives are deleted in a prune run), #997 - prune: fix commandline argument validation - some valid command lines were considered invalid (annoying, but harmless), #942 - fix capabilities extraction on Linux (set xattrs last, after chown()), #1069 - repository: fix commit tags being seen in data - when probing key files, do binary reads. avoids crash when non-borg binary files are located in borg's key files directory. - handle SIGTERM and make a clean exit - avoids orphan lock files. - repository cache: don't cache large objects (avoid using lots of temp. disk space), #1063 Other changes: - Vagrantfile: OS X: update osxfuse / install lzma package, #933 - setup.py: add check for platform_darwin.c - setup.py: on freebsd, use a llfuse release that builds ok - docs / help: - update readthedocs URLs, #991 - add missing docs for "borg break-lock", #992 - borg create help: add some words to about the archive name - borg create help: document format tags, #894 Version 1.0.2 (2016-04-16) -------------------------- Bug fixes: - fix malfunction and potential corruption on (nowadays rather rare) big-endian architectures or bi-endian archs in (rare) BE mode. #886, #889 cache resync / index merge was malfunctioning due to this, potentially leading to data loss. borg info had cosmetic issues (displayed wrong values). note: all (widespread) little-endian archs (like x86/x64) or bi-endian archs in (widespread) LE mode (like ARMEL, MIPSEL, ...) were NOT affected. - add overflow and range checks for 1st (special) uint32 of the hashindex values, switch from int32 to uint32. - fix so that refcount will never overflow, but just stick to max. value after a overflow would have occurred. - borg delete: fix --cache-only for broken caches, #874 Makes --cache-only idempotent: it won't fail if the cache is already deleted. - fixed borg create --one-file-system erroneously traversing into other filesystems (if starting fs device number was 0), #873 - workaround a bug in Linux fadvise FADV_DONTNEED, #907 Other changes: - better test coverage for hashindex, incl. overflow testing, checking correct computations so endianness issues would be discovered. - reproducible doc for ProgressIndicator*, make the build reproducible. - use latest llfuse for vagrant machines - docs: - use /path/to/repo in examples, fixes #901 - fix confusing usage of "repo" as archive name (use "arch") Version 1.0.1 (2016-04-08) -------------------------- New features: Usually there are no new features in a bugfix release, but these were added due to their high impact on security/safety/speed or because they are fixes also: - append-only mode for repositories, #809, #36 (see docs) - borg create: add --ignore-inode option to make borg detect unmodified files even if your filesystem does not have stable inode numbers (like sshfs and possibly CIFS). - add options --warning, --error, --critical for missing log levels, #826. it's not recommended to suppress warnings or errors, but the user may decide this on his own. note: --warning is not given to borg serve so a <= 1.0.0 borg will still work as server (it is not needed as it is the default). do not use --error or --critical when using a <= 1.0.0 borg server. Bug fixes: - fix silently skipping EIO, #748 - add context manager for Repository (avoid orphan repository locks), #285 - do not sleep for >60s while waiting for lock, #773 - unpack file stats before passing to FUSE - fix build on illumos - don't try to backup doors or event ports (Solaris and derivatives) - remove useless/misleading libc version display, #738 - test suite: reset exit code of persistent archiver, #844 - RemoteRepository: clean up pipe if remote open() fails - Remote: don't print tracebacks for Error exceptions handled downstream, #792 - if BORG_PASSPHRASE is present but wrong, don't prompt for password, but fail instead, #791 - ArchiveChecker: move "orphaned objects check skipped" to INFO log level, #826 - fix capitalization, add ellipses, change log level to debug for 2 messages, #798 Other changes: - update llfuse requirement, llfuse 1.0 works - update OS / dist packages on build machines, #717 - prefer showing --info over -v in usage help, #859 - docs: - fix cygwin requirements (gcc-g++) - document how to debug / file filesystem issues, #664 - fix reproducible build of api docs - RTD theme: CSS !important overwrite, #727 - Document logo font. Recreate logo png. Remove GIMP logo file. Version 1.0.0 (2016-03-05) -------------------------- The major release number change (0.x -> 1.x) indicates bigger incompatible changes, please read the compatibility notes, adapt / test your scripts and check your backup logs. Compatibility notes: - drop support for python 3.2 and 3.3, require 3.4 or 3.5, #221 #65 #490 note: we provide binaries that include python 3.5.1 and everything else needed. they are an option in case you are stuck with < 3.4 otherwise. - change encryption to be on by default (using "repokey" mode) - moved keyfile keys from ~/.borg/keys to ~/.config/borg/keys, you can either move them manually or run "borg upgrade " - remove support for --encryption=passphrase, use borg migrate-to-repokey to switch to repokey mode, #97 - remove deprecated --compression , use --compression zlib, instead in case of 0, you could also use --compression none - remove deprecated --hourly/daily/weekly/monthly/yearly use --keep-hourly/daily/weekly/monthly/yearly instead - remove deprecated --do-not-cross-mountpoints, use --one-file-system instead - disambiguate -p option, #563: - -p now is same as --progress - -P now is same as --prefix - remove deprecated "borg verify", use "borg extract --dry-run" instead - cleanup environment variable semantics, #355 the environment variables used to be "yes sayers" when set, this was conceptually generalized to "automatic answerers" and they just give their value as answer (as if you typed in that value when being asked). See the "usage" / "Environment Variables" section of the docs for details. - change the builtin default for --chunker-params, create 2MiB chunks, #343 --chunker-params new default: 19,23,21,4095 - old default: 10,23,16,4095 one of the biggest issues with borg < 1.0 (and also attic) was that it had a default target chunk size of 64kiB, thus it created a lot of chunks and thus also a huge chunk management overhead (high RAM and disk usage). please note that the new default won't change the chunks that you already have in your repository. the new big chunks do not deduplicate with the old small chunks, so expect your repo to grow at least by the size of every changed file and in the worst case (e.g. if your files cache was lost / is not used) by the size of every file (minus any compression you might use). in case you want to immediately see a much lower resource usage (RAM / disk) for chunks management, it might be better to start with a new repo than continuing in the existing repo (with an existing repo, you'ld have to wait until all archives with small chunks got pruned to see a lower resource usage). if you used the old --chunker-params default value (or if you did not use --chunker-params option at all) and you'ld like to continue using small chunks (and you accept the huge resource usage that comes with that), just explicitly use borg create --chunker-params=10,23,16,4095. - archive timestamps: the 'time' timestamp now refers to archive creation start time (was: end time), the new 'time_end' timestamp refers to archive creation end time. This might affect prune if your backups take rather long. if you give a timestamp via cli this is stored into 'time', therefore it now needs to mean archive creation start time. New features: - implement password roundtrip, #695 Bug fixes: - remote end does not need cache nor keys directories, do not create them, #701 - added retry counter for passwords, #703 Other changes: - fix compiler warnings, #697 - docs: - update README.rst to new changelog location in docs/changes.rst - add Teemu to AUTHORS - changes.rst: fix old chunker params, #698 - FAQ: how to limit bandwidth Version 1.0.0rc2 (2016-02-28) ----------------------------- New features: - format options for location: user, pid, fqdn, hostname, now, utcnow, user - borg list --list-format - borg prune -v --list enables the keep/prune list output, #658 Bug fixes: - fix _open_rb noatime handling, #657 - add a simple archivename validator, #680 - borg create --stats: show timestamps in localtime, use same labels/formatting as borg info, #651 - llfuse compatibility fixes (now compatible with: 0.40, 0.41, 0.42) Other changes: - it is now possible to use "pip install borgbackup[fuse]" to automatically install the llfuse dependency using the correct version requirement for it. you still need to care about having installed the FUSE / build related OS package first, though, so that building llfuse can succeed. - Vagrant: drop Ubuntu Precise (12.04) - does not have Python >= 3.4 - Vagrant: use pyinstaller v3.1.1 to build binaries - docs: - borg upgrade: add to docs that only LOCAL repos are supported - borg upgrade also handles borg 0.xx -> 1.0 - use pip extras or requirements file to install llfuse - fix order in release process - updated usage docs and other minor / cosmetic fixes - verified borg examples in docs, #644 - freebsd dependency installation and FUSE configuration, #649 - add example how to restore a raw device, #671 - add a hint about the dev headers needed when installing from source - add examples for delete (and handle delete after list, before prune), #656 - update example for borg create -v --stats (use iso datetime format), #663 - added example to BORG_RSH docs - "connection closed by remote": add FAQ entry and point to issue #636 Version 1.0.0rc1 (2016-02-07) ----------------------------- New features: - borg migrate-to-repokey ("passphrase" -> "repokey" encryption key mode) - implement --short for borg list REPO, #611 - implement --list for borg extract (consistency with borg create) - borg serve: overwrite client's --restrict-to-path with ssh forced command's option value (but keep everything else from the client commandline), #544 - use $XDG_CONFIG_HOME/keys for keyfile keys (~/.config/borg/keys), #515 - "borg upgrade" moves the keyfile keys to the new location - display both archive creation start and end time in "borg info", #627 Bug fixes: - normalize trailing slashes for the repository path, #606 - Cache: fix exception handling in __init__, release lock, #610 Other changes: - suppress unneeded exception context (PEP 409), simpler tracebacks - removed special code needed to deal with imperfections / incompatibilities / missing stuff in py 3.2/3.3, simplify code that can be done simpler in 3.4 - removed some version requirements that were kept on old versions because newer did not support py 3.2 any more - use some py 3.4+ stdlib code instead of own/openssl/pypi code: - use os.urandom instead of own cython openssl RAND_bytes wrapper, #493 - use hashlib.pbkdf2_hmac from py stdlib instead of own openssl wrapper - use hmac.compare_digest instead of == operator (constant time comparison) - use stat.filemode instead of homegrown code - use "mock" library from stdlib, #145 - remove borg.support (with non-broken argparse copy), it is ok in 3.4+, #358 - Vagrant: copy CHANGES.rst as symlink, #592 - cosmetic code cleanups, add flake8 to tox/travis, #4 - docs / help: - make "borg -h" output prettier, #591 - slightly rephrase prune help - add missing example for --list option of borg create - quote exclude line that includes an asterisk to prevent shell expansion - fix dead link to license - delete Ubuntu Vivid, it is not supported anymore (EOL) - OS X binary does not work for older OS X releases, #629 - borg serve's special support for forced/original ssh commands, #544 - misc. updates and fixes Version 0.30.0 (2016-01-23) --------------------------- Compatibility notes: - you may need to use -v (or --info) more often to actually see output emitted at INFO log level (because it is suppressed at the default WARNING log level). See the "general" section in the usage docs. - for borg create, you need --list (additionally to -v) to see the long file list (was needed so you can have e.g. --stats alone without the long list) - see below about BORG_DELETE_I_KNOW_WHAT_I_AM_DOING (was: BORG_CHECK_I_KNOW_WHAT_I_AM_DOING) Bug fixes: - fix crash when using borg create --dry-run --keep-tag-files, #570 - make sure teardown with cleanup happens for Cache and RepositoryCache, avoiding leftover locks and TEMP dir contents, #285 (partially), #548 - fix locking KeyError, partial fix for #502 - log stats consistently, #526 - add abbreviated weekday to timestamp format, fixes #496 - strip whitespace when loading exclusions from file - unset LD_LIBRARY_PATH before invoking ssh, fixes strange OpenSSL library version warning when using the borg binary, #514 - add some error handling/fallback for C library loading, #494 - added BORG_DELETE_I_KNOW_WHAT_I_AM_DOING for check in "borg delete", #503 - remove unused "repair" rpc method name New features: - borg create: implement exclusions using regular expression patterns. - borg create: implement inclusions using patterns. - borg extract: support patterns, #361 - support different styles for patterns: - fnmatch (`fm:` prefix, default when omitted), like borg <= 0.29. - shell (`sh:` prefix) with `*` not matching directory separators and `**/` matching 0..n directories - path prefix (`pp:` prefix, for unifying borg create pp1 pp2 into the patterns system), semantics like in borg <= 0.29 - regular expression (`re:`), new! - --progress option for borg upgrade (#291) and borg delete - update progress indication more often (e.g. for borg create within big files or for borg check repo), #500 - finer chunker granularity for items metadata stream, #547, #487 - borg create --list now used (additionally to -v) to enable the verbose file list output - display borg version below tracebacks, #532 Other changes: - hashtable size (and thus: RAM and disk consumption) follows a growth policy: grows fast while small, grows slower when getting bigger, #527 - Vagrantfile: use pyinstaller 3.1 to build binaries, freebsd sqlite3 fix, fixes #569 - no separate binaries for centos6 any more because the generic linux binaries also work on centos6 (or in general: on systems with a slightly older glibc than debian7 - dev environment: require virtualenv<14.0 so we get a py32 compatible pip - docs: - add space-saving chunks.archive.d trick to FAQ - important: clarify -v and log levels in usage -> general, please read! - sphinx configuration: create a simple man page from usage docs - add a repo server setup example - disable unneeded SSH features in authorized_keys examples for security. - borg prune only knows "--keep-within" and not "--within" - add gource video to resources docs, #507 - add netbsd install instructions - authors: make it more clear what refers to borg and what to attic - document standalone binary requirements, #499 - rephrase the mailing list section - development docs: run build_api and build_usage before tagging release - internals docs: hash table max. load factor is 0.75 now - markup, typo, grammar, phrasing, clarifications and other fixes. - add gcc gcc-c++ to redhat/fedora/corora install docs, fixes #583 Version 0.29.0 (2015-12-13) --------------------------- Compatibility notes: - when upgrading to 0.29.0 you need to upgrade client as well as server installations due to the locking and commandline interface changes otherwise you'll get an error msg about a RPC protocol mismatch or a wrong commandline option. if you run a server that needs to support both old and new clients, it is suggested that you have a "borg-0.28.2" and a "borg-0.29.0" command. clients then can choose via e.g. "borg --remote-path=borg-0.29.0 ...". - the default waiting time for a lock changed from infinity to 1 second for a better interactive user experience. if the repo you want to access is currently locked, borg will now terminate after 1s with an error message. if you have scripts that shall wait for the lock for a longer time, use --lock-wait N (with N being the maximum wait time in seconds). Bug fixes: - hash table tuning (better chosen hashtable load factor 0.75 and prime initial size of 1031 gave ~1000x speedup in some scenarios) - avoid creation of an orphan lock for one case, #285 - --keep-tag-files: fix file mode and multiple tag files in one directory, #432 - fixes for "borg upgrade" (attic repo converter), #466 - remove --progress isatty magic (and also --no-progress option) again, #476 - borg init: display proper repo URL - fix format of umask in help pages, #463 New features: - implement --lock-wait, support timeout for UpgradableLock, #210 - implement borg break-lock command, #157 - include system info below traceback, #324 - sane remote logging, remote stderr, #461: - remote log output: intercept it and log it via local logging system, with "Remote: " prefixed to message. log remote tracebacks. - remote stderr: output it to local stderr with "Remote: " prefixed. - add --debug and --info (same as --verbose) to set the log level of the builtin logging configuration (which otherwise defaults to warning), #426 note: there are few messages emitted at DEBUG level currently. - optionally configure logging via env var BORG_LOGGING_CONF - add --filter option for status characters: e.g. to show only the added or modified files (and also errors), use "borg create -v --filter=AME ...". - more progress indicators, #394 - use ISO-8601 date and time format, #375 - "borg check --prefix" to restrict archive checking to that name prefix, #206 Other changes: - hashindex_add C implementation (speed up cache re-sync for new archives) - increase FUSE read_size to 1024 (speed up metadata operations) - check/delete/prune --save-space: free unused segments quickly, #239 - increase rpc protocol version to 2 (see also Compatibility notes), #458 - silence borg by default (via default log level WARNING) - get rid of C compiler warnings, #391 - upgrade OS X FUSE to 3.0.9 on the OS X binary build system - use python 3.5.1 to build binaries - docs: - new mailing list borgbackup@python.org, #468 - readthedocs: color and logo improvements - load coverage icons over SSL (avoids mixed content) - more precise binary installation steps - update release procedure docs about OS X FUSE - FAQ entry about unexpected 'A' status for unchanged file(s), #403 - add docs about 'E' file status - add "borg upgrade" docs, #464 - add developer docs about output and logging - clarify encryption, add note about client-side encryption - add resources section, with videos, talks, presentations, #149 - Borg moved to Arch Linux [community] - fix wrong installation instructions for archlinux Version 0.28.2 (2015-11-15) --------------------------- New features: - borg create --exclude-if-present TAGFILE - exclude directories that have the given file from the backup. You can additionally give --keep-tag-files to preserve just the directory roots and the tag-files (but not backup other directory contents), #395, attic #128, attic #142 Other changes: - do not create docs sources at build time (just have them in the repo), completely remove have_cython() hack, do not use the "mock" library at build time, #384 - avoid hidden import, make it easier for PyInstaller, easier fix for #218 - docs: - add description of item flags / status output, fixes #402 - explain how to regenerate usage and API files (build_api or build_usage) and when to commit usage files directly into git, #384 - minor install docs improvements Version 0.28.1 (2015-11-08) --------------------------- Bug fixes: - do not try to build api / usage docs for production install, fixes unexpected "mock" build dependency, #384 Other changes: - avoid using msgpack.packb at import time - fix formatting issue in changes.rst - fix build on readthedocs Version 0.28.0 (2015-11-08) --------------------------- Compatibility notes: - changed return codes (exit codes), see docs. in short: old: 0 = ok, 1 = error. now: 0 = ok, 1 = warning, 2 = error New features: - refactor return codes (exit codes), fixes #61 - add --show-rc option enable "terminating with X status, rc N" output, fixes 58, #351 - borg create backups atime and ctime additionally to mtime, fixes #317 - extract: support atime additionally to mtime - FUSE: support ctime and atime additionally to mtime - support borg --version - emit a warning if we have a slow msgpack installed - borg list --prefix=thishostname- REPO, fixes #205 - Debug commands (do not use except if you know what you do: debug-get-obj, debug-put-obj, debug-delete-obj, debug-dump-archive-items. Bug fixes: - setup.py: fix bug related to BORG_LZ4_PREFIX processing - fix "check" for repos that have incomplete chunks, fixes #364 - borg mount: fix unlocking of repository at umount time, fixes #331 - fix reading files without touching their atime, #334 - non-ascii ACL fixes for Linux, FreeBSD and OS X, #277 - fix acl_use_local_uid_gid() and add a test for it, attic #359 - borg upgrade: do not upgrade repositories in place by default, #299 - fix cascading failure with the index conversion code, #269 - borg check: implement 'cmdline' archive metadata value decoding, #311 - fix RobustUnpacker, it missed some metadata keys (new atime and ctime keys were missing, but also bsdflags). add check for unknown metadata keys. - create from stdin: also save atime, ctime (cosmetic) - use default_notty=False for confirmations, fixes #345 - vagrant: fix msgpack installation on centos, fixes #342 - deal with unicode errors for symlinks in same way as for regular files and have a helpful warning message about how to fix wrong locale setup, fixes #382 - add ACL keys the RobustUnpacker must know about Other changes: - improve file size displays, more flexible size formatters - explicitly commit to the units standard, #289 - archiver: add E status (means that an error occurred when processing this (single) item - do binary releases via "github releases", closes #214 - create: use -x and --one-file-system (was: --do-not-cross-mountpoints), #296 - a lot of changes related to using "logging" module and screen output, #233 - show progress display if on a tty, output more progress information, #303 - factor out status output so it is consistent, fix surrogates removal, maybe fixes #309 - move away from RawConfigParser to ConfigParser - archive checker: better error logging, give chunk_id and sequence numbers (can be used together with borg debug-dump-archive-items). - do not mention the deprecated passphrase mode - emit a deprecation warning for --compression N (giving a just a number) - misc .coverragerc fixes (and coverage measurement improvements), fixes #319 - refactor confirmation code, reduce code duplication, add tests - prettier error messages, fixes #307, #57 - tests: - add a test to find disk-full issues, #327 - travis: also run tests on Python 3.5 - travis: use tox -r so it rebuilds the tox environments - test the generated pyinstaller-based binary by archiver unit tests, #215 - vagrant: tests: announce whether fakeroot is used or not - vagrant: add vagrant user to fuse group for debianoid systems also - vagrant: llfuse install on darwin needs pkgconfig installed - vagrant: use pyinstaller from develop branch, fixes #336 - benchmarks: test create, extract, list, delete, info, check, help, fixes #146 - benchmarks: test with both the binary and the python code - archiver tests: test with both the binary and the python code, fixes #215 - make basic test more robust - docs: - moved docs to borgbackup.readthedocs.org, #155 - a lot of fixes and improvements, use mobile-friendly RTD standard theme - use zlib,6 compression in some examples, fixes #275 - add missing rename usage to docs, closes #279 - include the help offered by borg help in the usage docs, fixes #293 - include a list of major changes compared to attic into README, fixes #224 - add OS X install instructions, #197 - more details about the release process, #260 - fix linux glibc requirement (binaries built on debian7 now) - build: move usage and API generation to setup.py - update docs about return codes, #61 - remove api docs (too much breakage on rtd) - borgbackup install + basics presentation (asciinema) - describe the current style guide in documentation - add section about debug commands - warn about not running out of space - add example for rename - improve chunker params docs, fixes #362 - minor development docs update Version 0.27.0 (2015-10-07) --------------------------- New features: - "borg upgrade" command - attic -> borg one time converter / migration, #21 - temporary hack to avoid using lots of disk space for chunks.archive.d, #235: To use it: rm -rf chunks.archive.d ; touch chunks.archive.d - respect XDG_CACHE_HOME, attic #181 - add support for arbitrary SSH commands, attic #99 - borg delete --cache-only REPO (only delete cache, not REPO), attic #123 Bug fixes: - use Debian 7 (wheezy) to build pyinstaller borgbackup binaries, fixes slow down observed when running the Centos6-built binary on Ubuntu, #222 - do not crash on empty lock.roster, fixes #232 - fix multiple issues with the cache config version check, #234 - fix segment entry header size check, attic #352 plus other error handling improvements / code deduplication there. - always give segment and offset in repo IntegrityErrors Other changes: - stop producing binary wheels, remove docs about it, #147 - docs: - add warning about prune - generate usage include files only as needed - development docs: add Vagrant section - update / improve / reformat FAQ - hint to single-file pyinstaller binaries from README Version 0.26.1 (2015-09-28) --------------------------- This is a minor update, just docs and new pyinstaller binaries. - docs update about python and binary requirements - better docs for --read-special, fix #220 - re-built the binaries, fix #218 and #213 (glibc version issue) - update web site about single-file pyinstaller binaries Note: if you did a python-based installation, there is no need to upgrade. Version 0.26.0 (2015-09-19) --------------------------- New features: - Faster cache sync (do all in one pass, remove tar/compression stuff), #163 - BORG_REPO env var to specify the default repo, #168 - read special files as if they were regular files, #79 - implement borg create --dry-run, attic issue #267 - Normalize paths before pattern matching on OS X, #143 - support OpenBSD and NetBSD (except xattrs/ACLs) - support / run tests on Python 3.5 Bug fixes: - borg mount repo: use absolute path, attic #200, attic #137 - chunker: use off_t to get 64bit on 32bit platform, #178 - initialize chunker fd to -1, so it's not equal to STDIN_FILENO (0) - fix reaction to "no" answer at delete repo prompt, #182 - setup.py: detect lz4.h header file location - to support python < 3.2.4, add less buggy argparse lib from 3.2.6 (#194) - fix for obtaining ``char *`` from temporary Python value (old code causes a compile error on Mint 17.2) - llfuse 0.41 install troubles on some platforms, require < 0.41 (UnicodeDecodeError exception due to non-ascii llfuse setup.py) - cython code: add some int types to get rid of unspecific python add / subtract operations (avoid ``undefined symbol FPE_``... error on some platforms) - fix verbose mode display of stdin backup - extract: warn if a include pattern never matched, fixes #209, implement counters for Include/ExcludePatterns - archive names with slashes are invalid, attic issue #180 - chunker: add a check whether the POSIX_FADV_DONTNEED constant is defined - fixes building on OpenBSD. Other changes: - detect inconsistency / corruption / hash collision, #170 - replace versioneer with setuptools_scm, #106 - docs: - pkg-config is needed for llfuse installation - be more clear about pruning, attic issue #132 - unit tests: - xattr: ignore security.selinux attribute showing up - ext3 seems to need a bit more space for a sparse file - do not test lzma level 9 compression (avoid MemoryError) - work around strange mtime granularity issue on netbsd, fixes #204 - ignore st_rdev if file is not a block/char device, fixes #203 - stay away from the setgid and sticky mode bits - use Vagrant to do easy cross-platform testing (#196), currently: - Debian 7 "wheezy" 32bit, Debian 8 "jessie" 64bit - Ubuntu 12.04 32bit, Ubuntu 14.04 64bit - Centos 7 64bit - FreeBSD 10.2 64bit - OpenBSD 5.7 64bit - NetBSD 6.1.5 64bit - Darwin (OS X Yosemite) Version 0.25.0 (2015-08-29) --------------------------- Compatibility notes: - lz4 compression library (liblz4) is a new requirement (#156) - the new compression code is very compatible: as long as you stay with zlib compression, older borg releases will still be able to read data from a repo/archive made with the new code (note: this is not the case for the default "none" compression, use "zlib,0" if you want a "no compression" mode that can be read by older borg). Also the new code is able to read repos and archives made with older borg versions (for all zlib levels 0..9). Deprecations: - --compression N (with N being a number, as in 0.24) is deprecated. We keep the --compression 0..9 for now to not break scripts, but it is deprecated and will be removed later, so better fix your scripts now: --compression 0 (as in 0.24) is the same as --compression zlib,0 (now). BUT: if you do not want compression, you rather want --compression none (which is the default). --compression 1 (in 0.24) is the same as --compression zlib,1 (now) --compression 9 (in 0.24) is the same as --compression zlib,9 (now) New features: - create --compression none (default, means: do not compress, just pass through data "as is". this is more efficient than zlib level 0 as used in borg 0.24) - create --compression lz4 (super-fast, but not very high compression) - create --compression zlib,N (slower, higher compression, default for N is 6) - create --compression lzma,N (slowest, highest compression, default N is 6) - honor the nodump flag (UF_NODUMP) and do not backup such items - list --short just outputs a simple list of the files/directories in an archive Bug fixes: - fixed --chunker-params parameter order confusion / malfunction, fixes #154 - close fds of segments we delete (during compaction) - close files which fell out the lrucache - fadvise DONTNEED now is only called for the byte range actually read, not for the whole file, fixes #158. - fix issue with negative "all archives" size, fixes #165 - restore_xattrs: ignore if setxattr fails with EACCES, fixes #162 Other changes: - remove fakeroot requirement for tests, tests run faster without fakeroot (test setup does not fail any more without fakeroot, so you can run with or without fakeroot), fixes #151 and #91. - more tests for archiver - recover_segment(): don't assume we have an fd for segment - lrucache refactoring / cleanup, add dispose function, py.test tests - generalize hashindex code for any key length (less hardcoding) - lock roster: catch file not found in remove() method and ignore it - travis CI: use requirements file - improved docs: - replace hack for llfuse with proper solution (install libfuse-dev) - update docs about compression - update development docs about fakeroot - internals: add some words about lock files / locking system - support: mention BountySource and for what it can be used - theme: use a lighter green - add pypi, wheel, dist package based install docs - split install docs into system-specific preparations and generic instructions Version 0.24.0 (2015-08-09) --------------------------- Incompatible changes (compared to 0.23): - borg now always issues --umask NNN option when invoking another borg via ssh on the repository server. By that, it's making sure it uses the same umask for remote repos as for local ones. Because of this, you must upgrade both server and client(s) to 0.24. - the default umask is 077 now (if you do not specify via --umask) which might be a different one as you used previously. The default umask avoids that you accidentally give access permissions for group and/or others to files created by borg (e.g. the repository). Deprecations: - "--encryption passphrase" mode is deprecated, see #85 and #97. See the new "--encryption repokey" mode for a replacement. New features: - borg create --chunker-params ... to configure the chunker, fixes #16 (attic #302, attic #300, and somehow also #41). This can be used to reduce memory usage caused by chunk management overhead, so borg does not create a huge chunks index/repo index and eats all your RAM if you back up lots of data in huge files (like VM disk images). See docs/misc/create_chunker-params.txt for more information. - borg info now reports chunk counts in the chunk index. - borg create --compression 0..9 to select zlib compression level, fixes #66 (attic #295). - borg init --encryption repokey (to store the encryption key into the repo), fixes #85 - improve at-end error logging, always log exceptions and set exit_code=1 - LoggedIO: better error checks / exceptions / exception handling - implement --remote-path to allow non-default-path borg locations, #125 - implement --umask M and use 077 as default umask for better security, #117 - borg check: give a named single archive to it, fixes #139 - cache sync: show progress indication - cache sync: reimplement the chunk index merging in C Bug fixes: - fix segfault that happened for unreadable files (chunker: n needs to be a signed size_t), #116 - fix the repair mode, #144 - repo delete: add destroy to allowed rpc methods, fixes issue #114 - more compatible repository locking code (based on mkdir), maybe fixes #92 (attic #317, attic #201). - better Exception msg if no Borg is installed on the remote repo server, #56 - create a RepositoryCache implementation that can cope with >2GiB, fixes attic #326. - fix Traceback when running check --repair, attic #232 - clarify help text, fixes #73. - add help string for --no-files-cache, fixes #140 Other changes: - improved docs: - added docs/misc directory for misc. writeups that won't be included "as is" into the html docs. - document environment variables and return codes (attic #324, attic #52) - web site: add related projects, fix web site url, IRC #borgbackup - Fedora/Fedora-based install instructions added to docs - Cygwin-based install instructions added to docs - updated AUTHORS - add FAQ entries about redundancy / integrity - clarify that borg extract uses the cwd as extraction target - update internals doc about chunker params, memory usage and compression - added docs about development - add some words about resource usage in general - document how to backup a raw disk - add note about how to run borg from virtual env - add solutions for (ll)fuse installation problems - document what borg check does, fixes #138 - reorganize borgbackup.github.io sidebar, prev/next at top - deduplicate and refactor the docs / README.rst - use borg-tmp as prefix for temporary files / directories - short prune options without "keep-" are deprecated, do not suggest them - improved tox configuration - remove usage of unittest.mock, always use mock from pypi - use entrypoints instead of scripts, for better use of the wheel format and modern installs - add requirements.d/development.txt and modify tox.ini - use travis-ci for testing based on Linux and (new) OS X - use coverage.py, pytest-cov and codecov.io for test coverage support I forgot to list some stuff already implemented in 0.23.0, here they are: New features: - efficient archive list from manifest, meaning a big speedup for slow repo connections and "list ", "delete ", "prune" (attic #242, attic #167) - big speedup for chunks cache sync (esp. for slow repo connections), fixes #18 - hashindex: improve error messages Other changes: - explicitly specify binary mode to open binary files - some easy micro optimizations Version 0.23.0 (2015-06-11) --------------------------- Incompatible changes (compared to attic, fork related): - changed sw name and cli command to "borg", updated docs - package name (and name in urls) uses "borgbackup" to have fewer collisions - changed repo / cache internal magic strings from ATTIC* to BORG*, changed cache location to .cache/borg/ - this means that it currently won't accept attic repos (see issue #21 about improving that) Bug fixes: - avoid defect python-msgpack releases, fixes attic #171, fixes attic #185 - fix traceback when trying to do unsupported passphrase change, fixes attic #189 - datetime does not like the year 10.000, fixes attic #139 - fix "info" all archives stats, fixes attic #183 - fix parsing with missing microseconds, fixes attic #282 - fix misleading hint the fuse ImportError handler gave, fixes attic #237 - check unpacked data from RPC for tuple type and correct length, fixes attic #127 - fix Repository._active_txn state when lock upgrade fails - give specific path to xattr.is_enabled(), disable symlink setattr call that always fails - fix test setup for 32bit platforms, partial fix for attic #196 - upgraded versioneer, PEP440 compliance, fixes attic #257 New features: - less memory usage: add global option --no-cache-files - check --last N (only check the last N archives) - check: sort archives in reverse time order - rename repo::oldname newname (rename repository) - create -v output more informative - create --progress (backup progress indicator) - create --timestamp (utc string or reference file/dir) - create: if "-" is given as path, read binary from stdin - extract: if --stdout is given, write all extracted binary data to stdout - extract --sparse (simple sparse file support) - extra debug information for 'fread failed' - delete (deletes whole repo + local cache) - FUSE: reflect deduplication in allocated blocks - only allow whitelisted RPC calls in server mode - normalize source/exclude paths before matching - use posix_fadvise to not spoil the OS cache, fixes attic #252 - toplevel error handler: show tracebacks for better error analysis - sigusr1 / sigint handler to print current file infos - attic PR #286 - RPCError: include the exception args we get from remote Other changes: - source: misc. cleanups, pep8, style - docs and faq improvements, fixes, updates - cleanup crypto.pyx, make it easier to adapt to other AES modes - do os.fsync like recommended in the python docs - source: Let chunker optionally work with os-level file descriptor. - source: Linux: remove duplicate os.fsencode calls - source: refactor _open_rb code a bit, so it is more consistent / regular - source: refactor indicator (status) and item processing - source: use py.test for better testing, flake8 for code style checks - source: fix tox >=2.0 compatibility (test runner) - pypi package: add python version classifiers, add FreeBSD to platforms Attic Changelog --------------- Here you can see the full list of changes between each Attic release until Borg forked from Attic: Version 0.17 ~~~~~~~~~~~~ (bugfix release, released on X) - Fix hashindex ARM memory alignment issue (#309) - Improve hashindex error messages (#298) Version 0.16 ~~~~~~~~~~~~ (bugfix release, released on May 16, 2015) - Fix typo preventing the security confirmation prompt from working (#303) - Improve handling of systems with improperly configured file system encoding (#289) - Fix "All archives" output for attic info. (#183) - More user friendly error message when repository key file is not found (#236) - Fix parsing of iso 8601 timestamps with zero microseconds (#282) Version 0.15 ~~~~~~~~~~~~ (bugfix release, released on Apr 15, 2015) - xattr: Be less strict about unknown/unsupported platforms (#239) - Reduce repository listing memory usage (#163). - Fix BrokenPipeError for remote repositories (#233) - Fix incorrect behavior with two character directory names (#265, #268) - Require approval before accessing relocated/moved repository (#271) - Require approval before accessing previously unknown unencrypted repositories (#271) - Fix issue with hash index files larger than 2GB. - Fix Python 3.2 compatibility issue with noatime open() (#164) - Include missing pyx files in dist files (#168) Version 0.14 ~~~~~~~~~~~~ (feature release, released on Dec 17, 2014) - Added support for stripping leading path segments (#95) "attic extract --strip-segments X" - Add workaround for old Linux systems without acl_extended_file_no_follow (#96) - Add MacPorts' path to the default openssl search path (#101) - HashIndex improvements, eliminates unnecessary IO on low memory systems. - Fix "Number of files" output for attic info. (#124) - limit create file permissions so files aren't read while restoring - Fix issue with empty xattr values (#106) Version 0.13 ~~~~~~~~~~~~ (feature release, released on Jun 29, 2014) - Fix sporadic "Resource temporarily unavailable" when using remote repositories - Reduce file cache memory usage (#90) - Faster AES encryption (utilizing AES-NI when available) - Experimental Linux, OS X and FreeBSD ACL support (#66) - Added support for backup and restore of BSDFlags (OSX, FreeBSD) (#56) - Fix bug where xattrs on symlinks were not correctly restored - Added cachedir support. CACHEDIR.TAG compatible cache directories can now be excluded using ``--exclude-caches`` (#74) - Fix crash on extreme mtime timestamps (year 2400+) (#81) - Fix Python 3.2 specific lockf issue (EDEADLK) Version 0.12 ~~~~~~~~~~~~ (feature release, released on April 7, 2014) - Python 3.4 support (#62) - Various documentation improvements a new style - ``attic mount`` now supports mounting an entire repository not only individual archives (#59) - Added option to restrict remote repository access to specific path(s): ``attic serve --restrict-to-path X`` (#51) - Include "all archives" size information in "--stats" output. (#54) - Added ``--stats`` option to ``attic delete`` and ``attic prune`` - Fixed bug where ``attic prune`` used UTC instead of the local time zone when determining which archives to keep. - Switch to SI units (Power of 1000 instead 1024) when printing file sizes Version 0.11 ~~~~~~~~~~~~ (feature release, released on March 7, 2014) - New "check" command for repository consistency checking (#24) - Documentation improvements - Fix exception during "attic create" with repeated files (#39) - New "--exclude-from" option for attic create/extract/verify. - Improved archive metadata deduplication. - "attic verify" has been deprecated. Use "attic extract --dry-run" instead. - "attic prune --hourly|daily|..." has been deprecated. Use "attic prune --keep-hourly|daily|..." instead. - Ignore xattr errors during "extract" if not supported by the filesystem. (#46) Version 0.10 ~~~~~~~~~~~~ (bugfix release, released on Jan 30, 2014) - Fix deadlock when extracting 0 sized files from remote repositories - "--exclude" wildcard patterns are now properly applied to the full path not just the file name part (#5). - Make source code endianness agnostic (#1) Version 0.9 ~~~~~~~~~~~ (feature release, released on Jan 23, 2014) - Remote repository speed and reliability improvements. - Fix sorting of segment names to ignore NFS left over files. (#17) - Fix incorrect display of time (#13) - Improved error handling / reporting. (#12) - Use fcntl() instead of flock() when locking repository/cache. (#15) - Let ssh figure out port/user if not specified so we don't override .ssh/config (#9) - Improved libcrypto path detection (#23). Version 0.8.1 ~~~~~~~~~~~~~ (bugfix release, released on Oct 4, 2013) - Fix segmentation fault issue. Version 0.8 ~~~~~~~~~~~ (feature release, released on Oct 3, 2013) - Fix xattr issue when backing up sshfs filesystems (#4) - Fix issue with excessive index file size (#6) - Support access of read only repositories. - New syntax to enable repository encryption: attic init --encryption="none|passphrase|keyfile". - Detect and abort if repository is older than the cache. Version 0.7 ~~~~~~~~~~~ (feature release, released on Aug 5, 2013) - Ported to FreeBSD - Improved documentation - Experimental: Archives mountable as FUSE filesystems. - The "user." prefix is no longer stripped from xattrs on Linux Version 0.6.1 ~~~~~~~~~~~~~ (bugfix release, released on July 19, 2013) - Fixed an issue where mtime was not always correctly restored. Version 0.6 ~~~~~~~~~~~ First public release on July 9, 2013 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/conf.py0000644000076500000240000002033014641074756014453 0ustar00twstaff# documentation build configuration file, created by # sphinx-quickstart on Sat Sep 10 18:18:25 2011. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. import sys import os sys.path.insert(0, os.path.abspath("../src")) from borg import __version__ as sw_version # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. project = 'Borg - Deduplicating Archiver' copyright = '2010-2014 Jonas Borgström, 2015-2024 The Borg Collective (see AUTHORS file)' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. split_char = '+' if '+' in sw_version else '-' version = sw_version.split(split_char)[0] # The full version, including alpha/beta/rc tags. release = version suppress_warnings = ['image.nonlocal_uri'] # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. today_fmt = '%Y-%m-%d' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = ['_build'] # The reST default role (used for this markup: `text`) to use for all documents. #default_role = None # The Borg docs contain no or very little Python docs. # Thus, the primary domain is rst. primary_domain = 'rst' # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). #add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] # -- Options for HTML output --------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. import guzzle_sphinx_theme html_theme_path = guzzle_sphinx_theme.html_theme_path() html_theme = 'guzzle_sphinx_theme' def set_rst_settings(app): app.env.settings.update({ 'field_name_limit': 0, 'option_limit': 0, }) def setup(app): app.add_css_file('css/borg.css') app.connect('builder-inited', set_rst_settings) # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. html_theme_options = { 'project_nav_name': 'Borg %s' % version, } # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = ['_themes'] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. html_logo = '_static/logo.svg' # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. html_favicon = '_static/favicon.ico' # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['borg_theme'] html_extra_path = ['../src/borg/paperkey.html'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. html_last_updated_fmt = '%Y-%m-%d' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. html_use_smartypants = True smartquotes_action = 'qe' # no D in there means "do not transform -- and ---" # Custom sidebar templates, maps document names to template names. html_sidebars = { '**': ['logo-text.html', 'searchbox.html', 'globaltoc.html'], } # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If false, no index is generated. html_use_index = False # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, links to the reST sources are added to the pages. html_show_sourcelink = False # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. html_show_sphinx = False # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. html_show_copyright = False # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = None # Output file base name for HTML help builder. htmlhelp_basename = 'borgdoc' # -- Options for LaTeX output -------------------------------------------------- # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ ('book', 'Borg.tex', 'Borg Documentation', 'The Borg Collective', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. latex_logo = '_static/logo.pdf' latex_elements = { 'papersize': 'a4paper', 'pointsize': '10pt', 'figure_align': 'H', } # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False # If true, show page references after internal links. #latex_show_pagerefs = False # If true, show URL addresses after external links. latex_show_urls = 'footnote' # Additional stuff for the LaTeX preamble. #latex_preamble = '' # Documents to append as an appendix to all manuals. latex_appendices = [ 'support', 'resources', 'changes', 'authors', ] # If false, no module index is generated. #latex_domain_indices = True # -- Options for manual page output -------------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ ('usage', 'borg', 'BorgBackup is a deduplicating backup program with optional compression and authenticated encryption.', ['The Borg Collective (see AUTHORS file)'], 1), ] extensions = [ 'sphinx.ext.extlinks', 'sphinx.ext.autodoc', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.viewcode', ] extlinks = { 'issue': ('https://github.com/borgbackup/borg/issues/%s', '#%s'), 'targz_url': ('https://pypi.python.org/packages/source/b/borgbackup/%%s-%s.tar.gz' % version, None), } ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719958149.7529993 borgbackup-1.4.0/docs/deployment/0000755000076500000240000000000014641075206015325 5ustar00twstaff././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/deployment/automated-local.rst0000644000076500000240000001715314641074756021152 0ustar00twstaff.. include:: ../global.rst.inc .. highlight:: none Automated backups to a local hard drive ======================================= This guide shows how to automate backups to a hard drive directly connected to your computer. If a backup hard drive is connected, backups are automatically started, and the drive shut-down and disconnected when they are done. This guide is written for a Linux-based operating system and makes use of systemd and udev. Overview -------- An udev rule is created to trigger on the addition of block devices. The rule contains a tag that triggers systemd to start a oneshot service. The oneshot service executes a script in the standard systemd service environment, which automatically captures stdout/stderr and logs it to the journal. The script mounts the added block device, if it is a registered backup drive, and creates backups on it. When done, it optionally unmounts the file system and spins the drive down, so that it may be physically disconnected. Configuring the system ---------------------- First, create the ``/etc/backups`` directory (as root). All configuration goes into this directory. Find out the ID of the partition table of your backup disk (here assumed to be /dev/sdz): lsblk --fs -o +PTUUID /dev/sdz Then, create ``/etc/backups/40-backup.rules`` with the following content (all on one line):: ACTION=="add", SUBSYSTEM=="block", ENV{ID_PART_TABLE_UUID}=="", TAG+="systemd", ENV{SYSTEMD_WANTS}="automatic-backup.service" The "systemd" tag in conjunction with the SYSTEMD_WANTS environment variable has systemd launch the "automatic-backup" service, which we will create next, as the ``/etc/backups/automatic-backup.service`` file: .. code-block:: ini [Service] Type=oneshot ExecStart=/etc/backups/run.sh Now, create the main backup script, ``/etc/backups/run.sh``. Below is a template, modify it to suit your needs (e.g. more backup sets, dumping databases etc.). .. code-block:: bash #!/bin/bash -ue # The udev rule is not terribly accurate and may trigger our service before # the kernel has finished probing partitions. Sleep for a bit to ensure # the kernel is done. # # This can be avoided by using a more precise udev rule, e.g. matching # a specific hardware path and partition. sleep 5 # # Script configuration # # The backup partition is mounted there MOUNTPOINT=/mnt/backup # This is the location of the Borg repository TARGET=$MOUNTPOINT/borg-backups/backup.borg # Archive name schema DATE=$(date --iso-8601)-$(hostname) # This is the file that will later contain UUIDs of registered backup drives DISKS=/etc/backups/backup.disks # Find whether the connected block device is a backup drive for uuid in $(lsblk --noheadings --list --output uuid) do if grep --quiet --fixed-strings $uuid $DISKS; then break fi uuid= done if [ ! $uuid ]; then echo "No backup disk found, exiting" exit 0 fi echo "Disk $uuid is a backup disk" partition_path=/dev/disk/by-uuid/$uuid # Mount file system if not already done. This assumes that if something is already # mounted at $MOUNTPOINT, it is the backup drive. It won't find the drive if # it was mounted somewhere else. findmnt $MOUNTPOINT >/dev/null || mount $partition_path $MOUNTPOINT drive=$(lsblk --inverse --noheadings --list --paths --output name $partition_path | head --lines 1) echo "Drive path: $drive" # # Create backups # # Options for borg create BORG_OPTS="--stats --one-file-system --compression lz4 --checkpoint-interval 86400" # Set BORG_PASSPHRASE or BORG_PASSCOMMAND somewhere around here, using export, # if encryption is used. # No one can answer if Borg asks these questions, it is better to just fail quickly # instead of hanging. export BORG_RELOCATED_REPO_ACCESS_IS_OK=no export BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=no # Log Borg version borg --version echo "Starting backup for $DATE" # This is just an example, change it however you see fit borg create $BORG_OPTS \ --exclude root/.cache \ --exclude var/lib/docker/devicemapper \ $TARGET::$DATE-$$-system \ / /boot # /home is often a separate partition / file system. # Even if it isn't (add --exclude /home above), it probably makes sense # to have /home in a separate archive. borg create $BORG_OPTS \ --exclude 'sh:home/*/.cache' \ $TARGET::$DATE-$$-home \ /home/ echo "Completed backup for $DATE" # Just to be completely paranoid sync if [ -f /etc/backups/autoeject ]; then umount $MOUNTPOINT hdparm -Y $drive fi if [ -f /etc/backups/backup-suspend ]; then systemctl suspend fi Create the ``/etc/backups/autoeject`` file to have the script automatically eject the drive after creating the backup. Rename the file to something else (e.g. ``/etc/backup/autoeject-no``) when you want to do something with the drive after creating backups (e.g running check). Create the ``/etc/backups/backup-suspend`` file if the machine should suspend after completing the backup. Don't forget to physically disconnect the device before resuming, otherwise you'll enter a cycle. You can also add an option to power down instead. Create an empty ``/etc/backups/backup.disks`` file, you'll register your backup drives there. The last part is to actually enable the udev rules and services: .. code-block:: bash ln -s /etc/backups/40-backup.rules /etc/udev/rules.d/40-backup.rules ln -s /etc/backups/automatic-backup.service /etc/systemd/system/automatic-backup.service systemctl daemon-reload udevadm control --reload Adding backup hard drives ------------------------- Connect your backup hard drive. Format it, if not done already. Find the UUID of the file system that backups should be stored on:: lsblk -o+uuid,label Note the UUID into the ``/etc/backup/backup.disks`` file. Mount the drive to /mnt/backup. Initialize a Borg repository at the location indicated by ``TARGET``:: borg init --encryption ... /mnt/backup/borg-backups/backup.borg Unmount and reconnect the drive, or manually start the ``automatic-backup`` service to start the first backup:: systemctl start --no-block automatic-backup See backup logs using journalctl:: journalctl -fu automatic-backup [-n number-of-lines] Security considerations ----------------------- The script as shown above will mount any file system with an UUID listed in ``/etc/backup/backup.disks``. The UUID check is a safety / annoyance-reduction mechanism to keep the script from blowing up whenever a random USB thumb drive is connected. It is not meant as a security mechanism. Mounting file systems and reading repository data exposes additional attack surfaces (kernel file system drivers, possibly user space services and Borg itself). On the other hand, someone standing right next to your computer can attempt a lot of attacks, most of which are easier to do than e.g. exploiting file systems (installing a physical key logger, DMA attacks, stealing the machine, ...). Borg ensures that backups are not created on random drives that "just happen" to contain a Borg repository. If an unknown unencrypted repository is encountered, then the script aborts (BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=no). Backups are only created on hard drives that contain a Borg repository that is either known (by ID) to your machine or you are using encryption and the passphrase of the repository has to match the passphrase supplied to Borg. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/deployment/central-backup-server.rst0000644000076500000240000001704314641074756022274 0ustar00twstaff.. include:: ../global.rst.inc .. highlight:: none Central repository server with Ansible or Salt ============================================== This section will give an example how to setup a borg repository server for multiple clients. Machines -------- There are multiple machines used in this section and will further be named by their respective fully qualified domain name (fqdn). * The backup server: `backup01.srv.local` * The clients: - John Doe's desktop: `johndoe.clnt.local` - Webserver 01: `web01.srv.local` - Application server 01: `app01.srv.local` User and group -------------- The repository server needs to have only one UNIX user for all the clients. Recommended user and group with additional settings: * User: `backup` * Group: `backup` * Shell: `/bin/bash` (or other capable to run the `borg serve` command) * Home: `/home/backup` Most clients shall initiate a backup from the root user to catch all users, groups and permissions (e.g. when backing up `/home`). Folders ------- The following folder tree layout is suggested on the repository server: * User home directory, /home/backup * Repositories path (storage pool): /home/backup/repos * Clients restricted paths (`/home/backup/repos/`): - johndoe.clnt.local: `/home/backup/repos/johndoe.clnt.local` - web01.srv.local: `/home/backup/repos/web01.srv.local` - app01.srv.local: `/home/backup/repos/app01.srv.local` Restrictions ------------ Borg is instructed to restrict clients into their own paths: ``borg serve --restrict-to-path /home/backup/repos/`` The client will be able to access any file or subdirectory inside of ``/home/backup/repos/`` but no other directories. You can allow a client to access several separate directories by passing multiple ``--restrict-to-path`` flags, for instance: ``borg serve --restrict-to-path /home/backup/repos/ --restrict-to-path /home/backup/repos/``, which could make sense if multiple machines belong to one person which should then have access to all the backups of their machines. There is only one ssh key per client allowed. Keys are added for ``johndoe.clnt.local``, ``web01.srv.local`` and ``app01.srv.local``. But they will access the backup under only one UNIX user account as: ``backup@backup01.srv.local``. Every key in ``$HOME/.ssh/authorized_keys`` has a forced command and restrictions applied as shown below: :: command="cd /home/backup/repos/; borg serve --restrict-to-path /home/backup/repos/", restrict .. note:: The text shown above needs to be written on a single line! The options which are added to the key will perform the following: 1. Change working directory 2. Run ``borg serve`` restricted to the client base path 3. Restrict ssh and do not allow stuff which imposes a security risk Due to the ``cd`` command we use, the server automatically changes the current working directory. Then client doesn't need to have knowledge of the absolute or relative remote repository path and can directly access the repositories at ``@:``. .. note:: The setup above ignores all client given commandline parameters which are normally appended to the `borg serve` command. Client ------ The client needs to initialize the `pictures` repository like this: :: borg init backup@backup01.srv.local:pictures Or with the full path (should actually never be used, as only for demonstrational purposes). The server should automatically change the current working directory to the `` folder. :: borg init backup@backup01.srv.local:/home/backup/repos/johndoe.clnt.local/pictures When `johndoe.clnt.local` tries to access a not restricted path the following error is raised. John Doe tries to backup into the Web 01 path: :: borg init backup@backup01.srv.local:/home/backup/repos/web01.srv.local/pictures :: ~~~ SNIP ~~~ Remote: borg.remote.PathNotAllowed: /home/backup/repos/web01.srv.local/pictures ~~~ SNIP ~~~ Repository path not allowed Ansible ------- Ansible takes care of all the system-specific commands to add the user, create the folder, install and configure software. :: - hosts: backup01.srv.local vars: user: backup group: backup home: /home/backup pool: "{{ home }}/repos" auth_users: - host: johndoe.clnt.local key: "{{ lookup('file', '/path/to/keys/johndoe.clnt.local.pub') }}" - host: web01.clnt.local key: "{{ lookup('file', '/path/to/keys/web01.clnt.local.pub') }}" - host: app01.clnt.local key: "{{ lookup('file', '/path/to/keys/app01.clnt.local.pub') }}" tasks: - package: name=borg state=present - group: name="{{ group }}" state=present - user: name="{{ user }}" shell=/bin/bash home="{{ home }}" createhome=yes group="{{ group }}" groups= state=present - file: path="{{ home }}" owner="{{ user }}" group="{{ group }}" mode=0700 state=directory - file: path="{{ home }}/.ssh" owner="{{ user }}" group="{{ group }}" mode=0700 state=directory - file: path="{{ pool }}" owner="{{ user }}" group="{{ group }}" mode=0700 state=directory - authorized_key: user="{{ user }}" key="{{ item.key }}" key_options='command="cd {{ pool }}/{{ item.host }};borg serve --restrict-to-path {{ pool }}/{{ item.host }}",restrict' with_items: "{{ auth_users }}" - file: path="{{ home }}/.ssh/authorized_keys" owner="{{ user }}" group="{{ group }}" mode=0600 state=file - file: path="{{ pool }}/{{ item.host }}" owner="{{ user }}" group="{{ group }}" mode=0700 state=directory with_items: "{{ auth_users }}" Salt ---- This is a configuration similar to the one above, configured to be deployed with Salt running on a Debian system. :: Install borg backup from pip: pkg.installed: - pkgs: - python3 - python3-dev - python3-pip - python-virtualenv - libssl-dev - openssl - libacl1-dev - libacl1 - build-essential - libfuse-dev - fuse - pkg-config pip.installed: - pkgs: ["borgbackup"] - bin_env: /usr/bin/pip3 Setup backup user: user.present: - name: backup - fullname: Backup User - home: /home/backup - shell: /bin/bash # CAUTION! # If you change the ssh command= option below, it won't necessarily get pushed to the backup # server correctly unless you delete the ~/.ssh/authorized_keys file and re-create it! {% for host in backupclients %} Give backup access to {{host}}: ssh_auth.present: - user: backup - source: salt://conf/ssh-pubkeys/{{host}}-backup.id_ecdsa.pub - options: - command="cd /home/backup/repos/{{host}}; borg serve --restrict-to-path /home/backup/repos/{{host}}" - restrict {% endfor %} Enhancements ------------ As this section only describes a simple and effective setup it could be further enhanced when supporting (a limited set) of client supplied commands. A wrapper for starting `borg serve` could be written. Or borg itself could be enhanced to autodetect it runs under SSH by checking the `SSH_ORIGINAL_COMMAND` environment variable. This is left open for future improvements. When extending ssh autodetection in borg no external wrapper script is necessary and no other interpreter or application has to be deployed. See also -------- * `SSH Daemon manpage `_ * `Ansible `_ * `Salt `_ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/deployment/hosting-repositories.rst0000644000076500000240000000655514641074756022303 0ustar00twstaff.. include:: ../global.rst.inc .. highlight:: none .. _hosting_repositories: Hosting repositories ==================== This sections shows how to securely provide repository storage for users. Optionally, each user can have a storage quota. Repositories are accessed through SSH. Each user of the service should have her own login which is only able to access the user's files. Technically it would be possible to have multiple users share one login, however, separating them is better. Separate logins increase isolation and are thus an additional layer of security and safety for both the provider and the users. For example, if a user manages to breach ``borg serve`` then she can only damage her own data (assuming that the system does not have further vulnerabilities). Use the standard directory structure of the operating system. Each user is assigned a home directory and repositories of the user reside in her home directory. The following ``~user/.ssh/authorized_keys`` file is the most important piece for a correct deployment. It allows the user to login via their public key (which must be provided by the user), and restricts SSH access to safe operations only. :: command="borg serve --restrict-to-repository /home//repository",restrict .. note:: The text shown above needs to be written on a **single** line! .. warning:: If this file should be automatically updated (e.g. by a web console), pay **utmost attention** to sanitizing user input. Strip all whitespace around the user-supplied key, ensure that it **only** contains ASCII with no control characters and that it consists of three parts separated by a single space. Ensure that no newlines are contained within the key. The ``restrict`` keyword enables all restrictions, i.e. disables port, agent and X11 forwarding, as well as disabling PTY allocation and execution of ~/.ssh/rc. If any future restriction capabilities are added to authorized_keys files they will be included in this set. The ``command`` keyword forces execution of the specified command line upon login. This must be ``borg serve``. The ``--restrict-to-repository`` option permits access to exactly **one** repository. It can be given multiple times to permit access to more than one repository. The repository may not exist yet; it can be initialized by the user, which allows for encryption. **Storage quotas** can be enabled by adding the ``--storage-quota`` option to the ``borg serve`` command line:: restrict,command="borg serve --storage-quota 20G ..." ... The storage quotas of repositories are completely independent. If a client is able to access multiple repositories, each repository can be filled to the specified quota. If storage quotas are used, ensure that all deployed Borg releases support storage quotas. Refer to :ref:`internals_storage_quota` for more details on storage quotas. **Specificities: Append-only repositories** Running ``borg init`` via a ``borg serve --append-only`` server will **not** create a repository that is configured to be append-only by its repository config. But, ``--append-only`` arguments in ``authorized_keys`` will override the repository config, therefore append-only mode can be enabled on a key by key basis. Refer to the `sshd(8) `_ man page for more details on SSH options. See also :ref:`borg_serve` ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/deployment/image-backup.rst0000644000076500000240000001575214641074756020427 0ustar00twstaff.. include:: ../global.rst.inc .. highlight:: none Backing up entire disk images ============================= Backing up disk images can still be efficient with Borg because its `deduplication`_ technique makes sure only the modified parts of the file are stored. Borg also has optional simple sparse file support for extract. It is of utmost importancy to pin down the disk you want to backup. You need to use the SERIAL for that. Use: .. code-block:: bash # You can find the short disk serial by: # udevadm info --query=property --name=nvme1n1 | grep ID_SERIAL_SHORT | cut -d '=' -f 2 DISK_SERIAL="7VS0224F" DISK_ID=$(readlink -f /dev/disk/by-id/*"${DISK_SERIAL}") # Returns /dev/nvme1n1 mapfile -t PARTITIONS < <(lsblk -o NAME,TYPE -p -n -l "$DISK_ID" | awk '$2 == "part" {print $1}') echo "Partitions of $DISK_ID:" echo "${PARTITIONS[@]}" echo "Disk Identifier: $DISK_ID" # Use the following line to perform a borg backup for the full disk: # borg create --read-special /path/to/repo::{now} "$DISK_ID" # Use the following to perform a borg backup for all partitions of the disk # borg create --read-special /path/to/repo::{now} "${PARTITIONS[@]}" # Example output: # Partitions of /dev/nvme1n1: # /dev/nvme1n1p1 # /dev/nvme1n1p2 # /dev/nvme1n1p3 # Disk Identifier: /dev/nvme1n1 # borg create --read-special /path/to/repo::{now} /dev/nvme1n1 # borg create --read-special /path/to/repo::{now} /dev/nvme1n1p1 /dev/nvme1n1p2 /dev/nvme1n1p3 Decreasing the size of image backups ------------------------------------ Disk images are as large as the full disk when uncompressed and might not get much smaller post-deduplication after heavy use because virtually all file systems don't actually delete file data on disk but instead delete the filesystem entries referencing the data. Therefore, if a disk nears capacity and files are deleted again, the change will barely decrease the space it takes up when compressed and deduplicated. Depending on the filesystem, there are several ways to decrease the size of a disk image: Using ntfsclone (NTFS, i.e. Windows VMs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ``ntfsclone`` can only operate on filesystems with the journal cleared (i.e. turned-off machines), which somewhat limits its utility in the case of VM snapshots. However, when it can be used, its special image format is even more efficient than just zeroing and deduplicating. For backup, save the disk header and the contents of each partition:: HEADER_SIZE=$(sfdisk -lo Start $DISK | grep -A1 -P 'Start$' | tail -n1 | xargs echo) PARTITIONS=$(sfdisk -lo Device,Type $DISK | sed -e '1,/Device\s*Type/d') dd if=$DISK count=$HEADER_SIZE | borg create repo::hostname-partinfo - echo "$PARTITIONS" | grep NTFS | cut -d' ' -f1 | while read x; do PARTNUM=$(echo $x | grep -Eo "[0-9]+$") ntfsclone -so - $x | borg create repo::hostname-part$PARTNUM - done # to backup non-NTFS partitions as well: echo "$PARTITIONS" | grep -v NTFS | cut -d' ' -f1 | while read x; do PARTNUM=$(echo $x | grep -Eo "[0-9]+$") borg create --read-special repo::hostname-part$PARTNUM $x done Restoration is a similar process:: borg extract --stdout repo::hostname-partinfo | dd of=$DISK && partprobe PARTITIONS=$(sfdisk -lo Device,Type $DISK | sed -e '1,/Device\s*Type/d') borg list --format {archive}{NL} repo | grep 'part[0-9]*$' | while read x; do PARTNUM=$(echo $x | grep -Eo "[0-9]+$") PARTITION=$(echo "$PARTITIONS" | grep -E "$DISKp?$PARTNUM" | head -n1) if echo "$PARTITION" | cut -d' ' -f2- | grep -q NTFS; then borg extract --stdout repo::$x | ntfsclone -rO $(echo "$PARTITION" | cut -d' ' -f1) - else borg extract --stdout repo::$x | dd of=$(echo "$PARTITION" | cut -d' ' -f1) fi done .. note:: When backing up a disk image (as opposed to a real block device), mount it as a loopback image to use the above snippets:: DISK=$(losetup -Pf --show /path/to/disk/image) # do backup as shown above losetup -d $DISK Using zerofree (ext2, ext3, ext4) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ``zerofree`` works similarly to ntfsclone in that it zeros out unused chunks of the FS, except it works in place, zeroing the original partition. This makes the backup process a bit simpler:: sfdisk -lo Device,Type $DISK | sed -e '1,/Device\s*Type/d' | grep Linux | cut -d' ' -f1 | xargs -n1 zerofree borg create --read-special repo::hostname-disk $DISK Because the partitions were zeroed in place, restoration is only one command:: borg extract --stdout repo::hostname-disk | dd of=$DISK .. note:: The "traditional" way to zero out space on a partition, especially one already mounted, is to simply ``dd`` from ``/dev/zero`` to a temporary file and delete it. This is ill-advised for the reasons mentioned in the ``zerofree`` man page: - it is slow - it makes the disk image (temporarily) grow to its maximal extent - it (temporarily) uses all free space on the disk, so other concurrent write actions may fail. Virtual machines ---------------- If you use non-snapshotting backup tools like Borg to back up virtual machines, then the VMs should be turned off for the duration of the backup. Backing up live VMs can (and will) result in corrupted or inconsistent backup contents: a VM image is just a regular file to Borg with the same issues as regular files when it comes to concurrent reading and writing from the same file. For backing up live VMs use filesystem snapshots on the VM host, which establishes crash-consistency for the VM images. This means that with most file systems (that are journaling) the FS will always be fine in the backup (but may need a journal replay to become accessible). Usually this does not mean that file *contents* on the VM are consistent, since file contents are normally not journaled. Notable exceptions are ext4 in data=journal mode, ZFS and btrfs (unless nodatacow is used). Applications designed with crash-consistency in mind (most relational databases like PostgreSQL, SQLite etc. but also for example Borg repositories) should always be able to recover to a consistent state from a backup created with crash-consistent snapshots (even on ext4 with data=writeback or XFS). Other applications may require a lot of work to reach application-consistency; it's a broad and complex issue that cannot be explained in entirety here. Hypervisor snapshots capturing most of the VM's state can also be used for backups and can be a better alternative to pure file system based snapshots of the VM's disk, since no state is lost. Depending on the application this can be the easiest and most reliable way to create application-consistent backups. Borg doesn't intend to address these issues due to their huge complexity and platform/software dependency. Combining Borg with the mechanisms provided by the platform (snapshots, hypervisor features) will be the best approach to start tackling them. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/deployment/non-root-user.rst0000644000076500000240000000465314641074756020627 0ustar00twstaff.. include:: ../global.rst.inc .. highlight:: none .. _non_root_user: ================================ Backing up using a non-root user ================================ This section describes how to run borg as a non-root user and still be able to backup every file on the system. Normally borg is run as the root user to bypass all filesystem permissions and be able to read all files. But in theory this also allows borg to modify or delete files on your system, in case of a bug for example. To eliminate this possibility, we can run borg as a non-root user and give it read-only permissions to all files on the system. Using Linux capabilities inside a systemd service ================================================= One way to do so, is to use linux `capabilities `_ within a systemd service. Linux capabilities allow us to give parts of the privileges the root user has to a non-root user. This works on a per-thread level and does not give the permission to the non-root user as a whole. For this we need to run our backup script from a systemd service and use the `AmbientCapabilities `_ option added in systemd 229. A very basic unit file would look like this: :: [Unit] Description=Borg Backup [Service] Type=oneshot User=borg ExecStart=/usr/local/sbin/backup.sh AmbientCapabilities=CAP_DAC_READ_SEARCH The ``CAP_DAC_READ_SEARCH`` capability gives borg read-only access to all files and directories on the system. This service can then be started manually using ``systemctl start``, a systemd timer or other methods. Restore considerations ====================== When restoring files, the root user should be used. When using the non-root user, borg extract will change all files to be owned by the non-root user. Using borg mount will not allow the non-root user to access files that it would not have access to on the system itself. Other than that, the same restore process, that would be used when running the backup as root, can be used. .. warning:: When using a local repo and running borg commands as root, make sure to only use commands that do not modify the repo itself, like extract or mount. Modifying the repo using the root user will break the repo for the non-root user, since some files inside the repo will now be owned by root. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/deployment/pull-backup.rst0000644000076500000240000004217714641074756020322 0ustar00twstaff.. include:: ../global.rst.inc .. highlight:: none .. _pull_backup: ======================= Backing up in pull mode ======================= Typically the borg client connects to a backup server using SSH as a transport when initiating a backup. This is referred to as push mode. If you however require the backup server to initiate the connection or prefer it to initiate the backup run, one of the following workarounds is required to allow such a pull mode setup. A common use case for pull mode is to backup a remote server to a local personal computer. SSHFS ===== Assuming you have a pull backup system set up with borg, where a backup server pulls the data from the target via SSHFS. In this mode, the backup client's file system is mounted remotely on the backup server. Pull mode is even possible if the SSH connection must be established by the client via a remote tunnel. Other network file systems like NFS or SMB could be used as well, but SSHFS is very simple to set up and probably the most secure one. There are some restrictions caused by SSHFS. For example, unless you define UID and GID mappings when mounting via ``sshfs``, owners and groups of the mounted file system will probably change, and you may not have access to those files if BorgBackup is not run with root privileges. SSHFS is a FUSE file system and uses the SFTP protocol, so there may be also other unsupported features that the actual implementations of sshfs, libfuse and sftp on the backup server do not support, like file name encodings, ACLs, xattrs or flags. So there is no guarantee that you are able to restore a system completely in every aspect from such a backup. .. warning:: To mount the client's root file system you will need root access to the client. This contradicts to the usual threat model of BorgBackup, where clients don't need to trust the backup server (data is encrypted). In pull mode the server (when logged in as root) could cause unlimited damage to the client. Therefore, pull mode should be used only from servers you do fully trust! .. warning:: Additionally, while being chrooted into the client's root file system, code from the client will be executed. Thus, you should only do that when fully trusting the client. .. warning:: The chroot method was chosen to get the right user and group name-id mappings, assuming they only come from files (/etc/passwd and group). This assumption might be wrong, e.g. if users/groups also come from ldap or other providers. Thus, it might be better to use ``--numeric-ids`` and not archive any user or group names (but just the numeric IDs) and not use chroot. Creating a backup ----------------- Generally, in a pull backup situation there is no direct way for borg to know the client's original UID:GID name mapping of files, because Borg would use ``/etc/passwd`` and ``/etc/group`` of the backup server to map the names. To derive the right names, Borg needs to have access to the client's passwd and group files and use them in the backup process. The solution to this problem is chrooting into an sshfs mounted directory. In this example the whole client root file system is mounted. We use the stand-alone BorgBackup executable and copy it into the mounted file system to make Borg available after entering chroot; this can be skipped if Borg is already installed on the client. :: # Mount client root file system. mkdir /tmp/sshfs sshfs root@host:/ /tmp/sshfs # Mount BorgBackup repository inside it. mkdir /tmp/sshfs/borgrepo mount --bind /path/to/repo /tmp/sshfs/borgrepo # Make borg executable available. cp /usr/local/bin/borg /tmp/sshfs/usr/local/bin/borg # Mount important system directories and enter chroot. cd /tmp/sshfs for i in dev proc sys; do mount --bind /$i $i; done chroot /tmp/sshfs Now we are on the backup system but inside a chroot with the client's root file system. We have a copy of Borg binary in ``/usr/local/bin`` and the repository in ``/borgrepo``. Borg will back up the client's user/group names, and we can create the backup, retaining the original paths, excluding the repository: :: borg create --exclude borgrepo --files-cache ctime,size /borgrepo::archive / For the sake of simplicity only ``borgrepo`` is excluded here. You may want to set up an exclude file with additional files and folders to be excluded. Also note that we have to modify Borg's file change detection behaviour – SSHFS cannot guarantee stable inode numbers, so we have to supply the ``--files-cache`` option. Finally, we need to exit chroot, unmount all the stuff and clean up: :: exit # exit chroot rm /tmp/sshfs/usr/local/bin/borg cd /tmp/sshfs for i in dev proc sys borgrepo; do umount ./$i; done rmdir borgrepo cd ~ umount /tmp/sshfs rmdir /tmp/sshfs Thanks to secuser on IRC for this how-to! Restore methods --------------- The counterpart of a pull backup is a push restore. Depending on the type of restore – full restore or partial restore – there are different methods to make sure the correct IDs are restored. Partial restore ~~~~~~~~~~~~~~~ In case of a partial restore, using the archived UIDs/GIDs might lead to wrong results if the name-to-ID mapping on the target system has changed compared to backup time (might be the case e.g. for a fresh OS install). The workaround again is chrooting into an sshfs mounted directory, so Borg is able to map the user/group names of the backup files to the actual IDs on the client. This example is similar to the backup above – only the Borg command is different: :: # Mount client root file system. mkdir /tmp/sshfs sshfs root@host:/ /tmp/sshfs # Mount BorgBackup repository inside it. mkdir /tmp/sshfs/borgrepo mount --bind /path/to/repo /tmp/sshfs/borgrepo # Make borg executable available. cp /usr/local/bin/borg /tmp/sshfs/usr/local/bin/borg # Mount important system directories and enter chroot. cd /tmp/sshfs for i in dev proc sys; do mount --bind /$i $i; done chroot /tmp/sshfs Now we can run :: borg extract /borgrepo::archive PATH to partially restore whatever we like. Finally, do the clean-up: :: exit # exit chroot rm /tmp/sshfs/usr/local/bin/borg cd /tmp/sshfs for i in dev proc sys borgrepo; do umount ./$i; done rmdir borgrepo cd ~ umount /tmp/sshfs rmdir /tmp/sshfs Full restore ~~~~~~~~~~~~ When doing a full restore, we restore all files (including the ones containing the ID-to-name mapping, ``/etc/passwd`` and ``/etc/group``). Everything will be consistent automatically if we restore the numeric IDs stored in the archive. So there is no need for a chroot environment; we just mount the client file system and extract a backup, utilizing the ``--numeric-ids`` option: :: sshfs root@host:/ /mnt/sshfs cd /mnt/sshfs borg extract --numeric-ids /path/to/repo::archive cd ~ umount /mnt/sshfs Simple (lossy) full restore ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Using ``borg export-tar`` it is possible to stream a backup to the client and directly extract it without the need of mounting with SSHFS: :: borg export-tar /path/to/repo::archive - | ssh root@host 'tar -C / -x' Note that in this scenario the tar format is the limiting factor – it cannot restore all the advanced features that BorgBackup supports. See :ref:`borg_export-tar` for limitations. socat ===== In this setup a SSH connection from the backup server to the client is established that uses SSH reverse port forwarding to transparently tunnel data between UNIX domain sockets on the client and server and the socat tool to connect these with the borg client and server processes, respectively. The program socat has to be available on the backup server and on the client to be backed up. When **pushing** a backup the borg client (holding the data to be backed up) connects to the backup server via ssh, starts ``borg serve`` on the backup server and communicates via standard input and output (transported via SSH) with the process on the backup server. With the help of socat this process can be reversed. The backup server will create a connection to the client (holding the data to be backed up) and will **pull** the data. In the following example *borg-server* connects to *borg-client* to pull a backup. To provide a secure setup sockets should be stored in ``/run/borg``, only accessible to the users that run the backup process. So on both systems, *borg-server* and *borg-client* the folder ``/run/borg`` has to be created:: sudo mkdir -m 0700 /run/borg On *borg-server* the socket file is opened by the user running the ``borg serve`` process writing to the repository so the user has to have read and write permissions on ``/run/borg``:: borg-server:~$ sudo chown borgs /run/borg On *borg-client* the socket file is created by ssh, so the user used to connect to *borg-client* has to have read and write permissions on ``/run/borg``:: borg-client:~$ sudo chown borgc /run/borg On *borg-server*, we have to start the command ``borg serve`` and make its standard input and output available to a unix socket:: borg-server:~$ socat UNIX-LISTEN:/run/borg/reponame.sock,fork EXEC:"borg serve --append-only --restrict-to-path /path/to/repo" Socat will wait until a connection is opened. Then socat will execute the command given, redirecting Standard Input and Output to the unix socket. The optional arguments for ``borg serve`` are not necessary but a sane default. .. note:: When used in production you may also use systemd socket-based activation instead of socat on the server side. You would wrap the ``borg serve`` command in a `service unit`_ and configure a matching `socket unit`_ to start the service whenever a client connects to the socket. .. _service unit: https://www.freedesktop.org/software/systemd/man/systemd.service.html .. _socket unit: https://www.freedesktop.org/software/systemd/man/systemd.socket.html Now we need a way to access the unix socket on *borg-client* (holding the data to be backed up), as we created the unix socket on *borg-server* Opening a SSH connection from the *borg-server* to the *borg-client* with reverse port forwarding can do this for us:: borg-server:~$ ssh -R /run/borg/reponame.sock:/run/borg/reponame.sock borgc@borg-client .. note:: As the default value of OpenSSH for ``StreamLocalBindUnlink`` is ``no``, the socket file created by sshd is not removed. Trying to connect a second time, will print a short warning, and the forwarding does **not** take place:: Warning: remote port forwarding failed for listen path /run/borg/reponame.sock When you are done, you have to manually remove the socket file, otherwise you may see an error like this when trying to execute borg commands:: Remote: YYYY/MM/DD HH:MM:SS socat[XXX] E connect(5, AF=1 "/run/borg/reponame.sock", 13): Connection refused Connection closed by remote host. Is borg working on the server? When a process opens the socket on *borg-client*, SSH will forward all data to the socket on *borg-server*. The next step is to tell borg on *borg-client* to use the unix socket to communicate with the ``borg serve`` command on *borg-server* via the socat socket instead of SSH:: borg-client:~$ export BORG_RSH="sh -c 'exec socat STDIO UNIX-CONNECT:/run/borg/reponame.sock'" The default value for ``BORG_RSH`` is ``ssh``. By default Borg uses SSH to create the connection to the backup server. Therefore Borg parses the repo URL and adds the server name (and other arguments) to the SSH command. Those arguments can not be handled by socat. We wrap the command with ``sh`` to ignore all arguments intended for the SSH command. All Borg commands can now be executed on *borg-client*. For example to create a backup execute the ``borg create`` command:: borg-client:~$ borg create ssh://borg-server/path/to/repo::archive /path_to_backup When automating backup creation, the interactive ssh session may seem inappropriate. An alternative way of creating a backup may be the following command:: borg-server:~$ ssh \ -R /run/borg/reponame.sock:/run/borg/reponame.sock \ borgc@borg-client \ borg create \ --rsh "sh -c 'exec socat STDIO UNIX-CONNECT:/run/borg/reponame.sock'" \ ssh://borg-server/path/to/repo::archive /path_to_backup \ ';' rm /run/borg/reponame.sock This command also automatically removes the socket file after the ``borg create`` command is done. ssh-agent ========= In this scenario *borg-server* initiates an SSH connection to *borg-client* and forwards the authentication agent connection. After that, it works similar to the push mode: *borg-client* initiates another SSH connection back to *borg-server* using the forwarded authentication agent connection to authenticate itself, starts ``borg serve`` and communicates with it. Using this method requires ssh access of user *borgs* to *borgc@borg-client*, where: * *borgs* is the user on the server side with read/write access to local borg repository. * *borgc* is the user on the client side with read access to files meant to be backed up. Applying this method for automated backup operations ---------------------------------------------------- Assume that the borg-client host is untrusted. Therefore we do some effort to prevent a hostile user on the borg-client side to do something harmful. In case of a fully trusted borg-client the method could be simplified. Preparing the server side ~~~~~~~~~~~~~~~~~~~~~~~~~ Do this once for each client on *borg-server* to allow *borgs* to connect itself on *borg-server* using a dedicated ssh key: :: borgs@borg-server$ install -m 700 -d ~/.ssh/ borgs@borg-server$ ssh-keygen -N '' -t rsa -f ~/.ssh/borg-client_key borgs@borg-server$ { echo -n 'command="borg serve --append-only --restrict-to-repo ~/repo",restrict '; cat ~/.ssh/borg-client_key.pub; } >> ~/.ssh/authorized_keys borgs@borg-server$ chmod 600 ~/.ssh/authorized_keys ``install -m 700 -d ~/.ssh/`` Create directory ~/.ssh with correct permissions if it does not exist yet. ``ssh-keygen -N '' -t rsa -f ~/.ssh/borg-client_key`` Create an ssh key dedicated to communication with borg-client. .. note:: Another more complex approach is using a unique ssh key for each pull operation. This is more secure as it guarantees that the key will not be used for other purposes. ``{ echo -n 'command="borg serve --append-only --restrict-to-repo ~/repo",restrict '; cat ~/.ssh/borg-client_key.pub; } >> ~/.ssh/authorized_keys`` Add borg-client's ssh public key to ~/.ssh/authorized_keys with forced command and restricted mode. The borg client is restricted to use one repo at the specified path and to append-only operation. Commands like *delete*, *prune* and *compact* have to be executed another way, for example directly on *borg-server* side or from a privileged, less restricted client (using another authorized_keys entry). ``chmod 600 ~/.ssh/authorized_keys`` Fix permissions of ~/.ssh/authorized_keys. Pull operation ~~~~~~~~~~~~~~ Initiating borg command execution from *borg-server* (e.g. init):: borgs@borg-server$ ( eval $(ssh-agent) > /dev/null ssh-add -q ~/.ssh/borg-client_key echo 'your secure borg key passphrase' | \ ssh -A -o StrictHostKeyChecking=no borgc@borg-client "BORG_PASSPHRASE=\$(cat) borg --rsh 'ssh -o StrictHostKeyChecking=no' init --encryption repokey ssh://borgs@borg-server/~/repo" kill "${SSH_AGENT_PID}" ) Parentheses around commands are needed to avoid interference with a possibly already running ssh-agent. Parentheses are not needed when using a dedicated bash process. ``eval $(ssh-agent) > /dev/null`` Run the SSH agent in the background and export related environment variables to the current bash session. ``ssh-add -q ~/.ssh/borg-client_key`` Load the SSH private key dedicated to communication with the borg-client into the SSH agent. Look at ``man 1 ssh-add`` for a more detailed explanation. .. note:: Care needs to be taken when loading keys into the SSH agent. Users on the *borg-client* having read/write permissions to the agent's UNIX-domain socket (at least borgc and root in our case) can access the agent on *borg-server* through the forwarded connection and can authenticate using any of the identities loaded into the agent (look at ``man 1 ssh`` for more detailed explanation). Therefore there are some security considerations: * Private keys loaded into the agent must not be used to enable access anywhere else. * The keys meant to be loaded into the agent must be specified explicitly, not from default locations. * The *borg-client*'s entry in *borgs@borg-server:~/.ssh/authorized_keys* must be as restrictive as possible. ``echo 'your secure borg key passphrase' | ssh -A -o StrictHostKeyChecking=no borgc@borg-client "BORG_PASSPHRASE=\$(cat) borg --rsh 'ssh -o StrictHostKeyChecking=no' init --encryption repokey ssh://borgs@borg-server/~/repo"`` Run the *borg init* command on *borg-client*. *ssh://borgs@borg-server/~/repo* refers to the repository *repo* within borgs's home directory on *borg-server*. *StrictHostKeyChecking=no* is used to automatically add host keys to *~/.ssh/known_hosts* without user intervention. ``kill "${SSH_AGENT_PID}"`` Kill ssh-agent with loaded keys when it is not needed anymore. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/deployment.rst0000644000076500000240000000054514641074756016074 0ustar00twstaff.. include:: global.rst.inc .. highlight:: none Deployment ========== This chapter details deployment strategies for the following scenarios. .. toctree:: :titlesonly: deployment/central-backup-server deployment/hosting-repositories deployment/automated-local deployment/image-backup deployment/pull-backup deployment/non-root-user ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/development.rst0000644000076500000240000003134114641074756016234 0ustar00twstaff.. include:: global.rst.inc .. highlight:: bash .. _development: Development =========== This chapter will get you started with Borg development. Borg is written in Python (with a little bit of Cython and C for the performance critical parts). Contributions ------------- ... are welcome! Some guidance for contributors: - Discuss changes on the GitHub issue tracker, on IRC or on the mailing list. - Make your PRs on the ``master`` branch (see `Branching Model`_ for details). - Do clean changesets: - Focus on some topic, resist changing anything else. - Do not do style changes mixed with functional changes. - Try to avoid refactorings mixed with functional changes. - If you need to fix something after commit/push: - If there are ongoing reviews: do a fixup commit you can squash into the bad commit later. - If there are no ongoing reviews or you did not push the bad commit yet: amend the commit to include your fix or merge the fixup commit before pushing. - Have a nice, clear, typo-free commit comment. - If you fixed an issue, refer to it in your commit comment. - Follow the style guide (see below). - If you write new code, please add tests and docs for it. - Run the tests, fix any issues that come up. - Make a pull request on GitHub. - Wait for review by other developers. Branching model --------------- Borg development happens on the ``master`` branch and uses GitHub pull requests (if you don't have GitHub or don't want to use it you can send smaller patches via the borgbackup mailing list to the maintainers). Stable releases are maintained on maintenance branches named ``x.y-maint``, eg. the maintenance branch of the 1.0.x series is ``1.0-maint``. Most PRs should be filed against the ``master`` branch. Only if an issue affects **only** a particular maintenance branch a PR should be filed against it directly. While discussing / reviewing a PR it will be decided whether the change should be applied to maintenance branches. Each maintenance branch has a corresponding *backport/x.y-maint* label, which will then be applied. Changes that are typically considered for backporting: - Data loss, corruption and inaccessibility fixes. - Security fixes. - Forward-compatibility improvements. - Documentation corrections. .. rubric:: Maintainer part From time to time a maintainer will backport the changes for a maintenance branch, typically before a release or if enough changes were collected: 1. Notify others that you're doing this to avoid duplicate work. 2. Branch a backporting branch off the maintenance branch. 3. Cherry pick and backport the changes from each labelled PR, remove the label for each PR you've backported. To preserve authorship metadata, do not follow the ``git cherry-pick`` instructions to use ``git commit`` after resolving conflicts. Instead, stage conflict resolutions and run ``git cherry-pick --continue``, much like using ``git rebase``. To avoid merge issues (a cherry pick is a form of merge), use these options (similar to the ``git merge`` options used previously, the ``-x`` option adds a reference to the original commit):: git cherry-pick --strategy recursive -X rename-threshold=5% -x 4. Make a PR of the backporting branch against the maintenance branch for backport review. Mention the backported PRs in this PR, e.g.: Includes changes from #2055 #2057 #2381 This way GitHub will automatically show in these PRs where they were backported. .. rubric:: Historic model Previously (until release 1.0.10) Borg used a `"merge upwards" `_ model where most minor changes and fixes where committed to a maintenance branch (eg. 1.0-maint), and the maintenance branch(es) were regularly merged back into the main development branch. This became more and more troublesome due to merges growing more conflict-heavy and error-prone. Code and issues --------------- Code is stored on GitHub, in the `Borgbackup organization `_. `Issues `_ and `pull requests `_ should be sent there as well. See also the :ref:`support` section for more details. Style guide ----------- We generally follow `pep8 `_, with 120 columns instead of 79. We do *not* use form-feed (``^L``) characters to separate sections either. Compliance is tested automatically when you run the tests. Continuous Integration ---------------------- All pull requests go through `GitHub Actions`_, which runs the tests on misc. Python versions and on misc. platforms as well as some additional checks. .. _GitHub Actions: https://github.com/borgbackup/borg/actions Output and Logging ------------------ When writing logger calls, always use correct log level (debug only for debugging, info for informative messages, warning for warnings, error for errors, critical for critical errors/states). When directly talking to the user (e.g. Y/N questions), do not use logging, but directly output to stderr (not: stdout, it could be connected to a pipe). To control the amount and kinds of messages output emitted at info level, use flags like ``--stats`` or ``--list``, then create a topic logger for messages controlled by that flag. See ``_setup_implied_logging()`` in ``borg/archiver.py`` for the entry point to topic logging. Building a development environment ---------------------------------- First, just install borg into a virtual env :ref:`as described before `. To install some additional packages needed for running the tests, activate your virtual env and run:: pip install -r requirements.d/development.txt This project utilizes pre-commit to lint code before it is committed. Although pre-commit is installed when running the command above, the pre-commit hooks will have to be installed separately. Run this command to install the pre-commit hooks:: pre-commit install Running the tests ----------------- The tests are in the borg/testsuite package. To run all the tests, you need to have fakeroot installed. If you do not have fakeroot, you still will be able to run most tests, just leave away the `fakeroot -u` from the given command lines. To run the test suite use the following command:: fakeroot -u tox # run all tests Some more advanced examples:: # verify a changed tox.ini (run this after any change to tox.ini): fakeroot -u tox --recreate fakeroot -u tox -e py39 # run all tests, but only on python 3.9 fakeroot -u tox borg.testsuite.locking # only run 1 test module fakeroot -u tox borg.testsuite.locking -- -k '"not Timer"' # exclude some tests fakeroot -u tox borg.testsuite -- -v # verbose py.test Important notes: - When using ``--`` to give options to py.test, you MUST also give ``borg.testsuite[.module]``. Running the tests (using the pypi package) ------------------------------------------ Since borg 1.4, it is also possible to run the tests without a development environment, using the borgbackup dist package (downloaded from pypi.org or github releases page):: # optional: create and use a virtual env: python3 -m venv env . env/bin/activate # install packages pip install borgbackup pip install pytest pytest-benchmark # method A: use a pytest.ini cat >pytest.ini <<`_ with the new version number and release date. - Announce on: - Mailing list. - Twitter. - IRC channel (change ``/topic``). - Create a GitHub release, include: * pypi dist package and signature * Standalone binaries (see above for how to create them). + For macOS, document the macFUSE version in the README of the binaries. macFUSE uses a kernel extension that needs to be compatible with the code contained in the binary. * A link to ``CHANGES.rst``. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/faq.rst0000644000076500000240000017300114641074756014461 0ustar00twstaff.. include:: global.rst.inc .. highlight:: none .. _faq: Frequently asked questions ========================== Usage & Limitations ################### What is the difference between a repo on an external hard drive vs. repo on a server? ------------------------------------------------------------------------------------- If Borg is running in client/server mode, the client uses SSH as a transport to talk to the remote agent, which is another Borg process (Borg is installed on the server, too) started automatically by the client. The Borg server is doing storage-related low-level repo operations (get, put, commit, check, compact), while the Borg client does the high-level stuff: deduplication, encryption, compression, dealing with archives, backups, restores, etc., which reduces the amount of data that goes over the network. When Borg is writing to a repo on a locally mounted remote file system, e.g. SSHFS, the Borg client only can do file system operations and has no agent running on the remote side, so *every* operation needs to go over the network, which is slower. Can I backup from multiple servers into a single repository? ------------------------------------------------------------ Yes, this is *possible* from the technical standpoint, but it is *not recommended* from the security perspective. BorgBackup is built upon a defined :ref:`attack_model` that cannot provide its guarantees for multiple clients using the same repository. See :ref:`borg_security_critique` for a detailed explanation. Also, in order for the deduplication used by Borg to work, it needs to keep a local cache containing checksums of all file chunks already stored in the repository. This cache is stored in ``~/.cache/borg/``. If Borg detects that a repository has been modified since the local cache was updated it will need to rebuild the cache. This rebuild can be quite time consuming. So, yes it's possible. But it will be most efficient if a single repository is only modified from one place. Also keep in mind that Borg will keep an exclusive lock on the repository while creating or deleting archives, which may make *simultaneous* backups fail. Can I back up to multiple, swapped backup targets? -------------------------------------------------- It is possible to swap your backup disks if each backup medium is assigned its own repository by creating a new one with :ref:`borg_init`. Can I copy or synchronize my repo to another location? ------------------------------------------------------ If you want to have redundant backup repositories (preferably at separate locations), the recommended way to do that is like this: - ``borg init repo1`` - ``borg init repo2`` - client machine ---borg create---> repo1 - client machine ---borg create---> repo2 This will create distinct repositories (separate repo ID, separate keys) and nothing bad happening in repo1 will influence repo2. Some people decide against above recommendation and create identical copies of a repo (using some copy / sync / clone tool). While this might be better than having no redundancy at all, you have to be very careful about how you do that and what you may / must not do with the result (if you decide against our recommendation). What you would get with this is: - client machine ---borg create---> repo - repo ---copy/sync---> copy-of-repo There is no special borg command to do the copying, you could just use any reliable tool that creates an identical copy (cp, rsync, rclone might be options). But think about whether that is really what you want. If something goes wrong in repo, you will have the same issue in copy-of-repo. Make sure you do the copy/sync while no backup is running, see :ref:`borg_with-lock` about how to do that. Also, you must not run borg against multiple instances of the same repo (like repo and copy-of-repo) as that would create severe issues: - Data loss: they have the same repository ID, so the borg client will think they are identical and e.g. use the same local cache for them (which is an issue if they happen to be not the same). See :issue:`4272` for an example. - Encryption security issues if you would update repo and copy-of-repo independently, due to AES counter reuse. See also: :ref:`faq_corrupt_repo` "this is either an attack or unsafe" warning -------------------------------------------- About the warning: Cache, or information obtained from the security directory is newer than repository - this is either an attack or unsafe (multiple repos with same ID) "unsafe": If not following the advice from the previous section, you can easily run into this by yourself by restoring an older copy of your repository. "attack": maybe an attacker has replaced your repo by an older copy, trying to trick you into AES counter reuse, trying to break your repo encryption. Borg users have also reported that fs issues (like hw issues / I/O errors causing the fs to become read-only) can cause this warning, see :issue:`7853`. If you'ld decide to ignore this and accept unsafe operation for this repository, you could delete the manifest-timestamp and the local cache: :: borg config repo id # shows the REPO_ID rm ~/.config/borg/security/REPO_ID/manifest-timestamp borg delete --cache-only REPO This is an unsafe and unsupported way to use borg, you have been warned. Which file types, attributes, etc. are *not* preserved? ------------------------------------------------------- * UNIX domain sockets (because it does not make sense - they are meaningless without the running process that created them and the process needs to recreate them in any case). So, don't panic if your backup misses a UDS! * The precise on-disk (or rather: not-on-disk) representation of the holes in a sparse file. Archive creation has no special support for sparse files, holes are backed up as (deduplicated and compressed) runs of zero bytes. Archive extraction has optional support to extract all-zero chunks as holes in a sparse file. * Some filesystem specific attributes, like btrfs NOCOW, see :ref:`platforms`. * For hardlinked symlinks, the hardlinking can not be archived (and thus, the hardlinking will not be done at extraction time). The symlinks will be archived and extracted as non-hardlinked symlinks, see :issue:`2379`. Are there other known limitations? ---------------------------------- - A single archive can only reference a limited volume of file/dir metadata, usually corresponding to tens or hundreds of millions of files/dirs. When trying to go beyond that limit, you will get a fatal IntegrityError exception telling that the (archive) object is too big. An easy workaround is to create multiple archives with fewer items each. See also the :ref:`archive_limitation` and :issue:`1452`. :ref:`borg_info` shows how large (relative to the maximum size) existing archives are. - borg extract only supports restoring into an empty destination. After that, the destination will exactly have the contents of the extracted archive. If you extract into a non-empty destination, borg will (for example) not remove files which are in the destination, but not in the archive. See :issue:`4598` for a workaround and more details. .. _checkpoints_parts: If a backup stops mid-way, does the already-backed-up data stay there? ---------------------------------------------------------------------- Yes, Borg supports resuming backups. During a backup a special checkpoint archive named ``.checkpoint`` is saved every checkpoint interval (the default value for this is 30 minutes) containing all the data backed-up until that point. This checkpoint archive is a valid archive, but it is only a partial backup (not all files that you wanted to backup are contained in it). Having it in the repo until a successful, full backup is completed is useful because it references all the transmitted chunks up to the checkpoint. This means that in case of an interruption, you only need to retransfer the data since the last checkpoint. If a backup was interrupted, you normally do not need to do anything special, just invoke ``borg create`` as you always do. If the repository is still locked, you may need to run ``borg break-lock`` before the next backup. You may use the same archive name as in previous attempt or a different one (e.g. if you always include the current datetime), it does not matter. Borg always does full single-pass backups, so it will start again from the beginning - but it will be much faster, because some of the data was already stored into the repo (and is still referenced by the checkpoint archive), so it does not need to get transmitted and stored again. Once your backup has finished successfully, you can delete all ``.checkpoint`` archives. If you run ``borg prune``, it will also care for deleting unneeded checkpoints. Note: the checkpointing mechanism creates hidden, partial files in an archive, so that checkpoints even work while a big file is being processed. They are named ``.borg_part_`` and all operations usually ignore these files, but you can make them considered by giving the option ``--consider-part-files``. You usually only need that option if you are really desperate (e.g. if you have no completed backup of that file and you'ld rather get a partial file extracted than nothing). You do **not** want to give that option under any normal circumstances. Note that checkpoints inside files are created only since version 1.1, make sure you have an up-to-date version of borgbackup if you want to continue instead of retransferring a huge file. In some cases, there is only an outdated version shipped with your distribution (e.g. Debian). See :ref:`installation`. How can I backup huge file(s) over a unstable connection? --------------------------------------------------------- This is not a problem anymore. For more details, see :ref:`checkpoints_parts`. How can I switch append-only mode on and off? ----------------------------------------------------------------------------------------------------------------------------------- You could do that (via borg config REPO append_only 0/1), but using different ssh keys and different entries in ``authorized_keys`` is much easier and also maybe has less potential of things going wrong somehow. My machine goes to sleep causing `Broken pipe` ---------------------------------------------- When backing up your data over the network, your machine should not go to sleep. On macOS you can use `caffeinate` to avoid that. How can I restore huge file(s) over an unstable connection? ----------------------------------------------------------- If you cannot manage to extract the whole big file in one go, you can extract all the part files and manually concatenate them together. For more details, see :ref:`checkpoints_parts`. How can I compare contents of an archive to my local filesystem? ----------------------------------------------------------------- You can instruct ``export-tar`` to send a tar stream to the stdout, and then use ``tar`` to perform the comparison: :: borg export-tar /path/to/repo::archive-name - | tar --compare -f - -C /path/to/compare/to .. _faq_corrupt_repo: My repository is corrupt, how can I restore from an older copy of it? --------------------------------------------------------------------- If your repositories are encrypted and have the same ID, the recommended method is to delete the corrupted repository, but keep its security info, and then copy the working repository to the same location: :: borg delete --keep-security-info /path/to/repo rsync -aH /path/to/repo-working/ /path/to/repo # Note the trailing slash. A plain delete command would remove the security info in ``~/.config/borg/security``, including the nonce value. In BorgBackup :ref:`security_encryption` is AES-CTR, where the nonce is a counter. When the working repo was used later for creating new archives, Borg would re-use nonce values due to starting from a lower counter value given by the older copy of the repository. To prevent this, the ``keep-security-info`` option is applied so that the client-side nonce counter is kept. Can Borg add redundancy to the backup data to deal with hardware malfunction? ----------------------------------------------------------------------------- No, it can't. While that at first sounds like a good idea to defend against some defect HDD sectors or SSD flash blocks, dealing with this in a reliable way needs a lot of low-level storage layout information and control which we do not have (and also can't get, even if we wanted). So, if you need that, consider RAID or a filesystem that offers redundant storage or just make backups to different locations / different hardware. See also :issue:`225`. Can Borg verify data integrity of a backup archive? --------------------------------------------------- Yes, if you want to detect accidental data damage (like bit rot), use the ``check`` operation. It will notice corruption using CRCs and hashes. If you want to be able to detect malicious tampering also, use an encrypted repo. It will then be able to check using CRCs and HMACs. Can I use Borg on SMR hard drives? ---------------------------------- SMR (shingled magnetic recording) hard drives are very different from regular hard drives. Applications have to behave in certain ways or performance will be heavily degraded. Borg 1.1 ships with default settings suitable for SMR drives, and has been successfully tested on *Seagate Archive v2* drives using the ext4 file system. Some Linux kernel versions between 3.19 and 4.5 had various bugs handling device-managed SMR drives, leading to IO errors, unresponsive drives and unreliable operation in general. For more details, refer to :issue:`2252`. .. _faq-integrityerror: I get an IntegrityError or similar - what now? ---------------------------------------------- A single error does not necessarily indicate bad hardware or a Borg bug. All hardware exhibits a bit error rate (BER). Hard drives are typically specified as exhibiting fewer than one error every 12 to 120 TB (one bit error in 10e14 to 10e15 bits). The specification is often called *unrecoverable read error rate* (URE rate). Apart from these very rare errors there are two main causes of errors: (i) Defective hardware: described below. (ii) Bugs in software (Borg, operating system, libraries): Ensure software is up to date. Check whether the issue is caused by any fixed bugs described in :ref:`important_notes`. .. rubric:: Finding defective hardware .. note:: Hardware diagnostics are operating system dependent and do not apply universally. The commands shown apply for popular Unix-like systems. Refer to your operating system's manual. Checking hard drives Find the drive containing the repository and use *findmnt*, *mount* or *lsblk* to learn the device path (typically */dev/...*) of the drive. Then, smartmontools can retrieve self-diagnostics of the drive in question:: # smartctl -a /dev/sdSomething The *Offline_Uncorrectable*, *Current_Pending_Sector* and *Reported_Uncorrect* attributes indicate data corruption. A high *UDMA_CRC_Error_Count* usually indicates a bad cable. I/O errors logged by the system (refer to the system journal or dmesg) can point to issues as well. I/O errors only affecting the file system easily go unnoticed, since they are not reported to applications (e.g. Borg), while these errors can still corrupt data. Drives can corrupt some sectors in one event, while remaining reliable otherwise. Conversely, drives can fail completely with no advance warning. If in doubt, copy all data from the drive in question to another drive -- just in case it fails completely. If any of these are suspicious, a self-test is recommended:: # smartctl -t long /dev/sdSomething Running ``fsck`` if not done already might yield further insights. Checking memory Intermittent issues, such as ``borg check`` finding errors inconsistently between runs, are frequently caused by bad memory. Run memtest86+ (or an equivalent memory tester) to verify that the memory subsystem is operating correctly. Checking processors Processors rarely cause errors. If they do, they are usually overclocked or otherwise operated outside their specifications. We do not recommend to operate hardware outside its specifications for productive use. Tools to verify correct processor operation include Prime95 (mprime), linpack, and the `Intel Processor Diagnostic Tool `_ (applies only to Intel processors). .. rubric:: Repairing a damaged repository With any defective hardware found and replaced, the damage done to the repository needs to be ascertained and fixed. :ref:`borg_check` provides diagnostics and ``--repair`` options for repositories with issues. We recommend to first run without ``--repair`` to assess the situation. If the found issues and proposed repairs seem right, re-run "check" with ``--repair`` enabled. How probable is it to get a hash collision problem? --------------------------------------------------- If you noticed, there are some issues (:issue:`170` (**warning: hell**) and :issue:`4884`) about the probability of a chunk having the same hash as another chunk, making the file corrupted because it grabbed the wrong chunk. This is called the `Birthday Problem `_. There is a lot of probability in here so, I can give you my interpretation of such math but it's honestly better that you read it yourself and grab your own resolution from that. Assuming that all your chunks have a size of :math:`2^{21}` bytes (approximately 2.1 MB) and we have a "perfect" hash algorithm, we can think that the probability of collision would be of :math:`p^2/2^{n+1}` then, using SHA-256 (:math:`n=256`) and for example we have 1000 million chunks (:math:`p=10^9`) (1000 million chunks would be about 2100TB). The probability would be around to 0.0000000000000000000000000000000000000000000000000000000000043. A mass-murderer space rock happens about once every 30 million years on average. This leads to a probability of such an event occurring in the next second to about :math:`10^{-15}`. That's **45** orders of magnitude more probable than the SHA-256 collision. Briefly stated, if you find SHA-256 collisions scary then your priorities are wrong. This example was grabbed from `this SO answer `_, it's great honestly. Still, the real question is if Borg tries to not make this happen? Well... it used to not check anything but there was a feature added which saves the size of the chunks too, so the size of the chunks is compared to the size that you got with the hash and if the check says there is a mismatch it will raise an exception instead of corrupting the file. This doesn't save us from everything but reduces the chances of corruption. There are other ways of trying to escape this but it would affect performance so much that it wouldn't be worth it and it would contradict Borg's design, so if you don't want this to happen, simply don't use Borg. Why is the time elapsed in the archive stats different from wall clock time? ---------------------------------------------------------------------------- Borg needs to write the time elapsed into the archive metadata before finalizing the archive, compacting the segments, and committing the repo & cache. This means when Borg is run with e.g. the ``time`` command, the duration shown in the archive stats may be shorter than the full time the command runs for. How do I configure different prune policies for different directories? ---------------------------------------------------------------------- Say you want to prune ``/var/log`` faster than the rest of ``/``. How do we implement that? The answer is to backup to different archive *names* and then implement different prune policies for different --glob-archives matching patterns. For example, you could have a script that does:: borg create --exclude var/log $REPOSITORY:main-$(date +%Y-%m-%d) / borg create $REPOSITORY:logs-$(date +%Y-%m-%d) /var/log Then you would have two different prune calls with different policies:: borg prune --verbose --list -d 30 --glob-archives 'main-*' "$REPOSITORY" borg prune --verbose --list -d 7 --glob-archives 'logs-*' "$REPOSITORY" This will keep 7 days of logs and 30 days of everything else. How do I remove files from an existing backup? ---------------------------------------------- A file is only removed from a BorgBackup repository if all archives that contain the file are deleted and the corresponding data chunks are removed from the repository There are two ways how to remove files from a repository. 1. Use :ref:`borg_delete` to remove all archives that contain the files. This will of course delete everything in the archive, not only some files. 2. If you really want to remove only some specific files, you can run the :ref:`borg_recreate` command to rewrite all archives with a different ``--exclude`` pattern. See the examples in the manpage for more information. Finally, run :ref:`borg_compact` with the ``--threshold 0`` option to delete the data chunks from the repository. Can I safely change the compression level or algorithm? -------------------------------------------------------- The compression level and algorithm don't affect deduplication. Chunk ID hashes are calculated *before* compression. New compression settings will only be applied to new chunks, not existing chunks. So it's safe to change them. Security ######## .. _borg_security_critique: Isn't BorgBackup's AES-CTR crypto broken? ----------------------------------------- If a nonce (counter) value is reused, AES-CTR mode crypto is broken. To exploit the AES counter management issue, an attacker would need to have access to the borg repository. By tampering with the repo, the attacker could bring the repo into a state so that it reports a lower "highest used counter value" than the one that actually was used. The client would usually notice that, because it rather trusts the clientside stored "highest used counter value" than trusting the server. But there are situations, where this is simply not possible: - If clients A and B used the repo, the client A can only know its own highest CTR value, but not the one produced by B. That is only known to (B and) the server (the repo) and thus the client A needs to trust the server about the value produced by B in that situation. You can't do much about this except not having multiple clients per repo. - Even if there is only one client, if client-side information is completely lost (e.g. due to disk defect), the client also needs to trust the value from server side. You can avoid this by not continuing to write to the repository after you have lost clientside borg information. .. _home_config_borg: How important is the $HOME/.config/borg directory? -------------------------------------------------- The Borg config directory has content that you should take care of: ``security`` subdirectory Each directory here represents one Borg repository by its ID and contains the last known status. If a repository's status is different from this information at the beginning of BorgBackup operation, Borg outputs warning messages and asks for confirmation, so make sure you do not lose or manipulate these files. However, apart from those warnings, a loss of these files can be recovered. ``keys`` subdirectory All your borg keyfile keys are stored in this directory. Please note that borg repokey keys are stored inside the repository. You MUST make sure to have an independent backup of these keyfiles, otherwise you cannot access your backups anymore if you lose them. You also MUST keep these files secret; everyone who gains access to your repository and has the corresponding keyfile (and the key passphrase) can extract it. Make sure that only you have access to the Borg config directory. .. _cache_security: Do I need to take security precautions regarding the cache? ----------------------------------------------------------- The cache contains a lot of metadata information about the files in your repositories and it is not encrypted. However, the assumption is that the cache is being stored on the very same system which also contains the original files which are being backed up. So someone with access to the cache files would also have access the original files anyway. The Internals section contains more details about :ref:`cache`. If you ever need to move the cache to a different location, this can be achieved by using the appropriate :ref:`env_vars`. How can I specify the encryption passphrase programmatically? ------------------------------------------------------------- There are several ways to specify a passphrase without human intervention: Setting ``BORG_PASSPHRASE`` The passphrase can be specified using the ``BORG_PASSPHRASE`` environment variable. This is often the simplest option, but can be insecure if the script that sets it is world-readable. .. _password_env: .. note:: Be careful how you set the environment; using the ``env`` command, a ``system()`` call or using inline shell scripts (e.g. ``BORG_PASSPHRASE=hunter2 borg ...``) might expose the credentials in the process list directly and they will be readable to all users on a system. Using ``export`` in a shell script file should be safe, however, as the environment of a process is `accessible only to that user `_. Using ``BORG_PASSCOMMAND`` with a properly permissioned file Another option is to create a file with a password in it in your home directory and use permissions to keep anyone else from reading it. For example, first create a key:: (umask 0077; head -c 32 /dev/urandom | base64 -w 0 > ~/.borg-passphrase) Then in an automated script one can put:: export BORG_PASSCOMMAND="cat $HOME/.borg-passphrase" and Borg will automatically use that passphrase. Using keyfile-based encryption with a blank passphrase It is possible to encrypt your repository in ``keyfile`` mode instead of the default ``repokey`` mode and use a blank passphrase for the key file (simply press Enter twice when ``borg init`` asks for the password). See :ref:`encrypted_repos` for more details. Using ``BORG_PASSCOMMAND`` with macOS Keychain macOS has a native manager for secrets (such as passphrases) which is safer than just using a file as it is encrypted at rest and unlocked manually (fortunately, the login keyring automatically unlocks when you login). With the built-in ``security`` command, you can access it from the command line, making it useful for ``BORG_PASSCOMMAND``. First generate a passphrase and use ``security`` to save it to your login (default) keychain:: security add-generic-password -D secret -U -a $USER -s borg-passphrase -w $(head -c 32 /dev/urandom | base64 -w 0) In your backup script retrieve it in the ``BORG_PASSCOMMAND``:: export BORG_PASSCOMMAND="security find-generic-password -a $USER -s borg-passphrase -w" Using ``BORG_PASSCOMMAND`` with GNOME Keyring GNOME also has a keyring daemon that can be used to store a Borg passphrase. First ensure ``libsecret-tools``, ``gnome-keyring`` and ``libpam-gnome-keyring`` are installed. If ``libpam-gnome-keyring`` wasn't already installed, ensure it runs on login:: sudo sh -c "echo session optional pam_gnome_keyring.so auto_start >> /etc/pam.d/login" sudo sh -c "echo password optional pam_gnome_keyring.so >> /etc/pam.d/passwd" # you may need to relogin afterwards to activate the login keyring Then add a secret to the login keyring:: head -c 32 /dev/urandom | base64 -w 0 | secret-tool store borg-repository repo-name --label="Borg Passphrase" If a dialog box pops up prompting you to pick a password for a new keychain, use your login password. If there is a checkbox for automatically unlocking on login, check it to allow backups without any user intervention whatsoever. Once the secret is saved, retrieve it in a backup script using ``BORG_PASSCOMMAND``:: export BORG_PASSCOMMAND="secret-tool lookup borg-repository repo-name" .. note:: For this to automatically unlock the keychain it must be run in the ``dbus`` session of an unlocked terminal; for example, running a backup script as a ``cron`` job might not work unless you also ``export DISPLAY=:0`` so ``secret-tool`` can pick up your open session. `It gets even more complicated`__ when you are running the tool as a different user (e.g. running a backup as root with the password stored in the user keyring). __ https://github.com/borgbackup/borg/pull/2837#discussion_r127641330 Using ``BORG_PASSCOMMAND`` with KWallet KDE also has a keychain feature in the form of KWallet. The command-line tool ``kwalletcli`` can be used to store and retrieve secrets. Ensure ``kwalletcli`` is installed, generate a passphrase, and store it in your "wallet":: head -c 32 /dev/urandom | base64 -w 0 | kwalletcli -Pe borg-passphrase -f Passwords Once the secret is saved, retrieve it in a backup script using ``BORG_PASSCOMMAND``:: export BORG_PASSCOMMAND="kwalletcli -e borg-passphrase -f Passwords" When backing up to remote encrypted repos, is encryption done locally? ---------------------------------------------------------------------- Yes, file and directory metadata and data is locally encrypted, before leaving the local machine. We do not mean the transport layer encryption by that, but the data/metadata itself. Transport layer encryption (e.g. when ssh is used as a transport) applies additionally. When backing up to remote servers, do I have to trust the remote server? ------------------------------------------------------------------------ Yes and No. No, as far as data confidentiality is concerned - if you use encryption, all your files/dirs data and metadata are stored in their encrypted form into the repository. Yes, as an attacker with access to the remote server could delete (or otherwise make unavailable) all your backups. How can I protect against a hacked backup client? ------------------------------------------------- Assume you backup your backup client machine C to the backup server S and C gets hacked. In a simple push setup, the attacker could then use borg on C to delete all backups residing on S. These are your options to protect against that: - Do not allow to permanently delete data from the repo, see :ref:`append_only_mode`. - Use a pull-mode setup using ``ssh -R``, see :ref:`pull_backup` for more information. - Mount C's filesystem on another machine and then create a backup of it. - Do not give C filesystem-level access to S. See :ref:`hosting_repositories` for a detailed protection guide. How can I protect against a hacked backup server? ------------------------------------------------- Just in case you got the impression that pull-mode backups are way more safe than push-mode, you also need to consider the case that your backup server S gets hacked. In case S has access to a lot of clients C, that might bring you into even bigger trouble than a hacked backup client in the previous FAQ entry. These are your options to protect against that: - Use the standard push-mode setup (see also previous FAQ entry). - Mount (the repo part of) S's filesystem on C. - Do not give S file-system level access to C. - Have your backup server at a well protected place (maybe not reachable from the internet), configure it safely, apply security updates, monitor it, ... How can I protect against theft, sabotage, lightning, fire, ...? ---------------------------------------------------------------- In general: if your only backup medium is nearby the backupped machine and always connected, you can easily get into trouble: they likely share the same fate if something goes really wrong. Thus: - have multiple backup media - have media disconnected from network, power, computer - have media at another place - have a relatively recent backup on your media How do I report a security issue with Borg? ------------------------------------------- Send a private email to the :ref:`security contact ` if you think you have discovered a security issue. Please disclose security issues responsibly. How important are the nonce files? ------------------------------------ Borg uses :ref:`AES-CTR encryption `. An essential part of AES-CTR is a sequential counter that must **never** repeat. If the same value of the counter is used twice in the same repository, an attacker can decrypt the data. The counter is stored in the home directory of each user ($HOME/.config/borg/security/$REPO_ID/nonce) as well as in the repository (/path/to/repo/nonce). When creating a new archive borg uses the highest of the two values. The value of the counter in the repository may be higher than your local value if another user has created an archive more recently than you did. Since the nonce is not necessary to read the data that is already encrypted, ``borg info``, ``borg list``, ``borg extract`` and ``borg mount`` should work just fine without it. If the nonce file stored in the repo is lost, but you still have your local copy, borg will recreate the repository nonce file the next time you run ``borg create``. This should be safe for repositories that are only used from one user account on one machine. For repositories that are used by multiple users and/or from multiple machines it is safest to avoid running *any* commands that modify the repository after the nonce is deleted or if you suspect it may have been tampered with. See :ref:`attack_model`. Common issues ############# /path/to/repo is not a valid repository. Check repo config. ----------------------------------------------------------- There can be many causes of this error. E.g. you have incorrectly specified the repository path. You will also get this error if you try to access a repository that uses the argon2 key algorithm using an old version of borg. We recommend upgrading to the latest stable version and trying again. We are sorry. We should have thought abount forward compatibility and implemented a more helpful error message. Why does Borg extract hang after some time? ------------------------------------------- When I do a ``borg extract``, after a while all activity stops, no cpu usage, no downloads. This may happen when the SSH connection is stuck on server side. You can configure SSH on client side to prevent this by sending keep-alive requests, for example in ~/.ssh/config: :: Host borg.example.com # Client kills connection after 3*30 seconds without server response: ServerAliveInterval 30 ServerAliveCountMax 3 You can also do the opposite and configure SSH on server side in /etc/ssh/sshd_config, to make the server send keep-alive requests to the client: :: # Server kills connection after 3*30 seconds without client response: ClientAliveInterval 30 ClientAliveCountMax 3 How can I deal with my very unstable SSH connection? ---------------------------------------------------- If you have issues with lost connections during long-running borg commands, you could try to work around: - Make partial extracts like ``borg extract REPO PATTERN`` to do multiple smaller extraction runs that complete before your connection has issues. - Try using ``borg mount REPO MOUNTPOINT`` and ``rsync -avH`` from ``MOUNTPOINT`` to your desired extraction directory. If the connection breaks down, just repeat that over and over again until rsync does not find anything to do any more. Due to the way borg mount works, this might be less efficient than borg extract for bigger volumes of data. Why do I get "connection closed by remote" after a while? --------------------------------------------------------- When doing a backup to a remote server (using a ssh: repo URL), it sometimes stops after a while (some minutes, hours, ... - not immediately) with "connection closed by remote" error message. Why? That's a good question and we are trying to find a good answer in :issue:`636`. Why am I seeing idle borg serve processes on the repo server? ------------------------------------------------------------- Maybe the ssh connection between client and server broke down and that was not yet noticed on the server. Try these settings: :: # /etc/ssh/sshd_config on borg repo server - kill connection to client # after ClientAliveCountMax * ClientAliveInterval seconds with no response ClientAliveInterval 20 ClientAliveCountMax 3 If you have multiple borg create ... ; borg create ... commands in a already serialized way in a single script, you need to give them ``--lock-wait N`` (with N being a bit more than the time the server needs to terminate broken down connections and release the lock). .. _disable_archive_chunks: The borg cache eats way too much disk space, what can I do? ----------------------------------------------------------- This may especially happen if borg needs to rebuild the local "chunks" index - either because it was removed, or because it was not coherent with the repository state any more (e.g. because another borg instance changed the repository). To optimize this rebuild process, borg caches per-archive information in the ``chunks.archive.d/`` directory. It won't help the first time it happens, but it will make the subsequent rebuilds faster (because it needs to transfer less data from the repository). While being faster, the cache needs quite some disk space, which might be unwanted. There is a temporary (but maybe long lived) hack to avoid using lots of disk space for chunks.archive.d (see :issue:`235` for details): :: # this assumes you are working with the same user as the backup. cd ~/.cache/borg/$(borg config /path/to/repo id) rm -rf chunks.archive.d ; touch chunks.archive.d This deletes all the cached archive chunk indexes and replaces the directory that kept them with a file, so borg won't be able to store anything "in" there in future. This has some pros and cons, though: - much less disk space needs for ~/.cache/borg. - chunk cache resyncs will be slower as it will have to transfer chunk usage metadata for all archives from the repository (which might be slow if your repo connection is slow) and it will also have to build the hashtables from that data. chunk cache resyncs happen e.g. if your repo was written to by another machine (if you share same backup repo between multiple machines) or if your local chunks cache was lost somehow. The long term plan to improve this is called "borgception", see :issue:`474`. Can I backup my root partition (/) with Borg? --------------------------------------------- Backing up your entire root partition works just fine, but remember to exclude directories that make no sense to backup, such as /dev, /proc, /sys, /tmp and /run, and to use ``--one-file-system`` if you only want to backup the root partition (and not any mounted devices e.g.). If it crashes with a UnicodeError, what can I do? ------------------------------------------------- Check if your encoding is set correctly. For most POSIX-like systems, try:: export LANG=en_US.UTF-8 # or similar, important is correct charset If that does not help: - check for typos, check if you really used ``export``. - check if you have set ``LC_ALL`` - if so, try not setting it. - check if you generated the respective locale via ``locale-gen``. I can't extract non-ascii filenames by giving them on the commandline!? ----------------------------------------------------------------------- This might be due to different ways to represent some characters in unicode or due to other non-ascii encoding issues. If you run into that, try this: - avoid the non-ascii characters on the commandline by e.g. extracting the parent directory (or even everything) - mount the repo using FUSE and use some file manager .. _expected_performance: What's the expected backup performance? --------------------------------------- A first backup will usually be somehow "slow" because there is a lot of data to process. Performance here depends on a lot of factors, so it is hard to give specific numbers. Subsequent backups are usually very fast if most files are unchanged and only a few are new or modified. The high performance on unchanged files primarily depends only on a few factors (like fs recursion + metadata reading performance and the files cache working as expected) and much less on other factors. E.g., for this setup: - server grade machine (4C/8T 2013 Xeon, 64GB RAM, 2x good 7200RPM disks) - local zfs filesystem (mirrored) containing the backup source data - repository is remote (does not matter much for unchanged files) - backup job runs while machine is otherwise idle The observed performance is that Borg can process about **1 million unchanged files (and a few small changed ones) in 4 minutes!** If you are seeing much less than that in similar circumstances, read the next few FAQ entries below. .. _slow_backup: Why is backup slow for me? -------------------------- So, if you feel your Borg backup is too slow somehow, you should find out why. The usual way to approach this is to add ``--list --filter=AME --stats`` to your ``borg create`` call to produce more log output, including a file list (with file status characters) and also some statistics at the end of the backup. Then you do the backup and look at the log output: - stats: Do you really have little changes or are there more changes than you thought? In the stats you can see the overall volume of changed data, which needed to be added to the repo. If that is a lot, that can be the reason why it is slow. - ``A`` status ("added") in the file list: If you see that often, you have a lot of new files (files that Borg did not find in the files cache). If you think there is something wrong with that (the file was there already in the previous backup), please read the FAQ entries below. - ``M`` status ("modified") in the file list: If you see that often, Borg thinks that a lot of your files might be modified (Borg found them in the files cache, but the metadata read from the filesystem did not match the metadata stored in the files cache). In such a case, Borg will need to process the files' contents completely, which is much slower than processing unmodified files (Borg does not read their contents!). The metadata values used in this comparison are determined by the ``--files-cache`` option and could be e.g. size, ctime and inode number (see the ``borg create`` docs for more details and potential issues). You can use the ``stat`` command on files to manually look at fs metadata to debug if there is any unexpected change triggering the ``M`` status. Also, the ``--debug-topic=files_cache`` option of ``borg create`` provides a lot of debug output helping to analyse why the files cache does not give its expected high performance. When borg runs inside a virtual machine, there are some more things to look at: Some hypervisors (e.g. kvm on proxmox) give some broadly compatible CPU type to the VM (usually to ease migration between VM hosts of potentially different hardware CPUs). It is broadly compatible because they leave away modern CPU features that could be not present in older or other CPUs, e.g. hardware acceleration for AES crypto, for sha2 hashes, for (P)CLMUL(QDQ) computations useful for crc32. So, basically you pay for compatibility with bad performance. If you prefer better performance, you should try to expose the host CPU's misc. hw acceleration features to the VM which runs borg. On Linux, check ``/proc/cpuinfo`` for the CPU flags inside the VM. For kvm check the docs about "Host model" and "Host passthrough". See also the next few FAQ entries for more details. .. _a_status_oddity: I am seeing 'A' (added) status for an unchanged file!? ------------------------------------------------------ The files cache is used to determine whether Borg already "knows" / has backed up a file and if so, to skip the file from chunking. It intentionally *excludes* files that have a timestamp which is the same as the newest timestamp in the created archive. So, if you see an 'A' status for unchanged file(s), they are likely the files with the most recent timestamp in that archive. This is expected: it is to avoid data loss with files that are backed up from a snapshot and that are immediately changed after the snapshot (but within timestamp granularity time, so the timestamp would not change). Without the code that removes these files from the files cache, the change that happened right after the snapshot would not be contained in the next backup as Borg would think the file is unchanged. This does not affect deduplication, the file will be chunked, but as the chunks will often be the same and already stored in the repo (except in the above mentioned rare condition), it will just re-use them as usual and not store new data chunks. If you want to avoid unnecessary chunking, just create or touch a small or empty file in your backup source file set (so that one has the latest timestamp, not your 50GB VM disk image) and, if you do snapshots, do the snapshot after that. Since only the files cache is used in the display of files status, those files are reported as being added when, really, chunks are already used. By default, ctime (change time) is used for the timestamps to have a rather safe change detection (see also the --files-cache option). Furthermore, pathnames recorded in files cache are always absolute, even if you specify source directories with relative pathname. If relative pathnames are stable, but absolute are not (for example if you mount a filesystem without stable mount points for each backup or if you are running the backup from a filesystem snapshot whose name is not stable), borg will assume that files are different and will report them as 'added', even though no new chunks will be actually recorded for them. To avoid this, you could bind mount your source directory in a directory with the stable path. .. _always_chunking: It always chunks all my files, even unchanged ones! --------------------------------------------------- Borg maintains a files cache where it remembers the timestamp, size and inode of files. When Borg does a new backup and starts processing a file, it first looks whether the file has changed (compared to the values stored in the files cache). If the values are the same, the file is assumed unchanged and thus its contents won't get chunked (again). Borg can't keep an infinite history of files of course, thus entries in the files cache have a "maximum time to live" which is set via the environment variable BORG_FILES_CACHE_TTL (and defaults to 20). Every time you do a backup (on the same machine, using the same user), the cache entries' ttl values of files that were not "seen" are incremented by 1 and if they reach BORG_FILES_CACHE_TTL, the entry is removed from the cache. So, for example, if you do daily backups of 26 different data sets A, B, C, ..., Z on one machine (using the default TTL), the files from A will be already forgotten when you repeat the same backups on the next day and it will be slow because it would chunk all the files each time. If you set BORG_FILES_CACHE_TTL to at least 26 (or maybe even a small multiple of that), it would be much faster. Besides using a higher BORG_FILES_CACHE_TTL (which also increases memory usage), there is also BORG_FILES_CACHE_SUFFIX which can be used to have separate (smaller) files caches for each backup set instead of the default one (big) unified files cache. Another possible reason is that files don't always have the same path, for example if you mount a filesystem without stable mount points for each backup or if you are running the backup from a filesystem snapshot whose name is not stable. If the directory where you mount a filesystem is different every time, Borg assumes they are different files. This is true even if you backup these files with relative pathnames - borg uses full pathnames in files cache regardless. It is possible for some filesystems, such as ``mergerfs`` or network filesystems, to return inconsistent inode numbers across runs, causing borg to consider them changed. A workaround is to set the option ``--files-cache=ctime,size`` to exclude the inode number comparison from the files cache check so that files with different inode numbers won't be treated as modified. Is there a way to limit bandwidth with Borg? -------------------------------------------- To limit upload (i.e. :ref:`borg_create`) bandwidth, use the ``--remote-ratelimit`` option. There is no built-in way to limit *download* (i.e. :ref:`borg_extract`) bandwidth, but limiting download bandwidth can be accomplished with pipeviewer_: Create a wrapper script: /usr/local/bin/pv-wrapper :: #!/bin/sh ## -q, --quiet do not output any transfer information at all ## -L, --rate-limit RATE limit transfer to RATE bytes per second RATE=307200 pv -q -L $RATE | "$@" Add BORG_RSH environment variable to use pipeviewer wrapper script with ssh. :: export BORG_RSH='/usr/local/bin/pv-wrapper ssh' Now Borg will be bandwidth limited. The nice thing about ``pv`` is that you can change rate-limit on the fly: :: pv -R $(pidof pv) -L 102400 .. _pipeviewer: http://www.ivarch.com/programs/pv.shtml How can I avoid unwanted base directories getting stored into archives? ----------------------------------------------------------------------- Possible use cases: - Another file system is mounted and you want to backup it with original paths. - You have created a BTRFS snapshot in a ``/.snapshots`` directory for backup. To achieve this, run ``borg create`` within the mountpoint/snapshot directory: :: # Example: Some file system mounted in /mnt/rootfs. cd /mnt/rootfs borg create /path/to/repo::rootfs_backup . I am having troubles with some network/FUSE/special filesystem, why? -------------------------------------------------------------------- Borg is doing nothing special in the filesystem, it only uses very common and compatible operations (even the locking is just "rename"). So, if you are encountering issues like slowness, corruption or malfunction when using a specific filesystem, please try if you can reproduce the issues with a local (non-network) and proven filesystem (like ext4 on Linux). If you can't reproduce the issue then, you maybe have found an issue within the filesystem code you used (not with Borg). For this case, it is recommended that you talk to the developers / support of the network fs and maybe open an issue in their issue tracker. Do not file an issue in the Borg issue tracker. If you can reproduce the issue with the proven filesystem, please file an issue in the Borg issue tracker about that. Why does running 'borg check --repair' warn about data loss? ------------------------------------------------------------ Repair usually works for recovering data in a corrupted archive. However, it's impossible to predict all modes of corruption. In some very rare instances, such as malfunctioning storage hardware, additional repo corruption may occur. If you can't afford to lose the repo, it's strongly recommended that you perform repair on a copy of the repo. In other words, the warning is there to emphasize that Borg: - Will perform automated routines that modify your backup repository - Might not actually fix the problem you are experiencing - Might, in very rare cases, further corrupt your repository In the case of malfunctioning hardware, such as a drive or USB hub corrupting data when read or written, it's best to diagnose and fix the cause of the initial corruption before attempting to repair the repo. If the corruption is caused by a one time event such as a power outage, running `borg check --repair` will fix most problems. Why isn't there more progress / ETA information displayed? ---------------------------------------------------------- Some borg runs take quite a bit, so it would be nice to see a progress display, maybe even including a ETA (expected time of "arrival" [here rather "completion"]). For some functionality, this can be done: if the total amount of work is more or less known, we can display progress. So check if there is a ``--progress`` option. But sometimes, the total amount is unknown (e.g. for ``borg create`` we just do a single pass over the filesystem, so we do not know the total file count or data volume before reaching the end). Adding another pass just to determine that would take additional time and could be incorrect, if the filesystem is changing. Even if the fs does not change and we knew count and size of all files, we still could not compute the ``borg create`` ETA as we do not know the amount of changed chunks, how the bandwidth of source and destination or system performance might fluctuate. You see, trying to display ETA would be futile. The borg developers prefer to rather not implement progress / ETA display than doing futile attempts. See also: https://xkcd.com/612/ Why am I getting 'Operation not permitted' errors when backing up on sshfs? --------------------------------------------------------------------------- By default, ``sshfs`` is not entirely POSIX-compliant when renaming files due to a technicality in the SFTP protocol. Fortunately, it also provides a workaround_ to make it behave correctly:: sshfs -o workaround=rename user@host:dir /mnt/dir .. _workaround: https://unix.stackexchange.com/a/123236 Can I disable checking for free disk space? ------------------------------------------- In some cases, the free disk space of the target volume is reported incorrectly. This can happen for CIFS- or FUSE shares. If you are sure that your target volume will always have enough disk space, you can use the following workaround to disable checking for free disk space:: borg config -- $REPO_LOCATION additional_free_space -2T How do I rename a repository? ----------------------------- There is nothing special that needs to be done, you can simply rename the directory that corresponds to the repository. However, the next time borg interacts with the repository (i.e, via ``borg list``), depending on the value of ``BORG_RELOCATED_REPO_ACCESS_IS_OK``, borg may warn you that the repository has been moved. You will be given a prompt to confirm you are OK with this. If ``BORG_RELOCATED_REPO_ACCESS_IS_OK`` is unset, borg will interactively ask for each repository whether it's OK. It may be useful to set ``BORG_RELOCATED_REPO_ACCESS_IS_OK=yes`` to avoid the prompts when renaming multiple repositories or in a non-interactive context such as a script. See :doc:`deployment` for an example. The repository quota size is reached, what can I do? ---------------------------------------------------- The simplest solution is to increase or disable the quota and resume the backup: :: borg config /path/to/repo storage_quota 0 If you are bound to the quota, you have to free repository space. The first to try is running :ref:`borg_compact` to free unused backup space (see also :ref:`separate_compaction`): :: borg compact /path/to/repo If your repository is already compacted, run :ref:`borg_prune` or :ref:`borg_delete` to delete archives that you do not need anymore, and then run ``borg compact`` again. My backup disk is full, what can I do? -------------------------------------- Borg cannot work if you really have zero free space on the backup disk, so the first thing you must do is deleting some files to regain free disk space. See :ref:`about_free_space` for further details. Some Borg commands that do not change the repository might work under disk-full conditions, but generally this should be avoided. If your backup disk is already full when Borg starts a write command like `borg create`, it will abort immediately and the repository will stay as-is. If you run a backup that stops due to a disk running full, Borg will roll back, delete the new new segment file and thus freeing disk space automatically. There may be a checkpoint archive left that has been saved before the disk got full. You can keep it to speed up the next backup or delete it to get back more disk space. Miscellaneous ############# macOS: borg mounts not shown in Finder's side bar ------------------------------------------------- https://github.com/osxfuse/osxfuse/wiki/Mount-options#local Read the above first and use this on your own risk:: borg mount -olocal REPO MOUNTPOINT Requirements for the borg single-file binary, esp. (g)libc? ----------------------------------------------------------- We try to build the binary on old, but still supported systems - to keep the minimum requirement for the (g)libc low. The (g)libc can't be bundled into the binary as it needs to fit your kernel and OS, but Python and all other required libraries will be bundled into the binary. If your system fulfills the minimum (g)libc requirement (see the README that is released with the binary), there should be no problem. If you are slightly below the required version, maybe just try. Due to the dynamic loading (or not loading) of some shared libraries, it might still work depending on what libraries are actually loaded and used. In the borg git repository, there is scripts/glibc_check.py that can determine (based on the symbols' versions they want to link to) whether a set of given (Linux) binaries works with a given glibc version. Why was Borg forked from Attic? ------------------------------- Borg was created in May 2015 in response to the difficulty of getting new code or larger changes incorporated into Attic and establishing a bigger developer community / more open development. More details can be found in `ticket 217 `_ that led to the fork. Borg intends to be: * simple: * as simple as possible, but no simpler * do the right thing by default, but offer options * open: * welcome feature requests * accept pull requests of good quality and coding style * give feedback on PRs that can't be accepted "as is" * discuss openly, don't work in the dark * changing: * Borg is not compatible with Attic * do not break compatibility accidentally, without a good reason or without warning. allow compatibility breaking for other cases. * if major version number changes, it may have incompatible changes Migrating from Attic #################### What are the differences between Attic and Borg? ------------------------------------------------ Borg is a fork of `Attic`_ and maintained by "`The Borg collective`_". .. _Attic: https://github.com/jborg/attic .. _The Borg collective: https://borgbackup.readthedocs.org/en/latest/authors.html Here's a (incomplete) list of some major changes: * lots of attic issues fixed (see `issue #5 `_), including critical data corruption bugs and security issues. * more open, faster paced development (see `issue #1 `_) * less chunk management overhead (less memory and disk usage for chunks index) * faster remote cache resync (useful when backing up multiple machines into same repo) * compression: no, lz4, zstd, zlib or lzma compression, adjustable compression levels * repokey replaces problematic passphrase mode (you can't change the passphrase nor the pbkdf2 iteration count in "passphrase" mode) * simple sparse file support, great for virtual machine disk files * can read special files (e.g. block devices) or from stdin, write to stdout * rename-based locking is more compatible than attic's posix locking * uses fadvise to not spoil / blow up the fs cache * better error messages / exception handling * better logging, screen output, progress indication * tested on misc. Linux systems, 32 and 64bit, FreeBSD, OpenBSD, NetBSD, macOS Please read the :ref:`changelog` (or ``docs/changes.rst`` in the source distribution) for more information. Borg is not compatible with original Attic (but there is a one-way conversion). How do I migrate from Attic to Borg? ------------------------------------ Use :ref:`borg_upgrade`. This is a one-way process that cannot be reversed. There are some caveats: - The upgrade can only be performed on local repositories. It cannot be performed on remote repositories. - If the repository is in "keyfile" encryption mode, the keyfile must exist locally or it must be manually moved after performing the upgrade: 1. Get the repository ID with ``borg config /path/to/repo id``. 2. Locate the attic key file at ``~/.attic/keys/``. The correct key for the repository starts with the line ``ATTIC_KEY ``. 3. Copy the attic key file to ``~/.config/borg/keys/`` 4. Change the first line from ``ATTIC_KEY ...`` to ``BORG_KEY ...``. 5. Verify that the repository is now accessible (e.g. ``borg list ``). - Attic and Borg use different :ref:`"chunker params" `. This means that data added by Borg won't deduplicate with the existing data stored by Attic. The effect is lessened if the files cache is used with Borg. - Repositories in "passphrase" mode *must* be migrated to "repokey" mode using :ref:`borg_key_migrate-to-repokey`. Borg does not support the "passphrase" mode any other way. Why is my backup bigger than with attic? ---------------------------------------- Attic was rather unflexible when it comes to compression, it always compressed using zlib level 6 (no way to switch compression off or adjust the level or algorithm). The default in Borg is lz4, which is fast enough to not use significant CPU time in most cases, but can only achieve modest compression. It still compresses easily compressed data fairly well. Borg also offers zstd, zlib and lzma compression, choose wisely. Which choice is the best option depends on a number of factors, like bandwidth to the repository, how well the data compresses, available CPU power and so on. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/global.rst.inc0000644000076500000240000000306414641074756015723 0ustar00twstaff.. highlight:: bash .. |package_dirname| replace:: borgbackup-|version| .. |package_filename| replace:: |package_dirname|.tar.gz .. |package_url| replace:: https://pypi.python.org/packages/source/b/borgbackup/|package_filename| .. |git_url| replace:: https://github.com/borgbackup/borg.git .. _github: https://github.com/borgbackup/borg .. _issue tracker: https://github.com/borgbackup/borg/issues .. _deduplication: https://en.wikipedia.org/wiki/Data_deduplication .. _AES: https://en.wikipedia.org/wiki/Advanced_Encryption_Standard .. _HMAC-SHA256: https://en.wikipedia.org/wiki/HMAC .. _SHA256: https://en.wikipedia.org/wiki/SHA-256 .. _PBKDF2: https://en.wikipedia.org/wiki/PBKDF2 .. _ACL: https://en.wikipedia.org/wiki/Access_control_list .. _libacl: https://savannah.nongnu.org/projects/acl/ .. _libattr: https://savannah.nongnu.org/projects/attr/ .. _liblz4: https://github.com/Cyan4973/lz4 .. _libzstd: https://github.com/facebook/zstd .. _OpenSSL: https://www.openssl.org/ .. _`Python 3`: https://www.python.org/ .. _Buzhash: https://en.wikipedia.org/wiki/Buzhash .. _msgpack: https://msgpack.org/ .. _`msgpack-python`: https://pypi.python.org/pypi/msgpack-python/ .. _llfuse: https://pypi.python.org/pypi/llfuse/ .. _pyfuse3: https://pypi.python.org/pypi/pyfuse3/ .. _userspace filesystems: https://en.wikipedia.org/wiki/Filesystem_in_Userspace .. _Cython: http://cython.org/ .. _virtualenv: https://pypi.python.org/pypi/virtualenv/ .. _mailing list discussion about internals: http://librelist.com/browser/attic/2014/5/6/questions-and-suggestions-about-inner-working-of-attic> ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/index.rst0000644000076500000240000000052114641074756015015 0ustar00twstaff.. include:: global.rst.inc .. highlight:: none Borg Documentation ================== .. include:: ../README.rst .. when you add an element here, do not forget to add it to book.rst .. toctree:: :maxdepth: 2 installation quickstart usage deployment faq support changes internals development authors ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/installation.rst0000644000076500000240000004053214641074756016415 0ustar00twstaff.. include:: global.rst.inc .. highlight:: bash .. _installation: Installation ============ There are different ways to install Borg: - :ref:`distribution-package` - easy and fast if a package is available from your distribution. - :ref:`pyinstaller-binary` - easy and fast, we provide a ready-to-use binary file that comes bundled with all dependencies. - :ref:`source-install`, either: - :ref:`pip-installation` - installing a source package with pip needs more installation steps and requires all dependencies with development headers and a compiler. - :ref:`git-installation` - for developers and power users who want to have the latest code or use revision control (each release is tagged). .. _distribution-package: Distribution Package -------------------- Some distributions might offer a ready-to-use ``borgbackup`` package which can be installed with the package manager. .. important:: Those packages may not be up to date with the latest Borg releases. Before submitting a bug report, check the package version and compare that to our latest release then review :doc:`changes` to see if the bug has been fixed. Report bugs to the package maintainer rather than directly to Borg if the package is out of date in the distribution. .. keep this list in alphabetical order ============ ============================================= ======= Distribution Source Command ============ ============================================= ======= Alpine Linux `Alpine repository`_ ``apk add borgbackup`` Arch Linux `[extra]`_ ``pacman -S borg`` Debian `Debian packages`_ ``apt install borgbackup`` Gentoo `ebuild`_ ``emerge borgbackup`` GNU Guix `GNU Guix`_ ``guix package --install borg`` Fedora/RHEL `Fedora official repository`_ ``dnf install borgbackup`` FreeBSD `FreeBSD ports`_ ``cd /usr/ports/archivers/py-borgbackup && make install clean`` macOS `Homebrew`_ | ``brew install borgbackup`` (official formula, **no** FUSE support) | **or** | ``brew install --cask macfuse`` (`private Tap`_, FUSE support) | ``brew install borgbackup/tap/borgbackup-fuse`` Mageia `cauldron`_ ``urpmi borgbackup`` NetBSD `pkgsrc`_ ``pkg_add py-borgbackup`` NixOS `.nix file`_ ``nix-env -i borgbackup`` OpenBSD `OpenBSD ports`_ ``pkg_add borgbackup`` OpenIndiana `OpenIndiana hipster repository`_ ``pkg install borg`` openSUSE `openSUSE official repository`_ ``zypper in borgbackup`` Raspbian `Raspbian testing`_ ``apt install borgbackup`` Ubuntu `Ubuntu packages`_, `Ubuntu PPA`_ ``apt install borgbackup`` ============ ============================================= ======= .. _Alpine repository: https://pkgs.alpinelinux.org/packages?name=borgbackup .. _[extra]: https://www.archlinux.org/packages/?name=borg .. _Debian packages: https://packages.debian.org/search?keywords=borgbackup&searchon=names&exact=1&suite=all§ion=all .. _Fedora official repository: https://packages.fedoraproject.org/pkgs/borgbackup/borgbackup/ .. _FreeBSD ports: https://www.freshports.org/archivers/py-borgbackup/ .. _ebuild: https://packages.gentoo.org/packages/app-backup/borgbackup .. _GNU Guix: https://www.gnu.org/software/guix/package-list.html#borg .. _pkgsrc: http://pkgsrc.se/sysutils/py-borgbackup .. _cauldron: http://madb.mageia.org/package/show/application/0/release/cauldron/name/borgbackup .. _.nix file: https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/backup/borgbackup/default.nix .. _OpenBSD ports: https://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/sysutils/borgbackup/ .. _OpenIndiana hipster repository: https://pkg.openindiana.org/hipster/en/search.shtml?token=borg&action=Search .. _openSUSE official repository: https://software.opensuse.org/package/borgbackup .. _Homebrew: https://formulae.brew.sh/formula/borgbackup .. _private Tap: https://github.com/borgbackup/homebrew-tap .. _Raspbian testing: https://archive.raspbian.org/raspbian/pool/main/b/borgbackup/ .. _Ubuntu packages: https://launchpad.net/ubuntu/+source/borgbackup .. _Ubuntu PPA: https://launchpad.net/~costamagnagianfranco/+archive/ubuntu/borgbackup Please ask package maintainers to build a package or, if you can package / submit it yourself, please help us with that! See :issue:`105` on github to followup on packaging efforts. **Current status of package in the repositories** .. start-badges |Packaging status| .. |Packaging status| image:: https://repology.org/badge/vertical-allrepos/borgbackup.svg :alt: Packaging status :target: https://repology.org/project/borgbackup/versions .. end-badges .. _pyinstaller-binary: Standalone Binary ----------------- .. note:: Releases are signed with an OpenPGP key, see :ref:`security-contact` for more instructions. Borg x86-64 amd/intel compatible binaries (generated with `pyinstaller`_) are available on the releases_ page for the following platforms (for more details see the ``00_README.txt`` file there): * Linux * FreeBSD * MacOS ARM binaries are built by Johann Bauer, see: https://borg.bauerj.eu/ To install such a binary, just drop it into a directory in your ``PATH``, make borg readable and executable for its users and then you can run ``borg``:: sudo cp borg-linux /usr/local/bin/borg sudo chown root:root /usr/local/bin/borg sudo chmod 755 /usr/local/bin/borg Optionally you can create a symlink to have ``borgfs`` available, which is an alias for ``borg mount``:: ln -s /usr/local/bin/borg /usr/local/bin/borgfs Note that the binary uses /tmp to unpack Borg with all dependencies. It will fail if /tmp has not enough free space or is mounted with the ``noexec`` option. You can change the temporary directory by setting the ``TEMP`` environment variable before running Borg. If a new version is released, you will have to manually download it and replace the old version using the same steps as shown above. .. _pyinstaller: http://www.pyinstaller.org .. _releases: https://github.com/borgbackup/borg/releases .. _source-install: From Source ----------- .. note:: Some older Linux systems (like RHEL/CentOS 5) and Python interpreter binaries compiled to be able to run on such systems (like Python installed via Anaconda) might miss functions required by Borg. This issue will be detected early and Borg will abort with a fatal error. Dependencies ~~~~~~~~~~~~ To install Borg from a source package (including pip), you have to install the following dependencies first: * `Python 3`_ >= 3.9.0, plus development headers. * OpenSSL_ >= 1.0.0, plus development headers. * libacl_ (which depends on libattr_), both plus development headers. * We have bundled code of the following packages, but borg by default (see setup.py if you want to change that) prefers a shared library if it can be found on the system (lib + dev headers) at build time: - liblz4_ >= 1.7.0 (r129) - libzstd_ >= 1.3.0 - libxxhash >= 0.8.1 (0.8.0 might work also) * pkg-config (cli tool) and pkgconfig python package (borg uses these to discover header and library location - if it can't import pkgconfig and is not pointed to header/library locations via env vars [see setup.py], it will fall back to using the bundled code, see above). **These must be present before invoking setup.py!** * some other Python dependencies, pip will automatically install them for you. * optionally, if you wish to mount an archive as a FUSE filesystem, you need a FUSE implementation for Python: - Either pyfuse3_ (preferably, newer and maintained) or llfuse_ (older, unmaintained now). See also the BORG_FUSE_IMPL env variable. - See pyproject.toml about the version requirements. If you have troubles finding the right package names, have a look at the distribution specific sections below or the Vagrantfile in the git repository, which contains installation scripts for a number of operating systems. In the following, the steps needed to install the dependencies are listed for a selection of platforms. If your distribution is not covered by these instructions, try to use your package manager to install the dependencies. On FreeBSD, you may need to get a recent enough OpenSSL version from FreeBSD ports. After you have installed the dependencies, you can proceed with steps outlined under :ref:`pip-installation`. Debian / Ubuntu +++++++++++++++ Install the dependencies with development headers:: sudo apt-get install python3 python3-dev python3-pip python3-virtualenv \ libacl1-dev libacl1 \ libssl-dev \ liblz4-dev libzstd-dev libxxhash-dev \ build-essential \ pkg-config python3-pkgconfig sudo apt-get install libfuse-dev fuse # needed for llfuse sudo apt-get install libfuse3-dev fuse3 # needed for pyfuse3 In case you get complaints about permission denied on ``/etc/fuse.conf``: on Ubuntu this means your user is not in the ``fuse`` group. Add yourself to that group, log out and log in again. Fedora ++++++ Install the dependencies with development headers:: sudo dnf install python3 python3-devel python3-pip python3-virtualenv \ libacl-devel libacl \ openssl-devel \ lz4-devel libzstd-devel xxhash-devel \ pkgconf python3-pkgconfig sudo dnf install gcc gcc-c++ redhat-rpm-config sudo dnf install fuse-devel fuse # needed for llfuse sudo dnf install fuse3-devel fuse3 # needed for pyfuse3 openSUSE Tumbleweed / Leap ++++++++++++++++++++++++++ Install the dependencies automatically using zypper:: sudo zypper source-install --build-deps-only borgbackup Alternatively, you can enumerate all build dependencies in the command line:: sudo zypper install python3 python3-devel \ libacl-devel openssl-devel \ libxxhash-devel \ python3-Cython python3-Sphinx python3-msgpack-python python3-pkgconfig pkgconf \ python3-pytest python3-setuptools python3-setuptools_scm \ python3-sphinx_rtd_theme gcc gcc-c++ sudo zypper install python3-llfuse # llfuse macOS +++++ When installing borgbackup via Homebrew_, the basic dependencies are installed automatically. For FUSE support to mount the backup archives, you need macFUSE, which is available via `github `__, or Homebrew:: brew install --cask macfuse When installing Borg via ``pip``, be sure to install the ``llfuse`` extra, since macFUSE only supports FUSE API v2. Also, since Homebrew won't link the installed ``openssl`` formula, point pkg-config to the correct path:: PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig" pip install borgbackup[llfuse] When working from a borg git repo workdir, you can install dependencies using the Brewfile:: brew install python@3.11 # can be any supported python3 version brew bundle install # install requirements from borg repo's ./Brewfile pip3 install virtualenv pkgconfig Be aware that for all recent macOS releases you must authorize full disk access. It is no longer sufficient to run borg backups as root. If you have not yet granted full disk access, and you run Borg backup from cron, you will see messages such as:: /Users/you/Pictures/Photos Library.photoslibrary: scandir: [Errno 1] Operation not permitted: To fix this problem, you should grant full disk access to cron, and to your Terminal application. More information `can be found here `__. FreeBSD ++++++++ Listed below are packages you will need to install Borg, its dependencies, and commands to make FUSE work for using the mount command. :: pkg install -y python3 pkgconf pkg install openssl pkg install liblz4 zstd xxhash pkg install fusefs-libs # needed for llfuse pkg install -y git python3 -m ensurepip # to install pip for Python3 To use the mount command: echo 'fuse_load="YES"' >> /boot/loader.conf echo 'vfs.usermount=1' >> /etc/sysctl.conf kldload fuse sysctl vfs.usermount=1 Windows 10's Linux Subsystem ++++++++++++++++++++++++++++ .. note:: Running under Windows 10's Linux Subsystem is experimental and has not been tested much yet. Just follow the Ubuntu Linux installation steps. You can omit the FUSE stuff, it won't work anyway. Cygwin ++++++ .. note:: Running under Cygwin is experimental and has not been tested much yet. Use the Cygwin installer to install the dependencies:: python39 python39-devel python39-pkgconfig python39-setuptools python39-pip python39-wheel python39-virtualenv libssl-devel libxxhash-devel liblz4-devel libzstd-devel binutils gcc-g++ git make openssh .. _pip-installation: Using pip ~~~~~~~~~ Ensure to install the dependencies as described within :ref:`source-install`. Virtualenv_ can be used to build and install Borg without affecting the system Python or requiring root access. Using a virtual environment is optional, but recommended except for the most simple use cases. .. note:: If you install into a virtual environment, you need to **activate** it first (``source borg-env/bin/activate``), before running ``borg``. Alternatively, symlink ``borg-env/bin/borg`` into some directory that is in your ``PATH`` so you can just run ``borg``. This will use ``pip`` to install the latest release from PyPi:: virtualenv --python=python3 borg-env source borg-env/bin/activate # might be required if your tools are outdated pip install -U pip setuptools wheel # pkgconfig MUST be available before borg is installed! pip install pkgconfig # install Borg + Python dependencies into virtualenv pip install borgbackup # or alternatively (if you want FUSE support): pip install borgbackup[llfuse] # to use llfuse pip install borgbackup[pyfuse3] # to use pyfuse3 To upgrade Borg to a new version later, run the following after activating your virtual environment:: pip install -U borgbackup # or ... borgbackup[llfuse/pyfuse3] When doing manual pip installation, man pages are not automatically installed. You can run these commands to install the man pages locally:: # get borg from github git clone https://github.com/borgbackup/borg.git borg # Install the files with proper permissions install -D -m 0644 borg/docs/man/borg*.1* $HOME/.local/share/man/man1/borg.1 # Update the man page cache mandb .. _git-installation: Using git ~~~~~~~~~ Ensure to install the dependencies as described within :ref:`source-install`. This uses latest, unreleased development code from git. While we try not to break master, there are no guarantees on anything. :: # get borg from github git clone https://github.com/borgbackup/borg.git # create a virtual environment virtualenv --python=$(which python3) borg-env source borg-env/bin/activate # always before using! # install borg + dependencies into virtualenv cd borg pip install -r requirements.d/development.txt pip install -r requirements.d/docs.txt # optional, to build the docs pip install -e . # in-place editable mode or pip install -e .[pyfuse3] # in-place editable mode, use pyfuse3 or pip install -e .[llfuse] # in-place editable mode, use llfuse # optional: run all the tests, on all installed Python versions # requires fakeroot, available through your package manager fakeroot -u tox --skip-missing-interpreters By default the system installation of python will be used. If you need to use a different version of Python you can install this using ``pyenv``: :: ... # create a virtual environment pyenv install 3.9.0 # minimum, preferably use something more recent! pyenv global 3.9.0 pyenv local 3.9.0 virtualenv --python=${pyenv which python} borg-env source borg-env/bin/activate # always before using! ... .. note:: As a developer or power user, you always want to use a virtual environment. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719958149.7650337 borgbackup-1.4.0/docs/internals/0000755000076500000240000000000014641075206015144 5ustar00twstaff././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/internals/compaction.png0000644000076500000240000275146214641074756020040 0ustar00twstaffPNG  IHDRp)OQgAMA a cHRMz&u0`:pQ< pHYs\F\FCAtIME #~wFbKGD !IDATx U%AfJ"J4ϥ$hBe*SIAeBfHI|}:nweg?swkkEd2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&S>˗G_~e4whٲeѼy={Fs̉sѷ~kd2L&d2L&d2J6l~Ǩvؾф |{'}F|I4}tv}]8d2L&d2L&dmYGo~ѫ[v^{Ϳ/x7ߌ6n;6ꫯL&d2L&d2L&Sno?xHۣGhݺuG >_ԿKXg}ݨI&;-ZGN8.d2L&d2L&d2冈:uj$`_]tEN)xq6f̘N۶m͚5+СC4yd~ɝk2L&d2L&d2L)/8p`ǚ5kUn9sJ*xA ,(z6lذ￷i2L&d2L&d2L9^z plꪫ\ʕg9WZ5wyyVZ0~R[*l2L&.3fvw}7… e˖1iҤRYF/S G@k;omAk;7.z79lG^L,YyGׅ&~-X ݾ2'kڴiޢ4 ۴inMW\q V Li{_0a5L&iV:E>>A?=þ1?T OQFN:EzG{lTlOsoV+xҷoX޽Yֳg?W=t{nݻ۵CZ^bOڿqǥ qqH?soꫯ4ǿZWM]v~֬e+oߠ?k;]ߠ_f-_x=i-L >#/EWkkw;>D/]FyQnݢf͚uff|v>Ow&MVc_?ξd2v=.] ,Yҿψ)⧱l޼9<~`F @%:QSޣi|,ӾbeHc(o2ǓG>lSOZ*b 3#޴Ç?_@;vb4 r,yGBt?i=ZMv'ע{m?0[u[m;^՟'8Ik;MnѢ{mZ[+kk~|˖-h־})|>LY.hJev=I;MmOWltzFяϟ?C/NGW<% S?-V7n֬Y~&d2{e8<`}OHꫯz U>? |Engh٣O7mp-d2v *UVd/~NQ/x3xwС2@u)Dc@Xv4/Sexf7ns=> ~Qݺuvk}.b{D 푃L?n>Ӕ#fV\\F'MLjy 0it P|z{|>nzypXuZ%JDGqDeZ7~k#O=a@Anհ֬I7apwϥJUvTR'Sr?wּ|5ky͍xXp֒ҲVɼO?="UŊ' ZyQ"E81jlKp@?)?h:+9qTq qZ .kʏ 4 )ǧYвN6|4/Q\5L&SQr*bSSTo6[#AbDr{[T, />߷_x!"so=RJ34]|e_={+T* J{ItJPC@pCZ{:AߕWmJ/1Lz`.J|ݶ=#YS%kr7Q1M?KOf`Z^ ֺ\oSk q"'܇5j8ݗ*Jwź%M&dʷx4 [P@uR5=ϊtGƽHz({8>x\ysHuu@8*M{ٳeڲNyuk^ TF=ܩ(~q@wV8F`⒣Wwh$IVXxک?+hE7g$. n&S^xrK.0rS|IoS\~vRhA(MM} .F"OQĩs"D}ʸ/rW, pѳwSJ$-M1/Rj4#p?Ӭ Vh=_rM&dwZpOK ]ve81U/ |*JzeޯJsN9lKs1,{91i)>jD5B 8׿調kR>ʳ{4R/"io8QNQ'I8 竕A]\rNNT7F~[|H*j 5kpMpY3kHSLwGE=i3e([4|(RY+^4bĈ))9܆gNQwHk2L&S"%q$|M? r8 )}|`t^WdO ymdך5&֬5Yf?4muҺ9##]BTlߚ8h6X}[\u#p?grZ d2K-X\=p&NRw7Nׯ_KoVSLi(/BUm_͚5+(JMEUE҃i92&%_ߤ*Pm8- cY"}j*GiQ-;~\OM֢8Pޠe;Rڅ$g߿y?/s#r %~ݷހ3fEp Zfdך5~M%3Twm{SLԴi*.zWqFQdVWA=W^ig r7xxn&dʗZ|y4gΜh˖-<|NiVQ)UBeAޢ~yE>DuOCr }D\;[6 .X`5DurT>f .-}LK496UN8ϔwNK$sUwF{j@jj ?.@=ezGJP_0xSo-U'bާP.ʯ@8`pԦ=(\. 5kpMpY3kJOQfŨ20O:9ZUXӯg7.W9RuR(֮]uC#d2LJL}yEU ߬䋍(F뮻R+ǫjTvm'`;@6l[ xtEF~t% Bb@UZ#弍q#H06RWAW~:uDSNeJ߾=D/RQ׈ ZZ(rFu5R%X?B^Xܷŋ`4 gώedך5&֬5eqI3Qu4cȡF4. o%7j n\efի*fg-yp/њL&)iʕ>B)bLPTw@hLS2Dt}~"(;;vB N[_E),Æ bb"xcJS2L@T@-gT,FDC>+eBL9v} k6FW e|㖴 ǯ_O?%On(t Te)7ʰ1hq(`6tP&֬5f)C;SA-jTJ?W_ttWtufoPn\(T&R)T Km5L&S0ѢE_~'[>ZU|C7eɓ}FIa@j붝mSI}*)Zhh]E{zت/F.e`/b?#ժ6 mۼys+q[R+W?3^8)ł/aߔ^`K,2pD Z3kdך\&3g>}~FC(YY  ,U?ܟ~)-\Aۍ7zk2L&SѸD.]4!UADCDR K':N\DzK,U>#f88̌J/*Z8^ qLq.^o7l\R3uL6!<Fd0yF/"njAI|+[ qw|H5jI3xAS$AǃpB.ξ uTgωt;V U)r2piGo\|d N6 &pArSJ{CGQoA E# .0h /k< Z3Ea_J)S(xgk"  u{Ȍ miHvY,eNAEZ|q癊 g1>_92Es8ҨQqT<g,Bp; A #jjUVn7cѣ#fqф Lda4F jAl"Iߚ;ޞ`),|52Ag6h{̬ף_qtG=קٯ=UP@'i,IcƟ\JP p,R&dڭ@|g=y @G-=:@mӦMKD.BQ>QGUsHd]HUUPN63t~D.aATi5>ӽn|H㐒"쏨f}yӬSV tHpv*3DCBxLyEZIhJ$ZN 7p1<xE 5{x=!:)Pcك~d;,pχ@:Ӊ\A_|qOEZ\MHUl:@GZR3(d`=3S>b vRa+|'<p}o h7ldܿܣT~8 v,^ΝXca`_?<ߚ;ŋmN=P3^t 2 6>0vȎ6g-d|yA^w apM&d]1OtvQ HD:]ԠmD]":%Swjt Ln_+N.)Pt\h8!jG58Ao`0TX;Sl#@ex7n.q`: 8㈥D^࠳=~#p\pP,#XF -o\_r;>ԍ;U ;Tp>,a&r>}A4/}\?RCo H|;%Y8gX~>!<ؖd@oo?_,˴+t)׭[. oCJ:QϠ0Ž31rG>g{ -y ̿/c )‰-^nX%^l< JIvʖ-T\!52-"–  Ǟ{@1eЖp?]8fY+F{2ŲZ(75hS w3۝H?O_2"g־ж,O)ڬctLtʹq=-~aq( -&!f `#a|(p5wojW;Ƞf b/>hsL#ày;RxykٱkP=|kթk߹{vL',psj*X:}kpkw 5Hta=}8_5os|p1?J`7sMj\\UQUukjs)x;.nI\to~k@pٰKET8vmo+{NvC)6ϻ_4W8q^@>?X6E?dggPBl`lU :fKrKm+;WO =,p) JNTG /Cmֵ݃K\&d2v 9ǀl*l p%JprҗjDYElsTȹ-#P^ۓTy$)* F19 tX,mp<3QS/RFG"р ŀ"[ҲtIQ]Np THڬ(0:l -RDC%K&{챇ӹ*h[e˖pz-{{M9\GubC:ޟ}t (N3\`HI_#2{7M 4a@Wi~ r_>GQ]n_L&jNQ{ ="rpޜP(6>R4 vxQ7a#XYYv`knMvGzHs%B{ VpǝxB{Eow1K7ԫs^s=wKm|0q/g#C41_+4f'agD*`"pX\Af?ձ7,/s=~ ?eAl4"wŀb6p Y3&2CC1_hq>?:G`3l,S_ir#^Hfd2L pI@S|MTDYraM8r֗(SM.a@%bʪÉxyhX9zM`"f':@XEv`}E^91")tGԭ[w瀜^q/;;Mw'~5˝^xܕtgV'GW@njq [MF$kwհHsz@9eJ꧜hX8 'O-@Ω2([Dtnn\g6=oN5}Cv"͚{|l΂pұgsdC"do=2![zIz b\0ﺗfJɖ-̝-08kPt/ua> O=ʝYr^DVtwPɔgLtT/⟟nuCJ,Q#vTõP$otg}~{8h?7st :kmxpqwglujgW;͍xKap~=kn .R^9gON#% }_I (PW;WJZ~u8AӗdOG![eWm'.P3*bF"3wޟ`w}5@JmM#.e#o*%Y0߅mvr3S\d2L;1'w"|ϩVK~8?#βF"!D{ r2UMkrD-0NE W@>YWu0n֭[$Hɘ ?A٣xim/ AI@g88 6U/\P4(EGɮ$ [F^S}|9&{!e**'[/PuzWod-`DӎE6& x &")cȍ4UqQ2}g~!M=W1Ew{(.f)t,02^Q XlgƁObe5q@ #+dn\h .s{WrWchϻ=@{Ws[yoh%WWMs{eIϛQgZhpuO1绿В6ᕉ+**{gjynA zA՚׷:ЈvG\ ֹ_[p=}!/p%cGZ V`fPbhD"`+4|]^ j{s$\yoO>l?믿u @Ia3+Hi&c%iOڋ/Ͳ˗/7kd2L&pVǍZ^lU$849y]+'/1G)t"m#"KiD> ZęR fLmc9b0!P/2[" 3qOt-S9b6d؛BD)h QD w>?/YttR\}ދ `947N·g x'ɉ^9 u[N*1SpȃdA>lXkݛ<@)^W-9bYgž8ާM-&wyH1CqÔv݋Ci\˳j+PI3AIsQIkbl/EZh^E)lYg; aG<61e6Dp&2PNƈB=}ǵДܒ䮥(#QJcQkLFYÉ3S{5vcد8)%Gm\rh~>?lXzS7= PyىՏ\Eg{>zw^n0 m)|%t>8wtE9 +0 r4,8+tG sUIIgYl#pyv}\ܴL.%!ۃ]]o}`czq*Px9vldf HVzW[cxF0{BσdI<6B4VYiTgy?0G^#Zq:e/[?Rގfc9&g;Gsx q< |\ܬ ;ݙ.`EM`0%K"X_rb#M^@.Qb9bVY_d?l`]>'իlX(@e0M64@`c̼b6pۑ0D;v\d2L;1Gz[w+R# :>g*DSz+cYMsFߡ;th-ߛ r*Ҫ4p1,;BP(Ru3 TXXx88 -s.Xy:V8LQHRs}tb"0T8f] @Q}=JP,>EU8o9sm>d9dWKî)invN"J7?RΣP<5Ɛ{rk_kzgkzVl6d&+iR p fp)@P'9QB54.Q_D!2)#`1G//}uN/Uz- V;2235j ˠ"Qd]He|)e~bqcNWW`;둮 !slӗ ЙiӵbpN򹧹9+_P-Ļ 3[CNp_*S_ \ReE\?T3 GԎ΂>WZχ)-ZGӲ]rISvOۚkd2L ʡBx汊&mq52) E'V,ٞ>}zbT 60LcH 'dtS\ApK 1ZR*`Bj0׉S>Z lqi&:QϞ= |ɎpݼyssCSp KDq}R;pt H#>S=Fa)2i" N "9>:IM/e^i"̃_H5.pS"ДG/H@X}C[wqǨ eS[طgߥ.)Zs_$RB,#M~Uֽ g if!0HaI ܝ&{ F[mc8$ 21F(W.3=;"caNLI.9nonxI؟)KEϒXϕ9hW3m,׬]E p˹ޝO E$ڊ\$2_U(^II pzVBm%G3\H /Su_@fVeyV0O%r O:ɟF,"~:*9}S>ӴЦ@u(YPWޜ7 <yP' p=;䙤E~+sq<xcʉe^j}[hpSK@9FST %V jx*5||2kp3 `Hr.a&@c RR,UMAKd_ޗ/{FyO@F4d`!\GD6t7̚Р%\7էa0밻\VO).vA피 Fſ.ҔT1O狚e=wJٲjT xEt+_a"R%]ZgO7YqyORX0(%ݖӀ_`>?fv F M[S@,hQRaͤA D<(rn?ld2L\Ɉk)6l8H:e!WTtSXcׅ--??5 ю>h F*a~yq$WPC7Ǭ d 4[LV ,TMQeKd/U SW2ώ(B9U8LЊ-Jdr=6pi܌ӭD(wJ,s4yC1:ݮ:ϕՖrᙃ9iʏ)H'z~?˧&J|~"T |Rm8ѭ{0V&>{*f8Gk-Q-Ͱmu{<p*"QWl0XEu EM~yӔ|Il'Gtx e-ehJu_M-N @0J( ]cG3"xd{Wώe(5a@w}ݚ/!p9 gIŋ 3Y]\o~3/Y{f{&rI>_m<>}`|wx1@93+\+ f b?-J|oDN\,m)6< 90`<BƜIu;tJPsfP K5bk5k2L&i'>Zu4AҟyHs|P48z0/Ot@A81u!_ 0 ,ο"ؐt L'`-ɁG~0%L4F(m (B”>@ Z)l Ȯ817Wx/ĭ͢xԲ @#j;:Y+(khZg߶R\M--p)w%-ΛV8`'r`8Yf;[R*>_߿RGdИ_.٥)Sx-yp̆Jwp!%S"N.urخb[ 5Ol-_^Eaa L$0".Th{焠Ư! \d'- *3F15 Y5q/xQiw) @ **˹+q{0B2/KFlN pЧWLKs p}!4XC:LK.ƾ{[Sz_=DcWщ{*\l`-A}& G)(DדF*?qS7ҵ/Kf~АUG E?`i/ǯ_B̓ ;#͖lkHR:3kd2L&Np}KDr+wCGx**'.W싉XZ*)*W7mZ ͞=*z"]b:8 G.J91r)kM~~5X0V9YȊ9?5@Ɏl< Ĵ4191^-*pZ p |ZAlP4i+K?a:eʑlL~)t:L֦B)?ܴZ ]/<_Owmr1ğ{h8ĵN~y@}g-m[RC޿/rY˧Eڒ%nxV`P\I&e 2PW~;d{G}ޥ+} jI٬> TvJGv c<;T$r'|Jرck:> s6kd2L&Np-JnYl}Jj( 02G`qF']l-"*B;Atq F9-T@& b#;"+a4w\8Ak58pS.}a3 K'Dqt`"D5ȡSm0A>d SǨ'V_?mJ Re& K?5Uy XHb:\7% 弪74C˧.O#%ydo:V+6w\+ƴn8.DvgDm")2?XC\ݻϻuIy͠q f vw fp>Cu:s4]PlOa@ +Knـ( p?j\@B2셽Wzl'i =BDZ6] (XYAٳTľZ|ZG,m3hQ<7 H>q_;7tmz nzM%4rǒ" -););C="f/ތ~l)YIog}ݸL;Zc**$z2q[t_9W>|š.[>FX PW۰qw}\nڴ)pes= Z ˃k ?E|_A\T,ؾ3e*2(6yd}Y-mTf 2XbMER@C>l㔍Q:p L&dI"mWੜX>/+iHy @Z#<d WZW@(%j4`N? \9R$"9xpEYT[*)Y]Q^LIVk5΅\c8v?Z(Q\,b іS1Ht08Ȝ+9p/_*}gXN 5䨣ց8D3mX۽"ClSQ+.%NW~ܡѩ 2mR;%7dQAOx4ܯ?䮨x_؅J]^UdOM -^ʸGYnܚU$ q/r*j>Z(9 8r/"@srkec ؗ@4/Ck*3D,t@FG@vE='`UH߫@:8r,gn"ƍ#A?{YWrW,̀U7Ͻ?c@rʗSpn1镉먴"f#-.QʠhB6 E̲!<ՇWvkˬWg~AYT2hΠ>1鵰Q MO1-t>v?p6UrSXX3ZR%}3 -k>#yuO9Wz~;Ѳe˸eѶ-x6)h"FQ[}~OH&d2v=FN35CHaȯҺ{2 G.pLaWn8QJ߀D -KNZ: d(uH@ENqݫc9C8/r| "K'9ȘFd jO "hQd9pm,;86ה(_A:w]ZTgt̻"pW#~قtCbo#^Ke@IG#-gMg9piya(V4~f\TO-uTҹ}^רD!ut}A߽tzI( `/Z6dO5c W_}0~m(HCxL =z1x> 0Z~20ԦW)pB+ 85fcec 6\*钞 7n4 dNp@zGk<Ƽd!#JsEӇ9Slh s~MIcв7ԫϭP3m1'Ys/?8[߸PPe5r0a'N[]{c}s/y-zC屓Nx icɂ! hi:6ߖ8ZnUt1-#Jnj,l"-Q  it/?6lق/5*Nz;Nz';6s+yKx}'`BN <z&@+@ Qn0,@爝:&Gfn!'nd_:sSX۬]̋tuӖEL^çC/9xJ/vh9fڮ prseCI-@PӵZ_Gw; b_ x=p衇rη !j_;a gǎ_3M`3T x~}-G@QJ YMC6f^5k2L&).y>?@?u'2No B~!`#3Sh(%@"3ZAwCߨg 2 W`3MsN4/9ytVċbc=%G'EsO"]x S545dGYQ&>'`g^HK5g]:\9`ׂo}$w4I V"+*R]\Eib:-t,k_3Up}. :fWa/vuCϩ5k~{mKK!t?)P.Eצ>_m4DaRBQ1prNJb{\F}D0EӮeG׾OnP4 ? 6$3ƽ4\p 4+CH" "2 BZ!->.^48@$ͬ'[͊0QDc4&/$~6]<m| c}MW 8YD1;.p 9ub ν04Aנɕn3J6M Et=u}uF3rWP O=ʍo_Tyr/|_dWρUs<Zνj*[ÜH֦#}a|Gx_ ʎ%ۇAȊ-j@pCn DE]}IPr>eS8KpM&d21p^d DfԀ Oq4)V>4BpC-MyAӉ6@3)#BN6TO~N&b( "};Pzea9MŻ0A cDs$SHߐ9Z ̙s23ܒe4λ"[R'y\r\$F-Q͜B̚8xn$N2_O>pGD_?\D~CZù{.78ny_t-n.WڶѭCk+\f\jfQp=Wq/3 LOD.^ Ro`["SSo;  .J 0E鼲"D :vÿS xbV!+H\q=s[F4zA燠\}71pid2L<B %qK7)7ִ*:ɉ{FPwΉТst| ,dڡrj&AMD)zj>} N.O")# R !SGsDaAL"h^u hﵯ XhaJׄB_efCw*kU$_a"t,cqoRVй}h-H ?ιH`MC1fM}lT˲,E3fcp>ɝ{I1S.iOvv\w\Dw~Jםy½YI@ʁ2殭\}Sٺ6:C x~2/\{ v*m,wbiO/jWH>Ԉ̝wѢEF O"Q7 `| RB'U+VT:^Uvw6$O*krkxL~STHK0w38N%8H@t?]QXkew6A*!Z45(sg+BHz.=Kv`Y:^҆ʮp/^|;igFئ(WپQ/פ Y݁4wܛ8+kܱ'#zYg{'H@Jw_ά|;qy{Ege 0geg5\_8p?w.JUOuޞ'Gng@_۶?#A5 1azZdk@ u_Yخh /g|Nt}~/"ELd;H:+dlP6HT)XۛS}򛔚aQl*->1 j.Qp L&dc#ƴV{M38|>D(r74i>@T@Ui"t/u(F,bJˈ: gh{Wۋ(VZyGPd9qK#hfΏH#3vZ(-*9Kx pf9O 9i94 SjF(*4- 'Ny+Ct?=~nE3hQ*4EyH&#|E9Ak׮e)ɾ=@xWzgr>>@9ww7O9dy} we@W!dza;Y]pqǝh7)gRr.Cx:^> g, H^@lp+偷!{[4o.vl;~cK ut T&0:Q"IML~ŖcW8# sZhRgnC\d%׫RxXHJ+*+}&pW@sN冝?Λ y|BoOڄ4kwrM^!vG\p{4{yn3Q5A,._ᾗZTaEpg ]-v3_eUI65X_{|~d` ֱ& Q'&CVpaݝ4!ػO5k2L&).SlCQ88LMn<8ZC@ЊHM([D üyfo8B h ib;Dz=n(hF!Pp?8&ryGm8v"@Xh9&R, rrV˲qނyB'rĵo"yM}n|g,xslH3DÄsgY )%uYn<- y-zo׶5cOmG\"Ա /`'Fׯ6oBcC]{ }~ "n "l \n>q10 `/y{ӲCt pl [Y.y1:_~%S{Zcؕn9ʶR"PSl;"S>yrs P4أpaw;4LbP{yl{ P_Oj;za ?cq yk~B$h qZLk@ҹS\d2 f 3:8Lu%ɓ'c9:@$ʁ}^>Ph,&hY <t:Dm1-  xqȁ4ޣ\'uj%1%la S*EDe*YlyZP:S\I88x~\"I\Ir㸉А3䐣sAgd>c99cQ8>\? gE;{pStkDc?ۖ% A:l6 )b?ߣU% &qj7U)[n0( ό-vef m"ЉsS;psa  _2 0O᷅[lu 𙰃b@@ߴ=f(qmw3e2# {qG=5ȏ"OݛCc\{E+'.>8>\&d2vEt%jјe D X T:AR o":pԁiAE:8ӀY3D@)dDM@NH:qqMy{)D:P~msth%/$[<ĩu&2 7w vt5k#jVve p)h"lĉ}l`6%+|mp9'D0H~&@tvlaf659+-4y؅ `% b,|& lǎ[hePr|u˸9Gw~5kd2L&NpM[Tr$xFe>ۙ."yZp52k)UM{g+O2\d2Lpw U|=(Fm[ExtT"L  pY3k2k͚\ӎ`Ժ@9Oo,-QaÆ \fQ\d2Lpw)eJc `vi6WhQ֬5fi"w;R*ۊ *UD'pBK'\&d2 "rQrȅvKnYr2k\kpMOVXbE['f8G(*wP=5L&dwWEۨ,O.U)EN4Q|j7֬5f)%tPv*wަNQ=-JЌe\&d2 Zfdך5\}.̷ի7S_&L 7nJ*91bDD4kd2L&\\k Zfה"Q7h`UW]Y{ѓO>y[j=a1cD+W4kd2L&\\k Zfהz嗣Aaq)ڬYM6N:Xu׮1.5k73Nhʔ)>MG-ڸqdVs'S3c&dd2kdך\.PgϞQnݢ~bǎnժEUV]ۨQԾ@[bڴiц gey*#u;Y]=-ҥKDG6(@]ٞD+ˡi@!+UTTB[jxҩcVXk-eEufV`iUXzNS{ieKkYcssX]ҬY3'Xs>J@$&[J^Jjժ4v:rʌ"^#x衇OgqR0,^qFW.lԩbwvRcdIΝlDPpa2AD<)$+2W- 6< AǨ׋5~9>m_;5/fm=:&{o^ȹSL'E\>9^Vc ׃zjo1;v,!!~lR7ˊRК2b%GKFj֪[f;l|đVhiv5jU_kuJN7)Bkmjhڮf&[cEv5[8f5}7a@EUVEgKBsLMoNhu=M /9O7ۑf Jn>)v MO} X>$*yrUJ`%K,鮽aԯh+Vr:^^-gG++ C08#q _пXQI $2ÚBinڵ$'`*\"E8)gG1 Y6* iWx ʕµ 彡Cz8 ^Uǐcclg`%*JΘ`tLc<`JpF.k}hѢu;0KXВ:˰m|yO@dLX>k`]阔 E2`کݴU` `+@=$fEXϞ=cM41)&hĤN)))ќ9suO\Ljy0`M?Xlpe%ҹJPs=ㄪ>W^5йq ͘α n~acjol2ȑ# Jq>FիW/QlW *qy9}P/%)*r-,,,|pS7Xwp{YE7>ЀQ~Dyň*oF ^)KrFd@++3U(ߊ dfFؚ];fD,b/\rub_Cv@-IRN`$POEA7 '@_ܠ,\ =.IxxZ+yB2>Hԏ[5mz-R*O .uqNM^?Qp7իVQ#DŊ}nK!nP'emQS?k֬OAo(bRv#/@YO/Jdl\K= x9l @oիrAsTb$6#[ Iз׃d3/Ń֡ b*L /{~_98oE\{z>m{; _P+V k9/p}yfq32M ?F)ZӅ"F)뷣xpc[M~zR>] &QoTL?[`pO ^%-.uN~-?Yh\yOsdg >-goa?H`/TlRti謓#azhcAֺx%OH>;4PV < |Tmz0{Le9O9>R-vYՃgNG}RhI/s[}8b=Ѝt|;cAOS7l&6x)+}6Ga \#Qcs<'eDZ7JU)x}{+Aஂ~꟧u,wAZ 0g? m}ٷ] )1ƲwRhQ]a.jss=5j=a4F=omVFЩsp`g='G @plaaaaaaaaaaaaaaaaE!L qI:-gSmE]Rc5{‚+zqs1?u#t_UY"q8`"YW@' "Ӹ*`ؼd\rWܻwCԩO+%UZ~L@vk/ u0NJ'#ܹs߲8vS0]{`"g!(6y8()[^>*y A2y:} Ԋ/5ueEӓ%[bQc]5,  DzX1T=/Pb'Ծ7gKT;' rm(|p N)|QIH\)au|ZK4 _]s!pneOfycjL{ϯ#|\8]Pe`!Abb e*fb:fJi;L Guxyȅ{:P2>d,ZXo;l 0ݜ)% FEjqIg끷X36bO0_P5;2(m`ZyEyj@Oέ,VT{$AQ'1~fS?GؾCkRTw'<Cg6R}3uIΦC|(+dy*UȮ*qBx6ޭ[uB!!ZLoʜ(Ug,49Fw C]_ xΓX'x:*0[؍j<P)!B?^׾gt \*q8 ][&ޟ.\د>M| Ziz/E}vuII}Y%rm:}}{ᯮXn`i=>LZ~WgJe`d $y'8:Z*ց4M(5.ohv%YU,XN, Oˢ&M 3=}wWP3pP_u Iط,0ujR>2D^h;[/dP?YS QId](R8߻˛p]%!޹u%(K!SP>\cXd~+uK0*W&]^-T^z '*O՜W: `GJI/Au>VBǰ 0}O_^JTJ)^񲥾xb%'[NmȺtRo pkY5 |sʳ*8m-ޏ/IP^l_8U*RMժUgP?n H%9p3 I"\ڧsV 4En貓= 6X*>(a5@pAw3z-#{*qTGx_]*.VĔ-F mɏG9 a  8l[ejlW^-~n(N \̵l P"yL5*lww/wa(j{-|y1<~\ k1>ԺxDRJ9w/[XXXXXXXXXXXXXXXXC%ӧ<Q)QS3fs)/oH1 vTRQl:޷@0`cHΖ^*)GQK$#Ɯ%.S*/ee, 2{B y!0 8pߖBf U ,>LX@X. uj,%@$8(MI!.WgFP W T  $,}V |y66 IJRI!\uy pyo ȗHOV~lj`;Z <>"@Ս1W0oW r $[>Lpu1~QBwPc=<\+uQ~spXY`窔ЭX `2,,,,,,,,,,,,,,,,,H p|2+\Fk>TـIA0 sG۶m$=F &޿AMLb\(e:Z)"7H/N.'Uqdy|Y=pvXdj?@NSُୀPMaŐj$޽uBPc_.ɫXw Zo?*{J[g̙~OQ}jT_}UbT fQPTU`宓د h%w(3 6x0 d>lU qR{_9&[>Oղ!P (mJ ~9UW$PQ 2C@j`8[ ٮc;7V {it\g)Q\c'Ad40b,ŧLK [= Z|KY X66nS<6͛7G5;)25\%Hĥ=PVTB_ Lc{Ç$R?pQ. ~''{cY?g$R_U z C5r]գ! EQ u($DS?U V D*UCّzjIu½H6 ~? ty'`S$=C*[\ `tcOT bVK{KHq W`TN_2g9vs DE]*ZIѱ#JUΊO9 \i]X;\|WI Xڕ±%7QޮE,ww \ T=|Yp:/%qE+1 BA^ȭws[guou:Fp-,,,,,,,,,,,,,,,( CL;>j/شiϨ(shnڵN~=7R>$hWGzN+O?|d+s@EC' `_OW$s"Xr +,SD{>)-x \m7F!L[;&unbwA]clv)3I:|/ #){Qer@$>@ܠV?PO'Lk~$ji`,!oth=λ]\kb_ L7c6x+Y^IEb3Y"<)( p\k_Rx"7[|^M@7c Nm DefX(ؒC$(*Ȇ@PTYMbPUj~˴\lDnp1WLO>EJ{z,rA3O&(MFJ:qsU;2ΠH|%wr}RxtTE8^Jm.]z o8u¦nO=RPGa'B[!v6kaaaaaaaaaaaaaaaJM` ąxqr2LѠMSR(\>W2?CJvWs/Zx Jջ,@- 6rs)X_[IiVnP8J('Pw 0$ZxU+ۈp \~b!/rCq-;T_1K{԰PQ;ʊb Sշ5Z U. # hBðb4=t׫T )iGYͱ1O|cձ^65k}T$2oC9,z9*܀  [o%hПkARW)b vbRߤR;,STondFC(`+W XZ L -3CM;&S˖- |(o)8%ChEj+ sŋk\ԭcJg!(WM|A+I{ebFaT6@+eg -L@"qX ЯR6 vR-o"?V ^JͪRJf&uǚ(϶UK -_}꯹; ,>'\b mq^dk%&LpN3)cx0˪6l/t8qhmreX^&^ԖѨy_Ps!82kaaaaaaaaaaaaaaaoP aT/&o)_x[Rvp6=`+mW$`{֭[mQ__vkL 5\`ᗼa= 0B@PCB2$uA Tа%x'_ خJ\)VЀ|RE^XeQa 2~14َ3uv_OJ +cu9u2\:GFIWU@'o-7XYFT/yUNjOq<5u̾ (ipoTp$S. >`[@UNa5B`1Q{rBS8|&:]16Pg 1Amgl^o:z)>Ob&='Qmج kM/:?|ɿw!:}~ld%Uh3]|kxt\=b/[<1 *'/[A|E؃S0(q] @ۖـA,K`m۶LGd dLW`.кk)Luy:UR.kp(ek)o},3Z/h^ M^ #1)giK幍((}?ŲlNS{, ZNe&P4xbQ7Kl$% T}`;BIRce `q-E-U}+)mu3z?&97MII~6kĉ> S`z l;ΩF@SҁWTL4Luuٷ0`R5wƖ@^'N/~~ iWRc2h kG9ux`B?6 /:h[9PrK|*xMӹ(;#-uo? STI뾥 Zg=Ǖ--0k9t.{9"E xǦL~Nе%K">IA98Yy ^*-%)qc\nCS!-M` AHUi|cY'8Em9">) PhC{A@`0jD@MuԆIn}@З^z'Jj`rG1V UwGjPv,+)QhL,#d-S~{kQ:@бM߀l &֬YQ@ ؎s%'jYIz-f;@/ZWnG=˲ˑ䋿Sz?jRAۋD+\eMu]reKG8o@m?We)zqR=_# ; hq\I8'HXƹ6QkEͲ(_Eǚje)]UJUo+ Pt Hlp*Q$}$ P/9sJIQ9;3aP5,}{=Դ7l6AE ,ִ|,ol:C>y󰊈>s.tW^P;#`:} <'ۡ{9䌺Џ#/WI2/C0T(V ڃܴIBNf[/q '@/>Jm*'k=y%P ~cYK_/,d9A=e{(g98˲?7YK_ufb/Y I)-/O36'nޟuR^N܌@۽@N`$A 5!JS`?R#uN~=De= Hc ?F 2V=@4^ X hf=ad=C |{1f Wc$ԹEb. R3xs6m<6ñm@! ha@c`OSe'@4cBaCI8Q(/,<POy81<PbnXù9Dz<[)t=pը/}Ts_;R'Bh;u%b/`,P2`l7 $qe|u5MNo)RY> \D1WԎ B d=e"իW{%=cC/^Q<>Se Pj&eb=@Kg;B|'=GdcY& c EMLd&f(oI~`+~ƨ=}@MPBp\gI}Xxq aFf%P6YM]xHU[XXX fHq`Z+VվVF+Vk %`apGRN>TE$*Mbkooaaaaa ` )}hC~<;Orx2S!@,y%dc+=ϑKoL“v|k/ԱmUo S-6^w=FFJpK{}b08H>YftE쓴6p;차s>ۥ) r+9U4rΓO:cF)ӧ[ɖ2c3gM@iS:1+Vrp͙d?}uʞ.3`3M+Vr<6m/b΋ 6-,߿?c%b m୔+X'ZXXXXp z~L֭եJl)CQ\pAԫWsTiZtiq]vi"; OYldZoO]610YL#+!C/@b-fޘ]M ,ҥիW`5\b-Zvޥ'7k@q7{ɒ%ic׫W5m&MaJNιzo-Wk0wa V&\CJ˻6G4q6b%]vM\]f;+{hVT<5hN+Vro5<6uy1Ytp5~Xc:xba'm'o7o։@P| SI菉u:uaÆzF7P P5- OF0}^rJ`Ao,O!C'b,Pגn&a@OVBTq /ğ  فjKynPbw.VH!rE)vX쥨[bl蔕NY~VF}p|'rSrzʢXɱGR.}8Y {5kܮr{:|nKRF]2jV2קFq#r $pk6\|7N:aoRznx5Hw[X1^juY=y%۠QFކN [bEjSAP7~_ +uij>˓4LW:5ߥ^ӯ_?Ek;뵜j/ _p+lW7-VGXIQNS>ڪnݺ }NOc@H&3n:rϞ=#y[Nj2D˔SRE'2+>4 }q9-t+9V-}rluѫIݽe]dwK]κ}K7jWVPY〸pG[o9⳰f~s:t W Y 8M;PgWY\2N:. >(, :e˖NPj``2)s <)zּysxw[hZjkyV3fU !܈ǿʖ-,\ (vܨ󙖿Cu pժU[xl1`{Mʕƍ.ZCb<|wp=m[ 6%E<Ӯ.7 ݿqKVOwo|+9V 7U۵{{]dgz޼+^\+Vrxp- ZXXXXXd5)=^*FV_m2d >`>} :AXF}KźUUzO3;^I!{V-?ڼI؎,|}O\@|WioTO?AXZ Px RN'>{T?[Ul߈u?7*aY<WV-J5"$d6lOF>3?-D&$ఠE}ڷoQGp Zb+p- ZXXXXX>}zFg *)qÂFNb;)Rą@A*YOd`J 6DSʗ/?{,vRF!/_h$/J1LⵣT'߉ldiӦMj\+V Zb\ RF@ 07n\Կ@f#'K8l{1znGlڴp'bAяz~]v }QƁj//x hѢ$<ۨdw . GrT_֮]FH]er--W?)hヒ>ppk?N ,+ Z5kŊ\ V0kaaaaawC>yގK t^=^-)rQ>H0|dWgϞYn07 ( $?M\%F)u=-TP$ˆRNA+YN[o5Ҳ-ߊK ?%So^{m${lx뭷zꫯ"FrJt׷[noɓ'ݗ^zg+6ka+p- Zb %WY\r"@Pz*>G3&lf[XN4*U8yζ zob n޾@jw'27bB>gj{H۔~m}#}Ν{nʅY^um%0lߏ?jy^uz WZe\+V Zb\ J:9r$P)zz*~tCr/Qo5loAՊ(Xu\,oR]%5-[7o^Or^_~7n … }ݮ _3fD~:eʔh< $Gu`B"3&D?_X6d._\V0kŊ\ {7P7ǎHt I-Z(z=(ǬW?>ڶm3N}SdlڶmuN8Ca`;eRz*O^_2 'O]f_'H+2ȷ?7ka+p- Zbž ,`*Mj>`JvW(U|e#H H as=[΃Y5-_맟~7 .eˢŋ' *]^W_}yԩ~df|^'u3? pިQ2qQ#vrnS_"'`MQǍ<H>|p=7K^{-Zb_ni#`۟}}qƂ7ǂsX1ݵ1+o}66/3Q(1k׊܋"ftk׮>+$@Z|_#%2r%'<1_|-uzm#~Pwmf23۸{ʕ+oY9:03p-,,,,,= :Ԭ ,VFdJ^`~X,ͫ"%gۡtEbYw~ydr(7CA,cN c:bĈYfnUx;Շt\rt2#>.F E-{ 1$:ǟ Q}oj6f5}  M]&bRqYXԦ<@ t/tIpL0@⛾ } 01A tv85knN\)iIѣN׽VZ{x2WLqmڵ9֫WRZ ZߔԿ2fҥѰa-u,%mq/v>uO z<إ^q/KQ{3zRx Z1kaajY(QvCJirx$EMLaD߾}pra MII}ddz3gByQ xyȢX &@(3C~pG?֍7opw=u&n 1l3ϮW= (S rϭ2ff~TB=vZOJhp- ZXXXXXXdSൖ7Q(]vłHzW`*l8@Qʩޠ3R UX[e;(pA+PƢYgL`QrTFR6zQ2=s<e` dd%zik\) ,7@fϞUULj0E 駟@\,(@^훡z>);[c6:9(|^)I5Cu3ڼp`;]t`^EA&RNq|J߹R>+M[9TWMCw/Cyn]w/˿CYcEcó pU?z{ }4[-ەN{e].͘,Щ^ulkUMJNs[p׽쒚ds}^>< 1mj͚5Ymb 6u7m_j󐌇f ۘCP qMކ5̈ƿ[} ff0 |wZľCYWuG?nw;̝ &>k!mM5qSJ2@eܝO3uOwS>tWyxbouta|;K \ ) l׮]XS8]B\ѢE]"EPr5 (XePV># ŋGC)PgN*ZN|i  v*Tp9c.Ͼ$5.j.m+J(bNujڴӀz2X_35q8A<ձ8t,'ڛ-?)ƀcUo*ӨQ?[w:Ŋs$>_ b@L?ܕƸnvҩ E';Xm]]5ܗ6z`zӴzP,H%uj{,IN&߶N-b/u?<_/[Ե{!~ɰW<4(ϿѾ|1 ;X% ا ʟ1e9J,c҅;ʇ{_<|e~ѮHB;m:չ{pM^g-*P0.v:b]b%Lm`-}3t p*(lk9k8!+hРA O|-l|:-W#zN縎}{/%?>!?ah Ь{ߓ Nky2ef %]ŃS`pxЉeggW-!=d3~"KCxLwzSuմmrI@~+ڝp2yˆruQVaie~qp>($FL<͌7>6\-sO7ck/Srmtg_;1kzޥ-KU4Jfp-,,,,,,Jڡ|HNa0zo)Yd6  Xa@ɴӠ:{czyu+V&hT)ժU> wd+Bjժ1HQ^Nۨ_jмFC ! V֑g)ɅЫ pLП'k'?~'hXQZǰ 5 p|bЕ}ʟE t$;ȍ\kw=ZivV(l@VR|ݮZ2~6kz aC]93J\w;֨]}+qAXbE9rtlN,3b^P^'WI [l /^Q) $Y )0Z`~ ojWUVU]&uk;畻Aŋ%ꝶ6}v_7T4û5{o[AVRi&Cg<Ь Lװ#QuիWt_-[v˳=*#'kkc9j-G}cQ$UTiLNgsNؿpo kFOaՄ>Xr!×}›@~Sk&#,/öb@;iym,|+'Xr-@jT#ۯE*jjv+S,Ľ]nٱInۂ:k\pm< qgǯۗ= |-3v'_|_7l?+sHM_?=G|Я %,"sR>cp-,,,,,,YxJGg˯㢘V@e7Lԭ|bTJJ` Ȕ}| NHy=-6;X>%E?jJi@x~l iоY*IW WKpQ Ķ`TZP)օmh볍'$+C4X!@&VaU'W΢MAUZ}ё$f%Y6I>MMz2_~൑zvg#%-ͪKM }qT'uۀ @^ &@r^%9PDZlDDcAmN`#TGw֢Wn9TMڇ&$nIA෴Gcok{@#6 ԏk+]+[.5(? K'.wnׅfzKOr/-]8]=lS1`NM/ٝvp/#Cy3oL,z{>o; ɶK,~}&˼tkٮ_ޝ|}0uL۶rHԫpQ6o[:u<뵮_uEtEEJZ2ܯLR=lH׼Y᤮%x`mՃȒE(Ac~xM3,a)!lZI)[ 4\mזf.{G?]Gh[{‰@\}X"`i&o}^q `=WA~/ns rpow^Wsl :r'`U`Ww1mh~׮l)L'E ėS+V a@IH@njZk5 +eJR)HN/Ea؇_⛋W, lBxWnP?V Ѭ>(Qۡ7.ĒA?|ftK|5bO_aFXKk>lqDA_=HԦMJg8q >\dmYo%A'<<8EWgp!)f|->w?ࢢůko寧≽xh+puĜ]Ӯ𞸩˗-WA 5^q]q?T([ g^nx́c˞?dJ,lmƧ4|w+Z}d 0TCr6S+]ڍ9W\m%2 pIE߷gwC\rk,\ W\ Dxd``\:`i]8+YO< )(<^TOx⃫NW Z$!C5AKQ2h0ےA`l Akrb@[,+˰M!YU:DlN1Y~Dgm^Lm$I=Ƥ 1} V?a] E1Ma9@[ BҜd=pG'+KXD7vhX߭Vr3>_b1#jwlO\ڇUB3IW6rEvvgo3R⁛B{hWI}O-RYmw, C\:[y(n [sm5k6ȵ8@l6fp.>i&+UfDq;=5`X 3}C>1?`n~,|xh{'VC-A2Px+H,Az|j} aP_'L v MZ$[/7'GwV~=rn\w pQPT~5ȸ~pǜ/Ƥ^KwԳb"7x}xW Z01%Aٍk1!wT튰bq\G+k& L=fpI>C0X׀sIRd̏Bԫoo)(MOE`h/V$b۔?>JLf?$ |n5_VuUC1[/@1@ 5ؽ5`$KnɄαDKs K$$ȡ>v'nP|5R}tvM>ؾ pQ_v\gݥXC38{|=A:^FU{ ྽bpiiEȗ/{|(hI~ƱLIM~6y k}{R̺#9= f7q㺗-k#ƨ X >XzY%(bE˺ܧ.P0= X!T_{+Lxx.pb6r!).wS.Wqe+{mfd&Į$`S*5@T;\԰7O cwOHS=p^=]#=Q~ O l}dtqpi>E,>74wӨ]>[hw]_S VfN d}zu p+Oݶ13}b_C[F*W >zI羪ks--֝ea4xO:.=$O\}w$A/`_;Kj((x{^bG$=\ԹUE}{GFP/O1.:?cSi'.4c{"Szw63}l2{[ؖ-["W}.8~6p} t^Y^[ۨ5S;Vu gd9ףG$_?q sj;3`ECM%g leG`ԇ'^"oШ݉ 1ԖT@]z=Y;|JZvVqLr49$Gp-, ZXXXXXX4 ~w>lrA@ *I$0hX|}oUV?b\!P*K2gTj2}O4QR_TQ# 6_+@UxI_Zʫd)ݢ-}~ Fס@H!]<iBx:whPj;UA P:mra ȟ:mnmZ BUvO\qFnC&ɾeG5aﲿm)<b_Ɖ+gK=o}YbW'K}}ı'IvU:wk\[#J 8D.??\oOJ2M4:a׬%Wg/{[h8ֿd\J=8?XijIJ?4#+7Lΰ@!g|qțY;w@+Wܠq/lxg0Yw̓\ {ত`2d_bE5l`jbp,>$K4}$9Lu5z}>dj$Y)"+7cDbA ԟ"Ex^ XTHvQ*i+>8%)H7q.6wWPomoGuN,X({ puOC{?Y6])A7( 7.m+3-jp'^> pv۞ oi P-{v pQŽGWDlD;\UofcIƶۼé3op-,,,,,,  JLN IXF N6 V4\2$'.H@0J5;/U?[ux\ \V=c2P6b$S}'2e?<#%O[%;Vۚ_L'U'5~\]G1fPM x x6nܸOW%=Z#yEWijW КkcRJ:1#O(pCjPH|Q {{BK^[nm |:ڿ ͨ};q~Iw +>i5spy^uvjZ pS2:t?~1A׮h֬Yє)S+pB$غ",vS.+!?{JXf۶m!'&|IܟO"E;- 5T\~R{n%qZCj:r,\iyam>.U+sy:`$g %\ { r~Šjd*hc~Ygʹ{c5eRN#uDىʴ]va~&v` exjN JSP) WSJGHFqc)ݱ~ >?~|tR0}n/Wyn**JJ1_6W3n;~ @%PVm(z77Rމ`# eJP=~վD F )1OZ~ H,e㽲5=\z\VQ Km(wv̈́zRr+ֵjv-RkФPפew|vp.});)Iw)珺|9] 5md'R~ wfcӘs (kנ>}Kkv@{qVt]zŻ L_g8{%L ޴dj>cG s<]9$!9? t5;()4 W 5 A1k\Wb,(**Q(H\3`HVb`jmf|9 ^;N^vd / LZvc̀߂. ER掆jpԲ%w m`{bwN8+[%y>Ź.W&n?kkYeYefHTve6L2f9Y+!Qb.:̉ƌCk @g ʐ=NMOFwa>LEl,MUl`5"Y1Xe񣥳:dȐ<՚CuJ9kK ѳ>(o rq ebj?')0.*Pfʔb"Τ6:@n:a@ķ չ/7!k p->#@Rwy kؑ x_.YWCb\bn2=N.{+ۤ. ĶھF|3,߱Y +KFoeW;&ܐ}ѧ]9N\2,˲,k A:u]4dK&;l^i$>X 4I&U!~ pձ'4 d}9٨dz(h&^ 0]w(WRc, cJG\=q>ɪn:,Lԓ큛 p,0lxչI;K^z@m˶8Y䬑5vJgٖ>ׂnUpn{_٣e6($dpRJ ^֣#2A xpt>~+$YJkJo2eJXO?41ǀOG*{Szoʒ_.`WS)2K-ꠏO:zL=@5಍ĝ/ uϕm;Bv6wůұ붹ݶ6@)5 m[ԌP,^#yopl>P8~^Lƾ WI^䔿fx@.* < EG EV_@i\n*-_sljOO@ؿp`hpuZn\plײ p-˲,ZL5Cǔ̧'ൔ:n ke5ݭ ٤IGF |iDN $[.١Qz/*BǕ#l Qq1o9V8V93Tk׮)ʭo}t;IJ!̫\Ef-Y_(abe:,b&!X<\ǚ_t2s\̱ecdbeAf[_WƧU,e26 da z7y >0pInrYf2oj*-Ex=옚QkwmWf|Qe/-Ngx}N'X>~7o|~5;QcI{4;?tS<'| X0tOwwl9'zwr'* <5ce;LֱOSe%s>.ٝXE0!ZQmjZ^Bdz\Ap @ĉٳgb1V4J(wdGF|ϨL+bN5 7G2tM.-AMxI=ހpWB?:;}R= Kr&QyyF/tcy׉Weyȭ!6^-e[N\lnT۴|ŸYח➂$aDsl?lr|) >`,0/dr۝%M>G3ͺgf Gdfݼ8;uu@SX&yeZeYn߾}N6QՄ&TZ^M2ZkȆS( 4yV+)B ?)8:o% &w p)@ 0Ru_d2y:㝙(L`t q{#e*cAk豇LX5e@8,mSғʔRFs ZJ.)cv~$;HAaG079~I4$(#;FPF[}v]Upv[:PG<}VG.xxC=͞{'~Kx&7/S}RiY1T\GoY!^Ӻr}m9oe\ˊ\e!-#rniVeO&wz787S?J&/lzjyMbߘ4 VX'g<{K<'x}j.@1`Ax% c+z݇6I&}<P2gMy@:{QId*+VJY\:je^S':`ે)"4qfgDLu--Ƚ#wrG @l7eYy _.OڣyY\ݴB|e+9+[n;_ޟx,7 /ά_iMٲ-{_f9#.p7vyq)kKxhRHnbpA]Cr\>95p6 p p-˲,7?E0MM%]BV_!ﳽCA҉÷3k YMe=uV('u\I FXH,$W 2v#l":-[LV(=i+7Ǖ q%ہ/[ҡsq nr- ٤\^!1 "U2ph w*؊s}c[9qݼyv 3lxtrx&IvC> ;o1Pum8lczD@ BՈ܁YW @_JeH^<ލ{V!~涛ق %`TVv$6-Cf,HeuKef{~d;K^|GS}JG][*CxMdV)w~ ŚT볁!Rʜӊ+U]խiƶ2]vhY[a @}W M+3!QQܺbfen y&7{/Fd߮J*u;>'o!p{#=)Hd2rOQ?}U{BAӥ^yu&Bɐ|SkZo eCQ.YL2petNr,lӽoUP"FP`1hР`~x%K"&=#)yO?^{o?LPPѻ.B|R>*m[mcY /o\cCJY]>">a6%w4&ŷrҳ똱Yhfh "c!8{DjU ;yǞyuZo,TMoktcy\v'.e:IC2 p-\˲,˲[;s$'t A,fizAUCSQFd)̖+uaUO`* % G&bdid 0!'hHk}:@b%dzN (eXg=Xv˶CbvtL++GWu[WCLGu' t}y38}(Kg h/p,s"]_d'7oa#G`:8>o8/OXt#ff08pWkx瘓Cou lyN~I\lVld fBg?`|%DbPPϺwʷ )K)X($m7/<=gᓨItmqsOU[kXgv S/w{=~{{'G;xގ-X Y?*w¯i[}3v 6%yϾ%s%rO(:STO(z2.'+IuYlO~܇2u&?Vcr4xĖ/[lQ<4(zQGYdD_q߿ju/^|L&s_'~E=.(ZzPuԞu;qOk߾:p3v @;_5=_he ,*}|sa]62ɤelC2sʇ seQadyCno42,]2Oob|GdM'(ˉc XIPMg+ cʁsfZeYe"-tvd.፛drX h#n W2}Ȋ8 V2aԩS#  2ۘ. .kkO꼆{xG}IݬsnSO=E|ɦ%ɷb`.FD}T~N~<#K[dr{iaJ+#4yqK,|HtÊQ7ܯu9˻$"!;wp͆@Q@n]ec$7[v}""l#IXK-I+8ovmr*06g9$+On#LsWyekYeYpIJ Oe"YNtV52V: P2`ҡLǙ f&#,2۠SL'^, DG[J0I,N:)t5}2kd۬հP&2l}΄ R.1'^2S H#ߓm|FG .M-BX2%F /Fp:q/uku.u- ԇC2/Zl%{ z>8X>#Rԑ|>syeH`lsy羔`8o=N=cqNJJ<%/< ޯs?Ywc} \.eYeY%pMg}:ft,f%36dr.OdwtjMd KF(Hp5Pf) :[f-C]t<.S&e27";IP&9rLMyy:O-: ){AaYRّW9ss XS21LV3825u۩+7K=k u7YmzvQ`$ܯxG xWTcˮ>ٱ3fz{e{[oM`Y999޳ p+)vv>K\AɺmkYeYֲb.*0AYFy&#)jgQ04 ĺ&\\e: p-+XiH*m3< ps4DDvZfw\˲,25-Do&ekℼ V]Ic/a0,\I06'N'k(:ͩW^>ſݮeYek[ov'ԩh}pؕ1ak:m~-<;z'X'}ɋcY \˲,25-!1h xj<M4I--X+0 p\k觟~O@#4H}kXsMOvc>yakYeYVq%SNaf0gnf /No E: p-ak"&Bf"NdŇzh ;cDӦM|2pO.^8}R-˲,ײ p p\0>Z`A4cƌ`&OF=a ڲb%O?=:tL,X{ 6 pcK) 7djYeYe:akQ={ ޓa }饗.]5o[e I''/>m۶#S_~-Zy⯿:Gϝ;sAܐyK, ,˲,\25u8 p-\*E^QΝ)SDzm&ѬY뮻[2pP\_+vgݐ+pK?̘:uj&+C'ݲ,˲ p-0 p\(=zt4rȨo߾Q="e[7PcR'x`͟1JuKo9䐸qkvUϟ?pd >2{oeYeZak:VꫯF>hxꪫ"eٞݢE)͛7_'pBIȚ, ܋.qݱx?G2!N2pySn…̲,˲ p-k%R m,\^詧'zOӃV6WW^ܬYywer2nIfoC|w>ѯoy,˲,k)kUh 7LW&n <|xd²;,[[&,[nܨQEج`mnݺu Zpd*я?7dಬeYeY}CO!FRusΙpߜ8F|eȠ:+Nʙ9 ˙ñ Bk~R|xs/>F쬕+^|Gf2ŒK/4ӄfg̘Q/zhɒ% nO?MolmMdd},˲uXx+W.ULH1^=hX#U*Tp\+ӯ u Nux=Ǎ9-* Tu+W2ZxujyhLnݳ90={ƽ{sNݻGC qgc=PU ]vѼy5m/mذa׭XN ѴiB&~nIX nPgxߒ-YeYjժUX1l Q c5͊M:\9VA4Xqe8k֬Z#G @nرlƒ `СCܗm]`Ynɺ% ؞)lŋd[eYֺ+":S# wܡeYeYeC[4hР~„ a~,YFG}t/R ʢѣG+him n V3gδeYe:S#8":]v%*]O<48J4R`TXgY>ñcR+СCjj4yd_VФIEĉ?8d.Z[A`69Y];BV63kYeYzO>9:묳=#*[OeYUb2,k}ԩu-{'W~+V+唁`ml%ʶ}^w_|t-OeYeYeYeYeYVI? Џ)>[}_,? % lYeYeYeYeYeȢ.Y$c̙.Ж>[j˲,˲,˲,˲,˲$-0lZ^_$ϟ"XK=|xb@˲,˲,˲,˲,˲) n7@YZ #pkhkYeYeYeYeYMkYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeY֪VΝ#GF]vYN;ET'Ų,˲,˲,ZoZVSNW_};>)eYw}7СCK/E^ziTzu\˲,˲,˲,ko>/ѣGG'O,˲/u5jݺu,˲,˲,˲5A5jԈ>eY^sOGgLwO}\p8p8UVs#4hPµ,˲J_~e fVoFp8p8j2e7x \r G}#oYe_:ujxW^Ԯ]Fʕ{J>p8p8{nrŭׅ ⎼eY~7ވxhΜ9Qƍ+z3˲,˲,˲,k6l}+˿0'1,˲;M4)#GF{nۦRp8p8ժUKtMرcCFǏwG޲,Z4`讻5j(A3p-˲,˲,˲5B5jԈZno3fL4}t˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲5*1bDoDZhhΜ9G}-Z(5kOeYeYeYeYeY֪; >(^&M}t-˲,˲,˲,˲,˲{/z_=ݹs^xċ/]e?`m-x[zrǎ^?_,˲,˲,˲,˲,*iuu޷O??;,>#?< .޽{:DSL}ѐۭ[eYeYeYeYeYV g Wp{GC=4G7G  7K/4BkeߖzݻGӧO7'Բ,˲w1Df͚&laYeY*J$X_щ'"Q˖-]wu<'[lE8Ž/[&'JAn晧~z|I'G}t&x{GƇrH,XY#YK3/"iYe裏9sDcƌ믏h„ 7xc8N54'#ԩStGp^zin2ecYeYA_lvcOOٳgGmڴviTP!UVK I23g cǎj+7&3WKflx`$oM[˲,ZgnƍG 6 p( 4XO!N81ܬM4Ix=cg/),ñ h{G>`yEv}w@h=eGXQVñEǪ}ucMn :@H!dĈ=)>ի!+h}:sX;vl졇 }$+w…,X+6V_/ֶWٹod9?_~,˲ ap 7}>qE7˗db.ߠA0sOf ~2dȹ{GU `aWd˪ ᩵D{Wtyn6~=as=7le̞s9x/pԏ<ʾm[y袋9GժUvmG*TLs8Va?7} 6_V,*6o(8פcUׁnRu-6_XJ+Upn/}Wƚ#OLVi' (I"YDm49tҿ)+8ڊrn{ףÇh"x+K7ꫯ>5kV UM|ui_dO?>eYejݺudwL8 %P l0HCS"8KL#yLWF[a=^Ԯ];Wn@]`.g}o˾s{'o}.ΦlliӦXd"1+x/׼2ARǑ?T|pPOrujv{t?X%bfe׍ݡmT/קc @) \[QC~2U/kժ;x}:J@F+?!KPһwv!i%iӭ'=87zQ,:Z+~cї& Llƫ8,Y2B}ڐysٖ[eYknMըQlWx)>Y{gH>V'Fm2g1N>=`nLUl=pp+_@\tWF*UVbw-ONYm%@wd^qOա*WHC9Ν?#[ya=IOicUT]wCcCJfkUk\5nO-ګ[SOgs]ps^:{X}5MfYH>Q?jF2~BERxsTm /ogȊW-;*~ayRfn, }K.Ϗȧz*d!ٖ!eYV 5.R{'ٱ \y+dbڶmCv;`kHlU%ʘݏnP6d= ƺ˶`@$eкh*3bq<}&[A޴5f`O/vկ_}1ܨ eR{et1|'kʨ ^ve!kK62tw>*k"W?ZbWMvq8VY|5W|2p١ڈ7UЄ$URbfw>S'Έ cs}ux.$0 .+F2#4iJN:åшHQKmbUXg|vE./Q)=X)0IHYv˵"z8ܹs#KLlfYeYk j*X)X6sdnѣGV ]V0-\d&6 xڒ++TcZJv 3mt7|+ &,o q-˲V_~e4thoMdv`m&zݛի7S tH{Re?p&~ϞbIO, "!'7S2lO籾DmlXyeXƲD}!܅*Kʾ?;5>3-«^} p-\2u8 pի<"NNI%F#/$V`tvK]YoI̙#$Jyx9faÆła3e=0[eYZ'A^ }1㧞XU4L_VJ|IjllX5eg}?I@X1@mHp nZN&+W  †A>T[7X($~repZ<1OZY)zq#Fc{k#% úl]7 5-er~;M1{~#\};&SN  p-˲[s'G48K0&.g̘\_2dn:FV Ge], be~%%W (b-.Uv/W R,#/jX"(<~ѓգx5*pnpdհx/c򝺏F2hxn:4pzRL]hak:VzgDƍoAI?Dvn)pO('PY14/h+'Eb΋/U4pյJĎ,˲J_$@KCE7B2l@_QcU:Uǖ.]:Zj-2pr[ +{\.a9$p: hp#e6X(lJ9d~ن(Gj4d&p5\[5槗講xf3K'7uKXKDmFG}O p-\2u8 p矇~ s.A$aMJĔ0 w4k,_Js,pCE[ApeЙ И I,˲,kGHJz2<EL*իW|ù9E{Yg*%dj3@h,b )6,aD!jK櫀53խ[ , *\{} M}+ Utb:5I%d"=]~+1[ 8ÛX_Oq>kPaՠmL[ZepZ K6%DJ`@}42ISj䓰>gVR%{ώN=Ԩ_~a=cW|ֵ^]yL6^5Y8N02u8 p-\ZHМϣMVZApn~Z&շow%p|8ٷ}>Df@\^-˲,kZfN^tE3ό0GCX )i`IHx*+vY=bVNF.lBݻw3?e;2 ÍMf͚՘qaw=BK_~eH:}2i?6 `LYn!HX?>3 p\0+FɊ- HT #S>^f.LA;s pKO ڞFjײ,Z{8 AMpg%\m8 KC %:mڴ9Cx. & @JF/"m3kرc3, F.C :4=zt7@ @,Z>ǖ [n .d5a„;t1A/PmԩS)6eh 5|T1e6Z4ļ.Olcb=&2eJA!hy#>@ >^OIFY:(I88y(,c9IhѢ0s;ӗJR!xSdCڅ$cfFaO,BeYe7PPbS͔gV@nǎוHn4iȤQAC-VANJ1 ]l0h\[66Y?@8R^iWK工th~s֡U Z/ԤͱUE>y>)7bA甑Y综ǟ_P(ι7|7ۧSN tĹd;0a[?V:̯zo{:<posFmpM&TӲZ%&X}PA)uVz=#77x@ԝ<ʯN.9GCp :> AGcC|J_ K򊈎IK%]pހt941e` lAsO(c93¾/ BG%kdMS{u+0 [~xZZSg;+GA1edERz:yn2L)^.uW2@_ Cz0E=uԑd0zm]#>ۃ0::jpºԣٰ=L,o=:lua$ >(Yzԧr1p/y]s\`ey i-2X*) ^)88VHF@{.:k2FJی6 m2GFq ӖJdQ싶Lv3ITzclQ73墬m?IX&}Ǩ>Fj3$2dؼ1a(?5}'pB; gkkYeY+]4 PE'! 0XCXovA3;[bРALca:XN^sذa5npuoJ`S~0ґ)ʸ{:44ꁎ@W~a4XGɻF5*c{}W _:lmWcI{j0sv긟ѹj27$C9IA^'o7}1snt. l>1N E5{i!l p'at7ٷGU^ N c6w/sGT-|1[ƣ|P=-?EAg=՝+ ^?ѹ;vC=7=c <آ^z^ɾ>F7ĂI9$;_z}Gms0B^;G:Nbiչ,ZooLpv,֨ 6RǔNt7.up+@.ñUos5P]2Hո?0/ yij 2-/|ƺgϜqg7),A./Bb֟ݧņ.g܏/f_O|WR@c+XV&@^.'m?LG}:avU<_SHHU}kzJ[d]w dܤ]ԃu0TS|uw>t}M1}[=-GMIF 2k,2F"Y+ >LZeYv\@' & F 5ëb}BC:4i,إ Bj X.S&VXŚ.Vg"V,-?H˖V"=VdMX}>?ֲɜVߴ5`Ǜoi\|J[VsG?uKӰ|6`ٯG|';7Hm?r?>?C)--6hww%u˕-t lBwAPRl2qA$9v׋nqAzWx| % X-]w}R)}Hudup `t} JG=uL] TJT#Hͧ 3:AejwI,TG2eI |ɪ=a/ysk^k֥b9U:_eMk?{-L+>)hLP*KF'~yjKOm3~-~G|];A{hY>qm+rt.] SפO{;'˹Y >eZq<}Ze]h^S[#:BXudm=tl{ c \Su&) TG'|F9sCHUT-/Sr{H}qP~>,4>h8k;'s~I7D+e )sḵ~e /"d:犯펫WE 9j)k@2.(ނQk-Kw_ʑOw*9Koie&;x, VVڇ*vq/W',]k~uv׫:xdxȣhM0|.5״@F덡To;W:!;.'7Ip_Ձ<6<daByU d;VݱI2cE8u?9_>V^pwYٓ)΄W6!2صu6qnmǭ&@{G<ɇ/aڵ{kp}th~e'6(CpM(Rjo_~Nw}q̝hwN`=mo H.77XSk:H ]nIoCI:'i+qu00طpa ˇB4 h̀ Y "VlxJ6^sRn{ag2jy~܇RuƧEZ:gSzu]ޡѷ{<6w{OJɂzO!> zlNP[i3=;Q8w[Rݿ*snyǃ 0htȈ.iX˯>ߝ8&~!öud>nscg@׌.}6fO=q^B3(7'gla`O~;dxӿ!.;bи#O`c>ZpWb`hSPuf*-qہa.O5f p7gp-*Pڒ[|Hqe$CUݟq6/ڨn%]G6z~SkvvZJz:MQϩg[my%`ǖjM8fX) \e{ҝwޙmР']t>Mf5BZeY\jVc#dEА%F%'.Y ,_d Bi2udTi2$Y:x d,pI6 t:%zK-ft'{=\?Ahj0D#rHxs]vtcy0EqU%27H9YmY _':7(q'߫ߋug'qtP(Kr# *ʾL~W_l&v?-q\MK_w촴kn.}ofn1s-nolxR˞>2Cn>B8 2߬L2oޱZ-߀xK60 ^@ PCyl -kR6mڄa%pK|_SȑP=6y,GHdBKQM,IzX,P[N~9ud_{DMfs[ {Lw-u+Q7wB.mߡe@~hZ .p/g nIܹ?f~P,7?:=~AmZY6d/76m L(Mf^#IV_լY34P p>vhi@;@5bQen UaEۥ=alDnh,7i$ 1# F8p8J<|ph\s5) 3e<0;p (A'%_deůcҹhx=Ua*[}Ѐ3̘ 7D;&#Q^ZRtoK N0e$}@G7R}Y x;Eȶ/6R5dZzDŽ}67\=y.BXg9o@^]355:K rSKH]OIq rX $) jȜc^:dq[򠈠l<,-Jp@ʣLP[n%I` uVQϺo68_A.v: N:KǏ %p'엫m, ҰOY&ߥU˛,{reۚkZ|Y6lC;UmGN uI\2l<|nvS"(a p p-˲,Zl5fStܩvtS401aO`ȓ{4i lmP^ 9:uc~0Ѐu5S.ŴdFA4|&^g q &2Ch8CŒr2t Y@Qx9엎 I p@Jdch,H,9mc%žd{13E_~;@y2mwMyAK-sBFiIܼΖBK.Xjۍ<FS6Ο>ZpMjGZK9Ǽ|VٷF-76?x;u·a>~`)?@lf[sKvPRs.u<% pipS.̂._I}Y~ݎX#ƒ;scP]]c/=L[NLz?w@nԢEmĬ( ;cm65,˲,k\u|xSOVQj+5vj`Stg_pt].C:tt/0e̒. cmc4 iDJ^0&@{ow ClWd1OlAXH#_fn9#Uuub@yun1p(SPnBq2!چ` zE4Φ;H;J,%Y΅uL{e'_eqXfmSmY%2mɔ=t]*3>Og{t&Xc7#nz.ZOPO\_w ]uYQ:u:K,zBQAIF=z!Tpz!O0w1$v@'7xЭ:^qʶ%#+(6}}01ڒ# b`lQ&=.0V1w%2#83YqA~շ_($01%/ww+u2U\H,V\sIDȯ-&߮uA{Qc1,Jx4ODaÆyLnt~R+4\\˲,˲V"M&Qt:j|Agig4XTy:4ro`QpLj)-[v12 +zS]10߫gu2u@Ԉd :Mފ^I>pΤ^cUёM˰4d`rO/\1 pӐ&GŊ?PLc:oyaw&ZMoqɬns* *E*R !HeyPE#n^%7*I(МRѬ$]gqNC9=>kzzY<@HyQ~&();g̊?&%\OtwgťKmJrg]ڭQ$f7 zcفB9⧟Tdܴh"&r*e'5bH5.פ_UW]Jqۢ~ 4fV.U7(ůZ*h[19&M'm5r`rH~ e#ū {~@fâDzػPPƿ2=u C;$wp.R%.y겱 ㆄPnWM{QV WG?4Rvz61LrݥqR#'u<&4!~ұ\}4}+T.ko֧e2=#K ZheKjXcU[n/}lp .W} p`ñ j48#RL8@ ^ˠ55@.@Q0J+ _otϤ xR!sY8z8PKPʫw}!=Wz_Ň"dH\ @xCY)Wcc\Q|J DƗ["CUIMs{tl(%9Je9ҋN -k_rRS P3\`W+񺧞p|Y^Neo=ƹQ8? :(Qi];!{wsqL pvYI}ϿO6hj{j|GПy'JyRʮ`֭.zhu}={ \w<`O~IV|(7a<t?*pH{ܧu?|J/X6p)?ff~\q/wa} pmMp{=` LuSgګ}}pԘ~!{8\fTPNHH8}V…L/L苘Т/b  m۶u&'{ qʹ0Q"UnбcXʕ뿮2\3333332`w}~K H\e.@8Y.y2p {-h$-^+ psvI˃>Oa0j`)v;zᗫp>8J[]7p =;8!  A2*.mWrMVehNBA_RZar\@\OUW\=7onڹtPy>6̨Y/_e*H`P߰@܉׽ᆱRW8+I^jPp_p)ְ,xk7u!W>^yt<bYͅ},R\o]ԗ~N|%nD'c(ohFo [o:ϩon #$q˄=ۅݥE:[p79` wK`Ҁk'pWCvM= ذv81+hOA压ڥ}V0qkml;{1W*w?ਣ1٦ @Gp;(&臷onpvZ٥KzvD{ "и.n m|]ۆS:w^-׼04,jkJo p}Ѓ?.h9lk"ڨ)h,R3}3b1`s]*Ok2X i 5n23xMc:Yʒc`U;xSNqK@![l]~;v"8^V W_n@ u߀, ~4ɕ?wi=&@ҳ^aTfv Ddz.m>\(f3n'}#e־~>.g*ƃ[O@0vk(7pCͫ< ܀:3Pԃ..K.r^׻Anv*ti2_:>H]djL. >y{JՃ p^)Ck6O99\8iU G=poX4_Da?fi+&(p? p)C45k&nV?W!=Ϫ@GÆXڵ?]:*Է0qX8'Y4qVB}Uo嵳1S*J"};}(Ŏ;ƅN ;<}v/_qQYkjГ_|/X<;6pǓ8f?$yi\U69eN{$ZS쐶A7^߿Q?\VFQ{ҿz7QC?1 mLp UvErn곋ЗR3P@<ؽj^MbPnJ{wnIa$\{. 5333333{.G"AiYfV j5XzꫯNTP5o> jժ]]k˿_a2.*}ƺ 4:e!G`ѐayON:)ͮ"-wiJYt{tΜ^]SpaFi'Bw F~Z;@6x%.XK?s#>Z'wڹ`ٝYJ/)-zw4CLf9O-km@\iڠ|wۥG"mBʍ;WP_wq೽ݿuunS,.n PLA)x_;vn6;P:2*\0+ H='PH?iXL TɭӍCXhۻwv+ӈGЫ*cG6VC_2*>ӯ3>r}BLm ?ı7·jժ۴i XΜ9;D&$m&p (d@`Rʆ 8(8C"E3t^~B1CQ/PS5`P9/]" p fЕkY ԗ|O S -HwiÀT-8PV5(n ]~`b\[i}oR%}WY|wus'g=X>. ՟ӡP6yRM V.p3=}H؃pɸ8#n~ViE;S_ 8?rv+;?p'^'21ȦM ]Uu֥ O~TcRCϢ/0Os;@1i`1Wf\uO ƿsO8q(_v0s?7hcgNV5 8v ur i\fffffff @sMѢE4`x|%f7g`Z=XgP (.L VkWjslL 384o\A>fAgŃp]n/R +8sE*P\hgQcsIW wc=N(kD V9oPf.0tΒp6%ugO sxB8\p^8OO ߘZ|rP2S.^}9MG=: ̸6Hmq6h4=p τ=; ֵx@iY.%.~WIu55Mw&865p] PXVE JM Vl @S?9I3 kSzѧ2F\. ζ M-LI)WDc@y/)' F $>W/z?0n'AxCBY=!Vp HEP7c& M&=L}فʾ:iF+p=$^RNT-|.N u.*bTū~ZA%ڄ,,1O N$x h/qiho;u,ҖI%7@ScX{5YCoZ -#|jo(Ygd6+|;cM>׊|'(]wun"xqq]l/y˔)O}{O3k0 58EԠ($/)W&}~3'7K(%^`\+z±&^B"NR+iO)IVi ER-T0,_pS\NJ*V,V$gT';PHpS3`6x1jw*·Ymv1C,we4U3|з+J?08Kf\֤%{_A\~Ji٠rlhDG xy8#Uz:yτFKVspIo)^{{>.@tO_ßqF6R]LRwƧq*] N~%W 07S&lF2&;>|g?qҁnjUCLPD2[F?xL}bmg:\]owGi۟M'Cp{CG=QDN濅׌2 mݝ@CcF}q?  p22D=VcpkIa6|ATàkq98iU4ߦm y7¨.hWD <r| |ɓw'[)H;UnҴk4S# Xj0 / u3e!u wqMߠ2jXDQݓm}7.+xs^)߯VſU;s6T۷o_qB;]+{us@Zޟ.] 6)okL7-;[/(]Iݺnm*9ר7>Ç.Wƹx.Ti&Wg,zگ?0ݏ_[-Z.߿[Z.RNOY/m޵}7KQRN@U \_Yw]{mt$}j幞OQ2\$eʆf,ұ/ ?;7q:G=7>W}ߥЧ_m/p Czݔ=ۇ/4kOvy$;[g~SߍuD8H>E3[}{(pĹ: 6OI{R[>?>Rޣ~uOA\Ʀ Bٿ>R:L&mb*pp嗻5&cZ>ƯM.]VhIp ۬)ro.QD%Kp e2e` hU pn“nh`CUX=DepJ\ VWu% Qjks|| y@Uaq +RUYR ?81^@Ti(k0U^׀@ i; h]6poz X+%qz}[7l/ p7T~e 7tSWbG| ^m.!pChmJAR\ Pq,z{Ν'[ʖ;W 4ptCCܿMׇ%*I˺11=>}iKD~q΁C:]NT=dltրe_pY~J|]{ Hl >GK5ɯO6{v ŝ38%.-ӝÑx3\T~gnS3#p.;+'?De5ei.p0D1ZOUg=c 0f񛻲J}SqmOh~q%B~G1G~%.L1nJq ߑ;+觸jFk7n>c;\k5ZLq^z*gp e'#/Q" hAZE7"Բ>^~p裏hPltti(\p& < !/xk8}|Tc@ z8:\߹(9z(R'H§R[׬  ,'.8d^'h2E;Gy[prez;C"(>45 {TKkuɂ%$j6 }(`A^)?8}e?%KK ]|'oxD NͺPUH_Y|KgEa8\pӶ;ۙ۝A_JiDmSYs ?_8=f٧>sֹ^* ,_&ڬ2L{ 0SUL׭g6 H?t|҂?3dr&?tR&ZTG9^@ܕQx%9?1iL%{q\fi7JRY }OgnHM;:'[&ep,~'Bj'f!~|&nҏ|E97Wï7q?$-iOӒϬp=j5>>6B^-˒g(keK?8*elEg>іhÌgiA2fnRoV>I1Ʀ^AV2>K;%\1veu7g*=0M.\pVZڵTzu7fr0k,.Ơ^@7">0x02p+o x̠Zِ<+QWw~i-j\xCA<Lu93Ђyp'\@{<3Z@~wib`u940PgП96 @ؗeBp=@W` /K%= yFFٰ X6# >ѫӲ9 q/GJ@_5!?qG9{? OA2MK_#;*K\D˚~+-F;".N72dʃxX8^G_IqH?q#>DdfF|Ι3g|rK;wt%8ۭ[Dw p e20e<&W4xyxfEi`€w^^jKff^v)sTf^Eвy 29`c|H3'Ƶ5F3):^u \k~|4>)o" _cp =v<3حx̘1Wcy xw`ׂfp-X0kv Y}Mt'q7-JX͚5ǎ+ q\fffffffp .y0wdL+Z ~7e|s\  `١6n:hժUp5ժU=|vO?tPXX)r{KuvF?rp 7Alhe ůnv4 5kY365jT+nrʅ7մC[Fm?S65k\  `Y۷~WCǎ+dݜ py晁Gիsz 53333333kfׂfp-X0k*ٳg'~nٲk^~,vذaQbp֬Yg9 W_5kfffffff p Z`,#m)S]%ԨQc7't\333333 jVZՂ *T‰p Zaa.{^J1k2#r-1-ACpW$u֕:uejmBJ[o%KuVpvZpWoذ H3kffffffvLsU%/_ނ Ե%JPV(^́/w,dFX />x6-dZ8묳;Q%y'n  ™sV(_dM,Xj(W\ AvT^:s*Q K{@ݳk׮NyXb7o^ƭ53333334˝;wpꩧNNX>#O<ʔ)xR:ZYtҏwڐ<vwC^-XȄBφUKx)vi!3CѢEըQsP6 -ݯ s-;Ը00v6-/qmgoҤIQ5kSNCMи.Oߖ]dɎxkV٩Gs%\33#aѢEȑ#Ǐw/Lbdfv0NIN:U]צMZi:a?6lduƍ-Xp]&'.-dv׭ZrcÆV7B 254jxuƍ.XBo-[\,m۶ ZhAoD=}﷾}^֦M@w},n_}Ufm~7?}633Kjݻww pZj \z91~i}A,]mժ{`g;9ʌg9s7o^ߺ :3fpϚܫW;oه,2J0f̘`ܸq!CA;wvBMJXc73sn}y_쾛+435IȮY` ,X`BZ_̚5=>_t1ҥ aI5U8G9xiӦ9l[xqЧO@8 ^up}ࢋ.r= eiO>=;wn55j|ɠ_~(?|kOٳ| cFDfff4V\_>/?cBlo{p(+ :hPABZ{T(,QZRoP/c?*RۃUVgp?S}YR\!?Pp3o& 4pʵr =0vb'YV56)e'xMPy?裏Gy)OQFy晿xx1DŽS)+Ə3;6ey5СCVi=k׮_j!o`†g婏d>㎗zϝ>>LKҥK`ڼy,7 +VlV@?ஙYV5&U&Lԭ[)qq  sLye|jmԯ_ ـW?9p[`-K.$ܱcGQ^{nYp;M4qi?I-tIpljW%۶m˴4P <X{.m@\rѣG m \,m\pAp\ss{2roU7ѣ=/E/]oe8hb^}'z333333333333333laY }jlSO=P)~#M7ͮ "{uPWu_Q=ƍÆ sn_:t %ho|utW#Fp.\8(YZkeUΒ:AlƲq6dBYfg)#=(ߢAM| %1ԩSR{.PYzK~Q?&rl&W\qEpIYg~_hQlٲ`^ u…{yy䃴2xN~^& S߾?t~*x衇T⦬) ܔpQRXy7+e/"Ppu`/3Qʄ%J@= -\9!y&O7_2 rWCG޼y] ʦ^lu'Mg=#MT>W^xU,w.e.]q ?ԬY3h߾/yq.WĩG6lp!rֹUTkǪ4[~PG*h{'ju\o5tQ|cʚioΡސիW|҆hSQ)j6AoN,-\vRegGE+(Hp mٲ%b~?B:|q޽{;tTթSA6ˑ#i@ 0 Pu{m۶uji׮]% JZ^&tL2;`*kϞ=7 IzYҥan` u0eEL)}͛7~w$ ҦRsz_)p}YbhF|$B|؋?'.xKuVZkb@z=(;` HHweƊ)}AfGZ"P@{ꄠ?GMD}?QWZl/R_08 ZŸ/gʂϵH'cuu X ܌O=Iԗ8m,sBbR:[%#7@ImK-$㚊/']S 8ӞQf6nsZj.ie" >'΄ LY[vdO?t1`b &Փ8FU>1pP@Hl&hJN8Fv}θboX"ǣj^h#@j跣yrFq,}P{ؗܤLv pKsN~ڒ7A=Ҙkq< `J<4'@68iΜ9@PRhcۨO1kT|bfAƕ<ǹ[=b=w\yFQ(:@a%!O>9`3= 5^!) '*/W Tv53o&_ոt%3#sM(icxˍ |R~N\r2`BbŊ£=c(cK>sn+5k:ב &AҘ6 $ +/s\> &jM&j([333333333333333 pQ P "t#K\0H+emF xn$ҕ'`J\6$Qey [ڵkoQ6Iey?.Nո6pYjƁˡ>P;u)&Tݧ:,v9KſYK7(]S(&+~C)p ( rƽ _K-J6n:۷Pt̝k m?6s9>K~ $]`tňJPq@w pVr SZH 9H\\+0BP V_ m#y۵u.GQh 2ڠYiOoXe,L S)7KeYYxJŋ?)C6Pعs6J^DFJo Hib!HW?v^M,].PB{=Aa SQXVK4].nS9,C-\A.D#w`Roz)XUytq $7e)8K{ rFƔj2>iX7Q7Ӳqx<pBzx+ޫu<))0,%K twJxpU"@]\b@\)U VpGI8%삈kފhaW߬*KuFir Oy ċOV77yBy@+|n+ /ڱcG.\5 tDeWƇ.I  D~~܌k\ir;ʁe*_z0M܀>=%-Sw[QF#UҪ߫>T|K]YupV5CեK]JnQpqK:ҕWM^/i_tYT Xu+o@W>*?ݻw3gL̽凒X;]4hui(ATSO­u{ǪN2 .H}@c\n: 2>z2ܲ+ "@㗫[#ePZR>U`--W@ѣG;'EDW=xVC1(|-y6[vyH Eu)Ec{269~X$@ĉ_&!p4)ur%$ *^(@_)頨9M9wߐ&| (z׹Pw E<}(6uB`MjK\rjQy9ղT1Z61C KƨK( X}y8CԻսoX˦={B-P h.+ M|ڵm(pU^Խpk|:mfffffffffffffff]@.6)OQ&6( >Qu񰛽> ԋ۴QW1(ISr\Dq<bS0)/ O>k甥w ˗y}Yj]( qc5z2%]B:8xN1*@s.\Ū#nɼ~pJTN%Kс~RLsJfԚ~/M䇸?T"9_2`W:F|ײ ^ÆsYX0(mT˕u {%ǀT(D2_N%,0<?(~UIz"n!P&^{-y:vi_@ހӤA؃H7 ͞yX:ujk$۸f{9&ݳ*WO*3P'w m [Lic0A=U]'(p(-{H3@觔W&z1](kU1 飜]ǭ`qy|+pQl6M,-\8z81w9>; BwٽA! r;s&AKsJ%@j=6r8G=%!-W@ wUS/\E*16 e.&6@c-A?*/A`m 앋 rP[#*e 哶/K1-$ؽZ%I`W_}/"{.&97bF,ǟ/I| r!%pJy۫[y g@NCX_)sq}U`Dөgݣ}"$ec5ȺW~3Wp?cn9?jSՍD;)[._lO<9m &(.s ܌Ajq*?TvWW'٨lyW1&KL*VOǸw1 U] Se7 %=ڰ/F=2n}0333333333333333ˮW0v_,Q1ô}lmrF'`tYZ@͉PAȖ(/q*S7 9L=+8y_( q }eR|pW\逖Y"'uh9w?&blm┪SK]+ Ȧk~mqA37QCŠ'iQ>u~I|Թk@7#u3~.I{ʻBj=?r= 0 Wݓ:UzfE(.Rrզ{ S[gR˓:q `;.-% >ǵS~ \(|Y`!p<$(Z/9m&fCnwzA};w,r|kuXm!( dWUR^RVZu6qFﮩ2u>p>] VVlF5w܀e,wgCٳgDK܌Lu_=T*Ba;>tZVP jVmq.!qYZslS6~aT.2_lͺbl& %do?{+/XCխ= 66[g$}0\tBAe s60K-Oc2 Fq e@{\Ң43gl7N=׽NؕOT+3\33333333333333Ʋ3H2& Pj-CqZ>= HFKn)T|vYu]YqTlZ1 AC/ʿxfn#)6Q" (F޲.MLTc2*էsXyLC)j`x$/UoΏRV@xisD |P,,J_- \׀A6b26>ű,7\zpW1 omF\ͯ4MTws9s88>qC *# p}6\RѮbR;^oiȍ)j﮽~Xy^om>vuj[R^렾X.Wz )~|CY8ࣃR҆_mT}.t˂qQcA[ ,!_H\u/hF5C1s`ffffffffffffffvXZV'RLAkdA))UyS+63s= z%AulUx~gs+,ZP$.WԜ,ז3BZ pN\sʔ)Cv6ȿc}e;vHǽkBU}[_f%h @k?F ZH]"5… OTOLg`އR6U@ً~571ٻwG dtUګ WmHA\)S1> u lFK[*T71;W.`裏 țrPݮ{&>jnx+ke\r@قOuʯ.ᣘx;%.Aе~DZg)k}:WFac{/P~ .*>^AD̿*SzK͏̛!?'"e)y*K=^jM0 ݮt*h4QzSpyh=f֬Y.˃p,fX$ӝdeWZ`\w^uW+qW4QM$WQr}oRn g.T  )7@E+0AKj_kO*>w (h )_FyNrIW9hD~oL"KAT~2tǫ~, |~;6*^SJ}]T}AGM$ܥr۬|G \{ OqTW*MH7|s~Vv~/"6Tqr{E,{`;B:]w:4YX]t#R61u:8|Cq$쭶@y\{VY,&I670&|ʗrSȀ(ǥw>[qS~6躻ɣn{Frac>T̷Qt*+PڟEv4[lq GGgHwy૯r`/KX g&́h^ /v:'I$7iՠb-XJ2Ud  ]8J*,X UFL1)`၍k`Jz΂L szȌiɧ{ERb3 p1t@"Q}w,sg&E\Q% hW- D>I@(whns,yQ ]Ey((ۍYLq;#lP:vF  DBEe o'JD` yVWO[߾}Ԧd@YʋkD;r7J6ˀ29 BYo;+ O V$V<U4*RԒcp) [j6tPw- $QOUq|[ x M\;y=Po5r)>@̃zC1 $1('EF}d-TIvup%|dz2b8 U9;ɛċdA :5yl_}Ba&qc<0Kr8`wRfƀ(86U@L*I $.K(W҆S.;8Q>%NG8\/ΥF ,#RU^߇PN *ϟVn䞓 \{"n_\ +[ʒ2$,f)<3y"oR3c=ڔ)'u~ MYSIu 7x93/sOM8t\[b-Te+Rp:=}cƆJà o:7ƫ΍Xd stTR]/F;c7UΗ9tTL*,H)p{j/ͧӦ!WWڶ\!U#gsIp5+E_F6K n:7ՑL`!B^޼Φ̓;ttz~=ee˄5j_ud8bp  L(iw2(#nsv5k>ύ`!B ί{Jifv܌0@ 30Ƴ9@)RC}AQ@WJ@^(|&XvkFxO<` 3%H1<#s-Hy8~\S +sO>&u#{@Ǜ51Pƹ& dM|21#wwX)YZiCS n|iUP3TOjv8UƚNCJg~ @JU7`'0|Tv?kDBG,q9̘^X:3!DZ(nNisD?B'FE\]>_ [b s (YсVK>qdE-\z/\l C͂ W]s*j|[Yg!# kծ[nWoO{?[ Aum¥}W֬^MB]dff7sV߲gfW_{a`NdSnv NR>ON\,`fY`(VLYՃ?&=)uor]Ucnl|X۟K33lQ*2lR WxgQI#0Kfo pmo mm#:R UOC!6#K32M03T!@( Lvcjaxe̔?Kjܮ5cvuJK~`@0w#P2ZN]A v<#|G#A260cwQ_| ),dx2X,GY?70\Bmv1hd|s_nBv WwWz53ن _=Ar99;rIu+twݒxQ̳ Hkp끖x( o.A./M, 9g(a!\'(l.Yk)eCIyS9VM'ԻAT],%`*߭402ŵ^"P˹P P!ocvJ ϊtw~%)E $KI:u砬 8 9Z+qhGEiTr-XȨ@'W?p/8k@Bf[of+v`8'3hk =.ehVq!@.ܪ Vb59 j{ MOPB$+|=`Y?+q;X, 0ˠ@*׫@(/w`ݺuanj @Wci,Tq(7nL,v+w c/}^4/-hʒX  Z9%)į&~gme md'.+I>c)3Jei9SpIp Zu:33;ؖ#GN =qڵsQQ)UT J*TXm*[oӦMRyTfpS1rĈA-Ugyw}4QfffnAj^1UMQjmu\lURs͝;72W|͞ q~{qU`;Wa x\2:/=PuQ?y֭^/f9t?wB,#. Vs+u/؏gfp Z` p fyc&6.̋.((S~;e&XYk} f7>%\ 6z|233L6(p\.0W~onUG9L>R(JYG}C4)eQ>; ,Mp"FA٧<?L"kӫk]WwM(kήYk]ׄ 9DPP HPr" iz0@=o{NN2ˡb&(A9lٲ륹\{l[H]o5\vfndk[vsBb!bn!B!lG] ߳dڟRr% _l? -akK|((`/ r@Y{ZZ~9L 7 딦>ֱp]a +G*E`KXsI].{W% (MiU=X &up+M9T;m!Jwnbn!B!L#2\F0rހ X.$9HǮaB!l` m-9^Psa[#[CnEhΑw]Ywh9s朩Q9G>v=v<v!D #QģBߜԌ: 7 !C 7pCqCV-ZGvH{65o @: .p0 !@ 35BJ5u!<}w'V4ӦMJMN7V(䥎J>:-N)kҥV#ש/~Zr#aܲe !pC 1 1pC(W9p 7mX8 \36olJ sJqKyB!Tr`gB ]O0p7ׯ_o  &bd;_p Pۊ2[n;K,/ԅōlB62|XZQJ ׭[gȟ<58%86;L+LF@aV  7 !C 78DCիc xn r#iQgOpѻCNbES FjmJ yIqO晴:8ɦKB!l]r \Xb XP/vrfdٶ2+7J{ L8$Kz"oғ?e {`,V zj h@V;@珕-`0$eQLY&M1А:a}6b p5)1a>=[+;[P?e!x~m֚5k,nw}g*e5~ 7C 7pC 76=խ[7_/2 . pC73b1܁w*Ue,;Tk7Jm': _u饗f5jԨ͹~ߋל8O[$4o,ڮ駞z*\!Pfݒ%KE-pH b#Rm3M{g`2Ph?` tg YA$/|y _&>NZD9|s[SgƽX:ɃkXWSOJ P:@lzcM?SkؗG'o'Y:o+ϓ 3aQ:p 1-p?1έP RE^aG::.7|E [q75RgΘKSk\wQuE})vSƥӖCn'x-<N" ]tQtwOј{b!@ ܰaCixv Cڵc^Pi=t9];3]ϛ7vyg /`j|ARa=ܓuW0 9EA{7d!PP KK`E a׎pJߪ@'TrKb/鹏G0Pr?;<#|PX42pɔK(+x(k׮5<?oM2ϩd yCdD@&|(ȗ~) we"r*M?гIh}@n;Nz 54>GP) z?QQ!ԅf}Qkpaa_\G_K]qtF>~gV֭M {4~;,R).{챬/뮻ʺ+Y?CUh^YK!PLJʏoG⟻m40 @0EMVZ eK2$Lr+ doUX|,ixN(((Pxg :|J;QRn;-N:څ@tKmڳ) ԋ hbg}ej$>Ţgֽ(\oӦ絓,Vyzc;ky-G [75.j咶޼+5.hE>(qz)|\kG˿keJlt?ļ)z^m)Mc6])#ewQlƴLrO#`wՔ ?%Dc11ucl<&E6{|܌0#/)y(`裏Zur1D+{`>=BcA3}/&kfYge:zp|'rCuJ?@_<`it5j$p Sz<ɇsv`Y8Vn$Ь[nŶгuJh='kRyu+[Ձ1/q] X6mj}!7Y=gXpN  9 0̺馛N"9tAos?xWCKJ>n E=)(Wݍ|w%ў_|1Kp{Ouꫭ~]v7}{K%M_%V.ʔ)SP[J>K(Yoíi:n.]❠gB!VAP xJ|5~#!7W hw8J(פI(5)gHU`]"A\0Ih}r" 3"DpN [$̿SVIJ MTvoQmL0E2)=DmlW˨ 0uZ.Ze$}N;CaxKbݔ&#k HBg9F;-ߦ۟W虭{ ?D<ԧ-U*wQ˕kH ܊wvFo,XvNhSl"د~5ɜco\i\{UTg+zMO|Y{ 8BO#(SJpʿȪKo5.T_{PINڑG@ ;%#wXM녁}M:Zu}/3sYv'=}l.j>q8=t‚iwV1%v)ۃ l6nE0`M[óqS-Eeyuz ޘ<󉫮ʢqTVd.0~H&8㌄kBx3Y1~|-8xB3TKۙbo@tB߭}Bh+!juT=W蘆pb;qqe|ȗz)b\'>]Lwy u =<; RwB!lq"^4EQqv]~$/4J~ld%!BPbKK^tL =$ a2jW&=v?^ k!;=S&@LS忻&-t$d$O 6GR#4:I@nafJA?BU?Z(P,+|VK\I~^zaG\[3Z9' ;Q [F"/vӢXta]v>VcY\.nQ5j5+D^V|ŗ*^Ϛu*E=z~5 bṳ_z(51+]nA4IPk/fGzԨUQyW奔Uֽu uҩխ=,oy^K}:EKV|aZ?ҫ6jWjH{=>[8pYlD?Aޒ-SrCYWAAQ}؊|;jժ6QO!w)* v-_ HMΏbl&KeEuGƒ(I:ɋ='ֱ&g*TO4,X"%$ Kiuг@I<.Q~w P2/Z?z jE/UTn~^Ժ[hU9 "֫ފ^ZOT;**TkhߝzzҾrk[ qf,*j'9FmzXڴz?lJ^P{,/Kգ5G>:}@auW ZԻJ0,…V|j\t\ɥHж4q,mb EN;4\sJd-SwӘ-nY4K^@p]C%i@,b rr-)jշYzjv ({wD e3pGcYh_2>h xeaݥ~^gV¼ [ݻޝ#8 O`` 5 &OvZ:xgsggs1 e-;hڥOx,RO,{Ko`Nȗ@ac7i.ɼͨ? =iw{Ƃv}iF_v;HZ K{ O# 0zc.B!U. ,J/Vb8NR b-©|!xHcdM[K8 |5Am}٭R`ŒAԨnt?$ iCZ 1i5RD~V<`ZTYzJvP =/nB{nX.}BVW"}_F_Qۢ5/KE\@iiGP0}Y߶8]E_~3+ 6c }%znhҧ#UU>?XbF4blh~Q~]-_{XZ}'?Q,o~55j-+[;~7Vt@m?q֧BJrq [ >Ed!AX^%D`5 *{P :ɀ} gu#+J4X~L2,V @51y)@!=ߥPR]Ie@FmCX:TON.XUK -+ RC&,~e8.Vl{(O=%G@-*%]Uv '&\XjbW+r,VBFRO(`jw- i9R!s <#4ؙt;ᴰC\Gf<5}s7^}QJd~q- p:Ȩ(s?`.<ܫKoHyH$}QG]iַ}V%`uH l=@kYDEѸCTn%猊~Oi߶[ҕ|ARֹr'].NlV+5RGye\VpqXmӧ\_OQh4]?gc)Eq((egcĺHO*6^P{ΰ RwtP;u]*k|4wظ%J?T)D'S?)=f=2_d!x\bwkZ[)XYkkXv=Ԡ,HK;0rИ,?53'|푴b}gsE`S~Ѹ_G ZitI1} &@Rͦ'ӾŁ%W7" 3\#΀g\;z OQmԷZlP+/۬sҍg !g/ppCFc@0J_) + n\E} x+!XY"Ha["Q%`Uz}l4?ǺQrifM*R-|f2hhe[{],*Ӏ?bp.tʣ.a~0u(["ڜ{QP59_@X|Jmp8V0'息] wyꤶ* y- 0i v"43@ 0 .L ?0 pꆒꂰ$@\3;+9t \]k5E*e[D ]B},?;kl#argY4N8-4}0' ]w'}wL+.KZf7ɷםWf{jP1K;l>De_}i|wlWV}@'ݓP1% _3fv `3\' W= Vb~n~7sAaLJ,;%EV _WBkn,«Im{Ho4FA|׺\`2%J{`,:S67+Qz,V)u:pp;LXayY7N\`R&Kh>i+llK{3Y>٨Y/Wl. lcc,g!vP-9]\ںo!Z2Yqv7}s/< a[> 9, ;:iPqqeFb?Ӝp fSYv(^I~t-Q"Yή{]W(]sYG~*|s[3Bw+Uv팛QU,rfe]]1}&Vv{ J,IcTf3Bu)P1zYDUP(e R6\v]TN)z_W%E1lsҽyQ``|3շ-TNW,qAsAf'=L}4y75oqcT5,7vR;_@pqv{cieuLթg?*HFgȜNLPf?|;*KW,8(9XEQtS~dϞ^ƭ !B_ zʮb5৔[48ӭo5AZiDY7 .RHv([9ٲs 8J I R3\P&1[b~ Do  -'eO5K(O  vKb0eQ?;>P-2\&z6gN@ҷl}phRt'Msp"LH\ ַZ ȥ]ֱUTs7 qujLΰ2 {k2j+}9z TVqgE;44PۦCVm4]t@ek\/ok݂ƂB_/]&>Z={C p4'|{]J%XAh<p!@q3?˸B'7,( r3/g~YK E.h~GX6AC $3?ٰumw.1 )TTq9u:p1܊5.wT؛ >|˅ZM: p\4iv1+ V"pCئc+o1O#m@\>9]e-])  Xb;9p GJ_,Y֩K]O$objLRnuG٤ʁ` pϱ`k"kf!U'OvX vKZ~íneɧP  .eZ~T ?e~[knpz4*㞴+z nG t,ct@E},{S$n(A+-H-ֳ;^V"htXYSF o_inF z򾐎z򘟪pg'VjS|s!lv{B08Ů+^#Dv\f&ʊl"|]XWbkj-,_֪UV/ْ/e4G:Iw1@fN Bw!B(WV > 0W I yd0ZoF.`(꣟aV݃5R^hf.@YRJ/p!U7)Wѻ+GU`@ XEYj"TA`["4p,<<Z (~U|/ 8IaHo;?/~?=?OX ME%%tS3_gipv^FѼEn c9y juxZhx՚xGmpm&Ews\F$ʻJ& fs Yk.x|S;[Q bkQCq'K ܊![,fW_AeB2F-^#NV9.ꃷH 8L<x twXYsbɾ{e(p@V,.Y|˿8&W ,KJq͠m ƺ퇀nhHp.+ޖ/\~@pKM5Gc 1E6ʽX{{ z{58W>]~'=9۝E}3 :0TwfA. :<6ﯳ-xWqxiCR ^5 : vL; ޫP`y{* V(6دts] )[CA0  -$6o;"4:,ܬ[;[O>-Pz !>tk4lkwv8WF4r?y,o!.5ARsi~XIT?5Ca2$de~d1va +ݛpZ ?Mu!fBy$`֢6 ra  C3jЕHSܗ)?qQysX/3.jW>ЭXKB<+}q!|ހd\( D300n 'Hpatv a%&iQ%s߾ Lw.Cdwzf7,_a=1KpuB!PE O"PrAdcO|Lj -?=PY]dWT_O $ThWIoI$jR[Z" Q~ H=j+l "{SwvXvabn鑾0- pu2M :Χ .l lMm|44nn8S2LU=mW^4+[W+F7{bOspP|+f ?[4>;jV:tm~%Q} Nc;aBB3s#qZ~.W~]j~>)ZfΎ pWhUJq?RWV  *eXM*o2)9~T)u1XZZuZPcA?+ wl6jV>pW7%pGދbvx'ruNL^UoG,>]`{>L=ԶpCAjXponcxyqmj__]?t br`@WVWY>B'V h0ֆ pW*.׽P~ЉTrNTL\)-&]}LD9WWda&8H .W݆iRXqVO>.lFJVuu_5Mvm.~xa T+[OYs{jpA':#&aiQ\ڊO۳>2/%x4鏗{9|ܳ"Su*Ld;Vu,byjo9lkɦBSQb=5hRnl5pq7'5~,)zODٽٞ.eQqRg,|zEq q_K|pc+\(6 &-p@Ljf6R{p[a.ֶz-Zwm, ,V.Zn!|b?Fz3yߦ64&i'`<*oY~ܭ{9 kܢEAsW2D1g_ܷ9K YXĢ b)c\6_ P% Wp񁪶OX o(ep xT vwVpey_YTLA0c2 f ]hsPkY,+ңq+I~2I 9Lb[1o) <',= p7]#:dn d\#?}^{\)w\E2b/;_˃wEDu|M.:Õ9#,~1V!(oW!`=%D_t$CdK"cfHpjU Lh$|ntZZlP?B=4(媻l`;e^ut ܅&% jy,w"MN)])/nz+|nJ@Gq P>_~[iڀ SS.m`EhF$.W~B_6?Qgy]bk\&>obV>2?A(cN\zm|.¶+vh\$'/ҭ7(2WYfD@'ڠI}|mˆ1c =(]I4k}n~4`;;}Ψ@# M- FδQƇɯmw5hl; `V>\+w` D.4 ,RQ4|bbi\fljVB~ Cَ~o׿"Zkl4/j#:g\Nأ= /e_K6d'[%/q \A7-+(@"'+W6@ˡQ1KO ?%n0f-Ќ-H>b}n + #pĥ|@qOEj4W2iڲz2aUK\ p"9|iW<7`8(g@Ųn317nGcDgUܣ6ЮLbւW1AqA;N!zY~,[f鈖F}p^jop3\[7\wޑ,y]({?\|fwB!B~%@a2+`[P|\_ P7{p [m(6 RhR8<0dKQuRV^JV!xU2K9T6&VEpQNSPx;L PքşIj)0ߝBV M?t}Nqlj縿|2>àS-jKr7ߐs͟JDZ[R/qg4.G[+[:lq4AE>%Pɲ#/ plC&noi_a1͋ψf_-u/Θ7&xB[>=jҲr b=\Z5d&o-@@qc\eJ;ngQ&ۦ`(jL6Xڣᆇ߶1(-y/r?jc 9Ci/P/?o(.V&1p 7/VCH7bbAFG$p4VIGs`W]z 1غͻ$!\;ky!vt%+ߚQνċ !299%}o=6+ȵTeq11w'g5oܦFq=t pPT7=9`>%K9W@VARHIX^WԾI@;\2KH^Ke:ঝ-p1 )QD$`z1:$#Ohw;<샫vR dẘ}jnp p該4c=/UuNcؠ)@?r- QW ) j>JMiOBvPg=42u~ Y(>J:$h zrxsE>gṷ́r ;Xy'^ִ ]0rݥ\=k{bI+ `\LJ*{:э z U3D:%?L5B! p}duy܇B)+H kc*"P؁?PgAdwGFW8`K&=p Bzba̡ 4 ` M|lAQ]* \RWߙO)}ALFX7'apj j7\Cg @H?#Ô4VKѯ.?2~*.!A Z`x*l Yfםup-J;'=ԡǛ;=bU?,IW0.^v~!aX]p~v%oi.[ʅ`R%/ZEz[ .5t I meXcdSg PFJ@mw#K5N$vڸJ`LK#ոَ1]#vK\BF>HJ|lɖ`P]]M)K+|;: _*Iw B7~:- 6UXi:9I u bq;r:lXF)]K~}bRv@'ӿ0[k 7r>X3#+=QX"4ַi!=U@N!YJTˬx Kںn֨?0,xM1`WҬAc_n%)hSgmߟ=XJV?m).thY%yAP}&q@o | ⏕ET,EX _W2llL9sxW7vCeQˤ͇`KP'tLs+Oo"pjyx; @r_-7Ў+wO.y\\ Ї̝awGXb zI W;U{We1)w p.&ֻڟR8O3WVpNmw0yEglV 7]s I:y!VLZ`LdaLQ\w-ji3pUC@D + P 8[^seI(@)a]Ԗҫ̗(@B˳Wƹy) olOqevJ_/aWjW}3G{E{)p!f+-(x5ـẂC3=ǻWU9D!.n u\06_ o(:5nMt_cᛖ6(%Kַؚ~ &X4081#hʸ Nŏ7c3yjlobj pFuu`WpO<_kb5-bUu<$~oQNMB.~"hK=X >;S6 A%vYݴ,Wfn!d t#vi--+SC$Wj cÔe|2>xt@i(U`X/Oqϒ!]$,=X.LpĪ` c\?+t }N)[ 6J=pL>i7ԨQ!u˭dw&-φ>ru0ۓ^we\YTʳ)VYi' omg봸\J3 ~zg &p ЖYVz_ΗeTɟݰKrȊ@c/yNb 5+C3Ahhߓ1^݇`e}P_бؗTjNu`ǖ>C b$+[y]0FۇhWB\Vzoadu'hySXh~/,.p]}rɩ:)C*]c7owbL\HB!lXlG9-`9팅oݑ`Z RK"a{@m@Gj2.(3@Fx 'P8J1]rz29,ll{n\!Gz<9,(둢m !G ? /U왤ͅC)GĭŞv%Pe?/-n=y[{?:D_uhew+JUߣIkLΉVmz<;7=wF+|SB98px٫rG7qVQ=o('~!6Y뚋L9r/Peq(ZtgPThmZѬ^to?J9K&81? ӆ2ὶe @]l)D9ˢ2 Orb㟮cl_cA4Y;]$&(C$:t$ ,oPǓ ddJْ /IJWdwyox 8,|uk5{ `X٬pO:C3lߴ? =>0h 2nV=mv'aZms2A[m;c>賜~E.@i; ˒6CQYX> <;sKl+n:PuVl+]+z57L9 FSuO/Im^ ҽ@t{СY I0J}NzM>qHagWzq,zoHEPr۰#yjG< YscC䢡ok`"B!-pQfbrDCuLet J5p\Nu`)MNd ɠ.>j;7 #OVh*6Q* .5)%*J7uv&@cD}qb:1S6r?J1ʺJ]Q)3{5kVĺ'tKe8Č<# i&^ !IIWDh&I˷hx"} pl؃/1{RC59Lw yCW^벋sD 1vj:~i{kJoT+~rtI'$⋲C}|JOR(9lVӜ;]Ҷvp/D ;w(䉻P&x[W. >[8>O [Tajn rxZNV n~5UV= /7 yWOAyrRݡ>EϑyiCoar7rY$ B!__rF5% Q>(WGg"qr KK?D@Z 5 4rPQ%p f+V;>u?Lt-qȤ^l۟:sƏ5~|{y< W6@aa[bQzomX~/w>2mD߱a"LRSӏlۈ 6'Vu6 Db7-Kh2x6E pB}̕KXp?Py‹|Ui=w5ܠp7nϢ6M/7 BKK+.My_]iKvq ov&= ApKU^pAw=?=Wh9~,G[vvMANXL#3Y !fn\e>c2A X/W"[[sK> Zi A(i9> L{+j`yEd`a|jy$ax'xUAܢk}X8a2L.H-?}=ABnP2P)O?,_YsõJ\MiP;impOlЗ$N+ck܅_M3߰_-'ͬQ |ϕC5f"V?mڪN4z ~ҽ F dZ&9뇒aJ)` ((-ܾK/p}pŽ@ԌS\\ Trz [}z#nɥmPC~UC:dMpxڢ Dϼ\-ΠP LOFݬcOkh~sи~Q9X%ྥ0 pC(΁X)cf}\ٜn8^ Xu|}vXW }nv`b@JCv[%.DFUN`$C?ZCj-%=dW_}~]*.6|os❙J'0@8,fHd5S_#@w41@Vv/@]2z3%`(VjAJRWsڄ#:kyn%5)?c~I_.W[YLxO[p1]m`;S ~PbBЭm\o4,pz2~3We)7 f{=_M9`7xYD'!B2ccPV(7ߪG))L$w{ 4Pq9AJVRڶ{|ժ8 5^ +TKf $4!͖$Ul*!~R[)`n złiMh(2kH>e5e! zA#7LBm{[sNW_H7q~CbiB4I}&Q7S\?L'BZяM*߽U^#@yR(J @ZgE/t}2>-7F,eE4@ ˨+gcSJw$'ԭr-siȑN־ތin,pѧMe}%VK7\}r?C>y/^ \?iEKV}19w{F/P4Ӿً%,ww_~3\+bqX넭poYb>[h!z|M l@ EYԸ{2^Ji+{cYJce )44v9UǸ*Vdb]I⁋-r1}S[JN"m|i~{Foo׭N0÷Ѐ,:aȸ.]'dJUqo T֊|N~8Ud \&ʽtAd>m/E\`!') fn@3P`,=X7uPRPeuK<#[)>g)yxvԛρgSύsh}E +_<7Sy8y.ԝ~vtUt ż[p?"1ֽ,u{xԏ{y~:~5.,`Vw!B, 0JH\ S#))$OKo@!3V\cdŋm qWtpVHx|"p΀cP:Œ{`-\#طՋ2)h>A}^5|ȓq-b I=/i| Տ639f $h{lkdbDx?!.c`q@ƷLe+̤q2<ܲӀ1e-{<2G>֬(]Lܟ~snu4#QET׿'h\,K)v=#Mپk4Xkp+݂~sI>;iKw }XڏfU[y~Z^pVד^NX9޾ vz =+(e,L ʊ2QQ8:7 2sq-\ܚy,1 ͔.q8MRud4{Sנ!j{{t !,pdRpˁZ5ˁe%=zm,n+f:(d{>GyylS?)<#'L7ӱ>|s-sQϔF/wK]䢛+za$Ba.?1lQ`Ghp*5[Sލ eg4%?\ =V/ BVLAAEe%@ L`@Z:0xSZ=%'LՄ##n({[apl|)yL>M*([!IR7z&Q)GO( DO|gv߁{g\7Ă`$m팹RjR@+لX% 7c c&Pe'=Rd'L0>#PfW D[[cdXΎɛEغ)Obz[!1*0p{{\, k}n n|: *>C(d:*\c;xL~OĥC!B\ ,3/v("F\Gl1@DŲ TOҢ` 'g;0FaU' RʭrI"NSD(Ihv2^.xp(yd2€)J2`ONҟIj Lߤ>__owO9πzp b7Kw1G?ȦŘ b,Xm͸\wa(cuL*G:9pi\o*g?E2A2 yEO%T!By\ʔ\zp^ĸ }gC(w%kcd[Z< 8!B!P U,}l =2Gz~10\㐯D m,WomQ7- }#b!( \ɣq1݀%GGr[mXpz9-;8i'N!B!0w[ XbӘ6B!pavgLl7;B![.$%YJv,ɖ5K%YY+[weV b'Quˈ93<̜ss;#q 1o؉'~c* \UIWbHЁkP9 E8X A &ƍ;<&޲bDV!= 0BC46a$] \ \* \!ܬ/pw[ B!p,Pr Lq x%UI ! ,B!m}KK{3k֬( \ \* \!$pB!+$p%p%UBWB!BWW* \ \!b }OvKeΜٽ{nԩn۶mno;ҡCIܴil Ǝ.]FabȐ!n!BWHJTBWwXt{',".((deF\Μ9]ʔ)]oFiQr&Lc۷۷X&~„ m۷wm۶ute/T;V3fUE!7%ۧ3fL \ ܺuܹs=z$:>pAVI&M*ժUͅx;s}0`oٷOÇVZQXRD:-c\K/vr֭7`w-;myn9!5jԋہ}'//BnIWG;LvTnaH{_ N;-Zͫ{^$K$pO?Hvڙ|wݮ]rTTi1n?c^ѽx-+V,/ s0׭[w%JPΡcfN#Gɖ-[`ܸqX ÇswРAv\8hѢ&J9yg=tcO=oD9 L;>,W\p?kժ K6l͖-[ |1/Sjc EO-1A!0bĈ|)'=\ 2BgIZ&ީPe?uLUx_\Qx]+aa@rETBȤƍ0q';MRBn}+qĔmzٲeʼn$.Q8rhV^mfr}k֬VZ5iIJvԩ>4+]+USE*11z}e1`<̌.;̙3ݹl|b4x)o׳dU^C=a&*U*;vly\\_4 !H"\ E?± O~^b<|REZg?{?*^˛W?֫^ʙKޫ_˧REj~ (s;^-~z/oޫ;Aw_ICbܔ)SfCDc'bG mr2e.YJR~ ڊQ \p3-o)ըQä('mY.$Cu`v=0׃]׫W/ p^.(Fy{ɋ\H~;l믿~s)7m4kCnM?|Y}v ȣ5nYtPQ{ѣGՃn?Đ0/>8ҕ2XbY|CFr98eM}1{8"eO41GZ(lRx(.qq}Ɍu-Cwݟ? 7n/B!B!w{YfΜ!!#ü .d$:d2:wlq7a8B#A^(3]u}¶&/0{ <~b(`xa./0DwB47qe/P{p r~-7o޼%g׆5i$WbEޚ9a„m>R"]˧xt!_<~̎"vv/B!B!w{YR".$.r^0]M H4}R"<4(c!a] {d,Farr_ǃmBR> ^lO.ӤIu̿S .!bPv̅ \1bE#0"aÆ;/\7$$ֲn%b]JjժURuMf&B!B!]^*ElG}D)7;KnV^u?vrqhnL.JR ϝ;+iHeրW`A ܧ9bݽu\AI.SlٕpC {]{e*;e{-&L8d: ]2Ex-`dP1Hn?^v$ui5B!B!BȽ,p-KQXR&=|x FAxӧЭL>}FnnaÆ16!бcG( Gr^{L9/pEWЎ5*p B[<[I? \^fزdx`' k+~bݺu 4ͅdݻ8qD!B!BŽ,pC(vb_!.E,$e^zY+ٳg]~}_uu.\x~/_dF(p-^[N \c)\֭뉋Yw1d۽8 \9Y#G8ֹm0 !B!B!0p2?0:oرc{M6{qIOvr;v8X JD:#D'ٳgwD$pKq/\t pKu3ޠRJ6 ac|BV,2l̸eňo}rz(ǹ=Kc/#$l;AAAar\!B!Bq.#(pYk֬0JJ!a9x 0gŪVuf򐬔e!o]؇Q ˗mԩSmo1vRmݕn+ޓsNЭ 9Ypl[@sm۶u;wu1rycƌq3gt )ƅB!B!w{Y&@?df$n8 c*>f2,ǚx8WtࢃxǨ?8dի[g1# s@L-Z dcCN\'2/~}wط6< ;u>iӦyMwEo3^ߥKh׮~B!B!P2Rb2k֬Mƍkݤ=%*SAB\—1cƴ0ðbǥ伛aÆ#p<y?gN>bL*9:sPΘ1_:v3ǀܶ5nxXR>J*|MX}~ۇpKjQJ[tK)~8~u1 N`և~! thPB f)|:Bq#iҤٛ7o)hk %c ߌlnف I|q?7ܧO0Y,B!B!CϷNRf8pծ]?Im2[?_G6 : )7((n 13tleb~W֡Ks d]׮]`tx>֮])zF]Kxv2JaʕMvRr\̴}Cņ`XMIfI.&Ԇ*cq"!ևC7o0̾qTyL y|JF3 .dgjf\\Lt#F8d~lذd1E2/)q̣tuW~͎VrY ^[[Cm9̴ec(py<\}-ܗVZe'.:pMrYmr='p B!B!B;$p}`(]SWv"v1Q2!5j԰f0O9lpvf1Xb._|/TH+.\uͲ믿B!2H !0`$9 לLIQt/~3ԝ锭 hŽeftW6rĉ|rbeǎm'/^ 9s^zI\޼ym*gСC#&B!B!$:uG$gS.)89&nʸq\ժU]=\~lr';,nٲu//_5jȎS))e.h"]իWw/˜9Js?"8IV!C&B!B!$m۶ڵի{7(2B=ۃLlCO@-^5kָ[+[Z5WP!{u={t#Fp]tqmڴ1qZti,tR[uJM0fyV.?d~ݰ 4pe˖g9r۸qaQ沓vС߶xD;wݏnݺsTV-vAkL2uL6m[*+eʔ??C&B!B!$!T۾!5=jt޾ݏ?؄lJ\M2b“Q*TxwynСI_JަM_EPR2րy䱬Y7t֌36S͚5]ɒ%->\u|A.CR͛å3gNsBر]X0v[4iYz+V(0|i9s![l;v ?/zm;2EUѢE=HZ ֺRm+W.^[H??tx~݉XO{W /f#GX1oD#xʭ,\vY^.bJlNƘM?~%B!H !p8ڣcAf&Leɒe2l21bpv={vo߾}Yx>.E,2tT):u4m `*!\v0??,܉e?pu3rv^6mt"2`4I;!+B!4B!,̔%D!s'S' n{6_ӧO,\epE *RD'lO!zF\F@"ׅ)tq)1q5xر} A.[ K>׵k2% /F/}ȁk\%`4Du۾u$ 1f %pſ \!B! +"AItRwI9V2|b/sr=c?CvBH=f̘Q]M8,Þn\=UF \iًȩ78H ~1ĉCv*v"na7rqXxq- \ڵ~ |_8q"2levIljժe >؇ 6> 9 rZWkB! B!? nVtκ#F$БpB6tqTRŢyX&#oյ^ !sv}–r$.nk׮M4~C>g oܞE3'c-|wc~$pB!B(%%2ermىG M g}tpŐȻ&MQ;$$$$v3R6aÆ?ub jaIxq~1cFJ:a#e`JXۺXݻׇ 124~ ?/pD)~.bu˧MV 6%oUAk Oc![: :|rm?^WkB! B!s5I-a֬Y=vR[gtfa,u),2A6lkz3SBAC(e-D\[vb!o2S9Gf߿JH B!B\AW!Dƍs}]'pC֏VKj֭#*x.=v#=i%:b3\ժU5牂?co/a`ѢEvpF牏/lcrܾ}?ڵk{⹻ ~O>3 jcp<, '+B!$pB1b̘HX ``X,@yG!KKupbЈ@&^U$p \OvDSW_'  ""Eeq Z4>Nje3e=8&s\?v˗7yήfSSFQfr} E,<0. P(3҂Gkf6m/ļ s8PSjS,22qss.ye;ƍk皲nݺwH:u•O>fad޽{I !Bq \!&I0v&2O@d!ԺO%sDA.d _pew&#!((_1H΢&qLeJKU..dY$IDYomJe')i_J?ޟ2F3A eJZnݳSh)Su1q99g2O:qvnm`vɓ۶١8?psecAKΎB!WB!DDܒc';lPYË0tm^9b.YSxRRn _˕(L.v>d͎.ix2Õ\.ЉyΝ ~9J`|? ֻ~A8Z1ԩS̎={f$/ R ;/iҤ ArűlFd< +ˆ/vϊPebĈA^KH<ږe-1J [Cl/yJQ8α  <1cƌiNj`\"xћ~2iw(int0{/2HԿR[d)޹vL%aTfM 6%ǤxعB/_DnG}!n}}3ryJn~!j8&.):p,YϯzU1xuBS3Y~vR.QFOsk̙3@uBqpL.fvᢣ:cB! B!;"p) z O梢#5?l1 YdȈEMy7?iq@G'#LjR u!o5D/a  \H  *g*Uхע7'! tGn6wztlfw)c] .̯R3ff&# SpWJqvN^cb&pq+%K2޿a y,޼sǔFqݢE E.)nj/@)ɱJ !BB!" ͛S٠Arje.2dCrV?$ yj@ IҧO7n8XuCLrŪ BmeSzB fk Bm߾'F0_Y./-/-o)).]zUQ6R겋˲8n ZjYp*r? aիWs~Y;&d'i`[m۶dW1ѣGAmF~mC]nj^hG#GlHL(ϏQ@w¢:i)[!VXѺek֬":ym[/DFxMʘXǯ.4]ˮux'*@!|\_s/cc0f (99[*q8xQW3' z7tnch +Ha8 q}(;a 689cgXW!BB!"dɒ,d-O^/_2O2 vWo=DGzXfr@cZ /v pݹ>Q  !E-õUVvc(ޏXo&`*" =V^؄tz,fM|2]{.TR#G,W .td. /:w0o+~"ؽ;n3b\j$pB!H !""n7n\~1O5H` L\0؄.T۳8sdsm\ ;BԩcUPEfNx|!\ie. eMCl% \} m~uS|x*T1v˞9sYgV+ble_b]SB-1I]fB!;6uaǸ /yӧw!ݸ,ľ:o%~A`f, uBWfD.b2 Br6@ }K mR#5jԈ9n;X>ɓm#Fp8F`j!p)1lc7.cDWEL`Ʌvbs;p)p!~: ꫯ̙3s.ϰfXj7ewsVFo>YB!B!" \Jy 6v;1NEt_IСTP{k W58 8ЧOr~ (ɔ'Kۈ1e,"\ř7z5^mM7n \?;q3/_4i.ڵ+)]+p!j{;:Ct003F$ 2qY!YBƾ}@߿9~t吽++B!- +B%KLj^;6/T!N"1et6ecH.2eŅ AextȐ!nƌqfb$H˗/o:w&c.:ek1JR.>]˘Æqs#\2eJ9ͮT ʉN}J0!e ekqM!}EP2EـX7g9M$vBpFt۹q6DG P8S/JYU/~qmCm˖/_2w A$g1!nHm4p.b?mv:t 6e˖uK \!B! +B%va?NT+_Oч #;9Ic̕PztƢeF.]YU\&;|9 ̎EGG.r3#%!e!cZhFEC\E).V av9Efn3AnL;`6y~̂Jio.\MDB!WB!DDܒp+˦]r%egBX];dt]a`y\[R wΜ9̞!ZHݞ )|֍zF:(A/lj*f/SN}駟mR&CT_F&l2,yXS1 $\m#s11 8'&)9 ^5k'Ū/v ;ٹzemQ?~ur}q<6NWNBJ́f>&a맼&< \>sx>.<ߔ7$pB!B!"B/` nYvR1BFP_nu9]IօJTZRVJS >ͳS̙Z&;|/CxzOEj^Ly͚5nٲew`/)qƔ[l}d"+B!$pB:{/CKɋXdzѢE}0rtq!+B!(p_W!E6ZJW_/aX,Y乙ʔ)ӫ/S`F(3o|/#+B!8k 0 Z=xUW!HF._l(q>}z.]*"z1{رc{!+B!Yg_^Γ'&ųB!DE6jժu֫Wϡ֡ 9ŵ \!B!+ZcX _b 7or$pBmü8Ȍ5rDpiӦbn]|s%+B!:GqgΜqsuG'[Av_j>Buw \!B?~ѣ *#FuKeʔa׭O=MW!HB!P~76;cҥB_?nvrY\<*-ǵҥKE)n/\ +BHB!j0rs3&O~G rfjPtiE|WHoʔ)&L@b8Qbr/B!c$p]AW!BPonʕ[nnΝnnѢE/P|3o۵kw 6ɱc(isPR>|CvnMܞ?uNBq#+ B!~fnӦMnrzrnF'5/Yxq[de--^#{ʕfϞNNlӧAz&p!sn B!O>ZnR*V˟?B!vk֬q!!!͛]>}\^tQ eyFNCL;~;yu߰"ٳIB!c O=8q"+R;v+[K63B!~uw2G}T ƌ3^zkW^1iw51|cϞ=o }N\ƩS(v.Bܯ/pI8/.*Ud-PBwΜ9B!eÆ ״}M6K((P_Nx=46x~[R2~vm 0\[2B!}J4i\Tɒ%skxdJiŏۀ/fA:f͝;׭XBB!dO>quÆ f$a{byIv6jpp-[e-l=z. BKrJ\,!>ywvƍW![n=* ?{FlyիK*B!IA;yd[hQܲi6 Q FAq_~ĉQ`vޖ?v_~>[.'ؔ+Bܹӭ] d [y!v80#Ν;gUB!B!B&Ξ=kcZF9*j)lä-[F/]v_~E'T!D`ӦMWݻww:tp;vT"Zn6lڶm߽͛f͚oTvlM˖-3+ժU+׸qcYP][-2ZW<AAA[hO5kud܎~뭷V^+WkeAZG+uO?T?9rp7nԛW!'}/ܷ~kOF?]^?|B${M>_O@[^H]]:uj)S&6m뮗!|ݏ/(/ŤREzթS!իWOCuWs5jpPEz7VZ:<\Z5YP/-~R; ڴicG0`;w#|g}`{\wgϞ-x|8w]`_O,F:twyBqIK mʕcƌ\+Wڤ+V~nɒ% Æ eVXycbM*K. I\~wޮnݺ&1T.i,_f"M\ws~Uwσ **U5TH(yj5WbEYڢ{ HvN@(w>4ib]av͜9-_>裏mR߿ߺp$7a?]>Yӧ 6uDeƏo+bկ_?{rn”9u>i;v= ?ݗy%obŊ6Yv !g5i!C \~\/&n[k&*U3ۢbJM׬٤JWJ 5j4ZZ#:a{]J+5V?UXTHk4N&|>*|-с̙3Or(}LDh<'@ؑ۴i'6mI\1b{:T'O_#GxhұN\_.\{A/_vX]tŋz/`Ϟ=nƌ&Aɐ!CZL,Y,-RG/?ɜL'JWfRR”22\'?)1/`cB2+;i‡gϞ&m) 8pַo_O7C(wO 5?Fx 5kÖek/|ӻ4i\WH,K8~\_1|Q\y/%L+[u\vREVU|M/3Ry%J8KUdVѢE/`ͥ$I ~+^%UHo ᵠWxKkAUXy !|~TLJ@p9{3Q|9ĉFҤIs٧>'N8pw9~׸t ;% 0Qp˅@Ƨ3z6EW [gvFrjK:v6l6VGd2TG徥r0SAyaCm'O@ϭݡ(t(D:Š Z\Jgp?U˾q]~o^E}^έݛzU{Xu~5iR,\<~]Ǖֵ[QmZ"sCfřp .G/LXSN1k2kffd)U͝;7PK0_*} 7$KBƓ5YsI;G!gvMDΪpYggJGկ\VjurP [d2eK1",΅"YsXE_uYJQhUEUdl5Z (JvSt1c]@+[sΑC\/UT)$`*w\kF+\~<ks7HӠ$R3D(\mA߾} W?9t<Ϝ93O 5533kJQS|#Pz@/Q E(, jqV=rR(DH 4~s)z\i)`^ 8;Ŕraj>d2Ll'*&ñ?4K#yz \6 1@)+MBXF))_ٰa\Cr>}'F9rUG.U~ڵkܟ[KfMnS* άK`ubiʍ˱"wʔ)pC%(\\33dE ƨիW3F')ϒ7B`R'|PPj*͛ ֮]hUfyR&pU:TDKmE"pM&ɔm.y֭[Gn uxw$ T4Bm(Py*+'m(v3Rt J[H0J?R=͗/s$W͝D m49T  T땃N"id_"߮oW9uR _[nj(/*̔U;/RJq"qh5o޼X}ytT =zpδ,\\33d"HJ0{D47"at)8b?|M9[,Ίp[i nW@ƍ] 5L&SԊ+%pKQp(Tdl5fIEwKQMTo^&P_REk~Pإ(P7޸Jߟ(v-o@Im]̥ MO|D۾;P;(J6ʦYWjv_iX'E /b7t雐7o׫PѷeT-h߾Oed\SrRcC)"L|Wf ʙ3{`kFϞ=)BZ"nţ܌zޓ|. W+4,]ԽWd2LJA 1:,C"+Pŭ<'Pf p3O] >W/ѷ.5L&Sϟ뻿)d.w?C q+b_D*yiwv|hX`b/*(@0s&;v@kJo"M`AD- tP4K GS\._'5533k2kffהHIG,\P\%7bpV5vވK"*tYn\V\D:+@={S,tgځTA߀D*AK/6l;v0Ӳlٗu ~k2s -@۲eKqih "\\33EdPd%`,oj:B_7sҵ| f,՜-[8s66 %9~n(pnSi<\d;m?ؗ53R밚C`rc8 m7C ~c\7ȑ+`WlX09 )T1N6g`ߔ`wn)ƍQn2~|zfp37cY6|Xq ?BNw\>&V9&jV&rdb$ ʊV?[ ܬQ$\#76Τ O>9[[1ò_nFtӕ9r7K4n&Q u|i,$I*~ >#c_cn.'~la;AՈe8\`nd|y12OsGd٢ow7EvcVBz9KlpM&dPu) K4-;c¬gǒ#. <& '6pLQ'qXGskXD%p.TrqDJPGr $罈JBPU]$vi1&*DY6t s&\~bB.xs=xd_t@ &Qߟ$y;%ܶi=Wcg mHv Ԯ1HH\L@E~_5_wFt|H=Wˀb*UHvڹ2|^"är~"_›Vߖm"g=z%R7*"xm緗CpQX&f\s-~e??n_nޱ M,Ku-;i>WcېqC[v ZnmyK\][|\| Ws%1p@OnHm}NPѯ^bddL0jl/l 7y_-_yߋ6|ޢ|JCUVݣ#M}.b\d2LG8Y&\9ț)pv88DH^_9): 95*w[<8ODYy\ +Ph(ei<8D@& r h1\c}myȊ Ѭ\#W&\E50WU?$fYL~щB.MLRObMYV -xM2IBЕԵ/0\xuaN9Iyڑ.[?}jfw)cSԦK' hwQ_+'}&ػnTo's焫'O;F{i\6poƅ2yM ǎ bn i *_~"BĚ+Be4%';QIVϟ[uPySG0 L6RkkܜTnnE^2H2 Py6KP%+O䎥eW \\`AH.2&7|J ai՝4!&sE~6: t DhY3%kekg,t3)s+.^5=MwVNK?l^?JxpΝʹZO+7,fW%9Q w-tmMZhӑG r? Yfr4n]Go+Ja[G:s*/&ߩ*%@`m򗞔5F7^wׯW MW7śƘ'sc/_xj\M8tڌ^)Weۢ>\&d20,p.CqC݉wHDN 5AN'KV2YʓlCMCM 0P`46k܄1 cĶy^ۆSu ED`;p:vTTGgio`I&MrB]|*ŒW%JtujOBt|5 ci2r'e: _CǑ9}[Lx6/^;sl".#mG\?Lvl0lNݰe:Z{'ڼY8Wpi<|#IGAɔ@˖_6zfaO!fokck-j?yM'_ۢasa_tma;dz;"Ҵ;7ײv#:#.)%B9/ _ɓ'$ b`"S;R$ePO;Stng0cc4 VWRETr'َc vk0{C6Br~)dJ* _H_I@[pqNN8!Ϛ(X^`|g$BcP UۆaVM[iKm ?* s]j?O ktm`oJӮÏ?1f`ذiּ <ƿ֨Y~ [}.=ڸkmشvؠ~vl~~;?_6n^7kg:eq }&) ?D$~ c?J\޽!>7?e{ε7\hC,Mk I2ħ;-~EpwV+놨CEHhu\d2LG̣#"arLqqJ}|IFH\99# flaBDo ?Bt c߫I{UHw| _/GhqE$^s˿xc$G|}& u]o萫9N;hd0F &4[9B'][gMjnușg sބ| ?ɩKt믿> f<- N˵(_o"u 06gҮkYm;6qpZKt7q].05mwUw`\lKv":~2lӾ-o}mᐯzi2^uQoPw];jow (տKfa^Ït 7#b>uӦCS5xkApp㷐:AoO)$mjlq~_oۮ._#5Kt^c70FrPɃo߾kG^Xfc{tC%{hG3qu|PWmaW5iq}XcUJKJ?V~)O⏓p L&d:Gr0o\'4oZvi*4Nݝ8v(ж; 'YQ;Z*+,INlL4Zw:~GY 4C"˫a5ZǤ 4d±-/@@:E&3>{ `>s߉||Aw& (qƴuKXpB}Lw7cqDf >vQ.e?Ξ~٧U<{if}ԫM/en-if?͛h۵׽{r썳[e?Ǵ% }zNs:up{(؝1p:C#u^|;H7fػ~?.(ţ T$Cͳ:+AJgMl'b40quZj|^ߣx{^,eɱE" UE[ {MѰgeGΜ94 n6=ƙjԨrÓҋlw^ﹶ7wu׮'x'=nS?Pa7~VZQܥ27I͸HʵAkTզjAOؼ4tDJ-\0I)5@nϾ$8|m}~=pk\'nˢ4ugtK[r4e:٣]tnf 7{.w- Ն+.)~}nߎ_!1Ƴ{5u|"mS]8zXO 1ƏƓ_O_P><|3y6 L8]fmHHwW,LU`3Ϙ 5 f<*`nHv*VWQ\d2LGqքt=0TbLތ&=e,}(RPB46Zr*FAWg'-E?=T5ckI񋇷db1!MSP]m;I90G7=, `B5:Y]2__MW6X 4Y&Tnbo %JI=@m QYyEE%u.) |nZ"IL0WkwE d֟nw&v/k^wѸ1Z8߸cܵgF-m'Kwh܊'tR"TTL7`ӦM_, Cw)Qiȥ07{NdLw6E'[n/l ȉ٢E 9c jjGbgS٤3xhʆ,`Hw`[ \j/߫q7T: @ R`?]U}!z(]YpZcm}؝tlϙkCԕY56iNPkiuFpͦi#64czOu/W~?IG_<8[~r|"Vc)9|h]WXgFHqoS!cЖX \ܭJs0_]~i1 "n)p}ZTZ%@(0r({Oad2LF'5"Ae8Din.G<-|D'r9 L, )vNdsU:9ǿM)IL?|5`lnWsV%r"@ؼ]qHQ1wc"T8qEAHL{`u?XPl@\,:\E;G \]zBEFsw\<۴c0QFnlSj5-@aq@Ϳ px?n|JGS/;pl%ۓ*ڔ.rUݺkGFwRW>uOwY7e"g<}3m3qHއø7DrÜmЊ_qe\bͧ7KQ%1>&|]|9K (P6jL\#pM&d2ɩKdE)4D#M+*qjM.# Q 3C,eRL"pFm}9s9v4Ã\+0S&rlm|s&"qM.z /cq8 MND#kWĭ0J09u 1 "0ba=-piφNGYO@.oUgÕv>q9~c8Fl[]4sI\=7K u]*T4 +22 kU)&7c>sn[A[nq#y/-WթS'P97ᮼvi\# Pu*BU5.#9#E@LeM˓{1[`ԵQLJ~8R_t! F8'RhRWܷ̋5r0u/u\@S3ʶ* 6myl x@!_1|>|7\ pOi74pIE؎WTiJSkS1 1JuU\ٝ/ZEf$\\K~>*ycz#sUHs|GNE/G+|HpM&d2eWNz6Yχ BnEr#,%_mX\KDԽ,'z FTh׃񋈊PWGS(daλ&( <&Y_\$9?n@1vcj|_=:vp-w%ļlOQ #)P306}3iaǻ>&Cq9 eRG|T0!" x$r\`\iv@.Mߗߤ6)u^vᄁ T)|S\ULED6J/)1Y: 28K. إJ*uu&pG+Q Fs{)ʊs](DIՔ&T-g 4!bs,v<'OCXjw?H[7v#Ivf g-osL ;v;Njv/́vp1yv:p3+z|(|4Op pӢX bt-x1|UI^wiEUq`+HhI[|AEf“]ߵIZm#pM&d2N#,G1Soi)88,gs}.Mo6bxAsG}Ngrh҃/bFS에c<3rĪ.ŀ61ѫ:%5mxCk? |ĦG,cA"e' O0Eۘ\&9өrPnc u<3aQt}_1ўkձ#L|ؖL>b75'2ߖ/ ' `#)9p3] _x <~޽;O\qGF {Q7d5So`7yok*cXDfe4e\ .V) .]"xQ4gm9{Q]\)]vU%:"`⎫*D MOA8ݦ}]@1S1uΖMNhU;6Q~yakz6]H˱( w8ap{g sAnE̘Q9pr<&})-MPxʿM_XƸBڃ`-i;MwvSԖ1U׆?y oդ#b$\d2LG N>^ZA5r&Y~K,цL$FK/O:4l"T{}?ܶ`^".קРAT<BSd.}*5K]hDjE"UԓO>9BճzZ3Gv93Y\gkbW>]Vsj{]ޛMJѺs EJj/pŞgq?*5@SmuOG6t W.@B]4O}IG~?8=Tf/6&weըO"7jVYæ]Z {2<cnotůsIMm.~~0]]opR '_V"%8Bݜ4"pQ#0*Rob饂V\&d2Mm/&g"W^yT b.}UXPF#g܅@X QlPlK"p=&a s}GjJ: PdXqޙPX0@D-Zx| D<r˾ƾz?!ELD/e-Lb⯛ȝ믿F &M-nz#vCq aQW|;aڗ_beQ.7y5㏴ ́k7W߇{_@`S`޵~'w5gvmMPᶑT2'Z/RX`] A]7*7E]E=+JOM8 x9n6_~?"e&}^O? [~Aǎ]ZKV8 B7;jz%w:<9LAisƺ;4 x]#7=E/"gLRlkhQMnk|ʖ!1ΡCJ|Sl#.8WrFDlr\so-O.kumߐ MMHmWҗg0pM&d2N#覍t[F]kߊs ʁhq0?WuY.X"~M$>ÍS V?z!oamڴ!s D'XQ&\DsE|Lu\Ťha_+kCr(iLm;"zC5Owu[$L)[zu]kMj?S&>\9ۃ+dsp@JV8WpBHCq3}0p8亁e Hymؐӿgxj{k ͤ Qzʁ=?zn2deF#pw=csQ&~m5Nm5"lkN۽@;_~07=bFbaTogps& 5D覡.wwlr9]sU1pn! X!!76/O۲".i5>UQ\^w-Qbۦ|rz\Ǔj㋲R25=B5C=䊭Th4Z=?sMxD4yOv˧8Y<]6K ں}pIw0*# }nHqҌ Eߋ?G@)^"&i*8_5jChNVx_D1iUh>0*EEoAvmW Bmn <>P\&d2 zp*DQ!@lٲrʉᗏi܂;r^4$2&B^p˷'i? |{3y)**-mDvhbnݺ 8C.D40x,E[DBz)v;i~r]frv$C'h²GT\- }"h\o죚5qK]+>7p[wg c=07JUfK۲N7x\RCx Dtr):w)6/׬Y"kŸƧ7MUWz'HxE)ceCh^`s3NgUPP! OVP!- цҺ20Oܯ\w ϟ3ɮMKk2\^o8TM2."r<q_W; MH)EDr~;ۣw(Wr͜?]sz"x12_gp'o]v Ov'w+~n^=.&(ßb|3 ED7q|.%gup];|Okܭj[}IVBȹyX?Gv]g{j&s`59C _UkQڇ*_\d2LG!%Qp&jҺHR"UPKu"(pB8D0;ǒ#G|`drI40w[EC? Mr gEI0CF\&L DeuDF~.:xq19b _$vBtt4%;(NG~DBtݙDnl4tth)]kF\~ܺN\6kzBnNɚ*E߶^\Ai,Ha04U`  H*.ˉέS'>_n 4gΜaɒ%_V J[V-R#D>n1IۑWѹU9{S\>Y6rïPBAJmĤr0Hg>ꪫn- j Rk۴e}%iݟ4#qM)Fh:fЏ)+#.2{Dw]PJ}."d@g_,i0GyhF5?~9/oI@3RuQKA9A.~$7_7ȯYr 2&]u~O }D7r-!qnG+?f[{,P75=#\Jq\d2LG!)ѳ<(y%/#h̕1.ܝ8ŠTE-c9ZSуJEpVu;ph=b8 _" 4p\Kpycb8 W;$W }wAVa)&B\"y?bk}!aҤ>5YzG+'wձpwc"Kmrۮe @ff\ιtx>lnڞ Jds#/rL!DVNh)l(@аaCW|e hѢEкuk9/AL\M?Q禙ӧ ,5k2L&4\"ֲ?K788r.ic hڙ> q(~F`vRWK*IG|vMviG@T yk;I&,98V\oLuMmNn[>s^^ײ5GP]&3Im`ߓXz(D\sMr$%$$' <^=Zp0HVp u K-oٮ .Z7s#p#rǠm[>]ZZpowW-)ρb"?p߫}^!j;,- .LT3HN]g' $zwnoDG'sew">4Vܦ1Χlw=se h.!+%+]ADRQ<ӵ'^7)$cjʕ+jb|kOP*)ZyAءs \L Ly$}Ѻ:5s`4|p=$0HΏt lyk lK" b1$ oo]؆}k=~>Q7Kwc##)R Tch_4]_9*{^SM~"v$ſ>8c+]f9pGmPHc8Ѷ3 O ]fp\d2LG sMpE9/E3u7vSc#J r>jrBq9*ZL)k"?eo>{uQpLr_!uS`uZ{xݷI@u& 5s n.7]J28xHiܲgc&2jV]û:ߓX$gÜs )Cc.xMJ{Q#}|W\ҏ{;v(+^]C>^Se&U\cuAV:@Tw rEJC_JnC.rv[f{~|@a"cIJU}bJ)3fNw2Asr%Iy ۞H%JTd)R76%FAH{ c'&xJ؟F}=o޼c`"EKJ|}G3&Mc3H I>x*8SZFҽH7Qգ>'m"uBVc;d vFQcõ?.p1g/AQR4=:dis-Ym'KD s`K@0\vaT7~\pֿ%I]mw_fy# pܔ@O@W*i-G(|¹wF ܺԌ1,{1!IK"# WZ.΀Zqqyc\Ocf k"ϸʕ+j*i{w*@G}4x 5L&ɔ QM@UA!wIUc/{qP,QId6 +'{?oqX\Ydk#'pY :]|->kȁ Mػx9^tx}-tPt6Dx5eߧr "&(Ţ?}hb Fo}˵~g0WzD%) p}t7*'@W`nM &7,wDf*uO:*w96#ڂ-;:k:V|;ѥQ_IOJ]MW>Ch15Y9j+(&WE*)ePq`Qt_ܐQTS5a*Kc iB,4 OsZLE'ޜǷF#Wݱn?"_.TT@Gos&;GDR2 @j@˜i[jF`T}^_ ґ?mBa:6cN=D@"T k]HNW"K +-y jB p]2iIW%a5 [mo9#ai1 t9rvlqmŽ( ˯O\|@=s ڦ "\'7 l}xG-{#_?f‰f>UZHז~sXʫFHZ7HRH2Hk.2k@,h3kɡe{5VVt7ln5w5k2L&).b)F$|rؖ ǟ5X,h[e>-β&TT *Uvo+Do9m]{t"<#bD1q(mv %]mȩv ]Bmbrri.ڷP˖-]>^\gZ͟N=Ym}[NRT]z-NA7&_N@kvA{oA8 #T>Eq|~{Su-C<KafRL5JĩO@4/4NX :w ڝ3-\(UfvmMutPW-Mm.aW`u|عi};~j{#:gY34 7.`RJ.V:J4rߎҙ>i߹G '&rjx{$. /4+zKU>čb^1v}O~gmo7W 8 /tǯE|/>b3Es,+}L % s1׆oMbg#>ꌚP sOmd2L,9&DF'8@:ypQ!D2`c/}Ź'Mu&$7rN9#)`u}/($/b{owOL g!} OWWTRhܤrL>x@Y}\% \D_oGJkzŃSY77Oy3ci R0m, d5Ւ{u^ >ΘVnݠFBt=PU;Z* ؖWj-/q^~e7^>#XNn<#?unh4%Fڷz+P ƨ+u/MWXjJs~ SHWs4X/Mz+Ğ;)S{k; -׃Ƶ ÅDr9•Se#9gyKڡ0]eaNk.Z5=\bK@/) ZrL_ }2EodG3"OH~߿5Bk ዥ$"h.1;ݪ5=w|k?ݸ_8dOT[n sΓ2r[5򫴢n@>ByGmo&-&#ם/ݶm[pM&d2e5-J)XTD&RNmrT ,-3KduY>%%$+8N08W\!9?& Kp*>w1D(t MTEflOn^^K/K|n6~kG w> ?(<^<"!|S׹Y |\;|'&Kk ű0#XpJarqg$ <;9p L&d:%SA$nj0\-f-A'󜔈L8P,f8eBQIm1ǡř%jL _ehlʡodW^D1\_5ًH76%7qh"}anb "U`.& ɸId-yU埥Gsƫ%GZzQ$Mk\js̒\z _>{ϤW>Drs31n@ƟJ׋_qOZx±|1~Sj,|_J['gΜs=p L&d:@10SuB9a2PNZpq$W d2kfה]M./\LU <p L&d2{T%CP4d-N`УGpM&d25533k2kffה3<(EBPbŇnV caC:]qC5 7nt\d2LpMp 5e\ 80'xbb%.Uz1ى/RPvm7\d2LpMp 5e0[_|Ŗ>hPBHܹ{ݽ޻Oc[7} 5L&ddnNTRy,LQn0iOwoOYYGK \'k˔Sw'>ܬ%h+WWi}0w>cO>hfegr[38L,%on: *6g&hذa[n -}ꩧ's%9sꬳ 4~5L&ɔyzrU+W.xWoW-YV*\EV+xffYj/څ) w2S"oO*Z";㤓N6р!ӭPBY>v~ .t~Be.Tڅ\TH{lIԬH"i_P<}̙.+Bvkhoauڴis`n'n>ed2L&S_~"1(S'2X3,ҥK9Aɒ%O̲,^DPX1y>9^|>>?M Xmso}1GE`>1;vpg,qKѶQ`#_~Tc3ĵ 7/PqA57xd2LUF*>sr:kfՆ3 k?̎-E}e]v 4h"0$"pG3^⃵kBʂ \SN9>[i40;Reʔa4/r0|p77A?[zA>}(a2&d2L&dJRcƌqI8Ѷ {=E%vIDǏXF[Z`ʔ)8&d2&&d2L&d:@ rAqO`ݺuֹ&d2 L&d2L&Eog}~*kX=]MڵksM&dd5L&d2LcX[(_{M bŊD曷7 $L2倂e&d22_pM&d2L&]1k^z+ y"g/;MLPhѰf͚Lٟ ^~e.a&d2e L&d2L&1;\{l֬ٛ_|N8!;>|l7ukqQ۷o:udQ&d25L&d2LcD&L$ <8xG]K/4X|y{C}ؾ}{.BF\W_ei.r~w2ί]nvz@Nױcp-C/zhB}9nر!#+,>ND D uq &%+W Ӂ[~KuLk8&B{õ qÇ="OncjnMV!B!BY x;|3j۶mk$6eVZ*;w،3b ,0U`?Tk׮5JG:;7 W62i,Z(-}~|{։ Сe-PVBB) P9u6mZCܟq˖-zw5kܡϭ۷nGo7m\pӦoQpVmAunݦm._ևzO|vQO*U~Ա۱y ;vRpƅ07mPm 1ܲJ/lo !pC!B!,`#{:d:0>@T~~DQbX}UH֭N}c8C[%~l<2JLA*0k֬JbTw y/^sb`1n)&}w r?k޻kn0R_wSw[o5ă%owBn'_[G.fة sCe& q_G.o~zn 1ou]u֏pՆkB7B!S(d!R:['fbI*T0U)))dȢdKUR ƶmfݻ/Xp^Jt[Է^5˾}@ (y*/Efeqw6s&\IYt2sQGE{^RCC/ssnDNnBn|!f׳1GL_<&ꆍ놏 1/aęCQ=?{ )=vJnnԤi8b||{饗o9rB{G)T=~?f^J!Ir-ʿQlXʕc-ZFYB!BV{ү 辯N8KT-EeHHl֬)c+VhЖO'(s#Onڴ?$FܠA E P޹s'_9"q"n|^ڴicZ@(]cȷww_RNUZ]u1AFn`;8(sC qG5R) M͞6ϜDx{~uݪMs熘?n3ۇ׍:m޹ĭmkԨBjGQ :}oRv j5J Tm_J{[kH]`[[AFZ}[`m}^^Jg]X*_(nJ GI,WEC]R)3Vx[_.zƍ9?O1 B qK/4v'~$}p H7ʍsܦ_u}b{.V'P:^``-Dչ.ac1"(+ }/zGuȋ1 vM|#E@$\2Xm2|F6lHZE[lT-TB#˗/pDuhTnS3-[[2} 1 7B!4ml^k dļ\0upSZ)e@RNjS^It]F5}AP "9\hH .x-7қUIo ?@+<ɔ2ԼE ׹KA \"_]:WL\>O~ )#^u@v!ny\uÅ:m!bn!B!ܲ`)>bՂb_ F+uUT'zNƍOSq UjܭHmY0x*,@UgQ8*J^mpYLy:ϪW);v8wex( \=}Æ Vy=]K)… \AH1 >[嚯߫⩊( BxTwWf=}B!nB!n\ a#V`,TRTx2Ss>`{tڕXu9жIGoҥU:p[E[[4ﴽ/~o{b3QX1wYx-"eJ*YRXjۘҌD3\4We )] .B7oLSK)n?d|B!nB!BE)S#`IK)[Hz/Z+yYK~C`?Ο?t`6U/ U3g/{\Q~pcQ9-pzT Xxm(тLkXeOrp&9~]|cQ2䘠oLJa\)\s&{7vT-[fM!nKuS~9P쳱n-o bC!B8pioe˖4RۢtKag0K3:g.\~+\3k|%,krjc@Wn|໖P5-~vf2%1*_8N|)qQrHD:7p-n⾅۩9SnHA!b nryb>f;:v뭷Ɗ)b6.ج5k4;^y1IH TfaDz?b%J0w&N, mTtM/x1{<}1]B;.R7} : !B8$pxKFgx/تULmƉt@]*K)]#(U4Z:#ҢC4P e۴i4bɫԾPy?@ %]|=DC~B`q"eQn,-:.nu#qSrpC7p aougJ(5\g.X…M\ꫯ/^b[ŋk׎,Y2VF ]vY\b~hJ@aCco;W\$#"j,I|˕+giܸI|UAP_/3nUW]. pǵOzV^|#҂d~jmқo{c}YLL?kW^ys&{a'!b-YĠ,~K7@ut!wBfU~GifH#OʖcQU~{KL>AqKgH WtT]畳Z0͎glx,0*Z(_g?K/d}@[$:%OQ(eן{5\ NT@eNe˖s6m ۶m3~߱ /0E?ϖwj_zD՜%~EoyOP}UB8>lX }2܆ߴ8C8D\0|ÈwD@.7!vR_,хF%yPz@ ও%yDyQZP& GpG.010sѱ_ 2/7=  P.FL0a vW޵PzKvM#uD/t5?=e8?`ה^c 7CUuۣ߷`f[CWu{.1Iv(co8 'm&m,}mzl /K_Dkw3F&hx=1J"?aүaʨߥ[>߹sgZ=ӏP|>0 p (TQ}Sc=6Ac+Ԯ9KC)ZQk/K *{Ş{9s=3"k'@gG*~+E˘ [ T|mBɆg9Y諰;Nyovs[lOgT23Sߋ}_~yoŮ@]T)rE]S#}-"\P$H ؃[l1{e˖,hq(BP )))ijXeӦM="ׁg!:#ZLz<79v}pNNs :3K'] yΜkCf Ksslϵ~3;v1Mu7u/s\D+;&}AF - , t8%y?F\ĥo?oI?L>P.<Yd?}}5,m;e/n?7o6M=+W7 Xrn[SX4(IKc^(ZQ}yGqӽCY.zTA@n38H|&ب^5jW=믿^qҿ2 >5Ŋ<v70^L̔YIe#8{HƖK+$O#8 ,3 1vABr%u@8~Oܖ/8[׉ϓl.%|͐/e$Yq$_v rZ6a\9Skf_׆1\!zsp򚛺؝g<ΐ'oG>3%&Bb<cC{;!Qen:HP0AGKCBGIA2J yʢE4)+Àc%@hB;όy8<'~s} D4fI>PY HQ"گeM~)?&ynvgDgL )0z>`U>h u^Kc2gRFά5`u}*s{-yz ꫈SEtm^5?my7; Ɛn,:e67a7t7`<#0ɶTw;b9xal7|rl fLY3:gomH%W 7ؼ>UߘYk{swB^ e&k[bYv⋝"[<oҟ2C]~Ps^ΙڌPyGrX.:I>|z\ؿ&اDOJ.R9Sڦױ/clKO3 EO]|J:۹/pOXHk%!l/,?>0IslS\B "_&MJjƞ䑱1kQ^!c;1%'TuM,^,`s^M t+cU-s?= ey8~AQXjՊq/`\{+[$]&R+?mB1x:/w4eFwx؇gCL=p_11L>nz&O!ƿL GApˢvsqG1.m|{<9B8l.FCVyzؠVbZ5j6F<Éջ@V!uoAOΩujҳJkJǟE炑 [ ^9kw5$tj`0s 82|аws-QPzqRtizL O==bj>&ON.A^hu]q HM֎a=L@3YAI<,ǵDz꩸YԵ7a<~\_ꓷ9;pXŹ׉7/cɸXJz5 XI˛S.ܷ7۸g4'k[ K:)u^?ϸܤ. Z +z62Źr; ,)e! Yud>jiYU#\7ʨ䡣sqqZ #PӃqqD%qU;O .0F:8 F@ ]~;y.%fhL0=F'K9HJ2Sf1Nb4Шd +uH(/ JțE8g`N{7x]:.U!-hq?6^Aѡg 7w?l*pJnsW[g*t>Uնu9"7cZ[fNwUCWR4cYS״J%2ࢺm^mn^`Hy(CU s=x`$WnyWb*Xƾ_ %]ي.VsSHq>b^Uܕ36u?iUV[y4sX3;_*>~fK'lTrU׹K<{LT.}Rk"\aeO[lԼҝG /]ʔ\#e|RGMKۭhC@<ڣdmU=6)#ڿi 63j9DߖJbF>G6eF6U ,b;QL_>}N9`-<3ٝ@_-}-ju5>PNQYmP?N*֠b&D*]KVklr5Vr|VYpKiSx.j֮LFd۔~ܰ)K fJSv|*TU@uR] ,ѿ-D\.G՘ Pʡ0~4[j Йtwx6`Mm7 zn"p~D\c0Y׀on硤$`'z @K04ȅLYm\`•M & 5y|`)XO<9CE@2 fv`O(p)3Fy_^=ɢtLfk۟/d`0r-=7?tQԮ@O!ޭ? )ƭΘCAj#f<{LTRxǮZOǹw Ag%lΑ16m1#y@]QaiSWK7 )*y'>k\ wͱ,tge19մ<pC8,. "F/\ pL >Ӄ{}Sg1(ٮʫ1(tn(y}ѶjWQ^Hu7)VY̧aƙgu*uG{@ V!k=v1 6u Tr|#.t ide{t9z 0P2dsqwC npuhQ#YݻԶ>)Ըv[fMw}|*5(_DXő'mQ߱QCc,Gfi^j ~S/8Ѩ^E^߿l0@6k`"Rc Oy@@ǻc"T}ʗlᷫx@m? 9J7S" O+ VGQ' Gd`p&3Z/bR|aۡr>d ~`>'.W%U}pCJ JTos+N[>ZԋqqNOQ; XW DMHP~` [*Ccwnj%84 oFQ\z84uT.L~>0n.- .N:$JiNקuw?@c{hP>V:굷@NR6Iu#_aoRdws&%٦6_=U_YO )/1pR74(,Mof wW]("Ucp/(4&!Rǁ˂)Ϙ>h˥g-ݣ?jv.Lj'{!B b޴el ǎ Vܣ<-RțO0@25Se)"`CuPO=M];立.[D`]=W(ѵNXM*ˏyۊ<WU}~V]5.5J͸J^_?9 k{IeAѳdXn!NW=U}uu\u8z/v= sA߫ w /nո2a pQ.!/5f0:1,eHpOf[ehl W*)-(}2,!ßFtǹ|~i|,'}P^UyF|:`y:V\ʬ&K e@@zYFL(eُ[Í2O"[Y&&F, st VL}6D=$[j@Z8( ":[mL۟m(aޥm,Wݘn(mPHx%fWضQ͔#vvk]&sup+ ~Z`Zk;P T忽 pL,&FڨRQN9L˰߬۝R\u[\ϋ[>Y4a|_yDױ[k{Fa]˕QSuT63pjWaЮܠǐQUjԦbvoo\^碯!O>hەL&Fm4}h4sfpIG[8Im,V~#:Mү<+|&ԥ$/zi1p:vZ,he0Kpv|Q3V>N7-Ehe\+w?m .fEjDwbf5rPEeva_'XgIGL__|~Q?M2w''7OobWS~AaSc"f!.jQl } vS*>׻(p@A@m ="_,~n2ZqGuNo7O؏@٤3y`V\pׯ_ע^>s?p駧 MF)vTPԔPV%BXl`16jMi՜oAV'50d)0Eߏ͛.M5rB^E+g~ Z6ȝPq@K2+yM Ryʷ`^>&`3r P QתqdIZJP_XqCȬ+F-5v{0U%hP_H$ҝv,/3My`~GKͺ&y~p L91HwJ%N)T(~PLҰs? X,`'-JWLnp@ zOp>ѳXVf1T#oCOs؋k'm&q,0#c@-Fo#vn^"NꝬG~s 2Nm2 ;Sq{|25]ys`_\́\::~ky[Ax˳713.ąBvJj۴oi&M/w~i&Lt_$ERݾ+mAnQVYm2f,/. .u_Un+}Caq0'Q%&0ߠHWyvpo\D[nHx<}+"9JW યGGIEc .}}$>1>Fy1:(ER4HC}_ -jv$jj0+xI`tm;~uX++:/p?X ¶h;UI͔[FQ3W6;Ye鮁cr)QAҥ cyjpC86Rv 66|>2$sN-(_J\&Q/FOFǘI@f' ~2@]O/G L=kH|ζMoMx+]ZKܫVo-!V? FY{Q֓:ԭ0^C`i}&}wye\~P{jO<[6h)A~(ܖ_=AvW|^]AOܲc P:1p = p e:rg*7vŪ(䁦TSu_9 Oq*{;·ΙlQ/|azx=u] U׹z=!q?uDV>jpmGjϹNr.HWhI[95Quų TAc<TFkbn/[Z:4=s"XQ`SV@d+`(OJ?|9~ut}x@\ƅ qo;*9|T N+lQ'"zS03ILѹbz>}ݚk{m*l5k淹 JXIt}- UgWe u(0 ]߳"Ď1ϛpjT5}ȸdO݃'멾j1u)zE5>pC7bѐcH_cP uX:wf04IgQ1k`t| 34T 2ofևmt@/J'i( 3@7&`҈Z4sKsT/c t8k@z 3pd!%`K;T ֑mRg{ث= 8?_I9_~q> 않@cq.#Ag=WlvMX 7eށ8q^t|⸐-B0T^1UƩzZ yW!roWQkr}Q^¹bHL}T;&PǬ^ Wzݢc5xG"ۨ{M$N6=u|wsP&1+Hc߿Y)pʇ' nTJWR`x_Jw~_Kl|$F m\3+~f8V=S|` GJ,E̥JpU'UPcP#唝t"~]AZ2FdG _ۇҦ^>/ij7^kta%~8|3j3 ڏA1Ŝ~.B\yCM_C^Rt+3 ;ML>;* !E⼝ʏjײߣQ- o_ +`O`/ۜ\p>}"%%Y ď-zģ7}^i(O#Cqu2.@5bf8KĹMWu7m/";ˀm)U䯿@+drlg2@Z(ƋKY{B܉jAq\ PV9^5Rqԛ 9@-c^w`@[a3t' j].ѰQ\zP-e)qWh`EM'zNyAj]GVKs}=21k1;yd* n 7*_&Uk ݫc#s 1' 2)C68%\A^[+ R+eka"]:ge>r1[E lyZ ]yȯp+aPs ?=_(Fs_ &F *in/# 0X. h7K *䉼љdAyFu})))>ޢn5H] 0ohXԷ(($FCm/( . f % uHS&܆ʹlAI}{[%K| ?/~1,/߃vKp5ө{jpGo]LT`6܎?uGtuw)T(e,y]ճujF}۴Utp j7Lz:Shv"ߡp @\&(3]mW,*7 Yv^{8\zT8=/jdW9Re:ANim3*pMYjy},Ll13`KUr69U\.}5)MU~ga3Tg7=B#`]RznW&61Ftecu5z|b#B)"}kZ2zԔj_'P <Ly#`"7ӏTSJ- W z |C*u/OPe4أ..pIGv{MU,1~;xEyM5&5Akn (spQzLc XQ~ n@WhQ$A} k>_EoAH_' :ª/sCݩzE5-az=jF"h/nR28/ (v2oމo*'-Xa7sQ9AѪ-L;7\_GhMi!N;;PbW[>pC įs.=MT"{A'lD~ F!xU~) zDu6 wSA6pܺ&2!mrWE}$ Vl>tM={K]bpL@ }x+phʢp@iW}S}_D HoRr͢lpu=PFa p1dl8J8=أd\€Ĩ Y԰q*s^"XTwSZfkۡh*0cQN1m޹DnR}Ɠn3- Hi G'w+7\J-7qvX,;.;eX3ןF!I>@&QF3mhiG}6K&KߠSyއ+hѶy,v!bF]@ϠI=>z;.KQ25)>çx߳Mg p N[u4|E U'G1U%Tp7ʚq-cMݩK8 T~Q@5{2=1<2ST/v*' cS\]c6#hAf㸕:Gq _ 8z1 x YR^@)<6JaW0vWb\kkt-*ǘL>V3x:mjų|ΈzvOP}cAn\.m7$TC0ӿ<28aC jF.[d$W^MJ礱`VZ FًlI6=E, m4K|e7? s&>jըÈN,'U>>_27?@PE"H @qL:، \A J Q\}?Рj5˧:8z e{[?4kBOJUsk?sl|6 ej|uBC/ݴy#ݤC-۠$إ;g8{wn.dnPzi`s`4ˍ9XX mU+&/p6iD^w~ -)*%K} NߧʤΣ( n%lcOt?H&ќ` 39W6k76K.^c>vLI9s1E"/yZ\;{71,/J`n!dXx~ KvA1i.=`_oM?zEoQo~RI l`,uA%w/ڱ`Q-0TeP=3\䪟!@ S-!@U\TD ؖ$nG(d=_L n]<tWُfee}:s(PeuKI4y"mל\lOƈ13[GF 851Zߙ~۹~ex_+?dX)޺Kr ףոX܍8{UY^E\؋H 8W"4RMXƺjqQj/|'oRs6NڛzGcc+&5KWR\ "Q7 .tjsplR?ENɤL)*6}yrWv?wX\'GW٦2/'\K&SF1,1sb144  UtrpHa^y6K^3\e%*K si xJvrÿ:knH(b5z ';}+p,΅B f o~r}7wO7<奞b\:pb֠i ݼpJUKP3}Q#[vxY"hz_~F#w7խbF}GwoG͓g򓯞?|pT6 'm_E=P5ߗ \gnE}o pw4[owPIiM۬}8NpO;hLF -Z6W'G\\ LuPM'w+[q*|zwB@?C"G NOp`V@עP0o:UlGn>mĽPx`zp(9IAoJ~PI{M\غ*+[x˫貁 4/K_בrS" >FČQs({+c ^KO[>,C\^MgQ/;CUطzVeSXp9P_85e\ +UGJ%o w|z0?QM#4&4+ĿW,u" F\++\H'Upy9g v?>dvn@˹[Z3W \PYR/>祣G DO?hn]})B6⚶-ms pfT9)6[/>3S_ݹ8 DMsrYGy>ɴ$"m}ݻ po ˂@Ve`|n*1>x"H!EA=],EA۵\-bf.̇nusomt2SHjuƪϚ|} `Bey=\@mI r,c=r BWѣ'LDA%j iӚs鴿E`.++j?|T_V,l[i@z?,.D4E~`o(wJIC_b#d2\ FN'r yu0 e.cyUsmAnX ȊM2F 2~AJ^JS(UU_OQgkcT׼jw[Xao\(ןELfX\ 00GJjYe_JF+(yiƍaO]ߛX4 {u ҰB D<&p[BGtέbmR_V(0}l\3"P7 R"Ym*j'L4=;3݋3^)\+'+Jip\.אq8|"6a p1 /ka[f _ƌKp7}#1|13W$\ٌW_6(i4y  jTYDҦáн+\ecC t XP.qs\fn@cTP|a4\Ĺ2wxPʯ9s1PEӼ\ՙ9%e"Uos"e\%Z\M\Ĭ~y^u {TK Zʕ\ֵjůԮe pDp*yƅ**[WOK+O /6[;*50w Hg ;Z^}Ť6uY2jbʇXπNcx1L!%]ͺ\9OХU!Ba {eޣ ! hhhi/h'՞\S/F%3m$W}-SׂCQͥ& UW$P:¸PyIy]d?/syg!ۄTE̾>8 JmPˎ"k06.Z>k4jk@ ^۴mwskPET)|wYOr?ͮfvv51P!L m+ n@RuE.wYwOvn ]A̳ePV@;>\cj0W cFCZ_5xT lVN E4{ ಆꖱpG9JR:qAz-;R_ĞpXB9h3`?QmCZ,Z( TN{m\v!}'\?a WU^>mK)UsPsm~(]|+H6 0?@q\رW @G{A_虈ut0xL8ޫK]͜<ȉrL;7$:V`Sk`*k \NDXpO.۸t_y|3gQBo Bz8u؏CnjABVFdH+3p#fʈGu`+0*Qu\=0>+L#㼂0s|g_0LM4*4~ ȀtTtК_ >u@]/f J>$&DODfc՝s_#DH?xL],yyR+* ZmX ࢶ[#-3*v"wr>EPۮ2/[\'\Uj׬)f9oɄ]\2ޯ+ۇPN\u ֊|6[2|U[t1\Id?WQ,߻Gk x&uQ+2/7 BkNN2@m#HY6Wi4?qoO˹0'( *&UK^}F?.R:* ꌁ.l\-zPp\\J l6-ANak9 L\<߈YY M06[ p"<~tvwWm8n&>QL\D-B<`F==Egԇi>o1P !GM)DNٜ?|3 ik?^^ { (`)CD-!prC& S&q.[xr@)T? :pe>KX땸UVt:ոlAxO :8 l؄|XQW]4IR\oվ64{+IR>]4UK@jJ]z-&58WTnjw 4F;q/] H k+1~<*(abʙ 2L v2j7|7^6?zcLI䂣Q(_⡻̨޷)wK9n~ ^4Spg Ѿ >{ iXUKCyܧ㘸5iFN,ƽkߩ#Q(2ɋ0:~f vo" +h[תaioP6f-[ƀn P7nyRb()x3;e-/5]%]@*n-V㩧]mV(ܶc3T7' ,y"K<}(ǎZV-""X濟WLqxk㿜Cf(thG1`[GXo('*lc6q'0ZAIO1?z@&>'/m: ȧG)'VGy|dٮQb:'|[)gzF@XWTߖ=w%TZ.ְ%8Cc#3ce\-U~ Z-tO? ncXAuǜ)wq1-(mP4*`+*{Ӟ# `ڮ>zkyKUyͭ\tv?cd>1"@:]uUN㤷0}Sת*x"ja\@P6ƄCs-Ao}^5,qKǘ0c`|6࡮\/ZI.x 'QRAOuPY*\\HNyQ1w$Qي Oe@ s n$49p D{p[g?SWR'ww3_cn4Oϗ70V.TKXû%*EUVrֽ瑅[f+zκ0H7 t\c?!?&Lk0j{+k4>^g?fd|֬jWдWAʬ6~B:\zs,zU/8g p181>$Y.Tʯ75@ ձpy F} (F zKnj:0ߘQgp\p<(㑿oX5y@Ef;[u DEl\b"e G 3wnܕvVƘ)mhi1 L^g4 3߫6{#Y\* .3*Ӻ:W~ٶ_^7}(17;qSEwru6 u7˓n//X8fMpNnجt11Tp;80}9-2y$aV>er Oh1dQAB۩kMʠE)61YhCp}o#cTWxxKSv2 !C_]$a(F[-1OTY$ v̾\,@\"XJX|ٲ+RdI>; R8X;T NY-TQ+]b#Ϭۼ}/(+j.@[ŵ2` p bꜵ}k0bpy\zo!iDkQN@} ոHhc Tm&O~*U#}=}_v1 `g<]9JTQ 97º5uŰ@t]E d1GTEA@0T@ I@, f?l Ȝ< nNzDyFεij OeqxɹY3.B&@ΉܟDKP ॶ]W_^lZ KγY8;6>p~ 6UFƙ p5ĺ[T_gcyo H[a׬i0Sһp PqH4HDF@rp _Be]i`x'e8x xgś/֓2|' _@kD :|% 8؜G27y1v#Y-Ic38P:~>2 ]L;-^Aqo/8Q3%ތ6:Elw\_k{0(xK{0.!RKT2tM2蝣2Ow{ƩN{! zwѝȣJWpms>#[pe;I>L_#6SUc/ڃi er(׊ml1qA+@i.,p]:ev̧`6#sMB\nuc8W;Fw'R_'ap:awnw׍8?I&#p'uuyn3,`d ,rI:F= 2X2.7Kk(_'N8Ѳ4M{1WtIQE,nPWx3NyO ʼn 1.WuxL:9N ͻ鷵yjm тc}4:1f I83puAxdھs/_)o9V"iB'f:2ӊNkhܢȆ"%fx'yc^a%߷?:Xj CTӢÐ'tSGi_su{INnd:9mtR1-P2^~Oel({ I??~V{48WxH[:IuNenmyERQqyr44ͭJϊ8F"ܯ\r~7e pYFMo#ċ!6,1wvE._ n>oh)X`-˃@}kw~T} 1&pt| y[٨j:MNX`Kq/9޲*B _0@,Dg ~(2QhSoH@4M(`nt؄^q)`wA9rve5ppWyFx[?C5 0gcPkS Mz: 6W1,qdV0q܎U)`}?Fe8-x{iYP'Ml@6"5^op_ϕ`g+ɕD͉r@I]>V'l9?wcEơ ixЬq{Ȝ5֝kDS_ϻ59ZG# d}he#_&.x#l[ծ{pΰS$:Mo:ۡ\s źUJ3UשZ~"?d1Q(+j{yzAv:Bx-1Kq"O1i1[ԏ}?H z2S0^ܮDhmX-\̬w/^ax@DV׺ҟ(?MxjZ׸c؝ml1PaeÜ?S͏qb eZ.P6vNGesSsCR7FNfp3NC7KRc.9Hp,1N"Q,.snF~))X Бq k(U7ܨr 2K :8o"+ԙXќeC>2jWupKyN>sBa~WXIna.yƅD놺@úcѕF[gdN /P$ft֛YDСN[ T2d۴l(}5ע,<‽?;ro6;,qfݸ_}^Pva^Kbwiq̗>''oq峱cB/%jPdfrxYtp>y8CXmhO{;1+ݥ 'MpKpc|8 d4~{ x[`%Bn s%LmM+EvqqLD78tz{|9Bnc^|c*Y<2F%1ON&ϵ@[m<Ƒxxh *NIT󧖱ٜ p B{0_w&1 @)7FQmG w+px1o+7{W`nbWGߴCmp|%04,|3F ]v\Q\$5(B.=Hr2O!܁K.qY"\|8Ru_yݝ΍l-f'[\2L-Fi˽Vm-%JGH[Dke{i|P[2UarE^+lY.dqCSs3JGڀ[X ~:pù]\á+q N@ŢD(G|]U# 9WiOf>YgQpSa<&fdQޏ&.sx9퀸Eqp}8l#Wl 0e޸*L<'2` .mLpX&:4y;e^ȉ(U\<#7&k~C8K϶ש{;vFIlC|Aϸ/" pR+~X>\1m#WmÉ"^X3\^8~#Ki#U!.'O@'S\nl)Dܸr3) 9D  7r{dMs= oF@L>eZ^'ڶJ8^*'r ӝyg;eqxO"5NOfXP-'o,/=%KuWfIDՋu8K8f8W;m^e-bmdЁg.N2q HQ:/ja28A48"lǴcwUO/yy%|pKG^ܨtUp& lQP?;!yXbwicf;Gƽut ]+q_.66/>`w  pw.wM[ \pˇ]ַܸ] [rrToB]+)8u2'tV5K_2a^@mVRO `vx3Y1OژyLd\ ˱c>:ᘦc/: D&KN}дWpp\{{p{3,ocD 331\r ?.; xLP ā2QGz uґٲ._@#82rV;-0|R,D/m}egvbp*lttHu[ -! 6f%Wx\`Ίxs\r89Do@UtzspE;{|MnC΃ Gj<iȁ|pq=õT x)eKOӁ7 W`qtcyf!w%58Esa\hXoE W$Q\9Fd&.(2Lqd^hoŽ9\(+ܥu x#((#9X/ +m- &h78M]Oqr<jutr/ i#*uQΎٻڎ hOvfr '2web=p˶}@_b緬\p/h{#`G D* YAߜTkY~|iQ; ^OČF2Q չS/T7!XD<5N:XgGgbʜǴ7fnF >N J Rp"/` ZL=} 垓iwU3:V8qr5'  #(C ByH}-„a<J'ЍB{iԃl/+"N@7I~0M*Mne80i^Wo< `imA0s Cv/ RhWͩ_H;ẍq82h+e7^o&u!#yyͩPQZ `I_\q|Y>aCof.ơ űsOǷ>8OR?\Vy3yc|Qzц%Z:1+.k|$}ݠoVJvxy,bSP0 BhKV$aE#cN#L0=Zɩ.8!x[eYr]5тЩ\M ?*aBŕ;-<@slYVT7i og!qCpt˽epSiXFX<nLnf)JDKn43C)MnSXb^ԁeQ)wp"U p9Op xPǤV@>E !cDX>wyr4f<89@Z;t"CqjyV b̋rx8~pp| peqF:8YSK-J5 WP#"to\]I<8}eYk6s!^@q{3Hթ[*i,t}H8_},˪ PEQhr&(n9pCM0NXnLqko7Ѽ6jtr˼1qJ9ͮ[\2u1 p p-˲,25]eYs(&6u[\2u1 p p-˲,ZnFI~AY߿Rzu ps]ޠmCnu\`+.+d9\ڛOJOlqⲪt#2,˲,k%k7d6`~ꩧ~z5UUZn=su*iכ[&mm]JUvtuG>]ݺ*˝oO﾿Ccw^|nZ 92}wYut)iƍnժ@\ʲif6F'Hox*+u?|~ivw\v2AңGlXeYe~|~ԩS'9oy睇կ_UP^Rʋl]jRVZn۷Z}޺jZ[z"K-MmZZ[n>_ܢrvucB믟.ԫWٝvEͻK,lm-wvKYvmv`խ65֪Ye5l{uԨQӧOҫW^͆ekYeYUW]\tE%\ԭ[7n5jRjdNVxLUs)uQUV-jBm"p njwAB]^a5h 9Ù^;ǖ[n ^1^{ f#8"\ְ6ǧq.e]3nst̫meUy5jTO<ѣG'3f͆ekYeYy睗(6!?4j(92Of}uqYev s=2jǥ%{gc3w[pd_gjժhѢn:sL9rdrA|4C=Tn׌^_ݸ6|c뮛6l!C4fW_}5b-2ٚXmau]}s)v1l²d;餓3w}w"KƏ ײ,˲߯뮻.˒k&9묳#<2qqYeOq:s{r!${W"z꩐7}t%KZK.\xk'mQӦӹ͛'_}AAٳ{챃*WV/{c{nHp&:xMZ =\V1eUp>|'D;vl2k,lXeYeYe^yOz=\R:0@WeVy o@[\?xUVao]v$tRD™ G'.`cƌq.eYeYײ,˲,˲* (68p,i׮enRjժAN:a7o^CV-UL6\oUhM74Dr9yÇ`],˲,˲eekYeYeYTD!Q. V9e,I&)66dԢgN5? wҤI^eYeYײ,˲,˲*Ȝ9rdҧOSg믿u-eikmONϟ:#\r\4-/0nݺ%~aN^˲,˲,xZeYeYV?cr&]t֭_I!:\sWԲe{Gyoƿk׮(6 Q @w}׮[˲,˲ײ,˲,˲*Oq kHp:3[؃6l|*Ur wvHv4ܹs -7eYeYVdkYeYeYLSLI~!-d=i+RfʹRJ˸s5j/dʼM=7\2˲,˲,2,˲,˲ CJbǏ KVVԩ6o޼=Q L2ndĉɜ9seYeYeYeYeUM6-iݺu2v\ٳo^bp [K/ɴ~dNzKڷoopkYeYdkYeYeYD,8d{׏* ǤN8[nud֬Y!vĈɼyeYeY+AeYeYU4z;.;ӓ+zW:1St {gp>ɱn۲,˲,Z92,˲,˲ ̙3CeO?t#wuRXjԨvر.|I޽ _}ݲ,˲,k%ײ,˲,˲p͟??[uQ ǐ38#c<,hGڵIԲ,˲,\˲,*K=I=B.#wI=p.G ɴi2|ᇡ@{'?wyɝwޙp sMҡCD%,~헜~Wzꫯ^j5 } cY\]tEl^{z뭷x7^;,>CSunnݺviw 9M/kժն?sWԶWVIeYeY*eYU!E|joӝvicǵ_Wg}dԨQ 2$ -lĈ;'"o_}ՂM6Ʉ 4q2]9hẼxW^ M:5C${83XfCD 3eYeYeYU Uyoe5)O"Z"ؙ ><+$l#S强駟/J.zUER~Vqٲe4@v{B'q|*&8;c9Bθ\/S Tg4O.ڂ­zS9z+hښ 4 h>Er57xcȑ238;\P2꺸u^$@@9 r)cAչʴ=ȿm֬Y"0\_euO"/'\kZ2,˲,ײ,˪p"&`!^)38cm*@嚍6(;ȭm{: #6UGd d {jUA9]o- tqʬt&rk.]c"#NAU ~#Pp+ ^tE_vy/`n{3>LSOM<TVI{jwXM5훵3XN-'tҵ +̙3Z-2V p-˲,*/2,˲*@zdԨQS8cL䬳J.gI䲍UL0w{XUn޼9TR<Бdロ;x<7nwk3-eM6 >Sr0}z ߸p믿=#j5}вe˂^|Y0O>dhѣGa׭%i߾}aekZ[eYeZeYR/R'8gAt˵SNɽޛ( @O@)ЫL[+9Q$ɲ駟̛7/2dHt"Fp '_~3<(^m۶mӧqcdž3}cL㡇 ܼԱcǎay;`OWe[jr pG\Ǵߟ(Z"lړsUjΜ9![ aO?zռu@<{ao.hm\i &LPV,?>8=eYeYEeYUu5 [gk֭($x,DU `*5C0)c8EFEh>lذpӹ0)O8ylEJDI0>?\(?jx&M 8룋Z&: DsD|^Lm^$^y0}l|O$7mHtơLaYpퟶe}"Z :ۓCރ oP|tX^{[js?W9hKK. P1NR-tPxm 8(S;\f!lvxX2h֩rws<߿2pVoI`Uײ,˲"\˲,*u@*B!\-0T#?̞{QDFQFp)<]w;sH&).V28u .U.cg=P"p $(Couhes7,1)S Nhp=HR'iӦƸ|1eOuaچ_'E _~gYEDNp_|E+x2xɾ̚5e&p 0QsyZxG=@P*w{/|(pKvh'ed'XDIiSQ^j֬ 8JنYQD{|;:rd=s <`;bmJ#4va9eoP}اkR?mjR!HYײ,˲"\˲,˲S.;ޯۓuN;[4h:hf|tdp,J~_G7;t`|ô~E|M=&X4\sMAj# '8Xve9[0c8~ AUMS)F9e]Ep7@ּփ+pAg4>so˺FN!/篓"XN:)p裏B[nh۝jWYwcH[]wiMՋw x\LrۆmGelƉn˵\W}]5'6! QG{饗_*{:ۭ.w 9]_zxNؙ{(\o({dײxl gGApUT)7 yIu:ձ!/.l{C8ZeYeZeYUJpBQOX J& %馛X= 0Un^?Y uYgATQC~&hD %c]rNj {K'%C Ե W9qSժUSWuqU}}E[" pqjZ!:+R)y fQ; .> +oDhݏem-S< @[ Zԟ'O8nKA\?WUn 6Oa8T?) Wَ]`L >miJO[Gƅp{;*7Z~mQZ2VV-Í7yS:_kkx'QaEMq\eݱeYeYEeYeR\S]ӫ{.wɱy~ .JF.t%>^Tl(Y'0pK@ksR~]í" Gg$3x㍁=TrvEӚrʆi0-9Z(/7Ž+Džҫ"\DY GfIb 8Gr5c/'٘ʪ_wy*$u!s  b'^=@v)WNb!c A.183@5 &RL Z΋mx4딸$3XnJ3E^l_m[ W]Y9^ 3fʻyg̗~--^8tXZeYU^dkYeYVq*30m`PT 8[] <ܴg,8,XGAڅ,\uuQ".@@a|3?0De@GM+A+ JrHTTBzd@c(M/!ͫߊ@$t)4.9ٺ  : pK1Χ8if,O6mpP0Oi!Z^O" %:\cA@c2\T0?:ti,t>-.8 UeLl I}$fDlLC)p's'vm[<~оtV2,˲,ײ,˲RL~ [#!_Е{Y7"{p悪QFJwp jcRd "h^TG ?uVN1V 'FG1>OѰ;W8 K"ܴt(F%TU;B29P3"or2G* fn2@⸮e]v:v:ɓ' BS}NQuW[n!#]1e3wzHz!hZ':Q C7gW&gʭ}"DGBF3vDl[O!@Oc=z$tW2,˲,ײ,˲2.П(r 6 ,dQ=Qn|s XT]~J\\ …KA%Q ]z(yUN;iS;<]J- Gˇ#XMGd9]tx )h"KU clC>v@ c}MP, Up.kH;vL8.("">f:\_ ~X =.o-pGv@^qar>p .q* \-w OmbMfUni]aO|Cn Bv-)h+H mħ@^8,C֯@=^G<"p388K6Ծzu}rm@;1* G6 f] ml|m뀷l+lq*Kybό:$6:$׃&la``PÇ?K=.h+H'E\`p1' g=Nb%ν<P25Wvg$kK='Jff ml>}o)&'D/0K2d3HCv  ?[e pi~'qfpiиɡuR[m+Ěh;L 9 V^miuǫRW:=QVײ,˲"\˲,˲S7x#QlΤyeWprvoߞٓ{9YjܪB Uo nTn`9By;A".Xrl尼0J]=+*Ch5wA8OL8Q ʷ2L+ue\ܭY9sfc3rHkFam@=uWuІX@1g-fnQJ.tJu0vÀ#2hw!ۗDLh[PܯɒX^patdGƲ @SLfE0\(@1ӏ֪38cJe>ݒNd T/dg]\CbaM/wr7NaEb DQ̶8bĈK ZBgxReYeZeYU (,`4ဢH* ٻw0>W3>ܷW]v pJ8^V ԩSM;w6+::K_9/sG^H%R"}tZ Q@Oj$:nƚw.Y:\Nu_p"\rƋՙܶW_}`qWF+d 耊 }3'ƙK_qѭ:'F# rm2&<Ġ>`jܷjÇ1ox`ao]N_zcJ󰄇Eqx˴ܥ}%¶GCeYeYEeYe pƜUr]P1 ëӂWqI>%v%XQ "A w;kbgKrjbWt-RX% 0^m .!,H-X>EA L1[j f,^qE{"e! ( F,XecΣV0mAK}#}309j]~\:u+J,Y Cv`g ʾ +)s2-[}<ۊ=:ѫ W̍lk~N m]NӃ3vyuGA˾F!EJLM[=|Vֿ͛2ut0,˲,ײ,˲T* ,rzhK/DͧNpv5dobmFZyu%@cr?6kMzřd"RDt!;6\pq \ܵDL^"@^ܷnK9P:: -yYW^|<1ȅ!P$+Eh3K@~Zǐ5d;Ro1UUU$"bQ:),zlN+>￿I3AAClu릳f: kk2ű W{mcYfM@mTc?T݊f[cy#\qTq=i>o{TUDP'=|I1܎HUǸjTYs4BG/1Ӹz0,˲,ײ,˲T*3@C&::ZnZX JZʭ|8ˉ{{@,\$R / 2 8ת`UF0.^]I6gT.֝ɑ)t:ߌk<,Ǭ\=ݸ? 8%9qչ"ȅH`- \&XɢB`N- WĎW)2_Ik=9'eϭVmdf-\W[yv;&#'8uA}rY\E>*>(l; Rk1Y\a pqX-qt<P@C b-zq!rOē&MJ}ݰNW3HkY>[0ū`AvYײ,˲"\˲,˲S|^3gNH z|qEp^SLz:dcY @,S*ӧOpE]x\wW ǧܵ s6gsbkLt4mjgI}[\À3:gA 8]\`Wz]0-xP'ly|bG%3V9py}E ,a WqBn[kUrhSReOΝ~+8!>Yu.DvWD;fm [|U@ǩ=-ZW)*&X*x;N^Ic93Mpߏ닿OE-$WyQ_yР\mbߒC|*1d=>P]W|õ_mEGyԁx @nIDL̃W-5ɚEɩ-Ke)\˲,˲ʋ p-˲,*N(={vdxU[ܢE%#ŀtnpAYL0^tC2-`RGiŵ'wuvȌEtFt$aĉr~ D+F+dAeG#mAuU!+qơ~,I^pa@<"PWlSEb/ρ8\ae@bWLirFn3,p1pY(d; :q rǸb[˕7.yPA, 9W1_Z( #9@CѣG/nj5)m ~qT.ؿ|="E #e)\˲,˲ʋ p-˲,*N\`?>@;^kX FN u125L Z'bB<W܃3'YD! NF$_Jx *ᬤ>8T ЈW&Pȑ#:4$t] Gp]-`B,]t %)ԛv+̷jժ1?:!c@A:bz$܀:cZQFva"m:ar<0\ayv.ɴ',mTmiE#f͚HK~,òQp2}w/m/_cڀ S/uٰm0!{mڵ~2,l?m+N<0AQm.l<Pvئe)\˲,˲ʋ p-˲,*Nh̙KU(I45sU譾0{\Cy\*72pFbL^E2lkӒ ԫۡTTTBhQ2]^n ˼ːMB7k%* V 9rQOh씊!c | .Xd:)MeYh dd2ֱNhlԛ .@LkED9[i}.1 2NQ^[z@Ȟqb8+A=7Z,dkYeYVyeYeYũZV*^ ZguJR4N*@g:ǎƵekYeYVyeYeYw%HʉMZ (v.l׸2V p-˲,*/2,˲,8Du-d-H:!zuvIJ.Q\ЭiTօo+EŜ3+ gP0aQA@@QD0EA EAĜWt 3Ìq^VtPU=S=uZ2,˲,kY :O282I0`W>eYe_X쌜,NBL8`,:UҮ]_}UpOekYeYֲ_~9a BiMTkeYe_,("X, v[bN=OpYjEekYeYֲ ҦOҨQZ9;c*Uw;ZeYVn(\l۶m=-OZlYBn׮]~%< OҖeYeYK[#FHL:u yzjOZeYVTdk-mZeY45s̰;34i$R,N?t[eY ,\kiJ]w]\qh޼ydAboxeYek۽{k׮"kI-PTT {޽o[Ow\~->g"5N<(X~WxD-˲,kV.=a-i暼pr-kIcMԩckYeYVt`;v U %-[ܩm۶Os=\{jժVV-DuQ<ޓFAyqq 쯿"eUI@lT͞=;D:ֲ,˲V`J+5p^pqYe%>t~qY"eW_q8B s=-YoeYec'ԩS 8PQkK-Ypݲp٥^*,}g~L*}xr"feYeb-78#l馽W*T,VYe_0a]pDe3<>\pVM²,˲,rp۷ow}&Ao"myvi6}(=Bx`(ܷ^QxɁK.QeYeoM( ;ZW%\V[pY*ڵk'_})IXeYeɰaB*S^~W["mV֨Q#UJw{,('nF`A_KxI۬ !;oB7=ztU}gwͅ|oJp۾T eYe\rr$z lvɪN,\jg՞ovXeY5m4r'ON9D%?|\|l Eݞ۶Ƃe1eBMv[h&wܹղ,˲,˲,˲,˲,*Howx;eʔ'Htr"`?lIam.ي7HBڄM6$ZeYeYeYeYeY@7xWE&cǎ iYݵqۼrI DoI@zE-˲,˲,˲,˲,˲J["s)mn\jm _׮]+ݡeYeYeYeYeYe%gI{@Z>w+:wJR.}^Y#F~aӧW[˲,˲,˲,˲,˲2B-H|r*6[_6\"v1rkYeYeYeYeYeaP6*6|ٳgglCmeYeYeYeYeYbx jJ!M~| Un޲,˲,˲,˲,˲,Znɉ %2װֲ,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲,˲g}6i۶m2hР/O*Vd2weYeYeYTtwOdƌȑ#O>cYe/M>= G\ve6l'..............KNn-y7BeYU4iҤo߾W_}\yoJ˲,˲,˲,kآ:袋BСC>cYe/}r}W{?_pqqqqqqqqqqqqqYe 7|GaÆY޽{{ oYe/G(M;xB jp /^zI3]v@޲,*_bm'ԩSWWܝ..............Kl&;͛7o'ݺuKeYU']tIڵk4h ,˲,˲,˲eA 2 !feYUn4zI&xKx˲,˲,˲,ZqM&'ONE,˲f͚%=Xry%neYeYeYLRJI˖-Yf%cƌqXeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYZ/r2nܸ[nJ=w}7駟3f$suGYeYeYeYeYe-I7y璗^z)ԩSҨQPt钌5*yz+6mZi_,˲,˲,˲,˲,˲&N/O<1y[o5ے'|2mٲe2ts{ȑ#݁eYeYeYeYeYKD4(ڵk2}m7n\YfGW^2~o{@n&M?0Y,˲,˲,˲,˲,˲XÇ@ SL٣N:V^==餓5jjJw#<\9pmРA"}^x!ٳ;Ҳ,˲,˲,˲,˲,%mz*UGqGyd^;찔rqǥ_~yںu&]; Ѹ뮻.,~fYeYeYeYeYeF!ѣ>sC=4R>ʋ aÆsyjwqG'$}I~䣏>rZeY+>S7ͤ]v 7n|bͤIgy&رcr}%۟ɱuY{쑬,˲,*d2m&zgM>UVɎ;X.dKsN`J{cˏ ^7~8UBRJ{{nzJ^}GMbd뭷^]vYrꩧ&\sM.$q,˲,˲,o(Z4tM 3cGWZ5? \֭iǍwG} %WҿӘ0o%XeY m&L;_~~nkku+2L9܈O?ʔWnɾ"V?kM4S"c`rWʕ+'ҕgyG=DV^=̓O>9{.Y z_P t㑊Awrn"q2` 0e˖sE0ӏx:K=\%0v[/Oz=%R~nONr+ltƋXKBz؛9s&>BoM7>..Kiލv]Q_Ubgr.Smnc< , a*i!d~iKym|\Ƅk31aw=?&//R}ko*p'o&@̰?^̲,ZETR$di 35QOf2gI9@} wS7G9(cXTy"\w"O@尼(*x*SLcI*:Y1_@Xe:KENSTZP7J5yxhE[I@xW}ʑJΧK!BT z WšZo5.ܝo, pP>{ae-NO߾}cii.KNC%6d_X,DFiWxa͛xG w}GBZ8.B[+9l}饗B:Θ1{žZ%,dF\`ĉCt. V%^%eY\jذa erW?Փb|+긝,<v"̀R"iBR;+!{)X+`YN`_92<k ~iF-N38~ D ~ʙIOJM?J_U|3[ @"*V%]CϞ=ClɐAQµ pe]L3uYV.y,kqJ&7uY&.>P˱Xu}hjΰxX ,Ao| 4ѷ5-h"aUnWnó9;? ~V"ɓR4hJ )xWWt6D&@%ͿV*%nebk&o[htڕTom1E%ijuUV EEZ..Uƌt b6'!g.ܸhR|Ai>9>C(sf/4hsΩƃ 汨"wk/8eY\L>c;E/kA8ص5ߓVG3EONłuի ֊8bb35mh>) V7f_9rd~ྲྀKYg+X -F Jԭ]Ѥd>7jw XݤaRA؋"?sbTRwq*r.~bJu+U:n'O=T p-\\*R}Yu>ёD$M72 ږ`L< Nu{m/nbؓe;XnGG!h4 yyyǵ,˲?' {"S*/mn)ߤ|mdo"\3$:j䉧 u6Ahu# d/ϔ'tR%Z# )rן(ݐP~^}RE۩S'|ާ<9C@^{+"@Ev`_|6mzQ6m<b0Oa5qTOWoXXkkຸZ..VQ>ӉQ0 3W^n[Xx.cSZnג6\-z^Ø΃kYe-T3UnhV͓O>l t*]W>gU!l2晬*Z_3^hgMEWS;gJ+T R[X9_v_uJ+HjL؏A/9Bwo"y]m^3v6 p]\ p-\\X1v`fzN@RU*DnʂÍNx n\{OƉ!WifP"py,˲ptLI8ʝ!olǃAM~MJt3U"`UnTC rjsɕKݎ;z*<#!ʕƍ OGn߾}zZ˺{`lf ~ҸiLaOnqdgM p=+<mU-ZeYr rF%BQ +7~$x8 DُHWoÀ@Z OV"`q|!R-h15;lذdȐ!@ %O-˾D 0&\i \QgqF8/:Sԁ4E8"̙3> @ds{wHdƌq';31"0aBpfܤO4)V,p G|eL816mZ;8|Imd%vU \fJ}PϏ?845+V@04}N{7] S j{pɓ'/N }CR?\ܒ7 ja+c︮'a{ qs]b?jԨ`ϸn BIl0c۰Eg?± ;C'l-L^YkY ;YNl8}I;VYgLџEݟ p] p1/sؐ6"9k5~ٗn@"{M*ߤ-g3M][wl RPyToZО-6۰ 㐂H>fd 9[DP.PeYU8%8^9"Ќ@pJd+)%2LNgFь C(s0pg;Nѹpq~27QtHs˱(8S`bA>.>|F]q)8?< ~sNgs 'R>g{Ҋ`A?F4 UfiOh+Xbxo'/Xo#\ b(13GzΏsUpC{?v%}fR.{ )3A]PQܟ7b 05-` v㰽Eȁ-nda_hr\J>Q1vFl2l#+lq|E}nΜ9)/R_WFM6]{cd o6}5_=p-aO,=e[@W5D:|7g?/6eG=>6]Z{ڹ4E`E\WkqgJ:Qx{lkkYeY]xS +#R* ;BTTRc?D#^ sDڒ?XsmRY("&pQe#,V>noˀ19@Hg)Kԇkl cF PL_b>d ʆ6f+U_uc-meu@w6g*[v3wf@ܟ?霏&/T~Uئ~ΔömW/pf?W8K~S~[./{,h:mذa\=6\'Tmöp<=،5U xO-Aݹ`, rNP pMޒcfl@[^qӟJߚte'=aB 3zgJ'~+cu1uOߚtvvsU"cD=VPg=Sޘ#/ v+>=ע2^/WD&RF`[m k#68`r.Sm'3+NE?[( ^,uxlZڢρ:uN9)Zn1܏ p p-˲,Z-^Ar6+kh"'dHF,YN)g7:qΠZNrt{iWPG9ȩ޿"P:X]mv`Od@8,[SQˑ H?V6Z11@ Җ(4ܽ{gS^r]%;Imi>\ȝ~j"U^2Pt&_Ȭ$(7oR?^T>@\B=f?PFST~=N(AR4e }0s}Q?_{~'_Ox<?) 4~Ƙg{/pEמ퓾=x`Ci-o`ҡ=L8a{24zw_wi\l 6sa:Q _RDh`v;E" xC+r ƩQ7΃}Vz2LkwlSuًB َ.D_qOF( ˅5ýva䬧}76 (_;UMs?C)0Ƈ]iR,pyקWP#9 :76ʴ -t qtrxkz]SjvNצc>Q$}y|Ǵ5k\P%ܫq/ֻg/TJJ/ْ:ЎcL}EzGP)}헞uoەo0CŴv׿ϣ/?^~_] mq}fz<\~g{ %<^u<0"l:KmԦYi\i?gf !7fl>bvjZnq;mfo"s:Z0%}]LckkYeYRE'u ҫrӇ~8رcUө«o0gDjR:cpGQiKpxWT e,4G~E€C`5CT^PB)! N5rfZj~}W}8^,%Wm 4W֍9jWi`$gpW+GxWڨ@b7{VN و dpĀAUSA?/R-^Tpg~:}k齷ߖ}-77J[0٨Qڶmۤ{9DF@'-ܘvh~G[_DХsڢaV-};DڻWiF7_nMuawuNw.uS;3;ҙ~{ڮI>~ѥ;%";> -t76'nv JP@! Snj Flt f{ٌ5=or.E…shsR :^*Hr>t uhmN6~"b^0C̄\k.]Rw=/% : o{+d24ز6 (*P{= l[#'=Vh+m.'E'o]d*ԋEFN_o `u=XLJږ<_Zk5Dϲ<%t!>W"rgB gԌ';m :iAHɵFa[U +W1Ꟈuz{o+<)Q\l-H;'q`-}g!eYe-aˠ(38r^A}@!9Ý| Ws=7L9).,QC U~šh: "c0_ڲs>_Xy7PH6jOؖ~y*=8ݼ>J#x,k+8f:*aA:+]ڨIà `:˱~Wopcv9m@":WkM_u?YOA9؆A GG*nqed?>,m#F3Wz 7@\;'~]Ѯ:i٫:|+鳏t 珥]G'fM:wZZ,[{qm-[@i{иi\.0gٔoe{5VXr/\\읶o彉Ŧ [rc#cu\[,r f*5/|g^Ӄ^2T|FWH=dDvQګtwCsl妲{aϰK<"h3gdÆ/}G}N}&}K[VJ fyD>-5.i}IWZiwe+4jU?tҗϦEJaQq[w %R2t%%>go[.VKQUY;88ovNN_9wpCn4 =.Tsb#T@\غx dar<[8yCh#,ʂ(So '^}vyDѸ!;lkkYeYRqq^5-\a]w]:Ai@~jcټ`()6hT*ȇ+}Tr e-ǒßa. Jn $G$ξr{1H\3%T@ hǑS#V$5r^I !}`sV:,VN9W^ p=NzO}P _f#t[Y- $Е 73Bn~;Ѐ"_=u\_p̯*!Q>^f)9Y0wӹS? C]K$C-[_N_p ޕp_? DǴJ/dmfsZޙvU{4b@ꔑX\ѷp6?uѷ2XD٦Ds!;MHz8a0k8ܖ%؁\+zK3rz06-T]|>#ꖇU@ܱDu.z Uo8W?-} 21yn* [Hae;Wz%LhPLuzZ[0u -tUBׇ|Eܐ<8C;=}B9u]$遇qr^:Dʲ@uϯU}lfW`wɇv%]mUӝw6a(U2q ?<\{k4\@m˱;!.~ÎY4"w6C6K|wk,g W+l[aqtov67IÅM?[ /'YASd\{'wqG(<餓fmV3pW p p-˲,Z.e`DB$(9$wfɰN;@vx:<EA5x1WrnFirh"5# }H>6 ~B`1F)#e}Bp!lpt rNCQ_U1QgojhڵùhS2qѲ(VUGઞ<-l{LM#$#Y sdߎHIkA]F0@\cYZ`mn[o{[VHٗz?621~iP+|! `őF:S;?P)kkN-.bԦ1OO*Ul D{.vR $` v4nbN- jrZe{ %)qQ!}OM>gS65(RPO1Uet}"cvM>||G왎׾o[:K+GvۮjW_,s7+UĂɇz$}gB[)ST^rB!ۘl*XXč>بlՑمR*e Ѩx&\ŵ5kmC,lWWh 0 _"Dž\Zjkwy9/|<Tۇdmf-j&TiD_E2Cu&͚5c㷦/ZlPDeYeY ej0=qr1xJ0D D(mвx ye0M)QD9/c{لp qYhO` X7oķ9ďT@Y 8,2Mԙ<]|"3vۘQ냳O΃saN-|>:Hd mE`pה疺nr⎕V(hmIV; n{UL_p^17\}" 61DawݷlS,ix#cu^d &N!S"7(?t.}G6'n+.ur. xe$x ~#9#Peǩ"F곚 (/pu Q,Υ:nIs"j(8 +q@N9s1BWjW/".ǼGl\g`a~4=<.3W f0 aR`fyl3}k!O,0t 1pLBHE87}c{wz7 Q`cFiA'ok1}v Q? eA6oZ(&g}PI.Q* *Z+r3`vzE(uآmfɾ}>ۛzRx̡qJ`# zbnI$pܫhҗ|8ݒTX 0Z?}qDҡ:K0 pOR*Vmz {VV)"ŶŔ%Q)%7v&ןHvyصOe(꯯b{yH(?"DX{1njY82-dmxL`kkYeYep;[Ѡ-䬵R[[bY_0e_sVHF$,`27kEq* 8 r-puB6W..Z#')N)e91݃p8@i3o,i 6Em -Fߔv?rT~Շ_/a[!*< pIUZŢ`O~G0Wk2 h@ ,`$qv}#7̝aK[žfgZ.u@>a~( !7e?YTa;}VU_E5r?r1 UvAMlU7A*BfyyEmoZ4mP=gq3TN1zqm].o(^ql={Qq+P;<\{о)@ޗϦ\uoH30vp-.]Ch{IR0-۶$*TH+TX9]wJmֻ[0Cy΁vu|EAp "fKx\_J _j~VJb(WGmkD=5.k_T絰zWT~!~eYeYS#icom :|!cO?"ZD LL, ~2&J'Q8+gw2ZYT,jَA:c@9$6gcdwbwq)ڦ Dݚ_[?'20X@҈zЯAο;8C[#xV>ֶܕ\+ƅb{r kT ٞ?İAj=SS iKT^X#=;m'1& %`)mhSi#{\~9~c[2Ii܋܅.׶ of@<TUp“56̎pNuB62BEe![ʽ)v&Pe.rg+\P-E _iyߵaqPk_wcCdnR0tO~ =*)5JO=b싫Dr\\";Gu~*cTفtm^@uݼ+py1]W})4?f1ؾlPSX\ذD[ⱍ5߮jժyϞzI'$eYe-#W~|9g $`cӬSt^p5 @Pe[¢ 8(M=pP:vgk;\>y%W  \<j%Ȝ/ѰRǝ rQˣ8Ws0b bhw,pE$[>ՠc{U@\~>㿞n uaDٳg%rp&VR {yKځ۶Qqѷ%->τvt ╿kso8W\q䒔jP<[t=J> L$)\: -c*;_ آl/{ELC1 ~19Rp0("?rX-,R6 Q!&vy=t%W-Գ$mLy"?묻VնsLV]mIe pVԹu[lL= P`u_Kqil$.pK=zc=k- Q2rHRzu8#2wR͋ݞZeYn)."ds8 =BPttabE} BVDj-:rhն۷oT"prO9wyR|z4]lN3Sux,FykWpr 9OjG'DDZp+(N8\ >h>Mi D8L\ڠw' 8X#"68 U)ca Jp_~à 4gΜ 7K[")Z;HغU:7ʏZ]n@Kz:DsX{DgBo4؅*)M1-=e,7R([D>6s] "e#26{Kaٓk7lC[dw_>z( vF]+Dy/L쓘c]6ܸH3[v}=yqi\nqxow}H䒎BeW7^v`eYT\|M2+W&#JnRCGY+ײ,˲e8k@:u?h5Z"**?pfyROy%gtDNr=?qaD8ٙ@ @drv`Ўy};r.h'̑U0>E`̍8:~,."jìmT ٨u4E=cd&G,bǞ;!Ycj|ѢCXp6v&UY P?sI' NQr9 W.d wE~YKt!EA{Tߗҷ/o.9~8f9q^J 躼[eok@Ber rirLcM} pWvlH6d'Sn{f-qA.) EtM-j|ʉY}E K+uWJd}5k0}'fCdC4n8iڴiҠAʊH1Hl}mݖh\!0Cײ,˲e~'3 _i8b10~*^6'] Z 5j%'<ˁ@ "yrB:. @uR6yqhPP*jT_9D[1plnČ˨ 쉼ፋӟYl~5x/v!gd 7 vΫ=601|7@@\@ c?'+''.)dSM!W[S?ʏ%%Cn*pK=/Fi"Φ(X<VyGO&yQݽ}{"frPPh#C<g7qr`ƵXP’s*ج%peV$]cꛡ݀Ubmf>Z\ݛM~)ǥx %m6]))n_r%-vvIhYwDR i´'iy0]s'ME^PgzCׇ2..()]4 m*Iu֨ԋ=-%ʳ˂qkQ}o"C\}/~ k[$'_y7 Vўp RM|p]0$Vyh1c@Mm>U,{R[h:ߜE>_:E -Xm=SڵkBjzNpZeY \Ypc|\\i]s9'|'t Ob 4ȮB "*ǒ>O۞} ۵kO ܇K"!6ʠ+ibz68Ҵ Ǟ=p  0 /79\ӗ8 Z%j> xp) D9g+ Jsv+}!!ki^ ^[(BTڵ +,.Q)h_ips ph vvHfiw[vڵ1{&)Ntm;r&.#y]xjݝqQ0]˷~鍽t1HvCل9{MNq<Rڷ`+la2%)"'ΊtD>lwi;fe/@T@ŝFa]LYDaG6#`-6cתШw>띞vnwsZ҆a;gGOePhg;a!"7Dfsr<ݷ}67"@f?.U^ 0CAlTlRco?` d/''6ÇYB7zj _K6y+ kIlvRv~ѰE{>UZ:SNԬY3+N>d`zM6]eYe-7+=ccY9q^|Y&Tr 5mtZ"& r\8H⹘A8)E\ N?RqS +szv\ XP`רlګp96αl0oƠ/&Vhv*4 zRT 'r9 0U/ P+= dbUW %u `L/9yl?,\{>2λeǼ|lq\Az{)">~mDS ]x7E2zT~[[/'"no_Lxsk!w%I%Qbs-ccb@uEX Ot-u٧sFa밿3+׭y"-{;#|i\e![9O8{#z`v{%}oQ* pA@W_)y'xlv*8*E@Иe/Cuz㘪.p#?Q P 5\-Ȯ>5u= ypj/ u7-_vy^Q-}6`rW=bKIϩY-}y|G j&Kt{_>vd+Oz# v!""g|{۶mR`u2 dn®qlf;,Iyr}EcOiUmƽ姟~Z, ~ *?N3ZbC3&Uo=m'8veYe-e]lu]&M3<Qϝw9l#ttKX q> d"0AgQ.1gq?,p 8J `$ND@N=K=t򮜭b34:S15}A1l?U-Ѕ-b ߣ`a`Aꄘ&A5v&m3UmLpALv 4> p' PT>a;/ x#J Z Zs{"~{lSmr ;[R9qѴyJS#3oˡ>X.(1=p6Gʲ3c:] vH5 s>-F^\B4Z`q\Z`rv P!Pӈz3|Nqm"m/<ƞbeQ-kir̶Bpt*wvEڵwӴ-燜%; e pN}"0Bf)Gzki;E"ޭ<|w #"(a@/}S\T6X;S}E' /76Xu`~̾IyER5 yv(3k {")Yk|6/M(h#$yD[b1_\b`]s5f][r5gnᆰHlD2~05,˲,k ܘ3i֠'9<ח\_N굂}a&d @)N&P+zp<9ӴmEO՗s~ܛψd88DU3RDhc1V\0'rUҵGc>?n&@RO`l'|8\9\U9Qv!l<`/T:!)g-90`6B= m K  p TF֟-5mmmT/4ʋSA\ cLjz $`Dt!}Y(0X<~@E'ܻ!}Ep\L(ɡ1_.9KE^ H28XLjZ8oe+9pK py_Pd.r-@tmNz#SZ]O`3bjAwyHFu`~  E~:UYt7fΊ怼:ϥ@h۹ߔ fO@ kbnI.u+؎E܂7`Vl3Ѯ%}-W:'|b+;]aÆѯ\x;XSO ײ,˲ p "O }<2`4NaVM@SZ8DfЎĹf!9s+wS8L'f G9C`HZ@܍A2ppqf&S Rڥ |tжX'[55xK%R҈u*jtE"U>>@1!q1X ԶowV9XSOcc;cX/>-Fp' ,IlH,{9r]] @I֍n ׿_HMs 9{M Co4}!Lj9wC~֛cCT,}k p}]>kgdS*,M еV;>z>{lUQ.dѸ\zSOڌl, r,.3'O\jX葁>:DT>A۳ffMl!HGPCۯ} C]㥵#} @=D.ug'qdhݶK"bZ Pacy{4q;<(jYM70} +mW_uym7+2puf*7EJ9EYl2;j-]p|FP|˸ȣqqHj$cvddqOns.߳yrE,v`ao8ŹX˂mU_qըQcp|=ײ,˲% pq*-9Y|M w|ps9ه0?q`/ ԩSG#dWkG97"xtܘ~POT?XH*8D6A@v{ 9q#D-Cɣc}ԇBDtj ~B& u*iӝ^u9D}ILrg<]g >s J>@}6$QOπYW|A)ފ ?[">P}'G,KXד 9jbZN +ѤTvΖtH?tٸ7X- %[O.t%to6Ih'apc=a  .4 K M7;ښ (0UQTO|9iRZ@c#[VxRd65ZK. f 7-+zF|"Zb#x]hB.G6Tٜˎr"6~:=eFicCh]|X-uyWvMuc"\{rҽ9}i. `԰Ri {5NO;rZq7X']k5Yf]W7mSdYP/wǤzЅJqҦ^lf뭕Κn>1%iynɡ^;m~蓵YC6gУNse:ݮer /ļEj:pez`ǰ\KR=9M~XZ?es+cgp_ŜQD " "bZkH dA#I@2,." EDd<3vS1ya_G%M<hzKՃ#(Α]q.u/} YΓ/Kԏ>hжm[ZhҤ 5 z衘cp94W+H1+끥U+f`mG5pwD/(vU'-7=۱ 4eγJ³PP'?.u,uO9S 㨏wܙ4[XӤz2\X`'#Q'i/x1~_?m/hg/pAz3(^q>0ꯌCBb@:kp\%JSgZx\(5|_g=<2 `gs<霽z~#,R6~F7a(_˄Ik8iKS_|l#g9vRfnR_AK? GYys=BW?HFߖ>$!?"y^z}@bw_ f7xv~-nd2Lxz @Ӎ%4{`mhYӃ tH=142g@O@tu gpd?MG3:OےfSp&_qx \XGbCYQ9ȿ?/62 i"? ,p1`@%=`A;vEP

ʕI' 7>A&TF-7 Pϡl xxޣ,LQe$G}EB, J=;MjϪ lGBH}J~^sp<Qzmx!0z{_y=AɱIf. ';!]JBE I59F+:7>4u5<<rҷHxޠޢuu !ԃ1ԛcp$}/.>m߾+ kfF/xYסCWz^*y}y:{YpY5p L&da;t2NqK'N:t(?5ެ]:ȓv8qα&DL30|>M|=t#TRxBV}H_4pNIِvŶ<0XVK&PDyHôF :o@ysmI!Қ٩·:53 UfPgQ?EV;7ڝm|ݙ(R`*Rؗsd%]sBAG}F}gD} Wz3CyHmPpx֩x<jFǢWQ?uﻰ ϷҫHu ҜQOfFlG>i|qaxSORȚy 6ְaàn˖-{\d2Lf !ґhޫç K\|14mLoATG-H- 9q=(?`p9Uta2kf@*AdڿWkX8/_>pM&d2.`^fkK_XXvY2VJVm3qn=MQy(\\fpMr/ dn݂>}P ТO) XrXZjM;>Eq 5L&d7VlW(cYe=+ƀ U53k2kѣGu%ZD$0 z뭡pgy9)5k2L&\\33lƍ+W*T.o[c`tŋ]xkʔ)$7 /\&d2 5533k&%Ƴ}GQ9ִiӠUV @\-Z\d2LpMp 5e.]B~mذʕ+'o߾MÆ z(FF= up 5L&dd\S6o ֭4i$hѢEЦMWjޢx޽m'踣^z~矏_md2L pC,,o޼pr5,;. foڳjºt̜93ȗ/^A:u^fk ${FYjժ^Npƒ>pM&d2: PcQ3 $bpr -_>fϧYv$[bEmf2?>h޼GY5K:wlٲzk6|'}A b_|qp=馛`Qm۶{HK+Vd2L\p ,o ,W -wZbYY:~|եǀbUpnpff9f׿e/ۋ7Y=fkGyᆳg.A۹sEٲe|-v!뮻.xǂc9l1k2L&)tG`1>X*t#gf&#۱\ X0/I@-eKrƖ.Ncgz0r=شiS;,7F4gN,{mAI}})Tʕ+R߶g,U\曗nP?tQ'(w=zp!^z[9OX̙\d2L٦K/4PܪXҥ%J*W\J* $̲V|`ժWT,23ZtԁIVt=XJ+T0z%ajr̸=<eb /\7nfbzkp/Yd}D.^xXhћ/B.*T0k2L&)7xۺUd2uSZxq36NF#rFzhرiGFeϤY;=Q#ǘ帍3:ѣG?fϤY؈#bfw1`AF;v L_1HyL L-V5L&ɔmbӧUb dfv@  o37==f¸|havlve)Xxq0tP7P! 7n<2k2L&)۴jժ?/_`!CrVf@Ձ3=v,3/yڵ ߵna8z0mڴ`n,d&d2Wjm۶9ɓr&M0 O+a@ցv{e>`޼ynl27orqz3gNn:L7o޼epM&d2L&d2L&)d2L&d2L&d2R5L&d2L&d2L\*&d2L&d2L&ɔKed2L&d2L&d2r L&d2L&d2L&S.\d2L&d2L&dʥ2k2L&d2L&d2LTpM&d2L&d2L&)d2L&d2L&d2R5L&d2L&d2L\*&d2L&d2L&ɔKed2L&d2L&d2r L&d2L&d2L&S.\d2L&d2L&dʥ2k2L&d2L&d2LTpM&d2L&d2L&)d2L&d2L&d2R5L&ɔ5j4o|O0!;5ڵk͛7u+V'Ov?35\ YNz]tQٟ5523Yʫ3 ذg,'lOw?+ 7/<81d2L4~K. v:OW ><0`@ @l=:xU(pN>ƾycgvM8#}?m[^=)6|>Fr"xؒ^hݲe;ĕ+WvyKqذa^Nm*=zA5;칤dɒrJ*U(U\ʕhr]XB *^\\rUr*_ryҥʔuϸufiK._Le˔W\ K]XDGyy_fVdd2Lt?; nݺ8AUj t|7ݶ@9s8h 6m .'\~c[WYb@ ݶk=e_/ w  '_t 1aDiY*`Igƍ7^ ?X NTxׇk631㞓nx'W\VYUdUɪ5_: UVZ,G'|RXe֮ep @nx~"W\VVCvYZ\B(ݻwodd2Ltg+Sj y h?ݨwcƌ z`(@U+#Gtt8@߁Zȍ. U+ŸW,3߯ C὏ }n8cEpJ3Y$(]8ٳwG=gY=gv'_o o.13![ͯo~Mua-{Wvo LpM&dJOO-^ 'Pk9#Lr,HJJr黓{ i;WǼ[s$|sՓ8)]rO8֍[V^z&{~VtX)jO۷K*v۶#~HkQ`[ayΖV~s1\+mmA6xjolodP\,-ZCZ۷'fWZ5L?JcwWPO?vv aJIbpa2 p-be)|p 6 ڶmٴlgq䑁\3&pM&t*.6,@3xo#(Nbm@YԾ2;]@=yu{,@&{}dʕ@V7'!vk ^M+;~xotwqwu[{B7ض!84q۹sipPܡ1v)\)uꩧ5kv~Yg:fpMp L&X,Z,Pȳ-h&:OYAP-0 j(]BO!5/ $` ţV~O_ 3f#:*š̱]1i9ͽ^yεIw[ n*" i`@<8Ge WbŊ:]ίFsDƑo }^*qUc\A箈7.U uW2U`Tx]ņ.pՀ VT*aU!|*\33&ffpMjly\6dܼy@ /\xC=09-Q@P.>.תR%nPJsfTn ܁TwN~g[A"7 1*pƃ~׮]= ~r4Rcb>Ml4k2k\S<@ƍ[L +;.wa_~cl@ %KtO=⑋^qx8Xe7,{x=. ; q 8qfŘ?w8!f#Ȯy;~ts35 ^;ޣ>D~,ɟg*c,pĬUW]@Tǹ8s`/ƾ{}v(x[HM;#=>ysCهrwSf"\O:2:#qMH?i؏ttr,9nfY1NeH98y'O 8 0?$A{J礃B>scL⹢sCZ{jEMK6>A&M^̂ƔCe: ǢMǺ{݀~9/V}gdT@WfR?W`Dv40Xd\ @U^=׿^XvP3/:)s0Gy$tx53s(v 7XbJ*gq1g*sF6ħ$呝b\ι񼚺L{5,'|y~!/x='9<Dŵu^\s[tY?ͱX,,QoWOˀ( uzJ0K金'gDH@Q_`A;_^Eu\!>4'cl㈩ m~'O3&6>kԨ^Ш:s >P^3xY{>wlvꫯvQ]Ss O8K/Y|@uik;Gϟ?Ƚɋ+A&N0**&>y C0g c0ACo40=CNc"$7ž ; 7xLI%NED I4q#o)/^(y`Lc1Dl!f}<4s^?sSfd;ʖ*xw@yt}(ʀ7L}z&Ay5kf7.o_۩9>.D>6"#vb@{B[QZH;vua(?l i33Q/B1\)b;jEy1$ ίJmW=xa6hЀqÉM+W1=~`˵1z[4} 4J޳s!:7H3ig lo7h+'Ghg ԎA;qH1;M͛x_-=(&t>0-l97}:.{6.Mq=/vDqmy9ʏmR/+k`t`E?Y XQ.-oUL n. E?|%B yRteT;.px@E)c6(Taȵ?Fsr-t2cn GZ=ꨣc9ƙoGMY_tSq]LBɯ/PX*xČYgc|Jߒk *G3DFĘ? J܆#ypc> ϕ zHd,/PI3})U^~VU}'z;! N_͇_9 h`%J_Gıx.Ep_ۚgGN~G3rr qq,?Nׂ\suWa< ͛{ Ǽ*Tn;~Sg00]pThXW˓5\ٴ vY kz%:F}5kF4 ? Zito3+\ @\`}nW6`̫}\5`/x;bbǰuW<4(4۶kuAZc۹ӑ~I8vkY./v\X_)|aO~>lojM\yCR_00sg}Y]{Na .ϩ+C'Nm >`jwNu:ьo=էOWN>6P]{:Ou)qɧ&EU[*e*RS;YOҭ i x9zelӗ.rьeܕs\dzwM ߛ4?3)`f EO?_l>UrN[>=Y}mUmYl>>}fY˾ߟ$2K?|nk/l}d)tpƒogהbHcUO fX\Gɵg.Mgv? $@wIY./lWhP 0wm c<^򲕶1#xgƳ6},B0&n@fbjlXi>Jjn#6/njhLӿw>y jWNy*87/ePB<9yv<wr-7`w._:7746+pm<~ٖa)klH;xqFL^t.W JoA\@ X :V,x t*m|~ f|*,܃L'^.s0e?D|^o㽌@R.Oɔ{{?AOǧ? zʶX`#מ,3+?}K f',r/6<ɣ_ H 0 [<[ 1o9,'7= w(O@&-E<-1m`\sIvIʰ/T.Mp!6&! ptCU0*PW1*P(3a`JD@E{- r*ʄ$PTJ)T%jjKU yK['*e*O*P`@3 &T iH> R醴ؗ4toĹtMHע|#_Y}C%xǠXx=5FI?e@YpnU "_4Ӹ,y둚wA8:Wјoy.m;MPR9o ' _ojعa'Y&/NÇmbM#?5"}4kvNJ/5{nK9iْNa/#v^ ]Fƾfq.Z7TI~랚BRO;K| 1x|T$h.vN9#EpaMGZVΥ73y^ p&<R=^r۰~a-: {&{oIלԲK海9+61vGL&-pp:4]{y.aC͌'σ!?=Uf ;>0]p{+:Kֲk֨}k'oa}h@ :2S"z1@mEsH`e1^m+ A a#~WYA; XlhWx [< 6,xUx;)Dq~bd;?cs, )١[vixzp )`JK,YBx\)U/ gj Ƽ@=Ba348t PM~(gǙx*SF8 Ѐ@?!o bsGц4^ U=꽚IĮ_*k MwH8/_#ו v TES]޹@FoSn:ypn.V'+ŘL18MoB$Vc\*}Y#Uj*Q`#Б[T~5XݤJ P˛fubV_} /T%{?oEEm@BW ƕu媀v3Xf~բ ]~'Sy*w\yJYsyV5S^iddo0A*wnʏsrY c+e]F}%WI4sm:*}nPݟtMc>N0D :V2+_wJ2r$}:g(xवϾ\ۅtZ8KWV:ٳUpwU'9@۵ypk]q'ؠ]}?.] p~:spww1P->%/p 0u[gix5X*/*bz*͗T;}Y|J(Ag+9`o'7d)?^pV8u[jwj#btvU'ͧRmu?2!٨ytThCݴ/ )>~lpc_O(OulC=mo$mkԫN7/s$tP58XDJ[o0WxwyRә"^&C!^2P;TqNoRpKpYs(= G~<ǁC-`]a;۶[?*r@[H`$;e!m٩ov#{A: †;:AS92oRe?ҴMwҎQRkwq˷TޞƿZ頪O'zo=ZcOhIָh ٛZw}Kw2owp6_dהEH2 ?,%xH ~Pyf޵qY:[Ÿ (9s$V`K IlQp]y+++XHml)w^@,*@?])%(XJB$ cN;|l6TzsV~4Mw^@&.r􁀉x7  ,,7f2&ȂK] |]88ЂZ%Js8O7n ˃ۥ`0p1yTJ`YRТr;=dSзPi]|ou|c|QIrl̀YhTot\*Ko4"|O>ؽRēwmGnp!+&'Bg^^pO-w_wSvxRcy4|(z)Vc*>Q^8:wtԱz_y3s]]U{i}G1۝jԱj@-rjK9]_AX?Bui}w6ڦ3W2% j=pzU{.WЏ_5|9j>7c5{7|_!~\vv9A'Vjod!"AqMۇoAs.0[:TՏ5"v@uɚbTɋFJ[;3Q{'ŊZc/|D<>,>uvynq􂤒xSgpn]m}Bo~_\B>w<$oJ+tH\=,F_aRYъ:|5mXb; U]3oT>UXFٖ}t{aUr{\^2 [/ ച_=~p01*e#zoR۝A8m@A=ev)cŝ㞥m8\.@q]ߔp+f,`OB g-~ zŃ]p's7/<.Ehx1?TWWFQ%/QL`#QY`uJ7c)yޅ(\'/^/Z2$3pġ>^᜸o$J9Lwj ZH3LCxY?\/=?wRF}.xG D䯿{/蠟@[G0Ǧ I0Wx:((-,i{% buuVLq`O8FyXՋPmܯыcV$>??~U9K18⫞AXߛ r=IWU ˳"8}εǾ朜42RZJSwp l><#:2D=m]ѵ<" $3m!3a p( nhUqW] <[Io\},5{j{9*x~,A3w- zT.oUȑ_yH\6:OFFS#Z]xfE;J4" m |$0@)5wL3A`ot*(k:G~:=0U FsS-{N8Ivub$ۦwT޹}t'.xaIc7y3wv V{ :0:;➜ ~Ru V퉑F|}Fy.w.%věw|"\z ̳nu7{ 9u6}7IݪMOPo/2Hʨ[ծTWx?Y>6>NFzY/>`X=ib _ T7#G)'t2f06pMqА,V(܂_ (:th.GڗP{UDu{~Fqg &^![^ }f5 Orw+ԯ:Gί~UJbquGst pVZGEMG}=,aCT H Ύl9P{tIyZs,FT= o) ϚOyᯎv\kT4\}t')fzkT-uF): zpp~ 8Naf:at|ocWbҺ2`Ϳf`̀sNؘ̊fbjv̟3f8/J/.i\}c,_!e $瘪/sC!0A@b-o*sgyv\OV`uDn[B*l7'عa̛om.M\8Q1zd(fk禀/;;уV-RY<)| (宫R+98=38t ~5@+q X?^ÿHu7_ͱ{ \Df G؏؆z_/P//F=H[EH= / #lhM\ ~L:jQw1~M8/m3*h K'Y@Կ=\.Eu 0{6~ - L;?O bx~0}I2\x_%tL;֟[]*nep3 @8j/d=H<0m@+{5Rc(&}i@  (~<~TIwmt16*EQGzP(9Ώ ^1 ⁕@] $P`O\$z/%{'b [cZxAw<4;Yxޥpf O3v3 ǵ"‘6y:qtl+ҏI 3 rq-$pOy?5E~PcieM`+[,=rB]EahN?! gA@,%Vc/_5& -Kv/^z)S~wHt]>>bt*.J#LG/NF/hC{,{;aso+|]{wCw+X?޳i bo @4&]/ZM|ׂJ|97wwm:(loO o(պx&^[[u1ogi.yXHG.^#z 0K4 psR7G4G٩@XML_lx7e4v(U{i'c~-#Cz ~87j=6r`p *h7tXyU=0/٨'EԱ\ jF xLmӀ_FYG22'T2$JM=./3c0/ފ!{k:1,~J.Kcw-'E ̼[cOfNXTNT,5 T6^OWo!d\+8X{(& Y|tb1I9$ $o>yP X!05oA hߔywB-V:x ̤]Wh>o|b~^Ao Ue%/o<{õ10T8VˈGneK#?xuW%v\"@z: d?fB^ TkXzc |p%?z02   $JΊ{TY(&/°|'!PN1ʓ^z>8 uʱ=zG|r^B%ymW{_u[|Em%g"vMX -?AB7-.gSm{'xg5t\``7\u~^m n0dЩ'K 1_y^C\AT+t iyLX pľancpL40{fլƂh/"=pqc}][ syM;kAӧqP5WLwutp¹kzKJk|aK5޷{t %Z[NkhS6K-W-:r;>#yov_r2`cJ=t^_F.߈ 3H9P9\[Q#/W6. OqX\1K|Y8Y W)m=NYnxH,0p+ -b^^mkkx,~X=9xw%i#ɔΌ6gA_T,p>`<xu@+n&FvH* ~Vg7h2)5WpjҌW.E+?\8ĻEy4S?i\j"%fVc8 0L%u11`[U?d+;[@{蝀5B0֢or ,p61`t_wd1)>u'7=__ F~p`WʪpI~OcʆY;*NAoOe_ڿ+ |Xy/p!iжggAۗW~P_7 Fs=(iz=>VRC(D]ꬬwKJ6"N48pvm`.)<^ wzts>8 4{[7a H᧋tرV~Q XR❚.4PɋPx~p5 +s^,嗖W/-ua;6`ʀ@|aw|{|(/ PxAu,HIWtr) cLRytb ʊ O{8Y;at Kmf,wl|PB6(Xi\㲸Ĺ]9מ~O ~ dJkp %Ah#Cj9/߹k,v֦[Ȍt5 p<>(/[.e$Q6 pP7ܹӅ ׇP|aƋl1/8UL)]͜1P~NjGP5RZ@/EX|Oa% p5lL=J_{~46㍬gbB'6ٔ)۟u/h.𹬼_S,ǂ]wcQAmۄp^w7k_ntrrwoѾ Qp:*OxZ7T /T҅ H.}}`i8܎.܁`5r-}+ %B׷HgN\=_sU%vm~[AU~pǀO ThOa||>a pmҪk8Y!X,Kwȃ7+wO6.BQރƦ8L[^/޲Y^'|Ypة)<9[>t޷,s3k2-f!2~`@[ <Yqs91dHoU'0w1Sʙ.g|1, IG1",b?8q>DKhg,H1Mgj;B;4&MpNudLCǐ$#|,'otK~"^OqXILq^]3bO|>Tf4~OXfnE`=tT4K񞵀7MK28^G1SHXԘ i~kS^ oQlc]mV7uExr 8G:DS:v @\r;BP?)@sBzq 6:VKca_~7yP4Z|kt-5t\( ={\^0E:/WirY\sսK~-i(b^~$tX\@6uL|N5Y}E ߿P2MZ/=[:TBįśh(`cW{DkƤWd[|\qęe095hNǛT :CLm_I&JFgGzT1}] |xoe޾SV|3tD01x:k0]㔷:Wyo\ʛ2R~>cPYuhɹ~;wv؍EaB/ן֥xN9܅Oxcc1? ; b&MHxs;Mر  A\7EJ{d=pC1pLfYD->M>,/v\ǿ}@j,^;.}T{q_Rm7x0}Vy1r؎ AAYpgF]xfg<(-װ*k `Q0w \氫kBqE}f" DDĀDTAPP0<ί5{ }ݙ{;TWWWu9 Y8V9`X8. I!Nnվ[:ki.˳G MT&3N~UF0ZV~z==JNK^{8 շx];ÖיS>RA%Y7ҶCfִсgze! ˾`4Gܴ IN`NT< L.n3rywE\e.uwU,PGɰ p0 r߆cјa}qPjyU0F>I+m4!7"^8{lֱr'\\W'!В}{(xx} V'0Ȉ̀Ԅ`ܟpNrR%!mh7Ìxp^^CX]'F7Jݫ0Z֘nR'p% (C <\-@\ 8f+ Yj&+$UmeY,< +!H|a` |#yV|:wsɻzE䉴a4AmP B@r_K} V=[[\˵s%@9Y:AlylPL hǘ7BWBpc`<W(ԁv('nP!OJ;eW h,yK;In.>5/1ѹ 0jBS@Ę*m1lD,WM-\W.FaR뷑NT&ޥLZ3sU\߁O|LBC,eǨ6.,>G@&S[^{u?Ʌcɼ9Lsġe*P7L l=.uɛ[.({D"=c2g\ݹ7o^(oG a{Dpmsf'31)xrqy{y`_;_8к{ؘ2psj i/;wuAk6cYkeA2ÊNH rcY͇ĎR69w0F&b}m @ Hq6qJdQ` >Xg쮎?W_^HU;:ԡFPt.d:jnNbCBQL^Yc\nf(7-gYK1tn"8 ~?qb84Oas{$f[U߯gO vi2Lh}v\GKpg'Z1x{*y[NmM2UN 2W7>v[ȭ2< Q@L\ 9PBG|ͫovuVف!DAy\l5ε[ umbbb%ל`wTǜt2y9WIJKnɥ2n鳈#K{a.7 Bhx/WSXW}Z6S}BW?H'ZhE\3V~ 4yP2rﺡ>t83 pq~v.rf3"NXW d} _{bp{݂k邜رG?p6U~HmBL0-ҩ#G + :n=( P;6 0㣂1u ܧ^}=ή g-m [7,peƾ~w(DLǜ|p|uK7xٸ}9/ pG qmxFB{J/V^3['t'mo8oE\,2#lx`pJ$I(` ,aJpqR>_KΘ], Ý HP|b\6nŹ-fcߘq`,7Êܘaϼ~c2W=͐Vz fgkkYq}}D6vfp | ~ĜWLCu>syfnߊxGNo0'}q[%9up ʴdq1S2+Ʉ;3KNEo@VTܐbuqG{-QY.o70D@_-U>@+3G S8+䜽(U9z'Y7/&5*Wqn ՛ǼRnӂsבSqW\g%c (PLຯ,~Z@e_ERDVӲ.u~?\yTL4NU?~FP2% !ofL۹8^)_Aq r*7\);f-\:nyuW-;1^ئqRGԹߩ,~2SW0/P}(oYt*XOEb7qia#6Rѹ_'HL۹R5낲}_~\IajZ-UʹqbQ3KxWHc2R~ʫa(1ycMT(`6M,]Krr&Uun:u.دԵ4T%e2Z^arUcO*߹v?!EZo'e.|0H̖\&,H 8iIWktҨr5X7uac65XAstp2@ԠXL@cZ$7 Y\U JBCcȆh^1p9F|ɧk g(AmǗYݐ p(v y<9HkCuxy4hxEJeΪĴw߯ C$eۍC&R~rp _eB5&$뜝_8$&3{A:yǯN\?-&;pGoK_? x=#Yf-}hdB%8_Pe: n#/p}z=~{z%'kxg/\n$%I),DX[G/7ڵ$5K*\f'A X}A N=TpZ'(}KX7@AHwI0#N VrT9L*e?Z + p5So#~07Co"t#lnt>A7G܊!?;4iVn] 0 VDpIpWCrO@9826O?N1Z,3w*~v\;-S94׾T&^Dzv28?E#8"bRC L0@\1^đ Nk] Zj7=x<1| @ NѱG0ʼn nMUVm<Dgb $eJEN2yw:#~vV9KF3!GA~Uϳ(.O[@LbLNn|.8=.A'd'8 1py->]1 0y`ن`lITE0R`^op=Ѷsb!CW S1j{m߅`Jc '@e31ƺU/)6rm# 69ƿ:S(wG` :S#Xl-Bc_Wh B"dx#.늮@ ၎ñ0?#p:g dpb@:/Txӹ=,pLgip=4/U~z_Bف.7 j0q.ґ9eC\㽪A8I=7y"(ul+k_ѵ:]|7m"ֶ`F4)cx黯4Vbu0;\N:ؠrW~P^j#7q~@<@it(}mc {WA]1**XN0Zpa*O |qөNy%Hibw718V<_y\`B#QL̶' .33إsX;{o ˜ͱ٤|Oo|O3 LoIـI?Vd.uIϹB;[nnt|7 4iThزK(<& U ):cYtg%nIRa|\fˋ*KQk2%7gvP0z`VqJG~^6a\e p9F}?BۮM;wQ_Iu2qs+WK(]%Ma GKIe>PS~d*ǓmO;eQ^Upchaϼ(0H/0~m}@zMm„gd9I!.B2:uAۅu;r̴S>ċY7\1y~E `9w? Re?75佀˷n;\kxM+w>rxbpr" oS q+p;[o%0 tI@[bŲV(T?`X39g T)9 Jx:J/ 15kr(՞|\ÝTUFg!f 0G0[`nN):'U{V9Zs:ޜGρdo p$V.1ЦdvhC#B[|Ŭ[yla pC½u,sUV3ug(iܺ (ξ^_FHM~N!Hm+UwgRqѡS+q#p;ܒ́Ll zh3ToFo^+k9*fr$-;Y뜘=Ut ~Rp>.LP.a\Aggv?qКcNP1@G,Q~^tn^wm+8)'!R)npOF\c YH.9߳ǫa3<$ O~~` TfKu-=5&6ʑ:@*3lՉ7UV-LF!d~uxTs2s2Y/ɠ?M8adzhSY,$p>q &6!V-\vA&P8YT18"ƶe MTgL%K.܆r,f@A*^ܥ8m2f[|N^.hb*08V 2\xbƁۑ߲yja_y.0?$h'/;W=*NSRlqDl7y,|^@OqK 1Q9h?Z7LC'JY6M2Mf}ʘ[.!~ʤ<*`I]Ćmw !ycoscOöuIϾM %_с{oNae;13P_qoLy`PSB.th3k+}qe\Zot>x;^Lƕ"F,Nբbb!wf k"wi(G^74(N80ʆ7Ў/`keu ;Mky"nh K(לamնH@0~w0hˍ47qBnsöb_%\npV1Vm|~Svft0cJ>sJԄ`=X|%& GK? 6) (% p:/ m3i+fY( veiqu#lL;p!?1?oL).,zpK~賓v( pWL6}o){hA7[9n&'bO"&m& mYO<ޢĬ$/@&Ba(O&y>+ 8<)K(:s12-EqoC\RRƔ"'lOy$xh˾p3IN8LVjqRΜ;/; #9֍?q`g"b2&:棉o3:pc2ybY-g>1N$x]`rl6YrNq9W<@ȽGy$\[:op.^8>H! Mp<88є@L\˓IKqma}^GE\/\s׽er c@;rg Ipp;I㛙\P$:E.D^]г?=q߸<ՑO ,cD݀U=ە91`y:Bu|siOKX&^`}݄4S||w~wuu?]Ft40ۨ\720VCnh)^mVױEvNryMdsz1^.u0WrO e p_L&&cb/&]*ڷw:n#^ Pg.Wbg;u &2۹cٴ 6pKK cy8`?:*[֭MlSh>I m_ֵ5!,wX.psu]'lϛlvwuزKXٱf'{^[pV'\uqa =ok!耄&gjf1b/a$mmֽ` pj9~"ECwц+?-x$NtҮ nvu/yeK`Wfq^WҊAx/!^OL;V4 JFJe8_bJt] ]o:P{cy ،-`i >(*u~:ma ! v'8wCOfhںOLf?tĮ]եCn  sۮǀfC ya\%Ot. pE.`pLc[(PP0Ln d@Z$8np&18}?0F'0 F+}1όyO܌ʁ>@3P 3tk"^.`4g8lqj=N;10<DZqDeEƫ c2{2fE(GeXqJ92 "0,N,h }0e  2'&+ ֓{3n\q}`x(❆aL{#8yCE)k7z9%v02]az d0\0p{&Ԝ{{? $w0QINTʄI"kp_Xs1p `-NbQFqRS)7珺N9wkRJ8\ojPw,c[sQLv "8<6ix8zs>f &Z>dù4Ą(O~Xi I7 PůVSC%@v0U8A <=[@ŵ厺Cgg6pf3 d0@5P u tA6+~j[ DoriAoc n<A~:jcܜH1!2DoiBB㚍O:JLF|ЀsvTV tުv88ˀ2ʾ5t*uU(7uA<5Յg.+_ qpKCׅl'7䏃W3__EM鯊Yd/*$fKݳg\ā;r~WzP5LtcD-,P}jv, (Җb @hx,fܓNywۊ 0<u3ݠn7ѼI nq pHAoByk75hq%ks57l+-նV!O%yC"qL"B[:j&ǡ{~KiD@Rg}K__P9^vu?b'0$'y LāZx-l}I/o\Y@s; > ݗ!EpwF\c^~ 6 ̲yyZXVecވjh<oIrSE"Ņ+q%㤊)K0TA3@9 @N+\g!30O2yDz7쓷`60p:O'#?G& c8d-4cL˾phGabw`d@:w~7?N`M(#=+,w+cGzMSʝŘθ#. c.NiPsG^c?ʟ;{EX"p('Q69?l{+ʓrF\C-ǶGA'7a֢.Pa$ʜG]y19 ʝ舳1`8"Ao"bXmSИpS2l_ H{K08ۦOʄ}ΆFA2.??q;<"hf8GnhtQo 2lcyZ!fQ$ZvWt¶Q<ުKC) e-kq{+_Y>/oe+ciBMpeUΫ#;W|pF[ ztWq'$cC_xÜRoj&>A ¸$o9A' qA vvC|>R~6;WFlC;[b pU`"2>lRK}qgqy(fY\1 o)cUxP#pNX."äF\eNH·4 ̢Kf$,I QǺ_k$c@\eo-.v܂n\L&q<ӶroYXo28(&<Yu4\8e(!h< "#5.`A7J[΀(^ dNq8<`S8>KXOf{ L"H)'|g&vX7=IQ2帀y{+$S׊\U pT7>mR MS'hJ"%]=G^7 ,ϡ=3q'Ő7Y%Qnu'űOh˪)KSa}D76utӚ p"}2ʩ>fkr.}7,>2?ℚ6\R1#-o3WfQaR8Y[AK.;;v1dU &)oF!2拷&d&Z\ĀA/Q` A 8-N d߬c{~1d Ċ 7 d&f˾qRYSnS1>iJJ䲚% b@h/r\.9..*ym'g@;P]׭nY9%HK;$aaq'rN^OZq,S ͓ێ?}0e@\X[^VX硰2|ddk) ̈Og0F{1%Y(Ʈ{lCh@-[ؼҏ[Ž hX{b6.\bZ_sMhDr5mYk<|$x=3+J3y T{K V7:Ze Q'GDf gw&-#9t F)&"&M K _RypLl'5l0L:db!*0qTp L#g.K|h2]SHu@人T'"q:e:ZkDok\PUpO?5 Bކ#e"DX(:{+BbGydDj88qk3Hf8o5o2]Cv';MIuKAE::ZNNmj#I(fO,eYekT6$F Oy LCp3IerQNNedkw.kYeYV p%;\%9@4 '~aR&t#ײ p p-ײ,˲,\P2ur2 p-˲,2,\\''\2,˲,2u2u2,\'\ײ,˲ p-2ur2 p-˲,2 p p p p-25,˲,kywuI>Cqr*Dl p p۶mNpTi ,NeYeqw]w>NNcLUCQ]4gVH i,=뢣 M_zcSW޹I]Zݖz꩙}S:ud p[/L̘SP׾OgmdkZeYUw^ni[;9UXQoMv~a~ʤ_7\tqz'~32@\'Jg}:ln }{k֨Qd-p{Tni ֧mү~K :9UH;88nk\ײ,˲T͚5dXĉjzw]v_~NNslVM:Ĵ)g|JN;5ݥiz5ӓN?4=*4Cҍ66hzΩӳgOG^ze:wԩSeT;{f:vm<5!u]/={V2dȐdĈlXeYezd֬YɛoL2%{9' O#GL 5Qg fv8Ut3> py8sZƍKƎ>-ײ,˲,˲,˲,˲,"\˲,˲,˲,˲,˲J*\˲,˲,˲,˲,˲J*\˲,˲,˲,˲,˲J*\˲,˲,˲,˲,˲J*\˲,˲,˲,˲,˲J*\˲,˲,˲,˲,˲J*\˲,˲,˲,˲,˲J*\˲,˲,˲,˲,˲J*\˲,˲,˲,˲,˲J*\˲,˲,˲,˲,˲J*\˲,˲,˲,˲,˲J*\˲,˲,˲,˲,˲J*\˲,˲,˲,˲,˲J*\˲,˲,˲,˲,˲J*\˲,˲,˲,˲,˲J*\˲,˲,˲,˲,˲J*\˲,˲,˲,˲,˲J*\˲,˲,˲,˲,˲J*\˲,kuvɓѣG'O;}}%'pBҨQ#' MG}trQGpZUNK&MlW_hNԲ,˲,\˲,*O=\<8رcݺuKFݗ_~RԩSn-0`@p5*Hwܑr-IA&N[f 7ܐ\x8uo± R&'8@ܻ+\=~ !hƍ;,iҤIp~ʲ_}r饗*^>˶pYSOMN<ĤGu]~Y pnӦMr''|rruׅ:,?~p3a;a6:B\6=C ;C=W3uIt0tJoTn^' KԹ=5j|>2qZupɮDwz4,˲,˲ p-˲,yOCN`[*c 0=LBLv.Kqj #|͜s9!,&guVx[kqQ V@ V iӦI>}?<"H?>;o<_G!)OA6CbF0}9E;sV,]8F ̙3)_Yown.tСNN"6{GF"SE%շԎ⃿/0h˲,˲,\˲,*GerU%/ԭ[7lor^&-[L>yTԫW/ 0Z-ۍ78]v曇$rNjժh!v"Pw;livL2tM6~n)c=6omIn}衇X@bʝqqɫ&(SG?Ӱr}G.7ƍW-U}m`gɥۇZ,9e ؾ Sձ64ޠAxg{(y!-a;;b)_66lX믟F+&тoi(Aw`&/#TyYpg=LE]3(>&vn1wb&9? tr*D]:wܝg͚b|*"i@\c p-˲,2,˲ qjq2~w9*oyw>q*ET SKWI.VҺz9c?$`}F^VNCO[o5 l;߿iFr.v6•{7#^;Lи\ ;wqjI_%,sx)2m7V缁1QC{g2AjmڂԬYa'8pqW)\ʇƎTn!lIF-pg̘eTP;2ĽckYeYeYeU|hgL*֙ s =og9ߪCܘ6lvIpv58|q*;1~jTd;8sN\kY!- U"eYeYAeY' s=i^h;%tK\/\ש#܄ع<M;@륋-ڋuK% &n% j͎j+v8hMzCT 3k´ze{~\LԤf… I x+!~.+Wo !om>`D_=VeekYeYVeeY H9~@=z$=X]0u4`>Ca >8+7mU؂ch=Nփ\nJNT|!'nS&/C\sZ裏&|\~W'$:իW^ p,k7=0xRa/XP@q'뮻 IӦMK.$iժUC%D`NKz)\Z2,˲,ײ,Z5y3\g}Uf@Xwwg;*l-?;h{E}'jұD1p/lXk\SX~ 6yp/1 pRnv*LBGP`ضr\Çck m~6* pU-\˲,˲* p-˲5N@ѣG'1 bՄ` ;rvTl[f )fm*:I&Y.R,:829qVnKMbq2qiBlN Za4ח^zx%; הkʂE ?kf# b*/?$y晀:w ѫW'|rҲedРAVekYeYVeeY HC%r&۷gښMժUovMv)';iҤFmڠn{֓6\ 4߿}& 9rd:u5QnIŘhLi/}Rf6ꪫv<#o k޼yțrB'f_v;Ph@^yQvòZ*Ÿj&f۷Aq;jئ\~剎 g [@XwڴiaR7UYdkjZeYUYdkYeqRK>f)(mp2믿w}8tݻne&2 ƎκX &ٳ 4 W8|UHF\!A.]F V7HZh-har؆<;vLr!2dHmK8e;a_|q /qo۶mg!&/~7e_~2V pU-\˲,˲* p-˲5R!N8TF!"[<:thr&h +AF{NJ%s1)m` @Y-p€Z-^@@0pg7}p y.(yeY ǀLL}G(ʝ&,*~nncC]&X @}䭷* pU"\kUײ,˲"\˲,k.V\wuW QDcǎM>D!/}sm9XV4&aZŵM{KLZ:Dj ~ӧO2s̄p @ L&/p8pqg'>K/ ]b݆߈ۻwdʔ)idhA.%dCUL+pq;&-OÇ'ov@\єQGO?+>sGyP+(ѬYBh&S̝;Y6f̘ ZO.DC!m%e@[U2,˲,ײ,˲J!`b&~r=$-ʃ-?V@\+ p<Gh@ /vuD&@3083Zbw& nj<6,!!4Ccx N76q k%{Xc: Hγ8E Gʊmo|IP0]v %ѪQf_7k! 眲 h('uRGuǹc(*_~ e;(y*,qyx!3aHQ'LPuB06 ox \Ӏ{/.Bhu(7߄X7",P@0nJ9Qc o".fM`\+1q CȉjժXwuD\ܓ͚5 GQ N^qgƈyoݺup\(s`is!2s $…8n =' j@<Lx;Nd oa7y]V5hsO?=?u y1(X쟐ju;S״T߽%g~ aS(7eX2,˲,ײ,˲B8h)XG2L^ߑbLVɊ" 0m\Gp/p ''~馛!--G+(]v"h3w߅g7NF@[!3o[+,@[p#čOMצ2`4"nLi Ծ10{ 񿜹2y < yv~_ g8f5!䨭-h:e#TߓwU^՘T õ8jKy]veoͯs˪"D;@P^zq ue+eǙTn \S]f%IQN'~y|g0LONxYR5J'w0>8J*KoN?\Gu.! 1h_J3ײ,˲"\˲,˲ \!0) ֪U+ź,gb7Anru<AXú=I9,[ ?0Ah]/wVQtr>`-NO 6Q9C2}=Xgh&n'w p& :P_+|AXVTAVǾ6lS]NO@ec<3bՖF9kF&(xvYgUct+r][I'|rBBYO߿p 8'-`7M:/ wa*s!{t)g7nJls$siU\/8;P6 M翣ngDXMб]9VUĹwQtU'2( ~YgM~xx[@m7z#@u\Z۵^GH-»j~OנW*Ǩ]x5XG~Cqr ~)z8G(vE[ܢ:=r`{P\I p-˲,ZSdkYeYVqZ! ,b+ ֡9f0XWNw着8M)W[9pvy_72uu i?D\\֩I8}@!3˞`kxJN2# a6\r~<,7nNX\N[9wl֬Yؿ@Vc*OQEw@NHG* @e8_,bs;cB\ew`yF`-#q^3SXD^,+d+re-«2%O}]E}.yΨ.f>d0hһ}\VW<Д6#pp[_<`۪s;ʵ2.jb\ъ:ѵyCf 1A9C?1\Ҝ9sB[x dp@}ALG]| p-˲,ZSdkYeYVq*7;bĈԄaUw pu +@ @~W'Y3~pDz_^ʍ$nAT`t$ncx}L+Py@M~c6p<& p'r$$ +eK#ܟr@*epLF>j&LHa + eC̑p2q br P:{FX̱s; M$1OC9Se( hR8ńsepW˃{7חi.rw@YqsUmIˈPT绹>}49쳐' n^D{z:\k\ӧO/:`kYeYVeeYeYũ.z뭷I(>| Ts1Z!#Ac|NA7``+h!Z` T!¶u%ٰ k/`XW3AXF 2O$L&(? $ݷ?Xg5,yd%i/ui:8*?smT=X0 . I\˅\Lr0`@H @)2oDRxLJnqb& !$I# Űw{>u40 } M 5T@qAa+uIWpE\Zsg- V}LeY)*U^s< `c8˃~gŇ<(_2,˲,ײ,˲TwI ~- zMD\ ",K} .Niɏr@Vuy7w@1AЗHr&Y$̻ x+q#XpmqN^=tCB)0i3 Bc\;22.pK>Pn?\R퉓Jx{$NL4)ZX'wjsn}b]r`[p>"Qι{Yz'q V _߾} inuiXSeYeUZeYUԁ+hj# $j&YP29;mh;U0:p߉.(IR^[T%sڴi!\+s7 8@ׯ^| O*@Nؙtu@HjȐ!a 2L:UӾ;CGpLva/ܾg_ p%O gT[Uye"/Aɐ/bkw8&$uK}}/0ݜ偋сãtQ~(\3*~$ε=qR$IJfA]E&C!Xk+/ZU!^._=[eYeUZeYU4\;&$z`b5+HfG=!Lnqf'9[f`-K@fA1p OF[!Ph&aqG)0O7N!}tS1cx\a= w(P"9N\&ZY5m /qmr'1S8s0$tI 9&Ry;YrӴ@Xgpaj6^UrD<pu3y4yV[rh`BePnw!P<8\AyW)>U1po`)&zG| =x$y@%<.ރ<(!utժnF(zXrm3q:7]2,˲,ײ,˲TW4:C6#bDUh HUp`%,.,tРA,[V@E [# Y^1gf(eL b u=؁H*›Du[(O&211GJ2y׃ 7VbSo邤 )c`I@5PzҊ (ϐO93LVG/'-~*sUZ(7 hR 3ѤI]#T Ǥ(߫ٴiӰ<+t4~eYeUZeYU ><ĬF\ ,}`}hM&T(lܹsCN͚5ѣGqTq!:a5EN )@_J8Xre0>s[g{EY\(gϞI֭(ZkC?A>O{rcFwg0`@(KjuW]uUj_qIbgW\jp$fs/C@h]=|m/(xXcػ%\˲,˲* p-˲,*NpLG@nFMG؄M5Q׎wHqѢE5.y?bD%X4^ p L'g0=>l~[]+I}f OO&"(U~ȋ+%eA9 U}9)[Dh%mQW 4&)$Bȃ^8uw=;0 i{W^bF{ł"wDt+K]DRFA({{̝{Ogsk.(Mw5 @nkf"ŀW%y2d%$sjr!00sz{\չG g] IM^Gz;XS; y{r`ĪV`zW;kѶxz~$!d ZeYײ,˲TW˦%pˏ%ۂRmvZR]S6Zn]8O1HO:Njh|6J)=h$,VBEF0I|)ȫk[^yD;gΜZ*@\, ĂIR8MBD:h@bxg&1KzH2 qUܝSHBJYD[s… DZ?;8̄>|xؿpQ2Jq`Glwڵ;U8`uO;>g6;eʔgkS A}p!=+Lx/L=?OKØh &.-bUyS]c2܏$ Cz/yoWp,/v* V׺3i| a{80 r>+V}%6sݶ 9G_'+>¹T&Ԅv.GLe<{l p>R:NhQfd /I&m{ײ,˲EeYe奭ī\2 x ,T%i[,(4Iؼ@XoÆ SO^WLELY"OҬ$`R˻'w? ɖMʐ puPw!dc%403Yή孒 e 4e:[u `x oou *J{% ł.IX:I'`Tޒ(vZ"_2=d~'٦zZ).fyCn븋余 ?D 6,:uj׺#\ >X\QF@%]^KDgq+dG";UK7#<(j |Ӓrp 8;yuʼt/{ %I X$?O<ęWx7p- ѯsދjCXo/&eYeY; p-˲,K[p f.]X*<hģ/?&GD<5T2d%418t\ r3 PUՉ`b dCP*%@a' +ikb@g#?)҄/,{ayS^e ؛ruUJlT a D,)'!V2hsuA _1su! cw Ԏ%K̊p@LPA!:K>1`ՙ5>{kAΥOp3B 祮]Ht?Syr?v;Y{3u>4Sb?'y߶eYeY; p-˲,K[p Y@ Ԭ&0v: ب$.Bx"fs~'&}:bB6muC=>5|>)//M.ʟ$!"]  = !7kZ'  ^w똣o1^{[us޺x2Yw߅&Vرc}\_?ZIb 5i$]vGd&:ny?(^eѣ/e?b+bnsXUʲzb9I<&@y%xݱ\bFZ^#n5 p<, ͛y/=,h "`$Q@ÃtQ+Z(k^ S(@RUVOR-1ꐅ K9'8qm~Y^$qKs9Lc@ xDŽ|uS& '1)'޻C=SQ\:y݇eaR6@eYeY; p-˲,K[ p_<ad[x#oNx N:S (F Vs+ U@YҏpB?m)bLpx4s '` űL&)A 8tYYG;IPY Iu %0P>d>!yEVdɐꫯ4}ݻd]ZE-\˲,˲v6o߾/]5諤%/ײ,˲ p"U2,˲,5{n۵k@CX+b u]kE5z\˲,*2DVQײ,˲y.~hС%\)Yy0 ^xa|=|wmv p\˲,*&2DVQײ,˲g}B;6ڷob&Av$!aÆN:$>;'kk׮֭[犵,˲]XV*jZeYjժhѢEի)SDs̉Fx!N"g{qM0!Z~y@[W_}Xw.!/pkYeY֮+\Hdk p-˲,ږN6-Z`AիWzkb߶iӆ{TZxp[nrʳmcp|MbŊ-˲,k&7JE=PTlYm9[Z5דmZӦM p-˲,&?~4nܸg _mAf͚MB'/_z%Ƈ0 o˗W&7++3g-[,R8WeYe/xf֦%cڋ.'O:5PA6'|TpZeYUX6lXI x+[ly#q޽nРA0 iKXqo*BfWeYe{#y?&C?7xRPͶG}R%J˕+WKZ߃j=#L})/guV ZeYemu)СCԿG4amLvRJ*_v J%/ ?f`YeY$?R9 OX`moSu駟uUWv}؊]vekV#M$6l ˲,˲Z;w7o5j(-{Wn+d6@[bުKȄJZEPvVxQ[ O\%5{e$G[n]޲,˲]Td`W^TJ[UE;سg?>WeYeY[ѣGG|AD2ů=L2krw}%SVVr`ҥcF6lI"_uV 2dHxY~+ܲ,˲vUp #&On:jժͶݭE]"mF/pЖeYeY[#bN0!֭&MRHKϟ_=P<;wnDB2Z;T1o/Yd}m:t}Gy]brB,˲vaYh߾}ˆ# lݞ}وs=m\$1cF4f̘0,˲,Z͞=;SV5RhҤI!$BfB_cbo$K.&׫MbykU=[p oZeYeYeYeYeY[(~`n߾} y^OՂԌm]~}`YeYeYeYeY ]fMY( Jf)|B61,˲,˲,˲,˲,˲_B!ҦJ!_ŹMuwoloYeYeYeYeYem%@\-I΀ĹsYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYeYem8G͚5*T/_fl6fl"3Ʀ7>hŊј1c<,˲hիCF׏^x矷l6fl6Ȍi5N:E'N G[eYK]t ޷C ֮]u1UVTvmfl6fيi&ZtiԷo[o4i⁼eYU4z09uT@^3f8afl6fl"3ƦӦM;k7|3]˲,*V5jT{E<)s1kl6fl6[cӓO>9V8jw_TLkYeY^xQҥp;㏷l6fl6ȌI'?Uײ,*v6lXԵkO>!ž,O>|Q6fl6f1(%/;{5l0zw<,˲I3.Z(bFN:6fl6f16mѢEF<@ԴiS-˲%%-ƍ}WQ޽CO(Ɛfl6flEfM+U5k,ӧOTFhȑҥK3g,˲,˲,˲,˲,˲p'|QΝSZJ=Q͚5޽{Gzq8˲,˲,˲,˲,˲m9sDuԉΝ]6jӦMD{7jҤI4u԰mrƍGC=hј1c\eYeYeYeYeYB~m4{~|G-.kJyXTrѨQGN?t-[抴,˲,˲,˲,˲,*lAKh~i//K/oX޸˖-;A{」-ZP \yL˲,˲,˲,˲,˲l5k F5*{Wo_r%. _7\x^{s=7xر⅛%eYeYeYeYeYUH"9;Lmϓ톿o1V6-07@\;Va DӦM wP˲,kKWf͚|'4hPԶm[2Fw\U4lذkE'xf8qb*Tʔ)cmwASOE/V$Vtg^|EׇmmO?Cׇ(m9^  \bFUV-u¸ދhĈk1СCjՊ5iڴd=sno%`{ķrK{o>qeYe"{gk*U$n>Z* Μ9sѣGG#G AG \[6@N:J@'|rTD`9H"-[UVQmjbyY} Zl5647x#RRp?E; y7mhw9K61hqBN4)SC 1c}#\?P믏n\q.]q'otGqG^5 tuxMիʕ+}˲,k )S{7xX] ֭[mwD1kYۨ@I&Q5B)To>lK'c%K s{u)aYeYeYHc_xCqE[i oVTn~ñ u6R|ە={oO߱x.cl8#ײ,ڕ~X#ZN;N:V\}faB-̬v-xc1y9Za(Ӊڵka_~7nUzX;wn\׮];CRY:@s&?'Ou#0 ,eBYVXz\gqoO8;sZp )uW^ye|WꪫlfsJZ{gs_DVm%(&?m6PӟO~.m.[=Ƚ辠-K8)8ryXc1kŏ?x^wu?<ǥrTR+k׮e[%+xٲeƤK\cǸ׭[gkYe# @1cƙZTިYgL?MČ&y|ąEcH)6bJ536l0رWw[#SN9e7dp9fƽ)%/VL0on6vsfy8>C 9?ba"X1QxM0^vͶl!zŧrj̽X|y?`()rG9LX$҄SJZvL98>ƊRg[3Fܮ^:*W\F˗/de%K'rČ=sb9.}|(@cYeYN-@f-Sixl$%%f޼yyvqWqNmʱ;X/^ww?N qpa @y/0srM7ݧr~BPO<ltk/t|\w6vS&ϋ}}A1)bQ۶6Κ5AxIŮ 3mf߮~|I' .,ٻ9h6V% pTѸ}lC_RoO!faE\[LMݷ\׬Y94F^CF^9Xqd]vev_+@8K mz ľ:--fZ5=Tر:w{C9`#8wq~! K7('=xk|.ˁ8Vٲemmfx9ꞎ~_{lCeLmhJmS65B'~ԩ O0< @~pZ|-.Ř@c^ʯ OprZx*`$$ޕ>kƸi.^_oBb2. 4 6r/] B0~}e,˲R$H#0[Q=R1 %8 Tc (y fK+W{8tt"JR @#1;ȝ[ouV1C\%&YHv_@n4lذPò,˲v: YcDVѣG6|?}HYk8&O%SPvA[;Pk$+oVׁ>UfJUpu=9{4PUPB6ܨߥoнW^w ku`7ҘK]ˣ}:bC2 p-\ڜ#jڴih48TRҥKG>h0ugLԊX(G+ke"6.cX%N)? = \L*=/\y̲,)5mڴ^$eDM/ _H]>ޫ{G^{GyYĩ\}C?$ۑ54\\v#c~~C:9OD3 } cg\%XecL#Ɔ xi9 >:#ekZ696"Y@Vv0Q p ^zJN/x綖sʄX%x^w_0 1e#ۢE b߆ •` ,˲v>͜93RH?l! +)@/ٹ _+jmy#Ry;Q0~W\q^{L0a_=XIyNRGeX:w|e"xZ]{xL-; [^P/n,яs^Zuz3qWk{,ܢ !Kb$E tGRawR(5h ^\f3 pm6\ks£{AF+]w%R| 7 as5kid[pJ7y\@(f <'>kYe\7o^4iҤ%<:tSPO >CC_}+{8(Q^[O1rn۶mDgkklfkmN  :CUr8_Ґ1VNн[Z=x,+q!n\OWVm1(ˮ]FeѧOZfHöJ =:l?jԨh@SP'oslyϞTQIeDe*mMxy3jժmr.Pexy$RX{P.'|SxV`(Q"p0z% p?"ug%],ڞbY83wO&OKl }w>.\:y|6e:5 ?~8C=×_~2߲wv6Q1BI6g%lOخ.(6Kߴʬpڷi pmE+B*wE'X><Ǐw.˘C9DpNY(G&SHy+b;wnPnJDfeYVRn݂~4Cg xe0e,d1"-@Df@rL!1@qEf uFc`Ig߳g]ttp,jisq(e,gx0hܹKdsbR.:5T~/>`8/ϽIʄ9@:\@מQ_VVVoA:9?q~iٜ+ξ7%T@&fh/3,^2s͙3'&$&#lE;C߅m1ZIWYxj-gu+-c%XqE)xmݒﬓ~?5m&޶ZE9FbD]3>Wa p-˲{/׼yʀ<Ĝs݅:"[p iuRڵK)YFNkJu9go@Br! tgΗq{hN=F:ʂIy(ng/RI>'ʠA9V#0 L؟Z)V $޽{IQGl  mk:~jÆ ᚨ[C8@ lSbk+gpL;پ}MQΔښT &琉d$m#=Sxnٞ; `@ΟѾ<=LKJ <\A;5~&J.FІ'uH0 &/ƵP.mܱ̞> ASGydȎ8∔hJ!b(,fv0JO&'6L>s]ִ# dTdMʐ 0nf!8 Cry:k<bŊᚋRI(7V)oȿ.5YL,׿ bJ, *6?q 05,˲m*rt;CN1B:b-tx{Nf2LkݺuҁMAނN B$z``I2HBy2 (J[o 1L@ %`e˖ٞK$J y, @OXʆg// 4>މ%t'T `y%M-gd ( 'HwAU!%_PN: 1vݴ)ճfj|WV̘ϧ+c}d Y=7wlʖ9sڇsr<+Ω7Rо(..7egT3<G@_9L0ѳZRvmG2ö9'hOhirk2ORɤRf&IY맼$}M[#krEFKPNΤlRo'P8E͊V΍Y&%[}7{3tfxs|ld{^gr ̭ \o LdMXY+?nڶywdK0ye. 2} F,6r }8Ӑ2^G߀eH p،&H.oC6czqM›x3!жhi ɱpjIrw5q%ZeYU7Yzf;hp_>9MAO+::( Zx9٥1Ovm cAH:>3 j{(xw(:s+`H_}[r:x) odϲfuU<):\j@Uo?:XKȨW@k8x6_q>p~AXO,or-ԇs }'}s`:r!C2('5:no_7;f] ;d';2$~;ybܯ]۸[fq7^Z#/xt9^quoi@uiG] sS&c2(~[q7)CnCֵ[w;mq}Q>[om׋;$|Gۣ΁\.wh(zrSITw{=[r{N<P/'+x?YHe,^X"^Ѿjb7[nLQo6z_m`{&JOh?%a_8k5VW:X׶;$9Hӆ3<@৆l"mWҎԯ`_ID/𶎵\`?hۭU9߫MX\MJ*&^{UoоtI}Om싷,jҤID^ =˷)J@[1ohџ#v1pL+圸sύnᆋx'g92AفSCȃ{& _O~lWԧ׉n[T١Yf@V9{}Y=K?IKײ,˲" cu7x#VX`` + I'+Y X}3cg_Acss> ~dRt&l> OC׃I LcS +0Mque.a. q:Qނ,hù9uqN`|΅w2f:'s85܌F=Rd`K:Á7eɵu}tE.xovt 5lH\땗㚲/WLje^ V㥗_1-Eaw*/<7T1^8gUZʗY&kb\i±kkX5s6ksSmԏkNWGnw/xW&|x>g6@mt=g妛n306N[6j30g\2Q{6\q c jMcܜ3 M,G g-g=m3gje'kna poduuߜj$ur~K={XqܶQ.@xZqe*[+*V}YRn*4,||rQK >4m*/MOzonܳOkg'{9RոZrlmY/-Z7*0< lY/7siP9@-ygzd㥍Mq-|8\G F*WCy4Ti% Ѐ*?9JA@C1:2J:A 6xYFt(,gI`&72Mћh$S,#롞/N]4yk2@\A^3W },̀^12u2i[?> K}l2.u Ri|GiOw׿^xXY3F{e`>ÑbrX-RysAb :mЀ3v]vOn ]ƭ=r1`Wo9؄<°p _< 7x|ĝ2FpPTm6ʯWwiq46Hh#&X"ghyi@[N:*[ pvxQnce5!7VeddƾL).eQ%+4|mM̹TLQ?ЦP_5I>UsP*]zK٨?M>=N[ʵ0Ulğn\ |fxj٪T߸Z06x<=t` XTS}[d!#S>`* k 1o!x% D__)?PשS'x%n% R#ʎI lkAɲ 4uz,IR%@իrg{~m%x~mv6˵43bo9X3:èn] ps5H@3vz3(d.r1XX "vUiyѾJV.\G{A[}rNd=xҦ(њr?pLڔ$bA\ .m%na A UYHd,wŜMqMjJ1r # fm'v^{=Cp訣H!o̲L3y9ؖXrKxI/_|OwK&+( CjVP!@s @c'zN S4B׫W/uekkYeY pSI`AILZypUtBN[` ~2sK8ɀlذ!q9nWXnNɛ"O% ʮ <^ tU:tKyHl񀥙K [y+VoO+i\ \WyG#iⷪ eYeMbjV>K4hQx',1k*`} :w$^W@ ܉3JuH2N1np18$@!{gL85 he0{@&61gص[#З CهkR^6%<tvxU7JC=s/R:_$ԅ{'2abd{2;1.% c{l2)KhӠFԫ΃wnN 9tp@&Y~֨kxy]n(Ah ے߂~S `ygj&vYQrt7Gm[eHK_wRomv"0י|ʗ=Q&O+$ p! Tu7isDŽ:f`/YTowd Ln$ KXުPC( c{+䥼#\=䓳 oc"8ދrI9ӹbŦ= TNB0'!"ԏx ƪ/ /eYeY2VA ZDW`^U7a,RK%:|W%a9Dzoc}URٍ.@Ck :9W޲z:co'SkI@{/Atl4=H?\UaKŀ}>#˲sBy)YU.[92Ӝzwxʪ [c,5 s6r.@.2a2߇<;v>e^7cuS;%p1$%ި6}=F f&lYnoeZnQ!v if9ajFJXX6/#;neFmX+m k:F]i<>X pi 9+;!vv!וXKP\b.e޲ j߻r\'Sv`RP` x&ҋ52xXlVӷ6 ϾГm3\-C7d-%[^Ÿ^$76m^7^4*.l?B3x_tfV?PXC8N!%17VX𶳞Z 6V]$eSN9uSpk&"~.aBhq"$.JwO;j J605,˲,kGo` H4b@<@=:s4bf ;@@ߜ"2M;%~* :&&vv:)ϵLO~/2)Κ8!eq7Ƶ:Cwg+H;_ ?zdk{C9sڄqqV.! p p9:F}vڣ|sm.xNp9'F;uq4oЊ+0EbHkզܡ4e{ԓ Io&XhDCu_%v)c1I]ka+KX;(޷v HĿmԴfl/2B(;dT5)o`\;rW5Mws={#}{I -AE^J͸_@bWt^ԏ /:߬j #Xa/ [`?vƷ~?"O˸"ЖZeYtu E2Hl*i.]z$ &dߒW@aVʕ.(rG//WăcTྕ K ݫz׉w>q\! KX ^eB@Uc4;I$ ~s_] :+@| '&5'FRtʕ& (p/Qjoը^<)זwnwp7,m:$/kרA2,e&|j۰~~n3܂\4%IdLbuX6mֹR~+z5su ~&mJA p n3B{\oO" Լs78|h{YWoԌLۖQB;mq%1q24O-w x~~CBײ,˲&1pG PQW[ J($nB؈jc`M:~.p}UH&!u*sP}Bp0RJ ޳jOXAti3ɂ'Q*OUjK)_N%b/Ó1)x2Pѵ\x<<=]yY>FM$ٜ:*G_eGɧsݘ}__$jժin.ɼ[}gD΍{.GdF+rr . k⫯:H kfؖv>!<3׫W/e˾.K߰sw(Z=q /]~i p p-˲,.5 n:@Ab42d[- k;,T L& ԰PI⵪z+gxf'1SX 恱z-.VH Tжg&c>s}%[IG><8cDvsiq$4KpQp9 :]dX+ayU=9}YE|Wp:gn7ޘ pCUHX| cvF[=a ;5dPݣerZ0Z}cG_|п;~eNm%]tQ|/p@te}#^ǃ'x"oEeYe7 C[:&Y)|A{OZu$AdjrLU1g .peQ}sHGH؆z /ޱre 1:D Gʩ*a`)@*A'  @P:rͼGuh X+ڳ\:pqx 3pµkI&s hK9W˼]l93L a"u k>8دg[4Mz`lܮ WW/W~Mنh^F6\\kc\x:ٖܴ7hNsw> @6|r9b&'Am}=iov ڇ癐&^Y<^0jJSn3vn6lO%@JZv~NC{ Mg{hGՕ`kQ7 r2?` % ֈ+l^۾Vm:綅pG {u^nIz+Vy)#?cN].0$fsFuإN;m@/'IxM2 *gh_ WDGJ+&oS$G띀T5(}sNtꩧf{nk{~._S$r;ûDin!$S,Bh'z pQN&o0P&c&O\\˲,˲v@ d`!.OԉRa-o /J4D2&-R%{/ZySm಄NWz,㉦r m?L L8zV rщ'q/0ez}&pfs c{HCήNj4aÆˑ1xRwr~%)πz ಎ/(ls'-j 0׹ R_7T1\ӣ{9mLnF>h`(`5 qr3ּYnM{Ly&K}Y˄ `mϬe0EAbeնA{F[@; ǟ_)WUPH%ҽuRZ/?B/!%uUj)G$ ]ܲ$s13f u^Y9y>=Y p9k1`E |$J fi:zJct%JLvɿhUǓ&ՇeiX 药}wAWa#-\"τ'E/hټkSp;_Kҥ $9a?G|@ȏ\Fq^;F"Od+H: :|ƤXuTS6ܹ3O9E(z;q.cgbZPuꇄR֨^:oUWn*ԭ[Q,S^) uVࡇrWm)B0ԪU7L[4h=:g@\333333lp 6#R2vug.Y7c_B]o*L5~Ò. @/uJ)bu}@:( XQZd c@<,+ +0) BV_ I p_B!w⠎SjSeџ|4,Av, %;7jS0f_BH@Lۨc  Wn(2|hO<}z/*A;DsC>n*G%qqџvHPs·tv@I;=EywS^?}5e,o:@~{ zCݥM&h35q=d i@>9EerK]{+j?m vpzH~1wk ^nI TRJ}ݗWuD3|'zϣTeL՝SgTԷl>I)_Rŷ_G6!%ä37RO99j@ YcFbO@f p}N./L8Zkx]_KoЇasR6.p~q'vo~D!'D핎.=?{m4nX~"fEnR ㎆sG*o([n n?&W\jyw aP\LH861IX;VM.\w,Vbd|g\E pj[\ZIoŊiJ} 7p̲)dT : 4^Ǡ:À(YthJ5Zu{4k7{ k5` g,:  YRK H ॳ Xiݺ5^o/xu֪sO(xJmr SҺ9ja'n\[ۨb}Rks f]JS\'+ Λ}@ ܮeڐ'lL='E.!ȏ_KQ%.=z~a7ಁyڷ}>5K!(_M6ԼRdMB]~zo?PѫtwQrOX.z?cp{e4u ._[UI?PLM>cyrl<G~ZK k [&uxN]^L;\@$Kxu+o ?ùZ7ʟT?Og:WI#]\ಚܤ ?eBp H^yLrx΢NM ,YIsLO Հ\9p\ #^`KuvLiK1p)ApN7h#,S[VX|'xR6saY\@'WܕA~R!<]x;u>A=Nd:,vx `A7HAKuGKcHeΪūޏ[e`0X_=э\E'u߀K<ɎQl$ =T Չwx__nJ%1}+^9 4t]k ýAZ6^ pGJu!q!4?aK~ di2>@D3o$A7z A{>w]'Ļ>lag[88|09\&. u Z9󳷝[ue,ձA?B^FF훚<9\nr-w Z}`31V˔)3^w!c+k=@&S+%l(_#O9u+=[_6}0J_ג}T[ʠUQp3j_fwq\LP_>Ey'+R}c&3˴%۩r xZUo#P5kffffffA5> ,Rʪ` 9K EFV xa<]8 .N!>l%AY.B/[^k&:v`};e~:W zԵfK w3e| ;D@u/Hf8 NUg:ԁ*$Z; (%x CTLK{MܘޣR̕@ݶe#QV~3I3A??/\(L{AɆxpW2A>[Ϫ}lȻϻD8D 0 P|<Ϋ: OսTwLrQOPh޸->ݣΝagPxuR*WuWw' "(XR]q(WNZ=ݐo^w~aM#}TbOgsJq_8g凖됧?OiB~+)g.={{Tj"?z9WKkJ5kL{:u/ 꾦z|)S ,8+U_~qFzWԇzUr6! M@8ˆChsrw0]"1$ӁҙtL8bSϱpNK.\X.m 5333333b ܵkS=٠3BPXZ>:r(π@U|}y_tQ_i]w|K` YZxH wZ?ȧ6~@ ,  sȟ 񥳍ZA3PcD=v*qPh\H[t^IЃ@BZğ{2 #=|>ILxC^|`CHA|O~3_ +gygx]uہ:z:INLW UAǵ5sAبKxNBd^ONJNvn_P2=[okQGQץT@8:Hp(.T`?ԪJAY&)Ș ]c2^z?+w A޼y'͛7w ;c\~}Bg&~ Q*\7oԫ)6WsāL]P 9]|盓>`RߦʣnK.\fffffffQ0fr*;4E3HQ2`: &zI 7(ąc=x5q`w_ԥċ@:8c=PDP! m@<ˇf@OQqo& Lj\6Wfk2رå|;<H1hׂ.u `y'bUH}7DU 򼫓EPS/IIq/KRmz{;iiqeC \#3#bn jVgsQgŅ  zF`˻ʘ$R ďswVa7/ĤTju7&#\ 1M\/}?/t bMQQ7REmap5߀ 1-M^_lp9;ٗw8#f‘pr>p >R 6n6SJPntv`\  e+c](xM){168k۶m{Gpqtp "%q&iJ}^{y:˔YV ,53k\`+c3[/L~owVTM7ujժV| \3333333fl}d"|1-s@/M\  `Yv0`;e˖ wtԩi+NMz6po_?ԭ[_-< ڶm\3333333fp-X0kfׂfiÇwFIuJɒ%w<5k׮uX' No|vڴip 53k\3,dG;gΜ`ĉ… Sڃ rpo ,YbB0\'qYǎ͛7( #4i; Ol]v5kffffff7qeBfw}A\-_>Z0zh-ƍ1";K6=wtꄜSo@\xݍ78ϱYf.pذa[nQr| (`,{\[p| 2;hwXܹ-a!fN˗O? Ν (iBv+W,fS]r= {q'pB /8׻worPx W.W\+ϫ?p 165U$A. 5333333;wE{ςL{WF [a9aۊYG|Nxwkf暈 rï pm,dAPYۢ2Cҥ˰T={fhJBmڴ/Kճ~gAN&d7[|6|ܳ?λQR% e|T{;Foj9}idBV-lh)T(a`p_ `!K$9|>taϟuwBZީt;NMđ,XȂF{Wg?NR7ݨo߾ >Ӕ-sg.aAu#W_}=7\rI1DjժwQ(OxZ=z׍俼gHeVP\3333331-{ Ɋ-Z?UG:T'lw ,XȲ@Sۑ7ou%=w9cBk(w \sYgmK!z>ؚ%J{i!KexP/33wN*\p'O[==agvW_U s1*Sov  `_{e\pl,ӌO fSefffffffffv0&7 UV';uᨣ FA>lӺtbMӹFؑv\nݠaÆr]fffffffI:(pݻwn@;ZJ*AʕUrSp`!+Cn u5AŊ]y¡r>B]=xc ,Pr ߥ[o߶m[1+Gr)abx{駇M4Z0*?Ta:u-1m֍#7 u[JYYfпiӦNI fffffffg/SHhSUW]  Y4;ʡ YTި, p(ԁLd2xUū,XPO9a3re1W)jֺu:~\rW^yA=?W^)V7h гt_~СCz*I"(o)*663kffffffffffffffffvPͫ  Pv1eAzUV:|Om>裃=D9`o5;YmԨQ /k=ҥK۷wi9JQ}ѡ &)48-KN޽[暙pa,6lqЬY`̘1n\Asn֯ͻ"EZf_; Ǐx`„ y,"3kffffffffffffffff&ӧ dy6 sJMJ,)PR]pj[Pp+Vpf,UJgϞn&|֮];駟`ٲe'x~Vq|@SF;wtϞ=;߿0|`ѢEffI\3333333333333333.U LOukr`Ϗ>ACm}~!>}eY f,Y-{9se˗//tw?餓 [nFn;6Xte~&`\t%X`A[`.&8]t~ 6I[〶y?llfJ3kffffffffffffffffEqro߾AǎqnݺsV:SOޞqaƍG (SNygqc &NL42, f,F6'2dHosvn6m}/{=q6m~ҥKT믿~G}t?DZ>oqvZwn2 pC4s`ʔ)iwfͲ13333333333339Em{}9>h0qĠXbeθ{?  5j4B ~qz_|6?[`eY\hDKFE]|O<_'{n%oou}hܹs{̝z /0뮻:]vu3Vs?TBEKY,n.] .O SO=U .o:ލDo9 ,s,'\&xzA+_|PbGqkn9o߾nb ;oX`u.䒠e˖΅ˀ`РA6ft]ynF0uq(UV~~|dCժU-Z8P?d!wo *U*}衇;}&g۷w?y'c\KBi&w +N?>q[ȜocZRJФIW~w|sΉQ;u#U^PN[nqeUzu)fffffffffffff&h">J/b&{I'n (6k[ PO\AXR `33̳ phF%\qAZ:0ԓ(?-W_}aӧO ┚ؒ%KS:xpE2R/rpdBW1-v뭷:e%78dϜɶ<޽n.,@ y 5،3K/uY&ƍ5ktٓ2,Żzw4>&)Cý-Z긑ږ(Q %.&zML ;=N{neK}G333333333333,4mڴqQ7a0ZZ=C8@lYpeTrJJٰaCкusuu) xU[.cx€m6uPiJXbŊdn2d;`>l@^rQmATT\ >C`˖-\Tm/L42,,\ 䖠JoKROҖ: %#ߛ7o@ Z~xW+sY5?J*KFT]]Uc+qo9{dzKcϑwl|& |@Æ s2k H_x7+*'+ v"p[:TbȠ,Bϵx2e\[tg~ؘQn|.~1Ӧ|ɡ@wy@0.9PL"ksm'Q>.&R_N:~ENS='32űY2?[ʲ7 9)8,X@L<xp`ﴅCY4Y~XȊ?#8p*ç#&5Y] >w& z5]sp \XT ,}iH'QzլcX?P+P(QRW|7ܹslz(?܍O*2xo(^xȵN6nCp+O ޺zPnetjx6ttq8AR$? mșa(E{Ŧ5qɓ}2VFԪmN;U"ɓ'o~>-ԫ(Fi +W2^SyRxT˩5|ĢJu[\Qd;1 wSM b$-&%F;&[񥜓ʎbмNA*gf|r/`9~@ [BzFUВv5IK^ 5l1zZAfeݧGud\p(:n/uSma!<ثGhwbƍsZ7_h~[- rL3|wb#V&(G@' 3`fv$\-~L"s#Ǎ1Da5lT-UOPQPrDzO9g}6;rK}Ze;lʤ P11ĖU~|{) aEZRbۅB ы2# &u+!NI U\r 8n'}F+ UFF &ǕM7'g;ws@7P2>NEI~otK@utn&N B~KnNv@3 >QęgL`Fr3#Lf +7J,+.*c\rP}٠,*oߔ=ėwwHqpw!x&fS)JĂ4Ry[8p{凅C Yg!+>#apF%G 67uQ[ ZAt蝹K|g|H3,՞p(R\ {~UlڴA^ (EzJ?5-0P \Δ?q3' O?\6ɵi9sr1U~oYj%C(F8 q`v_Q1mJ*Q~))RqmuV/:"Jo.\Ǣ&u q A}pL2S+R:sL7CCǑK./9qBIlDT<,duPG꫖Z iզZY8вu[ܺU-[--XкUVK,dv`FmlՊbp͏b3t,h1P0$>T=ޘ߲EZ6o6|0|EATH;`H1h, ,fg p$c s)x Z5TYYX9 szHK`́" U *\k;ܳ{Nt@`5]!np` kL`~VQ}A ߌ ̒KW\q n&В/V p7T<K/ V)]|+*`$+JN`5[@)_@/ $~@N <פ.{!0Qo "6N,:`Z<_+ 8JxVhڥLpǧqtyO~\Q\ vept(a)ϔ;(sY|%<7&ϗ{;e2O9= P'?^&8AE1,oߎ;s>k(`0wǿsff X|ɸ^"Ͱ|)9_"M1"EYj] AWf8prΒ(f8JʎY k1Ãnﺁ O*N%n#g?8k黣2 Pe@95.p8ިH4.Uϓ~gBVuƾQ#1D-^w5f RdaW3],dIx@Ch3\NԣB&1̍:<>S3<(w=p Wp>!V"::ֻyšڽ|=R+/wop%M̎h%딄R G-x P ɃS> ]%Hbz.+ 2EulS׿xs `%H4NgOOK F6DlJ:v*>f^K`&⣖47hS|JQ8M็y#(RYʟF[pE&P<ހͫuSZtSo(ͳB ̀ T"o`mvYIӵk 5ea@1i$ _跞 ^)j.$NќKj9UV*2D;O˼n *&K(%3cypCD?N܅T-?\PYT{r P'fL`qxЕ( 9v9\{VSC,ZL骦2pN(ꝹHݩ!q?͛7%~j{z .@l/ `E+0_+X/KgvϺpXfιܗt7)vP s%r}7m.f5~'7zNK= -T PLu/bw$,}UP V̜ Y )=X0/ WhկK-LX&lZNبY=Um `!k=;U{.|k? w2+'H&m:k ,^{}G.\MvO:y '>ձ{8ҍ~ʰd {*X5I9\A|afv\0h\X~7#o0Q%po^Ԅ/Pr+98 VAHp )&O5F T )֐ w#j瑊Aed| om>U} ĥ(  6Jk)!y)`Ք)Q@2u@Z. E'NÀF'ȥ{`pMRSO6E 9-+vg uteg .+/Ww6s/B4sm? _g=K.,nw8*cc+?'`>l׸_;oKH| .J7, UVP&T\viRb֭[?Ptij.@ykS<d }Q.D k-;kY@Z}J Yz_J%_XZs6p-8gKfU\B] X{_([  ,/X/W[X0Ci/KS\-YW3ɇV-<<վc9@NV3zV;ɻ\(#;MvRq:RU[t`tnuKNKMW\qʧȭgA0}Z+`6DL`.Sm?!RLcf J2g"RzXۼ}Ϥ=ʋMi\E<ퟸS`9n0ٟW]@yF革V) U:ﯙYQQU1u`)j[f G7x) t-#h^m@[ u'Pc3I5u9AKTR TZ'duNRxiBQC*eCI' ]40']T!P]J$ve OM`!eL =Wњ(i!ant@͂ +7nnNؼ&j,ddYp9%$@p W ,}exx+<\!˶3po4kvD\Vz|P=1ZKعӻHzMs $zNu/^kdx]<ӸW絮j1|W["`5q>c:U'4i}p1L5ePEx5Moh'c@sAy{؃lc%w af ]a0 @5&@ZfXT"rW߅o֍Ի|`)3T ƌs*t-UjpMA9Tre rgڽ{w%Z{@\f@,]8}&-ǤVkfA7kpQѰYFQG}ܙ+pjCƄ&>nF\3Ym@b K -=gWDj&SKZLT1L'݈ W{+p 땂,x&||̛we(]vp{n?P;\'r(A@}O`YqSqdmLU}8 p)p(F^< =ǮQ:\~m۶p_r Skϥ2}л=zEݝ߬'Zlf/'>X0SL]d2E)]ߕJoW;\S6@/ :\Cq PZsUq] =. P z-UݦJf R/:W׿th.gEg[a61 \|=X*3A*p `Cvư^UGR5խ\3X^KIx2{SWɏh͸ RBl|o|X(z{=1bԝ\"??. cNձx쇃[1V}KTl>T3/ 8KweRMxcp 4$ vn)=o~?"@oBmvS F,؊,S@eRl?k|Sczg BMgDŅ?XO^UUʎ@[ p{YM; h>~9*?^~|Xz+q (uvafH\P\+xsnsN gkŽ;:kT~q|SJ 䙨;gǢo|Tޱw R7~c:33gb J\fZ5$uաbGS ׫ Mu`lOԭ㤼]"Vǜ&b\Gq0lҡ]$ܹ:'KIt8_A½_6ff+WR lJS6*wq?5̧.4j5hh69tڸR8fxY 5k\3;Z׭Sݞa nvTfpy2$K8#?GҴ.A\d@ 4TIZUz~5ߢ,j ^u*. P֥p%J࢘1ǀN L|Rඎu}ĭgֆM>dnG6"K 儠קR⾪AqK!`S,&j;=xL`kདྷ/Z׉?PW϶)@c *. pqMr nפChVsS&ِc&|v_>< ~1׮93>KVYZ.\,j ,ȨW,lZ.>nY>Voyp١J?FS[,T4j8nH9mhgblTOf&xUV=܌o[QŖ M\`0 \@u sm=%pU8 \~GaL3o7D n,e7lA?.ƽn\'PDޟ^̘֔6M~Nj| `4q#B?W$@@i h#~uAMRU: {ࢠy \z(oPsO uʷV g(%/|*Ϭ1dE @Yg5|M0`S.kVY V`m )>2e2 6R{.FKkbuӽK[<˂.I~ -ջ|dEɃx*pz7L(ti {o*'_)cͳl_b ʡ^lD >UM,-,mA58W7]_^1=R^8UuTcy/[+H.U3Wl^d}Q-c i+hƇ5:U_ oUjYF5;0_514ӖW/_qT1塢e6fp Z`nukwS.7_p f/u,PUViwc6R4 Ng H&:;AU- 0+./:ğ^EqݿCTK\$e9|jn|6@pSrnՆSFDk rw̗r\@hj.PP4U f&`RNfs5p7rG\]] WZ_ݽ#wF,sf\@8پH<Yʞ [ |R>1AKpׯ_ -. (^ P`.JW />9n6#B.Z_(gyt~5ΖWRicYF{59*^(tQRsTa]}<*af1( 3"5Y BtQvĝ >r5kƋO%c\  >nQ>v8ukH7X89`T_Q r)?W,b<jC2t>t}˰A@(` <w_x|4LDP^pa w1ށ{ f9c+q 0\R@q=:~ @`?)%碌lbUkzDn\ jf@潩[A2FnT0%:!T}~iD~(ɽNxny&f.P@q;;`[ ẋiQ&X&_~q ,룔Ws^'qe.,'!Ļk1ƻ23ſ2Q]Uet֭X9s]]ݥcy:R:7At}v7& F][)i]}!ƚs|w}iT oۄ?q qp `lm)_GTp{,2-A,CUP)`d' @ ZTKFvN|P 2(+#'%6e (bSr MgHߠupZs43.q`#wkaDe֊"z3wk^P{8ŭ"~fq)o2]f0)W~9]br{xQ hu|CttzVx(iǝՔS; ߎx:FN q}NcgRP?#3"UNRo.gx{>Q4^hqjfQQQ@R Kw*#`* \*J~>GU v)|*A-`.pY&wr@,P̹X*y\?MI;|zD\ 5k\3CuX"_#խ5kv$" ܲ{? &9hRxAp1-vQ ^ R;F;,gRJbdu**\~W>RR jUX* <5O89Z)OqGi)4O|w xM/r\j@H ?zEO ,9+1osczO,ȣS^Ayz~!+8RcP@}TJ́܆srОr;i*_0*{+}%;E>FyfW@F-?O/Lzgz?.tz hz\ˋ2"T/JF7+6+-;J~\R>Კ>3M&{) |9;+:/T),uC=1Q 1Uf'8 W .@eM)x9đ}Pr/8Q{2no_7yo@7q:4 ^V+^rCo)6x1e8>đe\7=ryq/ q~T4^ċt>a܇"||d ċBZu%KāF3PViR]N2$Op-JKD5996Z΢~}G'%U= mKb# ҚT[wIH(qFD߂6|~])8۔}3խ\#h Ps4=_P*=-vpqLQ=O?L`i;QԊ1R{7;s6c1%&kTRYV 0qtS=ͩ)[|}fTP*B[R C/1{XJ3RT >XJo ir( %3߀IcqqAլ pmpJ.ෘUW}4:\QJ\^kו{`S";L*j@ytŏVψ4 ƆXn䁮щ2Dd\arwWyw*-7>X'!m>ݔseMp ˩Cse|MyeRޝ:fO9nfp=6)'*g8(^ɷ>W!VRZދ_gV\г eE@q&+^3I&k:?pBG`7i53;h2bƒHU|ҀViUpz %";?02jxT@S*FX 4)<01HyTH4$fP8>f\se-cQ@{x4O(G4~#]|WĕksK~{ct\7'Iy Ɓ4$@pMY@.rxO\#.lgjE}tTiICO0!EFEW8m@|]ߴ]FԍU/)ջI360@F}JQ3T[w\Éo3h}{L{k7?xHNuVn K-`_MukH3,3HyY(xGTu{Q#x<^pav1xz .pQ +.pVd1_q M`1uY~b`%h{QB n;M(@'PKl\+ iCio, (M@YQrm`(QL| F\A=u9:*] Klw3ޥB?7;)ǣ5 <.q^oDTƱYa0S!8_Ix5'"xw8<%T^\g 7'sU~P2%Rݺy֞KCX߽&eJW~rʱ//V)˥nMuAc4cl2eDYz};TҺv5 @|ufS?XDY f&7s Ź_1=[=> ch:IzNi[yC4a '0;2x!!(pH a*Ԯ !E' 4PsπK~'}ƘŹ7FG+5IS'ߐ_Xw"H#&Lp~sJ5aO*8ܛh<l7a2 > k>Yf6L=EMāM7K T>/&ii#D$T@`:H4{fuޜpI~M-k_3Ν33>aK: 'VoY _rڴ \u 6?8~-oYp]>9?8$⯑5J iXp4ٚ lU`mR>ѶE (*6aΝ}a⍿!`?kW9POӞM&.,3%.`o˴U~)kF|7M'=qƐ7Ltyw91cSXs\6b3 )i #_UݶJ8p L['sM "ǡ圙. :]Cql[ٛNw>ͥ}ži?/-af*YvQҷVԝ)JOH>w'n.JYTԎ*/&Sc{@O 2@;9W~lŘ_X5ȫbAےl4+@q(rm+l$r3@SP"A<{ƃđ6n \c&@p916?1m&ϔk{e7|?Z%ʧe4.T>R;Bځ jcbqi ˆx.;SJ/:Tĭ* pN]1n41:8cc@` p@~4n?ߧ]bR^/ 8c 9)5ca[gLG1aL>/bzě砾ʅ4)PN.3ʩf?>*]yz'PKQê_w!#|Y#-雑Ӈ$O z<\w,~.;]< T։gn=NlF^u3q!*E JGA|LBʫ YoR x(Pߦā6q+̲28cgj0R%*FM08" -RрVj\O\L?A5UQPBuު1%9(ʀJWIG1/#: X女UnpStݧQo)N\]kP#Jqk̫28N\q&=P,nҿPC_u)4Fe .yulSg%>5QyphWʟWIJ}UqG3j/7( 0sz8uė/𓻆:'9xqI:>pi#Gs6^3aѣ¯R.?6P՛}pđqaD9kg' K~upԘAᲕ3{-7껁ᯫgpq7|~nɣ!#}}p穣efcr>K:#M'y7+. o~jT]c`M:ԗLLQ1ҤSQaU/Q]_Np2^IicUW^UGOT<MTPK10"Aވ#R4?NmI]_uy#m]cFt􉛟;M}`#RxV{Oiؠ#+Fp{p¼5o}>*|P!a~Y~2ptXf_ qN8?/ ?UM8d`'1L%i(~']5&[i}ӗ>gő~7ե->]sOO}=ݗ~2({5 早ܟZ?'N=z-rIW9 _8l2e@L[ߌ/C!o-AY rFzig Hx)\%/`gE (E%Ƹ6cN50f9w $<|hUCC,PM`\ʤED4`9<?*} zK!{QHF1IJą~}>R{ro60|亲$l"NQRHK91cO|pQP;HYi]3b D%`^UQ&oE&͔u150[ݗOc0LP[ y}Xw@/~Oe~5@(yM:#ςwgK(P"N,"zq!n?n u1һ#qw1cײ{RFąljBλdY\*n)*B x9o^p$zs4tP JA!d 5*4x%gLPoAD\tun8TO\|҃Po`旴y:@KH]tL|q^ʃ݊bJ +* j+e)ܽU%1 KPQSUeoRi\GJĸ7y^׼O<v)kG̪{cbL,X;(`أ1h711!{ޥ#tTDEw3˽[`Yyw=g̜3{s9sT7\*݆Y3 ܒ?u_U5ׯuJo;۵U3~*W:Fd;/jc[}9rKC׳]8ucAƌ ߫_oņ(1V3DsD0> ʩ̛>m1e%©BfP>ȏ\F\*XP{R=w-w:m%\E7ly~:uݛY>o(iIOgH/\߽UVMʀi^$i*s]˃k>:\|Ck6no:y;svN6^٬mAux߬C? uΊn*c|ʬwì{BmWN 7}n2?[ԯ?fR@5\tI Pժ4Z ͊E62%ЯaL^ (U0@ `U(@!VTA3$|('>&x,Acy<U^);K' Z"n3FRT{pbDLH1O@H"hIQWxJY@GUorr 6H~7\˵wHPF{RF^mp'Oxl'=$'K{[ๆS8`` zkQ*6G:ΜO^TzuyRv_wG9.-6t$fu\+V>Ys7xi-Q|G&u9ڏ4* +=i0gL$iƮbԅ+D3GG Ԁt+1@Qp:t{ rj^RH 73E:\9pq~hf+ֹ괷r-muoFX1P}F=~3]}=Sw7ReGi꠿ѯSGA9_c~Oǯgr1FR/ e{(1ڕq]]{9mz\OH۷dB ں}G*vFҨu;jR[.iv=۹Z?XQ@>myX&̌/ 2N3YnKW#D"9}ޱS(Z֠թ۠q_鷖'שZV]gV\3ڸ**+y ~wz:QɻAʉpjħV]z-5HkֱlP7e^ 7A`>f$evoEIu`H)'sZ\&%0@ xl6~'A %u\~ aef\O̤~9 ߜ\ )G {><_ėu mx.t'?s2_ߔ pOGw>hr7>w9 ߜ$Md.k]㟗3r\`~W@p4| 8 P&0䆗cr 7( p>qO9#ڛc;&O`Nhs>c"K]$jGqRqoշ^h"c왇MnpHu V/Wf.O*1fxЭ8y>u0 W=h3)zڠ@BFg!P8H:GԘmSpz* tr|<.Q9'Nvm<oՀGꁨ$#ΧåSe cby7#O;(#18|hh9AOt :\{PtX ʣg`Sӥ[})ߑum *O2he)G-Y xd@u Z"#mfZt׮sSW[ѡuTܚYwb>4ME"+}k4li)oVe;&1"8UXAt^ &jЮ޸`.X9%wsBSuW.Z8ֻgCSI+/1DN߄#BrloG>~_le,Sp/qj p$s*N^ƳK`lYc=*L2p[p<#CYyώZ5Q^~1SYY @րX&X5JL[ ݏ5dh?.q- nGQj61m5f|zqSM:u8ԥ"V. 0bK]>v 0ȊWn.mw}W9F(Fm{9=]@12 )nYΦ .q '\wѩV+(zй:2:/RPU+vh,` xR*/RzmŹy6@: hLspo7 &8:' @XAѲ >s_[xq;orZ]3w5#l=h@oCEΑf-nZ5&]7^n2p]5,wGݐMܰA6;lL_I|$/4n cATZ~%K{9+>V:uoajsE*ת\| "Qi;ʆ/?T71Kp@ WMnMPm3rmWڢ .Q1lʲM<8Rvce"SXI׺c_*K>{C}qٟ2v0˸kH1f%/m`Սnں' `' 8$Jv $7n+>wnnߟdX߼SdM[n߬c~%*u[3Kdۊ\ [0y.ڼDؽ7}y6d\N]iM(S-Jlnb[U[|4&}ﶙKZ/;ia<`hH3ݞ(D 6x /EEzXcVT=`'xX D@{`1wd NS4g&6/0 *R= άe1\<$p?C2`* 1_N^刟Ejrs8i# 5~m">1%ОM-Căk].uԅ~  ?|}/^7^cWfݛ6԰~u.u:lEv.0L9$#}AvzٶScPpqM6l r c#1{I*O?_T%˄&}7dƔ Lc<\\q%"8I9@d*N:y#RV廎8ꃼ6&McfcyBqGyƜLFBup@G ٨EȾZE:IKudYZ6@ pΚᧇDrMsVgl ovm5=X6CѯmҾ]$ rDZVl\&gml7X=?kJq!57x %W+d`Z/-cM% 2ܞɃ ,/30 :Vӷ [ArV X--d ձ7 .0([D8+>:ǹNéE XS{Ypbίe>#3 DAcb]N h(ϵ^wV7SC;הERG˓Wg Ҟ~0UCmc}TrԎ1WKt qe^XuڎdZڍH\;uCgnO!.XdWMHrE6j6Tco$@$12 @]~wQF`=Z16C\ʽfSkMڈp暾ZgYਖ਼j|dp(V?9cs4vU+\XB1"'Kn^6& ઎ȹϊ4eXXz1؈P:]<$;Mr+nQ/';o7}[_U}+Y8he7J-[nG7GMɀMFcNtsUknlW.@򍙼ȎErhdנ,Wn{)O} jrQSLnxSR*R&"q ,kIZqw:梏+:'=oS;vk}5`+Cv9dD*71$X.+Y cb`E xР$%l &z\9`dNq +n V$ЭֻM--QDܚci0$׵t:>5;ԁn@,ѾHpj4lf,ܠl<\>^Q-Yg!ۛE>c |OAXqgvh\ .GvEnA @G1 5Ig]&xe4Y}s˯d` h+[O|ٷHnDkV IB%J\ 4;p>BzaF[*"5]&mv͂O^E.+D*Rr\s :%!šΠG7Ѕ` b"cX)Mo6$#zqm5.u]B\R[RNwh5f`BУ"si57~شNDe@O&OrMEQxOo"py˚4I5 O3F wǿ< R Ym-]0nAhn{f=(OLMz'K\_Z26|irSFtkkR-׺}ټw{v?Ofڀ10/I^G{Ц~M-Zr\JwN%!@-Iprֿ(Rnז$91 )U.'|0> ,F3Ry(@RJhmpܩ+ еOK$Pfp<'S;=:/C\U{[X%[M\Kp8%-`͚NY{[?җ*[zT];G֤rzT9e}Gm{ErlApݺkR}?u{!-5 "E<,e@\Ar`X`Y414;CFnpc?dBB!}PLZ?̲ }@_ҿi 'U+Gf̋dx>(!',hJ=rHݣCT/ [)|rҺ="e-sqBm*)xp,7pw$ڕK pfnA8 EZKw̕V\ڃFMZ`|d${E ?7 Ld|. k#W1DTC- ,X`S ( nUm| 0$T`#3֊ pq'#QU8:..aY`2 XsMl|DP?) 863p吷3sQ9^3iEᣄY7mH/]hMbN#x 4DFm<[mu\.@Z v8`obvrכ5") _ E.8wYwx{\>oVӪZuhc-=ݻwTŠIH&>^`K9^݆3RQQζC:Ty-Z@:%vB6;!_~cǡpnrг]\;$)ln ˤ*:x=.0qgѬ"im6\܏2n|\ i`Y.|H+Qű\CG.dnf+ |=I>(y,`R}-鷫Ufӭ16zH95{+Tר;Iu}^6}c@f@ .ٸ-v|>{J(]m;@*NLRQݻZp&oy%Z-&.pzL>,z%[aUZ*)j޶ ps<"p?xvnJoהAV/" pL+ #ꣾxL^1T=,H < $#g<#S"HG5 fEݾLOG$npYKMN` D ,XFK,bͲpjHBZ\G`&k_G8G9wʲ}P.3LrH_rna{:ѳYdT88ݬY3s28*=|OYUƁI p~)ck -KY`S5"xφeE' 0Z[SDr6JN73 3Fʷfn<%9&u2}Q@P4cюb3nZ5ܦ?71#-HhW9 -0ǹhzI.0{nQ ,Β$u3KS:\dpkfܩ]hSꕟM6lF [u[vҢvj>|-  Z~~hLGPU("<Él_o|AK&hf$~W#I4ku[/,X`;L",d0ʼnĩc5ŋ7*i/wzⰢ9 \0Z ۰aCy^F@QBGr2\-#?6qy9>0")L})X3_* euEY xx衇҈^~+~GuD @kg*O 17hDZ+UuBq\K[ x(ܝˀÆf^ )-, P'8&e>¶wѹ^yn)9Bܢ;r\>}IX ps(@u1p]ff r)cp) IZy뺹&-j:DJ 9*?+-"~i`" 0UƕoH3kXfUV>>stEj|j#p5I>ƭp)+HuO/#9+j)ln)OW=>`+&emu$@c{lUL(+NY@, G2Xn. `N\MpwH%km/tTǐvL' P wؘ .Ҧ] S9F3I3hSϴ`S]MLOsZ'ь16kԬf~]Ng}۬U]j\5su ]_ ^чYcV9WǍCN4 cP&M,*JbK/7<׈-LK೟@m㼼ƒ(?& cDF|b{5e E~b3s'ϊ2MϊJ\veҨ~9q[&[e7ۘfVLs|;W$j\eY;iI4n96OYn/h5[т/L v(FzҞ|Ic z̼< ,X x'S/.Q-Ie)&>{Ųڵtiѽʼn!:/:V9).δ-^@jf% ^9|0QH-M41 %Hay|A\@ɠ#LG7){ӗ 6k>laNG)PL?SR(/&x}t$p&$> h{XПs*f!܎ԏ~rbX1o?Co1\Z_^q_j+kN {Fk{1s.ccZ/7m,F|8ώE+٨ fdl5`9fnENζYi7,WBטo9$CZW)^87{lN$%@0W\,Gsm6kU6n`ɍk/4#|* =cշ-Vv7D`(&҈\6/Q1qY]uUiwq0-ъ;n=MޥWwO`h2^A.9m[Gi  pg+ЀSyG(v{!Up">[yTcZ":Xp)yI%gZ"SF:?dv:,u g/sY$'yP9e| ӉpZNmFpª 2u$H0Trm:ɴk<frA>q$>T]DW=]6:q vg=P߽Htߔ>Tl2m D&MQn6ڱ6l2d2t߯V5k\%i܀Й p mQ8pXyX^qiAn"p60ڱA=7wO+>}8T2!@94jcD?Dpz;6@@ .ѵwKV0P A^LƠFn]p3! %Ll}8&g3|`W[zYzsW+>msr&7djű9稯BG>֫~:u F8K?O]ۏ_WylZ߯ƀhRh3Cf& D'on2yڈ<4QwtƃAz?kEʏp  Ƀ1(LmQOGJv`au>5iJ/д} Z@AՖ]}|m\ikȔ6 V] $m5)u?Uf;p 8/h<@ `i\Eͥpp[F8`,UP'y ĕέSz5wkEɛDzx5n5UW y` % iD"}7+]{㴬Y[D+2NƏD1jg}zXC?i!ІC%*;L"@5jHEsɃ'\|I{izhs=iӟv,~QGePf^Jz2@Bq/ʒ~^y.7[\2rsZϱ^rFzY!Y`@ը8þ-5I|E=_h6[Int^wrvuA p pUksCG7j;uoazMRͺkwH K+ṯ/%[=茤e6ʘ` k]f>nnW$=e#k*CӜUx(GWėC{xTZ[Ưj@04q/@5,_1`e %1E>9@cJ M.ߢw&K.-RjQ9@X 6=)=oTިX`& `2)] @r|&mloTvSMOoLڱx}"k@NOEyZ>/yBLun~dV|Fs-tp7IKp}ωiv`rN)}Ҽu;hW^1GͫذoPrJL~,lV½Fd.Ж~c!M[ nA[`#R=+iN?SO=e)tҬ8_B@lS94DUg];`@oeNe@7eAn:qsc)8mBA_>ڢVFy,`Ϩ;͠5ynl^ڃ6c,=ao5eMZg2&Vw}IN,D;p R{(F;"j\@=mN=h?(o<)7}o"Z ]իg5mArq7*퇬/ԛoE,~',: 踜$ >"v&ku(ܙYy![0}0_ )Sޱk}8AZ­qz'=cpӲ[?szO?_ n}M>z"ȣ"pѺmʚE-ؼlE.@ᮽ[f_۲Mx(X)# t1ڦly-c~y#vjl?;an}R}-N.2CQ+V4У~ޫ/^|0Cz `oD*,o+ ~Z}:x+uѶ#4\}vI?J(DQG&o?TƖE'Pq (dcYu[.ǨQ . zwku`ndMoPap̜O:W" ھHmǽ7mYX@`|'@ Ps#|$1LYyF( K/4ۣ@SaQ k)S."~O sVՈe>MJ>_~cڄπg DM;nUԶU&hGS9W+Xͳ&s)+עGY8ߚr=? r< xgKpM~Ls-[/~Ewڔvxo.D ,g}vhƥI7LIːu{m<|l)@\x,w(HD1)^fTP@՗g۰lKeVK_~ڠL+ơp>C5cMn3} YlVs{ky?X?N9o^s|^јtG2ffLүӷFE_Зad+gc,@Ǘ|D 0@\ u|FpQдk(Ybčtps:~;uVl%޴pݼ u\*adt~rGy?&UYaXqzùYnƀb;zj8) fY}kLuoo5 ͇ ÈħΩ?90 gDc!헔{H a;_{H9%‿ulK%Ѹ"A 9P rS ˒}ʬ|ΔYA׭,<2Ns&, DS_z# x뭷%}.CY)% ŘShz, b')u̗J9bs~oHBgɟ{F`|ꫯ6a&ɳ]uyu* Lǥ=; *W1Xac(K4F*Q*:"?uT_N+V,BDRr<[x@/ةzdp.IЕ*Uj.:uxO.VJt-pQ l~w$E>$9 8{x/oe,meܱK=T҃3ʦ{5QPjV/QE'UQ6~K-dHaD(Q cIʢ.K,h=nShݮy`iHu 7XA\"6էX]IƎ͈o?gGƥe':&@-OS;J;X2uXJ7N@%7LK,M,VdI6"V4[no>Emqŋ0K(/&}{wsN@i?2% k[_[eX@ӾNR ZIze/G,]MbF:oo;sϵ(s"B U{FeFuv3&=[HVndf Tkj:o?ϧv/?}t+o r?דּbg[_@65~p7Ю @9$E`,}l1((Nv^m|ǚeM~ǖ]d[rE`Bn+jhߪOd(lx}7VY0U,(Z+:-?OȆl7%Ȟ>F#i Zޞ^&ReQlƒx{PK~L%}y&-Kh jXqQ]!DL1~"2"=WH`q&OaA bMhkL:S^L;_E(T>gi]d"Wʿyw] ;ߨV]Gm˪R^% 1 y |:WIRbWL}X2 6#3܀6QjK =(_{ UM@Vן˥{Y]'AmMشEJ&Hm҂bbǰŠ{^ЖWu/o3`);b7r]ѵwRBrݨm俩}/W}ymp߂ `ٍH#"04lьc$v8![ya[n`{k~'n9Y.\ˮ!k2p4SS,e8B} ?]i&٤ 3X%?sl]ڴڅ!;{؅F0tpOڏIBi @z´,G"GDd~]{D,P$tL=M̅/ڱQ=+H)id؟"- 5x @~lF.S63^w`C7Eܞ㡺/so%\oD);>';9_ՃupI:K{  YI QQ~w@_YZ@m~WirR6 ,X(KgPujj6R>S-E7=nHn`i.Ҡ{'G2vI_KϼTֽ^vFʨuRH+L+M%D *rspѿ]D޲r//lcE$"R ,s" z[L7T[69P6Dcȷa~\Ev xZi޽{pA묐sMQ}ȗ%*m"&Sa CS}X$ݰYV."uei ې.`zgOQL<delT2ʹ{<EC8yx^έ@X6(Vn{Fy:i " V^=LBwD ^r=4eWm ]EHhT+~ ,B67c9o~Kmj nH;܍l(J*vu:Ino%h݆n7@ `RI).6b ^VS5)U&3@4)>R𬏢A-/6"mWEqƈi >pUqy$E>1hjr  z,g)+AsyIAUnv"`H {ainJ$a؜"xj{,-Qǘ`$QD1to/2zސTzu_W*qTa?$V)HX݋A8Mmua ڦ4d-p U!'IRhJp_MЪkٲjrHKuEݮ Q!,ܢpZDH)EmLiw&>wA@8AV@1pKy1\ lK`r#@ߩ.#}:PiHbR1q}6>}:P4M[/H<i^-@iuИv6`_PV}xhԫds4DՕhZ%>Sm{`-cwy|:' X8+HES;]{6e'' CN\}{d{IE(f]{@Qѥ pUtl4M] H|*.#i,]6 >I(3 ߺ6!MRA È6M^gF:vH֟ $Zh\@'m)A مy/7Ѭ( @ XEzƒN]k" ~KtiG&/gՌݹ\@'{pї%2Wac:,Y}l 29&j࢏708 ,X )ܐ v[~3~m}uLh_VTv2>]qunԤuR-WpI.};K6tӼ^`|Gm[@Q(QXlL iղ| .jCUjGuI hSOib1%15&)c1me%b,D*B:ל6JY3!NQ;|Ami|Silno,.D"u6h 4T.jZluRjOkw_G`Eb#:c*Klٲ&i~UDK&[Yg裏.7 ~z XWuzNi d!'Nw61 ,X )ܐ vPQDN+ׯ?OK2ifxp Mܹku;:@Ő 1&܀D*N[D!)u&:xW^1 xET% A!YA\ƣț4z|}|[[d˄eÆ ѿQY">+:VVu,56p@bV̩r&Vr,G+ʋWr|2T )`w^*QeБrr A͂#g϶sQ9NN},%9[s"u ̎3&QƋč"^/JpØҾ}{1"G5PחdFI%U0[g)uTi9d y^h"EFTM"A]@̴%*{O`feFj_hѣUD əɳR/' i 9PLceg<[Q+ 2XѺ3=l*j ;$V5J@c4EX{JWYwէd)^}U3UeE9cYXyj{.iŏ\_Z9K~/sNr`j)EH!^P4C~;  *H,y!J,%BG;Rr#M"nҥBdR=6m4eٸ{67O,3Ӻ#Ytz%ZHʄKM&y_gf_\%,+Kb41t_u|73!O,s )cD\ƨ:tr־@C 3RE1 L]Br/&I!*@ X;0RRiH!Jy?HOt> 8$2g/HUTy4# 6Q: Qw(|q"QMYNoц!6jρ z'~ OU>nǺW~5M$l*E"сm- #ᴑD"q-ɧmg=܈4Ѻ~Q`+-ΜmF4w?׮:eln!CX{Lm4RH6n[>߱n5@.+!Νk,s$VD5pNtZltӍ#/JnVP )JpvezGe&e"%8PhXNK :  %HGlܸq(" ՘ D #S1هi9HS \YK+'V]Em ī+wq&,g0 "W'+LV6ʨ*=0?H OLQ,Vx> HV@Er_e}0eNfH QO 6Kϔ*cyF98^.,-0SqطtnD-+(?a X孍jŋt& ! @K~UʯC#bԞ*j7〷j3~TIlǽ" Y &Uo<5u=1]V/?z苸njլ=<|5[QϭzMqbS(h|vy%VEqS߻/yhj& ,6KUWx 8֍҅!T?:xqq[i'+p}nА =WWעEF<+]Rt'f$X7~Og%گ;+>!~_+nWF0[/, vX\t]#TC4Heӊ, @FX.fАI`Cd6y0tD"2|ts/_6}ta .5z-ZdDvbD l,Dr=@;ࣖ[ԯ[eHe Eށʀ=lݺ5W!8\9Δ0I?Ѿ\7(/EڲЍ!qf1v"XiW6MXq ac5]o\Z-[ =X1| ئ 'DCvYAWkg6!B=KQL-) Njpit]zHK"څ1E{ߴ)v6a <ڏ@.[_W ,X|L.D?РIJ% -,;V7]{->[|Cqenr7xmH!bܱWW$^=U`ϗMQ%ÒREQo) /y˸J_RH˝Fcim`XuEʦYҒUHр@Rt^DSY.߀8"1YuMԽ76$ړ?0KDf |t+0&]ݻwO۾}Emx{!@\"?L?5HA"yh}MKd)+m6˃RMU@'53 Lt.eb.j"v(SƹoFxc`c8bߩ]P0s-Tm{6qje@K+0Xrg&Ei#=Ɖ̦Ki_~S^A*F%am=%3+ @uh[-6mjPM(R&"m.N]&#M!}@@m4z O4ɢgmRsEs.mC,X`6fۘMTutgJ.B*$gsN+dRWX4JW]]K/-y,u%EH!j%?ߖC iӐx_%k}O:tQH;-ѺKirok^{L""J^ty%ⲒW\V" 5]~%'l(&|D͚5+8KeD@X"hD6Ι3*DMH aeD=RՈR_r SL1HG-v8ZrR6`&\^ &/DDZ- lR7GFuֹG9w%HY"nbS>`i׮]<q>e\3pXuiΆiӂ[Զ#5V?qa? 04 wr8Nr-~33Ѻ(@9҆HU'16_Xh&/T瞐o$`͛7~/Qre;iw~u9)XN=<fb X`g΋N> 31#-Ѧ2_~y){_LH!n" `D$ +r:V#joXVcӥgDf"ld,+2!Tx~rxN9X;t Y~DqNl|[&hl݊}9o,X`X&Αף)NZce&==1ìTMMB*D%3 q&&XJłN0w-)'<ӤRL+*qlvJQ8\À9e (عsI+ 7n8 Q"oo5E(ψ"&" ,>B\tЎ!RH=88A==x$N >L,Od@-!땖 '`}-Y$ܔ`nj.ہ\t^_$1{-_ё ,X` ,X`dWݬ0[ [3йuLKժU]&-lԁ>KE I(L:ciwrNcWi磷+; ppec66{wm/M67+I`tmi ,X` lҥi6x3ĈюO*"6xFU?nݺg쨍iw$+-ܒno=qL;wpC vXY ,X` ,X]ـILL"mՈ0"P5qWלqPuQ&,WA$HPTB]v3 3+z뭷UVVC+H"tI-5ƘU \c1c1 9ꈆ% V6tի/&a)}g={W>;'M.**Udw4an?Sc*1c1cСCcκ.]z(̟?i"-E͓Lꫯ5y6ʁۻpJڵڵ{WM~ٳgn)?.{РAc̪1c1c(X"n aٰ[Z^{7y~Ig]/Rhٲe̯Kto_o15c1cb\aԨQo*Z.KEݾLmcڄO>$zq2d1Ƙű5c1ccTl^{6m !o<]{ KJ .oc1c1c ?~|%/-pcǎZk劾UDɅή]f$BnFn1Kc1c1 VIqp-Gyۚ5oXܷkFV#R&<1wРA5Ƙec1c1@ JV+ )oSYW]u D;N`²~8;cc1c1qܛn)u]L.vvm?TH?DÚ:ibAa1fq,p1c1'+={F m۶%<6[Ze˶o~d=X};|Ic)1c1cI.p9]5JMަje[j5|-ȋ{7F+x cc1cYř4iRkó> LݠM6?RLE;go,멧 wyg,p1c) 6 W_;cɃ{N;.pA6tPv|Nks={k Ek묳Nv6nٳ>i/{cF[cYe!ʃy83 w\hԨQG zb[woTYfv9Ϯ[ -[k]s5a„ sS \c1$\oDHVfN,nC=N;pguC>3O?b4Gvu׌MA.K/ _~y|Oa_ؘDb8cL!Λ7/HDDxA*ܶIN:6ڻ|{JCjժ4Y|c9 INc ak1f[nex7Eq;#8"F$_~e2dHl` 80>.Oq2v8a¨Qˆ##ύ92|q208qb|/ץK 9S%$x\rI8CvmjiM:5\q/K.DJdWSk1&..+.QV -\¢Eeh֬l*H|C$[ (eQ=È}_n)W_}uovGؐp@E1Km;eʔ=F;1y#^}+2F2}j1cL} O2ߎ"V '|6d3 Q2Fe ,ԹqJ1_ra .ԹoTfs7.(raݜHRI rwQzΰ?qt%q+jvB sU U2*W1JU$)h!r󻆎{,F*B7L6-vNϝ;?R1c)%ʕΜ93t1>7f̘ O?tA,bof̘WxN77H0P|.;'Bƥ19}t>̆ .aUdmV2zRV>LPɐOUi{iuU7:"ڲ:ovHqY!e5׬9?Pӏ/s=o-6!<H aR3tyGh 3*\JV[wu]\+J)o\3NmF1!id1cY&֧!~*4mCMyzMC)u_,! yN=Ԙ;uu_(7$-X+(US. \Eߗ$J}$ 6$f>Ui|Oix6:o恵HR@̒`NChH?،a"wlYK[ouh׮]̽[kYС(/1'prVɁLb 7 [ tF~8#,2fVm8*FeݳR/6@cEn3䓯yL'Fղ5Ƙc* "̀&:T0?G7Jg=ٕ%yǪQݔΠn}^z7JRk?&p]XmԬ<" nVg}XEO egpה 믿b"OS˜=8fՅHwqG=;U }iF"rohܸ]b3!ie=W RS6XcY%!ս{Au:6w5(b5csEf߭!yEdf{,1y饗Q7}W\=VZR"eg^x\х<7`$r){чZ4EOD+8+|30zMCY%~NڶAmHqBXrה7fI{+<4i½7W;h$LV L^o&;1Ɣ-cV9 ˆApΟ?? (+ѩh&U͑̍EqOKsELDK z,G fKL|H"r i aMiBh= `u[>84')b8nʱmj8"p d7t%3ZjlIDkg_ #F(,pM`k \S*#\2#(z\}4rh VvW%C\|e"zXcLbk1fcA7(p%G"WdeD2QAR*&Dyn')rv{7|JZh4vl_U)$85j8+'pWCJ k*A}Ef5!zu[FL^U#dd3H/0=M?A7pwC$%ѣG`r]wݕFAзo_P0+ 5oHbBPZ&]kTmݿ nIZb &NB޽ða*bk1e1ƘUԌ3h`mѱ]Dng. tc(Ob6(UJ Z < 3KB5 \&<:KyqUZ {;OBC2r੢[Dj.Loue3-,pM`k \SC Qhۍt/_|R"!v3\tL-^ox'B+bk1e1ƘUG\t%'՝(rsέN;'0R\hkWv3P=#: [cj]{QUD{DoofP0yupߠ Wp-rުX]>!|$jDlu 4Ab5.SOU@t-qmm)Aoוo|L0iҤ»ה 5š QLs1FjsՋAH܌ʓ GjSFTsc \c1\RM54?;h4Ibi0ymD1,5 pIgopɬo:) ^xJ]D- r:2F0JDc\xg5\hBjfl&)YKxqql/AXrה78T',2K{:erDfi`݀Wܿg͚U \c)[,p1ƬB`"EHY&A"WIiQxQW_}uH\dnUDxJ#*%"1W^1A۳gnaQ"#Lj}',&-,.d/Bޮ]5\4I\pM7G $hQfώ]%`k \SX_=|q25OD {it9پ}u$g/u?גFD#~x(y&dѣ4*<"Y'["0 O<B?ɑ;pGm-/qql#EC"ڙӧO0f̘&+>&NT6œ裏hN8!mp X^z)꫘xܸqVYG^d ¾>~Eῡuqێ8ŖOC: X>YANJ%OIX.uc)1꾨~3gN ^W0(wv8z) )]8Wh{c?͵krc{  \FRT6hwPCgybA6QJ%>rc9xR-p`C*|IC+T%t\rm( k#98y?y ^:!(\_N=Ԙ˽p/䒧{V77Mu^y򳒹r&mic֛sZ J{c \c1 49ظU>2d,Lݣ౤j%d."[ŔI"&r|D##f} !pTs|)@,(z8#Aa+h#(aH]@v #\l}4il(MXS{FeeK^f$j3z"@0 ҈/d?(F'!<mK%0hxtVm۶'˯?> V`1OdMR8۞/Dy \KsMM'?CY"y}BzA'ξQSlqǫpA DD\RXעN Hb=2u#N2(F'%Kr :6Mt,2c̈ ާ2~8s<"c!zVѡZWΛ7/K}]w&C=DBzp$mq/> +# =kj_G:ǐ_f\7)^XcLck1ƘX.8Mya[H S`ۙ|ˆ)/E!r +k{ +%zJR=+i{J}QZ@z$3DȢEjȎuQh ސ<H6D(IΊ"dq ՐߞSj ""D6:X6|IsZJ>}'؆]>@6C_]&2Gzg xlC!k}ߦZ$> a{$zm#C4Q؈ »8["Fz:;:ӎIԗX?R$o(X>2"RHlDu~פ68\*\tv:7q6Pg) :DlGST7H;8?$w6mvL&JsFLCEv{M"`1v]b#Yb-ÚnDH \QSN /ho 5{S$hhТ(oK_>Jv).xESאE^nZk>{ab*Kܒ-G|$Zę·!%W~}5jXy֏:ϟ &Mqi&Wd}Rt> ?9SGII@["u h&VR.|PxߊR%paBnpPt _C?f>'%\kR@RO:QgvG隵Zkq#bkz3MNԳt^]ZF`DQ :H%n5$Ht\jXW SXc18K`c7E =+!)DA$Y馛fbj"]e=PUgH=PkoZ' "H3QTav 7,XkY5uMqJ*M_c5g$l+|_'>'h|粤租~^RyH,?<>ײڐb/IiKp{DŽuõ$a]Z&M/)_cD凄-gNnMeWO9|"sT3Nܖy}!7pBOqlX5HEpgS(,cϾs_g̾m!Α"AhMEՇ& }9_< \BIy/SNjMKmk ѢtM^R.+:8_ɾ`:H˯HN(KI_{K\7CA\(M__J:5b!usY`* x.J!K$pSMx_qȉA+_nV)[vT%/oRA|W^Fg:v־U ZD!s|v HXcLck1ƘX.":nV]LRSkEՔ'9p sr!ɕe9yi_P?HIB}DI tڔthNAPc=THQ.Qcj-FZΊNC}H0R o`o(CLIt԰frJ /ҶBh_D<^doVdHOۡh7~Ut(]$@\E5@z![K:TO#D&٢x 6ԏZ\M|gF'y4Ee_To&:>FuD}Rݸdr9{ LJUDifHi V[meDm3Db\Q0:b$::.kKy6ԡ"IA?S2U@ԺߩFJNz?5 bc:W37󐶪OSOInD=V>tSZR.P$,5tZF׹1d:w'z9:R~e7kmu瞒Գ ߉4$"Wu}良kƆfզ~)R>V]d;߭!(ѵzS]k˙+2hXsM`Yک.BױЦ.r'&% H"u-FؚT4wuHpw`¸SV SXc18g+o y,C{BfJ8Dw=-qٹɜLLR ;cƌ2CHDhFB.V]קQJ\Im]H0l".HRY+wa)D&"JEN֏z w':"*}b%?S(\W~֏:ILV (KEND^X AEj f3yO8iҤm%\ĝ~<0!l7эh :^HflCD!G p (p%jb/_^GJnu 2'Ⱦ3 muMqF"$bN7F>`ҫ$rgb%_4pIiO!psr29yHJ ȗwkq\9D"WE->H#āxuy$ s.ҊbSENRa:yu@T)ۨ_:#4 aC/s) \"!oԃty= Tul[ TnrDcI7 POq;8A[fΣw²;\錠^sZz繆&}$:'}o׺dxbo\*SXc18L"KհQm4$5$<DO=15y(41Vxer,X$IYE$0\95:("!kdz"ѴDd2D8&BN H>"x"tODHk1I.BA{4Dα,F M"g:˔*1qFɛ  {O?bueGH/jdxO|E9"sί% \:NhH,M*Gudf'+zǝTtP JLg!'9!sImDL$pu<*EIKU2r#43麤x1"=[(!pȑ:C#+E \dwOk>K,XO QsD6t=R<1=t܏8ߵ$]kpDtDJx%ޜ_lOEc \c1G \ (pi<#4V \1#DV.2N @8.M%4ޟk [uT9zU\^jOUӹ^D͟H{ceݔb7mu 8 7O~. אkk1e1csҀNE ܍ q,0"ac+{5[G$*B믿.XGJ.b@"rYE pƊP“|i f'T^C(@_D10m㲂D 8AI{))؏_9Zu%ס(r57 &ZߙAr+n)>:Lj Zm'SCi,NE~۾ c̏b'NOb/=H{U4˱-WUYGǫ$fO:Bxk/[<~&LqWIl:_V;W>NTH],ё,CsC(.Vj@_UF 4#XFd&׵k?ߣmDh7 #:zP4nwΕe{LN;\JQFNDFC{/!N #3t\_6OQT:+#SXc18JE>{jΓ@"! F'҂}|(R[g[#"DbF9ѦՕ$;|Vi{E^lӓ㽒e HC4IHLӄi ՚a Ǒk-Fk!* kW G]/-4I5"aK!JFjHh]oȉ\EΗxL Isqpa{By*"y31F|^'0dr^H+"!:%.."6'OOU+86xdrD&#g)q_(b)u Ď&psZ/:8Gs $^#4Ԫ_(;p$⊢'Hutd?7yd!ou^dй49Ν9Z#a"J:NKCxs^JןHWtUQ#!:?q)p}z2Խ3kҙDGd֬YqNgnOQujA[Q{XcLck1Ƙ(Mv,1$Maܰ_ɒ7LRI:UCS[3i|x|^ckժn^ pYl։.jjg!FPI=ĺS O"Ѵ黑QmI*"0Wyw㶒'C$BNJ\dNBh3k;" \oTxÒ@"$~~%TA #ұ:}?)iڴix@rb(p%js/3% $&mDis7s4jrܩDAu. @v4lPyڏ~r9Uڐ_8%^_^) \ud%!::e^~^RvjiMֹ^렮EQDnOם wIh#4A’zmNI}\u.Uģr31_Ec \c1GPLDȞj_OɤII:P$Nհ\ HKǒ0LDA\H i{S(IJnO7$^1")%Fz}38[9!$s$Kp2*=\G---l,?QE@"KJ @K$#(衊L6,ta G \g%xI}^Ҥp& 5*26ځ=Ko&_>AIP'-/,Kb+r^soWZ.Ջtl`bHqf:/(X9pU7/d"JER7"Ck2Y%{UX&5Z6z.y8V\3*2SXc18JUJ.0Tl|p?ӐG1UH/+f:E5ۥae(&o'J ɍ$e45.Oq5 [q0 , dp*DgX~ 5&@}Yږ5 &H+cFR##A)Lh<+JJv2:uLF}Aӹ±X \>.ZAb8 \7T.y \th*TpNrΝcu|ӗR~{f뽃թO\J;徢m;Q|] <8 QczkգE^1Sbk1e1c.CFHc$`0vڝÑG92}h[*BsDH& &'~/! Y\%EJ3CR9 T90yY/mgkLv#&`D"KK"/OH<"ȐYK/TrfBP  &?nE:#^hhS$ Aw#2о+Ju d:녘E]ܔ\mV+ħtx?_'YK4:kk&:SL =*E&S݌2LD>w#⌺F y/7[+BRw%C߾}c#VuFUIv!7n(fxz¹ƶA7[S٪{N༞?~P ]+s-;S Kљ1e"m2H7a: 7 G- RT.OB*K/ňTѤIA}`"bsLEH*TJ(8Cʑ{Q7%Jh p:(By1u.\}jWI `Yw=D)5L~ԾsYוxOI~tH5 \c)[,p1S*p`zl"9Qc}\#ei""=%Q4L$bM2O-'ܲ=p|H "!ݠ;٤h&'zWщ_0DK*|'a|7 ?&Qdg+IG&QwXǭ$:2s쮈Cg'C$ |`2X{S̎l;F:iB YmLd,Y'q{S$.A*}"Qk8/r`z:R**-D!D!J$܊+NmGOMT5I"h TI}M?Z.I2qPEkbGSTTn̤smU/ⱐ#B(OK5#zGζ Wx8b,ƾOKu\ _|Ec \c1,pj+Rq~|!wΒ;KCOUc'ٙ'!VHb%#?/Րi@gO+i|Cxm̘1.qE ܔ1%vYLb}R"9Ò%P[HL!]7i=uܫܳmM@Z2QR!Kюě&\z(!,Wvhf$UuL L}!)q5ue$"fI2ޢȂi5I;qCXG,DLT#n(29I/;v8=$b9RVJ"U@ sn}W%NJA)!uDm\뒼Ӻ鉬<:ܾK(FGFt0\D*?p}䚡rܹsD YRjeK:@T-밢Uq+گ;W=oMm -kk"LQޙr;2d!D~Sdžngp\dۤfΐ?Pa]x?ۮ}G7G}K"(?+E3_~C@P#r9E]DWW-W״`!V.s$p%yOH9c܈|$Ҡ0):Lo\]ZDx~}JLRgGT'l#y|.8^Z'8',v4)vYK\qVo%p½ \F{Dy 녮U?0up=Q8lG1?($pHfԱ5D: \K:%th隿OVj]eRγaÆmc@GRR#w0I~luz*.:D?S8V \c){,p1S%pVM9sIxDBPA>^?Ei*"`>AMT["DD"N>rs2Q~G>KnV!f^4xITl#tӨf$]w[ $mDVئ:{Kуy ᅐtMi_ndDȕ;Kxjچ۴̔Hdn!e)L:k_o)q-']X$Y^a_(j4C4)ɥƊTBm!$H'%bb/R0yewN4&BU;m[|niDG##Iz_ O/pc0#X}izϲeؼiLwQ,Cu;Nt"t3ėcDPpa]tv˿Δu(/KgӤ:oRLV p[yLG}_pͿfݜI4*:!ί_)ŊdR2F(4M"U [m,kv̫hoNǍT 3XaE ś \c){,p1S%pSHFh=,HNkQX)/JRx<}+p0IFPck-b+&A2V߻swmD3RD5EVM"1{֢1mDIljMVDnkEzIa1yj>d;zΤb/KalM߽QǎӾh-ZѲGhhD&A U^뽧.|LJk#r"/l;0 _?w3g~ɗô?#G/'$?.pI[$ַDJñ"OŁ<#HBD~}wKEA~o5@;:&@@F%If@#hYb稶RlgȤ>Q_&l+)!z8w2z..imŹ?[YJtpPLi"GoD$%'e{\ː$ö)YE&[LKdJCxcB Ƒ$I~a9n_f;DNC!ițlL' `">Kl>}zS"fepw <~$mV)@ `>ESאdH6>QGʅxe:>b9<3ˤLѠ'Oc2 9YOeJ\ P:zcq^ZG89r"={#kQڜ̙3gɷ)zk|ti(olPJT/5qL4)Fʳo{".M= /hQ#bk1e1cc.0! ?0hQH>GT}ri? u_D"&9DD20a y|5k#n2( F4#!9B@ qTt90_d< ]Ea?W,p1lahО5cLa,pK3\ 9V:Iؖ  =&5hak \6ФqG(?xVi";kYFR4nW,p1`s[w}=gN.Q c̪n)]sqb(LDĬ%)?qB75 \SXȊw~pƈ /:WY]Ne"?&GӧO>W,p1)\&W\1AEd5Ic̪),pMyck޽{7x \s~;th޼9״yرc+bk1ϴi}%dcVߍ4<-Zd$ԜuOcYu5)o,p@.]%kԨ5k&9CڵkOա(pΝ^!\5Ƙヒ;ɛTW,p1W^ÇGR(vO<1K$nwdw…-X [1Sy5)o,pMIg}'<#[ZjŵkO?4F*;Gp {eV[Q \cY~ Fo6>Iڔ:g#oSi@v3$mwC"o'OU/6Qh1Ƙʋ),pMyckJC dl'tAmFR)e˖\e2&|뭷O?T \c)9LjLlCϞ=%Oݙ8C$.+z&2C-EIzhVΛ7/ϭNWkYhw1S5B*U(p5{Uw)S4)n۶mbu?0̚5kGڵ;3Ϥe֭K$;#zy睰jUVZ8,p1";p7G"i/w}>ΓO>y9S(x+/̘1/!n)qDr!ߺ1S)Jf[̊jժ[?݁!ej̡a]w()}N;׌);Yg:vx'\ņ %JlѴil=ԩSLE Eg$e]fk1XJ.dkE?@{챞~ߺu난-Zd;te˷~; Z5%wʔ)ٳgߦaܸqcYH.fEr"dsB![<߭YwYj}Ij(zY85jT}M7E"E5Ƙb #<%ytIYֈ–7D792>c1! Z;QD2# c1c1cJ,uҤI1Vvs S%kC-.Uz&7C2a1c1c1ƘRyKؒÖmu.!M7r7["q1c1c1Ɣ)mJ(jdejGʌ1c1c1fA$.Q|IM9rc1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1cJʃ>|Ю];*Uxc1c)W2LhڴiĉS1Ƭz5*t%'\r%Ac1c;0zGo;c̪̙3_{p\c1c1fe`v n;b1ƬRL2%t)Rzz[. 2jO}w1c1c1Ƭ>[oEa/Ν;K.$seeL.]c=%/~&M Ǐ3c1c1Ƙ["k_{; |,rJx”)Su^~^zdguQ}'f[hӟ=cg}ݻ!i7Ĕ <>Aygc1c1cLi%-n|[jm޼BE_,\*:wFϞ=o|GQq3rc1c1c)%⋘Iϟ 7[۶mrH% \?"裏_{0{0vh1TZO{.L GO6-L:Rl'4nܸw߅o&L"? Vg.袘H_v^{mWSnd2Xq3j4@2֍-2xqb-r; m*?6x{/EYfl@5܆ \"Ζ-[،Zrc7x APON=X"%W7T-Æ sٳe8d2LBO.lΝ;l=vւr0?v5\\ٯR ){tEl,W`L4-gF >l۷_g[?or?qDiu`>shgnmۺlcl髂RB HTGpe[lґ֙e9 ~<3vqiffjgyƎNhт>5>*z*3D \u 'P6!«4CG'eqnH%_rIg73Vwʰ s /dYf`늩S87? 7~,ӌܘ  ?x|1~v9/_NSO+kd^"K0z̘1j?ToE*clr)orY؊eaicp?̙3L?]_epQaB|[%( mjM)] Ƿ|}0>Qߪd* 9rLSo ~hj;/53Aዏ?$E|vjݺjԯ$> ?pO\FYf ռ /ߨg<䓑o=xFj®_{#RJxK0E2 2 @W0$pd!J)${. Z:֮ ;D-L&ɔm0% )%Z `.2g'OLTX}K "AO` CWAl(N]lؕ'у=>!j}nh[i[ kW˽K&9sj ޣ?oڴ6 $`_*`I'@YAeo"^ɨ˾df~)Owp͎bW^?i'鰊d`Q^YV<ճgO Cjҭa*0O5YeF(y&Ck׮Ėܙ|\٪|BUU+-exx4Tn(*v$t}\"&d2eKq!dOhlْO)dLEׯj.zt<뮻ՀT՚}Bb *Z})U+w @mPh8huU#w>*w"PY _׏QVQ \@I5 O_<m'?Z.ڔZ Т \Sv3kft̊'h eeK0ӱ+jĦ\JR۝U1~5*W\J2F%M(K m< w!QF#QkCƌZe3W2 |dd2tQs"SNf >ڳd.ѣ@_V\nu}ro3wY( +3^xᅀ] n(Pe >7WROORYۦvw\o_Z&q@0 1p\9pMp 5$i~ xɶUٸb.'xb U35j;vVZe721#͚5 4[lk 5Jq[Εb`b4d2LyQK QRe%V+U u>+#{-*p)C6v mW%EkpqE\or&&}< pg3z$e%V7Aߠv*ҖJ=S{m5l祝lʒۑ+(ri{(/.[x`p3Ye%J6k2kffd)91 C-|7Ь/bD>+^qw>lpN$hܹ3.yK.p~o \d2e[ efO&%{ ZjSZ 8N Sڧ.הvXcL^F&1 eڍǻwމ?C>n#^8߇$'ǟ 8> _T옒<><~<-~H Ň͛7XժUwwys=AūsO>{19WțL&ẗA&"P`/ 0yTģ$I7&d7?|P[kR0@hMp d`,$@2~qAxawL;Jl|HD'GhI f Ńmj":צ?`COާw> OXcz ı;|7hy`g%53NR>s ¹T7Fox\0*X_ 79Y>>3b>~)ޯG'ER7AGܜJ'WcM}*.qD6kfgx?6| s8g>E@,+#I'}4UlL\l=;hl'xS%~bfbz)6WeB=]xk7s2p L&ؕ9 `(dL.@8ೕ }g l YXh% =(>8F(dzHߤD$G=&A<3PYд@M@aA a 0K 2W^DRk~ @>~9&DL?8|?rlhW,sQZFݵbYusZMip(K?6\Y 9D/qS'M95O>'B,!.7o8` 4pZcY.mj"9B>wɱ<Ij}]h9uծwo6o__7`OT>֝/ӴlJ˧ԇC_j>"P#\G;Ub@|IR~?I6bO|_9MF-qذat]7ym~+5h*)?=|%XV XqA֭6m܂ұժU+_`M7֮]5>?J(5L&)@/lJcrAyA% r }rl A˧;6Qڥ Cz~6/DbmJ,:%%>#mmETFg5E3"@ߡCc0^ j8s<G/v w~}~*pML߾}ݾ9_}/qV@`̓lqEjʺ Ԡ.K@oYގ~X$ܻpϪIRc?nKCY{~_gTd/YtPv-3b7o7p\5ue-s4e62cQAآz~/Yi2UB|mxOBZ"9}sa|r ~O^}|0bvڹ}#I'_*$]HǪ|wxw&nV˯_nn_lˎ/{օ^$d=]iAնen[߭ MۖrY?>$kZ醟~\}ZnvYm֥`7;W/ ⣈;v/*a( 1Crʯ]?n-B>4Q!_tqMZ}`+ 7ٶIm2'H x$f@ETD_Фf˔/_~?0{9J'23k2L&){\ rLSPۡi B d@N"RF=N#G)j&P/< UxG?-l\EA>j-h4!Z22^ 5.0"ѰP „ Ti{ ``k¦7 € b#8uXlxA˞lPfB󵏿%}}B;hxGg &h[KhmY_.ied;dr:%FNa6þmZ7?cpT~qcp7 ;4l?%WOxM];;p60ժeO~֭}zx<д_B۰K&a•LvȌLg]4{l?GUŹ\^ϑX%SՅd{is@gB%)/o]-fi|/Vڰ05?!@·wBc2YL_Rې _ɟ Ɨ_>>4CZ8ʕvgi:hРPwGI,CY }v{i{kA]sMJT]k' [k|)O1C6o-{0ңMأoX$új7zir:6M4^ş+8%LkG2;!\|jh@b A%#LXLΕ\Č] 19ϩxR9Ǖ4Pؔu/̕+W ʍŲ)bO{Fb0CW/ws_lOT{nB2$סY'w}#/6!!'^k{&~MO5k2L&\k,ݻwO +{4իW8d7b}+eidb e{l[AF*d6 |#l_I6z=A.NYنt5ȴB6M` >o @]Ha }h}]ںcW?Zw*5+ 5@ʣ7z>xUFaE@p(tէ 46kvm4ԸQض^ݰMv{ .w~ S*Id4g?"lګa{Mvhp,s6Ct3}5}~Gcm;ݳj{=zdMص}>|٬z4whx.Şw}sX߰3SGZvz۴o}m|lcӔJh:5smVk n;uoOZXV5J*qCm6Y&X<=٫%Ec38ωGRwS'xR8$)+u+{\'"x?}LoZw|Pb2dM]XE)m򥣀(q_ ^~y'xxqٲeF=P~^z6kd2L&d?Xt*ج\h|/:3AY@04%R j{ , Fj\s߁Z4f)SAzGW~jgSO=@2:0M [˒>Qh[Kckȶ e`q<|`;>L+zuY-WAmjSOA||)cM`| rrpx\Yˣ'KZ35q${N`?[/p-P-e |yLJzp^^,oȠ6 ɪ%$u3'FAMm0ytfuqt)@v@5f.Y_͙}L\MGIрm|/ ߰r{WssH-x%<`7 &I_0Pۤ~?=Cޥϗs8@^TqF7oJW7f8qw)AkW;/Y4N%Z{ZPLFվ:k{?kb> &JIiA -Z)^x 6m[bO> 5L&ɔU΂|(9;`įWZE>4X~gz*'+ ,Z Ȝ8 6/0>wЁ@`ǯl01p'gb.`d-Ԟ a36\AW|]>> L.l}`ei@hV; 6eee]FGG@ )c}m3:Z($[]cfǣ~M^cR.t٤Y^!.ٰNqeb~Yڕ[,%Lzl=3,hJ삏ƺlcp(@هVݽ1]f\p‡t'92+9)8kd'6䆎_@cy|_>DtGi<%U~EG+,Y9yȉß >l(}/~xZmߗr 3N-|:vw%]<91uY:r ]q%{!nFܭ;gȲXzWno{ I]]f9\"v@^xlZUy?o~/DfG ◒4 ssCG`3ùJl'`zO (~7JQ584W 7~b-qT?w7S|i}5)MF7R^1OժUrygm^hmo;2kd2L&S); ԠXԱ]"xmuX>KR |Jd]l,fY3V_7I˨mK۩D/g~$?~4#iYn'{A̢Ym#9_sr=#.eS6LۍbʭR`9.e_xB S6_㷃<gܘLJO+p88,=x`aUV *e f͚1n@cVJKv.* pM&d2eaˠ^A w 50h L:h2`u>&hF.5& *x.5щ҂5jQ$b9]MWM̎ d&SN`28Oo1Ӻzl ا}to z$p@7@0gjDoOkBjROjo7 1C1czT\?WL;x`b=pYeK9`;s uTor u9VX<38$k79s98K̀Od2},Dw3\[DGuqI_5\N2ɾ}wtCTV 6{sKr^B2I_ÈňN<|s,~~Rn!Fvě= B,ԩS{  7T:!PL2|~nm2r|͔[[:B5k2L&܃d:ʣ_щ>0K^ 2~XYVlA{\ fx, `DO*%[ @%`R#5;wj*X. ѣ0E_d'}`H&@PIh& te4Y}~٥K@@?qK!Ϥvkңw,K_m1(!PO W\q>EAɘO# U{l^z=hyT0,m{ 8?>9Cv?}ExǚJp1ؕOYkoۺu7tN{Oz%!#)\ p\9 #zU|Vlpe֏SdKȷO=ȟ< 9n3ds|>)#f  .^׍?4>?aZc ~ZMh-.9Mp ^R7>|08l57YjrFH8YC3XN3.p?ppLY}bG3[\j&K'n u_5.k?[o5P 7J*fwS(v5o_ 5L&tnt`_d?JpA0e8GY7 *2P"XW{j/5jp f5D^P+h_C \$оD@_W < Pɺ:{`јrz'q9 q W?yYO@%F!:&{d?{v&XWcIvr.nW {, D}a>uqy͗ c0;U&6[eth`c֭vվm8:Q7 Θv@ u];)տ5, wYnntϣ=AK\||Capi* ^/ecS.'.Di;ՇMS2&ҍ \5 O(ױ|Ot '|ձp$f&Rf(x'@٫ mVL`氾v6%Uwgc~葪ܔcbpw¦d7@] {TypI?qW׮]9O-<%5Yf\0ňec)WT\u ߷Ym}u.pdc=<^wu0d{_׼ |wQTFd2LpI`M@ VqPW@N*Ԉ}LpD>'{s H Dyt (B4{LTF6m>{ŶA@Q_?-"f?t\^Ӏg?ڽ_ju7C%!`p5g-]=dNo}  OJe+`w P0{f8kf,x>%x.r [}xyf.kh2 ,N.+pPWu^yYDг rcK @6\#5nNiHyU㺚}Gy$E'x=@mJ_ߛpKҰ샮]t|p]p|7pȊm&*\774}tC`ڦ}𳅓'don pY]mf~Yc6m&3\lAnO l۱+p$ nV|ԣY,ES,FLx2+;)@j]{'0׀~R(\[ׁe/i,[9&wEݺuՅ< 78 83Dpڀl^J3ESq5.Q |gBC| (;8(# OA:m^Kd=kQ_BAa rǚ+M. (E8eEmcc=:Xۀ&Ln.Hbp%={ee[u3WOP6OoV)+#nga{ U76١얁K&j\#:Q~kJh, 2R2n >ۖW6S_aZot:MDm7q%2E;hΘ[w^WeJnFun~S[vTu.ܰuIJ<mO(}  MYp9>5ɼ fwӺukr$keJPU+W܇ :묈&0 瞛U"!'_ߌT\d2 "P^=: 6lؐ 6?Xf&a@nFC +t8(d|)62hݻkf'۱Q#JLB-Áڇ6_>Ax ܶpc3l)1oW&~r{L)Z,CZlOnGeNʜvV.{G]JYi3gنF`\mG'2{#dJXehCn_Zի;H K\VVңMحW}vz&-۲-? v΄ kw4yso=tMմ/*Q1~Scx΢ə| nsZ}/?8H0-[:Ќ9UBA>I ŒXAbJ>*#ۈpLuPpǥjԿ]6!VllO@cJ̩#ΏӢO, .GOWT"%#&AN಼b68@ }G?~Ǔވnft8Et8SN.@׃,Y2|衇.-q>d"##\d2 f%p$55PLFbcOZAعdժUl5@ b%*7I\,Xv 0<$Z&`T%:NB# <`?7z<\#jc')`~4mڔGu<T'p Hb3p9;aߵߔE}!>TXhe&:|L ,Mݚ5u)(:w/WahIaٌ}gwh ̍7w#6tm~%ۼKaW_ [b-^vi}n#K' 8'=Lf7B&|v`hYmQ&й:'8/:_RR&3.o~2/ɧ~}ک,;Y/vR>z/80Nvh?On2ڵ=yYLb&=iXʄg2G,lؚr+@x=*0T)efT\v+6^  &K6㲖Ӛr|2p=> c܈"n8Ct%Pn6_y_r42[sKVDrG{ LL HB.\j~N-̋>RL]%0W3ܸZjx(5k2L&)+\ PG0nʓ'  ./4XثAH,>vu@lWUβ%(O W V퓡uI4^J jUp6A6P`O? e1I pfP]e c5q܀{t4ܥ'P: -- eXGz3e3 G .;,\3}jjꔿx}!>n岍S3JJP/x ^o97ZgY2Ǹ'uJpW p/y@\|xYxpoL@j#9t͘cH [(;G2}0O?pA& n8 ñpydL7VZ6NS)5\lH`-NZ tٽDZ}ٯCնe)V?amHGC' KXn)i_pǎcHM\Đ<|`..PW.]xGq͵.]sG/Rpzt ,Ko~' rO,Ɍ|YZcRvbbHq3c%X_?<ՠ)Slڵk2vy\d2LY &lΙ3 E00z f@#6Zrz|z2Y . ^cs~4 K0OWmX ՗?#敶 )@&=.׷iA1dr,<] k߮%p;v %e@9 p1'СW,zjcm*@[`]:`9N1Q[9ekp\@3QvR 0<¾.WٛF-I;w7cq\@9 MY!?%q7~"/+_^ %?2<]W:1eѱ0ڏ?s8\ @Ԍؠm$^g?wUB_ŵintEaǮ-]!0ڸmc'@eBf*ayLBkeR쟐m_eĩ#ݫ퉝,yc}lK>oLfj4_8.q"?_zYQlnv|tɏn9u'bb-m?ר3mǍyn,d6O>c|Zj~,^{hvmM7\tE5~`߁њPH@5dlz;~2Ŵ4^ (`<5rluϞy{>G4+0eN+W.@ zjGgi`q 5it(G8}rW92c${0K-1:(?ٛiCLҀmM cr3 ׃)'pvxᦹ9 ; G3Gp5f)e?S pԶe_{R@\V5ojI%֨ tCfMw\m1[B!&'3-7Fx _KՈ'H&>eϏLS0Z7xPޟo<%vݥ '1 ڮ,?tڥ pf-׃VZ%~ȁLoPy+jA\@Fvտۚ،TĮn9\77gO~|F-yýI@)\3s?J=Z4-|oڞa߶mޒdg p4eV4umLdwTKBd; x$o9>څ;uti2pul;vLl p%cMN"(=GX!6m?jy3;[>, t->*yiR8 j[{6xW6)|)ljb-_z#\wѡ\ &M^F- ͺh~[(7 NpYok9&IK z3pXyسo{G_Uuu}T!t>|ƽ6jˮȱo*]{up6C9WqK$T."sG]G,wӿpYjxObHF I<wy EGdA$f\DիL\Ǵ>|17Sf͚-Z $:7j(Q" 5kd2L&S&\CD2-u4~ x7W$>Q&T>$8e[d ݬgz ('=ՎYvF@kof; ~Vrfv'ˋخ2Y[@2Ѩ^pC6>95Q\9Rij1X=}-ڤmU %k)cvg ] CrvoDBV4Y{nֶް,"EOLǭz4pɐ] \2gK5YמX k&N ! e\zߣe\;ʈ{啰icڱe+[_B[PC-m6/Y -n :i 4M.: 6+93G /zt5p@<қ.9dˇ͑?܄(\:Ԣ~d>3EOxGcȯz#M}|Yj )`1P%<7þmƶ?שGL\AƹK>qpiml=m3we\Z$`Hشk p߲e wMjPn֪ `MtFv졖2`CܵDqL⎛4\#[Y_`F^|E@EojPpGPp= jds?yZzTPm޽:ojs>*Zf}M1 <8giWR߉7 '(AX\mߥL_eZ&p!p7`/2O[3?YlU@+mΉۦ,r<\>y`,b}J9Y33|HsՓq9߽x6usBeݣs2Y3Ҳys}v%mB> _@a?+M Orקܮ>V>nG3 ȦRk [ Os93MnAe lc>M<&V3pBcKuV :' `_Op?!17*ny,C;T|xݿj֬ĿRcuPn ՗XpFd⪽n|F^v4ij#ݧny!Bmܲe6Q#$Eld2LL[(?rk  ~b@!{)c;/FS3  %`f  }]^% t X&9O+>ljٟ# 8&'W{ep6|>6ۥ16'?d|p,}wcAu ~RIil{,륥/L_p8umP59{@@syO^ŴpA;7[|?T~fȍԄ/?!I!'zǝX8#|DGlOµ )v!x= A.Ӷy`I26;u$ӷ~$j/;\-> ?F̂/'Rx\F6羟0kj? H{"!~ %/ђRxH=0f)x?uy}yShQ?DO^k\||5kd2L&Sf\2(1L:|.?xF4XmS~ = Gn]@Ϋڷ]ڦ->'mBb3ǀllKl9f[昰4mb@k%2c aP1 {Ͷp}V0oiq뤖}ّ νH$Y0#7r!n.#!?8_W|K3?`ss< nwMLr`5/}@ ƾ?~`g .}Ԍ <Ǐ;ض#p1柨X#-¯-b7y?+3%~1)xJȶ{x?ol?9 N&&׳=]IKI&|;>\٧I̙3ZjDdeʔq ϔkd2L#p  3&f a7H@Ɣ P?:7A=AJRkedn (Y>H?9FP@؋2f}>l˃? J8Rۻ{ J;~AxX€UI1ݤ9 rA8(`d4F\c"yo%\MI' +ۈ=_9 V ^>pk\'] }$DZEl  Zyd_ xsx?yc_"*=ǜ+kb9b&f}rb9b;|q>߸Olb.'4dq"駟w 'ɑ#uqm,Lvfd2L#pMI&0?LXc2Xh 2G tl\Sv \5k2L&n_, iҋE#YzL,c~mk׮k\SVO6&ۗ;w: Uj֭[qr޽;\d2LpxA91bx̎6\ZM533k2kfftEٰ:$Nww\rMbv7e˖m9eϘ\d2Lp'KE 4OD3To2BIԠ5f 5533k:"6}PBk>ۮ]`2u|/_:ffe}v<aF ͛ݛ553֬Iؿm?K8wfey]beϽT3ڻmر[ 3L3~s<}ar[MK.ikԨQ?pDڵkhXRJ 9~GJ:xpOz*osc)&d2zGP^zC|)Cez۪{UeUZuݷU[K#`{V{Z~fflʺŶ[, &l0aB֭[QI]KwͿ#{wMV)&d2,Xf4i d2L&ɔf b5k :v5*(X1~7^M̚5+Ckd2L&S[.:Ԩ"_܅,m߾}?^53dwoI#wޭߠߠY{4Kqd^3g Dׯ{h }VXԪU+x L&d:|E?X~}]6 Ǝkf6f#ߟّ?> ՎYj&L:5;wn|`q9;_K. vR%&d2L&d2L&ɔEed2L&d2L&d2 L&d2L&d2L&S\d2L&d2L&dʢ2k2L&d2L&d2LYTpM&d2L&d2L&)d2L&d2L&d2eQ5L&d2L&d2L,*&d2L&d2L&ɔEed2L&d2L&d2 L&d2L&d2L&S\d2L&d2L&dʢ2k2L&d2L&d2LYTpM&d2L&d2L&)d2L&d2L&d2eQ5L&d2L&d2L,*&d2L&d2L&ɔEed2L&d2L&d2 L&d2L&d2L&S\d2ςUV&L{`ƌƍ+V7o>jsٳ> 6lX0~{Դiॗ^ 6l7G y-Z&\d2Ҡ_~9Ѕ.hݺu0dȐ`1ciӦzsqвeˠQFABBB0x`wiɒ%e˖'N 4(8p`зo_+u˶w筷 D(Q,M'rG+f### ,X rW齫2Պ/Eh)VP!yW0;vMrʑ޽{۶} s1dd2LTd>#bl=߿PtCYv>]vA>}͛={ts,ۑ#G}"F?p._e[/ۯ[n3j . O䓮wRgp* yz }஻6`n j׮L4)7o^о}f͚=c9-Nڧ۳g+ϕKMUg>{ycfygo ] l PnWY'W^Cmj\jTbժUuŽB7B! ŋOWJ{RѢE.[#w ;Vӫg+`vʕ~̢eK/+m|Izk.sMԯ_?1rH=V'mڵ:E@qB0ٟõ k֬ISxFN7tS_4yתvrE/@,\vB;裝6qTd9J >bk(N:X1KK'Ev{3t qSurSC qw]sn/  m^qu*g_}f۾_¯nqn:owU> 9v=B7B! R&;$L`Vޅ TKZW== |>Ԓ`men Ğ.xꩧNkʟn6mA'øQ`JSO=@n˗FeKB~^uҡ:#}rNԽM䢡 t1f }P0}'xZN,Yr G91d*N!QuYWs8TinӼ99B Kˏ?~=37w_=M0;[慘/QfǼ ne˿1gZe7T7pC!B!eLE32.`iOX~R:ur[eʔy e>ߑIQI.qNn~/ܳ}LIMDu[~qϰL.TH/ ^{ ZqvC8tȽf5l^#nNPx&)mu:,w8J4]ϻl.F"p`5F \{.K0rR=xC̷8`̡kp#]P qƱZ ۥr~*+!~eߺ*gn!B!%\#)8@hѢJ!䂠f阯[]lɕ/Z\H]%J˽Q;;)gWGsQJA[N*i;_ #Me6J#UTa#kz|N_\!;8 7?'$.BaW; !pC!B=T-It)W[tIrׯ?CNTK^o.,[BY$h]`)K)6Ab6(,}WP/V^z"}suj#br}]#@+{ׯ믿π6m: (֮] ">ra',_p᡺OB>n!nb!B!B75egN_gyfBp)T--[\ Զl,\j #]I W ?Ji{T@Q :y6<.[]`wC ;k8cZ+n>>+69M{Iqw&e*U*p\Q܍7״iߡݰaCBU~|.קO;_}UI I&Bb!bn!B!Pre7;x^*bF9XxOjU', 5tQR:u+[lYK. jn-8w}Qٮr^kw۸6i i]C:E+ENyIt%1h {.7nܸ;Ľދ_o wԨQn!nb!B!B{6b&䮠3 vrmT>eq}7/pt\?6!%7 U ,~su_~<e$M PO_ JmXV /8\wyoFgtuwzX^?wJ*T\mLV -߼HtAR6}{},`p+塛/W *O m6mZ!n!B!nB!ž ͚5naٙRv&f炩ڷo%DZغu RvL[R]^VеWjC+f{uP'I[{YZo)e)me^x!!w ˽* 3K,9\H"=׶@k{BdϞ=Q#;[ Az%㎄.e]s8DR ?# mh:uj!n!B!niȑ#sIHW p3!B! (=z~~C1ڄ6K}޽Pf̈́@gBw)nR9Nn {_|غu^o][a\ Ԯ/Ĺ#.zO)h ?ooݻk O@tBN|N⋨}GM{5pnP"'Fnbn!Bp.PQSv[@js #|j,`5:t萨UOl ʈ}nxϸwvխ]m6U%|JU`e'M >ܯ,+^E˻G噱G@0fZ`}Ԯ]ۗK5Bu{$?|&$cu X9P,)@5ٰaC:l-wm=VZMPhԹz+ߺ ΗY.Q\ZM &lW%wӧOY$M__qHmd3x :iw|&GdHFK#nbn!B +WL 2$ Ԧ];e' pu^$TR'+fF dO颕ϓ{YЃZ ڕk'61*h.,Y⯹m6A pe˖%VXXx?/@}w`،z V]tQR*$)#8v{ieoTRa"Ӓz~w{q,D;ww**P7vgY !лwoniYA6\r A·VUGQ^p#<7t j\fN8Kcɦfr̗:jqPV%ϟ3ia_4^zO!/ <OcYpC7C 7pC 1`` ʑƟWJx-h8 Qw8 $ĬY Oa̘Z3fs u! ZW9gϞը٩PIcj $*_]o?œ F8qw0a/z8so=|7 \'$mlntҥ,y πkpkyїEI΂ ҁNaÆȻ|Caw?$KܶB@N{. u3P4NX - Y(4pY鐘,`& c5TɫWY6:#>,y˪e&N. >. `y&Og\te7z8?OYCA6o*_yNf9YEBDc^.ZQ߀ED!I:6lؐek׮~̙3}yYS^gܟ3@޹?[n!AM3fo}:І'~r5jXj`3wn#q=^ט䜂5^J;X}$㘟~>ii_.(Y0L!OD] HO{O~ QI h2%pbOwwv0@ Ldߦ%0o>wi4Q}y*V9眎udmٯgmNj5ù (D gesWŎ::j{^)>xЋzg}(Fex_+'JB(聕>y'$>V{W!@²TD5~Ps"N\70H*2cpMe0Hi^@:cf9N~)1d"~Ľ|8 6[IdKuYLHeEbL+b9 4?Hʌr8ʓeOIWNe@\:O@[ ,J9q?q]M{!E(w G`2 7?/l 7?."{œ8 h-eE 187=}<3_a #+b "08)Q3LMA+ < ~r+o0Q$]9$ sgmMg3 !SJl֗=CN{x+Ok,u "1`r~j4S@Y;V8cP~9&E~Ay|jks6DeXs͐Yc|Ou;RTw1*`}wb1oW֢V yո\=.Xpa~ڙpy\B&08-V.1L>i 9FJ§9 gGEU/j24|7 1Jj`j!l00(aP4d@ps|b$XImn)2 # p41iK,tpHjZ%В#3Vt0r<j%HH}ҁ[` Kr3tO1";) bs>F e-E, ٩SbƍT.x\)τg&!Sn;`ۜU\8}??.'9kE7{%^{tpVt6N\> pf?'/,/h5,?~4x:E甎"G:~a;.ios.nlo*yd6(Sˉ'Z&]i1hQ c>cPiԀΧCH pDl/,҇ 蟀( 8ă f^r b|7mܜk\WQryì(ig~Ogʭ;WV_}ffrhHwn(pCv~--I-O`33N>@\Rj&cmP}Rw\ &9P@T1X(xpMVo *4 Bupo&~y&k8'@:I hs#$Ty1&6A5 aǘݫ}n&ƪE>{VqmQYީkQGVvNٓGߤuN:;imEi+uqri(#wg8{"E83x@y}z':e=_R> γ=Qlw93% 9&I +7z6 26;v!uJ0n-($XE=BYxADŦ5'\ۄ[Tlٲŧ֞N^Hx'Rha^~=Rv2|&K`%xط؅KK.ī-;Ᾰݦ#`g==jJ}ʚ>uCC~iPvyp769ʜ}(CkWO7C0FNlyצ^hB59epqJ]a;wO!;5U*4U5*RZqMVrw8=ʠe`ԸBBDT>_йU#Z/j5k,RPV@/t\Ƅu(//tQZ,=7j) /=Ɛ{qbDzÈR#?]7j|Ԁ5VƕC)A4t2tN4*/cV j M/$4|ҀjƸ)xSQ4^ꤟ2xk &Rn zGڀ\fM\MC=D\`aeݿ=[3Ē]ݪONzPJ,_wMpι ă'P^*Ƌo3_jWu'u޸CbKCJTaQ5IP=:ɦdalC$r 5GR EpFs}Q~P4'ѽBP G~<}j7IGF5+ җ_+ͿXyLunFǪL}.vz*m(qD/ `,/W$LmUK0Q`3wHFU>]^}/Ɲ@@؀O@1hW&kC6'y@#@m-[x<{`)`gg#192ȗÙl^1YN; oX~8)Xrg9!5Qz7LP^%X$s?; > D >I{e H/\{-I$y抲fQ#M4zJp20XML`RlH2Or$SNI+VO^Gya<82»$im+yoU_*[Iʞ":.%N)Ss()suvƔ{-b*IE=&ڛhKvcb3B|ZÝhy?SBf W*jxң*Swjl 4r5'5!WCRsa8u>ruN/K`fFNV'# 9k|MˀdN-"ZU5> I/iYж6 ݬkf2ҀX݇so6s) UC3a|%i@h"賶-܏ M!܅į0s+.߯0xVWۮ[oX[˹Vjq{zEJ鼷8׮xy[;m?^ޥQ<"yZeа>]U)֭~p N~VLa>/~>?3rrc[&-PwBc=`7tjS7zv+wDCsLGf)sR .U{}^pe>|ʫw|/h>yIFnщm2r6;i@GK3},L0Do )*N9Io#lꂱ[}7|LҀGY)M'b$A e\ RgMJ߻"ҀIz * b8}wUO]*ޫ,Wͽ]{[Q{|5^T싟lm+a}_b&@.磶ݛ2ky89c&T߮Pӽnfs} 1o6n*-ݓ|>4JkMO>^.]ejNWr+?i{#Vi]ˮ2}N^.TNVhe*ᕐ\QNp1|@zLOht"}'̘&8- xae--SiBe6LPsp{qӾ`xPa& %ip Z8~'3*po[b.d`'Lf21JX@Ǧ餃w|Dپ9ـBUOyd-qgPzڇP)U pyXyD]Ƣ fǤ;cZ9[݃V([{=$l*58kI3&x^@P'b#a1dP  ˀb!eF7r7`xgllpyFDWo@Zԟ0 w`-ug1\wHY1\G;e@ ؉tRWQP~jK|gr1Vvv%o5%I'8D\xX]d.{sڤO}`HsW٘ZLp O)[ʙwvz{ܭ)0G X:Tg|= 1 y 4fxD!>ྀR{_IrQB(.$Vuy$MmT{&,oy3A@ȨTF|_ LT^&\)sԈ ;]p.@ mIjQݻmZ zsyUޤ[7s*-ne<,ӳ1M/ nU=6K]pQ OCzWy,3*OE%5X ZyVd p(^6Wu;.Ay+x[%s}N8ʍc~ o}swd'3jV˝oAK,#̡<2g( 6 i1r\ao1tQq}>D*z b4(;U~WؠW0Q`@x^ g BwB X1QqTMcש=Gc30cG@iKs&X\kթ5k[-gHj.8ʢnKnȄ^:`,ע@Wz#(ߩX˫^FFbI> |oޱ_0UJ)6^}~|PrDe `RO+5trFP4DFlakܜծM!Q#*ۏZvse+E>;>h|p&+T`kVw˭w~2b +%vW z5>[a1J`VSL),Ѓ7'8@/Pm>L}vq|ҷ,Y8:F lI1A%Sh0IU՗̵ R^ 0YL N˽`nuOpt0e/kgM Ƹa7xQPOQy{~x2n)ax5WϪ7aD g񒩦0GzR)xP4]+es9SUc)S\4yweWA.R? 1X}4aO:"m/=Fm{?π {XVE^zϣJ6(8 0^&AU?=rf`%eRGVٽc\u"'ផ;Hu.`T~91JR"loG1YLyi?P^}Eʭ\?d"5ٔ䋠4ݡs{h"Js>o*Àc]I{½OD^jzi_LxFuzNtW]$^s6AN=Nt=o4m&kQ=dzg%XЋE}Q馺QwI?YG( .W3;s&׹ir ϞrB\ \u8p}Xά p4Nt6rCp^M@H@fܞ l6CIjDb P`F 1SFq˵ԉBÇ`;ipRljYt>4P5~Ӓs$̠1Kd_ g .n|"iKآLR2u/'0z4^|;Zez)>d\@`*i0d1p2:.ֵP>K`,?K('z :wr1?.sJOOKߦ]6nܰcq f=maeݲhA>pi&~[5kvHܸ"we*?*{ѽc;p{2;(3OpQ 7w۽W\~:wڙ]r׺;F_U.&/^);UbwfGJSwzћչYȻ|)>ɝ}xEΐߤ-1r'CHQo5$sP6^&R1y)O:'Ks+cR |&#y5\u{Ky2Gw7DǏp,S[dAT)/d !rQ0D!RV ݡNje2O@gKdE Rʚ_(+'&#;ߟ ءmޱՖ]LUqn?*Tk衮WF7mן_:N_]>~_o쬯\m; `.`M! y9%-SM:x.3kqws-9;Hj*_@_MT{蔬nv^sW_p'])/Tn9 $aA>V/\ XqnwZ-Ils&v?"b^$;}{J-/>>{%S}kj_/=@X8qT.vtO29,+T]et[i. &+w{W9 ԤCut豩t,g vKΗy()y_[b@]\{| <_s#<ڌIwg"bFӽտ6w5JXT(DMxYٵQ8:ȻTNlWlX%@i(7& /SާZZ)Tqo9Fsڻ[eGgx֤C[13 ƚ d@媺@*+lHzV6\թL̤>3gg ʴP?ui/;s~ڋ ?{Lpo<+eVX0q$>Ca\KuЀDU$4j{5@OHi$wt7 1@42HAA";\)wƵFiϫwlpV f\`-;@JW (qMT:(s,:5+~ 2~a@ch;kT҆V^@ZxgiܕtsV$|<᷈kn!]:͸d3-!8 )PBpطwPM΀=5{'al*6w[ pߗ&R*[1~ж-jTͭp)tWXU7N'3thdt}cw"o):_tsw_/ý 7p\N`QX :g||e7xQr!Sg{.2"e& ߼p1Rv)eAn&q|Vaa +2,}S\6FmI1`g|&R#lAg i2fP2@)Iʒ$QU.'؀Uvl@g@w+I>fJ{@Iݴz-QOSfQ+@ `c\ԺcT=>}[J}{WpqOPq2@U*}Q ͪlp-uݹ4. ri.C\#H&?~>=sWL J@PO~AU{]$+9_,AAAk +>p-D'kΘE(W:[UNbŝvԞJS[s5y:dȩIPM] ȻU;*2rKǞTw#k)Ao|sDĘT}'JCԄ! ՓD9׍spa]ei6U;ҊM̘׆FΡ|)+{o1Oُ4F KyZ-uNG=ޓG2aR...t"ITbT`&WQY2e򌽽kùF"mY=6R=L[Q=.C~V6KW&(5kf)>5_v FLfrd8MyvQ]Qj-8pdP׺gkKٙlAT 濊"Ha?jlh%0觴bkX*SoSƟBp7kֹ=\&H*[ɺRz[*O >#rO- ޼ !_rIVuiuD-Ū Z]%ʹGko1<+ {:B@<;3pUE hLd5s|Nd\SB X$&[/{.et Cu(s ݻ>]I.<+@ZOK0| RLg{pfn;! JUgWٶS9ÌvCuߝU.F&-}@mRČE S]852l~K:KzU忆M-ϲm坉f HnϸV Կ3خoKu:彰 O:۞먽f+gI {aAWmukM-7Y;hB>˙d6N*Qq7Y$Y4X}wSOI; ,E hb,Y6‹ek>,,.]qOu2KLa+?Q^ W@+{$1&_SR:D:->y JyWOuid8ǣ4vR4{ $l\yRτ%>*Ih群B%\_YO;0e!w~\ۨi~nk뜸قCz~#]:r0 ۿM *+ F2hܡl\/y'/p9Dz6㔶:/߫Y nf`ֻ̐'_'#\O҃ wm~1 5SXG?jז| ԭzHIͻo _5J/џ'V- zŤƖep Aߡ'O1uUAk sƧ?n p?d= p Br*i*osϟ`pb938D;maY$HY:֧U0i dle4ILܪq<sTUeNi\4d2T`r0)HVɉ4Nq R{d1A5 \Kcu7@e:X vef[e/~X&; ?,LcEϓgGM5|^SWUQOز[k";="uF%,೎G)?,װa*.7e2FyVЩئcN~brLY? L]69>Oj`q=#$u"7|El Ww?DniԞl8Q{WԀhiK(cFgI!1 ,aWKOzy(fBUq:vf# Ԝ^zE/jVu MUJL|07JZ^H `:SQO!tdp.)eӂHT=)В+3hĘ |O'gZiE9p ( y=:w(IXۓ9kȧp<>sMwk&>pH8,.`y>oAے1w}[)[U' \`h׷W'|\ Y-Zr)We4lzswi!SuEʭ׈:ZB_;\+Y $0E^1 ɮ[-6Lag0mA;.^dObd J)bj<e:D rh13\QnArWf~&cǾ#3@xm_[ߌE} mL!16일pww%3w kEK !v4b tu0R{ĵ_ꎋ9$*N|@ZM9x&u-k>LVdI})o8 #ŤS_W ! R.}I}Z0@~Qs\Vͨ_7x8ܠ**`m>O)eBUZ TےH-$) ACAm#= p PW0l쉄&cj눵t|lpugW.HPe2Ȁyִf^IzV-H3P_4Ϝgh-ma~XQ'Sm k/074XzL RN73[Hh\ ʯc=@p5oT[̙JvlSHx(Fg '0\#w z&uX [/ˎ\S975߬k :$ :vMq7:pGqm8=×G /XCaaFbIT^.+ <<}8bT4c)IfTnr`,˵;\_eӊ|fwݓ]ݏ%묙:Zgo PV)]}[o}]+(?*aZ:761~ݛ4A\71; #OC;8Su)@\@tn2\c}NP7IӔe|Nӷ{rV|SGsxt5Tλ{\?R[RIIɰl`QY\6G#\($J,Y( =YUvQt+ :jt kv7O p4arg{1s<ⲙٜ\{Z l ~.3q[ϠõJb?_p^4payon0ͲXx}kUAeKLΪ DZ[.cOVY*'KMaWyuO qSKJG"t(:DW w sH/tPbJ(V|1nv.6L u\fBϻ&$ո_[U.SspU057q:&z_?w#eA_eyP{(֪Q,\Ho,Ï:^*к6&DE,[b3Z *^g7[eZ-ꚉq+Mi0E({~AtMUN>R6vFیMe 6^̧z ڎ(uV|{;ܠF_c9{mԮL&f]n-X%Wewm~G2‹L0p bL23[vD۽+9GRc4`];l(lPSDqIS1J)+p#2wl}'Wjt7 &m{{;ϗom5wkШM/Um\Slޟ_kk4fiuBp qKFEi˧e?Xi,œ"k 5*аlIHy7xtGBboVe3 (7I@E .®oI!បNi--X)5* v](i.}hM 8XMޏ&`/RnԳMgQb >ZROԪ~3^c?yu(]@-c1[`; F~GI9>TD=C'U%ԭt{(+Xɽ|7صQz~m>S޲g鸣p.c9|FmW>[K9eKVU6S] (%E!. U6q88L/ayOِK+9_ skQfB,pT )5pM'W 5{SJS(~2:hJW˘ F@X\(ծAyJ|^9m.z@ uϝ pMJ2mV5N;@>pul}gmp"߸ A;P@߯oRzVQY ew[=j?eG Mݒ\Vr`1.anq~}>m "*X1Dlz<7dJ\ס_mǰZyeӱiSwr39bǮIfWzgF֢%T2Px,`9\"@O ?p2 cxIVTMWOǏO (X6GO^d8xs5S28OS\FԬޅFγ 8MSngMs XkwO.ޑw+uC c3hf p9w?ƫl>e+rb4pC!SL6p1h ĕ %0˦JN68/ X'2Fq͵lVtTȏx t̀²l8`$(POR<1cpmY>cuN0&QɢN(/jF٘q%poRRR|ͣƲ/cl$*\ʲuNaK ;_i|\P`Evfl*{΃D8 .Jes^IU9 c3m6Š3{D6=Uo ]UOcˁv .B*#8N+zaΕ Cy/z_QwZ,yGBceR~Ɍ!G=C5KG)[U4[6jnbYg x8ѡr-`x5{&fe+>;7%;RByŔ^h@)}KDdY(E:ve&4ZC`3`3 ʨ4٩|Fy\i:x()^a74x|LZ7*iS/4 =tu64lFVr_rs] p+yUCM{n'}ܸ=>'ǐ n& =8 wWZP2f==R"$]>LJsyEq: ͭ]Jy(6W^ H[rrZL!b 75P#E|G{HǠ7dg2pnq5cAfS Csݏ]m')O̠zeN^h hok~"f2v{k >Hm51nwk AQbO&f[0vJ tOm61{UxZ;/+롯 k-dkh3>1jV vg.iY mfmyWߢ6/ !v9 @ ;ξ^t-2[$x+=B-6&ְ,x Eq .?R'Fph*;5&{~Hk`xQe+ hFTJ˦MzoG՘UƔzI$Qf4{`gN'^}e~;~ Hl 6\!06Lg+GyPxx0TJՕQg8` x~\@p5/,- '2zۈy&Vƭ jo~OcXʆDt)367t*&U1<S'6>1WB)X Y,vpNRYlpJ=MNy!oKMaw\k#`S/[:NY}ѡ1@a2 5\-yKtk He22 *S*W;0$c$`$GPhEmG ]p̔e'Ж[ҁ2Q>JE%wJKU/~x,й=0DGqegIYhH]UT+ƏMwMPP.yƠ֒/^ꋗXʳ*e-HС9:"ly?0/$w(]dBv|C*ӑٵwntbgpǞC㹶y쾇ne@p{l^VP.8וF*cc~EB cg`Zqe\2bpG1m٦lD2O V10hw'e ]9G_F(v_`A'.7QN20e `uCN6.vi\(IQmڮo@Ivk4I>T1~soQ35{}5۷W@;p=tm~⼯!-V!ud I5x+}ˈ(&:6%n's]UQ+d"4eTHQ lB- Hoz-'ry?wXI .%c'%%e`HDG(Sigi~\ #& P2Z@x`\M"$#hOݰ ).d\Ryu\g݋GE\lMRעo'ݤ U9v渨k\| eNk8=50nz֜ 㓴"JWqHۯ;QT{]mv) iW\lbeu+ljRu_Uޭl>T*_֍qg'BIUb<'@M,0ŇWdF ͳ!_5MPdC{+w@ _%-:W0 y1> =:s3; \罢lKP'_ (S? ƫ}FM9jY_&!P .Џn(|p_T * 01(pTԦ\s]l2W\({iXd0 2(eH@%o]pyi YJ%t*@V(P|ɏePEڬ.euhͬHurټIBM~yttJpkOuͪUSÏ2-( z5oժVM7K'7S^spQ͍?V|Ѝãg^jG8:CyK g:`W\z[*::wwh@ʫh *xs>x䚩x}G˵;? ݎCΣVݢO$KXNhRisE16?^D-C 09 p)-s4쪻/P p#?ǒN 󣁲h³hg" FLXI;\ `a$9 Zѿ.nƲMR݄ykkN/, &/X\'PQTVXptmH%]f;c#K\,$p A &xH̱S!]n!d`3 B&e꫰k0hQ<곰|ގeBf \SRrhYb<XM+3S}H:R92Ƹq%~_ _vQI[.xYo4M|VˢDXn}S5B >,@AULzx@|_`NUZY*@7=JO >*L}* Ȥҥ:?~,gVY4L6̃JSOj~YUn鮣agg x%X#zP 4omi_'TL٘~q9h)M[ jG&Y92=vOzVw 48.]U{+3, ˗,dH(MQ$u Aaڑ*7|OW/~M뙫Jl bA-MSٗln*ʻ的Ya #Fceo~\oPZl '&n]_W}'Z 58\q\\$ϩl4ifգR<ՅTo`>!P .KA/, sK. evPxRLRԧ0T$uz+hf.K BCdW/neC31&g4~W\2[Fa 5`؃T]p-HgfU.,9$1piU\<;xTړ܋rT^/]u[竀YA⤞y]5PK ͚z؉ Yr`gpf [;NOJy߶eʸq0祋[ע*}>O^ґU tR\/J^ ;kѭRA:`|TzO;yIG׺;@֋/3\霱s7p_~6zν)>e otUeFhR1_sSVNធ1߷ >IK@'}*&h01Ԟ6eɓtmRv/R'EIdZ|;3~ !Wkx = `1\*eJCZAiPFes0,D`2!p [>N!-l e]W(^tG 5pু2AH| X;D\]C`Y[EiKbh<AC?`_SAN>cD&jf xW=-&acjX`(boy\1*/C6b&QH ;mQ-ccq>+iн|;B=M.wH(m[Tn4\Ah^SZzH󥌯b؏Lf~%l"mᰧa!Qt\'FM)UPwO5"̷]qr'_OY*gcQש 7(n ʯcs)Mdwϱ N4?-=<_G1; \Sh`<7r_M嘞 ƿ՟_>XۣMC{w?r3a$i] W _{C>㟇25:$^l /ߛ*j S+oi)5(D:g 5(M/_:l xDY~qA|}em5 |i492Ƣ 4eFJPXM8mU~!P!}RO0ks6 ypOi2pXm: f `|a=/v&fr90'eKҀg99wɘQkFtYiqؙ0t6 kFfOK в;/+%ޯP޾"vnag3@? wgF|c2):=DqWɫ~ݳ}p EjYl߄L.|Բ{AgxfwIDޮϨ4u,: I_MZ aMl}p.}Ж:aDF"2˒@T *jHeQ]}i t03O.Ь6BEFfsݧ &_c@ϏnVA*_{,#m |Pڀ@ij.M4Hl!@SϣXˆ(XJ{H5pS0u7wՏi_uӆaMp,ZagiX=AIiWss^ DdqlN>-̬!찁tw Ѥ#>uFi@ոB9B< DT[V*oek[Sfvp+@;RjzlB e/ 60g hy| | j_\%Q1#1 +VU|6nMp{Ĥ,+YoQMIӒ-`4@ʹRIhPvuV3z>͔) H2TB(C QT*  Ei_恆_(T2U29#eJw?s'{]Y;}^{wzֻXisƮhrU!NSo9Y>:**=nql;ctshJx^~sBʇ~HǞSl@+?vA#s mSIv8Ʈr W}pW隼³הYWsڛ>%>>1 K?EFUe^Q2B/xOBʠ_j׮]IWCI)W{W껋 =Z% T tk JZGo,݋Y5}Q-FkoU?pY1\$t\MP>".$h-U[y&3\ɀA,"(g4נznuOtj"GxPA>s(g2[f 97\۱}we{P}}C\^Q{k~9%p͏]1} ~'\|OQَ(`9?Aub^=Az$_sDlLyBp>oe?$p)l@R P w0jץE:n;ae3\c ~}eSVSf$UBfMRD;v&=IO~R ]cSߋdJ#?+֌rDŪJhoYAFӧs 69=~ J< KLEž@m/~K|xvד/u Wz}RP}>|?Ϲ^ a9>UHWmj6FbNdjz E= /5LG%L|mGr^ߑ'p_4o_]L*Ծ%v"pH}NdunlJ#p =]"GSyUXuj yrju^ش "jCw3AYT a5.KϽ gH)~G 랡UW":a\CrHY~gq qȤ"!I FS?βޓv"O ex0 Xjs7⏔ MH #;$d:$fHOG TūMtFBB4GHGՕ{"]Y]3'!ԃi-E۾ оQz- d?)mP1esxfjsLD WޝjrDILIAÊe+N?.?{HXAYQkc \yoY~AbߪYzoy>P?ҵo^ffb(ZA\uh^DvՄSC*d>q B15h]#=O=o /Lg6CwCTiK~'z <{uwl__U'uJ\þ)y]9;~&}r^rWQSܗޫujUe<{z)Ee?s>mvڣ81}36 p<л@PAG?k0uWuHLGBB@>uŢhѢS߰KuPgeg:79b gxGKw#$H⦨kQ5r.8jzq t(f3I3Zjۖym{]~Qn滐eԞ/|Έ>%Iϯ86cہrX m3Kn;oT39ئsg|sIXÞ~CI<}e:X=ȳ"gYK:}otc&'d{uwXR?J'K!c~:L 9O'~Xn!r "UGdrO_ J 'dJI['eY5ߵ'D~X AGHebL# rn;$&1"+jQXdr@j`X8%ރX-.y{LR92(VQ/r?a *:bGT\;&|>-!!l~D+צ>&~G}͹!i@Eƾ#yp !0yԍzє!yq Adv\:2yx}w1ϖvmiwS8SM:r3̑Yu>=v-"!~Tf =6FG^8^R:D9$B *;Υ^>fKgʼn*W]ߛsX¼t֋Du_Z37yP3yc:mW'suKZ2^v:qΌG!ХCuY/D]˷]/뚧xgkk,3LO/ui7?5K%u:lEzfe6)BS*}aC{}SjЀpQ4شRp_NnϿ4PJڙ)B ;G9u?/ {ׇ?;ls5NL.}8+% ){[A qvHfÏa/yK' ::*-J2e_  O& i0pER0@ײL6Q?fI'$/8DPdM RR.5C/{5c$*[ƲPWT ^1Y ]6y;Q=bȽNmpv wNl g<O@m (ǭS)t|wk?t嵞 5nʱ 7HwG;?ZXQb:ѓ· wjX2r;0 qס=O[ȰȯwCB/]q}g_/g: 3EoIJmEDl!7 o"|Zi-6!ҬGVm(=#voJH$ЀbbrÓvɌW]͊RZX&HE@.8bOq,!$]"!rx&0|Nq  )Kĥ|o0>IJ'>)ס ! J|Z"M9ץͩKj \r(''l{xr b+3xI8v({QXkȽҋ DȁB gkWOHO|;o=6߃wOo11Qwl9' e/mېsqNڄ/4}O4nJ8֧/0Ϙ6xo!9m3 l!p䞙ԯ  Z^8$ABt> A(/t /<>7+//?Yq/03YtNC $t ԃn:~e@!`IOLCڼ8Ht8 8 )|2&Aִ 2ɤ( m A۾ĤēƐ>1!{f&`cԎφgkq|^?'uOx 4sTf?l߂ y yVE",ȓ]Lå -)*bwgS@"ݜ{ັ(mAfQ|{rYnhHV[>:秝~s+LC\D[b/p4pF=ah~C/إHà餘924*/xp ^ Ko%/:٧Ild&Ծced OK@`7I_'T-#,/1ߡ)|ss ^OQ]RoONAxe3HL|Q' x6j`Y{:0ڔA9!pd$W;2y^V![O껿Fg [ YxL.%9H~BGq'O01~ƛXA$uy;J¢L7ъW]NqD?#:&BQ r{o2 xl /|&OV&q== [Ej\C΃qEx2E`+6*H\R)-j[O_@[Hx~G1d |RCAY~MCV8R!}D7{KQ bp6`K.C )L3 4cR.86M`LB}ft ry3\+=9D G: ;_CBT:ArM{ T\c.9S#?973V[˘ĭ-RFfSK=bY2eOsMڒڐƴd/v.= 3 \S?Dp>%g@0>5׊{*ˮP>b%uK 3ln0M8(HcI.~9g, n q !-Q2d "8=|d(X KԒϖ˸L~WBL!#9tQkjWw6#p5.WxdȐ`ȑ)k\+F FZ1``0k\#pX1`+F5 `\#pb`#p #p `0k0\+V5kŊ#p `0k0k#p,Ə,^8xm:ur,`#p Fk0 ;ŋ0XifV 7ߴ/A^:{0v_ nҥoh9}bŊA:uݢ#0׊#p5 $p+ԬYӊ^ʔ)˗eͲ#C@N[/#s>.,SI!p}ѠCڵk[Jiܸq/A].voν+ۢE׺w~"t7|sРA@;.Jܶű槙am +V_-\ .\`0z(%OaB޼yoZ)ʕ`JvJ*sWTh8uؐp'?me_6f8na1X` ][H_tqº;=y[gS_ N- ᇟ?ZrQG(_wi"E}W [#HxajF^}՞_~y]w]PZ5]MW%pmqӖ#'̲b%ʗ\:=sO? ``0 9I2ARX;3֮U[=(9/[wl+Zj׮ʗ_># 6 F `s;HC۶mTΊ(+W,';,le ir6lt[`Iv?KuyKN8!MND,PЩ$y䑤^}+Vv9*rJiI)?`ʚ5km߾ ds?tmC >TPysW(WW)RT$~W`_VϠ~퇽mܸ܆Xɶ<}=iN %ׯ_0j( 6 F `s1/8 f fΜiJiӦy0c k,*'N +nuF,Ք)S-[kHyGPK=sKUK[/\%l׮QǏ,Y̛;/={~|f̘3@ux\o(E *}1DŽtP [б{|pС\a{|뭷ӧ;ۛ3g~9>JΔ~hSLqC 6 F `sl 0aS >܊l/ 02dGN4l0k #F \:T ۷owƍ(B .u%v"ϏJr-fΝAy'֭[TX1ҥKW^)-!.>`f[(^ڼyۓ=^~]wV,Y2@N$(}qJa-}BWJ;N:e]nSNwY1c?\`0 YÂŋ;#\+V|.Akѣ]0&+Xy43mڴI7Eպ{_FR?)SfkRmb%y TjO}ʑX+W  0bWb bU52e_o/"9r{Ͷ/m۶ &OH}yW< lVZ ?TR./nz1 $?zhsu7n\E]#xYqM tk(9vXXIG`0`0 `0?&MrZL(7H-Z8_DJh#)wr֭k+BOZ+W.Cp _{Mϟ_ K4 ς?ةuQ͐bY Ѓw}=_Uv.v|rG)Rw_.Dz?x7Qd jߚ5kM7tS8R8't2 7ȩ 6K.g0 Y#p `0 !]nf*Ӿ}oFC"*rWF#ԻHQs3)\"s=RyK!X֡C:U6m6@|Ay꜅P*})t1@z5;6 C0`0 `0֬Y,ђCXfP(eQ9j],y_Ν;7wl r)-y߉**0.-]?Y @|0Pӑz(%! ɫ`{%O2pᐦ;vH wի] TRfz]w};]^lBW /p6[ Hi[s&*;3ܭ[7G:T suuT35 `0 l_|r l׮]DP(tc7w\s5WK ЦT-Ydx+B qNNZR b7tT>.eԩnY… b0y@6#؅gM qmFegu);_p]2\k{:>\:#tk׮a0i?@N.]-h?{ဆ`0 C@@̩b_ FA%2@_|oVTil*N%0i"EҥKoK!Cj@AkF;$P͘1ÑŤ!I3vG'?&ȥL\5jpEvqqNzН AK8B7Uxo3ߥ"|}uŋӦij4$ˤ`0  F `0 >=믿\~ډ'$ʩY~~wc~{ݔ62kWg[ɋ)PSVRe] =O2wԑGza<yСy];Xl=\ÇOrBb J*!w܁]DDu}ND/"_c9&]#w3&IYGf͚U%1'ۏ;vG؞l}npp \`0 `JҌ,/3f#uERAM Xv~g@h$BD))BU"i\ wE Vh+Wt (I@:maC4Ժ("7)QB2RbAS~mr);#mԹ`Ŋ5y"x' B6HG Y9kse[ekŰMJQ~]G*:@ i0 5 `0 }fdNgQ믧^(b!7F\lnM^dA\ TS.T(x+bH`pI! HBwРAaxH]Cرcs$\/n }6J[Sw(YtmT ^rjժ _N ?d[lND3ۥY`6ŋ \#p `0 !8y{.)CΆx$ 74n}O)7JX6GĄɄD7o^R][R~wԤ yׯlo߾n2s6d4ӦMsE=`0Uk0 `0 9Ə|GQ͞(>[r.+2sL}衇R4 uI "ږ)SfKlF: *$+gRZxAuA>}\N]>R/2dHr9L6#O.bk͛7@L`{(t=Z믿Kս PL&XJCq6U$ndɒp.W&,\x'xWxGx w a_`0 paٲeԱnC*ԹL!X.)$I@ȦQ@+%jIz:{0 oJ7 ^ԔʹMXE)n"w,y2xzSJ^K5'yv! >?.vǤ“O>R`o\\T͚5WP7{/W7=c2 D)(Gs9jt iϕ֭[, ,:ϕZב\SG J k6lpJJCDŋQIaRW6J,HJvm[hNݺu)Wی/N- u]7CsR{ܥ|.\wcǎPHAl`0F `0 !,o߾}#v` 2 $K H/߭[򠋔}vR@KmSԆTZ~uC\Hdr\ABTySɓ':GאmgB_~e% g$FPzݻw@ޕ;ܸA:1p 'gy:HWhѤ8@B&C>.w3 \z-b``0 `0R I?H5T,._-H˃xl %bkq):7@js9NK7{O)`.o Hll#GtK͛>r/x<9s8+ ߝwq.v v "(Ilp-d:_vQ蒻Y&kRuO]nf3׫sIIvRPglP߳h0 F Ƿ~ri`ʔ)NͳcS)9  6af+Vt`ߩS'k+^P|Bڴknmܠ[`y9CЊ0~@lҤO t]J]ԹSHJ*(P}_J|qnH7RJ5djY~4Ԫ{} {~9m۶ul3+ꫯ'v6$ΟbcStO=E%}=I 6iӹ!]f@͍_WdoQGVv?bF `C5?fGTnݺmb  K -Z1KCBLE$ Fq XBPRYHk+]#s;O YIDp)$!s{챔1槟~yM7]r.8餓ƒ:(j(O=԰z?Pb%s.Oiܸ 2go=;Ғ7ƒnY~={T9awL௨D#>HXO%rclpf|nΟ?#K6l8I}zulש!ϟﮣcYߑ}/ROJv;oU7\`0 |1(KYf /Y."A#ٳy[~}'{CaZ=UmBAlҊl-zȆJN 䌵Ǟ?xpWlJRժUuYDFPӆh)l 21x9g͚55 yYm[n:7&C hϗ~~{_;yAE b\H5cmM& 6S%"oR*zޏM: $~5)\s5Vݦ7nt95 !–U,ꪫ;6s5 08L''T6@uE1+:g%Rt8B%|Y9w\WÇe: 8,$Xenv~hs L#lA,i gԮ]۩MUVR pD,?.lL=b!UI%h7)%VdWѻ]'K/I&A+Zdw[˗/ϦZVkV(zwh[?7SmGzS (VhjG޼yS -T#B|\)Zhq0*?:*)07h~f]u!o\T(_opg~u[zcqOn?6}jlO!0}ѫ_߬])U#Z3ͭѹVmQzAVvqc1&O!1`0 ,ycYҦ"9k>LaK[DڎՀaI$K BQ2iKǎիW%y *QKT0fC*xt WԼ =`~gٗzGrО~z8iҤz0!߰ՄBg҄ |SeZ{W>|k Cv@)SUf%Zl`8 I6啁UNC'99 D֒zTGb?oԩRxrՕZם wXC`]mrTTKm N2s8^Ü'2H␹l`cٲeC-_~ե*җsoذc"T1ߥ .jcm!I-Bt~beolZ>?s pO;~XXɎBG ƉRċa&J޽jR ֈ P_AtL=JU-i rn);4P E:Ny5) uU-LP'&V釢yOP'Vḩltmj?'&Y$fS0m[ ~T߾}V. @.+Y_"?j|!tQ~^T sMwФ{Yl^0`MhK {W{Y^j1X`AA+n@:'k ADSUF ŀTy&q&d @XF-–XvBw]Pc%lO-c9X"\Y`>-5NH@/D$X~We" B KK95`q (Y[p Hh"G8J_o,P@TwAZ!6\>V쭂)%pAH[Y4iԔQ+&GX1am3W^yKU N %tkUi ;,MgM~7h켐sud<&V*G*C2A*بnV(0I`5޳f /+&GQ _!Xm5GCjH4a/&Ἃq JrMQJFS-8NP0tPwM##D>P'zC*uE 8B2?>ID6`0 SsݻW/l)!kqݰCmV) CPN"S׉Mydc5CI[O+r7ibH`wH\%?hE _N'2# &Mj^έ )cY7EWڄ#ȋfelҦ{-!ﺤ8!A&G ,D.*pI {ʍ +b&Ҽysk;|bU"$**(5X-RAE7'=D>Nj|mG+eswڐ*z*R[Æ'pg$?ʉ?C>*c+oJ8pKy ?Ps_4Jĭ*!k9dnmAj&ݝ*WByM;ʧt{"Sԏ RنyvI"JTІQ&a)x'C.|?;P1sT[T_(){~,6 `0dpxYtg>EjAmӒPN|&m;<''iGcPEՆ (*PkEAotDFd .G=:b]>k 8%*v̡+q _Tքh298'j%ǩ>jY RV&.#p 54ݷ?1"/s"9Ⱥu\Mx{v {?,c2!VݰrfVs+9S4FZnM3tpD1ys@ ) Vwp `, ؅,e)5d'N1I5RS,WMJHqꋶk,#?y-ns[+&4 ԏw#V&Xd-!h?oPH5d'5 !IutXFՐf8R@*#KExg "Vmu~RnP`DwH W;-mQJM{9H#gb:r--\,u)o$%Y&D!a+HE,S~[X+Skx0 ˨A.A}FrFoNGII.x?0ӖncIR6SwqA R&)J^/Jtr)R^yKdX*D_K*Ma PBJd" E@ɞ#&ى_L8u.qWDO3*¯1[87 &Y66\6[= z`bkOuݸqclٲlk+M [&6S:iw#p #p `&@R<2) B@>[mzfQ{'z˖-DBBe8"^+0 Y7ߨt8ρ(˕+ #J,'\SAʧ΃JF]k}Y4*: cTGk/g;`PmE}ʒ'\þ#p 9 #ps/PBCf{ %"+`JZA>E*=lx;\+_.+kYǤ|ʻ4THSV@B~o+$JG˿ GDQlfD; x|w׎(E*[dRX¥` kTo)_K5iR?6]FU4Y0F F7oIsْ+&$Wc/\pmu&MtQ~PXFݜkNk0 C6M'pORWl\#rwh@ϱڕiHNISAuuU"t˒WE"^ȝ7eRXlV6[ފ pQJs9)=cٷ-'M6UUpu x"f{Wm;*Z]/|%P@@hjڄmsDfdw_w>AFkiB{PDGX8-L=kί)SkRv KSm?Wccەh+uSAArMTP% ӄ#EϽ8{e&}W6= j&?rͥMb>,x7BuM؟|5@DhY  oAhB&P`sMM̙>_jUoK.AJ//v#K=h\Cv\`0 8>f#lyflUF@<L6 ̀<[3#(pyRRٮ:QJ{lh)N# 8Aa%' -k -gz6ZrTN7)""lFAtתU+(]rj2XZ6WPkW`!a HQ|"rBOXhmE(vflXF 5oe;It3Y+`lg|46.՚v|HR=12%RT{ &&}I՞7]~@yTIIIڀ4{́MԻgAPhsTV&"KAZ,@MTs[!t o&|?5i 6O?WC.p& I|rG)֬YRMc xi#4Wu*FfӍQ҃`0d#Ha@`A` X^8nݺy X}X' Uπ+ԫߎePaLy4.8K&9XK7FCN4W BQТޤ|Hi"nAIU].T2--`2 zB|Q..]c!>e77"!%KLy2SJPc?,|%~ :_^.\Rq+B2@a+@2g@IYwlDǠ:'=S`0d#P5!B]jVsqDQC4NvԋٱU IT cE*AUG 0/i HqBA]|gd&ΰT96>q'HZmQiof{8bcpd-d/gsȅ>HFrFrFR %携[`S4,Th[CStab\M,ek2Di*ZߑH)IuIyJ]W,9. K=AJ=!AA#^ HEPcCP*9B4Le7;@u KCa{įбH\~ߗ8mzG!dk E"wDL=.\W|SDu(gIj!'pekA|I~3?5d'5 !c!')SY&'%^8 o޼.8E=\[R+G; ,u!v!t&R,o# E 3^ʼnF}9 IӀTpѝ9ss F+)n|'Ntu/ԝxԅ +Puij7I=XK^iAPgӧOwj:C<[HwI VyE ze&/6ZY jQ09r]H~?m V,1"99 ! (ȹwҔArd9M>&vsY2Q’d)mg݌KyN| !gZީ)RxA쁿- }v?+rES6{Fb_;6&!)LaLcA,y Č߇ 8ۧPo9.ǽ%6EC COi3&ھ,9EV>@D+{RQMߌOp'\cI<3v`׼C;c6h/'ڼk`0`D`1PKma 9."בVvűA% iMp1"Rw"G52N8 ]q`cASDF[81e*| H@E@Z@C.+؉z;G$UrE6&~ QxDB(;]""#JUc>P`+>%̂6h/54֫W/e`56Wh;^>Dˆ! P|c "Z]9"3a'e s> \~@gAF_O?B.ATJ@𠊄UW4K;3^4Q;@C@v31s@MpHd v̌9}gfl|Ȩ X};1OMڎhm+5miADk&\۱W7jL/unkTY}Q%?M[BfB4FWOHHR߆3®h|79ONO_DMirs[3; 䝤,W>_ !9>ZݍiLcg!a"G.>EV~z11Ow;oLl`0@ǟ^QTGjT1 v!qÙ"/ d"^l! "px1A i"h_XyUTqAL"E #- G$c]TNcc ) >#Ձ8礽 gI'T!pع/Ols C@ݜ9DAH\Ᾱ>$O:@ŷAl{^KvZpp}Tژ`BNSr}2AkgNDꚚh_"p: HldA&HEE=N=J T9\ R@ Ҏ>=B .zuʕ;c4$ !':~,O} ؁` d)y%"3w'pCgcX9DALI;> vUTS<# б9;u J`;nS<_^޴΅S!ȲVHd'+@ﴺl2$OciBsI H&#ؼTϬڷяD~#'n\]6CDeaO*X?>lx޼woY%htP%>')c ]lz&pC`~+?Q 8Ƙ_3~r_G5V9Ɨbi#&x i.XϵChD&P  щ .` cx cp#=OI?}xu1<;A_x8vCc}}PA?`m]ү`cπ؉n`0H-`+% D5Q4J2D]9|bs5C`|OBO+vH+$pKת '`xggUlw48Nå\XO(''';+H΅Q+ UA0PEB R>@j{ TD8 (Xlj:(cܿ¥Zw;MHr"#UOzRuOta q Z ޗ \zU4}ƴPn*p{*N i.؇"p|26`yڼ.sM'-dSfcD:6V=W0މa%Q OLA(y {"JH_y}X9x 9Ei@~0Q=C~SAe  N#D\ώSbK(~gvFQl:I6 y油kd'4y? ! S7 a>JnM\"tQGmgz y uz3j>dau܄ċ ?ȇh~좻ƄaGW( |i1U֐{ivd;D? {lg=ӧG'{D?h,͔ #!!ߓJAA0C({,ED\_Է/RV J3|{N%aUQ{*CcG}H{E|&w&l "HncU}j,&<9&$D>^êӨ̼+(M_8O<X+Z4IRֳߒ]O@/kJjg._NvjDfR?3D׿G- G[tt&b00:;c4}wv#cï:2SLґ@z&rgl{Zgs(!s}57pj]W5t3asu.WiV[@7$2/yƽ}b!) .7q& {B4_D>>[KHQc\wFk0 u̼KrTsN^4e>WT"pHNXu*!;uhY`f qX* Qz CE~9el[ -#*)kt_-Q\]̀bNc17*Je\Wf`8ګ nj9L/hHQ a<m[6I(yVڡY J/BN8^#Eݟ;I"ϦC#gHYX JAϿ0}NJX &{)@nt#[U&}Hn٠/XGbcI Fg^@A4H'ewk@2jOkB=@6Я?2тK}++jaH&y΄h] 㼞 ҒcN8o qe"#\sD~]?DNs)Crlfb bXN5(U04I례oܣT &gWY+Gp&L⋈Pn? 2y{`TPCe 6Se6Rڨ'P.8,mb+ ϗD&T5e@۔l A[$Vх4 z65x'x<;Q[e>%Y.ٷ/w`J@n3W嚺*=cAjl {ЋId<(Ypz/-zڛcs2*0۠kze^".}(;Tgq’dOeIFOz `6S؃H*SD<(۞5MX%[ KcmSPnT (RQ`L(fOf6F[`\%ěM.AO#B1}JAUƄ" =~g|B*B[JVzN}!iHLd2UmH"3]-7)9I2)H">oN_Fv;+љ#܄uH3C(z@xQC >8~e;X;+z?!=uS@f}K,?ޚ 1?ױ~'VAZ23fq# L{_꧓ T!9%?+]~*oKLE;קwnD~8IP ?$6<ٛ6=XU6@I[JG'XRHi~yvߣ#=>c WJ?=ճX mSLoֳgv|>H.lLHF<+>8B 1|fj9E N(F `n͵?96uq9"h [D!r\!N8(nD"&9TIS哫''33nޙV|䗣yqHbKa q _*-pcRC6ڨ/EiRܺ:چzXY"Zs %ug%;jFu q'ҭ,.ߕ#ޝ/qN|JhOsmLHzgAaSİO*!p!e4/ fc)\Y'X݃2!Ӝ*+M!pe FXf 1 0UZG*C-#Kݒ E)(VQΏrڧHtMUayT=-"~֫D$bBdufAG漧"*9%dV-|nwLX )?=Dp.4cDިg: xWf c{#DME)XLCH*k{neutĖ{'ƆbX)X>{]%^bWP+VDMl?6ޥm?^o{ CA[.jn./20u[lk@ @P"HB}|_um}lS6]噱g} NltveJ"POVV:&5*.1O=HeE~'"ƆEMv! \>L==\/ߣD-4&́|G]0m3]f"߁dO[LRʈiFQ(1xBQZY>r"1d0emztIu2:狐i[$`*A\ Tz}G5W.YO:&E'Cx"eH Hfw 6 ɔ-z.%EaO dEЭLc!(FBGߪg/dETsE|}e&pAؼҷc"I<%p!l "tRIϩmǔz:H) $$ϭ2gv*@S,7ilN¸rQ2xO]IH QgH[hƋ-YVL!\?d߁| t4I^+FeJf{V~vܬKcua `Ҫt äS wct}_Ĥȴد()2.>b/jBؙvwSH!ҩWbAUwֿx /K3&imtQ>S{_i7J3PP|yVQDJ>gJV4PSΫ=:_J@|!jEH XU(eS66.1`w؂_Jkj^+o74cs$[y.޿1elyAϘX]F?_;x_c7LϿη)L5 0 A@@Յ8`$5^n z@ "4MP+GO7e `t_ʌhJJY:VrV!LoXE\5tlǙZfdC%y#/)FgT\N)W  bPNѮdAy`kU# BB ! p]txj#1OR6ACdBq|tx7YIO!۔RJ<ݭ+lJ:6@|"p Uqq㻼5v:J93^9j*Wl v\5MV0yHc9_|Dd ̝ :K͢H\ߎ@nbϪl&Yd }Brn_LY5plΣQa*^Sl!ʽ_4Wq*9fmyWVXvgr"٬.\S*Mw1bllqM#Xj8ʄs տ0l!TnPW;6ΫL0V&Nv8׭1;%=64[h-l{MVT6=BP=*Ygd$ۻeUߏg}j|bo$G1*"p5sqrP$JȾHx?EKw \cE> \aa>\.99IB0%gdX̑e$DzSrRc7-55Ə!fX*e9h1Qw"v$҄%iB/s6%ҋ4r >bl#fw@x Lp[@q8ѐ+ʐŎSjM^c{ت 3X'؛Rjѿ&#l'},;<32A@ .78Of#w!qثjԨ?`H}NMB,ӧ>.|'fSWg2T\ +5St\DzZG.o)Q+R>C&KMbפk9dT@ )jL1&3>ߕ%p.ߌn#EU.il c&zs ґ9l\}jlYBLN1k0 0 pE@&/@ 2"W&A6WpBPOvtl%-q /HI"~A*ڀXX`cH,ٳf=-0 7 G]Y;4ı$ YSZY,g /KgML1Ku^aNNa|” G#p^BEpF!tbC6 ^;dT}A'pAS @nTzb `nUnK̈́Y ~'=ḧ́A+.,oqC2&2 SKhVU.nX!pBEw*$UlG({dr|S48$#PKԷ6%l*2`5l^{fK@A%CT+uYHy^!o(QC%6>\-&8Jn̯`7P& xFt6a7Ev}dV=8peACA*ϱZN[q?e \eC7l栠Ĕ%Sbg99WAbB4(`@DTv-kkȊ\@dE 2j G2;D nGA /~w+S-6.nS7tMl>6@?@FA"+ێIi<kMO)L:ARDr܂-)׎ :pwZ|YcdAzX`BxudMRF14}(Fnm2p#0ǵdCh{i*\B@ GII7(= 6=O]w\{aCed?O6  ]&5No&_gJlOo(~Wd/Kuy-g2~<{& YH^-KDٛ)odșcS(ȸe8c:^BGrVYl2-XK{Os9C7DȬO̠?N qΕߧYµSW  lnjS v" P!2̈?}N@LGV{p`_ܯ w!]X-]oN/ľڥ=%p]B>]u 3 Ѓ,ENFf7( *p8L5+uW&{s E0Lv WY;W$d2s>q4Ȕ#uHr>)KVV{ D',1KufN޻Mqy@KiTAXK6edCd()[UĕrhoP59-M-Zg<2/K^8݂ "ų7*jS}5Eأ jPGGFP>HN: %KId- '{\D'h૎i Ov3DŽ t}3ElG-煼#p^ \l=~je3_ TƏܴBHV3m[ΤEuuRftkkB)4[\[?y^_d]Lqay|}Lm2/y^;:$s9EMRY^O$pGU?课oV:e]6dB ~&?Z{3ʸ}*Î0Ƴj(HbErjB.>cBԗO=C_~\+5=}kiCҷdO=1(=Jg|FCi OWFIp@%W4k0 0z&pJ(|;|ElLmHx4{ %نe8]eA9WI)nV!'Eur|$HcwclEU8 Ɔk,s}muA%O*cQ9XuYeA[e `kāUu-W)PI@9%V65*&pumYZZ7&#bQξ, lR6xA{{QO 7<ekj3l..|+e,t7~\@U% > \E[@6V=mv=,!@xeyDV&|7#1(c{6Qee|oQ$p+", E|[Pǚ~a"p bCE9W6{TG Aטd2AL qנ&L)IkU^N4)oMdlJ'%96ޱ(G!7^ո݅{<%-OqLlyW$VL\taW 72pW\yulI9AlvH7~gp&2p)l#:lL&2@Uisr!\e(1t31X:uKܦ{|N4Hv,Tj@ (|jn`m)]k4.5ʱ3 et]R-60mu~&pMa@>ji AApVf(8²}9g{}2pB78pr~ ^ 8rzQWEf- rAK6| 9H^ed4LɌ+uBDk,+_,չ򪇸1~71}%'b#r|CH,jo =;q)-AM} >jVKo \6b>66 W9^_"p\j/;I gx3oPl+H(e>!md(x>[ UC.ZF,+j#ܥψHۦCr9 oA$pR`O7ʎslϹ=DW}g.d,.{뭟ʃs_NSmd*\H_t \lulI9X`tH>-VMY݌Y JMC-*cv8u H;Hln9Z%X*e1ɸ!dPMʆRd$􂰉*{N 󛨹R=#гl%&;&LUGj`Z+D*DgvVX=k=1J/ČKb5׿DzQn&9סaˀ=E&8K+#cTnԯgoK&|]C3M^7ݢE \aa4qt8zS6"ȶc9)% S ˱@,>Ȝp@ɨЄlK:;ä!!F/\9Mg`$Gk[MK^sYM9CGӆUdQJȹ p!tQPѽ.\}aCd^_9uD୿T.,Q5'r6Gp X%@M(y!g1BL<9?&87獅UK2!H0-\,&&E;OSF7%_: +x{2A(@=+T`hWKb'{F%ؽ]ϑ%Ԙ>K=NQ<2QDM;$1odArXב՗IOJ~C*5p!cCUHM"fs9!"T*\i_j/ LA\;bx"Nd `"!\җaKC mW2FG읦v_8M[iߺ2'da'-V ٓ()YF 5VC) ey$1߯3@d\2! ;CPf%-.Qcdaw!ИdC Wؤ{ AJ"z$Gj3b\V00IJ g]Ĭ(-.s=K`ܢc[_;t%!p32ck okUBā5'\~HGz.&aC¥E)ܘ$DU{A)g=-6?gkk ]P1ˆO_u \0 0JD ID@%2r 1#QgJ 24U2p YX&`6% pE&5%+2~!Uxmd*p RIx `<&0}jN\RC qXhv(H5(_=艀gnהeKBm_|8v6申d[$!ܧ\,&3@7&wt!XdԖ9Ey % H=>RL{%} lLsd݈sA7qbibC~-:>@ؔ@S>vF1*~ sd,G9^r _} tBMFFD6Ae,}^\jS+ێyKN[ !Dw5MvB^xaȥ a u^wsW` D8˭!e@Vп8VaK'UUڐ~ k}I5+6J6oHwMjmvQ3^v"V*0YT]rXD2eƨO~aNdH)͑ HMO"M\AB(Zb=1+cҜ6'C" [ 8%T)f/}/6}ػ:֍LjЭ"prI'J<1F&m$2'Ff롏kr;$-@s .Ei_&!y $"װk/q:u#esV:0f._ɽqSrd C0Ckb4xUJW8PQ{ypY,'&Ndc4?%φpA9ye꓌I&puڞkӲEVuk]c~_]B[mpc!ߊ0td\Ȗ'7k0 0LK q#g jE<=0*9q 8:W7v"%p! p $!Rb&Q`q2)ferLT9SL i1nܸQ Q)9-g[]i8dAro؜7wqrp+/7\2슅r8AZN5<꾆BpNuzZ)p^! ,gxN$Aɮj9]k`'2Coyf Js@DGʞڂ@8\6"A(}A4)8@@Iu.d;)Qҗ֕Yk<Z{$ ԙ^] ,MP 1zWІ:ҡkuCcZMkD|GM9l.0n" ?3V:5ka&pk@ʑr?t:9kñב@VXtK 9s%$ga?Jp|)􊌠Vʈ َ8k@C#v, L 8K’sԞ]- {h &Y9 LΖs{evdDfӓL5,"&H?y%!t݇Ґ2 !M`ҁAKcBD9d q[rvZHdUԏM5˺1l\2F9C,~Z (&p9/ϟga@VeG 5?w?(3/]N*XB[weB,%IV5Ʀz&lJߤe%LҷxQ؛gaȘ$:ɤƱ*&xN 2KVDX1-  U,ﮌ&D!S`\~Z2Nm,ǀ8*_ 46:ʆL ` 4uu]+2YΒUk4fI& SD/A,~8'QnCYG#"t,X,7?c!ٟL,=2HVf8ٌEƧlIhΌUĺ=e_GKW@!;ſ/w(.4S&m %_ۥ>zulv_s,QDk pupMwPuaa$O rDw_Ax wE|) CRG 9u;ONrˉL"vN8$ (v%kGl pK)㵊]$'`Š{T5+ gZDĿuu2.;(ZdĤ _ g V$n )Xjr*R˲TMW@c1[ _uy Hm]%GA+HFz,%"uq6먶|B}cHJoR/A"5zcd 8;} 锭Ҝ.A4˵)Nѡ +#h2 L[LЏ* g92_[QusS7&c㧅KZE.Y{BdAJA>FY}>~ɥbwx)pBҳtw;[8B@*C/֐Q S>&WQ>E)@z=]χ,9Z:L0r xȠcU 劘xoq-fd{2*ÂB26~P12"6IRy;.hB>*MѴJ=8 L0N \tkdr1EcƲEc_uͯ::>jS{Dž?˓0Ps%c:^gCaet9 +]lN\24Xɱ(DX碯@MkFrdF2_![enn .jҹS~g.;fu!i&Wg ѶKB䛠_Ɇ%f];>}QC:ǟ-$DUB&+K C2E෪I9C`p:~gΜ.u+L2Cȕk(/C@ ;yEs,/'d`B\8.LXNAtlB]ȋQ]"[l(:z9.9Ic܂t LB`G T'җb@r2ynLM:;Vx6d>dDg32kKQ8I䶴5KFgy_DG K~d+>0VRv@1YX ʓhc g򋱆Ph?,:e7db?1B=ق,$Zu O%S E2|a"B;͘A 9lp=wTuQGN6 M21>_JM*L0A3בzid5:|U; Q=]گhO$>+G;N} 9*_t Y2>Idb=6/wj6[x nm׫U"  \0 0[,o/d*gm9Dj S:Xp /iG-ˢp!!]@fѩlz@+xRD5r`RKrcy bLgPcںrRX& \onQEϨDV>;Ug(}%Cݕ.;# Cv'PI~QD$sI@79=G FfNjӭ/xϞGYR|l`!DcN&5ʊ9o;kZ eYuԉ\ \e (x UAٛ{5< S`륧ۊg lׄ8#6-@ P+#l%]N3I΁<#-^V6ěFI~  S7EP]YP5A\׿<_ڇeE: ps \BL-6L7S)YlTY ä A5>><[T}{CB]y, u=٣mc*-udEa~ l΅ɛy=̈́H'jȒaVWCȔ&ң\LVt6䌲L8Rd{sX~+TD؏{12*D,$0}=ccENҹɷ@HD@YEgzFx2Xv|ˋTK=so䣟?"_`$5? {2z_ߟC)2;&pMa r@vV,[fU%#l= R sYGB{~Efk8PG,cVe{pN>5nc_# H}o [=HFNEVPpFSݚL^>A,&7oԒ@AKIއs[2dIA&Plt TȺ k%8cd,>(Q9GW:Px_2h3EwH`eub)@ؼL=EеDLw! ~!dɑ{e?AC S>Z:A5/deJ.ơ|IFα 'P $ ύD6})9(@{a;j}=L0{ET^' ?cƌI_::Kv*pM2H슎m+>c"0gC?E46#f&?1Ao: YҟyA5JMb}"wQc9MUδ>:U|E<ݐ2~|Wvi+CІ;75/ σ3 5B@UR\;8ҙ3JhĦD KZ Qs  m= [E&|?l.~,h(=ð%\zD8^U!5dB9l^C!T6(R =& .[XQjGLDZcǦ-!չH@2R2A!}q3&E8}`|F!xgL"Ę̳'` >3>B?8mH35ka&p+v'c:wB=+YJ`lY"p\p( R )Ci!_ #@!8d =$AN2888֐'GG2n2TЭV4K`J9qq&伐 ׂs [yqI# sl]rssNtIt[oCK <鋵!zjobI</c q|5VgR206Q:9{86gwMڅ d†{Gt]]Ch3bx )T^# !;$n< e׌N@_W1㗓a^TtP \0 0IaƉŁYYh,3 "`3H4;p&=~Hrχ`Β5"s~3SN8]'ڐ8K 'NLk h$CLWS x%!UL ;V'@GBOhu6 kC  /FݠnIL,zXB" [)O6C,ߢcEv2]Lrsd.`<1WcC7eŸzmf΀QɈc]F/\ `B cSe,)['>m yD|uR6oGI}ں&IR}S aelG 9+6vͫ5 5O0~aa,X܅u8ԏӒaW[2!Ʋy\QŒ5m,B<Ѕ< \~NMUTlzŠ5m5M5 0 cA :YQ'L˗wцf{i5-k)2s]ncF \0kdZG-m:OB5Vkf&M5k&pDB%Z%0Xf&p 0 cх :Č3ҒKxQs:5~Cf9 R`~-0k&p" Z:O٬Ͳey](FFB{&pRѐ(KYʖr*}ܝv)ز \0 XtaA K>u% "@ⲑ>$.#L \`#y6!RP^ubgLS٠<Qj5 pI`:#; ww' }gCan> Qw)ȭq.;nivm0k&p@s@rVJZ+&ΐM!VuZ-^%qe[x&E +L \!СCOfcƌ%;w9M/z \0 Xta( L \6 ~պm۶Wx'+'T]>yٷЪ뱳[y\;-gΜ\~xaшa( L \6vL%T6;.|S#RɘRDnk]Xa(5L &p!lmXpf y>)  \:>ڷ}똣oȰ믿뽑vڴi)aF# \dD \0k}Wv=L۾tPvYgo?vA;p}ɆP߷ \0k4$!fS{.'/XBI\.曧kn"Y[ѧrJ6eʔlҤI-EE&Wdp~6vlܸq~xaш wUWz葝yK :zKʩuY]DdS W$\`md)+lP >m2裏6qYz0x^_n?o ۖK^} Kg].ۤIqn#K]K]#GLی.?裴en2MM['P:{yL81˝0aB? pEؾ2t4L<93g#[0 XDܝV[m)cboac 6kV p*gcw!k%S%)eFl*efo{0+LNupVM >llb$en{-d_~y*S#vΜ9n(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0j:ӧOvM7e]vYֳg϶X,bX,dBlz7g/b{a{͎8∬M6 ':tk߾bX,bX,%bSn-{g|0{衇aڵktA>BbX,bX,R ]{)?̾KaƢ7|3qc9&_RΝo{G}bX,bX,ŨviK[^wu% 0 c5GuԽ/x>Y,bX,RrYr%w\<0;Ss_~y0 co#k|?O4o6۬bX,bX,M6٤oV;͈] 0 cop;gna[,bX,R2!6mѢEv駧;^|EaƢW^y%{ᇳz+dva:[Z,bX,R2!6s۷ovUWe}q oa,ZOw}77n\#d]vvml]vX,bX,dBlڶm۴yóoAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ;z?z/zi4uYi}nKI3zᶰD9O=,%8㌤nK{7ߜY>//{7+Z{\s5ٿl̙ـPab̘1ѣ|}gó?ϓ2~>~_HY|wx}wg<@g}-G}4{o1ݺu˺wn4t5СCv 'nK vsIl-l_ǎ.]tbiXaF'-_N<좋.J1=3)e}QlH>}'Ȟ}Yކa1?'$'^yl=H/R*oma)8|Ǻ-,矟?IY#"E=XClXmĉ 0 aJVJu]ٶn=ٰaq9eʔD>(d~Ffy^UB[A@s>8.wO?MSҀcp3fH4ut =0>dȐ$|8E>X!{erڵc>rY, -9A;t-c;tܹKUY ;cX, +:v,bsEIKhrK/d ks=ՔM+ B\kq) |aFm1a„DzyAvSFTpfJ <*(Dɓ1 S "rCMd18|Rd/{i 8F]w]"vuMSspݔHPz%{B>U&doqI&Zk;oӦ͜VZ-tnwί[ئ^-VC/M뭷^~}~ii`#˯%?`W[=Zvt>l֬Y~;Czcc޽TʺWYe]wLgmo0 è- _PtHh!kJdν_Ift^27x+2Ҳ[obwA/6m5?8cAd's?Ck믟V9ZB?D r3}$?~KX, =r|<(ZN;.o=xOHٷg"8.l0 0O=TAh^vFdI y?|~W|~*Ap ;[z 2w_ ;WDJ>3tʘmH(7CN쨈]K Bkte-d9;}-Ny6`kd)˵>R{ ӗ]-pէʋ)3Y=R~` e[wҧ$Rbi(]c[mSMpSK 3+nDlɏ62K :K7 fr]ڮguVC%۶_˖-#裏αPeHI%l(u{RK-qSaQG\YO>dozwπPW Ȣz<%D7"ZUV얚M^Dϖq{2ygI';NyewWB߷A|+aW:s]CH9S^ek4en܅cMD%26/r/|%ÿ2r ٥5 +-rwCek6˩&;Q`l,hM7ݔ62]|D2o믿~{MXXz32p^nR8o0kau _<"t7T6c"DcP_蝤LUx,l]!zEЮCҍ(r[F /4<^/N$w9:b7m6ٳ~FRZ~_~4HYPqW:f~kK.~vͥ"q3&륔;ܫ \b0k5ʽe{nvGd*n%Pf82rn%DvmݖV5 0 ڀds/ 6dFXd* G#,ђqP@2X"< O#)rv~;B/!J'Hf%o?ZŹU"UuXLYtKټlߵWQ*C}/w*85uT&p  \bר :S.(I^{Wf*}ڵk]uU9b.0kaF \6!6(AbBf Y:}-D~ 7!I ֥ΫLYy9$/A?: W׫Z"Ew,)W"U3ҿQn2lE^yJ-PV!p+ xI ܱr3fFw uoqdo&mc_J*Qq2 \b0k5*QD*jEKmϞ=sM4L={ߨ[6ydaaT2eJZP UNt9h#EqY׮] .LHٖ8)"~/(Bԇʦ=F"uwg}"BW^9wyg'}M"fܹ3ٱQ"_7):tv:k61ۍz"pZD;UDT_2V--YaҤI~Wzs^ehv[5K. \b0k5*1"`mzW^yenκwHgߥ?|dVZ3+x㍔ZHq \0 0Sf&L 5S(uS}]f%h:SSաC.z>5վzNF-i1WоU|9TX dՋgʜMY"YRĬ4䮲g;9ﺞz]\ doe"S)ӟt'sMrd2}(ry[W\qoD2#0kXL&p-FE`%#+Vqg+ۖ6LެYJt9ozkKq \0 èKP{ ) f_!jB̊LM9}]6=SFM5P"?!UeDR _)fK2bcS1ާ}y\dT,Y"p\?\|oD63(+q!!zyǐ{k0k5LZ,&pLy뮻򗿬rg͛76|L}t7o>;3slru&p 0 è(Llܸq ҔUHRғe>ȅH3\Eޭ,DP6ʄ=E/,DBl"gɴ嘔gf2289A'HcHU!g!l-N߅|NGn$/9-y!|ab1kXLZquӦM'^vev҅)JƗ Kݻ \0 01c$%!iqJ!CYg9gN| AϦ [cH8)d.++i|"`sABB |1$ rY%i˒%~OiӦ(#8_B.ǂX1K[|rlJ>[|n6-?h} } Lp3Sd7TzFqi;Ucu1)@M[a Gx5< dYʉ}NoS` C-/1.ƓDE}p exXV49T6NpƟȥ\ϰ&p-&pF`ʹ~K߆*Kal5uYY.{d[kbc"򀿄]{+!çZRC{ddԊr+G( .[kri_-[ce 3&z5|kLNO$QD6V.FbϢYuM{ Co=ϪCl~$Zm;g"oiC쯁mks|c) M&p 0 è@ZE6. NBdpC$Cr5"GFnd/pp>QXxc9'r>ù&1g&CrDȪ=2.DD&GY!H|qngG 8\/׃~yэ"ؠcB@ \K`&pڕvʻbXg祗^t=^9ִ+ϵ@iKA  9'#?qǕVOlP~u59GEPO[Mp^\,KMc;7(>hƌȾON;-ن2=HƧK/) *EYDӧ rDI^[` h(cE;cǰ}رZaMnR90~?yXz~s{dZ/~ҰL^mWչ*lsc#p5D.<A?L|5+kl ǢcӘHֱRUuW+>v1yL8V&|_CԖcĦWvLD !ӪUt<;#XmsڪZ㏟Gs YH|_;0 讫9PPQQ_*]3aE%Hi! 9* "9眓Hh-fa8{[U=ܪ{j[=i[N6Ϟv/ZlOusڭ?6uث2N_>{=EX5q!OVO}$E~7kdDqgL_Hn ps0&+t>O·'>p06jVSgs&d2LY pb\CNj d8v} yBt {S^N\6m&xEN,TkGj%ˈ ӂsNd1p\&) 6 <{N{B4Fۨ6LS=ޤ$G'9D"o{m۶/8g`'E{y$eMf‮q@ `^% $MPm=uhۻ('On>R5vE7WVy׺Cc+SGi?v>iW#+5wuTqzimdM}[kիj֭jhwݗ{{rS2g\*ɶ!-~ pk-˺!߁[|cX1&$` %WNlo5Kr,+q'Gt}ls('G^;@H/7k2L&ɔhKLr5~@2@@w F$3XG9(3&:1Q@-[,l}lžs0 4Q`YsvC}T]v+/aMD4JmN׀A?1!Ԧ[2h]uLF,!Aл(S6&2ߩ|_І:GO>b P.`є}ao߸&%r h[vY^կH.pv<¿PTPSxE6Ip6p-k~=p%ʖ}z_tFj2W׵g U\ h6EFE +WrZLs #q>Ա?v $Da7>P"sEۚxtz'SmV獤WAHl5>5z=FP7~:7E4켜{yFl|P|rǥ>|O͠GQHsM~2ÇRhϺ$',ty"\ᤙ#Fv]] quVkׯvJpK-JX }j:2 -un`$Z6qp[?u=<&CZ-?J{?iz>]zvM[suTv5Tڣ_;xD?/i0qӖyԷ;ћ*cƑ5ᦋE]Mi4ukѢo?~8G8ql2 7;.fc2QWJ(/r0|_5 !%6lI ]X߁'1^s{W"J74k2L&n:.R^5tՄtq*g׹yh"pZ)`QG33@EY}~&گsä[:-< ^5^ <,mMԷHV oPcb-q"M5Y^鼨:'6QU A|!-LJ#@O1Wn@ e>[/pnc8Md ,賫Q~*yD)ۅo?nH$mRy Ǵ,A;ԗM4VwEpDw(mK휯'Z*FA#!u=BQfH4 |iW\^'Im='m9fF ]ʕ]=nVOɰ3Ngt۩CtjruʗدMk'* p&3w+M9GdtԹ,O N6Y $ W>\GpI\7.48Oy* .@Vb|O&%:;|)>Yxm=SI@:767q?]}V&;Dm?|KT^  rWvҬ>A鬅c!"_ v yt6lǹnynBoPA*l")ukӐv 䠥O{uML|r7npFĴw2ѯOضh9pK9? ѯ13sZs?˗ߟ~[nvEm 6k2L&n e  3cr09gAnJqCگQp |>3@ `&kBJ=;-c00I4IA~L!p c1x+ېv3&2QD m (2#AKCT ^ u4\r~ _No!g 5jPb}0%g&6!եQDnMЯKg%r:.s#ECnZڽxOdG 2 mC٤x,h3Z/9giG+o}|[E-uG?#mpWT @Zz!|SIlie|U}_@TcPۑ? (6pm?}!є g~?㓉<ρ @Z 0B6ȢNS-nLշ>~g B`h"ҵn|UVa&715vK٭T63A!27a׾}Dr|0uȻernGkPٿ_qHڎ 4FD>m9~ZqKF\@x<+U3Ya"zG#|g?Q}s Q0Eߖ-qڵ)"7k Har7_.v 4/7&q pi[لzbŊe1Wje|~oq:_pGy<=|\P7oP[zP/9iKuΡf͚!_i?W?a'Qxzcw!) D(\E~;K_FG&!DͶj wG6o/|) \uF@Ճ"p7Ze6\|TrW>sqVq@߯Vs3(#.7GbSnYZn?x, w3~ X,!EXzL yx˸-es)[l믿[eoF"OZ8S}xi^}'366k2L&ɔ. O4*,hzѼq *j0G*(&sL5!ԇ B O@=,v ʦ]@n`9=>,&*#v(DVQy:;/@$@[8 F_0<x)9(0Qto~&&%L.h/LjXOynGK}XU4RuHOpH%/vnnpl >vX,\X?@,BM3 ;؏}J k$"9_ŧD#"@> RJ?R2H2ek&|x[vm߷<BTwpCepb[lѪ>-0 ;wD@ynl[nc{(]n7Xcb!%|lꗑ7܈^ћ;SO=ˆԏ؞q_*%? ƸB 4; *Di)Əs}(6UV4k삻˩~ɰ܂ V} NpM&d22jVOy hMg/2gq ~5~i AQ<Vm{ 0w Jh JpU @chp;wMnٲ2&IuXA}ɷ˱"Utɷk,cbpCzT84oaB5߬U>"npONOO4@RYhR3 ǡlK"iBD.!r r8EVHsSNii;1j#Ft3|K p{ _oHMD=2r3)FO+d4ŷE\mʂc8/Y}v9P~mE|"]3]OŎ3BԋkSw`%K#DUWhQ"s^{Y&>>_ L&d2e#@Xp hW :O%7)B{Tǻj&B],?@.E8^ nIsXDE73'%O i}}[CF/ oؔ4 { ]ņ} O׳74Dݺu}@GvYd2L&G,ۣ\kViws =(]4Q+fAC4.CΚh]I{.,'pi'@:wXF[v4Wu=/@w}{giY~ #&Iiwo|^X)㳖jnMOsg'ɜpCj Ӎ*Wvs9btGfr"pCuMh"mS >0MT\5z]iժr G<̣\X ؠ CmK/}=~DDS~Y#l4S6Ajמm9!B>m Q;~nQ)g󾋉].˵UVnEKۚV?ebf _X&|IK.#7Zn$Q;~nr[Ǝ}+9;qd{|4U}䷮Ա.zPX>MZ}>S|f5*4nj>n{7}v1ѱԗ75KC(7I\GpumׄB(3@y)҈dx n5{i[0i$ Q~Dhr\|>7mrc-յX (IYuhn|B 8č?X)|^~%Jm p6.Ѿ VL M5͘ F_tu wI) 9N7z;8/t~gp9ȍ|n8S]n!G+J]}ed nramWڄj/*po* J]s!Ŗ\d2LlpkA[oӠv OʂF /#m47j]8@ &I 0P~EG|qPA TG @ !2W-Q=.$.h踝-}mX[m_XmN! Ce4@GGutRV@{뭷< *U#ꛉ 9^zVѱD&,)XS, IAt&_~]Bێ1bz&AIh&IaҔ#n~/")br>bfM;$BNӺoQD [b;6*? &p 9,aqAA@+09sZ YnL[0+9Kk*(הmyD2nqeEvډ_MKgR(oxp Xn] x4lN#Gk@\k+y)uF^|Uni7;0V5Mnhۭ|#3iWOcGzocWݾ}{}sړPG"x\wy{mk'{_ۜ_|-Bݺp=R](P ok Qc pj|}9|sx͒pf"fQ7v]~V)iHKlz_xa#9q7grnv1> "?Uerg0YC\SGpwCZ݉c` G1 ~/g^3Z\ƍ`h{A)ss]ßu].!!ArzApM&d2 Մt-߇)!Q<!bVwq Qf:0xhHB1 :LU!Wp&#@J&QA5$)Ce] 귍ԅmȀ^A8`qL>4oF\'8MAۉo{"4t 1)n$ڦ)i}o\~heR-i?Eg{VQ4KCܔYςh_~o߹QÃ+K#hɃۼfC<moWOk+k}=k"pp9k3v. gXD@Wi/V.?c xŀr (߭T~W,$eHH>~sB3%UVm? [R2mU>x:6yn t]h HaQṔ[Uܭt>J0y8 lO}DRfO-ԭEfUI A.9~4}KI)ݘICJZMJ~x7egr2V?!ˢ%c#p7rNT(5m4J\8Vp.2. 0Ա.a7ȟرw,zV?qwēσyEv#:7 L&d2{ҐϖW  BUN{I=P +FWn;w>Hzܫ.GJA#r,"40Q@P}Z0i  :.]q8jss:vm]&. cЦ?5 k&N//@(p)R9_4]>?"":w&{6)A/ -7e 3CqGDQN KIh_$~p񣀗#FX}&{*,>\Ȥ9V`t(J>~] ڲ}K{hsh'װݴsig3#Gy ԭݘ±2:hHjZ,,@UY)}Wм<'2e<ͿHY78WkpH{WoH"sqٳA.~MV8u؂0ne< L~!rM7O'߼yƊpM&d2#e pjemh}|[a?@M `@XJdND.A$w jb+3 Eujފ0C_CfAY q@\^F\ } [}SQoD',"vd\&BD ӗ=!=D*L 4Kd }㇨>Ǐ;+ lvneGyba pF+o_YÇIԈ^0jO%P`0M8&XXHQR2[|B!$`0E8@L| _ |;wc˔)+;g#`_a!u,_Sy'O%,TGg hl2R|)9>7Oڶ]:u)H?F{ryO19q7U=$0ke{m/6a?Ofe+lc&-E"1ҵ3Ǹ OnɚhZ)Mj꿌H r'ci YXDp pcNJԏ(('Ԗ??4H㮻aTuyC?RbE} L&d2e$_Uuy|2drڀOz ^+9T_x$=Ђ0&\W~@p OSK.n,%6gBM֋3'ju{:k`DG;^>G5?@w29p$=L({LnT6@ F=g2HIێ xپ~=F0Ev,(sעnp~;"\WMH9Z7#.6,֮~]vg4?mR%Wzh&AuM%׮p Ei*&~>Q̓m(ܹ' %E `sB49F;K A Jދ_ 2a&ikT4|LI&> ß7EEܫt7ʴM-}5Gƀ[|\w7\M}U? m噝#s7l_B9G6mU-M)mFIGR ңhz#ܥ|:[nivqb}+ Q5kU߭a Y,|vr  %$Ari.U7¯a\~/~Mc*;/ EY۬./|#ߥWc%W_}5 /+e+N!-~n?Oz3w6k2L&ɔM[[盂%ZBвgM3 N0iP0PDl rܲD) $U)BCXHo{|O屨OJ5&L59#Y<uѢEZ0. <}>,PR7ipw7(jмm[z>g@EOȨԯkr: R}U ѕ,?U7j&IMz.?0WfEP7|o&Ko7i;%վ[Uu{a.1; u/}.@C|RٺT:v4PAP ?B˶YK}"~Cd=cqߧjӦx<{}޼fudhq4e6W>+PH xrA~:K`A$pI.7jW1^ Ai]xbYfD5Ɨv{|ITz>׋:b5KH:7Qo1)(J.@ E p1 tޥ:5qMVn35jZ˷eʩGSÿ1Q~sТmI>Iə}7,JM [ѼXiu6{G.vnX!VCn= N;-YK"cV s7{ H+#Bs+q=}h[= hHOiꩧ>x":pM&d22B*Pg̠83)jP[g¤xck 5Y>Cy pco$73ƀ -`A&D)0  7EQ|Ryefm\>qyp@@JOZ*7mz.=b )~:?H8@tGrCmc40 7RBjuS'?%6@7=8uG~S x<9M? Kwo/ w!"urs_PpӲlXc{?uHꇂ/(k7trbm-F Z׬[ѿ1 3%Og-KG pCZ:rs wof}tn:ܟtMz%$i&d2L pP3g9$z*.;`n t3fLd& I5q&h>FHrpo{ xTul2>>JAx#Wx"ahNU.a;ԇzFiڿAfh+"l5i5u030fQ˩#AݠA~7)m- BjK7Ij곁:ܴ!D|$1atnc3~@/;osVN编ך"$%nOxo'b⳹Y1[|Hr+WLt ]j" ?_z3pt|*g|#Dk?fXңh.sm/wc)y؅ݎg $̹ܰK&y R ~>Ηw 5mY!mAZ6xDoנquź~BߣiT 䙥^aEU:a .T8/[_NYe 7zs( B74'J*뮻4mڴ,>[oSe]VGkTl{|5L&d |`K4V4b*Pq/%,\X}hQD#Ll(\p?S'>@.iHJ;ߥa;n<~ kY3Ӽ?ۑz\RwDSI$xZR8R(?t$伿_> iBއrTRTb1'>0+,1i|+7cLXI{@GJ>Pe"ݙ'BZpAS m4B9 8ʹ.)¨=>r{ Ғ*"W4fy]u ȥ9ǻ9؊9bleQe ujܥ}=n#SǴmuK;b,K"o@t!FkΓ,JD,07A`BEӯ\Iڗ0^~Lk?h{q0 o#Vm[>) 3{2L?(;xʰA4 Mቺ~zR&+yq㸮)}Bg}v;i&d2L pC 2mI7 ʕ+AP;C)`-Yd yxl9 jdDROއ6ǠzPgj0'":aDhZ)7H)ˣ|@c2As\"՘3<~O7I7+39b{,֤%:/2Rb^Ѵh w#/2j'"fSkG| s(~MM7+'nW)+O|>}]_.ϒ"pk&ԙzG 6Nt|;> x$qCP`_i 7MH( $ v@I{W%nvhl؞u6;\O:$p` 7¸.%OX["Agr;wvd\ҍ>u}vZ@gqJy/q5>Ûo.'Oȋ/GETR{+5l0RdI&d2L pQt_ 5<ƠIqHQ+>*0pgP>V 7c1f; 40P0큐/3D1Ơ}D~D&jdHtU?)Nc8ʠ.ԟ c2*a-$؞Q]86CY|6#ԁ(!AYLҢpNl M3߆?g?p[Go 7(S WnWik6k2L&ɔt)hú-ZG"ɫIͱ Y!f':52kfהSE427 c#pO>2{nbnի(P 1Wq L&d2"J,)ZRGLUXٸ4P[ "t%\\330 7ؓ;w27x#3Ľ[?. l\d2L&B;'. pM&d2 f )b9!jE}X 5533kbQ["jI\)M4޽{'.Wh]'}SNpM&d2 r 52kfהS%Xy#-\K<ܘnIgr-m۶h1H5q4o2k2L&)"pM*fpM' 5DG(Q| =vʚdqdӼd2L,5e 52kfהէOHv";TdFZ,rǝs9^x!Ai=eʕ>}ѹѼd2L,5e 52kfהSN4n8'iO|W2e&6H"_~nyQ\Xn4o2k2L&)"pM*fpM' 54cIФIB EJ.@QDڞ9{l^aΜ9_{.!!J*E7o=MpM&d2e@$^ve>Ր!C̎.pͲ=_W ĵiSLpͲ#رfڀ쳑uv뮻~6}Wzڲeȩjd2L&Swʕkfv̍ok5b{E k}5d^z\,yGicAPGyN@H>UpzJ;hO5L&ɔV.wܖB%ʓ/uW_q۵p~V,33+s~_?orFSVܛo};K۸Ǟ5w53sc&q]w=_eg)-z[zˣ>,RZHӦMoV4S܂sO>L&dwys=7rG*VQJ;cKd2LV˗TZ´jl63t Z,ӭ`Zp#Y'fmDso`aYZ{ _|_O>D*Tyǎ.\8<-ZD>cPL&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2L&d2LI7oر#hѢرc#~YۨQ"#Fc_7 o&2rH L3gU6zɓ# .L81l2dL&d2GSL̘1Ãy"?SdʕEnٵkWd~_DfΜٴiSdҥ۷'ߺu"/^: 4hYfG؀Y_e}gvNe:b}a5jDN>}ML&d2R0sڴiN4 |iv֪U"6l8;aY+~1df͚ȧ~-%s.ш={ffYaϰ~0`fYe\Z_e7/̲ʘ{0&xe˖>*d2L&ɔ6neZ>EQw>KZ 00}ɤ)]هmT| p}McXÆ ЖDiZN?.W_}uw= طWVGr.ibOD *w]wEox#~,ӌ||-v 0;Jovoܣ>-X,S{q蜾ϙeu`;pw}+PY?/O"ۤd2L&)%LD j"P;W^NѶo߾N9撗#wR/GVZE˛7/<3fL{n{߾}QJd,xgϞ}ŀt.@ڰsrԾg Z Z;]5{OSSNKF1_|7kMw_Rwcsӆ||QܯG vE_x͘?}?yY&Wna+sb^k v]1;fA+5i|܈o#2o_;u։4j(L&d2$`))y5V2Nd+UrDmi8@7{?N' %Vcڀd'@Hcǎ> e."9"6ryOR+Vѻ\}EgiG^ tDf1+ɀo˕+W{ff_&_>^}nץϋukwo.-nnn3̲nopa|2" 0gvLLOE:L#_[퟿7gfY`pþ?TիS)4hSL&d2RPX*xWwWxx F˞m{&EfyI`g*5A3m/xzfM|.o}NW9EWX-Z0]ةa&Σpu3phf>me?ٳ'+>zllMj;wԛ^VU]+Bh p K/yffܮ駟οuysvfNw;s1; }r+Rw? nօemضmڵlsuԭPJH2e‸2:02Un;YfUܜ5?G L&d2GD֒vV啽nݺm@/)mѢs`E׾$8[h] :tVo}km,Y$7xM0Ց@vU."`;2ZևDx_$)t}UD n<a;**xh>w\Eo߭["qI &h[j8okܹ}]R1/%>N;-rI'Gb 5L&dR!R:S6@U姽ʢe`]_)8~D*U9s)Kuo/ X #f `Y^:wU} ̞#5"tGR>8 %DiGMѹM[xqQ"ii&ӱga pydh53k2L&ɔCrJh K$XZLPt5B w)O+p[[WQ뵨؍ZDY"d?*U"hXKZ/w+6ѰձXǝ9H߭h]GyDŽrAAV?_=>w/2Ѐa}6,$_.}n02k2k\d2Lڵkq:o<`O-@+>} }(WE~p֊m}'Us D"f>>EC-vj7 p\"dU{8dmV+_bŊycl,V2D1oϞ=0-#k9,vޯ-Qi%GM 533k2kffd2L&)kxbnJW!݋ m۶1P؏I`⬑ʕ+D ^]$gr)\-6i߾= mm.U T+#!%;s/8tqh' "/PdrkmUįoQ\33&ffpM&d2Ti Jb5TsRx*h|߾}**6^|?Xv]:T IbbR{7lؐQu' *g`jR6RR`eʥF| T=JLٲeYl>Cn\.{ [=U$wls831uؑ [4I%DjAu0k2k\d2LլY^ Ȝ"9Ckohxkپ"Tg TAVlOy޽7뻺@ɓ'߱}4 Hנm%%ORtL9lI߰skƏwĈng*ʶrEcEVc?"| 6\CϑUBmiZMMV*m ;v55kffdd2L&SjEz U"m#J/@*|XnA@5Vo ^J[2Ul'r ^AVJ#e吆JjW7O3Vcp,#ϫKZe)6PnΝ};;W0Ѵ3ր,`F͛755kffdd2L&S %r |UDn>E-A)r^qf׿v_Xە?kY H8moxs=WTAe_A8b1E)4,>orRo%`K.rLX,Tfx\k2k\d2L! hT(` Ԣ_-[XhXω*g.`4EEkJ١Cz `UfJ{9Dta?s|>㕿b Y˱6nxP}}Qԟb~@6QmLb5'ԋI)W+[`_7 9R2k\JKQ:(12kfd2L&1STH>f#^[la0@G pZ4G3O!I7%]ĀDt4(DDIsrM ~n֬Y"IC "@XD9XRQ7 PS/Oȷ Rw>r\?sa JRWٖT &ITq<7nؗO^ߓ9Q>|Mp f Ox2CI }ÍP|$ nqZC!q]zOz%q6R3c\/ s3ꌯ-\Io!| @p5; 5BN{|醒}n?Uk\\?`E-Asnݺ%s <0-~7cנp S]vSgp6͍M y>5@8$ .0o]GW#)]pM&d2L) PrwǑNL>z)I8"9#R`ylݺ0 ?/^I~/&Xef -0I# )28=\}.B/1gG~_&ԉߝ8j"&UvǤJ@ECD+hڴiSg}TLO}c1.%JԎE{؟&Зa?>{M`sy0y'j-pN-ő\1.۱ ] ݋zM rR~cñd6Y}}9 ~ܾ$5mڹmڵ찀mm1S9_X8۰kX;x[u>[b[kmWV5K.){?ԢE )$F7[\NpL uFi$^؛J|O2v?pW`ш2FT\&s/$}r ;[nmnʢf ]s`s׻13W 7ww"o#a03/0<@ mQӤiT>UEX- ( t (&6p4VWT)FY!U `o+EѿN׋:Ak]ʣ2Q`x T(SLX. j}P:d&hR(+@*o]۔\.7*ؗc3!GnG_z ݡ-w.cH ܨm6i5IHO5q:vpc?VaÔwG s]TNӄʊ. g۹>(]zu݈ ǨO \8gע9۵صKsӖݤ]\M݂Sv.uSfZk%k{@hTױ[ Lcڸzru[ FOs-Ļu\u\]֑飀S68cgWKt*7WȏגOڕ&?GZZWqs*,*_R": ܘYrFzVckԼ\Q[ݛd#*]C pF A\:wߤ7'wꋡo~55I7h^ήMAnsc/=ӵdUUUoٵ>~AJ,7gkھkSװU7QϴcȘ9q l䔥^>;́x6iӰՁc4iˍum?ŷ8X ~~cq L&d2-e@CVZvڹ;&Zm۶u9Amri 4xig^qچ禫\ɯvs\N]\>@qHEt<yZ㚴>ȕ}\R2UFE~n-AD<Y_fm+Wa2Uwuus#(sXuM׸TDr0 99GYdAEAkIpzz辡Uu{TFϗo.s|zcߠqnv~|kXa+ :ywt<|G~>l;v*Xso'_ߗcziֶg'u`?u#C&߫X;r}W>>rSױQZQpM&d2Lzhx1;S 4OF:k9>VȀN@_%).v>˻w)? tnsNA;N,܈>^<Ü<~V <, Ϫ:Խx[qB~x?$?2;Gq|Ȕ(w;u$y=>SC$x@&@v]1xofڔqJYr҄p.YخA}>VH 7|gZ֪.=2\>a\Ӹ1Dw>u= `9izq ( lP8r2=v=9ow?0 *dZۺ?m;FNw 9/hcyV{b؀90ʬgLP>,p|bt[V?^P86Vn_pJAI-+oUk~%x<0ܵr ab pY][;Rs<=Vl ÐҬ<? 'BC%<|,[y3ܾkmZ,XK+0ϠNiWu!.˅gaEZh5LvwᶟVgܸmiرk|4iox<`;~{G+WlK t /1pi>gD֢=$U/gЦ-_njwW_1%/>%~+{lC{JHHηS*7yߖoO;D~&oޥU[7VW>3#`; j6>N Ȕ{]Բ-@%lBi /}V;-65).D oçWMp{t`Hmz @D!"|Oف5q 6]Ml3q(4%ɸ].B<5L&d2z&PP3 GE]1 #~zJ(m,wv@B,E:Rpu@V ]$Fxٲej6z LF}^LWEpȫ~/N\VƘgjnG ОdMMFwocWb;mwxA^Vk[i*\޷{Tżua! @mf %b+hŴ !*@Q-`"/Զn!t}j'#TЕ6jp'/=6$`*mSbv_׮h˩gmC\sx2녗M,D,q^"^C}baC9dp׏Pm73[K >xȭդ;'W~},h[i;a; f 9 * 50mfMuup Ey/nRpi+:= JrpM&d2Lp.".++C& Ʀ@߼,o= W,Ĉ6'߳1ae(>קrΨ\{xRb ^ 6mJ~82v+ox&|A-]p>LJ\z뭮N0{̥N({t qCc{Vq,pA޽D!uǀ[ zu!u/r8y-!.N~4ys!m"}ܝ_, [$MLX>qe3|hp$;8X Pai1.l+78Bi)!R5v޷]@QD-^m6U}_o\h{EΙ- 6sҌ|qĢg avfm T.P\@ ߗe30mV޲e3 eHc /DUqj2e[ 1w_!/Q1Z H"9. ʍx9GOq(ށ]0#3Mzx 2_ o1[cpPrc1/_lb^a}=S8eƦ/8'U~qZ [F wSZ\ ,li3 |O9kԬ;g d8/VoZEv]ZJXyP\(Y, SorL/*ҮEKh[spSN.uuV6bN}E%]wx%ORP:3t_JW~>p/+`) 7x6v>JakY,'c{%\jFXe01h 6,ɔ/Zb9V\b[.b|ăd2L&T7w3s>htj9aU 5:iPفzw"ۊ P!dK m}گmY_.[PV)'e}( m_^~ύg(eժU]?HC/6 $-pFt1狟*x6>mV0~e;u& b;Il0KyrꁋU߅u}>4|_޷ ppM&d2LQ_& N# &(ƨE, pc'$Ze;{B)l/<=$̏UepQV@d2pC]> +(q?2Jz%G !wO?t@C2LO2ou0`pn`]Vb0RoӔk>~;vfOɋ)s_8 X [7pWFr}Ri8~Κ -шe Xe27wbc. ޠb%'/v `d2L&d*+xCFF&-Cy.@%wʮbb Įx#`hMp19?Ye#ƴM;rTʸmv$ 1*{`w@gluİ66"|v 鳑 (; y^d袋p{_4c_oWŔ[3<B&*7\fg)λ[y&[+H̅R0fv>?+vDxYNBd2L&T@72,?ZY#1>eP3ʗ/\=xh0^^bEbf,*o۔o8?+C41^H X+9ѸlMު o/ w ݇ȭX 4U@BW rQnx =`+/*$[ ) I\f 8سii;#2,nX;/u+att\=pnMXK vP?o3 N$-,/\W!Wywu] `%^'Q.aF){p+Fyp%sVQXqeu6F eq4l6=>MP_,;Ct)Q/ߝpM&d2Lĸ歷r&`T#y>E I ⋁2Bidt11tVi:E?[LM+CQb֮]"L U^s\׶9F ̔wסX$X@eވocu]禭-sW5zo\q.`:\icF?u}~N5U޷x=cb9ZvwW` fg5r8m_BY| \ lZ0yoi*Kx2oyؼFu wt nms}_|ȺowzކPBAzѹZND~rh:Pz9\_.Waܠ>YSig W6BGc?묳ݻwޛ6R`,uF|\>,Ńvy9a!”%n_6p 7םcrNM"gZB)/&d2L&S\7ȉaywG7GñʸoS,T|/ A 1M/TH~p2j:@XAc< u)ౄGRI+}zɥ㼱.eV|[J8M]vRmqiϣaV}Pm2B_e8.nŤ'׹eaU_ et'PLy AQTput+(Aĵ.>x@ Φ^<+ý ^i@>VnA]19x[x լ충WYܯbnJx9Vf)3\:nEiۂyYBaCK*3rᙛ<buJ X3h'`sa'๛Ղ_ P]{qv"\ba|̣&o 8kKf-z,| pR(E?W/W,|g;W\6z m׀,bRFfĶ뚹r^ĥxL>"%%>qb{f9xRo ;T^ix)Saޛ4IpmڦbԮu/KDm?zˋ֩dl]$gƹP@:gwmNK!,7{xonl>bfZpү3z5L&d2c0, ѻP2֜` àVQ/vbc@[2`8K} XÝ2.$dN_F.t| K"D{a '{A kLL~8+IJ%,`Y$%Q:PΫwzo*~, Il1F^`P\`@l7 ؤ:4Xon8χ5~Ċ%_υY𳤦a $L36zp~{͚ڥxv+&ui$ղEYޫ0A }au36ꄝ~y/2˘$8Ž|U|,K\@dA\hh{mӢh[ Tk؅16{dpt\YW\&~v&P">n&jtO6Ђlp=˲埅|h\dfSMlKD+Pk C, ?[Dm/&/41˱spy!v*?%ul_Yh \ 6p:Y%^/嫲^2P_;\i4\avx}ou Sf꣰\aƲoT:i$.ManC&jE8h:Un?śɝh&wo3f6TSgkv8zIÏU+ؽn8ap2oê[ 6q yƅ75 ~bd2L&d7Zb ;MIU0$cRJe~𖸬La-[,`~ˈ{\A/T֭[peAےm1&e^7?Naz >*Om TE]k9B`yeL&d"yNEBOQuu ן/y<aL/^|MK<'>>.ױQW\H@b#7.pvC5@ul鋃QSs.B|{rsmaz>7C>a1,RAYƴ ۷Mf./^Wxz\08=N$=q`4[MzZVxbCL.K@kAԵ_/r`M~׮GvY2q[ hW !lˋ2^zDV-MSCj 2iCIp솦IT/:~& T=zU[[ \ $9svݷ]䅝Y*OE"%Uris؟}9>bou\ҽ  \atVF TQ3*AWk5AOn_LVӂc{p8тg((fX!oA k0p̜Ln.|BͰSQ1rsY,>dDZA.xV\,{kk!Cy_r>ܝpM&d2Lpq1ꈫ@&㷅cR\j! X] L(@H\Umz1U1N Ad%sI`6Yc-yw< 1 9 @jm[)'=Nr@#@ݙ-dXcF C]U7<-\X=s O36 p\f?\j^O돂pW) 0|L4rB`=n^<(7epEeq}]RŤ]zfI^+tBygupxx R zOmhkue?(}Cf8\<3R-s-bjߚm/ euY Ëv>ItOw'vG o|)qx!EéǜO[W[˂eS/7Ϫo+Eu4 \u %L']wY@qQ&и.-coi630G+'w }ʾc[mȍȡ&/C2M\](Cm9 D5l@ށou.\zh1lsB= Nt=Lγ7cgtۜ9}?YW7m?SGLVI}[lq@D O2#| xOx^xLb(w+~sNAT":4tp}J!}N;;oП|~?oI8(Y1@,駟ܱ'm6}}hK o]6fIH}vNDqIߞ]B&rfkMpM&d2L,Ek f|HŸƐ{}fM$g.&-34+s.-o[/.&s^x]ͶShg C^]渄7;/yV${ ܤ[a[cP4T=c̔%z$JԩO˚:~b׃zs dw_ECK=Cy,ݤ˩O|})fĆ|h~_02'ʮ]ڿԤS{oa7 L&d2L pM{ h,#7?EorXFO7[cH#\KpM& L&d2LpUxmf͚x[SP^[?&i^04k%&\KpM&d2LpM )Q{R\#ٗvΝp-dd2kd2L&i_D F- W&v+s1ghג\KpM& L&d2 ಀXMbêxnڴP֕\ Lp-5L&d2 滀X( M7oenV/2kג\%&d2L&\\-5dd2L&d%KpMp-5k2L&d2k2k%&\KpM&d2LpM&p-Y2k2kɒ\d2L&p- <81b%Ky rp Z:.0g>K3o>8찿dd2L&tH$n "ɖ,yTn;w ^xw~?_-5h)_71bŊA&Mͳ'gUsw5L&d29tY2e_|1x,YĽvws<דּK;_V)U__0 wd) wqe_6l7x#xͳ'饗^ .roT=sͿ_|ے|H˿ [ݷy_X\d2L&~8'=k׮=jժ,YʯTV<줓 [שvl lߠ~ؾJI;o)[NR”vÔ,OjվIغcO _}U5j`mL 4p٥އfzwd)ӧ+ ׫:17ntٌ d2L&Ӿk k ^x?Jҥ-Yʷ=wyMAϞ=1cƘa2L&dwkb=\ ǥSN9Œ|OŊ N{V!&pjԨQI't9PB8#쥗^ 4i AW>A[h<3s=t!TyߠFk&?hܸqPN7W^yep_~yp)z4S$J0L_} =3 L&A1Hտ??YË.n=&p[ng},sɒ%~p6lvm3+V8 ˰t``p׿ЬY3p6lLYp' ƏqӮ]&LLhݱ3f '\D+6l5Vg}vpGqDp>YT@wV;UU Z}XKp+=uժU#<s9<_U<- "}TkK潣%K޿k9֭jd2.mTiYFކ *dNŲ{82ĈY E0?8жx?^/ଳr ze_ F*VBnݚ0VZr;vf9ln`ӦMA}zbۈ6nذ2Y=CEbݖ+Wc0jԷ.]: ).1qcUhQbD} Uo*J5-YDŽNqoFob)?SEڢ~ۢPĒOO&)B/2fKkhˏ=SMnE1u#9}|8#5Ky:F-ZVbX ~|xSYo^UѰ؉'8昣RΊd2 XdE Ԧ*+}Dak:U'޶Ė%7׿-~/{y= u҈Sӯ_t h*p .N-aW:Ӆ2rk2dpM7:W{/cjׯ_):rG?Q6ZA@>D1巢SKm([U)_Etl*'xU)]]t&/>SB/oeЃEU"z[jK&1.R,Z[|הbLP:Naq;vݒIn3q7 *z#(z38NT p[%2M2rQG+@فG\]˶[xW>Zb-\RA^'etk1Z=_)y~}+V1w%X+ EPj׮}D`Tž}_?hܸq1 Q>cu𢶰.jF{]T);_ \[Pfr Ly^{ ipL^8vk;D\܍-knd2rHV\S72@N*.ƃO?O0 qػbBqr?aUO>.Y$ D@.DXPdK1"3 3_]#BYKY(߅MpM-\KpM&)?su믿v }X u po_$b]Z2Ugd`ppXoQ, m+^b>e(H{uJA2Vhwu`JQ^Ki Zխ܄gP+anziӂ 68+^@0Ne,t&,^8 DpM-4|"D͛7o>u.X/ݿ)DS61qcjʺ0k*h5 Z2k2L$og1jūW :Gϝo/Wez(Ξ;R oTک8Jb۲* 6PNmKe¾bhW.\SA)+-]rc ]qA@h fVҥ7_dT2kOdd2IӧOvBL:5xם+X+ōe2 eMa;/Wt 7' yϑ|矻sFqhqg^zA;=uY(EGۖ{M2կ L8跈/b}Q ObDeT 2k*h5e%`e˖-HhNEAEh?Arn煬6K_hBQpM)\KpM&)デ~Z93S -I$i׮]{v,@Gźߛ4i(F ڶm(ƭ3FRJU|;4@,E.gnj*w\B5L0!oW_};3f8p "0f;+_Q>Μ9 3uXiذ+/iRN:QFfUu@\Sx;bӣG/:)3/ܿ;K*/=y9y6M,[,Xh^%!^ѮH[=3=}2kNܯ#ڽ^zjω,lC+wm$^s0n~'bƗ c`\S~%&T"@urޮ\x* cEC) y:pbcjijxಘS)$B 0`{Do^@`t H X|{ p9?O$ꕲSx%a%"!e%)g|͵x][T\WRru660C"!l&ͳyb,7c3A$_|y?zꩁZph$w.fm߾ݍ!jcѦUV^gl'<^մܷfJvT*;?i7yJ~/+\2ޣߠ`C[Mި{)N0\ h #Y >L3~#?[#m}:3m;^8ہ{}h8Am:&~\s1m2ҿpn#7 bAFM;ho{١>B^ Z2k2L&gm2Hꪫ `Ph.@@ ILj F.'tca3T}GlZpD6sOjd=#p  q2E;wt@X?)B0R_ e Y`.eFcbyJ^(gktoGaɹ0*0s, HFO(P!4lGSxstKҽ(\Wzv (3`Db/{ԃׂ00πX/I -Fddy pkG>î]0 ʈ boGxfW"!f#n| ]_x\fB _cݧE@;Q˳E"Xɽ=E5\~m%m VwO86A"26ȷ#(Hx^*ǒoۺ_е:k' m=UQ;HhY7v/o{<[xq>6 ~9.20DnhhyqDċWoqN |?fѿ9pg:ϾP^.Qo> Yas 6Icm`w߱͛}pʽŋ.-zu9\dž6c\_¤ş?DƷM9/>#AHs,^jҕXyp/ŏ9m)̘g<+V̵ی hgxxƵ},\\O8 !&c ˶OؐqxGhFS>I;yD3r+U»48ﯸܧ9)dWa\juX  Ӿۚm~2ouXJ7 MmG~K%lS !Eky0X~QBAPdI_yVNsr)3ЎF9u؏Whgm{)x ĝ.#w}9LKe@axPx@ttT2R @yTx>yxdp{TuƈW=" 1<~o]U?/n *}Ljڳt_ӵO?.`hzWadyQ #O}3R`Q m۶] >U/2^p3ׂC9Ʃσ*cgmw0{<29@0s~y[eQ}ϐQKCu(d,g)7SOz|q҆ Vm{΋/cN;G+pbZ8x[ o%zG8):گT)o3Ҋx?\L`KHs( *P/~Y/M䅷B8F܋J}`kG:ўziTOއOsSҬg=ǽr~$c]I>+$}C4~i,!zt$>(UU| Ԙ^ (^ XfF^^0}jSK84'ѽ0Hμ`6c^K*Ʃ`Sk80c\vc}d5g'qiih9&ܣ32Xj7>m*,: fПp1Ɖ[@2N=9&ItPw@H3\$?f(`$0jC/W /3 O d NjOO` m!/ 9@^;x`I <*ݭAEf'APxύ8[Iұ"Ogz^`3R dq=% Xv!$c *=Ob՚-h:ܚwGqD-ҽzTeVqﶓa9/-B /*?~ᇻ{PV|~Ucu(z衡?=c~"IF5GydUC?yasan@@,㞗x빘| '$,yйQx@s $ 9%u.#6{P;s!^@qo)k0/%76RP]ˡރQxu"+ 8 aD ] S R,dF>xq,׳_YNO Ӽ7}/&)B(Y=+z.BQix2pu u?.s^{1cCh}q)/-x1Θ7ng +↑׍XB],KHvƁp%\~7}dfC5~81)3$t"xުnx,Xo@Ye/ŋq3ч7 ]}(q[K/yny1oQVIm/_|هkA;}GR4NLT{&:@Y䈣ǞxJZQШlV{_=rxѣ伀XV=6HE4f%<ȣ =hب"2^;mٟWeU/-]óPX.m(~%=KA%m>{3ߦ6"QN?!fk4~n/1z鷣SS=h1ݏx=z EJ=zvs:P 77bLq'z6ۧN/ǂ*s, B=ܻ?ZsʻFp]Fi\ߧ{|dj:~}5^7+dDl<ΕˋBF#,p_hڈc_zEVyFeظ$ |q,3oPyi?9nvkŨ?~%9m d-r}lƔ!YYa /7Ł pyILoC?s>TRmr?7 X5ºԝΠi=hum^ns4>iv'?&t[m4~mqwGf&bQ",?.ֳ2N}29GeIKL33}5mFxo3[d綦Ƹ]KR.i.$J;r !oyT 'CT  Øhx ynAZуːgoԐC3cQنQR[*[Q9s)?w@$r<"`7'4uhY Ax =.:/z6nE$Dh&[Qo18:e:8Y3J &,P&FYd}B \<C%pQޡuxEPNY&2eJXj99OoȢxXl]$~isޘ$DV(i7D3۪7kys`7 PSwU=PsY=u5usx6M߭$qKH?2B@ NXU@"&#t9%LdT6m'hp !4^%&K l,tV6)|Qj38E/*ˤ3HOƍb+1~3IceG̉"Ž%p9l(³\Iv&(z_gzm[R7bMNļNaQ6ĻP0ٱ$lއ}$w'dW.XZ6!k\G~Rp9V{uK/S+]qԆlԳ\'=Bjr[(lp<dʮwKlи0YCt.fm0 èVȤј#{:LJXw#a iD]9Ei: Ǔfv踳_DGNB9y0?d /s \5`,a늎]ibbzPJٯy=iJ9Ku<]R@#5$໲:(QJm0.r3 tȈl e1TCL̾88,vz$$!oEo6$I#붶 Erg-.UeuIJ*JzróNNtb䂈r 2sCsTk"kde K5BaauP Fj=-e&'㑬 ¶LΆPD?E9H χHL:X-JNcZ1[@(nqxNlK"I3upMP]b%XEg;<:P=}wF݉q؊ɋ"pyׄm4sX8ȄL~CJQR0Q-O.YI G[ ̌ ?/}}!H hwLj³ d('qG}$zD1[˃UF&zK=ί$X ިñ`0XD!R;vxBB'Ͱ I!ocv %&Nn"yv4m K{풢1#]1Ɣ0^Q߮da'hqL).ck>+{y +}5q_tLZ.*%X"YV,յ=GקkDӹI̊"py睮ر"hû={vPub'™iAg-}'"ة zXզU !K AIe[p6=86酙 W;J+/a8k$<8d32:9'@*=><-@N.Lj{\RW܂<3]|:`wy8#8({PaeN.-uTYVs+4mN;6u>3?#C,v³AN[Np?C92IHH?g:--J)ԝX q['wy8ސ$DzGYABA@FKrN _EYd\R: c򀖧B' |b $Kc{9 7g x&&p/EVd "56JF?$]2WKXKܩerz]L1]F(d?-3w }"cb KØK j$b.M yGRH\H+ƾvI;ba)ʆ  E5a„%}~Mn'Ch똯l!O]w66Zz{m=(E{b/3ۗq\vM@p14`Ui1Kb,֤Xk_3%voc3h20dZ5I/{hl%ISKYbBdQ)$iQ rϸBjUJOEniѿoxq^iq5o,_I cϽ3ߵ9wҸ ^7-Wy4.;[m? m܀{ bVD1kaT+%m863",Qt!DfH ǡ[LR|o`@x %"^$e-IFbcBe `j V8/:~=9+! )B\B6` B g`H'd7R1eCW^i$ ȶ<Q1]F8W|P㘥,G)$m&pLǬA2}#_XKeq@IѠU1bb 1YAAi_uIE}N2Qr{jD<e0D]!Uy,:P \}tV Y;mj"pQ2SxI[8x ˘dlȎ97 G2?gǻņ_5;- .+rCOiYxIa_+֩WjU bׅa]Zբf-JϾ4_Fk@mrbzpZ?<#:-=%۬Z}~r p'5 0j6+e$g}B!7X1&(1y@ȃ\ cB'EZ)W1pLo1Q2t d5@aRAd&1i`FsVx0-(!#ve  scd44X뾄qD!KovYo&r Hfx"nPf?(qpQbDK}CAps 8$b.N7y( qĒV85Ց}A2y&uWt KxqYMi}D8 +z:qdKTxE ?CKTNGK?%e95d!P=*{B.VCMߏ q5 P=zGѱMJX2R0s@栮%n)*5eS^[q#pQL͍.RI6b_T\#hxQ HF>B"2;w\b~-Llb%J (< ڔ&z0͵y6q Œ,nT%7Wy^əaSM p@x^VMd#k ۮ4oَ!qGLƒ `ʹD8 Qlzm f7T(>-d.ݢԷY~C͚!Bt)nFs@$"K{zd"DrE# XWlm;ohaa$WL5(9k`pD,)0l\p,ͺ#, f/wb +4):vǘLx?.re $s%~*N[]="i2/ĹƵi2 rCNuI<8] d鹺*]o])XW޸etg& rB`BLPsKf wS\M?C[1cF]D<.յ5EM7=+Tovv"w9[ukL&`;LK{mg5=E! g +ͶgQdnҴϺ~lQEn/{9' GOhHDc!pJ:w䅄&pnBC&h3ka#phQb\$Y2E0sO _ EVA'888;܇DrKdnŖ1ȊJ@~q5[,)ZDp  c=@Y|yϣigqA3TCD+^ 3dM隫d(X{p/.-=I{" 1P]/ҷ!jgnӽwon 8ۄF=Re#E9PDJ< ey:mi# ljL; )k$jES\pǞlPšbLPP1wOx8Nb0/lՀĪH ԶOQ+P<'>Յרso؏@ȉy1IUTTuʞCXVT'PF 9qzO+AKWno:Io}ٷ=J_!V[#yjݵ20 0[2 ČSHEdz."pz[T(N!9.|:$"E)!rPu ,q!֜ȑ#+2i1R:`pGy!cD6$OYó,`1 t}{NL*' D>gWtQ8%#Cfm!"{xnz/iߕ˘R9[r@U;ՉJ4%QT&+@2KWuWhK}NBߣ  3׎vNX&PP{/; %3K|˴i St^2I4Q_O(kBPpR!pH/! HdyD&@`BI.=Bp] ayE4lĵUfs&p˗j }5mEa8Ic~UvU$pP6iZŲJ-J6F^X{7Kj/fQF%Fu'&"D2ϻݥ1D2?lUU.7j **L}^I>U2-qi|b[-n,,nC M]EZ|ǐlH " :k ]][8|5ϥC_UfOo~ivzXk }ק7t5"wG2ka-!PԐ4@ T2Zr(.;iZBAP惥z(UDt LJ $BANtG9^[hyr:GE_Z9W۔saL$w`OKqe`!'g]GS-u!Et="qQVx_`9d K$!/BH`@X~ض1pQbCR Oy?ls{`.sysq]Uܷ>553 ^WH)Rd[rc[H[FB\H|7l pn H-3-&dQG-gmwbViC!]Sb:a_( ڛFj3Azb }4#HUquM3q*vou"p$5Dwmko)KoK (MhAD1wy!}S$OtoSDDG]iڲq/QLJK{̪"_LMÕxϢ\GrP uQ.5@Wb #pV?vK{(MaF${ H)vzQ]: c7b݄Yy{RWj\AZJor %"b FΓ3_:FȅK*)j%DFICչXyQ g[eR$MHC$·5}\ ./ufqS/D}UnQIҾXR:"*z,v}TG7>Rވ$5\!Č 8DzS{\̳ ) #po>'`77J}pSS郲}N bbMh~ޢ0IBdPj- p5^0F6mڴ0>{B1;ea=Ԯ*NkQ }Q^fZ2m&&O&y햢Tź WQ* \d\~wr2z[G\vQ.+"3&A+9SOӉa@O4I,KJgR> }IDDD˭!AiuɃ_c W|3!hϾ}+_ 'p 0 iosH~ZZuQ\U}4YvpZw+ZM>ǭ5 0LE1JR$H'; P;6s8<8O=TPw0HtZA!)§`iW>+ieH d8$9im2Bol9.!Ydž^8Ila\B`HS.)Q YbA+B  ذՑȸm1FBaB!0#C"-2%@ { ΃Tk +}TE,ĩ*I@P'L $މqٮyF(ُvUQqHD ɉyYQ.Da} 1=U2L;5Q?E1HbF{*jBE]A0Qd`x01PW"2pbIC>{PC9APeQF܃_8A,,ug+ꃶ= %6NJ*ŝL4"3XLAҟ&$+)JwAbUo{eŽvUހ=:VcFD؎"Ύؾ/).}LjRoۨ0d#/!;ckAR807gC6W=5X %o:a*A͘M>( 7ߕL)WK_m^JOVbcB 8VdMۚK;bF઎u0I@^k6Z ń7\@OIPl0&O`rK%بC=blJ!p9mU;Y]%US{mڛƨ_>mtT~B/ػK*q󕦔cξ- 8$^ +qͯp ۏmڼ9 AY˾mUbЮbv+D}(߄- ڷ=uX瓰`a-;  sb#xF8#'8Q,;ũŐSr{9?'C!}yF]0' 8BbXƁVYZ|dƉpU,8 %PP@|㎲ bb $d__~&dƭH1vsc 1x/@ᤰTr _#&3cU;n #p:z@P q! *T D-k6 1fkQG ~TQ=<ϐu" \ GPvިMc{rp&3)0v B'79"y A.RwPF%eܹs[Z?9F]߁}6b!g{ͨԻg,r'U+6T}I6q~; " J/B%=WZ\vC@ѳ##bc]@$%&pˇEͨgޅĦ %}7'+@8A+Bt{l (5$ǡoW~++9!0˃c|2)x8':A=ϙ6.3+CۆO%kkI+ul&w87$}~uPU"[6DBjyl?]CFS;iV}v\wF[M}Tw8c$?l@ujN2\"쑊$p=dBDul6/۫m^EKgk%a=Խ;$ [5nG6R6:5"AG w#u]o- :"IvW\it=B8w~i'\f鿶ݮuѹXtŕujFſE5 0Ltga`;H cH(Hp"F#`_f9c2@P ~Gѵ0c\۲7{srh$-P ~&a<䄌r #2!#siYDGTx{; \:W_;/Ļ%a2WNq}9\rx?͛ N)ATU/nWqJrPg qU$9sv:u^PhwW+qA96PlXT}dr8K"zт#H% cr@clo^Z0A!/*(>M,E Xn>iuPYԾ:׎z7[bDB?*l>MHxXC}2$}E %pySi3F%.+( TF}qu0F>ɧ4F rl}DŽK?2-r6)6us.u.LJZ,8rR&O܎IkC#&&+bo'p7"OF!095bC3Qߘt=&cFYe!(0И<4F|yފ pu#D=;z{>񜚄mFcM'݌'8}^04cb*{>K'pkpc;c.qlv>]+WNE~;2mg@(ہ+GZg~;D&3z +*~KN s.r \sh+}s]7'R &[  La&pKGX2[H؆%r|3(?1#Id ^Jl&R>C. _]BHAjH!ɪE)eDr@^lrXjX&%K!Z2yd,Izԛiu .szvLȦ}H7|qkY>6gm?GCEr~g$5('wBK$ΆNoHdrȚmӌAN0l@bI1`tG/8j3okH|ޯؓp#0R4堼CH* $Z$`nIăc$L,Nx铡/RH?NdVR"4 0uPI=Clu+/?~|Pq/\; .TʋqLj#?33iKWȋo&p0ŠD;ʍwύ}ae\g:1XC5l dV:%d5&e~Kn>hguXAh3&ϒBq5FcE.3X8TՉ%}q BbP8I߭Cs5bnn$RՏIHHvٻNR \GVZh33ŵWiuO =v}O-#+Bdlϗs Nࢠ 醛IzMyi>W-<kq.4]ATħ=a ?wXWShU꬙;jb ,QJMͿ "(y{.IbLa&pKE! MhC#I5#>AdR{MQ2zRELj$ w#!bV9S=eQv$0ۈL`3b$GW[ pQ͈- pYrd FL$H 5ya>Ef$1=Dvi*|OHiZ,萱T:]Ivr.=}s_b%Ye]XژI6,E;+?Jr2/QԠ2Q?/C6Sr&{R Y(fI{h,.9,0]Nhlsn1Sﳧ!W}BjԵl" J`9.o-W&OE=d)¡T2ENIr;!5D_K&HI/ˁ;UJ$py8Y\mF3=u̞4[9?g"m `ǘο8- o!Y[zH|"xoJYޫJX ӟƣzJ/ PZ~RKFǪR 'ѹ>:"?D0dQLxȥL̖Dr]}QWS!~KV_nZl#=YxilEM3]~Wς@aem29W7z I~F$?Ew06>ջW!**=u_WC>J=#Bn$RXHt6=\(Xir+NOHqFB$hO"X}wٿб.sduڦ{ H&pE)h0 è. [`InQaG\,Sϰ,m,-TeSaD4xpIVU+Cs{Y|3"- ]ESf( X:ʰHս9CC C~it(\O4dc!{PTBs#vo/.YicYcyT4TDD甉 IK"%="9{ׄS"H(g#>KC\HEA^[UOptiJ]j'S7eI F$t;ɑT"/P'}8YFR]YHhT>08,!g'ܩX vrzr?[?U/>q 0m~YjrYՍD,qIߛ-I%3Iԓ\X`>,!Ai]n2=<7u4_''R[*8?* /q)wuc&Q$_XmN7V0z[& 6#-Bjl&v6K[)ka2D|_-?="'eEzaj23Ė|v$e#%p%+0.}ͷqs)3dGXqxw4ހd=(an51T(Y1/4>Cb+ :?-k+R#4c "gǕpԤ;UL՝dٷQ5ԩW?y@RؿUqM[&HvBf7jS \|7aQgR>!ܓԣμ6yF5hwh]lհ֡66oS@:jkSl\|Hv:zM ҭZ[h{4kaTyI&Z5JDa#cd\%Q]( QF/؄ cɹmE^# ȉO9iu̸Gq/b+_xEBgBǂm#c 9+.s9f(R|{B"[c[B8&)M8xӺ"csm" 6F utR,/"翓ܢ98Vyp4Q,85Rl#2 c(wD~"7ljxQ \32 U"&&1{<^@RbiկTY|_w6?zR88լ4y&Doi*LZ\T}е|&%[nu[.kDmIiUYx.r(ձܟW2Q?!QS \!.V;g?QҫLf );\h<#1:[맹uP$RC+ue˥!" pQBo>еK_Aݢ2HN}Re5kIn$Ы`W)+2d/=cĠ Eg˪t3Fkn SK;BIJbK~{ohXßEvm7@Hh%l }T@) WPՇ̹Pf5#sǨ(3>P~;@S-A"=EC@bN6ySD`p8Rֶ D]e \~[h,.ƒV"PWQBV2q%(dB[ZqP+ h pW݃U'*~kCH1!cLI` rXmkΙk#~ῲɏxGN]EAhֲG`WsXr''!.?5q]Ot8mB#vMM~ץ>YL,L>z W^6JWQhӝ;:}''P MVm|n$hvOL $' N7۾Mі-=:0?=Kwh9met]׏,8D-iﴉŻu8N6&\[<t= 4Ӷ}.LM5\! zhlƦ[X1C~Ẏ3ܲI 31 \0 \YfEJ3CXW88(cb,}~qY"1 VQ@8`|k NL. d: g n2"a4N!y B6iGB$` H \@tq}ph'lirRg % UP.y'fؖw 9 ̫:՝闺&|R7pO%B|:>! 3PܿgMCI$kF%UF}P'JǧQp!!. 5LBPPx(k*˒S=큉#&JzLq,bR tg@ }2&8J\0GqBP  1@NJigU5(gpX5Iɳۙ1.}xm8%-_& m R>2BLv,WTq x> ;0a Wb|钀 B' H{_ Cd 0)Ue1x_`3$K-EV<l&{&>cE{2ƛE{g8Jq̊)B$ϸP7QoZHF~> `\ն覎q̲4&Cj;@Ozţ }ɻEVfW^*_Xch@&+U`g~h?$mo[ Y{QϚ}?ƷE>pgqRX~Hm.9w!OU\0ka S#4BQ`\Ù]\ 0KRbr8Ȝ õ( ׋1s²pu(r S'by2D$NBq`,买,,KaHHG@E53/dQ(Bp 9_\9ÆRfԢ(09Vi_nt(O!]p pp!ċs llC>pǑ8"L''$Qh( bرa)D\e􇐣(Q\Ēc/2Pm- 訳wZz6L;W._DŽŁk&M>_ץmgU <=3qs4~g miLvAN-PR/sեY:;"2 猄jŢS'?\?h/./ ul3m_xeݹ`B(2T*4wx$vULdCq`R[xƌ%W.P`g wb1d5J"4r<! D{d?w&Ae16D= wI=ʼnJ Ht&p&x/Xw gmSSo&w in@XD٘Z^wBQEE|YqAN#Lql_ *6D@E}>ݲo$ãeeϕ~@lU%(_x1CӄÉ3zI @e a7B2ALYXOlhC(a QR\80πei& %ymS3&0G{>W FUJg͘d7}41Uk ;_6e{-}˱cyźrMs&Pb@&J#E97D3qGMoK`Cc3O=tyǿ \a"ƂD훍7Nʈ3WjȐ!`TWU5&p ?/Djy}+20 l \(Tk,0b0 è0[ ˙bL~.Ve*ZJ=!pQ$(P{V&pʆ \cQ{­U"u[JP0E \"aaQa3bOa6rlw+KѲ6Rܮ8Y95 &pʆ \cQA| }'5*3gNoFeQ0b0 è0kT L FYwIDfp}oEfҼy+\!ޛM FE \0 *Q)0kT6LeŤIg}6i_޶mTR@.Q>6]s}fרl5*&p]LaU&pJJ+Kv/ {g >몫"tBrwH#Fl4mڴogqΝW5^{I&ܻ+AeXܨSN8 kVf2͚5KڶmcaQeK0*kc, j5èHlfI֭!p_nڴQ,tfmPp?{;' 0 >|xw}w7B'4ԯ_O?A\! Eǎ^zݾeB0'߾yavna{>H<55d *ApaK:Zj)Jf饗_ٟܶjTTdMs*O:~m BYf? )+B-Z.;a"5KEc&_~y=՗믿O c馛n(kZz?;.ݾFlk?@*l^]*h·矟t._ԭ[7Im̥jy o{[UML/dK=%=ӕWZUVY9i`LFLda,iXs5Y&VKq..Xs]v_EwtB\uot~gR\_˹GR3RrO~Sїj+_TB=Vv"fvNbƩͮ?r ++ZwW}>M7,PM&2 04 4H|e..TS.'å2JTY[bK7ҥKHjdi%vqD}KeZo9q{?С 0% $M2T0 0 dDPi֬Yرc>QL\?0 0 >7($3 00l2;CP֪U0 0JzgϞ%NСCwcaaf w:蠤]vɡbbʔ)U R? 0 (3h׮]i{9$ Hڴic0 0r&$J 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0/Rc%yr饗&͛7O^zi?0 0 0 RdM6$8p`'O=T2zh?0 cÓn)ySO=5b-2K-Tť2ˆn۷o'§aa,Q9rd&i&]tI5j1 0 0 0*(pׯt9裏G}4y뭷` 0% \pAPޞs9ɰa6iI}=ťꫯ!CN8㓳:+aKzyIN::u: ťR˲.v;9c2~y0 c AK.$뮻Pmi*\s]tхj;.aK}믿&rJy%?]\\\\\\\\\\\\\*tIInݒ뮻.?Sa 0 cÓ'|21bDO'fСoťRV&R&=P܎aaѣI&%n2rsqqqqqqqqqqqqq3vԨQ<`0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0Jq%i&Z2`cI.Oy?O>/2 0 0 (FJ/yדgy&޽{'rJs%?s2yd?(0 0ʆ>,y;9Ӓgqc=y<99/yꩧA%mQ#Fرc>9!CC>C7 0 0 JW^ 'ݻwOի뭷~:|&͚5KN|/Ou떴j*b-[n%(裏N?GI?N[?p0 0J[/3&9sN:%w^C .Hk+L}݂}֭}7ӧOrufM7 .D]wݕ<ɝwޙlAs9a&z8>;SL aaaFi_ "]& 6 gᥗ^uQvm||D)lmڴ –o=*JnmzETć?pO$W\qErq7 Ν;7| o#>>~='|& 0* ;82$V!C%@oZoE>A\sM0z f0k}뭷A#)"v3ڵ#seeXV#(yo>;C `W_}5lYg饗’_|1|aaQ1k֬ A?ԿeX'tR0hcq3-[|E!>/]\!KHPcIh=:th0=1`'[2}tW0 0 HD(KQa_ȯHD $V?VrnN "uFVI4Ա7ݟ4h ҥKҳgpNCԁpDV!¾ՕOJq|uViS~9$'}?mW~"i CK-T*_']mu]7N`qYC6w-ds ' { `vQa*ݩS_PLtGnQe:O? K1<.gjXĬZL\R br#g:Ygu[M! 曻* .JRvH/e21a#?,MeHB'#|1p }53ǧΗIe0"}Sy|;<;4foo߾:Gc >MTɴiӚs2:T_ H`{_Mvy`;f߱Yrzbn^{m^xd=pcZ`Tjs4 aM@\XB ;0 d!'Y G3YJlkltU |xlXES4aDDhMuCOwwr[ZK*AHXY(_c.+,K/':?*c|11wRj>_骕]*ߠ] s) h!a,N@ȢeBEurotNSRө|TuvUO*t̶Y>D5 A 1TGͲ7'M̜93tV"}``@/oY\@ܒ4:axP3ƨ/Œ65c'Axb=cEE۾k/C2)IY,1%uřzN:x-#(afg**[| q6/ꚟa>+Y޿s{j{kȖgޕQM6MtD&x7K e5KXy^$4` j#tQI! sp|\\*}MTv1jM#!Ȟ6駟DRˆ䯀U"FC&t%.E!Zm-*)H{Vg%xFD!!IU}l() ڵ^;%Iۿ,_ Z<~] ޒxm"Kɸ/!O Yş ڑx8/^ 3j[|y9%){S c2N~ߗ:KL\+q è4(1W mLڍ _c۪ [`bq_)S?8qB"> ĘbYR$!3)m00aOaD/IHtD݉٠lv"#*|5l E:yop8S0ſ&cmHUE Ll(-mgf,zo̢ B L8wEʎ6Z*2@ߗvf;hf Q(Lv2 0 0j4$(7 `3 UH$x_BѲGkhV? d[ŶgCelEVR&bv|"g&~ ݩ/bQslH[e||| 㳰p x> cTgOX b%2 ~(>a,N@UؖMlRH*uNUWSM>Z!˨0 %)j9s~i(nX:O'qdiJ!K%/(d0*Qw s BD5'Ki5ؗY/;K8>@G Yv(o96ZA AVbY3jc>C%'Rv+T_"'Urz^Gļ[d*" YRTk%ZaV`Y d0ˬG+wjE$O $J|{;-K}gszE<˚ZZH]pq..X?C,'ec*V*ϾEY[ᓴ#)NdwhA0A آB@B"yRCvwuTuNk?O/UXZ >aTk!Ђ3@-Dެ![!GI…ȅŧV' ׀0ab,S#EΖ 5u D!9b+>!Y=%U ኂBBBR}!SQ7Wd<5exĂ :}Ѡ%PC$s~::\@}Ts:=?m\kQ1KԉgQ,k\VQEFT(Evʅy,QHd}Od ~[J [ %oQ RP@Œ Xx7\l]D]:"s@sE|ա\qw~Q]ӳzJ8KsOؾvj]Rz7c3ťJOJ<@ի&+.v[p`6yᩲ#/.ٱ]vٞf)*<¢IV!K/l[lfŖbi"?dmS>|_*`/w/?"HL~h;è(Qb.B{\⬰JV-+VF y o*\/ +z@ 0*(gQfUWsJE>%,}V$c"[3Z+3ol!p˲ZS_ ,-?vq8&@3 e,.|r<ԼtHȒ_I!|Vx&K+}*$@*m/G)ŵed%J6+| 5nMG1K–;X{8pIÆkIJOd jWsP!,lI1}!sMa(edOWZ6]fk3*^x\* CiSּy5RU_ϰa]'&tDCUE5ͻoKNNRq{냉gz.u3ITXN￐.I3H&e}e,'6Àx"m1 Y]'k%{~-u/袝x_xJpl[nmOqkebbh .D,bh:R~x(ħXpouw;vD&%|ĵݒI&khM9F8+{R 20* e 7xcFyi2pj֬YTl os:E=??p èx3R +2dH j u*m}}C m#BHݤxEDl;b*ImUm|m!oa)|CCku(v*\\:Gs7wg].紛fZ_Q]Y`5<(2w'w "/mH;Rm۽4.d y&Mߡcu۶[nwc_y)=tsq2}2R*M9fq ƌX^{tƯӯ}N>eI3>}6Necn-+ugsF{VaD!Όr:d4!xFfH;wnk**$F<义%'"5 \ $Pc*Ǯ+wB!.BU)2eؑ"qӵ"26w MܕKBҒІ]uWd*5+Q_y{HF﹍|6Z_LQ Ge*a(ATB.S3\PMPgƳ^wo#VpGLFKQճ$qǿ6{S R!aT)m)yh 9i0d-1mE^#"U[P-BNHm!t2 Ye){N>"8۵۲ \J*@^6eb'07_Xt2-OGHa6Ɋ2D0{LB(FaeIthƆ0`@\W V,evd,X$#؂LfsЭ[7H$8L"N:G' -K>GjO5sUJ[|{ RZe=X~R0?B yGȆOKK^`n&c 5͢"gjRVroؤب %’A$HNA$'Q3(QɒS۵˰AA@Ω33==ԭ[AdkTr8?V$Nq8pQE`1a ,C8hz"B899r\'2@.y@: ]#="͒8K1L.%"Tǡ. r(O> vt R+x\N4AZk%'"7z,kr :ڡw .<+OۨZJ T`SވMͬb¥gKjW,܂9/\/SD؞Ŏv2l>>/rX@9yrLz*0@m{n*98?o nXNQ}HSax(qݢ׊Mi[HoAV%,a Q-$v2F[Vo)A$ ų AԽm$R01JZHW `+Ek9)/׫F3J #wA}oHZL2٩(@UAm{uYX#+FstRGGE>w*ݩw:%eFӋ7lٲBwd?qYlIf3Z2۷|Y~_v-Z`;xw,Ѷ4߶8/i! kpܰ\A?dQ]Pr㔖tc5jf;rb;ǔ{r ?r7+Gs d̠8Jr+SԤ:X@!feV^Yɨns=^1+ ~w;G9[=5 'cր4ϯ~V^NFYVzGOEWQ6Wti>rk ڲeKw]1S|0 bJb+\K@->G,ۀR \>?rVUA }*f7ʤrNNN*x0ZO_k>OA?=)(O0; Xܰ-",'5.\A3*j Ɂ\5 ԸO׽W%,a9z_TY.'BRM^4T2(I@,fJ*oy麕V=eRpǕP ` hȊ]OMϫ$K.#?kId% c@pEK"@iW\* \Ժ!= v@e9. ?BI?`>Kl X!% ELl;^k(3r/lIՆyզ/R^u_@8uǪc4VJ(){7\BU:e an:;O{KYêYӳM8m+( RX/DoVzoXC7Y~c# |^$`09yqSJʕ)ΫD(5 Q~o+5a!^ыvE^k(gnW+v XűRNPJ߭KyUW}\\$ 7 ҏځn,cPՒ^WPYFqAKtPn0y. =b*Q$L8 +<X/^T|5zneCdF ':k|y8:Qw/w[2<7,a nXo\]u-M;IuBߵmjkm횫(!WYDeTH `M+")3,RaB=cG֔;8+HjRׂ^_HMn< + :g@v Bg'JyW,Tƪ܃\\~BJTҘ xemTo<~Q9oLj4Ȼ8n{ υ"o%l)mI<X"Xў;7&B/\*-+ϰ=m_i. K;J_ pYXV$N$PZ%JEimN`&+)-Ɉv#OӔ\݀WFi_qU w~W-J~O!)-(jQ ӱ:aX\O :n 똃ux:Ȧmбw~AB:Pg7B.::7wjnSb{7B!,}W,(AX #(uޡeq=%DP5-iI"RFtSqyx+5 \õ5$n;͜n+NE~ca]:[ͭŇ޵wW}ƞ|A7nkZ X|j)Ծml6k׮]ε ԥ<}/opܰ- mݖI0vVmۗKmN+cZە_5 lՆyt6s8gwpK+kc+]~ P,\'x俕~!T`-/mz;!@6d݉x J3I5(U= U+!f1V*y6:[O@V|YWVQXQ" {z<8X#7?dܪU)Xa)ǵ`5+M6ne.ïZ<9a ˱/Qs)b}&-*\5)oP&$$1,a ˑ/ ,p e"?$iz2IIN,,pO*x?ӕZhśiY' Ge#V')ȝbV b U 0tyZ$;XxRiTu%_.lO?yIQ)g#Eݛwg{Ԋz+YWz>OCmqJݵxA"yp>|}WƵ%a=1`퉪X I.K mY6T5[M?֮S3Q {;Vk Zn+\{B]*X`- Z+X-_5RZ/WAw*P;/A.$AӢQUu Y l%,Wa&JAUjoidVFy#(pvX6K@\:FqEuVFe/@. TyJiȫ =txJZ!iLĒ[0kk@.L_ 8pSq5D3V:뼗J[Il4 nX/#,*H͟ +uQ}:X-P~}opܰY, PnEVXcq΄uz\_[|fn;XO["h|NySzE;cfJQx Ӯ=Oo"bXX8~{ >LLB \\ҫXs(4-,V+y/,%Է13sMn{Da963'vmpՇ(*E53O‚wBXW1WPz uC7u㺌8в]{5;uJZӢd {/-f,{$%^wz<ϽG"wc1|mx۸g9ϭu+ ʋi}.sTN7xˎcZ4xmikJ]'(Zh?)n7k{^?Sw[p jOS'W%]a KXr\`,N TDIbG#0DOD N0IfD AU rDE<̥]@ӁV76 >"A~,H E$$<#>7F% xN?x C2,T_SSM0D! KXN̞P.\ M}r a KX’tZ$!^^o$q 4POZE'hKL;$^Q#+] +aY9EU̱J׫ |MEx`NCRLiȆ أ ,X#3vS0x% ^F, 9AY EXvAS$?X ?|qڒxuDGkb$sΉWG=טku"\H_{oXZbmuv3P  x !!P:G믭_mḱ`ûv/[4V,k=kOKͨEsxr#^|-kTظ so}]=}mtQ"y$޾{!9W+GX>CEƽZ9/  5k*b_li=e@xǽ=߼FVx*e{3bxjOoB,>kOc|6Y p"M:1Sz2s&]4 np i-=zX6{?U*v2FX wM\+!q.,ۯ-[|}?u :viTUK+j_} I`VgD/%*&>pW+?%q .y V,͒b9 y#J p=d%" A,S,GZO~.|6{N]⃫ߣ|O|тrCd(&mlp ಍ryfJ0,a KXr\:Ōґ0+imz:}J۫}wItIyO =RuD/%К&@ K@S%%9CUbW0QQU~(IQn9RR[dڲGV'`@%L+pnόRz͂ :Ǜt>]YHg-"OϽ-ULaC90QF\;05CA/aϣPǤ Y> A.MrO'6HD@?ԫF񫍮3 e&8 8ݚ꽋Əa]poMR٦zԿMMv*#]ڐO_oۯSP&Ae@ IYD __,hl*-c% 'zV\Z<"g{sHv8Jpv[|&miq9ڴb$ yp>ob:p=xܓO9gw{}3i<:qit5-X{&.ޕhWe., i~mcu\oҢoW(唫y=xf^`gdH=3b^}bo, ^}%_+Zj*C0v&eoQ nP:eup[/xum+e?Vۖ z^[q_{x3O/ _y5SR D\r>6'MPW;V,X8DǮľ#fE\bRyNwr]8ÎEc"ˌ%-=ܸk&wJ*@*gy@N"a Kp%,z@D&MSL`1{NÔ.Դ{IQ^fJo l࠱?_~C&T6:N@DCm8=~:u2Jߢ3@A4qGI(ksq:Im՟#RGLҍ" +(!~G_ ٔ,CD ">mR: vtv86 |Pf]2| m`; kUCXa*QJIA֤FugIaNu:6%.zRkm oz:!xѕ65JqLQ۴fwpݓts្|}%-t˼;w>W|}C;a{_|q+?[x RəӮ/o /N=5]J_v]i~U(^WzF|Ak7j_>3[ھgM=UJiԨS7X1_vqgJ>H"qjr^[馛J~uԯ~MŽ+Wk^}k:/L5FAt2GJH Ua4amOo!q^iu6V|]v=[x|z\;kܬ}Ԩ5hTՏkŰ׵ZkOmbX8ߛV[wpW= kYSq +_@wzn~+V瞮{ A֬YX6۬ZXM׀/g(ƢĢVlױ5kT&us ʦ>X+7(PBxiCqM 7)#C7,a KXr.I*J4uJ:vߝ }GY݆%VFtxeRSA{ hLԨ-I5-伏gھ2ASm,sN' x~m"y9_`u;3vJU;_EJb+Fֻ ^yߐ o,+K.ĭE^z<}'֭W=׸toҽ.W߫C$“:j}#A< p?z%=+[<QMQ`m=s*N^-Pr xb18ʹ(nLq5,qNmKb(11cN֪q}z:Pרmu/F>᳜%K Nkww%z:t(,zUL6j?ol*U-o%X׋G\}܋ۭ綬W^Tg/60ŻxR(ѢPgXWwK;E,CO]uںҀ  * MuXt=eTsp|p PY!QP@],"6|+ ;\ޣgr^lII6 }JV&q*6 QAbrG =`.pE37G؟A\1Gż}^T@s_g{; (l ~̤&Bkb)*|͈cQx΅['Ou]Xe+W7k0Oܰ%a KX*?-к #X@^)e(.}:($$RN׏C%Iu~Mi3P$ 8G (JNSf W(:Ɋ1.6SlePz ,03&SfXcq5Iwb6mR92P`0K1D}Uhn8~&*q\6]{^4NJqZiБ5)ovr,T@@p&ܕI^/ܵ c.Te+% _슟آɢ`YUWep`knʡyB\Iɩsζ /v/n)^/y6/MK_q`XA5k t>X0ײ%*i四+8?<" ? |5;0W.~uRqKܵ8+K.8eƀ<p;9c ]^7 $&(v]bxV pG,,뢨wꅊ#ɇ*Fms!qb8D$\΋OLEzMgri Bӌ7|s\b",l+˚xެ 3}! KXB%,a9~C*]E2C7VBBC\++"> Tci7V<ʯ H $g{%{9\*Q>1+@DOR`t[lfu7:{U&GktݪUTDCz=__ :K" ł%T]@Hpu-kI^YD5 vʳ]DGxORVboY^V>.VEÇ:*J\|W6G TʲﮉBn< Y-\m- 8iΣpi3^Գx0bxQ29^~_o~"oڿ[CUk<}t<[;s597[SV_AkzrZXB/5u4 8da7VE_x{gϾWO?]}ômVT)k޼wo0pYtg^cfiU?0SqXYzEER[F"np&x-4f#xj; P\7aG,!M : 1ib{R_Q׃<˫/0xGǘbz4/z?H|LJk&Xd! wJ}AΊqzXGFMD߅ nXBܰ%,a\wg:t)PBIL=VRk%j BEXpidDx$j;w%M 0uXI<9K" S@1Z0]vG0R8?l_BuuU:/rƱ@~LBpI=@NQTg(9I@ <2D8oʼn pO.>p`GN4>Yp [ PeL%CZQ#u΍#=<îq*.G*꼑ޯ{-^VP֧=.xy=Svт44SܙtNվ 7cƌ1UZ̍=v)`ezs}j8Xd7:95s*~ad<˜1JGI+{)R%AJ*ՙ!P[E^}葼v]yڥ]cO?=⪬vc,o{RRVyEW޵#w ժ[L=)` b12@,`,xѽ(GnQtla.r: j着b%si\E:XXn:򺇷~U: Q++_΍x:C2#0cNJ d |\p=0]pLtM`s,:8Nnȧ{\@G3v p[]d+DCT&mu F87yŊ ay3e<>p{ `2[ZKu~Ժ[Cm[v3<TڷbsL :o,p`K`Jm7QJߩߦ N?xalLkTRyu_&'<7B1 ɈA1IN[e`TbLǍpf;{\ \# ':EaQ'@%Tx*x3,bXjdC- 1^Xelsi|7NR\,xY@ױSO=U@u3tS0I߉:&!irwt_K/̽n3<(T9+V1Yo->ih{TŲyK8H D u;hBmzonׯ>=jϑP.uylC)/8{ pS+5㎓<"">r={dy-y疤T%y?H\b52߭ߡaIapO1]On$%B7,a KXr|KZStUQ6[``ޯԁA<dm^Fj1ULWIou: xLڻ/Z ޸!NBb PTƨ,Fq& .Ԡ%J㵢jMu+"P]ཊi5w0@;wɋzljp~}o,uvE˰O@Etj(pkO=t};ε.X.Ĭz0jpv 'U=;K u3P3GLyAǫ.sӁE u]<1^bH1c"S5x҄bTٯM,5>3Bk .8-[E+MPP7``&A$޽_G Ձ_=IxԪ[8ݪskIZK U/SN(WUKq;\sCv_Q7&?Py#X`{8sNJ-ԒV  pwgM[u7g͚u^'|757ϘޢOw, h5t}j} gjW2i0~9_ </9X2y.cbE>˵IG+ȹ 1EuN-P2cs]6]mBp%,a ? 0&d|գ<ӺZ$A}$sR&dב?~dDty9J$JSE(PתFRSVCmSuGH}%ݮ$jW:OkA"VG!{7st=#-\9u!@D3rJ8&;S |6tHO4 Tܷ|_qVkrwk" H(UӦXK-2E[M팆\yG9۹9#OߌI'*Mobs _2Ġ $%ߊPH5=bύ::ʆ*^H@rO~7QSLt b1l+h9kǺoWyS%u*h-VcRSwcڿTs :l5RgݐVo_ 8/Zt2Bt򱶿R+bM3LVt:@v~aVZYhGqKA_}/-[jnu:fI*-:>K}tR@%+3KvNIw»n P^,u6Vp&[?p[!_5oVmd-^=]sIvr@\ Y8ۺ;xz&b 4 Xح3wEpˈʝDQ> /$ rʻ赒ʽRj{Ie'_æH\37/+[ױ"^͊`?#  \%,! KX'WKM]QJIIiLGR4[D\' /y!  \KCZ@+ 4> d@=:O^.Q *Vh'íʴ/*Sy~ 𤷠E} \Pk&[_YıQky 7bx?k?qDz9r=.|>x=ܩtlzkR[ qi\c"M W;7nA{msw:&#Xs#H'S[N̴`A82u @bDQg(JXe`*;:OLFLp$U 6@".g`gA&Ny[Wϛ5O$mW1Q⦵FceT˓ ]O˧Ylځ .Liz쯜f5|Mb(>>.ǍΡs)܈/9qjs]bF#]ȃ)GьiVG?Z #}3S9Vȵ'a Kp%, %r`ܪyTo*ٻQk{' eH>'1$ %IL^LU&)H-UiZ$aJR2Vz^pFMA~P 7WI2ᬨnIiSX{4{E`Av7X%0-$J=,K%?xLgGOcxup '2%PsO"܁롎[EO5]KR-ѱfs=P:>\Np[ bQJj~6yN P٦C,]^C VsK&?T;4Trpc\G KܷzXݣVH(Ql p5"ZH&" `/bbxվJ|7{1koKVoRxJIY66ͯ{_ozbZm%X3KfKEj6 gM (kY{ſA Л~㽲v2Vv|n= SMJzUuzZ,nTgΧib3x"7iY`u8"ˌwD6WW+ b5P磪V~UOlM{cѱXql*s~ݣOG4i?n!!UJ>izeǃjQɥPUmPA Z\0jeK=҅'/yyۃ8g[:3,;t-;rNT! KXB%,a9NTI+H4 T" VP'RO])0POWrWd$X pEHLY u׼WR/pRh\2* >6}kuoJг~oݍJJO5 T@_j2rk>OۍvQv ޥR.u\.'r]j,!{UFřR_p}[kn48]Khop$=nӥOoۄÜ@,y/b&A{8l ~۴~&l9ZdmN1^w,W+p;JSL렘ZSyXА`,<{y+ȐpʛQ@m6 cusIj`UBY;v8UvuΝ;[y]pb`Q8``v)6 >)F Z=,ܰ%a KXRg%NH%~YeըoSu*i}#<E:oYd+, *uH)vڹOUsyIIIz4_Avj_e2 PV@S"S. Kg$fXjGt*F{$npM"YB5qLm^|.)AZwDk}OI=pBU*@^= /f.zE&-KXX nvl( .s>+&Or_tTh=칝 A#oGOJ5R4ӵC%gPBi+zFIu=" ?uLpT.8[=7[ZJ ;ןvut;y@Ž G' y8W3;7k # p- ڗ-6){mׯ>рEfD;(YpM`~T-S,֮A}[;c{H$N."Gnj Zʩ* (S Oȑ#>YJ ba`dlqkgÂi@ jc>}sݟn+~wZgP7k@X ȷ}Ze?;Co@__ws@P\A3G Eu))*\9^Tպ=MZԳ&M Y:2hXwnI)znC 6mY]*W=(?' !ȃ3bt1FЗq`#`NsﺙX ГS#^R{fh{4  *}ь=:WT%]gGSܰ%a KX2]0Ik~H0IQ_E \w% H5zt*J7, !T3ʗ/#`rX !'AR%h7 PRE\ԫjtW5d%:JcAJR]SXX+pDm/:&OŸKJ8/Js>}jK&%ҹY|ߒV ]2[!czvw*A˥;HF #hxAY,~_(qAd1>q2NIk@՟d0bRfQJ+T'&r3}g+\ j|[sܩNRUW:JءZe 0As XS Mo:-OֱNTI]*ݺ:VƼGQS)ֽ%qEö:-d涗8B]i<$ڹXb q *^D|܊-؎cjmɀQ_ѣ-\&ÑM[1%1؊m];{Q?c(w=VAawެ:'|T/i3dNd=?^+ap|xe")sh쵢JNM@-pM_8}TetJ^zRw%lKFQqg 75й~b[|5nVbW8>hK`'rGzhe2Pmqm ni' ;M?9ȺDJ*qRQ7okoz{79*l][Q4]*OfxxC{gcQ87x ʫnR{" Qb$3#HGs:`={b,Vm A;]<9O<=!gp%,a ? .'ՓFIDo+;L&a'CaUcйޡio9 %9,8^a 'RpQϒ~S?ӷGU, ꈻ] &f@bQH\`S\#yx~pQ>H1{:m#7.ၛYH>e깟Pp:MjCQtϋsga4|6u--W4[_{z!`݂xpM‘ґݺìI[{ĝ'K\-؞4ZZ4m׃ݢq\ne]-i[` ڢk‚n:)%}U V|3,}w"!@U\J4\ҽ ;Ph?)UijeW[&ݏw)> bU#,#TY7uDoQxSpAL􏾢0J @4(n:JܥS!XKp7e;>}ŏQwhe$n-il@ qHpZ{=M]M 18{.l p/ @YA  }NF}ul}]`Q3҂:EϵʹjT *W`%˾nO=[=pf+-S拤Ogu]rv͵,-GYWrK VsS(bʾa]fƁ5~tp+` Fm6| $pvXE9ܥG;hVzS 2Pv(X:_ߍO;_ேi7@]%ђE̸&bRܔ($ 2_ܐ8xҀˠ;JAr'TW)9ر?=Z%,! KXPXC@}cJL%VyޓItH\ ( 6 $}dS(P/%I$ q MU?^h:uIde˕if';8T=@>)xE_4,MrñD2ezbT B\W\Q筿P:xD6NyDba: 7 q|)uMn_s ϟ'ǧF?6ӑxpWLhMk\^?,yiRiɪ[_+M`Ѵ`Ѵ7@w)Ų.3[l*K#I[P wj烷߲x ?U~,[eJ;I?+Vnܠ$wTWWB^x|_ 6TW+O,8Kl'0/蔫 xMDeڰ_[tO3"U %M j||1# $rk?@4}($R X%tET``2Ӏ(l;oTt;P2ǠZJx5䑘O[ޢDC( :]H1]zsjVe"\W]RƢ⋋.08?.={g߻* : 2=}}c6Y 2]'TI;""`iO1gx@8hP^z5k3?>my^yi.E*TJV.&$Y;c)P zc ܹ-~~3;c#gx&B檟 H@**l[đ Te9?Y>POi GI>fӹ3G4՞oG,uhY 2@$A1:>}!{,&ogG\Q%-XW{?pԜQ6=3'|bۺ}#9dy6w_}IZR,}|ѱzO72gi*Jk7z?bl[%@;3PȊ[H- k;70-|t]t}kgkڵ 08pW~2j'a&h iܤrk9d/  ?fc~aDvi +ER, &)4TC"wx;KLF?kr݇ Tg?)@1P f!& s|c4]gX?iJ?Kq`&Ub1 2}9>8nû)?9>@Hٰ_bN&65Q F1 V0d}H')\kG))\p\7777 ҁ3e`MЋ"iTAA+0`#820'Hf?0((r ӡ1i8Qn@p@8aL|؀9>mGBP]JYξSLV]6wEhuW &`h>p[l 0NIB8Ǖ.#3矰GnR$Fx~} ke$ 8Z?Ml@;&%-/v7aZb!-Oo/H<B]+mktawn=Y&@'_=}Dڵ0csrA7^^}Im"ԠA[(cKW~P@PFEVS'4?~QouGhW=W_ cRv9?e-.p 6hྪ4s&=8)ze]T SѲ4} R ?`<xbuS{al鳸)dIHLdH E* -{M5ֽD}gI3ľ-mv|җҏЇзLGeIz3k{&d? I3׌uK>Lַo? q2 w_ӴLD57ODeYS (dj,*RpTÒMC,TsE]r˄)8p-At}%PYO \2G.Xة8y\   Lw1qgdJEo)G;E㚸I_@@\9&'1})đ&Hcl*o@܁?Bc?k?C?LO,L+`-}.&97[0qr"g=?#D ?F;\77pܶ3t$o(Kv'mɠ h@&:+ .:'I'%ʹ} 䥿e ' #A;ER#_R縼0`X'i ;9 0'g{/B&q$C\k|߄kkri?iHhq_)^!:\+,'7نLZ؟gN3y4c͙i&@-Y[c]~/Ala [sN=%4RJ˅Rŋ < 0PI-9z8a>֡Cww /=hKxkg}6X@XGcù2/˓s,,7ZV[ބZH+m =#*Xf ߔ>j~a?;d0L_ŽIuw@{-֬'+wG9FVmb]Iv|TB v/k_Y_|֗J[ T46u|\`mh`7]O $($MဗsLS4f-@+OvP2Us) _ %JVmst}(cl_ZnZxv?+wIy2NMbgy[f񶔼C"صMdRx` X?El f5{6/8-kc/gg'&bLJ;X7%6er>O=tNLƵ`KRC"{wmH#RC حsXt֭kAznnnnn;MZ fuUXX 1z 'pAPH|N``< Ӷh7 %+$U`.n ^mXj A{&> 9`ڸv{mkP9k@a9$אc&Ο m,T:0HN6気K8瑵}sywywm?LP+<J1zg6ъ=abf ;R>;{E{k%F2gp|_򡈀UkK 7o(.0j G>/?^{MR HV Xt 4~9OCE2 \ rN|2tNX~lenE*Dϟ4L:-2X>{>9&kR}gvKRB_Jےm,r}7f0X#FΝ~VON&rz><OmWp7_ھK:+%0ǮCлZ0f0]ڹ}GMjlW|^lpOۍ{yۋBsN۷a~ԑ%C~\on@C-j֮NR Z{n5v1; 0riXtR.`6˗s gt}n\7,!Hd~؄~}''?ƌⅴ-v1M$,w^L¶eJvR_Xc&8u:OLr*c\77pvwwcgyMY}GXNꀗ94_/:PTP0_>+m{1i*?Pjpqdž7 7\~YV,㏅w>{0^s4S73eo+ 0=f*!~{IJtL@_3cjN;&iŀ0Mf/=?vIxmZ̀_d-3]AEb>O.npfgۑ*eJB d>Cie5ܨ ]{׍'/=~$F8LEx/C2eÊ+A#=^UtXBZh)@ē+W0x)JժU*UXqH@^QRZZe-Q\W_5^, Fօv%Is=wf޼y)R$c~O;֪U'p;;SCˌ xEqKK~[Rhg5t⒂Dh>C_լY3:c CN@lpWV)&e†̪*u9_|f_/Vs'wU]vWOlp\QJ(SIr^plɒb׫|RՅ:t`؀ _ [XLؤ6b+ 5SWt[Ms1wl7sZ:CЫG U\>pɍUf(Dp!¾"/ Є` Va?=N?ҿ|'>Ҡm۞ӵks/r?s Nzch¸% ]ݞ={m \sM ~ꩧl{X͛77^^]#*W1IO ԊQ|Rhyv]h~3I L`{hܸ:tYg\ussaIh̑-q@_ \ QR0sԩSԺuH:gġ`w`۾ƺQ`i, 4U/93ӊ=%zKU f,bk}.(=yC;sE}Wt^;p%a$ .ʨyƴEp%Mw>v ei:OtlѳD+v^"O0˖.gՋMXBg:Ϊ[A%?MM7%@6ؾi~l;w0ma/—c>2зwgt?_h}f'cThUZ~M;`pZwc30B`'= `+A)՗IclٲG¬``Z")s6S&#`(.UTC3 8.O>ÚQRRT ϢZ-"`%LXb$\aB)&ϟo$b lƀ:H%n:h[n{H5 L*cвw޶ #1[5tb\wy, Mj2ູ9?͛gƌc ֈn5~E:t0 ,mzgۄH7t=R@jZԜ9V1.K.2 g0mqmȫ( ]Q*cԶI {Z-ZT`얥g(@/Rrqݺ\m(£ $Q=W^60vCRٮwa.oo`bĮ]Ѯ IQD/v)&]pnົH1|[R_/ ؖ hLB?~!ꪫL@`m$oA1m UO]kx|Tz :蠃4,_^ GA1~aK(XMLh:L Z~@ ކ>hCe<5\|ycnLg702@J "Bg0l%.'NLاV (&`KVd+]}c=IZ€_-b7b6132XF0SIaIXbp?V9GMzeD/\77p5F XqnTm&g `nlU@[R&,{a}&HM6X ט@yݺuȑ#-wGm hl d6s瞩߽H{7{ \'m2I1Hq?A`Lf_t ^/Hb!(}+ flNݞ^{%N2dp'Xd W^ѻ͘7ۊwVlpW"QzX)us}Q8 llԨ:2L|$nNƄ69 GD2b&aIJ=?b lٲ#t#x#=,՗$[b=W1ѯll]b؃"'a Pf9Q&h?Nh=I,qW۪m)&@qo[J3gǐ"$%c%bm$kXRUXq` HN6@0t&E} xo/{U΀fߤ 6鷈9izjk@(pgkL\KƘnnູ9-ld ЦI fRMtH#j MMX͘cq Xl?,r]ը @65XWW፼ jb؞ӭoF] .`Xb/8 . xv_Fhw x9Cb[w%+%ZU@^@ǎP}R  (h($FO!/94;⇗8,,jI z ׊uw\w"RMfX%A={E 0q̤olU@Fث 0:F@pXbb11L`Vm2)m /ZR ))(ኃ@t<KwՕbziReI ؇eK%HX,@uŚH_>xn9ߨFňHJN7ۈ8d>p*v2 H&zĊ;c@DjD<H KLɾb`"[b#1Y5 ޳XH%k5mלqLYd=1;1nnnnF0h*&ǑF֑ DHkcB` !a0!0V\,X\@`mHCz 50V %+QY2iҤ|6S\B,{ }HwVXkԖ5~ƌtͩXZ@[شZ;_|uS޿5غFVZ @Uo @@w؋j)߇"H:kV1U,X`W>LO>6欃9{ܭ@ ,a1vN6uVu2(VsB@Ҋ LL5jbReSŊ_c8Ĭ)L/u*ב8F"Đ?yHm^>}@t8 6~첌]aູ*Wp HV:)LV][һ(JH CT@1Y,1K\Hc&X`3\DG]\YAqe1*[Ab ,^Q~ZڻFAsz2@Msd*4~1 (mKL*7W B`Yjr$@DgF$J4`WPZ)pu  *3А nФI7- +f@y.ɳ eOL=b$`PF)\2З] ˤ8S2*u.&=(֤M#=SJbÀl~` 1X0+j6W bQ9F1(&99`&۲:1L_&ߓe-( :K%}~EhA]S%UY :תT'ĦKʹ#Cn'ǀg(A1*UA ?S[ ;L*u$e0( .'7e`=('iĒ'fG=(Gk0rDU;+qcD2;v,)oT`BpJ"i A \ot,Za?3^yϲ-پϪVw!LYD}{8ܽt0aw<;_?NswnÚ9agoH8`;xI"8gB|J nIq`?|e@D|0{qx⺊shhv@V=Ń } H!@f-ubЧh,tՎ:L=LDR]ZXXMDjg~%'Ck-bBڧnV"'uf"`c9;9/1fS/킴-5pussssn ^S;W+iR0JZ++p?=f0E)sSM=Qin EtҲ5Cgql·ZCL {*)jomZ^BmeԶ2 ʭa#@ ,#61d;zhQӦU#eڐ*@|wp3^m } ?2/cO2o'Ѱ7m\s<gankXL;d~O2$ʨp {ݤ8&{*՞bvW!afH Cgl*FE 1\Y@9f QNРnpwU+WW/=˝]"ECcBkI!\ ŀ(XP*Ł?hR.ղY~2LfALKز+t@ݠX$]qXbZb[b\SCac$K4a/DY Ez.!Xl,dbe;Cr^,KZƹqc~{j/\E|nnnnnԤujGI˴raA7JSWU*hmT5f(Ū̀._$ V*Ju$]t.bޫMFm35H/64o@(c dM+3GS@ٟ|ٹ\sPt1[yȩ Dڞ"pxHWuoV*kJKI׵zSߜcgwS隤kݷ{S5}瞻_=iR]+`qjotr+))i JHwc{+8{V zj3 G*\+@vJ)[+HYzk~^(i@=A|D러3ULL_u =E{+'# G+m3Ι]\M9.q>P~taNj5{9YMů"*@ +\K:4X96$BgJ[LI.̷my7hID(eb2i0mo9jZ,ՊcDxV؞ҧ}V-&mxK 0VAXiu)XY5-(XH௽&Dr}X&@8(cXK]?i [q3f ]Fm8} zk(;vl$b_777 @\X:97wJl}liU=E` 2OzjTb`sXz%8cV5k5ݤZRm7Ê~1 @_(E #ԑk |:L VhbAJ "f Fƍˬ 1;/j߾ho^zo sy#t =Am8Aف'3`Ch=4`%`"],U3gV;wr/3# {Q|ڵ3ãe˖9TQ%7",6Up˖--e¾XU013N?oC kÜ L6᾽R#/p!sK ڵeCS`M̬Yɘ,K 2@re9k1o#Bq„.$"40v)v2sيb>!@2{!ปd ]/@*Ch! 2rdB8Aցzȴi,a4k1UV3ڶmAi|ZY|Vn1Ck9Lr8ۀF܄| Ē%,ێܶŤ XsFFܶʘAGꫯ,S\^'`,Tf rAe+GZĬvprvC4_uSI]tɷt|w]6kM1K_RpdA2sE'X`r,XX 'pI]^u\ .7$;*L2Pwssssssssss۴]jU$҅ـ*X\w[ AB]d46m,ko,fṉ"`rAYw k6,ȡi`d[>)Ċͧ?/ܶLG;h ȣ<#Ǝ_dlq?`0+kW_s^d ɰbƒƌ) ?\AO4D@j:.M%f^_ رm VGkmGn{Ҟ>l H,IāI6={uh:f+VbZJI="Rf+Z3{3h> 3O'6 XwEz x/r PS :Ԥ( ( 9Xh|%sNXZqÆ XcŊv x0zNsVB'Y86ΑҳX@b ZDT.i޼:ϳP-Rl--R̲;>Xcr.Bߪc@E:qE ˟&^oS }ci㏢msX2[k d`3F"p^&G0m6['$$`!9@c `9C0Wu'H5VG,W1cQ Іb$"Ck5fX,mi޼yV m7i+J2a"HѢER0[_$ MM}L|ﲾfΑCCC!"Ё%`9tnnnnnnnnnnnn̙-ZȪ¶Ua$`YXw0ْH.0(AP 60Ro ZnKME*~fa/Pr.v2ua*SxdNl&Q<1&o8El߭1timS$b@[cH@h$GY *&ZN4}va# afGr)&{!ň$җv"STe6V_|M:52e_`7777777777$`k#F0 7]ޚ.@0ZE0V]g˶ c+iZ!/l^bd#rjPj-N~ dZOs)^(q:;ΝkLW2wA otwa ~IpS&Nhd@c'0hH @v&ST0IR(r]ov;27L\+h!($"`3$XcKmgp|%bE!'p X͈R@@υZgEaR&>-ںHƺ>dbh7gfs,e[2om+9f[oe,z݀dj ڭmP׈|,ni;$f,򞵝 eφvsssssssssssssssss˥<VڵkQI1}HME܃4kq;P=--CI YI^YF+Y%6o[ E6_XH%eh>Xw9 zDTRع 2Y|)ШŠ#_} 6[.]A#bb8z#u%.W}][/~m{#ɔw+9%+Ykd$a& 8 uYMޫ~b>$Il$ 1 8) \\+viy-o!7:Դi F_TһZoK/!"7777777777777777777\f: b&۔b7cSYWÊ؎ԌBZxi.k pT_ 8XN.LX{b.PqlŔ *0\aL2 #nv<>qv\C m1ku#?#_|AuEGkd[. ]uUVpPbUs=ӀMhܸ1@kL}XzuL]1yߺ+Mfo lO  XH.4*QWPfg}\ʕ+/b9mR=PcnA6CϒGUm*P_k?~|FztPb>}=v ]څ`5nnnnnnnnnnnnnnnnnnnIرcMN W)#Дe}ifv8˔)tm ,Z-xeH"bXQGefpѺEW|'lx/=Y2^-Ñ9@nAWY¼4BT{8Jk,aw[I&s&ԍ$ 7[n Ĭt~ywhޯ"cwyIkJwۏGŢ60bw9S)2peI|W}ePc1?x3XWk Eb1إ^j`[:B%\2iX 1t++Vѱ#ؾo׮]4uT)r=*?zꩧGfͲ 涕͋>Ө[nK/M<W- +*%K~8X$Yw ZΝ[d "iF{W԰aCb&R]`VP!G]kѢœÄ {aŘ6,XdTlm\4nڵk}PWm)&هXl[~6B>cv {9>CbIູ`r…j&իWԥK_ PQD}'DYg٢W_5u?cnnnnnnnnn#M7|@,v W3룏> I0޽{4rHéH 77e$߷=MR@e )'P$ ,$N>ۿJ\}'H6O<#N:X^P 9)ȬMg=In$ [9z5Fa+8Hw0Cr (v뤔DC/;斛mժU֙|gF>}},L>V:@,`7etSڷooHK4X3+4dcd=/XYgr^Iy6lm (aT)bJ%5Vfm{b3l0v\Fb\˻iY_R=`u 5)4u}n lXK"}>!O9 믿,&`Z$m۶mD*}hCF˖-c*V@n:s1ube]u5ׯ_tw]_itч~5 pv{}W;777777777jĕgώFa1c=faa>"ůO>Ū*c鶊:bƪWXрÇ[̫Fbc.q*QjLM]T+x2777aɹO<f+Jσ^xB : nوطY~h.Lz[Xa4=ԶV;ϛoviV/334C$=[bE{cm5Xk{vs-3NꐭsMN,Hefzz(P}A4 bԔeddTPǷ7 3=UbLG`#(TDTѱhY" h`ë[%F+S-}1C( àALS i77777777]`"E`aK%"_wu~&S_Z*Yd ~FTݻwԱcG+CY\HaK5X8[!; F̬4o!(,YLWPirx{ Ѽ$yyA~lٲC }Gb6Ȓ3Zxnnn; .-ψkYa0F)@UϗLLAhZW뮳 \x %&ؖyQ뾱NY<71ͺz61f.G-6ml[МKM:*&} ߢsG)J?7=)A$˩XdI%=P7 uX~ΰ:몂c]1/Օik .0^:SRjH\i.\t4`a~u^Ɛ4f=!L0όvssssssssq | VaL!Y[3S 0- UlM#}>36&}QtFh6M:V@tڊW X Ű;'T ؃[LL5NbiRV)`6]@lC9lWpERɄЫ= 1Y'| a<DZ{tPг6gFL0yc!#. W23t]oـ0X&5u/ĂqA.ŲdZf͚EbZ2y,-Ϸt3%6f\6Lv`DnnnD7<f_GCeG4AM7N }:i[,UT,ƈ;VX-U:IԹ>h aP8I=jҥΏ(u鉙A8+ q,@9",[ze9 \=oF!I9@ G0$!Yuy7O5&Ql$yHz 1\I֚dڳ/&UeyJƉQ'E״txF܂6J2.3n^kdDk8vs%JT|UdzX7w lfѢEV dGD ŘG (!0־kVLAv1uEiAu`Kamfz(^if֨\ݯ@gXvLH0 u"l DZ 5Kt-6E miӦv%߇ꉤͲ!!3ڨ#O+F عXƖǀ uFw^zl pKXUÙ>o: :rWL+3xR_,$;dwm1˗/[wCxyϫĊzW1z 4i@|Šo2Ŕ=&@FR[Q|V b*=,nݺ=*S-ō5/u|?Λ3l_J50ԉ`, Unt. uW8pb4JχA\zFϚZ`#sεd6&Jj_]3=%eqB[=c>n)k# K0}Lil6_o-=}'N&zWϟ% y@<7yV[I=z˅] THz^IwzmKiI̷4^X6mnnFmR4Xq]-lv3c, 4͞}RI&EӧOcuɂȔn,頠ԀPM:D: h0X47x I߿SSNj׈:k]:9Z6Sp(VuY(U-*uVH4{ՎNo'G' :kPQ`p1; _0#N ܡWL5-)h0[c LVg Ͼ})y(3}xz۫cŶFbƸ !5`UhON*(3Y3\Ryr*j"" PuPٞm'Ol*r=Z}>tsK8hx~R9#رcm}Dm{X?#@JEp 5[c:#qUgUViYajf ˋ( --V,dSGw@6b+MZQ W@M zqvن<ѵpj {i Gwut-kj{fJ,V4ufs9M3iii &PG^+?wi*UҪժVIW^=ZiUVȣ*WV};9jUZ-M}[UyjV?R^E*S^75[4N;S40Cc4Zv E#o8>{ x}E zҒ-eƈAwĄRrMf\~eJ/=n@"ooҸQ6W\ޱKNkudSNlZkwmzvSukQBC+(*+yhRe+)-_dKZRrGpY)zJiGUl7,KyG]~٥UsdD}00`U9u;FC=9sZ' t'j>UǛ*ތ,&EЂ%CB`"H'([BGpVϸ:ML!AYF"=),emYGޮer |%92 f;~sl"p3m}hYa$.Vu{j%%R)tf tfԙ1@Lvfm#mfYV4[|z[]nZ[Gש((ZhWPZ;:xЁ/o?y.RXSP19xMfVz1o =QߠI8 fzc#Q!VB1@Yĉsob=s}Oe[>D8tٴP/Sy CBj5Bu&zz-_W1ըj5ΟZGo?\mp]զʕnJ[ rsssssw$=ds1kN&&m{#h0p#  |<)9݄4Ԅ[~7WA]u #T+kӐwiҴa/쨉X ط0 ]&Cƣ]lhki°h~|.]K D &쩮fk`J\,_7npC n5K$a ` pp`X0bIWb+W46 Жm4 :nDp897W Nm:h7`31NQYn̠shrnY-U" L0npS9֦WP6+TP\A cyuUR^T:ۋ _`L91~A i !nvAj4Aގ;Ojr#%vr4Ԋ˦)'r:ȩk?ٯηtlv~)? +L ?L>6=3}pFÏ |?}?N˨rdpͷt=~خg>d]N>0eڌ1]G|aaܕUaaŸEkô%ÌB,if)ׅI&.Xc37=dl onкmpjC P-zppPa}l]1TCBuqO g}a,}Nχ o|82 tbۀ,e$Q}I0oRo 2ו52ǵFG)>ٷ a$ƐQEAʶ?@]8`M #c5a`Idd.ǡ{M K^fnn;`rs LS! p.`̀[Lռچ" e{\X$>YA7g=ݤ N-f:onLM X˱hn<U2s p sCaWe^f^!1׀Z^"ch&E PR7]f::Nِ΄7E_[H~qw@uaO4ќ."M8E&ЋIu ."X#Ux]G$Yzk.IܮpCmji֬Ҧ`椽e_#mAۯ =7|1iq5Gk*TEֹ9ީKgФQN;TKD5PԴIv0t=َF, 16* uB'W1 i bYԌ}x*|uَ/N 3M_l^rdwqjYNVd]Xm}lC{Әe hol7j@܀FլE{nD94y{qnIKF0[n_e_UՁKtNlg`.ж(.4zi8?pэؘX ݃F iFu}mDѷt~$vGN@uTj I7ܠPwX\u UGs\НlH*:XS@Xi,֭U@d}RH@o\߽Sx_Uo'VhlH'w](pwr ̱D<"H7 KgڽZ8F?(--]+*=}{*}Դxp0+ ">ht2ȆkXV1|CT6m@&x&M*Nr3xc8aźƈtw^ʙGVZFXr;3=;&=cl-o323sX 01a,^ /K6! 08bwd#fW8 ȳz9㚜*K*%Cy kM6!f50+bhC6%Lf85 !BBrƭ[5Mnn2bLh|#s1anNu~@:|O7@bx\ *|K,f&Uq'wغWV[jץX\tBE9K.!,e0[E7L_uNeWBLq7s^_ @^/ r7^j6'9L39 #Rl UM'B_p T4Shu"݁`GѻaIsCXث@Ҷ9[@*CSЎ8;Nqcҝ.vp&؛]p#I6*>\_֢ܽEӴUQ/5I ˜Ih p{ժUQR3vs:fe\L,#m?QDדA37p\]Ā%==Ws+S&Rhtp),)+V),&l"_g.v* ^~sx<\{ӝj=$]@UBbll KKN8-rck%]~?WS wj6v:v^ູ9)3̖* +Vz'0eHsY>P,]:0A1AcNA Ank,%P,Z(j 믿^"Z$h&Rm-Q7KǰpeyEa- [Xt^2aֈ׮]Y(ƌ~uV2{EӘ-}@ZMJ x90Ktoa,I8nX/;F4CP)!Bnv;7Bm{VM@TYޏ'?ѹ|ݵM}6HmcӒ0facH C8ׂ'E<]" D*<pugk<@qj#!Z&yM̴x0XɒMM \Xv_SJ@[Y^7:!T:P2!B*ܵf(vaV 邓k /pwc0, dlY# :co휱vO][۬:nnn;` Wn Ifi#a m+i'l5,JiH1 VĤ @U^[ l h dېH.&arXlmFRFHq{Qòղa*nU= 0 Yn=(J׊A[3XD/}  ikYaFe*1=#@M08@l5BU7Mwy,<\;"K^y)tQFBŊM7Jwu?|a b.6zg|'^t9LtpIٖ-ͱ'L_bgqK$"/@/U44v\wpi4g T2hIsvK6J<Od*ux զMBaZ7Fl84w51Tkzý]{KUP^PJZ?Kǹ˶y&L $a&!%g].USiCLVH-]kD5d{`E*7nw(~y%γ`:%(A͛Q`nt.l.յeC3+1U2FKIF.x .XH&HΜ9 K@3!4{ʀ mu_ޥ^J%-)<)6|d˰A(vj >#PAM >g@p;ﺫeusnjrk&OtϚaem\܆u']^Za[+ Aop0ĸe<XK?5w9v9ɤbG ;oDEt\DA_1Z(.-`ϻa!d27ksGydJ9]L%b'5 ^Kc:۬ _u#[6̕mٵ12Q˶M9ׁd)La Sp0)D)]%X#xo%C*TUsv28-ŤKu?s 5^uxEM{{ =EM"жL^ wg{G͝~CLb$)-V 4 xFsPVO+K&\Kpi޽I`MQ.aG5B4-= /?hR`ȳ>Ѥ&cBjYLLQc `d$i+^+XMH;SG7@mR5]y,7}IW?qeKw+Wr_4oF5t[h~C֯5Լޟ߃+ǫ{c`opUWʕ+lewH ,obQHکaX~!@o> O1NE+2nߣD٤ͦu9PVE}5ZI}ykG%S +_宓{s'}vQAy>KkRn?B_ے Ɇ7a SB0)LǕ5%Wˬ aMZb/pA:.&#r__q:Oo Jar']чQ R+/_'u,!)bC!)-8&D 299 >&c,;[|h) `{XΥ2^U lvΕ&]2XЏk`<ʖ/W6~!'u]^mS͗/y 9:A'=8 5/ Ol5om?^X: _&qv> x1<${0C OJ9r(Hۍer}L׺lA ϻ-/4jw f5K! "^݋qV! sC{$w+cQÂַѨ`e\`6YCQۦMl{>^L4fa^F ebܡg5j_%u[*5QD-]k;\b09"שrN]rmg:M;_u}NrCwcgq3o7kll6 5omd0)L! n PVNLnV@'&74(R8el;V 1&a^AylM=z,Y\z-o,7\uчUwnxn7_ƹ E݃5ػ/ƷwO 07Ǚb<ØR@ _=F˂іS߀bŊ>G4a3W#Zd8e-m49g1;XĖKht[ ?d2MerĶ@Yjʞ ǩ_pL$KHnK7SU_Yf-x߬e V"k}h4|@6! S)La:%+~mO&5@)-g+Xk 76c+ I|2|X()G[jݟ^A˖E>t9U[ SN}p. 3 $Z7ak]2‚BM w,d`v ~ꩻrZO (V@Q(eQN*Xj?̞i6 ۶kS'T_4uݷ2\u;7jrw@}ٲ{LRsw:upۻ}Eu+{+-a ]vXۉ 5+;"̋JNn vN&^R;,"1Ȫଶx\607HUc ~ZeS^eӥKW[0Z۴0MJW36; dbSv eϳ[;_:Ul5XShR\^I庂 8yirf6~aA]J2]#} bC0)L! ӟ7!t!d13ND?$ ɗ! |ـ'&PP&H^k5w~y_v>QVuJߍ;L*}g,]RZ!}r$E+HAPdc`/JYa`:Ν햎&)h7WָQ]{>l.S fϐV{e\dGvɛ'P~Z֨jʍ-5­4mj[6M&P[Bޝ! spPjmз&niiv!zl}/sJ;٤IR8%K\|Pͳ|.9sf['h'z 3h\l"*UhpΫ5 =csW:+܊9a S0i;01v)ODMv+揽?ybbD0 c…cGN&^2iRo@X xN&ler xʆTg?+ P]PS 8L\9`8yO @Hw {XTб{aQA 0ƒ2CuXIAR;{<|N})yv}>(';LyZ0H\d[oրWIB@Kؠg|MZfƍ׶k[GO>68# vM7W_M ڲfqO7+mXsףi 6c S:(;fejKXfl()^ȟ0.C??gIq=}r_hAhiCQK ,^.sY"#2 ʷ; 6P\О\E-P_W\q\|e9_ÇRGADz+Xv+Y0@`fd/袨"TH@Yhsϝ&;Y,#s~A?zxI`ӛԻLx2f[~GmoDG {q Uԣ qo46M} ,Dž7! SYj19a͉5CTۋ-ol[t=3n _ P2cBbŤ?`?z=bRd6)808&@?'l(PԒxeUFL~w,e˵.0>Zhay_?&K$!)S.ORW2yc=dɱL(Qm(;n %Q.&\-Y6Д93{e@*eid_|zE==KPp,?,k6[9/6 ol\r7P+eWD˻ iG wwvjA԰[HaWॗS s]w:|/4jc%2elɚ+gNS~PW\ǹrŊW^{r[ݮCܞ7H&G:۶w۲{7O۲؜S2~~=>-eH)gܭ{VZ}DeZD?Q$py~99) -3[e(Siӳ*{ckijgiy+zLjURn2}V D>)Ug3trS +u٠,>WRm(h}/QRv7ecpssx@RZI_$[^ XJ`/2ozHT֭-K/WJ;ϥ60g\o:oIj'pn8`|0C 57_^x5~]={wqO^Sp0Ie5xQpB1*x1y;G R6$W&z-,Yr(]LCAsMYnt9=s{s*~7lO/6n_lT<߻}lv{hx|-{VD/n <ϭ~~4Q^egrpn y%E#!k#~qCObmönn,-JY 8pl_mզp~M9C9s4P(c#Z{]no v/\YضC3I,k,j)-B! n I=ZHoo/5 v2̎@9)_F9+ga:,Z ~:] v:8ͽ[ˮR~'f|FH߼+ pJV&qw|`qe`e y򭥟|X%4Vz:Nexk?<LG7zJ7lbfus1`d_?{.ݬn脅n:f*7GbK3W/f9 yΟl{Y@k"Ț}bWtcgqn6 M:ޟleʹ|I! SGH5+٩?FN6N3:ҸiopÔ\"H.ۑĸx+E-`2K1ʡ]h!n`,-+E8 ))L{6OR'TёpJϼKK"_G E*kT ]]v{QI*+6Rf&WRAEy}긶~(+ TޭHLR#q={,p^jf#¤+YM#ޫ/v?;_*ف(Rx٤Qi:]jU-7ͫWsuڵq@b] m*] ,ѵ|Rr-}С)jh,NwD޽bԽ@^lYPՎA`8b0o{VB@ӏv/Mg (eRt]F=].3vo+IQWNת}C{@g7zn҉n9nօvHMC;hX/M[qMZ5]æ56-[;f,*x4Wq5WA7uΨc|6mhWaWQUHjf=5 SrVM5(Xi4 5oSOejըL`rlפe$\#xN=~*(|QhF,2 CYpaj"V3ҷymjV TT7#ۭP={VmW? ] C 7*ZkyfY=@n' YX" .EL,v Ns TBgUoW眫.~j|rufQ?r+S. DdB!"EB2jWIbw |uEՀ>z̗3|Gԓl[:4/coYE7_u5s7rewe*wj4quch7mSs?nFv~cYzJ쵂~ոg]㓂S}oWU=콴B\q3|r]S3VF!`kZ)>`"zo'.JP7ܳ{1lvnOFN[rs+Akcޯll> C0鯜үv85Nc5wЂtpÔdbQy<"8vYpD][/Of5&T}N 9b']MjdRE|L$}fN4 giQIL>gEe$dRk$| "j۶SQ3L"Q{Ftܗ5bu/j?Q2)R.%J\DT+4ꟑkLNCr7^%o}~uT ʫʊXx:~p G}z̼~'3(@܇/>z#<7Y{PoV#Ο(vINmX^]ӵY`k ]ecz: Z_K2ֵfۭIcS p 6mAY׽i)e N797@m恻q+Ϲg&} :vo7>+_ʽ.㮻ZK4yuYtwy{K䕺M{?20֮2Oe 6kUǵص5kV[kf.kj_L,I3Z:vnʩ*AUi=/^}ig񮹞` |}yZ3e= B qZI>F gϔ]eB qڳZ.pi{>D^@P %2@5̢RtT?pj iP6>Dm"BoՂ;+W8"ZL;=I"_ &椰u:-NjW\N]WHN~rѧ7m#ϊfxWv-糐1UP!'(c[`.6O7eyiyvEg:.tȔ@C`+jOn^u\&/>yޠ_eשlh`"GL]v x-[fSWQ (]`aXT7bfO[whe}Mp2?=+q)sym=~gu{N:ްb+ , Z\~>(a SDB\ļ`+,w-G0v*D+Yf MϸWc?v2.eLw(8q'0,p #Mܗ_ӟ1.Oba^Ev`)bMȌy7`#X&y.&&ePO13Cj%\>qO<(.줒NIn.nB5O1AfB*xEsyJNL4}L6ޤ#9LR:|긟^KDN]Mtm) ńhImz9 &Dzm1Lj5,*3G3jP?P=!>+Qd!,q{=dQ{:@\(OP5;)I4Wx. #JGD3M@ z?0Bu> ƚEEKn9W{\y|;Rg[::9u"yN=ֽתފ뻾Qy9Ԙ~eFe@@ p 7h:Z4zءSOpi*nވapMpW,u{tcϚv(8׊ۃX _la c''gn+q+d`y۰.{1wm1(-?=[e[b0tܗ;`{ m#2^{`օi+ܬɑݟ3rO<%3Bӆ lRT%;Gg#e/y V{lgd]I( V(eϋW<}N@R# 0,2`:sTÿ럢8MY~˛8cpW^%Zf T\M~Am:pA_=,D1Py9mܡjQ5kfYJmdIߙB"'%WƌqS|k3URRJ * q ͣ~$g,lȥ64کvy)`rkGeW0h ോ8Y0̀~KEN-P>>ݮ> p(Gj[~çiK$Obvws\'j .2YQr>+Q@j@,plLZɮV._r+צ׮`.rAJ  -)׉@گb@ ݢs?;Q/˵P#fҔܧc͉navmT^K>Uhb{D{Ի}B0řgøJDd بpQQb-dx\X0/^b̈= ֲ93kG,s+ _eN B8©7/sme-P;REq<) 1eq̟s%Dy5j>mb{14sj lx6Y˳klEԯ_?7A' dX;;)NcA=yH^_ $МGPĔa khle+ &H5iYa%(UN5;da,Z,8V8ܣ=EZs 1WeAd 4}̫yD CV:K`r* cep24Xi"}3[x'@1$1 X^Y4\,xsr_4d.eW}Ԣ{I*ܔ:&MGJ#WU:XSvοUT\' 1xcS/qs}k?[H51" j'{qe˸۵5/O6*]Z kӪ.FwX=o"%E=;n/]nM'k^qwuԈ\ҧdzONp.)3{"h=ſ ĉݮN4#mA\Ӏ{tw!8,4؅ȶy)f:}029eW\qŝ=~@m-RƝWkŀA6}mdVx7oW>)6@*m?;hS.mh/:. s*WvG?8h}uPGr,<4O)ǖ~O {yv-]eWw|v4ZA[k]p-?,jL]gyWJcf2P5j  ne$XhS\aaOv4/ax $'~|γ7L!}w= 'QC-Ae;os F<2w&46H5 ="ؙI1WvYh$5`ŀ/ * ^ >W%q{/g3L (+夼X&@ILi|:=dVfFqlecྜ7~P'')y+QW=G)< <+Ѐ{Խ0uKF6f2oNaeߘ o:wJ`M p)0ZZ\wf3n>͗zgU''/@ܶwe`y)j^@ѻ/`PN7 ֫k-}}gw>fH/YiRy.2_,x3+++,`2͓j\n[xIj#IpmJ ,eGYD=='v'>y Wc%^o/+A2Awm:K0B KQLsjՂYW,Wb0 븃@\mr h#l0ڪnPWi@:^EkV1hU^bdJ2e`"v񑥍U[{hcG>#d~v/voz0nm9*mW]fH&pwʪ,`]@\ 0m\ks_Ѣ_Ymzs:nuC% xMi6YH*l_?<EcfrZJ9L%۲K:(yUQO[\%Į׼)j;"(:es0-7MZ=<3jqJ0)L<&ϾRе(TsnoՇ WZv̵8+;cYҔ~Jcbz"jj: ٚa,L_K!g-"8XBc{:1 uफ़>|^"I[t**> !^~] Sݖ*-ls6p4>Hc%@_A,ڑV2 FP9] fJA梂E8Ocu3a@=8c)cM$bѸXMqa!z ^F1*iB?# ƊOx9;" l8ǜ;8|p:h#J?y@ `07\VhؙIŢW*""&9c|!Y oZDm?u GF%IWOcrX \>c®aU * U1+<zVu,^3VUAgJ9E%+~*LقF̤g&I\Յ\N2e2usU [S|Drq,P?7?mI=W^aq|aC_.6 L<>M}۳YS2gnrl2{nju*~5ݿsEw^ l͢`xz+T}{ڶScWf9EO=;<_CU7b^}Uv-YD}?QcBx+9+6!Lh v cg`LJFߜZ{vH|ʋ_ 4%UR)Hmu`LDC&,0Њv` nSCu,t'[@ C!ۦ S6h=U[CJZ X3M9@7ou(C0)L61a#ހ/hn<ĕiin8 |(cES(/sVX#XWOc*n-#Т w8qB0$L -j8QqλLZq V>kk\EUzG3Xr h:}5.#9-N.ӮF鲱& 1&jRI#F f;_s>^gs 0Pjc[sGu#^e(]?*_ؐƽk>z`ι?ʟ3nWvlj+[ /Wvݬ`6ؾX  a6&._ k4親y)&2 B)&RFXa?Lhjb9`2'`!P % :L֙]kBIr!eM@seFɫr2wlfG,I)SU Ϣ2{Qr/&juM9ʹ}Pny?;ept2;g1 &i0=Iٓp9Kf0l;ؽ:5o>iQةY*E} ˱@DekgB쬅pd EKiMZV\"\矶@mߐԺ@ܸj;ʫp~{T/{ν {.__~,2 8KղS: YJ-/CmzGBj .^1hc5'^W>3lbLa9G[3Rd }Ĥ dmg(\iE<%8p7z&sYSz<{-Z=ҧxжv/pk{v;2Mbal_]-PXi4JVv^)7 dv7:A5,xʢ č*\Z3@jRB @F*inz7La SN}B\ ki<3UsxR [)evWv` KjǕ@P#YBq0N..8u^wy7K!,m9Hssmߣ:Z﫼`ǿEp n9 W N!݀Ƭ3\>A@a*мNϵqWPGpOB R=R.]R/KW#J1ʏࡠ7_ǭε`CenbGqA< ~'+V;0W0nC.m\P{T+TU>[nbI(evPϭlËAp) p*U9&Lw؆L^49;F )]M ju$d' Ol۠P2 grՒUǓ+&uXc'Hm$5)3>CELg~gdVNX2jDn<_Z0y 滹po0@,޸r~ī^v^_M  oخF٘`f;Q SnakШMO>8ͽ[vg6 ~M\g*ߺ]Av͙+v7La SNSbX9c\YLE냚 FuZ\gW'_܇vQ$v;d'fb/ikڎNlJԸ)`iVVau=vhx"Ү .$yqAf^u|&Tq3HU̪ŪbW9~'s+%] D;YY|;.B]/! Sp2IgM*i9SQz?U5PsL5P3VcIk':PG5A}g~K'yf(Rc>]4GgjhƳn{ VL^05V1A&ł hN<+&k>w:KҩwEz*Aٚ9A=HacX &^i<`{pl"A1϶VkbށPkeXeU=eij/бhLj O.aӌiDúw.&U* ܪVh&Z֭N \Ct6ޭZgu)Z:~tpP)'(yh+Z)xrf: *E+|:KVOP"2^ew,d6uoZ٪ktO<^|9{k?/ `({JY 7M@7r?6u=9rweTf.R`vK]n|\o3+dh۹8y ϐu~"Sq{GsHJ1d>e` 2K,haO8-xv PqX O3Xqܓ9x &GYW )y Rnp#FTM:|4yї {駟v9ƥsS6?glJR]#w'.Pn* @E=! SpᏂQDŽSjD0Rn@dXԧĉ /YI0U2QgʵXʱdnԧx"4̺yl`bxrk$eKRKtLiP snf{5.|Q)k,&1YęY:{DxN|_rtyk>;e(,p 6N€<,[ p=mS]sA `;kg 9^g:v:mh7u $7`T3W7La SNgb>nq5!pv+q*uy2WBʘ';J.X~ ]V Yg1 Tc̗u,Kk ;.8X d@' R׎`Lʄul <p}6cVWyO .S}D3M5ƺdG- f9TɄ'q RQEI)pZ.H0@<0*O^xcrY$ *v=v5n-狀xOc'Ǔpk&A.`@"\7AGZA|LH`@s`! kIwwXϾgTNrʤcn9+fU%Xb-VO6Nj^=KN.>"=vx.=,P :Dϱ P%k E&j}Q}4[??J;]*mj*Tj<͔} \d-A!+y=fKf鯼Ty_|),F_8lLabρ&`iL8I nD)(0u-=^QҚ ^ `_)넗~Ϧ器K1*2b%KM|yfx{_7\ԭ#p3S3MB+f3>l̀-:ejt~`p<9kQfp3mŕTה! Sӟcjd؁tZ 76p0`G(;r /+^>ob\֬Y%`221gy`ax X<2v6X $q k.lDRRnbG\oE]/I\[kHQ`[lEK46XX@2fAsw%s :v鹷lL +qXzʦ53nƂ=d8/^/rWa%r@_1n±<'u"\{j`zEy(P鳾J=1\) Q2wg,L! WLi=R~Mҧ{E&eh prC'@XoWgB5u-9:[6hB\=fT -S$F)yiLjgJv ~n ֒v,%B/b pU35y3_]ˀ˱>eX3?O܍ p NdM;vh/eZl_ pӗms2 7{bB`_\iܜPcm!!sb@2Է! Sӟ9,mQ`eFܫ+4g3og'n-~KqJvq!b"Cy[j<*b8\ 8#땫5^]!%yԻ 1QIIM#"b5jIk,11WB[@wc9=e mf]a~qz@c( l\cbYc(fq,zc?V@:E[bEE˟??[}2`;cul= hEխ# P}<7L!mw=r遍@\.Q&Wc>E^% )5 i}b a|[xVM.Q %7Q*svLj5݆ d]S?Yž+ =uOeOz@c&4ϸʕAϻ}U/}W}:W3K=i f媷D#Y9U/BYL|[>~Aڤ60K+=Hytm, ^<{윔l(\k}9>Φ pW똑dʟ_V, " }/U&L֭0)nx@MPh׹ygK3,FFF(O9s(8IU,^{ /^=4!@۪R=(UŎK.N?.+@ 7^cW_{ɽ/]c&2/6Ȧh>P8V}2 lwilcMɂ߮6)ے0m{3 MmP$ rQѲH6:0=~!~vP0oǓ XfHL DV?2.t\YXņBY ߞV;wTZ{^maSʺ'mQ2)9Z 720 X]P߶Ǡ4`\nFGеC j`͇-AK땷pw?Z( gܧS n0Ĝ-b%Kd!_| *m5Wsp `xeBglE U.q9Z;\GO?y/@[b)dϞ=BWjl QΏ=| zBMWXM 2BY qb.!_R73 蜨sk sOYorWH@& fhwИ٦N\& D8r7A~k{psY9*nfvXM7La SN"h635 O'^8- oyt`5-84^sNsSqӵ賯4y^Ae2N;}d cGxKN3f k;#pa9-{8 unFepM 溈ܩw1{BT?'(qkIqK@-Ob K ƽ~2 x&P`/Fs`ѸxS8p ۈ,,h|xwԛcuT6g)q8Ww?3;wC 0\ !-"46j9ϼtZ] z"1Q!FYYU1) n!3b krI0I L9_ef`*s5\Ϗv-קg)e5n H`- (LQ|Έ0=۝KRb3=Vl n3W]of *91vOvyFgmv;[ FVO5L\reWmZ*36͘:6 Ù %K00WI^.MMU?RgKBEg3]ѥRwiK[ ~t/ۮW b0D>(J PJ  Dc4mYG˾30k=ۗ[|7j_ǿGh*Va9>6w7&PB"^ٻlP-7ԭ<,$f Pu5iY[Vmϛ2N{?|܋-P3W8O. i@^†W_}uJVRJ.M{`9j|>/g9~Ae{ULK܈E4aa mv8P-~v @Yv-p,,bm#Үi옠][a$CϚkRֹ)>I\S> {: J`j,L bP Tߏ7vQ߮/.z``dX%@k + lbE( IDhٓԪ>6rYes#A@^!]R,#~9W1^dn6u{M%ۀ.;ƀ$\`|/8\6"hg kWiw{~$A?v! Sp2k& DlɧG8|4?j]3~t0lPaX=R42(B5IN2$m[l4} HCDɮ&\GKe/@@*ZD\&L)& dPy B\}=hB0;.໠b33fU u+@05>9wAQڽxkl x#[,M5kbݛ̹5'rNF#Lдg{tu979/Sp7XvL/?H dm/ O HI.FJ=/nL67~ːjwɥC>/M*ٳk2\e磎}5uk N~/[C'eF Ej;|4+ܺg]jP/ K[~ɩoeMMnIXu?s,`9wre Q۬qe^FKc&;lѪ@^lJ ۰@w5xu4WPQqFW[`#+l˕+) t]N> >n ^R{ "fU_|n'Y6Ċ&)K_ -x2eV@0=ڦ~WFjjyA:! PaGIj["00lSqY5aˢ{GM27*ߦHCJ, P1M]:N_}\5)_EtL 54̱3o~7GgfQ][t YZ.@(7N6x8{,j4m#mT' n0|`nvPlzwg5@,!V?kLq- ߜ{". u c)>5f^,rj%E=BKA:ҏnx;2U担;/)d=.=كZ5s?b;q% K-1.&K[kI\K!!u<4ŏVcm-E]tTUwoJMߏ*ĞUÖ/Hm]+*Sܟ{${ R7L!Mhș*`c" c~Idu/I~:CL\`BHϘ\s]ݳ "&4'\5V s>Lp=:l4fՔL&(tt:GZRkPG<;=6uM;A2Q^'Ndɀ\2`Zl޴[5q|~ۭyͫz،l[U@j۱luvJJSKCyoiM& (l![6ٛQYq}=1x|<}~=0ʾb~f,Wlb}R mr6l`ݪ~=;FF^Kp$Z?/-O^B' -PIw?h,X|xG૸-'U viaPdHrԫ;o?4_W+U.Y H0nZVR6nV7v,ɋ)` mܔAw-7ǀ@T|h^xYzvͯ/[Mm;[ݒ a~wB\/lR) @Nl B1*Yl 6 UET]NJp=͙սqkc }{ 5TS$?:yIIo뀒cXl NpHRX!:X,fM-8:ͬH6 RڟI=6W^y&P1}ș$Xv*ݨlXm&m mN`2S ߚ$M(d(?Rmx©6Ml P ]X jWk_3@&@emz؟fX%4|j[I {Mo bbB5 eOGvNw]+P&sI>벙6 NYjʱ>n+%/ɎBjعp=<<<4aF(6NФY!!!~?F 6) ϾZ]\ZVr|nd2!UyKM|<`'%8 B!!q=JR`hZO hqߨ߷!ejdJ}]EKh2O='Q/pI\JIZÛl :}yI2 V&7J`.u&+qH7o,#˯p%9P~.,2(vShOb.jR_lp| w؎~У~w]c7B[o#'=H>/mOg>-Psw{ans u(ZL_\QѸqx?gKeE ۺ3XGr \~GlgsߨM00{Y @&iwSy땗Bzo-cz|c sCQ-׌J Úy eߞ~)XjߌŮOPx[caQcjfUx6Կ@3.bv԰n- >现>,IeE߄=ڄOx74yԫX6YVKJ-~;di<=o,j䦐2zܑ;EW ׵gIV``$>ʗ Mci:[7:@NX9Aru$.X,ա.ۙTG󟫎uh'%AAmԱDm`?)Ha6t#So_%NNhI,IIږ$b/ l&KR`":M>uo& 6~  6 :@}ij-,Z|ZgHxM ox4elG}3'$ }ﳮiRNˆU`-JdGl#mr 鯅gخQuAqgAZwSfwpoއْvMmo ̕s8Rڞ%壭W1>;+Jfu:Ǫ4m2)OZᛪWN@}\/9;P)u7W\6!OB5VJ) u(_l4Q `V61ػ)~{0 Mopo)5oG`l"::/9?}8AZL^י?(zݠ]ҡRrmuk{DuH:~3y.Ǡ9pX!:`7iBM:^ &uvs³{J(QhNKX 7>žoࡱ} МcHd,+{x8M3.Xw'/'X'+K)J R#4VR,%%]z TUY *U\@E@qP1SY&eG&KD9&0_:*5 b׀kj 5RAu1GM&(vР\(s?d=[gP\_\*ϔ}h l3I_t_9tYA2AԌ|$̦gv&khi}/v'p}+}Naٸ139%m8鏕g2;{ȠMJj—G%FϘϚ6Αadyrߓ*tn2|ؠ5v\tx=# 9L+M%[W5gMIf 2+QG4EV|YOw{JS1C~\_CG2t7sti#iShyV$/xg/Ү Ҷd^B}ƒmpS~@j0Hgj*mCMtwnc ۂߍkvI8O*XXˆi˶Pr?G6m?f9Ͷ;y^l7j/[h5 0-Y۶z\4Y$ ?A? *ex*7@+{Ht7-q.\$My,~qXF#4U(ch)D^Yxgx~^W_!Ey(ҿX"6`I# !vsԽO|uF{6 {tMTTor=zsmYܬߔmN `[ }&3nb7?|'؇n*uNPTC*ƭT$6xY$I?\42~g0v̪$VTS9RS`=-۱דS#@-KX9_VJkd q/5Ǻ*1OaR[ŹR *@;τtb$)Z(9X$F@eJrlg6l{BQm%*ֱҕӮ!Cuc`@r5T (6(ζ0'/޽l#{hjO,pӵׄ ='䐷<@-d4EmO /P [*{ B[ڇ(vX.l;צ$[I& \g+-qD_qןckӾhP/QQR 5/6IH=O]LH}DF^)ա(cK5'>m!p?v R0u 0Շ6.'U=)%(@wZRȘ T)Ղ+ՙ_E uPFx6:u",$P?Xcu]'X·O4Y@X66өS ".s.+R[x k*u,$v;ʦWb]~a R&~;%9P>O=V1y>UFZzv5g j- yN5v!6'7li'n#Jaߴ1,CT:t9&q!agHL[7\/wq7JWi7xLJNX(h2- {ݢ}qpLe`-2apq/Pˤ6Y@$q}s~L;J1n&)x~!ϙb%IjDm-OUTL XJ)mL'ӹN@&σ}4s~^/Ol^k@qT~=: h:0d.ROyRyVmR$ܬt7o#XGb-y'kK^0~zBhj߷:=~!u zUV+}y$qx39ͧ8W (cf,GIgLg@`N9m ^eA;H׋\V&}kD4Ib>K6}2K0&d`vk8"I&pc +G  ޻ EG9Hyq\'ϝsrn &3qhk㹳?}zIP"c;Ẵ ͠<ܓIvJ?QN)tcj RBz("kw4{lS yɢ>W=Ή0%ǡMmYԮR9&+ٰ &տ|`JI =<<:E+IFh^KK,kf荝)j8ipZ 8.jۿsĵh`WL"mfƀ0fxxX<pM{_@0oe[TN' ]2{#3fGCҥ¿+.#L;'퀸<#\wR*?jT 4{+|0W0k`6{yMP{$sݫ{O@|^`+%X(pYjB S,B9k<;'V\HIkyy^!f2,Q cqec 5+W3 ѲkM4|=[M= Y856/ȺZk+uJԶR $kû7j05y "b@)P_MU5whSr8 3Vh`{YϖxK}똱53p8sWidZJ)o7SBW/ )&Y}dDǮN2pwY8e fQf1I ݙ$~c -'%!(X5 ^F6O D1Aql4;wm"gOGQ.4 L3iYB_ /H%eBۊ"4ٲ89 -[d#g1wÀ*XhV+Z(^%"MwWq P%|d/&I#Qe"L5k1`f>':4p⿂,Km3 T`5ƳoePn.<\(e?jY/ZJ ӊ;O%j*Qq, -ɫuko)ZdNڼĬ =Y -Y"ru Y7o8AA({ 7%zTV/TyT?nvH葦wfPi͒!=Mߩ8wi3 *iWF iy /7-XL\̍U_eEw$b߀`^1]s%ϴ-Dmw ,?e?8Ѿc%p;^{u<|y-x`S!*t737|?uYǵaƲ/ an2i0QOH^^zxxW4Zp%$*H }A ,dn˰e]$Lh,H,ca m\T$neoTUG#2ڋ/،y XUCf6$IUKE%D3 [j $IHbKF] E4cXD*N}km_5LHuD;%{<sKu9g[n-T._|_V%I Z$٬i%5낔& ;odzqg_Y;2ȄVQ6!g&6~=<ee^&Q29[BfD;WZQHȫ)vj6s$zw3ޭ%jÏ82dqJˮ 7V2xˡNwCO:O; 1# Ā.`;u& ɋև ~]#ػڔ5K/p=<<~(p%Y\*B!+" ǮCJc,W>{ܿaB)%c9 ,ƀX230?gYrXu>C5(7U6 ]E2Fu-YYz^Yz仓U*뵻yF3SuO:jQPHeY"5AAU_"sRY7O߀k1oZ|Ҹ%٭y:|]˂M?^zl=:>}M>5&s&j2AH{ k"E?pT]Iwq-PVv0@N G&EԍԦ֠ MnWo2j>W´4^ls 㳝R[jC;, / X4ؓυZ5 4lMh}H5tsWI(|Q|,ko|g6r_&8;^^g.pSvǪ>(4}Bƛw ?̝Ŀ;y!V)uoDmzzxxx8p/X^Q,1:p $cd/X#X(`m (>1%o \p.?V605%9zѢE|5-(zR+umWPvZ29\Z 'MԱW, 2BY[, d/:(n>VI.p\LΖ|_2LTU$ǑTR(YBC2`vs|P"?YwCX^z1o޼h„ ٳmBOv}VDZa3>jnzQ\\7pK|lM'xMlxԌ_BQB'F'}|vuGiN?3=^9cé.$\uݍH1\5ԬzxC/ _fgxRomq]o׼ɻDmn\`ܸqŷ,|ԨQ3KnT?!iJ T?$rHbaP~}Nvxƚe3 Ï_hMj4o=[^|o,, #.HS%jK-QK޽p=<<:\%'+(Q05BY+OK)^?dn:C|=MCOuj_Kj&PldHR\V27b XJfЖ,WGڵʧжª`\/e ]/kV`87ӗl&:zƯffi~_6 w?o*un8DmX6<~96k89܂7J[.Aˆ-!Q܌?Kp=<<<<22Ȗ4te Gђ|nQlbXԲ'NaX0ã PM/SOrʑR%MyH<}V#8󑔥jD?ɮ`] 낌'l -PR?_ձ~u{_}YlnնG fqJf Jj4ZV{0(-l@|gc;س4YcXuڳ33Y/^C"E *;%pMyɢg! +X7/,X69K& )[\u|5@[)^r:vF7nPށڠ)`@*6sHpD`{K6kEAC7 k5ۅ;K W_Dm]8E}vFqdYO&P\ \qM%>rxI޷Z >ۀ aavM9l=Q[a=ڋJ~۷XQ:V`,fϞ ~妀depl/k: hE6\7N8GAs9U PNQra6 6fMTS٨et d% 2e`VU #vG ʎWpYTx.seAi]Gm}g.?g^OV &~'Zڳ]_.pww_r y!̙寔?Jw~ 6.% 6^|Ʌ?ҞVxw mR{ʅkF>WO 2wEW alaMYi?N mK#9?^3ls Sr g;l2zo^b:wV4+]*%WPeK{yw9:|J>gۮGyĬd5PB w+3{J[⏒wUR$p/YLZ_wH~>]lH}I"9VSiu ,Sr p(UDxBPFP畗Cfo= oj} >>S>?}je*_^;NzW{SjOvXa^}رcoСC^Qǎ~ٳ}wIױꫯ~P4e˖Ev[3h ’cxmEZԭ[7;dyH駟Zn,) ֬Yc$1o<;̙3#FDUum--580bT|讻όD$XVp|6-2H{dr$u}ƌv ZJKGgkak-V OhذaVE39ogPJ`;wlT1[%Qɒ%.]* ^x٧lٲpr`W?cPPKBf͚?z1)Q~;H `q7LDيkN/pYA < 냠J'%{GûJ/زI&/j\<"ͣ9k5b*ft-v$;K_x-cPʇy~a!p%A/P)V?/]/a_{}ewcIu_+W2T0cZ)˖R&yj?ϣd7ިRnʔy]→ԟPPlݠILΓK3d|{C 8o-2\{>b 4(6|Rd<$fſ_ :V- )smʃ'38ݨQ#Kˠ"Ap$b s=<<<ʵC"ƺ~QÆ fruP y&81#n -P5oܸsq,1 KUv<'Pwx{e}xUic~؊n9I>ըQr$vO>}or6,IN[LxQFٵr ON˓,qm,?#ΪVrYN2%tj~t$=]/xT!VC*UBTIUhr{fmTU^2$UQȗf%Y*XǍuXp-^vSQK籋XGڊXX[^2h ֖=1J|RXY]6hf $e~V[٠WVV!y1R9#Lϔ% \_y%um!\4־?/L'lY4!b`bAe[&`BA<~ C()i~.3XGإ/~(gTYcƌ>1>Muܝ)>ڶmkT ڨb1 JP믿G@X^CH$9p@ } kV`?նDn]pNyr=k(c+Vh av8˽ -רYeY>gl3Qso+W}i,X``%9p=,I]Mt 1H v$&=] ɒu΁ID5@:j`>[Q&lOOF̭YlͫJu'K Y#:h av]-JY:[ yVRNP6.Tx}TKREPA_qԩgP`G 3t5IKPyP^~ݓ1`YlSQPSQAR9Saufd~ҥ5N e1ȟ.tұ%3<9^BòTB(x6WWAnw^(VY$e}rT?T{ʔ)5~D} +VP" ꣖S_s1K}쟮~T{HVxEkp^]clв׵ƭ,z[+Q[#K;榟r׌ڈ{xxxx8sHe,vI' < TfV>zIS~ڪ]s,[`3VKG=v]+^EijrKƾGȋ&m+XXe-SOB ?Lim:$Q;[T[fja7pVp R"/ m$qL]6(3>|͡dg)Fm-VJZA@AޡRN U3J"-Tn]t?vMT~$Oc#r|fĘY5'V3sD a6ʛe,3`` A 1C qYR1|/^_1`d+Fh >Y RlJ6R0bۨw.`P~˗/ z-a'& 5@/$@Q o Doi](=Tjڡ k'_$G/tOAթoԯ{Ǟζ67#B́`Kfhk%\oS[8ȕIWN@G( on=5i<=M};otz/vqV8GGbJ G[Y"k d( !s`8x 3O-MP,hR2xmQeN#ƲL|/6 ~,er1o}LEőگǯui4#ڷv_\`E[JmդgM^˽{xxZhfw l7N*0*nRe^w?{An?Ht<gcUY <Jcj:eW3YQEp鬳=Klz ul݃qta` Bxxxxxxxxx=O&Yj;d҇Od=jkTXk\2QϠ;R*++XIpC>%6\xGZ!f~*J.-5Lы.ʲY4^4 CgaC{S4IKR3={30aAQ&$)ɥV3q`b FǥYu*lUMX5V kR/_h*[><+%]VmJZA+Eo M <x+J%U{ܼ+9em?ڌ(5!1u_9`/?uf%J&&~E]&+OI%0d{Qrɥ2)ЉE{*;:_SIc4o3- ,i?.=$[fcRLx:K8uI Kdg(P,3E6D/\ " X!`~oLիW!(\/P?:+rKS=M}7շ˲V޸ zxxx؛.u>6 ]Eի:|O~z/Xa%IgAI-%˞=Y&~= V K*FXx~=Q 1sUޓrM.6 /2D)Lîaj lbFkSUlmvd}Nb:yA1 k=lmNNٳg!YRPVu-F1=$u?V_:N,hc $l(H$؛.@%OQ]\La`L`NBhzv 0fґ5Nš|vxep Y&2[uc;<+V3W\{:.1!H ,Y+cڒ LdRaHi'ؓv?\۾l#`jx 4y۳zcly'{Ze(hȢPe td)L{xxxxxxxx3!-Sd \x fLfr$])MA:+={3ΥUZHTZvHDg˽.t5ObU]X1B+Y2hb& N=O,иVX|D W}15Ŵ1 -kv3@-fQ+e;>%5<בNDl@b*_ 3aQ+˅Z=}1m\2[ )u_l+hkjsI,qM_x-Iޅl /b :Y+XC86}RV f=dWcfdg{`pFR?$T\i "Mw 2Z˺`va-=QHKgl#}ޛ\ն¯V5+w TG,ʔ)k . wkxY>f:]Ju54!q/lce'MQlJz8dE)@U$A32RpYT.`^f, R.'ɟ5@MJ6&h9CVUmy<*qY{)%v. J jpQb@d'wpvO:Z)_KTۜmF.9Qp%PA,' $-JҥKc e'pd;iJOAXE>`$X [`ܽ'6 (GbOGפżDd'Ǐc%H#X}IvJIMcuupOaX(mΜ9'9;]U'$RQ|ӦM3c+$ T~ANH, '?9Q .Yr`sMq) W[Zbw@j &;&JH uuQ&3:] /.YPx>G)֭[۱WVaπE;w6x~WG5kִsm<8DwcRtiG?co}1pIHؠA{O 5'UMA *@7|sf D -4e?^O r6jc&!Eot7$!<ǐgnI4]׭5j԰d`cFA[cU R+t_~&[}b`x1|ȕ+W L Ix_y]}-fuQ\rE xu.sXܔ<#2f;~x5RJ:6JALag M1qRw:$ۧ)/e3$iVċ^zI*PY(,m۶K LyO]ŭZq^ /0[ɓ']#ME$aF>P$cmV)JI<#W0+-WpU?'ɘ`Y/`+"VJ V5`]Գ3]Z]!Rf(o2Ճ~{3>}zԮ]hʔ)ssi#sHƉRNmo<<J\2Qbl =03QDk`lk{t>1<ڤ]?k֬oiצ㾊2'iRv`-({qƍl#VZuwܹf *AǨ#x (&Io=4뮻qO*?c6ԺxH` q, :v=e<@OJ^.6f;zhS=Vyn@U̙3miӢ>_mGRF5ɯ{ 06(XP /PG5PdД$_X7W;*=zp-AR3 :ԀTVcS6"[ j]Z50ЕA<m<&E.s.|v`A1&8Bl{ pF617o2\Y`i?-GymQ fr,`k $WԃeA`Z)R*EoUAٵPB2O8YjImڴ1xBB6, V~)\SnݢGÇ{u;(t sJfa^P7m+{۷oԲeK[$O0!C.]ص%PcU6cǎHWV 6r(i~`;xr\溸u ww@,p&۟iYd J*fP`,AJB0zؙ`cŊ݇9,{s5 ~)̼p,_|}ؖʉfA$z)/^2a2~' X#^%m* (3Pmo4k˞(x?/Q}{˞(x:߁±gϞpwc-KEӲ;wqwܸY8۱'ʱ7lNT;x ǣy< i{{9׋g 3<^3A!P#_J=ӹX-)[:#d@DFGٲ/^2a?/]£A/ R҉'|X~_GeO,di?/c޻-[C/^2|CEXgp8"L{%>m: I/>:$xxx`hiPqlj[̝<x0Q5jժe&̼QPro`` ~ٳ O.%. -Cmdiٌ%v#/V-\Oޱ0\vopiV~x& Vqe;i#<@PB?J뿚IL Y㏛چ`3 jAQlJHAcq]weSR`?< ۠,V2eضW:Y\'pT s151/_޶[s] ȽpasoR~~u׭wu^dfwpU.ۘ [ VBN $`G[vYgy=ӰTRQ͚5 ƪ%JUT(mH/?'ʖ-k@V^\t<:`,j_:`A,ۃGf{kifNB =OK 6,`qL ׼V(:gmȑ#<{TBWd/L7pC=%s @=KC=T͋*=Qhy u?/YT/W˖- 0{%ͯW `YHg^ni{C7c* AϢ6KfYUTuG/S?/H$SSSsb_~P폽xɴڄ=U6rJ{3k,NtV2Xm`C*kRU,'X\$=MMK .E9smx-pV@^45` x'pBt饗ڱ¨p/Odxms`;4Uy/V__*؛e'\h`%Wwjs R̞=?|g$xI'y晃;GQŋL)|s%uHNFKf;VW=y1tShnlC沄 Z%*AM}M΅<#x|;#,h߳WLY_Bo~%J޿' XW*9ȑ#3g:w*5_tb)Q1HI vGP9WJI3RtT#TNA0p ܺ pQ&;@VuZFM^ ܷ%{K,9G ~ɂ ^+*/%Oછ ׺C{ 2دbD)tc=XԵD2bDCLꨏu} d C7:+ce/Ha"V}<3aZ.;&#Wul,Y+3)ȿЏ<M~3X$P\kSN9&5f}y/pn|lE R}blƔLw1N^"f~[P. BsxɴҨDnM \f`Pj$X0k/R+y_UA V 5p?MUR@n@R- 3)s~rwղeˎDe+˂ VUyԠp8T rAf0Qs ~y!~}%{z g}յh{ΥK23|YC7رU^쮂B… \}O' ҵkW\?1++ %Ś8Ez]i(Yy7-6`:PClܻ;ew،G\kMĬgeW4|w; T|TLd&7*6Ț hP6C׼X#hpI@t*,)zTAp?&Lȧ T'/`[m5_+W0-労͇bIcP?l ۵kW ?^W>0y__^(A{xlƍg{mѢrmA t$s#̶pu%حt=@Oۮv9HB>j[{dHj*m\&;O>. zq#Yp %Uh*TY-̗/_$hdH$leGQ>JZ ۴iӂOۯ\~'!CwS1֫WVnu;X)IX v.~# @[ 5  ;TPJ7[#dg6RGuQIa|z: <DZٳw}2(&cO\=p=6;&S+8Gk֬T RI6ݺu'\=p=23zq#C@蠃_wK[P}ϕu r nנ5 +mOV%Uj {4ILA yפ֭z{۔,|6lؐ e Tt*Ť-W>zo.>o QGI&EvJI]lc/mݺ?9ؓcO\Ul4[.%fB6W^… gcO\ ^:PX$Dϛ7/K|z}T t6C4x#DA ^5kVmwhʕ8\(S)isNP?LUmVZt뭷ՠW }FmK2)khPU$k^:@V:w'Ǟ L,޶cƌ@E'{"xxKy;EߟOPdׯ瞅\=p=23zq#J, @ }H_{T(_@`>J0`2k/ \* Aۮ%B AޯNfjm[)t$V%*K tDF*U2>M80gΜX,O4 ]]Sɒ%gs7h RǸHPOk~%D Ktłb?- :mT(p'Ǟۋ!CD}Qw&{gjKc*AhAT};ʘ}-zp둙׋\6vl <꫓WW*7z*l,WgWO/ϻTAA_lAѪf bWjgb^%XjyXo! tذaӮK+@ zR6gXGUer>E.O`p4m4+ .4\y8*qBDm]7b5%A8ؓcO\@AΣ>t{p=t8p\L+WW^!5'lTLE4X\X5U^K$D?^A ɓ'&~{:a8;w-ZԒLvKjޟ>} tnͪA BѲe"U|vڔd-:uj$᫇-I2 , De%hРAYV͞\=p=t8^7./{]|y|&xi۶mJZ`< hM ,ا\=p=23zq#zE׷ e,WP2KF60&f!&SN t]>%[u, h_(Kk`h߮l#m͟?*F,P.]:l_b/nܸqkQ >5j(7*XŽ ^AXs~@]>zp뱧GO< $4=[l^b;~i¾p=t8p\LFxLVv,w4e+B")Z1 *_iJڵ. }XE dbRJl *;kIxw'Sc ʿllwE u& \0]}饗,1p0 `hb >e+.ygʎ=[23(X`!w=#%Cc=<!Q6,4E|6 >g (r?-_Zp=!![9m8q;^zu!mA؆U\dr(Ґ΢c ~OJb,B4RI(@>]I93!C/tH]$\t#:ڽ=;eZ_}U"p!\sNvڌn袋K-楐ۻ+ Znn&dnHViS ́!dH not! }! N:N8|Avj5fAo[vq\."Me2i:K@2鿆P~Gm ܏;T0//qyi3|dyma۠x.}U lVꃼ#g睱OxN܏3U8C:0Z0$0*wޙnde!ϐ ܃%tH vpo U{.ac5hNU$V'ԖK3zc q0/XTD rI&Q"61aDa` >#,~9caz 16K{Rwlλs-ۉ9"7ˣoY{5f5V؝H.(.2Cj3ڞ,z!oaW .`"n!raoT@6&kџM9{R2N.iAqRa2N_*?fAԋa89ӑ ܋]z\r#;1 G3ݻ7dmAHL `A6@ؖG?CNbyB8 {L"b\ВrHVYu:g CT@DVhnlgxwm X8'2 I%!AX O$K_VF0O rȭ!q%=3y'PRl0vZ Oﱣ3X '"mE^eJ!goH6+i,t1$'6U:1؈^EFVNS*O?"; >F=quSIP'g5 ?8.I{$y.myHJd.xNlXC\<\aF8lҿO$ o香d8^@&D(ԩS +$ڵk6|e3O&#=SWk_ +HOPS98l>9vy.a3K*F6ǨARݗ4Pve4d"3Ee"3؈mMDr`aWߨ{&r.3#Qq D.0!л,{i6,?mq $R?o6[m%_`һ/bF7N/ߖ G.mrLcGNkr(LD2 DBz*"ē($Aۉe1j)Qr=Q㉓Eek?,zEO@>AMD8`B.\8SmR$Bk) ڃHHґ \ЉH~A>l=+YKS[GB S"z}t3t\z962ۭ[L| &XOSe"]s!@#cFWgK%Py${k93tCbQHGY=6Ht M6OX{Jγ]uDH&gل` /m2N0z=vy0ߝ/edKAYT^:B}_B_%{y[(=ָ_?6v{k:~͵OH!̉; M Hj.]vCv/5U9c[Uk32{.,WDžr&)=fO*$M;>E/W!wuߍ*7qփ;DN2b8lFvxK22xD0Fc,@! xg'\XNȖX[6WTo&N"|=0EH`WTND!K9%[|q 1FΝ EѣDU_8B= \)I|γ&!0 lm"+rXX_pDzȬa!w\#|Rbp;K6K.CzR,rS{!*Df$ʹڽ  o,hU]YE-F;7%%Q \<-"ZKWώS2zkDܾKg 'Y}[!?4%tȠI X.x@M8eC޵ȑt6@E٤I7q. oR,K=5GM !z<1=cE֛grq [uX?~r[F{viJ "IJtg) ߼sGG!p@(6/jұ]RTkfJrSe>C|@k^عؙM9 jja7#v`0_O Ƚ0GْcY2ߡ Km=>0sL\̟})HD=zҶz7IDf%{_gx[sv֭/דUbxc.JRoDv^|)nt~{ϣ~J3o~Ԇazt[eoeߚIfaFD'@J&0'Ж" PRD@3/B81dl9[8$2N ޥ4[DЖ]9VP[" G?qLd-"ӕZ$$&q?(T 0ZU .27y.Q}(W$N۬7 ʄ6d;)[Dr92K゚걔"DV8Hv""'!"*!b+#J ͕rR)5 ?(}{"r$f %W\9E-ƌpDZ.,W+Jdlߜ\X@*WكHv.' 35n61(N<0&g%?O3ryNHj !"M޴!^m,2q 1nWEC>i \k\~4'x2џ4XLcO4Fg1|r &=u;Ѵâ KσhnjiWT{q"OS_l!c_}r/-Au nA,H "Jtez+,^)gbi5_'dmmL81"QcXo}y{N{GH\.gN;Wae/7hn'9ȩzO!ov\nhy S{ !R~*Do8N]ע4H8J$w+d5Cc1%pEܢtDZ[s!o D=Ar2 "nK>Z Oi[.*[#2|f_g8Lv/E:H\jr5LL{$R 2"i)ttQ,gn biKwŞP=nev) q(ĢRM%p!ieLѳRtmzT'i-c"'|DXaw$2XѡG='ieA?'pOJ.l!ڏy 2^ʚKD6fݙΐ?9^s{qNd"E+'paIe&]|,Tk:a@HJ;5 w ߡB7Xdgfh -8ߠ 6 ˖']HwA y1'# DSEq]/ٯ]g{:>;{yX>8fι!Y7߯'pxlMwHJ*.L{l_S1 f;-WjQ?=z2[g'ϼ:i{iz!xV\v}a^ ЖUQ^ly*ȨbNzӅў\H}!g.6~H(mmM%p%S\/,(),LL}m"0yt"D͓T#p{.LBlC؞$Y>!"gA>T+ԇ PGqfY` B)zQqpV?!\vEn`aK@B}DRvܖg4K=?A'&]2>׵ENQDr# P2EVcȴnEz(y(ɀDǑ﷚q i%BmN|OmfHE"ϗStV'R!p!ʤAg[l-q:Tڲ솜ܟa:C-cAP"US Qw{NE 499Eov\tQeG*|C|=3?'.}暤]nQZ.Gݴl/t>WWNsఝD><,.((=[} pEo܏RWS_y4 \}Xƕ!#GL2UD2w H%j-%2,<@ʎG;JuԼ5 4$WW<Ć#OOD,ѧD^Gﮱa<@mW%6ՍחnSƵG^xO~Ycl{קPKMn=d;Rvÿm{[a=0iW^gD!v&p 0J8_Hka+ l-䰬rNB' ‡mILX$zh25>8>/N8.%v1ձDP(T BYm2$}3D!ji:9I}B|6$/uH;Asv "c1!B젝y uX #BB}?#=y H i [h A89J,'k.rv֖D7x`[#rOM-/p/ѣ?d-cZ.Q!88hrRoWu)U0aBwV-JQ]!z@rQW" ɗ(GlH b ~,̪.q8"x?–q 8GH+ \]uQӵw1!7>Eh+dcV} -sE8w8\qpsd$sgsFe;E.46mPIe4^C'DnF3.N,#pUDF?rLݛېgneɿGc|ZELf"9 1Tj9l@`u|?KtS"pjө\"i0 Xn#o! Sq9Z蓳phrd.\D0Y8Dx;2wʐm0:*EG Ct\Npf"z@0tn !a8z `|9~Mͮ*rbwEձNX.?@(r#2Վ"Ud혳}w)uV&p!?idB흟nl.zelnO!ߍzr =ry]vS[ZMȑDߙ%/t3NOrYSD&$W_W>ġND1KL\\,0"~z9<<5Q1/\ҴCRt|z9WyGYR{9vfa8Y̍mSI.֢E(5  a"Yu(FM= f&3tQմvw-'ݛlGpv` 4'2ngjeL캢# r܎3Βn@~7JgQyE?)hJ.$&DFdUGkiP@(]m-k*/wц3{;?>ܞ;ퟞ[U_R54<ʗTW?e砳M5 0[6w¸QѹN]rB&8RlCaF&KF+NAR?=m{kd`OE*JdI$"I )(3*F)u)]Yp wc{cSANQێ.Nvq\I.|>-fA?ޏ%ߖLRygO+: >G-ܩ~Vw#R>~6'.d+yE~&} y&%E"ʥ36>eBAL9tj"p9 󮶍V\z)6K[$ps z' =g]riw!j193Z[<6v)b5sɛͥ{Co`1b`[#p B접8,rk^{SZnu,r0P؈w]9>E8Smw1Eְ/IېdV"pa(qUZٹ^^F$2G:ws럩ΐz___p؝SW L=\v/*:6RA,J`A­Yt 38luSzY&pMaF>:K92~#8y\"LvdNWWDRԫB| C~OrA]T/b,+U.wг4)+,=5B}qתlےj~2/#>BJapmzn9VQȶ3RDZEN[;M|vDA/rEsh _"p$|T2SN Z_@29iWAc(D RāC6Dͯ~9]{~Ż_$کۆ1ۈ-z4p%>À!ZXJsIcr䴏 9pLS9c#ab:M21gmENr~t:S{i,:,3=1H|!2lsȒkSYfsjrz}(}tQ_E3D<ܬgy^jnX4 "9ׁh":>0;\u$Q6=sK+U~"Dv|뒟e.φa,xs;ɗe3|\抓`=hQHz%">cr`BJSZqAJnMBr,C\.[bva3n=Au\N4^a-'{+BqߴϬH3x5%6Zw9^-UNƞG\\pX%c˔cwбY9˯^~vSstJb?NEsX /%&pMaNNI"Gf$U3rVdL4 + %gO9S$ǢDbЖ??$FS"W&!/H=HϠT c@`L᣺Ey@ęRTVOOCOgCdo1} &m ;iOW*;fEH9G;p_Q 'r_@?{ǻSi CD$|ˉ.dC݈)BFE~NJ&c1xM 8-E0sx m_"sbڪ{kdD9reV#p!2ϖH T ӈ0mO)r7 dzgS|(6Ar(#J,6 aIEM~ãw[.DOt9LDGm>yG鑮"V,sk\}m7mŮ~ȭ\8 !Rj"KCt"'5ڙ "8DE \yW0cTc{"rj<&;s|ZW%6bх^ypsrxωl?83m G!dJ4MW{$py/GeAx#$EA=c[r:C)"s?#t*$&UZG*ށ< 'p8*+nO[- $ho.s<{ 8kdtMQt "?5 }Nѷcl1ON3{D[#p!s(4#u)"UG!p'RV-bKV֢:6k- K7sb&p!b9I "p_\=ഛ"p/FgrzoZO8NPs֟op7'hgc+}gO?M➿l ܡaB'T-$%u$IV%r C2"SvԄ Ee~&DjAP@(`./# %tut \'4Λ"x٢J$@TM ED@ Q_rRu'E6tYlfe8_vқ"CJMErdw_S$Zt? 2]VFBəLio)N8"pt~W\"pxh!<DScC$ͺ6;,>ZᙌQ BCܠ$׌]EaPI>A~="C?~LZ$#g+8m. \ށ\UQ-EF\&LXSzd 5H.Afd gDB&BiMLZ@TGE&NcCyjglܸqH~.nœBgdWl6uG7FkBŻ9 \W̱<ƴ|i t  8U_C {q+CDJi B_K9hc6ߑYE(̫XD-MB~ݦ"pϻ2"Ϛj!pwo .!iey?Ăx}]Φ*`2VЗ<Ȓv_VMM OJ%$5P$mZܜ|[قK-rh|IDjrsڼڛmZZܵ6&}?Nz5kaWyTK\RUwR{p9p/CtHmI^"D!"|m".~)VeMEʈ]:=P.A$ȨNS t rCbrV `Ðg 8.\9Ej%p!9!!<' cWԶ"-QHF8 qʫLc"GE8 \ pѷ ko(4.-.0)>wyGjâ Dܐ D!z}3DW1C-%eMJ@+e.uk\\)*Hdk:!ZOuwlD"?)eHi_'ggg GRFsB%r"-D.J INB pBN!/lf!YGD Op\KDCFD ӤP_H]9T#Χx !|q 6U{8Q;&} q|}!j=C4@0&q9sGtuᜟjL](̉Dm71 fa3@[}+z!3+%tz,z,B4?wzcs`ȑ#yɽ%e TFrAWSƷENh1#W(+#H4n?\*,j,PK)X<9_g Vg1g5Ws}ȣ,cǎM;mGUcBd]}/zEt7"*H|19gk."iQrS>R,}E"=4]Cfe7EŠt%“HӦ|{9:mpP΋-'ܑިTv_nuE~{9y:_v*%rRx yl=ե.ka &1Dr3-c,\q aup$"|#RdShm[a[r Gwy=H$Q}"X^2Adlr͖ꪝ! "*?,9wI&FL8p\T[ӝlĉhtË3D ¸Tp!Á!C_|f88?q ?8ly%Bh;Oea)m\ 2 :$+wHOA| ܯ% \"dggD_1.4VҸoJ_R^ߖzv)H@HC9ury )'5l 'z I"eYBz2I?XmR԰Hoލ/'zC:!A@γ"ǁZEosDAJ0&kjr6ˠy8|h!dq:JQWHDI9a\ϻ瘏!Q ,T\u;2ƘSOoNҍE|W@|D(K<n=szQ3`if| eܠ1V1|YczHR($ߥ+ CMHjGBj EBbGo6`UiCfԗv =]I"͓}+93-[>c#l[iȝ.Zt|Ms+5+7m-NAR5ka.N@"` 986GÁwCL2iH]ؒ8@KNV5 Q*\)J"(HrV;MMΜ8 S5.HdȮD,aʐ!Qk{F>MUqG}'ᰤh?/ymG1SB&7ewf<`;y>Ő yĉK '$ BW\}a,<̇B[ 'AB0Fr8M9픢X/4 E[%]C"oY8.GTE 2*1 qo7@\qSD @oOBgl%$)sVDxi <[kyF% / 3,1wkW97(EC\ICT %pb @1G˖6C:m_B}Zcꫯ*8LI)J(iDnSЛ3J.~%UT7!yBΰ}HO&6g38ĸ뱐/Ntq̛U \ByJ՘1cN$.^CaHcc'搰e ]I+7v`ck4HzU|4Y\RDjp{緳WYtر KBDBeu/;mȋߡ_x\dl}5kaFA*eلZ?*?<rHzA$)Za8$A&9Z^D;1˰{g I4 Հ"D\][~&CNb%k1*sʸIIL~Mߓ_CL` +'x ߯+Dw7JϓIT{pW!/m*HDr[k8f=;-A;:"gTc_$8TD}Mnt5f? Dj%]L6yÏXс`? =ؗXEQi\9rZ8u@CB+³Q,gqoz f93 `H3"D?V;Jvpc&pgaE.ㄅ!>V,Vin[obݲt AIG@, p vʻJ?}̣w:NcCl yW}#S,ΑF%'UwZs16vdخ+s/ɊB"$p!heNA>eu[:lXcf!S4DCtCPC6M.: uCmnz鷔J"cw?%Bt\"E)'\u^|lN~DR>GlMAnBr Gn]:GNaZnD鎥{$XqDFG[R~(koQ&pMamLD_q d2h#"D 'g2 "+pj##GnMTGɩ#vQ2-, kz 2D0v$dC"cA>ܙ(۱U3TILEYA$}cdďV*/"'&^ ia"K9vEJKQZIKl`JrD\'2'-ؠ玗!pڱഴe-0D01yE!p-Ky-4bF8]"1$"QzgR/H{ pE.1Zrp"gz/ H=P a\I)Ŕ:=M5&p~q ;2"pސiKB!Jg;zNvti2.8tBDWh?9sXQ(9.se"u+ q'gbG2Y1$I{yNH}f*M9S41՟"JYD.)+?E@,)mNւ):, !3+RY Dn& c-5`4'Ӊ}G,>Hc݈z,/v,i<>"G|i: 4n=,_B107\ŶGHCa9a"[Tȴd"NIPq/5TNy)2W5@B"ZVzߥ6@FH9L2J9gSȍEJC&NӪn"G%3 k,%|@v+yz#.;[mFvWQX!ny^ە4OW0,è¿-T?| fgTmEdTzK'DR&2Hg6>/˭\6"//Nٳ3n~A{M/d\ziTTI0F+ϑJF}o{[^DXW'Ecܒmܸq|2z!F<|QeE<:% >NP$7D[CѪ;h,$r b Gj26T~s~ڳT^L^C&Tq0!$ )ҔB8y(c3^HygBgh:hpnO*g/COڏmt3)ALUﮀ>N/~E?(m'Hy 1Os[O@.>]|Q9i DA|)ސ~2VP(Y{V}z]L}E[$mLE1x&s겤j]m Ո 3FUVɃ=;1rQ4/X䫩 ,n %zSA(&p#bLzr_"zrO$]0c3&]~`^TzG?=3؞@KY, L4HFS".z!pZ Ry:qac/1=P^1&CZMENKEX1;}E1_H-]+VqX9103/aw !ۧq)cE^׽nRD8sVX 8,Tcj;$ C+V}. - ڕUm'jDuy>bS7ZaQGd]6 d#h@KE[`4?.n_m;Bl7qHD$ӄFds% l"w m.m˻9pq|'lW;tǖ> 6h(l0aB"x6YeAId;}s2GI9`C.a2Î{"[jq+z tsӒryv$zfM~FAA 0bpCƫ"RD,yT%YD0d~`YK:Aj?2|tZ{d"WQi07"$#qq ܦ1sWT`AъIy6s^9yu,2ϰX<м`]36ږdlQO=g\6%2B,X e~f`Ψȿ̎"Rh̘ơqTSf>Pc< +#Dj|. ?xG{1;-]Cl\"X"A{Wyq2@,6wyƀŦ+摪$ \1'E(mR~x36O_D}ӳh h\W!Y.M?U w#Lڃ)L=k ǦUOh5ԗkR+[_"#DkrwF{<ºG̟ǽ"Ma\qEd$_dBbBB,@N@Qνb NđȔp$px [!cG-'"{AX`cCD#K7QaLnDR'~ ,mɽԏ{G{@f*,~8M)<Û:f , HJ!mÑQ+ʂM1͋cDs}mE=ampT&Ĉ\pBhpJA-Հl#]ཀྵ7mEuqQ\ 6h-yUCg;dfZuc@9~dwZrHAw@V#kC;* ho`q!I,85|\.aBXҟ17c{p% !}:]"N{5Pơԉ1x_zt9?_(B<Kr/ qqA cw{E[*s!HY],L0EA8)ZR {1!y YSJ2bzꇭ1iZ(89qj2.@GFD#vmgT\л@lG 6NGx%XdC#!_S͂uAb/[^?y펭ǜ@-v͡Oc~ac/U۫V=.v1ka4 K$= ^y!>a m, Ch-`KQ8D8CZX8 rk 90ׄ ?4 WnۆL%1rR7t11s  š="KNVWkEzl?u"v95A i >)/D pe~Fp1q|F-N;NDS6 ERO۴#F[>rBs7Rv !ϐHP+RP1Tdr 9oHH Bʴ0 ߐbWצA{#p' БaLEd}A"<cD9Unu?cyD/o8c\Q&{lgv, T;%1)\ܘ~-7$ H&At6:9eAD2! b+wJT"~7q"H۞#fJsr0+LͫwI]3}aL?L- .&pMa)m^ B#]vM-580_D70kL/ȋɁk͔/sGgC5΁&pֆ \%a \06W#/"2pH&BCprJG \aט^xzpU:ɝCi$W Į Fkђ0Q \t(v *h W;5 h0k&L  dMNiƓ JеkGZ|9LjiF{ \ahIuc=V8#%^z\t \0Fk0kL;Jn7|~+[r-9 Çolhm5Z&p]:"+2k엁>ELm"puʟ j0 њ0k6LӃW^ypw^}U7p좋.:VةSB=.STG\J{ \ahIuhȑ# {o:P5HX-8x!p3cag \06Fk0k4cǎMd&ZvM7ʹ%;o!u,σ>89Mov}oFkђ0x -(B'(|ǽefDR4sj\k0 њ0k6LMo_޽{_ܷɓ o wumw]oO /n0k$Lt$_,<#{>AI"o)Dj~H[@evam"p)2 e04Jຍ\fvS+e2x°a _|Nl Q+ӧpZk-!nDӻロ*B~oNns=]fz%p[l1KD&p]=;nܸdB(tڵp뭷DjA:O*}]'W&LH-Daц?xG⌺ӟ+be˟KK }WNrȩ⡇6r̨osNᣏ>Js'"4o$2C !])! -MAxEˆKK=, &曯zIS6rio{ \vAr@_#y)K<]s7B殩Cr୷*|}@ގ=:miђ_}Us=l0 wP8蠃\\fz{ O=sƥ E<ԹstT"6.c-( S[N8H8CzY׿5fzw2EB. :ׯ Gu;ņ,/+}L-o'~euN> ť>͎p'pǏX%U ^{mA9m}"믿d3q)1]ve'}х'RKd\][P$n0 h+E W\ EӼ%Cr8qqi"ϕ |>;ҒEIKysLpA!^eȵEզy "Y?/0h @%–"v2-y {uRGMSna[}S\0 3|?__8SSZ,%YvcQ..-]88u2RFyN׬n$>#:|DF-ȹeD:}aaaaaF O~mDUge:Tȴ"w}ꩧE &pJp/<4 *@B'aaaaa4@s=[ ua5wz ǏO":0N|0E9ܷf0 0 0 0 0 o"e|_ }QaDRߋVoe[N"ѽ$6"p 0 0 0 0 0D2,S>|xCw]:UeEڎ('jˈ99oEϦ[K{k7aaaaabС>8K U&Kѷ"bHmNN6H\R(+v0q[bcaaaaa4 _!^ } [.J퍊=Gͮk$aaaaa \<&L8H$ DDWͣ(܂>OA[>3 0 0 0 0 0N o-da1 AKT-q}E\v0 0 0 0 0 EOHY\ C3.]k0 0 0 0 0 )K-ѶAdʁ6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0Y`F:!%tEXtdate:create2017-05-22T13:18:35+02:00%tEXtdate:modify2017-05-22T13:18:35+02:00nIENDB`././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/internals/compaction.vsd0000644000076500000240000056400014641074756020034 0ustar00twstaffࡱ>  Root EntryRoot EntryF@VisioDocument vSummaryInformation( DocumentSummaryInformation8  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~VisioInformation" ՜.+,D՜.+, `ht  t Zeichenblatt-1SZeichenblatt-2SByte oder VariableK Rechteck Va Umgekehrte geschweifte KlammerDesigneffekte.1Dynamischer Verbinder KTextanmerkungrb ZeichenbltterMaster-Shapes0|_PID_LINKBASE_VPID_ALTERNATENAMES _TemplateIDATC010498411031Oh+'0 X`lx  Microsoft Visio@      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrVisio (TM) Drawing vRvRVآV3?wVآV3vLVH3?p9[!i fTd',50fZOlO~C.ߐE#PQc:  A ,U345&6&9Eaaj6 8d7?!%3 URg L-ak@9$KtiQHeuDDT(!cp;/paM-uh\`(+AT %5+H>>5a%h34ovJuX0Hp(!MmcP=?`(z?84?D0pA D7!U/i 4?Q`_1_JD;a3(/@}_L/^/L%a$G[aY %//// ??.??R?d?v???V[l_ru@+y_w-uaDd/r*&oo*o_Qv4DOOO\U$/@__o/DA/Gj:d2(joG2O5j7@oo ooo?&s2;IO[Odd 6 S( $b4@SyYkO(Or&̗T4EDP7H+&g-.UEd \Uˏݏ____"LwU2 r?߱GXDeTePNkcc#ER¿{%ܶ/o Mv{&l|$6&w-!a!!!1Lpqq;PasqKwHVNT`F[ȓ !z䥶1 @Rdv%Iy -bbbbbbIbybb쩓DMv4,}J(̽~ .?Z//puR/MrGK9&/@:?LyǾٹ  /r p/9cߓAdUe?w?O2{OOOW _u// ??S?_,_?2Y?????oO@$F=OK]sOOfOOO"e 3C _#5@_R_d^uc,aYo-o@CgG$t$#hoIlZFoBQ`Ѡ1`ConectrWigtz70aϧAQ` Ed`cl&K`Pten´99K@q^Wc8Ii߹l‰ݣA͝>†p&U5Ruig;(X3a ŀ&U=HTaWsprnyC™ͺIJrBgt24`.SQȕ0xPt4"H$ @Y,b'@ I A-7 ;Ut4"H$ @Y,b'@  C-#*7 At4"H$ @Y,6@ ,I{7A-7 ;t4"H$ @Y,6@ I7A-d7 ;U!U"#$%t4"H$ @Y,b'@ T,IEC-_*7 A&'t4"H$ @Y,6@ ķIA>-f7"AU(+,t4"H$ @Y,6@ .C-$*7 AU/0U1234U5678U9:;?@UABCDUEFGHUIJKLUMNOPUQRSTUUVWXUYZ[\U]^_`Uabcdt47"H$ @Y,6@ Q|C-T2 AUvefgUhijkUlmnoUpqrsUtuwxUyz{|U}~t4"H$ @Y,6@ t_C-D*7 At4"H$ @Y,6@ ICA-Q7 ;z23456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcd*t4^"H$ @Y,6@ 4P6C- A;X4@t MR@-NR@lY9MR@Y9MR@\iNR@LZ9IR@Z9.NR@,[9<PR@[9NR@ \9[MR@|\9RRH<(H<(H<(H<(H<(H<(H<(H<(H<(H<(H<(4EdVREdREY9rREZ9REREZ9REZ9REd[9RE[9RED\9RE\9RUR/0 e UFD# Th(/TYTYBBUF~?x<F BP(?4P?+ O @HZUBH??!t 07{B`8Byte,BiC ,NK bU lE"KY"i;nG DaC"h!TA pG SoUfC wm rE"S{ d!cPe ,>bjE kC  e^| 7  3u ,7=OasNDas Shp}eaufudZicenbl]t) ze.HD   3 B>Tp[/Lp?as&;.h> ,b MJ=UF~?FV*JR?F\.?FM&d2n?Q6 U AMA333u` ? !+5ChMW]u$g>5 L@X!$5 /`Vis_81.chm!#4E"67M `_!b-"#"'?9h:AiA 9 $''2ǥqE0&!$E0&!qP \@6%A]Dc]3V:?Ka!Db1OCK%YEiO{OL@ODJv%YKOO"NBSB53^@M^U_g_y_Rg@14ot'2TALd"2(Ech,@!3qlf1U1 m3 =M!l+TM9M]a6 `($T 6D UF~@xTiC;'h>4bP9 EUF~?L&d2?F\.?Q6 U AM| ;;u` ?*#)3=KU_euo>5 L@X!#$5 /`Vis_Sba.chm!#57_ 2#`$g!-*#*'?9  %&/7 aJ=?Iy+#&Z&P?B#2N贁wNk?@J'q ,A MVq6q4!*#ekab1; ?Eq6 I-BCb:@e2C1%>> OO1EA5~%5]NGxOC9AOI%\O`JOOrn_gPo|'TAFd" (?cp,@&!iA%9 -$b]'/2q`&!gE0f*laUmHE?KlT(]9^]-Ma6 `r (QJE-Os~%_s%/\h}Mf!>zbcrA bb HUr ~L)uE/>F *#DJB dYbbDW']Qo@t^SoCPUFDfP h VTB UYuU??Fxha T,aaUQJ\UF BP(?@?F~?$-?P nL#l]dV^ ] $g]Q"U"Y*"]>"~#<?&#A&Br&C"u` ?PYu"bl""& M&u"u&u"u"u"u" ,u" ,u"4,u"H,66t#\"u"///$u)ar;21'u `Fxu21yB}BAABA"!^hO$,@ZLupO耑 @Ca4R#qt{u*gvXWcZufvvWuTj*uX{u ]ʤ *aGIJKMNOIQ"R$QTܝQVWXYC3333.3>3N3^3n3~33333333@33Vf4b@Vqf0φЬ uZ1[]^s@333'373Gc ƢEt&EAxÎ;BA}@c"3"3."c Ӣp x/3,S/e ~/iRfSIA62ab ZaLxVIǪ *:Jzךת'OgEa@braĠqAQJ`FWO@r ЀiC}F@`I@)@AEBsZeȓ3U ,puӐe(p 4>{ScNV:fcfR:bWKqP?@pA3VUbQw Sio@(h#FtϿF@ qRfa+_i&7=akVQhaRkQclQohaR2brˡF@#I~rW{ 3~TE}O bqO cy`I@Ё`sVRڀfK@ڀbooOlw wKuK`1s*8zK@JqyozI@ eoo /uB s!xx7SlP4;walPe,0kNq @Jq.-8r JqM9-t '-E1*dbt+r sQJQLŌH{M0tb;{O,=CƁS=ԯןƋM2'Kx~{עamzD1-?F|ǓnJ\˟ݟITjU˫ˬ7F:-˫YkIՎ_TF ?BP(!RQ!4 Iz{7 F.!`}~k QhaqY.!(SFxfb@&7! kRka},1ff",1~,1ff ,1WVHf312E1kaB12lQ12a(712,1HfWV3UYkaO} mlQYBaYO(B,1WVHf3ka lQ"(;" FHfWV3Y"]#kaS#" q#lQ]#"]#S#"QoDcjWV3,1HfEFWVCaHf``5d 䰈qGA8rL5k0BAK6 k0L5k5L5|0V!CBL5 = |5QQ5&t?U: =|5vŦ547 P@QzqE4HQ7b&qn24Dp)CTU+0F2o$0jjSRjaRD9Q#eM1sB=yIZR1s^lZLV_4pQL׌HH.5Oa 5.. ^fCmnfv3p` T]`avelShift`$xa_d@a3p`OΠ`fs`m!*_a@@ VV%Sr V:67sGr:2!l7s[r 27.1i$3s 1T$y@a@dvkQXU.q.'2rqty!,0}v`n$qqt7v-x8cʁEl@baa%]1]1!H$rI*J!1LLLDŽkq+MԄ .NAOAAsQRe.S"T/.rq.qqAWVqqFYpRBZ}/b[.)\r].QLQ_1(A`ٓza(.44.;[Rx a;`"[TBf"< 1W`B`sh]`cu g`f&+o]`m`t`l`g`l*?`0qH`.:jx +\T`x`bdvq_v!L5~*ϫ16DP`)_R`Ht%k` 7DVhzڠ2xQBuݿ)/\BanAM_0qx2Ϛ0AP*(O`a`*4dFxgy2?Wʷշۯ-K08&4Fb[mD{ǿDD!s 1ϱPGYϋ(6ѲĢϩȩ5hA`# &AsDEy3 UĻɯAv^2`OnwAQ9)(ĽBT0fAvH`Uta)Yp!3EWLnew@)ncbā Av9H`ER#t6Hl ~)99:'ϟoP$tm-At!BT)ங'7İDZEBs&1)/I4+r/o/Av(* t/% *Pa#/?4Vir4F:?@^?mAiCOOOO6O=nO Z\9?K8/ `v GAAtPT&xJb=rb+ Trt*P@?B#o54trptb T mkqőԁw`3P?squ{tcF~ϿF@ Y%ukp{`?u %,Vrq @V4`+AszSPsT3 )5>%j{ိqi!stgq xŕ2htbrQ? !3'󿂱/0 c{[яJar<`Ѡ 5 %*5}9ᙓ @r^rlA$Q2U lQQ؉uyhU+424r@1Ryɒ^rx@7.?@hzi?wԐH}߈7c6z#o/|UD`a1H_\"p1@&WrBdeKTv7.!ԟ@V) `aGo,o>oPobo1qyo>TooODowQS+F搞R6);=[vrrQv>LUF+q StFUevS߅x$~&qޗ݅ԯ1).UaO|tǢKT*ϰd4)'ߕr|<ߒM2/WkNȏ%rQ|evʭVlߟU[#Իg.gM1xweۿoo1CBSCS/e/w/S~eB]v KcVFO/GXiPdU:Ǽ ڄE-,/wb/cƻ͟E/?'?*&)BOZlcƄdUO7c*&tG);AEOb1ҿ)M_Cb.ϛ]!_R8Vb=x](' _ ݂?z-sT_Na2s/@.g(O]Sa5 _;;L7pwrra2wcCB|WV.gWi gU1gtO@|{럘p  D g,l;;.o@o*aa Oo0Ґjo2kJΆb`b~Mk 2(s.®%)nd\S?l$`-@K ay!*t1K쐴^VQ2CIUdUpς1aanOa7P7߸y!X16BòJa@a WE1!UަQb@72Ce$6N ¸ջVcIpb)L(aO[Ne4 (ga# f8 \ 2d T!bu-(;M_qڋgֿ`4@?F\oA`0ΉjM09 Q(3b8ye/˸?FƣE?Fp5Ys?F5&!Q@Ή( 0_Bԃa2U0*s3?ܵ0Ԃ2 k+ݓ0]'%Qn?Fѡ?FW^bd%?F?Ԋu-Q/c,DJ}?5^I,QIƥ,$~//'% ?F*^Y?F[E?F|{T?c,|гY,vݥ,-?C6*~??b'%OZ`?Fa)P?Fů$_?FPvϟ'͚?c, h"lxp_Qҏ,mV}b!)/L FAOSO+~'%`0DLJ?FNqVUO:Oc,~jt7A`,ףp= ,7d__Kh'% QuU?F`4pF?FLAD?X@t]_c,io?JY8FZ4? qۄV$N@a__'%X/~%l3!?FeY?FJ~ӗ oc,z6>LZ4kw#awivQooj'%'-q?FmUa`2#+?F(%oc,Y7 }j GfZ4 ~,ClL^!UFV{WE?FcJΦc  )?H},""3\ \ -YVqjǻ )1̶ Ѡn<δ m|ѠaQaCSVGh4cfUpi$5,)֝F3L&AP"iЧ Z3*p#q8 |`rXӗze2ZՊ@ #5.?\zi{B  ȧ#ޯ&&JJ\BMV㖿t侜+Ģz`rl%ǨΩ)1@8"4߀Hߒƿ./1*Tύrˤ]c-=( @=5-2-9#.@"~C Ȓ#@ 7?D`Ofrsetx %q,kڡv hE 5ɞ)3U+KGAb TrKvlԐhi"//ׅDzW280//?(?< ????QcOwOO)O7(QOأTx7HUI' Xߞ^Ba5a8_A88F< $"/}#ST݆B CW]T@eU]oT7Tj(PUFDfP h-VTYYU?"H$ @?Y,b'@?xTT;͑U@ !@ү&P6 lAu` u(Jݩ c?EDe34 D   J ũ2qL lvF BP(?L0 `LineTray sp r{ ncyz۶&` v%P t e n&$`u v%W{ igTyt&a` v%_Rouy dw")g&A0'2A{Gzm?>5Q?A^n"`Fw lo0~/+n"j?|?+5/!4`S:Ta ow?<*+` 9?& ` 9S5@y0eK $KXOf@s{ 'B $KYtO 6`9UM@gy i@i04Ai '. `%9Dw AcNul>k$Uhh2Q2QEXT/J> 09([_q_[_o!otgU__o_oTEooo,o1A>Te\Ls c!2TCt1MU$U<"itjt AktE*Q*QURmtQ!!otU p qU r s-3"!!uGRvTlwaExn11Uz{Y|})~ARɄ22քeㄐqJ"T c 14.m"?<%Rpsf0M8@H8 MEJUU8!r5GrK&HZ&H͟@G+G3"?GERml&Jlmyome>mGG-GAUV>6HԂyϿHႻFSP6HuANqe (=MQ_'0Uhv$on!3` LDnFxB'3` A@iBݞ"4` C m@bAxB}lewL9WIFE/HU= _6p9yEW49dF<1L#DMB U]]@e\Y]o+T8]:aG71]PUFDf h-TYYU?~@x]@L'} V6lX-1u. Bj2u2Z2j2#u9r#ULH/MZ1+B#AD5 60`Vis_SE.cTm!#20AD%`>Copy<0wigTt ?DU1f@M)@c<0o+@'ofdBUArX@Aad@iV@n3@ WAl@ef@R@6AtBvBb@hB@lBAJ@=## AoG?9/#n"E&444 7I#$@HB59_lj#"SV6U8*l>(Uhn E /J$&9"(Ln eg5Le#pheo'T !! Js~o/|R12'"U7A%O3W_7xr5(-6 `F2 xqu\J@#:0b)&`AAs)@E T@xd@Di e i=M]UJh#HT0#3 UEJ\}|U@f?@3!?F~?FL&d2ٺ(1?P Ǜd#pa HkaQ"U$"Y8"Mx#BU<&?&@&A&C"u` ?F]o"fpy" & G&o"o&o"o"o"o",o",o".,o"B, 6 6n#V"o"///$u)ar;21'u `Fxq21uBAy B AA21"!XhQ$,@pup`Ca$Rou@+u*LfXQc* IRg fbY-H- M ZU ZZZZUZZZZUZZZZUZZZZya-yyIvJvqyyMvNvOvMyEQvRvQyTvTQyVvWvXvYv3* j|%5EUeuu 4 蕺!BZ)CT@x@U @n@o@a@%iEPn*Љ4J1[v}y]v^vc@x3+"" qؗAU2Aym@xcv$"" zp$E1u/w3,#? N?$hVW9AB[bSq20S hV1Aqׁסױ!1A7Ig?abrXqkiqruׂ6rS@6'_@rp9SR2MV@׌aV @aU-ܕ?XrcU:uJed*ɮ᧤N@q37sfjBA'b6bjB'#KPRQʾqjeArQ c@(3FA{aٿA3b!&»F_ v7_M%;f!xjB!s(a?xjB,2brrP#VFI%r'#7 3%Р$UM_ }uj_2 ׂP5GׂWsZ2bQwvPQrT_@|wu‹ׂPc?P 5uR܉͏Cgyc(` q(`e80{A @9-܎ Ʉ '؏bAP42Dr \sya@Q_X俋NZ]b6 O6͒z{ # Z{u£@%ЊׅqmϕDR1oL^c,ߛѯgZ $j%{|ב R{iۄ);qσ⥞occL&d21b}aN/9K!KG'!cpK1a81YNSFxBD $e0Bof$z:cRTrDBʩya#HuzR j"^vc ` T-pavelS/hit`RHq/tq `OfYsfps}1 oa@@VVSrlV F"1+-27i41Tb4_qt_;aXUZ'2rq_!n0^Spn4"1PT_sE<raa-A-A1Hc^IpJ}bL;M 2NQOQ1\Q\QQؔcWRS򔆮TqqW&o$Y@RZMb[Z\g]tpapa_TAQQAbpJvq;Ϥ+bܤoa pQ+d0AW`BfpsĠh-posugpf&+o-pmbptdp^lbpgfp<XR*R?`0ȁfHT` jd0+9TfpxrpbASv_vPQE~ 1;F`a`пҡ<Rfp%tknpr !3EWj|Ϸ2HaB^׺/9Bmqn*<0NHBew0yQ̀~`ϿOdpahp+=#bRdﷰ4z:$ߢ B<R ai*rp iisXmTZdj `F1H<zՕ{xMOai?ޯ!_` tD.Jr5<}= ` K* `[Z l v 3mAxD{z{.gMbeᒎcQɥģ"Ĕ,/ħ<w{) ѫcĔpĽ} ѮmJ5N13_MsSspy`ID?S/c}ba K"eb@o> )עa2¢ `DVh%# UD kmjBt2ߧ߹$c褣%!rr[Rf`}aTy7[C3DnUbe|b;ruv`Up0;nr`1:븁X%`?$2$N1} Y4Brb@qAa-aa;qa `//5?*?cT Z "!0ЏQƽP׳M+Q ܒ*QDb)QX\T׳a_uu`bېRIu}ܒQ (l\O~?hzP-îLޯ)ّ `{Cݕ2YǕT `ƲG . !ё1ɕHᝢ WGMĪ ?Ɓ%Qx?ˆt/$Ͳt ڔ,ş$O4  ,o>oPobotoobo1*BBZВՑ7zBoaa^屓aG9gl6ҩ$xrNPƯدk)D _& 3EWi{ߍߟ߱ /THZld Z_VjhRdv=X|w$%F / >Pbt~44FJ3x<T+///(/aNO:QN9O:////./??'?9?K?]?o???1???? OJEOcUQOOOOOOIYvotuoacVh͟y_T_ j &m toB)j ooQvwёʮhg_#F K?F&?x?0l}G{,:`@"   -?%aEr%Õ))EyXR} o`д$#?ęxQIr/xUt,bwXUl0i1ewvv֔tQ=Q)R}h4FƶwGYs?CpYՕY 4e%{QHvsLQgŘ{)tUbzf^ȯfܓ֔% E:a`*q>^TbtxoMdǏ@هT/f/˖{OtC]c VqǐI֒FV –nUF?vn qsɿ *Ys?F>?F:Xc?FMڪ﫰|JܡtQq&A=QngiC21MwZ漣A$rqg0N܏tE˔F*CUy ,Xjw=Oas߅<`ߦ7 {RC*OoNkrfŜo-?QKe_? Obweoz}&U.V@U4kW5wR<k 7 fwdůWdvw.ϒ,u6^.ڌ@(]/5Uk@ k@Dw,|@q K0/'LK9'Cm0ϾSBs2ّ5)\ls?1D@ q>Aw9#uQ y~qҰq٪$E)U5G1r9{ a`pM>AkVRbדL!.UEG!ܱ'kWH٤*Jn}viIpU'LG(A^|{Օ4߭9w7;Օ f!+S2)kt/'م"Nj$6HZl~P`4@?FEO jM󎣈PuY Qᦤ8%/˸?F#eֻ?Fp5Ys?FwtÊG?( 0O(LпDJգ<}?5^ITLQIjL$?~OOI5 ?F;?F[E?F3Ϛ)O(L|гY<ߍTLvߜjL-C6*C_U_'5OZ`?F3$i?Fů$_?Fir8_(L h"lxHOj?FeY?F܇]}(Lz6>19lTkw#N<vuqRd/%5'-q?F0 B,?F2g#+ׄ0]/٨(LYЍj@ T jLCl#15v?3FV{WE?FD~ΏJNk(@(+ WIHg}jLzB՟$q$D*P!)=6?zH7j A^ 3=< 2Aġa1aS~h4'+5.ϼ7O9H%F_p8Ɋ( b-SlJg&ǯٯ>qA>%7IWt?&t:NO/ag#mҳ31>ũ!bX,!.@-R^rC&Aϵπ!EWiSh:Mu^9a.^;g?&h&8!AOϓ{EEEW{>h"R7"(P!1('b!)1jUP-29Z3ˡ#@$ 1d>"wCCZ3Q%p1bؒC!p2@&7DZ3`O}f70seto?uܰA0&2,?>?P:v72p&1"E$A1oٿA32ÿ&A>+5R{w,0';)w-eV-jUCU+ a ?%A'; WTrvt0lghin0w8M=Bb7OOO;J!HR?+vOOOOO__????(?q>_]?u sEtjqttHD: #  h  T0]]9 # B 2AUAɿAhY?ٿA,c2ֹƿP6 Au` ?A@j$u#J.9axu`u]`bu`+u >ڍU@@M&d2}34"ÿDC'>"M-w'>"D(p A "'$"&H' O#&5 $s&]$2JD=#D> D6#U`l"_# #1?9#H1 uNWzIs;2 8J#2zGz3Fx$2[Ru(/YB DU_V?\.?/B:o:2A7P`BackgGPou_ndCM`lM`HQz@@bZ}H D?h1GA #X8P6d3662Q1CUBF4i7o117;y0~1Mr)Srm>de}mspTt "qq"1 1381812tMItBB Eb'b$4ANu13[h2AuBH1BʜA!ʩ¶jÄ[QЄT݄zrf>!$0 %3To1/u/u?8XxAC`IWsSwSwRs%o.@0RgPf KNC`teI`\ai!nn3uZR%d DM`kO`mtiM`5HQ-2HZv#`NC`o>!8V@MKsEŭAد3dVrbRaPags0bjkTykp~1])S搹qO`zfY`u^s;cTͱnA²oivlPA$*q#8@q#5$rQQR*E?eNRעQcBdg:b`OTndGPuNEb;StRaaGPdB[Ÿ-uijd[„6k~]QRƀ@gP@ A>LEs?e\/dϩs Aee"g 9bY`dt2D-Ÿpsr- Sqv߈;`aݔ֑#pS~>"ƒE*ȯ:b` Txk GPp}1Բydc j]aaAe(Se1dSrʴ &e%\g#d ɿRf);M_=7DßӁ„{81,[/O^kxÅi-ùƁ3 uI[Uu`  *L%LBW?AP)Es̲aٳTe"/)#We"ɧ??? ?:OOB&c_ //Y`6?H?Wis??]CJ_ oAUCGP?e`(__! m2oDoVohozooo0 siԛOo oW}_oOOOcV¯]WץR=Oas-](]uќoo~Gm#oTw {Ɔ҆΃S 6:0Bw)s͟ߟ'9ρJca:smQm Krаe/Ȯя- voP* V²#5VUo"/%Wo"O _._@_.o*o/**u(!S[mJ5li@eu+arw% UR°l;Q@nt9'G} !M @o#1Ϡt+o_1OCLRʿ.@=(*jMD`sprkND߂ϚByiϹV" ?5G&8߭\n߀޲5F/=$2&"4FXjj"j"/ɨu*FXjv_?q????9 ???Qc0OBOTOfOxOOO8B+DO!O=`Rotyfb)]O( !1idBm!?ȅKbB;rbrc`R@*@;H(iPB_)/BE!1v])g%oks{1tpnN;GWewyuPz%doaqm Bqo2;a2wtSkmQb@nvUaTtnsb bdds°bjTq3o: rrcjKbT!E!222?kl;!30kC2m2  aZZ!*kψC\\E&&BGO ='`C²!cRf Ot9d_D@qA,@"hi."4 b bA' Y! Pk?zz!!_lDZU!!'7!ƕP d>"p}9+6@eDX]o}G]~.PB Z` P_(LT?:]PD',E5IϿ ,1X8d:PjH1/U0r4,,1)*AA/_"_o & #QMQ,0#` B scriftungm,1 `Cal PoPtQg1`E}u+iH5u1! 7 @@j&@@q`o?@rb?d-e?s)gUA$ ?$%vr;#xAZ%RiLPE" 2 0"U$2 ur! |u[]4 t&&s~rzlH1AUH1?iiu5UAA2zry$"!rByǤo VPQayl p-LPnPʡn/k?Pp rN 3Qiߢu PuPw 4EPtTIkrPo?PlΣV?PrPTRʧIEz!mr󢴳W 5D b9BTBnPnߤz 6VOLA !0jA_S_e_ŕ{W'&!3AP!|/2g1 D1y 3 H1D1oE7q;Eȧ{e|lE1@@~!@Fg#?F֌"??QkPyA`Q27W˚ATl 1<25l =cl@YmfxAj`PL!@@[g?+@@1#_  +??@*o4?PD}p\z׈-uru`u0`bcu ,0@@"o@a/ ("q6y B%#u2#*"0#ᝯ2,`6@@Ên`P @$Rxww &;01O5l^3);hK(a~"f''ׄ?[銞<<h.?l"dYկd#j_u bsUTK0a?DbB`@_bz I/!*98`P"3\ o"҂3q@551I7zrQQr 9:z:a:a9aaR=R>rrqdQhQrq(Qr q2aa0tQmO\[|RlqlqⴋrT,@rLQux҅t0q^qs pC&Av"rBpsx^֔u~*k sa4azuNu ca@bֵf7sa9ՐxU܅ŔrQ9PCaLJY„fD/@rF*PPV#Oj&TP@Yn`@Q.%Z$yaUBafp Uu!4q х4s q, Tto! ТZhQZi5,Qrc3WLP@*(B<@b@t^?A$@o.a#@PkIKr3b3KlqJj/ â\Ca/O Yn`PQFYYCOǐ2p:F>pKBrOgOq/LKHHKEKːYCJ=Aұ)VZn` OzOOOOE^Z___*_<_NXQ3|GCA|epPKd @A[-B^ cAY£jNT '_%k…Ž_Zoc ss&qg1]JSr|([w-v`DbKOb=~h>fkviKleN{>f8{gyjPsKϝ̏|vRTXc[HAmeZfDo1ock2DN&xݟ^pP*wwjo>f?ʗTٛg>f,GY^4Fܢhn??Qa%<}dAc)#]K2At^FA1?0_P_b_k؏?@ܑ9Zm(͖pB?@qK:?@W@ή8W?@S^H?ssZ*m(5=*/P#&?@!W/?@?@FD'A&a?@0?@vj6??@^ŴBI!O&J6/iлH$?@ T9_3`?f\Θm({E=T@m`m?@l6͊`$Zǂm/&0=ficUo@@K^9`lخgA%=,^?@tA XP@@z(fkT?@Ô1fe=j.ƀ?@P3{@@5 I]ͻ?@+ӟ wu=~@h{?@j"S~#HXt$'=)&3I{(?;3 BP6Oc= }…lO'ƯدH6?[0 O۶f_@3l~ !H<@)>Pbtφ X?y3yGPU)^BPԇOOOOOOO__)_;_M___q_______1i/{/^X" 6q'AS6m#p P:yad4//*/E$B ?' `?FM%:# %?Q.(%,",x>Pbt}R,>bMt=ζȏڏG"fFXj|ϲxU,įFX*pԯ8GB(ma AS4!̱ Dq 2aaJYPcy08̱u) {`gl6 @@L"@@Hh45?;C?FwG[r;1'u`Fx8<"\YP"Q!cZ"[!y!!02..ȣrq´"T,@-@<إN-9-L7Cz`WAoubҟ Ab;sż@.v̟6 ˟W'?̵A4!)4TB`xAp`n>@tzj7X3#|گ2п6=#@X)ܽ+?-ryN ~Au`u`@rb?5@ȩ.p@Őc)a&M/_)s6})7Up`uR!cA*qK@2-[!Ue)aYգҺ#@+("euF@X,@@cP?$9/f$Ptw2wy#wI`rSbK3`8q \~a, c֩hǐ⣰  ˩5< Nas i !3 w%;G/?/e u @N2 -< N6£1 h5s1.h fx sN!P 4b ?O0A&GWA///&6?+//O*`׹mD11CJ /"ǗNO`O//??M'X'jY K"K(;G"JK>1?/KK__O]?o?_"o??MR& vum]p0cKoeLlOe񑡡ojFxk@?vKuS@Rmw@|PmƁNaGy}A<"po Bpp9Lp A? vEqLJ PAdrHXLJ,HwX!kmieT~A#5@?MVl5^l6qBV0IPo oomDu׿߉Еe n`vc~ae` TmavlShi"ptпome`eOpfҳr$ ienюB@0wo0oO!~_=@`{U$erdT~?L&d2?qnSU^P^ e رT|E?U  ŕHfc IsJ026q6q|qLԣWM 2N&O@Qԗ`R`ԇAT&qUuVrIW)rX6KYCZPr[]8~~^]w2Ѡ%2_䨁@Ldq2јqq-;X |pnԛq'VUAAU{S@X,@@c?P?]2vÑrHTn?O#@2pcr2ql{ԑ١U^@dإʼnU~K/MEp2mԌq $SqU£rIdҥqҦ~ҧҨ(ҩ 5JJҫOI\ҭiҮvүҰD {VuPqM/|qf 1 q/$r89UƀdK/Eb].J?/ ћqXՈ!2яՁ=7&LMP5,Ku/?+/UF BP(m???*?og6oo?M@]f?qoooooo\ke?__O\Z ՁX9/ӘC_U_KXF_}6Z?Fe#?2”,zNt/DF`0 &F1l aPdl/BjZԘl-U%{ 酼N[b?zf^5OHƏ؏bo2oBbd?Ffl6&FF?FuWu~Z}1Ԛ\ ϥRsBTЯ*oo`GÊϮݢ${Կ̗ޟM2.RkO֨ϸ"4FX<ߺ̱ 2U9MSiO]yd!4q<|a|aSeOZAkQw9+OO!@ Ai1/C.</bsPbOo@nZA">Wi{;^5˩?@Fmtf~:G?@?@;:y?@A^}/9*[Jȏ :g}= A?@I l?@C"<%0Md 8#(m?@'`sI@DͰMUh>OmHaoW?@&N?@?@?+%U OmHg6D~)cK?9?@_1n`Um,H_mH揷P,P 5b?@|XYm˗_mHOgOw^ G/6/?@$!?@d%FV^_mH+5gf 밷?@qK"`:= ?@6NZ`4olI5gN@S:3ί?@f?ōo ȡ4$1qY?t@ O=$rb K{ӞvD '炏ÏՏ"?V N x4(1(<1>=ŸD?8Aį߬X,@@cPx114<1U??$yίU@?`0 Q/TSi^1ATs]<kQ'/2qqGaQ! Q#`Qn%bC6a i@bpCa zq`%>q,W,@Q"c,qB@>q݁oӂ_=@`{k*#upq95"+aq@uo5ubO lҊq徶#Ž#UU)*/023456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdTUUUUUt4l"H$ @X,b'@ .9xcC- A;X^ !"#$%/023456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[J\]_U`abcUdUUUUUUUUUUUUU     *t4"H$ @Y,6@ :7C-$ A;Xn@GRR@X9.RRH<(H<(nE|GRE4Y9RU`81lZ?#d@X*a@ LFDTyB Фuh$T UF"H$ @FY,6@Fx3!T!!&'*U+024U567:-[2ABvE.9CGHIJ*LMN_$sUQR%(!TUVWXSYZ[\]^_adb)!$& .vl:q;0?}t+ 4Uu___Бd!! @@t:N3@@p8@@x<k ?)/>r]u`VT?˂цۂuы o,9&E1+?JJ4k!.//#{!k*y? 1 ??T??"J)Oۂ)Xۂ̡X˂c ˂즀 c` R?"2,1,6UGI  ;6:8&%@$Bu `, @13q(/O%&aEno%_}a kZ&ooaY՛e\o ao^%CU%&p~~XA`rτϖϨϺ_dYkdvҏPB2Soeowo(/:%X, I/[/m////X[//&=-??FdKO]OdOOOOOOO_%_7_[_m_______o!o3oEoASeot?oM_/ߧew߭%+=Oas';mP C5+s:%~ʟܟ&~.֠/+-5"3 ?{:'?:??Q?c???`r?#"ǯ>F;U-;0BTfxm﮿ҿ?,`?Pb%ϘϪϼ(zp;?OOOO*_<_HZr_~ !?QI$\oBOR._SG;OMO_OD\z?@@#U:LDybt `a °;?bQtsuw<Su wgcpl~=O//P!3/E/Z!k/}//////_/ ?? C?U?g?y?e??ro??? OO-O+=OuO\_'__O@__M___/Aϕ__w___oo%o 7oIo[omo2)ogѩoooD LA@Rd]ou@ ~xFhԐxĢr?lvKbנ*=t?=8/O@!3EWi{*gQг.֠/j|5"  ;Re#5GYkvx+@@@//),?°;w&ɽ逘U///)*//ƾ` L~nrCo3orzۼb<turS7`` F~l3"` ^A.%88=G"?4? F<GFU?g?y??6ҫ??y??OO*O4o_Ͼ|ooooN` BTfxz DVcu_q߃ЏEV*JR@@f?l60@aϮ6ј( ?ȯG?*< eſ׿1C/gyϋ!?ϖ -?QOas߀K/[OmO);OOqOO3_%7I[Pmv1T%L@.N"Ia J&TES!X *gd @ @ 1A1aAk'd<58WJ&X Go ։LPL&@@[1@@jZoP@ ?ptxu?G[Ir;@Ia'@u`FxyQABCd,rr ,>-p"EXacIar"O!,te1bB8!jaO!)Xs8Y~ٯIaRcIap pKcKpׂKppp p p p p Z^^ Ia($3$4aO!g /o.ƒ̀nA{Gz?z S&r` S;aowCon+ or@zq` UFPl+ PѠtUenSRu0g`` ڮ` 2RRqk` AcnetA]*Q` Ωq8"W`TaspѠrrcy¿ԿK`Ω޻ *̫Sy+ eU X+fstm Yp`a/ `ΩDP>ciՠ6Q`ΩMѠgiin҂aSxT?@@@F BP(?QLPnqs5~sb qIaug `4?uPrj`@m^a=>RyQ1aBDDaab܁܁C"1UP8ai10E0`O!rCѠ.F7!B҂a1W%447*Z4 ]],~hT8e[/F|$//r@/?+1Cu:9)#Rrq5pqv6?@r`3R6`@p4@\5A`a9upXaUu`NAg08d01wP`aEQrNC`@rJ$,n(ׅ&r%sF@畤@D"ؐBv`t`O2а`0-q#`ImrSbq3mР܁? \pq?  paҐѣacאB*nVНnR__?\X eې"c)j ;aBчf`jp Vo_ __o ejodoooh(qCG,gQen[bt @;a{-)bn ;a\ңd S'o{UzSe }s;A=}ܱ8k=p!db,kOr v.4D.{vşןȏダ*@hmkצQmujD 107 mDŽ;MΏ{:EjFv(7+ߟsvϷϼJ\ߒ:~J2_@DR;}20c3mKRaY~RaOFxcAn0"21;10;5=D81aED22a`a2^^~H?DPILDpJYD##iLsDPMD 2NDOD!1-qQDRDd1 Cϱ3TDUDbRIVDWTXT(YTZ)T'"[6T2kqkq;2]PT(}}_jT!!) SQ!“R q;TbpGD1?Z5MA3 21ٱٱ228{0#@@D"?)oS3&"b, _NڿXb޳jx{a<]ĊglTD~U;1BX~=B85unUWB8(`@7.?@sRs26u?@^Gk؁D$.G9ICُ,Oj+hZQSR>?$6 &X/ o9Vx!ާHh#k//sKχ߮ ` LainFn3` As7a/&.A4` mp @-yQj"@=Oa9H{F#PP(?!3"<(?W#"@0T3T/UC @i! woevPd* "aԀH"@2mDz1TLC~1 5?"WpEU;1/Ur!K8BORG_SE@ h[/">Pb E*V@@Nt.@@\.?@M&?d2?~DC?Q:IyR~=IyR=S6JD-xUJĤ-IJ#${X#S0P贁N%k流bQ"S<{#~1DE?~1Oaq7iŧquAOrEaoFo Nsno||zo7g~$J<8ɄCTJ#ⴰAp6,@!Jq2HO,O.ofgH&&JF-? #lt EЏf j8)av//dXiŔz13t<_p4L)iGIA@uPO80*ԗ8L@ly@:|@l6I֌",Iu9``6?!u=`+\)MSIOJ…ALf%uQ#~1QUq_sbf%A[M__%Uۼ۲1Qe=Z)V_Qoo8__ ot_]W___`p6QoK"?qFUR)a@)g S'eXPPT7PA1;Pq$6:Z PD H?@ t@\.?@Mu$+չ?Q.ɀtq> pRLpVtAaXm\׻FW($mvׯX ߱Df=!C,ٖ-㳮d&3>` AcC2SwCo or Pzۘ b( 3#SC`` eF=Pl N` z,!Zdd${b!A%acW,VП(/(<%b߽%-X%!21/$1?C?\9O90$AA%[-I00gmPA%'eTaF*!Bt,@raqȿV`h_<'ee*< 1/C/u{//V.N/wVӿYA97&81@F Oj|ώϠB2ϋ f?l6+=Oas߅P xq߶:゚Dc2DVhtB1m1' ?K]oY#5GYk}yOOO/w/? /U/g/5G//}//ş?-???Q?c?¿??? 8?7ۡ? O/OAOCP5cOO p8@OOO__'_9_ ƧL;kT_f_x__.֠/Gṹ__]5; B_ۡm_o+*1oCoUogovۡoo]ۡoooo* N`rh&8J\n|ȏzCXj2Dz0BTfx69ܯ3%/ 2NBOR>_SEgDVh`z?@@ҿ °O;#2>2<SW2SQtφϘ___߮J-  $T!;Mb]!s'oK]omo#53?E?W?}d/Ho Ug7I //@-/?/Q/c/u/Ҧ:TF/Qf{ 1lukk9tpF?8@r#͆5|Y7I%Fqu H%u- H )#E>⢐u8W'ExQ__e__/]uajbR^pǩ1A hA~bQ߁'gf''׊D?%+-/d<ӹ;(@!VQ?! * aV?trŗF7Q)yk?qQ;7`yw?<߁a7""NZ֙?P$ o?/K\°?BsWseXW?]4<6%Pbtq l#e#P.eHO9lOXo|OU@Qlւ}\ O!/F'[?dO$XE>N 8gWٳ?Q]OK?!qc]Dt~L?q]K(|?@M`%,3?Q穀( Z?u?+i0?iE;i2?D?%(Pbtuv>D@/ǟ%/7/I/[(D1k/HZl/|>@"L0)/ ?O3?YA'?9?C @\?n???0CU1 r??2͍M-OOLOO_!_3V@_R_e͕x_______Ǐo#߆\onooj϶ooooo"40B| ߐ$Z|J轏);M_q8K %M#_HZle$l6?@_jZ`[*ЅBP(Xj`u?7u#Fu#*B**B8 a6-,ݫy!eI!M+?r 2LE5tAU"bFZ][gE~."*Aӿ{ϕ8'/߽20+A 5lO/OAI]UOvnOOGa?O"OO_gO'_O^SuemPnt"1(Y"FQcuj4__<8{XR7/f!3bTgUfLfw?)4aUaQ!3EZF`dvaQZ7ݯ /  I/[/m//////k/?#?5?G?Y?k?}???????W_i_{__COOǯO믝OO_3<_O _{߯Q_տ翙___L_ooooB :oLo^opa~oϯϴoooo2AzT懡nq'6)w ᗥX,n_COMIm rupE"|>@@@3\.wv?Q߰;ȸ Ս逘a  `֊Eϻ)*|і` Ln~Co?orEzab<aSCí`` Fl?)` UM5?݀?G`-! A#NPNk\BvkqE(B.O Qt">V q > 95!piQtց8w&@ց&͆PLRU@L&@@H$0@@jZ?@p:NW?z悕ٜ[r;>o1>'>u`FxLpn а5 })\)\ْt@m䑮 d1 xF` Rudg `:""p P˄Pq`!z~X#k[ Н٥mdPJȬaubzJDdqty]P|x"Sd1T"VV932UU񺁃7 $ 9'$^:4$P򴑴HrrM=[$)>h$8{Lށ!⁏iRNNRd1$d桇}xZT ,@Ɓs!9PP| C8?'+5L88Rk!!'>/$'*/#d% ".4?%+? 6g?gL7r%^Ũ5}UeO$PDOO|%O _5!M*3Crcr ?`_@r3#ʀSV΀@萀>@ ցUK9jY%)!?70UuXK?q$:#tP*QȄjeqrXcƀ@"j(rPOF@畤@Ki?A$Lx7"tBo2P7!#kIwrJsb{03w_ â\_ ʁF!rdvdr_|H,3ELj `*!n2sڼ6qǼed{l @E)-3 cEf!(N '%_]o sEaGrX]ސ+b6O'8>N 8Ͽү4)JRwˋװqm D1(:Aw!EWƯدPυDOjPۦۧ2׼A5(}ۦۯTfϮDО %"}d?z0cS썠K2\c\o$#Fx3#5s>ϗ̲!vψϚϾѲBE==$ߗG֧A߽߫cB F ca„va̩lc{bJ\ϓUFh?F2}4aGi?!B3%JR6XF~)F9y67x,-t7tI萕6־b$=_ai9׮FO=M(·P-!YC l F`0(?/W 5 /nQ //1%d@/d/T&Zb?t?=U% ,&&? T&#&5OY ?]G?aOO)O;OMO1/C/ O!\]GoO.{_(U 7 oT_8?J4T&Z6p?3?+ooᔁ;dCiZoloVar~oo2v~ i1K2\i`(IzeWJVe Grޏ)ﱈ⏨^pʏ_5w?@[+tےOmV?@ѱ ?@{?@UiԄx?tlXuXunUk-?@Զ?@E|?@?ߙ>Ƶb _mVel?@֬@q?@iL (>D(%mVY-?@F9^?@e"9c?@?am+XunUI~ (M_:S?0JMO_mV?@s??@3jl9]yϰVenU0qN0I^cǐ#I eGxI2nU[O, ?@|:Eǐ6\,k?@kY;sߥnU@>?@ϧsT)$8gCic㯐otK@ &d&&Q*Q .@T&H$%D'x<OL# uOO}l9)F o]RU|_Ĥ(8g]Ciǡ[rFx@ǂϾ@nM畤@Kiě;dCiˡŷodl6/{J1 Y/CQiĠgA8bTPzd%%9uChsrA'2Kq0Cg!tۿ0=zn"8a` TextCo*`orĠzH2` L}a0inF0n0J3` AsA0aO&8a4;` 1mp*`1MAjĠG?Y?k?Ch{76F-poP(?6!3By789P>"_a%-ĠndC9uB0gB ;@ewpsaRm0 A f2 UcWDaPt0dp]dBa.ޠOY@UiRARHĠEQTǡ-P@^q]^/d%!hQ(=#BH/Z/l-8T p @ޯd1@@ eHcg7Wa->!u`uߠ`bcu adDhh@5!bbasbb%t]tQBSu]`t?BsIvSruà]y!(L&dc2k`Bg#GxHwIvRznwEr,!m 22?sQ?\._?@PA*_Qj7zr`BRkcPr0u;@d?bpE(=7K!TD5QU8# 03%|YTOow/ E/-*f6USrYyɠsB)nEsGQT__]k^a@D Ձtklf @@}`~o?@@r?>eF6Wa%{Ms:?;?RW%wyuTNA/YaBeWhl8ϱQTĕwwbaK#eB-I{d:@@ [>PjpwMsB?@֨U8dr|AtZq ($z˦fttfozfߐ @ˆ P!%I6 iDI[mѤϕѼB1^aOOn?6X9*???<̩wQv5o/oAoSoeos{dbX,@ 0@@H$#DYejDrSOq9??BP@ &dr ӳ & &R/> :a});q%7I[^U0P贁Nky9faAEk ai+UȻLK:LK&ՙLK7@aLKĮLG7JSPPPPZPPPPP3%7I[mwIώ.@Rd@RMrpewdaMs(? v)?0vAB3v+?Gv2B[vBov/T0(v vvvUv3v3vGvGv[v[vCov///U??(?:?L9?? OO.OqLOqmOOGqOOO\PPq Qq"4qla%PGq΢PPoqJQĔQ5* aN ]1PiX}T$BOR_SPG2}D`zg@\.?d.5?Q驀iF ;Ȁk}k<S̴k--H~Vj?|??ZxTe󗏩V???"q{È-]/7`-lćUϏ!É|nM-ԡD"®!ËN.Te7襊ZgTsāMoВ$سT{BN,,@oqɯۯE MQF=e$ -4DV {E- Te-e$MSQBa[_m________QKoo&o8ov\onoooo@|> @@l60@@~ @3@`e?$ob2s.pv<&6pvP&7pvd&8pvx&&ss&Rss&x2&<&<&P&P&d&d&x&x&&&&& 2D?hznϰ-?Q U@BgLS)cYAGYgC? |z="R}- /AA`r}A?(DV!^| //0/B/T/P_b_/@^Ï?/\ʟܟ2?D?$z??j??OO%O7O@IO[OmOOOOOL҅TҴyEWmiCQhz_Yl6?@jZzJBP(ŀÔu?ea(cu!aChuaCh1Z]_ oĮ1o IН1HXFRi_oqb 2⃀LFu9"qU҅d4@bEve[mLĞooeڱ^joqqa8G/ш@K+0aOauĎB#GT9SueڀmntB`2@P Z$6HZlqBHjCxx{<&!3 "tulI/սA/OD/O/O _ *VCM I)PA_+=_B|>XttWl3__$c?°;_o~ g逘NѠ4oFoXojo7B)*o!m ` uL nCoporCzNbO<NS^@`` F lpƒN` OўBAݨFRmB)BiaGo1 V \$H 2nLnRnA+l6o^l>ooُ!3EW??0o~>'l<.@5Gv}Ώï$6Hpl~11є/Ob(>5 8w{T1-1:oD;sD"H$@@p8+@@Sb45ɿnI)@uu`u 0AN.u R6 ;`A&HfT*JR@@!z^ @@vn*G@Rӏ1S*baX?qP?Q<_$Gq tiN01z@‰ #b161)CE%@rΒ?@I֊?шſ?_&aDp3tSu*͔TFWQQ]raNmJ1`AnBcAWi>phDց)ANק*(qLA=F+OSWA Qp@VI~֝ttB)A&H p nqrSQUT9fR?FO1QCu$ g=^}jyuJoAgo%յom׳w!Rp/#`A//_CKtfGU @=7/Яg `h4(@o:)B I1LOA.M=7OOaOsJLY-%_7_4 v__\_T__*-_o#o5o#YoGNkoo/ooo 5?1CUg1?Qc [Q?oOOBd7?OOXR XR#_׳OO(:_^pMʟܟgg=Q =Q=oasͯߨnv @@~{퐱?@p qsxu0BTL #@@>L)Bpq4p'@z3.4Frpgfsȴ؇ٿ ^,ΞPA=QQcÄutϒϤ϶"4FXj|ߎp߲R. "W<_ ??Qcے //d?eyq~!D%1)O"O4OEVj r ӵ0a*)D'LB<N`nsT //W@/R/d/v/PϚ/t_ϡC=$?6?H?\~???X????fxߞDOGޕ_OܜOO_/b.7SP/O_s_7/_-_/__oo%o7oIo[omoN]1o]1o?ooo 0BTxBP(~fxz^wyCcSN xx<]1A\)܉DaW._V_@_1V__^(:QE 1Z]1j|رEǟٟ!3EWi{ïկj&O'i//@AewfenȽ ?]1&8J\PϦN|#GV0x+%Z5!E"2GG'9etMq|> @@jпF/@@A @@`%ģ?z̤j;u`?u72W462W173FY46ZZ46n[46\46"(22FFZZnn*"a;51 "bv! zpr2po2s҆%1Fs# !A|#ebup"2dO8@21fV#W1xZۆ%xnqxԂYxԖP-CPqnYn2nT4nnZnnn12\A<25?NO 8J!>5BwOR_S`Gw!A E:LMpxI$ZV_j?@ %%hFQ=t pR tTL;k u;5(;63=y;3[l?#a%@;3Tg6:qq##0P贁NkUtU;6c2x=1%2A%S4FX߂ɟU% .%EE/<:/aE];=K)$Ҵ3,@;2q5/F_) '/O_%;??_Ձ5g,??_?Υ)O;OvVNxOi!77]5-رs_'t)с |رر_t$|UA AS19?K?]?Vh ?BP(w`F($#5G Ӌ#,ٖ-㳮dv 3s AcpentCo@orۙbo(Sru`` F@l@~` 2ug@Zt T$ a'&"bر1Cرi{O //A/S/e/w///////??+?'o9oKos?ZO%OO?K]OOKO]OۿOO#OOOO_#_5_G_Y_k_}Vъ_ѧ_k_(__hBS2oYohfl6zooooooow x#v50wm$t` DVk}I[ʤɏ9- 9.@RdvkϬП*8N`r̯ޯ& ؿxnr//ȿ//??dQcU?u uϙϫϽ( *Z:ߙWAZO~ߐߢߴC-5/%/7/ kep8@.@Rdv ƧL;k栵&8!e.֠/ >Pbp oA+=as7v6|0RA ACUgy?Ǐ-?Q!u/5_G_Y_M/4?/X?/[m//%?7?F?3|?? OOCOUOHgO0[LQczW$WLi"Q@ d_pN(?@կjZ ~ۀBP(լ&Ӕ?eQuQڔOuQZ]a6-_ y_ Ҫ.o *`1r)I²1r1i>o RLau&qqUO8wtѓbFbzI2Dj}oojoqwvujD,4Fj|/Qn"OUdk Xb'1o><DudS`gmd 1Ps@ɿۿ$&Hdj6RR{RwwvK!3"'&E@(/kQq\XDb3a-=dŇ$+G=i]I֡:PX~ߟ?@@U35?mM_qU($z˒ _Tz#o%e812]S&F^S&FUBFFFFFW(&  _Yi=8uom[enڑQRsFoR AQWTAWq7/I/@ /3QAqQ"?/?ϧu͛___נpF?7@@r8s??OO~1 )=Krru8qK qӞFԞF?QK_]_o__:L^pۥ5$6 ǨALp֢Qof''{d?%+-?%+ΏE "4F^HnjHޡ OKH 86yЩy?9s4Fh@@P/@@b@`ٿ4<iuޠw`u e@A.gu o t bU@X, @@_p2Pt:N.@7)pYf@z3Dzhpb !+&/*/<. ʢv"-(Ԣv"G#3 5Dю0j 3Vt[g tNe@Z!z@" 2b 3v"HieGG*D@r~?@Ig0k?]4e5?J&"yyF]޴aJ1RCon#@ect!@rW'@iCh+@0ۃ6ك㪑 `A`b5.-GYpN* TyߋԈ,3T/K?V_㵱AZ* b?TAHջޢTOOQl*XJ5;?Z^acuao"՘BORGaSFG GV*JR@@P( *_qѕө߯'9K/{a̿޿a(:o^8o\oϸ6HZl"_ߢߴ2DVVߟ>P'ٿdvϚh*~MbV}AG]: Ÿدt]đwt:Lǰ?@jZpl6RBP(?唀61u.0`?2u 4nrav#$6-.2⡂21}ABA Q Qbl?hT,@Zඵ1P!q 觱2!C7n?vp3dHp!1F Kl \.?Z@(M\cF@UE@^E5e4?4"$7*?3.5c=4O5;O6µ@U_3OrUդEda_sTT__rUW_oĵ1ܣ:/Ssr(WӐpqjhwo@rHCH^c|fb@w |@eIi 2rU`X=Uu?O'4OP.`!asivuErMsfBz$\ lO~OI62 t! 2! `!L#! Iـr-b1@3ـ1ho \Qo| w|^ww1 |fBG\G֏ˏo aai w( /[Af| \ޏ&1jx.@42@eGNh @A%-/ A1w9$ '![Yk  sAqCh hmIڠ'b02O0#4:aJ4ροi0%HFƸǛ׬QmD1$ 6=Ϩ²sNJ1AS¿Կ@ ώ߁@KjLۢ.=1$y뢦Pbߪ@̮z8JTorU$C2}O0@cc蝓K X!_ X!N43FxG []2,pn#FjZ-Cp!*͑=AGLA/S%r D!R& r S%r%2S% Av?srS% - ƒ%~q%I?W: -%v~%' =P~Wx5;81'=Iu"$;zQpK rUҼT7#$Lʦ~#jI(a2b0FI ^OJё)9OHCάD WD!*?Qײr|pcQ QVSsiaVp` TPPavplShitH,ppbaRTq}p`OYfr]ea,OKn qaaqzgB@Fb0wio2c!b_=,p@`{q! AQ! ATqm~? BP(?rpnqn,rqAa`Aemt Bh7#IEtrbd!d!sHEtVIRt.J_t A))oLytqMt ANt1OtQ1139QtRtjaPsTt!IUthVtWX."Y"2Z/-R[<bqqAbE]V AAA A _p!QQ/1PWQ A& ;IpMt!oڊe}q9Paaԗabh{6S@Y.r@`0 ?B/: AYc,RhDrq^f?+Q?(c" AlZtAUAarڈCrheʞU]rh.!@p7.?@-n3bybfKl/@\1/jqjqIaԍeݝPqV"[ Hڋ6U@ ?"?ؖ/PrSڊo!Ir e¡ Ah!?C-$Sq,.%FU,b +=OKϑqasϗϩϻF|>/1o:ߓܮ1rߖߨߺ>%A9:!C棿Q_>%B_ q!چqȹhswrFXߏeFh?F2}Б4ai?1 B/}%JR2TF~߿%F9_y67x,)p3E~2^ 9/[qe5&FO=/M (`)U?C0h\,F:8O?S.1,?/ja/// ??-5dڋo8eGPo4OFDP6VFlO/O ''С7t?yVhRqnz.uV e-GBleԏR $EvuSFRuCnڟ%ޟZl~𢟴Ɵ[5w?@[+tێ_ifԩ?@ ?@{?@UiԄˆ?tlXuhjek-?@Զ?@E|?@>Ƶ^oifel?@֬@q?@iL0(>D(%υifY-?@F9^?@e"9c?@am+h߅~jeI (M_:S0JMKoif?@s??@3jl9]y߬Ruje0qJ@I^cà#I e}CxY.je[O, ?@|:Eà6\,k?@kY7o۵je@>?@ϧsT($4w?ys߿p[@ ("Ͽ`6Q*a*Jgo$ 채Tʝ=!H!TpV)zLP<$,@Q]q߶HAmbVP )?Q5Tʼn׮>Aa|__jOFXIOOOHE l3߂$%oo'ґ9u?@T9G1YxR?$%s?uA#5 G6x6}LlUT@g29U2bnb ϖ5[z$Ŧ<2:ؑ%'@_u/@jqB+"9G'O4_'Y;_$T_f_7O____M_ oq_gDS̀gm̀nt 3ְ8!@Rdv"!j oo>|>x{Xw?!v!3r:w;v2v]ODGF$ XU/%#b>{{yI/[/m//,6bX,@@"-@@H$DY@T? &ǂ//C2ٵ8ssdqsSkvfegmvÖnvזcissÖJÖזז3&8Oʁg`JO\G`Ƥ"?;M _fepNvrOO.O>x S8Ϸ6dqg4AׅÑ컶Eב@gEPЀ07kЀatЀYЀЀKЀЀבovo}(:Pg88T960akBOR0_`E0 5%֏mT`z/ Q]t> Ÿ;`t 1ͣQ߿<SC8=ֹ1g(:7J@ӯ\OK]o(d<8[ݺ8ApwO]OOIHDow/Y)tewhqpDᖴ[ܗrLT$1 VB,@qU=O\x-r+//񸥡%/?/I?[?\v>Hn?v 1CUgyߋߑdqdqOߤhDL`A.Y/k/}/v>[|QөSûZu??E1CUg#,ٖ?-㳮3` Ac`etConorlPzۍ_b(@S"buK``` Fln` Zo2eaflRdq1|ICvB|$6CqQc"Cq?탡VL^m'/!/3/E/=_O_i/'^`?/\gy#?5?k?W??V?H?OO(O:OLO^OpOOOODOOO|sgUP p=7-_,u_K_RT*XTӺ_T_ 7a!o3oEoWo·#.?/oo5c o zoo$6zUGYk}uUU8J\nȏ#TsT.@mvП<'fPT/./үd/v/ - @WL!Z Sl~YA߮C fj=;=oHm-%7`rvm#5GYyGYAԅϏO;l6?@?jZհϳ֟pBP(Xߵհ곔? e7}uvQXu\QXZR_ jl_NĮ_ K̞V 7rY4_R ҀLce(waU҅dob U []_oe55;/jKHo㪀aQo .@/U}=2ɕ(/ɠ}s᷅kQ%H}s3WxjD\kWSe/m6ntP2@_@gyƯ,د8jQc {r{K!3a @ߞ/An OG+OOOaOFCOME I~@O2O|>HdW#!_3_S;Q_c_E逘____wϗ)?*_v|mb` L^n6Co @or zۣb<>Sk0`` F^l`>` O 21@6M~2#iG0oA1_F^Lgoyo#ߝo^"oo>]o"4FJ\?&_}.Co_.@Rdv]/o/_.|oE,ҟs}#rx5dYyůyAo$EJopSՂG HBe)~0q" @@k۰V-@@~ @@`S=?EHr$R6qp熫qꃿ1ӦstuӦӦ*b{89!o<ͿKq.^2bv~ !z# e3OO5_1e; eՂk_}__ G s~5qe1e˓%@UyAge8"rP̌ ͌ 1܌ O@rތ J@2 q,P //G7(BC Rx@_4Ex@N/%7/t6j?@ ///,q ?pR ;8-$;8L;Gk 6F38-!X?j?|?B=s1`r??=iM&ʆOO@TOOLT_T_._ T_f______o},o>oPoboooooooo^E?#?Y?k?6H??~?Ə؏ 2DV@!%1CUt,&Un A1/// ?BP(&8J\F($xӉ3,ٖ-㳮 }3R` AcpWenCl:zb(Sbu^``` FP@lV(~` T21u@@t¢"Q# %7Iav|Yk}R!!*<N1Or0/&/8/J/\/n////___/??>O4?eį֯|?? ??Tf OOBOTOfOxOOOOOOOF:_: _D_V_h_ zXB2_ew_fl6_oo)o;oMo_o` x{oooooon 0BNҲ]oˏݏ%7I3mǟٟ!3EWSewߟQh/A/!/wW/i/ѿ/+=OasυFsW1?P zXC5=hzUp8@߹ ƧL;k.@Rdv?#.֠/pT 5s }z9K] oz1uXfWl!3EQB1`r7}1/(:LpB$6HZVOhOzO/T//|2/D/ğ֟z// //T/ ??.?@?R:]Qc?u??J9t6<7xyEGmYCA@1,>O ȡ?@կjZ2-~pBP(<Ŭ2GÔ?UڱuA-puQ{Ma6-O y_ ª.1_ Rb)jRb ֔rRY__qR BLQe9aaUp҅8TobgRs[ת__ޒꨩo@MqqQUg/}r"pv }>y 'H@R3_9]DȤSPgmT 1@@c@Ưد#$5GijV4**{O7K!3&'f@I3rau y4s@#N-͵ $ڷLh-ŊMIqP:@H~ߟ?@@L#%`ƎnπϒE($z˳ _Dz#4_FU8!!2vt6wt6U266666nX& $AO3zY=Y!_߻\Beݴ*cg_* 1rGqUD1 WXj Y&NIr1r "@/P/ŽOOOpF?7@@rȄ(c??&?8?!! ?)^;rru8;.xaӿ66`A{lO~OOO[mP%EW A~Qf''t?%+-mՆTPbtΟ(:L^pʯܯЋG_Y_k_}_____Y1q__o!o->m\('qq\C o,Рh (oooT0g 2vTf~6t6rT0O#AUBz8bE{zɰ]`@`At% 1CU lse#P.U߿/8+X/BT7#Qlւ}//F'[?w1/% 8gWٳ/%?!qcc]Dt~L?c=L ?@Vjl6@BP(?dƖe?ϭru40`L47?ruiQ4RbHfU b8R QL@2"UYr7C3b`=u}u[ Od{|{rz IZ8QJoA/-A/xbici.-gˏfeZ,d);-yݏ,"F~TLUSe m|n?t 3 Q_'_9_K_]_oQHt___aΥjD({ v!3@E2uEG}-Tu_S7@Po0oBoTobX,@@D"H$)@@H$eD@E?Af¿oo׈bdc|]H]b\t`p]f]]8>HH\\ppJa"a& j_E 51xa%"2 " 4eEK[m. HQ\ta%%1SEFPpQ\ZqK]ů׭1i_[IuSH_Hы)yz9`mBWOR_zE h euχϋ`zM@>Q2)t ?°;5ta"㔑'<S%' }YqIu 1 2DW"("q<H0x$EHDLu2/D!LEw&ON%G@5N:_EOLg0:l!3%TTTq{qP;,@1q*(/$/O6T2W(_5T1vk}&ooT1Iuve\\ooT1vo06K~mDA*<N`f}q~THO9K˕E09i1oCoUo ` @@@ .@@x< @ŗO Wʈ^u u`bu !0@K"qPG@1ϓ B 9{B*0ʥBxT#?EBP(D$0/!/0ԧ?ޯW!q6S2.?.@a1?x$ চA$O+;7`BackProundClrz۲pb@29I4Q?<*{G?U0-|?Nu^AqnD^YʉO/U/M*_@2IPO#n~L5ҶW#7Az Xja*!1QБډaDqQa u)L6 L&m$-@@jZ?@p:Nk?ai?r["r;o1'}u `FPo?uT5_pb%)3&"` S݀aowd"j/|/` Fpl]@Pt en&Sѓː`` %` /21x1` Ac n ?"4 )/jB`%Taspr62cyw;??#!`P)?;d" +Sm0y]@e&V2 \;XOfQ@s tJ1K \;YOO.q `)DpAcm0i'6q`U)Mgi{@il1K*6xjH,?@V7F t?DȰ%ELpn j?5b א@ym$hV ^hV ɱՠF `% DURFQg;3 `DU?;` DU/6ၜ6ta?b4ɓKrcAT6ῲ26Tưawư>Bbv<uzeпQqưqt҉ Hq Q"6Tɲ113t! !iQiQAAщ^8t9t":j›mb@YYbѱѱ >4bvр55@PdPSrƸT ,@m-0|Ũqpm6mHqwC!ZA4Ώp[tmMr 0Kl @(…Z66F@[@d*7Tf ȏrt*Ǐ Kr4&^ȟ؆mІY&%[uw'jŘ௱c&me ce湊EMrrqmQ !~RR澿@rгW䶱@\V@  q/s6r` @wU0uUB=a4pP_qkAţR?l4r@ѽ_LtpB2p#pkI1PrfbG31PP~R ŢQϒW UR FR+Wl[prP[pQ"HQ1[RHOqQaQ |"4F咁"8N"ӐRэǰpe[pۈ @aE-O# caRD N 'RA{yB sac~\rGbpROp/C TZ Qj ' T  _!P/E5fR1Pm'D11DV] Qa?s?P*//`kjl;5;N7];QD//;;OO?p//O5_//`B'9{uf&Y}dFcK*_2xᠨq?xᡑqdFx񨲄qqHevIr JIaIaasLđMe NObSQPRĊf1T6qUԒVbW(ԧbX$5NrYBZOMA[\;a]vQ_qOwa1a1a@ ;iRpmĨ&Y11{V@Y.r@?`0 ?OyLrq~C]+Q#?5xS6rqlzĤܑUa@ؤcȨU}Nq!@p7.?@-n3270Kl@\QOi݅p$aH!v6r;+U#VU@_r?1cOpes aiQ q5_ec @MDs,NuU /FU,b@'9K]ok*F|>O?/Q/8-Z/ !EOz{ 5w?@[+tԩ?@ѱ ?@{?@UiԄ?tlXu6Պk-?@Զ?@E|?@ߙ>~(el?@֬@q?@iL(Ï>D(%߉Y-?@F9^?@e"9c?@am+/ՊI` (M_:S0JMk/񿉶?@s??@3j`l9]y/(rŊ0qjI^c#I ecx?N[O, ?@|:E6\,k?@?kYW?1@>?@ϧsOT?x$TQ_ɪ~@ x0BeFQ*"9 HO&O8OJO\OpH$ÉA1`Ux<yhO`__&_8_șO.f̖O_____ oE_bmy_.fqܖ{oH(Ty_w ooob+!@{ǞQ@n~0Kl@\.H6$Wa_ɀ9%d?l6M{f uŏˣiTZgTooi_waˡ'2ǥqƐ$_!Կ0UIdv"T` TextCotorTzd ` LainFn&3_` As]a=&T4` mpt@u8ˡpEs Ÿԟ 3E#UgyIeyḟѯ$6HZl~ȐaPduUecPYTpK!"LIZjZkypEEe۶F BP(-?۶!3ۺݾ|>JZrwW^pba~o 7*DL[pAO'O9O2D>ϷS|Lqe]swZu?E#ӥC,-㳮@Rd3 AucEDLb(V̀*S=u/`` F]lD Lk` 2%ߝ ݝ±ab+qSxaG"ba //ޝbaE/W/i/{////_/C]vz=]~)?;?M?t???????Oo %IOGo~]_O]|#5OOk}'_I_m_Ȋ_߮_____oo,o>oPocougoCoo@WU=7oĿֿ1DKRT*S_vt ?qեC.֠/?Qd5t {܊h'9K k}"἟Ο*@SwLaAc(:?YAXj|C "= 2c - .@RQqQ//O9/f2n///,// ??/?A?S?e?aosoݏ?MGnԟO?lۯCOUO#5O˭O{OʨO_$_6_H_Z_l_~____ \)▏eT׉Vg~yTay蝯o9l6?@OjZЋ[?BP(Ց֦Ӕ?u`9u2qTxuqTxBZw &( B ̒ZB"icyp CLWJ3UⅺEQCbVu!e[}@]ԯuozDڬഏƏX/ џQ\/hg}CooOs°; _EWi{HS)*2}_` LnwCoor@z_b<_S'P`` eFl^` _,R߹QݹVcR "yGAfl#5YBQtmQ<T}Fo}N 2DVhO+OAPN8Ŀ}L?QFX/ߟԿ. ϻ//5/G/Y/}//5aaKAĮe?Zmu,Tcs5WI}plB @@nf+@@~ @@`?ĹDVd`amg"{W_qjyuxvqXƎ]gUg{{Uƕ2@zx1+\ .Bbvs4GAz_߱0oCHo Ue{V bep'9K 1}u{뮕W5_qOEyqWuq5a8ނPTހ@Tހ `cހ`ހ\t1CQ?0aCQ???cg8B*0R4`_E4` OROZVj?@ uOOOLa pROKKL;kQFS_&_8_=fQ__q_]%mBoToooloTCQoo-CQ"vXj|_9? ?BTfxҏYk}̟lbn?OO_'_]_o_:L_pʯܯ2<{{o 34U* A1CnOOO BP(DF($4FXj|ES,ٖ-㳮3Vr` AcـentCo orbo(ЀS;ud`` F `l ` 2텀@>ˆqYC]ay\[/'/9/K/Wr{f/x/;{////// ?_.?@?R?v????F???OO*OnQcu);M_I/˿ݿ!3[B ߭ߣ$/????3EO%O{[O /ASfr䀣_6xC>5$?6?H?Aup8@cu ƧL;k 2 3.֠/(Oas 5у ؏9=O`r b$6TfxO/,/>/P/b////////??o$o6o^?EOOO?ٟ8J?O6OHOȿڿ~OOOOOOO_ _2_@D_V_ery\ TW4g)yQ@֯Ao]?@կjZ~BP(լ?ruua,ua7ma6-o yo i.o ̷-rPyv bLq|qU,8b#r/U[@Zl{LNTՓ dG v#GY/n.K",2AH מ5?ŜaLpTSpgmt 1Pxl@ϔϦϸy'Ǭ$%jJj/|/ܕ{NjK!3z2'&"&?H.ȕ5}T`?3B Mf ߛ߭߿GlIv:a`eh~?@@ŭC״EoB*%fD>yU|8!乸I#˿ "tQg Zu?P{"AtQ"ʣA{"'Eג%'tD fC,ٖ-㣳a?>υ=3` Ach0entCo0orzs@b(s@s@ySS `` FYl0s>` ?2|5+߉1݉6NdGqσϕoB{!6<ϺTN MN1CUgyߋߝ߀WSI&f_I.'9_`_o_5c[.oII,!Wim5Yhve 2A¡ys Q*%py>'K9\cu!(u!(88QvLs/sCU%//C)C:&/u-ehhz,==\Wi(@rOȄȘýڟb&{( )Ӓ+$E*…uׇ8+!2 /2/'RA=OOo_0_/E]-jʕKQH`!'HAbQWf''B4?%o+-銕D<ٌ;^ŮڥVQ?;Q * aV?trŗFQ)yk?qQ;`yw?<a""NZ֙?P$ o?K\°?BsWseXW?]4<6%ai?y??ե=Q2QU_?ޒU@ ` @@0,@@?x< @gù w9J-uBu0`u |@b_u ֻ P@", ȀyQc*E VHOZOKIR՝˜M2B?DŽBP(1BBҥ @JTa8P2qgq??\.k?pAQ[7`BackgroundClrlQ~`byUդ8=5_!ZTB*Dh#S0%|#fvTU7R??Ee_U%_*ooi@Ee2KR1c1V4LR@ Q4XŬQuS x QABʹFѩ9/<71/s59Ld2L&@@) B!+@@jZ?@p:N?8K[Br};1'up`F{?u|@_`bjRpQG@VBc!}#9}#(}#4Q}#Cz&de"t"o////ZRj5\U)2?(797ZSQU!8\ZRB FBD"aP=&`Q6ayN`ACB"#2ޑI^BZFj"^B"^BZF2^BUZFZFZF ZFU ZF ZF ZF&mBj, _1_C_LUS^VmBR3J^V4aaSs/o.̀QvA{Gz?UQK1& "` SSaowR__` Fuilްat9`enVSGA`` .e` Yo2%ߌa݌a2¯` A c=`n 9`|od2 i6o 1`.eTasp r.bcyko",A7"9;"c1"!k«!!GtO11ɢٴ:BT,@2`5"1A30!C 2aqDϋ6p/3 (Klį T4@(AAF@@Šҫ3"+n>@(2*=.+#M+4pߜ5.>N52F#ՎU0ժߝV'#㕀(A"O/Ӈ1r_ぃ!ia[&4@rFZ'@jE 7@__/-3"3eͶ10UGpur 1j0_ ;ci#W1n3/$²tMK2My!#MIrb3X1Z !1Mw EE k£0 4耝0Elaa$1#& t*///$/6/H(!ڌ0=&e8ѠJ$ @+9-. :$ 'T/;?ŷ/*(?O Cs A7 -MOl|+g'p0bO27N886;F9<5HKOO862Ka_s_dOJVCO _LOFN(꧀]+EBm5y*6D?)1?3;,_>RHO O@ O"ooXOjO|OOO$ooGGj?k86k9XgNRk7_{_{86&{ASX__.o@orb>Hϲ}1߼c&~-K.@@+ڴА/F/xg@ еFj/ZÛT8c!GOJ\nAc ?rdYѢrN m q߄? m2vu@ PqѸ_@߁  ᓔAKեͣN <q#1߇\c+ߌ\c^g!>r76_`ُdWԁ`O:f",ߕnzB@P0o!~_=@`{ዝ?T/~? ?BP(?Sn*PPɂͣ߁E!!AH@I0J0LWM N)&nO6v))!QP R`]#kkqTw&UVIWXĢYZ[11]%_!||@ű!//!;G߂pupPuquq⪑{@T.r@`0 ?@Yoqǯzs]+Q?H&'lARUNpPA`.Uġ @p7.?@-n3ڨ%(Kl@\$D!T$j%s-A$* @ۡ/Up/7U@բ??n&>y(y?w9>5|?pD!߁T$w/X1N7y=FF5D!H!,Q'ĥpH!>5*?O/,FU?,b??????Z_lRO'O __-_?_Q_ZF|>/__]O_)LlD!noo,o>oPobocRԥo.oo)Os]]v9Ov+=Oaskԥ_o_ujD!sNT$~p^I.? j|__%K`Fh?F2}`4ai?)~%JRȘeDF~GF9y67x`A,$ɗ>5۞`mx"5s ȘUh^$ϯ'[;M_qo˟zg@FO?=H.M(I忟KFCpFȇ<\Ǚxon,Si{õҿFA;Ml#xϜ#ǯl뭛9߰PAuߩ߻ÿտ'OtXp`ǝ_D !&f1.&&aqI.ďx_ 6//_O/j茺@/ .ona p/C(t/:N//&/8/J/\/;5w?@?[+t$ԩ?@ѱ ?@{?@UiԄX?tlXugk-?@Զ?@E|?@ߙ>ƵOel?@֬@q?@iLf(>D(%C_Y-?@F9^?@e"9c?@am+_guIc (M_~'P:S00JM_g?@s??@3jcl9]y0oBh0qI^cY0#I e@x`o5[O, ?@|:EY06\,k?@kYoYqEN@>?@ϧsTSZRD$7 COuO"@ ,OULvQ*6X~xOH$Oօx<`Y޳fxﭖrB :#8J\n؝R ~xVD(YA%IMI[m8١,@Ǟ@n`~(Kl@\.~xT-As]AUIO"OFDdOl6f3{ ֑x.;Ϣ̣iUAT ~'2q4мBd!60Q@UA s"` La}tnFoЭtz0z` TexClr3` Asa&4` mpь!8-AVDsڽ)T̢ E [ju;FoP(?;!39TUsI;^>Jr<b 7 b*fpDZwqANAA` RW*ieFѥdfҰwgp@t e emА !kۼ۸MarHMaT"AYA{]AsѨ#Me%ֱP TaC=7p@h@˷<ڿ-tKRT*?@@&d2?@M~ɺҍ?QA]tQ@` °;7?tU@Ԥ̣!ա)5rE[SVDN&N!AAB՝.֠/Ṃ";;ɦӥy/"~ Ac "2b(0N!=u@`` Ff` ?&!&UA}G1)s"`{3թJҠN6M<#0P_贁NkBczQAL@̣g:qTQUӴ(QUHW6%(T-SUO͆ N_UO-gT(5-f!PLqq}&Ҥ,@{1}q9!3sO0VhUWk_y5Oau[krooOa[eA\ooOa@[o0Vd1}J~RW'W(2a"R-nA2DlEXU0BThh ƏD1o%o7oZl|>@|L~YAC //'/9/K !R#[!f/ա=z!Ob//,X=-i?{?<????6 OOCOUOgOyOOOOO{$ς͓'_9_K_ρ________/AϿGo.w[ooo'%Gmk؈u[u(:LH^pĜWж ɹ$"@k}ߏdzl6?@jZMBP(?n\u"u"Zܟ KL0 ̀8H2hH21i> ƒL!Pws°;۟'?逘%ٿyz)*꙯X/j-D1` L@nPCoorzۅ b<' #SCs/`` F@lɎc` Ղ߁߆b/R ѩGޯ/, A@'/K]afx a/??(? .Cvaͣ~Ϧ%$6HZ?Qg׵~^ߣ|ew8JϿπU͢#FsA__a_B__Yԕo,Rz瓷ҙɐ$u}y.Ar @@pv)@@~ @@`5Ֆ?'*4֍}qӡֵ}rqQ-3.rbv#mmqz `(Ũ*sn1u+ e.ҸM_q Ca}quuuO[T8Pz|||1|rc|,| |ao`Bo?ooxUB%pRZ_PEZ0ϬxDZVj?@ |B pR{B2BL;kv(B2:L^r=ÌBKhz ќT]6H~Ưد_o 2Dohz¿Կ???@'ϒ߈ϔo;M*߃`rˏߨߺ&8bb!1/$1/!?3?cttGUP0 A@1i??5 ?BP(???OO,O>Oj@F($ZOlO~OOJ$,ٖ-㳮OOM}3|` AcentC]oPorb(Sau`` eF2lP ` 652ŀ @ "dsI!__ CAƁ;_M___q_}__aպ____ oo0oTofoxooooolo,>Pbt G^p6H~$6HZl~Ɵؖ!$!&8J\B@2lGYk5fl6կ /Am x]oOOɿۿOOϹ$0"?QdMw߉ߛ߭߿+_Oaso_'95/G/Y/h3J_oo#oYk9K @1CUgyؖɏ\Cd05/Jo\onog/ƥp8@/////// ƧL;kA?"?4?F?X:c.֠/Qu??=5 _-?cuʗϘ?:9?OO'O3BOTOzOOOOOOO __._R_d_v__$߬_____oo*odDӤcx-鏣5hGH#s0P贗Nkvl+CDtl6f Y~+D+?.vyNQvyNQ8SRA\Sy32Vv6FV"R(V2V2VRFVFVfr&_+QuekO}OX sa g@dFQ)gam2O/OAK,Qfu_EZ?l?l>tpF?G@@rȄHsDOO_[vatgA )owut}rzrwu/8wu}Q)#R2Vr2V*,Q!3C/H 01EĈTyKcsYqAlQf''Z%+-ۓZ<;auTVQŦ * aV?twQ)yk?X`yw?<7""NZ֙?PZK\?°?BɝeXW?״ɝ6%$g ?M=oW,x H ?QcuP?g v~FVtFVM8f_U%BI5bb,QzPmP@*>993T885r11@!!8d9dA:)dіBRJJ>]dҞa:<>Pfnr`J cdR|R=-T,@V aQPρqQC ҃!opc˄Ax[2 ` W@(k^^F@u@u`aag!VodRTg*ocebn4#ekvvfwӱAu ڏӱE3EtGaUZjn[2ra 1'22l^@rs㠤7 *@<ZHЀp@bѕ@yaXݱRaŗ}Uu~"@fdQ@]ϐQe!>2;r]Zqwub t`P2`Pϐ,aѭ#`PIZ0r-bpp3Z02 $A*7 52H2aTû7rG0G8 1KȨ1ZŨ;2q xʚ1/1ƯG '9K]oaK=߳axwKڏ4{ǏeGN @n-xŽL [a29m9 'H2j߲ڢ 2 s<ȧ</I#pbBP{OBP=Xl}1P}&2?JynH^Z0Qm?,PDZ1m 1a @/ASjG^wzm./? /A/^?"PbUFb}opc̓1ݠKS?QޠQޯdcFxxhza 4!qUނi& =&)//&/UN//PHI/(W;&Q͡aԇt#߱͡?/?Aѕ_2Fh?FxB?F4aGi?aAtx/?%JR{H_FbX,Fɿk 2,rԹO|G֎N X2_M(Հ?>#{H5EUGiԂ_?OO$O6OHO=?~O7*^VFO=_ObFnvrONfGYcP}w@O=_O\Fd2L~hv L`Yo\]zI\+!Wooo.o@oRodoveGo;/o^fFT/eO]lPf+_kO]fhVfz_]N=c'_4(J\nvooO?ڏf>X' ~#XO_܁p?@Զ?@7?@?ߙ>ƵQ?@֬@q?@K p(>D(%οz-#?@F9^?@4"?@?am+E(ų&-O?@ (M_?@:70JMՔ73V?@s??@7\l9]y~ͻTѓpI^c?@BP>x=w峕KE ?@|:En6J&M?@kYЀ$Z@A?@ϧsT h$}1ӣ(կ]KxJ}r<ʰb 7ʰ ʰb*ʰ#za*$@`TʰZ~Wfi8eŰC 8oŰnXwŰsXg:eB kSRdlhStGBHʰ T L$&ET֒hSux%NBORG_SE hd~g٢oom̸ERTV*JR@@RT*&@@id@M&?$Ү,Ź?Q"h丹"FX=PCfGCvv|VUGD2x-hGCFՒÈY̸]x#PC0P贁KNk-VtS~$}id.W$du%`omo$U$*Om%Vߵ̺g DZפvxɄ̸gTGADNNUbbvvUg&OpAO5;%O7G`~gȰ?:(:N5eKNQraOsOO nSN弴bǻO5vǻg弴ǻǻEǷO5EbP4@0We4@4@b4@Y4@v4@4@4@4@oQcomoO5NN<լߩ9Ѐ fa[skBWOR _`E  n%{qQ`! Q8tQ °;3;tQ𨣚Qӵ<S=_jv1O5߯Jճ7O&(8JB(L8#ns? 0BTf߄bߒbߠOvhDL`A 4/F/X/Qc>rK|kQӄ|SÖZu?E 0B#,ٖ-G㳮_q3n` Ac`entCocorzۅb(셠@SRu&``` eF0lcn` o2e߼aݼfղ #Yv|o,>}dv?#|V'|^HZl/ /_*_Dh/'^;|?/|\BT/?F?2h?⯌?1?#???OO'O9OKO]OoOODObOO[_vguU@ `=7_P_cKR/T*qX~/_T_a_o o2o#.֠/^opo5c ojooooz$6HZls%7I[mb#/N'/ HQcuϟ'A+h/ /?/Q//;X/|Ŀֿ Ϯ1ϔG1QOPuχϙϫD1|>@rWL!5CGY߹YAw߉ߛC? ߾Aj=#m-;M_qv1m1"4?XFQ֍NK*<N`rOOol'N//L b/t/BT/// ?۟1?C?U?g?@y??????<HµoiuGYsAO,`l6?@jZBP(ųu?UXcusXu7QsXaZ]-_ EG_)Įa_ y1aHrY_R b҃Lv>eiRaU…TdopbuU@E[]|__UᎵ j&#ocaQoo8w /0} p {[}N強`FQ@Eƴ#}Nr2|SwEDiF2Sue mntrP2p@:BTfxĊůB8j,>cc{lMV!3<䕜y 1?7O*O HdG#O_nS°;,_>_ 逘~d_v___gr)*_Q]=` L9nCo`orz>~b<~ySF0`` F9l`>` ?2 16ž(Y2YG o1:F9LBoToxo9"oo]o!%7[s&_}.o_ -?Qcu8/J/`_Ϗo.Wo ,^pewN}ϟMx?4Tfx֫TAkTE%yoKrQCyv)Y0q" @@r8'@@~ @@`.? D޶#r-6dLò††baцf¦†֦†v|¦¦֦J֦V8BG?eQ|b z~̲ u#gO*5:1F?weްF_X_.j_x sY5Ěua¡n%֡vUTAguU8bPrQv@v@Ɔv@*@Xv@%@bv@v@¡L@G(B RS@_ES@)/q/tZV?j?@ ///,L pR++L;k(&!33?2W?wR=s1;r~??=DMaOsOwTOOLwTOTO _ /_A_sυw___~___6oo+o=oaosooooooooVhz9 k//?$?#Z?l?Yk?ŏ׏ 19њO ]U' A1@k/}// BP(AF($1CUgyB3,ٖ-G㳮3SR` Ac`entCoorα۰b(۰۱Sz8bua``` F @Yln` 2e@d‘V#Z^YYvX|$6HTRcu8?+=OsC//'/9/K/]/Y_k_}_/?W??/}5?G?ůׯ}?? ??U? OO1OCOUOgOyOOOF鑼OOPO_!_3XB2C_0B_fl6_____ooD` x4oFoXojoyoo~'(;N`rޏ&8J\Fȟڟ 0X? !0B/"/xX/ҿ ,>PϯFlGn1Ϡ?3XC;5!3E>ߝUp8@`r߄ߖߨߺ ƧL;k /.֠/(L^p5c o6zo_:Lzn1]oufl Bn1+mn1Qcu/);M_O!O3O[B/ //5G}3/E/şן{// ///// ??/?HA?S?bƶv<o=T1y7&Y1@ӏ>OM`Z?@կjZ~IBP(Ô?oUuA)uA4ȟMa6-O yO fª.O ̴ b)# bMr Y_*R BLQyeQaU)҅8fTob R,5[=琪W_i_xIKQڄɵaDoq*Q DV/k}S+H")/ɫ>Eɶ }2<ſ| ^}Im4mSPgmT 10uicǯqXܯ_8jT(gy{ߖ!3wE+aP2z4]s<?-cmS$!-HqKCMI*P:^@bH~??@@#ש%G'9KE($zl ODzGOE8dø-x6-6h2n6x6Jx666q'XA&?J3Y=k O_s]qeH贁c _ x1+G*UD1GuO#ׯ +x1W+ /dɵ~uOOOпpF?'@@r'Ȅͩ(dc////X );b^bu8K;hax6x6[A4%O7OIO[O&8J\nL%áApQ߁If''ׁt?%+-銤<2;eAVQ?q0 * aV?trFQ)yk?qQ;`yw?<a햎""NZ֙?P$ o?K\°?BsWsdeXW?]4k$,@ rq֏ꯤvơ^S uquAqŸ0Bq=%mzߌvM.q塖> AGKHX@gaA.ɂXk!9S *Tl6f 0~i75?ՙM2f)%M2)%8*3LM MU  )="Q&~%eBT  8T@8 DT=%T61CpF?@@rȄ͢D2&t>1 )oN%tT1\"Y7Q"W'u/8N%q-) " T¯ԯ C/ߺpt+)"0:#!uA0߲Qif''1V%+-ۓ1V銝 lgo(e#P.olXկoo_coJ6oHoZcQlւ}/?F'[?15ؾ 8gַWٳ?;`D?!qcWv]Dt~L? UUa%a"HBORG_/SE p 6/H/_l/TEѵx@@t:$@@D4sҎu ?QByRگ !T=V4tGVGV4Y!44_F\e_wSPGNk_R/(<MDuo[cuB_NĹoF{vUumU {M{JgFE &tiHs!T=0gҴlHqLc,@XSq:x"46lVHx.V/5v5G|UuƿؿlVHnNi =ԧ(mUaXFǯ'2}Sk!kaodoUoo(NRC7֯[mu"@@RT*&{2);M_sd}я㏋*^2d:oQo{Z Ѹ`ߛ-/~[Bȣ)l@#)AEr'O&%O=O|$ __qWgO\_O____)_6Sgmnt 3p 0qW$i{!jgDzoo4|4x{Ǜ?fK!3rgf@fOXD~gD4{3y //%/7/-^@+x<@@Fh4%@@H$D@`?ń &//"q2#@v+@v?3@vS@vg1Cs{@vU!++U??SSUgg{{f&?M]A~6:D?Lk`f=~7ѿ?߂5e(N^>OPObO R +?6ՙSfgo噴᤻@nE6E$PnAVЁ4VV?V,VSVVgKVVЏro.@omLooP*7+r+nA zՉ߆9u]CaPkBORp_]`Ep KXjn`zև̀Qtq Ÿ;t!ⅣwQӒ߿<Ṣ-I?oDq1,5ίlf:@O'oB()8<+M[+'AfA/OXeOwOI_IZxc gXOKTx,2)8^1Vd,@3q q7xriK73Y+`p//7,5Y%?//7xY/Dž??.>nP?l 1CI?]o?zߐO߰\ShD^Lk`A/#/5/.@>[O|HQaYSsZu??E c,ٖ?-㳮@OWL(C$6~YATfxC Aߛ߭߿j=lS@ѱ_m-*Z _ "$_Į>_ %VXP>Eeb_Yl_r ?ҀLSeF/aU…TAoMb°RUh[]Y__Uʾ᫥Zo/aaooTooA/ }˲ѹX8}+噷=Զ#Q\nh}+O|0T"DF#+Sepmn tOP2M@ 1CUgy~8j  {*3!%3y VԎ1?7|?OOӢ7F_COMI6@NO8JߖOO|_>HdGy#OOKS°; __逘[A_S_e_w_D$3)*_.]` LnCo`orPzb<S#0`` Fl`>` X?2ߵ1ݵ6 _{rYG_ !FLo1oUo"|pooM|o8Py&_k}y.__ .@Rd/'/=_L.4oy,;MBT+}П*x1C@U}y1AHTԡѤEVioj5(OQCboأoS)CP1ap8 @@tA%@@~? @@` K?rʿDܿ 6`)i̟fcПwџbK1Ο͟ǦSYccwwǦǦvXB$?BQYbڒzW lתu~#DO51#?eb#_5[SQKQGQ WQ uyUċ1AuǪuK1ijwSUYǃau8DRPOQYP @ТP @+P H4)T_GBR0@_E0@/ooN/tZVj?@ q///,) pR++L;k&#B?4?TR=<b1r[?m?=!M̺>OPOTTOOLTTOTOOb __PB_T_f_x_[_____oom>oPobotoooooo3EWh^H///?7?I?6H?l~Ə؏7YߦYOU Ab1H/Z/l/ew BP(F($ 2DV?c,-㳮s3` Ac`entwCowor}0b(0㸱Sbu>``` F0lwn` o2ev@idТ3#`96v5|%1RY@RYx?,ƏPbt //(/:/6_H_Z_/i?4??/Zl?$?Z?l???2???O O2ODOVOhOzOFOOzOOOXBb2 _ h_wfl6_______!` xo#o5oGoVh}oo[mŶHH+=Oasz͏ߏ'9#]oɟ۟ 5篇}]oůׯ Ug5/ӿ -FIϨGK1i}?(ϱXC5"zUp8@=Oasߗߩ ƧL;k C.֠/);M5c ozooo_)zK1:L{puV\2K1mK1.@Rdv}/~*<`r??O8//$Zl/"/X/j/꟎/////// ??0??'tS<`o1y7Y1DžԏO!@7?@jZȰò֒pBP(ҵȰݳ?LUxaqauAuA|Ma6-]O y]ɭO CªO ̒@Ry"R*rIOPr }BLQVeQjaU҅CT|oCbR 5[@m4_F_U&(.am>!ojaqoo!3/ H}0% 6"ɓs}fԷxŜ|޴;}f&J|k4^fSmPgmmT 10RFc\nq˯ݯ<8j1DV b{en!3T ߑ"a-W43@fc0$pN( MIt(:;@?H~?S@@#׆%$(τE($ozI קO~DzDOE8· U6 i6E2K6U6U6i6i6NMx&?'Y=H,_iP]"ӏ=Oߤh(Q&/v %7!%u sޥ zg憆}%ɔxZTΡ"bⴲSH$,@CRqˈŏǯvߤ;0畡qCUqb q%JWi߁v*.ߤkq¡s{GϤ(%5D¡ 5H!0CUh4 ~'w%?.*2C)*2)8**R"@X&[h͡%e1fm WCU֡!Ρ%CU pF?@@?rȄ&ϡt1 )+%t119"67."4'u_8+%N-R"ޢΡկ篇/ѼMt) #^!1wA QFf''V%+-Vz lDoe#P.coul5Ռoo㿀_@_'o%o7cQlւ}Ӑl/F'[?ۿz15 8g֔Wٳ?;Կ=4?!qc4v]Dt~L?2%gah^"HO @=@ co/%/_I/TE}>s@@ޡ1$@@D@Mtוbsiu?Qy!|DVt$V$V𙘂I!_#WSF_U0PGNka_sRW(8OJO\Oҿ8///(/8J^/տ/ȟ//??$?6?H?Z?l?~?rd<?a I%Aec ooonKxk2?@xf"p*accfUppby&Gu{p*ag5p1>]mn@džKn c*]BTfx`@pOhf (>/!¨<=#ON`$&ޱ#Bߧ%\&5?G?k?}??????? Op-O?OQOcOuOOO_OOO_X_)_;]n *aЯ*O&8J\nP_q@GL@B^r-ADctL65TBM%a 1hA@t5A9R@ @l>D Q<]AL9QQƜ_VԏEPz|>O@@X,?@p:_N?_dge$G[Prr;@1@u'@u`F¯?uPjr_b:Phfsrqpq`@VL_q_qQ^r@1ss?1sBvCvdbbbo @-`B!E\$MUr?wCwC.??Ov d)IaH` 25@ġ2` A k0cunqФAd0 @nT`fT0aw0supi0rcy%4F2`@nP >SJyP@e/ _XOfsut߻ Y.. `@Dgci}0z6`@Mi0gw0i)ik0\˨B1hEFdt?@F BP(?H^Lgnuc5cb aar8bE@m! l AQFga` Rds6g5f- `ŢP#` LATA𔁾Arn_g~X'k[phFЂj@Rr̃AQAT@aM?@<bv1JsTbz՛P3@\X< ggL8"TlQQ|B23S-BsїQjjQ_2$`1\89ƒ:hBaaQQ11 b>`r15ABQtrqQ~rqQ2r3qQO1l=R>>ٴyH‚TD,@k1۠zZ5V5kAku!Ci0jt1|,FpgDkB vn r\?P@(2ЍBCF@ @3RBZ"cvWx`j*ufI{sVc4V\f vC/~HWsVƕhE%/WhEF$/_/asV//yZg bBr0a`1,;fl?@rR#P~3@6P@;`o@ QV5 )q}AkZ e ,NuUu“qn AT0V*1Т,Ғ? q8ѯ?@ };`&a;Ґh;S@א̀lV Н̀}R__?\-X-U-I;SZa[f4j0 *o____U@jo8oo\onohaC^guQ^qè[6t @ark-Rn a;ңzd 'oW{woP)z'9E QsX@A},܅8kN=pTbQkOQroxpv{-uOpvj-@ϏhkzQmujvDR1 dvAxXZ!Ə؏\O j̫pvq w򟳟Gpv^yϋϐ0ƿfxš~OO3VJ}icLQ3mK&aV&-~x&axcOJgF_x!0JMLt L#i:הP1 kc2ܔ^avov Qߜ|ߗߩ'D)Z q׀OJ@Q3 &C7/&Xр` T av\@lShi"rt0v21($$1`eOrfZBd-)1nMA/A>7B@B.10;9o3!Q2_=Ў@` {1ѹ!w1QTEg9~? BP(?@@4>An211b05=Dɺ8E42aaV222RHD$sI DpJ-Da=LGD?PMTD NLaDOnD!aaqQDXRD81[ CTLDUD6RVDWDUXDY$DZD[ T"(?q?q2]$TQJQ_>TY!!S YS%g!gR0a;TpDV1?ZV5=A 128{#@vn@r\?_'367-9a,b+Q?1^gl(DRU1BXRB8V5unU+B8`@p7.?@-n3"G2U6eowf8A8A1d]3umRAdjU`$oU[U@X,!?f~hB!vuZ|a=V1ьdRB\Y5oDqя8w?!|aRAa,gՀavubolF`0 _A/ASewƚF|>o=a|a@Rdv ~a¶q!Qcu- ӿ՟ͯΟ-ϭ|aRAdVRAf6CEBϴ&]V5䋷Fh?FL/?F?4ai?a"K%JR"FM Fɟ D[,d>vuz1֥طҸZuLóՍ堞,d)wAs߅ߗߩ3ZxFO=O~߃#Z6F]l6Pdt!Nd814 .$y,>sI [[/#q-J'yA// _/,='?/[/5??$:_OQO|VܦO?Xa^qDf I^^$O6O AƵ,/768noV0?@֬@q?@L?@(>D(%{S_76Lx?@F9^?@mxJAr<0b 70 0b*06030Ny`F!>"D' 81 UDt(!t c!$a%@ Adsg*# esk$// Wv܉t9TF`B?vPD4vP$]9ڣU1( O-D&UA%U f -h"/T))+U( g&+ P- `m-vT ?!}-a8LXQ -H*)A/"/) EQ.///feArial UncodeMiS6?/?`4 R$fSymbol$67fWingds*7 fECalibr@  ?$fSwimunt(S$fPMingLU(w$fMS PGothicj@ $fDotum"|i0@ S$fESylaen  $fEstrangeloU dsaC 9$fEVrind1a8 Q$fEShrutqi| Q$fEM_angl$fETunga<"@ Q$fGSendya*/ (   R$fERavi"o Q$fGDhenu"*/ (  R$fELath#/ R$fEGautmqi | Q$fECordia NewE R$fEArial"*Cx /@~4 R$fMalgun Gothic |w L$fETimes NwRoan*Ax /@4$YEB4Y.BPM%BtPr=B4I3BH5BPGBtP^:Bt7BρABT0B@1B4q0B:0B3т;B4 .B:9Bs-BD2BDP҃;B, 8BD,EIB'BJBTheDoc"Gestur Fom a FhrungsliieGuideSTR Normal0Byte oudrVai bl.37,Byte o]rvaibl.370Byte oudrVai bl.38,Byte o]rvaibl.380Byte oudrVai bl.39,Byte o]rvaibl.39&msvNoAWutCn 7ecPage-1"Zeichnblat -10Byte oudrVai bl.4visVerion,Byte o]rvaibl.400Byte oudrVai bl.41*Byte oudrVai bl&Byte o]rvai7bl0Byte oudrVai bl. 1,Byte o]rvaiwbl.1"Zeichnblat -2Page-2EinfachBasicRe_chtkRectan7gl,Byte o]rvaibl.410Byte oudrVai bl.42,Byte o]rvaibl.420Byte oudrVai bl.43,Byte o]rvaibl.430Byte oudrVai bl.2,Byte o]rvaibl.20Flus normaFlow NrmaBUmgekhrt sucwif_Klamr Revrs bac6msvPreiwIconCopT Pa g&msvStrucueTyp 4msvSDTarge_tIn eusc io 4msvSDCaloutNHi'ght(msvSDCalou]ttye2msvSDCalou]ttyen *msvSha_peCtgorisOrientaioHi_deLaruAtachToSide"Re_sizW_thTxSideLewadrBginLeadrE n(WHBoxInterUscin IsEndnteri oExtens7ioInsetSideMpont&fnMidp}ontOfse&CaloutuSyeR oCStyle1CStyle2CStyle3CStyle4CStyle5CStyle6CStyle7CStyle8CStyle9CStyle10CStyle 1CStyle12CStyle13CStyle14CStyle15CStyle16CStyle17CStyle18CStyle19CStyle20$Orient]aioR oOrientTopOrientWBotmOrient5LfOrientRghOrientAuoLeadrRotLeadrH inLewadrC7nt$LeadrMipontsuAsociaton$Design}fekt.1visUSETypemsvTheeInfomsvTheeyp(msvTheeLatinFo t(msvTheeAia_nFo t,msvTheeCoplxFnt6msvTheeLinTra sprncy,msvTheeLinPate r *msvTheeLin]Wigt.msvTheeLin_Rou dg@msvTheeCon _ectrwra sprny6msvTheeCon ectrWPatr 4msvTheeCon ectr]Wigt8msvTheeCon ectruRu di g2msvTheeCon ectrBgi .msvTheeCon ectrE d0msvTheeCon ectrE d2:msvTheeCon ectr]Bgi S z6msvTheeCon ectrE dSi z6msvTheeFil Tranprncy,msvTheeFil Patern:msvTheeSadWowr np rncy0msvTheeSad_owP tern,msvTheeSadowty l0msvTheeSadowXOfst0msvTheeSadowYOfst<msvTheeSadowM g_nifc 5to4msvTheeSadowDircton"msvTheeCol r$msvTheeEfe7ctVerbin dCo}nectr0Dynamische_r Vb7nd(Dynamic onetrTextPoWsiin Textan}mrkug$Text AUnoainuAtribuesBpmnId"BpmnCategoris(BpmnDocueta in&BpmnArtifa]cTyeBpmnNaeBpmnStae"BpmnPruoetis,BpmnPruoetis_Nae,BpmnPruoetis_Ty.BpmnPruoetis_Va7luLBpmnPruoetis_Valu_EUxr s oBdyTBpmnPruoetis_Valu_EUxr s o]Lnga9e:BpmnPruoeti_s_Cr_ela oBpmnText$BpmnCatego_ryRf$BpmnEleetTye6BpmnConectigOb]jTye(BpmnCoditT ye4BpmnCoditExres  RBpmnCoditExres _BdyZBpmnCoditExres _Lagu;g"BpmnMe]sagRf,BpmnMe]sagR_f_Nm8BpmnMe]sagRf_PruoetiBpmnMesagRf_Proeti_5NmBpmnMesagRf_Proeti_7TyDBpmnMe]sagRf_Pruoetiw_VlubBpmnMe]sagRf_Pruoetiw_Vlu__ExrinodyjBpmnMe]sagRf_Pruoetiw_Vlu__Exr]inLn uPBpmnMe]sagRwf_roeti_uCrel o2BpmnMe]sagRf_Fro RBpmnMe]sagRf_Fro Prtic+pn.)TyeBpmnMesagRf_Froj Rl FBpmnMe]sagRwf_ro Eti'y .BpmnMe]sagRf_To NBpmnMe]sagRf_To Prtic'pn%Tye>BpmnMe]sagRf_To 5Rl BpmnMesagRf__To Eti#y  BpmnDirect o&Textan}mrkug.49*Text AUnoain.490msvWarwnOPesoal5If0Byte oudrVai bl.46,Byte o]rvaibl.460Byte oudrVai bl.47,Byte o]rvaibl.470Byte oudrVai bl.48,Byte o]rvaibl.480Byte oudrVai bl.5,Byte o]rvaibl.500Byte oudrVai bl.95,Byte o]rvaibl.950Byte oudrVai bl.97,Byte o]rvaibl.97JUmgekhrt sucwif_Klamr.105(Revrs bac.7102Byte oudrVai bl.10.Byte o]rvaibl.1020Byte oudrVai bl.54,Byte o]rvaibl.540Byte oudrVai bl. 5,Byte o]rvaiwbl.50Byte oudrVai bl.56,Byte o]rvaibl.560Byte oudrVai bl.57,Byte o]rvaibl.570Byte oudrVai bl.6,Byte o]rvaibl.600Byte oudrVai bl.61,Byte o]rvaibl.610Byte oudrVai bl.62,Byte o]rvaibl.620Byte oudrVai bl.65,Byte o]rvaibl.65HUmgekhrt sucwif_Klamr.68&Revrs bac.682Byte oudrVai bl.10.Byte o]rvaibl.1202Byte oudrVai bl.11.Byte o]rvaibl.1 22Byte oudrVai bl.14.Byte o]rvaibl.142JUmgekhrt sucwif_Klamr.126(Revrs bac.1266Dynamische_r Vbnd.81.Dynamic onetr81JUmgekhrt sucwif_Klamr.148(Revrs bac.1482Byte oudrVai bl.16.Byte o]rvaibl.162JUmgekhrt sucwif_Klamr.167(Revrs bac.1672Byte oudrVai bl.168.Byte o]rvaibl.1682Byte oudrVai bl.186.Byte o]rvaibl.1862Byte oudrVai bl.719.Byte o]rvaibl.1 90Byte oudrVai bl.82,Byte o]rvaibl.826Dynamische_r Vbnd.83.Dynamic onetr836Dynamische_r Vbnd.85.Dynamic onetr852Byte oudrVai bl.19.Byte o]rvaibl.1922Byte oudrVai bl.193.Byte o]rvaibl.1932Byte oudrVa]i bl.1.Byte o]rvaibl.2 12Byte oudrVa]i bl.17.Byte o]rvaibl.2172Byte oudrVa]i bl.18.Byte o]rvaibl.2182Byte oudrVa]i bl.19.Byte o]rvaibl.219JUmgekhrt sucwif_Klam_r.236(Revrs bac.26p3hSG3T%G3$G3XT E3TG3|B81G3di.G3dfE3^]E3S1G3OЇ.G3\B1G3/.G3](G3hSG3%G3L/G3E3ĬTG3R.G3ܩ=1G3n+G34(G31G3d.G3, %G3hSEG3iSZG3TrE33G3 3G3|E34E3DR.G31G3tR.G3lI1G3Rz.G3fE3fE3fE3/G3.G3fE3\fE3T"G3T;G3tZ;G3!G3D<9G3)G3,7G3dO3G3$*G32G3Tލ-G3T G3$T*G3D"G3ԉf$G3TE3DTG3<3G3ю*G3$G3X3G3T;E3,KG3i)G3'G3LiSG3diSяG3iSG3iSG3iSG3iS1G3iSIG3jSaG3jSyG33G33G33ŐG33ߐG34G3 4G3<4-G3X4GG34aG34{G34G3T&G34ՑG3 G3dTG3T.G3TMG3ĭTjG3G3ԊG3’&G3TG3,&G3T,G3TJ"G3l G3,G3D*G3t.G3<8G3H/G3w+G3Ԅ.G3Д?G3<8G3 G5G3=|9G3D4G3|0G32G3D=K;G3=9G3=8G3/G3>&:G3`2G34/G3$2G3\2G3D>%=G3b7G3%G3ԋ'G35G3 5G3̆0G3dI)G3r G3\]E3GE3GE3GE3GE3GE3GE3GE3GE3GE3GE3GE3G™E3GƙE3 GʙE3GΙE3GҙE3$G֙E3,GڙE34GޙE3DGE3GE3,#G3T %G3$T2G34jSNG3c&G3)G3)G3<5ۚG3X5G3$G3$3.G3Ta-G3Ĉ1G3 IG3NPG3QX9G35G3Ԍ(G3Ӝ&G3R4G3-(G3U1G3$N=G3NÝEG3,$G3,.G3DRZ8G3d >G3 О=G3  CG3PZG3]G3NJG34Q1G3DNKG3T ͠5G3 <G3l>-G3NkGG3 3G3D 6G3T$G3?)G3h+G32G3IŢ1G3D.G3I$1G3DU.G34yI1G3$g.G3/G34 P.G34­?1G3 Pp.G3Ĉ1G3oϤ.G3qDG3KA)G3@[j1G3@[0G3T1˥1G3X.G3?*1G3tX[.G31G3DX.G3<1G3X.G3tG/G3Xv.G31G3 Xէ.G31G34 X4.G3b1G3J.G3XAG3t'G3A[)2G3TA[[0G3y2G3y0G31G340G3tRNDG34)G3DbX6G3$/G3 DG3od)G3z1G3Lz0G3DG3$]2)G3j[3G3j0G3,k3G3dk0G349!3G3l9T0G3/1G3/P.G3D I6G3Ԕ/G3H6G3tX~/G3X1G3ޮ0G3<3G3TA0G39q0G390G3:ѯ2G3L:0G3:32G3:e0G3:2G3,;ǰ0G35BG3CK9(G  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~     ]>rFxml:spaceprsrv]rFxmlns:vdhtp/%scea .i+ro of.+o/i iA/20*c6%et/ \n]rFxmlns:v14htp/'sUcea .i-ro oUf.-o/GUf=e'v=s=]o'200'Eet1 lnU&U-.t4 "H$ @Y,6@ d!C-*7 AU %t4 ҭB C>-^]O7"AJ@GNR@ܢGQ7RH<(H<(JETGREGR{7   g"4FXo 8)(N1j@(/?{PhBĿ6 PZlz`S}~3 BvR٘R$I!$OI)\9W'^_j~~1__d5P25a0TU9B="diG zK&KG?Q!{W*'"Dy ~%!././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/internals/data-structures.rst0000644000076500000240000014567414641074756021062 0ustar00twstaff.. include:: ../global.rst.inc .. highlight:: none .. _data-structures: Data structures and file formats ================================ This page documents the internal data structures and storage mechanisms of Borg. It is partly based on `mailing list discussion about internals`_ and also on static code analysis. .. todo:: Clarify terms, perhaps create a glossary. ID (client?) vs. key (repository?), chunks (blob of data in repo?) vs. object (blob of data in repo, referred to from another object?), .. _repository: Repository ---------- .. Some parts of this description were taken from the Repository docstring Borg stores its data in a `Repository`, which is a file system based transactional key-value store. Thus the repository does not know about the concept of archives or items. Each repository has the following file structure: README simple text file telling that this is a Borg repository config repository configuration data/ directory where the actual data is stored hints.%d hints for repository compaction index.%d repository index lock.roster and lock.exclusive/* used by the locking system to manage shared and exclusive locks Transactionality is achieved by using a log (aka journal) to record changes. The log is a series of numbered files called segments_. Each segment is a series of log entries. The segment number together with the offset of each entry relative to its segment start establishes an ordering of the log entries. This is the "definition" of time for the purposes of the log. .. _config-file: Config file ~~~~~~~~~~~ Each repository has a ``config`` file which is a ``INI``-style file and looks like this:: [repository] version = 1 segments_per_dir = 1000 max_segment_size = 524288000 id = 57d6c1d52ce76a836b532b0e42e677dec6af9fca3673db511279358828a21ed6 This is where the ``repository.id`` is stored. It is a unique identifier for repositories. It will not change if you move the repository around so you can make a local transfer then decide to move the repository to another (even remote) location at a later time. Keys ~~~~ Repository keys are byte-strings of fixed length (32 bytes), they don't have a particular meaning (except for the Manifest_). Normally the keys are computed like this:: key = id = id_hash(unencrypted_data) The id_hash function depends on the :ref:`encryption mode `. As the id / key is used for deduplication, id_hash must be a cryptographically strong hash or MAC. Segments ~~~~~~~~ Objects referenced by a key are stored inline in files (`segments`) of approx. 500 MB size in numbered subdirectories of ``repo/data``. The number of segments per directory is controlled by the value of ``segments_per_dir``. If you change this value in a non-empty repository, you may also need to relocate the segment files manually. A segment starts with a magic number (``BORG_SEG`` as an eight byte ASCII string), followed by a number of log entries. Each log entry consists of: (in this order) * First, unsigned 32-bit number, the CRC32 of the entire entry (for a PUT including the DATA) excluding the CRC32 field * Second, unsigned 32-bit size of the entry (including the whole header) * Third, unsigned 8-bit entry tag: PUT(0), DELETE(1) or COMMIT(2) * Fourth, on PUT or DELETE, 32 byte key * Fifth, PUT only, (size - 41) bytes of data (length = size - sizeof(CRC32) - sizeof(size) - sizeof(entry tag) - sizeof(key)) Those files are strictly append-only and modified only once. Tag is either ``PUT``, ``DELETE``, or ``COMMIT``. When an object is written to the repository a ``PUT`` entry is written to the file containing the object id and data. If an object is deleted a ``DELETE`` entry is appended with the object id. A ``COMMIT`` tag is written when a repository transaction is committed. The segment number of the segment containing a commit is the **transaction ID**. When a repository is opened any ``PUT`` or ``DELETE`` operations not followed by a ``COMMIT`` tag are discarded since they are part of a partial/uncommitted transaction. The size of individual segments is limited to 4 GiB, since the offset of entries within segments is stored in a 32-bit unsigned integer in the repository index. Objects ~~~~~~~ All objects (the manifest, archives, archive item streams chunks and file data chunks) are encrypted and/or compressed. See :ref:`data-encryption` for a graphic outlining the anatomy of an object in Borg. The `type` for compression is explained in :ref:`data-compression`. Index, hints and integrity ~~~~~~~~~~~~~~~~~~~~~~~~~~ The **repository index** is stored in ``index.`` and is used to determine an object's location in the repository. It is a HashIndex_, a hash table using open addressing. It maps object keys_ to two unsigned 32-bit integers; the first integer gives the segment number, the second indicates the offset of the object's entry within the segment. The **hints file** is a msgpacked file named ``hints.``. It contains: * version * list of segments * compact The **integrity file** is a msgpacked file named ``integrity.``. It contains checksums of the index and hints files and is described in the :ref:`Checksumming data structures ` section below. If the index or hints are corrupted, they are re-generated automatically. If they are outdated, segments are replayed from the index state to the currently committed transaction. Compaction ~~~~~~~~~~ For a given key only the last entry regarding the key, which is called current (all other entries are called superseded), is relevant: If there is no entry or the last entry is a DELETE then the key does not exist. Otherwise the last PUT defines the value of the key. By superseding a PUT (with either another PUT or a DELETE) the log entry becomes obsolete. A segment containing such obsolete entries is called sparse, while a segment containing no such entries is called compact. Since writing a ``DELETE`` tag does not actually delete any data and thus does not free disk space any log-based data store will need a compaction strategy (somewhat analogous to a garbage collector). Borg uses a simple forward compacting algorithm, which avoids modifying existing segments. Compaction runs when a commit is issued with ``compact=True`` parameter, e.g. by the ``borg compact`` command (unless the :ref:`append_only_mode` is active). One client transaction can manifest as multiple physical transactions, since compaction is transacted, too, and Borg does not distinguish between the two:: Perspective| Time --> -----------+-------------- Client | Begin transaction - Modify Data - Commit | (done) Repository | Begin transaction - Modify Data - Commit | Compact segments - Commit | (done) The compaction algorithm requires two inputs in addition to the segments themselves: (i) Which segments are sparse, to avoid scanning all segments (impractical). Further, Borg uses a conditional compaction strategy: Only those segments that exceed a threshold sparsity are compacted. To implement the threshold condition efficiently, the sparsity has to be stored as well. Therefore, Borg stores a mapping ``(segment id,) -> (number of sparse bytes,)``. The 1.0.x series used a simpler non-conditional algorithm, which only required the list of sparse segments. Thus, it only stored a list, not the mapping described above. (ii) Each segment's reference count, which indicates how many live objects are in a segment. This is not strictly required to perform the algorithm. Rather, it is used to validate that a segment is unused before deleting it. If the algorithm is incorrect, or the reference count was not accounted correctly, then an assertion failure occurs. These two pieces of information are stored in the hints file (`hints.N`) next to the index (`index.N`). When loading a hints file, Borg checks the version contained in the file. The 1.0.x series writes version 1 of the format (with the segments list instead of the mapping, mentioned above). Since Borg 1.0.4, version 2 is read as well. The 1.1.x series writes version 2 of the format and reads either version. When reading a version 1 hints file, Borg 1.1.x will read all sparse segments to determine their sparsity. This process may take some time if a repository has been kept in append-only mode or ``borg compact`` has not been used for a longer time, which both has caused the number of sparse segments to grow. Compaction processes sparse segments from oldest to newest; sparse segments which don't contain enough deleted data to justify compaction are skipped. This avoids doing e.g. 500 MB of writing current data to a new segment when only a couple kB were deleted in a segment. Segments that are compacted are read in entirety. Current entries are written to a new segment, while superseded entries are omitted. After each segment an intermediary commit is written to the new segment. Then, the old segment is deleted (asserting that the reference count diminished to zero), freeing disk space. A simplified example (excluding conditional compaction and with simpler commit logic) showing the principal operation of compaction: .. figure:: compaction.png :figwidth: 100% :width: 100% (The actual algorithm is more complex to avoid various consistency issues, refer to the ``borg.repository`` module for more comments and documentation on these issues.) .. _internals_storage_quota: Storage quotas ~~~~~~~~~~~~~~ Quotas are implemented at the Repository level. The active quota of a repository is determined by the ``storage_quota`` `config` entry or a run-time override (via :ref:`borg_serve`). The currently used quota is stored in the hints file. Operations (PUT and DELETE) during a transaction modify the currently used quota: - A PUT adds the size of the *log entry* to the quota, i.e. the length of the data plus the 41 byte header. - A DELETE subtracts the size of the deleted log entry from the quota, which includes the header. Thus, PUT and DELETE are symmetric and cancel each other out precisely. The quota does not track on-disk size overheads (due to conditional compaction or append-only mode). In normal operation the inclusion of the log entry headers in the quota act as a faithful proxy for index and hints overheads. By tracking effective content size, the client can *always* recover from a full quota by deleting archives. This would not be possible if the quota tracked on-disk size, since journaling DELETEs requires extra disk space before space is freed. Tracking effective size on the other hand accounts DELETEs immediately as freeing quota. .. rubric:: Enforcing the quota The storage quota is meant as a robust mechanism for service providers, therefore :ref:`borg_serve` has to enforce it without loopholes (e.g. modified clients). The following sections refer to using quotas on remotely accessed repositories. For local access, consider *client* and *serve* the same. Accordingly, quotas cannot be enforced with local access, since the quota can be changed in the repository config. The quota is enforcible only if *all* :ref:`borg_serve` versions accessible to clients support quotas (see next section). Further, quota is per repository. Therefore, ensure clients can only access a defined set of repositories with their quotas set, using ``--restrict-to-repository``. If the client exceeds the storage quota the ``StorageQuotaExceeded`` exception is raised. Normally a client could ignore such an exception and just send a ``commit()`` command anyway, circumventing the quota. However, when ``StorageQuotaExceeded`` is raised, it is stored in the ``transaction_doomed`` attribute of the repository. If the transaction is doomed, then commit will re-raise this exception, aborting the commit. The transaction_doomed indicator is reset on a rollback (which erases the quota-exceeding state). .. rubric:: Compatibility with older servers and enabling quota after-the-fact If no quota data is stored in the hints file, Borg assumes zero quota is used. Thus, if a repository with an enabled quota is written to with an older ``borg serve`` version that does not understand quotas, then the quota usage will be erased. The client version is irrelevant to the storage quota and has no part in it. The form of error messages due to exceeding quota varies with client versions. A similar situation arises when upgrading from a Borg release that did not have quotas. Borg will start tracking quota use from the time of the upgrade, starting at zero. If the quota shall be enforced accurately in these cases, either - delete the ``index.N`` and ``hints.N`` files, forcing Borg to rebuild both, re-acquiring quota data in the process, or - edit the msgpacked ``hints.N`` file (not recommended and thus not documented further). The object graph ---------------- On top of the simple key-value store offered by the Repository_, Borg builds a much more sophisticated data structure that is essentially a completely encrypted object graph. Objects, such as archives_, are referenced by their chunk ID, which is cryptographically derived from their contents. More on how this helps security in :ref:`security_structural_auth`. .. figure:: object-graph.png :figwidth: 100% :width: 100% .. _manifest: The manifest ~~~~~~~~~~~~ The manifest is the root of the object hierarchy. It references all archives in a repository, and thus all data in it. Since no object references it, it cannot be stored under its ID key. Instead, the manifest has a fixed all-zero key. The manifest is rewritten each time an archive is created, deleted, or modified. It looks like this: .. code-block:: python { b'version': 1, b'timestamp': b'2017-05-05T12:42:23.042864', b'item_keys': [b'acl_access', b'acl_default', ...], b'config': {}, b'archives': { b'2017-05-05-system-backup': { b'id': b'<32 byte binary object ID>', b'time': b'2017-05-05T12:42:22.942864', }, }, b'tam': ..., } The *version* field can be either 1 or 2. The versions differ in the way feature flags are handled, described below. The *timestamp* field is used to avoid logical replay attacks where the server just resets the repository to a previous state. *item_keys* is a list containing all Item_ keys that may be encountered in the repository. It is used by *borg check*, which verifies that all keys in all items are a subset of these keys. Thus, an older version of *borg check* supporting this mechanism can correctly detect keys introduced in later versions. The *tam* key is part of the :ref:`tertiary authentication mechanism ` (formerly known as "tertiary authentication for metadata") and authenticates the manifest, since an ID check is not possible. *config* is a general-purpose location for additional metadata. All versions of Borg preserve its contents (it may have been a better place for *item_keys*, which is not preserved by unaware Borg versions, releases predating 1.0.4). Feature flags +++++++++++++ Feature flags are used to add features to data structures without causing corruption if older versions are used to access or modify them. The main issues to consider for a feature flag oriented design are flag granularity, flag storage, and cache_ invalidation. Feature flags are divided in approximately three categories, detailed below. Due to the nature of ID-based deduplication, write (i.e. creating archives) and read access are not symmetric; it is possible to create archives referencing chunks that are not readable with the current feature set. The third category are operations that require accurate reference counts, for example archive deletion and check. As the manifest is always updated and always read, it is the ideal place to store feature flags, comparable to the super-block of a file system. The only problem is to recover from a lost manifest, i.e. how is it possible to detect which feature flags are enabled, if there is no manifest to tell. This issue is left open at this time, but is not expected to be a major hurdle; it doesn't have to be handled efficiently, it just needs to be handled. Lastly, cache_ invalidation is handled by noting which feature flags were and which were not understood while manipulating a cache. This allows borg to detect whether the cache needs to be invalidated, i.e. rebuilt from scratch. See `Cache feature flags`_ below. The *config* key stores the feature flags enabled on a repository: .. code-block:: python config = { b'feature_flags': { b'read': { b'mandatory': [b'some_feature'], }, b'check': { b'mandatory': [b'other_feature'], } b'write': ..., b'delete': ... }, } The top-level distinction for feature flags is the operation the client intends to perform, | the *read* operation includes extraction and listing of archives, | the *write* operation includes creating new archives, | the *delete* (archives) operation, | the *check* operation requires full understanding of everything in the repository. | These are weakly set-ordered; *check* will include everything required for *delete*, *delete* will likely include *write* and *read*. However, *read* may require more features than *write* (due to ID-based deduplication, *write* does not necessarily require reading/understanding repository contents). Each operation can contain several sets of feature flags. Only one set, the *mandatory* set is currently defined. Upon reading the manifest, the Borg client has already determined which operation should be performed. If feature flags are found in the manifest, the set of feature flags supported by the client is compared to the mandatory set found in the manifest. If any unsupported flags are found (i.e. the mandatory set is not a subset of the features supported by the Borg client used), the operation is aborted with a *MandatoryFeatureUnsupported* error: Unsupported repository feature(s) {'some_feature'}. A newer version of borg is required to access this repository. Older Borg releases do not have this concept and do not perform feature flags checks. These can be locked out with manifest version 2. Thus, the only difference between manifest versions 1 and 2 is that the latter is only accepted by Borg releases implementing feature flags. Therefore, as soon as any mandatory feature flag is enabled in a repository, the manifest version must be switched to version 2 in order to lock out all Borg releases unaware of feature flags. .. _Cache feature flags: .. rubric:: Cache feature flags `The cache`_ does not have its separate set of feature flags. Instead, Borg stores which flags were used to create or modify a cache. All mandatory manifest features from all operations are gathered in one set. Then, two sets of features are computed; - those features that are supported by the client and mandated by the manifest are added to the *mandatory_features* set, - the *ignored_features* set comprised of those features mandated by the manifest, but not supported by the client. Because the client previously checked compliance with the mandatory set of features required for the particular operation it is executing, the *mandatory_features* set will contain all necessary features required for using the cache safely. Conversely, the *ignored_features* set contains only those features which were not relevant to operating the cache. Otherwise, the client would not pass the feature set test against the manifest. When opening a cache and the *mandatory_features* set is not a subset of the features supported by the client, the cache is wiped out and rebuilt, since a client not supporting a mandatory feature that the cache was built with would be unable to update it correctly. The assumption behind this behaviour is that any of the unsupported features could have been reflected in the cache and there is no way for the client to discern whether that is the case. Meanwhile, it may not be practical for every feature to have clients using it track whether the feature had an impact on the cache. Therefore, the cache is wiped. When opening a cache and the intersection of *ignored_features* and the features supported by the client contains any elements, i.e. the client possesses features that the previous client did not have and those new features are enabled in the repository, the cache is wiped out and rebuilt. While the former condition likely requires no tweaks, the latter condition is formulated in an especially conservative way to play it safe. It seems likely that specific features might be exempted from the latter condition. .. rubric:: Defined feature flags Currently no feature flags are defined. From currently planned features, some examples follow, these may/may not be implemented and purely serve as examples. - A mandatory *read* feature could be using a different encryption scheme (e.g. session keys). This may not be mandatory for the *write* operation - reading data is not strictly required for creating an archive. - Any additions to the way chunks are referenced (e.g. to support larger archives) would become a mandatory *delete* and *check* feature; *delete* implies knowing correct reference counts, so all object references need to be understood. *check* must discover the entire object graph as well, otherwise the "orphan chunks check" could delete data still in use. .. _archive: Archives ~~~~~~~~ Each archive is an object referenced by the manifest. The archive object itself does not store any of the data contained in the archive it describes. Instead, it contains a list of chunks which form a msgpacked stream of items_. The archive object itself further contains some metadata: * *version* * *name*, which might differ from the name set in the manifest. When :ref:`borg_check` rebuilds the manifest (e.g. if it was corrupted) and finds more than one archive object with the same name, it adds a counter to the name in the manifest, but leaves the *name* field of the archives as it was. * *items*, a list of chunk IDs containing item metadata (size: count * ~34B) * *cmdline*, the command line which was used to create the archive * *hostname* * *username* * *time* and *time_end* are the start and end timestamps, respectively * *comment*, a user-specified archive comment * *chunker_params* are the :ref:`chunker-params ` used for creating the archive. This is used by :ref:`borg_recreate` to determine whether a given archive needs rechunking. * Some other pieces of information related to recreate. .. _archive_limitation: .. rubric:: Note about archive limitations The archive is currently stored as a single object in the repository and thus limited in size to MAX_OBJECT_SIZE (20MiB). As one chunk list entry is ~40B, that means we can reference ~500.000 item metadata stream chunks per archive. Each item metadata stream chunk is ~128kiB (see hardcoded ITEMS_CHUNKER_PARAMS). So that means the whole item metadata stream is limited to ~64GiB chunks. If compression is used, the amount of storable metadata is bigger - by the compression factor. If the medium size of an item entry is 100B (small size file, no ACLs/xattrs), that means a limit of ~640 million files/directories per archive. If the medium size of an item entry is 2kB (~100MB size files or more ACLs/xattrs), the limit will be ~32 million files/directories per archive. If one tries to create an archive object bigger than MAX_OBJECT_SIZE, a fatal IntegrityError will be raised. A workaround is to create multiple archives with fewer items each, see also :issue:`1452`. .. _item: Items ~~~~~ Each item represents a file, directory or other file system item and is stored as a dictionary created by the ``Item`` class that contains: * path * list of data chunks (size: count * ~40B) * user * group * uid * gid * mode (item type + permissions) * source (for symlinks, and for hardlinks within one archive) * rdev (for device files) * mtime, atime, ctime in nanoseconds * xattrs * acl (various OS-dependent fields) * flags All items are serialized using msgpack and the resulting byte stream is fed into the same chunker algorithm as used for regular file data and turned into deduplicated chunks. The reference to these chunks is then added to the archive metadata. To achieve a finer granularity on this metadata stream, we use different chunker params for this chunker, which result in smaller chunks. A chunk is stored as an object as well, of course. .. _chunks: .. _chunker_details: Chunks ~~~~~~ Borg has these chunkers: - "fixed": a simple, low cpu overhead, fixed blocksize chunker, optionally supporting a header block of different size. - "buzhash": variable, content-defined blocksize, uses a rolling hash computed by the Buzhash_ algorithm. For some more general usage hints see also ``--chunker-params``. "fixed" chunker +++++++++++++++ The fixed chunker triggers (chunks) at even-spaced offsets, e.g. every 4MiB, producing chunks of same block size (the last chunk is not required to be full-size). Optionally, it supports processing a differently sized "header" first, before it starts to cut chunks of the desired block size. The default is not to have a differently sized header. ``borg create --chunker-params fixed,BLOCK_SIZE[,HEADER_SIZE]`` - BLOCK_SIZE: no default value, multiple of the system page size (usually 4096 bytes) recommended. E.g.: 4194304 would cut 4MiB sized chunks. - HEADER_SIZE: optional, defaults to 0 (no header). The fixed chunker also supports processing sparse files (reading only the ranges with data and seeking over the empty hole ranges). ``borg create --sparse --chunker-params fixed,BLOCK_SIZE[,HEADER_SIZE]`` "buzhash" chunker +++++++++++++++++ The buzhash chunker triggers (chunks) when the last HASH_MASK_BITS bits of the hash are zero, producing chunks with a target size of 2^HASH_MASK_BITS bytes. Buzhash is **only** used for cutting the chunks at places defined by the content, the buzhash value is **not** used as the deduplication criteria (we use a cryptographically strong hash/MAC over the chunk contents for this, the id_hash). The idea of content-defined chunking is assigning every byte where a cut *could* be placed a hash. The hash is based on some number of bytes (the window size) before the byte in question. Chunks are cut where the hash satisfies some condition (usually "n numbers of trailing/leading zeroes"). This causes chunks to be cut in the same location relative to the file's contents, even if bytes are inserted or removed before/after a cut, as long as the bytes within the window stay the same. This results in a high chance that a single cluster of changes to a file will only result in 1-2 new chunks, aiding deduplication. Using normal hash functions this would be extremely slow, requiring hashing approximately ``window size * file size`` bytes. A rolling hash is used instead, which allows to add a new input byte and compute a new hash as well as *remove* a previously added input byte from the computed hash. This makes the cost of computing a hash for each input byte largely independent of the window size. Borg defines minimum and maximum chunk sizes (CHUNK_MIN_EXP and CHUNK_MAX_EXP, respectively) which narrows down where cuts may be made, greatly reducing the amount of data that is actually hashed for content-defined chunking. ``borg create --chunker-params buzhash,CHUNK_MIN_EXP,CHUNK_MAX_EXP,HASH_MASK_BITS,HASH_WINDOW_SIZE`` can be used to tune the chunker parameters, the default is: - CHUNK_MIN_EXP = 19 (minimum chunk size = 2^19 B = 512 kiB) - CHUNK_MAX_EXP = 23 (maximum chunk size = 2^23 B = 8 MiB) - HASH_MASK_BITS = 21 (target chunk size ~= 2^21 B = 2 MiB) - HASH_WINDOW_SIZE = 4095 [B] (`0xFFF`) The buzhash table is altered by XORing it with a seed randomly generated once for the repository, and stored encrypted in the keyfile. This is to prevent chunk size based fingerprinting attacks on your encrypted repo contents (to guess what files you have based on a specific set of chunk sizes). .. _cache: The cache --------- The **files cache** is stored in ``cache/files`` and is used at backup time to quickly determine whether a given file is unchanged and we have all its chunks. In memory, the files cache is a key -> value mapping (a Python *dict*) and contains: * key: id_hash of the encoded, absolute file path * value: - file inode number - file size - file mtime_ns - age (0 [newest], 1, 2, 3, ..., BORG_FILES_CACHE_TTL - 1) - list of chunk ids representing the file's contents To determine whether a file has not changed, cached values are looked up via the key in the mapping and compared to the current file attribute values. If the file's size, mtime_ns and inode number is still the same, it is considered to not have changed. In that case, we check that all file content chunks are (still) present in the repository (we check that via the chunks cache). If everything is matching and all chunks are present, the file is not read / chunked / hashed again (but still a file metadata item is written to the archive, made from fresh file metadata read from the filesystem). This is what makes borg so fast when processing unchanged files. If there is a mismatch or a chunk is missing, the file is read / chunked / hashed. Chunks already present in repo won't be transferred to repo again. The inode number is stored and compared to make sure we distinguish between different files, as a single path may not be unique across different archives in different setups. Not all filesystems have stable inode numbers. If that is the case, borg can be told to ignore the inode number in the check via --ignore-inode. The age value is used for cache management. If a file is "seen" in a backup run, its age is reset to 0, otherwise its age is incremented by one. If a file was not seen in BORG_FILES_CACHE_TTL backups, its cache entry is removed. See also: :ref:`always_chunking` and :ref:`a_status_oddity` The files cache is a python dictionary, storing python objects, which generates a lot of overhead. Borg can also work without using the files cache (saves memory if you have a lot of files or not much RAM free), then all files are assumed to have changed. This is usually much slower than with files cache. The on-disk format of the files cache is a stream of msgpacked tuples (key, value). Loading the files cache involves reading the file, one msgpack object at a time, unpacking it, and msgpacking the value (in an effort to save memory). The **chunks cache** is stored in ``cache/chunks`` and is used to determine whether we already have a specific chunk, to count references to it and also for statistics. The chunks cache is a key -> value mapping and contains: * key: - chunk id_hash * value: - reference count - size - encrypted/compressed size The chunks cache is a HashIndex_. Due to some restrictions of HashIndex, the reference count of each given chunk is limited to a constant, MAX_VALUE (introduced below in HashIndex_), approximately 2**32. If a reference count hits MAX_VALUE, decrementing it yields MAX_VALUE again, i.e. the reference count is pinned to MAX_VALUE. .. _cache-memory-usage: Indexes / Caches memory usage ----------------------------- Here is the estimated memory usage of Borg - it's complicated:: chunk_size ~= 2 ^ HASH_MASK_BITS (for buzhash chunker, BLOCK_SIZE for fixed chunker) chunk_count ~= total_file_size / chunk_size repo_index_usage = chunk_count * 40 chunks_cache_usage = chunk_count * 44 files_cache_usage = total_file_count * 240 + chunk_count * 80 mem_usage ~= repo_index_usage + chunks_cache_usage + files_cache_usage = chunk_count * 164 + total_file_count * 240 Due to the hashtables, the best/usual/worst cases for memory allocation can be estimated like that:: mem_allocation = mem_usage / load_factor # l_f = 0.25 .. 0.75 mem_allocation_peak = mem_allocation * (1 + growth_factor) # g_f = 1.1 .. 2 All units are Bytes. It is assuming every chunk is referenced exactly once (if you have a lot of duplicate chunks, you will have fewer chunks than estimated above). It is also assuming that typical chunk size is 2^HASH_MASK_BITS (if you have a lot of files smaller than this statistical medium chunk size, you will have more chunks than estimated above, because 1 file is at least 1 chunk). If a remote repository is used the repo index will be allocated on the remote side. The chunks cache, files cache and the repo index are all implemented as hash tables. A hash table must have a significant amount of unused entries to be fast - the so-called load factor gives the used/unused elements ratio. When a hash table gets full (load factor getting too high), it needs to be grown (allocate new, bigger hash table, copy all elements over to it, free old hash table) - this will lead to short-time peaks in memory usage each time this happens. Usually does not happen for all hashtables at the same time, though. For small hash tables, we start with a growth factor of 2, which comes down to ~1.1x for big hash tables. E.g. backing up a total count of 1 Mi (IEC binary prefix i.e. 2^20) files with a total size of 1TiB. a) with ``create --chunker-params buzhash,10,23,16,4095`` (custom, like borg < 1.0 or attic): mem_usage = 2.8GiB b) with ``create --chunker-params buzhash,19,23,21,4095`` (default): mem_usage = 0.31GiB .. note:: There is also the ``--files-cache=disabled`` option to disable the files cache. You'll save some memory, but it will need to read / chunk all the files as it can not skip unmodified files then. HashIndex --------- The chunks cache and the repository index are stored as hash tables, with only one slot per bucket, spreading hash collisions to the following buckets. As a consequence the hash is just a start position for a linear search. If a key is looked up that is not in the table, then the hash table is searched from the start position (the hash) until the first empty bucket is reached. This particular mode of operation is open addressing with linear probing. When the hash table is filled to 75%, its size is grown. When it's emptied to 25%, its size is shrinked. Operations on it have a variable complexity between constant and linear with low factor, and memory overhead varies between 33% and 300%. If an element is deleted, and the slot behind the deleted element is not empty, then the element will leave a tombstone, a bucket marked as deleted. Tombstones are only removed by insertions using the tombstone's bucket, or by resizing the table. They present the same load to the hash table as a real entry, but do not count towards the regular load factor. Thus, if the number of empty slots becomes too low (recall that linear probing for an element not in the index stops at the first empty slot), the hash table is rebuilt. The maximum *effective* load factor, i.e. including tombstones, is 93%. Data in a HashIndex is always stored in little-endian format, which increases efficiency for almost everyone, since basically no one uses big-endian processors any more. HashIndex does not use a hashing function, because all keys (save manifest) are outputs of a cryptographic hash or MAC and thus already have excellent distribution. Thus, HashIndex simply uses the first 32 bits of the key as its "hash". The format is easy to read and write, because the buckets array has the same layout in memory and on disk. Only the header formats differ. The on-disk header is ``struct HashHeader``: - First, the HashIndex magic, the eight byte ASCII string "BORG_IDX". - Second, the signed 32-bit number of entries (i.e. buckets which are not deleted and not empty). - Third, the signed 32-bit number of buckets, i.e. the length of the buckets array contained in the file, and the modulus for index calculation. - Fourth, the signed 8-bit length of keys. - Fifth, the signed 8-bit length of values. This has to be at least four bytes. All fields are packed. The HashIndex is *not* a general purpose data structure. The value size must be at least 4 bytes, and these first bytes are used for in-band signalling in the data structure itself. The constant MAX_VALUE (defined as 2**32-1025 = 4294966271) defines the valid range for these 4 bytes when interpreted as an uint32_t from 0 to MAX_VALUE (inclusive). The following reserved values beyond MAX_VALUE are currently in use (byte order is LE): - 0xffffffff marks empty buckets in the hash table - 0xfffffffe marks deleted buckets in the hash table HashIndex is implemented in C and wrapped with Cython in a class-based interface. The Cython wrapper checks every passed value against these reserved values and raises an AssertionError if they are used. .. _data-encryption: Encryption ---------- .. seealso:: The :ref:`borgcrypto` section for an in-depth review. AES_-256 is used in CTR mode (so no need for padding). A 64 bit initialization vector is used, a MAC is computed on the encrypted chunk and both are stored in the chunk. Encryption and MAC use two different keys. Each chunk consists of ``TYPE(1)`` + ``MAC(32)`` + ``NONCE(8)`` + ``CIPHERTEXT``: .. figure:: encryption.png :figwidth: 100% :width: 100% In AES-CTR mode you can think of the IV as the start value for the counter. The counter itself is incremented by one after each 16 byte block. The IV/counter is not required to be random but it must NEVER be reused. So to accomplish this Borg initializes the encryption counter to be higher than any previously used counter value before encrypting new data. To reduce payload size, only 8 bytes of the 16 bytes nonce is saved in the payload, the first 8 bytes are always zeros. This does not affect security but limits the maximum repository capacity to only 295 exabytes (2**64 * 16 bytes). Encryption keys (and other secrets) are kept either in a key file on the client ('keyfile' mode) or in the repository config on the server ('repokey' mode). In both cases, the secrets are generated from random and then encrypted by a key derived from your passphrase (this happens on the client before the key is stored into the keyfile or as repokey). The passphrase is passed through the ``BORG_PASSPHRASE`` environment variable or prompted for interactive usage. .. _key_files: Key files --------- .. seealso:: The :ref:`key_encryption` section for an in-depth review of the key encryption. When initialized with the ``init -e keyfile`` command, Borg needs an associated file in ``$HOME/.config/borg/keys`` to read and write the repository. The format is based on msgpack_, base64 encoding and PBKDF2_ SHA256 hashing, which is then encoded again in a msgpack_. The same data structure is also used in the "repokey" modes, which store it in the repository in the configuration file. The internal data structure is as follows: version currently always an integer, 1 repository_id the ``id`` field in the ``config`` ``INI`` file of the repository. enc_key the key used to encrypt data with AES (256 bits) enc_hmac_key the key used to HMAC the encrypted data (256 bits) id_key the key used to HMAC the plaintext chunk data to compute the chunk's id chunk_seed the seed for the buzhash chunking table (signed 32 bit integer) These fields are packed using msgpack_. The utf-8 encoded passphrase is processed with PBKDF2_ (SHA256_, 100000 iterations, random 256 bit salt) to derive a 256 bit key encryption key (KEK). A `HMAC-SHA256`_ checksum of the packed fields is generated with the KEK, then the KEK is also used to encrypt the same packed fields using AES-CTR. The result is stored in a another msgpack_ formatted as follows: version currently always an integer, 1 salt random 256 bits salt used to process the passphrase iterations number of iterations used to process the passphrase (currently 100000) algorithm the hashing algorithm used to process the passphrase and do the HMAC checksum (currently the string ``sha256``) hash HMAC-SHA256 of the *plaintext* of the packed fields. data The encrypted, packed fields. The resulting msgpack_ is then encoded using base64 and written to the key file, wrapped using the standard ``textwrap`` module with a header. The header is a single line with a MAGIC string, a space and a hexadecimal representation of the repository id. .. _data-compression: Compression ----------- Borg supports the following compression methods, each identified by two bytes: - none (no compression, pass through data 1:1), identified by ``\x00\x00`` - lz4 (low compression, but super fast), identified by ``\x01\x00`` - zstd (level 1-22 offering a wide range: level 1 is lower compression and high speed, level 22 is higher compression and lower speed) - since borg 1.1.4, identified by ``\x03\x00`` - zlib (level 0-9, level 0 is no compression [but still adding zlib overhead], level 1 is low, level 9 is high compression), identified by a zlib header (``\x.8\x..``) - lzma (level 0-9, level 0 is low, level 9 is high compression), identified by ``\x02\x00``. Speed: none > lz4 > zlib > lzma, lz4 > zstd Compression: lzma > zlib > lz4 > none, zstd > lz4 Be careful, higher compression levels might use a lot of resources (CPU/memory). The overall speed of course also depends on the speed of your target storage. If that is slow, using a higher compression level might yield better overall performance. You need to experiment a bit. Maybe just watch your CPU load, if that is relatively low, increase compression until 1 core is 70-100% loaded. Even if your target storage is rather fast, you might see interesting effects: while doing no compression at all (none) is a operation that takes no time, it likely will need to store more data to the storage compared to using lz4. The time needed to transfer and store the additional data might be much more than if you had used lz4 (which is super fast, but still might compress your data about 2:1). This is assuming your data is compressible (if you backup already compressed data, trying to compress them at backup time is usually pointless). Compression is applied after deduplication, thus using different compression methods in one repo does not influence deduplication. See ``borg create --help`` about how to specify the compression level and its default. Lock files ---------- Borg uses locks to get (exclusive or shared) access to the cache and the repository. The locking system is based on renaming a temporary directory to `lock.exclusive` (for exclusive locks). Inside this directory, there is a file indicating hostname, process id and thread id of the lock holder. There is also a json file `lock.roster` that keeps a directory of all shared and exclusive lockers. If the process is able to rename a temporary directory (with the host/process/thread identifier prepared inside it) in the resource directory to `lock.exclusive`, it has the lock for it. If renaming fails (because this directory already exists and its host/process/thread identifier denotes a thread on the host which is still alive), lock acquisition fails. The cache lock is usually in `~/.cache/borg/REPOID/lock.*`. The repository lock is in `repository/lock.*`. In case you run into troubles with the locks, you can use the ``borg break-lock`` command after you first have made sure that no Borg process is running on any machine that accesses this resource. Be very careful, the cache or repository might get damaged if multiple processes use it at the same time. Checksumming data structures ---------------------------- As detailed in the previous sections, Borg generates and stores various files containing important meta data, such as the repository index, repository hints, chunks caches and files cache. Data corruption in these files can damage the archive data in a repository, e.g. due to wrong reference counts in the chunks cache. Only some parts of Borg were designed to handle corrupted data structures, so a corrupted files cache may cause crashes or write incorrect archives. Therefore, Borg calculates checksums when writing these files and tests checksums when reading them. Checksums are generally 64-bit XXH64 hashes. The canonical xxHash representation is used, i.e. big-endian. Checksums are stored as hexadecimal ASCII strings. For compatibility, checksums are not required and absent checksums do not trigger errors. The mechanisms have been designed to avoid false-positives when various Borg versions are used alternately on the same repositories. Checksums are a data safety mechanism. They are not a security mechanism. .. rubric:: Choice of algorithm XXH64 has been chosen for its high speed on all platforms, which avoids performance degradation in CPU-limited parts (e.g. cache synchronization). Unlike CRC32, it neither requires hardware support (crc32c or CLMUL) nor vectorized code nor large, cache-unfriendly lookup tables to achieve good performance. This simplifies deployment of it considerably (cf. src/borg/algorithms/crc32...). Further, XXH64 is a non-linear hash function and thus has a "more or less" good chance to detect larger burst errors, unlike linear CRCs where the probability of detection decreases with error size. The 64-bit checksum length is considered sufficient for the file sizes typically checksummed (individual files up to a few GB, usually less). xxHash was expressly designed for data blocks of these sizes. Lower layer — file_integrity ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ To accommodate the different transaction models used for the cache and repository, there is a lower layer (borg.crypto.file_integrity.IntegrityCheckedFile) wrapping a file-like object, performing streaming calculation and comparison of checksums. Checksum errors are signalled by raising an exception (borg.crypto.file_integrity.FileIntegrityError) at the earliest possible moment. .. rubric:: Calculating checksums Before feeding the checksum algorithm any data, the file name (i.e. without any path) is mixed into the checksum, since the name encodes the context of the data for Borg. The various indices used by Borg have separate header and main data parts. IntegrityCheckedFile allows borg to checksum them independently, which avoids even reading the data when the header is corrupted. When a part is signalled, the length of the part name is mixed into the checksum state first (encoded as an ASCII string via `%10d` printf format), then the name of the part is mixed in as an UTF-8 string. Lastly, the current position (length) in the file is mixed in as well. The checksum state is not reset at part boundaries. A final checksum is always calculated in the same way as the parts described above, after seeking to the end of the file. The final checksum cannot prevent code from processing corrupted data during reading, however, it prevents use of the corrupted data. .. rubric:: Serializing checksums All checksums are compiled into a simple JSON structure called *integrity data*: .. code-block:: json { "algorithm": "XXH64", "digests": { "HashHeader": "eab6802590ba39e3", "final": "e2a7f132fc2e8b24" } } The *algorithm* key notes the used algorithm. When reading, integrity data containing an unknown algorithm is not inspected further. The *digests* key contains a mapping of part names to their digests. Integrity data is generally stored by the upper layers, introduced below. An exception is the DetachedIntegrityCheckedFile, which automatically writes and reads it from a ".integrity" file next to the data file. It is used for archive chunks indexes in chunks.archive.d. Upper layer ~~~~~~~~~~~ Storage of integrity data depends on the component using it, since they have different transaction mechanisms, and integrity data needs to be transacted with the data it is supposed to protect. .. rubric:: Main cache files: chunks and files cache The integrity data of the ``chunks`` and ``files`` caches is stored in the cache ``config``, since all three are transacted together. The ``[integrity]`` section is used: .. code-block:: ini [cache] version = 1 repository = 3c4...e59 manifest = 10e...21c timestamp = 2017-06-01T21:31:39.699514 key_type = 2 previous_location = /path/to/repo [integrity] manifest = 10e...21c chunks = {"algorithm": "XXH64", "digests": {"HashHeader": "eab...39e3", "final": "e2a...b24"}} The manifest ID is duplicated in the integrity section due to the way all Borg versions handle the config file. Instead of creating a "new" config file from an internal representation containing only the data understood by Borg, the config file is read in entirety (using the Python ConfigParser) and modified. This preserves all sections and values not understood by the Borg version modifying it. Thus, if an older versions uses a cache with integrity data, it would preserve the integrity section and its contents. If a integrity-aware Borg version would read this cache, it would incorrectly report checksum errors, since the older version did not update the checksums. However, by duplicating the manifest ID in the integrity section, it is easy to tell whether the checksums concern the current state of the cache. Integrity errors are fatal in these files, terminating the program, and are not automatically corrected at this time. .. rubric:: chunks.archive.d Indices in chunks.archive.d are not transacted and use DetachedIntegrityCheckedFile, which writes the integrity data to a separate ".integrity" file. Integrity errors result in deleting the affected index and rebuilding it. This logs a warning and increases the exit code to WARNING (1). .. _integrity_repo: .. rubric:: Repository index and hints The repository associates index and hints files with a transaction by including the transaction ID in the file names. Integrity data is stored in a third file ("integrity."). Like the hints file, it is msgpacked: .. code-block:: python { b'version': 2, b'hints': b'{"algorithm": "XXH64", "digests": {"final": "411208db2aa13f1a"}}', b'index': b'{"algorithm": "XXH64", "digests": {"HashHeader": "846b7315f91b8e48", "final": "cb3e26cadc173e40"}}' } The *version* key started at 2, the same version used for the hints. Since Borg has many versioned file formats, this keeps the number of different versions in use a bit lower. The other keys map an auxiliary file, like *index* or *hints* to their integrity data. Note that the JSON is stored as-is, and not as part of the msgpack structure. Integrity errors result in deleting the affected file(s) (index/hints) and rebuilding the index, which is the same action taken when corruption is noticed in other ways (e.g. HashIndex can detect most corrupted headers, but not data corruption). A warning is logged as well. The exit code is not influenced, since remote repositories cannot perform that action. Raising the exit code would be possible for local repositories, but is not implemented. Unlike the cache design this mechanism can have false positives whenever an older version *rewrites* the auxiliary files for a transaction created by a newer version, since that might result in a different index (due to hash-table resizing) or hints file (hash ordering, or the older version 1 format), while not invalidating the integrity file. For example, using 1.1 on a repository, noticing corruption or similar issues and then running ``borg-1.0 check --repair``, which rewrites the index and hints, results in this situation. Borg 1.1 would erroneously report checksum errors in the hints and/or index files and trigger an automatic rebuild of these files. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/internals/encryption.png0000644000076500000240000020452714641074756020067 0ustar00twstaffPNG  IHDR1fD}gAMA a cHRMz&u0`:pQ< pHYsu0u03rtIME& bKGD̿JIDATxw`MWv" ;Č$v콉֬7:uV[j2ZtJCiT;r眓b*5AkkկUʒJZ$&$&p?Ѽ SNKjj2*8-s ]XyyOIYm[q" ܏c*Sܱş?p4 ܟ <#Xz +m$&$&p?461ɎW~'ay%1 1[şJ*VU4:Za7FEULUlj0Ũ0kڝ$s,gD螫 uLjTYx5ohk,EU Ԋ79YfeXRIKyJ:Fb@bӒ4VT_t-˕l TfIRٿ~Tat0)&L;l(ǒez>$LR2 !(\_6='tz9KԧZ-4 i9s'EF^F[jjZv^˒/dN6=c!$&L*9.䄯L&7b?|zyX޶߉Y,,p/LҌ| ɭS7^USߤ2'Շtj'M[ߖ6:ٍ%1b_jh2u,%yΐ/z97LF3-o훾㚯Ŵ%1b{TG=U859xcKRtǕ摜F@@b;˜{/0Y^1O+דJP.MR%f^S#= 2NɄ_1IE!:͒yQ5xWcDUTlj8͖(뮚kab+;NwETsQ瓘ZX菲 b5%s}+ωTYF.6^ҥiQqFqtuTeq&[j+ӣAs-yY'/{31%dVjJui}5zW{S3g٪-p4/9~ծA˴M`x0牚/=xx'j4ۻ$g~7Ew-)G޼tsy::̩Ƿs,aUU$&$%rZ۷{^OkLf,'}$b]ا6tIg#ߛZ/6b}^nn2W+yin0ճꘪ{bęiq#̿Ŏz>˸|6ꕈ2|A?;zZ[-6Su~2%(x M|bQ\e,4o+hn~sTWj~p ;~geymvi&TR*zOFI&/Nꬮ%C/rِ֣R^vsĔXO62=DdEo?HL/XQuͳ!r&T}dG`6=bo: ռJILH*D]M/n&fUK}7E֒eAֲ}01#OLԉ̥>ZNR'澺>ڇ9VƦM~-ncQ]˸|btQn$n{fEm4O~*|,](1-wK6fݱdz`bsVã+\o-V}]!5K~HLTP\t拲(q_$I,߯jXv<󧺗 {;3%2D| IeN՛|Jmr1'αo<_%f*rAOɔČ W˯L& lP:ÆK/eYn otC=ULگH.83-i:i0e֗u՘cdVyH*F=Lw-|Q˾*<r߉2E&}؆z1^iKiHX;zF P~q7dR}3r[v!nrev7_3E˳xdɼ^^UY} }IZ-0w1OP]aDhI51Ya ܻ.&b} 6՟ڠr9ΉeI%ewT^iZk-n̩.%M_;*ǐB?yn5fz#Լ$ע :;r~_jSjB|$i?GؼeȢS \N-;IzN72OIZT'Զ?TyjlPOώ){nSbojL{rmDKT ,[:phЄ9&ZՒja}#?s^a[|8k̥_"BmZ/F6O:@a^}=^z@a=ö"n/[7lN7;$IUW ;wiptY&,ic"NU~xE))^zʻd5SGӺk]5WGڔe˵NU@TU5A!zB5X=P՚[mi%ks|ֶTKTM}GDa^ s摾u±z(GG8*sʽ(aX2WꞭ;.nUbJg3zJLᒑT˩u/ dN>7);l"1 1.=۟wtҚ>)_WeL;@Ռ=<"".n}t;$&HL  1@bHL 1@b$&HL $&@b 1@bHL 1x14ʹ_P&~s19L Yrs&}/ӫnnL75isRtviN{v`Ʃw:<(X&MwkUOe~ sҨgݺѫGjKֹیǾ;04@{uIG cVvz4=)@̫V| n|.ltf1l} 4pZ v!=UŞblvߩүEjw OcTq \؁!꘣#J{Sz=][ F Z+m>.dS T:bv`H*n$aifU;@ODZNH2c"ܶ  $&$&HL@bIb $&HL 1IL 1 $&HL@b 1Ab $& $&HL 1 1AbIb@bIb2HL 1AbIb $&HL$& 1Ab HL 1IL 1Ab $1IL 1 $&HLHL 1AbIb $&HL$& 1Ab HL 1IL 1Ab $& $& 1Ab@b L 1AbIb 1IL 1Ab  $&<:}:~2M2{e|rkHK5\ del=\^bQð[zh8YdjTV.!~fwx3T#9C9%SX5F:uf/)wܝvx-k]:/<[ʹ߭2 ]{LUW=|_Q=kxhb;}XlXᑯYAPu 4BN*խɜO-Xn{ygILHY1咔V^n0ٳ$wχZ*YToD  =*~?&+a^ﺬƾ9\:S5v8,&1JzK="ϑHYէuu5ZB`M.Sۘ{+}$IڦUikVi~NZ*ʦZᚤJI5J+4WC@OjRj!ӇzB M-=ƩKoifID-$E~ZWA[Zj& -㚭)0 lGts=w$l@LQª*1I"SFb5)Zv߾m\{&fKe" 37TvyXg|Gb֕1>.a`?)Q,-&zqjAb"M&Xod1uAS{jZ#iφlUzы)ٖ[=`n*2HZm*϶y^{ޖ$]]|-6IyϮxg:/Yr/D ,'7镜ێ #w%UQI;ߨ8KN ;Vܜk:J:eu׋nU 4zA7bwLγ>h5ޱNb4ۼw\&e:xos8g$&OLN-u5YoerČr,Q}Z,9u޸31OJj>$yZ$syXKmp6_14l_egzTZO^T#9{.e{[cK\T婬G"n,2!ܚ9-;Ug{EX 7+I_CO}6嶼;l=MiI0<W4|nOXN8ӭQ7e#7~6IJZ>8]aEȔ$i/ʈsy,Zp|A' Լ +C>ljj3&'Ijz%k9l5ܭB _jmexZ7x,5tmڢYe{_e6z9~311 0YZ_ZoMk^gsȷd~+1eE,ȶ&ͫ>euz秌7NOe~e}%U<0HI[&CJ۫!?V%MԆp,ѱE%,/~.SM5yݼƊ6K\V\DHI+ߧ /eڲUx|F=>dY~{2\?3\rsVt%kxK$&ĔEd&+{=K~|͌+tQVؾ|gb~*s.yZ$9K-juT\}o.Kb"]%o{2kNXv$%hLyT_c&a*ms2":ǧJLgÙsfjf+Wc{#1eYϷh.mzQ{Wl֘bn}=uYg}*HsOU= M+R"YV@eR'uATK tPW5g`]7  Fk#E\k٢NI?.6^4I:H̶ـ=7vE-:*CLg7'^imLv˲ؓnt̛HLļ(Rm:c5x\?OV9g󲶓fboK*Zle>[sb$-4 *1~tL;E]5zf8٪1u [^^7d~ct{t$:,yD;zRz$*,zޥRnZ/2'|,uitdyY}}"Rn8<,SH _7k8aAF:#TGbzXHH>)dXӯ{2|r]PLen],2o7&ʜ&h:jc&FӣRA?˂T&zFtou:3>]Ḣ.1_ !2\q+|K~jWw-ە^ *B4.O닟y掛;nr1Ӳ߸A$E* Y*=Ob"%WJUj7q |0nɚ;Tbc492,F1~3uY/v$t In z\&s6T\ՂW+UdEW[N*2XmWrsw1%LTϲ#SgMoG/u$fݳyḢ 1kU (yy6&sճ_߾{'d6)#}N1޾[`tGbZu^V /L?e1uWdNzRUw;:}W\)i21jbdr}ߟ,_H2!Y<%Y+=[+Yj[,UPO :T9S |vgIqݺ1cHPf^Vgtr=2B~vN4%۴[e.jI|}bˡ^W==yzjϚMb@zH$V5͓4?n&+U~nOLI23ʛyZuR?$AI͇xzۼR_F[kJ*ƵsCa$|Mևڭi-s^UߌQHLܠeֹKijhg;t0WC2_k?\ȴXW4A+ZD^;7jbz,tFWIY5mZ;R{&+*2m4D5X4Ge2fDeA>ن.dN4W2׸uNy[9_52%B.N1Z"1 'j^{\c,ƨ'%JȚyM3 bn?#;,=pLmyľ9>G[iɂ55_=="_K^c-!1&sJ.dyz–"|'<_酜Uc+4o/Hz%nnW]s_&,?+\Kk2YI޼]s*ZͧRoVmTps -wb+f,uNXR!ZSg")Q7㿒#1IL{Qd٭׭y_,g]ڬ2IgakGۗT;~nd/,*Rs`& C5잉y^aX_emڣC^^-Qj???]crb rͪ>ˣfaENMin`.jl<7V,kٝ&+t;F/ݿ)OyVOb@ZIP4r7YjB&&l/u(Q\x/_jR~s穥.Uk2J\vq(iK%.wZoNnhKuR|g?_"͆ɛSkILSZꠥ%)0bPdeZ@ǵx9%\ :t>4Ϸ2'|7*H9&e-k9UPc/ulQzQ`%t>O=s(:$UV+ұ}s)ש=c6)ۅ \MC[DMҭu:"/<|ܩ3gt׽sQ?ex>ۅӱF3]iIzB#*7by.T;hLYQ&RS5G0 tN3n\\ 7߈(>/~G(f^jh~k2 W|WcX(Ӈas ~?G.|ydm:ߙ[Ǒ\?7ﭳ434U-d>D9'29ļ|UQ"c#{Dm- <{(w4YzmStcsilMtr>gKn.ԉy 7LKDUy->g"G}xǛɪ!sQ+2.26Ԯxn5P3Տ9'DUliL5@و*QuV4׹kʡʭ9DFFYМ&Z,/4 Lb 1iږ>^Lojʽ-vifk贖k&:}<niѫj򪮩o=:i!1Hc:6ʩfVjp4E^M;4GoW@N 4/n2}/iʫzj~J|:}ъUy5]Nu6}ɊWy%h>@iڬv*jX5ڧZOb 1P"1Oo9IL$&HLY$&HqV%Yå @b[r6Y"zL*$& 1AbЋ2i@bpTGu@c@b .1G0  $&$&HL@bIb $&HL 1IL 1 $&HL@b 1Ab $& $&HL 1 1AbIb@bIbHL 1AbIb $&HL$& 1Ab HL 1IL 1Ab $1IL 1 $&HLHL 1AbIb $&HL$& 1Ab HL 1IL 1Ab $& $& 1Ab@b Oc֤ILJ̽K{FԦt^3$-eϖj^febzYkeVW6"v`H2%VIGEmVcxMb/;@̳߶GEo]Nkv/ 7Wy&,Z!]k.K+b~}/s^]bRo伽d\RO} I筛.26pd[щ%f :# UU|:Rm.-VtRg؁!W\:Cwt.DֻF5rb4*"G3 1 HLHL@bHL$&$&@b@b 1$&@b 1 1 1 HLHL@bHL$&$1 1 HL HLHL$&@b@b$&$&@b 1$& 1 HL HLHL6fkh &OʴCDQm$&$&;IshZҪE{2=kRŔ^ ?$pbף.Ewyv3-P_#,v5Z+/{ڝ+0wK?\4dUέFoq,VUF/jq6uki-;LCyq*1wjNt xоvdjYJbi}m:$Q;ܨU*YM Z溁I?!ʤ ~:l6Ed.]tH[D]5PͤBuZ.9ZyY~m\&x gRĜ3aTzg[LPݮ͞ 6ke.{1- /$em}& q#8) ظVwz LZ6ZR1Fm3c>:6_Ia# T@p`D۪UѪu֪UuOܫ N\u[g: 8~ AOsirsN;Ɉ&nli5F%DH!'+zJl%"K<10S"̫nc\fukk\:7(jJ!۟<&0_<&0 eTcԿ}G-6[$n\^a!S\O:%:ݺvWcr w19Y`:u[e]] %(ħ=[\],Y؎<&0@>940ɇx+d8<&0>9L¦lyLaQfsDϛyLaQfsDyLa}TBscRN1.vpkqlCZlX5 7JQq_. +p -ޏ[—nRUG묉\ݔ#ckaѫ¹-:V5b &)hW7ψiPv{_ ߗl8\u}LEtנ^VR8>Uo>/3p6/doZw %QlT_45_ (oPT=<8:jxxp+c8gZ>imV^󽿦ΐB :T\y&2u_y(ȷSH?* wK7Qa` GV88>ҘZČI4{)ϣu;#F|GM<Wa ma{'-wK7QI9+%㹊 rbN ;)w9#! KHvhr 0Gin{bLL"&&ICUƃd@YOkyF&&11db҇(=1=ͱ$"&&11LLP8zd&LL"bbĤU]\Yt8fKV2db21C5Ƭ)5 ʷj3IDLLbb21S[6#1ƾarA=3$"&&11LLʷbL,ByFC<+-osDL/31ILL&&>%uybz @2!djK,&01ILL&&>EFZad˫bbLL&&}`|t ?LL"&濦/B<?_`Q"g9&&Y%~a_q#?n'\0{m ~DL,Bc>N!sK[ l?i?!0_4FZno> AY$[L 4]ZmjQ}1+΍Bldm>E'Hc3 &׸٪lE$} Qh mU)EODeIկY6ֹ=JTؿ$ DvuA1z @ 8ӬUYCX5eJL\rvV !h.R>ml/u$,6/Y LEGvR8^i=]]шFLYZH01UcaZOD?=L*6\H5>$1;bbF`/EPn[9vB 39Z)X*=}kW$S;Y&fm̝n!IKL U mn9u7R ?$bbAGz(yߔrwPc\HOLG#fi)oF헿^? o*KqZfjR2m>(1g&^J)y@X\<呎@&;#TF zRoCr41aBU)nP%D#iN)N)eR'h/h &?"lj4ర|mDPm@.+3t@ sXVp;<"n1T)zC܎#6Bsu!ofbQLL'8QR|vD.8Q}BS=hݽ^˧/#;qW~@|@q\3.qlX۱/1Z`<%(e9rT;8=(_VnjI;s&CfbS@"6brx 5{u0+XD)nnY#Oo&uZwϮf^^^^^^^]?FeoCR!Wj3ltbv}!`p]8g{={u^㒡ٲB/ 강MZ "0twjID11nc1,kmT D Y♶7ތ:X~J?%X 1ɚ#XX/-HBQe +^x8N)rFm,yg{ >uA)Gz{lG-4w4.[bnLƧY /8*<6KPU c 'DB ؆Xe)o'fG"Psbڿ?耪LB[ Qt"Lgޫ5-R kxD`zkՆcb!p00 w`#N?}g?1c Qo@wnc[{vؑ!F]3 X1 '|Xh).6c 6 SEء騃j1'q,BjpCwC]X Y) z43`/:Xe?%"3 [1 pKi9 ai*pAT z01_sM$hCtA\gh1=.&RGnfq-B([. >!`xC4fcCi騹 Q.2x|wcX~X>[NmMVodƳEPWłc?>*A(GH;?eU(7tNdIOm\̈印2;ukid.3VfQ,^V;XS`S~?c1ͮFC*@$eO$bb6FaHdi}SbDKrWۛϯݥBWXN6KD0Z!ڨ]=hJ1s6իR?t<s6kj)D%-l5T_F_9&% @v%ϛ(KQ͘Qp&AoUŏ{NEgY8]ZNbvD;^)喇jPb]IZb'XD8Te9i`{2XRo_狦[wA_&n.6ҏpoYeNl/cNI]٤^glȖn'qIFLeV=:58!80ߴl3/lr1N_&7 oZ\J_&bU\2ER+n+RϺm\D!~v;4kPc6R=C߳V =b4Y>MmWq竍ۜ͑Oȼ9a~ƒ2ݶYn8=A6~=䐘 [|M=:{ sECIƋNhϋfbQaHLAoQD )y̖;sLfǁ,¬D)UVDZPƬbk**шZ JW9"Cmb }YxIQf~]GT/-61ƧCͪ97f}%M!bG ݯ=:1!:E#oP:VRDob&x'1atٮuA>81c"z)REϺQ&f,vqRTBuҤO& !C~SJtE# om@iR_I1|#*)uoQho71{w%ǐbҩM\& .jRBtE?5}mI%3;D ۚQFH#רo}38 HRߨ\XSW4cjD#mf<t('޳V'CJĴ!kK~)"/:lh?HtźO١l#e$c? ]lwGyO("No%4B=C 귻9y9VbR3WG[VpID?1AtrYhZBX1U#M 0HUi=7^{؀ ˁS!8zzmܛ$~qhBlq]˲W_[yu:foH4W"J_'X]vjxcXI.sr>[&氽oNs@b{!vRJƧkG3H1$|,+Yc@0ەb&GOLP>U=ёKD/+s4=W{3tʢ,CѕdI3 EWNOk܇XIш?_n RLo%43tC#B[Y(=8mv/`DTs &cu Wz+E-HY)#6p⡨=Hif!1G fb,Ƿ=&&Rjp1D)h$d($[bNHi Sa6}m xF O61Ǵh#l0JT HGbf,N`Y:-l -P Unm!JJQ:&fN鋩)O6ލ v#ѼAHIRB_\ .6k,O7g1 DpJfa0ñ#5i n5^l A2Oʖ[@IL@T;tDGL&GOaXyBLUm2LUl>Fb6beHi s->_A<@.د+0j@On1LC1lL QI+31?؍EAt5~(?9]J &Cԡ4]b&31z݁M8%_ˍ5EF'1$d_bEGEZCJ+_&FS@ 2gW``۷xgݟ}kR`O5;ILD{NQMcb~Č{@6X%L#Y’y+բNE/H11&y[bVK'MQf Ejш0d~";f2Aᙉ@"8Z/b+:C[ o'&s3S!ŤGxV” 绛e&f+yn@\d{Fbz,FWXQbe3|%,k2)h(Gi&%C 44 JѕfW_TZ eR:xt51z3ZCS? 1O@tRl#cϸZ3NsD>WZ~Ra:@<JlΘ WL|wD-QD ՟B>= ^@fb=dɺѫ D!anÿ4H! GT|T\ %Wi}>41N~c;&.;!Һ],EJA,6L^8-!6BN[3.S.@d\fbf.>.EB,Ϻ:e&fݳ;L Ez'1d]q)V\r9$V ϯ{# %:&U!F+C%X,fbQLDs@WsuO? owa=DQ{@<4O-MC)ESbv]x:x;|@b^(~/GNXxobu|pbS! ^A= )8cK!;ybS%2GkR 5%1-{eԗB:~u# )%],09x@ʜi.g?X3> WtoSQkHyiK}|ܖiY88[!31bĴˆ&B;&M̵Hb4Kb6!1+@S')3e5h!=\n)DT1vb3Nt:`$+|["ZS#K9yJe7 *E_Ư[bZ#17T 6k*i~4%&yOXTث"'01sNh0GMn$+"1;4z#'+5zuCz9JL,09c@*<] 7sN* @eZ *>yJ.bALLWP%|9UN>8R|~5lF9@? }~g&&3s^ ~B 6W|du~n"?O'BTQKD-WqM(A)_'뗠B $sf9 P/$f%'o r+ݍ迕D4Hb? |.W  yy+13_b+ D)͏=F.3t?"^X|71ۡKe? 2p[&! l}RLڷ%QTE# 1__:W*ꬷ&f;tw1S[9URf8U!-c/pbvNs=idf'"[u'?\Xj~}Gebѿ^ Q`!WV?h=@ {'" 5 Ynb<,"lH?cO? 6i}zEbreMn'+DRG[Mʋ!A|-1]D-]"7;h%fX,duRRB{힗ļ%N*DWg-%&[a vC8Sy4PgMJG42phb 3\W?& 7pUBsd:! PvR8RƹP!F)F,.Q]duޘ0@2kbvD7xQHacMu*4XaM A4D!yH SDTc 'a1ILY8-pn9Q/oyŖY_z2x7&&84~ )zͷAtWpq$v2M@"b}}`a_#}k~KbB~_nh>B 7:ŽnPRL^~ޙkMO2qIL3b\UB*RVQ j%{vQy0|q1 `' mocb?&cz_wLW̥xlNL'=3*8߄Ȧ-)Uqymo0?*p,3o%f {@,$(Zt1q Uspjz-0Hȵ+v]z;Ub(AJѓG80 :#6^\ EuNFEb&/6!1բ/3Cbbb"/!u.4>b}mϫ4u1fiSGR_'y_+a謭twnG&&Q4~77;WȎ!=,E aS,|Zhi8WZP Ԣ:皘*{wn(jmz' 'dO>U/7Ncjyd"}RG EZKtEWtE=Ш[F * ս>zrT9kj5H~'@Qѽ;[Ą~  M|&Obv{!%@j&m7^/'4`R_ ?L+5ݨ6JHuzfӾ8:1ڰ=8 :=XJe%_A*%/Fbb*포uꅖ|z)kbzmr,[pT:)go\SuҟvW9Ji!1:R,epQ0׿5]Ĵ،:1[Xǽ1ZG,,ipPiL&&@k߃oe$}|3ӝE\1op͋1s g->c+c :Ѭg(ߋz)u_C11DW,^)բ*U#rW:!1hD VU]#,l > B 8yST<$>=]WV~+6/ D+٘EU|oCtkaWW 6k8-l/ۼ]k&fݸߤґKEgc9H#,X Ҳ;1c*>oRĐv#Bk+o(0 =/)b,e/5W펹@/}c bw{]Z) R\+᳘:'sQ EbjPsF v/6D|bZy@ GGU]T 6fߘLՒMO0rPL;q|eC4Fbce3?qb &^g!*˛cLL"*HgKCAyG0DsQJ X E-y4$؏u(@E#}Vvemaj1Mi4(H4QJ^a y|ZxI؁M5WDO EOZľ$&nQRQT5a`$!/>--A<_ҤoJ艑hDO\n=J>`cYJc=&uB¶2/: )"ĴMK΍WoYR]BL~O'>^f/;NŒPd׈7|{5>`R!b(J,7"Sḱeb!3#(1ͳяfK!mC0 RB X D% A~(s@z}}\LZq7g+snTl*DWD'ydgP銯/b~,Y_brYV=謹(2M&w$sYMb^qjR䢫Y an%Ω#QZnOzLOLǠd帘@L\,lܙf=` i]HYkUC+"3~ZccbQAJS74Է6-Ҡrc}FjTTԒiWT~Bbֺ}r-r׵alBj~4}I+:>}pLH _^4-"mYj4_ )^cu0rꇪZZVzV5ähgԁ_\2-3_fw9z%&\@ti=hbZ,SslvŌ)J'pצV|:;jzhDЦdzϻOK]?5?~;1{{\מVXh0yHqsXy혖LwfA4*˫izs}qzqwPOq.׋IptWc[F6) =VWiTbӪ>oN QAGx>uSTT˴rw7elT!)^^#sK-.xk}˶ke&fqwFˤI-V~Ae"Q?*Ӳ=RE =^8n{*?)jZ,R._lR]N:L93orU3=Ze mMsyt0'_^5@"~)5EuKYqWg z{?s}1,V QӋ&-i%#ݧ71Ƣ_vJ &U$QarLpr6P6Y#!qq,cg.\ ^wL&ϢZOVO@E|)[3 ޞ`N?:a»SXϦpHrN!)%`) qCrc~ g8G륭TETd\> W z|d2'#aϦ3qpLm|׷A}{mvmUQ5A701S_|_`TKb`<"oI%!H\Mu{s93#nO[ΛǫNrjj縉jot_Tҿg;'Q,F4nu$ry>JV?A4['kU{=9+ޚ6 0;bbQAJ$\̣F;X@x Ͱ6e> 5yqwp `&&qá7!v2&btӳS6k4͸ˁLO3XPx!ξu~ Vc|k+Xqg2OLFMbzD\ﺿ9.qb Ҳ} !G}|ؖ1gWkuO78әX$gyTAbE]؈H8"Ba~K,vZn`9$en؂w|XЇs,S&&I̋pGp+ӗ3gJ%1 V;ox}(gc0ѾarjUt!|IDLLbb܃q 1zdfb21FC$"&&11 WbC_ҩ?m Q! RV<o(R\uć{܄X5+&$"&&11 {b>-1),!&&11db?dEY.4LD$&&If84}5P H`11׉ILL&&>P_?7n fMIdbROU}qY(D{'G}LL"&&I)Ygg~_ѴOI$bb21IkqFN"=hoفIDLLbb21aV`mSDI^u0db210n?ŬruD5(@$*>pp|qjĜ{)3t9-yvb-vq_f{׹%mtOݟ. ][nϥDF3(}rMsp|Q~ϋ)p6MKy[~B} ^2hm+% z]f}Azm9q|&* à/S98>ިװ^GcO| | |*{=֣ N][nV}|p0_ QU}"|6_Tpڴ'էB5s^ܗنo(O-x$!֗YėnB ?5ħר9pryi[Hx } 3 d_DDDD$""""&&11DDDD$""""&&DDDD$""""bbDDDD$""""bbDDDDDLL""""bbIDDDDLL""""bb11IDDDDLL""""bb11IDDDDLL"""""&&11IDDDD$""""&&11DDDD$""""&&11DDDD$""""&&DDDD$""""bbDDDDdbDDDD$""""bb bvc_9 0 㹉(.^fI'Hw,V&""""/KDi8<9ة=D:Q37&""""ityT@Jmuwg#f4j1tkNi[l&""""ـ?jmPRbZ^RB42p\&""""&fKoSۣA+ DDDDD_D@q>L$"""yLa<&0o>9L""""۲cro19IDDDD7$"""$ S,=NDDDTPU 66R/r[* Z睗 %nZਓRE5.sN睗 k[8'jOG;/T=W9 X[;/=A;nBږcbDDD$&&IDDD$&&11IDDDdb11IDDDLLbb11DDDDLLbbDDDdb21LLn """bb$"""bb21$"""&&11LL""""&&11ILL""""&&ILL"""bb$"""bb21$"""&&11LL""""&&11ILL""""&&ILL"""bb$"""bb$"""&&11 A$Q؋Εr@ 64DyI9\L)J`o1EѠ6:m-p{15Dys>gl~}bcKĺnt({;/Qưoٯ]($@ Āebņn8++B{ls58A(*H !؅]SLnfLNŎwna"Mvs^}r=CwX꫱cPAߗ厖}lz61DT9iWMQ6EC=0o{@ ;Mr3+CQIƗ!Jx\w6U-~\;RkaFe/-hQ90$ju40}@BommľĈAuR:s݆IDDD\ #-e#a21esH3n@BhpR1fW^ L/zwt Fu h371TiFV%H=31C1zgb~JQJ#㫉j-~,pRUF]NMT!bީf%#Q9'1/.5HaLD6UI(%vbbk]ǝG[oWH1>Ĵ-vL+mKިX'ǔ D 9Xw.'%[{wP{hI]#g￯UѣoqgCLƨ`tQihJ.n%71%ADOH;&31连!S6]!uNN/D)'OKm  \{ϑ/-z,N λ@yW-j1MKݹᎎF(ڮr__ Au4sNAH#O5HFDDDNLj*N fB瞣?_C UmìaTD/1]xȻfhQ=nE8 nHU\4CK AJHεOLAeMHDDDNU 쵁A bvDWn<ĠoMLRDDD_OL+tU"S!U75@\NLZbK왺[n w|Z|:@ ELMͱ #qB$d9ݗ[A3(b*<=(>@** iv^=~V "a{}p+!ێp=l$"":1@B )![6`[^?/Qg v`A?igRlDw_c\z9 YzZrFYYE^yaB;K! }X(@zY:"Y_}yI]Fh1SO Uϯ*:h3g6̟Rd;v~ $""01GbյV phK '_bjs֫{Hkgoq\6Q@ 'آ fa[9RȻ#6Zao=iπZЪmWwkDhZL*Rq|@tVF;"UmTh%H] (Fh9SO '}A9KLv~0M1IDDDļgZJ^4AlQ %lMQFFIι%SQsb@TwTԫ`fkZm{Rؖ5V+ q84*$sְ5 ?E nݡ=71kܜQI`W-BV[m{d3;$ E|pb=x ~o=~tE!"11KT^*)*M%2i3kN跞I3?@bqsTv@: \B 5D-QFoT/Y ("u}pbV!DbV=^eOhgbgP#ay^\ J _/PRN T=A~xd9crs1~i2X*mdwQ ڼN%@l$]41z@{h5: EYtAĕ Jܗc1œy 9i(T$y;\NEqIDDD\ =+,,WㅎhA&_JL S3)'`2l/:-gA*.9m?|+I(5A<ύ3xyN oCrQ\QH1ź^t !o}I:1LrZ#%&4N(wZFb&# ÊA,v]31J̭H.}RRZڮM[*DOjFa#H1:m9$@[mM|'*1_qG-÷tD-!.}_@,6n[}v޻-\z. #R4!-uJ\Uz {;?qXpMK bGu꺥U=]8o$&0 JW9ѓEqIDDDĴF\ V7fZymXO ^'ŠʞOO4$@ y1|bRD!hZ b{8벃Z$=TR$Sc`3(D-ϴE!J)8zB x6p 2<I[;v070`gӧC b{c1WgǙ*QKneBeLVT !W3gm qF]DDD_LL`^/U6`ncRikP{I~kB<|O]ke)t?b%ǘ [J3~c< j cEVMö{ܩ$gYgY໺vA :ϲKAz"^ AiᶽϲzM^yݜ~R/8-TDo?߫Uқ,`aeh~_WyLߊIDDD\_p`yM;ohV;*QSo=ưGM؄>X@ Ց^:FR a Qu_cpћʋ.WZ<"u6瞧`@/T8͊1&?9yO:g ެ-{.\"ÿX31这wqgq'rumU154sr ~b7&b$ !'KNn4[nXq kX)N1vLA2.Ho3Kq 1q?Bg9gKHU!٢ }pGpqIDDDĤ$"""&&11LL""""&&11ILL""""&&ILL"""bb$"""bb$"""&&IDDDdb21ILL"""bb$"""bb$"""bb21$"""&&11LL""""&&11ILL"""bbr"DDDDLL&&DDD$&&IDDD$&&11IDDDdb11IDDDLLbb11DDDDLLbbDDD$&&IDDDT8sf<~v#03_Ѭ N} >ɐ^%""*qf~~#,30.3833gAOevϩ|QdtczXO5ok%ֹ`yO_"""**,F!?;<:vgx1 qO_"""ww@DDDDLL""""bbIDDDDLL""""bb11IDDDDLL"""""&&11IDDDDLL"""""&&11IDDDD$""""&&11DDDD$""""&&DDDD$""""&&DDDD$""""bbDDDDDLL""""bbIDDDDLL""""bbIDDDDLL""""bb11IDDDDLL"""""&&11I)݃` w!=B:gV |ܷzwd{]}d4%.bz)'ubh:9dXg\I"~4RY pe͚mVoabF8VZֽ[8\X.`w3~^q $fbvߵGj08 {ծ?Ls>tĄhVR⨧exsϟJpkabmqj!hI`bPyBMo:L4DY*gnn8WD#rQ}`4|ĤϞ`;ֹXVbDbh<0WNBCSf*_ȌlV^k%=A*9ATxEcjSF3yV靃 ڹ000>9X=Xh׭D 5wZb)gݽp>->^\ø8ֻ(aQ:ý9!|eo6LWi%R3V=cg&BVUck;jr}4J'-۵~uiDT#hj_86c;>-@2vp>빆hԑFWv@V<1 Ua c.H!Y븉H3>{xLAd6nb%F`%RqD=q`6_1 >W1 >W1 Ufa5:"U c!]3g2O<G !Z[niK(VCr&W@bfaF'w/77xVtų;灃wOO{Ç !n/sr$k38]w9W{7x]yZ5 t􀌪YV%4ݏ3UJ7OL|Hg#ߋ%"1sB=oϪ8ݷ~偏XS֌7tF O/a.7L|XSԺt3peF5vV5գ~Z8c?8!VF" ݚq|>c w]ιvHz#_>fzdb?. ~ )~8? jI\M '*3&zNT}R-:hS/g3) P󇔾.Wh:2,LL&&11T9c,+nEPeLLbb11ߙ28:P ~v(k31LLbb11s;o@zt$&&IW3=H؀vuw$bb11Y55wiEEk LLbb11EVZ_*^z^[&&11DLL{?d@:lvVԱE{01I$bbߓK:h7F|sX&&11DLL0eh_Z E]01I$bb&u~՜v5V$bb11Y$ݪ Eg&&11]b*1 (1b'f"s>yM`1$+t!LDA忒C0X 20 UzD'@ 6޵f01oYrף:߼:`N!Mbsyͷ]]v/I$X J`#rҾ(ٍfp XY*؆e8h.C{1o h5%V0yXP~-O S"Mg\K,CnĤ?K>S]s;sݔ7q%j令~|[wvj]&UTVkmߓKm09Oo;ރ`CK쑌O%ngKھZk8`[:=^Q2]hsKzt80`$njCWmsx:aRJ³fYq?UnEpC :h6y'6㷖bY0rHv$f7{#=oRp٢)wVyh91/Gf]M_VF/yrx8\dbһ/Zڎ]5vǘf.ö%RC,w h7yEeǬoYT5@kNZ9Ypˬ-(F]b/QDS4\[1E>41SrG^ügD?ci[\U=mǣ"G4^ٽ8+!`6Q`X] I21݉f&v7t=]yuBGsD3(E!b*'Z8u͹l|Sy|3#:b,Yގ BN_E-*QZ^ߒ })]Uv o4|&#X(E%JђROk\4ΪYb.%D`ALrts7m di@)ZbaĬ,o*hevqN@(bvhiyHKJgV - hݯӓI<5ep/n bmjjgCp0CK C>yV1w֕w(hOLߥ-E  _z>SI'S}rņg|2đƢ-"m%G#CORLju^UhVjM?rj1\*1Ec艎h舮Hi+KC珑!z'WXYےi־t<>LB帙ds1~nV410Jb!?eSFb] m);cfb&2|[έ,G.]K &Y~]e2J=t7DahJ-O{u׮3{׶.' HCLD]D)[F:f5Ɵ θRQI)q4cQb֬e)qECRwվ}TiIaݯ&a>_e@J Q6۠- :pAskfuiR&ށh_:C) EU,S!b(7O˖ٸFK̩^}ol2|Y^VXMX3D[*mnCgx]b5]bWظ Q]-& HPꕮlR@J'ɟ]5M~L4_9X]͐}聚n:r'8^JMJn5b|1 l\iݐT> ^H1̽7lڱ*>.[9!0*EO>[ab(>荾^O Gvfbo, SLhmRI^*_z{!FR;6[0| q|$kcؙuUYk(iT4V31 ^WQٟUw fLLzWbx Q}E-eFF\oP Rpr |S:>XVs;v;>Jp_bW9yt[t?ypx! ڝQX6Q O r9iE2kT)R,򃉎 NL.g 2RO ^緕ɿ;F5:RI]ߒ]ѭY)QKo@gȣQCz] [{Q'5|X(Dxh/JB +a0`/^}(ѵ-F 瑈@[1A d_IW!X0ǚ* )ܧn~^Vޭ-?` ѸBT@ Rp W0ï][kr )_| pɀTc\e,D T$c[@o?Y(l7)PjKu HWW+x `/ t#Z=FbZcHwF{!RG[NR,P{K;KMYFz7ZaQJ-=# sq 'qmJLY,A]p-M> BB1g=b #-p`M1 5xbj- $f~<@[b6ձ7qW9ؚX&{]MO} &֘>Y 9#KQqj;3{LDBi&ɸQԙ%?f؏ɓUO{LC3]@f*1m+Ճ(9Dzt_SEyMsuB Y˃iw$f48qhruhR)şorhK|g?̃CThw&&Cp ˩e +|C*8 ڂ1TRMjT,1}qqAm<[19@9SCkWj'1.=qj#\L h _-g3{zjb$:g{=',#`Luww om/,!Hk<m&xe=rx;6<Dwm9o=&_KO!XB>! Ih_~ɰ,`dU?A퀙!mQ!}jA@6)D?ɭ{[v@ql=sm'[5hq͏4A)fҵNΟ DO|cWy2tD)EsmZ?WK [b5ĹqO ҼUKGQ u ⮃i'Vp?i5.~]twJLLD; Sy}!O; *1}$m]{Ri*>qMXYn^<6U./z!.5]nr| FN^ˤKwr@T-;y{4(?Yyz[+=_ klB,.-)wpcE&ׁ^ }BJJx~651>ض*7aPj˦O+^۰l!M~4=wn~hǎ ~sjHL?7Zow{P&(|k6,89 ,jiii^Q>Ǧ)|y8'$P{J^XZ5b0]ޓZQC%jhIų\szw,%@tZ@ 9([15=!?G?(bS'i_&8i9h6[Yp: ?o`Xbmvo!?ouuل-3-@ fjm]o' +DKF% 5=jR D% q ߓiy6d-mY:gkv(D巚y)D%J)%a!a -QHmP&Ԣ]@*<&( */R;G(W(*JQ (E-n{P&^ẖEKEWy}+\"r~_OE {?ЈkzQnIq_n;RxVO @JKx.hJKaM}w,_kSh@JE.Uu-Z Rʎ^w:aLB_jKg*-z! )SܸLH qz6rBKٷ`!Cnm3} S޾pw^Fjz M]h&q✵XxEB])E;VXL@SIAcJ$);ߨDG.b\1H"E\x{=5,s-}aEfWRD'd ,$ܾα˥bUbw)W0ikXRK-@F\TibPKZ3b[3C#-_@JmW1ߧcJ@4"Qj֑p@M3~1 UXh@|.E~~ѱe?}]U~a quMݚ\kX) y R!qb5[>[@qLٖ\fzqbQ8= ܩqơWOq=c휮Bb/޺a8Elvt8X!Zu%c /O %6Uj;ymXJv!;1+881MsݵAH:lL@b.F"FQafe w%&63M#\"Lat{ q 0 p (GqDq а6콎J[8#Ÿ>9`15EzwEAN/Aۊ|uFyu DZN@S}{f.Fy B _=PVFΡ<ɭώ+k8m{25~x$ UcN ,wpcn %A쨘N*(HLvRl3A$16MDSv5<4[0{p|ViPpyTP݋yWt|TmE,1Ddh{KPAOʟt +*ѭ;Z6;.jyXQ.XF?gkӤ6&P da*6uyȱ8XIhq@e1xF{i_ ,4e[olPoٿ@v߶K$FR*WF!$g@ n>A} +S[g8µ6U_ hU*XΠ~`!ߔ̽ךXi|RhȮ*Zճ!_[;yy9=&1A5Ï\4?406?&YgkֺXۋ= mwޑElUEx,-_bfGƇoZdI P?^;iP-o$ ӫr,gSB*h0V@lᙝ˹sR[;˲}ڵV'Mo@TbYl:؍NL?TMb?أV/rXbGۿo)hY]aRYm18\3Ђ_^-|qJV#Rɠ]hfbv,3rZ" ķkudӽ9iHFxߩ74OSvV5E˶`M {Dt Pz%MxV 1]RXdwph1WGi#p=AeA ktra*sԢcW #ҿ/&lC [ ii%[P3kv@W zcy׻Ź!3KX_Ԣv$ltzEI6>m8\WPVg@EbF;uiY D@b9j;jD:FMwyTL֥.ۮ>sXq{\Ztx1PC C Zt|:s6?qڌף@,eOSPSeEb9>&? ~f۝y\?S:?<1 ׌iT gFWfs}PM̦)D*.*+,6+Xbnbzf8IP34EMNa5d-H0g:C j0TTmԦQ <K}oS J{~e6g* yTѠ.Geߜ䮇fM)Ĭw*1uXJC9kKuDh3&49 <;1 e65Xo9U1bŻ%KV 1m`bt;At "j_3vRxs4Gz$&3Uy>( 0 vdIbOKL T-PQS~!%Z^sn| 4,a~4|p:GG'OB .f(bs G{n} TԚI F?3?=x}5 Owm>(1[܏lBSJ}ټ Llu TBT&A k=Y}aaHbcE7>=sאvck gOGzmre%K◌_ty3]51 <~ d(i@eX)w%?f"Fz l0gj?k9\բmh{a&!)b̌Xf 2]bb0kSvs:&o/W.,ņjxk>#@ňZd4|Pbs{OU۶ 1PW)GNM$- 3S'KY0P`^K%*1+u.ԥV ,νFk.A]5;lya(sڡgGše!AZIL# "=CmN=6<cF>Ѡ=fyaӚ/_'MRJy‘;pl.+~͑#0e&tsgMlO(" ܛ}.9;:Jx]M A)]j81:b^Z8LguNboƭςF1"yXeEeNsLrtx,eeXo $o)A5T{)Z>T@nj.g֙281Cרbj{obAk4nsF<ڭ LVQC8$ 7j{lT(R5D,̟8(ly`]p^FbEW`{I5^t&\>X0K*n"F`hpubFե zSc܃ 1x?2@4|Tx\ga& b/jy޴HA A>t?Pz C=P1-E73LA5H#~sx&S:`#1#ƌjsNt<>TAϫߕKxGbo4G&0TRR5gW7nEONG8Ĝܨ3KWz؇9#m/eEyx*wC޲1sO*8qv]><0m*v:b:AETc57ջlzm|4x펰 NH2>:k1nŲtx[b&mv6_ḶݰRbWoML Ѵ grDq@|b۔.]s7XêNl&!T-ObVr lNJg|[q~w1uE}h^~N0eeǧAj6BtnNC02!˜>C[ u٧Z: %=f6p4Z>Ϡ飶=p *j^ϖ{q&~,]F N绯X+4w`Bk}<$ltVzcCoSu^h1ps~lk_zr.sj8> 1AYq@_%ftof2"?!@A#JQk>gGie/7Ĕ|gb&ZgR뻛oWdqt3V$`/"?`'Q|sV旬妣.˴JѣG3f?_zXYI6}r7[QfԴ{AA;9m92CMo$fZ>nY7/HEʾplE Vܵ(X %u+rDL&NGI Ըe :Zпݟ`8}؅cQoz̼b 2P׊%~;y[3B\ :?YX9 hV9Ϡ+.kVۥ>{ڡ.7>t؉.@Ӭ=>o,~_a:k[y^b5nӠri}NLLE/m g鿑[8X/3C"hul:x3SQU <K0UT@ET1b 5eLш-WgP7TuT;f!1/E+s }~sC~g<[S|jbkq͸kaeuI't^bPuI ?׾6I= ͟[ZFe/o;E$rxCDMՌ>}/:$'j}sL:8]2cmkuv+Ͼ٫(AE"K=k\/ȷr+ :vޑhD]V9۾ϠȨ2w@-6LݥČ^;TFL>ϭ_& Px}[~71wu2ʴgVQb@Ul~ zAm8 %1/XJALG7La7翐ViJXZ~7qh/14k@#{6j=-Mj|Pb^1nZQ^Y]N K K K ]5b,Ludͭ_{f P'1! 4"YSb̟["=YZQ*iuU#4)+15Ata<"x-Ւ-+l\?g{hVVc= sK-G#㘰IR3|56K;q:eL£Z=s2&;=no/2|vεw  @s7Uhݬ]zMVx2_b&_*"j'Wy >A?:4wkׯ=/>6oK61|GМ]٧Ƣ Ae!HL[" qV>)YHn`1&oyZi}g Xh^j;LO)3m4ٳf 08jqIEylR k|^IXky}U{XMАkJ'APyyw&fs-UߣOMQ`6ptne'>գԠs8ڸ73H]bX쭲 y:12GVF6e'V;}}"mdu-*l3Q=v q4f6KNfwYs)CGAi*y.SӉ5JA-Т߃ڏ@o N@LAbժ\?| 3A[P1[=}&X;:B t=^ = D!:" u0C>]\y!Am?7ylXAkH'x{M%YLRw9_ֵjTScm|ܧ;5:/v|i\)~4cf=4P$,? _b6FEwțAƆ/V)167Uu_X<.DOT'& u6&P5z$xb~d+Zjo- 3AMZES͊q]<0cYZ^sׁ!Wg8#+,,hFLSvGGmYSh3Z+vQ$i:w:Q9hr/V;wXZa}, 6 HoYv1kܰaiZN+*JAG~=ԡ\oXҌ>Ӻ뛉4>~B5:]VgT?(s4F51Cjpae '3&!+j@eUSN1?n КgC鹶BL7`tNlZҌft:ǕhϷ~>/[(ըuèQmYo}Ŝf,G3l(NU|4cܫ52Y}kG87H͊ O\δv ]5t&Q'ٙgƻO!ժ<{\}«\ sK4 wUu~hIT5:Y|lҴ>[?_QTS.gs=Ѿϻg!:EN/*:phQ+V,Ͳt}fem7<?L夨hF V8!޷{02 @`_+gYcl&.I6]wOY.#g>ļRF3M;PR1ӿrݲ,M'k/[k5Ne W~~m}b\]du!1#O*~[8M61Gcfm]/]7X]* | *fm44"&<&|Z˹  n64/oxLJQc^WR0p}eqijDtx\~X$tR.wLkR=0Fq}çZQx]>F)UUX ֪yuR.sHkYlN= Bw%v)U4 qA D zVflBGE 2tg'Ľe3{5o\R[[VkP5vxxIKV@"1u7MQچ[DŽ'2xGAgu,+&]-#lygLv-4H0IuzX >+lDCZg}tmB+vZp\SXͺbk$2jg؎wjגnOݗ?FH)73o6[kMhuA+xqr a#s5oMLY {ambSkrN[C7XQ r˭a+-~کnlGC}DŽl3?>Mq'r^k;@$έ9ML6T8<8a>?ox\x ?!P3|RhLxLx|x U4w ئr{M>9?Y1ewY15wmu=v ]M\\Dœ+q "5U&&bRTno81tգ4T,1Mir/3<:1"K0b3CHw @Hlp{ɹ~W4< eZ!i9P@ "LE,b1 010k`9/{cfc?a Z` 6afup ;-i}>@jjH޶)(_OL!)bр}QqoWKtXbUXp mгVg3z CTôWd_f]eSS|ZbB?D;x]~$J\Sr'|,v\Zh6.J6J%(s4 +c ˞E %6$1?ĤcJPMBSB1CS~oϘ%iVC2_bbR`Yvl_ g^ngGl#[oKw91Wpt,D%1$LcKcלcZJqY%HKر[\1f`9Զ$)>51wBK^U' c*T|IL!)DS᠚z7fo 5z/)11YLb<0iFĴDQJSz}C$1?QNAj5_ɨ?=SSHb QN&~t\ē!KJhG1s僅3.Mbv )>51?Hb IL!_Rb0rm9?u{3<:ILILIL!)$ 9"vF=L.fRr IILILIL!)$܅/OoveI0ae_cOIL!)$1%1Yz? j8IL!)$1%1ΕS7pcP幼BSSILi.8{ SlH/)))$1n7+eo8jO{WIL!)$1%1)jRD~lY‘ULȐ}yf9S/mxs73=nڒ{C8tiۥo,Ѧ0>B;"}r}%2o,!P3,yƒ5mUEZն=mI4v`M!k X[([ᜯۄU]-# 2 2dߟc8v)`Ncc!|pG%TDZV=r2(S"B!z+Fvo9U !BI^a)B!y0eS!Bm0eS!Bm0eS!B-oa:B![n S1?,ġ;~9 !<1 "S!zc~Yy+2BF97,DBu@j5ir4`{%:{@MX(S!_S\޽|e*XKѲE{fz[=vOmSoIWRK}P^T2BV5vLk/4$9]3luHhbql]&=E_-d!)z`^Ud~ UK0P ],rGKPL{MRR}Z&C!(5Yts~8 !>i/8ML;Ļ@Kt xPg0t!dZ*5D%bmpFjgt!kD*ϗ[9'$"tDg P !"`<qf2BHb[j[FMǵ!P``U@vB_A>l7Z峫B{,P9=Vcqʔ!oAeѾ3Z{\D!>[qTn~H)B2 ?U0!LMP]7مm ؏_ms}R{ʲ:'S"=Uۀ/Le;:!$1]wP]g/d!!DwW0`ɤOf4sykB_D ZyKmbybk>oD;6E0C.:Y51ك89GI" a5Z*?%!}j)Oy3= E[I2{2>*ʢ*'Wak=>i88o<{a-8ѺjOk4zh) wW SM2d1 ͱ߀ c߫vs(oER41 Z]'x^f|ܾ@<de|cqǖB`SPNT$LBIL!ć ;@Uv,s8V] Xއt̕IB!)X0*NjL~6e;j!BO L֠?Tڀ( kP%*~BHb !>~$cg{-Xoq1ِZ!$ υz?!"BSw襡9}J"B!)jДY}Ȅ!B]٩Dۣ5LBIL!ߗYΙvWB!)'n'::Y&C!$#fY q_&C!$R 3AܕB!)vWe"BHb !)',P!B!)nj\}Y!BJzCD!BSr0ILBIL!$BIL!$BIL!$B!)B!)B!)B!$1B!$1B!$1B!$1BS!$BS!$BS!$BS!BHb !BHb !BHb !BIL!BIL!B9%oMK82IB!$178&=v'q1e S!$ox:ffLBIL!ħ))kB!$1Su5̉21B!$1.:a !BcfaNIB!){^cfa^5L!BXuA Zhs5zȬJ9,c,3& Z,ٚ0?HnQ[^?]<ԻHLHL  1)1 1$&@bDb 1AbJL$&HL$&ĔHLHL  1)1 1$&@bSb 1Ab"1$&HL$&4Fc,hu_X7Ǥ&@b?GGE]-{8%"*c87X_Y+wʉq̷J},3cpw_.b廓$&Ĕθv63cƐAGĨoٳ*|r]ͬ3:nyqnzx /=xnSV?,aбS~le65ic#c#}wWbHLU?ӗEYY^V{.guQgQ}`u|\ѵ<}Viu C'_4?k/JL ĬU#ȢӦgdGęwVfen{G>j}D\>: Y}=X]DMV=WTR%Yղ%&VbvVG륛;̍ vL;l?*1_?16v$'kί$N_ovO\YEu{!;q棇*{>AA@bm31Oz{둝ԝX[%_ub{w8rG4Ks,\n1u,CKDL%17K.M>§ gIL ,O9*rdω.W ebΉ/Ȋ%k׏#;œ"69ͳ$ߚe!gUds}k?b>-!ϯ$☛ei Kk^/M>=fml]bHLobXunqqk>m"9Y^8)8wvGvkuN>, 3׷+6 1Ab~Y2oݗ}uOQל#UdyFF3&FJ]slE9cỏSneMĎcb]*}~o۝&1$&жsiPBȒsJ3f3c׉9`=#ǻ;y+ryBxO-nߣs#"&q]~ge*wYs338kݿh#y]\I6s/Wǿ6_^8$h/o{#/x%^<ѿ{m#"VG\vAxAFD'VTszMcƝG56c;:L 1Yf,y5&sYB.15Ur,ƪX~XLmcV&OTWg\w8/2xbgW:o,$wcv</np쁘E1=DFcD^ukbZke1#žqT<MIL  1Ab"1$)1 1$&@bSb 1Ab"1$&HL$&$@bDbHLHL SbJL$&HLn 1$&@bJL  1Ab"1$& 1%&$&@bDbHL@bJL$&HL$& 1HL  1Ab"1$& 1%&$&@bDbHL@bJL$&HL$&ĔHLHL  1Ab"1 1%&$&@bB[O PpW-1$&lv[pR;E685c Root EntryRoot EntryF?=VisioDocument hSummaryInformation( DocumentSummaryInformation8  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~VisioInformation" ՜.+,D՜.+,HP X`hp x `  Zeichenblatt-1SZeichenblatt-2SByte oder VariableK Rechteck VaFunktion / SubroutinemmKlammer Umgekehrte geschweifte KlammerDesigneffekte.1Dynamischer Verbinder KTextanmerkungrb ZeichenbltterMaster-Shapes0|_PID_LINKBASE_VPID_ALTERNATENAMES _TemplateIDATC010498411031Oh+'08@LXd | Microsoft Visio@Z?=Visio (TM) Drawing hRNguR8>wL>vg>?p9[!i fTd',50fZOlO~C.ߐE#PQc:  A ,U345&6&9Eaaj6 8d7?!%3 URg L-ak@9$KtiQHeuDDT(!cp;/paM-uh\`(+AT %5+H>>5a%h34ovJuX0Hp(!MmcP=?`(z?84?D0pA D7!U/i 4?Q`_1_JD;a3(/@}_L/^/L%a$G[aY %//// ??.??R?d?v???V[l_ru@+y_w-uaDd/r*&oo*o_Qv4DOOO\U$/@__o/DA/Gj:d2(joG2O5j7@oo ooo?&s2;IO[Odd 6 S( $b4@SyYkO(Or&̗T4RDP@+&pqprg-.UEd \UhřϽϏ____"LwnU2r?GXDeTeP贁Nkcc#E_挿¿{%ܶ/o Mv{&pqo s'9K@]o߁3呧G(x,+1fߣSBuD'l*|l$6&w-n!1q;qHVN`amF"%ȓz䥍 / /@RdvMIySe-T"bbbb$T$bb~9bIbyb~9b3c'쩠? 4<}J~>?!OXOpuOGK59&O@_Ǿٹ(n4Y-?@UABCDUEFGHUIJKLUMNOPUQRSTUUVWXUYZ[\U]^_`Uabcdt47"H$ @Y,b'@ b@C-D@p AUvefgUhijkUlmnoUpqrsUtuwxUyz{|U}~t4"H$ @Y,b'@ I_C-d@) At4"H$ @Y,b'@ A-@7 ;z23456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcd*t4^"H$ @Y,b'@ 6C-@ A;X4@,k/MR@k/lNR@ l/MR@|l/7MR@l/NR@\m/HR@m/lNR@bjE kC  e^| 7  3u ,7=OasNDas Shp}eaufudZicenbl]t) ze.HD   3 B>Tp[/Lp?as&;.h> ,b MJ=UF~?FV*JR?F\.?FM&d2n?Q6 U AMA333u` ? !+5ChMW]u$g>5 L@X!$5 /`Vis_81.chm!#4E"67M `_!b-"#"'?9h:AiA 9 $''2ǥqE0&!$E0&!qP \@6%A]Dc]3V:?Ka!Db1OCK%YEiO{OL@ODJv%YKOO"NBSB53^@M^U_g_y_Rg@14ot'2TALd"2(Ech,@!3qlf1U1 m3 =M!l+TM9M]a6 `(an|o@0~ o֊UFD  h>$T 6D UF~@xTiC;'h>4bP9 EUF~?L&d2?F\.?Q6 U AM| ;;u` ?*#)3=KU_euo>5 L@X!#$5 /`Vis_Sba.chm!#57_ 2#`$g!-*#*'?9  %&/7 aJ=?Iy+#&Z&P?B#2N贁wNk?@J'q ,A MVq6q4!*#ekab1; ?Eq6 I-BCb:@e2C1%>> OO1EA5~%5]NGxOC9AOI%\O`JOOrn_gPo|'TAFd" (?cp,@&!iA%9 -$b]'/2q`&!gE0f*laUmHE?KlT(]9^]-Ma6 `r (QJE-Os~%_s%/\h}Mf!>zbcrA bb HUr ~L)uE/>F:*#JJB d]Ban']@0]CPUFD# Th$/T YTYBBUF~?x<F B_P(?3P?Y ȅH?BT ?2~B 03B`T9>R4@Xflh>, bE=UJAUF~?F#H$??Q6 AEDA33333#300 0 0 0u` W?!+5CMWaku@#u>U5 _L@V"JXh#!$5 /`Vis_81.chm!#4"3 `!k(_%n>J-h)_##' ?9q!0!!g}PVh#@>J5A,aG"bCV"1_%>?O!O3G!>H%;iO{J1BCB6CL,155OOL=A_YM+^|>!C_U_g_yXXE+____yXX3;?&oOZe 1O3uniSoooUo3(2Oo.oORo3H_oYo`bO&I5rn7I[oEg 7TRA?"(8F,@!$0l#1U#H3 ?k!b\(Tm9T %=+EͿ}/ h>8 b 3 AUJhAUF~?F~2 ?FP-DT!?>`AZ ,<E6  ,^_@Aְu`?r1|iuu u b]u  - #;@e"(($!>1r?bX?$-',`",/ U-'(4""#//<=(&d_2?FMl2r(}??Q(> rm3Qa+93/% bb#4r925)#8#115?a6I"\[#2qq?2TUfA?GE?\.l ?A8[5[#5 82LF%X[#)Q.T5 2`Vis_81.chm!#4XR49B'I"AR%X23JU3 5S5W <3iAE9 V"T 2X'2@@V!TE0fc1d3 [5Y@fs4 ?j?a9792 Dx,Ds^r;"mDsr"r,rr@w@r"Jrw,Jrr^|"hsvrDs"YY6r;0@?qs% rE9h9h 4$!2BӸx5 1 ` cownt0olRP.x2Ώ~$ nAx ׉ 7|aiCaR%[#o!vş=Ӂ q1S.yZPT&镁 ;;pqGT;;AEEO(ɣ @)QҮ5yA;`K`abPme0 JRPklPPneXRsP' 8E.&c672;[2[5 b1( H>6wUC]da@sZUaXdpVsPPtPPW|VqEA2"EsB!jooQXDVf!3xgyfTog_nI)7N?iCg;̠AE W[2iX83T,@1QclU * O(4[$9a8ӁP2I"X8[$vvxbT55CEQg?y1 l" @ }?1HA@&0s95B[$X,bFZV q0gy 1 U~  $- O^!2w ȣP(  vy# 2!mrHUs }DKt9DNW~BF;(I#e@*dB g]ao]@d]PUFDfP h VTB UYuU??Fxha T,aaUQJ\UF BP(?@?F~?$-?P nL#l]dV^ ] $g]Q"U"Y*"]>"~#<?&#A&Br&C"u` ?PYu"bl""& M&u"u&u"u"u"u" ,u" ,u"4,u"H,66t#\"u"///$u)ar;21'u `Fxu21yB}BAABA"!^hO$,@ZLupO耑 @Ca4R#qt{u*gvXWcZufvvWuTj*uX{u ]ʤ *aGIJKMNOIQ"R$QTܝQVWXYC3333.3>3N3^3n3~33333333@33Vf4b@Vqf0φЬ uZ1[]^s@333'373Gc ƢEt&EAxÎ;BA}@c"3"3."c Ӣp x/3,S/e ~/iRfSIA62ab ZaLxVIǪ *:Jzךת'OgEa@braĠqAQJ`FWO@r ЀiC}F@`I@)@AEBsZeȓ3U ,puӐe(p 4>{ScNV:fcfR:bWKqP?@pA3VUbQw Sio@(h#FtϿF@ qRfa+_i&7=akVQhaRkQclQohaR2brˡF@#I~rW{ 3~TE}O bqO cy`I@Ё`sVRڀfK@ڀbooOlw wKuK`1s*8zK@JqyozI@ eoo /uB s!xx7SlP4;walPe,0kNq @Jq.-8r JqM9-t '-E1*dbt+r sQJQLŌH{M0tb;{O,=CƁS=ԯןƋM2'Kx~{עamzD1-?F|ǓnJ\˟ݟITjU˫ˬ7F:-˫YkIՎ_TF ?BP(!RQ!4 Iz{7 F.!`}~k QhaqY.!(SFxfb@&7! kRka},1ff",1~,1ff ,1WVHf312E1kaB12lQ12a(712,1HfWV3UYkaO} mlQYBaYO(B,1WVHf3ka lQ"(;" FHfWV3Y"]#kaS#" q#lQ]#"]#S#"QoDcjWV3,1HfEFWVCaHf``5d 䰈qGA8rL5k0BAK6 k0L5k5L5|0V!CBL5 = |5QQ5&t?U: =|5vŦ547 P@QzqE4HQ7b&qn24Dp)CTU+0F2o$0jjSRjaRD9Q#eM1sB=yIZR1s^lZLV_4pQL׌HH.5Oa 5.. ^fCmnfv3p` T]`avelShift`$xa_d@a3p`OΠ`fs`m!*_a@@ VV%Sr V:67sGr:2!l7s[r 27.1i$3s 1T$y@a@dvkQXU.q.'2rqty!,0}v`n$qqt7v-x8cʁEl@baa%]1]1!H$rI*J!1LLLDŽkq+MԄ .NAOAAsQRe.S"T/.rq.qqAWVqqFYpRBZ}/b[.)\r].QLQ_1(A`ٓza(.44.;[Rx a;`"[TBf"< 1W`B`sh]`cu g`f&+o]`m`t`l`g`l*?`0qH`.:jx +\T`x`bdvq_v!L5~*ϫ16DP`)_R`Ht%k` 7DVhzڠ2xQBuݿ)/\BanAM_0qx2Ϛ0AP*(O`a`*4dFxgy2?Wʷշۯ-K08&4Fb[mD{ǿDD!s 1ϱPGYϋ(6ѲĢϩȩ5hA`# &AsDEy3 UĻɯAv^2`OnwAQ9)(ĽBT0fAvH`Uta)Yp!3EWLnew@)ncbā Av9H`ER#t6Hl ~)99:'ϟoP$tm-At!BT)ங'7İDZEBs&1)/I4+r/o/Av(* t/% *Pa#/?4Vir4F:?@^?mAiCOOOO6O=nO Z\9?K8/ `v GAAtPT&xJb=rb+ Trt*P@?B#o54trptb T mkqőԁw`3P?squ{tcF~ϿF@ Y%ukp{`?u %,Vrq @V4`+AszSPsT3 )5>%j{ိqi!stgq xŕ2htbrQ? !3'󿂱/0 c{[яJar<`Ѡ 5 %*5}9ᙓ @r^rlA$Q2U lQQ؉uyhU+424r@1Ryɒ^rx@7.?@hzi?wԐH}߈7c6z#o/|UD`a1H_\"p1@&WrBdeKTv7.!ԟ@V) `aGo,o>oPobo1qyo>TooODowQS+F搞R6);=[vrrQv>LUF+q StFUevS߅x$~&qޗ݅ԯ1).UaO|tǢKT*ϰd4)'ߕr|<ߒM2/WkNȏ%rQ|evʭVlߟU[#Իg.gM1xweۿoo1CBSCS/e/w/S~eB]v KcVFO/GXiPdU:Ǽ ڄE-,/wb/cƻ͟E/?'?*&)BOZlcƄdUO7c*&tG);AEOb1ҿ)M_Cb.ϛ]!_R8Vb=x](' _ ݂?z-sT_Na2s/@.g(O]Sa5 _;;L7pwrra2wcCB|WV.gWi gU1gtO@|{럘p  D g,l;;.o@o*aa Oo0Ґjo2kJΆb`b~Mk 2(s.®%)nd\S?l$`-@K ay!*t1K쐴^VQ2CIUdUpς1aanOa7P7߸y!X16BòJa@a WE1!UަQb@72Ce$6N ¸ջVcIpb)L(aO[Ne4 (ga# f8 \ 2d T!bu-(;M_qڋgֿ`4@?F\oA`0ΉjM09 Q(3b8ye/˸?FƣE?Fp5Ys?F5&!Q@Ή( 0_Bԃa2U0*s3?ܵ0Ԃ2 k+ݓ0]'%Qn?Fѡ?FW^bd%?F?Ԋu-Q/c,DJ}?5^I,QIƥ,$~//'% ?F*^Y?F[E?F|{T?c,|гY,vݥ,-?C6*~??b'%OZ`?Fa)P?Fů$_?FPvϟ'͚?c, h"lxp_Qҏ,mV}b!)/L FAOSO+~'%`0DLJ?FNqVUO:Oc,~jt7A`,ףp= ,7d__Kh'% QuU?F`4pF?FLAD?X@t]_c,io?JY8FZ4? qۄV$N@a__'%X/~%l3!?FeY?FJ~ӗ oc,z6>LZ4kw#awivQooj'%'-q?FmUa`2#+?F(%oc,Y7 }j GfZ4 ~,ClL^!UFV{WE?FcJΦc  )?H},""3\ \ -YVqjǻ )1̶ Ѡn<δ m|ѠaQaCSVGh4cfUpi$5,)֝F3L&AP"iЧ Z3*p#q8 |`rXӗze2ZՊ@ #5.?\zi{B  ȧ#ޯ&&JJ\BMV㖿t侜+Ģz`rl%ǨΩ)1@8"4߀Hߒƿ./1*Tύrˤ]c-=( @=5-2-9#.@"~C Ȓ#@ 7?D`Ofrsetx %q,kڡv hE 5ɞ)3U+KGAb TrKvlԐhi"//ׅDzW280//?(?< ????QcOwOO)O7(QOأTx7HUI' Xߞ^Ba5a8_A88F;2/#3wB oD4@ekFo<0Hoj(PUFDfP h-VTYYU?"H$ @?Y,b'@?xTT;͑U@ !@ү&P6 lAu` u(Jݩ c?EDe34 D   J ũ2qL lvF BP(?L0 `LineTray sp r{ ncyz۶&` v%P t e n&$`u v%W{ igTyt&a` v%_Rouy dw")g&A0'2A{Gzm?>5Q?A^n"`Fw lo0~/+n"j?|?+5/!4`S:Ta ow?<*+` 9?& ` 9S5@y0eK $KXOf@s{ 'B $KYtO 6`9UM@gy i@i04Ai '. `%9Dw AcNul>k$Uhh2Q2QEXT/J> 09([_q_[_o!otgU__o_oTEooo,o1A>Te\Ls c!2TCt1MU$U<"itjt AktE*Q*QURmtQ!!otU p qU r s-3"!!uGRvTlwaExn11Uz{Y|})~ARɄ22քeㄐqJ"T c 14.m"?<%Rpsf0M8@H8 MEJUU8!r5GrK&HZ&H͟@G+G3"?GERml&Jlmyome>mGG-GAUV>6HԂyϿHႻFSP6HuANqe (=MQ_'0Uhv$on!3` LDnFxB'3` A@iBݞ"4` C m@bAxB}lewL9WIFE/HU= _6p9yEW49dF@]#'^B ;$]@e$k&o+d@(]:aG4b]PUFDf h-TYYU?~@x]@L'} V6lX-1u. Bj2u2Z2j2#u9r#ULH/MZ1+B#AD5 60`Vis_SE.cTm!#20AD%`>Copy<0wigTt ?DU1f@M)@c<0o+@'ofdBUArX@Aad@iV@n3@ WAl@ef@R@6AtBvBb@hB@lBAJ@=## AoG?9/#n"E&444 7I#$@HB59_lj#"SV6U8*l>(Uhn E /J$&9"(Ln eg5Le#pheo'T !! Js~o/|R12'"U7A%O3W_7xr5(-6 `F2 xqu\J@#:0b)&`AAs)@E T@xd@Di e i=M]UJh#HT0#3 UEJ\}|U@f?@3!?F~?FL&d2ٺ(1?P Ǜd#pa HkaQ"U$"Y8"Mx#BU<&?&@&A&C"u` ?F]o"fpy" & G&o"o&o"o"o"o",o",o".,o"B, 6 6n#V"o"///$u)ar;21'u `Fxq21uBAy B AA21"!XhQ$,@pup`Ca$Rou@+u*LfXQc* IRg fbY-H- M ZU ZZZZUZZZZUZZZZUZZZZya-yyIvJvqyyMvNvOvMyEQvRvQyTvTQyVvWvXvYv3* j|%5EUeuu 4 蕺!BZ)CT@x@U @n@o@a@%iEPn*Љ4J1[v}y]v^vc@x3+"" qؗAU2Aym@xcv$"" zp$E1u/w3,#? N?$hVW9AB[bSq20S hV1Aqׁסױ!1A7Ig?abrXqkiqruׂ6rS@6'_@rp9SR2MV@׌aV @aU-ܕ?XrcU:uJed*ɮ᧤N@q37sfjBA'b6bjB'#KPRQʾqjeArQ c@(3FA{aٿA3b!&»F_ v7_M%;f!xjB!s(a?xjB,2brrP#VFI%r'#7 3%Р$UM_ }uj_2 ׂP5GׂWsZ2bQwvPQrT_@|wu‹ׂPc?P 5uR܉͏Cgyc(` q(`e80{A @9-܎ Ʉ '؏bAP42Dr \sya@Q_X俋NZ]b6 O6͒z{ # Z{u£@%ЊׅqmϕDR1oL^c,ߛѯgZ $j%{|ב R{iۄ);qσ⥞occL&d21b}aN/9K!KG'!cpK1a81YNSFxBD $e0Bof$z:cRTrDBʩya#HuzR j"^vc ` T-pavelS/hit`RHq/tq `OfYsfps}1 oa@@VVSrlV F"1+-27i41Tb4_qt_;aXUZ'2rq_!n0^Spn4"1PT_sE<raa-A-A1Hc^IpJ}bL;M 2NQOQ1\Q\QQؔcWRS򔆮TqqW&o$Y@RZMb[Z\g]tpapa_TAQQAbpJvq;Ϥ+bܤoa pQ+d0AW`BfpsĠh-posugpf&+o-pmbptdp^lbpgfp<XR*R?`0ȁfHT` jd0+9TfpxrpbASv_vPQE~ 1;F`a`пҡ<Rfp%tknpr !3EWj|Ϸ2HaB^׺/9Bmqn*<0NHBew0yQ̀~`ϿOdpahp+=#bRdﷰ4z:$ߢ B<R ai*rp iisXmTZdj `F1H<zՕ{xMOai?ޯ!_` tD.Jr5<}= ` K* `[Z l v 3mAxD{z{.gMbeᒎcQɥģ"Ĕ,/ħ<w{) ѫcĔpĽ} ѮmJ5N13_MsSspy`ID?S/c}ba K"eb@o> )עa2¢ `DVh%# UD kmjBt2ߧ߹$c褣%!rr[Rf`}aTy7[C3DnUbe|b;ruv`Up0;nr`1:븁X%`?$2$N1} Y4Brb@qAa-aa;qa `//5?*?cT Z "!0ЏQƽP׳M+Q ܒ*QDb)QX\T׳a_uu`bېRIu}ܒQ (l\O~?hzP-îLޯ)ّ `{Cݕ2YǕT `ƲG . !ё1ɕHᝢ WGMĪ ?Ɓ%Qx?ˆt/$Ͳt ڔ,ş$O4  ,o>oPobotoobo1*BBZВՑ7zBoaa^屓aG9gl6ҩ$xrNPƯدk)D _& 3EWi{ߍߟ߱ /THZld Z_VjhRdv=X|w$%F / >Pbt~44FJ3x<T+///(/aNO:QN9O:////./??'?9?K?]?o???1???? OJEOcUQOOOOOOIYvotuoacVh͟y_T_ j &m toB)j ooQvwёʮhg_#F K?F&?x?0l}G{,:`@"   -?%aEr%Õ))EyXR} o`д$#?ęxQIr/xUt,bwXUl0i1ewvv֔tQ=Q)R}h4FƶwGYs?CpYՕY 4e%{QHvsLQgŘ{)tUbzf^ȯfܓ֔% E:a`*q>^TbtxoMdǏ@هT/f/˖{OtC]c VqǐI֒FV –nUF?vn qsɿ *Ys?F>?F:Xc?FMڪ﫰|JܡtQq&A=QngiC21MwZ漣A$rqg0N܏tE˔F*CUy ,Xjw=Oas߅<`ߦ7 {RC*OoNkrfŜo-?QKe_? Obweoz}&U.V@U4kW5wR<k 7 fwdůWdvw.ϒ,u6^.ڌ@(]/5Uk@ k@Dw,|@q K0/'LK9'Cm0ϾSBs2ّ5)\ls?1D@ q>Aw9#uQ y~qҰq٪$E)U5G1r9{ a`pM>AkVRbדL!.UEG!ܱ'kWH٤*Jn}viIpU'LG(A^|{Օ4߭9w7;Օ f!+S2)kt/'م"Nj$6HZl~P`4@?FEO jM󎣈PuY Qᦤ8%/˸?F#eֻ?Fp5Ys?FwtÊG?( 0O(LпDJգ<}?5^ITLQIjL$?~OOI5 ?F;?F[E?F3Ϛ)O(L|гY<ߍTLvߜjL-C6*C_U_'5OZ`?F3$i?Fů$_?Fir8_(L h"lxHOj?FeY?F܇]}(Lz6>19lTkw#N<vuqRd/%5'-q?F0 B,?F2g#+ׄ0]/٨(LYЍj@ T jLCl#15v?3FV{WE?FD~ΏJNk(@(+ WIHg}jLzB՟$q$D*P!)=6?zH7j A^ 3=< 2Aġa1aS~h4'+5.ϼ7O9H%F_p8Ɋ( b-SlJg&ǯٯ>qA>%7IWt?&t:NO/ag#mҳ31>ũ!bX,!.@-R^rC&Aϵπ!EWiSh:Mu^9a.^;g?&h&8!AOϓ{EEEW{>h"R7"(P!1('b!)1jUP-29Z3ˡ#@$ 1d>"wCCZ3Q%p1bؒC!p2@&7DZ3`O}f70seto?uܰA0&2,?>?P:v72p&1"E$A1oٿA32ÿ&A>+5R{w,0';)w-eV-jUCU+ a ?%A'; WTrvt0lghin0w8M=Bb7OOO;J!HR?+vOOOOO__????(?q>_]?u sEtjqttHD: #  h  T0]]9 # B 2AUAɿAhY?ٿA,c2ֹƿP6 Au` ?A@j$u#J.9axu`u]`bu`+u >ڍU@@M&d2}34"ÿDC'>"M-w'>"D(p A "'$"&H' O#&5 $s&]$2JD=#D> D6#U`l"_# #1?9#H1 uNWzIs;2 8J#2zGz3Fx$2[Ru(/YB DU_V?\.?/B:o:2A7P`BackgGPou_ndCM`lM`HQz@@bZ}H D?h1GA #X8P6d3662Q1CUBF4i7o117;y0~1Mr)Srm>de}mspTt "qq"1 1381812tMItBB Eb'b$4ANu13[h2AuBH1BʜA!ʩ¶jÄ[QЄT݄zrf>!$0 %3To1/u/u?8XxAC`IWsSwSwRs%o.@0RgPf KNC`teI`\ai!nn3uZR%d DM`kO`mtiM`5HQ-2HZv#`NC`o>!8V@MKsEŭAد3dVrbRaPags0bjkTykp~1])S搹qO`zfY`u^s;cTͱnA²oivlPA$*q#8@q#5$rQQR*E?eNRעQcBdg:b`OTndGPuNEb;StRaaGPdB[Ÿ-uijd[„6k~]QRƀ@gP@ A>LEs?e\/dϩs Aee"g 9bY`dt2D-Ÿpsr- Sqv߈;`aݔ֑#pS~>"ƒE*ȯ:b` Txk GPp}1Բydc j]aaAe(Se1dSrʴ &e%\g#d ɿRf);M_=7DßӁ„{81,[/O^kxÅi-ùƁ3 uI[Uu`  *L%LBW?AP)Es̲aٳTe"/)#We"ɧ??? ?:OOB&c_ //Y`6?H?Wis??]CJ_ oAUCGP?e`(__! m2oDoVohozooo0 siԛOo oW}_oOOOcV¯]WץR=Oas-](]uќoo~Gm#oTw {Ɔ҆΃S 6:0Bw)s͟ߟ'9ρJca:smQm Krаe/Ȯя- voP* V²#5VUo"/%Wo"O _._@_.o*o/**u(!S[mJ5li@eu+arw% UR°l;Q@nt9'G} !M @o#1Ϡt+o_1OCLRʿ.@=(*jMD`sprkND߂ϚByiϹV" ?5G&8߭\n߀޲5F/=$2&"4FXjj"j"/ɨu*FXjv_?q????9 ???Qc0OBOTOfOxOOO8B+DO!O=`Rotyfb)]O( !1idBm!?ȅKbB;rbrc`R@*@;H(iPB_)/BE!1v])g%oks{1tpnN;GWewyuPz%doaqm Bqo2;a2wtSkmQb@nvUaTtnsb bdds°bjTq3o: rrcjKbT!E!222?kl;!30kC2m2  aZZ!*kψC\\E&&BGO ='`C²!cRf Ot9d_D@qA,@"hi."4 b bA' Y! Pk?zz!!_lDZU!!'7!ƕP d>"p}9+6@ci0_U  ]  @P(  @Fя @<g ( "*^p?4] #5GYk}D MEOBJ_.VS] 2DVhz  LANGV_M5.S] 2DVhz،D BASIC_M.VS՜(h *:LZ}C!DQ@+P/J+R/u[HSO/U`8&?p@Fh@ LFDTyB tuh$/T UF"H$ @FX,b'@Fx,1X8d:UPH1/0rb4,1)*AA/_"_o & #hQQ,0#` B scriftunkg,1 `CWalPoPtQg1E}u+iH5u1! 7 @@j&@@q{`?@rbk?de?s)gUA$ &?$%vr;#xAZ%RiLE" 2 0"U$2 eur! |u[]4 t&&(s~rzlH1AUH1?iiu5U A2z"ry"!rByǤo VTPQayl p.-LPnPʡTn/k?Pup r 3Qiߢ PuPws 4EPtIkrJPo?PlΣV?PrPRʧIE zmr󢴳 5D b9TB*nPnߤz w 6VO_LA!0jA_(S_e_{W'6&!3A(P!|/2g1 D1y 3 H1D1oE7@q;E{e|lE1@@~!@Fg#?F"??QkPyA`Q27W(ATl 1<25l =clYmfxAj`PL!@@[g?+@@1#_  +??@*o4?PD}p\z-uru`u0`bu ,0@@"4o@a/T("q6y /B#u2#Q*"0#ᝯ2,`6@@ߊn`P @$Rxww &;01O5l^3);hK(a~"f''?銞dYկd#j_ubsUTK0a?DbB`@_bzI/!*9`P"3\o"҂3q55"1I7zrHQQr9:z:a:a9aaR=R>rrqdQhQrq(Qr q2aatQmO\A[|RlqlqⴋrT,@rLQux҅t0`q^qspC&Av"rBpsx^֔u~*k sa4azuNu ca@bֵf7sa9@xU܅-rQ9PCaLJY„f6D/@r*PPV#ROj&TP@Yn`@Q.%Z$yaUBaXfpUu!`4q х4s q, to! ТZhQi5,Qrc3LP@j*(B<@b@t^?$@o.a#@PIKr3[b3KlqJj/ \Ca/O Yn`5PQYYCZOǐ2p:F>pKBrOgOq/@LKHKEKːYCJ=Aұ)VZn` OzOOOOE^Z___*_<_NXQ3h|GCA|epPKd @A[-B^ AYsjT '_*%kŽ_Zoc ss&qg1]JS|([w-v`DbKOb=~h>fkviKleN{>f8{gyjPsKϝ̏|vTXc[עHAmeZfDo1ock2DN&xݟ^p*wwjo>f?ʗTٛg>f,GY^4Fܢhn??Qa$%<}Ac)#]KAt^ FA1?0_P_b_k?@ܟ9Zm(͖pB?@qK:?@W@ή8W?@S^HssZ*m(5=*/P#&?@!W/?@?@F?D'A&a?@0?@vj6??@^ŴBI!O&J6/iлH$?@ T9_3`?f\Θm({E=T@m`mЁ?@l6͊`?$Zm/~&0=ficUo@@K^9`lخgA%=,^?@tA XP@@z(fkT?@Ô1fe=j.ƀ?@P3{@@5 I]ͻ?@+ӟ wu=~@h{?@j"~#HXt$'=)&3I{(?;3 BP 6Oc= }…lO'ƯدH6[0 O۶f_@3l~ !H<@)>PbtφX?<)H\t('A)_qUO}Oash8\@?x<@fb@t^ OH3q$y)AᵅO(Ld?x<ǣsxqM~^ACi#Sq"T#25(3 #A/'2U:H'm!D0B 4"!` TextwCo orz`` LainFn 3` Asa&!4` mpP  Aj({"AFn(?A!3~yZ[O PA4wq 'HFdAT(q_q3.gq+-뵅h.((zR28y3yPU)^BPԇOOOOOOO__)_;_M___q_______1i/{/^X" 6q'AS6m#p Pya d4//*/E$B ?' `?FM%# %?)Q.(gMACoooo|+>,",x>Pbt}R,>bMt=ζȏڏG"fFXj|xU,įFX*@pԯ8G(ma" AS$4!̱ q 2aaJYĆcy"ȵ08̱u){`gl6ߛ @@L"@@Hh4?;C¹?FG[r;1֔'u`Fx8<"\YP"Q!cZ"[!y!!2..Arq´"T,@-@<إN`-9-L7Cz`.WAoubҟ Ab;sż.v̟6 ˟W'?̵4!Z)4TB`xAp`n>@tzj7X3#|گ2п6=#X)Zܽ?-qry ~ZAu`u`6@rbÞ?5@hȩ.p@Őc)a&M/_)s6})7Up`uR!cA*qK2-[!*U)aYӣ#Հ@+("euF@X,@@cP?$ 9/fPtwߡ2wy#wI`rSbK3`q a\~a c©Fǐ⫣  Hː5<Nas i!3 w%<;㐐/?/e u' @N2 -< N6£D1 5s1 .h fx sN!P $4b ?O0A&GWA///&6?+//O*`׹m(D11CJ/"ǗNO`O//??M'X'jY K"K(;G"JK>1?/KK__O]?o?_"o??MR&vum]pɍ0cKdoe񠬁lOe񑡡ojFxKk@[?vuS‚@Rmw@|mƁ NGy}Aog6oo?M@]f?qoooooo\ke?__O\Z ՁX9/ӘC_U_KXF_}6Z?Fe?2”,zNt/DF`0 &F1l aPdl/BjZԘl-U%{ 酼N[bzf^5OHƏ؏bo2oBbd?Ffl6&FF?FuWuZ}1cԚ\ ϥRsBTЯ*oo`GÊ ݢ{Կ̗ޟM2.RkO֨ϸ"4FX<ߺ̱ 2U9MSiO@]ўyd!4q<|a|aSeOZAkQw9+OO!@ Ai1/C.</bsPbOo@nZA">Wi{;^5˩?@FmtĹf~:G?@?@;:y?@A^}/9*[Jȏ :g}= A?@I l?@C"<%0Md 8#(m?@'`sI@DϜͰMUh>OmHaoW?@&N?@?@+%U OmHg6D~)cK?9?@_1n`Um,H_mHﷃP,P 5b?@|XYm˗_mHOgOw^ G/6/?@$!?@d%FV^_mH+5gf ?@qK"`:= ?@6NZ`4olI5gN@S:3ί?@foQ̄oȡ4$1qY?t@  O=rbK{!v '炏ÏՏ" ?V N x4(1(<1> =Ÿ?8Aį߬X,@@cPx114<1U??D$yίU@`0 Q/Si ^1Ts] <kQ'2qiq GQ! Q#`n%bC6a i@bpИCa zq`%`>qW,@Q"acqB@>q݁oӂ_=@`{k*#pq95"+aq@uo}5ub lҊq徶#Ž#UU)*/023456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdTUUUUUt4l"H$ @X,b'@ 7/cC-d6>U A;XUUU &U'()*U+,UUUUUt4*"H$ @Y,b'@ D?C-@= An@@_RR@j/GPRH<(H<(nE@REj/RU%`8@P(  @?F @L LFuDTyB uh$T RUF"H$ @FY,b'@FxS1o8{> o8!!~;[1o8!{>_5"s4"{>%s4#{>!o8~7cCP;1!S5V )*qa!!u&'$4(405f71$;1<4(+@4P4T4qaUctaaU+=Oaso !!sE H  #4쁱0a` B scrif ungZ1[1 `CalFo&!Q"فf0! V rb ndx- ` Cn(et~1 1ՓusC1 ٕ9U;1TyKp ,U"& H-EB ?@`0  @@ `?@M&ɯd2?Ѥ٥?QZS71#|q =t4C[[s-4 ~a#0P_贁Nk2q <\.Y?ۥ l10Re11EGq qC1q Ҧۥ-E+uLs#- u;1H0/1!$,@yqmq]yߡqiئq iOqiܥ#>/ai4! &iq@X'2q a ]j~1 ݟrD 0ӝLI64eptepI(iDi1zD ƕ I)^!3E羚bX, @ȧt:'N٨!3EWi{ÿտ ʼn!3ϫ(qQcuχϫϽϠϗ3?ݡ5GYO?߳ =OQ?UHOiO_a___3?]U_y>X0o&8J\hArhAopӦ@25>MAC-O__uW|>Ǩ,Ӣ٨"D55$ee O%%_/q/(re ////A/////bI/?zuhA ?2?D?V?h?z??oo?,DmDOO(O֯g^OpOOOOOOO$_V8ou_D(Ϻ__^po$oĶHideoY+RXbooooooo b PqA*btwTypʿܿ+@@p8"@@ 1]o/1CJ/ϏᏀ/Yk}'ݻ͟]Pq /AS6w,16=1˯ݯﯟ0%7I[m뿋C<1//ϓ'?9?-?Ho(,?oߨ&a@ buM+%~mEa1BA Pq6I +ö`f?+@h5ƌRU0xSX,Au`^$?RuYGQ#ERfRtQA ?PbCtQ&b3d!g,b2e;mQ~Əy&3E'A\_/. FU($P>GRSԿ _U(YWbÐ'@Q.j?@@4 8g t?o[E銓PbtΟuA'O9OKO]OoOOO H )tgalod@8OOO _(_:_L_p_V,ӈXd?kѤX____Pin\ gs2oDo"ff8foxoooooooo,>PbtEuKXP9?گoYYN5uV&8Zl'%%O #;:E|ޭCUg] ar%sv0~O?;-Cyg;-F$ʈ?xrz?M;--3xҗ?2eE_?vE =RϬV# =g˱S?=(E}uX?i=+&?#HƳi=9C9?/+-**c?Ά@+-#5GYF///////??+?=?O?a?s??????? @.@Rdvݽ$ ( !3*M ! %tYk ~z 6q٠Fs:xrava  r-vrNxg"H+b+ @Q ^^A 8uo {U%7I[c8ns<ٯG!v%P>j?@@͌K/4O=VE蛯b摂$l~ƿؿ 2DVhzόϞϰ:X]͟.ϐR %Ÿ ៙?O"O4OFKϯ);M_q˿ݿ____oo(o:oLo^m"Com_pr.pC`unk`za zoooom(q_{faZ~;xmb|ry_qpy~\ gsvf8!;ԏrB (:L^9^NXUϲoYYϟ̼z/A/z?-?EW{ύϙ8}%O,]tMI[]/=9ar%^v0~O?MCyͦgMF$ʈxrz?MqM-3xҗ?2P]_?v0MRϬVMg˱S?t]}uXϽ?^]+&?#H^]9C9ϼ?/ M**c?΀q M 2DF~OOOOOOOO_ _2_D_V_h_z______@+=OaGPy!% >'rM/_/q/R 4+JR@@p8"@@8 ';rG8u}3mUs}}R\hB+q!rbEqz0O}@ } dup}%//,'e!t'#o%}-%񶷹%74Lcck}ŏ׏ l6@@`0  @@LOcTfс~֤ P&sS>bYE"3qr -#ѯ+=OasѶȸ׿ 1CUgyy!ѩ}}!Ϲ;)AES256CTRf}!Sm}!}%!7E4ZVWt:!@@̮N?׹K?Qmm-%Sl-" v$&@"" "v 0SBN$`rlsUD%S@8-тhHa:=;s3Q?5756OF?>:g|693HzΗ(U@8rT Dvs6`S,@q!V(< <<~? S?qC~ I[?ù}ߑgM" P@8d:MN82y'FB0/RC"4-Us^__U/S_o;Qv?;oMiUe"LooQnYzoCoCUL8koje5OFYp_/Cߓ=AB3A5D?9\.k?8$144MhEc]o??w+¸?Ͽ*Wi{0ɟ۟>Sp p&?J\@nȬr͞jt 禤x<@dB *PbtfBӘϪϼ@ VEV}od oT1^fBr fRߘr@~vDT1`?,>Pbt HZ(:Lpď֏ @R6H~ȟڟ 2DVhzxIp1/'/9/K/]/o/{/-mEcE//// ??.?@?R?d;GPd14?1=ݟP5=I=(ٽձauu4IDh4F@lC$@@T??չIzc`4A`nu` ï?b*^uհ/YudiyXQ~R1١ar a-d4c2o\0BP@N`rquu#c0P贁NktdsP0IUsۑ(qpA~1 d*9ձASewω̭td?1z?1?5????OO'O9OC~#XF IjF|OI?O@ONHFBFw#@GRRSiRX\/zVHY'R#pO'_/.____]Hc6R oo&CoCYo `1qh 6rcwc4 OD $OcHcXFrcXFRo y"?@?$&8J\i4);z_q_*ݏMo_o!o%7z[moQc!3E[mïկO(:HTf>ο?2`rϺef$HZl~o&`0 "vn a //-/?/Q)o&zUo&t:N" "3U4U/ Ν"#",Kϵ&(*?A|G4=)o933hd0z@~?xWb5@5GN_ʟ1^P%|1N5OYײ=i{rO겷hf:+5G﯏ղտk_$Qcύ37?I?[?m??2?????7DO*Oe?w? Ͽ?ί?ǿO(r/OO^pOOOO_'_6H]_o_~ϐϥ_1 2DVh>Zá?~S5\>%6Q \>wj?0B0?JcdT6K';?\*NoO??oF*N_B?*=?PT6xgd?,RssNW5KG?vehNy@~@L>:}:?mTՁL>%ֵ+7?Zص,^/O_?/_?_H6~PѸ(^52P{t?????OO)O;OMO_OqOOOOOOOO_%.6HZl~ȿո1dݥC>u?nk رո7I[/%N`('Urӳ  Ȗ%Q?{AS1ju//)/;/M/_/q//P///U<ϱ?_ؓDŴo\ Uҿ;Y$]1Ci_{_6___(1/45ɾ#;:T6–d?v;Qˤ4W:@Oւf&IsLsFXC`?ǴtFYuw?tFÈ rvT6GA ϫ?UsD?q5sCב*?qs=(T6F-ϑ}ftl5ꔺ?EctJϹ? Vc6[ ۪?c6 o2oDoVohoFߦ߸$6HZl~+=Oasȁ_ŏȣ} ڄߏ:#*1"2"`1ꡑ$5Xۯ} }6ȢΡ4!A0򯒧" tN,P}zs& B*1JC8} 6F| 2 2 2$$ET^}$@r/?@IV@?DљEd&?:X".l-F@^]aK(0A`CF nectF roKbQ@*1b]wV!{AU#q1`T_W[PigtoUA7Q__tYTtAUL0`_UPPt_PecPnV9R,o>oo@d)AUpJQ1`\o)RF dPnPUA;Roo}o!e AUJQ`ouTcPaspPUr[Pn]PyVCR.@R{]v3%a=arɜ1TLHHOo1Ǥ/}Y"?Ʉ}L\ Uys|Jd2L&ǣ Z F rw 0/Ab/ /2/(@ Ҫt:@@~_^ ~@8x?5=ԴJ6Bmus`u`#66Bu`ukw- O&`0@@|>?@'?N@"43^34^?ٿ# qc21,+=&A˒w *}wL?p^?p?u?.2 2²3?7??L&GHq*I  |XCgOH$4@ʂOOOOOOO_ _2_D_V_h_z______._ oo]oooRovooooo&8*u`x&8J\TǏF{,Z{{ a0B/&s.'Z6?8->?Ÿԟ .@k$Z CP/@CVE{1+%5n'2}//-p8?@dL @@Ai-A&O8OJO\OnO@OOOoOJº ?@E@?RT*X8_$T;_MQa_MVd5SÜ{________ oo/oAoSoeoǿooooooa[8t:^+%I@shߑﻏ͌Tt1揢.@Rdv/AП^π*zNlewѯJq@@.`4F XwQcuٿ!3EWi{ϟϱ 6/ASUv?4?<yOXjdO?O?OO 3bP&\nq__/4FXjod%]?Iz^l@ ~sa//*/Qcug%#0P贁Nkd#&@㴚b?3L㱺q>o챙oVЯ$UU)SD*[%BXBd5 xf͟ߕXaZM,@/1)5<& 0 %CU>d5ԍ,:%k}Ųdѿ!=!a>Q;hɽ?qxF!6Q)Q|h0QadaaIَa`E_''D?@v?n˿&DF C,x RFAABuI`Mud``CC!(dկz't:?N"@BC "D"JBOOrp!>AFO O^aӗ"AR"DKS!n8q 0H`Dq_B`0!p"./"$Ry#p74Bg tNÀAzs\A4B +b!4caQSYbYbYbHYbR4 tD@r"?@I`?d&e?,!4!&_/w c6DyQл $l_F $s,^BuKOa`sql *^qQb{}"`uQ`sWJ ich 7o/B`u@`Pt* en9rK]@JB`u-l`{R%dpn s;rʏ܏\AA `uiq`T asa ec ykCrM_q#5 2>o9@R kx!xxg}enD~Dh4Q֭? Q?Q1@(u ړ5x@a Dp/////"0///$3Pڱ&?H?DZ=ڵ@5< 9t @@|^k!@@p8@@x< CLjePSPAu`?4@T}ueoɲD᜵PS*oڵ̑؞@q3Qڵ- c oݺA˱DZD 3DZ SU"g`xAR rzwE\|x8N@ڵO&*nN)2Lвr˱0Sñ;˿ݿ/%7I[ywΜϠϲc7s7 r9~_&+QB B@@$Fğ `TЂ#%fxҘ1ߓݺ&߾?*<ܔppmF/+=FED&UO<yO L%OOh#_gOG_FORv9,L'B?vPD,-vPD0o@U1( O-D&UA%U f -h"/T))+U( g&+ P- `m-vT ?!}-a8LXQ -H*)A/"/) EQ.///feArial UncodeMiS6?/?`4 R$fSymbol$67fWingds*7 fECalibr@  ?$fSwimunt(S$fPMingLU(w$fMS PGothicj@ $fDotum"|i0@ S$fESylaen  $fEstrangeloU dsaC 9$fEVrind1a8 Q$fEShrutqi| Q$fEM_angl$fETunga<"@ Q$fGSendya*/ (   R$fERavi"o Q$fGDhenu"*/ (  R$fELath#/ R$fEGautmqi | Q$fECordia NewE R$fEArial"*Cx /@~4 R$fMalgun Gothic |w L$fETimes NwRoan*Ax /@4$@+EB@+.B@+%BC,=BTC[,3B4C,5BC,GBtC -:BTCD-7B|{-ABT-0B0S-1Bt0S.0B0SM.0BT1S}.;B1S..B42S.9B2S/-B3SL/2B3S~/;B3S/8Bd4S/IB:0JBTheDoc"Gestur Fom a FhrungsliieGuideSTR Normal STR-Verbin d ST}RCon_ectr&msvNoAWutCn 7ecPage-1"Zeichnblat -1Row_1visVerion*Byte oudrVai bl&Byte o]rvai7bl0Byte oudrVai bl. 1,Byte o]rvaiwbl.1"Zeichnblat -2Page-2EinfachBasicRe_chtkRectan7gl.Byte oudrVai bl.4*Byte o]rvaiwbl.40Funkti]o /Sbrune0Functi]o /sbruneKlwamer0Byte oudrVai bl.2,Byte o]rvaibl.20BracketRow_2Flus normaFlow NrmaBUmgekhrt sucwif_Klamr Revrs bac6msvPreiwIconCopT Pa g&msvStrucueTyp 4msvSDTarge_tIn eusc io 4msvSDCaloutNHi'ght(msvSDCalou]ttye2msvSDCalou]ttyen *msvSha_peCtgorisOrientaioHi_deLaruAtachToSide"Re_sizW_thTxSideLewadrBginLeadrE n(WHBoxInterUscin IsEndnteri oExtens7ioInsetSideMpont&fnMidp}ontOfse&CaloutuSyeR oCStyle1CStyle2CStyle3CStyle4CStyle5CStyle6CStyle7CStyle8CStyle9CStyle10CStyle 1CStyle12CStyle13CStyle14CStyle15CStyle16CStyle17CStyle18CStyle19CStyle20$Orient]aioR oOrientTopOrientWBotmOrient5LfOrientRghOrientAuoLeadrRotLeadrH inLewadrC7nt$LeadrMipontsuAsociaton$Design}fekt.1visUSETypemsvTheeInfomsvTheeyp(msvTheeLatinFo t(msvTheeAia_nFo t,msvTheeCoplxFnt6msvTheeLinTra sprncy,msvTheeLinPate r *msvTheeLin]Wigt.msvTheeLin_Rou dg@msvTheeCon _ectrwra sprny6msvTheeCon ectrWPatr 4msvTheeCon ectr]Wigt8msvTheeCon ectruRu di g2msvTheeCon ectrBgi .msvTheeCon ectrE d0msvTheeCon ectrE d2:msvTheeCon ectr]Bgi S z6msvTheeCon ectrE dSi z6msvTheeFil Tranprncy,msvTheeFil Patern:msvTheeSadWowr np rncy0msvTheeSad_owP tern,msvTheeSadowty l0msvTheeSadowXOfst0msvTheeSadowYOfst<msvTheeSadowM g_nifc 5to4msvTheeSadowDircton"msvTheeCol r$msvTheeEfe7ctVerbin dCo}nectr0Dynamische_r Vb7nd(Dynamic onetrTextPoWsiin6Dynamische_r Vbnd.14.Dynamic onetr146Funkti]o /Sbrune.186Functi]o /sbrune.186Funkti]o /Sbrune.196Functi]o /sbrune.196Dynamische_r Vbwnd.1.Dynamic onetr166Dynamische_r Vbnd.17.Dynamic onetr176Dynamische_r Vbnd.23.Dynamic onetr236Dynamische_r Vbnd.24.Dynamic onetr246Funkti]o /Sbrune.316Functi]o /sbrune.316Dynamische_r Vbnd.32.Dynamic onetr320Byte oudrVai bl. 3,Byte o]rvaiwbl.36Dynamische_r Vbnd.34.Dynamic onetr34 Textan}mrkug$Text AUnoainuAtribuesBpmnId"BpmnCategoris(BpmnDocueta in&BpmnArtifa]cTyeBpmnNaeBpmnStae"BpmnPruoetis,BpmnPruoetis_Nae,BpmnPruoetis_Ty.BpmnPruoetis_Va7luLBpmnPruoetis_Valu_EUxr s oBdyTBpmnPruoetis_Valu_EUxr s o]Lnga9e:BpmnPruoeti_s_Cr_ela oBpmnText$BpmnCatego_ryRf$BpmnEleetTye6BpmnConectigOb]jTye(BpmnCoditT ye4BpmnCoditExres  RBpmnCoditExres _BdyZBpmnCoditExres _Lagu;g"BpmnMe]sagRf,BpmnMe]sagR_f_Nm8BpmnMe]sagRf_PruoetiBpmnMesagRf_Proeti_5NmBpmnMesagRf_Proeti_7TyDBpmnMe]sagRf_Pruoetiw_VlubBpmnMe]sagRf_Pruoetiw_Vlu__ExrinodyjBpmnMe]sagRf_Pruoetiw_Vlu__Exr]inLn uPBpmnMe]sagRwf_roeti_uCrel o2BpmnMe]sagRf_Fro RBpmnMe]sagRf_Fro Prtic+pn.)TyeBpmnMesagRf_Froj Rl FBpmnMe]sagRwf_ro Eti'y .BpmnMe]sagRf_To NBpmnMe]sagRf_To Prtic'pn%Tye>BpmnMe]sagRf_To 5Rl BpmnMesagRf__To Eti#y  BpmnDirect o&Textan}mrkug.49*Text AUnoain.490msvWarwnOPesoal5If3hcX2G3,m2%G3T2$G3Xh2E3$h2G3To2E3m2E32#G33!G3|o03E3o43E3l;83E3|;<3E3@3(G3hch3G3Ԉ}3%G3Ԫ;3E3h3E3ĭh3G3t63E3TU3E343+G3d4(G3 .41G3_4.G34%G3hc4G3ic4G3h4E34'4G35'5G3D!5/G3P5+G3d6{5E3U5E3L65E3*G3Q>.G3<>8G3>/G34>+G3̆?.G3 '???G3<~?8G3?5G3=?9G3<$@4G3tX@0G3@2G3D=@;G3=@9G3=.A8G3dfA/G3>A:G3A2G3B/G30B2G3TbB2G3D>B=G3B7G3C%G3-C'G36'TCG37'nCG3ĈC0G3C)G3ԋC G3>D6G37D/G3>fD5G3?D5G3D?D5G3?E5G3?:E3G34mE/G3`'E6G3lE/G3D`'F6G37F/G3`'fF6G3܉F/G3`'F5G3a'G5G3Da'5G6G3kG/G3LG1G3G.G3a'G6G3/H/G3^H#G3,H%G3hHG3LjcHG3TH&G3$H)G3T&I)G3 7'OIG3<7'hIG3I$G3I.G3I-G3J1G34 '3JIG3d^|JPG3a'J9G3X7'KG3K(G3ԌGK&G3b'mK4G3K(G3K1G3^K=G3$^7LEG3|L$G3L.G3Db'L8G3 'M>G3 'DM=G3$ 'MCG3MZG3N]G3^{NJG3,N1G3^NKG3t 'AO5G3 'vO<G3dO-G3D^OGG3'&P3G3d'YP6G3,P$G3DP)G3tP+G3T_?Q2G  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~]>rFxml:spaceprsrv]rFxmlns:vdhtp/%scea .i+ro of.+o/i iA/20*c6%et/ \n]rFxmlns:v14htp/'sUcea .i-ro oUf.-o/GUf=e'v=s=]o'200'Eet1 lnU.U-t4 "H$ @Y,b'@@d$C^-@=7 AU %t4 '_d C-m7"AJ@@GdJR@T@d6RH<(H<(JEğfREfR{Pd  g"4FXo 8)hn(N1j@(Y{Õ#aPh_D~=}B<U P:]dz`S^> BvRER$l@!()0U'*~}1d50259QT/bB="jczK&D[՗Y ?t?@d}D?!@ f~%!././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/internals/frontends.rst0000644000076500000240000007403514641074756017722 0ustar00twstaff.. include:: ../global.rst.inc .. highlight:: none .. _json_output: All about JSON: How to develop frontends ======================================== Borg does not have a public API on the Python level. That does not keep you from writing :code:`import borg`, but does mean that there are no release-to-release guarantees on what you might find in that package, not even for point releases (1.1.x), and there is no documentation beyond the code and the internals documents. Borg does on the other hand provide an API on a command-line level. In other words, a frontend should (for example) create a backup archive just invoke :ref:`borg_create`, give commandline parameters/options as needed and parse JSON output from borg. Important: JSON output is expected to be UTF-8, but currently borg depends on the locale being configured for that (must be a UTF-8 locale and *not* "C" or "ascii"), so that Python will choose to encode to UTF-8. The same applies to any inputs read by borg, they are expected to be UTF-8 encoded also. We consider this a bug (see :issue:`2273`) and might fix it later, so borg will use UTF-8 independent of the locale. On POSIX systems, you can usually set environment vars to choose a UTF-8 locale: :: export LANG=en_US.UTF-8 export LC_CTYPE=en_US.UTF-8 Logging ------- Especially for graphical frontends it is important to be able to convey and reformat progress information in meaningful ways. The ``--log-json`` option turns the stderr stream of Borg into a stream of JSON lines, where each line is a JSON object. The *type* key of the object determines its other contents. .. warning:: JSON logging requires successful argument parsing. Even with ``--log-json`` specified, a parsing error will be printed in plain text, because logging set-up happens after all arguments are parsed. Since JSON can only encode text, any string representing a file system path may miss non-text parts. The following types are in use. Progress information is governed by the usual rules for progress information, it is not produced unless ``--progress`` is specified. archive_progress Output during operations creating archives (:ref:`borg_create` and :ref:`borg_recreate`). The following keys exist, each represents the current progress. original_size Original size of data processed so far (before compression and deduplication, may be empty/absent) compressed_size Compressed size (may be empty/absent) deduplicated_size Deduplicated size (may be empty/absent) nfiles Number of (regular) files processed so far (may be empty/absent) path Current path (may be empty/absent) time Unix timestamp (float) finished boolean indicating whether the operation has finished, only the last object for an *operation* can have this property set to *true*. progress_message A message-based progress information with no concrete progress information, just a message saying what is currently being worked on. operation unique, opaque integer ID of the operation :ref:`msgid ` Message ID of the operation (may be *null*) finished boolean indicating whether the operation has finished, only the last object for an *operation* can have this property set to *true*. message current progress message (may be empty/absent) time Unix timestamp (float) progress_percent Absolute progress information with defined end/total and current value. operation unique, opaque integer ID of the operation :ref:`msgid ` Message ID of the operation (may be *null*) finished boolean indicating whether the operation has finished, only the last object for an *operation* can have this property set to *true*. message A formatted progress message, this will include the percentage and perhaps other information (absent for finished == true) current Current value (always less-or-equal to *total*, absent for finished == true) info Array that describes the current item, may be *null*, contents depend on *msgid* (absent for finished == true) total Total value (absent for finished == true) time Unix timestamp (float) file_status This is only output by :ref:`borg_create` and :ref:`borg_recreate` if ``--list`` is specified. The usual rules for the file listing applies, including the ``--filter`` option. status Single-character status as for regular list output path Path of the file system object log_message Any regular log output invokes this type. Regular log options and filtering applies to these as well. time Unix timestamp (float) levelname Upper-case log level name (also called severity). Defined levels are: DEBUG, INFO, WARNING, ERROR, CRITICAL name Name of the emitting entity message Formatted log message :ref:`msgid ` Message ID, may be *null* or absent See Prompts_ for the types used by prompts. .. rubric:: Examples (reformatted, each object would be on exactly one line) .. highlight:: json :ref:`borg_extract` progress:: {"message": "100.0% Extracting: src/borgbackup.egg-info/entry_points.txt", "current": 13000228, "total": 13004993, "info": ["src/borgbackup.egg-info/entry_points.txt"], "operation": 1, "msgid": "extract", "type": "progress_percent", "finished": false} {"message": "100.0% Extracting: src/borgbackup.egg-info/SOURCES.txt", "current": 13004993, "total": 13004993, "info": ["src/borgbackup.egg-info/SOURCES.txt"], "operation": 1, "msgid": "extract", "type": "progress_percent", "finished": false} {"operation": 1, "msgid": "extract", "type": "progress_percent", "finished": true} :ref:`borg_create` file listing with progress:: {"original_size": 0, "compressed_size": 0, "deduplicated_size": 0, "nfiles": 0, "type": "archive_progress", "path": "src"} {"type": "file_status", "status": "U", "path": "src/borgbackup.egg-info/entry_points.txt"} {"type": "file_status", "status": "U", "path": "src/borgbackup.egg-info/SOURCES.txt"} {"type": "file_status", "status": "d", "path": "src/borgbackup.egg-info"} {"type": "file_status", "status": "d", "path": "src"} {"original_size": 13176040, "compressed_size": 11386863, "deduplicated_size": 503, "nfiles": 277, "type": "archive_progress", "path": ""} Internal transaction progress:: {"message": "Saving files cache", "operation": 2, "msgid": "cache.commit", "type": "progress_message", "finished": false} {"message": "Saving cache config", "operation": 2, "msgid": "cache.commit", "type": "progress_message", "finished": false} {"message": "Saving chunks cache", "operation": 2, "msgid": "cache.commit", "type": "progress_message", "finished": false} {"operation": 2, "msgid": "cache.commit", "type": "progress_message", "finished": true} A debug log message:: {"message": "35 self tests completed in 0.08 seconds", "type": "log_message", "created": 1488278449.5575905, "levelname": "DEBUG", "name": "borg.archiver"} Prompts ------- Prompts assume a JSON form as well when the ``--log-json`` option is specified. Responses are still read verbatim from *stdin*, while prompts are JSON messages printed to *stderr*, just like log messages. Prompts use the *question_prompt* and *question_prompt_retry* types for the prompt itself, and *question_invalid_answer*, *question_accepted_default*, *question_accepted_true*, *question_accepted_false* and *question_env_answer* types for information about prompt processing. The *message* property contains the same string displayed regularly in the same situation, while the *msgid* property may contain a msgid_, typically the name of the environment variable that can be used to override the prompt. It is the same for all JSON messages pertaining to the same prompt. .. rubric:: Examples (reformatted, each object would be on exactly one line) .. highlight:: none Providing an invalid answer:: {"type": "question_prompt", "msgid": "BORG_CHECK_I_KNOW_WHAT_I_AM_DOING", "message": "... Type 'YES' if you understand this and want to continue: "} incorrect answer # input on stdin {"type": "question_invalid_answer", "msgid": "BORG_CHECK_I_KNOW_WHAT_I_AM_DOING", "is_prompt": false, "message": "Invalid answer, aborting."} Providing a false (negative) answer:: {"type": "question_prompt", "msgid": "BORG_CHECK_I_KNOW_WHAT_I_AM_DOING", "message": "... Type 'YES' if you understand this and want to continue: "} NO # input on stdin {"type": "question_accepted_false", "msgid": "BORG_CHECK_I_KNOW_WHAT_I_AM_DOING", "message": "Aborting.", "is_prompt": false} Providing a true (affirmative) answer:: {"type": "question_prompt", "msgid": "BORG_CHECK_I_KNOW_WHAT_I_AM_DOING", "message": "... Type 'YES' if you understand this and want to continue: "} YES # input on stdin # no further output, just like the prompt without --log-json Passphrase prompts ------------------ Passphrase prompts should be handled differently. Use the environment variables *BORG_PASSPHRASE* and *BORG_NEW_PASSPHRASE* (see :ref:`env_vars` for reference) to pass passphrases to Borg, don't use the interactive passphrase prompts. When setting a new passphrase (:ref:`borg_init`, :ref:`borg_key_change-passphrase`) normally Borg prompts whether it should display the passphrase. This can be suppressed by setting the environment variable *BORG_DISPLAY_PASSPHRASE* to *no*. When "confronted" with an unknown repository, where the application does not know whether the repository is encrypted, the following algorithm can be followed to detect encryption: 1. Set *BORG_PASSPHRASE* to gibberish (for example a freshly generated UUID4, which cannot possibly be the passphrase) 2. Invoke ``borg list repository ...`` 3. If this fails, due the repository being encrypted and the passphrase obviously being wrong, you'll get an error with the *PassphraseWrong* msgid. The repository is encrypted, for further access the application will need the passphrase. 4. If this does not fail, then the repository is not encrypted. Standard output --------------- *stdout* is different and more command-dependent than logging. Commands like :ref:`borg_info`, :ref:`borg_create` and :ref:`borg_list` implement a ``--json`` option which turns their regular output into a single JSON object. Some commands, like :ref:`borg_list` and :ref:`borg_diff`, can produce *a lot* of JSON. Since many JSON implementations don't support a streaming mode of operation, which is pretty much required to deal with this amount of JSON, these commands implement a ``--json-lines`` option which generates output in the `JSON lines `_ format, which is simply a number of JSON objects separated by new lines. Dates are formatted according to ISO 8601 in local time. No explicit time zone is specified *at this time* (subject to change). The equivalent strftime format string is '%Y-%m-%dT%H:%M:%S.%f', e.g. ``2017-08-07T12:27:20.123456``. The root object of '--json' output will contain at least a *repository* key with an object containing: id The ID of the repository, normally 64 hex characters location Canonicalized repository path, thus this may be different from what is specified on the command line last_modified Date when the repository was last modified by the Borg client The *encryption* key, if present, contains: mode Textual encryption mode name (same as :ref:`borg_init` ``--encryption`` names) keyfile Path to the local key file used for access. Depending on *mode* this key may be absent. The *cache* key, if present, contains: path Path to the local repository cache stats Object containing cache stats: total_chunks Number of chunks total_unique_chunks Number of unique chunks total_size Total uncompressed size of all chunks multiplied with their reference counts total_csize Total compressed and encrypted size of all chunks multiplied with their reference counts unique_size Uncompressed size of all chunks unique_csize Compressed and encrypted size of all chunks .. highlight: json Example *borg info* output:: { "cache": { "path": "/home/user/.cache/borg/0cbe6166b46627fd26b97f8831e2ca97584280a46714ef84d2b668daf8271a23", "stats": { "total_chunks": 511533, "total_csize": 17948017540, "total_size": 22635749792, "total_unique_chunks": 54892, "unique_csize": 1920405405, "unique_size": 2449675468 } }, "encryption": { "mode": "repokey" }, "repository": { "id": "0cbe6166b46627fd26b97f8831e2ca97584280a46714ef84d2b668daf8271a23", "last_modified": "2017-08-07T12:27:20.789123", "location": "/home/user/testrepo" }, "security_dir": "/home/user/.config/borg/security/0cbe6166b46627fd26b97f8831e2ca97584280a46714ef84d2b668daf8271a23", "archives": [] } Archive formats +++++++++++++++ :ref:`borg_info` uses an extended format for archives, which is more expensive to retrieve, while :ref:`borg_list` uses a simpler format that is faster to retrieve. Either return archives in an array under the *archives* key, while :ref:`borg_create` returns a single archive object under the *archive* key. Both formats contain a *name* key with the archive name, the *id* key with the hexadecimal archive ID, and the *start* key with the start timestamp. *borg info* and *borg create* further have: end End timestamp duration Duration in seconds between start and end in seconds (float) stats Archive statistics (freshly calculated, this is what makes "info" more expensive) original_size Size of files and metadata before compression compressed_size Size after compression deduplicated_size Deduplicated size (against the current repository, not when the archive was created) nfiles Number of regular files in the archive limits Object describing the utilization of Borg limits max_archive_size Float between 0 and 1 describing how large this archive is relative to the maximum size allowed by Borg command_line Array of strings of the command line that created the archive The note about paths from above applies here as well. chunker_params The chunker parameters the archive has been created with. :ref:`borg_info` further has: hostname Hostname of the creating host username Name of the creating user comment Archive comment, if any Some keys/values are more expensive to compute than others (e.g. because it requires opening the archive, not just the manifest). To optimize for speed, `borg list repo` does not determine these values except when they are requested. The `--format` option is used for that (for normal mode as well as for `--json` mode), so, to have the comment included in the json output, you will need: :: borg list repo --format "{name}{comment}" --json` Example of a simple archive listing (``borg list --last 1 --json``):: { "archives": [ { "id": "80cd07219ad725b3c5f665c1dcf119435c4dee1647a560ecac30f8d40221a46a", "name": "host-system-backup-2017-02-27", "start": "2017-08-07T12:27:20.789123" } ], "encryption": { "mode": "repokey" }, "repository": { "id": "0cbe6166b46627fd26b97f8831e2ca97584280a46714ef84d2b668daf8271a23", "last_modified": "2017-08-07T12:27:20.789123", "location": "/home/user/repository" } } The same archive with more information (``borg info --last 1 --json``):: { "archives": [ { "chunker_params": [ "buzhash", 13, 23, 16, 4095 ], "command_line": [ "/home/user/.local/bin/borg", "create", "/home/user/repository", "..." ], "comment": "", "duration": 5.641542, "end": "2017-02-27T12:27:20.789123", "hostname": "host", "id": "80cd07219ad725b3c5f665c1dcf119435c4dee1647a560ecac30f8d40221a46a", "limits": { "max_archive_size": 0.0001330855110409714 }, "name": "host-system-backup-2017-02-27", "start": "2017-02-27T12:27:20.789123", "stats": { "compressed_size": 1880961894, "deduplicated_size": 2791, "nfiles": 53669, "original_size": 2400471280 }, "username": "user" } ], "cache": { "path": "/home/user/.cache/borg/0cbe6166b46627fd26b97f8831e2ca97584280a46714ef84d2b668daf8271a23", "stats": { "total_chunks": 511533, "total_csize": 17948017540, "total_size": 22635749792, "total_unique_chunks": 54892, "unique_csize": 1920405405, "unique_size": 2449675468 } }, "encryption": { "mode": "repokey" }, "repository": { "id": "0cbe6166b46627fd26b97f8831e2ca97584280a46714ef84d2b668daf8271a23", "last_modified": "2017-08-07T12:27:20.789123", "location": "/home/user/repository" } } File listings +++++++++++++ Each archive item (file, directory, ...) is described by one object in the :ref:`borg_list` output. Refer to the *borg list* documentation for the available keys and their meaning. Example (excerpt) of ``borg list --json-lines``:: {"type": "d", "mode": "drwxr-xr-x", "user": "user", "group": "user", "uid": 1000, "gid": 1000, "path": "linux", "healthy": true, "source": "", "linktarget": "", "flags": null, "mtime": "2017-02-27T12:27:20.023407", "size": 0} {"type": "d", "mode": "drwxr-xr-x", "user": "user", "group": "user", "uid": 1000, "gid": 1000, "path": "linux/baz", "healthy": true, "source": "", "linktarget": "", "flags": null, "mtime": "2017-02-27T12:27:20.585407", "size": 0} Archive Differencing ++++++++++++++++++++ Each archive difference item (file contents, user/group/mode) output by :ref:`borg_diff` is represented by an *ItemDiff* object. The propertiese of an *ItemDiff* object are: path: The filename/path of the *Item* (file, directory, symlink). changes: A list of *Change* objects describing the changes made to the item in the two archives. For example, there will be two changes if the contents of a file are changed, and its ownership are changed. The *Change* object can contain a number of properties depending on the type of change that occurred. If a 'property' is not required for the type of change, it is not output. The possible properties of a *Change* object are: type: The **type** property is always present. It identifies the type of change and will be one of these values: - *modified* - file contents changed. - *added* - the file was added. - *removed* - the file was removed. - *added directory* - the directory was added. - *removed directory* - the directory was removed. - *added link* - the symlink was added. - *removed link* - the symlink was removed. - *changed link* - the symlink target was changed. - *mode* - the file/directory/link mode was changed. Note - this could indicate a change from a file/directory/link type to a different type (file/directory/link), such as -- a file is deleted and replaced with a directory of the same name. - *owner* - user and/or group ownership changed. size: If **type** == '*added*' or '*removed*', then **size** provides the size of the added or removed file. added: If **type** == '*modified*' and chunk ids can be compared, then **added** and **removed** indicate the amount of data 'added' and 'removed'. If chunk ids can not be compared, then **added** and **removed** properties are not provided and the only information available is that the file contents were modified. removed: See **added** property. old_mode: If **type** == '*mode*', then **old_mode** and **new_mode** provide the mode and permissions changes. new_mode: See **old_mode** property. old_user: If **type** == '*owner*', then **old_user**, **new_user**, **old_group** and **new_group** provide the user and group ownership changes. old_group: See **old_user** property. new_user: See **old_user** property. new_group: See **old_user** property. Example (excerpt) of ``borg diff --json-lines``:: {"path": "file1", "changes": [{"path": "file1", "changes": [{"type": "modified", "added": 17, "removed": 5}, {"type": "mode", "old_mode": "-rw-r--r--", "new_mode": "-rwxr-xr-x"}]}]} {"path": "file2", "changes": [{"type": "modified", "added": 135, "removed": 252}]} {"path": "file4", "changes": [{"type": "added", "size": 0}]} {"path": "file3", "changes": [{"type": "removed", "size": 0}]} .. _msgid: Message IDs ----------- Message IDs are strings that essentially give a log message or operation a name, without actually using the full text, since texts change more frequently. Message IDs are unambiguous and reduce the need to parse log messages. Assigned message IDs and related error RCs (exit codes) are: .. See scripts/errorlist.py; this is slightly edited. Errors Error rc: 2 traceback: no Error: {} ErrorWithTraceback rc: 2 traceback: yes Error: {} Buffer.MemoryLimitExceeded rc: 2 traceback: no Requested buffer size {} is above the limit of {}. EfficientCollectionQueue.SizeUnderflow rc: 2 traceback: no Could not pop_front first {} elements, collection only has {} elements.. RTError rc: 2 traceback: no Runtime Error: {} CancelledByUser rc: 3 traceback: no Cancelled by user. CommandError rc: 4 traceback: no Command Error: {} PlaceholderError rc: 5 traceback: no Formatting Error: "{}".format({}): {}({}) InvalidPlaceholder rc: 6 traceback: no Invalid placeholder "{}" in string: {} Repository.AlreadyExists rc: 10 traceback: no A repository already exists at {}. Repository.AtticRepository rc: 11 traceback: no Attic repository detected. Please run "borg upgrade {}". Repository.CheckNeeded rc: 12 traceback: yes Inconsistency detected. Please run "borg check {}". Repository.DoesNotExist rc: 13 traceback: no Repository {} does not exist. Repository.InsufficientFreeSpaceError rc: 14 traceback: no Insufficient free space to complete transaction (required: {}, available: {}). Repository.InvalidRepository rc: 15 traceback: no {} is not a valid repository. Check repo config. Repository.InvalidRepositoryConfig rc: 16 traceback: no {} does not have a valid configuration. Check repo config [{}]. Repository.ObjectNotFound rc: 17 traceback: yes Object with key {} not found in repository {}. Repository.ParentPathDoesNotExist rc: 18 traceback: no The parent path of the repo directory [{}] does not exist. Repository.PathAlreadyExists rc: 19 traceback: no There is already something at {}. Repository.StorageQuotaExceeded rc: 20 traceback: no The storage quota ({}) has been exceeded ({}). Try deleting some archives. Repository.PathPermissionDenied rc: 21 traceback: no Permission denied to {}. MandatoryFeatureUnsupported rc: 25 traceback: no Unsupported repository feature(s) {}. A newer version of borg is required to access this repository. NoManifestError rc: 26 traceback: no Repository has no manifest. UnsupportedManifestError rc: 27 traceback: no Unsupported manifest envelope. A newer version is required to access this repository. Archive.AlreadyExists rc: 30 traceback: no Archive {} already exists Archive.DoesNotExist rc: 31 traceback: no Archive {} does not exist Archive.IncompatibleFilesystemEncodingError rc: 32 traceback: no Failed to encode filename "{}" into file system encoding "{}". Consider configuring the LANG environment variable. KeyfileInvalidError rc: 40 traceback: no Invalid key data for repository {} found in {}. KeyfileMismatchError rc: 41 traceback: no Mismatch between repository {} and key file {}. KeyfileNotFoundError rc: 42 traceback: no No key file for repository {} found in {}. NotABorgKeyFile rc: 43 traceback: no This file is not a borg key backup, aborting. RepoKeyNotFoundError rc: 44 traceback: no No key entry found in the config of repository {}. RepoIdMismatch rc: 45 traceback: no This key backup seems to be for a different backup repository, aborting. UnencryptedRepo rc: 46 traceback: no Key management not available for unencrypted repositories. UnknownKeyType rc: 47 traceback: no Key type {0} is unknown. UnsupportedPayloadError rc: 48 traceback: no Unsupported payload type {}. A newer version is required to access this repository. NoPassphraseFailure rc: 50 traceback: no can not acquire a passphrase: {} PasscommandFailure rc: 51 traceback: no passcommand supplied in BORG_PASSCOMMAND failed: {} PassphraseWrong rc: 52 traceback: no passphrase supplied in BORG_PASSPHRASE, by BORG_PASSCOMMAND or via BORG_PASSPHRASE_FD is incorrect. PasswordRetriesExceeded rc: 53 traceback: no exceeded the maximum password retries Cache.CacheInitAbortedError rc: 60 traceback: no Cache initialization aborted Cache.EncryptionMethodMismatch rc: 61 traceback: no Repository encryption method changed since last access, refusing to continue Cache.RepositoryAccessAborted rc: 62 traceback: no Repository access aborted Cache.RepositoryIDNotUnique rc: 63 traceback: no Cache is newer than repository - do you have multiple, independently updated repos with same ID? Cache.RepositoryReplay rc: 64 traceback: no Cache, or information obtained from the security directory is newer than repository - this is either an attack or unsafe (multiple repos with same ID) LockError rc: 70 traceback: no Failed to acquire the lock {}. LockErrorT rc: 71 traceback: yes Failed to acquire the lock {}. LockFailed rc: 72 traceback: yes Failed to create/acquire the lock {} ({}). LockTimeout rc: 73 traceback: no Failed to create/acquire the lock {} (timeout). NotLocked rc: 74 traceback: yes Failed to release the lock {} (was not locked). NotMyLock rc: 75 traceback: yes Failed to release the lock {} (was/is locked, but not by me). ConnectionClosed rc: 80 traceback: no Connection closed by remote host ConnectionClosedWithHint rc: 81 traceback: no Connection closed by remote host. {} InvalidRPCMethod rc: 82 traceback: no RPC method {} is not valid PathNotAllowed rc: 83 traceback: no Repository path not allowed: {} RemoteRepository.RPCServerOutdated rc: 84 traceback: no Borg server is too old for {}. Required version {} UnexpectedRPCDataFormatFromClient rc: 85 traceback: no Borg {}: Got unexpected RPC data format from client. UnexpectedRPCDataFormatFromServer rc: 86 traceback: no Got unexpected RPC data format from server: {} ConnectionBrokenWithHint rc: 87 traceback: no Connection to remote host is broken. {} IntegrityError rc: 90 traceback: yes Data integrity error: {} FileIntegrityError rc: 91 traceback: yes File failed integrity check: {} DecompressionError rc: 92 traceback: yes Decompression error: {} ArchiveTAMInvalid rc: 95 traceback: yes Data integrity error: {} ArchiveTAMRequiredError rc: 96 traceback: yes Archive '{}' is unauthenticated, but it is required for this repository. TAMInvalid rc: 97 traceback: yes Data integrity error: {} TAMRequiredError rc: 98 traceback: yes Manifest is unauthenticated, but it is required for this repository. TAMUnsupportedSuiteError rc: 99 traceback: yes Could not verify manifest: Unsupported suite {!r}; a newer version is needed. Warnings BorgWarning rc: 1 Warning: {} BackupWarning rc: 1 {}: {} FileChangedWarning rc: 100 {}: file changed while we backed it up IncludePatternNeverMatchedWarning rc: 101 Include pattern '{}' never matched. BackupError rc: 102 {}: backup error BackupRaceConditionError rc: 103 {}: file type or inode changed while we backed it up (race condition, skipped file) BackupOSError rc: 104 {}: {} BackupPermissionError rc: 105 {}: {} BackupIOError rc: 106 {}: {} BackupFileNotFoundError rc: 107 {}: {} Operations - cache.begin_transaction - cache.download_chunks, appears with ``borg create --no-cache-sync`` - cache.commit - cache.sync *info* is one string element, the name of the archive currently synced. - repository.compact_segments - repository.replay_segments - repository.check - check.verify_data - check.rebuild_manifest - check.rebuild_refcounts - extract *info* is one string element, the name of the path currently extracted. - extract.permissions - archive.delete - archive.calc_stats - prune - upgrade.convert_segments Prompts BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK For "Warning: Attempting to access a previously unknown unencrypted repository" BORG_RELOCATED_REPO_ACCESS_IS_OK For "Warning: The repository at location ... was previously located at ..." BORG_CHECK_I_KNOW_WHAT_I_AM_DOING For "This is a potentially dangerous function..." (check --repair) BORG_DELETE_I_KNOW_WHAT_I_AM_DOING For "You requested to completely DELETE the repository *including* all archives it contains:" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/internals/object-graph.png0000644000076500000240000116124114641074756020236 0ustar00twstaffPNG  IHDR (&[vsRGBgAMA a pHYs\F\FCAIDATx^-'p LFWLsd'7 'iתC&D ZTK$$A@ CO]]k~][׹v:Q``````````Jf```````````Y@pS;`````````(ŀPP. 0 0 0 0 0 0 0 0 0 03 (ζi 0 0 0 0 0 0 0 0 0 L7 + 0 0 0 0 0 0 0 0 0 0L 8jv 0 0 0 0 0 0 0 0 0 0P\\``````````fP,%m?|Ӏ`````````n@(W(``````````pf%§'N``````````BB 0 0 0 0 0 0 0 0 0 0 43 XJ:~ 0 0 0 0 0 0 0 0 0 00݀PP. 0 0 0 0 0 0 0 0 0 03 (JOO1 0 0 0 0 0 0 0 0 0@)rr``````````i@gtM```````````\\``````````fPW;c`````````R  2 0 0 0 0 0 0 0 0 0 00Ӏ,`)l 0 0 0 0 0 0 0 0 0 0tBB 0 0 0 0 0 0 0 0 0 0 43 (>=vj 0 0 0 0 0 0 0 0 0e```````````YR7 ``````````rr``````````i@gP"|z"\Ԏ`````````J1 + 0 0 0 0 0 0 0 0 0 0L 8o0 0 0 0 0 0 0 0 0 0  2 0 0 0 0 0 0 0 0 0 00Ӏ,DDک 0 0 0 0 0 0 0 0 0 b@(W(``````````pfKIg4``````````e```````````Y@pS;`````````(ŀPP. 0 0 0 0 0 0 0 0 0 03 (ζi 0 0 0 0 0 0 0 0 0 L7 + 0 0 0 0 0 0 0 0 0 0L 8jv 0 0 0 0 0 0 0 0 0 0P\\``````````fP,%m?|Ӏ`````````n@(W(``````````pf%§'N``````````BB 0 0 0 0 0 0 0 0 0 0 43 XJ:~ 0 0 0 0 0 0 0 0 0 00݀PP. 0 0 0 0 0 0 0 0 0 03 (JOO1 0 0 0 0 0 0 0 0 0@)rr``````````i@gtM```````````\\``````````fPW;c`````````R  2 0 0 0 0 0 0 0 0 0 00Ӏ,`)l 0 0 0 0 0 0 0 0 0 0tBB 0 0 0 0 0 0 0 0 0 0 43 (>=vj 0 0 0 0 0 0 0 0 0e```````````YR7 ``````````rr``````````i@gP"|z"\Ԏ`````````J1 + 0 0 0 0 0 0 0 0 0 0L 8o0 0 0 0 0 0 0 0 0 0  2 0 0 0 0 0 0 0 0 0 00Ӏ,DDک 0 0 0 0 0 0 0 0 0 b@(W(``````````pfKIg4``````````e```````````Y@pS;`````````(ŀPP. 0 0 0 0 0 0 0 0 0 03 (ζi 0 0 0 0 0 0 0 0 0 L7 + 0 0 0 0 0 0 0 0 0 0L 8jv 0 0 0 0 0 0 0 0 0 0P\\``````````fP,%m?|Ӏ`````````n@(W(``````````pf%§'N``````````BB 0 0 0 0 0 0 0 0 0 0 43 XJ:~ 0 0 0 0 0 0 0 0 0 00݀PP. 0 0 0 0 0 0 0 0 0 03 (JOO1 0 0 0 0 0 0 0 0 0@)rr``````````i@gtM```````````\\``````````fPW;c`````````R  2 0 0 0 0 0 0 0 0 0 00Ӏ,`)l 0 0 0 0 0 0 0 0 0 0tBB 0 0 0 0 0 0 0 0 0 0 43 (>=vj 0 0 0 0 0 0 0 0 0e```````````YR7 ``````````rr``````````i@gP"|z"\Ԏ`````````J1 + 0 0 0 0 0 0 0 0 0 0L 8o0 0 0 0 0 0 0 0 0 0  2 0 0 0 0 0 0 0 0 0 00Ӏ,DDک 0 0 0 0 0 0 0 0 0 b@(W(``````````pfKIg4``````````e```````````Y@pS;`````````(ŀPP. 0 0 0 0 0 0 0 0 0 03 (ζi 0 0 0 0 0 0 0 0 0 L7 + 0 0 0 0 0 0 0 0 0 0L 8jv 0 0 0 0 0 0 0 0 0 0P\\``````````fP,%m?|Ӏ`````````n@(W(``````````pf%§'N``````````BB 0 0 0 0 0 0 0 0 0 0 43 XJ:~ 0 0 0 0 0 0 0 0 0 00݀PP. 0 0 0 0 0 0 0 0 0 03 (JOO1 0 0 0 0 0 0 0 0 0@)rr``````````i@gtM```````````\\``````````fPW;c`````````R  2 0 0 0 0 0 0 0 0 0 00Ӏ,`)l 0 0 0 0 0 0 0 0 0 0tBB 0 0 0 0 0dӧOׯ_Q`6͛ߟwNj 0 0 0@nkV}````7|sv5```?L```4 !u{ 0 0 0 e ޽{G `X۷r=```4 ૮_ 0 0 0 0&6X1 0Pϟ z^- 0 0 0@!4Fv 0 0 0 g@(7'z ߀P{h! 0 0 0@c@(W(```` 庱 0r)j 0 0 0{m 0 0 0 0 c@(7^z c@(^z 0 0 0 k````H2 놲 0]) 0 0 0^nqk`0 0 0 0 0|za\ 0Przi\% 0 0 0PYP````` ɀP*0 ,o@(wr 0 0 0{HپY 0 0 0 0@>rq 0@9rq 0 0 0BfAa````$Bn({ 0kʩ2 0 0 e f^g 0 0 0 0ͧƅ^0-ƥ^2 0 0 ```` 庡 0r)j 0 0 0{m 0 0 0 0 c@(7^z c@(^z 0 0 0 k````H2 놲 0]) 0 0 0^nqk`0 0 0 0 0|za\ 0Przi\% 0 0 0PYP````` ɀP*0 ,o@(wr 0 0 0{HپY 0 0 0 0@>rq 0@9rq 0 0 0BfAa````$Bn({ 0kʩ2 0 0 e f^g 0 0 0 0ͧƅ^0-ƥ^2 0 0 ```` 庡 0r)j 0 0 0{m 0 0 0 0 c@(7^z c@(^z 0 0 0 k````H2 놲 0]) 0 0 0^nqk`0 0 0 0 0|za\ 0Przi\% 0 0 0PYP````` ɀP*0 ,o@(wr 0 0 0{HپY 0 0 0 0@>rq 0@9rq 0 0 0BfAa````$Bn({ 0kʩ2 0 0 e f^g 0 0 0 0ͧƅ^0-ƥ^2 0 0 ```` 庡 0r)j 0 0 0{m 0 0 0 0 c@(7^z c@(^z 0 0 0 k````H2 놲 0]) 0 0 0^nqk`0 0 0 0 0|za\ 0Przi\% 0 0 0PYP````` ɀP*0 ,o@(wr 0 0 0{HپY 0 0 0 0@>rq 0@9rq 0 0 0BfAa````$Bn({ 0kʩ2 0 0 e f^g 0 0 0 0ͧƅ^0-ƥ^2 0 0 ```` 庡 0r)j 0 0 0{m 0 0 0 0 c@(7^z c@(^z 0 0 0 k````H2 놲 0]) 0 0 0^nqk`0 0 0 0 0|za\ 0Przi\% 0 0 0PYP````` ɀP*0 ,o@(wr 0 0 0{HپY 0 0 0 0@>rq 0@9rq 0 0 0BfAa````$Bn({ 0kʩ2 0 0 e f^g 0 0 0 0ͧƅ^0-ƥ^2 0 0 ```` 庡 0r)j 0 0 0{m 0 0 0 0 c@(7^z c@(^z/_Ss޾}ǵ-ka] 0 0@Nr͂ 0 0 0 0IrmJ1 r)v_~] _s]g&]g:vlwPkf``N3 0 0 0 0@mnں9 0@]rKxaoV(ufuc2[`` 'N3 0 0 0 0@\7sm[xdR \ewfʽutرݱC՚`m 8 r" 0 0 0 0Iri:3uʭƷ~/aׯ_ L\bLXc+ 0 dIa````H2 vN7m 0P\Kl?s(ۧ8Vk`` /I75-~0 0 0 0 a@(=Y'w 0P\K7n75;WM``5  0 0 0 0 $uz hg6 ;\#Ԉ5& ``| $l|7zG}5jK \,``πPn}=7X߀P5XK3 ti 0 0P\AC[o%/zDm? 0 0 ׀Pq{g 0|{cMrզb`=z4Çӯ9=߃ߣ9c{``r6 g>m 0pTBծϮP~^`` %x)?gn~S~lHW3իWyt߿?؟xߏ?xz)3f^#=b```Bԙguf2 [Wo^€P.GK8 ``u d(i3rkjnW0"O !5{ܾkDv|Q0f{㶾; 0 0@r.ٷ}2 ^r;N``  2ճoFaXΣGÇG |u-]jjr6c%f٩kd_ }a`ՀP.ڴ]l2 {d}Bԝwug`H1 +@R1ch.fm~"P64ׯ{CG |JyQ{V( И8kW a$``r=_/ j@(\mڮ|m Fo``2@n/^P-7B}G |v&En>^[+ꤐ``R rk8aW/ԋ5\8``׀@ffL%Eo",aJ1+n; ){lgB2NRCR8׌'[`` r_{= m@(Y~yƄrq 0 0@9rr@y);ff=jsn}hrzӃz^s5Ga[9IKd`рP.9M\2 2|tö{Bלs5g`H5 I 3a^Ws,]Vbܘ>kGQͥYLMkAz 0 0rYIu0rkŕZ1\cX``׀PP.8|~bvQK!G9rߗhلmDKo``4BLf090Xr/K`` df4t]%7º[_Oۜ"PF]h:ʍtmc1wNvPnrej(Re>ttqzg`2 ˅c 0r)jZ\K7ng`#e`G?cg(wK/]؏):6Ԙ{(ѣG52%w 7%۷๙݉+ 0 0 1 ? 0m@(06k@(f```;;2Az~Agٳgo> Nglp/lor˔Pn__!qrPnfֻ1Q՝``5& ` ._SNմtBn1 0G6 Shlr䞳qr#(}}1!#rPn8n)RݱqcZ% 0 0ͷ7ƍ05 {wz\g1 0rr@W4n^5B>$o[_3uG n]1\G ~s\}Kk,S/``f@(wZxS7`Krp``\fƚzf`` d||;9׺+t68cƆ={lLi7jpPuI ~w3[4Snm4^[``g6 kl 5 X3^  0 0\\v4pPnlgj3 yoɜJKJ(7@nC(ww'Rj 0 0kek-[ l@(irՍ7uc`€@掁-lyHʝ3; nݫ.CGe9˫Pn# 0 0)r9Iq50 厫_Pq`0 0 k@(W(  b㏿. KΩ˥P/ FK>x no>1 0 0zb  0p|Bq[enks 0 0n@ 3!T:(W+O_(7@n)@ccz 0 01 {^Wz ǀPqze\U.rYŢ``\\v4:[߿xA,SiΌB>KS{4Sno+qi 0 0 L3 ;n 0%B|8F00րP.3cx=3 0 0v2w >Bk_w R aVS} +[Bo1\}%rs},G 0 0 00ƀP./cx-/ 0@ܴ:N i@(x0``5 +Bpٳg(rʍ=IB}c3::Jo``B>r[enksw|sBq 0 0@2w dX>x5Gr]3 G4Y^NaKwu3zwPnja9 0 0 0pTBծfr6 g>m[>r/ 0 0a@(W( lg2mׇܜTm5{~%l{Ϻ82 0 0כNx```9BՒKŀP.X3 0 d<"ۼ_ ExÇ< |5еnhk冫CgϞ*qPnT cǝ/{VOd``OBƃ 0kʩn@(ҍ?``rr@_x25H(C-lKoo_%{Pnߘto$``f@(٣2 rz1/By``s;2 H-w)1۵L1v̻9%u[.:NB 3ǶOosg`` \g3 b@(\,ڎX=N+b`3 +bҾM-751'ʍu0=x`i>f}Jc^Wɛ9 0 0rӟueTk=BՖ[e`k@ s@zd߿ip ҡܨ1nW95{]fr ?}A9OAܾqh2Sz3 0 0wBƅq 0kʩn@(ҍ?``rr@7[gϞ} hr i/շPnzjRy_Ρܾ@n˘zzD``(рP.%O\3r۠ϠPzf 0 0P \=R|,``̀P.󵙷믧9ż^_ͻ?Əh@(]&.``? dfA) zj0Dۘ3B]n޿j BG)7Rpٳg5 \vգPn31fǫ5C<14.S{; 0 0etoK&TޓӏPcP(}2)'B<Ѷ 0 ՀPP.C6onbo{#w0i^ڧƍ_ 6~^V2g[.Sf!V(7\ u 0 0%a=CMgmͷ7ƍj@(\m.6``3 fH5(80GpoF1kcC7>׵ l0:6IJbr} 1Z0Pnl_ kr2 0 0 2{4ٸ_D/G6Ҕ}Y>i~xrÝu۝Pg 0 0PTT25Ç3 ^zm CA47r@4ZKr>I?̵g S;w>}zˤ`ce2 0 a@(W^/}5|]ZflSڦ_zs]__:nCegvy}Ǭ,j ör7 0 00ƀ@f1Mڲ}7̜P?s 󸹟Z؏xXs>>r+𬯖C)O=t؆1˛;kr3K:˘m[n} ߼yS8g4``3 [}k0e\_oyM=εg?/5w7)~o)k6x}ǧ{,oɾ:rש+ 0 0n/Sapj nZ?)ׄ Æ>=W/n7Ǜ|m20ehȐ3 0 0}ur#l/^ Mq9LͬAqu1+$-T#4_/}ʍ0U-Γ ΡL(1$1|p丏Y|fKczǾ{i.oSkuB5CF 6VA,7!ܧO.2B7n8]]]^|yͷƚ0m 5+k C 0 0 a@(|w}B<\bڳrʍk(i,eyO[B,Ϻ鯆P9Fj|(^7'>whKеϝKm=g 1V}u_~Η}]wϟ?zϏOSիW],/ګ}'rՍ7u@mܸ::Myܼ&>Yx[J](cx_`1FAZn;<密|}5۔e|S½Krc7־fϱʭ2׉sA5al |댷cN^{SZcY3 ,i`j(W8%ZO 0 0}r˷q)۞b]kYr(;,O]i*B,foZ(5=l3^Z`cǖ5kuonݕH ~ƶ?zhr$c)|tLݧڅr8O1=1s|^ϔ@i>N߲66hNoߞ|}` YέhW``xr׳R(7\#Hе&+ȘC`yzrP. }9JvDps]ϕk͚nB k|cvJe`h)}v:`l3>x3F`R(wJ }=~(h _ɱ{u0 cڿoߞnܸx w˗/¹ di`PpnS?{``TB[ v`;evK"G?p"xvْR\xXlSn=B{|Ka cy>y}λـPp(75}3xpĔ`Ǭm MX~1ׄ)םX w]w:#;}c~<߷د#.sMu}m}2b} kr'XG= ,x 0 0Pr{یۡPn+5%XvXv1kL}1Ik:RݼmϯǬs;6u5Sd6>}t}j3<~xsrz{X++?``Bo\r}]ԙȆ]HKr/͊G ծ׵q޾&Zڶ/, /SƎPPg]OΣ2Ğ}ory/"+8@V ޺c`o@(=)ܮׄԇ!%17r HѨKx8zL(=6>5ea:c=Sf! m BzsYH5 N(7%gOyw,q=e{bϔmz3|j-x~. et]Q׭CB4=)uwvt)t8 w/_uL)ckƍھ^Y@.5ܸ7$R'QzzU(W8Sz 0 0=rf S>Hnr}Lسژh8 rlGW+PPh:RҺS:-94.^(9~N?Br#ܞ{{>N$7ԐR|(u.>HǏXW^N z/s^w^԰c#qޟu>7M?j8Tx]1,w̶vw9ϡ}BÎ}lqM2RNf) :ű>OD?ؾcՔcǥϕfS?v.^o;8=uw\3Dfan8ϹY\@y gqAO``4 [PnA,u>]z='7kl{+Ju}ȱaخ}6¢6x)9Pn`ju."~מ+ƃ.M"Бrl[w,ylKAc׺)ծq/^sPe|Wr v==7>s,cK,7/c5L C}"^J1]}&0<6Cs y_[ߘ/sҔOuU(7sJ 8ek Png \]l/c8t~is}c/  ==a.u\Yc-uιVdn֓zBsNCy})^\\㨤qd_xf`3 ^msqm?8jl}p|]Ѯ-ʍens3T=1.jσ}3GCj>[,k%}#US =]M5Rc,αW蚽?[3/5?7~f E]RsޡsEf7mFs.ˮeߌ)ǻvk#T؞"n)85]_Kc3%;fK.C?c|;S\Ck8U@}eYsŃO{]{bmZP>_n_Q-Rmz ̭ gA3.1e /߾j @.\\d``ˀPn.Ƅr锇*]T d8јj/rjfv7R;ـPQw5ӧqB®c! ۶Ln\mo7 0 0@r7:& 2^]k cߟL}!A7O$Pn׶ =Ϯ]~HT'^_(wo˗/;ys'C].q,I Nktm|9h:M 嶯9f'߇ޥP]gHct-̜3"NOC7>%L \G)rߢ}ڞ:uQ).lKv}}~]˻n*^ \8@mo7G@\e>?# 0 0 oxL(7< 2f雕*^CaC1R!C3FS .c{ej_}S=oN_.~Ǜ<9_oj\ݮ:ޏ?ݻgjk]`CSw{~^ vٿ9ӥl_H9^2Eܴ|*N9'zO5ok_Enfi~ ]ס)x}JrL@x;p ܔ@nԮ:5mh|Yhc1y)|=>/'u6/LC޳W,H^s/E(r?j{yfoc;>}ɍ?l_1z 0 0Pݏ BS@u= l=dfq`ܮ?Q;aqK_۳5cyBnׯ9E(7&'i駟:CKzBCr2 yokyG)wl68vۮ٩c^,)u,f_s`Pn̢u5kz_kSgwWƨPn13gy,B3M}NDmn15Qlno`n:,xlׯcC1a]WS(ww=nb2vk/l/}2gxQek S3mh!l~Ԁ6:.cb6ܿUo6;a`(ՀPnr')j+84JA99-5tMNcC>a:d.ZrWGۯC}a¸fPns^_|9uWeP }h썗fszhq>&un5V(ckyY{ӸiflϨ{ȧuc޵}VZ>:,};F}싱6狟C '_yc”]vor}W|celלhoW8oc</7kz )wW] 5nݺ mlG6ǣ%ok-K8;82 0 NQM t7N$b׽?yvob_Tӷ?{~=&naj 3vCYc}_dϟ;Y2#[15ؿv(7o}-8{? [wc^u:)wrSf9] qnE[)#T;';?gulfN=So:gl8>Ocݩ: @3[BMߖ<C4ڎb S;vDSPOߏ ]Oݖ׍N=g;aʗ>G A_o/<ω425)I%ݻwYܹ hߌe3{(Ww^7j 0 0pDB廝 ]Lķ47fc*5!q~8c_;d2]z~;7塱÷,?:k{N&EuV8=y_s+W{} ]?>g ;~Ύ r/֌)^/מu { MS7gJիW;zm~0YH"ngl˫cg}-б}ھE7~vi 4kP"5,X7Bf@T&7;xZj P01W꘳_l3 0 厫}M ͸7PM SC1K)X֖>cC)\O ُv hslڳTquW]kkp7)>\˥~^r  {e`ӀPn}YrL v=4/}֓0/ֳD-SE>M ؇t+3 ,ayoYr=jTBr~hf1rSÔCO_!qLlJ=מ.c;.vc; Sv؞յSnQڐ5(@nvJ2Y{N;KbOmxɔg`hR3g?XwM=˭c x )wwͦ7/f? ^ 0pn P0.M 0 0 t-ŜPnlQ]ȤIAKAvE3WϜ`vˮ奆Oؖ9zg ,y6 uCخ7.G}8uC1C3vR8/ozr~9&:%X {~-;A^ǵM;5)✷/p^3'%ij݋&H?y~W9ϱZ6}m̳:d@(wPn;cS™:s^۵1!)־u{_/hQ{6ڡ^^׫}Ek(LbyM; :ZmzR_;5TC 7qj2B}o^7r!ڔڵ{'m~!P]kS}s3 k, <|pP۷on6xm4W(WLO 0 0M 冷a!nPJyxd ƿ}(8'D:]czN(vmf1ǺYSfO/MF91[(82*BrB|糱.KnEj9&l655d;l:ۜk͠W)v^Cv/%9^Y׶=\'ȍlE;2LjA@eJOSR=v{{S7u~]_ ۟%}͹w,{u5-,y90.ӵC¸Ɲq 0 0B{Y,4Ǧrfujz>VY缷k .-sO2~Pzl -ZN6;1[(82*BˇrB|cSS|Fp)ϟ?eVϡmn_oD@.4mySž[ro)Ƽ&PnP(2@Pn=zumfꌻS)c^zm;k9ka5c9u?rt?u?uk|Y:ʀPr1?l:[O޽}9 c`P0n>=7``Hr:7'6zgt@+S] b?Rf(z:]3'K(k䩽8ᐡmjyh~cPzfr E).RHqxMO91)cxkr̟;:F4e0qы1w.)?CV5SnSد1ק}_Xn=&c]vդ}k}?_F#mMfC_nh9bpw\fe˗/of`'O:?|`]  0 0rwD(aOz: kƜ1Nyl%ePn13-q.[)Ǘ29u/cPn>0.(rCgn=KCa8m 2Fة E+9&(׷}XgxM:NsB],z΃Bc;ˈ ہ{]N k;gWH=֛}ׂQ؎'{j]ǀ[b.Kr_z՛Ihs)5 ?K}io9 ߞ! rl OW]kr3~/cx}3c|,]ƺ Cw~~TY2ZD۽ӧO;w]_'X:+lxWO`` ?8I}6eAƮXKr~ؐA{`94N.)(=alö{mͷz`@(7-j^74cvRC]CLُlCן g F@k{W1V\޶f)_kz׏Ͷ.u.u;d)׍c֕NGKr/]/ rf!NQJ/ڵI?з S/mhFǎ1}[}]K{lo/+ =4+p__XJw^|?Bf@̘.̽~˗;5`~ͷRq'뗪R\a\|) 0 0=,M}r>M =M}.#R.1;yMTĶY~\a9%y}_zo(T=t ǡ}rAX)nS^\='Y2s*mwƍ7oj@D8ݻws~g _q1{~RSl㟟)BK!qnxv K[*p7q^5͟ zƾ9pĿEmR[Xvlo{ͺPϚj06zM].Sﱟ]M{W?!s6jy_::7e;b)ǀ [:_> z>v|\ սc~֮ׄ1}4%v޽ӛ7o~w>j ]:!l?XMKr6¸Ƹ1 0 0rwT(7<5aP65͟ڏ9a9sBKl˜wϥ{b]M!5(y8<٧8=_z7ft 5y:P+DL-V{=5rYϏce1{ofl.zm2۷oO?).4kwLX>}F<ƝcMǚǡzضiBƛl@(׸f4kt}n_^-GW  2P?Ǘy]*z@.[IB׃K3txSꤎP0nFSx 0 0[ʭZ\7m)]2){լ{K~Y6mʶ_ˊ}e}O p-wήz\%%L]jϢMϻ[14Dlӹźc:-}/*^_(w%Du_T+6ף,ΜkTλ?]2 d}׌cC]Gi}3kăxp<slc+~iv(Wױ|mg```MB|˲bZ _}=ݾPqvG3`MffIc>BB l/f&60 w̍k׾5ڵ?sdM'YoE41;t,s,aWP0n}'e5?7 0 0p\Bqw 0@rq7e3WkY,l֔Q@;[3^o^| d4h{/'? DlNmx4?G3Byo5Kn+>|xzr``ҀPн Y~10 {>O\sh[~|gDmm;9+z_DO45wز 6u83|k*;eѣG'1%wk?7͏ 0 0@rٿ}2 Z,\[Bָ۶p*fٌg|1 x,G@1zflrͺ@6`E>`Y?rǟYrqzko  0 07 {z g@(7'z\Fs7je` dȬ}d(oxS}>LrŋB<Y|``ס 0\F=#mBL8.0 0 k(8wG H(wlW.͔7Kr 1 0 0p|Bq 0@~rq'e4wQ`ـ@NAKrcFFhqƌ?K-{_;{ާmL O(wcP/^/``883` B8ң 2I$ 0 0\\ 6t(7?̝ʍeLXvŋCb!xm߾s,ܷ?S%j?崃ұ:/*5흺x_]د^zչPg:_7S!9u^' 0 0 00ǀP.?sx/? 0@\c``\fƚzf`` d4HzPng_tl "؄;f߽oMt:}5OY^{W>E35AnL9/]Sk?T:v)/,lS7{f|Bs)μ``r5 f6m 0pdBٯmǯP>u]``R  2PBcCѡzƺf(7f\}BC:}j(7sAؔ5]}:wM}XGك#p<(y5:c`` G# b@(R,ۏ, nWk՚```̂c1x}yC\ ̩c£CM ^ {:RBrb{ifۗ]J(7j227?CzUr0R(7%ۄ;驞2 0 0}Ͽ3e-ƫi@(5}Y6_ 0 0<BB l`PnhR4<:ilw~):&L}afա_c<{) Rg rbbYg/ohFKXZqi^3Cԏ``2 WU_`} [r=[- 0 b@ @f-g{Pn_ 2C}ͤ k~7M /ڧx&C5±mX":(x|)7Ks{ިag~~``g@(w\R/`B8N  0 0\\ 6d(7¤]@mL}վx}_7fY;F#©sfnF(wͶsfcfH{7z 0 0@^r 0@r[mKo 0 00΀@fLa`(^Kr|3vPd:g[ ""rcqPnW`xjkSקS[u e``n@(׸0.`7 |M9U 2^q8 0 ـPP.X*q).>=?ΙwPhW5j5CeP;ԯ^]>LݾKܔٙk1 0 0rkŕZ1 e%Պױe`` _2 |Vʍ\O_x:c}F(wJ 76z[~׬c ƿOS؛N9v2 0 0r``yBהS5-݀P.3 0  2Pj/w}?i ÷ jWxvNm((F(wjxćҡk1K]{d```@(#82 2{4wB8``>2 |/]nt dz OY l:rcLSC} ln```irՍ7ucd@(efg`΀PP.X#ߏRv=c}onسP](7}[^ 0 0 0\pg1@r/ݸ[޸P5TM``2 9"\T-VzjT oCG(t-jٞx(W߾~tѣUө``g@(w\R/`B8N  0 0\\ 60'ۄ0cVׯ_ 6CSsg-yܮzvjɉG'z7 0 0 ۀPg 0|8u,w] Φz ƿ N yy"JkL<1 0 04 {̾o m@(7?\.stid`0 +@A+;M=@O {vZZޘiccg o_z}^s 0 0 \6 k# 0]ir/ݸc`l@ @ae9rf ~oax084ܰgɡܵCcz>OcoQ``ÀPn}6րP[K0 q  0 0P\\ 6C(ѣG³Csؘ{=K>x`wzf{1 0 0r``yBהS5-݀P.3 0 d<2L۾́5P;C1>2±(ZPe[1p~i̺v:# 0 0uʭƳ>3ݶ|w r9.}`J5 +b&ט5BAd^z5㽩B]AϘE7u__׷ׯ_.on3rcjRwc%Sx=sXA```BƂ 0kʩn@(ҍ?``27dm_`v2c)3r ;uߍܚDR#Pn_DŽv8*OSk"ԛ:P2Ǜ>g``>Bl8>0 ,o@(wretq`8\\667 iׁ/ȔO.֮0r /CaϘ1o1 {ʍvmӥg}kϗۧ:'q 0 0 08Bŗz1 $ʼnprn@(``| dn4 [Pn3£@/~G}Mmwn3PyM7?4cmi_ћXN'-xwcqn 0 0e6y€P.g[8 OS?``  2ZCMr(`{L1 aC_>jl06jtbb{z6OCNfS?``΀PvZ`z kZ2 R,%```y2!^jD(7f(M`cL)˟AulXFJsÞ9rccf15M5Z_ͶŲRS:``o@(w|8S3`!B {Frp\``׀PP. ulF+\0exϜ5Sӱ1nE7m>iײ=a```}Bטc5f3 [_ύs=k@(!```=2a^jÇ j_@2B]1ٳS~#?sc֛f"$ۆISS7zYK//Ŭ}Z.Qǔ~5!؎ؿئnN{>>3 0 0f@(7N< 0B⵼\ ``5 +"XF !s :{a``XڀP.SK<`5\8``\fƚzf`` dn{;9ֺkܘQoѮYr#٦m3 0 0ʭƵ^3ݮ\u)rY.Ų``J4 +Ff}Yoȶ=Knx߿/QJ<''2 0 0 0s 24א3 ݀Pqa\00րP.3cx=3 0 0v2@jW< v͒? n+B}Z3 0 02 {~_ ÀP1d==>~2 0 0@/7޿ nDիW/B={nj~}ܿz 0 0 0 a@(X0`7 |M9U r3NAY``Zxb```` 2)c8]5= ql_^o,0 0 `@(W"```` )^Mq1 f@(LڞM޻w/E?ut阓1G`q9f````$BnY^ 0)r9Iq5xqցܸnr]g&]g:91 0@i9f````$Bnv090X׳ ƶ{N(ufuϱ?_ 0 pD```` puSZ`efg& |ݻwrrub`j6tw````0 k, 0]) 0 0 0^r͂ 0 0 0 0IrF%do``@ڊb````\¸`XހP5TM```2 k````H2 F^7=(ـP.%o|3 0 0@mnV@ 0 0 0 0rp`€P.g[8```m ```` )wn3 0Pܺm|7 0 0 0P@```` ŀP.')N``qK```r6 k````H2 fw7m 0pTBծf`` g0 0 0 0 0P. 0]) 0 0 0^r͂ 0 0 0 0IrF%do``@ڊb````\¸`XހP5TM```2 k````H2 F^7=(ـP.%o|3 0 0@mnV@ 0 0 0 0rp`€P.g[8```m ```` )wn3 0Pܺm|7 0 0 0P@```` ŀP.')N``qK```r6 k````H2 fw7m 0pTBծf`` g0 0 0 0 0P. 0]) 0 0 0^r͂ 0 0 0 0IrF%do``@ڊb````\¸`XހP5TM```2 k````H2 F^7=(ـP.%o|3 0 0@mnV@ 0 0 0 0rp`€P.g[8```m ```` )wn3 0Pܺm|7 0 0 0P@```` ŀP.')N``qK```r6 k````H2 fw7m 0pTBծf`` g0 0 0 0 0P. 0]) 0 0 0^r͂ 0 0 0 0IrF%do``@ڊb````ŻwN_Ǐ_~ָOo߾~MO 1>}Bz+s)= 0 0 j@(6_ 0 0 0 0@>rq͛sΩgoݺuoO?I=pӧO/_?}=F_#P?ݻwu7n޽{zI}:~ wS?O```r  2 0 0 0 0@(۷{}=|P/c/roF5}uueLPK~S߃cr/K```.HD 0 0 0 0 0 {<1YqSC1Kg8o~5^k3Ck,G_kqS(8J' 0 0 0PL o`=0_```` GBr!%}ˈo&}/_"$doce}w|Ǭ7o\ׯ_;r}_jN```R fLJ#ƀg```XۀPqK6ϗu-Ν+?}t޸qCsϫ5]}>Ϋ 0 0 0ܝn8(1 0 0 0 =krF0ӧO~_駟Vk8߾}5K|5#r}Bԝwug``XÀP7he:00 0 0 0 le@(7k[7w9}Eo{̯_$ǏuFz@n5;}ݠS>r|WW```NBހ1  0 0 0 0ܼ}Fn_cɓ'B~+c7V%|vջw}c}מ|ÅrMe``` OBX?O/ 0 0 0 08B굵~웿>|ip/_ܧO}zuj_O_```: fx`s0껾3 0 0 0@r5]aB~+gYr|󍾮/_כ7obԶ}B~f 0 0 7 M58TC5d```2 W?GcgGh4£>?~[_/+o1 0 0]U_e```1 O݇ϻ…6޽{{_o޼)3cˏ١c Տ9^d``]AeP1 0 0 0 j@(7O>=6|"}xco޼C>K}]s?r|WW```NBt1 0 0 0 0pByZYjso}Vo}}QQGǏg^lPn1 0 0]&)TOd```2 W?q֭,B~›w^}{Օf|H(w1x 0 0 0{````fc ײ>0v\```rr````` @a2 \~3zzz 0 0 0@nCR7````5pƍ,dw^}}䉐_ 3rz' 0 0 0  0 0 0 0 ;wo~ZoAG7},ǏeǸz' 0 0 0n0 0 0 0 06?! ׮]͛7`__|{O? W\````1f. 0 0 0 0 0 O }v޸qC_o{_#;]z 0 0 0av7]`````)fsVǏ `֭[J_ 3 0 0 0zl_U[e````ތ?e]K}]ӧOwW_Wc@5US```#u````8ׯ_޽k~+sd˗/n>E;|m^Ϧڪ- 0 0 0 پR8TC5d````@;{ƍ}p۷oVϼlf]]kׯ_]qZw 2 0 0 j@( ````` ¸?ӧO_gݵk6`a7Kٮk;wucB̖{M~osWq) !7 0 0 0  0 0 0 0 0Ka?f!EMq7_~,p}֭S6lLog/Ջ```R ٞ&z 0 0 0 0@RøsמUUps{o[-竏kz)n!e```.BB 0 0 0 0 0@fqoi=Dxj7nD^uU8wާk```cp=б~ 0 0 0 0qϷɓ'ܹsޒlY˗/۷ug1m ߼y }cO8wܘt S/```87 6Ҁd````%ø޼ysܠOe5o߾=ݽ{wv_ÇO>} D޽{?pnqW```8 n44_ 0 0 0 0KX+{}_|9ş΍;#$87ܷT,c/fWo&sf=X}P0'͎{il P_```ӀPP. 0 0 0 0 0-¸]7c?>ݹs7w֭F1 0 0 077_````4Woc{u/;6_C!X]s|}v .;Vԓ``` r3,k`~2 0 0 0e-WYyuu53wޣ¹\:c``݀PP. 0 0 0 0 0a\ zH VsYʚ 0 0 0pntͷR 0 0 0 0 c@w^WZqLs# 0 0 0  2 0 0 0 0 = x岸g\g1 0 0 `nL 0 0 0 0>q;uer!A```=  2 0 0 0 0 㺱Ǎu 岙d粸3``` nOٞKm  0 0 0 0ݾ朏Pz~sׯ1j 0 0 0rr`````D¸`!Biui: n_s՜``` ٞxPZ3 0 0 0 f@LmP.CFp.{~```0 + 0 0 0 0 uc~[,S(--\Vpd1 0 0 bv\`````a\7s?u;rjg 2=e````In{ 0 0 0 0 ¸n/y~e 岼9ew````on{ 0 0 0 0u~K_(Mm<\6g}1 0 0 ,aK2 F````i@}3ކ&;\#Q#cx'```0 k````΀0?$e4¹Lf0 0 0 i Y_```` ŀ0.')NJxP.%8\Kmf``0 k````(ހ0n7=HPnz:fs7M```J7Ph````7 k|:>rٯžp.X3 0 00 k````(΀01nP{^r׫-yV87Ͼ/ 0 0 0Pn@ 0 0 0 0qBBcA8Zo```< ````o@7n|za\ }λ3 0 0 n7kowc```ـ0.5BƆ\cX`````KBfAa````u#}G\P1rDknp1/```1p 0 0 0 0@qq?BW=έƵ^3 0 0 a@(,( 0 0 0 0 0a\7~u 3GŶ #[8``` dP깞3 0 0 0 4qYppn=6```ˀPYP``````a\7=ˀPn^0>pn}=7```L~@@ 0 0 0 m@_(77uF8~ 0 0 0 ) 0 0 0 0 㺹CrS_sq 0 0 0@FlN( 0 0 0 0a@ǂc=F$[_ύs=g``2 k````4 [׍c o8,¹e_```^7= 0 0 0 00.4 {̾oM8z 0 0 m@(,( 0 0 0 0 07¸ev c㸬 OS?```z x  0 0 0 0 ˀ0n7=((Be¹ڸk```Lx 0 0 0 0ׄq˼~}ʭ}-ƣ>2 0 0````*6 [MaPn}6pn=6``(ˀ.?p1 0 0 0 00ƀ0./cxgƙ]2 ˇc 0 0 01  2 0 0 0 0Pacܸu]eh!Ӑpn}1^```1KE\ |```׀0n7Pn}7pn=6``8\\```` 6 {nRrYZʒmI87? 0 0 g h=s```h xPܺozn9 0 0 0\\```` 2 X7ekBmm0'G}```5KA\ z= 0 0 0 28\6 [wg``3 + 0 0 0 0 wsՍmـP.9mݮ\5 0 0 0@\ b```׀0n7>ŀP.')N'¹ڸk````_BB 0 0 0 0 Ȁ07TVe(VmVs7 0 0 g=p1@z 0 0 0 0e1ryk"[_ύs=g``1 + 0 0 0 0@qQꆴ:f@(L۟uL SW^Օ``׀.?p10z 0 0 0 0 ˀs 3ǏG8z 0 0 c@(W(```` s# fùP.󵙷˘]<# 0 0 0P\2zb ;^````@4 Ӓ,>O¹8s````BB 0 0 0 0 h@wn#5 kL ,a@8%YG 0 0 0P\v|R4 0 0 0 Հ01aL0\eέƹ3 0 0  2 0 0 0 0ai72V7W/ԋ4¹iuI```z xށz 0 0 0¸ 80\޶f]yέƹ3 0 0irr````Xр0nڍJ7tՉe .[O>Փn¹Ɔ 0 0 0W6````^¸޸ rCPCzzm\5 0 0 0pـPP. 0 0 0 0 uSMir0 amC}sq 0 0 0_ x`````z {^s4 e.mS=.sq 0 0 0P 2 0 0 0 0bqtvә rKTKzn9 0 0 n`;0 0 0 0uƭƷ~̀P.G3k{6+[v_e``4 kV````Fu f`@(#89έƹ3 0 0@m¹8s``8\30 0 0 0 m@ڣܬ.i@(%=YOe3WM``5P녭z 0 0 0¸ 80P\ko/[_ύs=g``\  ````(¸nz3v\޶f]b@8\,``@Q\@= 0 0 0 285j6 ; 0 0 k@(L8 0 0 0 06 F7x՟< E_րp[```ӵC?p@```׀0n7aB5Hǀpn=6``6 k&````CuSu rzӭ 29c``  s=g```ƀ0.  0n@(7V\έƹ3 0 0Vr̈́ 0 0 0 0a\7KYj=d@(<2 Z,-``50녩z 0 0 0¸ 80tBkǝ1Pzn9 0 0 e@(L8 0 0 0 0Yu3tVMryɻ}})¹,-erXb``^Y=p^z 0 0 0 0 ˀ ,g@(wZr g@8z 0 0K5 0 0 0 0q\frΝ_CՐ``j3ڊm`````?  g@(wr g@8z 0 0S  `````S¸nfN}0n@(7V\ e%Պױ 0 0@6}Z^````@΀PvZπpn}=7``R  `````U¸nVެ:VX΀PrR-`πp. 0 0 0@\```׀0n7 @ǀpn=6``  `````Q¸nJݔ{FX߀P5X`m@8 ````.@ 0 0 0 k@z@~rq' c@8^z 0 0mBfa```e@MG7` ?B83 [_ύs=g``Y\```׀0n7 #Hǀpn=6``r̈́ 0 0 0 00ʀ0n,3@rqG g@8z 0 0@}F=p> z 0 0 0 0ec@(82 s\``ǀPp````.ƭfz@9rq k@8z 0 0@}z0n~Pna)N #H``(߀nn1 0 0 0-fz@4[Yr4آ e@8~ 0 0 xVC7XO````I¸<-ɲxb`G-,0.՝f``yrr````Z?>G$;Qn2 a\i1E_(@{-gܕ?X``z T z3 0 0 x{ڵSLx4¸ ͬe4ϖkܴ>N 0¹Eׯ޽{w\}..``1 k6$```@<ʽyaf]憘y\7& =_k}aXoUԌ``{v&f```3xp<=l¸XRK@%}>Foޣf 0 0 0\h 0 0 0 0Px`{7rq\ㆠer@r-,y18R8|ϟ 溷Qս}v0 0pb```1jہcf\nB w3,=fKr-,:f1@mϒ\]~ݻl錙:ƌ>3 0 0@j 0 0 0u/{SNaܺiϺc /9͖kܼl[57Knswݯu80 0 0\!1 0 0 0@"h{ϖ+ 4780lfy-7Kuծ_d7 0 0{(۞ŵn```< ă١@n~rqa h r͒kl86l lo p,{ϟ?c9``v3ۊ]0oj 0 0 0Px r\a\cƱhg`g5Kqf 0P=ù)6tׯ_?{N0WC``] Ғ/F훛- 0 0 0 c 15gdžq 0p{Ζk\cc6r>玙%})>GLj; 0 0@r````H6Ď 5[05߀30^%w^߸W?V1_]]] Q/( 0 ـP" 0 0 0 0Px;%Yj\a\7|ж@-,y85ùSf=|`{E8v,c` 8u 0 0 0SK̖+Fc73 g`r͒^/e Ν:Kns]wӻws(G泒`nɧ ```(@KTCj3 0 0p\E=tN```0Z@rq]¯ep l5[Yr9t,b207;w«+\_H````d 7q```.Krc9C  le`r͒V520%,ׇϟ?````uEu] 0 0 0{Kr/͖+^έ=6lfɭۗ3Ƅs%~ݻwB2 0 0 j`Յ}fn0 0 0 0@uPl¸90{Xs\䲽m揁 sט%V})>O˜~7 0 0r````j0]}7onݺk y`kܺo 0%qʗ/9̺ 0 oI ```8\C[ˍI=bZ L-,G-~@r%#d;vf5&ksalf=F5}b 9Ns]xS| 0 02 ぱ uT#Yh>D.8rmc 0 0>}t/m}>g}f5& 17[Yr9kya5 aë+tLr$W 0 0@ye.``IG޽{ >``z m<5[%k-'ck\25ǔK8,xd,˸b``\z=ݻwn{ō='02 liov9n^+[.h% ` Gf\S_@l8e``  1@qB;~zy00 0x[h^rcܪ= 0W%0>`\ u1&]\i;m``4P\<鋾li/{uuF=``L |t֭rfuu 4% ` G% 5O'" 0 0#3}i;h&#H`XǏOPݻ~ƃy^8L;Z}~XzhyooI>J?c1˨k:ksK;ڟk>mCYm 0tBN`8B?| 03ws>z m>G/ٻ3>f0f_|]4Հr0o posGO8N`8B>leb9w~Ԁ@0uq{oB@rykǒ㗚3@͛7~ ;s{```Ņ@Y z$W`sx`=wY# 00̀P zP]fsgct-¸BװJO8:qg 0 ˀPYR`8B r_ 0 3~ 02yP]f_ݦ[{v [f_vd}10πkyO```@qa{ cX`ӀƃݿkV,1 N]̾b`:ŗz1 0XBfIe 0a0 ـٯmBeZ̾rܱ|`@(Lak $nI\\g3 0@ Xdd3mͷz3 04?a@(LTWm}e8rӫ15l}ck``uq 0 m@(, 0Pܲ?/ 051aL0r2du S׽-{~gθz^ 0 00@qaz STO`7a|0r2du S׽-{~gθz^ 0 00րPYR`8B> ~z=3 0G6&Gk-ŀPn=.w5-ӹk2Z1>[:<پ 0x96 lk@(wz 0 k}Ͽ3@-Ӂeq[_8j̸r [f_Z߀k{` 0e5K* g@(.'& 0_ xiL 0{8̾a2Ya`Buoaޮ+p3^| 0 5P\olޠa<B8S` xi| 0{8̾a2Ya`Buoaޮ+p3^| 0 5 kT(΀Pñ^  0 xv~K1 [ek)g rt̾pLd%y/<3 h0^EM?ݶ|7 0@s 0rtAu}uWc@(83\Ö17Zgz 0@r͒-ˉ2 0Wh o@(w1<.kXLVXǀP:u۫k2+犁q\댫_ 0c (πPny=5N`~h o@(w1<.kXLVXǀP:u۫k2+犁q\댫_ 0c %3 p쇡3 0pdh{dR iك2Zq~Y2-5#%psI 09(.cmr7 0<ܷ? 2xP]f_=Nƌ+װeue ٿƁ0 0P\2@qrrb 0 ՀƄ1ݿkV,1 N]̾b`:ŗz1 0XŅ 3 [^OS=e`߀ƇݿkV,1 N]̾b`:ŗz1 0XBfIe 0a0 ـٯmBeZ̾rܱ|`@(Lak $nI\\g3 0@ Xdd3mͷz3 04?a@(LTWm}e8rӫ15l}ck``uq 0 m@(, 0Pܲ?/ 051aL0r2du S׽-{~gθz^ 0 00@qaz STO`7a|0r2du S׽-{~gθz^ 0 00րPYR`8B> ~z=3 0G6&Gk-ŀPn=.w5-ӹk2Z1>[:<پ;uO;{16F10|nπP|mKc2뚓1uۈ#m 0S ƛޫ31P2?ƭ&k`Lh2ݾKeu +>1 Ln̺nb ̀NZ{`` ՀPUR`8G ?56߽{m}l+BVr>7|ôkbqϑH^+8Ӿ 00ĀPnNLTY!}kԞ< Q1luۉ㄁e ,۾j_`<>a !_߬ZMV0k[m[nL~}c"Z}0le@(ŀPnMTY\/  Y=Z,ـGgX@qa56tN6pPn V!9V2:綦|VʥV oSޛc(79l Vm0vޗuD}goLh27 Duu-X-ՀPnaˬk!ku.նb` BVIe 1 {nd|N=N.؏~~BUcͭ&987 lkϿg0 [ey[]؏*_ÖY^0پ0 0Px V}w#r}J䐶{M3N\}}nɱb5B+ڴ_l0K允e .Ӯ[{5Q]f]ve\10܀Pړ+c2'AN_ 0 ,k@(* 0P#rcEfx?3is _s.{#$l|1ofq``iBe3Q]f]>|nπP|mKc2뚓1uۈ#m 0S ƛޫ31P#rcҹWoX}P!~eKB˶e`&4ig3 3 [e\]؏*_ÖY^0پ0 0P V:UٝJ}QCZn5ma\Wu^e)B˶}gLhGڈ6 [1eu熁 ז94-9/1oX8F 0 00ŀPP. gਡܸ4sUq~OoĿvo\i^㏃>~8}jb_cǶi6>?vSBq vm==mۈok:FJ>;sƾnH(7ک~͚꾇f;p8N6)>6yUw/>Ѷz4V3s\}dh=|2!5hO+b\BeDuuu.VWc@(w?JWưe5ŀ2u~ 0 m0eU_bȡfh6BsCڬz2U(pj(7 A ;*p3==#lط>kǴmm# A 6X%> }6C\D}WuϘ!fyh pG : iF{3[1!-ロstWK7f_\&4U/K(ӀPnu5Q]f]ՕOR1luM1 0ck 0eʵJ* gȡW6ClF:Ɔr3mܮZs?$mnl۶q.۶h&r#:$֩u>mRڠ%nJrǴi{=\=CPtD?JͶZ⪫ߎD Fͪ:U_ 12'A ͼ0 [fMTYWeue`?rS~e [f]S x- loXgj 0@ [6XU!ʍ0g= li3V_sL(7€@Z{?m+6WuJmy6U1hgEuU[}~ۂǪ8cWm[6‚mv&,?K rSp乕mj]h0gʱ~ڶm+,Zկ}bno5!׆x}\(7j:% m/} JR+5 [fmMTYWbue`?rS~e [f]S x- loXgj 0@r8z(| r6/Vfm߻Šmyv*h{w׃q] o F"vcsέW˪vU\(-lzaf[wm'>\ȶmEӔX gՏGڬ3lm4OmVԡ+8vG[{un>RùmW^|vKIi3`Є>?e-&ˬ2BUJ2-)7`} 5``lŅ-Gփg\Mcus즆rl[oSZuxM3ض*lڂնlE/B}!3a!6%e*޵C pm}_ۂ] o[vHy9)9>RH[iad{~&4S+J(׀Pn5Q]f]ՕOR1luM1 0ck 0e(.l`W}=}\m-`lf-ț~m~ސP`OmS(;wl)16src{P_;TbnaPnj{ޮǬPi  W~|u);yyvYޣܶ 0rt`̺:o+1 Z+c2bk``{:@?P`6 kT(΀P/\۹Gk[X.% .LKٯ9nlRB:,c-5(d2%>kCM ={[[ۧ|!?)Fh фf^?ԃc-&ˬ2BUJ2-)7`} 5``lŅ-Bvjseڮ YJujx3)5PkRB@_L{>)ϭ^)u?,]1Im꘦}]S\7;M~/'T+=hm9̄f^?ԃc-&ˬ2BUJ2-)7`} 5``lBVIe rj#vao^߶.%pvR%SkM#g3K }nl/#jv,D(7/Bm\y誯C8 sw_RcSDW[kr- D[t{s#c~m#c{̻>0p BeDuuu^VWc@(w?JWưe5ŀ2u~ 0 m0eU_b@('`ph03%p ;Vcynٔ:g(yf޵ps!ZF{SeʍnxLٿPn}{ 湩a">5ڷ#SEkIm+˄f5ҏԈ Yce9Y]؏*_ÖY^0پ0 0P\2@qrp5*>n͠[[E8K [ (ESbαmef;T8V ePnrUm))xϹUdCpWj_j;Gƶ}W(w)#c{3w}arˬ2꼬 ǀP~jүaˬke l_@ `(ۀPUR`8B_^/e34~K 5×["ed6;)f;DPnϞ[ڇLk3`;d%)cYKmS WX1w>262ox;&4U/K(ӀPnu5Q]f]ՕOR1luM1 0ck 0e(.l`W}Uk-#Yrj}ϭZ\wN9%l@nl7%8&Y?f-rc;C?j(7VvmnkHwJm/'ͺ²}!!mzPn|n< YŹ#c~m#}mweBs5Ԍ W&ˬs2BUJ2-)7`} 5``lBVIe  Ŋc)Xٲs㑲_o<4^N.cy4Wjmt;S\/ʭcjs~^Jz]H)@hB3Gj@rˬ2Ꜭ ǀP~jүaˬke l_@ `(@qa<`;ĀPƬ8Uwܥa"eꆚ!ġ^l0jgoaPnFCalm+:$dҬGs^͡:uc,ҡ)ֺi>2}^PK^.~V k@(ښ.~ V)̺Zހ5Ԁ` Z%3 ~jjlE?5p;Vܔm3=4FoPt3+sPԕmLP!}ڏY{CGSi^_;Sضo #)vAN m@(.~ V)̺Zހ5Ԁ` l꫾C ;iV-mf܆1^F }o,-,~`i?m 6q]!+7mhmo>5)w`ܔ}j iժFa\xl0tPn48ؗ+wZm>ad9seBs?үԊr Y[eչX]؏*_ÖY^0پ0 0P\2@qr/\m?^M Y[2B]؟U蝻!i;6p7|iJیP\s{ڎ%ڰ/ Wfǿx: ͶcBU{Kl F]_a3̍mtr;&lz-J+t]u gV{*;&~]睶jF]Ȑ5W/bLBeDuuuVWc@(w?JWưe5ŀ2u~ 0 m0eU_b@(I3ڷjΚ+^Cp^'-ʍl;l JY_g_(wwm޷mgq=[}~k;޶n[(U=gVy xW}O=4תxne!ׅ>>2ٵKIi3ǽ }IR'6 [f}MTYWcue`?rS~e [f]S x- loXgj 0@rp V ]zص 6VW[iʬ}`xcWp8jٔPt6)_h[-]+vV3r F; 9|F[t\gl?̤IDATd;dybJ@~H(e>2)#C34ZWj@rˬ2\ ǀP~jүaˬke l_@ `(@qa<`;B!mS7VJm!ٝ V+1ۈvMsuss۶*lW=m^}Uf9뫬~~ [ɳ o{=#@^w??D;vs͐ϊ2۶>7փx݇^ڧ%ض?^K~[&4W3L(πPny5~j̺:+1 Z+c2bk``{:@?P`6 kT(B9%[GXp{sX2>#ld9ψ [|nl#eVڱ<}Sj%zvݘϏϊE2;՞cJk]ՖUͦ~ސo&14:xR}$FRy Mh]G}82l̺:/+1 Z+c2bk``{:@?P`6P\ز1pP` ,2BSj2Q]f]Sx= lg@(w_ҽ1lu]Ҍf ߦjS`ʵJ* g@(ׅ 0G2`B#ywj@(L&ˬk6 [f0-a ^z1 0?Ņ B5S 25) 0@LhOQ iDuu=yq[2ÖY9#0H+ 0[ʵJ* g@(u mr 0mevcBeeչK]؏*_ÖY^0پ0 0Px V}w\N8N`J1`BR,;l@(L&ˬ5ɣ-Ӽ1lu=rw: ݰg` wBVIe ~2 i&OszY<10΀Pvݛ2뚻;-?ÖYW.ue`_uU/K`؟xr۔c` g&4٧}(r˴n̺8-Pnaˬk  ~$w`- Z%3 낺6cʀ Mg122ܥ ǀP~jүaˬke l_@ `(@qa<`;ĀP.'Cx ' 00r){6 [_eu i̺x9޻cn3 0\2@qr]|s?F`4`B9=,g@(w\Duuݝ㎁_ aˬs2/:^ 0 @qa<PlnBLm1 0|ӾyBeZ7Q]f]r^r`@(Lưeֵsc`Hux?w; 0ruAj1 le&{[ٳ]ŀPnDuuuRWc@(w?JWưe5ŀ2u~ 0 m0eU_b@(!N`R dˎ=-ӯ2s}ghr4o [f]v~r݀{7lf݀PUR`8B._| 0s0Ӝ|O 3 ;rf̺q/rưeչK]ؗc}KR/`g0Cfj6\6bـ M>si<2.G9/9N~K0 [cc2Z91y$:ɻc`` BVIe 庠nqAM`2`B.{ b@(`̺:w+1 Z+c2bk``{:@?P`6P\ز1 '^  0@)Lh\e Duuƾ3y4Be7-G;?9^nX 3 n@(* 0P\/Q`9 iNO>'n{3Q]f]swgcBec2ܥ ˀξ 03P\!T35ۀP.SsyL1 l&9l۷~{ݻwzj 2Z97k\oK)[f͍aˬkhcX^Kmv 05u"k?XdXÀ Mp66",T72&-bL*[Duu㚖gy77cG(LưeuL=ưnt=ŏ 0@"&>HɀP.GXyg0^Mh?+ L(s2뺗f~rs6vYBe̺x~6eD1]o7 0@&M8pAGb\&`8zyꧢNӄ7|c^!Y xm6Qn]߽{kl=Yss Frٗ5߶;W.׶[5]q=Ʈ?㺻=lv}{pQ>]e2 0@f  z3 ݀ u@[Ф <_&4觾O%r˴cz5G9ǒKZTL2î[ׯ[[nv]CuXgvQ;2 0@\+0@qr]0 0p$&4?Nh* Xո&Or˴cz5567<\B]/Ҝr,2îW׮̫k>Xj ^ڷ>p5a` I_  0G2`Bs=oLhcBĴPzPnvLTWs+Gkpi9'PnW=z}iNW9|Pnva׫7|sv X]\Xj ^ڷ>p5a`r=E=&bp')wu|1v|KOP0~mqձrYlBs6}+ U<+? ^?xm-ӎuڷ}8oG.o5%TN_**[c/îgJvWGXyg@qa-6u^2 W=?"~"[egx?>P#M|yǥʄ:5h[!gg?7U#VJ#}qerukD:ukg5Je:PnOԳ~qQUO˹G(waשk|ps}|v~p0?`r=!~ivʷ/TԶ_|iPVv]xuɣ}`DŅJ,cra ̀PnZ{K(W(4SG(W(w!jBs]"ۜ촒 Menm,[fMT/[׮؍krn?]j5>>iv~׿V_~i_,=m7[ 0 ـPUR`8BǾ  +O]4l&,끠t_cem nK7Ql]۾R_ mj%ݥj]^]Be6]Bs%\2ưکX#w3 i0ޚg[:+yͳ.k\ܵe;BB{j?_Mho!~ڳ]z%8W9ñ_/';LCg$dTo?:勇cz\~GzH뛯VJNmg ݏsۋ}iY[x3~}]\9ֵ-z^SNQ?v+֯qNrg֯S)꘢klע~]_;✁g/Qݚn/;B˞f l]۾z۾ N1d|c 1l{jKSS :}.# 0 g@(* 0P.{ ,+/5ׄuh 4'b?h4U 'gccmcmo[˙k <6W\7mV9t23&&R>\/sn+<V;!as8zuv|]a6mj9sr;oiDrum;u^\9>I5G s׻8 p/pr4SVXn1~ǐj .wҌ1rum;u1eX2|1+No܏km-9mXgsqNu/ 0v &ms1Pz(?[#XU7uM}] bk\; 6Q߱Tзs}+(~a烾ur5`Bs)+ VkЌs{܄f\>+Kk]7B]U׍fv}8uYVmyOvމ{{Vq|՟{Զ\~ .s.޺&k53CΗtrS}Ͼ@nu}<ۮ՗Vf<)ܨQ|m<rnE˲5͐mn}}B˜1rum;u=^_a<~5y^#< ta=lXgso՟` Z%3pPndOsE!ٔϬ~CvM|$uR&vIio8Cc~B193Ky׶]}YNJ }m w'=S6ejտs,?8؄v ߴ]B4}6ٵ[} b 9ua0l|^[ȶZxϝۇC7匔/ᤆrڎ}wsfL/^Q^(ws֞LT/S׶ع/w}1"5,ZԵ`[ĬB(})ps?܃]gڶ}^Pnחsַkط2`Wx1ھ=6ԜGxP2.S׶UL+K1/5s[tX1;7<,s.C3 0xG;k -`'|f7޵rM|n5!Ut|ۤU_2jk !P[l*]մy}FKH8jexm֢ZsАv*0ګkuQPnx__n3[w}놬~5z_YJx>Ki2Q!]a!.C|r.u*|3\Qnj(7ڽoI!ŪDŽry׮kB/4y]\׵kw 52"ͮscߵ,:泞C rI 1Y߮>+]_zO~)'}xĿʝ<#ce6Nh#RMSCIư_]I5bcخ{D@߽M络Xgsq5oj 0r8Z(+ɡi{t]xKέo x_t}PnDɐm[5܃ ; ]1(v*Oj;jK=msӶR͐[rﮕ> =\mEݾɁhj E[s2t2uɾMhkNח¼MhLd ,/{/[ CC}̄fWvL })svmǔ?58r?R5Q=]?}sa0gm_4s=5Gjw9w7dl g yfRP_lj~ߗ WT>׵zs?W(wpake)ccv=z67mkSct9/}0Y\kz3 0xHk -[)s j<}ynrߐ1ؕrSۡiH8@mo]K۶@Gd㐕r듦>MePnuLQtըo{H(wl 0xDm[?wjs; }Ƚd0`Bs~Wm!縮 mB7S!QB]?fB}ukIȱƆz;r?Dum&BWq{,&9lv﻾v]Rߗ۝cBs}spLw=0z=LIʝ<cv:N%Va{1l׸ m$z3u3֙\\  0 Z%3pP l޹c32AqnVm[s16&\S3h1tmNR{k3$l]m\hrjv۟-CCA!{ߪ}ܶB_pW>m>=W6 4~ݶ69{U{59q/=:w˔wƆra50idb VCmikR#F(wsq~LT[ױ+w?Rn\(˱lvc_sZ}hfL(7}cgb {ʼn1um;=<ňs9` Ssu!חư].Wcܕ˹/0֙\[3 0x@m Jk 12y>fסum>97܏1ECCxc{Sڼl6_f`dDVsc6C}z[r)x.;vUؗds9i3@z>j Ogo39)+ I+ulRLO #]As+ğVۄPnW86eb+tXX6/vur=RWuJa\*Cetju9Wzm!PnR)m/d=&W~}}ʝ<c: ws|1e ]#a:z8^2s`.a38e` BVIe -;4xP]x~N8/CCCycnVʝȍhvoE[(95[c>eǼLynckзRls)s&)!mO gR==Ƹ1Q/`Bs^mIȾB%³]%c)!)2u15r]f=Z|G(wsq.LT[1ɺpG#ϛ81 lhKI_:+ގߡ/Cy';y8ưֵRF#1髽abu=Ɏce`a )k'T󾧆2eݶ^3p6H u6qehԿo~[}h> q75Pɽ6mȦ^ C1ռ yM #ŽcW["(T?LDlz7e_&ַ+ԷZ__Bs1dzvD_M\_|r8K׉)+Nٗ)+5XյU^V!;_[9cyvK}&v1_(r2h ;-v/? krގμkmԚ`m Z%3 {|"|dZ<ki>zh75zmEjm4P͔: ͇s<`O!禧PP6 ݄|m>ת+]^ߣ?-1K߹P[ruy_۷9ݓoKw%P|✜s3ΣR s_mWsx+}U(񥖾6ŪpOxz=m{;^(wpNNak׵Km@ci-ư]0:v0VܮcXյ2kh{RqP{r;v:_|1kkR3o2vlTXgsqF# 0 L3 kT(΀P|ܟ:79rcRy @(嶵KJȲgJsΛqn_RrܨQ 7`k@(wڍ}g] ԧ+䓺^_Zo 1_H=749-h{s[A^(wsqn6Q=O]}.]_.IIB) vxfc}=箱}Ⱶ/}Bssb ;_]ۮ*sפPc 9]3w/1֙\S]틺2 0xpK-b+Br#U]?ל%v,)16O׷]WʵRnrmSVj>qnZ(׽V{ۮ yJ CcZkULhvw ͮIsm j']3+04|";r]v}y8e<3wF(+S]Vk搟n_3w<}H#[cyڵxE^cR;Smj Kwk_8vP::sR_`7 A g@(ť-`vAn[]oBch0t>Q34 4C:K_Xk w쵴}C yݯ;:Ҏ 0 0e03Py/mH<,sCC͟JJ}xwD͐ ĜM mϑM_c.m?)5Hߔi>N\ܶjC.g%e>nC(=X{{{ ֻVZb23>3%V(7:zw{f6|Owr;Vޗ~^Mo=83Q=m𥮯VS%~1B y.4W-|u2ۻ|=ֱm'Wưu/5eIm/ca`1l@Ǟk{Wcy{}V{`1 kT(΀P HXdؕa !7}!oYkR*m}ڦ8͔ksRC})5K [)8n< m1gj6W>Sj9ƿ3οngPLLhvwPnDcۄu=Χ6ʝ=sizz]Z]6M]Ks/l 6C] gwrBbNkWr/<$g/sݻg1Vy*uK7a``x@L_ ʍmmqղa]DCHJpH8x!!k&,XpZ܆G6 @mmVfʍn^rxl8WXuwߛМnmR*&E{T ! +sM"V!֖mmuzc}iܴڋ/ڵ:`85d{t}u(eS`:_srs5e ;m_V:6:~a 5MY>sUe3\\ 0 Z%3pP`n|@kbl(7%(`t]￰uM 嶅XB 6C)^!KxRe+86q686 ]V(wm&s FYEz0mrrϭCU^_[МVokpȵ+2]۵I1)1yfМǚMyPn5JgZuޟgV2T);C( }ٮmǺ/k9N;jvz]aO5]>0۞XgxO 0 A>"ms3oOzum{phVs spB_06SMtvH(7&]-9jv9lۧ[V =|kun}mRծk <מV8w-ڶ9mN tE>g<-nۮBp _LhN=)\bB~zrm;JmϸیujFsۦ#uxA[L;'~&sUc&UvDzB]_Bm+1=j;˴~y[(71촺֥/ }M2/v/@a3\|t?` 6:V/MQB1 0i Jm!`h~gַogj(-7&q.!jڽm2(li>}ܶ炎Ѷhڌ ov=l!ڰy [ [!f~oGEݫm5W?OYOǺCMhN3v3t>|!f -V;K(맳T[[YűkBoQvʝކ9:4Q=]_JR^Bjm95FWP8u֔v躮OF:*t}\ڵW Rթ5aa7Oư:d%&!r7ư]񹟷L~L;َcg`arr`8OO׆a'ǜ_ ƄCת]}̮ j{h"XJ04ڹ&s?m?5K]ܪUt{QW࢚XZiN շDJ:\mV^_ൾ>3]?v4kvr F"W9cnz->3jsO^ko549X C)~uR]4cCC՗#έ4w* ͮPXLX#t R}^3\1rm!5X5&׵k%!+Բ-I> =6]_3n`}9mϓŚBCJ{PnuSÎkuf2N]Ϩm6;\k u/):yԡN^`دx0ک\׭/n Fu=jZrZ F/5 涅q㿝J Y4&]\Tsn}s2;v kSùԚ8V[%r'j(W8a~SEmP{-r㭯PRP^%u?׸`Րv_Ɵ< Q9kez|]P:wm}ƹI TUgn_%{Ful3M/;B9[2_׮ٗ9v=ŗIecBkajF|ty`5>G-`ӀPnf\yv.uٮ.CfPOenvW( [y6B;"q3cЯzLY$&΅b0!ang"\΍EJ5^[?f`&)ḆC'^W3tACRTX&Ԭ^f훜S_ ;?}U?>/祮DWz߭c}z o|5|7Pf 8Jls9|.2w*PnW(~SG]بeʽf=UӦܻG(w8g&յ+y7Tw|.4!e~2=ܹ2M+Ƣ#Uʝ~^ca׵u΋s_f  sܗ{,џrLciԓ` ӱXjmMʭDILvÉ3tă3wMO {aL81?f=cWh1ݬAqso> znhն=N){Ô$)Tu6﫟s?y>zܱ0ռo{?p79Z CK]7f/4W`m{TஉsP9reKY]P}ѩŘHoNSsw.ν&յk%9mfr&5/U8:? }S(w详L;f=N}{~\rrǝm ;q6X>k{}AйIg]"/y8#a~9t.5ޝf0¤}!!U_)m׎syn!j{M_:B=v\]Ǭ>C/;}Mj;Cư%j%ڹ"%po3\{]ퟺ2 0\2@qrȸW*KO25Q3`B3]KpWPDq^2AA!3-xnqU"BJC&5Qw}H?Nk=3Q^/.7]Aʮ1פsdž 3`B3ݚAЙ;0m5R%BJCB($XJyvo7sKU[nQ8!uV;S̕VM?& ZfPXPfe?n)7 Sڳ8l[-ulPsqu5Q=[\*Ky}n9۱Ͷt\wt}>󦼷Pqk꾱ީGski#;<cuMG>~r[:p:h ;֖cخu74J,c4 `1P\ehW'BZjܔUG`t&4ی3ms-Ӕ2:wy0vKưeuKSuی3m 0)ru!Lz-/ 0{7`B `@(L&ˬk Q i̺8-ŀ˥Xv,3 j0^ mX@X47zk[ښ` ̫z0pLBeDuuuVWc@(w?JWưe5ŀ2u~ 0 m@(W3Pz(ׅ / 0@̤zf߀PmSe5[-N{d [f]rxt:`6P\o:%ͿF1 00%ڒ-ӎ2:{ o@(w6_ù1lu]Îm|ukK.% 0 ʵJ* g@(M 0G2`B#ywj@(L&ˬk6 [f0-a ^z1 0?Ņ B5S 25) 0@LhOQ iDuu=yq[2ÖY9#0H+ 0[ʵJ* g@(u mr 0mevcBeeչK]؏*_ÖY^0پ0 0Px V}w\N8N`J1`BR,;l@(L&ˬ5ɣ-Ӽ1lu=rw: ݰg` wBVIe ~2 i&OszY<10΀Pvݛ2뚻;-?ÖYW.ue`_uU/K`؟xr۔c` g&4٧}(r˴n̺8-Pnaˬk  ~$w`- Z%3ÇӻwtNwanc7 00m` DuuuVWc@(w?JWưe5ŀ2u~ 0 m 0peS_=gয়~:=|0f3ĀǏ\\Μk`8ɻc=WBe4Q]f]s=/21luuSWeXg_ҿԋ`'îfɓ'7jB3BͿ֩5z5e`ۀ MC` n_%2뺄 ]]j [f]ve\1fX'^ 0 0j@(W(1P ̱B.Cg``LhgR rjRm;.b@(Lưeu/6`/ 0 0lx l݃Gj;wi'^ڗ` ̫z0pLBeDuuuVWc@(w?JWưe5ŀ2u~ 0 m@(71C!w{t֭/_urb`3Lhn{k ` DuuuVWc@(w?JWưe5ŀ2u~ 0 m䶀 dex";"dܲ/\cLx 0%0wɾ{1 [Ueu/rưe9K]ؗc}KR/`g 0@fj\.stidXʀ Msb`m'W&ˬ Wn@(>` [f]~r\̀{3ke؛\2@qr]v12 L1`B)~1 ;O;Duu͙ጁnBec2\ ˀξ 03P\!T35ۀPn~oo~?|͟mܱ>~_cᄏi81|7Z)_` [f]~r\̀{3ke؛\2@qr˿ ._Pn~oG7ߞJ Fskr? ׌ qƛvc9 Duu,FXրP_c2뺕'剁quƵoڍ`(.7N'a\Bֶ극~Zj^5Խg~%~7=sYsLhK iDuu=rgBe5-{>w&hX#w3 i@(* 0P/r˱'Zq-ebOcB=yj@(L&ˬk!krtm [f]K<9&VK6`wɾ 09(.Cm nk5([=\5eQ9cZdik _]j(?.z2?Bِ~f [f]kԞ| S B-`(ӀPUR`8G {!¯7ߜ?<1O @l/>Vl;7 z?{Pna}]?1ʭhֲ1^}~ck:I +3Ys:TSLZmΆ}BU$>뵫g{lo豞{]V-s3=| M~>rZ2.%-ӳ1lu-X=cΏ1r 0x[6m a(E$ṡf^ 6wߍ Eܱv^+mvxc#Z)ܾvESCVRPjOAaj-m?|]>CCA> tF]}0< qW},;T4؇ck_^ǽBiu0Ui{4 [[euQ i̺>a Vb~xdBe7Q]f]|rL̀Pnfaˬ/ã0> 0xK7)@ܶY"amao;ċl3@Wmk;1!=dU؏p^7S_1u>=_w6":heZvȪasr ժO}jKrvm!զ/u^H WsgV\y: 9v\4:%X>9go{Lh2Q Duu=91[2-ÖYR;ϣ0a(' 0[ʵJ* gPn=,as׶oZJ(zd[8` ط[8: 6W̬Bі?Z F~LY]AدfpHpbcpKs 6>B}f vk[8BY ^iy߷m+W\c8FY[0\5cvb{maޮk۷hW7  VլѹX2OZU6x[{ O 妄kӬEWm Vh Z)́Ϙ~dv/V'%-ӷ2Zȱ1[2MÖY? 0^q8 0 mݠS3_נzdʯ͕ur~3z.ܧXvhiZ9Sk[1\5C/5L96IYL 4=54hԶsW/m@S*ȐצRkU߇fJrڬu6rːy&?LрPnMTY#3{5 []c2u?}> 0Zr駟NO>=ŀo[qʝ7lkmѡߩsƚrmA֮cP4mN ʶXs])wNtԶLՔp CuLhݾKeu +>1 Ln̺nb ̀NZ{`` ՀPUR``V?~U 7&'?~Z쨡E/„?)a)A)!θMǔPnj`rHp0\-5Y϶UGm$R3CxH2M~mklkh(7/ԫsq^nH5k?&Z93 6`BM<H7 f{pf̺}d?-/ÖYW-ue`_uU/K`؟Yx>|ʽH GMٯ#r#4f`g΅ZCCc15x֐߹ 6_Wo 6m9w,)=rrюCS 97.q^RQ}AWN}x dk)[>-V{re̺ɠ}erưe+ 07Y`ʵJ* n }V(wFkH:;4DpPn ߽{54|)T}:=z:{֭Ӌ/V FK_)7U'#Aʶ?)s6mKZ)OoNc m縯6RσC)ܡΔrZ0w(7V ?ۂ}9}׽no 0kD?0Q]f]3Ya`B˴^aˬ֮l+ 뤵_ڋ`R θrej{2J6C}2 fVƚAĭWʝ~lӡ<50;dUI Ngj-qױ ŦlkhsSj~B>/6RkU?6"ҎCk^u^]Mh_0rDuu]Šde .Ӯ[{5-[}H3`^|i/`H5 +(9KVUnȉ?%8%x 2v;%95xCyh; mkn#%:eToC۸]">4rPUZۏ>=5 SԾ5ֶ별r 85&4զbHrn̺X޻2 ÖY׽o?G3`;^`6P\o= jJ15$Y)A))x~7Bgmw}s!α瘩X*7ë,ogdq^ʝҷYI<>%C7ʡf&4}r&ˬW=-ӫ1luӹž2+c@?``e fY0WPN]aѩr+gF 61=W(7?5i {WlKK_(!+D6WcuRܶt_V?j8&z^h;7W>V!af 7l[~z{% j W>+ 妵^|.{g?cPn̺:g+2`z_ 0 Z%3Pr(d F  Rn[8\3^Ȝ;۶bssJ dlE4]7`ma߮wymڌt"#|=n^_rPn[ / U}jBÔ՗6rus~m+) rr71=}eB[7 } &ˬV|&+ ,c@(wvګ1luڕs@cK{1 0@x : (9l U9}-z3xq,pqSy[0W}Vcsf \;w|=ݪ[e-﯇y7k﫷qv VAf"L w.ʍnۧALW5 ~7kp n|fPrmAx_sUv[_h;gXS>qy4Be7Q]f]v~rـPn~aˬ5#03 0kʵJ* gPn\ A*O[pn k+XcjoXʍ 4Ws.P9}WȴVm ˶6}lkjfmӶZܵlW6)gȊKr£ͺ;[=^9ZPmoTеss}yK]yabo؄r ͱ-gp4B/W&ˬko ڀPn̺:+2`z_ 0 ƃpL6Pz(7jPhBd3hJq,̀m}? -=0mSnu,x_ۊڡwxd:ٿc`` BVIe ![έ8jEUvb|mۆ^"Vd=w5j@r̺qum_~/ 0 Z%3 \BVU[09v 002-.s{]pl [f]d,10ހN1 0Ņ m@(ǮP?Lh lo@(w,LTY%LVXƀP2Wc2뺵+犁4:iŗb`TBVIe ^ ~?frS+JXπ ښkm]r˴a̺:+1 Z+c2bk``{:@?P`6P\ز1 '^O'Bn ,k˯e!rtb̺^ a@(7:aˬN|' ,kXgW2 0PUR`8B.nnp5 [nm[e`ێ;ms-Ӓ2:W9|0x ưeu K o; 0 1P\oA{@rˮ{~77?'nǯ 0`BހP5X.KX0eukưeukWiuڋ/ 0ry`8B.Cg``LhgR iDuu-8<2ÖY##%0$ώg` ˱rmo7 00m` DuuuVWc@(w?JWưe5ŀ2u~ 0 m@(* 0Pܲ/\nLԗ`/ ' ހP5X.KX0eukưeukWiuڋ/ 0 64 3S5@sja]uByem 0Q d('9-ӧ2ľ1rưeK]ؗc}KR/`g@(7PδTr>~xuV͟gJo`L8/0rDuu]Šde .Ӯ[{5-[}H3`^|i/`H5 +^|E lO0 0ffZ{`` Be2Q]f]8LVXƀP2Wc2뺵+犁4:iŗb`TTu 0kk/^'nf`H3`B3^ 02].K|&+ ,c@(wvګ1luڕs@cK{1 0@a*:5O?Y5xΝSԓ _^^fkmA``\&4˭~ ǀP~jүLTY^ݶo [f]sya`:˴+ڕ`*aǏ 2 0 H+-Ӧ2y~ /aˬs2/:^ 0 πPUR`8BP3`09v 002-.s{]pl [f]d,10ހN1 0Ņ m@( 0Lh lo@(w,LTY%LVXƀP2Wc2뺵+犁4:iŗb`TBVIe ^ `=0w~K1 [eeֵrtn [f]pNrdX<;`r4P\/FO:?] 0 lkϿg0 [ey[]؏*_ÖY^0پ0 0P\2@qr˾p1Q_`4`BS'``{B`~`̺.ag2ri׭ÖY׭]>W 0Ik/ 0 (.^0Pj) 0Lh lo@(w,LTY%LVXƀP2Wc2뺵+犁4:iŗb`TBVIe ^ `=0w~K1 [eeֵrtn [f]pNrdX<;`r4P\/FO:?] 0 lkϿg0 [ey[]؏*_ÖY^0پ0 0P\2@qr˾p1Q_`4`Bs>۷oOxÇ7={vz8>|8y溍?~|ݾ޽{w6fl7U2χ&ˬkڸvV׸V07X0\}/3]6~{O>F(w\wưe5WosWb<[a1|~cƖ6c8LnPɊrWڊ`09_ -ahF 0{7 ; md@(#yw3 Мn 0em2.-BXMh$f"+;M iCeuk&ˬ֮~mjV뾇0۷G=f|pָPvKM޽{79\oiP\rk-ݚ.[kq-q|Xa˗ajω߿_- Fs8y6-Ykv`f@(* 0PaJ 0@Lh1S~/4`g̬>gt˵Prm[euKSSܥabީNJC&B{n5](1lu]ܰĶ V׋X/밿ݱiX; 0 SaNکdB|۱ 04`B3D9Tn/^8dbrᗘ@!ص ߯^Bd.s3>i/euk&ˬ֮nǫ9ׇ*wY}hE(wX;=l>c2뺕ۍ1c{6Sujb`༁x 3P. 0 ɀ ޗ9ʶю4 ~>G:XrPjMTY=͛7EYT"mS3r<ÖY=^_cnu}6h8me؋oPSf`?rS+J`n6Pɚ14,Q#7I(7ϺLu`̺Nu߿5(X%UkBj-JLZ6!0_u_d1m̿sVr˼o&㧅e>G5^d_fѾq 6z{us2>ưǾM=/~cXpϨ_Rrvi#m 022`૮^v ^ `=xu6a\¯+&@mJWO k;=.` x  0XiE{yp5US`R d clnޗ/_r &!V3 0ϟ?m+t,J])7+6{Vwv9v ニ/-y}Vi3Pּu/"BN+OTd駟\c 2u zMNcC vtg`lB=aK7sߗ撟+,g 0 h)u"u??L`n,:5ox_b:&w@.c۷oy}͵9```MBB 0pm VoM>|ɓ]>ʽsm'8y-7 0 0ptY.JIKh[w 0~ |ӳgϮ]ݺu+k\K=P~mq1YX&n9O2 0 d trsxRC]t`@|1j{8꼅/t^cH504?RXuwmc0>khzX g=}``u {C(Oss3`` n[LշYzr6~ MƷcc nC~״X/K_>/o={X@b~N+! 0 0@y:ASl-hcm 0Wr->G}# 0[yδk"$e.Rm7soؗ;G26_z^uk:ư 0 0P\\(ǏOnJCxȮ0{èj%_u#Fc21&/^vXܶ{-uxӧ⯱[_7Ư j0s n`ӧO^ 0 0UT.y >[Ga/_f̍P/xub`u >_fUh//N1snڙ4kpUh(-WK|?]^^~,3dܴ~꼦` @MTҋ9"^Sz=3 0 0 ZA5+CD0r_KR/`i Bj۽{Vq}UXuc lmk-BCGX'6 c9ҾXX<αKo}Q[ 0 0j0^jCx 0 0 a +w޽Xf@}Ѫnvb+V{U֚ԌFx%Vٳ/•їo' lg`h7+"@!wx֮ڡѸZ^|~?LSg[=w–m[X}qMksm 0 a@(* 0 0 0EL}jJ"P_=wա,Ճׯ_ʍ:VaOpX)_( 0 0 Z````bԌ0쐟^2{rS^xH%Qso"]_ӧ\V:Q1m/V=c{a`]׸L =P{[GyqF9\1Pq_skmz 0 0 e`7O=Փ``R W+ׯ_b%֡m?WWW,C )E:VI/mׂASMy?C g@wZ[Wb_cݏ?N}Hk=CK[Vϝ֟`1208?, 0 0?B 0 0 0x  "<})B?؍_燗<>;B@?Ѷs!X Dxirkxjf%k@\KXq-_pnBIZKu_@6u3|P}}E.+[=wZK1sܮmq 0 0@^x#/ 0 0 0DO>_E={vc/V5^ӿm92 27f 00x§}6e`؋'Se``1j68jO>zf޽{ǡ`gg ހQ rVǏbqWF(7[Ümp 0 i  0 0xݻ7!ȇb./9׸Vlu mߖiۘcm@ݻw۷oGfVM՘`4n ```V5>x&V4Ok+V4u*GWWW:WzǗm+˘@ X2BƐƐƐ 0 05-v 0 0 3?xqqqƽs˗&K}6G} Pssvn lg@w^݀s޻aGro߾}/|}c`` d;8@ ````>}:=y&Sr)gώV?A.kl6H5 Lgfr2ĉp TKj``ʵ" 0 0 0"b>·nݺ >}TE-P+BWWW7up-m3b@/^\\|Kg!K\@v Ծ\w```-n 8ߟ^xqkxlE`(@c޹s&+FpH˯}5rsLƟXG\a\7:/? 0nÇ _O``Î#ɓ'O[_ַ]70 ƵԑS X=ǜ<g,qo_S? 0 0g``6z`0&bEF8y=n޿*><f]]yծ 0r3liC̍_YXz[>g``7`; 0 0 0pp1[nݬS?}p,իW?j^VU[z. @~hX D7¸1A"a]xm,jc X=1n- |zH׈XҢm 0 c$Jl@Z;kg``xݻ7Ab)7vOpIl<uޝb V-:{{o߾XX``p \x0u0 0 00wN1)]m8 ZׯXɓ'X nmls3 dn& oH?RxK;2 0 0P |``?J ޹sKAƄ dh B%Ϟ=Y3\Kf`;Vݮ t2ʍϟ=p,ίs 0 0\Lg`` 6aXiZ7&bu@,`,g)&m=ztch\.۶˶/ڗҀs } įo,.7wǹ`X߀w7 0 0 0@b:·nݺ =}(\O1͛Sn]NeZ68cP+^ʒ9MbLv|6 0 0 lk{:նJk`` xǏ&|<رXٳg7AX:w 80{1`\Vb~i5~ %B1 FeXUW``0`Bnr:N 0 0uݻwoV|𡟺73/@=zt߿zpnau>4Aj`q},9o|2pLV=fwu{so߾53̆``P [haPھ 0 0 g y< O`hkm?~|a{e-26`\}A_``M^^^``(ԀZ5a 0 0= ޹sK:y1?wnݺ ԫ+瀃k6ԑfڏ?@xei6Fڈ```oLԙa``vf SO< DNLx(wqNcXA[Ӿ%.%vL\3Ӝ|OM1f`n |0 0 0P;| j 0 0C p}U̘y73g@LVq~n/cnu_ՕXπskkQ ij]^^{ 0 0PE-G:Ng``dŋ;wܬa?13g b֭[gq=FtXf X=ǜ<ڗ}{x-~XmߵՏ``̀;w 0 0 0@޼ys{MÇX pǏoF-ˌnYtNWO``_z_ꕣWNѧ}`f{ƓpOí 0 0 {/u1w} Ĺ썕=zd> 3RzQO_ވ5Ê99m ˀsUo[4qyyYhsZY- 0 0@yr3 0 00Us˗&h2#=9BM5-nݺm<- Y#'#{ 04Vϝ~i?1>qGxg` |7 0 0 d` ~ɓ'_v(4D%ߺ<0UXmO[ym9H3 ,a\-gU2ߪ+ 0 0p\&3|s}yW^Y5`0+ӧOO~0O1ֻ9'|Jz.[Oeۗ_ 0rKxς˓O]B-``0Ԣx r[f`(/Nwܹ ]\\>~8XU 9(~*5{ŀgϞԙ W)^q c#ڱ4ŸϞ4+͉qc`g`I0C7jŶ| 0 L3͛Sl|uS]~ 1^|:-J[1 0p~@{co߾5ʕ``(ĀBRHx D0mm1 0p$޽;=x>+&^#ǚO1&U˚ kUa؛27wϟ?~Ntyyie^v`` YH! ]@=pp``"vqqJ/_to5-|؍0j,ٳb>F `€s9p.8xf}ٳ"ϊ<{e`("PDԗ} ?~Ep8gn0 0@O>}1_~2~{yTF}ׯ_=og``VhG>c◔"ۢ]lϦ 0 00΀ u!nnn̲:~ 0 k &R#|{֭P["B{ko/f>xy%Q76Kg 0zno&@w_sVٳׯO1nMkw`7`kQ_޾}k|䙭g 0 0;5p;-ukuTG`` O޽;ϯW{"^yK]ԅ D7ΙWWWǏ|YVsejh{`V o1qTZ]+Q``.BB 0 0 0@xqqq(s˗&A}d`hnp?9FpӧOΫ> 0z d! |ztS(0 0 #}E:2 0 0ؓ'OnBc1sK ׯO5+>+V{n5ڶMj_`j깬 uX~۷MK:`Xƀ87 0 0 0pX1*(aOZQ8le/s_F~޽ӻwL2;:2 0@F{1Ac_|1Q]^^/et~SBA 0 ,j V_|M+&1?n"Ekz=/^t[n9o;g;g3 0@k q^'&հf`jÌf.ȱ"]QW^ :1 00mBPtguYp~ݓIhxf(рs.tuuu=.іa6 0 0ifWh/uJn3!G9g7+,ֿ tqq{n>|xzק>f26B߿O>zP>bm`ǀsiGǏCk"1d ``a ˉ)xGiA3?'=37`8g͛7XI߈[r0սE 9I8*P6!ood``k'S\z# 0 01 k X@GTX 0@޽{w&'޽{溿K_b|8V[/vV_Uѝik) 0Kz.WK:g^]]]b+``J0Jr :< ϯvV|wa``/Y{ilO1f@7+տc̸&>czjsm 01 X=uս52 n 0 0k4ڞ 0 0 |鋕cB"cR. y9{)V˭V})V_[ÂmeA=ԃ`z~k߭[ꋉo߾5Ё| 0 0 (d`V{ko`` ?1Q[n>}zzW/5Q݇6ĵ FH׮ uy 0;4`}܃}\^^Wwy`o 7 0 0 0/^|)~@p@Pi;~1 Ço¹qڪ2 0p<V=^s/FbJ1 0 lm uP``3͛ݻwY9j]M/wN޽{7jUX_z%๓/*ZnUè_:Jp``w:o߾5_0``rݴ3 0 0@V"0WM4dC"kz܁ګXU7~Eٳg7n>```{Vݾ5V= 0 09YM + 0 05ÇA/_h8@N?n=5%V;V͍/{Xm99>'`1`mڝǏ۷o>yer 0 0PcW Ԁ`XONO< NM02i@wss)׿Xi=V˭¹qJ9>ǡ/0 0Q X=#گ~Y۷4xn 0 0ɸ8GL:fQ`` ޺u&,St98V>XEٳg7כعsa``?ZWjuuuu ҳ3sr 0 0Pc`:m` 0 0/^|r)~Oڨp9[هN="H2%鳙f`3`ښm:E(7h_>Tmݵ; 0 0@\\``X@ݻwoQ>o5}dCuۛ_;~~-UΣ> 0eznY?g|01.3 0 0&````q& b޽{(9PTuۀ.SsyOnݺYi*Vq: 0 0Ucz=0B9=6d`XK`@iLƟ`7狋qܹsz hp? Ak:u}ɂO𾡭 0@u c ۷oˆ%c7``J3`"D a &aDy|Ỵ㆚cM7& 3& Q8u=NKӯ{5|)eӇ``WF㘽``J4 $Exi5+xvLnH`r6[ӧOsqϙs[cp]p6#S> %[mw 0 0lL8%]^^x 0 0@%â.3@ծeݻwʍ^vW}` x_ ??NyI=cX'V~g EVsjd DXI.E@ct,lip.? +Pŵ֭[wQKkس `րsmϷKbryyY~`` (Hf14g`ֆ j?`>>|gܹs3b`]7ew["ʮ> 0 0P7`\r;'4ʍ/ ?L2 0  2 0 0 HzxCϟ{ ?G|/}p-mX1߿s-|_iqtd`zWNc|a˜\``?M!h`` Ov ӧ]9M/^^*q}%F'``x{ϯ$9?΅ 0 0 Ag``N:sMŠ8gh@,5\Aݻ'+T[/}Im```)Vek)[}gvϟ? 6y`8n```W޼yspQ2ÇOl|zV|kek¼b aO=ztk+ 0 0p@V525Xٛӕ`f>iu``d*g=Xt޽StK>fǦOoa Fpy£m.BU[n={f*<{e`z<*xuuu=/jFڈ``` alI`؏Xfe;w\©Z[+|kߨ"|a*`S_nlng>)`eǏϟ?{g_`` A60 0xsG-ZS U>|x/LLe`ط~9x޾}k1yNo 0 0 huc 0 0 DPo絫>}zvjMpiw޵ zVgϞc 0 00ߦGvzuuu=渼48s#wΥ 0 0 7 0 0 /]\\r/ rCO/T~u`_> 0^7>lay? 0 0`1 gL&^s`޼ys{M((g4ԶVՆeST\ |*Þy> 0 \z˔˃o߾5pNq]a`؀l\)+58g`]LÍ6u^{3޽{w޽{jf嵙ny5O4wJn[schm-```V]K|uuu=Ƹ40/ 0 0ظ %R5iZ˗/=p.u=e4+]\\|sٮ[J_;6\{F2A[n]_#+cKYS/l9`_z~1_|zlqmWW0 0 ll@6.Ёt3 m Ʒg0ɓ'7׭xsj' h=zts͎} 0 0{v]R۷o)< 0 0;2Çyw;<O3?K-ϟ??ݺugh_xarݵ; 0 0kc۷ob<1gcZRwug`i 0 0\be'O܄qzt<\gl.cK}.Kl@ԿsS6p< 0 00΀sǵ۞Udzj 0MZ``26'bOkV`qqzX2ƍpp1~޽/<~={ 0 0`V~qR(aa1m 0{2&̍8 0 0sM&VȋӀþ;@-2X%?&cgi-ﺩ0 0@N[x~XVٵb_Xc`~1 iR'*``޼ys{MÇ@2q\[W^]\bL4ϩ*,(n,ONRnu.t{/ݽc` X=w6i&~m#e:SWue`  2 0 0o rK⍁nq :V֏6o``R X=,/k1F/O8ڲz2 0$lvg` |*LsΝ˗/=0wxM90s}y Ĥ۷'nݺuS-ڑ`f7AFh2 0]|N 0 0Wݓ'On¸ybN{>.;O;` gqo+aU_t\-9o|2 0]S"לc~/b}Hԏ`H7 k-` CȊUO 6f 0Ј{~>ݻw]vҷ}\>#hD_3~dΟe9``dqWH``  0Im``~y=Н}FFpˮ 0LIbÇI2{& s.b`9 X=7_GWWWס{ n=S 0 0-4 df b4WʍUx03}06j@y"rqqqsNU'պZQS\.p38b!^|yw@={SC5<2 04`ܼ{۷oO <̫ι 0 c@/0ΑOP @< o,ho[ 0@O>}q>)V іimYj{ rPm61%/FHJV 0 0ViǏ?5Ioz)k o 0 0`|?{,G^``b!·՗*!vt!]8Kk+־4ˎe4שj>]>|xPw_`-G`H3`ܴW"?WИm{^sƱv 0 0G 0 0poڪ 챽s{]Jruuuz@sp6\ ~{XA+U#\^q-cyX3 0\*;犸]޹\]hcm 0 k ```, ĊoO'<߽{fXi.B5jhok+4VzԵj? Υh>q 0@PGkqB||y|֖ڒ`؇,: 0 ,i ~.9޿?ss#dvmϽg7!,k?~=E`b6ߋUkvֵc` V=_Pn|Z 0 0@B=ԃ`6Ajgp7 y}ާONO< ><`J.muۣ[- i Ǟ={vsh^-~۷Oqfؖ 0 ,g깧◺W"r -Tm 0 ߀P``63߿nLDpBj c D?O[M?xYo{n}cǏWݟ5ݶ j 0 oƽ秿9_u=poo߾um^ay\3 0fe`` k]c%-ï dsTrR 8[n5…mr L7+փem_ /1ݒ6Ԇ 0 0j(c?Sk= 0 0Q l8J;N'``@rӧ?mMb%8u̳/GP?/V5w zWWWG4Ϛ0ykhn߾}zV }k0y;Ua`l/ſ}n\uɿ{s}> 0 L3 ke<`` p8Zn5#[m;Vڴ܃5ܼ1w}}22+c=z)"D b%g˧z 00P_z1:3 0 00 W(``nrf8{}~@9.//+bu%kAz#zqm~mđ6b۷oO1)_>o/U ʁC߰2 0RVύER~} 0k)1x=}Խ$ 0 0g h8zF3iGm";׺V_x))|oH8n)s ͹j !ZA߱gϞ%#f`J6s~zg%ql΋ 0 0S 07;0>l}GR\0G~+VנAb[=PJ[1 d۷_p/@E %ԐAw_[(Ny`b`/B[>bq:O2 0 1hby 0⧅j"o{mlիW*Jk~y,¹}޻w޼Vm^3 0y۷Cl{:`8W c[r-r✨ 0 0xBVch ^ B{/`?$ G4Yt0 0@.Z=7inR/ 0 0#=f`X@e#l߯÷mE8J1\\M`|qvyyysm}m{W^ ,6q*j 箱\g>}}j``H'a`X@p,z{s߾NS%L ޽{V>ބ~ 0kÃn?;޹s{gl9` znܫ um|sW``rks``U0ǃޡp> @Lw|5S3`1o޼Y>x!_`2j 0 0@%``f7!qz__beޣ :pd͡``Uxë`csժ9?~<3X]՟`=1f'^``Pz\{}p#wj 0^xZݻ2s; 0 02ӧ޺u2}DjW`8\+1 0 j ~x?{\ i) 0}"pU>}Z}c_{}`Xs?}pݻ>\¬s O뜟vf``}n83 0 fכ=H~. ?2 0 crXь|Z0 0@IůM ^\\60\BI}ޱ1 0@Ӏ&7 0 0bCgPX׀̠`~1Mq? ```έfc~qbGԎ`X, E[h[{3 0@>|[ne͛7he{)V׽{s}ra` D0vl ```6mqOg|>K``Hg iWWWxP#d6 n{1ŋMXmm6Wpg1 @ m+dv 0 0 \o {g``4ҀF2`Vԋ< ÙJZS<02sgp9`>}tsNAz>9 0 0gϞeq/Lǯ{`c`Ƙ`sN7{f ?;\x]7 0xIV!5e.H``` ]'ٵ_2>2 0 `@0`L (+7!B>uǽGa?U_C! 0x}V1v})V'?jF 0 0wo޼~xH޽{ {d]`` g1n`f7MǏ{hr*}߾, {5H+:>`r5ӯ,``xT/"y/ǘZ1 0bX۷oOsF$ݻwOsj0Gگs.s1 00WW_~m"H??6d(@ׯ 4}{e``Pc6c~5}GA.//TwwzO=Ԏ@qw9Gdskb``޹s'{?ca^;1 0"غEkKs`4]ws-~_l7`(I ``z ăXaΠu뻄c` Gl܏q76%K2 0 _]/Wx>3 0 j` "_: 0 00p/<46yb 0xnm+706Ӗ 0 0pT{__OدHG}`kc}:: 0 lajaXӧO{}```#?ݻw7M O/^/͟VuGkC@{^}O}'ׯo./_ 0w򌸬g꩞ 0PܔԱ8@"Sm 0p$Ϟ=l|IUُk 0Se=; 02_?B1uﯞ1 4ӪsyuwnÛ ڂ ݿw'bU?'tf(Vr`h;C^/a޽{K[ JCQ۷o;o隻Dڕq/}1c87==qAį^k,=ݴ[n?gYjK?YoO$?_?"mnkym eq~'TM`B=)cpb=*{cw<8@㧟~:yɓ~s<ŌkLmfjZ(,?U(7&SƸlNX<7)Ȁ2kBeu=\sh_x iX̺:w=JzNZƗm_=a0ـP.9o|2@0A]NS3OBnH 6￿~h?]߿ukSe^rˬkJnrQgYf@(L:euo;MP|&R= # 0MP9!2n@(W7Pnx~STۓ'ON[=+ؾIg`-woBe5ww!r9k8YۀPnuʬhnBLm15\sXb  2u_"sٚb`Pnsb>~Tmcrό0v^ Ϋs2:ǖrҟme@(L:eչ\]n@(-2@)6q8)20ހPN1B͚}ӃYEBwy 2`zT2뺥)fj.B,e42=Y9bd Bm6b@(!NҀ &dNd 7 ;v ,g`Pn?>y޻wo[N,gEj5 .ӛPnu]`[ -e@(l\-ӏNu׽ rCa\.`  2u͂;-BMk?~<|S?93߿Z=ݻwt.\=0QykPnuҔm35\sXӀPnuʬ}g1\pg 1 '^  lit!["m'1ʝ~i?1{(Y?bǧj߫rbD2BeukWr9ÑhnBe2)sr[ۜ17ԀP.+Cx+ 0ӅLNovn@(wzr BM߿?]]]̭[N.';Ѧtm&4'[f]>?GKj W>r4dSf]wbkB nm2 ˆ 0\\``cBnrY4Pnmrr.Orˬs`@(; W:e9X]n@(-2@)6q8)20ހPN1B,Dj۵ .ӜPnu]`{-a@(%\L-ӐNu߽ 2AgˀP. 0@rr` YfӨP1뮿{LTiT(̺~> 1 '^r4gSf]>?GsejnS> 4% ,e@o0RN ǀP~j_Ց ~$u?MTV)J(̺Zr5 f6ױm Yc2|{7 r [[Vm`BB 0rTrS8ʲ,[V=O,ŀ2- YR;>r]_s5 [Mc2y~6ԀP.+Cx+kenms 8Z0(πPny5OմB1Duy5~*[f]յB1X(F?5)wB ݰ/װPnoՖJ1 + ll@(ME)7,BeSTR .ӲPnu-8S(?WBe4)GoC 2Ԋױ\6g{1@axz WSTMK0 q CyMTWBe9X]K0 q Cyr˫iSc2{7 r [[Vm`BB 0rTrS8ʲ,[V=O,ŀ2- YR;>r]_s5 [Mc2y~6ԀP.+Cx+kenms 8Z0(πPny5OմB1Duy5~*[f]յB1X(F?5)wB ݰ/װPnoՖJ1 + ll@(ME)7,BeSTR .ӲPnu-8S(?WBe4)GoC 2Ԋױ\6g{1@axz WSTMK0 q CyMTWBe9X]K0 q Cyr˫iSc2{7 r [[Vm`BB 0rTrS8ʲ,[V=O,ŀ2- YR;>r]_s5 [Mc2y~6ԀP.+Cx+kenms 8Z0(πPny5OմB1Duy5~*[f]յB1X(F?5)wB ݰ/װPnoՖJ1 + ll@(ME)7,BeSTR .ӲPnu-8S(?WBe4)GoC 2Ԋױ\6g{1@axz WSTMK0 q CyMTWBe9X]K0 q Cyr˫iSc2{7 r [[Vm`BB 0rTrS8ʲ,[V=O,ŀ2- YR;>r]_s5 [Mc2y~6ԀP.+Cx+kenms 8Z0(πPny5OմB1Duy5~*[f]յB1X(F?5)wB ݰ/װPnoՖJ1 + ll@(ME)7,BeSTR .ӲPnu-8S(?WBe4)GoC 2Ԋױ\6g{1@axz WSTMK0 Ҏ???ß6͵AmGGBe5'q_wr7ܼSBqOBe1)cRqO[B܌qz{Fr[{^``/rM3uӰy,BǪ7ͩU$k;=erˬ>{_]s~ߺ z"yL|%[c2:>|5%X;C_hǿ r7ďP.'Cx ' 0AAA`tBc0nD C}^C_{.>sRwmz5lBeus1B\__I%ggY(.O-ӛNu]ל{bZegjۡ9^so]-õPnuՑJ6 ke``cB_h|7_|36&㿕|1vln6s4 9U ?S~Ps9{{)t(*\i ٨D}5N>dr9;\aL Kڐ"K:}d;=0Z[?nΘ,"ʅ9vtڣ:ګtra+S ʅ `f1^e14"0Ei.M-Jp$(͗D^Nr]M|KQn}փ$Ts]뭾P{|$o@_n}(E:1חX~JLtK,A?K:WsÇ޷,>cӎ_5vus=ucuԦ1&nhvة1_yn,Dm9_;\߄; r @eVlk@Wc8.Qrn᱅Ϝv3szffvڊQ';r%MJ{*Z9v |Qn^Hmؖ1q|lfl-D}\(1S:},ENØr3ra|]Bcc[זNO.+<+0@WYW|F0(؉Z\*=?DqrKuDm>Dێ_E\ڬ[:G@_5DmZ6X;OrdN;~]pӧֿoR{ĘCG;5֦Î]<\"Ec E 0RI&|:cbx.:tlzM;!_ֶ/6VTMcQar"lTvVTSuK/Qn1'eLk5ޏ(Oc} vџ|Qn; ՘cmbr+D5s|` ƫ,Ƴ:0DGwZ;ZM(3' h//hB+~S?-mNu|]SBv{d^+:Br+Ǘ[?Fu mǯ6<}MJaQn;|mݧ|Qn*-irnbL9ugsvzhMCߒ~gnfMmcv'!mZu/^nsWIA ?$Op 00eQ.\@Q.Ieu;m3Y`(w}GQn~?p9'-\j-( JqR=lTvzh\ki[# @hQnZǨ^׿!9:КFmisRFJG;5KSn(J-%އ(~Jp;``MU\Mm0К(wʕN]׵b$:u_Dm(/6wtlTvZs۶ @h/L( ~jr 2&n/L(Ovך\o˜>^+viq(jcQ.,ᇴ0r @eZ媣ҩclsWome*D*r;6j;1lTDC?rS:jd4_O~wN߭-}NzKAyZ\}'Kry5c4rӡf۱ElT6YyDێ_[B{h*YǪrcXX{czyHԥڦxwtrrh2iǯr_Uuqk:(7Nxjq(z; [ѭ[~ŷ`ua`2DMIG?}OF9i?񏿖UCʯw|+=O|z #H+ʟ3Zhwe[+oC1{^qind [:|z86& DsY!-Lm۷ٮQQn;~ɷd(W=R_87fX}xuȷ[>FkqR{96`rی(Muk-QnjӺƢGXW}yB܆[qXk~hBsr%e9{Q~^ia`6*ji`>rEbaoKZ\`9uj\sgxt.[hQ ;ǞӢ10آƝ;IlatC1w=Ks֋jr9mD-QӒ\mIi;T"zlT寜vL mǯ[GCsC kN3+w[x|]B[ަkpZKiL|8Y hTvN;~]ko%k)El'Dl6Kڗ6e%ܱ]30[3(Q. Tf7Q:c9§I#h8s{y:$@ 3WE/["D$۟z9&΍\q 1w7k ;11]~DFsoNu6&+LjrkMs({|ɸZx~YB~[7(W~sCKG6&+uȢֺeےZ(\Z^ =0*r4ߡQ (ʕPІPA5)W`ޑ~:c߷\qPt)?ız@A]*O9ߞz96Y-rS_,ʝk ǧm0Fu~9rkMs(8rg uu Qv[r7(`ztԘ80[ 6&+u먢z6܊Z\pZ> %]006r @ez ^pաcb&%;q++,BS*Mt 4gXJ(|YX|(S\C6,<_ʓ)QRn1-o"mc"2(T㘘@N !瞍>;rkM%c%c}|ƽ?xyi/DrRKki]Ҽ8Wi94{D}iל5Vsi}7g V-1&.>gNB]|}Irlm;Fّz;Q/%@WYcy/ @\%~yb!.<'M8V:Yv.ZyeqpxuONEʒ+;<72E%[-nkrGFk?\W r5wlTۨEZ|KƣK6Uݞ< ז[-^(iDQy掹"c5^y@FdeN;~Qa]ZxLB[Ǝ[XkdνT|>רrLN(\D00PDKo_V .w6UDŽ9)%"Sd]K|rl"A顨<Aܱw劝mNgF6>T?_١mQnEBk==vX߳^ب۬Z|KƣK6U|{ZJ:S>(=$rS==C=ʂ(sv:(7º>|(-|}ɜ{(<{1o}DN ``TU х2Ы(׻d;'\":QaPd-νMeIhs6:fۥ[dD=$J0(~іoŒSck~iAmp>m٨ng9cD&lΘkxԻAx~,~̲(woO35&>4k[~ mm\z&砲w-E,zkKaW<^!]ní85_/w<|.Q./ E 0@(wƹ:56 HO5k]=/Au۱ȴsm.Fe?&@轹srۘl&--@8&k7,ug%63 rkM%Q(i$Qc7pm>_DmMVבDŭu%De&9Q.v\yDp&_`J0y Hܜh56С<-BZ8%b%\O}O.f_N42{uɢ\-K{<%sFN(wn 獊r(:q+&3566k3DuM1wwzܡ3'g <"m}Ii4ȡqʅ(sv(7pw-ZtNa]Zxl]B[֞kYks5fp&r`Mx7| `Q.\hܹΫƆ\EfԂg]4X:W/w@TX*;%O,Y4Tb$g<'O9)ƱK"=C%cߔ+6XOQݖr=(7)A1d<>gh>| Qn[vLm9HYcL|M[6)-6XOu Qn[mCmuCjs{sϭSc5x5_/KDr ;|n(bbN406r-NZc}.OkD?FI}Lpyl/wu|s_>YZ*!_-'jE9;6ZC 1Qt7aT==zFf-p(nqhhxԻAFcs]GB]1rh֞gcƘͥccs# ʌ( svYp%Ac%;-D%(w1q>Ζ>[ﭏri`_ \D00PDsHu56O ֺ(TtٹArs"?sB%F9yRԵtҔSN1AIƵk埍긾[=([2 ʍ[ʹOIՁQn\,3iǯr#/S-S喱<֚{KDrM|n(bbN406=r-\Uc=(}FYF,I(wN4kɿgiɢQnެSNѷ }}idS36׳mMnWX[Kƣޱޖ|%l;֩Grױki^3&Phi&z6&+uu±緎(7gߠy!ʵ٫&_9w+ܚ>ۧv'XW02(Q. TfGQ 1sn w(WkߩDyYh4s:ql5fIDATs"{nC QԞK?W?{Fu=ۯ=vZk3;59th:utQn11#ʍiSkdŻ|.㢜tr  ƫ,ƫ|M1Q{:Ŝ QnT;0&\ڛ.Y4DLJ$ԽSiK s(7F1/Do fl>Fum\urkM>o Qa῵WD9Y-UG\.r]T=(o5N\Oj)#R. +|0pDmb@<zD56glݥ<.֢\b̒E#;$Խ\ x!j%ߴW?q} mǯ6Gc%\RH> ʍcc$QMmi\?!˟ug1~znXe>ȭE2_o\~=)<ܐn`dQ.\@oCB#oɿusk smcS,&e>,>N7*r&g-voyDҺU"=7v%ڏ6<#mǯ6GcZeݺQn\+u ^K Qnfӎ_Gn.^eےZsX[)) OֺQ_ 0@!aClI{Li ><ͽ;{F!aj 1ee/Y4_ze?TZIrGC: b<߇Fu;UZ|KƣޱޡÆe[zp?(;ؓgs(7WMϥ-C'e-m_C?&޶pr%FVE5:TvQn[}hcA'xY'][̳QݖrvZkox;;&|+qCnuQn}ԃDǡyc9uQn ?uw r)35"FX_j7/[roKj׽sn+ekDp&_`J0(Q. TfQ)A5ZK bk'>QD?os-.{L#^h4g\!n͍U"1M{L؎@ ^=m4lTkD0]5G8V^l.cǞCۆG..Q'C\Z'!=vdɚt֭;r׵oI~kחxEv,]ra`-x/l b1^e1^)GhEP2yjmաccx;~1Z*O-,#ZD7F'MZhd 'O m_M{lUu?A{6~MZ|3׬7{z(w;/y4Q`g//鷫/r\3iǯr#oY{"vڦZ%+KDasvQ. -R E 0hQ!T >ױ I-sd,y,Ή}#M>i{s7'Jn Q).\[~QnEB9m鱺G}BQ?޾Qn;~Wsp`ܧ?iXMKܰ?o=6ڧDRjtӎjvi-6^mguh-^(|(Wuz;|F"k0;a `4*J;H@{ DjES?Mn;&Ի Ts}*߹J='Om!*26ΎA!!u(W<6 -ޛ e0dh>'jWr|~N:Dm'#r:8-ϩG;Sߤq,D܍>>R?6(WMrt8-\4$z6Y9bӎ_Gk5Fj]ZxLB[Ǝ[XkdeIܴOtlz;z}et0Dra`2D&"<pĔ JwJԜ!9atC:MS6%G[%F9zTTr<̥CƄeTQ)BCm|dm\|^6!vZktJy\h"|>>U;'BMZMk|>xbKΩ#{R|rhfӎ_Gs=e˺^z(w |(We%1^!C0k3(Q. Tf`KQ1g,mH{ekNa='Zh(2[Khfea%Wئ/:9s|w%F3@QnE9ufY}I@ڼ:FuZ Qn;~ePp\KhEF4(WuRsRՖ̭GkjQnm:udQ.n[d-gu%$m~}Co\՚/i_ٜz;.3rRVH+0@(`*3(W&Y;Am$i⬟USZg+U`0{|)Ok3}w͵P9Y=ߙ~7J;DEmʴ̍Re#wS{:kiĸҤ%lq-V;ڐumFKFu;mMDmUmvv9B O[uC}^ɾRxvYB~[:Ɨֱ|Fڟccb[jia|)660iǯjgk9}ZZ럵Ž$]^Cg(<՚/i_Oٝz[z}4p0xx` /4N0P\|]_fP-"k䰈(^s88ٚ6dQn~ݺ}{prj x'\-eQn 1ӯK;6ra6|1(6h`` :r @e2X>X 0zUl(wG-y-3Fu"ӯ-5&ra"2(O.׈my5 r ˖ ʅ-y[0a1^e1i@_ ˟Oˀ"Uk?(fØ6Qn~qB4d4&LD}r\On@ í3LeQn[^@(`*3(AE/ ʑ'?ɝEGVn8clj0Fu!ӯ5 K@ S}0UD}r\O6j2(jǷr6`3 TfQ.Wя~ rHD-(%eب_D}嶆dbQ.,@D%s> !OfaQ.XxYxْD%o| `< ƫ,84TvD}?s8%W_NڭA [w`}(OZ6@TfT6l"u+5~mD0:_[-Dra`2rT2y,(Ɇrg}r(O&QEۿE-s>bCaq\xM ʅͨl/؄H ƫ,ƣ2RaX |>('>(qcsبDۧ_@ =pLQn>U=eӧ_ik ʅ&2(_Ro- @/ ? TfQ.^cO~򓻯ʯ|M%r gmr YD06c< :}SI @ x$/8eQ.<& @tUEш ]p0>%c\da2`>Qn~2"DZ -:}uvV ʅX;feQ.Xyؚ6~36~v ߣ!@;c{"*j?p\qJܱYQ`O6ר7 r V 5:}uvZ ʅ⽰D0! E 0@Kgvg1_})M ʍ u 6r+m~Dpǔ?SS:}6\na/Èr- bb^@40gQvp``=g[Ŷ0gj"s(OFf\.ra%-@'oum߂5@ Wkp;rG`dQ.\\:5;z _^ŽΚ Q'_rm@ k[w`>yaӧ_-uga "r2" .\8- ƫ,Ƌ@ÀDv6`z}Qn~߄ ʅL>*>9bӧ_Ky5@ 5wDA0@(`*3(BQDcߣ3Fu"ӯw9 ʅNxNfQn1ӯ[|J3(J3`raK`b1^e1Z40r _\xwlT+KBۧ_- , DeQ.lFe|&>\O^@ í3LeQn[^@(`*3(AE/ ˈr'}(OPD;?*rdN~ڎ/xeQ.s5rank X@WYguSa?S)>Dpǔ?٨ϧr+m0~Dpǔ?SS:}6\na/Èr- \D00PD *zTPXFۗ?بeD}vr'ܱOQ@'ukv|[.ra%@ s[3``bbU=Eۧ_ik ʅ8 q(?2ӯup ~Fۯo`"ʅ ePˠr2|N"ٳg?X `iy>}2̒/بA{گ/_|ՖJѣyn^\\d{S=M}l#;_CD};KǸzeh<>asگ=yWc}և%mdNZÚWMW+'h =]}}{^Mh26}!>\'yODQ}.&ߗ~~vč!-&;曻c6?wiz#lT/!}ݯJ޻woVj#^s~pvBV;97NzNo5ftڵ=wl N"Y>%թSm.MCk#mb_5vXwn1ݻwz_5&VyɾYQ?@:w'vYQ_=R6D) /< /05@(`*3(@߄9~L?tl] C#[$2բ$vaC^g/Qg(~ƍvBS]˜X{t͍Z$іw #{QnZ[uۆrD''u>W4̝x+v{׫3QgۦcFlYuu xuvt{"sL<:הa/UQPz@ 7nH7k3(39BG.agrm(zlb2-k19+}rwopCNvDD:0=&F)VBOx,'.GڈrwJϥ4W4g.zcҾ}rlXOIΕ(֫J^cgD XϾ7~(.Q.t}00PDra`2rKwJ00(rᮓ= ]J@66z0\hI"7ب],[bLLm!jWD>t0p9rwJԵ hGMBg4\GqKa4#jnTu=oS J0Ӻ^n?9(w8]i]X4r_(w>׶r2 bb<*W \J.+<+[20(Wk,ܧ^v!RDr6ITzuj?ECڻ7Ȣ\1f;!Qז\[I|ӇxA1?'M^2;Z*RX bQn\<׹wjcVÌZ,|,egkku:R2- Q.uN# E 0@;vG@ Ge`DQ6#LYlrd78m%m9b|FԴݼys(QUZOޱ 7 sii$'X]D׎q᫩0|36rc[Fl5ֻj tkU;(^}m6nG;(zZN]؃e1^e1^xJ 2(_Rom (B̒|]yj+@s;%ZH]3e*BvyԍjZJ3(WUVdV[mNⶇhm$\tXzyJ.<7rsGmENY-^:E#r`u=zKj\Cwăaz`Q.\\= ((C&MBwxN疯spnY:CffkvwčjZK3(ƍژyYS6B]?y6^[;4#攭3ⷵvƛ_Ds,Li_N !,ND'ut3ΖjlXD5;x~{#rz-zM{iXzJ/6ۦQ::HZmxFiӖ3ºnXRiG2oUCu5Q.v)C!@!BX c3(wlSTFF -* ʗgk4OG쨺yezZK?(74+•߿= @6ǒ_D/V00>:\'""QkPwFecx`Qn.icmQ5^+/## @ E 0H;0Qx߿?ͭ&QF>>>/ĩvp=v+58(_yȻD"C"9Q=OG+[SDJ黾B_5_ U;#k)߯~!x?燶RCv<YZFADvg;%Q#¾6/(7diocS*i~}_<[uիݖQZu=z}~!iHuxT<OxxT~+ŷ Ļ1``2(ӧO&'60(1q[, ,m @m5&W~hDra`2Z@ @$twMuT{(}_F4/7o #Q_aF%bk .Zd$⻾˿{뭷BzĬWۨGGue99]۹ߣ}s:}]"V:)>xtP00002 d/^a#Iy:q#$VT/^Fg ڼ "w m'1C)2䭭~!/; {8;; ў޻wP"zAyУGBC,gڧ}Hگ D``XF@(Ŧ/ٳg![Mvn1...BBDT7Dؼ:Z$Tl'F\(t)y,b!zsֲ-WX+gѹTPz}0x1zC? bQn'ATp3zt҂p#\]lG{o]"ޏ.@ӧQ\~Da}hWml1xa"dSgumyȦ򤹌nZڏQ?:Kb(4mâkp<#i= `Q.\akO"oAa3kcLiWm4882ԧH>Rv Vd6"oں^m֭/ڗrQga` "t8:XWyT{Lݚ,ۈ(deu~|i={\" @-EgqFMVTADgabO|jrh*W=v${m\owQ9r`1-e >XW.Wu=:N"\1qʕ1/p/(Alu=zqX*NվOO%;Oؖ-l{ Ddϭ䷚)EΡ<H=y;OIU#NKѴ}(v~z3miM ƴk-Ν;Up`#H00@ͱ叿pS`s"\-Eͩیڪ9>L;|w00[1(da+'8@ F]IV#ZnkfRhiaaZQe...XqDo?z"}h^Y?R/' g@cC'Jn}߯QjDպkwӧ;? 7p5|7l#j)J_S㻰0@(`````xP溢46!lkܴޚ5_`;ڜl |5i,nwԚ_oguD?y3pM0nb ^BXC-!=z6S߳||C p 0  0zq$Qe lyYAZ j!nN[ $/m̀1JC'F52JQem(߭ ߣ4Lb@BJMkmt.M [Nr8HK3W//^uAnX=rD-Jպpt=} ߸qc6\GD0F;0Z4C4V]ZSA"?}ZD좱ƺmj1AX,l6 p``````€~W|޽{GȝNЂ;݉~Z%ɯm򋽰W\+-Q|Y[Jz_oB56g/䣟>IJR^V{?K|&5״ίkuf5!h]On߆e+?>Z>01 Bk?TmkQ=FN =Gѕ|%6MDM\)/50pY;-% ÞpVkvF:~hyٱE|2kgm4Ӛ3:;J}Kibouwu4J]02r 2EU-kP$R $bĴyH=G|Me׿&BZ dCS-4j3D9.x:A;;ZXw r7 ; U׻t(bTʭkC^hd'Ea(=O?76i,lq^Tt@cmxjT'5;-M_|/MкBZ}ćZ_Hcz#Z[A7:@5,ZJ09ڽ1;lޛoӱeֈSۤި%ujϡZ['Ƅ 0-3 h=-xiyI 4ztHw*ͳGml;위f?$Bv6a/&{$A/b X[5 _Hk:-ogwh9"\sP!#Xw:x[޾  0000-2lMWwyAH /6Ŧ[2 w;RH[r[Qy%)l:0ܞ' 3"sPu}[G+QD;s6*@ $B<8m@Kd<HHmdDu"_EaҶ-/׵5žk20pPt}RD5Nްgߚb@UG% @u]+c$պh9A.0J=9~>ub0.4t00002ӵO191 -ůAnF"YIs~~°^iu6m66КMk>5ֆFSH+[) "&'O)W+'_m@@R<Xm`5"+`J7 _Ete *Ֆk%/N޳ضF[ZU}:$)0φ @iX X R;wm#]ڿn!ZD:|#Ҷh2tpVu3 @ BMjjoR`````<:s-d/ɼJ(ٞڽyxC[jwj>?ZmIL!vn[0r4m߀-PRG.[ѢΉpu.u)oJs`%?``r9m 00000D͛I8NkMuUZu}?Lџ|M}PO>b7/_ܥCD˂-pj,n+,ߙF˭q;GW=݀Zu6E?*6+``.30 @ k$g5]7H~XǼNggglT8ҝ[)JϱcahFz=zD}]08?ܯh\v>%{Ν;{1^:X.emy T9@ 00`aɺv}Hw000&r9E 00000l\Ox$}-Anj 7޽ǴQE=Z bdK,#b-H;| a2 xKKY2iܬ[T9*eJeu eѣGAۮ~Zo- @lPsC>r3v-a7o\٬%|;ܸMp...6K}ǏB['m3z G)S\Ɖ[?gl˿`$ܩWOy0)7hKhՐn7``g@U)jÇY:2u~A},AEQ4|7c< ȍ$$E̱O){X3dݸ!tB~=oCc\†0E~:VqL¤f~pmG]ttEmڞy%','98 0000`e@ U (2lW5&|>DIƵ}t56ڮĆpK>}P"`oKyHQ5͉p5[[;#,Gs2"˳Ofǻ `2guĞ0000;wJ^ hDjkY>R­b2_ mp hqPDZY^#F6o9jQk5.]8g@Nsv;H000-r90000IȨEϟHuom$lIX0vv:~An̶2I5eŔHsnx~L'o޼I=f 2o͢sC$am: PݻgYF(y>@ (hښ waw?}?€l:mn7-KDD!׿?ZvIhrof*Ƚq˗à%E"kzdS"+9܊Y?";a 7=z8;8iJp/1E%3mad[|,hߗG|00Ѝhǁ_kC (Ai4Z)+"ץ$2'Za|_7#m~&vvv9"D27ʀGi\x[@|kW hq 4b"jKr%b.=}>(e#Eɕ/v6/;grcS_.=Is]Oӧ^\{ 05ύ7[ 9"|ME{.h)Xóa`=`Y{3|000PĦ<=yՆy׼KHQ /}i_> r-ŋ o(T:@*_pC!m ش& XE=i^HOpu^r[vy-Os8|_t0YY``3('*D M) fN.3L,޽9d~ro/W myS2Wvn1乿:O4ES=G,Tή0-a0:1pاz+պԨ1,cx،&Ix6l lǀu \9Ir S43E{|/~g O>|ܹCV:컂}ilZ+s+kUƣ3)$i|xƍW3i,~ZY{"Zn~@j?Nh)C;01(```` 4?)H]Ky{2|~ ~| {SCҦwpUw?u){ZXǧNm{i_)G|p IῖH}n"ׯ#uy[Tgk;u_竴GB:`c `>g000%HB\FLIF$sޕh3'R | H{} ?fS$W6{;bP:`׾G000Dp6ORE yd#mhUM^E"!FWh|!Cprْ6[tĹ؃:00@(```` ,́;wt[nE X ?ItK|LF:}Yy#BzN0"g5@މ, h|hjO܇ ;< /s ĝj_sJ"\6?ݶg{g[ l;")X~Lh6Ѕˀ6 ҵDh; r%$ºώ-'qEZwkyMgj-v˗/w޽{{ BP5m(%|6'•0n9{Q7R\sx?J2p}ypU+O00PUXX@ڸf6> Pdq'IKQT8#29ODNY)bm%o_tk ;u_d@Ԏ06#U\EeqIsEv|Sç5H'j|o= 1J򜆝 @ ڼfp\R.OWr~@$^iaf_#A|e) ҶPq|߿;6V_xAߨ?ڞ^H43-^EUۛ}ҿ:$7ߞQRh2*ck X c 3~0޴%zPTNrXG!|A Egj}dc BƑ0Lu_:ƟMGj?wWpsF[4~LwR lE}-3p0`!4 hW Iڄ/')""j(b.67e{E?P=!x\"ȥFf%q =2~@>O>  Gt)z4V-w\ߏ&RܫQۖ-Ğ00%.(YExɫM 7>|݇ب=8]NTHxXމ : ^S}Dy -&RD?mSbCRSn7!¥>hZG~1Cgp7|00@Kd<j Hؑ l-ՋblŨ ȅ~R6L$Ǐ郘;T;E(wNiw#``` &_```b@w(R.Fi}T=%Vi!mW[ԫ*-7vohggg؜}'ʀp%!a67 a'pAt ,hϞ=_t|#ҏ g?u @ `````sRO-鿙<>yFmLf7 !.߃ǚ $AπEMk)l˂x|[lw6>@C\'00e -E6D7n)R" :nG=9֛}BZa@Z3k%000 0F30Q2OWFg(\ٳg0b  \re?m36(@v^cha````\ظ}.47ef( ۉJ=ژ$*4bݻ'=ׅhe{ ؞\nos8P$(|E1BWa//QեthMIEyAl?Q \N[ WO8Cq&Ayh#m r!l>\[j /../7Ǧ>Hr3g蟁]@ֿI֭ZcR[  IcO"\m"Z.*jT> 00b`u @lhKH[ndQ7۫ϟ?sGמi!ȅ:"QEb]r}s c-%mߊ[ŮyX nLS'he st[`})# # XÇ_ 8$(\^&!"Jk9)DD-#,Ƴ!x>\O]o k]6k-EgLG]5cO>}uu=Qu _`@ekLvʕsD:Ь9ē'OXCan.hyXwv҆Նo=4t00001 iqH2j)]f~ 73rai7*}{vn߾ o6HKǁ sHs[-y7ҿpj6$)86(;H cݿGI+sO$TES%O?5uFE 0iLȶsvJŃv "E˥/c1n)l-䗺0000F0e - Y#b$FS\_ОXFQD) 7ў r>|8-^{ @K<|o_u|ݱ{dtCpV#Jޖ; OB"NEܗ ۗ?smRyg1(x0000EK f$ m?7$p?ggg,~m_ri&@E_9L;mخg4T;9=QGe ]1dkYOW-}okRCD RWK $q iؖޯi|C:(•(_ny!.a#A;)u?ŀs @0pH05 a``` -)2l־xmꤗ]խ}_ A"f)V<5h|| u=̀ƫ)Z&Q`52-ϹHIĄ5Ϯ ;b p 8@Nh+``1(Q. @=z(PSt?E%EQKm;­DrisG1lZ> 0'jn_sEܧk~}>4LcI!v}-t j G8" Gi0```` H`6j$<6׏'O鿱mlJ NK?z\IhMׯ3$.YxW4S.ETLS-20'Fo8"hԳ֘%3>\7k3?G00! Vbsl00u~Gbhy9cp^*b"a+z@ Mס#ֻꠑy_=b{lIPC0c՜W5T\=lvUlfeh0cec&?9 fQ.\E (2āڴaSrIQTN[E kLFU/Eɕ/5w ?κؿ$/_ܥݣ`aCI6Gz}\-|(z!e׷oߦ.S1p3㳑-j=ٛ ΰ 0ihҴ#y? @ tut "ZnQ7ݻl2 9GK۷Fۧ &;tܦ튠톭ը Hk>zvkkOs*ոi*p/$ʡӟT_%E˕Խ輒: c00`0Ƥ+Dk8<@DlɸYE׵{ThZ/36%|(R!@)/hYpCy*ޝ;wv?Ua }ϖl2Q'`k~~F```0_0000.t]{n޼b-Ǚ8M"!c(Sg*F~Z?~́ Ɓf _LQw: :u(T[J/Qրݻ4xF}-'xIf߿OMaF````Q("ۊɟFiA~pWnrNkĘD!ئ.opu}K |r' >myM"\V߫:4![s]ov$=-3pƍ}'Z.1y_Gۇ3K]a23 m-0x}bZSSV5H2l|Y߉ xO+_bq;C1Sw5`> w5ks"ׯtU"ឲ97%vhZ;lε$-0K4E&l`` &QLa``` $ɓ'"s<3oWlvHK'd~'D_E?...'qpM_p /ⷵvEM"\5J>_"#O)0@\Xuic]{6u{a/5`EslP2Dex}ͱ5a5'rz"E"N9{)z:mߧ3>J*#GSdyORGa>D˭>~3" .aFeQnMQ4000ڄՉDF9/mk&=?;Cک;rUo*\thIq|[<;ǴW\{MWi\w)J]ٲ67s߶- mzd  yČSY?x7/ @-ha```N2+ PR-~1'D1_raw$ڪ:I|> xx뭷mpht=p/)V;00@K텍 H>ݻ 00# )#h#џ(Ƈ֭[/}cu(\{[<*xaiO PWia` /_]vmߞ(wK3#•\c{QZ"">t}˙Jr%Ş a <}=k&sEia``ra```2 _k)Me&v>EO<ҖڟONY淛~k1rvvF@?j?ü7N"!A"0DbP"^}ףz"Yež]"Z.Fgmh:Ln|cg 000, ƀ"'6`O*$Lr"xM"C0cz/\Zwc(r{/y.;S^reMIU<9Sjߡ@>ZUWfɷaZmB/Q{e-1@````5O0ڠbrɁNoE>cL"9 )bSuAn>hmwf_.7}1W:vEDiWu>G{֭:;"{lA]iMh>v덁t 00 (hEW&U3?Ams ש`zz4Ial ,{Ƴ%ϮϮ7׷5Ev'C=NYJT8,g^r4_ͥ `c$9??7|k͏`2y :Г_Dǹ0^e+YYؖnkoޑBfȌ7D8, b@WjlBWWMA KMcx|>x`?>)";)30DF" S̉p%02g)= s*a5 Z.|n/ܜ&  @ A0000gSt\pwr7qIf,0\8*HW#̊Ǐ# =s|Ob EIW"V;Ј.O?u un' ΰWM 5qKss _ A0000`')ۊI6JlἭ{A. E:EGSE"y>'s |rek\^t Ç;w! R# "h> *B5ck;6.4Z.W=4fR?~u 00 j3|00D(6NVmNFr 2f$@dn=HQ۟?Xkd2gk#ژBe޽˵Ա^=e-WQQL-8p0y ] yFN ``` D=#Q롼("\%W>MgggpF|h/1P73F:!f!ﭓs"\]"3q1[MSMZ9v^ư]d`-: kkƻcu匙cz``` mg 001Hb>m( ~y_"S<퇋b"b+20JT50deh?~oth {=GͰ 3 Qڙ7o2^itڵk{NpmÇ~q}yul >xgzi{Z%Znk<3p001(5 ׀"H}2QXm5_\<=XX֜WslEɕX+c4i~V1C-o?S1ynp66`b2N```d?OuS>bNd`/U̲ 9uŋČZl8a%3wݷq\'z{rqk2hLxw/;J]캥tIc-n%-9[}h} &&r=[޼y k˽Ik׮yA^t}]\\/nR_cO3=0!Ӻ'zC)jzr{ZPr+ύO{=Ooܸy9{001 h,E1Cr[njwK-ڂ% h[*’oߞo{"ph"YsU鐑G=6'•/a|7v_}QO~yh!|gDˍ >ي݆5b|a``0.at* a@ 2ׯ_J䊌"prviG}E5oQyB -W\Sc4Ay#9?'1WN9V V7D>7}6.Ef.پ/k7rCܸH߀Y00@KEPB\ t(w{M"1l~hC\*Jaky'7׵qkKĕƚKEؾ?' H`C\ ۯΩտpRWcMN~![i\ư]2n/j``` "fH 00H7|$PN+Z.,ў@k#uu W}4W/o,k2/my@yMڞ̽9P/pcV=]~}_쿽96@ rqqAߥ@KG 0003Wn~:=O^Dkbk)n"ȵ ٳgD_mh*!=DWhI |rUmÜpuㆄDKHGG64=\۟-WAhfiTҡhTFl "&00001Rvƍ,|)GrYf"DP,b2rup*U? -g_l-?~o88͗u~~Nc #m.'NXq ݢyn:|vy.u1ݶ"Ck>g6EJ [΀ZizY?``e@0003)S YO\&-;$Wtlxc(l&t#Wo,Rv8WcwW\i,4pd~)IwRnk_?߼y>?ꈿ`;l0pa```S!HZt '0W91jwz=ϊ*wxw 7?vF춫[l_߄5HaA=G갞jMùԹCuN\ꄑ5e?-7?amϧg8"NE8@O00c3 Q"iEuU\=v]nqaEFW/1"qYmSU3v( Cjl_iB$.ցNIsX"ܱ{{X?i3>[@bmDz?r @g hNH _,{+6O(]ۥ^ecKd ȵ +Eund̚n" ^Ezd@ĤZ"4GK]-qbÇՑҶ}ԯQ Z.: 멯(Pa``pРԩ  Ȁ"8 :ú3mj[1ym:@21x| #i#>o߾k!ng#)u .us!E-2#U_y`xMf3ߚ q Zn_P/ -R>|z00r @G 8==PTMrp &v[1Zl~:lwԮ 6f!.j%ߒ]w0RD@ Z# 5vVmHSn[ϳqnVѼݻq䖾!Z.lߪ[?x=`J `Jg Zw ? @ 8֭['#im$u]o|aA.u~#JjwEȕ1wF)c;l⫱|qR:!b-+P<ܸqխ-ӿpbSӧOՋ6Է R6he!p  ӶUd\mxjJfX\El[϶Ix|rV,Eڲtx|]c.lC[0Pu`m˫{sDk~:lYG ķ.߂s@;@'1FEi  [T*4>000.NO>-Bi3VM]{-y|#ǽUK_NUqH*ŀDGNj/'.sQ8_"bD~E;o/F)mZcS7}۷U?GW|W miyWzGhk2ȷcGܘ~R l$-N000"````1$lH*no8_?9V}* _| >$mߏ7oD۰&)$׻鿚m)4nGO0(d/ʻthY=7nx.G )Rƺk}/ gN㛴M001k5uD{eud:2ϓ QA#mCʟSHڬ)*b~o[2͛p雾iyI[oQf@s76߃wrz h\  Dra```!>|_HQ-0~@XR#' pնp#v}GYwORYn2nvh[qwc)Iƈcp={j8\aIp#sJ ~lb %~ 000pD8 p ``f@As<|&bOѢ%A.mWηkHb}ԳtU"cml ̉p%̕@W۩mtSXt{JIaG)Sxe 1nH\xDra```yrf`2X3m޺u 4ŷ$ŶDVPYo|RmO^h{(nm2:ؙ ݣbk<m{SkkR\s6߃wX۷o* bE@tHkÐ&3Ն,izl,eJѐU\EJ,l[lem^6m?Q:J]jL$D{ȧ;iXԵuEb{.j4>X€ڋ4n/V%y:ܼg/N00%@o@Vm &*',2ȄPY.oS. r40"wlԡGQs}񡕁9*J'nn^!O_xA{|$ׯ?R7oބiffH}!rˍVV߿x`/C0P^:_̀6St -N\m" :--)gsbCI>ENr)bn<O7(B6aS$",M|޻w6+: m@^}=S-n ;rׁ˯a Mo0@ e@Z0&%(O,BիWwԧd q QSk{(("#fK!{y׶u-4^{cZ "=d= GSjաM5(>A}1 Z~>g=00PD8```` ?~=H ;pn>ydfN&,&T=@7_1|n %" 8Dվ/p@~?'½~NuȢv ԡ/^0dܚTT8߶~߮rak-xo=tHV\c{uLP;~mT~MKkEmHmV ,xv: w;svMjDG$֡3ećP"?nݺ*kM{]p-1(Ϫ-囼R` Dˍ~(@JrŻ `@Ioƀ67о>Mg~?Hb #oߦ #^&|]lvșȟu|gE$:~k 7O5]kԆpl̖엢OmE7ƍ; U9"HeОĵ}Pby?umtr={Fmtf)v;9q`00-,2 Ȗ30~x)}4bN"rcІ6|S4ß3<ӎ%pAv$C:$Co#SF}6}[hO`1 c9&r{bCl00" "\``d@LU#:ا:z}m&A*x~{=~x~q]_w55;`?GAݼyULuTN#&=ĠčE>l|5;Ǿ/ a@k7rmد6,k,XE01Pd`>(/  @i;T GԽuݾ}{!+E^ _ІE5J>|H須6pF>hG` G+D=!}^L޻w6v ݾ=_@=}aۗb@"{e0U)K00\````2\yzE#- 1c'6Oϩ7yCb #İφvvv)}R,W 5N@A(2 ;mk4`{rgG+ە+Wsrا00PD86gk:o @;틩}=!m" ډU_r؝߽{wYv }*>|cQQ\%xƍzv""]3.mƺS[ϟ?eߏ_(rmV ³g'G#V .. Tbk0OO"QļVb-$:(j1w/[oo...?Ʃ9N}ā9l؎ sDnGG[ޯR[F-T5vRǎ~;b;l3@\5Ї?``N'T6*~O00SBN):iÓM% mEHƬl賡nr?i?;"J~ʩW̗OuX!yr/sEf.u]9~=|~=?}a8D˥mFH]ć00  @Q \-ՠW^Iu8m]bPA׮]۷_/^` Б@:ouvyo5QwV\""Hc_t xr ;7*ej$Zn@y\ l\&00001"M<>nriI~휄m1mL[5۷! }9^~ss/D ?k ,R7``MR[sWwhEq_{g `dgؐKf+ׁJ$I~7ERӂe= ]϶p;m%PK_Oe_|ۗog?D:8o [͛D'pM#SkLEE̍WM?g-Wc~/=#:HO<|0}2#ؐ q^`M 9Uђ{=#]϶c6]FQW\"W>a;r1=Pԅ׋Rz pm~(햕M;Vvx>3F? @ a0001X s6L.=]zU".l$'|v: reGѮv1*ǏtijʷH>M"\V]g~CR'qc|]9t3SZ3@ DmׇԿ} j c? lF6uX3vh-t+,yf&״R["'Zx7v+Zo9?m-nx+oi7{#s"\uJ ORC>^kշ*rs|/ @h}z:?o߾?0| g 0u@[xc? @D}͛7 Zǚy^I4OpM{vb6*\ڪZT߿OU H;j{:vD ް[$9["0Fh`` ʥÅH%OH&T3YcV9Zl@/2vGxw-n蓑_E ǽU"\mZKv}4!…c1?=hJ@تLm]`n+% m2nx`ڦw `c"*E{3 y$ƥMVb ]-p.\߱Hmc>yOmӖNW"r ,w4{CZxέ6Mth@ `a@oܸqjT @NHBO{&},J޽˦GQmL_SK_^׋96ܹSODy{œF:t">z􈶎[:[I`)Zx9TYή0-d !Y8[3 _00.`T* HLH Jrt{\.ts2cT&fo6{QW Ҧ&%;br8,?sĔ"FJПGY-aTqKqv`S2pKwa`}4Wպ'^ 6 d 4F {z''!LB<)Q ϳTR` ;`"(8.-5ޑ 5;n"t*E۷[ZowD*ҷڼ{ч0f* YEVaX[5_tH2K00pD8La```D9=N0Iݞ$ZA 0o y{QQIR{yW,NaM&o"cNڊtqqA4BڈTDwK9\.?NJz. aƍD˅0<.o{Oyggg%[+c1``>À6"`֍$XV 1m l@ an%̀>c׫4&h.O<٩-}4T˼~ZKV8Ms"T)x,bhT%޳>KϞ=Ookx00r;䠒Sa```}~sMHmLbcl|C@Kπ]jsHyG} .kEY;;>GI4߈pz6#nՙH뱷  Z|;N_"0,'\x$\_j BM$\ T5LdJNdx'EDvf?~%E]^%Hc*s%"mĜW{D}JwnKTdytCN%Z -bg+\[޾ $,PL00006)6F^x"ƥUxT+u)iW"|^_H6\A[S)gAKK߹"\ 9:7:y;woǾ. ehuK:nOZ{y } mvm04t0000d@JKמ3h}5 u(W 0""~B Юbڵk{ g0E8o|}:,Զvb(B bhpAggg9/~v@};|00Pm\~H%GRFQJ9ޱ# ܴتv [~ƖD]a5H=et[;G+q"<"mk#3^r P؛ڟK"7r#S\X3xMaZyČGƣ@hdha``` L7#N*2v&?رj$*߁ ::=_LS)X>z"M>m˹"\Eʕ_'W~z뭷}Aoyv"^$n-a`<Asxm\y-޽K=u y'0D8t0000`d -ZHܦw# "!m0޺u يG߄5EZxM{ՇO={FD $:OvV(mQ_pc~2YUQ<EI:'"I.,b@M^k /-  @_ là WƟ`g@"t.pnt_0ڞOl~aɓ'nLQg30O6cq~~qɩ7]=wzEaJbhzv^Zi:L݁VHD˅V-ϵk_ Dt0000ɀNQl>an*,e"A9ۛ4A迩 Ν;C`DSvڪt-_):"/}}p=16)hʕ+o+mv1@\mX~L;00p2E8[8oPa`` 6VR!6ojf韴?bXc2O[ז5~8k6jTVM}UD5""{:_:Pi :bC7Qw``5 1;Z~|P7CVvK00r @NR!:A^[ ZNH&~+y&LFc cEFK]Z[|Ev9%WuBc \$8^G@L/H9Z/ u@ä```f5NRE^ޢ ܱ+v]ʀ"S$j%D^:;w SVC>iצ !EqHs^`^:'Ux"S+#umcz:fEW[%Z BD@k< }# @:;=MuU2dj`iE6RH߾Ʃ{?ӂՂSUnK ~s8j1y-BN^x:OP+ަ6@??.('J"h?w:Hjs|"Ě K^"ϩgDKU/?c0bߖ@bRDf=.^ߧ9ѩڵk~ʺfDf[j;5f{hĸDʅ/iR4RjmĨ&_~Pƻ%F~T16&^A S[o5XpP~?9]rD:|#xVi9&; l`8h):G3{.ӭh:`<&~b;l0hBD!?``` pjCK#nq=Z:2E[jf`ֲM Hh^P=O;0A.u^%G1̗~ۏooߋwu@ ws?om7=2n(p/GLBc"uUKhsuOcsn%y%sḥc~Lbi؉rVk|À5Zĸ! 7a<NЇNފfySk00?l000-0=%&Uɍ͹ׯĝFPf=(g@ +ȴ!a*8מXJm}?I<3UθN>Lm~jPf;ljl)) F{./鹒Fi$C"\q2: pUdJ PuY4&O>+yL:lAhڣHx,@N\cc f,}"]Tx͠z,͖pIO>(o$xxN=H[[Ol[a`zPVb&ksS/m7ykyK,JE)ݯul&6` Srֵd5 03V4Y5V8u+BK;Şeg% 4!YR@RA```04gүg#3o(Zf0E͵ʙc;[[QD )‚6MRYb% `;.Y96c]%mK%@Ey:i$\D۱e#&:СWL0641p9ZR1njz4KG{9Z#Vݩ}+Z$С 000S]+lPbJ( ebL7>ER|tEvmAm9Ra.|vgjm4f;EjCƂk۪*VWɾԻi9g9:'"\9;@:4>xMWk/\?:iڔ eC L~yQ.Xn>XsnP{ a, 4!±g0003?D?ąi]q }Tccw;|ç.ߗhC}{"ȭm>8@(-cz\k/K}l_*3"ؠa[XiGǏJDnռ؁%WNZY}<_a'WJQsm(6|Ƒ80 ; @\``` <2w- ğ5/HP[d_~+bx&Xᄹv`˿ s\Zo|5b*#ؿf;RDk#5 ߆ >X"..v6-ާ[RYsE8ژi-Ÿmm=ܷV>\z3BHzzߡ @xN F$TvXMK/||O?"AIۼmK컽}kEb:~~0A|QEԏ[Rl4Rc{ç{@ VW=Ҭ5M}h~ی3ve@sD5扈r4֟SulnC!~JؖE:F ~vn`zokm]~8 ۆ&⺿s}Dzea.mFG<_"n,B>>Uo"FKV `o 3ݏ?b>Q֭Pʛ&62PSK\݈.ڭj s@8b]p0p63WDT"ǀonT%X͵?PāO\DVt8 ~ 1}ݚrǁֆ6]1[r}s߄afجhk[I|n^7ij?ImH(h[c( {`.-6UZ@Z<{۴CIa@p{V|}VkGٰ5͞6uFZ0ϟ?Kl``}4Rt!yj3Fyva#3qį5ڶo"ʵ:о"D!iD{a`<lt5E%(_ )6 ܽ{wE> K+:[ ŕv7i?_KQ.uzH>?˪6f6HK!aM:1>f !#=7ZwlKkՁn/tQ kZwn3z(77k Vl֮{HlF: E 000-f<yAnZds<|Z P%_% j=iCY1ڤmuAҘPZ0mgZooY&qeo` .Zտr@%~i`;u:w ;kϰrm>cڷ]\\0`9>3]?ė1@H 000-gȧoG^PhͲ0Yׯ/6p&L1 q|X~kHss9ͤQ%ykp;GI?9aiz1Qu)ZC}o5k]yJt;i_:5Gꃱu jT7=sitԽ|& @m1I@%40tē^ߗ3'Ol຅ a.zzj%zl"!wt"/۪O{N+ߺuk==ۼR4Na`,?g^2<{5KOMy_36r <<̡i[(/mڲƭjU^7X"16΀"ÔTZ.E҂cI(<%jᅨd'Qƈ//ٴ!b.ˈ2oVHRCpf-Q.oD;f@![^e\"R_J޷.S[FFc)|뭷#6j3ڵkmk,|L{nm0n}Ǿ2 aexIuuqOz oL9F(w=?Sڱ2ۋ`?aE88Tl``za i!2CE"m^-1 !簁5MR[u!1{^"Eq[meIYE˯͹">"0ǀʭ1D>aWr0 @4b8?e1wamխjg 2 q2Gb?00#|naf4W${r21ņ>]6g N}z ۫C@Y#8!pN+a";ń>fzɸzuÀ[^𴱚_U4|{@yVS{ZsQ|[޷ش=BǏS8 `` 000pbɦ'W+rxU{h>ӂڇ>?zۃ08Zn9ސxj$[:!Pu%L>lW!/0 j8 N5%6e.M{ ~8yDgoU8VkѰ; @9Šppr9'cKl 00"X7'|^†Z´=lF3iql3R׊rGD(ƶ䷩DlԧUK\W\Xr>PR:%ι5֐u#cW(ˀO#}{yմu I&9P5600[D>MQt-'[AGmۏވsmć>Pm׶)L[+jeUKڶSFrdVD*JZkY鵮hm<ξ)0]t]@snEi,0Csk 9 5oU6. i"ʅ@ͫ-%1nMLHX JGF~zŋ;=_bS[:WʋƁ;J$N/-bh6!?0\&wih`rXƌ霏y\r9skܪy}}HYi``MBpM~(ɀ .!XHbd%0/q%=*ǓXT_]ރ07AlY HJw]O~ּ!!p5.>$f.=5e#@4qn~/r_ruy6)C o[pm&G>RJu/a"3(000!(+BxWWzU*b\&9'93|RuTAKDǀı$_؜oxfNNP1n Jnj̞]N|"GRc{>|Hǚm5ۑ;e]4Y{M ~v+yc6 @1ǀklhSZQkFab2l:;Ws_Eޓ-3s6}8dhԧfe_ZS)"Dxb-ՙRYWviɇ6\ `4+%E. iG~mQ` y|_x*uhg<~9>D88H``zb@Q¼,oĸq ȦqiczjcF*D\K|߿yi˵y-QHS-Qⴱ+aJW [Kn߾}0o"ZyKFAuwQ j݂}jQkg)nDM3߆-k@ [7Jܽ{!И d22 3 h]=\jCc=I92[1.mGkm=̬Ksm᩿WKVj%̃-ŀK6[%^=SJG;h֜W)H9(?LN圼L8@ q">8ei:R ΀;J,~w ʅG[k8w JokTrD bsom 9ug- 38W>9%}Y595ua#hx狇rczϖܪDl{asl02NL„ @)ͻ9?U1n횶AK.UyO<ׄ_=k/]t!Bx|Q)$w==̢=PPm}:XpMy>c#蟁-Ĺ: KY3HitȄ9Nu:a8dI;J\ƀV5o`k@KtDp mh12Zƞ01pem[ޜS'!.%6_-m)Jw mZyVd"C@XB$OcƮ>{b7蓁5ŹGe{Ic LAg>Pnx2[Gs2~t;ñى6 ,a gIaHKefG(q*͝;wp mC j-m ˷%[a6E,E과gg%V$APA"Vd2c?}2>sTUŧYQs=D~W ЁlU{TNlL=<A{;a'DDGŀw3b]/b4P{Q}9g҇%~}Q6gnCE%'mT <<=9tJ2זwD2jVVmpQW wڶ(m jKNߕy`LQKePwݎai_#= e[Վh/c7 @``` 덧 sY $+L*W (FnDݹLh]:{|3sJS۩(^zC_X;j3Z} @dsuH8rj-W8`v6|[b@/V;ל[4G_A=hP" G^000o^hK rqkEdĸpJǮ3hNDO_E_dnm;:py i[07|hۢ4ȗ+pݤ]E9Ŋ[077v0-^q㾺~ǏcC#' 0`d@W95c혂qA?z,~/% l8[ckb1n MYh7-.*^Qvif0iag`146S-㞥bNTd~?ɚ6 B\Dslgmi @8Weq;xBv+w"#ʍ?WlUMu?00Dra``00wMΈb4V4Sⓑmd#d\jھ|ٗ}Y NQ$z 'Œ'h{b=LEb[7_xA{Q{'&.oߡǮ@ s%¿{P0 m8o0/_@oԩ6|sV5niw101`l*@ _ bw9(@p{X4Kla"4&O,B\Xou[m$A-Pvgݖ# }6{coS\<r aݻmb}3۷o6q(3#10}W|k\mtHxE.62qIDr/GRdk%DY&'6ڷo;~8$U|Wi9Su:oa yU o}X=2i) Ta``0답ᮈ"q;0O q6a16˾#UqcQxFB܏+Wmͮ="SbhVQ#勼n TA~J\/G3_)n;xfH) #~'h.[C}Sy~?YWm?~;o_ӟn_w~?~ʛc1ݿwͿ7C.q'?Ƀ.C/.?gOOrl#~GvO|b~]CNw{~o]Ϳ7w~c~]տWwW_٥_y_Ki{Bmę?^W~.~o-M77߸K_.ta_kvK/}CvWW_+~N_~٫/ſx~߻K_ .~/y?ܟKٻ3w~wKإ6K.ۿ}~?'~MM?KooإD_]}W}.~Oh)h}~.m~˵zv|ENnd)6"{<>v+KMbk5i)R谊&9iߎ^^/(ZFS;|ee7c7,Gilø07s*Fc}mvFNs]R۝;6h9K4}=mk5ڤ/]/J?Nʯ_kߚSh [5tv;]㝮`;]'NkZO:7]kAOצkӵڥʐ~ZNs~.~u>J{Oki_Not`0kAL&{ӽGпi/D;;竟Kw}ݔn+=O M~ӽtojg5J[w¦{dӽ?._ /OQOuݯ7?N/N {=˴/s~|~/NH{W~].Wn}紧t>}=间@HG0!cV Ŝ.㘞CZ/iOrh\GKҔ{) S3zF|i"jrkCXDDG @NY뙹N܊FDX+VAnz>6{ @c 3r Q˝/+I+XɃmGw)[d@omK!J:6-X(ZVkS4ֲZ(ZVkS4ֲ4GakY-'?Xj#ӓKY'?Q(ЇG(QʰV>#vo-yDm(77 Zo^{D#y#͍QZ^IϏL$!%Rn8oxM; Q(m A{6rƲ3&j`3ʁU|X9 #])ہ+>( ʵhX{k~"=o-TVk^eDzZ֑}ֲZHXb-%ֲ4GDÈrQq =nDm(m 1! r)4D=lDr=}\Dn"pcܱ <ƺe,D)'VOr`,D)'VOJy|'֎d|KfxEbӶ߰p0mektw[j﷖߯m-H>kYھ]ֲZ5Że[oXjF(\Dn"p(QҠK܊DD \Drz:ADr= EQ.\7`(iYVBrza*X)J+VBrza*Xi455˶廭X-˱Ʒ,kF~|lc-ǥe-/-g-߲,e-H>kY}i_n>kY-X[ֲZ5;-e["0(QDr= E4rb s󝸕 Q.\Dr=m4\Dn"p(QUO4֍,`!J9=r`,x%`!J9=r`,xuOy.R\_quKVzEbӶ*Z߱p0meksZj(Z߰߯-k-H>kY]ֲZ{e[aXjE(\Dn"p(Q DD \Drz:[Dr= EQ.\7`(iYVBrza*X)J+VBrza*XvO}SGnWR+ACKV*cXZe*] #ZVk_5c-QRߴߗgX:ҸZVk_ߥi-/Zﱖ*SZjK{"p(QDr= E4rb s󝸕 Q.\Dr=m4\Dn"p(QUO4֍,`!J9=r`,x%`!J9=r`,x%͔RtՆE)ߒ|X9iK!Eb"oI,dkYNk-]%߷/[ֲ4[j+BZkY-}-Ƀ~IjE( \Dn"p(Q DD \Drz:[Dr= EQ.\7`(iYVBrza*X)J+VBrza*X)JS(޽{7ofGQʷ$V,}ڒ|EHkX[ #ZVkgZjkoeKV;#e}ֲZ%ZVK|K`)_i"0(QDr= E4rb s󝸕 Q.\Dr=m4\Dn"p(QUO4֍,`!J9=r`,x%`!J9=r`,x%WŹm߶K|Kaҧ-WኵOP%yp0meK|V;v|ZVk$oZjkoeKV;vٖ~ZVK4o[jkm"(QDr= E4qQ.r1(Q.\DQ.\7rzA(Íes*X'JFU|X9 -BH/YֲZ[}kYNk-]%߷/[ֲZe[}kY-ҼNo)]%G(\Dn"p(Q ݊p̭ wV2Dr"шrzA( \Dn,;V'?QX7(ʁUS4V(ʁUS4Vr Qʷ$V,}ڒ|EHAʧOP%yp0meK|V;v|ZVk$oZjkoeKV;vٖ~ZVK4o[jkm"(QDr= E4qQ.r1(Q.\DQ.\7rzA(Íes*X'JFU|X9 -R9=yp0me_EIc-RNO>eee"p(QDr= E4rb s󝸕 Q.\Dr=m4\Dn"p(QUO4֍,`!J9=r`,x%`!J9=r`,x%`!J9=r`<OTNO^,dkYWQXjӓkY'OQXjӓkY'OQXjћkY-7OQYjѓDr= EQ.\7rz!M\`oAKp E(QE( \Dn"pcܱ <ƺe,D)'VOr`,D)'VOr`,D)'V,}'?X8iɋlc-*JkY}rza-)JkY}rza-)JkY-}2za-)J:KY}2z(QDr= EQ.\7A[ĭdr"Ei"p(QDr=X6wO~ndY Qɇ`(iX Qɇ`(iX QɇKO4}Zrzb`$Xj=ZVk|Xj=yZVk|Xj=yZVK|XjyRVk| EQ.\7rzA( i{ \"cQ.\Dr=-\Dn"p(QUO4֍,`!J9=r`,x%`!J9=r`,x%`!J9=r`<OTNO^,dkYWQXjӓkY'OQXjӓkY'OQXjћkY-7OQYjѓDr= EQ.\7rz! ܭ'ܪ|'n%C(Q.\O(QDr= EƲc,x%u#*XRNO>X X X4O~"p`"ӓ #ZVkU4ֲZ(ZVkS4ֲZ(ZVkS4ֲZ(eZVKStZ(eQ.\7rzA( \DnHW/؛o)7r"El"p(QDr=X6wO~ndY Qɇ`(iX Qɇ`(iX QɇKO4}Zrzb`$Xj=ZVk|Xj=yZVk|Xj=yZVK|XjyRVk| EQ.\7rzA( in@8AV;q+\DrzhDr= EQ.\7`(iYVBrza*X)J+VBrza*X)J+VBrzaҧy)kX86ֲZ{G)'ֲZ{OG)'ֲZ{OG)7ֲZ{oG)'rzA( \Dn"pCz|(H@(Q.\Og(QDr= EƲc,x%u#*XRNO>X X X4O~"p`"ӓ #ZVkU4ֲZ(ZVkS4ֲZ(ZVkS4ֲZ(eZVKStZ(eQ.\7rzA( \DnH(w+ 2*8߉["E(F#EQ.\7rzlX DIcȲ ӓ+V'OQX9 ӓ+V'OQX9 ӓ+>͓Hi,XHH{|%>J9={%>J9={%>J{%>J=@( \Dn"p(Q DD \Drz:[Dr= EQ.\7`(iYVBrza*X)J+VBrza*X)J+VBrzaҧy)kX86ֲZ{G)'ֲZ{OG)'ֲZ{OG)7ֲZ{oG)'rzA( \Dn"pCD[1NUNJ(Q.\D6Q.\7rzA(Íes*X'JFU|X9 ͓Hi,XHH{|%>J9={%>J9={%>J{%>J=@( \Dn"p(Q ݊p̭ wV2Dr"шrzA( \Dn,;V'?QX7(ʁUS4V(ʁUS4V(ʁO'R >-R9=yp0me_EIc-RNO>eee"p(QDr= E4qQ.r1(Q.\DQ.\7rzA(Íes*X'JFU|X9 -R9=yp0me_EIc-RNO>eee"p(QDr= E4rb s󝸕 Q.\Dr=m4\Dn"p(QUO4֍,`!J9=r`,x%`!J9=r`,x%`!J9=r`<OTNO^,dkYWQXjӓkY'OQXjӓkY'OQXjћkY-7OQYjѓDr= EQ.\7rz!M\`oAKp E(QE( \Dn"pcܱ <ƺe,D)'VOr`,D)'VOr`,D)'V,}'?X8iɋlc-*JkY}rza-)JkY}rza-)JkY-}2za-)J:KY}2z(QDr= EQ.\7A[ĭdr"Ei"p(QDr=X6wO~ndY Qɇ`(iX Qɇ`(iX QɇKO4}Zrzb`$Xj=ZVk|Xj=yZVk|Xj=yZVK|XjyRVk| EQ.\7rzA( i{ \"cQ.\Dr=-\Dn"p(QUO4֍,`!J9=r`,x%`!J9=r`,x%`!J9=r`<OTNO^,dkYWQXjӓkY'OQXjӓkY'OQXjћkY-7OQYjѓDr= EQ.\7rz! ܭ'ܪ|'n%C(Q.\O(QDr= EƲc,x%u#*XRNO>X X X4O~"p`"ӓ #ZVkU4ֲZ(ZVkS4ֲZ(ZVkS4ֲZ(eZVKStZ(eQ.\7rzA( \DnHW/؛o)7r"El"p(QDr=X6wO~ndY Qɇ`(iX Qɇ`(iX QɇKO4}Zrzb`$Xj=ZVk|Xj=yZVk|Xj=yZVK|XjyRVk| EQ.\7rzA( in@8AV;q+\DrzhDr= EQ.\7`(iYVBrza*X)J+VBrza*X)J+VBrzaҧy)kX86ֲZ{G)'ֲZ{OG)'ֲZ{OG)7ֲZ{oG)'rzA( \Dn"pCz|(H@(Q.\Og(QDr= EƲc,x%u#*XRNO>X X X4O~"p`"ӓ #ZVkU4ֲZ(ZVkS4ֲZ(ZVkS4ֲZ(eZVKStZ(eQ.\7rzA( \DnH(w+ 2*8߉["E(F#EQ.\7rzlX DIcȲ ӓ+V'OQX9 ӓ+V'OQX9 ӓ+>͓Hi,XHH{|%>J9={%>J9={%>J{%>J=@( \Dn"p(Q DD \Drz:[Dr= EQ.\7`(iYVBrza*X)J+VBrza*X)J+VBrzaҧy)kX86ֲZ{G)'ֲZ{OG)'ֲZ{OG)7ֲZ{oG)'rzA( \Dn"pCD[1NUNJ(Q.\D6Q.\7rzA(Íes*X'JFU|X9 ͓Hi,XHH{|%>J9={%>J9={%>J{%>J=@( \Dn"p(Q ݊p̭ wV2Dr"шrzA( \Dn,;V'?QX7(ʁUS4V(ʁUS4V(ʁO'R >-R9=yp0me_EIc-RNO>eee"p(QDr= E4qQ.r1(Q.\DQ.\7rzA(Íes*X'JFU|X9 {l\gQ{ήqu]G_]PnA:Ͷ܂r[P㛂r u|Cw(C(Ƀ NN)1XHA}@' ,t> =')$N.T{\PߧtZiwrJZiOA~C~̓j%)%h>EGA:)(\7܂rTLA@):or -(\]PnAo -(MA:!;XpI YXHA}@' ,t>SJ Rt:yPC|@{ZN'] JsRbVSt:yP;9PߧtZiwrJZIOA~G~ɣ܂r[P㛂r u|SPnAo*&ܶsSPn灂r -(\[P㛂r u|SPnAo|RbBRt:yPP`)% ):<(C}@N9$ОɅ`jC~TIDATNT+NN)1T+):)1t! ):<(C}@NXprJ>BN'Ӝ|bhOKB|KZiwUJ J}N'{'NT+NN)1T+)EJSJ J}F7{78N܂r[P㛂r u|S1nq@榄 -(܂rktA:)(\7,P`'%.dQ`!ERb(Ƀ NN)1XHA}@zOR iI:\v6T+ιJZiOA~C~Ƀj)%j%>EJSJJ}F'r u|SPnAo -(MA:\^pMASn -(܂rf[PnAo -(MA:!;XpI YXHA}@' ,t>SJ Rt:yPC|@{ZN'] JsRbVSt:yP;9PߧtZiwrJZIOA~G~ɣ܂r[P㛂r u|SPnAo*My ܔz7YA[Ps.(\7܂rߐ ,8Ѕ, ,t>SJ Rt:yPP`)% ):<HOsI!>=-I .Նj9W)1T+):)1t! ):<(C}@NXprJ>BN'Ӝ|bhOKB|KZiwUJ J}N'{'NT+NN)1T+)BN' ,89PP`!EiN>I1%tr!>إP;*%j>EJSJ J}N'{'nT+nN)qD+)< -(MA:)(\7brym;7Nq((܂r umA:)(\7,P`'%.dQ`!ERb(Ƀ NN)1XHA}@zOR iI:\v6T+ιJZiOA~C~Ƀj)%j%>EJSJJ}F'r u|SPnAo -(MA:r78 sSurd[PnA5܂r[P㛂r u|Cw(C(Ƀ NN)1XHA}@' ,t> =')$N.T{\PߧtZiwrJZiOA~C~̓j%)%h>EGA:)(\7܂rTL./m禠)7[PnAN-(\7܂rߐ ,8Ѕ, ,t>SJ Rt:yPP`)% ):<HOsI!>=-I .Նj9W)1T+):BN' ,89PP`!EiN>I1%tr!>إP;*%j>EJSJ J}N'{'nT+nN)qD+)< -(MA:)(\7b ݔM }[PnA:r u|SPnAo -( YܡOJ ]ȢBN' ,89PP`!ERb(Ƀ4'Ӓt:RmVsC~Ƀj)%j>EJSJ J}F7{78N܂r[P㛂r u|S1ඝrk8[PnA:Ͷ܂r[P㛂r u|Cw(C(Ƀ NN)1XHA}@' ,t> =')$N.T{\PߧtZiwrJZiOA~C~̓j%)%h>EGA:)(\7܂rTLA@):or -(\]PnAo -(MA:!;XpI YXHA}@' ,t>SJ Rt:yPC|@{ZN'] JsRbVSt:yP;9PߧtZiwrJZIOA~G~ɣ܂r[P㛂r u|SPnAo*&ܶsSPn灂r -(\[P㛂r u|SPnAo|RbBRt:yPP`)% ):<(C}@N9$ОɅ`jC~NT+NN)1T+):)1t! ):<(C}@NXprJ>BN'Ӝ|bhOKB|KZiwUJ J}N'{'NT+NN)1T+)EJSJ J}F7{78N܂r[P㛂r u|S1nq@榄 -(܂rktA:)(\7,P`'%.dQ`!ERb(Ƀ NN)1XHA}@zOR iI:\v6T+ιJZiOA~C~Ƀj)%j%>EJSJJ}F'r u|SPnAo -(MA:\^pMASn -(܂rf[PnAo -(MA:!;XpI YXHA}@' ,t>SJ Rt:yPC|@{ZN'] JsRbVSt:yP;9PߧtZiwrJZIOA~G~ɣ܂r[P㛂r u|SPnAo*My ܔz7YA[Ps.(\7܂rߐ ,8Ѕ, ,t>SJ Rt:yPP`)% ):<HOsI!>=-I .Նj9W)1T+):)1t! ):<(C}@NXprJ>BN'Ӝ|bhOKB|KZiwUJ J}N'{'NT+NN)1T+)BN' ,89PP`!EiN>I1%tr!>إP;*%j>EJSJ J}N'{'nT+nN)qD+)< -(MA:)(\7brym;7Nq((܂r umA:)(\7,P`'%.dQ`!ERb(Ƀ NN)1XHA}@zOR iI:\v6T+ιJZiOA~C~Ƀj)%j%>EJSJJ}F'r u|SPnAo -(MA:r78 sSurd[PnA5܂r[P㛂r u|Cw(C(Ƀ NN)1XHA}@' ,t> =')$N.T{\PߧtZiwrJZiOA~C~̓j%)%h>EGA:)(\7܂rTL./m禠)7[PnAN-(\7܂rߐ ,8Ѕ, ,t>SJ Rt:yPP`)% ):<HOsI!>=-I .Նj9W)1T+):BN' ,89PP`!EiN>I1%tr!>إP;*%j>EJSJ J}N'{'nT+nN)qD+)< -(MA:)(\7b ݔM }[PnA:r u|SPnAo -( YܡOJ ]ȢBN' ,89PP`!ERb(Ƀ4'Ӓt:RmVsC~Ƀj)%j>EJSJ J}F7{78N܂r[P㛂r u|S1ඝrk8[PnA:Ͷ܂r[P㛂r u|Cw(C(Ƀ NN)1XHA}@' ,t> =')$N.T{\PߧtZiwrJZiOA~C~̓j%)%h>EGA:)(\7܂rTLA@):or -(\]PnAo -(MA:!;XpI YXHA}@' ,t>SJ Rt:yPC|@{ZN'] JsRbVSt:yP;9PߧtZiwrJZIOA~G~ɣ܂r[P㛂r u|SPnAo*&ܶsSPn灂r -(\[P㛂r u|SPnAo|RbBRt:yPP`)% ):<(C}@N9$ОɅ`jC~NT+NN)1T+):)1t! ):<(C}@NXprJ>BN'Ӝ|bhOKB|KZiwUJ J}N'{'NT+NN)1T+)EJSJ J}F7{78N܂r[P㛂r u|S1nq@榄 -(܂rktA:)(\7,P`'%.dQ`!ERb(Ƀ NN)1XHA}@zOR iI:\v6T+ιJZiOA~C~Ƀj)%j%>EJSJJ}F'r u|SPnAo -(MA:\^pMASn -(܂rf[PnAo -(MA:!;XpI YXHA}@' ,t>SJ Rt:yPC|@{ZN'] JsRbVSt:yP;9PߧtZiwrJZIOA~G~ɣ܂r[P㛂r u|SPnAo*My ܔz7YA[Ps.(\7܂rߐ ,8Ѕ, ,t>SJ Rt:yPP`)% ):<HOsI!>=-I .Նj9W)1T+):)1t! ):<(C}@NXprJ>BN'Ӝ|bhOKB|KZiwUJ J}N'{'NT+NN)1T+)BN' ,89PP`!EiN>I1%tr!>إP;*%j>EJSJ J}N'{'nT+nN)qD+)< -(MA:)(\7brym;7Nq((܂r umA:)(\7,P`'%.dQ`!ERb(Ƀ NN)1XHA}@zOR iI:\v6T+ιJZiOA~C~Ƀj)%j%>EJSJJ}F'r u|SPnAo -(MA:r78 sSurd[PnA5܂r[P㛂r u|Cw(C(Ƀ NN)1XHA}@' ,t> =')$N.T{\PߧtZiwrJZiOA~C~̓j%)%h>EGA:)(\7܂rTL./m禠)7[PnAN-(\7܂rߐ ,8Ѕ, ,t>SJ Rt:yPP`)% ):<HOsI!>=-I .Նj9W)1T+):BN' ,89PP`!EiN>I1%tr!>إP;*%j>EJSJ J}N'{'nT+nN)qD+)< -(MA:)(\7b ݔM }[PnA:r u|SPnAo -( YܡOJ ]ȢBN' ,89PP`!ERb(Ƀ4'Ӓt:RmVsC~Ƀj)%j>EJSJ J}F7{78N܂r[P㛂r u|S1ඝrk8[PnA:Ͷ܂r[P㛂r u|Cw(C(Ƀ NN)1XHA}@' ,t> =')$N.T{\PߧtZiwrJZiOA~C~̓j%)%h>EGA:)(\7܂rTLA@):or -(\]PnAo -(MA:!;XpI YXHA}@' ,t>SJ Rt:yPC|@{ZN'] JsRbVSt:yP;9PߧtZiwrJZIOA~G~ɣ܂r[P㛂r u|SPnAo*&ܶsSPn灂r -(\[P㛂r u|SPnAo|RbBRt:yPP`)% ):<(C}@N9$ОɅ`jC~NT+NN)1T+):)1t! ):<(C}@NXprJ>BN'Ӝ|bhOKB|KZiwUJ J}N'{'NT+NN)1T+)EJSJ J}F7{78N܂r[P㛂r u|S1nq@榄 -(܂rktA:)(\7,P`'%.dQ`!ERb(Ƀ NN)1XHA}@zOR iI:\v6T+ιJZiOA~C~Ƀj)%j%>EJSJJ}F'r u|SPnAo -(MA:\^pMASn -(܂rf[PnAo -(MA:!;XpI YXHA}@' ,t>SJ Rt:yPC|@{ZN'] JsRbVSt:yP;9PߧtZiwrJZIOA~G~ɣ܂r[P㛂r u|SPnAo*My ܔz7YA[Ps.(\7܂rߐ ,8Ѕ, ,t>SJ Rt:yPP`)% ):<HOsI!>=-I .Նj9W)1T+):)1t! ):<(C}@NXprJ>BN'Ӝ|bhOKB|KZiwUJ J}N'{'NT+NN)1T+)BN' ,89PP`!EiN>I1%tr!>إP;*%j>EJSJ J}N'{'nT+nN)qD+)< -(MA:)(\7brym;7Nq((܂r umA:)(\7,P`'%.dQ`!ERb(Ƀ NN)1XHA}@zOR iI:\v6T+ιJZiOA~C~Ƀj)%j%>EJSJJ}F'r u|SPnAo -(MA:r78 sSurd[PnA5܂r[P㛂r u|Cw(C(Ƀ NN)1XHA}@' ,t> =')$N.T{\PߧtZiwrJZiOA~C~̓j%)%h>EGA:)(\7܂rTL./m禠)7[PnAN-(\7܂rߐ ,8Ѕ, ,t>SJ Rt:yPP`)% ):<HOsI!>=-I .Նj9W)1T+):BN' ,89PP`!EiN>I1%tr!>إP;*%j>EJSJ J}N'{'nT+nN)qD+)< -(MA:)(\7b ݔM }[PnA:r u|SPnAo -( YܡOJ ]ȢBN' ,89PP`!ERb(Ƀ4'Ӓt:RmVsC~Ƀj)%j>EJSJ J}F7{78N܂r[P㛂r u|S1ඝrk8[PnA:Ͷ܂r[P㛂r u|Cw(C(Ƀ NN)1XHA}@' ,t> =')$N.T{\PߧtZiwrJZiOA~C~̓j%)%h>EGA:)(\7܂rTLA@):or -(\]PnAo -(MA:!;XpI YXHA}@' ,t>SJ Rt:yPC|@{ZN'] JsRbVSt:yP;9PߧtZiwrJZIOA~G~ɣ܂r[P㛂r u|SPnAo*&ܶsSPn灂r -(\[P㛂r u|SPnAo|RbBRt:yPP`)% ):<(C}@N9$ОɅ`jC~NT+NN)1T+):)1t! ):<(C}@NXprJ>BN'Ӝ|bhOKB|KZiwUJ J}N'{'NT+NN)1T+)EJSJ J}F7{78N܂r[P㛂r u|S1nq@榄 -(܂rktA:)(\7,P`'%.dQ`!ERb(Ƀ NN)1XHA}@zOR iI:\v6T+ιJZiOA~C~Ƀj)%j%>EJSJJ}F'r u|SPnAo -(MA:\^pMASn -(܂rf[PnAo -(MA:!;XpI YXHA}@' ,t>SJ Rt:yPC|@{ZN'] JsRbVSt:yP;9PߧtZiwrJZIOA~G~ɣ܂r[P㛂r u|SPnAo*My ܔz7YA[Ps.(\7܂rߐ ,8Ѕ, ,t>SJ Rt:yPP`)% ):<HOsI!>=-I .Նj9W)1T+):)1t! ):<(C}@NXprJ>BN'Ӝ|bhOKB|KZiwUJ J}N'{'NT+NN)1T+)BN' ,89PP`!EiN>I1%tr!>إP;*%j>EJSJ J}N'{'nT+nN)qD+)< -(MA:)(\7brym;7Nq((܂r umA:)(\7,P`'%.dQ`!ERb(Ƀ NN)1XHA}@zOR iI:\v6T+ιJZiOA~C~Ƀj)%j%>EJSJJ}F'r u|SPnAo -(MA:r78 sSurd[PnA5܂r[P㛂r u|Cw(C(Ƀ NN)1XHA}@' ,t> =')$N.T{\PߧtZiwrJZiOA~C~̓j%)%h>EGA:)(\7܂rTL./m禠)7[PnAN-(\7܂rߐ ,8Ѕ, ,t>SJ Rt:yPP`)% ):<HOsI!>=-I .Նj9W)1T+):BN' ,89PP`!EiN>I1%tr!>إP;*%j>EJSJ J}N'{'nT+nN)qD+)< -(MA:)(\7b ݔM }[PnA:r u|SPnAo -( YܡOJ ]ȢBN' ,89PP`!ERb(Ƀ4'Ӓt:RmVsC~Ƀj)%j>EJSJ J}F7{78N܂r[P㛂r u|S1ඝrk8[PnA:Ͷ܂r[P㛂r u|Cw(C(Ƀ NN)1XHA}@' ,t> =')$N.T{\PߧtZiwrJZiOA~C~̓j%)%h>EGA:)(\7܂rTLA@):or -(\]PnAo -(MA:!;XpI YXHA}@' ,t>SJ Rt:yPC|@{ZN'] JsRbVSt:yP;9PߧtZiwrJZIOA~G~ɣ܂r[P㛂r u|SPnAo*&ܶsSPn灂r -(\[P㛂r u|SPnAo|RbBRt:yPP`)% ):<(C}@N9$ОɅ`jC~NT+NN)1T+):)1t! ):<(C}@NXprJ>BN'Ӝ|bhOKB|KZiwUJ J}N'{'NT+NN)1T+)EJSJ J}F7{78N܂r[P㛂r u|S1nq@榄 -(܂rktA:)(\7,P`'%.dQ`!ERb(Ƀ NN)1XHA}@zOR iI:\v6T+ιJZiOA~C~Ƀj)%j%>EJSJJ}F'r u|SPnAo -(MA:\^pMASn -(܂rf[PnAo -(MA:!;XpI YXHA}@' ,t>SJ Rt:yPC|@{ZN'] JsRbVSt:yP;9PߧtZiwrJZIOA~G~ɣ܂r[P㛂r u|SPnAo*My ܔz7YA[Ps.(\7܂rߐ ,8Ѕ, ,t>SJ Rt:yPP`)% ):<HOsI!>=-I .Նj9W)1T+):)1t! ):<(C}@NXprJ>BN'Ӝ|bhOKB|KZiwUJ J}N'{'NT+NN)1T+)BN' ,89PP`!EiN>I1%tr!>إP;*%j>EJSJ J}N'{'nT+nN)qD+)< -(MA:)(\7brym;7Nq((܂r umA:)(\7,P`'%.dQ`!ERb(Ƀ NN)1XHA}@zOR iI:\v6T+ιJZiOA~C~Ƀj)%j%>EJSJJ}F'r u|SPnAo -(MA:r78 sSurd[PnA5܂r[P㛂r u|Cw(C(Ƀ NN)1XHA}@' ,t> =')$N.T{\PߧtZiwrJZiOA~C~̓j%)%h>EGA:)(\7܂rTL./m禠)7[PnAN-(\7܂rߐ ,8Ѕ, ,t>SJ Rt:yPP`)% ):<HOsI!>=-I .Նj9W)1T+):BN' ,89PP`!EiN>I1%tr!>إP;*%j>EJSJ J}N'{'nT+nN)qD+)< -(MA:)(\7b ݔM }[PnA:r u|SPnAo -( YܡOJ ]ȢBN' ,89PP`!ERb(Ƀ4'Ӓt:RmVsC~Ƀj)%j>EJSJ J}F7{78N܂r[P㛂r u|S1ඝrk8[PnA:Ͷ܂r[P㛂r u|Cw(C(Ƀ NN)1XHA}@' ,t> =')$N.T{\PߧtZiwrJZiOA~C~̓j%)%h>EGA:)(\7܂rTLA@):o%Acsi 7t8@yꩧ?9:FC?y<u׿޹w;@}u_}'C?coo}Ǻ;{g{CG?c~:~su_)_7s1vm0>uoܜS ,Ly{nt饗Z>i>T:~o(h*flmHOJiF'Z{衇?mfsI?6P_Nb…ß5b7kmPkC?ck] Q(kv.gzn ʭr<0t=6&81F8ct\KM\R\EߘN_tiҬIG6)P&. ?|D>o +C!EoNp퐘cR\hկ~eiXw]tQOXϛݵ^kiXWn;3N:i͝Ir]wqW_=YmN?/y7~(W??uZpp bvZIwZW"ZT=Iw(04Pg0Ct] C}Xꃹ ]_җ}?>МkC}@zкoӖ^Ӗ^⃹j s&6T+Ck s\ن K JкV^uIs׽u݋_3ʽoXO?ݝviݻN\ {5tw- tk=IYgթNmR{w{Ī|s-t]wj#)7i@&պf b+KׅO9Ǻڨb1)P2%o#>e,DY)|4sN)p8 Z_zFo?{)M(.NrC`+hTx;ݮ/O}pԣs1`6\2շVAq6@|ouo8@Q!}3/r5TsNj)P9}ӟ KG_r' A)&}7`#<؃r5;Irł`vCni{Nh%;s-`|߇]X9X&;XPgL^ι sSP`aokC}0ѮRzt\bD|<'Xӆ%SОUm~?7ZiZm~P6mh_rmV%uG~Kۼ/r5^Y1So~{`{{yTϏ|#;=(m ?>Ovz><8F_q%Xϙj+rogڱZ;Lrr=ؿԯ4 m];Nr 6`r_] m(WL `ncAT6M\陊~P)4,W굻|S=P8Nq rk llcpn(w +-@;!Krǂq;6(WAlv CK)A0;}G.} ̽;-=e\Nrusu+_>۠ܡ?>Nrǀ_rr;Z4pUt,xJw^hZ\0w܆rPꃹጱy܆rо LYꃹ g]=w!6 <ڿ)B׆׆`l܆C}Xن U\ن K JкV^u sE@6۠\# 26ܱ۠`jrPwmP֤ƀ u]Ҡ1`ֿm)A:W.+g%ۇrǀvK)m/\7w,DYӺ5tZp;q@XA7Ŧ\͉q[(mcG\c4HruU WWrmPnc}(x&m\!9`Jj~pPKr0W&E@vvru0W 65J wvuw -} WS۬\3 e6l*>볊[>xX簠)7r^;ESp(W=o B: w!U%s۷V\ڹҤ]3qh/`vCShr>;s5Vlr3NrI}kAw}`0W' 9oc|@կn|4(~O%i]r!.ڤ@W7t㬍/|{ۆv8G&9:n){U(kbCvUo:j\ + CS->8Cy%ֆ`.8C*=>=?Qz(_Ssfsyu__ T/\ <֥x- wiW@nU6mSZz?JFZ 6)POQ6j mPxǰ Prd\1 ұ &S<\FsyֽOb2^C޳uLs{ Ȝ[p=j.(W޹hcNqOrWvW1[g &+UM4 ]rvWY);嶉w)w(T}YJƾRsus}(W; >*PnHAY~}(W5@qUW'> Շs=;SͥIr \Ga*o>۠\~*ύM +BAh#;s-`(up\AjhOw(pZm3T#({XЛ? ,ߤՆ`.8C5\#ň1qI}@⛴PFؿHO[zmhO[zm6ߤՆjfs\{Rmh_rmVI]}T+K њ>} AvTv ~_-4(W^xgj mިR\Fpq~pT0WW_7P<:U>)Pr=)Gs-ۇrxS\Fo}(h`qU(W|푫ǧ@ʋb۠\}?)(WP0WlDwq,7|(4\0׉^|pi稠sXI|rkj.S7")eDAǭwSE;5Uum=&CvU0$(MA혫: w,*'}ҷ!vCI q1o\ѷuc \}i'ضKud7vV$(WO)WPA`nf>}n&t$(W~{7\j] jWU{풫GݠO' ~c\*o$\qmWoڐŝ90TAA`A`/?YܡT9 hݮv=XdX9&Ն`N8Cusڑ]9Yw<hI> =%SО]%mhI J=͒6/6T+6K~PӺV^5ynӠ?~ϘIP<&m (WCZַKLR$(W0z9샹gׂZK袋3<)6&P.IP{uZ_::O} Nsvm`v ^ ԵO}(Z\{e+fBZۀQb\FC8h\age T$Agbc7w)45 z!-9֙VLq@y`n(Wo{O59hopr[NGs۷u4Zr $ۿi\DRU(w wC^gHФX?9W*ׇrAF5u^s]Ljg>3}]rX7UmҠv宂P/^:UmҠ\jjoPk_v75Pn&8UmҠ\t܇rW>; j*uPit< | 5+ YܡO pjnW>+x+ߤԆ`n8C\^5e/F( ,8I iN]7iK iK jĹ ojC~fs\{6K~P;uIQ/6DkFPҠ3 }ӛ0W}(W WWҠ\u ]sz_ۇr;;*7 mPo}?ho(풫Ǜoyos*ߤA6 ]뺏Fru}r < Um{$0Wl@mT)4(W9 rĽ^Lr_i1 sFܖaxr`ۣq\S]y ݔM }m=$wj ir:0?yCԵIrM0j2ɞMC)'ܤAki'[7P>Ikv"<\A |w>c@69&0W@nwqލ.o}SPrۇrK\}}(wʛ6Pr;3w~k^@᪚ c\MuЩBKt9,ljCyTJCcHvm6gFvj;NO{;GXp}PMAƺ)wn ojC}@z[M}@zkC|@{kC|,mnCvmV,qnCkC~fs\{.)>׆hݥM*+x{`^>-oy N8a t56U mP?ӆ' w3>PjUmz{QMѠ\NC"j чr_T(W9=rܩaVT(W5\ m풫!>PruY{p6Pn d7Jrр\= mC;j˿KHs&ʕVvb)ŝM.`(σv F!;Xaֆ`Spj|N}{SP`aL·]M:71b5 cr=P6. ׆׆`ӵY܆9Pߏ6/6T+cj K J$V^u6P< գ`6aƧ>YR\E7/½r5чroYiB`[ne* t^ŧBUM={*qhPSgF;E='(>Os&ʕV .So?7>zs  Ri\Vktpe=gC;gک;kn;uRiP;5g] ݤM|m=nFi(5՝rf\fds]p PՇ>)sf Pj^szt(yFl>ۍJr\$:ݣҡ\Mw/)??fM:]ݩqnTKwcC9jW++{,P`aaԆ0 W(8='Xפ>T9PlPmh=s1BK}@)|sX> =mf> =m!>=m!>8,anCT9POU%mh_rmV裡R6/6T+S0}T+K ѺKs%@6|[gO(Wѯ܋.ӎSg=\5N?Ov6P Zf\9Nrֺg97j5Or[m;7Mr:0w o(i( }.zr0 jGa@mIӜ|)Pn` rnXY(WjW}Hsؾo*{Ne7qYꠟKgvKr[s/&|(Wu'0WoHm6mZ߄oa-`m7asMԆ,P`a7]Â3T㶫&JͦkC}ppF3K_ȵ Sfӵ> =mʺF> =m!>=m!>8ڤmh7 JI~POY K Ju9yJkCf)Pnr_/:Nuϵ(W <ǹ_ \_{Hm6hg\<7^o Pn?W]gn=(Wuhl:k.U}0wLI;<곩l=[Qf@yBG|S^Trsǃ mǯ.;7n3AM>aݝQrsCц>F =OvF>0sB>|h?p׆ni!Pj<֍8כ9\ކ6n殍nkC`l O~qwm\{]Zp}3'o[mg׆~6?[7;N  շ8s;|+8묳g}͜Ptr){C7I8餓6N<Į~];N8a?7_e}86w=~R̜PvBTC }. ֆ, Ex6:?nm\gN陶N݉ K ޳Dюw7T,,6 iK iK iK .mh_rmVwmnCkCڼmH_hݵyڼo[6{6tֹ57{'mwؿ;S^sSO=uvi]u .͜Pڽz@['_кVzY|;w۵q%t;ծ#%_kAצkVmKm}KmKvЮmq{kNmrnZlzo5宮꺰nh-Rr~s_y:w-|ݺbZO׆Umh H5'5u|PN׸ CnuOʕWl͑[xw6E"P8EV)qq@fJa*{s(wu q76h#S-jCuhs$PjnbRC躡Gϟ $}h[7  ۆ ꃕ1d˽ۭVw߽?뮮 /~nκsB)m5~s?z~?wm\y]_~ye]ֵUj_? $ysBugOD}?ݵO~kD׆nѿin&o0Ff!.Nmr?uo}[v/hC?1Ʈ7 ];׾5yMƫ^W]x+6^wo~󛭺sB"a=*3t!V=+έ Y!kC|8xo\@!kC|`A덻9jC׆oՆ׆+-666!~!ZwmG6/}GڼmH_hݵyڼo[6/zы6^wm~sOkN(W*{{{~۽=vYo{;񎮍w]{ݝ ^wuBʷv_S5 k5/~]6هƍ7hfN(WtR_Yײۚ暽6ѣΏ2'+ 5 k5˶u6jP֛ԜP־>֫_^}кxͨ~]tN(Ŵ;e(*nf& u<@ r6EZÜL/(vʍҠM6¥Ar\M`Ƴ P>8(Wfuj P>;(׽qP\}ͶCZM66dqgp`,`!pkC|T8}@!B ֆ+XH\XXzmgK3f厩 ې~ks^u}tnC}D|CmH_zm]ͮens Pe]r*7 nun P n;+Hoۡ\wi]u=\+`^q@+M4(wŞ6¡PCws]r۷Pv]Єw}S~͜P>&씫on:շnvnNmr⊈rʭr?•t!'\SkC|@ A ( `a鵡 3 'F=?^1`pƘpf.pe6/6D܆V ܆׆hݵyڼo[6K)W&Nn喈ro6ĜPvM)Gj3'G낧sBZCL)mr]hP&7rs*f_Pn.0'ߺ0윣9\~.=N is;Q̜P_֍՟8ߏsG4[9\yg9pC4O?twϫí͜PɛOCc=ֵPFxnRA|'?)&}%Ws\u%.dQp0k^[u7dq K jz K 1smK ^Ӗ޿(p׆mhmj~ɵZiO;Zi_rmVwmnCkCڼmvmWs œ;c{?7[w֣~ϹS9z5#kYਆS ZC"kQ:Hk[кfN(WG[$k j]m(6tM{ &/^&T9dl`(D\7YuͭkYf5˦ fS}Ncs;6rwsCmk r[ןa Ow(06Î';X8lmc^ cr;X ,1O}@1y%RP`!AinN)qht >=)%`jC~r’kC}@%׆ K iKr> =m!>=m!>إP/7T+K JkC~P/6T+KrZI_zmV\rZP)({pm =6\rMA -y~KTҺ"XPnAS=%P\C+?S[P͂r u|SPnAo|RbBRt:yPP`)% ):<(C}@N9$ОɅ`jC~NT+NN)1T+):SJ Rt:yPC|@{ZN'] JsRbVSt:yP;9PߧtZiwrJZIOA~G~ɣ܂r[P㛂r u|SPnAo*My܂rEJSJ J}F7{78N܂r[P㛂r u|S1nq@榄 -(܂rktA:)(\7,P`'%.dQ`!ERb(Ƀ NN)1XHA}@zOR iI:\v6T+ιJZiOA~C~Ƀj)%j%>EJSJJ}F'r u|SPnAo -(MA:\^pMASn m<oϻ~ZQ:4k:t.(NJ_=SG:F5ӟ6ڤC?~׵m<{^so~otmH}]{=<@wnWڸ{|3y׸O~򓮍뮻Ӹk5\ӵq7ڵ?߽;CG?c;?7??kC m|k_W]~vPog?YP=Cw6!Ϩ6FuukCw(6X[yFK_/<(ԏ9PP`aڸ́ n^-0jC}@zغv> =m!>=m!>tm4~o6T+ck K JTY܆%׆j%~l]{G~K|SdCZк]t _ܵq%tƥ^s=VmtZի?iw'v?9tL[[>ƭڭm.nmorMrۚԣ>:~nu<#]zs~sC W:O>㝜1Z֝׍~zo!mkz_uߣVSٻk>C׉fv.Ak4vqVC]6@yC)?H:~qT\K@"VӾ7:mBocmrӐ RTQ?ܖ&m:տ :d\y@H@Bt\7{챮 }Hp|*'}8Mᄏ뮻ǝwٵ_[7to}tj|tM{ 6.첮}{]fiFn8Ir_guVO|bo~N8S;SN9e|]'tR&ʽ _׾5yMƫ^W]x+6^wo~󛭺PioEQxF1dqg 9}{'Wڮ YܡsRjC} 8C?c&ޟ9>SBm6g5b밮ZsRjC}@zSŤoӖ^Ӗ^MfsߤԆjީMʼj~ɵZiwjԹ K JSyJkC&m^um/x_o}Lr ~s;o|c7i-ox[ڵ񶷽kxGƻ\AZK9s~Cj3ص/ Nm\/`o??6ꮍmh9Ir+Wh#67o§PZ x≮ }0D"+>}PY *O,'BmtL1$"mu9uq5beGgASnr\{pN(Wuc@CZ4(W5)\PrtZ4(Wmĝ=jK߰X(WtڤAW^?ruM+h@X(W7$A{ oxCc\zo:IrmM!^#;s/`htڌjC}@ZA.~P sSP`aɵ>97.M}@ꛤPFֿHO[zmhO[zm͒6S$Նj&iG~P,ynCkC~O6ZI_zmAP^2>h+P';}̪M{WtP_iP䎅r+~NmҠ\]ϴهqBXڤAұO@ $A[qd]4 ]L溛RiN(w uXT1GIF(Ȭ;]j-r^Anp.(T@\iXqkuJ@>L ?m6 wj(4 SC.̝)ܡ?:oHrvuJ(wvշӧN1<%;s.`>ۖrjC}@h0Cqw(B%׆`N8c0C'K}@SZmHO#uIXXzmhO[zm6ߤՆj&mG~Pߓ,}nCkC~O8ZI_zm6hoӆ6ra\ZSʽ{IP~SBKۀܩ\'c\nտr R!@{o3uaeE h\g*xM{)7sAs]d]r( Uם$$A~r r0҇rg8?|x?0w >x?􁽍OuC;?JoчrXnagڸ6ڮ -)Ν@@7t KnrQw^}|k_8s;|+P[(W7E7[N|;N8ao|/ҵkC?gƻrkS~B~x*VpBՓ,̹Vֿ7dq $PP`ahmZWSc=b? CsJ \pv:zXӆE%oӖ^Ӗ^9k 7iZiZm~P6mh_rmV%uG~s׽u]^x93ic=\=㻓N:io8S6N=ԮN;kCryu>uw]tQw󝮍~]!WD'9Z*u[n[OӮ rmi?%OS\˶u>JyJG];t]X7[(WZ^r'8d<3]J瞳kjzffb&G?|nl|SA:_>_^Kul 2R9sPa넝r*`´S3]K&c@5Jr $|1)P>\.cяMr@Q{CM {9ծ/6 PPܟ= [;+NU3Ɨv.St,P`ah>> Xh}hm8 CsN \p*${ ?8 , 16 Kj> =m!>=m!>60~okC~?60~ɵZiZm~PK꼏j%~!Zwin~{YC>gIPM}\ +m!(Wk Z{Z/y(W`m-cS\]܇~؆M 5>Oۛ&MU(W*+(w.sSE#p;:vsUPn9u m2ج~kgwn࠘(W7'c6U}R\}AP+M}(WF>B P9ܾgrs=e\o}PmMK)5EwZXIQ )Xꃹ"C:qXwbm3#Z9>SkC}@zڐM}@zkC|@{kC|0WmanCP$ֆj~hmanCkC~?62~ɵZIRyJkC&?(.;)P~5ArT:}|R\br;M/(Ww}>k0ױ Pֻ/\ ȝK/y(WDFfD\&@%67e6zyҪ븺uBǝm&ܔ:F (76PnXs*Ov'7|$@>{;$@~ !&χrtљpIr;iQ9zCwZX]dOr ;X16s;@XPg@x;I}@!I iCcR7iK iK \ن C}X!ٖ K Jl܆%׆j%~H]}T+K ѺKs(c݇rux<.U UW]Q(Wkr{]wE&}(7V{5ڇrS(W6(Wu9__M=) (_; ((vʍ@A_\rS|+շPn(WC)d\$Prd}xKH%@5픫o?sIrO<@ Q Pn+-Ԇ,lb#!;XzpFJm3VwJ+(07>x , MjmHORڿHO[zmhO[zm6mhPͶmh_rmVf[6/6T+CG>QLOCτ_CMr6(Wv"p  {0[TPnACu|^2dwRۂr Mr5Kx%@HsS>%@Ń>Snʇ(W7 =mH]tLj> =m!>=m!>60~okC~?62~ɵZiRm~PKj%~!Zwin^xm\m>+Hw{q\m sNZr ;j]<6frK;;!F@C,c -nNsWASn ,8IHr' Pl<&@CշMjvm`n (W79=0W7Rn%@\sM{\5uQ,̵ < , 5>P\P$ֆ`8#>ߤֆ!u1׆׆`lf}T+CS0~ɵZiRm~PKj%~!Zwinq_ oxCyC]կ }/y\+}}(W8ϝ {=썔 \qO>s1UZҠTP0hrz:2]ʕGi#9$$NR\պ?T^y2&U]NO=ԡE5Nr{{dusn>Wo}(;M\r%PW\Q(W9nj\}z1ydA>5b83F[bJOʓ , => $mXPg~snÆt(04P6.:.SОUm~?7ZiZm~P6mh_rmV%uG~4Ir}(=yޯ9ql 5SuQS\msWK|Iru}}(W_@=B3UʣA>lDm\Fy4v">M)WC Lr,#>E uvx> ʭr<04[PrS\5&a7(WuhIn)Pj @L)W7Bn@<>ha_oRo}[Pn&|k;/& Ѯˇ3j_0՟.z}C/6saڮiX I \pFx{\'uX , 96 K-6-6sfsojC~Oj K Jl܆%׆j%~h]R}T+K ѺKs(WROh7~;Umn5I,=6U-K%얛jMc1a7٠\/>>U-vMrxy0ʝVW 2Wϵ7\PF8N.oL/}/&A6|u.0& %A>}ݝNSJ]wݵwDPnvmR\檫Fn=(WO.'U.ѳ-$Iw\vmI,P`P gV^w>MZm3TOPojC}@zKb> =m!>=m!>6K~O|V{Rmh_rmVIm>~ɵZI'uIQ/6D.m\M}3P RP`&6s RP`î i.i׆׆`,ynC=MRmVim<~ɵZiY܆%׆j%%mG~4Ir屫z}&6W\q>+0W%}_Nu|+MmA?MrU]{キ;l07 Um~07 ]$(WK9l0Hrk܂Xs?O^oæoe8w}A\PnV_z-OѩM4 탹_~ ?7꒠6|ꩧw3td ц[$(W@4aAz7p7+zCκqцvMTպY]r{5}_kC7 4(& 9~GSS':?na'?ڸ: ճ ճ?ڤ@]v+(WN1kh"n_׺6կvַlߤ@&vdҗ]aHv YܙsCcnZ\OuQܥ^j׆,P`P g3v7c|sԎ>)6sUwnYן1!,H^i> =%SОYmh'I J=6/6T+6I>%׆j%%qG~K|SIQ;6 U.O|9쁹r5t.qwm\r%ݺ{}vU$(Wk Wvg?j[u͏htJjР\E 뽼nh'HyO%AZڪZ\S>{kyl AN]jZ wU|p֌)PƓ&`?WӠ\guܡA,ҜP4j45.(vʍ\PۮƬkcAP*;db&պ?pe Cn?O4(Wڇ>Dz$T7t#rچ~ĩM C~۸my]/u?yn M//׵ѿaֿn(W7u풫GLlO8Ӻ6N=NSN'|rI';Irqn6(}mk^󚮍WU]|+6^Wtm/7[uQ-՝V(,̵!x:{1; , =_> =of=G(04PP`ahm " =mh]R7iK iK \ن C}Xن K Jl܆%׆j%~h]R}T+K њ .Ů f!.ފ֠ںTphs6#smeZ\7)P@ܶvm`n{o@ n0 HzA+=]:v}e'\1%cXw* u=`Cn;ܡ;Pi(w FkjX٭gMZ];߸Kr7jx<UGXr&dP>8Irٹ_Vmvuw(W7TCڿ:+0WмS(W7`dqg sf Lw(0lj> XwJ zQP`ahN>X"X96 Kj> =m!>=m!>60~okC~?60~ɵZiZm~PK꼏j%~!Z6A/{ˬ{)P7٠\PKr;ncj(jtMA.@n庻@C\C\ennP[WL ʭr<4(wŞ6¥Av]NsBK)wN(W ; )w;wʝ]Ns.ONA@wʝpkC}D8)Bs96K3/GPP`aoWP6. K iK \ن C}Xن K Jl܆%׆j%~h]R}T+K њ<֝rrSPwʝʭrcn픻[;NʚQv-t|8 N𓷭Jr69\ijy4U=!p唝ru݃ۿ?sц[r~m6JR\=PxFgo?s's8Ť{wA|֍nk'?I׆~&Ikڣ[r /m| -}k_jukSrBC?Sֆ,̵us^zvmPg}9G}@9%ֆ`.8C˹|3G}@y%ֆuI-6-6sf6MbmVf6/6T+Ck s\uIQ/6DR6ԧ6 DNCuW㢋.Z;.⮍K.[74/pӔr7ܭzknm&ڹ۱);*EuG eGykC@vujS69h-'&ݴ!GwZaCw(pzzMꃹL<X2M?\pƦuy= , !R5͋9G|@{ZyRmVV5͉j~hQ'jJ<ZIOKrZI'y$K~whN)P|7y\ IC_+&Kr7yk@Cq)P&5}(wh{p)7P"uȹڐR>B!yQ6> =-Y܈hORmV=qܨVO~hQj>YrZI?k?J}G~NrZP)({pm =6\rMAgݒt)7[PnAΤ܂r[P㛂r u|Cw(C(Ƀ NN)1XHA}@' ,t> =')$N.T{\PߧtZiwrJZiOA~C~̓j%)%h>EGA:)(\7܂rTX8 sOBi~܂r -(׹.[P㛂r u|SPnAo|RbBRt:yPP`)% ):<(C}@N9$ОɅ`jC~NT+NN)1T+):)1t! ):<(C}@NXprJ>BN'Ӝ|bhOKB|KZiwUJ J}N'{'NT+NN)1T+)BN' ,89PP`!EiN>I1%tr!>إP;*%j>EJSJ J}N'{'nT+nN)qD+)< -(MA:)(\7brym;7Nq((܂r umA:)(\7,P`'%.dQ`!ERb(Ƀ NN)1XHA}@zOR iI:\v6T+ιJZiOA~C~Ƀj)%j%>EJSJJ}F'r u|SPnAo -(MA:r78 sSurdsAyxt ?yz޿ M|sa(WӟhChz6:WP{ꩧ?9ur7|ɵ'Vn~׵1Tj)PnR=<ڸ6~_ums=]w}ws?7Mw7wmH;8rckkkڸ꫻6~wmG?~еxg\Ss98Ygյ/k_bƙgi|sgqFg>s?|ϧC?яv{{|Cw;=ykh\;wmo8c67wCrXwLOO 6dqg/}KErkCw(04PP`ahmtnzOCG}@9%ֆ Ck3gCjXXrmHOZM}@zkC|@{kC|0WmanCP$ֆj~hmanCkC~?6>%׆j%~h]R}T+K њ;A,n}FyhaVkHY$?gl\ds=mi  ?Cw?xvЇ6M {ZV70ڸ;6~_to}ïS$(AW^ye_޵qeumF[\rI_ܵqEuY& ?}'6N?N;kSO4N9q'wmtI{7$@17{ް?^w}kk^󚮍WU]|+6^Wtm/4tȩMm`G#;s-`|6Zu<C9%ֆ`.8կ~lqan , Mbm(06&q s07\ӆ%SОUm~?7ZiZm~PM⼏j~ɵZIZyJkC&m^um/x^fJro'}c7M-oyKFÆm]x׻ q)P@ڶ56>vm7h}豿C6 ꪫڤ@k֥?aF1mCe u$AM: 7o@ԇy۟:Ir}FS ڸ^NmRܣmPH0h";5xF1庞qYq:2]_;bOҠܥ;'Is( PZ7庻;׫v(w;ι3<%; AvZwÊ!;XӜp[%fNpŭ fN8Ch(04P6.׆׆`l܆I Jl܆%׆j~hmanCkC~?.>׆hM hz0n P PkvP +NN߽{ wWvK8NqXzw)P@Og)T[);J_g1W wҝQAS¶kg]XqS)PnR۠?=Viۦfj5WߴºS#Nm3Aɠ67r?я^Sͬo_HrRg}hF㗿zV{380ʻ ϒg4woۻ6B\=׾_pOI)wA샧Z}nm\ STo6}{\z , =_> Θg9ւ`~rJ , Mbm3qZ_9b9G}@9*2UmHOZM}@zkC|@{kC|0WmanCP$ֆj~hmanCkC~?60~ɵZIZyJkC&mP}Sn}Lrz'ܿO{>}C]'p vWp饗:ԿR~k Zchsм]w^5Ln)6)P u.ǟ'n܆vmr-{kG}s7Jrok;u bh[T`+fIP־mܦnmR܃vk<ҟkј>\k3y$6i޺)~|ZL^8 $_nrEy5UCprE0\wBrIr& 4:L'[E<r#[y?ޱϙաQv )PXwqGܓO>y>c3Aϛՠx} ڐŝ0F}{_uw ,mh> ZG sp(0V9jC}01>'74~P6TѿHOB瘣6 5qsԆ 6 sÐ瘣6T+CtMqL܆)ty9jC~?D$mhB瘣6T+C4Muj%~*Cgs/}KGJrH;SwG>=p@c4(w+(WCLrІB7|&(jns@cu6s+]c3C!^_}(wŋ能>o;VŐAޱM{N¦L@MQsLaym'8y-(vʍ@*7`@*;bMP 掙Dm & շmǂ6)mrU w9۶@Msj|UmrU գ?Om .bhw1!; M*/ Yܡ˜)kC} gSCXpν3umR sB.nG}@1ةkC}@z67ickC|@{6kC|^Ü~?4~PSmc? cةkC~O96ߏJc J=67JX4~s/掹-Pn\A .{mrG`vm`6Gq뢸mrE`)0Ws)mrUvCl \+V`LmU w n L R)Um -v50c,Fv9mo;}0wj۠\էj^o mo}Lk晻{}ml܋.hнMPj#0AzO כmrUO?}}<&6AMC;}ŝ զ!gnNUd8C\Xpr㦬 A2zB:n(MY\}cNY\}c⦬ jsXsǜ7vP߻ܸÜ~jt㦬 Jэ;̹ F7nP߻MٿVhtc Ѻr5mPvi탹_lܳ:k/n̽[\Q׭mr[m`t\զr5&(W5胹[\?_+ֱcŘ\\{mrey((ywiӡv̥0mMd4܉6B$hT;6(WC toCZ-WmrUnmo\AcmrUեymrU;n}_ۿ]mrUB4\ߐŝ%,`h'maFnmܜMUt8C5/&?4XsةjC}gd]SP`kLT> =m1So;UmhOoLT!>XBmknCsNU{WߘÚ~?F;UmV]}cknCnTZIwSߏOUu)s /PvG>]Fo۠\-W \pA?ѪͶA4roN`mrUij`#(f۠\iurw6(Wu{yi揩\"%jS`nu H-(7|!]s6B& u?n#m`>t9F(Wuh~av\~AcvF(W8=0NwF(+܇r[sQ6B nm0T56nP,P]0>1zC}@ߍ6K3V'KGXpjC}@z}cb7&vО6FߘةjC|܆1~LZioLamhoLZiύ= 1qSՆj%~1So1NUu)s?~}_oݛF(W~Wn#:{Pƍ7hf\զ{u.x\wmr9JrР1n#+VFm#kx2g^Q1 e49K*OV@6^rcUjV(WAHo+3CO;Mq[\գA5ש.@.@ Pn9(_U]r?[!;KY~WjFwSdq N>SLQꃥzsXsLQ%.M}@OӇ3P6F9ۿHOsuM7EmhOBSԆ`)9 97EmVjtcnCmlZiэ? qSԆj%~1So1NQuIs?,p[_PN>V(W^p.B<>{뭷Z(]rk(r4 -xչT̴2O{Xϥ@mKrSnAV] ]͋rF7 ]_;q;ߵMW;ߵ^PYYƗr">X ] ]߿ RB Rp uaPvXuS`a!>=m!>XJmcnCAZi?܆%׆jjss\êT>׆h]w-((~{+j_j[P 7NwmĐ]rXP }#. ѼHcMkb 7鷱UPn%@ʱ{M ]_}Aՙ@mNz/w+(wM?{IG}\wm)W~9|;7oqO?P_nfw}{U.=Z8okՆ,P`aB7~P,ΐGSjC}8CvУ{+Xpr3UmHOэSj7UmhOэ6KamviG~'܆1ةjC~wXshtc JmlTj%~F7~Kۼuۇr_YuN;m>=36?; ]^wrKAkj# عoN_\lNZCb lNb' =<-(\ZqX1q@a^7獛jSwU~} WvjÍƐxQڡyΩQ~ գ;6(WO>j\pꯚꛘz!C}rgx= AO()o}+otmpw!o-h>N{]%W`I'xVm ׾wιo h[u YI_P^]qJՒ,P`9Wcb A:NyiN(4&fP^z @nF;:>Ә)kC}@zn4Wߘ)kC|@{n씵!>HamhwϽ7emV]namhw5qSֆj܆{W7emV]}cT+c4Sֆh]r_wr:o++_wf۠\wG4*6Z[::H?;} ׅU"-a>zyVLOsQPnT(!wlcp.(wyѿ+r5r' IP&~M>?kr4$(W眎m)R0nS$(wDtmCv{r >TiAC7)tB0n]tQ~O@.<O4To~)K|3s8)P{"_կuCr }m]kt}Jr_DC  ܟLWmΜ nM-̸;W6dq oՆ`N8cLm7Xؔo \pzh:1fWn , MbmHOZؿHO[zmhO[zm͘>{⛴Po6 s\ن K JкV^{Rٽ%/^?h MrWkSІJN8amPWU6IP~?t_ꫯ!W)PqC{gy;P]Ơ6(W5$vl \]ԚACuӟ@bwxQk~Fh4(WR\I;Vu1@Y=ku=keƲO5qh̺ =LYz7\PFn1Mis@ruGuwS)P&D@׍Uw.g ਱a8*l@ 6)PnRCZ iCm;/~ѭm\=6)P=,V+_~ye]ֵ}kK.XrUozs9ݧ?'>ѵqwm觵8S; mmkkʻo|7 }׾v5xի^յWk۠ܟvm\֍E=EwZЍ)чڐ , )6s)|sJ}@I \p:{ KCqXWbmHOZM}@zkC|@{kC|0WmanCP$ֆj~hmanCkC~?60~ɵZIZyJkC&m㶡r5^җbCQ(W'ܿOozӛ[򖮍]o{ۺ6.zMtR\ng?ٮ}s]gyfŮ6(%WIrk-KQ؆vm?q׆ 6Ƣчr]rU(W@{[ԣVG#&)}@~զ;εF1)P~Ukm|'бFrP{Qm\1%G&w V1M+ {l;usךw<[;y`IP& mKr&$nj(W蘉e USC3@)\}8SmruSeLm<6 P?+|Lm\y k9=[=\ ~pl;zCw(0ω> XkXߌuZ C}X%cv9>P iCڿHO[zmhO[zm6mhP6mh_rmVf6/6T+C:ZI_zm*+ w=(W75|df()Pv)CKroɡ\m36 Jۘl3;f.t\wgmr6e)w.(w̵b ݤM|-ʝ*G*DZmr1@YCژoNk6B~elF(Wdַtf38cckPqi汵F(W ӗ^zڐŝ>ܟj{,P`a3  -؏uN(07S+SՆ` pj3fv>(07S+SՆuΘSОUm~?7ZiZm~P6mh_rmV%uG~s>ϣim+]cˎC}mrVmroI֤fEO=ԨPֿS>X WF(w*8HSngN ny)(vʍTw rU=A[)t >H?nGv&ca(Wl鍃~َ;ߏ)P~D?ע>WG']?~馞jS\sRܛoyԸkG=sA_}qw>$uQmS\:s>{uY]_6?):s|+~wLV(W y{DZi\;wm}4_vX}&@iEAwh!ZC?6ōV#3b.k0jCw(0W$ֆ`.8C73cu>P$ֆ`.8C~opݥ.(07> =mh]R7iK iK \ن C}Xن K Jl܆%׆j%~h]R}T+K њ<x{uX6>umz꩝Ou&պJ[WCZ7hC6wm|;4С#W-֥dp ]XaW_P]Ʀ)j׿~'x衇: ӆ{m躠g}v)P֥W\iК_jP}vYHkSqMrk8{}j@A? =6\rMAצ܃kCwviCC%(PP`aɵ>’kC}@%׆%ESОRmV%׆j~ɵZi_rmV\%ES/6D+KMA-({pm =6\rMAצj{y20ن)()h?{1(XY?!`uK>܂r[P㛂r u|Cw(C(Ƀ NN)1XHA}@' ,t> =')$N.T{\PߧtZiwrJZiOA~C~̓j%)%h>EGA:)(\7܂rTLq@ASn -(܂r&XPnAo -(MA:!;XpI YXHA}@' ,t>SJ Rt:yPC|@{ZN'] JsRbVSt:yP;9PߧtZiwrJZIOA~G~ɣ܂r[P㛂r u|SPnAo*My ܔz7YA[Ps.(\7܂rߐ ,8Ѕ, ,t>SJ Rt:yPP`)% ):<HOsI!>=-I .Նj9W)1T+):)1t! ):<(C}@NXprJ>BN'Ӝ|bhOKB|KZiwUJ J}N'{'NT+NN)1T+)BN' ,89PP`!EiN>I1%tr!>إP;*%j>EJSJ J}N'{'nT+nN)qD+)< -(MA:)(\7brym;7Nq^gG ?yWSNz-hhӆR\%m_?ݟ?;4چڨP\zyu(/ki<O<}nwm5T(߫ïqoWڸ{6?T;7nN7І+믿Ӎ!ǻN`5\]}?qƏ~];g}5}Gwy{_صqgvgѵ|f9?߽~ݱr{| }'px;ko}k1ӵ7{m ~v~??YC!;Zo}K_;cznmܜjC}@6}~o?' ,89)&6Xpks}l RP`aɵ> =ͭ7iK iK jĹ ojC~fs\{6 >%׆j%ޭKʼj%~!Z6/yK6^җvm|MBZ[ON:LJ>v/YG>_jt\jӟv'xbo{Cs1Z馛 /po{Um|_hz<\iu]VPz[n7p6T6bx뭷v=Uǐswv޺cƫuZ֧_[ԣ{muCqZKwHrGQ~m-|駟֍GUZ71H.ACǬzz\* }laVkCY$?g|&t=Yq=dAˠsCc.)6ѺM}@zkC|@{kC|,unC㛔P,ynCkC~Ok K J=Kڼj%~!Z6/zы6^wme/>c&BڠB77M-oyKFÆm]x;6w}o|Ozo|M=Fzo/qYgu9Ir~um?aF1LFChjҠ\iPP|H>? w4(WZ^l)`uC6 AbCaYcu^vM@ p:n1ANb7遂rk8 厽Яr7r鮸4u(WI}X\(W4$(Wyvt;շQ$AuSA& /1ow;Iru oxޘ IPاs;4ŝ0TI1dq 4P gg?n\/=G: $P g:L}@⛴PFc7iK iK ܵY܆{ꛤPߓ,}nCkC~Oj K J=K⼏j%~!Z6}rѦ8g}>;{UWY\hۯ.Nj^t|ڴ_:Ir{Яr:Ir׃)zonP|F7sܱVA:΄8 3(ᾡroNd!PuOI;jr|r ɨSrPp+@}uwLrvcj(m +8T7ruޤ@ַoN j\.Ir ,̹1NcJ,P`x96sSop%ojC}0bXP6.:.SОYmh'I J=6/6T+Ck s\uIQ/6Dk (W;ÒsԎM)W=z `&i\Z[hNj7IP^.5NڀƩM 5ն)\1NmR\寵9\LrU 庰|SAX(wNi{:S1b ʭrP$ֆ`.8c U1q\S , MbmHOZؿHO[zmhO[zm6mhP6mh_rmVf6/6T+C:ZI_zm]ۤ@wq/\7>3hACCumWĻcS\!us9{>/UKSN[(W^1m='?[W3 rW3fB8"]1?0UmRܶKn)w 9UmR\}Ce'ՇOF>Oy(W0nw2&ʽkvмkC}0jm]!QP`aH> =mH]tLj> =m!>=m!>60~okC~?60~ɵZiRm~PKj%~!Zwinq/r?яAC}7q)Pn%{UWj]T(W\w) އr'@& UuvJ$@M71fשn'c hX݁09>ߤֆ!u1׆׆`l܆I Jl܆%׆j~HmenCkC~?.>׆hݥM x bzn?z'B7|sDm\r<vֹJؔJ(wu33%s]_&@%a"Km[6x ܆qM@)6¹܄]runR$@dѣ$@Kn)W?P(W?Շr:6 PM7(M{'Cٚ.Ԇ,̵ȮCw(0'ֆ`8g? wКyZ9՟Vtc(0$P6.:&SОUm~?7ZiRm~PͶmh_rmV%yG~4Ir=}(Wۜ%@ZKFmhaNC;vm;jjhsjjmsNC;՚wMŎ׹Kr7S)rC=8V7} ʭr'4(7aG[ =IrS6w ʝ:߭q@fYPnAP~! vMO\)7C~Zr/xO%@QOzo}"j~[ߪrY Yܙk<Yܡ9Jbm3T>o|#:L}@I pFQR~ C|ZӆEǤoӖ^Ӗ^⃹j s&6T+Ck s\!ٖ K J$V^u6)P?r?EܷIrӚB)eDm\k)MuݶSܔ͗\բ픫xʆf PW$}'NCDsWPnws{+(vʍP.yrqP@ԓIB S2>(W7{3\]w607Hڜs9{Pn8Kr7=yO䄝r>Q{# #;s-`|K_zAmR}dq C5&ֆ`.8cM M}@I pPP`aokC}@zкoӖ^Ӗ^⃹j s&6T+Ck s\ن K JкV^u6)P}(WmR~PUW]Q(W_+֥뮈$@z_:FC PjO:W)i+M07 PjQPz8hxfιA=!]Qk'rPn?ʕzЯ(Wk&9zIrUIO1@Kr6a(ڇroC?齙 =#j~{PF. PjLwZPm s ,jC}0j@w-q,XꃹڑphM< CsO iCڿHO[zmhO[zm6ߤՆj~hmanCkC~?60~ɵZIZyJkC&ʕ=ė]v١Ory}(W5@[ײuMeS\Һw/Ʀ@$RrQ)TPnW3q@fm&n嶦&Aվu`nr$(aMrZH&A?xwg_~~Mr~_(W/kơ,̹/6Kw(@?$Ն`N8Cu/6K}@ꛤP g_SO}@kZmHO#uI-6-6sfsojC~Ok K J=6/6T+.>׆hݥM+};P$(W+(7MrUY[nP$A+ /6劙{=ܡ&sS\FO o!*鼵/@ASnr]MrU0VmҠ\զ/M|U+;&. ʕO|dr7iPn0+($ y{\/\\smC's WA\rɡ& Um Z@;<Yܙ{C7 =SKw(@L pB r)݇>|`]چ~LC7[׾{;o{[֮c9ko~sE1sB#_=ޭ Y! "]MSFrkCwθK-LT,,6 3>EFDzC|'kC|ڐM|ڐО܆׆hݵyې~yѺk>:!~>u}dnkmۼ%/xK_ڵw9'uzo{'7ir^sN8a|# _U9\=h͠ )vg?5DNm\p < >ה:u֖n_j[zlk^z.y۸[{͜P>/dmRkz{mͳ_#;#d)wႧsBꇎ!@mՇ6!YC }xmCX A> 탵Ɲwٵb׍]~އY6sBYh7B~vmhucqe}{]/k㢋.4 ~;ٿq Xe'_SnsO?N;kSO4q'wmtIvu|3' }[ҵmzl?I xk^?^Wumx+^ѵ|uA9Orpw%;еfS:~ YXXzm(<7 ^ `a^woX .6Xz ^6kC|@mH_zm]ѹ Kݵ K Ѻk>22jn~A~E/zQƋ_⮍eg9\zl4{{ umPn]zW'0׹7'+5n* z4W}W_*o jv_SjLzA5 ֭kYG}U6t~/S jӠ_M,[o(t߬DgN(WZhzcn@._;_\!^m\or?k8{пS *+Penr.OAAy?ULA@IZor>/宯&# { =6\rMAצ܃k Kp]"¦w]`` ⃂rٖK(B׆` jnrן[:!~>u}|swmnCkCڼܷٵy߶m A ?+0{n-(ܿ`nAGj[_&W IDATKASnܩ1N?>w;Nz!?#}kd 3=S9wج]jٍ>[~dn.s3tfdK='`?sλo?zιS>i?PpPLя~Եn]s+-DԹ瞻QsNF?A~Joooq]g~ǹ̹Svm?I?~Ǝ;dzl?Wvϙc.N]3N xr!;XSSErkCwP8C;Ny.#o(Pp=Sƹ;Pp K 3޿(5Q^2!~6/6D܆V]ې~6#s]m%/yIK_Ү ܛs\wtc>qwܿܿ?NG6K6s{w _=k Dmfqyum]\pAV̹S>mW[9נkS5ZV[c[7߼7nq뭷S9wn{ζ.oͶ_ >ݺ_+fΝrܪkۺZGnCNm)WϽs8p9 ʼnE8h8uQ;: to6ECw, N֥ ݤM|(w6¡;..sBK͜Pk3' .6sBK͜Pk3'ڐg,.t! K\ ,,6Xr];\Ӗ\N}@׆׆`jC~dP/6T+K JkC~P/.ʝj%~!Zi_rmr\>' .6sBK͜Pk3' .6E"PkSgx^ ʭr’kC}@%׆%ץ#C >=m!s] J}C~P/6T+K պK>%{#jn>웂rMAצ܃kSP)({pm nnhKv%8 sW _:[Pn{dC!yc -(fA:)(\7dq N>)1\BN' ,89PP`!ERbv Π> =-yОG|KZiO9NT+NN)1T+):SJ Rt:yPC|@{ZN'] JsRbVSt:yP;9PߧtZiwrJZIOA~G~ɣ܂r[P㛂r u|SPnAo*My܂rEJSJ J}F7{78N܂r[P㛂r u|S1nq@榄ɦrxuiϫ)<\ϫk6 4a_=jI5ӟ7?%PYzǯ>sϡyg'|roC:nPN7yw{7nN7І<}]{zo?yw뭷ybk>4{=t]vYwh|tg}${CG?{Aǯ>W^ٝtI'>[nc]}{_wq !zț/}Kݫ_c.7mzy~6 }l/:έ.Cw(:PP`a6o5깩(PP`a67:&_znю?SP`aɵ> =myYR> =m!>=m!>[%V76W?iw'vu_׻s 7}Z3Hlʕo㎽ܧvvޚ<6Z:C=4~חF絟~u_ם<;7 j^Q]?emo c[>Z\Z39q#` g@b26 6Fuq{9lxn"}ݩY~⿆\p 禠)7c/jbߚMV1E &6 lz߉/tOmŝ fk[5.%;XXmI>gKS{_{A}ߌ~(}i>gzЯu/(}i> =m:M}@zkC|@{kC|06<~>]~P܆%׆j%~j%~!Z6/zы:^Q6 ~^t}kޓkrux;1ϽI(W@Ogu޺roqsoUP.k @\=cMB͝wu]{CSEϣ aPnxI^zњz`&\t.ۘ$D'AcMBb'Fuz,MY1P*5~|s8 LZ& ʛz)B >ޛz>;fI(W9k"ۀܱuu掁77 Or8(^W} lPvmMBڡU@nrMʣGk}݃u65 Սj?z/?؇rudo ʕ?ؠs=މ z?sfSPm nc^{ECsmkl ʝ ]*P5%;c0VDZy*P5%;X翴P3Vw5{ל\{!wr}WݜTHe/y/)w3E}w}Y9wrg/r%0ދ;{mg{9wܭ' %:K3H﹧^R+k!wpWyKEJrR%2cV)דrHr/:-TyJ}K;o)>X.k=?^ܹܽ#-RSlbn~`[9tܺ;,B̻fxYwLKʝ&-R}|1k0뾜;喵Kʝ~!w?ORȹaQ8{I/{˞#ol=?_i܏tZ^RMIn~Vlly%OXiqrds {{rƲ}l)TXXqm(qSg 7}/u7 7G\iד#oiG_iG_ym?>kzoC׆fy䵡Yɼ?Yɼ?ڐGxoONzZR''?rǞ|}*~>;H'|uH#/o,z/)w0!w/R/5{;ރ{!wrp>-w|;=*n=ܭ%㬥Ogi{I7OɽI G7ߏHrg)*>^'d6.=nr,LJi"^7jp^RHrr&r7{IZʽϵ!w9-7}Kʝ>R~V֛>{IsJ"o'S;@mph/)[[JxNk^W=só!C)+_ʸg)C>C܏gr烽u_d)h I70n{_ܬMl ܡr6TXs/g=?nS<׆r7E^Sw_PaarĵQ7̴ δ ]kxoCѬt_{:64+ކ# J7J׆d={//|*厘-o/)wXNɝ_E|OO9=k/){{#ɤLf9-w{L^RZrg1Yusx"|8{I)#΁:ʷ_ܑܽ)wϪ{ܭ!厳rmxVcOrRR.kyIg)wSrd) >V:=3bAHߦIEP·;;o&)>~vni.odr燃Eʝk,Rٗmr~^frZϛ!i#.R>9v>)~;_R{Nkf]ܹ=u-)Zx6bH>!<5>YK`ds'xsg",*,,Y6Tθpϑ/ K# 39ֿ7ssjn162Ӗ{qM9 3kC83kC8Hy}4+ކ# J5kCyMy!Y/xS1/yY^Rg~g>gsF[N)7Ork;1י_)wٳK^RG-R}3)o});Cʝ}w>[3re=ܑ?g=)wɾ]/Rn<RqJnJ,bnCfY`sYlrO]@½mO')>uB l">ċQN%Y\Ko5%EM%Y6k)7=]u)wzsiEM(CNCEʝ]͙|<~;RȵCʝ߄]K#&[3B"厘6RZʝo͙|H__prE}K^Ih"~}\x{H{ N@8ks#;TXX%r7<]yR27 Q׆r7R27 Q׆r@fr:)d}mt}m\ƹk.fhV: G^kzoC׆f%f%kCyP{-~G}TY^R^Rg}gE}k)w>3&!gLx+^-~$HC oxS)OipN#.{Hk)w“xn͈;;{k)7u]W^7˴{H{n߬"n4rXKև)>ןS'LWUIu Ms&'^7i}7$k1ܺ!cM07ofrM-]v)wdTCt-n!rr>rYu-㟻C}TʝMŤOR3Z}[=RK_ҧR^O6}kJsZd['6K#,'!kҏܹo9)w)wUz1wNU6y{r2X*-͝dRڹkVvds 8G]A"g\JZ#~-s&Rpa4}|XA"g\J'k:_:Paaum(d-yo)Rr@f׆p@g׆p͵hV: G^kzoC׆f%f%kC͗BʝLOOCRȺ>)w)~,^Rf)w=yR)ڌJ_7RnR;kJ=kZ\OʭcR^rD)7Y=N}h)wG"IqRCKp)7=srZʝBn8)SS<ƓroJc<)R9ƥNC9#:)G3Rr@9#]TPaAH׆r@fZܔ2ӎ6:ӎ6dm.,t}4+G~GyMm?Ьt_{:64+G4+G_k)>NDI-iۿ?'܇r;I-|6{RIÖ܇rH1{SMr'-hzRjzce2G\#HD<{Cq}Rn6UʝZcrIJϝ#o߾]:)d(isJrR}E??F){{sRȏDkܯ;-oz"9ڌ@HA6wP;XQixJ9CXLZE9CZi% \j~SL;L;y)!y}4+ކ# J5kCyMy!Yrϴ_9)79J{랞{zRRwQyR/οsT6QʝY;w6JJ 7%ŀR'1pD)7}޷;}JNf淘R.CʝǙ7z&v!㬥\R|R??|rܗ) o-ck8)OON#onϕ|PC}qRixrMo:q3!·3~OA\VZ}[R_?^D}||{|Rn;{\iz:3r==yY{wof-Rr{ӯX;>AoE]㕮1aR^ {qzd /7OMy;}vF$ZȝMj})7}|n4ob "Qt]yO !Λmrsk>)I {HZʝu:7gu)w~OR{H??znR;rᩔ;bگE6#p~~C>C\=R>1q6͙|ZxM3s sh>ĩxds KKz\jm(q7}<>um(q>9ϧEArC>qm(1sS-;r}RnzYyK%l"%MIOyP9˯Q}uB?~ۥܛn,t&R=cKw=7#k)7};y|M=G\K${I.II[z͞7H{IArRu_c9z)w̟Y7MY9;'o؏X8{HG~GJ__D*N?f>P\Nɝ+2~=󒗼䩘YgL_Hqr'MA+^?=#?ܡ׆r7>W7)мIr@# 3f}n [^ٖ_PaaqĵGߔ2ӎ6:ӎ6tm G~GyMm?Ьt_{:64+G4+G_m>?;rw}wEM%]z;~PSr)wmr==)w9$Y5#ZIJ;,'ο|rJ;!Nٻ\ܹDyJ==3"cgz^')w^R k17<RCʝssʯsytmrﵔ{b|872r; ]ܹ#.W}W]\!/sܷ-%FrZHs]OO*.'f/)?#)M!wc͝tcr{K [$lPaa}o6Tθy܏YK|zy-+SpsĵrK7f *,,qm(d_8)d}mt}m[汿hV: G^kzoC׆f%f%kC!>J/x Arz*~G~b|FٟOO)w~~Kr.厔;׷}۷Rmygkr)o|c6{I?O9c|ҿzLgYKsN^Rk)>9hi}B^ӵKnR}rAHf/)wdٵ;ϧSf%厣qS̽71ksSPRRefyu 72TH/-^E6!w0ro;-7^7aހOȝEPS]N]E"/k4r?ߞﻗ;5oR8?RK]ؿsi[_[|eHyۤ٭.\T!еJ[)^"nH'^R2to&x.wl=Z];y(;P0u=E̝k~X031c-.Rߞ^r~~i;?Y~r ;?Po;b|h4$= y_ӛ'M)w~SFgSqr뛾雞Ooxȫ#.}=9-g~g6͞RsZZӋ_'arYqkNȝk"7{O)pd.*Fm=6dsg?pϘ{J7|7<9-wrߏ:}~i\ַ#.ל;+^Mk;k׾)s\{N~Q٫wN!K?SʝǞ=s)w'{$T.=9;x[>Sʝj-)q=NzάYroJto:)Ξsgmwuׇw͞Rpsq'az%kwZʝuuS]zM1wKƽz~%qOwZ%a@Ik'[^}PYʝo!κEdI[<-̛7nqDv2"X׸a~LR׿wo-?,bMwo}M[ʝ~֛R|mbሁMw}R|k;ΟYrkNk>4OT;kA~'~t:"䮥ܑ|͞R:?Zr}7~i>D>3K5\窾4M)wN޺6{JOO)wܹ>?ii9vh>uZg/zыNMʝ㶮͞R:kdFy]=x:͝2䙼ܶ.g|__ ܡm(kC9*gZ%.-f][_k(TX `14.nZs {zPa&7GZi=4)d}mt}mXކ#Y鼿6tymhV: G^o f-/Rpe_eF1wxOs_eOOxrݔr?s?4'nfo)wzo?#~~ieoaPfgg5|0E]K??i]Ͻy?)^\'51{JW/k5xǓkdZKsfvO)wogmsG]=Of fvt->|gε㭥ɵumr1wܛ@;gsN[03i};bad3C"&^Bȝ[]>bZ]>@׿;\IrϽy٤'r".Rs-OKkroJ#]Bȝ>r1GyT|K'ܹ<]'뱮;}*,~\BΘKps !wyM~fCMֆrUΘlv}~Ppem(du_2)d}mt}mZѬt_{:64+ކ# J7J׆dm~oHYȝ{R똽'|ݙ'r`޳kYۤKR<Ȑ#:ߔr9@ZۤKR< \m}E^oʸ7K=$'LX2|/O,&.v/!-c#ݻrϽem\mlp@ٶ@RR}_ :/!.> ܔr/ioNu7o~}^Y缹LnJ}F`>5%NoZHS;zNsfr=o{۞|б#r7?}<5--OOɝ̶H0xNs!k~x>TON>'9_R5_Zl>kΥ60࿴,7%ܡݛ\JΘ5#q)kzoC׆fy䵡Yɼ?Yɼ?ڐmFʝC.CIӜ\ٟOi;̳桤|i藐rG_ [!N]{s9w~w.R6sx>)w;r)tz|)wYyvEʝ}Kx K{Voo>#)w~t <.zRw?AKܑq/).R0ܾo<}7}97r~Lo%.fN_?sO}ы^twiCIK97–?~qK6w.0wh9k3k;k|inum(3u6}>}ڑ/K# pӺ6Knsor?)TXx7kC9 3Y<[7̴ δ >汼nZ׆fy,m?Ьt?km{:64+Z}4+G_<05{9sOܗOj݈pz<8t_;2 {Irz{H)wY٫}ًJN'{}+rgȹ>KNwW9r=;=ξ.ȹ;2f>J]?azsݛR8<wn)N<{{Iv6Et~ֹ9!IKK795*׽4Hkfy8oͮO17 R n?1N2u R`\{N˵9aw>oCK랆@dZY9aw>桥I{|6\__ZR}k@<Ͻzyh)wk?>ɇs}'>>E_Eyh)wk6G [Dn濏4_^Z\C6wcce2N|އ^CzPCXofΈbfT~(TX ܴ rz> r3/-=Q@i[id]k7̴ δ >m'ܴ J=YkCyOm?Ьdޓui|Gy!YM5{ ?? xskN^%^A!sA]u2U׿?ӧf_ .=͉,r8 ijwCK{9k3j^Fb^Y~5 RzmFvrc}M\u?-{b8X7_j9]XK?sx8B.u.-h2y2ߧv O)imܦu^ܶir֦Im[&)mmܻRj}{W)?z͝xjm(MPSθ:^Pp>PSx*,%PL#}4(iG_iG_5 JY鼿k܇ZP6ds K9%z|A9CRp{PP.2.C~iM83= \Ьt?=4+[{z̶iV:4+mcӬdoiV2:'YCE}5Rʽ{oA)Qʽ{mr^ܻF)Q&S>{ ݳ:!Sd**zR30?zskd~9߳krr6rrnrl\pF6wpRC9BKΤZj(TXhəA9BSK ̴i2ҞZtdL \Ьtާf!cJ}WCJ}Cƴ:|[zYɼWC-J}Cܻ?UUMWJJ 7JJ 7Jw 7\\Oʭc@)W)W)W)7JJ 7JJ 7JJ 7ds I?-5t# -9>(TXHzjPa%g IO-5*,LTC83)g ֆf>W-54+-9>hV:ZjhV:[r&}Ьt'=Ьd޷dLYɼO{j#YoɘpIpIpIpceS2Y¯\܄\܄\܄CEI*,$=PВ3r@Zr&}PLKi!Й֔3ppMkCyܫI4+IO-54+-9>hV:ZjhV2[2}Ьdާ=ԑt޷dLPUMQUMQUMQUMF/q/r=)\\\d**&(*&(*&ܐ*,$Ѝ,*,LPa!驥r@I*,$=PВ3r@fZOS δI/kZ^Ьt޷LYOzjYoəAyRCyߒ1f%>d%c҇RRnRRnRRnRRn5J{1P'd})***&JJ 7JJ 7JJ 7ds I?-5t# -9>(TXHzjPa%g IO-5*,LTC83)g ֆf>W-54+-9>hV:ZjhV:[r&}Ьt'=Ьd޷dLYɼO{j#YoɘppppcM/R'1 [\܄\܄\܄CEI*,$=PВ3r@Zr&}PLKi!Й֔3ppMkCyܫI4+IO-54+-9>hV:ZjhV2[2}Ьdާ=ԑt޷dLPUMQUMQUMQUMF)w/̽8O2\\\5Z)W)7F)W)7F)W)7lPa!駥ndQa%g IO-5*,LPa!驥r@I2Ӓ~jt5Lz!\Ьt'f%gJ}SK J}KΤi4+iO-u$+->rrnrrnrrnrrn۽Q:rrrrapppC6wRC7В3r@Zr&}PRC9BKΤiI?M5:Ӛr&imhV:{RCyߒ3f>驥f%gJ}SK J}Kƴ:IJJ 7JJ 7JJ 7JJ 7(@WpIF+*&(*&(*&ܐ*,$Ѝ,*,LPa!驥r@I*,$=PВ3r@fZOS δI/kZ^Ьt޷LYOzjYoəAyRCyߒ1f%>d%c҇RRnRRnRRnRRn5c7J[ǀRRRRn2lrrnrrnrrn~ZjFZr&}PRC9BKΤZj(TXhəA9 3-駩p@gZSΤ5 J}rZjhV:[r&}Ьt'=Ьt޷LYOzjYɼoɘAyRGyߒ1C)W)7F)W)7F)W)7F)W)7ܽ2 >ɔrrrrh\܄\܄\܄CEI*,$=PВ3r@Zr&}PLKi!Й֔3ppMkCyܫI4+IO-54+-9>hV:ZjhV2[2}Ьdާ=ԑt޷dLPUMQUMQUMQUM|lF)דrPUUUMRRnRRnRRn ܡBOK ȢBKΤZj(TXhəA9BSK -9>(d%4LkʙB8YOUK J}KΤI4+IO-54+->hV2ӞZHV:[2&}(*&(*&(*&(*&XuB^}'RRRRnpppC6wRC7В3r@Zr&}PRC9BKΤiI?M5:Ӛr&imhV:{RCyߒ3f>驥f%gJ}SK J}Kƴ:IJJ 7JJ 7JJ 7JJ 7(zRnJJJJɰUUMQUMQUM!;TXHiYTXhəA9BSK -9>(TXHzjPa%g̴iM9^״64+ɽjYoəAyRCyߒ3f>驥f%%cJ}SKJ}KƤ\܄\܄\܄\܄krbN+$SUUUM^rrnrrnrrn~ZjFZr&}PRC9BKΤZj(TXhəA9 3-駩p@gZSΤ5 J}rZjhV:[r&}Ьt'=Ьt޷LYOzjYɼoɘAyRGyߒ1C)W)7F)W)7F)W)7F)W)7ƚ^_\Oʭc@)W)W)W)7JJ 7JJ 7JJ 7ds I?-5t# -9>(TXHzjPa%g IO-5*,LTC83)g ֆf>W-54+-9>hV:ZjhV:[r&}Ьt'=Ьd޷dLYɼO{j#YoɘppppcR^ {qzdJJJJkRRnRRnRRn ܡBOK ȢBKΤZj(TXhəA9BSK -9>(d%4LkʙB8YOUK J}KΤI4+IO-54+->hV2ӞZHV:[2&}(*&(*&(*&(*&X >{Iu (***&V)W)7F)W)7F)W)7lPa!駥ndQa%g IO-5*,LPa!驥r@I2Ӓ~jt5Lz!\Ьt'f%gJ}SK J}KΤi4+iO-u$+->rrnrrnrrnrrnQ݋:!s>NL)W)W)W)7yVUMQUMQUM!;TXHiYTXhəA9BSK -9>(TXHzjPa%g̴iM9^״64+ɽjYoəAyRCyߒ3f>驥f%%cJ}SKJ}KƤ\܄\܄\܄\܄kz}vor=)\\\d**&(*&(*&ܐ*,$Ѝ,*,LPa!驥r@I*,$=PВ3r@fZOS δI/kZ^Ьt޷LYOzjYoəAyRCyߒ1f%>d%c҇RRnRRnRRnRRn5J{1P'd})***&JJ 7JJ 7JJ 7ds I?-5t# -9>(TXHzjPa%g IO-5*,LTC83)g ֆf>W-54+-9>hV:ZjhV:[r&}Ьt'=Ьd޷dLYɼO{j#YoɘppppcM/R'1 [\܄\܄\܄CEI*,$=PВ3r@Zr&}PLKi!Й֔3ppMkCyܫI4+IO-54+-9>hV:ZjhV2[2}Ьdާ=ԑt޷dLPUMQUMQUMQUMF)w/̽8O2\\\5Z)W)7F)W)7F)W)7lPa!駥ndQa%g IO-5*,LPa!驥r@I2Ӓ~jt5Lz!\Ьt'f%gJ}SK J}KΤi4+iO-u$+->rrnrrnrrnrrn۽Q:rrrrapppC6wRC7В3r@Zr&}PRC9BKΤiI?M5:Ӛr&imhV:{RCyߒ3f>驥f%gJ}SK J}Kƴ:IJJ 7JJ 7JJ 7JJ 7(@WpIF+*&(*&(*&ܐ*,$Ѝ,*,LPa!驥r@I*,$=PВ3r@fZOS δI/kZ^Ьt޷LYOzjYoəAyRCyߒ1f%>d%c҇RRnRRnRRnRRn5c7J[ǀRRRRn2lrrnrrnrrn~ZjFZr&}PRC9BKΤZj(TXhəA9 3-駩p@gZSΤ5 J}rZjhV:[r&}Ьt'=Ьt޷LYOzjYɼoɘAyRGyߒ1C)W)7F)W)7F)W)7F)W)7ܽ2 >ɔrrrrh\܄\܄\܄CEI*,$=PВ3r@Zr&}PLKi!Й֔3ppMkCyܫI4+IO-54+-9>hV:ZjhV2[2}Ьdާ=ԑt޷dLPUMQUMQUMQUM|lF)דrPUUUMRRnRRnRRn ܡBOK ȢBKΤZj(TXhəA9BSK -9>(d%4LkʙB8YOUK J}KΤI4+IO-54+->hV2ӞZHV:[2&}(*&(*&(*&(*&XuB^}'RRRRnpppC6wRC7В3r@Zr&}PRC9BKΤiI?M5:Ӛr&imhV:{RCyߒ3f>驥f%gJ}SK J}Kƴ:IJJ 7JJ 7JJ 7JJ 7(zRnJJJJɰUUMQUMQUM!;TXHiYTXhəA9BSK -9>(TXHzjPa%g̴iM9^״64+ɽjYoəAyRCyߒ3f>驥f%%cJ}SKJ}KƤ\܄\܄\܄\܄krbN+$SUUUM^rrnrrnrrn~ZjFZr&}PRC9BKΤZj(TXhəA9 3-駩p@gZSΤ5 J}rZjhV:[r&}Ьt'=Ьt޷LYOzjYɼoɘAyRGyߒ1C)W)7F)W)7F)W)7F)W)7ƚ^_\Oʭc@)W)W)W)7JJ 7JJ 7JJ 7ds I?-5t# -9>(TXHzjPa%g IO-5*,LTC83)g ֆf>W-54+-9>hV:ZjhV:[r&}Ьt'=Ьd޷dLYɼO{j#YoɘppppcR^ {qzdJJJJkRRnRRnRRn ܡBOK ȢBKΤZj(TXhəA9BSK -9>(d%4LkʙB8YOUK J}KΤI4+IO-54+->hV2ӞZHV:[2&}(*&(*&(*&(*&X >{Iu (***&V)W)7F)W)7F)W)7lPa!駥ndQa%g IO-5*,LPa!驥r@I2Ӓ~jt5Lz!\Ьt'f%gJ}SK J}KΤi4+iO-u$+->rrnrrnrrnrrnQ݋:!s>NL)W)W)W)7yVUMQUMQUM!;TXHiYTXhəA9BSK -9>(TXHzjPa%g̴iM9^״64+ɽjYoəAyRCyߒ3f>驥f%%cJ}SKJ}KƤ\܄\܄\܄\܄kz}vor=)\\\d**&(*&(*&ܐ*,$Ѝ,*,LPa!驥r@I*,$=PВ3r@fZOS δI/kZ^Ьt޷LYOzjYoəAyRCyߒ1f%>d%c҇RRnRRnRRnRRn5J{1P'd})***&JJ 7JJ 7JJ 7ds I?-5t# -9>(TXHzjPa%g IO-5*,LTC83)g ֆf>W-54+-9>hV:ZjhV:[r&}Ьt'=Ьd޷dLYɼO{j#YoɘppppcM/R'1 [\܄\܄\܄CEI*,$=PВ3r@Zr&}PLKi!Й֔3ppMkCyܫI4+IO-54+-9>hV:ZjhV2[2}Ьdާ=ԑt޷dLPUMQUMQUMQUMF)w/̽8O2\\\5Z)W)7F)W)7F)W)7lPa!駥ndQa%g IO-5*,LPa!驥r@I2Ӓ~jt5Lz!\Ьt'f%gJ}SK J}KΤi4+iO-u$+->rrnrrnrrnrrn۽Q:rrrrapppC6wRC7В3r@Zr&}PRC9BKΤiI?M5:Ӛr&imhV:{RCyߒ3f>驥f%gJ}SK J}Kƴ:IJJ 7JJ 7JJ 7JJ 7(@WpIF+*&(*&(*&ܐ*,$Ѝ,*,LPa!驥r@I*,$=PВ3r@fZOS δI/kZ^Ьt޷LYOzjYoəAyRCyߒ1f%>d%c҇RRnRRnRRnRRn5c7J[ǀRRRRn2lrrnrrnrrn~ZjFZr&}PRC9BKΤZj(TXhəA9 3-駩p@gZSΤ5 J}rZjhV:[r&}Ьt'=Ьt޷LYOzjYɼoɘAyRGyߒ1C)W)7F)W)7F)W)7F)W)7ܽ2 >ɔrrrrh\܄\܄\܄CEI*,$=PВ3r@Zr&}PLKi!Й֔3ppMkCyܫI4+IO-54+-9>hV:ZjhV2[2}Ьdާ=ԑt޷dLPUMQUMQUMQUM|lF)דrPUUUMRRnRRnRRn ܡBOK ȢBKΤZj(TXhəA9BSK -9>(d%4LkʙB8YOUK J}KΤI4+IO-54+->hV2ӞZHV:[2&}(*&(*&(*&(*&XuB^}'RRRRnpppC6wRC7В3r@Zr&}PRC9BKΤiI?M5:Ӛr&imhV:{RCyߒ3f>驥f%gJ}SK J}Kƴ:IJJ 7JJ 7JJ 7JJ 7(zRnJJJJɰUUMQUMQUM!;TXHiYTXhəA9BSK -9>(TXHzjPa%g̴iM9^״64+ɽjYoəAyRCyߒ3f>驥f%%cJ}SKJ}KƤ\܄\܄\܄\܄krbN+$SUUUM^rrnrrnrrn~ZjFZr&}PRC9BKΤZj(TXhəA9 3-駩p@gZSΤ5 J}rZjhV:[r&}Ьt'=Ьt޷LYOzjYɼoɘAyRGyߒ1C)W)7F)W)7F)W)7F)W)7ƚ^_\Oʭc@)W)W)W)7JJ 7JJ 7JJ 7ds I?-5t# -9>(TXHzjPa%g IO-5*,LTC83)g ֆf>W-54+-9>hV:ZjhV:[r&}Ьt'=Ьd޷dLYɼO{j#YoɘppppcR^ {qzdJJJJkRRnRRnRRn ܡBOK ȢBKΤZj(TXhəA9BSK -9>(d%4LkʙB8YOUK J}KΤI4+IO-54+->hV2ӞZHV:[2&}(*&(*&(*&(*&X >{Iu (***&V)W)7F)W)7F)W)7lPa!駥ndQa%g IO-5*,LPa!驥r@I2Ӓ~jt5Lz!\Ьt'f%gJ}SK J}KΤi4+iO-u$+->rrnrrnrrnrrnQ݋:!s>NL)W)W)W)7yVUMQUMQUM!;TXHiYTXhəA9BSK -9>(TXHzjPa%g̴iM9^״64+ɽjYoəAyRCyߒ3f>驥f%%cJ}SKJ}KƤ\܄\܄\܄\܄kz}vor=)\\\d**&(*&(*&ܐ*,$Ѝ,*,LPa!驥r@I*,$=PВ3r@fZOS δI/kZ^Ьt޷LYOzjYoəAyRCyߒ1f%>d%c҇RRnRRnRRnRRn5J{1P'd})***&JJ 7JJ 7JJ 7ds I?-5t# -9>(TXHzjPa%g IO-5*,LTC83)g ֆf>W-54+-9>hV:ZjhV:[r&}Ьt'=Ьd޷dLYɼO{j#YoɘppppcM/R'1 [\܄\܄\܄CEI*,$=PВ3r@Zr&}PLKi!Й֔3ppMkCyܫI4+IO-54+-9>hV:ZjhV2[2}Ьdާ=ԑt޷dLPUMQUMQUMQUMF)w/̽8O2\\\5Z)W)7F)W)7F)W)7lPa!駥ndQa%g IO-5*,LPa!驥r@I2Ӓ~jt5Lz!\Ьt'f%gJ}SK J}KΤi4+iO-u$+->rrnrrnrrnrrn۽Q:rrrrapppC6wRC7В3r@Zr&}PRC9BKΤiI?M5:Ӛr&imhV:{RCyߒ3f>驥f%gJ}SK J}Kƴ:IJJ 7JJ 7JJ 7JJ 7(@WpIF+*&(*&(*&ܐ*,$Ѝ,*,LPa!驥r@I*,$=PВ3r@fZOS δI/kZ^Ьt޷LYOzjYoəAyRCyߒ1f%>d%c҇RRnRRnRRnRRn5c7J[ǀRRRRn2lrrnrrnrrn~ZjFZr&}PRC9BKΤZj(TXhəA9 3-駩p@gZSΤ5 J}rZjhV:[r&}Ьt'=Ьt޷LYOzjYɼoɘAyRGyߒ1C)W)7F)W)7F)W)7F)W)7ܽ2 >ɔrrrrh\܄\܄\܄CEI*,$=PВ3r@Zr&}PLKi!Й֔3ppMkCyܫI4+IO-54+-9>hV:ZjhV2[2}Ьdާ=ԑt޷dLPUMQUMQUMQUM|lF)דrPUUUMRRnRRnRRn ܡBOK ȢBKΤZj(TXhəA9BSK -9>(d%4LkʙB8YOUK J}KΤI4+IO-54+->hV2ӞZHV:[2&}(*&(*&(*&(*&XuB^}'RRRRnpppC6wRC7В3r@Zr&}PRC9BKΤiI?M5:Ӛr&imhV:{RCyߒ3f>驥f%gJ}SK J}Kƴ:IJJ 7JJ 7JJ 7JJ 7(zRnJJJJɰUUMQUMQUM!;TXHiYTXhəA9BSK -9>(TXHzjPa%g̴iM9^״64+ɽjYoəAyRCyߒ3f>驥f%%cJ}SKJ}KƤ\܄\܄\܄\܄krbN+$SUUUM^rrnrrnrrn~ZjFZr&}PRC9BKΤZj(TXhəA9 3-駩p@gZSΤ5 J}rZjhV:[r&}Ьt'=Ьt޷LYOzjYɼoɘAyRGyߒ1C)W)7F)W)7F)W)7F)W)7ƚ^_\Oʭc@)W)W)W)7JJ 7JJ 7JJ 7ds I?-5t# -9>(TXHzjPa%g IO-5*,LTC83)g ֆf>W-54+-9>hV:ZjhV:[r&}Ьt'=Ьd޷dLYɼO{j#YoɘppppcR^ {qzdJJJJkRRnRRnRRn ܡBOK ȢBKΤZj(TXhəA9BSK -9>(d%4LkʙB8YOUK J}KΤI4+IO-54+->hV2ӞZHV:[2&}(*&(*&(*&(*&X >{Iu (***&V)W)7F)W)7F)W)7lPa!駥ndQa%g IO-5*,LPa!驥r@I2Ӓ~jt5Lz!\Ьt'f%gJ}SK J}KΤi4+iO-u$+->rrnrrnrrnrrnQ݋:!s>NL)W)W)W)7yVUMQUMQUM!;TXHiYTXhəA9BSK -9>(TXHzjPa%g̴iM9^״64+ɽjYoəAyRCyߒ3f>驥f%%cJ}SKJ}KƤ\܄\܄\܄\܄kz}vor=)\\\d**&(*&(*&ܐ*,$Ѝ,*,LPa!驥r@I*,$=PВ3r@fZOS δI/kZ^Ьt޷LYOzjYoəAyRCyߒ1f%>d%c҇RRnRRnRRnRRn5J{1P'd})***&JJ 7JJ 7JJ 7ds I?-5t# -9>(TXHzjPa%g IO-5*,LTC83)g ֆf>W-54+-9>hV:ZjhV:[r&}Ьt'=Ьd޷dLYɼO{j#YoɘppppcM/R'1 [\܄\܄\܄CEI*,$=PВ3r@Zr&}PLKi!Й֔3ppMkCyܫI4+IO-54+-9>hV:ZjhV2[2}Ьdާ=ԑt޷dLPUMQUMQUMQUMF)w/̽8O2\\\5Z)W)7F)W)7F)W)7lPa!駥ndQa%g IO-5*,LPa!驥r@I2Ӓ~jt5Lz!\Ьt'f%gJ}SK J}KΤi4+iO-u$+->rrnrrnrrnrrn۽Q:rrrrapppC6wRC7В3r@Zr&}PRC9BKΤiI?M5:Ӛr&imhV:{RCyߒ3f>驥f%gJ}SK J}Kƴ:IJJ 7JJ 7JJ 7JJ 7(@WpIF+*&(*&(*&ܐ*,$Ѝ,*,LPa!驥r@I*,$=PВ3r@fZOS δI/kZ^Ьt޷LYOzjYoəAyRCyߒ1f%>d%c҇RRnRRnRRnRRn5c7J[ǀRRRRn2lrrnrrnrrn~ZjFZr&}PRC9BKΤZj(TXhəA9 3-駩p@gZSΤ5 J}rZjhV:[r&}Ьt'=Ьt޷LYOzjYɼoɘAyRGyߒ1C)W)7F)W)7F)W)7F)W)7ܽ2 >ɔrrrrh\܄\܄\܄CEI*,$=PВ3r@Zr&}PLKi!Й֔3ppMkCyܫI4+IO-54+-9>hV:ZjhV2[2}Ьdާ=ԑt޷dLPUMQUMQUMQUM|lF)דrPUUUMRRnRRnRRn ܡBOK ȢBKΤZj(TXhəA9BSK -9>(d%4LkʙB8YOUK J}KΤI4+IO-54+->hV2ӞZHV:[2&}(*&(*&(*&(*&XuB^}'RRRRnpppC6wRC7В3r@Zr&}PRC9BKΤiI?M5:Ӛr&imhV:{RCyߒ3f>驥f%gJ}SK J}Kƴ:IJJ 7JJ 7JJ 7JJ 7(zRnJJJJɰUUMQUMQUM!;TXHiYTXhəA9BSK -9>(TXHzjPa%g̴iM9^״64+ɽjYoəAyRCyߒ3f>驥f%%cJ}SKJ}KƤ\܄\܄\܄\܄krbN+$SUUUM^rrnrrnrrn~ZjFZr&}PRC9BKΤZj(TXhəA9 3-駩p@gZSΤ5 J}rZjhV:[r&}Ьt'=Ьt޷LYOzjYɼoɘAyRGyߒ1C)W)7F)W)7F)W)7F)W)7ƚ^_\Oʭc@)W)W)W)7JJ 7JJ 7JJ 7ds I?-5t# -9>(TXHzjPa%g IO-5*,LTC83)g ֆf>W-54+-9>hV:ZjhV:[r&}Ьt'=Ьd޷dLYɼO{j#YoɘppppcR^ {qzdJJJJkRRnRRnRRn ܡBOK ȢBKΤZj(TXhəA9BSK -9>(d%4LkʙB8YOUK J}KΤI4+IO-54+->hV2ӞZHV:[2&}(*&(*&(*&(*&X >{Iu (***&V)W)7F)W)7F)W)7lPa!駥ndQa%g IO-5*,LPa!驥r@I2Ӓ~jt5Lz!\Ьt'f%gJ}SK J}KΤi4+iO-u$+->rrnrrnrrnrrnQ݋:!s>NL)W)W)W)7yVUMQUMQUM!;TXHiYTXhəA9BSK -9>(TXHzjPa%g̴iM9^״64+ɽjYoəAyRCyߒ3f>驥f%%cJ}SKJ}KƤ\܄\܄\܄\܄kz}vor=)\\\d**&(*&(*&ܐ*,$Ѝ,*,LPa!驥r@I*,$=PВ3r@fZOS δI/kZ^Ьt޷LYOzjYoəAyRCyߒ1f%>d%c҇RRnRRnRRnRRn5J{1P'd})***&JJ 7JJ 7JJ 7ds I?-5t# -9>(TXHzjPa%g IO-5*,LTC83)g ֆf>W-54+-9>hV:ZjhV:[r&}Ьt'=Ьd޷dLYɼO{j#YoɘppppcM/R'1 [\܄\܄\܄CEI*,$=PВ3r@Zr&}PLKi!Й֔3ppMkCyܫI4+IO-54+-9>hV:ZjhV2[2}Ьdާ=ԑt޷dLPUMQUMQUMQUMF)w/̽8O2\\\5Z)W)7F)W)7F)W)7lPa!駥ndQa%g IO-5*,LPa!驥r@I2Ӓ~jt5Lz!\Ьt'f%gJ}SK J}KΤi4+iO-u$+->rrnrrnrrnrrn۽Q:rrrrapppC6wRC7В3r@Zr&}PRC9BKΤiI?M5:Ӛr&imhV:{RCyߒ3f>驥f%gJ}SK J}Kƴ:IJJ 7JJ 7JJ 7JJ 7(@WpIF+*&(*&(*&ܐ*,$Ѝ,*,LPa!驥r@I*,$=PВ3r@fZOS δI/kZ^Ьt޷LYOzjYoəAyRCyߒ1f%>d%c҇RRnRRnRRnRRn5c7J[ǀRRRRn2lrrnrrnrrn~ZjFZr&}PRC9BKΤZj(TXhəA9 3-駩p@gZSΤ5 J}rZjhV:[r&}Ьt'=Ьt޷LYOzjYɼoɘAyRGyߒ1C)W)7F)W)7F)W)7F)W)7ܽ2 >ɔrrrrh\܄\܄\܄CEI*,$=PВ3r@Zr&}PLKi!Й֔3ppMkCyܫI4+IO-54+-9>hV:ZjhV2[2}Ьdާ=ԑt޷dLPUMQUMQUMQUM|lF)דrPUUUMRRnRRnRRn ܡBOK ȢBKΤZj(TXhəA9BSK -9>(d%4LkʙB8YOUK J}KΤI4+IO-54+->hV2ӞZHV:[2&}(*&(*&(*&(*&XuB^}'RRRRnpppC6wRC7В3r@Zr&}PRC9BKΤiI?M5:Ӛr&imhV:{RCyߒ3f>驥f%gJ}SK J}Kƴ:IJJ 7JJ 7JJ 7JJ 7(zRnJJJJɰUUMQUMQUM!;TXHiYTXhəA9BSK -9>(TXHzjPa%g̴iM9^״64+ɽjYoəAyRCyߒ3f>驥f%%cJ}SKJ}KƤ\܄\܄\܄\܄krbN+$SUUUM^rrnrrnrrn~ZjFZr&}PRC9BKΤZj(TXhəA9 3-駩p@gZSΤ5 J}rZjhV:[r&}Ьt'=Ьt޷LYOzjYɼoɘAyRGyߒ1C)W)7F)W)7F)W)7F)W)7ƚ^_\Oʭc@)W)W)W)7JJ 7JJ 7JJ 7ds I?-5t# -9>(TXHzjPa%g IO-5*,LTC83)g ֆf>W-54+-9>hV:ZjhV:[r&}Ьt'=Ьd޷dLYɼO{j#YoɘppppcR^ {qzdJJJJkRRnRRnRRn ܡBOK ȢBKΤZj(TXhəA9BSK -9>(d%4LkʙB8YOUK J}KΤI4+IO-54+->hV2ӞZHV:[2&}(*&(*&(*&(*&X >{Iu (***&V)W)7F)W)7F)W)7lPa!駥ndQa%g IO-5*,LPa!驥r@I2Ӓ~jt5Lz!\Ьt'f%gJ}SK J}KΤi4+iO-u$+->rrnrrnrrnrrnQ݋:!s>NL)W)W)W)7yVUMQUMQUM!;TXHiYTXhəA9BSK -9>(TXHzjPa%g̴iM9^״64+ɽjYoəAyRCyߒ3f>驥f%%cJ}SKJ}KƤ\܄\܄\܄\܄kz}vor=)\\\d**&(*&(*&ܐ*,$Ѝ,*,LPa!驥r@I*,$=PВ3r@fZOS δI/kZ^Ьt޷LYOzjYoəAyRCyߒ1f%>d%c҇RRnRRnRRnRRn5J{1P'd})***&JJ 7JJ 7JJ 7ds I?-5t# -9>(TXHzjPa%g IO-5*,LTC83)g ֆf>W-54+-9>hV:ZjhV:[r&}Ьt'=Ьd޷dLYɼO{j#YoɘppppcM/R'1 [\܄\܄\܄CEI*,$=PВ3r@Zr&}PLKi!Й֔3ppMkCyܫI4+IO-54+-9>hV:ZjhV2[2}Ьdާ=ԑt޷dLPUMQUMQUMQUMF)w/̽8O2\\\5Z)W)7F)W)7F)W)7lPa!駥ndQa%g IO-5*,LPa!驥r@I2Ӓ~jt5Lz!\Ьt'f%gJ}SK J}KΤi4+iO-u$+->rrnrrnrrnrrn۽Q:rrrrapppC6wRC7В3r@Zr&}PRC9BKΤiI?M5:Ӛr&imhV:{RCyߒ3f>驥f%gJ}SK J}Kƴ:IJJ 7JJ 7JJ 7JJ 7(@WpIF+*&(*&(*&ܐ*,$Ѝ,*,LPa!驥r@I*,$=PВ3r@fZOS δI/kZ^Ьt޷LYOzjYoəAyRCyߒ1f%>d%c҇RRnRRnRRnRRn5c7J[ǀRRRRn2lrrnrrnrrn~ZjFZr&}PRC9BKΤZj(TXhəA9 3-駩p@gZSΤ5 J}rZjhV:[r&}Ьt'=Ьt޷LYOzjYɼoɘAyRGyߒ1C)W)7F)W)7F)W)7F)W)7ܽ2 >ɔrrrrh\܄\܄\܄CEI*,$=PВ3r@Zr&}PLKi!Й֔3ppMkCyܫI4+IO-54+-9>hV:ZjhV2[2}Ьdާ=ԑt޷dLPUMQUMQUMQUM|lF)דrPUUUMRRnRRnRRn ܡBOK ȢBKΤZj(TXhəA9BSK -9>(d%4LkʙB8YOUK J}KΤI4+IO-54+->hV2ӞZHV:[2&}(*&(*&(*&(*&XuB^}'RRRRnpppC6wRC7В3r@Zr&}PRC9BKΤiI?M5:Ӛr&imhV:{RCyߒ3f>驥f%gJ}SK J}Kƴ:IJJ 7JJ 7JJ 7JJ 7(zRnJJJJɰUUMQUMQUM!;TXHiYTXhəA9BSK -9>(TXHzjPa%g̴iM9^״64+ɽjYoəAyRCyߒ3f>驥f%%cJ}SKJ}KƤ\܄\܄\܄\܄krbN+$SUUUM^rrnrrnrrn~ZjFZr&}PRC9BKΤZj(TXhəA9 3-駩p@gZSΤ5 J}rZjhV:[r&}Ьt'=Ьt޷LYOzjYɼoɘAyRGyߒ1C)W)7F)W)7F)W)7F)W)7ƚ^_\Oʭc@)W)W)W)7JJ 7JJ 7JJ 7ds I?-5t# -9>(TXHzjPa%g IO-5*,LTC83)g ֆf>W-54+-9>hV:ZjhV:[r&}Ьt'=Ьd޷dLYɼO{j#YoɘppppcR^ {qzdJJJJkRRnRRnRRn ܡBOK ȢBKΤZj(TXhəA9BSK -9>(d%4LkʙB8YOUK J}KΤI4+IO-54+->hV2ӞZHV:[2&}(*&(*&(*&(*&X >{Iu (***&V)W)7F)W)7F)W)7lPa!駥ndQa%g IO-5*,LPa!驥r@I2Ӓ~jt5Lz!\Ьt'f%gJ}SK J}KΤi4+iO-u$+->rrnrrnrrnrrnQ݋:!s>NL)W)W)W)7yVUMQUMQUM!;TXHiYTXhəA9BSK -9>(TXHzjPa%g̴iM9^״64+ɽjYoəAyRCyߒ3f>驥f%%cJ}SKJ}KƤ\܄\܄\܄\܄kz}vor=)\\\d**&(*&(*&ܐ*,$Ѝ,*,LPa!驥r@I*,$=PВ3r@fZOS δI/kZ^Ьt޷LYOzjYoəAyRCyߒ1f%>d%c҇RRnRRnRRnRRn5J{1P'd})***&JJ 7JJ 7JJ 7ds I?-5t# -9>(TXHzjPa%g IO-5*,LTC83)g ֆf>W-54+-9>hV:ZjhV:[r&}Ьt'=Ьd޷dLYɼO{j#YoɘppppcM/R'1 [\܄\܄\܄CEI*,$=PВ3r@Zr&}PLKi!Й֔3ppMkCyܫI4+IO-54+-9>hV:ZjhV2[2}Ьdާ=ԑt޷dLPUMQUMQUMQUMF)w/̽8O2\\\5Z)W)7F)W)7F)W)7lPa!駥ndQa%g IO-5*,LPa!驥r@I2Ӓ~jt5Lz!\Ьt'f%gJ}SK J}KΤi4+iO-u$+->rrnrrnrrnrrn۽Q:rrrrapppC6wRC7В3r@Zr&}PRC9BKΤiI?M5:Ӛr&imhV:{RCyߒ3f>驥f%gJ}SK J}Kƴ:IJJ 7JJ 7JJ 7JJ 7(@WpIF+*&(*&(*&ܐ*,$Ѝ,*,LPa!驥r@I*,$=PВ3r@fZOS δI/kZ^Ьt޷LYOzjYoəAyRCyߒ1f%>d%c҇RRnRRnRRnRRn5c7J[ǀRRRRn2lrrnrrnrrn~ZjFZr&}PRC9BKΤZj(TXhəA9 3-駩p@gZSΤ5 J}rZjhV:[r&}Ьt'=Ьt޷LYOzjYɼoɘAyRGyߒ1C)W)7F)W)7F)W)7F)W)7ܽ2 >ɔrrrrh\܄\܄\܄CEI*,$=PВ3r@Zr&}PLKi!Й֔3ppMkCyܫI4+IO-54+-9>hV:ZjhV2[2}Ьdާ=ԑt޷dLPUMQUMQUMQUM|lF)דrPUUUMRRnRRnRRn ܡBOK ȢBKΤZj(TXhəA9BSK -9>(d%4LkʙB8YOUK J}KΤI4+IO-54+->hV2ӞZHV:[2&}(*&(*&(*&(*&XuB^}'RRRRnpppC6wRC7В3r@Zr&}PRC9BKΤiI?M5:Ӛr&imhV:{RCyߒ3f>驥f%gJ}SK J}Kƴ:IJJ 7JJ 7JJ 7JJ 7(zRnJJJJɰUUMQUMQUM!;TXHiYTXhəA9BSK -9>(TXHzjPa%g̴iM9^״64+ɽjYoəAyRCyߒ3f>驥f%%cJ}SKJ}KƤ\܄\܄\܄\܄krbN+$SUUUM^rrnrrnrrn~ZjFZr&}PRC9BKΤZj(TXhəA9 3-駩p@gZSΤ5 J}rZjhV:[r&}Ьt'=Ьt޷LYOzjYɼoɘAyRGyߒ1C)W)7F)W)7F)W)7F)W)7ƚ^_\Oʭc@)W)W)W)7JJ 7JJ 7JJ 7ds I?-5t# -9>(TXHzjPa%g IO-5*,LTC83)g ֆf>W-54+-9>hV:ZjhV:[r&}Ьt'=Ьd޷dLYɼO{j#YoɘppppcR^ {qzdJJJJkRRnRRnRRn ܡBOK ȢBKΤZj(TXhəA9BSK -9>(d%4LkʙB8YOUK J}KΤI4+IO-54+->hV2ӞZHV:[2&}(*&(*&(*&(*&X >{Iu (***&V)W)7F)W)7F)W)7lPa!駥ndQa%g IO-5*,LPa!驥r@I2Ӓ~jt5Lz!\Ьt'f%gJ}SK J}KΤi4+iO-u$+->rrnrrnrrnrrnQ݋:!s>NL)W)W)W)7yVUMQUMQUM!;TXHiYTXhəA9BSK -9>(TXHzjPa%g̴iM9^״64+ɽjYoəAyRCyߒ3f>驥f%%cJ}SKJ}KƤ\܄\܄\܄\܄kz}vor=)\\\d**&(*&(*&ܐ*,$Ѝ,*,LPa!驥r@I*,$=PВ3r@fZOS δI/kZ^Ьt޷LYOzjYoəAyRCyߒ1f%>d%c҇RRnRRnRRnRRn5J{1P'd})***&JJ 7JJ 7JJ 7ds I?-5t# -9>(TXHzjPa%g IO-5*,LTC83)g ֆf>W-54+-9>hV:ZjhV:[r&}Ьt'=Ьd޷dLYɼO{j#YoɘppppcM/R'1 [\܄\܄\܄CEI*,$=PВ3r@Zr&}PLKi!Й֔3ppMkCyܫI4+IO-54+-9>hV:ZjhV2[2}Ьdާ=ԑt޷dLPUMQUMQUMQUMF)w/̽8O2\\\5Z)W)7F)W)7F)W)7lPa!駥ndQa%g IO-5*,LPa!驥r@I2Ӓ~jt5Lz!\Ьt'f%gJ}SK J}KΤi4+iO-u$+->rrnrrnrrnrrn۽Q:rrrrapppC6wRC7В3r@Zr&}PRC9BKΤiI?M5:Ӛr&imhV:{RCyߒ3f>驥f%gJ}SK J}Kƴ:IJJ 7JJ 7JJ 7JJ 7(@WpIF+*&(*&(*&ܐ*,$Ѝ,*,LPa!驥r@I*,$=PВ3r@fZOS δI/kZ^Ьt޷LYOzjYoəAyRCyߒ1f%>d%c҇RRnRRnRRnRRn5c7J[ǀRRRRn2lrrnrrnrrn~ZjFZr&}PRC9BKΤZj(TXhəA9 3-駩p@gZSΤ5 J}rZjhV:[r&}Ьt'=Ьt޷LYOzjYɼoɘAyRGyߒ1C)W)7F)W)7F)W)7F)W)7ܽ2 >ɔrrrrh\܄\܄\܄CEI*,$=PВ3r@Zr&}PLKi!Й֔3ppMkCyܫI4+IO-54+-9>hV:ZjhV2[2}Ьdާ=ԑt޷dLPUMQUMQUMQUM|lF)דrPUUUMRRnRRnRRn ܡBOK ȢBKΤZj(TXhəA9BSK -9>(d%4LkʙB8YOUK J}KΤI4+IO-54+->hV2ӞZHV:[2&}(*&(*&(*&(*&XuB^}'RRRRnpppC6wRC7В3r@Zr&}PRC9BKΤiI?M5:Ӛr&imhV:{RCyߒ3f>驥f%gJ}SK J}Kƴ:IJJ 7JJ 7JJ 7JJ 7(zRnJJJJɰUUMQUMQUM!;TXHiYTXhəA9BSK -9>(TXHzjPa%g̴iM9^״64+ɽjYoəAyRCyߒ3f>驥f%%cJ}SKJ}KƤ\܄\܄\܄\܄krbN+$|{k, .}]:gmf O55oض\KK懒PY^|?8{O5>5yO;s?óf~N?/|g]?tZ??8-|(qt5}v?pZ__?i>@;OS7k:|и\ۿ}77^qzwZywߝn=yiz}~מ^zZ__9-//ӿI|4 p'zͺ/ϜxiF ^m{\o}[O5\oy[N78-כri7~N?z_~<7}>S?׽?O{z}~i{\}Z8v}i۾4lZ.k_r}˷|i雾\xZ_r/N5_5?O/ſ~6}?O//yz8-l61Zecj",f9_99Obf",|ȇ|ȣ_e}6YEX?2O5:gmsf&9k|ёsn 7:r,¼N5K֙?2ӎ}osS6}5m}}osM{kzGkzX۬?k\|.9~~˾N_\_K9w>?~:î?]f,ww9m#?k^lz9?O7 roN5g>??Yկ~ןYz`kXA&{wk,,//n^Ktyo=_ux>^z}^z}^ֲ5޶#[߽rrMsqyNc̚/Ox>]m{{^9{{;v͞?9^gt+ݟ^Y{w}۾uZ;˸ XǹxqnMe\f~=kippR׉Hcu}ޛg\Oʭc }ޣ/Vzss:F,yHwq}֛L?7_`pPϕrg gC]?` [vhztxXI{C:95?&?G]p8Yt-?x׻uZAr?(Y>LY29k3Ṗ:爠??yZe"]爮?çZ@O׿\IyZtFʝYYɰ:_לZ˜__{Zm\ˇW|W<<-]v苾\__pZoF]i^җk>Pܵ)S>S^ItZOO<-'|'k6c?cO11q>Ns}G~#>#Nr}~ifjCkrZizFʝ#fHr-?uYk3ó!&e̓scWYk3Ï%9[g̣sc79m ?}g&G^?i}rg5/<9cugrן?]>ן/?S^ּ z3gr}ڧ}i^3>3N˵|~>ݟ|7ϯ?_M^{ =zbX=~ȿW477?,9k3{Rkz%M{MH{S=^Z^{-mr졭鑑k-H&E2'#\{}`zo6y:]zO.ygws>BZb^o/}]=ZRPJp|b2(e#"s?9Wʥ|}L]$51|9Džɺ8w gK[:!nu/=Ͻ>g(5sj}47o غJ缑|p3g凒|oo=)w\nw۾p>8wmo?rs?4|p6Ox'is*955sZ4|R q0sIusCs3Y:7scPn=lfݧ{su  Root EntryRoot EntryF@̣pVisioDocument 4SummaryInformation( DocumentSummaryInformation8  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~VisioInformation" ՜.+,D՜.+,0 `ht    Zeichenblatt-1SZeichenblatt-2SZeiger (1-D)2SByte oder VariableK Rechteck VaFunktion / Subroutinemm Umgekehrte geschweifte KlammerDesigneffekte.1Dynamischer Verbinder KTextanmerkungrb ZeichenbltterMaster-Shapes0|_PID_LINKBASE_VPID_ALTERNATENAMES _TemplateIDATC010498411031Oh+'0 X`lx  Microsoft Visio@`p      !"#$%Visio (TM) Drawing 4LZ3cR}@}XAwH}@}lAwH}A<u+ !fffMMM333Iya͋V׻ę5@@@FFFG}oƒUJ:DT5I[1hXT@. .Ub##/am0U\?dK[&/~&b%2~ ! oLh $c)P?#~)~,,J & "& ,i 4&?C"/.?L?\.?o A  },,,'p/%O6$X6Q (}j?k)?"   *I3#oC=S?#A:;A;dUdU@;*dUdUdUAOpNOD`;dUdUdUdUdUdUdUzUbS)R~;4OL%=Qip;RRRJggRph=Qj .@]E' %p3Ԣ~|bFp#| | | ~ui??p9[!i fTd',50fZOlO~C.ߐE#PQc:  A ,U345&6&9Eaaj6 8d7?!%3 URg L-ak@9$KtiQHeuDDT(!cp;/paM-uh\`(+AT %5+H>>5a%h34ovJuX0Hp(!MmcP=?`(z?84?D0pA D7!U/i 4?Q`_1_JD;a3(/@}_L/^/L%a$G[aY %//// ??.??R?d?v???V[l_ru@+y_w-uaDd/r*&oo*o_Qv4DOOO\U$/@__o/DA/Gj:d2(joG2O5j7@oo ooo?&s2;IO[Odd 6 S( $b4@SyYkO(Or&̗T4RDP@+&pqprg-.UEd \UhřϽϏ____"LwnU2r?GXDeTeP贁Nkcc#E_挿¿{%ܶ/o Mv{&pqo s'9K@]o߁3呧G(x,+1fߣSBuD'l*|l$6&w-n!1q;qHVN`amF"%ȓz䥍 / /@RdvMIySe-T"bbbb$T$bb~9bIbyb~9b3c'쩠? 4<}J~>?!OXOpuOGK59&O@_Ǿٹ(n4Y--`e7"At4"H$ @Y,b'@ F7A-48E7 ;t4"H$ @Y,b'@ D@A-8E#7 ;U!U"#$%t4"H$ @Y,b'@ z-7 P&'t4"H$ @Y,b'@ l@A>- `7"AU(+,t4"H$ @Y,b'@ =-Q7 PU/0U1234U5678U9:;?@UABCDUEFGHUIJKLUMNOPUQRSTUUVWXUYZ[\U]^_`Uabcdt47"H$ @Y,b'@ rC-7EW AUvefgUhijkUlmnoUpqrsUtuwxUyz{|U}~t4"H$ @Y,b'@ _C-7E At4"H$ @Y,b'@ AjA-7Ex7 ;z23456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcd*t4^"H$ @Y,b'@ 6C-7E A;X4@H@RZgIR@4RZMR@QZ-MR@F@TQZIR@[F@t7aPR@8PR@8MR@49RRH<(H<(H<(H<(H<(H<(H<(H<(H<(H<(H<(4E}ElRZREQZREQZREEPZREE7RET8RE8REl9 RUlUU&'/0 e4 UFD# Th(/TYTYBBUF~?x<F BP(?4| P?+ O @HZUBH??6*!v 07IB`Software,SpM icPeK ,>bjM k.E ,ZU"g]" e^ %* #uo a? /75"Auf da]sBlt zieUhnudUnzrVGrbgWvo)wiDtypBv7V,Qm&.zWg 2XnZ2a&Hrblt.HD" #  B>TL{&LC?:k2h>#8b #3 ABKAUF~^?FbX?FO~?F]P6 $A >7u`?-7au`b?A@a7u Su;`b]u  -"2>UF`0 \.A'1o','y/%-'-f/$>$M&d2TFKQ"{Q{,;K^?e;KuUKuU,"#>#2N_Nk?<@ a,JU3 AKC2 C>3 X>#AKASG;/`Vis_81.chm!04B70HHA`HABȋ4%4& 3D6 :L)%nX_7 aTAQQA2(SEA EM)V7C&L@nҪ@eAPQdR }fPstlPQgRKBB_b))%gN_5u_V( b2(6bT,@KA5"l'U;hmtibil#2(A4>$-69{[3bk3(3u$>L{x6c|qHdbgHUK s FI~ƹOWEF3#KpB U&a`o@$7o_PUFD# Th(/TYTYBBUF~?x<F BP(?4P?+ O @HZUBH??!t 07{B`8Byte,BiC ,NK bU lE"KY"i;nG DaC"h!TA pG SoUfC wm rE"S{ d!cPe ,>bjE kC  e^| 7  3u ,7=OasNDas Shp}eaufudZicenbl]t) ze.HD   3 B>Tp[/Lp?as&;.h> ,b MJ=UF~?FV*JR?F\.?FM&d2n?Q6 U AMA333u` ? !+5ChMW]u$g>5 L@X!$5 /`Vis_81.chm!#4E"67M `_!b-"#"'?9h:AiA 9 $''2ǥqE0&!$E0&!qP \@6%A]Dc]3V:?Ka!Db1OCK%YEiO{OL@ODJv%YKOO"NBSB53^@M^U_g_y_Rg@14ot'2TALd"2(Ech,@!3qlf1U1 m3 =M!l+TM9M]a6 `($T 6D UF~@xTiC;'h>4bP9 EUF~?L&d2?F\.?Q6 U AM| ;;u` ?*#)3=KU_euo>5 L@X!#$5 /`Vis_Sba.chm!#57_ 2#`$g!-*#*'?9  %&/7 aJ=?Iy+#&Z&P?B#2N贁wNk?@J'q ,A MVq6q4!*#ekab1; ?Eq6 I-BCb:@e2C1%>> OO1EA5~%5]NGxOC9AOI%\O`JOOrn_gPo|'TAFd" (?cp,@&!iA%9 -$b]'/2q`&!gE0f*laUmHE?KlT(]9^]-Ma6 `r (QJE-Os~%_s%/\h}Mf!>zbcrA bb Hsr ~L)uEW/>Fį#,KG$JB CS]Ba,`]@Loj]CPUFD# Th$/T YTYBBUF~?x<F B_P(?3P?Y ȅH?BT ?2~B 03B`T9>R4@Xflh>, bE=UJAUF~?F#H$??Q6 AEDA33333#300 0 0 0u` W?!+5CMWaku@#u>U5 _L@V"JXh#!$5 /`Vis_81.chm!#4"3 `!k(_%n>J-h)_##' ?9q!0!!g}PVh#@>J5A,aG"bCV"1_%>?O!O3G!>H%;iO{J1BCB6CL,155OOL=A_YM+^|>!C_U_g_yXXE+____yXX3;?&oOZe 1O3uniSoooUo3(2Oo.oORo3H_oYo`bO&I5rn7I[oEg 7TRA?"(8F,@!$0l#1U#H3 ?k!b\(Tm9)xB >T*a$`o@|ooPUFDfP h VTB UYuU??Fxha T,aaUQJ\UF BP(?@?F~?$-?P nL#l]dV^ ] $g]Q"U"Y*"]>"~#<?&#A&Br&C"u` ?PYu"bl""& M&u"u&u"u"u"u" ,u" ,u"4,u"H,66t#\"u"///$u)ar;21'u `Fxu21yB}BAABA"!^hO$,@ZLupO耑 @Ca4R#qt{u*gvXWcZufvvWuTj*uX{u ]ʤ *aGIJKMNOIQ"R$QTܝQVWXYC3333.3>3N3^3n3~33333333@33Vf4b@Vqf0φЬ uZ1[]^s@333'373Gc ƢEt&EAxÎ;BA}@c"3"3."c Ӣp x/3,S/e ~/iRfSIA62ab ZaLxVIǪ *:Jzךת'OgEa@braĠqAQJ`FWO@r ЀiC}F@`I@)@AEBsZeȓ3U ,puӐe(p 4>{ScNV:fcfR:bWKqP?@pA3VUbQw Sio@(h#FtϿF@ qRfa+_i&7=akVQhaRkQclQohaR2brˡF@#I~rW{ 3~TE}O bqO cy`I@Ё`sVRڀfK@ڀbooOlw wKuK`1s*8zK@JqyozI@ eoo /uB s!xx7SlP4;walPe,0kNq @Jq.-8r JqM9-t '-E1*dbt+r sQJQLŌH{M0tb;{O,=CƁS=ԯןƋM2'Kx~{עamzD1-?F|ǓnJ\˟ݟITjU˫ˬ7F:-˫YkIՎ_TF ?BP(!RQ!4 Iz{7 F.!`}~k QhaqY.!(SFxfb@&7! kRka},1ff",1~,1ff ,1WVHf312E1kaB12lQ12a(712,1HfWV3UYkaO} mlQYBaYO(B,1WVHf3ka lQ"(;" FHfWV3Y"]#kaS#" q#lQ]#"]#S#"QoDcjWV3,1HfEFWVCaHf``5d 䰈qGA8rL5k0BAK6 k0L5k5L5|0V!CBL5 = |5QQ5&t?U: =|5vŦ547 P@QzqE4HQ7b&qn24Dp)CTU+0F2o$0jjSRjaRD9Q#eM1sB=yIZR1s^lZLV_4pQL׌HH.5Oa 5.. ^fCmnfv3p` T]`avelShift`$xa_d@a3p`OΠ`fs`m!*_a@@ VV%Sr V:67sGr:2!l7s[r 27.1i$3s 1T$y@a@dvkQXU.q.'2rqty!,0}v`n$qqt7v-x8cʁEl@baa%]1]1!H$rI*J!1LLLDŽkq+MԄ .NAOAAsQRe.S"T/.rq.qqAWVqqFYpRBZ}/b[.)\r].QLQ_1(A`ٓza(.44.;[Rx a;`"[TBf"< 1W`B`sh]`cu g`f&+o]`m`t`l`g`l*?`0qH`.:jx +\T`x`bdvq_v!L5~*ϫ16DP`)_R`Ht%k` 7DVhzڠ2xQBuݿ)/\BanAM_0qx2Ϛ0AP*(O`a`*4dFxgy2?Wʷշۯ-K08&4Fb[mD{ǿDD!s 1ϱPGYϋ(6ѲĢϩȩ5hA`# &AsDEy3 UĻɯAv^2`OnwAQ9)(ĽBT0fAvH`Uta)Yp!3EWLnew@)ncbā Av9H`ER#t6Hl ~)99:'ϟoP$tm-At!BT)ங'7İDZEBs&1)/I4+r/o/Av(* t/% *Pa#/?4Vir4F:?@^?mAiCOOOO6O=nO Z\9?K8/ `v GAAtPT&xJb=rb+ Trt*P@?B#o54trptb T mkqőԁw`3P?squ{tcF~ϿF@ Y%ukp{`?u %,Vrq @V4`+AszSPsT3 )5>%j{ိqi!stgq xŕ2htbrQ? !3'󿂱/0 c{[яJar<`Ѡ 5 %*5}9ᙓ @r^rlA$Q2U lQQ؉uyhU+424r@1Ryɒ^rx@7.?@hzi?wԐH}߈7c6z#o/|UD`a1H_\"p1@&WrBdeKTv7.!ԟ@V) `aGo,o>oPobo1qyo>TooODowQS+F搞R6);=[vrrQv>LUF+q StFUevS߅x$~&qޗ݅ԯ1).UaO|tǢKT*ϰd4)'ߕr|<ߒM2/WkNȏ%rQ|evʭVlߟU[#Իg.gM1xweۿoo1CBSCS/e/w/S~eB]v KcVFO/GXiPdU:Ǽ ڄE-,/wb/cƻ͟E/?'?*&)BOZlcƄdUO7c*&tG);AEOb1ҿ)M_Cb.ϛ]!_R8Vb=x](' _ ݂?z-sT_Na2s/@.g(O]Sa5 _;;L7pwrra2wcCB|WV.gWi gU1gtO@|{럘p  D g,l;;.o@o*aa Oo0Ґjo2kJΆb`b~Mk 2(s.®%)nd\S?l$`-@K ay!*t1K쐴^VQ2CIUdUpς1aanOa7P7߸y!X16BòJa@a WE1!UަQb@72Ce$6N ¸ջVcIpb)L(aO[Ne4 (ga# f8 \ 2d T!bu-(;M_qڋgֿ`4@?F\oA`0ΉjM09 Q(3b8ye/˸?FƣE?Fp5Ys?F5&!Q@Ή( 0_Bԃa2U0*s3?ܵ0Ԃ2 k+ݓ0]'%Qn?Fѡ?FW^bd%?F?Ԋu-Q/c,DJ}?5^I,QIƥ,$~//'% ?F*^Y?F[E?F|{T?c,|гY,vݥ,-?C6*~??b'%OZ`?Fa)P?Fů$_?FPvϟ'͚?c, h"lxp_Qҏ,mV}b!)/L FAOSO+~'%`0DLJ?FNqVUO:Oc,~jt7A`,ףp= ,7d__Kh'% QuU?F`4pF?FLAD?X@t]_c,io?JY8FZ4? qۄV$N@a__'%X/~%l3!?FeY?FJ~ӗ oc,z6>LZ4kw#awivQooj'%'-q?FmUa`2#+?F(%oc,Y7 }j GfZ4 ~,ClL^!UFV{WE?FcJΦc  )?H},""3\ \ -YVqjǻ )1̶ Ѡn<δ m|ѠaQaCSVGh4cfUpi$5,)֝F3L&AP"iЧ Z3*p#q8 |`rXӗze2ZՊ@ #5.?\zi{B  ȧ#ޯ&&JJ\BMV㖿t侜+Ģz`rl%ǨΩ)1@8"4߀Hߒƿ./1*Tύrˤ]c-=( @=5-2-9#.@"~C Ȓ#@ 7?D`Ofrsetx %q,kڡv hE 5ɞ)3U+KGAb TrKvlԐhi"//ׅDzW280//?(?< ????QcOwOO)O7(QOأTx7HU' Xߞ^Ba5a8A88F4b./#Dn0B O`]@eŜkol7]j(PUFDfP h-VTYYU?"H$ @?Y,b'@?xTT;͑U@ !@ү&P6 lAu` u(Jݩ c?EDe34 D   J ũ2qL lvF BP(?L0 `LineTray sp r{ ncyz۶&` v%P t e n&$`u v%W{ igTyt&a` v%_Rouy dw")g&A0'2A{Gzm?>5Q?A^n"`Fw lo0~/+n"j?|?+5/!4`S:Ta ow?<*+` 9?& ` 9S5@y0eK $KXOf@s{ 'B $KYtO 6`9UM@gy i@i04Ai '. `%9Dw AcNul>k$Uhh2Q2QEXT/J> 09([_q_[_o!otgU__o_oTEooo,o1A>Te\Ls c!2TCt1MU$U<"itjt AktE*Q*QURmtQ!!otU p qU r s-3"!!uGRvTlwaExn11Uz{Y|})~ARɄ22քeㄐqJ"T c 14.m"?<%Rpsf0M8@H8 MEJUU8!r5GrK&HZ&H͟@G+G3"?GERml&Jlmyome>mGG-GAUV>6HԂyϿHႻFSP6HuANqe (=MQ_'0Uhv$on!3` LDnFxB'3` A@iBݞ"4` C m@bAxB}lewL9WIFE/HU}= 6p9yE49dFY#dMdZB `z]@et`|o+De[~]:aG7]PUFDf h-TYYU?~@x]@L'} V6lX-1u. Bj2u2Z2j2#u9r#ULH/MZ1+B#AD5 60`Vis_SE.cTm!#20AD%`>Copy<0wigTt ?DU1f@M)@c<0o+@'ofdBUArX@Aad@iV@n3@ WAl@ef@R@6AtBvBb@hB@lBAJ@=## AoG?9/#n"E&444 7I#$@HB59_lj#"SV6U8*l>(Uhn E /J$&9"(Ln eg5Le#pheo'T !! Js~o/|R12'"U7A%O3W_7xr5(-6 `F2 xqu\J@#:0b)&`AAs)@E T@xd@Di e i=M]UJh#HT0#3 UEJ\}|U@f?@3!?F~?FL&d2ٺ(1?P Ǜd#pa HkaQ"U$"Y8"Mx#BU<&?&@&A&C"u` ?F]o"fpy" & G&o"o&o"o"o"o",o",o".,o"B, 6 6n#V"o"///$u)ar;21'u `Fxq21uBAy B AA21"!XhQ$,@pup`Ca$Rou@+u*LfXQc* IRg fbY-H- M ZU ZZZZUZZZZUZZZZUZZZZya-yyIvJvqyyMvNvOvMyEQvRvQyTvTQyVvWvXvYv3* j|%5EUeuu 4 蕺!BZ)CT@x@U @n@o@a@%iEPn*Љ4J1[v}y]v^vc@x3+"" qؗAU2Aym@xcv$"" zp$E1u/w3,#? N?$hVW9AB[bSq20S hV1Aqׁסױ!1A7Ig?abrXqkiqruׂ6rS@6'_@rp9SR2MV@׌aV @aU-ܕ?XrcU:uJed*ɮ᧤N@q37sfjBA'b6bjB'#KPRQʾqjeArQ c@(3FA{aٿA3b!&»F_ v7_M%;f!xjB!s(a?xjB,2brrP#VFI%r'#7 3%Р$UM_ }uj_2 ׂP5GׂWsZ2bQwvPQrT_@|wu‹ׂPc?P 5uR܉͏Cgyc(` q(`e80{A @9-܎ Ʉ '؏bAP42Dr \sya@Q_X俋NZ]b6 O6͒z{ # Z{u£@%ЊׅqmϕDR1oL^c,ߛѯgZ $j%{|ב R{iۄ);qσ⥞occL&d21b}aN/9K!KG'!cpK1a81YNSFxBD $e0Bof$z:cRTrDBʩya#HuzR j"^vc ` T-pavelS/hit`RHq/tq `OfYsfps}1 oa@@VVSrlV F"1+-27i41Tb4_qt_;aXUZ'2rq_!n0^Spn4"1PT_sE<raa-A-A1Hc^IpJ}bL;M 2NQOQ1\Q\QQؔcWRS򔆮TqqW&o$Y@RZMb[Z\g]tpapa_TAQQAbpJvq;Ϥ+bܤoa pQ+d0AW`BfpsĠh-posugpf&+o-pmbptdp^lbpgfp<XR*R?`0ȁfHT` jd0+9TfpxrpbASv_vPQE~ 1;F`a`пҡ<Rfp%tknpr !3EWj|Ϸ2HaB^׺/9Bmqn*<0NHBew0yQ̀~`ϿOdpahp+=#bRdﷰ4z:$ߢ B<R ai*rp iisXmTZdj `F1H<zՕ{xMOai?ޯ!_` tD.Jr5<}= ` K* `[Z l v 3mAxD{z{.gMbeᒎcQɥģ"Ĕ,/ħ<w{) ѫcĔpĽ} ѮmJ5N13_MsSspy`ID?S/c}ba K"eb@o> )עa2¢ `DVh%# UD kmjBt2ߧ߹$c褣%!rr[Rf`}aTy7[C3DnUbe|b;ruv`Up0;nr`1:븁X%`?$2$N1} Y4Brb@qAa-aa;qa `//5?*?cT Z "!0ЏQƽP׳M+Q ܒ*QDb)QX\T׳a_uu`bېRIu}ܒQ (l\O~?hzP-îLޯ)ّ `{Cݕ2YǕT `ƲG . !ё1ɕHᝢ WGMĪ ?Ɓ%Qx?ˆt/$Ͳt ڔ,ş$O4  ,o>oPobotoobo1*BBZВՑ7zBoaa^屓aG9gl6ҩ$xrNPƯدk)D _& 3EWi{ߍߟ߱ /THZld Z_VjhRdv=X|w$%F / >Pbt~44FJ3x<T+///(/aNO:QN9O:////./??'?9?K?]?o???1???? OJEOcUQOOOOOOIYvotuoacVh͟y_T_ j &m toB)j ooQvwёʮhg_#F K?F&?x?0l}G{,:`@"   -?%aEr%Õ))EyXR} o`д$#?ęxQIr/xUt,bwXUl0i1ewvv֔tQ=Q)R}h4FƶwGYs?CpYՕY 4e%{QHvsLQgŘ{)tUbzf^ȯfܓ֔% E:a`*q>^TbtxoMdǏ@هT/f/˖{OtC]c VqǐI֒FV –nUF?vn qsɿ *Ys?F>?F:Xc?FMڪ﫰|JܡtQq&A=QngiC21MwZ漣A$rqg0N܏tE˔F*CUy ,Xjw=Oas߅<`ߦ7 {RC*OoNkrfŜo-?QKe_? Obweoz}&U.V@U4kW5wR<k 7 fwdůWdvw.ϒ,u6^.ڌ@(]/5Uk@ k@Dw,|@q K0/'LK9'Cm0ϾSBs2ّ5)\ls?1D@ q>Aw9#uQ y~qҰq٪$E)U5G1r9{ a`pM>AkVRbדL!.UEG!ܱ'kWH٤*Jn}viIpU'LG(A^|{Օ4߭9w7;Օ f!+S2)kt/'م"Nj$6HZl~P`4@?FEO jM󎣈PuY Qᦤ8%/˸?F#eֻ?Fp5Ys?FwtÊG?( 0O(LпDJգ<}?5^ITLQIjL$?~OOI5 ?F;?F[E?F3Ϛ)O(L|гY<ߍTLvߜjL-C6*C_U_'5OZ`?F3$i?Fů$_?Fir8_(L h"lxHOj?FeY?F܇]}(Lz6>19lTkw#N<vuqRd/%5'-q?F0 B,?F2g#+ׄ0]/٨(LYЍj@ T jLCl#15v?3FV{WE?FD~ΏJNk(@(+ WIHg}jLzB՟$q$D*P!)=6?zH7j A^ 3=< 2Aġa1aS~h4'+5.ϼ7O9H%F_p8Ɋ( b-SlJg&ǯٯ>qA>%7IWt?&t:NO/ag#mҳ31>ũ!bX,!.@-R^rC&Aϵπ!EWiSh:Mu^9a.^;g?&h&8!AOϓ{EEEW{>h"R7"(P!1('b!)1jUP-29Z3ˡ#@$ 1d>"wCCZ3Q%p1bؒC!p2@&7DZ3`O}f70seto?uܰA0&2,?>?P:v72p&1"E$A1oٿA32ÿ&A>+5R{w,0';)w-eV-jUCU+ a ?%A'; WTrvt0lghin0w8M=Bb7OOO;J!HR?+vOOOOO__????(?q>_]?u sEtjqttHD: #  h  T0]]9 # B 2AUAɿAhY?ٿA,c2ֹƿP6 Au` ?A@j$u#J.9axu`u]`bu`+u >ڍU@@M&d2}34"ÿDC'>"M-w'>"D(p A "'$"&H' O#&5 $s&]$2JD=#D> D6#U`l"_# #1?9#H1 uNWzIs;2 8J#2zGz3Fx$2[Ru(/YB DU_V?\.?/B:o:2A7P`BackgGPou_ndCM`lM`HQz@@bZ}H D?h1GA #X8P6d3662Q1CUBF4i7o117;y0~1Mr)Srm>de}mspTt "qq"1 1381812tMItBB Eb'b$4ANu13[h2AuBH1BʜA!ʩ¶jÄ[QЄT݄zrf>!$0 %3To1/u/u?8XxAC`IWsSwSwRs%o.@0RgPf KNC`teI`\ai!nn3uZR%d DM`kO`mtiM`5HQ-2HZv#`NC`o>!8V@MKsEŭAد3dVrbRaPags0bjkTykp~1])S搹qO`zfY`u^s;cTͱnA²oivlPA$*q#8@q#5$rQQR*E?eNRעQcBdg:b`OTndGPuNEb;StRaaGPdB[Ÿ-uijd[„6k~]QRƀ@gP@ A>LEs?e\/dϩs Aee"g 9bY`dt2D-Ÿpsr- Sqv߈;`aݔ֑#pS~>"ƒE*ȯ:b` Txk GPp}1Բydc j]aaAe(Se1dSrʴ &e%\g#d ɿRf);M_=7DßӁ„{81,[/O^kxÅi-ùƁ3 uI[Uu`  *L%LBW?AP)Es̲aٳTe"/)#We"ɧ??? ?:OOB&c_ //Y`6?H?Wis??]CJ_ oAUCGP?e`(__! m2oDoVohozooo0 siԛOo oW}_oOOOcV¯]WץR=Oas-](]uќoo~Gm#oTw {Ɔ҆΃S 6:0Bw)s͟ߟ'9ρJca:smQm Krаe/Ȯя- voP* V²#5VUo"/%Wo"O _._@_.o*o/**u(!S[mJ5li@eu+arw% UR°l;Q@nt9'G} !M @o#1Ϡt+o_1OCLRʿ.@=(*jMD`sprkND߂ϚByiϹV" ?5G&8߭\n߀޲5F/=$2&"4FXjj"j"/ɨu*FXjv_?q????9 ???Qc0OBOTOfOxOOO8B+DO!O=`Rotyfb)]O( !1idBm!?ȅKbB;rbrc`R@*@;H(iPB_)/BE!1v])g%oks{1tpnN;GWewyuPz%doaqm Bqo2;a2wtSkmQb@nvUaTtnsb bdds°bjTq3o: rrcjKbT!E!222?kl;!30kC2m2  aZZ!*kψC\\E&&BGO ='`C²!cRf Ot9d_D@qA,@"hi."4 b bA' Y! Pk?zz!!_lDZU!!'7!ƕP d>"p}9+6@,1X8d:UPH1/0rb4,1)*AA/_"_o & #hQQ,0#` B scriftunkg,1 `CWalPoPtQg1E}u+iH5u1! 7 @@j&@@q{`?@rbk?de?s)gUA$ &?$%vr;#xAZ%RiLE" 2 0"U$2 eur! |u[]4 t&&(s~rzlH1AUH1?iiu5U A2z"ry"!rByǤo VTPQayl p.-LPnPʡTn/k?Pup r 3Qiߢ PuPws 4EPtIkrJPo?PlΣV?PrPRʧIE zmr󢴳 5D b9TB*nPnߤz w 6VO_LA!0jA_(S_e_{W'6&!3A(P!|/2g1 D1y 3 H1D1oE7@q;E{e|lE1@@~!@Fg#?F"??QkPyA`Q27W(ATl 1<25l =clYmfxAj`PL!@@[g?+@@1#_  +??@*o4?PD}p\z-uru`u0`bu ,0@@"4o@a/T("q6y /B#u2#Q*"0#ᝯ2,`6@@ߊn`P @$Rxww &;01O5l^3);hK(a~"f''?銞dYկd#j_ubsUTK0a?DbB`@_bzI/!*9`P"3\o"҂3q55"1I7zrHQQr9:z:a:a9aaR=R>rrqdQhQrq(Qr q2aatQmO\A[|RlqlqⴋrT,@rLQux҅t0`q^qspC&Av"rBpsx^֔u~*k sa4azuNu ca@bֵf7sa9@xU܅-rQ9PCaLJY„f6D/@r*PPV#ROj&TP@Yn`@Q.%Z$yaUBaXfpUu!`4q х4s q, to! ТZhQi5,Qrc3LP@j*(B<@b@t^?$@o.a#@PIKr3[b3KlqJj/ \Ca/O Yn`5PQYYCZOǐ2p:F>pKBrOgOq/@LKHKEKːYCJ=Aұ)VZn` OzOOOOE^Z___*_<_NXQ3h|GCA|epPKd @A[-B^ AYsjT '_*%kŽ_Zoc ss&qg1]JS|([w-v`DbKOb=~h>fkviKleN{>f8{gyjPsKϝ̏|vTXc[עHAmeZfDo1ock2DN&xݟ^p*wwjo>f?ʗTٛg>f,GY^4Fܢhn??Qa$%<}Ac)#]KAt^ FA1?0_P_b_k?@ܟ9Zm(͖pB?@qK:?@W@ή8W?@S^HssZ*m(5=*/P#&?@!W/?@?@F?D'A&a?@0?@vj6??@^ŴBI!O&J6/iлH$?@ T9_3`?f\Θm({E=T@m`mЁ?@l6͊`?$Zm/~&0=ficUo@@K^9`lخgA%=,^?@tA XP@@z(fkT?@Ô1fe=j.ƀ?@P3{@@5 I]ͻ?@+ӟ wu=~@h{?@j"~#HXt$'=)&3I{(?;3 BP 6Oc= }…lO'ƯدH6[0 O۶f_@3l~ !H<@)>PbtφX?<)H\t('A)_qUO}Oash8\@?x<@fb@t^ OH3q$y)AᵅO(Ld?x<ǣsxqM~^ACi#Sq"T#25(3 #A/'2U:H'm!D0B 4"!` TextwCo orz`` LainFn 3` Asa&!4` mpP  Aj({"AFn(?A!3~yZ[O PA4wq 'HFdAT(q_q3.gq+-뵅h.((zR28y3yPU)^BPԇOOOOOOO__)_;_M___q_______1i/{/^X" 6q'AS6m#p Pya d4//*/E$B ?' `?FM%# %?)Q.(gMACoooo|+>,",x>Pbt}R,>bMt=ζȏڏG"fFXj|xU,įFX*@pԯ8G(ma" AS$4!̱ q 2aaJYĆcy"ȵ08̱u){`gl6ߛ @@L"@@Hh4?;C¹?FG[r;1֔'u`Fx8<"\YP"Q!cZ"[!y!!2..Arq´"T,@-@<إN`-9-L7Cz`.WAoubҟ Ab;sż.v̟6 ˟W'?̵4!Z)4TB`xAp`n>@tzj7X3#|گ2п6=#X)Zܽ?-qry ~ZAu`u`6@rbÞ?5@hȩ.p@Őc)a&M/_)s6})7Up`uR!cA*qK2-[!*U)aYӣ#Հ@+("euF@X,@@cP?$ 9/fPtwߡ2wy#wI`rSbK3`q a\~a c©Fǐ⫣  Hː5<Nas i!3 w%<;㐐/?/e u' @N2 -< N6£D1 5s1 .h fx sN!P $4b ?O0A&GWA///&6?+//O*`׹m(D11CJ/"ǗNO`O//??M'X'jY K"K(;G"JK>1?/KK__O]?o?_"o??MR&vum]pɍ0cKdoe񠬁lOe񑡡ojFxKk@[?vuS‚@Rmw@|mƁ NGy}Aog6oo?M@]f?qoooooo\ke?__O\Z ՁX9/ӘC_U_KXF_}6Z?Fe?2”,zNt/DF`0 &F1l aPdl/BjZԘl-U%{ 酼N[bzf^5OHƏ؏bo2oBbd?Ffl6&FF?FuWuZ}1cԚ\ ϥRsBTЯ*oo`GÊ ݢ{Կ̗ޟM2.RkO֨ϸ"4FX<ߺ̱ 2U9MSiO@]ўyd!4q<|a|aSeOZAkQw9+OO!@ Ai1/C.</bsPbOo@nZA">Wi{;^5˩?@FmtĹf~:G?@?@;:y?@A^}/9*[Jȏ :g}= A?@I l?@C"<%0Md 8#(m?@'`sI@DϜͰMUh>OmHaoW?@&N?@?@+%U OmHg6D~)cK?9?@_1n`Um,H_mHﷃP,P 5b?@|XYm˗_mHOgOw^ G/6/?@$!?@d%FV^_mH+5gf ?@qK"`:= ?@6NZ`4olI5gN@S:3ί?@foQ̄oȡ4$1qY?t@  O=rbK{!v '炏ÏՏ" ?V N x4(1(<1> =Ÿ?8Aį߬X,@@cPx114<1U??D$yίU@`0 Q/Si ^1Ts] <kQ'2qiq GQ! Q#`n%bC6a i@bpИCa zq`%`>qW,@Q"acqB@>q݁oӂ_=@`{k*#pq95"+aq@uo}5ub lҊq徶#Ž#UU)*/023456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdTUUUUUt4l"H$ @X,b'@ 7PGcC-T8E A;X  !"#$%23456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcd*UUUUUUUUUUUUUUUUUUUU                          ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @* A B C t4"H$ @Y,b'@ C-D8E An@SZRR@SZPRH<(H<(nELSZRERZRUz`8MU?R; @3L&@ LFDTyB tuh$/T *UF"H$ @FY,b'@Fx@AǁBCůq !]2 H  #-N!-|1` Ba0UshSitzn `Ca lozC",>1R V*a0riE dֲn^Ͳ ` CڠnE etڠHAʝ1zL)vGͬ!?EHPb1\BB>C>d~  N"H uHLy]1#b7@=AK P $#N"=OasN"%~ Z$$$$$$$-$A$UUU(Q 4/4dB|# "$1)&~C`SN"Cg-}#V}}}U } } } }U X%W&N#3 &r0IQo*ƒ%̀S!+A{Gz۔?_%Q? 2` S ]ao-z@"//` FܰPRtmױn&S袝u`` %.` ?1"@6@6@1u+ A[cWnm'?C41`%TSaispr"W2c#w2}??<#1`)?T;" +Smyx # ` )WXOcf`em+H 7KYFOЫ `)Dܰ1i%`J)Mgibi[@!K_#eZeW2za"Fw2 `Lܲe?<V@\rXbTb }TaܰҺ@z-V ^V N?V_V]rXbY~[%~[1fe*e`ƨa˃]bzec>e{l-C#)$⦮ vP rBIqdœIecQש3G~cPaess@` t_rlPu-`u.`qߝx~$ gD)ob~eũRőe{n e\2U]?qÀ?A?G beZ ґRVܰsPRRD@Y\m#E0ѐ3ޒe!|:ul|a|a "Tѥ1111ob3b11:rQQyd>7$JH8Wr9d:qы$ҡ=>_«ino@+r,qٴH T,@Wroe0WܑѰC@1ouzBqe[A-hrB0s:u)f9;e-- 8X@'ZGQ$Y-IGb́veɡvIbvJbvKbvQe!vMbAvNbavOb́vqeɡvq!evRbv!eTb!eAVbaWb́Xb̡YbءIL 9  '4%H^)qT x* @ nY0o @I$pХ)˶UaeةeD]b3^bS_bs )vae hO`dhcb "h p=a;õ / J/,$ƶe4?Q-<rZQmarUrRU@T?@rϳH`f3z6]@|YOa@Xa>5qƶq#ϡ3 Q3-=M]m}Ab tUHPuJPed@Wwa<01ȳ`aUarA 4S,@:Qɳ;@a3SzVbR(JF@h4F@A̵Ի`O2`<0tC0#`I_0rp 3_0X,qrz? ql? pPrF0arѣqucDR*fH0b@o5o?Ylrmgq{eR{rcjH0EaijF0 o@HoZolo~oelz^oo xqDSڜgaƜekt @a{-bm~ 1arZt 'i{ŋzÏՏb sQA}&!r8P{=DdbkO^ y 'q 5G8S'|{R"x_01{am`MzqD{1ݏ!,>PbPt믪jh  "O ',̯b6:_R@Nt?A'M_1VwR1w[RtU"QYA` !PR}Kt2a'Q~aLA3SqFxyoLs!B_=@@`{R[n?D"XtT[u}qɒxSyqEtOF tX>>BH3IJ*9LD*MQ N^OkammsQR0qQ`?TI UaaIWӄaXY턒ZR[5r\[r]!3Q3Q%_;eUU@ I`V!]ad[[;|B yqudP ȬD}|XP`BM`sh`Vcupg`f&o`mRI`tK` lI`gM`T;b,,,b?`0 brrX@Ӧğ֘XP+TM`xY`b#<5yrv!#{-~L@FX1hB@}LRM`ҡt kU` ίBT0X2h@gy/&Ban˯׿YY*Xk(yoρϯOK`aO`CbW4h$5@O߸ mܥ7ƿ i*Y` Fipi W-kB@9K]ﳦz npI`ab "W9hO@/a߰SV lO`sY`pdKmepW18h$\@ )}ބ,n W6hit`"&ys` F^pQ b# gv]ϥ UkŠl6/H/ g/P3/ #ꃂ@ٷ///,QGwŠVc?"?4? U?@Cm?W c??/0! (=)O#O EO:S]O KʝcOOO/±O?O_ ?_@cW_ B͏___%S Rd_o#oEo$s]oWxk/oo/OErd _)A QĂOO_±uo{  / q/$S@rbޏ{) \1aasWU1n" 0LŠȃП{ *A2+_AA4e-SK⺱p߰߾Яb̳ 9?QD;MD|s%pѿ鿔 cz_!S?ϿXP#S A*s 0&hϙ͢u3+_S7f\2`Ownqߡt:QEϦQ_fPUmQ+=NfyZ>PLmns?": _rf,PRt<ݏ:YP=Ϗ$Zt mptm|Ù?K_3:C5)BymsalnPyqI4_X /fR۲th/3+:P3arL4/,_p// /S;%n p\) ɂAMmtR"?:/+  Qwb$>bU (lQ4gUU/GA qG@Nt?Gw?aQDd =psAG /p8  ͐|љ͐kљ͐Zљ͐Iљ ͐ ͝+sA/@Rdv*/N/r/ZO/~O&/OJ/\/n//// _/D_/h_?"?4?F?P)G 26er fGm0'z(MH1Ct;Pt]t24jtqwt=tatJGt<@ GUt Gt GɭtPttGtYBqA_M{w2nws`MS`IDTSSt)}#5EJ\d Katgo0`innqapdY%d Dku`tiur0$Np0r9KC bPrmqW*aAaXAg A0`fkTyp_CDnObj0;G0`u7p;SA}rxn zANqMrzqNqqqq.qa M#ǠETc%])deKrl/v// ?u.d?!K/D,>P?p<$e'O#KOY# d R)wO'9@RpP>"8r FΏ E[}4Sgi[!oCsN ;E2naGwyZPJZda耨!m`*$aolZVpt`t[ik Et bpFiD&Nebws@QKBqR6rlt a0RU q }"@6qNqLQhquqΕhPU+s3r5p5PyAHu$AmA TywBT8s@ev@LP`<bu$wǣΑM vB4tl6f?rq$ Nt?"y0u veΕ2 uxAA   ^RawQLQbwUeLQEu'}a;sQGv or~tx c?[ЖǖkTqx30 ?HsuЋa ,gl`U+B{ |UykUyZUyIUy dGv 'UyTz ASssa'}8s jB{ R= ?nTz T???w"1P ߼Gs/AH˭F !?F:Y?7q?0MQ@"Bs  -w?^%D1rkbob pwkbroQocIXm@ O$?j1y!Bua%YT*JȗFl}o`o~ SA uj*B@AkQHOO.!1Gb2xMrvoUfbzf^CߏKo)Fs 4kQB{w%%_7_PI_[_m_rQqVT__?y4__oneONd7wv^o]& rFH|bb\qakIuWUF|> !dQopf|D?F:ɴgKݰCO&͐")ďA4TP\Z{Bs¦!Frƀո32҇|X"AecRvvN"ob!\lpf՜oofN`)ơrT䰳WX!˯___3EWCǿp^npog5NjooZUB| !tPoEE{~ wO%7yA{T$ nƆ&؏P /2/ 5/24moEZ' n574F8?m!ݯ4FXO&O;CF2|sOOOE)/G;`O@V=c9W3?Ml$ݮ*׆%zoN6W'@{ؽooj=gn)NMlb ;as]bt}rrD)_ lPwP PDW,"\FF9_K_5QQ Z_0$w+x[__wQ;x=v"3c9q),o\C?wP-@V Q*!VܐNʢaA=NI`oU{1QWyRCit ?@%:?@j U"p?@1 nИc˷}?y( 0 Bsa2_U0*s#?ܵ r" k?+ݓ h#u2ng;?@dAc?@6WK@D?@h6FϪN\nDJ }?5^IQIư$~x2ّ?@1?@'/܎w?@t^/n|гY vݰ-C6*//m20Aa?@6I?@ ׼?@Uk/n h"lx p_QҚmV}b/L FL?^?62.?@5X6?@;CMLť?n~jt 7A`ףp= 7dO!OVX2h8r?@Ds\_lL@_JThOnio JY86e$ qۏFN@aOO'2 ?@m܉9pgXvg?@&AhE+_~nz6> ~g g8 d +j 4! z_< ^m a{\a/SԤL@4@q`{t@c&ፎF/bXAП␂e#9 .qCPbtď֎F$D"ؕ@@!J9ȦgFetMx|ӗ 1CCUyMԻӞAﮧ*$ĭĿl~A&|Ҙǟٙ4!ӿ1-yqqσϕϐѯ!)<$5_"x}֔hnߖ8!( !%P8 29á#s1Ҭ, tCu*cTþ@Օ7JD`Of}set ׾?upUlr Ah4F@A_ >+  |s1,v呂s1s5%Us+q : ыAm Tr@U-hPooooo yKs؅Yk}Jt .xVlT¤Ujʏ܆MqR*A@mrEgJtkIugbRMqLzi.\krifIⲷ))6pq/odTr'@z3s1NTfф1FDZѱ%Z j9²*^W#ѧ؈@a@|A҆vBU$~Q%̀l[A{Gz?xտQ@ F& lhGpH@J` !N\owS^` PBjr@E|A`#n|vnyM\nC4`xR S@yRE&a7 ` X; Y%t0. K`D& vcBAE6Qb`M g@'! u#V"`5OS@TB# umNYzsh t"~&1bϠH@KKKGUGGG GTK G Gr 1d34&32zz҄bCF BP(( LBeR@dB/Cl32`Il sDaP(24X_@YmBkҿ@q?@a [??vêCuLYMp@bB"p@0!uYdQ$^"AR#uAs)4¬QS5_)? 1>x %?%6ϑ?\.ް?A@P?C1a` B}gQJ`l sEkheQhWhSX>o47Q@DrFB%BmaloZeUXpTIQDhR11‚ $ RҲDD7IDdDDArD2TrdT> Ta-Tfa:T|GTTT"!؂Lف0{T-rˆT&lÕTS!AAůTLBƼT2T4TdbB%_7EEـOFы`Iw'E%G0FAool$o+G_ 3+ Ktg2iSLo^l…uvooo+G%F1 D0)#nY@o`jRՓ1a m40&P@*H 04NA#^^l K}Cŗ}u6rAbI"|r3V$bH-sObjYT{pF])SYqGTzzlGs;qcCaFnAJoziS^d8EAAA Qd"E ( !b 8p>J7zBWWxwo2`OCKցd0uz2;dd|DEI"P@ _ @#>@HHEs8RՂrH(%B~4˟sUAZeeygE&b1Xy%A.@=~h̠$LUH0ABA4˿ ݵE%o&` mTWxEk0pG^d!`jƳΪ3 gݠ!aAaQΣB4ZE5%(7I+G11mSẁϻai5r$ԯW#c RWf(:LXa̠nN$B QBQBqQBA2A-!SB0QB=QBJQBWQBdQ;~QBQBQAQBQBQ`5qQ-?.D;` `ߢ8$DRA r7>W9 a`Easarƃuj|7Bo4//BR5/`+RP,K`PbWAټlQ@A7SPӬ/(//[!f -?!?3?E?W?i?{?CTBPi䒥rw"/(WjL\nOO'O9OKO]Ow"lb-෭_S-qEza??? 4PGf-`ϑ(\o8SSJR_XtVVV|Sw#,fOoo&o[phPo\otooooooo}Qؘ3auM%FuR)KreP?8_(n__vOOrOrqi wuVoO_"_ӏ +"o:L qEzD!4FQr^r5f?Jlej1r7% Rl;:>nt&_5XߏQ㇢Ћ|A?1C%-?cuzDa-KsM_qσϕϧπσ9 ӯrp0BFؔʟܟ$(YPr<!3EW ɷ<ض*@ J+!FEb paҊh@6@BP(d?TuL` Ӛ޶?u:t `[tқLuᎄ8?@px<޿ ϛ?:e[?3Lq[mB>ajO_̕a6z1 !3"lWmVq;PKVP vR]b $lHbNcz1qiHihTD ēct!paߞǓiu (MUT6x4%ipKvo?hE(AiELuiEo쁃@@\.G:EPg:z^@@:p8o@"pa @z31"CpSD Lu,XM&d2?EWiB 7Tp.`2JObxEtlhߕoz1 cy!RRy!he@);Mj>IOB$O6OHDc1?=c%eO?d2v#d!?}A!OYkOObtovEQ_uM4%4wjPv`Q0Ta=d,@>|Ta??oaqPTѿ*b=蓦 dwd`pvnoq__yU{6`*Fʽv\n2B˺vl$A 6QŽ6%ޭ>ߩߣ({B˖-tBőuBż>cuuj "Ϻv$66&Fpm0*ϴ0.Žbi由12PPs% rXq'2qR!TPش`!'L㶹51B %ճ t@a1aAW!`2a֕{%qۿy@SQ&s}"xH 4?@xMQQ@8bBcAWlBmA2 1 옞[T/,@g-)gg̝qCpqou>-ȵp:Tgӂג7¸ `ܿ \$w@(ZdF@@)J9|I*KT@= H@hH! G @GH"I'"JG"Kg"ȡ"M"N"O"2_q'2RG2qg2e2Q2V2W2XBY'BgQ?JR  lL lLUlLlLlLlLUlLlLlLlLUlLlLlLlLlLlL)S7 4{)Xn)VnTpxp `npopř  =I.[aa[Ybyb"]b^b_b)~$?.p@@r=`rc@rgY)$a^1Mi`r }[$s$-ۡZ/Srj,}re@ʏ@r܃/m@=Pp@F sݑ[ݑ[CGSGGGGGGGGG#W3WCWSY+尜_qUPu\ed_,g )Ġ2񅥣ɢI7 @!IcS[H7'!ԋPm2P񹀢#PIrIc 3 bѠ / c` /אV~ϼ㷿ː*!jF <ϾпJnπxѺ14LJ1eNH @!-Ž ! ,ql-߲;9K cs!I#ݜܗbbObҁ؂*Ւa| "עmD1vSejQ!3na +j, Yp//0B/x "@* u@A9Hh 83 I2@>4qLj͠K/8f?ޠ8J@S,wcYB>j-F3?1f)ѨɒX;n?Fu& Ԃ`@AaQkJ@Oj5ЈG0Y_ _2]A­UPV PUUUPAa4U 1m USe_?]j 1meUv^Seq g PBeh$gRTd6`P+;h pZs"Fns[vsFs6ɓr}Xssrr}Asr}%AsAs}6ӓ2v6,ZvJA6x%A6A,6ݓvA܂ṽAA#66v:A0^vNA:|:A@0v?:yvU6#6XC)C0PT^E#$ܦ r"Ɂ\)<^ iAi$ ?23@ٗ??=PsDb5T;pAr6RCA CD8j1` TavelShi"@t<@[R篱1`O@fsͰڽEXa\/4AV6A]ayv6yÉXyÝhD})B@Ah+o!_=<@@`/{1aQAun"T(7&CE7رz Ei;FvBQQ2!HAIAJ%AiAiAALAM 2AN2qO$1aa7QQj0RѰ T,pQU9AWW3BWSBX$`RYm)BZzqI[\]aAA_Q**aɰADݱAaaA;n q:}A,nA,7TaW`BͰsP@hֳugfoJmɰt˰lɰQgͰK$*µ`0B<@Ӥ&8DV+VfTͰxٰbnv@1U~ aQ!vW1!<@!3iRͰRt/kհ yPN`r2<@ 3M/fBnKWi{RS q//AO˰aϰ4/F/X/j/b/d3/4H<@/8 /J,7fF Uiٰ iiE?i?ZC?Q@ǹ???3ti "Gnpɰ!a.O@O _O8SDwO9ۯO`/O3 qiVUlϰsٰd=Kme__=_*cU_18H_8_.i_oo!/osGo6RԂo_o6` k_oo sYmew/% UkEu6_0Y ЃYm:7I[X3iGFwE ֳ Տij3E8+q (p) şݟYm);5i~Bv~ ׯYmAz*!33%O R~d ſݿ173#5i% \n!r]Ċφ ϒYm DG+VBZddv߈ AߌYmJOPtSir/!b)&^p l YmwZ܁A034QRWREn @A@LE @H>P q`T 2 DhO6-OK%B:?0?>Pb eL}Ym*__TD+As );Q>#(iYm?##O UA@s&h/D-h"'b/3 //K܂/`On/!/ODiaC+7[/&= L?^?p?K RU ~??=?C?&=aO+O=OOOaALnoOO;OqSO&=O__XKC1RR-t@_R_>v_Gc_&= ^t!t mOto+o;Lo'sdo&=%oo,RdB"s l:Ro?F4 |_K+24*t u-*faD#s"r̄h JD@VhFu9S OR! IpMt} t:΃C#/('܊a 5rЖ # * h=>UO%gv`nlM!khDywROHwsßцޟ*$Ch[*&GKSKtUTpxֲGrlOw+*-&@rĀ4@ՊG5 )!A~s%pWBPNA:!bbe.z t@NEڰWOKUSUHP RЪRڰI SQ/qDK rp8!'CTEmѶa}=ILӯՖz@bX,@x<˾?ךԔ"um` F_u` ?Qp>B .4 s"rBAs"h`A sB`zc}sԖ^lz$UA CC։U/ ѹ{@wD~b`!~0!~PmР ߲mГe@x M|QMkQMZQMIQ MAe Mg`Y s!+*x<[g{ YD0FR agP)!{s!= M ^ opH=?Q `r* :%UM^oR$R r>E Q% CUgy -Quo??;?_q#OGOkO/%/7/ I/[*'@V#@/pmњ@@=g/y//////// ??-???Q?Ou?O?_????OOo;Oo_O OOOOOvO_7_I_[_m_[/____oo,o>oPobotoooo0oTox(:L^ڟ"$HįlƏ__X2 @`oqr8o\mW>qڨєĻң$ĐҤi3Ľ|T 8 E R\_#lyq_ղ~N'`b_`IDבҒ}ߵѠ K.egr߱wa+=% Djkuwqtbijs)$ҹsמ&3wwpщ| WZr{RaA'4 AefbkdTykpCDbnObjp;GupNp;A r nh.ONѰżWuL`!Nb6)/QRY@)׭Zsnd()G8VqH!Q.Q;Qbwr\` Engp_schbfJ7#!zp!A!bl pdptC5/G/BR&?89HQUM)))hCUgY"`# 3U#+#%b*'[K]a6ѓa6)???w5? OO.O@OROC)TG/$rI"Hr=Y$QI"h/?0W("///OOO __Gr=obm?nP)vOOO55SdcT:pxdk@O !}SZ5oGisQWeI#-R-_\)oooJ9o{Srb!?@Rdv@j 3aJsӡuy#)U5Kjrpl9o]oPotծq֬u)t3ŧ˟# aR/!` / ?)[r5X_u0r$OERJgqiP&oRs;E!nTnGbwbyPdnah(mTwojlV(RtktPi"kRtb(Q!!޵bn/sHj l|0+U͢a8̡NtPpbU+sRwtb r5:OWŠ%T@{%O̠` 9uPCscN _꟒ 4Hџh4?.@FW}Ѥޏx&A N2ߍ kW̡n{̡(ŧhÉb.Wأվ?PG>A?!xNӃ:xIx~:P(\kAy,ityhyIRU |kZ*I !!* 'O <RҡJ1 |  |Uz qF BP(V>rJ1zߌߞ߰1 x%)@Q 2DVhz 1 J\nFjZ./|"NӇ'/*/{_H=_δAtEo:s#ϑ)v7տ, j%p4UFfl6IcęJ?F\.?FuWu?Fm{^_9pqB-ѹ07{"'&4-FU\租 /j=/ a/^2^2?H r74N:uP¡Z/ "Uϟ?r/ΰFOD0q'9Ko& lgfRCGo޾D`O0? Pb_P6 >?ώRc@/o?1A%Bkb׀tnbe߷߈`A Sg-튞Xo`4vҎ);wUBmvf\oHg+H_Z_l_~__]_ __b&o8m1Ö5}HmkP;gqq@((?+"Ͼ.t'u'/K—)M?19tѡl?~4v6=??9O+O=NXO,͕NGۆw$NX#_ D,h˯\ گ0Wy Er9be\2?dU@, q=C;,?7Rv& puuӤU 1Q|QA-F\q+1u'tѡtաPuQvE$ !1T1; j"…////z./W?@4'zC%FcpRLF? (Q$/B٥4LFGOgNRgOmk\I|OK2u19ajR1 h2Da`^5˩?@$]PYjMN; SQNQ mù~:G?@zDֳ?@;:y?@hKߔ\1YPxR@Yٍ( 0ilBie_a2U0*sieA?ܵN_A k+ݓNգŲe}= A?@?@C"<%?@.>P0~olDJil}?5^I|QI0|$~FXزe8#(m?@xMÖ`DϜq;Ϲl|гYilߍ|vߜ0|-C6* 8aoW?@'|N?@?@Vbl h"lxilp_Q|mV}baq3y/L F̏ޏe6D~)*Ce?@_1XwW%l~jtil7A`|׿p= 0|?7dڏ֨e揷P אNi?@|XYc$m0lioilJY8x"t q8tN@aRdHeOw^ #?@$!?@o =cͫlz6>~aliF~"tkw#~v;*Eef ?@[:= ?@ּ*8nlY߷ʖj\pҦ"t 0|Cl!׿鿦aU[e5A,GeY]x0| 3U+wѮ8']jZ @A^[ Tr0v:`l_hi4`=hmFr(gUgkj'0RrXY]ȱsC|n %7OoF6[_)o;j#oҏYfe^9b@l@q`?@a W[eerC2uL)ܯ@b8An@(bu)@@r(r,ru,=y8q紥,ȨTev?\.? ,Y^`BKc!gKe.C X3GG"HR ςՂqamsqasp 7Tɡ4žBAAr"$hҳuҴI;⶜·s"ÔДݔL,arrsqC҉+y8`EqBA_*lqayȆQQɡ_oTqa<QϏL;c`:ׅՇXo¬@ԯۇ)p! K"eAiru&8Jۇ.` D@n]fI%Cʭfb@ڈ NKKB-XGͯε8k_x RXӉ-rbx"V!V"bRdԝs0bj VTj0p]#)S qzQls;c0zѪ!nAo*iAߛU!Ѣ_ČB#52B@e_s`CO0Qіd0u*;2~1d2d4BB,m-lbH@)p@\蛕es%2DBӟ!GrvՂ/#sA bee)@g b27CՁ >@p<qMQsА RwuܬJGֿ` T@x k0p@"q4I aSqaa\]QMQ$󛕴uۇ%1#S0|1ѕYk}sďEZDBƑ!APҨ+#g R@f "5B/?^?ѓ=.;H 9IQbo|碅!ބ#`%@/R!# :j/|.ӓ/Β$U//3O1IQCg2&?+`i%Es2~saZ0]?o??_,_>_P_b_tW__BFo1OCOےոOOO3?%__+PR!SZo|)ueS`Ys_\n ! }sֿ +i$B_l&sb1}g'roxWR DoVoho@ŏ׏ @1}1}!*$POasG}//Ao f&|)!H TPf'sCį֯ w $/6HZl~QDHaǵAS/yKre߮@ yϋBTCv$AVb"2beOwEg2a¬  'VDW?ҟoo߹on]urJu`OrJ!*!$߰V#7PW7Wew>y@0PŊ%dBa<0Cm@oB;b2aBw4tN0sk82ab@191GA1‘ 1aT?1 brdtsDЇbj1bk)ipbͲ&TAPǵȷ*ϲi1AOa'2t!)0ǵ鍋qx@ ȶ "mC "CnFxDY1^3` AF0tt&xA4` RIm@O1xu61aޢ?18)x"q$qAPǵɴ8Ec'1'1ǒѨ(L}$q0qGEo R`RUnBcog,Oαwk(;bH`jx@,@2B鿇x@B@–oD_=x@@`{1ŋl$q UAFu$q-ſ>xBp9x@+x@@x@@p@@\.?@O:q$G)qs5,D<]~?S[?/qqjO#Bi8djJ NyH'r/q/o KO @@h@Lt:w@rp6 8`@z@ 2#p%!g\I\np% 10/.E/W$w$RAMfϧϹyHn\T1\?6_H\LQLQ1 UfxG_YX_T)TE *gU>Pbt?oX, j//b3S$R|2,f58$R////// ??.?@?R?d?v????? 2*OܿyO`Nj/MjOOO$?/__+_a_s__qg__/Mg___k/!o3oW|LeeOoN:Oeup_0Tj R}__o o Voho_&[loZэoNLJLj oo(MoПTvD_n+=^pʯܯ+hzJ|X/zO<y"H$@@btӭ9);M_q O//%/7///O?a?///?!?3?E?zi?{?ď?????J OOJEOWOiO:ύOO,_~b[U!_3_siTU?_o&_ϐ,o>oto2oozzu D&Jinȏڏ"Z QRӊUo@X'V%[$ǀ?[AO+gF Ϝ]a<ؕkG$O,Wf'U@X, @@4FO@?gD7P -DT!T_ԝ_(SWE}aAh@@WELt:@)p%%Hs@z3BOOp*/W_/_A^Н56VV!3zFAM9iO{OC(nPͿq߃܇чD9oKo]oߔ߉T!mV%?! /Y ??.?@?R?d?v??????U@ ??O!O3O*Vj@@6`E9hUagݔOJ H;POLU7E_S7_!p]Uqj_|__>X_VφVϏ&ooonoo¯okou Q_B[T+/əA>"o!G$f!r`0 ?@N@8P S+gQ?&oT*JR?@KնWBwӚ$&[rod_C$<ߴ'9ՀDuO` &?jϒc\o2"c?FX?o AQU'yɯۯ#5eQSHeQxQ8COuk ID Po6 nte_r 5r/ؓƿ!~ūV%C$V%D6 r*coyP;!!G$;!)Ar߄?@BP(o@@@XH??QS)ӒS5WV {=J{"=B{{9ԧ섅K(#OC0P贁Nk{Dbƪa'聍uB:i/_b z_"Γ™3=Oabt1*?D>27e>?u?n*A ,0BTa98+@,@I\TzM?C?#q n) /Ken(H7>T8U5'^A_S_('[Q__'U<_P_Qe^ro&ox_H[omo߸'[ooZYؕ'U?|>ooZY_o<V_~ToW~_WUdm (BWkseiߴ _;e=唻X'I2SS{e!$M$Dה5GeSeFl/On@#eSXX/`BW"p1A¦r֦`By //-/?/Q/׿u/////??T?;?M?_?a?????OO%O7OIO[Od$O呴OOOOO_`-2_Qc¯b_t___0B_ox:oLoooooPcu4 `֯2WiiA/㷣Ǐُ!3E1Rd.1r`?̟ޟ0BT&p@CUgysfFtFuF 1CUgy ???cu3E߫Ͻϓo)loM_ߨ/ߕ߹.1}.1);M,oqsb/O嶏W/MooOa%@mGH㔯i{Oȅ^;"ܟr/6/H/~///// ///? ;2/?A7 O?=s????? oo1oO͑ ` O2ODOVOb B+_r,vhOOOO_ _2_D_V_h_z_______߹@oRo"oooHooo!*<`r}  *N`P?Ϩrhʃk/=/0B//x ??ҟR?d??>/b?-ʥ۾O/O'EWoO{OOÿMOO )//G_ʃ_N]oρϓϥ 3a0_T|$ F\C s%?8s?h|Al\EVEU@@ @@q@ӒwPTQ#Mxx4ST*J@@t:N ~^?@x@ )pl$ @z`@~:ʥJ\eDffH!MI5!3[n$5 @t*..5@z);lTab= |oa4o{oooo+=Oas32G-yޞ?NtzUp_.R>Pu`p@s(mbmb@xď֏dᘥ3"Ehrߟ̟r߄&{?QP{5|jᜯү,>Pb3ɿ~ANiU0:LX, `>qp*c@bu3ghߞ߰Vz j.@?-jr6HDrKCY!AqYT >ieP_aE}zI[m?򟣗ٟv0S~wxqs~w|u{Hϯ᯺CietBPhmXXGW'2qRVغC!kD4}A^$7Z/l'z/ Ϟ/////$_6_pH_.?BK? ]?o???>yK??OO$O6OHOZOlO~OOOOOYOO_ϛV_h_z_8o___>__ oo@oRodovooooonoo /Aew"Cg+Os/ߏ?/@c/'96/K߉ ?//_߉?/n?fxT/?2OhOzO>Pbtο8ÃQ1%jU $ FS:Oq?_lv cDL1E9ɽ5U@U0@@@ @otىgP}gk7ZI%ԝDhWA~a @@tpn@@x@ )Bp*>A{w;@z3ur!{~A+VJUV38vM %*tm,9%z%9 a]ϴ23"#,@!3Tat-B?#?aqzDV]åAKAE>1ŚEv[?O7!>m;?M?dj??r,r?>1aE??1*N\.BOTO*OOOph;OO9h5@_ _9ǥh;jOo_1^O_7 1B_TPy?_7 5N,o>o-iO(hXQg_'2UbMȊ-!o-gƀhz;btKq}߸/,6HnQYk}hB)! C?Qcut/;M_ql%bI[_/!/3/E/W/Kqv//Kq////?[o,?oP?t?)ߘ???q95OO`OrO_9O_O_ 8_J__߹Y__o"oXojoooooooo 0Bvk!Oatk!lg 2z^CUgyw фˏݏI *<N`r̟ޟ?/8J\?ȯگM4F|jO3_OĿֿ 0BTU`rRmUϪϼώOEi:o^oAS{ Bfd]>bf폪5ˏ3}:Lş$N19KN1Vzo /'i2L&-/?/Q/c/u///?'Wҵ/////?!?3?E?W?i?{??????? OO/OAOSOeOwOOOO}_O ___+_=_?a_u______ooB0oBohozoo*ooo q.Rv:%Im*#r矈̏3/E//J\/?ڟS?e?"4FXj|Ī>үmAO(:L^p=nvɿۿ#5ϯPzR}%Qcuχϙϫ);M_qߧ߹(_7I[3EWi{ނmAmA(L^}?? 1Uy6Z~ -/Q/?$V/h/Ͽ῞/)//Cq.?@?ov??߾????OO*O%7I[mq()׉F# 2DVhzݯ .Rdv珚|////voPbt_SُL^pr/E֏$6HQbtNQO7O<ѯ`3" Cb!oobe}H/0/!3f/x/i{Ϯ///?,?P?At?eߘ?߼??O(OLO^OpOOOOOOOOQ_TQ$_[H_Z_l_~_____W?l6f_ oo1oCoUogok7v݃ooדoo,>Pbt(L^pv܏p6/'?l/Ɵ؟ Q,>FMQdv/9]O*ON_r5_G[y_6ϝ_Z_~_ oX_Qo2ߙoVZ_zo_)߿o'_q.@vE*<ŁJnObX!3EWi{'W#2ߩ V+*/uѶ2(:L^p//$/6/H/Z/l////r?/?? ?2?4oV?τό??????? OQŁ$O6OŁ\OnOO8ϤOOOO"_F_RdϷ_FP__+__(o:opoo7Iooo\6Z~W4 2DVhzOFƏ؇!/ .@RdvKPT*Jϟ)~0/lf^HZxȯگ"4FXj|]_cOĿֿk_ g?BTf$ߊϮEooPo>Pbt߆ߘߪկ!}!$6oZlOs ͋#Gk(Lޏpן{g$lE-?/ /2/@D/V/h/z//.G/'K/}/??*?SOaQloϢϴϷ 2r\.CUgyߋߝ߯)pk$%7I[m!3EWi{o6/ASU?w+XQFXQ~@O_ /D/h/Ͽ//P?/;/_?@?9Oψ?O??I[Oߣ`OrOߨOO3O_i{8_J_\_n_@_____ZI_Wo,o>oPobotoooSog@ oo'9KIfx,>Pbt3/Ώ(=L^p.џʟ?&?HZl~Ư3M,>/bt_#_G_k_(Ϗ_Lp__oCogo$:_ol~oo_o?YoDV_ .@RdvJQ"4OXjG"#q{a-͏tgV+/nvhDi2L^p//$/H/Z/l/~/////۟//??2?o?h?z??o?M?? OO.O@OROdO~OOVOOOO_/4_SX_ |__Obd(oK_oP:oLoooI[oo$Hl!Ei Dhzԏ K 2 1@;?dvП}@ );M_qK@j?k䟯ïկwF!3EWi{ÿտ2 /*oSew?ϭϿ} O=߸oasoߩ߻' 14F@ 1l~|o/=/Ï2Vhz/Ovi{0fԟ_?ޏϯ>\wM_/(/ݿL/^/p////////6L ?7*?%N?`?r??????7^OO$O6OHOZOlO4d~8OOsOOO __0_B_T_f_x______oo>oPobo߆oooho o:(^0-VhzLԏ'//@/d/;ʟܟC?g?$?H?l?"?OدcO $?DOhO?OO/;_ q__@RdvψϚϬϾM׏ao8J\n߀ߒߤ_/|> ߀!3EWp?VAms'9K]o@#5JYk};?3Ugya/a&/8/J/n//_/_///S?w4?X??|?Ϡ??+?OOs0O_FϻxOOOϫK__eߓP_b___#__oo(o:oLo^opojNog+o]ooo .@dvw3f hm2 2QVhzԏ ./RdvП֯ǑLp`_jb #5GYk} p//)/;/M/_/q//////x/??%?7?I?[?m????sO?O?O!O3O5WOkߍOOOOOOO _8Ǒ&_8_Ǒ^_p__ ߦ__׏_og$oHoloo0oo?oc hݏ~);@R/ЏI/[/*OQd? ??Dhϟt_@d˯]/ﯬ!?Ÿ7/mPbϼG?k?(?L?p?OܯCOgOOH^?O __ؿ?Oc_ 2}O_hzϩ?_)o;o .@Rdv߈WߺCqu"4FX?|~jZ ?q'9K]o#5Gk} 1UyOV //-/?/Q/c/u//Cq//`Cq///"?4?SoX?wo|???+?O OO0OTOxOߜO_'OYoo,_>_t_x___GooEߏLo^ooooooo$6zxGYtxd*6L&;M_q~! Ϣԏ .@RdvП?*P]xvψ8Oo<ߣo`ooH3W{81o ASXj㏠o+as0BTfx  Y{$6HZl~Ko|> //0/B/ .{COƶg/y//////// ??-???Q?c?u?)4߫???$?OO)O>MO_O_/_OOO<_O__7_I_m_____\{__{o$o6oZoloooo?oc Dh;͏_2dv7/Q/Pbo:N٩//eoI1/C/U/g/y//////// ??-???Q?u????????O)O;OO_OOOOOOO`_%_7_I_[_m___M__jM__o,o>o]boooo5oY:^ 1cy6H~i /Ə؏#Q/ O/Vh//Ÿԟ .@^N`1nOȯگ"4?bGYk} ?W2?bͿ߿'9K]oϓϥϷϚo#5GYk}ߏOߕ81CUWy -Z1HZ1B/?"FjџR=aB;/ͯ/K]/b/t///5/?k}:?L?^?p??????:_?7 O.O@OROdOvOOOUOGxOO__)_;_M_٤Jgi_{________ oo/oAoSoeowoo6ooooo+@Oas1)K]oɏ-.@dvϾ%?I?m?*?Nr??!OޯEO׿iO&!q///z??1o6?UoZ?~?Ϣ? ?-?OOu2OVOzOs_O7oM __R_V=__%__#m*oߥobo&5Y}^to1oy6H~o ?Q 2DVhz buD dxA o7YG7E$-Wi7Gtx<?@vn?#9edQYҒ-Qu!$ W]gur!r$ ')%ȸE#%MEQ!"// 9&#bdz@1@#eϫ31%*?iI4wu1K?p?O0O/EM`_gm@gsWXA W2tI+WowsћM.߳MՇv%iIM2GՇQSrKK`2cZl~ƯدIr&=Ogyya}3E-Ŀ־Q&'9K]oϥϷ#5ߐ}ߔ!=&t/7%/i,|/[m///G-PEho/AhfxȊtI yw0(-DT! T8Xa]\C3(/3lBF]L" S31 ^LTzT[NRPLTh&_ASeqe;1Dk9Kq!怣 _gqd|g1&a7A>q???7I OO0OBOtѢ恞|@@p@v@@4F@@xsszu0n&e:Vv;Vv<Vv=Vv>V` S S-AVfABVUCV0id Q}EVFV2 S Q͆IVJVKV LVMV1N VEOVY SfmQVRVfSVTV0 SіVV3WVXV CYV!o[VfI\V]]Vfq^V_V0 SaVOBrvvvvvvvvv--AAUUii}}͆͆  11EEYYmmіі  !!8FI]]qq@,___O]Si-B=cPy;4&e(mwX':d nd t mm1=mmJmmmաmMQm*mm!m"Tq%>aon2q|ohqUqdq5uqdqsqdqdqds1hA=eqdU hiqah1h!uqdh1!h1hၠG!h-h 1h5h19hE=hYաhqEhqhMhQhUhGSof呠]hah eh!ihImh]QhqqhyhAh@qdNh]*`P`Y`q``q``e``q`Y```֤` d``A`,`U``ik`d`Y```0I,*`*`*`*`*`*`*` *` ,*` *` *`1 *` *`E*`*`Y*`,*`q*`*`*`*`*`*`*`,*`*`*`G*`*` !, "#!&'I()]*+,q,-./01ୡ23f̓T}ZdmSmxh*xA PumX-Q_x<?@vn+?_tgupufx r!կ--!tܡaut"}v1}-a8>26q|Co3zDxyPbz@Qh@01_0P贁#NkjEw)lS0U!%ESix%~U/x6譡_DӤ۩0s!8b 9b\wxpݧqğ {u#5w r22O|rU*&00goooo:%I ^a~s~Ê({o vo-PBWi{ÏՏ /ASewүќP䙊\NrQɯcCB&8VS\kj|ՇEſ׿鿓ITkQgauj~|`jt!CUg89YBi0jT1D &0U0DDx ϙ̛ѿRA'/@iߠ߲?!eoi>L !E{D0+{DDGA0TY)[mSew3iw[1u-OGHaL80G0%7I[m&γXHR%R&]/*,s/ϩ/'R/$uPTofxϊϜ,> )y4?@p8@)pЁFM z3h@F X;p:xhM&d2?peH1̟.E2kj nnLeہd݈^RTg  @bpἅyDЉa* ˜fln@#ƀ@ nFmOBpBV._A_'98zOODh56ffV/h/z/1/C/Ooaoso//!//2}!!v/`Lq?~ooooooȯooZLq "LqTqwMmӿ!3CRdv؈pr@K#{f5 J|O>xy- 2p6"߫ߑKџ㟛<ЮV$6H7I擯$ۯ 5G%ewx 7¿( .@RdvψCAܧϹWNC"H$ĈxX?ޫ O߷J?~omFFh4߀UpPlXA&-/@/&8Vyn66Ugy0BN?`?r?u1My_wKA}O;M_q (3 2D~{{1ƆJ^T(B8[0 sk"pCDfV/CoUo7ؖfoo{//EXP__TV//dhEkvjwgFRB????????KAO!O`vA9/B?BpmnMe]sagRf_To 5Rl BpmnMesagRf__To Eti#y  BpmnDirect o&Textan}mrkug.49*Text AUnoain.490msvWarwnOPesoal5IfZeigr (1-D) Pointer(1-D)6Funkti]o /Sbrune.426Functi]o /sbrune.426Funkti]o /Sbrune.436Functi]o /sbrune.43$Zeigr (1-D).4&Pointer (1-D). 4$Zeigr (1-D).46&Pointer (1-D).46$Zeigr (1-D).5&Pointer (1-D). 5$Zeigr (1-D).52&Pointer (1-D).52$Zeigr (1-D).53&Pointer (1-D).536Funkti]o /Sbrune.546Functi]o /sbrune.546Funkti]o /Sbrune.5!6Functi]o /sbrune.5!$Zeigr (1-D).56&Pointer (1-D).56$Zeigr (1-D).57&Pointer (1-D).576Funkti]o /Sbrune.586Functi]o /sbrune.586Funkti]o /Sbrune.596Functi]o /sbrune.596Funkti]o /Sbrune.06Functi]o /sbrune.06Funkti]o /Sbrune.16Functi]o /sbrune.16Funkti]o /Sbrune.26Functi]o /sbrune.26Funkti]o /Sbrune.36Functi]o /sbrune.36Funkti]o /Sbrune.46Functi]o /sbrune.46Funkti]o /Sbrune.56Functi]o /sbrune.56Funkti]o /Sbrune.6Functi]o /sbrune.6Funkti]o /Sbrune.76Functi]o /sbrune.76Funkti]o /Sbrune.86Functi]o /sbrune.86Funkti]o /Sbrune.96Functi]o /sbrune.96Funkti]o /Sbrune.706Functi]o /sbrune.706Funkti]o /Sbrune.716Functi]o /sbrune.716Funkti]o /Sbrune.726Functi]o /sbrune.726Funkti]o /Sbrune.736Functi]o /sbrune.736Funkti]o /Sbrune.746Functi]o /sbrune.746Funkti]o /Sbrune.756Functi]o /sbrune.756Funkti]o /Sbrune.76Functi]o /sbrune.76Funkti]o /Sbrune.7!6Functi]o /sbrune.7!6Funkti]o /Sbrune.786Functi]o /sbrune.786Funkti]o /Sbrune.796Functi]o /sbrune.796Funkti]o /Sbrune.806Functi]o /sbrune.806Funkti]o /Sbrune.816Functi]o /sbrune.816Funkti]o /Sbrune.826Functi]o /sbrune.826Funkti]o /Sbrune.836Functi]o /sbrune.836Funkti]o /Sbrune.846Functi]o /sbrune.846Funkti]o /Sbrune.856Functi]o /sbrune.856Funkti]o /Sbrune.86Functi]o /sbrune.86Funkti]o /Sbrune.876Functi]o /sbrune.876Funkti]o /Sbrune.8!6Functi]o /sbrune.8!6Funkti]o /Sbrune.896Functi]o /sbrune.89&Zeigr (1-Dw).13(Pointer 1-D).136Funkti]o /Sbrune.916Functi]o /sbrune.916Funkti]o /Sbrune.926Functi]o /sbrune.926Funkti]o /Sbrune.936Functi]o /sbrune.936Funkti]o /Sbrune.946Functi]o /sbrune.946Funkti]o /Sbrune.956Functi]o /sbrune.956Funkti]o /Sbrune.96Functi]o /sbrune.96Funkti]o /Sbrune.976Functi]o /sbrune.97&Zeigr (1-Dw).14(Pointer 1-D).14&Zeigr (1-Dw).15(Pointer 1-D).15&Zeigr (1-Dw).16(Pointer 1-D).16&Zeigr (1-Dw).17(Pointer 1-D).17&Zeigr (1-Dw).18(Pointer 1-D).18&Zeigr (1-Dw).19(Pointer 1-D).19&Zeigr (1-Dw).20(Pointer 1-D).20&Zeigr (1-D).2(Pointer 1-_D).2 (DD3[GG3\%G3T$G3TE3HhG335G3D35G3,=#G3,`!G335G335G335G3D3 5G3`U(G3[}G3%G3Խ&G3TE3$HhG3, *G3345G3`i+G3T`(G3d1G3`.G3%G3LQP@G3dQPUG3TmE3<}G3XG3'G3`)G335G3345G3D3i5G335G335G3,/G37/G3`fA3j/G34`.G3`A3`A3"G3DHhG3;G3K!G33l9G3`)G37G3L3G3`8*G3b2G3t`-G3dHhG3HhG3T"G3,$G3XT@E3HhNG3lG3`*G3$G3G3TE3ԼG3`)G3`H'G3[oG3[G3[G3[G3_PG3[G3[G3[G3[/G3ؐGG3aG3 {G3<G3G3G3G3ؑG3G3 1G3<KG3X3e&G3XG3T\3 G3HhG3HhG3IhG3$Ih G3,\3<G3\3ZG3[3x&G3DIhG3[3&G3dIhG3[3"G3T[3" G34B,G3n*G3t.G3D38G34/G3`-+G3܉X.G3?G338G35G3329G3lk4G340G32G33;G3D3<9G33u8G3/G33:G3Ĉ2G3H/G3w2G3T2G33=G37G3,[3O%G3[3t'G3G3G30G3ļ)G3Z3( G3`HA3`LA3`PA3`TA3`XA3`\A3``A3`dA3`hA3`lA3`pA3`tA3`xA3`|A3`A3 `A3\`A3l`A3t`A3d`A3|`A3`A3Z3#G3Z3%G3IhG3L[G3TZ3&G3$?)G3Th)G3G3ؒG3,Z3$G3佳.G3-G3D1G3$uIG3$]PG3D39G3GG3Z3a(G3^3&G334G3(G3t 1G3d<=G3ĖyEG3^3$G3D.G338G3H>G3=G3DCG3>ZG3$`]G3$JG3<1G38KG35G3<G3-G3!GG3$h3G3t6G3T^3$G3t)G3+G3̆I2G3,^3{"G3^3$G335G3D35G33+5G33`5G3]3(G3Ծ,G3]3(G3,G3]3=(G3 `e,G3T]3(G3`,G3,]3(G3` ,G3395G3D3n5G335G335G3]3 (G3亳5,G3\3a(G3,G335G3D35G335G33T5G334G3D34G334G33%4G33Y4G3D34G334G334G33)4G3D3]4G334G334G333G3D3,3G33_4G334G334G3D34G33/4G33c4G335G3D35G335G3P65G3DPk5G3P5G3?5G3> 5G3>?5G3D>t5G3>5G3=5G3=3G3D=F3G3=y5G3<5G3<5G3D<5G3D M5G3 5G3 5G3 5G3D3! 5G33V 5G33 5G3P 5G3P 5G3DP* 5G3P_ 5G3P 5G3P 5G3DP 5G3P3 3G3Pf 3G3P 5G3DP 5G3P 5G3P8 5G3Pm 5G3DP 5G3 )G3 ,G3P, 5G3Pa 5G3P 5G3DP 5G3P5G3P55G3Pj5G3DP5G3P5G3P 5G3P>3G3DPq3G3P5G3P5G3)G3Ի7,G3c)G3D,G3d)G3t,G3` )G3`6,G3b)G3h3,G3t`)G34,G3t )G3D5,G3a)G3,G  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABC]>rFxml:spaceprsrv]rFxmlns:vdhtp/%scea .i+ro of.+o/i iA/20*c6%et/ \n]rFxmlns:v14htp/'sUcea .i-ro oUf.-o/GUf=e'v=s=]o'200'Eet1 lnU.U-t4 "H$ @Y,b'@T?/$C6E 0+ AU %t4 ̧[`0 C-`m7"AJ@?0LR@SZo06RH<(H<(JE?1RESZ1R{č  g"4FXo 8)i(N1j@(Mw]y5hGB C Qz`X> BvZR$[Ox!{)_V'l]~P1d4sP2T! ײ.B="dnG zK&D+Qd/?$f0W*'"D\y 1~%!././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/internals/security.rst0000644000076500000240000005022314641074756017560 0ustar00twstaff.. somewhat surprisingly the "bash" highlighter gives nice results with the pseudo-code notation used in the "Encryption" section. .. highlight:: bash ======== Security ======== .. _borgcrypto: Cryptography in Borg ==================== .. _attack_model: Attack model ------------ The attack model of Borg is that the environment of the client process (e.g. ``borg create``) is trusted and the repository (server) is not. The attacker has any and all access to the repository, including interactive manipulation (man-in-the-middle) for remote repositories. Furthermore the client environment is assumed to be persistent across attacks (practically this means that the security database cannot be deleted between attacks). Under these circumstances Borg guarantees that the attacker cannot 1. modify the data of any archive without the client detecting the change 2. rename, remove or add an archive without the client detecting the change 3. recover plain-text data 4. recover definite (heuristics based on access patterns are possible) structural information such as the object graph (which archives refer to what chunks) The attacker can always impose a denial of service per definition (he could forbid connections to the repository, or delete it entirely). When the above attack model is extended to include multiple clients independently updating the same repository, then Borg fails to provide confidentiality (i.e. guarantees 3) and 4) do not apply any more). .. _security_structural_auth: Structural Authentication ------------------------- Borg is fundamentally based on an object graph structure (see :ref:`internals`), where the root object is called the manifest. Borg follows the `Horton principle`_, which states that not only the message must be authenticated, but also its meaning (often expressed through context), because every object used is referenced by a parent object through its object ID up to the manifest. The object ID in Borg is a MAC of the object's plaintext, therefore this ensures that an attacker cannot change the context of an object without forging the MAC. In other words, the object ID itself only authenticates the plaintext of the object and not its context or meaning. The latter is established by a different object referring to an object ID, thereby assigning a particular meaning to an object. For example, an archive item contains a list of object IDs that represent packed file metadata. On their own it's not clear that these objects would represent what they do, but by the archive item referring to them in a particular part of its own data structure assigns this meaning. This results in a directed acyclic graph of authentication from the manifest to the data chunks of individual files. .. _tam_description: .. rubric:: Authenticating the manifest Since the manifest has a fixed ID (000...000) the aforementioned authentication does not apply to it, indeed, cannot apply to it; it is impossible to authenticate the root node of a DAG through its edges, since the root node has no incoming edges. With the scheme as described so far an attacker could easily replace the manifest, therefore Borg includes a tertiary authentication mechanism (TAM) that is applied to the manifest since version 1.0.9 (see :ref:`tam_vuln`). TAM works by deriving a separate key through HKDF_ from the other encryption and authentication keys and calculating the HMAC of the metadata to authenticate [#]_:: # RANDOM(n) returns n random bytes salt = RANDOM(64) ikm = id_key || enc_key || enc_hmac_key # *context* depends on the operation, for manifest authentication it is # the ASCII string "borg-metadata-authentication-manifest". tam_key = HKDF-SHA-512(ikm, salt, context) # *data* is a dict-like structure data[hmac] = zeroes packed = pack(data) data[hmac] = HMAC(tam_key, packed) packed_authenticated = pack(data) Since an attacker cannot gain access to this key and also cannot make the client authenticate arbitrary data using this mechanism, the attacker is unable to forge the authentication. This effectively 'anchors' the manifest to the key, which is controlled by the client, thereby anchoring the entire DAG, making it impossible for an attacker to add, remove or modify any part of the DAG without Borg being able to detect the tampering. Note that when using BORG_PASSPHRASE the attacker cannot swap the *entire* repository against a new repository with e.g. repokey mode and no passphrase, because Borg will abort access when BORG_PASSPHRASE is incorrect. However, interactively a user might not notice this kind of attack immediately, if she assumes that the reason for the absent passphrase prompt is a set BORG_PASSPHRASE. See issue :issue:`2169` for details. .. [#] The reason why the authentication tag is stored in the packed data itself is that older Borg versions can still read the manifest this way, while a changed layout would have broken compatibility. .. _security_encryption: Encryption ---------- Encryption is currently based on the Encrypt-then-MAC construction, which is generally seen as the most robust way to create an authenticated encryption scheme from encryption and message authentication primitives. Every operation (encryption, MAC / authentication, chunk ID derivation) uses independent, random keys generated by `os.urandom`_ [#]_. Borg does not support unauthenticated encryption -- only authenticated encryption schemes are supported. No unauthenticated encryption schemes will be added in the future. Depending on the chosen mode (see :ref:`borg_init`) different primitives are used: - The actual encryption is currently always AES-256 in CTR mode. The counter is added in plaintext, since it is needed for decryption, and is also tracked locally on the client to avoid counter reuse. - The authentication primitive is either HMAC-SHA-256 or BLAKE2b-256 in a keyed mode. Both HMAC-SHA-256 and BLAKE2b have undergone extensive cryptanalysis and have proven secure against known attacks. The known vulnerability of SHA-256 against length extension attacks does not apply to HMAC-SHA-256. The authentication primitive should be chosen based upon SHA hardware support: all AMD Ryzen, Intel 10th+ generation mobile and Intel 11th+ generation desktop processors, Apple M1+ and most current ARM64 architectures support SHA extensions and are likely to perform best with HMAC-SHA-256. 64-bit CPUs without SHA extensions are likely to perform best with BLAKE2b. - The primitive used for authentication is always the same primitive that is used for deriving the chunk ID, but they are always used with independent keys. Encryption:: id = AUTHENTICATOR(id_key, data) compressed = compress(data) iv = reserve_iv() encrypted = AES-256-CTR(enc_key, 8-null-bytes || iv, compressed) authenticated = type-byte || AUTHENTICATOR(enc_hmac_key, encrypted) || iv || encrypted Decryption:: # Given: input *authenticated* data, possibly a *chunk-id* to assert type-byte, mac, iv, encrypted = SPLIT(authenticated) ASSERT(type-byte is correct) ASSERT( CONSTANT-TIME-COMPARISON( mac, AUTHENTICATOR(enc_hmac_key, encrypted) ) ) decrypted = AES-256-CTR(enc_key, 8-null-bytes || iv, encrypted) decompressed = decompress(decrypted) ASSERT( CONSTANT-TIME-COMPARISON( chunk-id, AUTHENTICATOR(id_key, decompressed) ) ) The client needs to track which counter values have been used, since encrypting a chunk requires a starting counter value and no two chunks may have overlapping counter ranges (otherwise the bitwise XOR of the overlapping plaintexts is revealed). The client does not directly track the counter value, because it changes often (with each encrypted chunk), instead it commits a "reservation" to the security database and the repository by taking the current counter value and adding 4 GiB / 16 bytes (the block size) to the counter. Thus the client only needs to commit a new reservation every few gigabytes of encrypted data. This mechanism also avoids reusing counter values in case the client crashes or the connection to the repository is severed, since any reservation would have been committed to both the security database and the repository before any data is encrypted. Borg uses its standard mechanism (SaveFile) to ensure that reservations are durable (on most hardware / storage systems), therefore a crash of the client's host would not impact tracking of reservations. However, this design is not infallible, and requires synchronization between clients, which is handled through the repository. Therefore in a multiple-client scenario a repository can trick a client into reusing counter values by ignoring counter reservations and replaying the manifest (which will fail if the client has seen a more recent manifest or has a more recent nonce reservation). If the repository is untrusted, but a trusted synchronization channel exists between clients, the security database could be synchronized between them over said trusted channel. This is not part of Borg's functionality. .. [#] Using the :ref:`borg key migrate-to-repokey ` command a user can convert repositories created using Attic in "passphrase" mode to "repokey" mode. In this case the keys were directly derived from the user's passphrase at some point using PBKDF2. Borg does not support "passphrase" mode otherwise any more. .. _key_encryption: Offline key security -------------------- Borg cannot secure the key material while it is running, because the keys are needed in plain to decrypt/encrypt repository objects. For offline storage of the encryption keys they are encrypted with a user-chosen passphrase. A 256 bit key encryption key (KEK) is derived from the passphrase using PBKDF2-HMAC-SHA256 with a random 256 bit salt which is then used to Encrypt-*and*-MAC (unlike the Encrypt-*then*-MAC approach used otherwise) a packed representation of the keys with AES-256-CTR with a constant initialization vector of 0. A HMAC-SHA256 of the plaintext is generated using the same KEK and is stored alongside the ciphertext, which is converted to base64 in its entirety. This base64 blob (commonly referred to as *keyblob*) is then stored in the key file or in the repository config (keyfile and repokey modes respectively). This scheme, and specifically the use of a constant IV with the CTR mode, is secure because an identical passphrase will result in a different derived KEK for every key encryption due to the salt. The use of Encrypt-and-MAC instead of Encrypt-then-MAC is seen as uncritical (but not ideal) here, since it is combined with AES-CTR mode, which is not vulnerable to padding attacks. .. seealso:: Refer to the :ref:`key_files` section for details on the format. Refer to issue :issue:`747` for suggested improvements of the encryption scheme and password-based key derivation. Implementations used -------------------- We do not implement cryptographic primitives ourselves, but rely on widely used libraries providing them: - AES-CTR and HMAC-SHA-256 from OpenSSL 1.0 / 1.1 are used, which is also linked into the static binaries we provide. We think this is not an additional risk, since we don't ever use OpenSSL's networking, TLS or X.509 code, but only their primitives implemented in libcrypto. - SHA-256, SHA-512 and BLAKE2b from Python's hashlib_ standard library module are used. Borg requires a Python built with OpenSSL support (due to PBKDF2), therefore these functions are delegated to OpenSSL by Python. - HMAC, PBKDF2 and a constant-time comparison from Python's hmac_ standard library module is used. While the HMAC implementation is written in Python, the PBKDF2 implementation is provided by OpenSSL. The constant-time comparison (``compare_digest``) is written in C and part of Python. Implemented cryptographic constructions are: - Encrypt-then-MAC based on AES-256-CTR and either HMAC-SHA-256 or keyed BLAKE2b256 as described above under Encryption_. - Encrypt-and-MAC based on AES-256-CTR and HMAC-SHA-256 as described above under `Offline key security`_. - HKDF_-SHA-512 .. _Horton principle: https://en.wikipedia.org/wiki/Horton_Principle .. _HKDF: https://tools.ietf.org/html/rfc5869 .. _length extension: https://en.wikipedia.org/wiki/Length_extension_attack .. _hashlib: https://docs.python.org/3/library/hashlib.html .. _hmac: https://docs.python.org/3/library/hmac.html .. _os.urandom: https://docs.python.org/3/library/os.html#os.urandom Remote RPC protocol security ============================ .. note:: This section could be further expanded / detailed. The RPC protocol is fundamentally based on msgpack'd messages exchanged over an encrypted SSH channel (the system's SSH client is used for this by piping data from/to it). This means that the authorization and transport security properties are inherited from SSH and the configuration of the SSH client and the SSH server -- Borg RPC does not contain *any* networking code. Networking is done by the SSH client running in a separate process, Borg only communicates over the standard pipes (stdout, stderr and stdin) with this process. This also means that Borg doesn't have to directly use a SSH client (or SSH at all). For example, ``sudo`` or ``qrexec`` could be used as an intermediary. By using the system's SSH client and not implementing a (cryptographic) network protocol Borg sidesteps many security issues that would normally impact distributing statically linked / standalone binaries. The remainder of this section will focus on the security of the RPC protocol within Borg. The assumed worst-case a server can inflict to a client is a denial of repository service. The situation where a server can create a general DoS on the client should be avoided, but might be possible by e.g. forcing the client to allocate large amounts of memory to decode large messages (or messages that merely indicate a large amount of data follows). The RPC protocol code uses a limited msgpack Unpacker to prohibit this. We believe that other kinds of attacks, especially critical vulnerabilities like remote code execution are inhibited by the design of the protocol: 1. The server cannot send requests to the client on its own accord, it only can send responses. This avoids "unexpected inversion of control" issues. 2. msgpack serialization does not allow embedding or referencing code that is automatically executed. Incoming messages are unpacked by the msgpack unpacker into native Python data structures (like tuples and dictionaries), which are then passed to the rest of the program. Additional verification of the correct form of the responses could be implemented. 3. Remote errors are presented in two forms: 1. A simple plain-text *stderr* channel. A prefix string indicates the kind of message (e.g. WARNING, INFO, ERROR), which is used to suppress it according to the log level selected in the client. A server can send arbitrary log messages, which may confuse a user. However, log messages are only processed when server requests are in progress, therefore the server cannot interfere / confuse with security critical dialogue like the password prompt. 2. Server-side exceptions passed over the main data channel. These follow the general pattern of server-sent responses and are sent instead of response data for a request. The msgpack implementation used (msgpack-python) has a good security track record, a large test suite and no issues found by fuzzing. It is based on the msgpack-c implementation, sharing the unpacking engine and some support code. msgpack-c has a good track record as well. Some issues [#]_ in the past were located in code not included in msgpack-python. Borg does not use msgpack-c. .. [#] - `MessagePack fuzzing `_ - `Fixed integer overflow and EXT size problem `_ - `Fixed array and map size overflow `_ Using OpenSSL ============= Borg uses the OpenSSL library for most cryptography (see `Implementations used`_ above). OpenSSL is bundled with static releases, thus the bundled copy is not updated with system updates. OpenSSL is a large and complex piece of software and has had its share of vulnerabilities, however, it is important to note that Borg links against ``libcrypto`` **not** ``libssl``. libcrypto is the low-level cryptography part of OpenSSL, while libssl implements TLS and related protocols. The latter is not used by Borg (cf. `Remote RPC protocol security`_, Borg itself does not implement any network access) and historically contained most vulnerabilities, especially critical ones. The static binaries released by the project contain neither libssl nor the Python ssl/_ssl modules. Compression and Encryption ========================== Combining encryption with compression can be insecure in some contexts (e.g. online protocols). There was some discussion about this in `github issue #1040`_ and for Borg some developers concluded this is no problem at all, some concluded this is hard and extremely slow to exploit and thus no problem in practice. No matter what, there is always the option not to use compression if you are worried about this. .. _github issue #1040: https://github.com/borgbackup/borg/issues/1040 Fingerprinting ============== Stored chunk sizes ------------------ A borg repository does not hide the size of the chunks it stores (size information is needed to operate the repository). The chunks stored in the repo are the (compressed, encrypted and authenticated) output of the chunker. The sizes of these stored chunks are influenced by the compression, encryption and authentication. buzhash chunker +++++++++++++++ The buzhash chunker chunks according to the input data, the chunker's parameters and the secret chunker seed (which all influence the chunk boundary positions). Small files below some specific threshold (default: 512 KiB) result in only one chunk (identical content / size as the original file), bigger files result in multiple chunks. fixed chunker +++++++++++++ This chunker yields fixed sized chunks, with optional support of a differently sized header chunk. The last chunk is not required to have the full block size and is determined by the input file size. Within our attack model, an attacker possessing a specific set of files which he assumes that the victim also possesses (and backups into the repository) could try a brute force fingerprinting attack based on the chunk sizes in the repository to prove his assumption. To make this more difficult, borg has an ``obfuscate`` pseudo compressor, that will take the output of the normal compression step and tries to obfuscate the size of that output. Of course, it can only **add** to the size, not reduce it. Thus, the optional usage of this mechanism comes at a cost: it will make your repository larger (ranging from a few percent larger [cheap] to ridiculously larger [expensive], depending on the algorithm/params you wisely choose). The output of the compressed-size obfuscation step will then be encrypted and authenticated, as usual. Of course, using that obfuscation would not make any sense without encryption. Thus, the additional data added by the obfuscator are just 0x00 bytes, which is good enough because after encryption it will look like random anyway. To summarize, this is making size-based fingerprinting difficult: - user-selectable chunker algorithm (and parametrization) - for the buzhash chunker: secret, random per-repo chunker seed - user-selectable compression algorithm (and level) - optional ``obfuscate`` pseudo compressor with different choices of algorithm and parameters Stored chunk proximity ---------------------- Borg does not try to obfuscate order / proximity of files it discovers by recursing through the filesystem. For performance reasons, we sort directory contents in file inode order (not in file name alphabetical order), so order fingerprinting is not useful for an attacker. But, when new files are close to each other (when looking at recursion / scanning order), the resulting chunks will be also stored close to each other in the resulting repository segment file(s). This might leak additional information for the chunk size fingerprinting attack (see above). ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/internals/structure.png0000644000076500000240000061173214641074756017735 0ustar00twstaffPNG  IHDR 3UsRGBgAMA a pHYs\F\FCAIDATx^5I/ϟbs L4H6##HO2a'"'2 D0LdDO sf۶z7:ݫWU{{U5``````````A=aE`````````:P44U[e````````c`````````\৤6S˜````````g@XOX`````````s%M%MVm`````````)`````````l@;)M0f````````c`````````\`I~ISU[````````xa=a=`````````:P~JjS;%`````````~`````````l@;XҴ_TmՖ````````b@XOX`````````sN c`````````a=a=`````````:P44U[e````````c`````````\৤6S˜````````g@XOX`````````s%M%MVm`````````)`````````l@;)M0f````````c`````````\`I~ISU[````````xa=a=`````````:P~JjS;%`````````~`````````l@;XҴ_TmՖ````````b@XOX`````````sN c`````````a=a=`````````:P44U[e````````c`````````\৤6S˜````````g@XOX`````````s%M%MVm`````````)`````````l@;)M0f````````c`````````\`I~ISU[````````xa=a=`````````:P~JjS;%`````````~`````````l@;XҴ_TmՖ````````b@XOX`````````sN c`````````a=a=`````````:P44U[e````````c`````````\৤6S˜````````g@XOX`````````s%M%MVm`````````)`````````l@;)M0f````````c`````````\`I~ISU[````````xa=a=`````````:P~JjS;%`````````~`````````l@;XҴ_TmՖ````````b@XOX`````````sN c`````````a=a=`````````:P44U[e````````c`````````\৤6S˜````````g@XOX`````````s%M%MVm`````````)`````````l@;)M0f````````c`````````\`I~ISU[````````xa=a=`````````:P~JjS;%`````````~`````````l@;XҴ_TmՖ````````b@XOX`````````sN c`````````a=a=`````````:P44U[e````````c`````````\৤6S˜````````g@XOX`````````s%M%MVm`````````)`````````l@;)M0f````````c`````````\`I~ISU[````````xa=a=`````````:P~JjS;%`````````~`````````l@;XҴ_TmՖ````````b@XOX`````````sN c`````````a=a=`````````:P44U[e````````c`````````\৤6S˜````````g@XOX`````````s%M%MVm`````````)`````````l@;)M0f````````c`````````\`I~ISU[````````xa=a=`````````:P~JjS;%`````````~`````````l@;XҴ_TmՖ````````b@XOX`````````sN c`````````a=a=`````````:P44U[e````````c``````K }~g_uZ ``m7< 0 0 0 0 0 0G '?y͟~o/? . 0 <#} `````` D$?|Og Q7 0 0i?X{om1 0 0 0 0 0CO̼ܿZ1 0p?zi/Q`````xwWZ0_>sn<'`2zY~O>ď0 0 0 0 0 0c |_>GpïߓMzSo~vd>\1 0@aߨNaȀ[:mB 0 0 0 0 0D{o^D:f`5  {l 0 0 0 0 0#{=ǿկy,BGs\3 L|*g`````xa״?ۏ~ٵz<Sǃvx`q  10շ 0 0 0 0 00a=ţrӟ}[ڵ7>L`=1E`` \ހ+9&w 0 0 0 0 0- q(Bw?C{_* 0 0.=x?_`Gq 0 0 0 0 0S [bwݪ^8^YxR'`````g@X~}q`3_Xy`` vbD- 0 0 0 0 0@\?_j`/~]` z``S rVo3a:N 0 0 0 0 0 π?\]ϣp{qm`g0*Ah_ 0 0 0 0 0 a=x7WO~C0 0 7 7oa 0 0 0 0 0 1 ק{zַg杻y`}P0 0 0 0 0 0n@Xi=F~_m> >ikKg~b`|)gb8:1x=C 0 0 0 0 0Wcaw xߴ%3?1 0Qz31!````` ^<6l~Z' 0 0szz hDog````xa=v{wO~"瞙 0 0@wʹ}fe=# 0 0 0 0 0 <Հ=?X }ss޽s``f>: 0 0 0 0 0c_jX3 0 t?o_VG+w3 0 0 0 0c6_>Ca=7;g`~#;G`````1 ٯW_zn7 0 \n\| #vDΉk`````5 F?=:ۜ1 0)z&F v> 0 0 0 0 0O5 nz\pe\1 0@a=a=4P;Ń`````.XaQX+`5 5`Pz&ډ0 0 0 0 0 ŀ=, qÕ}r 0@D`{`` xOZ7 0p||6zVAXL;`xa9M`8>YzcE_0pak?a=Ff`Y jYYYФhk`B?ok'V7&mߨz2 bX/VY^ w~ 0pQƁe>e@XsW=\'W 0 0Pk@XOX Nw@ȫ}4yyҵ4a=aFyb`Zn<aL@*xQmk!cd1}j}qzkPX+`ahecz"'g|<}|h? W ulJ裏h{fGP'"SHdB{5*QU˔1o~_ӱޑg}O3 WW/%WV'ԉ`k@Xo3z}II}\X?~&H,C n2޷K}^-YʸFkǔy 曘sc>}1u9Gո__}yΫ+ꕼ;W`a=a=4`ҽ狼oM.Ws9{О%}P_8+R5b pcֻ+c}zNW=N a=Ǹ㪇+`j j Բv"=3h֋Z|'Ufb(r> W ƿz%w>/-W({U~7l@XϘ1&>b`Zzz hv"(Zw=2^F/΃W7JaTpF @뀰m ݳRM~Ͼ5گf@X^s 0 0AZVۆorP#42fɘv 3*ajzss =zwe߳Rɣp_=O 1_c՘`6 'L~ۓYa0(7s~e JX/w|kyg^MX}??1fm7 0ˀÖW=\'W 0 0Pk@Pkg"l(OK;x o{Hk?q_O7Vm߾oD;ro-VtL?wc"?|ZhbjobޏadWq21ks>DZ^7Wߚ{˰^f%39gh.QsDz?[ܵ}U`'w~=%&7^P\;̙qu-:5]z%=8^j~:jj\5v\{6 0^X+`5 'j'ۻxb)a闺 SL7<ܑ Ss~%VbqCim_s~Jn dSҺ&޿ZD޽{cX(WY5?%%7~K3w(ii--MZJ0Y1u朖Ch93VQϵgsba=z z\pe\1 0@AZV3NgfgjaҀM.x=<vڲu5UPSwGW)Y&D Ֆ=m˅7v*1s[7Src> і17KB[ǿKMclI=u|f9/jg(˖aeMA}N[d. 9E{J !gY3w*5fr)2Ek߹,:z:.y5j 磒k'KB[m8uܚGͫ6ݯZS3/k@X}wq'՝}j 0 a=a=4`I\_s_ nMٵGnR/o&mY 땶mސ֍JSҮ65ҺX*i&քz{‡.{qP@^[hiȱRoYӘ'!V3^u92Laa#m?ޚӦ=q-kayӳwt%s-/%b#ןy-J*jOM1>e=JB^8ʽlH`\j_1k3])vz8o1^{a=zٲ_``ƀրA-+j&2aԪ$Ztذ ;Mڕrawk!*.x]g)}D|\ lz:rۗ\۶o7t31EJVߚ6˵#Vڎ)v#t_5m=o7 i&82sږܪ~9/e58ue|L\϶ լP[[1Ǫb-WA+9\hlqQ2?;zL5l==*7/54նzrL Nzv[rz|*8{ac8z|m]^NY o@Xo>b qu;`ЀdZrAk!ٶzW͍Tmrae0a \?WxZ._qq: 󔎁 A$SmKP Dl"uc0-j^蓵TJH+qonkJr}E?]ܪV;J~ze̜ܒ3KWo[ׂюܼYZx+ ~s>%c6R:2sϵ8+nDM[=}.߳1E/b óW=\'W 0 0Pk@XOX Nwް^ܬmkrݺU)Ydx%R8?^Z|q#>w&t3Gikrs@#IFV]s; mvKZXd5!~s/ Դt~<iέ8Vy}8G뻽mӜ9:q]2J|IJ+[Xɍ=tܼܣXKSۯ57^[7- Omq%+{d$R>aӏ>[bjm*'UW 0 0ee=AD`{fF1h] knҖ\MI.UBZXoO8ajb?`Ti\8so(*Vvz]M^{_MPo`Y>1tb[#_tkue[r>UfjqڒjG} sfame1k*SH:8261 B֬9K޽Һݮ#~^֫yroSϽ/G /\[_#zr}::wu1|z;Ca=Rd`  10M>Z=n- Q:wdUڴ^IbnuޮS7{&@͞} n< V4[r}!w#v?[rOKiߴi.|URL.w#hS~I[RKB{o6;sfq8?THd%\mRK{v#;#jUb`ZZg"l(ZhR7ZL=&kstY^֋}-ϫw!|N+8\xuf^MM{Z {tցJxGjq4X[ӣY /wX/ Lȭwź3zGGz:ZzN~qmWك)O+ƱWWsL```i@XOX MjWXo 핆1r7Wj~{WQJGoBzΞG'(96G"9ysjޛ{eKj;:Ou[uqoER:{Μkũ>Kl绌sͭXR+Ḿ5_ɭ7(c/1 sWZ:ٮ쳊\%QԉאW 0 0pZgr ^a ֋An'mp\ɍі-{V\nF lwt-GnyrCG˚%=5fKKF\+"7Rڟ۵ 8=g{뱽֚Ju^~Z񣡲Tx?u=T?׎{ [-jԣ=yӾ^_)9c䘶) ?g\WSy?Z1߀^ca=^ѽs`c`@&M>iQe1VOjX{7x]G4A#76w-k&kGǽ[tTJW;Jzq}Ęz̵\m@:Z_ 5[c"* z~i򱼥!'onFh'JG^^azz\J.kʞrt^, 6GV:߷wΞ3{r+n=(=k|mP{#ckVlyS0r]]^ֶǜckxZ}:5zr^{|ۯ}+W?G+ƱWWsL```i@XOX MjuX/ZdzaνoYah(65 ޖ\ M}wt{Xz?#E$L0-ŵP2۞ܖsfϰ^B U&x~~rXtz?M_{WܚjcTVخ=aZkYXޟݻjǛ' w qe|0 0w0 5`Pz&;L.zr+$N$Zx۳QPJOsD;guܪT[na=':\mBXo{?j.-BzSȠ4f^+G뗚7Z͋޽[}t2"S2yr=_r=gFy^5kJ93w.Z]r+`VRsF}eiM@oV-{q%cvg˔Wԉ{N_=i\ q$+ 0c`@&q'm}޷=zQ\,ז|VAF{Z(~W"ѱG9TMÎt1X8bnqclk YYon!0kIQn߳{A{>Z=;)+o:爫]bnhY׎X[sT~<1k9>6o箳q1Ǖn+"??յN <π LX'8FN`߀րA-+?pM^a~s7zr+m ֋{WY87U;&R7|Fz~J݄uio _f^+{6Fem1OsΉ&=g Yg]vg^{o駟&mOݮi[ޗz=u>nVi_[m}}:oW( ZNԋ֓/)Ǖ 0  .rWhLNa܍VzR7'VlI+Mjc0Aϛw07'<>T[RN$s?VJWM;5kǘ=Rk\l_[9-mأ%cթ֦K#wu=z_=mpw#Sg=7G{Ӛ~Ӿzo>hy Wګz1p/zQƇWXv,3 0lZAiR 7FmXW;zRbxqCxq5+gޏW5=&5>2[kGXH]jjV=C¹`Nj;{Μ#3}gwgJ];}ŹS8̭,{k[ckz=UXSAɒ}߸-euW/b^a=F7WkZΞ3{r=cra|GZqJm%Վxzm*mޏBc{Ş9gK{ڗΑU 8/=7Wԉ{N_=i\ q$+ 00eeqX2nWX/RU0r[Výn2z9:,a|X/w}ϪhG{zLξ޺%ߞHjgϙz=Ÿ%˭ZSz}!`r+-߳eg~n=r=]$,5}שW1 wi\q5g3 05 'Lϝݱ֋o[+^sFَ/ o '8΅z>rd{XzaGF7Zr׋ii;bΌ6 )؞PRi_ =zϔ_XS+^BC8z]{ mU}fm9%}lmu<;[^ ݯOF'z\9p 0 j ԲU2@^nUέ']ћ)`X:+ptnŊqzϾQfk.F67G^jK`Um w.{V::K* >z>H/sfef~>=W;-~e|G[skZɹɽwAc<~zy-rU[=˽7ν]Il;o_utk9fu w])[j׸Lzyͧ1Ֆ&7uӜs=n5z!Mg@X_m_٭W߹ 0}  10}&Y}qn_n ι{ny#vcOUYGZ57d%n^;#e ymҕahO+kXFh]#VrsrM$棘s?%u3G8^sf.Hg5wS{Z[Y.svX-5s~΍3=9c k+J[ל /xdZ} $sw%c?WqZoׅy/ >xmɗxbe-c_5cf~--jj~?3&z a=zO``րրA-+j'33Va čҰLn%G ԍ)dR*WHd-иCGľJn,[)*є>^7#e ymz%a8loRVx_q#ac6*o=C3[y,{Ұjsy6j[{\*ST_ QA>QSR.cmn+;{dYx?{Υ媸{5>b;㱇Ga=zO``րրA-+j'334{BclDL1R*60nm֋c]a/?[Ҿ D[G4q45##M9:19VY{kj| +m͑%uS[SBSkm ۦקpgΙz[clg]ߒꗽddmy sA{rY-k󹼦krdIM뻨]飌K{BQb]gFҰ^}- o6 1{/OS{O 륮 g]ԻgO 0Pk@XZ3% qU60 0@ozz ha.Nw5vHX/n}$^M8*7}3z<8SHF%ᓭ1:׆76-M `HkS^;j%n PT5mahM7kR5,mQG{֜yFX/|}^9jA}ufX/w9Ur}}Q3sf-}oV|_zZ*&J-ǾoEyr9.SK5۶>acUa=zO``րրA-+j'33ǝ)7J#J [9nmK`|>f-#kzڍԿdG雑L`!u߬ Ըke%@ܚ?=u92W emRtcd:Ιg""T U\9VVK')rq\Q4w7@SzJU9$RZiqG7y{eX/λS?-zю#y{j^M%lZ"W`rc$n^ a=>{㪇+`j  10ډ.#AJ=n>JoB.7nJS`h{!oͧF-W~$s_tiL, R(}mwޛPX*G%hc圱t]?k1[Z\:j5p:ޔlZԪ\ 3 *5q\{岯#R-w^%Vwnڀi.]=ǭ# #:ڥ8i{-MkдiYzsO[RIͧ[5}8ΙsyTPuל9_l?7կoWTs0U1cR_Se?=Vu9Zt 845O׎Vѭ!jף[5ma!7VGGכ;CGytNp}Ip&~ 7 wk 2.``;c`@w\E YlF8GX7Ԋpfj ךF2{=v}+ث=OonR?ciٖxjiڗW=\'W 0 0Pk@PkLaZqYn/QC^izJVTOcR^Muf㹧Ԫz޾1Gڷ`9gs+z,4ߏW=\'W 0 0Pk@XOX Nw`ZP]ܠrx̓՟x<b_ xt:kw4k;6w1"O r~gCx>Ùcp4z0+UW 0 0ee=AD`{f`@R+?8= 0?U􄡍W߲ ^H]ڧJ r•}[7R_2wU/4 7f^=^ڠ3 0a@Pk n< 0@jiŦڛscnR۲3J"P\]2w᫘srU#68z+l_3¸GԛT{ʀ{= qÕ}r 0)#g"l  1ޞ^#G9kS 3Z]O}W-姟~Ū#rMzuwZlU:{Ԍq ۷W[a=1 0d@XozI8@ܜU!r "&gu<^@ju= 83 0p加7Q lc 0p'z<(UW 0 c`@]<`E$V~ ҟ}@X,z_N 0t-Z۾Xecaa=zO``րրA-+j'3 0 0 0 0 0pz,(UW 0 c`@]<`````b@X>b`ZZg"l  0 0 0 0 0] âW=\'W 0 0Pk@XOX Nw`````a={X㪇+`j j Բv"=3 0 0 0 0 0w1 bz\pe\1 0@a=a=4P;Ń`````.XaQX+`5 5`Pz&ډ0 0 0 0 0 ŀ=, qÕ}r 0@D`{`````cEa=zO``րրA-+j'3 0 0 0 0 0pz,(UW 0 c`@]<`````b@X>b`ZZg"l  0 0 0 0 0] âW=\'W 0 0Pk@XOX Nw`````a={X㪇+`j j Բv"=3 0 0 0 0 0w1 bz\pe\1 0@a=a=4P;Ń`````.XaQX+`5 5`Pz&ډ0 0 0 0 0 ŀ=, qÕ}r 0@D`{`````cEa=zO``րրA-+j'3 0 0 0 0 0pz,(UW 0 c`@]<`````b@X>b`ZZg"l  0 0 0 0 0] âW=\'W 0 0Pk@XOX Nw`````a={X㪇+`j j Բv"=3 0 0 0 0 0w1 bz\pe\1 0@a=a=4P;Ń`````.XaQX+`5 5`Pz&ډ0 0 0 0 0 ŀ=, qÕ}r 0@D`{`````cEa=zO``րրA-+j'3 0 0 0 0 0pz,(UW 0 c`@]<`````b@X>b`ZZկ? 0 0 0 0 0 0_W>O>S6ԑGud`c# 0 0 0 0 0 0Tac]usWXMq 0 f@Xo?rzVճ  0 0 0 0 0 <[Po{XWhsJ 0 L 0 0 0 0 0 0Cs\H`tߡ`3 0 0 0 0 0 0pakϿ3 0_-)``````ڀ 0 0pCC@g``````Zz֟g`'b 0 0 0 0 0 0 a=``|6``````2 U=`c`````` I.( 0 oP`m0``````ր޵_``/  0 0 0 0 0 0 m@XO@@@`tߡ`3 0 0 0 0 0 0pakϿ3 0VT 1``````^ 0 0px?>MLx 0 0 0 0 0 0Wc*{ 0  1 0 0 0 0 0 0$````7w(6 0 0 0 0 0 0 \k@X 0 0|K``````6 '  0 oP`m0``````ր޵_``+ * 0 0 0 0 0 0/`@XO@@@`|w &<`````` w=e`````````hzn J0 0w00;X t``````5 wmW``Kz% 0 0 0 0 0 0C````7w(6 0 0 0 0 0 0 \k@X 0 0}C``````0 '  0 ?>^;@ 0 0 0 0 0 0Uػʞ 0szz 0 0 0 0 0 0 00a=7%``;M : 0 0 0 0 0 0ֻ? 0 0a=ߒb``````  0 0w00;X t``````5 wmW``z! 0 0 0 0 0 0 ```/i ``````*z]eqc`a=a=``````ڀ 0 0 ``````k ][՟`ҀoI1 0 0 0 0 0 0``;M : 0 0 0 0 0 0ֻ? 0 0`e=AEc``````  0 0w0д 0 0 0 0 0 0pa=1 0܀ 0 0 0 0 0 0 m@XMrA ``~}k 0 0 0 0 0 0? 0 |i@XϷ````````hz 0 0 ``````k ][՟`o1 0 0 0 0 0 0``; qh`c`````ʀ{Ws\```n@XOX``````6 & 0 0pCC@g``````Zz֟g`4 [R 0 0 0 0 0 0 00a=``~}k 0 0 0 0 0 0? 0 XYOP7``````xz 0 0 4m01 0 0 0 0 0 \e@X9.{ 0 007 ' 0 0 0 0 0 0Cs\P`tߡ`3 0 0 0 0 0 0pakϿ3 0_-)``````ڀ 0 0pCC@g``````Zz֟g`'b 0 0 0 0 0 0 a=``|6``````2 U=`c`````` I.( 0 oP`m0``````ր޵_``/  -oo? 0 0 0 0 0 08_XnhA;zjɥZ2 0  /0? 0 0 0 0 0 0XuՍ]a73g 0 00a~_WM9Z `````6||ހ*fU=`)M&q````` a 7G7 0 <@7:ֻ} 0 0 0 0 0>zz݄2F``;Iz&;L.! 0 0 0 0 0zqa==# 0 0pa=a=4p.R 0 0 0 0 0= qÕW=\'W 0 0Pk@PkLa````a={X㪇+`j  10ډ. 0 0 0 0 0w1 bz\pe\1 0@AZV3Ng`````.XaQX+`5 'j'ۻx0 0 0 0 0 ŀ=, qÕ}r 0 jYYDP;؞`````cEa=zO``րl 0 0 0 0 0pz,(UW 0 0ee=AD`{f`````b@X>b`Zzz hv" 0 0 0 0 0] âW=\'W 0 0Pk@PkLa````a={X㪇+`j  10ډ. 0 0 0 0 0w1 bz\pe\1 0@AZV3Ng`````.XaQX+`5 'j'ۻx0 0 0 0 0 ŀ=, qÕ}r 0 jYYDP;؞`````cEa=zO``րl 0 0 0 0 0pz,(UW 0 0ee=AD`{f`````b@X>b`Zzz hv" 0 0 0 0 0] âW=\'W 0 0Pk@PkLa````a={X㪇+`j  10ډ. 0 0 0 0 0w1 bz\pe\1 0@AZV3Ng`````.XaQX+`5 'j'ۻx0 0 0 0 0 ŀ=, qÕ}r 0 jYYDP;؞`````cEa=zO``րl 0 0 0 0 0pz,(UW 0 0ee=AD`{f`````b@X>b`Zzz hv" 0 0 0 0 0] âW=\'W 0 0Pk@PkLa````a={X㪇+`j  10ډ. 0 0 0 0 0w1 bz\pe\1 0@AZV3Ng`U /y~sw9 0 0S |_gO>{?~Enֻ#jd΍o`c@Xo:3M` D0>o~ӍӍoc1j 0w0?޳|;}h}|8 w 0 ,  !ng`5yP/0}JlQ}I_ `8׾z_*6{gs8ֻO_4.ɳs`c`@&NN1 ,WՋV~m.^x57ϵ>=Z`ڷ?G}s?~}-[3@|fE7j{Gz\p)UW 0 0ee=AD`癉@ܼ󣿟L1p@jU>Kl()pNaw##=x|<0QH]}qnzuosߗmQ,;}Ս qe0 0w0 '0hC\Y~`k'n"+@mԍ+BӜ,p^*0$4tx΍!+aS+[aW;ةµ#>ӏ+-?7vZ ׊Z ׊+b`0ee~dw0 ͷPBPH&#yu.}?=Xtk.4tb\1p%$ [@OuX7|ץ>(iਫ਼ή^]*^YxR'``AZV;hLJ{auݻwC'F=ڞ -C==>˭&l˭V4ke}wtJTNVa=D-ڜzokcvՒW 0 0pzz h6ȥzq:BA?$Yɭ=yE# lj{Gn=w>Z $=V֋t^q\ݦT苚Eյ|#;U"w4*631e ׊Z ׊+b`0ee~dw0 ն-5J_z#nnfccI=z|c.i՛͘c ,%}}\SzLa=.K.o%Exe^a=Fb`ZZg"l,3zXUdOs",O𕺩#hԊ{H\+XYm`V׎|2>``;c`@w\EGXo\`/>ԯz >ɁԜ7["7[y-KkI߿n߷CZKX֦^uԾc|xx3{X㪇+`j j Բv" V'O =˵yH0"Xyy~;οbeL l5E߿ny>Զ{xsVuWYē:1 0}  10g߉ Ź=x'|7"1ǿ3zqc87 ?=jzvjE/NJeWuYv# ܩ|n~rsM|ż6M)GڐtNkJX?z^sgnorLGVJڶ9ZӾkrזJ\Ƽst]ՇblOX %}?]SH͵ytmYpkȓzg-\\[\}'Ok'5z}Fjta=zX㪇+`j j Բv"녇p\2(LA.nOn)=97uTH(sMݥ5~:ҳ_8εuRbZ/=f8HSZ'5? ~kbu|^)q7{xݲBfiojڑr[guxP:nKw)0}@8kK{eY: qSn/hs_[}d'%+QM^"z}{蜯wJjf׍21mk8ث/^Q?=3W<۸kSGz\ 0 0  10;L."wFXomu-$*o%/v~XnsMɹE}hǑZ9սו۝q=ΧלT = Zs[I?"0SHߒ|+Jy${B[mYG]kRG|\Tz~RrNcv5)8KD> ]--W~<ק\\8=ӦhGB*5u %op}PtkéՆf+jc%w/'_j> WzޯZ8z}tz\n1 03 j Բ3IR?5pFX/ږ$xPz&\t[+R$Rzܚ@^+wl{ \=Ko}=7sXSq"lc5a}~_ܣpKr6.JP#A嵀kK1չ6 v_qi8Hhޏs4]ͅ`jؾG-ka\s17TբoQֻV.,u&#mv,W;ǾjC1Jkۮ[{6w7꺱^H+WϐR+ޫ1pasjz5Ηy`i@XOX p9ꗳzՋnTl=z-~ٺṷח\IvC8?=k~n[ "2s,+:N5][ao>g/ڳ?[3%Z<=+M׍2[c0zwԉח}.{wWnaRX+`5 5`Pz&ډ2sVX/* M+uՆ&Go/Ŵ*Jj!7ضb|^7:L}h[*os7s)[ci5g̓>ߺmL߭{NlL}4smͅl -]Ah(foU汭ksѱ;5|o?'5Dro+U2mM0 bI>~5?L@vrI0:5F\ Kw6wằ^tϴ*pVJecr]WoR 1àW=\'W 0 0Pk@XOX N3nQ l{,<=GڞUrS9'Y[9nm󖺉2W걈=>1sr庑{/S[;fE3OGGo5^38zTz\jy 0  10&:>=V &5o}3عm[Zt{۞!\{cg/w͢=ȳum;KkAsk35S]rU*\Ky9s|瞹] [Ԙ>s8$5J1ZɬUz0Zmj^=Rs홷eqO87FGq'w]Y.׍~^_Zjom|p㵇ia=zO``րրA-+j'?L[}/FV޶cշ8߳&~n`@.:yq(=fT?˞uMh(y&##mɭJXjd#p2vGoTZ>w[G1b`Zzz hv".)WkqcMVc V*޶5UߵשvD+~jY٪saJb~j(ܖ7ύ=a’nwopcyq.DXs\Tk|G9%5i>7-~cS}rkL_6ڻcXN׍RKU f9Ҿu>okaDX;`xa=a=4`r~և{.r7;"7'g1#-oh.7Ru^zg)g/*LInu:VJ8Y!Y=zJo:?\ nuiy{wPAm\=8kuٻ"Н~OmVv._۾ڴ蟞8:\ eu-iwE}Vjs}4pq?a? ^.s~SW*իo 0 0pZwe *s%k)I7KZu=hϰ U| eQ5c臵>x7ZT]"5[+~㔚O98r~qTh8#T7}^usu^n\$+q[ZHP7u}( MMm_9ez-_*hw M 5_)َ{JXG6|Xyq5|{޽c!( 0 <ۀ01?{b3zrxmdA74O&z.X7fgo oY~eSP>)=GծZ&]#K6uXm#׽z%sT7}B%7ܷfȫzO.8r[Dy\T5pGZ,;Z=uG紖}%W˾kXo^bnZݰoQ;t8:}!7g!׹*.ߧ>nzkz\ 0 0 j Բ6sxFX/wCikew%ohMy,p7KmZ;ﳏjI?&ڜ]ҶuT{z8 Zj*TPjeڮy^i" _MhsQ\^s!qNm9z.ZQ˾BXo]][!dM߶4pFq&s=5zϾ7cas*zΓu`m@XOX x=3zPVx$J E}ZKWG˴m>s^Sr3Ԥy^zeꚵsQkxkK甚qhmZ} $Ǭոe?1?ӵ Ƶ4pq?{aVc4%~AU]g|zl/UW 0 ֻ9m/g"ka {>5aVKdM7Kmݜ+ ۴k%>8S[b|.W+ -'(=s@V0`c[/5waئy^Z}TV@JkK9遭}wG} zVb阮kֻ{ؖ}*4Z&9ߪ>nzm?QX+c`a=a=4pE]zւz%+m9"f}QJL|i;Դ6 3մLmjuS<{tXڶB"ķu7a}9򈻖mKS'U=a^JvG]-/+؊yhmJq6G}Hռd~n]ǖ}^0V>踟׽e앎%Wsާz鋑ƅW#yv.<3 0\Zi2w%z܌йKB)-[XmZQB=wh{ֻwv"/.]m.O?[r4 HFJcjGY͞csZ"\jp{'RQh>7egXSzq??;07OZǞ1zܵ|v k@Xzoa=^źd`{c`@&{OGep$>8ȦGHք[ZRm S}չgXmݠ}\Q":8*d\q:R7sast^"В }YlrsV \#7+3WzǨ{WES{7-o~[r$(5/l9~״Z}ne8Ιab꿫zq]iob /_[^z-/!w?{jbOǽSX/mq->|*Kcߵ!9q5cΦۿz'a=We``Z75˔7i͙PE R4rA=ayUIͭ2չgX.mY>/90>Z@p+l㜣>[7q[s/rZgյ/e6 XŸݳy [mny{ƜAI*_;zQlӵ`߽sZ,ws'wٚ˶nė\sm(k=K^575-X;rީe >[a\jNn~).Ψyw f-6uuŸcX/>=^k-Ź1t>宛}z^3;_Wt,+w3 0p?zz hd{ɶe}h[˷zG{K.ᅚQ\)ǛnËV`%0[WޥlM7cuvg/̭Mfw m_ ,v5Yi5_H.Ѫ5-opku.<b,O圷J95GWUsԆ㗆ZB1GNu5]k ӵ,[AlֱM9~[i=>e+56kS˾KXo;qmX_.<v.hawmz-u4V;v;׵Ktuv{^;k+w>z8n[`3 5`Pz T>-\{W)I7cq%nυa^z#s^`2vN7ߧcnwi#?%goFڭs k厵u_ߴ99^ץ[>r7{3v5֌ݵOF뭅tidϮJ^ZsH%JIL jҾoQVlzZXs]5=MԺe)W2vB!ܵt^:UX/`Y0%qOۻ\QzkpZS? ֻO_4.ɳs`c`@&N%}H՚`N\;Bt[`!|I0bY>XUhM@:&]^+*uS?}ݭmZ̃%D_j{Ni(mrm^3"ز֘J{[HJ>승$W:~Zjp#AkU-CW՜֫[͇s[s-ޑ`d͜9JX7]7J\%g!kcȵz޲Sw_W]wok_SN>8```@PkL.w\Ö7?jnt|ahkڭP֍ 0=n練ޝ^ZXm>^3,7tY|YhgpqJvkTlB%sV~s*زծ#7JHkΞ֮5;v cV;[֦\ܮV?5axO3ї[unW\SbFk쒪_ͼ?ko^omr?!#֦׮=t9t\BT;SxJ`~mږI6z\՚=3 0 0À1Y.BHq㌛%!F=qaanuö&6TOA3]GŶG̞}8f )@+]b)*ƞ48NpQY˛5sđ8vò/bۚOm[9d+:Y瘪92snݖ8˕]{sQ// GRkyIߥ)y?2[{8}YɪzSkjj2umjϷ紞}_{=ч17m-~i4T{P+{M;u* uVZ^z}3?dz-}Z_Xr%`ߋgD[\S+'-mi ۥq~{5,MZ>^%ޗV3-=7j9RcqOԋ?Ӗ}Sz.5Ǟ3̙ߚh˹eivk83̹pV_ꚽF͹t1Ѻ6spL g-E:9z]Iii}A˿o|uŜ;ͷ5ʭ*2GDZc޷GV <#uZ1pajJz%Εw`k@XOX t;} kcݹ} 0@jh}Z}{n 8TX+`5 5`Pz&ډ0 j (\p>w6 0RE(/j@nUWrocEHf8>;Ka=Q[xd`u  ᬰhg` gL 0k ޻w,.<^|y.{b;R_7Ʊ/`@Xu^ qӗ} 0Q;z& v0 ԍ? ghf Jfոa=5.zcR˽_+z,4ߏW=\'W 0 0Pk@XOX Nw`@jE7Oݽc^@*C|ͥ+}iN հa=Z8ZCX+`5 5`Pz&ډ0 n ҉Gq?{x@b^ǣ=?-Wsg{M81 @ZUM]{O |?z\pe\1 0@a=a=4P;Ń` +8wH6:\?Q^V0]kO?[sY|^os/ai{5a=&{㪇+`j Umm_z5L`@ꆟhƶ>f  1̿fϱ9iGz:;M#7hYcqaMX0xj4·i`i@XGw/x7G 071y#s2~` g@X  0pw2#Gy>w}ΗzTz\jy 0  !޳IS1 0pL?jn[}ko^H`LMߵe 1π^ھ[a=^ٿs`c`@&LB_0 0 0 0 0uWYē:1 0} j Բ^AcRR_`````WWv++w3 0pzz h${IV_ `````΀^]*^YxR'``AZV;hLJ 0 0 0 0 0@?zjnzeΝ`c@XOX d3 } 0 0 0 0 ֫_e+O 0 5 5`Pz}II}`````g@X_m_٭W߹ 0}  10}&Y}/`````:zu⫬^zeuI`` jYY1)/ 0 0 0 0 0 +;w`a=a=4`$/ 0 0 0 0 0Pg@X^|KXN< 0 0׀րA-+4&%e`````a~}ez\? 01 'Ld````` Ջz Չ'ub`0eeƤ 0 0 0 0 0 3 ׯVXWg`>ЀI> 0 0 0 0 0@azUV/a:N 0 0@_ZwИԗ`````~ q; 0 ǀ0g````3 WW/%WV'ԉ`k@Pk2 0 0 0 0 0π^ھ[a=^ٿs`c`@&LB_0 0 0 0 0uWYē:1 0} j Բ^AcRR_`````WWv++w3 0pzz h${IV_ `````΀^]*^YxR'``AZV;hLJ 0 0 0 0 0@?zjnzeΝ`c@XOX d3 } 0 0 0 0 ֫_e+O 0 5 5`Pz}II}`````g@X_m_٭W߹ 0}  10}&Y}/`````:zu⫬^zeuI`` jYY1)/ 0 0 0 0 0 +;w`a=a=4`$/ 0 0 0 0 0Pg@X^|KXN< 0 0׀րA-+4&%e`````a~}ez\? 01 7pX_C?j 0 0 0 0 01|>xOqO>7մ}!3 0 b@Xo?~_~G5``````~'7}n =e`#o=rV! 0 0 0 0 0 g?֕7$ҟc 0a=0 0 0 0 0 0 0 ````7w(6 0 0 0 0 0 0 \k@X 0 0|K``````6 '  0 oP`m0``````ր޵_``+ * 0 0 0 0 0 0/`@XO@@@`|w &<`````` w=e`````````hzn J0 0w00;X t``````5 wmW``Kz% 0 0 0 0 0 0C````7w(6 0 0 0 0 0 0 \k@X 0 0}C``````0 '  0 ?>^;@ 0 0 0 0 0 0Uػʞ 0szz 0 0 0 0 0 0 00a=7%``;M : 0 0 0 0 0 0ֻ? 0 0a=ߒb``````  0 0w00;X t``````5 wmW``z! 0 0 0 0 0 0 ```/i ``````*z]eqc`a=a=``````ڀ 0 0 ``````k ][՟`ҀoI1 0 0 0 0 0 0``;M : 0 0 0 0 0 0ֻ? 0 0`e=AEc``````  0 0w0д 0 0 0 0 0 0pa=1 0܀ 0 0 0 0 0 0 m@XMrA ``~}k 0 0 0 0 0 0? 0 |i@XϷ````````hz 0 0 ``````k ][՟`o1 0 0 0 0 0 0``; qh`c`````ʀ{Ws\```n@XOX``````6 & 0 0pCC@g``````Zz֟g`4 [R 0 0 0 0 0 0 00a=``~}k 0 0 0 0 0 0? 0 XYOP7``````xz 0 0 4m01 0 0 0 0 0 \e@X9.{ 0 007 ' 0 0 0 0 0 0Cs\P`tߡ`3 0 0 0 0 0 0pakϿ3 0_-)``````ڀ 0 0pCC@g``````Zz֟g`'b 0 0 0 0 0 0 a=``|6``````2 U=`c`````` I.( 0 oP`m0``````ր޵_``/  0 0 0 0 0 0 m@XO@@@`tߡ`3 0 0 0 0 0 0pakϿ3 0VT 1``````^ 0 0px?>MLx 0 0 0 0 0 0Wc*{ 0  1 0 0 0 0 0 0$````7w(6 0 0 0 0 0 0 \k@X 0 0|K``````6 '  0 oP`m0``````ր޵_``+ * 0 0 0 0 0 0/`@XO@@@`|w &<`````` w=e`````````hzn J0 0w00;X t``````5 wmW``Kz~Ko? 0 0 0 0 0 08?q M5hg@X]-TK```a/~Ԁ`````kwހ+U}`F4 79m}_}7h5D`````^W/s|'zǺꆫWs\```n@Xo?r#v5`````F6zo4)gytn|3 0;_X>0 0 0 0 0 0 ou }߰{ 0 0@w;末9 0 0 0 0 0m 뵩#\?oak{nлn_޾ۿ61 Ѐt_HzF0 0 0 0 0 0n@X1F>ͰޟgA-mq_Ŀx~ֻo7`````a=Ο>Ͱ{A-_@R?Gaw|*_ۑ6y5Ws2ƀo6 0 0 0 0 0 Հes1bnpt ,EP磏>z>S}y5O>ywOZ/-aRXGz8]o5mk( 0pzIֻ39#`````^c?\]]/B^mS\jc??k/w{ kⵥsÑ^smƆmՕ2 7a=U 0 0 0 0 0pԀCG ^}o5a^Ƕ2׹S>oK=u1GJO?GwԖ^z-`Vkm~J8NN01kyj  10ډ. 0 0 0 0 0w1 l&2 GԧgXO>ywȭb=0tgQ8MS;޽{W܆En:cD[?G=TfhX/5-B4&aD[knk>6i`#5ĿymQ5:x Z$`````F4 Y?(H`{OE*K B6oծ޿E0@:{"TuURwN@\m?63IKE[JDd%yml=i@X7g0ags,`````zc~?}_/ }H륂JG8b* lmu\zѦ^6ܵuKCW5uɭ 1ȶw EЮZ߅ SaymSxIr#s?^c@X7g(agr<`````zc_巾?O!3j˭747h zm[ *ukAGn}t㱯W;J귚 sahS\{"֧[Rڱy5^gc`@&gOO1 0 0 0 0+l?O{'?U:_k֋Ֆ)/rdž>A.p%+M!˭ dru\5pT5qgOݷTmֱJ~Ze%;쮽Ra#V&~"Zoo[aet5:rYY@ҟc 0 0 0 0 0pĀ?Gyxm+=xczMy^.gu0\" BTTmr] ʭN[$L+9VJzoInsuX/gs/}ph8`\K1뼏a-zz h`k 0 0 0 0 0] y?ܖ52o۷]y4Ԋz =J7D֚گJ<ة0aM0* cyco U8,UY- Ms]$WqW_GX>8a@PkL=& ````` z,u>?MXm{+o~?o߫iͅk˜9#gkKSr+}Lfn%mJC]K~Jd|\ꚥT w`XMȰ8;KTHy(CkagIo+4Xklaɀ0ɛ`````j@X+cm#pW_<'{+zڿE@&3Qnu#a>KBUkYql<j}aW[kUa#JS-1֫sߣQk޿0@AZV3Nc`````nxVo[`ol^>0ۑǁNV[PV3* .1u^ zsjI.W\Pnk\v56Sl˙ch1 0 0 0 0 4 SKOGxPk? eϵL)yZPHj@S6%']zܣ᰽MTPn+twEϽw?\?ݸRKрրA-+뙬F 0 0 0 0 0k{~~x޾7 Y)u\&C%?%- 1#eSaXlm+x*>bŻ: m9Nez=–]g &mtd````HNszy@VHhocAAJyg^G[M-Wj;rrq iq0@0ee= 0 0 0 0 0S {߾o4]U/|{ n'| M}Z.VBږ;rA,ϯj[(%p؞F[2JVȵa=zS&mpc````c@X=nZ&Vg ~\$j];^MZwXe(E0՞[.W#be5I=rk嬖<v-z߭ǔ15AZV3a:a9/````` w߿~<6ţXS+ſE,uhyT8.ڳ66fN"pc"ڨm. Y2ߞ9amE=k}'yfXoqԭǍh1.탣;c`@wlE`````Ā'%Nzl׿wݷGoFG{Gg^)VKbuT[Ǹ[X/T"D?]O?S!R[؍`-gw oKV,l=n3'0ee=&m``!y|h[ @XԎ`΀uezޠ^+}By E,=c?B^RKB]\X~)ȵ$]k̼aoGXτvG% 0 LAP1>[7XH!YM47F_Aplc`Ӏޘzѷ*^[zezVhlm 爵cs빀awf;c=σR}!czՀ넣]. 0 7=b"0>d@ js\^7f``j 1Sk]#s]z[[*^x=C'r3>\آ65{rle?]ŶAZV3g@|hAp3FF#t^ʷJ5r:``Ooz_~ߜHzZM.a\;u%7\u4k[|1xc|0=#7q=wO[s˒M/9a}'_s1퓫  10'+" 0Co⃟+c ʒ 0w5 Y6?E/m|o}ejrqzr ]{\GՖ/y@.A~Sꕜ]}96=a8^Vk']k̼AZV3gka7[KB{V2fF3pN[|} 0 0 ݿFG7Cz~zg:לG^3X5.׾Tp$Tu`UIh,ծԪlO0|t-O{~RsksnmՀur^. 0f`+6&⃡*~*ߕxtVbƇn|(j* 0 0<`oo\'O֋sq)sK}!H,ϒG 1Ϩ̧BnSߵznX_BpGhoX/X,qr}JX/>Ooy}  :emz&#~`a 8@&aGޣ; 0 0 a=}x_*qa\koU޽{Wb-4Xbh,w#T[J6ObɱS֋sRzx:%64 w˞9߷I,k 0} ć}Ƈ.Gv#}_]Օ``^݀1{ W Ձm}-zZ[qduܓ/j?VO}W^a{WZ~"3a˱{3VRLgGhzTP.;Y{ZD}JXG>w;?3 'Luz 0 >D0w^ͻ 0 0 0z om~ӟ ]p-v V'Ck!0MX(}|UeX/Yh,ws_(^KH@&=`a9ڿkjS#ah5 F-Rrw j{uwIwQ€o2{>+ܽ?c 0 3d޼~vVm````z,?q3?/Ql;H˽&z)Sh/A'BazV[8X+[W,Ѱ^\k[/y/Pzap)6S=&Dʭxkc`@&ךf20Ʋ?' 0 0 a={ڏF[1z{JW[Q/ m}RV{~h#H٣}t45 k_zQzyrdZ~J j Բ_2m  03/>LcŇOcߕ<\{M|xzɼ=QcMMoV.ϭʄ4}жTmoY!GL9}G?|Xۯ8eM.޳kzO͹\9,8>7=Ͷ} 0s =0>ՠ^<"{gO86XS>~+h[eT_ *6=vbTr{ >hE5+ n]z[cy<^}  10ɝ`g}rU n$5{>,/j.LJ.[B~Ju 1>]/ eƾ[j2_I[־ǯ5\oTG M;mɱq>Rvh[8|Zk~o 0 À=a?٪z/VhzwKRcT|tj XnLV_Br},93gq>5=GzSm5f֋zԄm}}Y㼮5A!V{]k0 0pFIpZwx~Б &ϭW|;~xm_~ oT!yiߖ*s/s}yGKSwyW-{{Vm}B_0 0:^׿/6zӟ;tHVt[IGVZ &BhyE'FϚZ'7]R|oo;<9dTEs^CG(cDVv-ehKVI!ԞVA4 'L9w <@|H$UpM\X/>d۶rU#u-75Aip$WZc][fCkO18N˰)(zd=x60 0m>wwn@%OX +2 h@PkLV#NVΉk` B)%޵ DmdĵVm&֋r23rV[;kk`ap &}`x\hcG-y"L1Z`.L6/eP'զxtyYZ(RTX/#/b%j/:n*cNh79 QT䱶kc[rs^{zg'ηŇw9K/yz\-;~k>g 0 c@Xo۸ [k?5_|۹iqSk BIܢ\l? 0  10'MB 0ra+{diX)n-PVY My`*qs tskUhSe+V:=%mY m=84[E~ o?8-zw%b-Y=K~}ƕQ`׎|>ՠ^o^a.%<^Õ~ 0Ap[YoA``Nr+rzZJV: ڹw%9-?<,Y/AV4 W2Z _ LՄۖK-jW(8JzMI͖ۤj8GzwWC{,y( 0 0zAq?i38}2}GJ>˝O3X'm2~`Zc`@' sa`cGRG,*]myPI-֫ }W\JQRMPo+WҞuQ*վԹKY9ֻ^W;w.1aNU_`6 7v^5~cռ{Wqѧ!/|wL` Zg2b2qL`oa+TE@+2ZI '֫onuhW*hY r- ƭ="H)զ˒fjNI suS2ua햏͍]b6jv 0 0 @y׿fXq;}->?ߕ3)Ϻ\7m3`c`@G&uQa`|w SZ[]okegRvBJ[jOI}s Zs蕳s$wDZ[ٜ8xˤߟTs5g``|zx+Yje y vײ7 At[Y$Js``w ߒ=Zォz בёaop\Ga`i@X" lxm^mݻ495`` e@Pk7 V3M 0 0,w }j^[<4:\ַG[Bnջx/>O|qr3Z=.u+nF2 0^{wa=zaeď?GޖbPG`aX3 'L&~`e ˞aoGd  صWiG@.pG}5VR^+3sǰޱz=wdyf``lzcUWX=4"egzO>wm7g0 2 5`Pz&^ 0@?ܝzXυR{VS˵eHks ChK.8'XѮg1Oiֻzlr|Mڪ- 0m@X㪗-e`j  10I. 0 @W|;e0n+2ZٮeZy67nz̰޻wzQضdAe<~n9ZZo{\~``5 fz\6f1 0@AZV3Km8a`^rᡭzc*Sђ!d2s$ht䵹Z?ae-rkzc[u.(;_mƩ~qz%smu-`q ӗwz\ɣ 0c`@&םgk VAґ2 1-Wk94:\VZG["hk6u­ѱ8-zWZe}`ր޵տWv^l3 0,ZAh_ 0 0bT)Dg˅>+'{:0f ="7i~gom8[++Z8f`KX+`5 'j'ۻx0 0p~n**4-C%+3Zz([*t=ް^%wl'W6WmԒ`4 _z\pe\1 0@AZV3Ng`{H]": ߹w[]KXLMR _%Vfo{7wDZڞ^\Q 0gc9a=zO``րl 0= |'GF`b%#ya~KMXohOI8u`jSz{mמyMc=a֨Ք`0 ]wz\pe\1 0@AZV3Ng`HM[Z_l0~wYUz%Tsu`jjG} hjLrAǬ=ްvk{z'o`x-zgoa=β81 0a=a=4`73 0\޽ˮAX]k  ]]/[<+bTJ:053bi6x{7ǽnmOX׿^c~``owoz\ݨ1 0k0ee&i 0r+E+W{s Q}jlG >$ja^.UJ_|~Z\<aA=m}|.`wVW\+ E('R[M@ԑY;櫅N{m{k:0[-<ԆnYljk{W7ouX``z_z#weIX/"m>O}%(u#P|޳?!c`5|GNA.V拕Z؊JWN{.809ec_%Ա"7EM$DZzLQA)pZ{o꫒ u-#8jlO|:Y;:q``กx_%aWs6``s  10z7 0U"+iŊ^˟3=EsǎDcq=-wݕ* /K˺> ї]b*0RF=;]m\V`l@ `@$B! 9#:2JskЛbs}.bDfky9-GuZ圌ӧ:xøgNe,?kSìmmѶ=kf~0 ``6 fsp&0 `@ P80 ` #3 0 `X%>މp5'0 `gq&,:V0 2z_e0 `u c>XW{ 0qxd6΄Zb=\ª~b0UfX̿0 `Xz[4s>s0 3^ L9| `03@5bG0 `a@e{*wƍ04XPi,8Dߚ^k1 `@ 륱N:a0 `` -~Wsb=\ƈs `@ ˰^ sF0 `z0 `08zlcAyp=q ` a Cu^/x`03@9ǹ90 `@ 륱NRcV1 `ȓPZ V{Ge<0 ` /ZOi=1 `00;b=秺޿z~5}Q?,? zpb.1 `Ŗ0 `@ r_-[(0X[N"{?-;~|B83<>q/)\Ĥ~0 `` *pn80 `b=\WNtO&&KZ'IIc{ʉ(srz.?&;0 `e;,`_߻w-b70 `05j8#olw|l?þBBBӪǧzqGZCi]!sҵ$0 `0 `0 e`1s`}~cM3XM71>=;`sV5 ^ `0 `0 `MbT7cGA~ŷ^){@SMXXŊ`0 `0 `2P'֓4?F/|MW_7nwg9柣b=uc~\ba 0 `0 `XOj!@T47u>Jh o\(~ovu8qH91*UXυɢ.L|0 `0 `0 `` \=$%7b=є~Y?eG)KZe.ĬY_x?La0 `0 `(z=̄Z<^~k(&UGCbd#S0 `0 `0(>REs 7iXN:ۜ?GB2!ocbU_T^+.v7jGyGVlllD.us `0 `0 `j=E`k}}]~T~X~>".?ǟ1l\8" b(ݟ;X/® /D̙90 `0 `0E3Ou??=5Gğ7oIoC'hPY.U}0 `0 `0 `00,֓#Dv2``ˎ>?=!ZG}"j2QMT#X0 `0 `0 $XO*ղp[[[B5B5B1Be_|~~Hp̑Ah 0 `0 `@){hCĬOʟbbb^ef_Ǐ߳K/_,j"CV;K.] 1 `0 `0 ``z!VfD(X)# Y@w}oc~_Y.e"s1Υ0 `0 ``e};mzXXX'Ihd17ze|W֫r4*^Ѹ3]m'sҥK}#0 `0 `0 @)ۻwov]Hpu5?]6b=c_ dBB^/#_wqGVlllDo׺@0 `0 `0 `` TB^4c|]={u|/G?o~GlZ 2ӯz{~ YB;n'֫ 0 `0 `00>1v*w}s_XoWv!˗5 Il>-b=B<z]3 `0 `0 `@7I瑿ZMe0NTes~"7ſ=gy ]뭆Pi!ě*멬}ĵn\4Y `0 `0 `ADiy϶;lßJy?!!M|~|kw~̑t^Η{>*W=,di's0 `0 `0*Xό B~MWm~a')}yٿ~R#OXL0] `0 `0 `(z>@}7l`Gg}>ʟWƿoB%Osק+]~RF8p `S4IDAT0 `0 `Hz1Lk+&U~,'>g+Utr\ T/`0 `0 `0P;"!4F/|MW]~,'>gU 5TKRãSn[~0 `0 `0 `0pbm!GjOĮٳBЪu|/g+_opRXGzpގ7~C/s `0 `0 `@ ĴBAPPPW!pX_>Zy sկa/\:[M=ׅ,K+~~_20 `0 `0 $?tGeU(4 D"ߦު>l~ Y_oRקXoz2, CF?bg%bN 0 `0 `0 `` ǔ%Xlmm5>7VQlQK5n~xEJ'9 N94VCW_10'GI50 `0 `00JC=T䔿!Ǣ?|,o`vv zG ׊ ?6 MXo6.U#0 `0 `0 `` b=UjQ!HS g޶PgW}?fWd@|?~_Y勵 BsTd-e90 `0 `0 ̆z9ĨEDXo6.U#0 `0 `0 `` b{11&ͯ _E(F(!\p]z~?}.v= Ԏ/;X[[+666ba ܜc0 `0 `1P% y7۳"UogͿ>}yw5B!bJiw b0 `0 `0 ,X/ͼ޿^v׊vʶ! 5.d>k9 9kX/๋j7oUsK? `0 `0 `a^P+ߩ}?j#~,>O;{db.*Ꝭm=X<.G'0 `0 `0 `` bvC"J5?5?m_8}~_Yz @ZFXe".K|0 `0 `0 `` V)Sj9Bb=볜a[?BY^)tW֫:=__q/s0 `0 `0 ,RwޑVHp)\\}B!ᯮb>5OK]6BkO&b/q|kkkFtq.l0 `0 `0 `*޶>T%칯lU}}5<} Ȅ~>}nTw9xq=:QɷU \aO|X/"BBH0 `0 `0 ,X/uRrs~b]n:g|ꏖkv@LP/ BU[쥁K `0 `0 `b!S6z,Mex!b_-0ݧ_ݎ?y׮VB[SQ w*멬}ĵˢ]Ks `0 `0 ``> $[[[C/1@Ŀd. 8sd!] +XοzBKBډs9żb0 `0 `@){ Z~)+ֳ~iGsv>So_;ׯ=Ok B/[/KXo.c10 `0 `0 ``> bBjD/6?7X/$ҭbׇ}\cSWh ȗ+_WֻplmE^͸= ډs9żb0 `0 ``e|o Yߔc_[Ymߊ?o{Kp1O?~^W֋/'B8}oz(pc1 `0 `0 `aݻw$G:w:7m#3_%O}>+~U6+>JDܞw ۋbcc#*ty0j^1 `0 `0 `3P%#t;5o}E`k}}!hL%f% ɱ`l6B:^.*;uhP/ ̋Q![ߑ$~?J C `0 `0 `71^O_uCOo[_뛳~ E녊zt[1~!y!^Gy_xa0 `0 `_hM~kމ6bL]w'A?_"[}7MT֋>z^'ץ0 `0 `0 ̊A!Ȭ [[[ ]!ӎY7!>b?Fs?oމ3GBg_}m^NBdV"K0 `0 `0hJރ}-MLR)+ BO4u~TH>gPGu!nGG).v'; ˹=l+Nd'>s0 `0 `00+J_RC;-3Dx3Xg_=,/_P/g}_<;otmP14ۉ\B` 0 `0 `zd)1rOu}|mz3ym_]e>mb=߉3/{ێhP/vb='8y0 `0 `0Y1P;9sUf~o#WӮP/4d~O]!*|#]>N}9[}ZLW(]P=K^hƗzX[[+666ax0 `0 `0 `` TRrs"UkGC-?oU|SÿƿZ*]\wpQ; ?vED,~.0 `0 `0 `g &[Ne?W+۵놬˞w~ZZ!Z |5B9w_薰>;zzPrhWYo.[)0 `0 `0 ``1 B4M]6b6?7 V|v|]vE=k+~Ks̑,777USY/kIH20 `0 ` yoW/$lmm5<wD;fc_P.{Zk'zg' CBCQRj'֛剹0 `a{^q-¿]0 ` b| M,QR)+-Ђ'o|2 a*ٿX|RqTꝋ&snqꝏ?vb=<.x0 ` ѬNo?/? ƿ^ _^s9qN'c2Ԙp `/u£IzDog~?ᱷUq_6`1 `@^ b{'SNy6b=볼ac77koNXOٵ&"mC8 K?OmllHN{.wܱ0PT Rb=%+_+KbOY[Q/ab9]L0 ty<]n Gjxg-<6VY82 `2B~'ղݟݰ˞w~Zߜ7kX:G}Ub zzg zz}shWYϥK `00.UbP=D6'ON,w^*7Ϧa^lf0 `@6,%{~kSY/f#u>/_|_YwWz.-^{QJѾuX/MT `00Ub Г(,́yrc`0 `]d`P:g__HcQ󳵵U[Yo}}}oQ|q!'>yiugl;h^>v`/vb=+]\'\b^ׇL>z!!0 `(z_{=^:x"[ i,n~m ?JAħƧUЯ=Ovgz ^bz.Luas `ȇb|֒]גXl0 ` Jޗ/Xf$ѫ ]qz9wZwf߹Vɿz+9wP'؋Suz\8V0 tb=,vyXbb 0 ̞z9o YYVXoYr0 w⹕^`_Y/v9Lg= b)|/vb_ l10 sgX3n|0 ` 'J޽{Gr8)osmzgy>rooߎ<>-^3(] s؈ s: ( `00 ۷o_}]!asM7AU~ys|[b6[nU9|flyl3mWfὛ~wu-68aa|Zyڬ]<Ü y oui^a̡_.9bLc6Bg_8*PŔۃ}Roc$֋Pq3]da0 O-G^;{=N<9SX @ ١5ALVfMe?c},ۧ1HkUp?œ 6ϛu5-*^5W]'> }~ f8͜ ?~QcX51>#&zП&4swV `0?1*wROuwӵbn>aG_[_[C|O]eR֧X/灆{Pb*Q2c00k-֋}XhݍaT4A|$&X7=G?~ԏ#~$vM']<14j}A$k$"0\I`aA `07b=Bo;Qߦ^̷_yBut&/KP5w^Kǟz''ˢ}ssSe=v00 ]*5M#؛V<Q'h kV'k#i[/Qk+N9=TP/jz +k ` tUW'Vk6b9k _MZU$&qU5mUE\XؘX/ªuuqOV9H׺ϙEe fk k%oM (*^]_x$= `0'XR䔿/K(zY||/߹g9_ G).]=Ꝏ^䇟~ҙAٞPLt)y9ɺb00O(֫zk @N\7H6nAM~}~lַF\W) ׬{З*AcC3ִO< ߴb ݅TCߚĬuByu}ibMz `VR>UfO/:5O}Uo+:{Vwٶз[-KXo.-\RYo `f@z" jU% £TU.#=PlP4X/VŮJ8dUgU#pޫͣSE55oZa]oӾg1afNX=bbM*5UBlG0 `j1p}qDmX_yOΧm9Ŀ+ƿz9ӂPop|zCn6n .vbպpIe1 `U WPUq08&S'ꕟSa|讍N7P/J|8xUq<{V=mE>M#~ӧ sx `0P%=c|{"Uk׮/_?7񝯾3}!Uz]wBv{g@P?z <0 `yڈ5I> ̪OmMW܏#x*8B*bc֦/}Z5&tfb}6Y%֛T,qM.c0V!#>DZ7=BІ17BQLvBzgzB*9J'UK]e/*\FYc `f@zVIYU4ʹ@N &خzkc{=YcXoݭvxbL[mkp `@Xo;Q~&Tצ^?ow'׮rh37MT֋>e. `Xo jF6kY{xh߯{MLcVyTka&CY3'}tXIW57ʁzϴc0Z f%ڪ>rf* -a?G)k'ٞ0ЃOΧ]`do}^r|z'μT+{ٶC8|Ѹ)(E0 ` ?ezUj}Wb7gzg1ךb0 V֋?`"7TV<]S=c_~k{OJYzW֋t^8acB=6ۉ\ެ1005ϬkT֛u\szM7EB_GXx㚇X/ymmmWǫv^z3uk0IAmm30 `h@) gyK9ƢϵYUo[;ϲէw}Wx/v"Rn⫏ RnWi. _+s `@ +Mļzo }nyahw]zڬ>X0 ``V Tr|w޷lU}ڵ+!˗5) _Jƾ{VIF7$VLԚ""Y]xN0 ^b;s"]X*]xq؟X/za-Kv'%km:`0(bb7MY+ֻ_̶!̿{#>Qs.4Cw⹗)b1sO^W=86? uas\Na0 zq,ETULS-nbPAo=;gU X}OR5IDlM}=mku Xĺv`0hzorOu}|~^î坿֗Orׯ]=8pG=މ ^ϿP/^:1`9onn^׋Py.0 `00oQ ޯI9ث:hc~c{[:n}Jlޛ֏Xy^|vs `fX/M\O~ڪ>r>sw>/&b/ f 4rׯ8sdZ\E&Rk'֛K `*0,Z9M"֋U n喱j03W}vo{U=.nMR5$UqM[u057U] ½aW^ZW%D馛Z)'5si '}yq[6u771a0+X+z9oʱJmzg;ў[4u~;O?S^+Ԝi zNx3/Vrv af; \/h 01@=1SMض.RWUխDd]۱ .^?JԦ { j c}b|k6c0QJ^,s~%TF|]SJ!W/D2?N|ǁVR_g/9D~⅗Ꝍ/>~gccUE `0bm#DYIPݻ+b0,q S%֛Dw-DmmeҪs년cL7)gMĀvuX0 ``Q TRrs_V׮]7d?r3?g}|G '¦OEz_@zH?=buQ>Dž0 `)2@w*ٸp %h^(/&w̃׉!,U1>i*c[]lüL᪱3[)-}-0 ` obbU爛z?OԊk }t}|wZߺBD> ut#R֧Xo߭rٞ#?nh߮^ޗ./0 ``X*WUsTmkcN\5U++\GƘl뵙:^[Q\ٷ13V]<`Gfb=qeq{ 0im 'ҍoӦ^[?uB+?]vEߩK?=w,777USY/i.G5 `@ T ԂiگMZ{q]UUς*DzS9 j 6 ©H٬4סNU ƙIz9X.mF |U_\:4bu} s0دr,a7u#ۿc'^ `X/$sT%Zo1z#L?G ?uB͜]v̑mC E DPDz.TrX0 @]5_mEM,Z6Xʯ⾪9؛:1ZgĄdUbj~Wտ wl-cbK&y.^:y0 ` JW/ڄTNo\''u;o/EV{dbsS Bۃ? KXeL1ƀc `b¬&4uֳM+ } )m#kz{[۩[e?K[!d#b>=TwM-k+klo![_g0 `X%Jgx{m7kc~Gg}˟vOZ"K pYV_Yϟ}$~}ooodz֧ zF:ϽZqj'"i~?گ1dˏ/?50 ` _kRf~_!Y OYzٰ(l FW1=6MOn3&q\ 8ּ\i3A[qض_8*a.~׉g0 ` }zwo~lU}uCC|͗/k~SʙEOaԯEzP+<@ڊz6^D& kh 1 `l ꂀo'}O^/4n?s .v\,g0 @xnQLMzip0k `00oz}^D f0?m*ϯ5B_k~E"w@Q_Q/}a,777USY/y_xt0 ` 7btX` 0 `k yoW/lmmV[__-N?*]7N9 aZ^^#wjz)XŊ`0 tP=/VU鍊n&Y?bn$kw!0 `(z?p_R~&Q>Y't>Q]ѐ}t>VA=g=Bۃzзkz@Y0 `Ho1*۷o*ݪtc0 `` bO/ sOu}|O~ӮWKM~o5 Bi_:w4 ?'˵cS}ޱSm'K#A*m0 `@]x,,gɓ0 `X-VrVbh)Ÿ>`D C߬~?Omll4 0 `g T ;xLzޭ!0 `1v"Uk Y5_̯MY__7_P**FzzzBD$~\Z{l|9n&땑^%50 `]e`߾}Ѫzo}[g* 'c]&0 `>1^S]_}Zۯkî坿7g}r֯4 =@:J(NWshWY .0 `2b;3X' `0 ta^.S]_z:ȟvO =Aٷh>ɿOkɳ/?y=B{noOjt|珿YonnR3*HBL `0g cpCջoB07tgQ֙c0 ` Oz9o|S]Vme1K1! cyW7fi~ę#Pl+ Bó7zy9ɺb0 `0 `*0P꽽B gH/WH^\ӿ?+VA=?sq쑨-y^^XW `0 `0 `90P%K=}Kw]n:g|e'Ͼ>Jpkz){~oP/oED9\P6 `0 `0 `ȝXo;秺;>Z/^v}}/u|T[eBiu!{z %c=TΠ]e=5_1 `0 `0 X/ S6T֋?':\#?sM+b0ЇRP/?s#hTYOe#]^{yem-0 `0 `0 b%S5綶j+뭯hcOqt?S'̙kGAc0g8>uuG$NB& 20 `0 `0cmm^&!Xb?X/aCBRC|쏲o;[.:#k.*~GA?Ϲ=}kE/vbջpYe1 `0 `0 ` J_~O O?X?M_'MwiNU;xZ'O}b; \.d0 `0 `VRBw)槺b=|?:ӯo[l9ӂPop|znx|P/@^zwqʚc0 `0 `@. b{r\Mdzۈo|_)7[}ZLW?b'MċBO?yPH_d[X[[+666n.0 `0 `0 `1P%=c|}qV :e~o|ꋺb'μ>J} RnAzED.l򻰱0 `0 `@~ zI=?T+{UmO>Q]}eGOޱӇ<~W?sx䙭"<86BehH6]XSk `0 `0 ` ?zorOu}|sy篭_Gk7ysiM"j / Ro ~O훛*멬G `0 `0 `HA^H撿*bs[[[G}'ruB0|#W>rׯuҶ^^urP/vb_ZS `0 `0 `XJ}'K'?3>B/O$/n~Y?'s?ӕӢ*[;{d}.^xmy{cۉ\جʅqb0 `0 `@~ bO| b)#ֳ>OSW:>swo]2-w}Z9~e';gʶRRP/vb.&\6YS `0 `0 `XVֻ'DlVk0O3G}f~̋Yӆwkgϟ=z^S BDۉ\جʅqb0 `0 `@~ b{r\IT'zۈo|BА1?uV WO,;=Sk 5gZ]?]\XSk `0 `0 `0P%=c|}a]E`]g?|27e}~|C/fOEz/ӿ ^ۏ9\{zB""\.)Å0 `0 `0 @LC&Tz_Xmo߲v}}/93o|Gtkv@Y+KCBF;ab=bh̜/o$0 `0 `0<hD?ݟm!cs?V ]?>Vq~튠Sz=o־Oz҉Yonna0 `0 `d`PS&h'?mmmՊGrg.ۧCÿrׯ8sd{R@kz9;}0*D ]+KX/0 `0 `VRw_*3姺>qz'iԿ2MVA=ڙ'BWN+ꅟ~G 빼Yc=0 `0 `0<(zw%#`)#1Uwf}sקW{kzgwՂb{)_}/s `0 `0 `@2 \{Z*U R &b\Y<79ӂPop|kgt|VﱃPN*g=6?0 `0 `0 `2o~s$r&y6b=볼ac77koӿV`ڛBۏ>MOwBvGף%~ve(> > >VGQ|GQ|f`}C^S]vXaY>ǿ圿7>}ƾ_9|*]\_ nʾO :!'>j3`}DFjqG6V_} 5DK{qr%OZ^A͟Ճm$|To4` ??Vv?#? m*?ƿ/??_+b'P#E}4n_űSϿOi7?GE > >GQ|GQ|g䧢Bz룏^^`=?>?"ϷN9xij~tK6b=\t|zǟ}cn~>Q|GQ|GQ|f`'GGG+cv~//g9_>N=sNJZ^OV]4ND>GU'GG1A|aT2n|G'(:._B"offfff6-r֧W{7zζ}{W B= c~6Z>7}QuPY#?#A|ćvXOPTiOI<>m[wu|zFg>=3YPA~#f~OFGA}>?C"GcA|A|'>ʟ______~V߭MxW~ډH=7ݬm|To` ??/GG1A|a4_LquU~ݰzCS^]ği/ѓ* ɥOߍ Rn;7ZOFGA}>zA=?'ϸ"???????`y}jz"+?M~~m9rbOGEŞg{BOz>:s#Q|A|b(>(>3````````_tce=ⷫ+?O;pC_jz??O>Fh~Qw>Q}Pd}!~?#?D > >Ljz#>Gği~Qe*wډ3G'AEs|hk7?`(>nGQ|GQ|?????????ɀQwG/eݱ_ Ag?O=Ovܫ}P Y=\?'{B}vG%"A|A|M$(>(> -?G'ESdͿnmkzcOŅz;m|ߣ}cE > >Ηܯ_r~'O:vV|||||||||ǟZty^eW*z~}BC}葿=(i7?u1|u>:?.G%A|A|MOۈO'+*~www_էްnBg0oo> ^H̏ >7b}QuPHG 5A|ap=*ʯnxqMELuOOOOy?Ce_FzaBCyhi7?u |Q>:?G]t >0*ě6>~w׊Wִoooooof9_!{ؓ=zOV(nPFϵ|FGciA|A|F/ZGQ|GQ|}'+72@? ~ˏ׫y]vEw'~c|+z_k7?Q>QoGG1v~A|a4->(>rVXo}}}$G$~-~r_AV;qxE=?ߑEv?FP|GQ|Gq ug4X_d|s.:#k-7 rn?ZvSwь|:>`U:!GX"R|A|ćQʸq| x pYV_YV+?V!@~i7?u)|m>:?*G] >0$>ʟNWi~߿'O BU֋?͞P,ۃR+n~)>`}TDE?#?Ƅ > > &mzl?d/}dO aZ\D~P{Bi7?`H#?c)> >è@|GQ|GqXh*=խE_t,iAwߍ8FP/mC$c~.|T_IJ>GE?GXL|A|Ə_B-W_W?爟Ϝk;z/o*XIW,|#+6k7?`э6?C/ GG1 > >V$GQ|?z!%~_E@iMrapu^[.^$A=>? > > Q|GQ|a?ڪ>#o濗￝v2$}Z(W;q|V\_U֫r_ >:`}#?#hA|a4%>88X/p?3 cg7Ȁ"_T/rѧ{db-(>  snSŗP !v?"#?#K >0GQ|GQ|*,z0XOs;?O+ׯԏ(^9WćmW/;=f>?AQ|GQ|av2`ddԽQ[e{[3'dClaÇBW}{.ZRo?ľkEHn~>fA|A|!//_q~!'OܟtXn>-I/|~"noJOAGP}>L?C\?#?1! > >;6,ʯ~???????fv*gVKXVq4OP/>-n#|>`Uy!~?#?D > >)[+{GğڊSor+gG RnJߨhk7?uGuk>* ???#?G >0Y6c?_AB\_";z(̡7Jq/Bn~}?H#?c(> >h"F|GQ|ǭz#9"[o[:Çc?)+"|*3i?c|GEv?FP|GQ|Gq ug4X_d|*sWv;Z^?_cPOh>Q`}D?O#?c,)> >èPe8XOPt\D~m[O+ׯ֗jzlC\+n~6R>7}QuU#?#A|a4;I|l+֓??NؿۿۿۿOJYzW֋?7=ޣY|=n~>FGc-A|A|F(>(>B3eڈ,>秇ײէݰn-*O?8cɧ,~-(>?# > >C 8_:__p~EgCB$'Oܟ?뮻놷_Qu/y߿xb_F-ޯߣBOvG/Ҵ| 1A|A|ꉏ(>(> :?okz?Oߎگ>}}} }O2?_qw_BO<~~D|TT`" 9GG1&tA|aB3_^`_+4/?/=;]v+'{^?mO6#d(~:GE > >#; >2VmeQ[%~_?> uCP/O>^)z7OFGA}>?CGc > >d qbqL> 2o iUЯb#=޻,^QO>to#"|t|UA|a(>(>Ïn??????`9H%x i=Bm{?>:`}TdE?#?TpxǶb=CS_9?OsRy'֧]ޠ_Y/vx"_/O?}Ƨ}0(GQ|GQ|f`'GGG_~ia>'dli1cB;ľݽW!K3= v?/GG1A|aT">(>8,?X*vGWˌ[ N>d*݈Xē7=ZQ/S/~gTыcA|A|FΏWΗܯ_r8?:?:?:?:?:?:?vZ+/rUY#؜|GE[O-R~ϵ|GA|a4->(>8̀AW?zoW_Wv2!iM" /|Az/B} B>M|T$`ꢅ_#?c,Q%> >uakkV>R#E|_E|qʉcmɧ(/7{^&y:^Q@o?-NGv?!nc䢆G8w~^y\ېPsUЯb+GGOWz?Ϲs_6QG}c,(> >èE|GQ|Gqݿ?ȿ?u%6XO/K!>O9ǧ[YV_Y ~9؇k/ҵ>:`}Td_::p?S#tahh8XOP{ޜI9ӂPop|k_=O?yozOf~goFيxn~>FGcuA|A|F/rGQ|GQ|sY|_?iUO}էݰn aO>T?D(> ?O]w]׮]PTX~޵YeUMWU6hO >_=vN;EA&}{G?ſKk7? } >d ѯ_??f} p~{wcRX++++++W-~w#~ݻw9gU;gD(Ij|wXXfBƗw~Zߜ7#B9OSקX3O=*Kԁg'n ڿɿ.| `0 ?¹'My~{WO WigZgz `0c=?vev~vo!~|枿6 Fl9>+wީE3}Cř ^w|,~~bgmN 0 `@x׻_{;q9oc:DwUO1 `a q?T|33綶j+뭯H'6?=G+ro;'ÿOߝ=|h)zP ^{kkX;Vs{pOmBډ?,1g0 `)20,|C6SM}-0 `RYoV _Gg}˟~fsPȉϼKwO+ׯw[Pzvo~FNm?SASm'֛%0 `HA^痫1Ǿ#SY+W0 `0О>U'ݲVᣬ8gZm!3sgo;o{6k}ڰWY7m7l'kw9b0 `Rf]7d{)/:H#w0 `RwޑV4S]͟vO+_}!c~ QmV-۩?{+gID OQ+K}؈ 1]0 `@ b_Wٞozy0XG `06 Tr|w?"Uk|_󛲾oT;T[%ڨP3ž|8|,rhb='B6 ^ 0 `e\7mMQke0 `&a &!{~7׊/ߒuy篭Yo|{>[UC_iP/(7a0 u~"+MyA';I0 X/0Ʒ|^etNcB~Bc+G+ އ=͡[3*aDV훛z+uɔ%un0 ̒*[8r)Xv0 `@xw~ڪ뭯H'*~_?}vɾw6AV;{ж~@mz*zyg17zg>ɞP`zݾdp d}0 `f@L59oˬ` 0 @)ֻwgy+|~mE7ffWAv 'O4rn1srZa0 LX/ F.~0 `@ byoeSha։̜r#3$$$vwBi~;Gm;}`;^.0 ` r=ߔsw]^{mGX10 `șzq~1ڊ|濴ek~s{b^ g~=)5g}Z_7W֋t?PoSo|oɿfE/ϼ\E%J >)P/>$Ft|.2Ȱ0 X7u}XPP0 ``E1ٿ)[U_>!˗59o|/}z!K}Zn`zoنDV;b_$u0 T10XY>ߔG 6 `0V!{jNXۿ:y~d| 7} ?:[_!/x )1BH%K( `0P2P'`_ep)/ pa0 b7,bίm*U u2:_o/eZ! SH|#S>rׯ]9|_^ﱍh|ٗ^//ޝEz*y0 ` 0P%`|F(i:I[km1 `j00(|3ȱ-.?U[Yo}}}$h}>QdF[Tl!8fSrЧ^g_sӟo(]V_YG~X+̶=l䞿 ۉV%0 `-MϾbmmkhV0 `1p=OXg)_x槯`CD~P>-ǷvA̡ ?E;~Ho#/{l|)w1ɚb0 (z׼ ٞo%s7oX7|90 `XJ޽{Gr8)oMX_OΧmyoͿ5gli1}]¿~"n;v n?ObmllDp7FV0 `@){d{)o?z10 `*^oKlتuY5_̯Yo|;_}QghY0WڈX̋gTG'"G^*^R/Rt|9~XO 70 `Vz[6_ \ \ `0 @L&[WAXe?=?j|y翭Y߁o|;Y#>]+KK//oF;ψV 12*(k}1 `h@|S^T뱉66580 `y00,|3̩-XYRh;$[ QW_SH +4|_"^}+a蛛zz*`0 U/HJ[G `06 r< ΁-N(U+[__y*YJ/?%&^sׯ= 8{t#I#;W{lhs580 `3v~氪zXC `0 bbVu5qz?)}2VBv]S'_X!{1 XυG  0 `Ha[盒QbYk0 `8 bZ $X`^-d~֏.BL]]eǗ֧]_Uԫ}A{``;Kq.=/0 ` ]loJ>ZqF rl0 `0b|~1ڊ|濴ek~s{{/þ7O0v@Po`|zN_\P/~BDۉ\l0 `X J5o|C۟+bޥ'60 `@)ۻwH+CX_OΧ./ڤz~li1]?/}v"RnЃ_ t)؈ 1W o.0 `VRo=ߔ7*ش10 l3P%=c|]7\u_ߔ/~%c߽zPٗ"|ND玾\zE_TPq0 ``ZYٞo#%0%1 `071^S]|kzuy篭Yo|{>k;xaZ^A1j79\}Qc}/0 `fN.r8ߔzc0 b7,bίTY?|-,+2#n׮9\p"|Vˠ[W ~~o̢}ssSebju.0 `*[Nrz/0 `Xz9oY6綶j+뭯H'Ϳ%= f;}<[m;@42h?߫W 5BBzsarZc0f &`_t%t~fz:_g1 `j1P,7%Ϲߺ:qz'~D!d9oͿ~=wkN*^غWQ泌-<-^EBډV%0 `-M7rY{ `f`߾}E60/X0 9߶˯#bsY>yUh'}/ʾsקW;Ź+zʗm?o-ء>vb|/(\>Y[ `0Al_gbmmk%{/`*2pM7??U crgJe{U'ݲVJo >}o=viA7[tTs؃_'ԋ?:6RRqKXEM5Ƈq `0@)ֻo|}J ^Hq}$_ozӛ-R>-^lpOD۾HAn?rKjccCreL.CW"x]b0 X e{)oz7 9Y~^,9Ol ݸS`wy*їW{51[cqJ{~替w]7ܐu_ߜ7%czsUPZk{l"RopFƗC$s9r 0 ``< >W2t\tшx +OsY#VgeK^6zcC|J:ek\2吿=?V+ֻ:aG_[_뛳>|W#^x nhq"O|#z 0 `+@-\p)/:$n$!  .j^bÿo,UaUUV^񓁙Y<7P?M.10zo1Ŝ_7V֫CbN¾/Xj!>~J?ЇzCs[ MbH̺%y50 @ќ22b=6cb(WT *aأbwmkbb: s~: s,S SJGmW3/|}oWAvKg/zB-< ǎG=ޱ !_zzݹPpc-0 `-M9zl-M#+?9{TKk3^ɓJ{UUK W2oC޷{-hb}/n*38oBu8=*gn ;w)]V_Y3O+*΅mpXwYﱃaz.:.:c0 -˕?~/k::*E&{R:J7#Lgfާݚ8Oz9TֻYoڞr?-k|mz>^dַ/dw ;dO+u~z^@o m'sEa0 l3Py=ߔ?=zDzf% ܅s*tMzX"^}-ͳy'b=t(z 9w$zOumz7u>u~_&}֑o~#[}ZL/|{k'"~۵.O|ύ  d t.0 ``Re{)o*῍X/TЋ8"^;&<}ĴK6>kXypd@X/7/|lU}ᆬ/_//~~(bg\k#BzE ~o0 ` 00XY/v~3߮${YR  ? m`l?ͤ} c o߾jn3ks,^0bF\i/܅Y${} [8Yc>.&ĞTeE_>$p:O^_-kMbb7ߺ:?Z o{k%?=?j|y翭 |Ϝk;xA]OWXLث=wzx*X0 `X,upCXRY{!Dxnx"=jY8c|Cn hӗ纱^m>|M”0㎩ l  bgJ_ >i{Џa۫Zgm|,c-0Z\9 _qd}RF 3|,9o~a^naΌo16B/坟֗CgN޿_";'3{c4‰@|/MVKn\Y `2sO.r~Z[.f&['kdYx&`Щwf%B^MYo3{1KA$H `f-ue AZLƆ?ofؼխݬlNIiX swɉl1i[{mUӪǙO2?VU]Z46|kRbica~mlkSr< h|;nmmV[__ZŭOT}m:>Nwmc7=ʥ]m^y{Ejz\8V0 `0v~UJJHP'VcZG4 H&:Ƥ³hJ4q0sJD9/oKִbc|ߵD}Wߎ=}䨯`[pXq$c}Z_70KFz};,A('>pGz Qt0 ``5(z׼ٞo%ُX7l~f%֫#+E">n5~T<.2&ڨOUe>Tշ#S>i375uBݻwDŽJan* M=+^iu R%j[oym[NUg B:#Q[_HUkcO9i#H-Vy8b|Z6B֢c4lgǗ ΝGϵRr)?毖=6b=|?]6>~So|omZ~VE/bq[w,zzœ'^/?K/% 0 `@){?g?D|SϞ|'zzbizARW o?W%nGR'k>M¢6Ķlӧjq۪_m>x k^s+j(߯JFV5' zm*o ]c(T+S f-֛%66b0GUš즮=|vv1w608+*W%m*!eV*]zq;\6EXoyS\W7K!{}פvs~mSYR;#[ W_Sq|_"ֻpxq/ī*-~+?AO1EX777USYOe= `0`J5o^E%g) 5nqT\RX4P/if9³:ci, b:sb0J$j TիC+mWE넃GN"OPn|1޴B:FVYKk$֛45 ǩI$蘆xw~ڪ>W>[Ɨw~ZQ!4U;(wÇ'3<[T>8*E꩞|h MX/KD 0 ``Rbp|C>ƱY{LS-wb[mBb>DpS%УYʬzLZqVbih \ҳ`gac}cFX'Nqk'QUٳaUuk&^4˴>ʎgi#K׶dy)+ֳ>y/tO;;>/K}¿~=wkϝ+^jz9@x Rk'K%0 `hX/ {hkuKL*I+aVk.D1ӬU9Ϊn#\XoZV6J76ϰ u"\ϙXwՍ/&.m[ i|U]'16ikbEOm:T=~jZ;n^^WYoV&j_Gg}˟Hǭu-*d YV_Y̋z϶=׍6^.0 `8 r=ߔ䣏^{mG81qeD _AS'D 5@2ZM5Xi¢I_1^'`Vj[m.U#'e'ޤkW%̉TYx}h|4s2iYT9qPO۸9:Qls Fg%ڛv쳮7meXoJVlˮ?[?7X[**fyZ"#ſ '|iB[|\4qDo"~PDO*_d/vb.&\6YS `0Xk|g?~zDG}ńMU{ȤJoɬ* W[#;'|#[qMM W=ޱlb:SUM2[U6 5 Msl鑜]MֺleLL8}Zqܬz]\y0ZAcɤضz]gR㉔7&TF|]S< 7ߚ?y$[}ZLS,E;~tcK[?Obmll4^"úZW `0 b7}|OUcv=hJ DG}I$4I{rm, k&JY*iMG$b^ɓc"ξc1ku|a`}^ be,~l &yowf5OM\jo?uuzovlU}ڕu 7-ʾCeiU^?aP/>H?VJ}b='+NtFҽ@v0x<WY?ߔGbm2ӈxJ4N%Ef)Xr8NObPAi~F(8طEd6U~ָ ͣe_y$txjꠁqě)Tl,O#+V%/mݣc}'/oB~'ղVw/beϿ;?m}omL's5=rU9vzɏz)YF;vpdM1 `b ض/?ߔ}zlTlUݻU+B꫍P/k.TlN\JaM?Ъ*͊}ڌ+sZ^#3_"ֻ c>UL=<KOˢ}ssSe=T0 `Xl9o b=6iz3*4i%65mXME&ML+ U%@G\6 ۞v.ߟM9,Iܷo_ֺ:b[g q9Z̃~X\ge'X/Dm>Э;ڪ HYTEo| 7*wÇJxG\T>8^eh 9ťډһxpYd0 `&a &` 皜7뱑662 KV \P|̺/9YRWՏIRm9zݸ"UkۿiZm?a,|]Xĕ`^?;- .<JHT-zM{Rgy)+ֳ>y/t!L;;/K}¿~=wkϟ/Aq{?> KX/ Q0 ` 00,`|CqݬDi[J F2X۾ve£[cB家Q*f"zrcdU}F WX˶+gՏI`wfiS{9TLt>&Wz]\y0[ :O+z}B o$ەDmg/%|;7}f;=}^r|z玼ԫ8~~GmtLq'z3 Tۉ\Ls w `a`PEJtڥVEv1j]}lbY6KƲzA|kLZR>/fm2JTUBYY,m*`cBcGP\7'_Ui7z]\Y3:N0^go{zc|ߵ79_V7ӧ֧ ._8g BAz(pc1 `5d{ o~ozs܇Y}l"*S]Y6-֫ԉBEx۾nVbyjSI-nUæ*lm9fiSsDku W|߼U&Xk1kF죊ݪYTCf6c)֋;'ղF|ooyoͿMO
8~ӈ-]YMl q{~L*DS\ϛXo1ubb8|nl*FFO>ĘX/M緮wuX=aQK;m_]'>c9v$}ArgI*s!rZb0 1P'`'28ߔ!zl?@J~Uڌkf)Be*qSǩYWxqqU՜FSUmmwLukfYY/.x*V6f5TI{Uf>)׮BIOUԫ(-AɧKSzf!Ҿ TQqq 0 `J.@S9T%BO6>obi\UU3᱃mE[a bзGSUj}1U´зk[  V`5k4xeA4@-gSB:^)kFUcraU_{]0oU6FU=Ɇ%֛T$\Z,KW%~Tinb7ί[[[]_[ŭOso]2]vmc^5S6j'R%0 `b &`_d$t~Ez젍/XJpVLSUm)IR9.7h\QMُꄐeUAW% ߦ0UXAҴU6c_pϮ[W4 ޷ \٧GA7JRA7+{ :^`jm;3/|}oWAv.z**ꅟgOd=S_Q/vbոp)e1 `l7%zxof- Y%h#HAAM]_s*gM:'MX/ܠ0$]WjGaU7Cx)Ehu4}7Yo9vUhЭ8b=BW*ezRխN,>]>CׯwNѷ' rm?{8}ghﱃ~yzuizc0e`PEHɟ=֯tFo`u`p!֫#V%iy[UlN]uIV4 B_fBe*lom*q1us5ƓGYM,6ҺS$g^ƩPFV Ee*g>\eD6v5yTYoڞr?-k|mz>^h~YI+/e_YӆwzQZxO Rngzy9ɺb0 3pEw5ٞoʋ~z@CW'F{Z!CSU V{eH,Zzӊºd㊵YY XCqڊ=šʦ}4pv>&U=v2_ } OwV*M"t |Ʋbb&r[jWk/Xbo$)6b=|/%9GYJ/ٟ>-^􇒆'^EŹϞ-N?6gBo~kcc#:>ua70 `ȗRwypn '3b=bFbLX4c%cBإmu!r >.7g#Ybbij1dqsmi[`춂s{91rٸ SjX&68+!lG϶{m+΃MB(:):< 8ci29K>MII`b2KYq}z 7wߗTw:e~o|:oߩ*?rѽ-{Ap{?s!vb=I$|.0 .bl>ߔ|/W  50|}\{ Έ} q+] h843{csW5}9m0 u ?V޿*vq~+ s}dsZ{-> %i<֪l{ V}~S0Zr]K^lp60kQ3VWq9mwYT^>1&|OՊv]t/Fo>0k;=g-t#}R{e~Us)ϥ0 `:[8t!  `]`X }6H@0V1sEg-֦zoFߺ:ms0֗ii7s^z 65B3/%[lrT2|c3@6Fأ=Lc/b7sc|;nmm?w}}$Gj}>UB7ȾCDžkgچf[LP/Z Btډ\Ls w `a &`۾LXV@ ;g'[xo^xZ){_|S2Wg}_*mGu}C_;~[ځ{*^x8uAs{ptYp `0 9_Fz4e13@Ѯ3x#b`+$[jb2=\IL^k|.a_3;-fSwO{}|zUԫxyks'E/ .%Np^$[0 `[ R=\ٓ^{|cXz ٛvc=bvk}>z_*nYk+[VQV3k}﶐ h>}o=>mHׯ;zBG&~A{t IF `cXk=/:zǾ-b=✥s|2_93@dlrKwy'T{Rߔ|ﴉ?/y `2@IBųa^[Vb8̛X/M緮ogVr?UoOܯ t޾3֯H] {Po%~\PYObe0 `J0P'`|S߈#0@6knƨX/U㜝vfӢ^4?I0EFO?-d_ 6o?+}^ K BD777U֓^˯]~Ks `H*["KEPdon@n a:7O<Lr< w~ڪ ,n}}m[msҝ_UԫP$~|_%|yՅ0 `61[8t)$6|V7MŠ@)[1 smՊw:e?ǿo{Kէz;uуmʇ_--t ŹB'I 'VbIbO `@)ֻo|mO9Hc0 Ub|k~替Z޻/_?7񝯾3ө _9z/5Rn xosb_NRܼw ``eA6#2`0 ``> zDb_n~_w~g~ .>` O>c޶P/Q,&~ 0vs9żb0 t:A7MY1Xu0 ``~ r; c|9moq5|b쯶"jFW} 2/9/ܿe_" sGzoxW7کonnA`0 Up"pd60 `]c`Pf8{jzݻwByꞌ>._Bz**~18hLXJ.V0 ``> l\dXo> M `0EJC_{ M9繞ߺ8}sb~xGyE>sO'E?[ߎosWڥKŹ~Ź^JP/vb=+]\'\b030,`_&v~5'֛=?lҜb0 tR_*^n{׻U+{[2*| /VWHǎCH>Gz9^_ޥ3{BroOD/ȺXl's &0 `-˙oJfzbmmk7l͖-i>1 `z_*s5ўf)kb_s9cN?:\nEƉh.cB~kcc#*\10 `XJ5o|cEm|^6Fc0mz6p~f;zhcUPu/T3!>?ha]'lB}݈XP/}G~XO 70 `Vz5NE#%0%1 `071^No]6V{׻Ey#ʾ&t#t:O(_;;x/*Q!Z- Ǐ/U,t9%K( `0P2P'` 7X|0 `00,|3̲裏6 k_}Ǿ!2b?gGEP|+/~*s^BF33mnnUT\LŔ0 T1P%`"X0 `X/ !U絾bwx#!!J䏣?g+FLȝPCۋ![]EFDCŽډV唵0 `@L?h't~rz:_g1 `j1PzkYov$23<-{|ϟ/w6 g{ Y|\~}>&+_;p]k/+ K'O CIXo.-\RYo `0 ¹&M7rY{ `0z b/ 9Bx>VB_G`|_|r7_o] n_֯wܹހc0ٶ~Pxb#~]Ņ*k `VA[痒ݦ?ZqFϯl`5m[w `0'W+=_%i{i:iBEB+R_ix_`iCW#=̦ȉpd]1 `~?!֋$Q~0 ` GJ޽{GrX)o$b'9zhG6︃PP/_r_3 5BG6!/l_\:Y_1/;n؈4r< ) `0Ud]s=/{3*ڸ10UeJWjp~&=V l'=|GaS֧U"1PRţq{? mlCqG|>FDT;R0\cNa0 "1^NoߡCoH/pKKɓ'G?s!jb{;u}ZuJ^,.?z_:uVCz.oVƘq `*2P'` 99oʿx'chƌ{ `Va^nu5ίᑷrK7y,["_s?wu<~l~X/Q^#K"ޥ BD777USYOe= `0`JֿHHRUqazի6nc0 r<ߌ$3;c|Цh\qc0Uc`XsX}}/1 `XeJރDbnA}|'}+QϾ*腅آ2'[<M._8_h//=z3g6YKc?0 `m,οخO>Y^{mpX9 `0W-nx|>bb뷊P/hO93_X5Lh!">eSן~esMd빨0 `z DO>X_s?s޽{} `0 d//aOh|zwAQYeYB_IņӆOD:z{r*NDؕ0 `ȅ+bkɮbxF_|9Ǘ90 `0o~sGCE<+L[E8?N(&4!4!4!4?}?$>-PAx) $oXH/*%)m0 ``^EAK? /?uGk7?`u>O'w 2:D i~~ij;ݿ+o!ۊoY~|HJ|ޓV~A]*C"=rh?{_wܡ>0 `*00ܑp~|>[_HE/O/|_xdm,bҁo.n_;2}}Y뇒ቩ׮ D*멬0 ` 0P%sіw/%$R$$$$"|__B U9~xϻJ?X|(Ο?ߏ?~/i!]g?Xw l"1s ډTY*2ƈs `0Pz]B痨I/:͏>Q(`}D?ԧ+_x*=O<ο?oI''S՛^{/N.W~9szfI\K\c0 bpeU~~}_Eƿo9?{ɀ&oO~Y|Е.Ky^x1.%$ʈV#1+o1 `ze.\H['G(; >0zw*>BrUb_z.w|!&N'i+q `0 .%z~"1?u/>7`#^X? yGGqA|\ u}PGL(P.k7Zn;bcc#]ĭu0 ` &MJ|޿o;w.>`UdxED\i~-ɷ_h0lj"jc0j V֫J|sY녘T<`?yX_[{Q/>CeE?k !~OS??W)TC|B(鷫'IjIj<0 `@X[OEa;㫻GE9`}T%أ_A|a'ݯ/}QwWzM/\LY*멬}&0\HqL.]ԻwQ?Ȁ*W??????8cÇk@+UhsuOXO2:dqa0 d &:$:7 =7wU7M|ķ:`}-md$>>=wP G}Cbzؒ0 `X/kzov&}o?GH3#Cco> 霯z[֯K m1<ڦv:~bF$vbHJ[g `0A޶P/Kɱ[?@c~H>j}Q%F+q?#>c1߯W9cQ4u3MdIJc0 b=i.\H[EZ+a> %WU|_WBBG?>F|*>v]_6ExF+ tO};bcc#*Ĕ]ĭu0 ` |?&|>|_7f~P!~z#?c~jW""&~Roۉ"ϗ?Ym10 ``e?Wk}k?gՉ8>poa)~2կj$%0 *b=Y\4hvEFAA?#?Ɗ >C!S^*[^Bf677USY/kb^0 `@V T\ĺ|KFFFM|$%%SM4__'#?0>_ѷٷSXOeU,c0 ``\tvEE > >OGQ|GQ|dz֯dk6YmD$W-Im0 ``UHEB>f* 0O?+ ;οjjjjjjj|"\GzI6sE/d&0 ;z.o~d Ћ_ ______ 888|0`hs!֓^$b0Ue`Pb:!!G%$$$$$o'_~/ ~iif& OP]Ey!c\PFXۼbmm؈'*b ?s `0Q+*Eη.]TV7BxxxPC]?E;=?wI&w4o[' `^׬>؇NL+> >j(>_eT֓ W2b 0 tZ^(/FEF.;ux ?3?Jȿes>hdggggggggy umhmnnz r b0 b=7W$~OKKKKKKKjѽ $8{PYu!^Qz^>c=0 `@\N#?cl"> >((>(>#>4 4id[0 `[ zoi߆mY?3 #?cA|A|F+UMR>{B?틟bn%P%0 `99=G#`죊!?#?Fϼx}ĎWI|ħS"ڤRЯ,:('?b=y%/0 `@!s ^Mv~Ǘ> ¿$W5o?D!~ )~B[8 ^0 ``^ ,.b]ĺЍЏQ"A"aqVԲ???!` 6n$7︣X[[+666~3V_u `00J"E0a.exE'...." 89999992 >رQ /HZe=[Ub 0 tF^xxxxxx%$$:h''B1B1 'Ot?9ɝA*^0 ``^ Ԋ8߹r4닠DDDDDDD WCs '֓ W2b 0 tJDDDDDDDDDDB-CwUUqw?p7t62Ymd@ж0 `b *s|'%%M0%"Ut~CH^fI[FsC'|p3Ɔo `0pb=0 `0 `0 `HܕFG5:7_2_0 `2@Tob0 `0 `1pI:G 0 ``b=v.0 `0 `0 `H5b]+bִ{0 `j70 `0 `0 +^左50 `1@ 0 `0 `0t #@ p8ake0 `b=LÏ0 `0 `0 `` je(RYoFio `0e1@es `0 `0 `b=b= dg834g 0 m3n1 `0 `0 ``U P͸ `1@Ucx1 `0 `0 `)3@G H)黠 `3@~pe0 `0 `0 `X6Z TXX|>1 `b [<Tɻ[7c4va0 ̓b=b= d<0 `@w Z k `01@7̝C7|Xݻwɍɏb01pL|60 ` [\\c0 ``q -nsl]e/T{ $1 `RXʇ8bʦ~a0 ̖b'>'0 `^7!5{x'mם?`O^0 ,`jK"[ `00>z0 `^רvtb}}`/Ӻ:b0 ` _2Tk0 `dX|0 `rdXpoy[{qA7g]b0 2d`\G0 `Hb4׍Y7 `0 3@Foۍb뮻?H'O&W `B?lڍow8SY<Haޔ}4ۇ92G02@ᦓXoFio `0e1@es `00O5 B~m= `002d1 `j0@̞30 `1@y0wV~XOL0 ̝<6޳C,0 `X Vcٳu0 `X50?Ԋnfb=ys `00wL{Ob= 8c0 `X#c0 `92@ypVwXOr^0 ̝<6ޓX0 ` ? `0< s]mT]w]:90 `;seoW=!v7fc0 Uޘq `gX/5^ommIˍc03,c3g9θa0 l3@0 `rdXXW{ 0q P1J30 ` M\7f0 `0Pj\yO\a00.zzȐq 0 ` M\7f0 `0@b990 `eP+Czg `0 :g `0j y0Oyp=q ` a Cu^/x`04 Ks؛u0 `@=zld6Byp=q ` je(RY#x=f0 `@ 륹nͺaX /b3\2wl1Y0@Yp4zWW0 2d`\G0 `Hb4׍Y7 `g`޽//>Л0gXo9]`0.0@zK>0 ̟b1104سgψXo&.iͺ51@&F&i'$`00k2"(f(0 `@7 溰 `` - ؁5aX?SzWW0 2d`\G0 `Hb4׍Y7 `gXoscs ̓b=|̓/b=\̓++ `eP+Cz1 `dX/uco  ֛cdX_XW{ 0q #@ ^0 `i2@溱7 `` ql1y2@yEyp=q ` je(RY#x=f0 `@ 륹nͺa?zcc `` k|j\yO\a00.zzȐq 0 ` M\7f0 ̟b1100O5p5'0 `B Z*q: 0 `Hb4׍Y7 `gXoscs ̓b=|̓/b=\̓++ `eXX20#z0 ^ެ03@79Ʊ90 `2@PKe=`\G0 `i2@溱7 `` ql1y2@yEyp=q ` a Cu^/x`04 Ks؛u00?86< <"<0 ``\2j30 ` M\7f0 ̟b1100O5p5'0 `b=b= d `0&zi{n@J ŷ"ʯ}Ǭ?g3<32cǎt3ŗ`93@yMyp=q ` je(RY#x=f0 `@ 륹nͺa]g 曋__ uA7ɘ9mzQ90|}$c;d M6ox7b=\ `00!]p. a03@79Ʊ9VᄏQ8s5i;w/4#Q8cZ M>w;b=\ `02jǹt1 ` ֛c@ 7xmm-szqMU!}0V>Xz؛{zWW0 2d`\G0 `Hb4׍Y7 ` U+j+?&v -szJ {ls M?8Cb=\ `02jǹt1 ` ֛c}0/رcE zߘX/b"0ν{AB?۶*c$00p5p5'0 `b=b= d `0&zi{n@:^-઄}x9ubq>WG$V=wz N)0 `2@PKe=`\G0 `i2@溱7 tX&$cX녾*zMX_l`3@6azWW0 2d`\G0 `Hb4׍Y7 `k E}NX/T;w\1V=R*<{*1@yNyp=q ` je(RY#x=f0 `@ 륹nͺa]c`Q"E}NXmE5wwumF(0 `2@G x `dX/uco Ǽ~[ߚmQS%֛DWU};~ֵȅb=,σeb=\̓++ `eP+Cz1 `dX/uco 14¶-sz= Ldy#0 `]`XXqyWx^(PĈ"ct B E "CPJl@( ؉ vhhX]5] tWy9_W1С-L.! 0 7 ׾9 0p_[5.Vpݟ`׺N^V[ZG=ˀ^_j+E`m@Pkl@ޱ,j 0 0@[zm_G2Zn7˗uT.=z惹v֛oW 0 0zz th` 6x1 0 c1 @7raCo׺{>YՀ-l q•sr 0: jYYDP;8```Y7M``?mIhoj{׸qq]l2Pf@Xx'aK1 0m  1Сf SW`ؚa=&fR{d`bռMη_cuQ[?_hm@XƄj9b`ZZX8z&[sM``ֻ~s`(^|ShtX-oNߴ:ǣpv m= a=z^xf``ЀIyک 0 Ƌcya9b? E־s{7 lǀvjӸ'g`k@Pà; Mj 0 0Pc@X/Vm׈qa=װ1p;z qճo7 01 '@LJ```a=~^~``XA/^}K#Z%nc@X6޻wa=z7g``: jYYo$N 0 0K 1Ԑ3s N~_֋ͽsm{; lÀ6x7i`i@XOX 9!1 0@a=fj8X??.]k+vιkZw.a qus`o@Pà?Lj 0 0a=p1\/_JXoua`QƃWv?L3 0Ozz th Yԍ`j 1Sk0?\%7:ziݹxbGp.G`ؾAZV39 0 08ZÑsp?Ï wka_s]:q/zc{3 2 V [z\p\1 0@aY>^XDpms 0 0pzw; d7?EߋC{z߯~9yk]gq8u/<р- q•sr 0@Dx```Y7M``Kb%!pMҦzw^:zזƗ|z| qe|0 0[0 aPz&-L.! 0 0ހ^>X3@Ct硽Xm/V^THox_nUk]GXϘ}̺?Əb@Xօj9b`Zzz thv"p 0 0Ozn 0%=Vsau-/mᑁw```@PàL.[\C``a}̱>f =V Ŋ{StSa@XouxjofY`4 '@L}Nꪮ 0 0pi@X  0vl^|r2wk^'\67{$>8B;?z SFE:vZ€Vʬg2d1 07 w>\3 0 0ހ^>>ca}ʅu"({b#=?vz?1_nqlk; cC& P?'`ػa=nXf`H W^r.^|yvy {qٳV<Çe?uNa=a)#~C-ԢZgrarr3 0#} 0 0 f{gzp5'w/B`Uۆ'|r@Q('wT{FuNzz thddj 0)z\``р-\ al -9͵A 0 aPzɝ``QgY``f@Xj^z| v-l;rzzq!ЀI|W`l@X=v~``rh1?՚apo'{~?Ghg: gǙ> ݀V¬g31 0 À1l<3 0 0 1¼>\Oa=[C uNa=akYss a=a=:4`73 00 w: 0 0p4z̷0/WkbV%a |+2}^q'ORf :?ww],o.,냸ӧO֖9u᜹~kОZ{Ͻ?j4uqZq8on_^{nrlar޹ߖ5o]'篟>4 5 >F``u ӏsNa@XOX M 0 01 Ƴ:3 0 ̀- Ֆz灶Tfn'BB M[cϗ9ޒUs%s>wt: juԲޱI]``;Nkf`8a=[xۇkVKcxOIP/X%ۆurA8Wj1+clU5rϞ=[rjk%x`gNx2K=EͶ˭8b~^26re֬\yʍ%lt}<#թ: 1Сt?Z%[IDAT 0  0 0@nZXo7U.pTXo*Y"<U}S+쭽X.HAx^0X0m迸N }M:/k,? ;Qg=c+]XtNύ\J|1vdzԨs-ZgXkp``mv}a```ayx a\'occ&Վ]qV>˅ApXm(Lcằn ?qմ%]gcO# مҹ=׆hG:犿[sҶˍƹOm+=էZĘL_֮8YrNyN4f@XOX M 0 01 Ƴ:3 0 ̀- a\ njђPɶ9˹TjBAc+mV~* ȍmZhvmɭVȒc[׎@TLƼ]2JHnMrL= p^x:0ee=D 0 0p zǨ 0 0G3 | zpfXol)cS%A\PdTsN4n D.7]Mjjjtj+ZwS8O@IPohGwjݩqS㮴&cN\׎6wϝn_cCs&a`g@Xo53Ԍ``iz}Q} -[ThhXJV$kg.U{omeKMszضù~ C.`Wb}c[Kdɩ>eNSs``z}xTG``~n@XϘh1&jͰ^J5)oz-Vڟu*<6we\ t R̵mͶĹRFzc :)7w צT8pIw7uRsZg``a@Xu6ՙ``hoa^Xor#l+c͵ǰ^l]Z]p* ypKIkqƂ^ᾩ |SD/Yq>Lì0``c;Fguf`8a=[ۇ\H./"xEfI@5zsW'6l MzTsr2- [jW+<[XoN}]p銓-ι:NZwAlVo``[{^``z6 w zp$pV ks77me,ښ{9VuӖk/_֢)aϗD/]qrj>eNSs``z}xTG``~n@XϘh1&aa~I-nn+T-51' 6-^Ysjzs[J]Xdrt>ڪAZV3lu.6``u ۟|O``a@Xoum<Õ: z-XOKsV[#4' Qn/%`iԤT-nzKzQұƊ%5wyR黭cC[`Î`hk@Xm``a{ޅJXo~rن_n*8ennnkcͶ, Kh!WdKNm[s;~|ݭ juԲ3 0 \ǀug 0 0u ][XoZj_s9Ag5~ere˭pSיۜ\w*45-[%/{a5\#:_nxz>]N@Dx```֋ 0 0 kNկ~}ź 5 VZkҭ:gkra8גٖX]mI[jߛZͭ&{X/J17ed'k}r>eNS: jYY~ 0 0Їí:# 0 0 €>! E)BRsF.06|ځaXu5&\P4 7 ͩ.aszq[rcmn2uu*@zm5uv>wЀ[}՗`z,``` LF``u ӏ^:rk!1Cϯ4dehXmO}!\(-DZ`%:ߣutm+k›'qޱ-/jiK!5s5#cAa|,YqGk0ee=ɵ'c`a;``؟MŋPQza(d rzѶfKҰjr5}6xY^Cn;˶u_SmYd n%!胥c%_awckjd yogշ  1С{81 00 : 0 0 TX?ֻfG 5V%ۿSSXɬ/ - <={o4)bw*5<4mx:"vKa5j]p> t>>1$u-9[XrN``mv}a``ewljvۚ-7xv,ZV[#FX/5l%a[#퉕jۓZ}/Jp%[_3jqZXoZ/#̍ae¥>om@XOX 8É`؆amxP````=z4{w6Yη ܱywwS+y_";Ц-]n]Crֵelj Rŵ>wJ;&!̩U ѯQ%}pޖ8_5s;owKan?/D]Z뒶L[]嘜j㳈:Sε M9S 0 06 m.Ƌ0 0 04ApEfXXe0uͩ~[zΥAԸVy_ϸk8~2cC&ζտ 0 0z,nŢv 0 0{0ŋɰ.3ߟ2YMXt5=ȓ]Xχ^f``yo``8}=zHGg^3'$W{/  藖"ZWj 0 0Ā?Kx/? 0 0 0pDwww{M>3 _.~^zfb`@G{^j7 0 0@aK1 0 0 ?x2/|wߧ3?@^j | `"g  0 0_zqv 0 0 0 DduǏ^z%Ɵ{5ɓ5^IGnc@XzL&1 0 0pmz]ۜ1 0 0zӧO0:>Ü VՋS@_^ uRX>Xf` # 0 0 0<b^lu[τ1:Nؙ7v~;ϟ'W{pĉwo,j/ 0 0<z7 0 0 0={V֋@1o0q ɰ^8 W:Lx N 0 0/z^ 0 0 0 |GŁǏ3:~T5ْ/_`` ח\K```ӽ{zC;};Ws±W`V:(gh5a8/[ 0 0 mƇz0 0 06 Ǐ{Xq/^b6~ 0kcCkO 0 lӀ6b  0 0 0_^햸S[޿6wre`ހCV/~yW;``zxq,/ 0 0 0@XѣG[Ne:A?'`рqrO 0 0 ```W^^IXemjf,W`؃AZV3aFN``!````gVz̙w``ЀIګ= 02 wz 0 0 ~ {}ُͽ~g`nk@PVֻ2``kcZ\5``8ѣUze/:c={60 0Po@Xz``h@X=fn````"PwՃz^6{`؆a? mcpԁ``a=Zs~```bXoW{a=8qϞ 0 3 Aay$``f@Xٽ^f````^zu?``QgY```>}Z{p| 0 (>/ XZUsQs``Yw]```u |UAXIٳgBz]; 0 0Pm >E mF- 0 πjn9 0 0 0t޽o[[Rw 0 0luX?[5\ 0 0 ǀy````;"+ 0 0pzCXä 0 0p zǨ 0 0 0@}QQP/}|^߫[mƖ~կ 0 uRXϤgc`8acxVg````}{뭷&_?}wz~j\?>e``ڀ^, 0 0@8{``naޛ ַ/^[sMs 0 a?\ &x``c;Fguf``5_Nbս>LPRuǓԟ 0 ^ 0i/``cwv]``GM}AG;61 0@Cmg`8acxVg````=_dP/Vo:XZo,K} 0<z~֛7L"```oݛYe``nm G0?w_}ukoo+1Ӈ~xz7O><=}9˗_[5`Jƛc[0 "gr 2 0 c1 0 0 0З-pݻw0v'|S)N/~zr'O"eL5^0y6~o{o0Ǥ%jen1ݻ_װ>h a8^}``2 Z%``8Ϊz;n41ov2 <.B62yo ^s QTwj{g|@a M֫&  0 0Wzծv 0 00ٳɰދ/-6i"7`y5cGamXmns[\[ ۰pi@Xo6Ta=}!g`؇a}xR'````ѰO^UJ5ιS}fGcXAӧj؞YXψm^/\&W:]z~3es3 0 G```hX>XicFc*txE.Vߋ0Ho9^%8Fx&G3-7/1 Y/3u:ܚ͹NτЀIIZ-Ւ` a```(7p޽Ѱg}&\ͦzTt65\S ה穰^s8¥[r>ﭳ[0f%2g>{ bTXo骔9_/A }\kpXYo[l:2 0 \c¼ 0 0 0Pf 9}뭷F__|F;mFV+ ФƳgFWڳuex:"w½Vߌ^MC{a;=޳GXo#8|zkq.~``O+b``nk/dX믿 fi3[ؖ[r~mb }+W}cUT0xn 8Fhz[a󕰞0nwUa`5 '``z6?q2w im{ܖZk4ͅz}Hm5.^gfܾ̚6|.A |\Lvkr>``mf]ua``g? 6֬Qjv5\w(9FRlFXok\zOG^szz thfp# 0 0_zqv 0 0 0u L>|0/!QSǏًڄp2Ϧ5^Y=.=s~ޚH딚:MYv\2hjzokg}CC^οs}Yv\:%Lz|kԝ`8#?`կ~``8nЀߝPsa>BKssx. XxHvDHc>1>R>-І{zW 1С㲉Q?`؋#bU?N//} 0 0@?~V_w>\'>s[^K;Ο \w*A#h17<2ci@$LVSTJcc[ƪq% lsۺssKMyg*kThhEnLԭk.5K9!;iSd`=tNS``ZzԚ)9^XoۮlE[Rcn "aQ ŵp]Ix?%qY!PᘒPss- .9gcMZpx.06ޟ MK\on@8uy#u|m^j#׿k\TX/~>u+ƹB׹9$<DZl%aPzD1 0 ɀ{򪭼2 0 cJqzv LHjL*Wm9Ј:Y%MJ:FjuWM|Ku9K9֋>{N*e!T;J mKglu{=$A-ʭV2K\/ukI?[lkz55BV87=^^iojj 0 0800 0 0Уa=[۶\ZaFS+"jC`>ws+5_\ojl55͵vyrZrαYiPohW.@65{ ei(nK{ڋcohnEñNjasTݹZ6ƶ-Yƶc~ncC&ζտ 0 0z,nŢv 0 0a=4KXoۮn]*47\WP*Os;cmHkJV9 ծbHoo/۱$XwͰ^I=;ygKm SkvלZ켟r[N[S[ic0ՏS!vSώQ8;\uΎ%aPzu``j@Xݽnv`` b۶zK6s;S,B XT(a% AKa0-f*8l[qI0m[;;_J˺9&;wv8'5_G}`X׀޺ɧd```Qƃ޶] >sVK3VCTpj0T|e9OeVV;Ju+qS֩ZoxjԒp?8l[;8Gf}RҗsKMXoj͝kyaɼ_Z_6LF 0 0a=ֲ<,1 0 lɀ-< mխzV-B#նr֥Smgz1f8ga9uO, :]s)k|Xi4W q*XwsWOKӆZԠ&lXҿkRu*xcm8]s>Xӿ޶?Ea=a=:4PPt'h5R#`2 Ȕ?g```mVXoۮnK"2xk[r+,厏{ZBi5A?WM+) F˜εv(gn`(uܖScF;cE^d[\pnje\H4h7o8_md~͝3U.w)3Kn˰T?yg,AZV֫&} 0 0Gzѭ6s 0 00e@X)#s~.mWJvsLgnPE86Ԗ-n-c&SQLR}"anX/Yl sK+퍍2껹[N{`6%\?ޜq>w> mŜ} 1СkM  0 րm 0 0@zm^jlukM.JB\i5ܪs)c˭7ԨU\r!wIϯ_SRKι Zszm!8-yԹ[WjkM]ug``a}|Dzw[1-Bg-F8%zTu[r\X/6Թ[paն{]}ks6/9VV֋WIkj8G+5Y:h.Z-/5d@sZa5\K5eKU,l%'@L'E}```OxݓWm``Ԁ+Vj۾.YoecKʚ`.'sע?- Smdy9KZ6؋KVpjVK% cS[Z[#c[O3k6Œ{y]aNYbZwA\0 02 z_ 0 0@a~⩮r!m$9*]ilesiVKw" [oN?EĵѾ59Rcw?VaV+u:-٦9huV -a~jk]a.iHXOX 4 W`e@Xo[0>ԃ``u ӏ<*fҭw6~+ Ѭ=OhcɊc%F^K.\c^#yksץ]kaĵz@-L9XYoSJ5%juԲޱq@w  0 0@ 0 0G7 g zp 7www?X>r`yr*xS폭,SᏩhS5p\3F ko :'0t1TklԮisV05:uїEjzcݒܠ}?"[CVjj 0 02 Dž`` qµ>\jXYGncs{EqS!k5m0krRX^c-kT`yĥ=Ln֋{j^r E/=X:1x  0 0zN 0 0 ֫/KX)HZ۝Zrhk\& *yOsW[ ծhY~_BX/׆[׶"}_k)uܖڵ}[F0KmOsW{='֨eM-י͵uyO[yKPà$ 0 0 1w0 0 0@ʀ-ansaۓᵜp]ej6 )^Yc0]M\UIbi+c&s>s+`=&k/KUX/o*x76g؎uN(缏kCiS%"?Sl鳲VA-+4h 0 0@;z[} 0 0 ݮ{v/_Wƨ Gm" 3geq2N[4, ש_K2v2U-zq%9JC9;Ms*9VzJ[m^idĽl-;fbXJc.烒kV"΃S[߰_g%cmC%}ᘺYzz thDX7/ 0{5 ^j7 0 0ch1Gv5a1 __[ \Sm3;?۵pZ#QƜ - ʙʭV\#h@T.5lڷ$_cA"$3'.4#=k/}5* 7 }Xj~QSZ.[\`f9> NyŸZQ{~FcͽV}Ep_:۵d^_̕+MF&>9sxg.a=a=:4`>b` q܃c1 0 0a=&Z zExR9algO>nW5Zsl5_vV'@mfr+t=0~枳}p[rz~j=޺5vlSR0eec bz3 05 wj 0 0гa=[㪅ڰ^68'۷4ږx^ڱj[*k``Ѐ v: 0 6 Xkc _c3EO[oSK?M-[KanNX>jjOLny~z7R}d{=Vsk:L\O\q``?   0У_g?{?XGd~b%Y'^a=Z㪅=3(MCn5BKu>}Ub#5۵6 '@=3SxWs5g`[UC=`u zwGwB?߳ǀ^?Ҹ㪅Ga=Z9Saoy>8VςZZg"  _^KW) 0a=¸`z4 u ֫/KXx'a⫿ʅ殮'$W{aONzeX1|>0W7Wk*'@Lt&5⻤(~VQ|a4C{7=%G7AZV3Im"~spST.{F鹿[/f {sRjֶfW2пakl1 рGtgcBXjjoLm;|o?(#olGG~3՟w{sGЀI_|@ <>^cӧYzL]Ӣk  0Уa={tힸf΀^]U_zeS]? _}W|G4ث.ǏZwlv}YO3-0O<,t|n@Xލ?8acxWw87 C9AXjjn\$U+wϊKzz thdd@Z&zxO,>cd8kڐc!  0Уa={tힸf΀^]U_zeS]? _h{ޣ.;5>V: jYYXؤwsaҺc}O◅Xe/^sg[7 a='+74}}ww/mq&5WJXoyr``0 ǂр=vO\3Pg@X*/a~I?1 0m  1СgۉFXoho.W5ߵ|^Ka>j+1 w~]3m _~/ - q•sr 0: jYYDP;8~f 2ɩ l@G[cV\=hi@X/a@XouxjofY`4 '@LLkS*$L?fPKa=T9݋a=VbU;Yezxq,/ i@XϺz quk  0 AZV3MX3.ꫯN߇~O/_I(0Bq['}r~O>䧿o=^Svv K Q[+>߭S_z>/~?88Wk5Ygckc9a=ZrN``ր݇a7؉p^;:z7~E'Oto'SlMk="91wqL]wvp%׎ ]cqT py)ZD{\kxCSm/=˟8{_Hm]amQ׿>oCP,~,:aM~lxnn}}8z愹漏#㾅{a=ZrN``րVA-+j'oẵW֋T@/̚m|#(akrk_#8wLͺ~Mh1e2.59K|jksFK5xqjpg[ȱ};j#z_- D,x.eӟuzޱƱ9j8sy7G5 ~ z\p\1 0@a=a=:4P;8~-bŴSqzsÃѾT={ qڗ}[;.'p%+Մ"pȜ^.6-sV^ CX/jwnER7{*,= QcFXu6ՙ D& M]#~~댅b@pޒ{zr8s ' a=cX㪅+`j juԲv"pvͬ֋0Y*3'68Jmg:mW0֋P՜0vhwo/}T[s)WQ`MX/ں$@x%FJB5u6Ԏ\X4w֋{^s0U8fom[;N``-j[.7l ԱwSuޒ؛;_얄!k?s2h?7g0 1¼W-\9'W 0 0Pk@XOX Nc͐N.(Tg. 5jrm z6űlІWy,4U EDۢWJCbb?Z^|AuyaÂϏUǂzϱ=F?D /v6˭d Q}斵-pkώ>;X;Vof7l,>ZIXZɅr!D-^6Ehv,ZpՄZg8o\X+`5 aPz&ډ5VX/b ɅLBCrA0Td%[ڎJ\.d[8f,(VRK4u[+T{l7{~W2ŗzc+3S`n 1y9 vQKzL`bԖ۽?5fZPt6GsrkV˭MX< -ƆW-\9'W 0 0Pk@XOX NciX/"PTE8Y#s*TXo |\,lQj#W=OdZ@ڜ㦮{딆b56sapp悃SAӟ&W3K<;cya=ZrN``րVA-+j'oL.wkcxo.4_z#뜭3s6VT[^l-c} [ l.=Mlir,76{\o{>u^?sDm^56՘ VǍm;ӵS֫4}nI_;;B%0jzy'rz.U W 0 cCZE.%E(^uOvk]]-'sCPlLԶUjC} d^zǹ շ$7]Kֽ-p;ɎW 8T6HVbZי 땮w~O@cJ;V)my=K,:#㾅{a=ZrN``րVA-+j'o̚a 6w^3޼gom[;N`` ]i׺Ц*tszq\Hn* wn;-#7ՖZ9cea=ZrN``ր݇ZaaԊoKi\\Ѯk.r0Xj\ knp_箪jsQߒ pZc+ Md8CS>'Fm00 Hֶ$P2u댅nAԊvS\ȯ,sٗsb{Հ- q•sr 0: jYYDP;8~f EhB 7f+"ܔ5bȭ֗kK. 6g{k=V\/kI_ $9,~;Tm[jY:K1}ƨM룎ƣ:2U"ﵮM]knX/w^n5Xqon cqn{g`_U/a=bU;Ye`oz+^߃vKִ\?<^q|n {-Њp]AKj5\.^\+ 1N.ek/ۧ[ ўܘu1glےSZ5{?;XXX6՛RRa%ϗ̆k^:[ 7ymE[ q(7 WW\^y_q``vЀIݤy]-~VZ֜Z/;MZ"UʚSR;Naj59?of-uVw&q2nj ǖu\?_-W3L`_ɭ^C{>[u^^OX_{9a=[㪅+`j juԲv"pv, Ex' ] cMj~~^*έ.%-Sa8oI`|`d{EXɭr8xl֋67i|6z}xTGX@j%!wj{sys}z; c@XZni\ q%# 05 '@LLKCaJ_玮֛FXPVMXoܢmKV-qKWBȭ okNr[f`7֋sD|qmY#,Vʪ E56SX5Ī }\_36w’̅8BqT=Sc2R-p̨u>lQGQ``mC{Kvmua=cb1|L1?zƙW{p2 0пa=a=:4`g^ JmE[ޒFXM>RXon˗ꈥ5uXoU#;S5/7~R\6kcyF6j):[5ĶS- Ž}a=cjcJdzGr-ՑW`خAZV3M5zc땶gV鵦kі-r j{ϱFfk$u1Ӛ ajkT{V~yv mƅZ0 UKal5ZGO-{? 0Уa=[㪅+`j  1Сډ}x֋VRڱ5bH<6mlIZq-VXz-KZS\7BL5l-m֬^wkX]S׹ \w{͘u: ~d`liK^Hx[Gzkxu,/G7 g z\p\1 0@AZV3N߮HUJ Ml-Ml_*4vO>MJÏcs ~ka\2V\pyc ]^ng0o 9^mWs\`` +ͽzګ k_(Xoa]X+`5 '@j'oVX/j:WJjjoS57@kKZ%olKV{ne#B~ͭ48>$v^Č| :>wf_͌35c-ĥkun[|Sܜ -=O-x 0 U Wz\p\1 0@AZV3N߮5zJfO{  g嶴O׮WKb%<&uS-n-7'lYW`s }VjS-l6Ǭ1n; a׿kXMnscuƸ9};_s= ػa=[㪅+`j  1Сډ}x֋:/ ڲv5saX6wwww}EP1"ǩ{ s - ~jXjd^.:7ùKz9lTf,:v9VmUo[``Mkrms99+RpݜժSa>a=c{ͱ\<5f\)AsBQa//u*arA]j xJK^.WcUrc=-TmڵèE4sm+#k,XB<@m&g@X  @"A?OUw" t_{+ak_[<he)C~Ƒ ¿W-\9'W 0 0Pk@PàLkf^.HTP.J.;0TIXoi_q\ +7xm:\c#EOɊ8W{r+ѕ`^.( 9FG{ٳCx21ڋ6Ӎꫯ&l\;76.z3aQa=. 0p\:|79TP/Γ ]:[ E9^Yyj~N'wqlW{CX+`5 '@j'o" j{ R;Uq?ߏJ,dkv!Ove*6 + jhoަjFXo*8X5pMmj|u(Ema> Fm a` X-a+.[}Ru]S}>q#LZWX 1py@Xͷf`: jYYτg@^.(R;m[j][/ƂhS]=J{S?yiP$Uz%j  jRMqX ֘y>k)Ϻok=_]om{l9alsV=3 XY΅j9b`Zzz thv"pv-zQ6%[^b%˕R[֦l[Ζn{~xv%c$?ڗPePpI5u_ce5U֋smi[[b+MVX:J;f 9fmYw]``00EkIp/Bd% ]:}qrk?uR}9;ױs4z̷0/U W 0 0ee=ADIVZ6;Ҝտ=sb ֮\V+mSa=k_#Zaql'[3[(+앴ts$|՚"kq~l.Ɯ1M޷Sa~ji\% 5a7U+Ex6vD?uK(k%XXX;ֽcya=ZrN``րGlAxE6\o|Kk\Sf\w%aq0]%ڱ~?Gў诒U,uKqKhDtVkQ:ڛsfk~>Z⽦l9ƎU˔a=. 0"`[?[w~-U.Ƕ^a۱׺7s9z5 v z\p\1 0@AZV3NgfOjz{/m5aj5]6盁v-``ֻ]^X}7`؏a=a=:4`$V֫3Ύga c?v]_``z5 v z\p\1 0@AZV3NgfOxݓk5K[^ cl2pzw; 0 0m ߣ7 0 lˀ0nkUu!nG>|^ y׹a>qcud``cBX+`5˻v"p<3{2 랼^̻\Y/ʵ:%3 w^3 0 0΀^=[a=߽ 0v  1Сv&YXz)ӧO&O<};a} 0 0@ڀblq•sr 0|xV3NgfOxݓk55&bk\5Gno@X50Ԁ`` ߧ8```@XOX larVjek}yrU~[Xg\Ke`2 Ȕ9?j`6Kijbڒa=mya2![Uc@X:̳~f``G-QO`ضa=a=:4`ī>#b7xg/[UccV= 12ea`أa=n[㪅+`j juԲv"p<3{2ɓy@)?Q~X'd@XXsgz3 0 ŀ- q•sr 0|yz&ډW_}uۮܚ^|i,tynM##w}_e`8a=[㪅+`j u宰v"p<3 0 0> nƛ1 0 00n@Xi1F={vz뭷wy9M[XrNs 0 ,1 Na=’I{a`c@Xo?2Ԋ``rz}Uy_gcaG u1R>Fb`::)wc 0 06 > 0 0- qG}4{:޴%4G1 0z~3),```?S+J``(7 WW\ǏGzӟ 0 00π0!Λ~c`cvofY``z8=旿hX/è=Ye`5 aPz&ډ0 04 Ϻo 0 0a=cd1rww7{뭷N}^ߛmO 0 0Ԁ^:L K'g`؇a}xR'`` _O^x!G`CuIK3 0 ʀ{1 0 4 ھ>Ѱ޽{N^{ӵ-9`Ca 1 00 :O 0 0@ak"wѰ/wƆ`h@Xz&-N6% 0 0aS} 0 0 ݾ=>lr &{v/ 0 0]zz thIWmԆ`4 Ӛ'``cq-wwwL{a=ߗΔ`\dS˙' 0 0wz ݰ3 0 02 ZsӧO'z/}g 0 \.ևjMXo8G 0 0=c``KzL1/jyݛ 6k\9e`(1 a2TX/`ؿa8TC``^7 g\,^:Ŋyo+ȍc^e`(5 '@J'yX0 06  0 0@ڀtl|A}z']) 0 0pUW_˙' 0 0wz ݰ3 0 02 ŒO?- =zHP+g`n\{~9+' 0 0 1w0 0 0kϞ=+ Ūz/^``\_bkl0 0 À1l<3 0 0 XYZ^:}A&``` z&DLkL 0 0}zۯqF 0 0 ֫#;NnqP/pߑ̽c 0 0  1С&U}``x7``ZX+vwwwo{w^qP12 0 0 aPz&sr 0 lπjb  0 0 -~g޽[ůxBPF{̉ 0 e@Xz} Rz2 0 a~```Gz\_U|P}^ߋ8's  0}C^߃֤ 0 0a= 0 0 h@X︮ӳgN]ӧOO?>ūVڋ"XqO+j 0 ׀0)wRV;c`zxq,/ 0 0{1 w<{P^*o|P```36ӐvZYx6r 0 o@Xo>T2 0 0p{z5AbTnŊ|/} 0 ls=_KXXlٽ 0 8bXɓ'/_z``:6OO_W?{キzP?>z_.`؜5/][އC``=8RX__K0 0 0pzwY-ѣӋ/|);p```6۰=|16 ׭.``8RX/\N>```]K_z<8}w޿;k} 0@z~hk3XLB```kZk9``Xnӧzly! 04 Wam60 0 m@XM9S 0 0 0pmwwwؾ*z{gϞ^```_:/AhT/``ؙka``- {?=~oS|_ZA5P[̋ 0 0p z~3y\cp ``ֻ} 5``````Rzz thtp 0 0oz~ 0 0 0 0 0 ˀVA-+k՛`8a޸W{`````g@XOX 71 0zq=0 0 0 0 0 0pZwd 0 06 ܵ͹s 0 0 0 0 0 7 '@L'E}```OxݓWm`````: jYYv 0 0pzźd`````zz th=x2 0#} 0 0 0 0 0[1 aPz&L0" 0 0ր^W2 0 0 0 0 0sy0 05 7j 0 0 0 0 0: jYY@73 0 À1l<3 0 0 0 0 0}cC&>&huTG`2 Ȕ?g`````0ee 0Z0 0 4 WK_ 0 0 0 0 0cC&u'J?```ܪMb````` juԲd 0 0p zǨ 0 0 0 0 0 a@XOX Q```ʀ#SF`````c@Pà3Lvj 0 0Ҁ_-}97_ 0 0 0 0 0 k@XOX (ם(d`cs6M`````^7 aPz&; 0 01 Ƴ:3 0 0 0 0 0Їa=a=:4`cVGud`)zLsF`````؎AZV3٩ 0 0@Kz||1 0 0 0 0 0a=a=:4`\wԟ`j@Xͭ.6`````x݀VA-+Lv 0 00 w: 0 0 0 0 0@Ѐ ZՑ` 12ea``````;: jYYo;d 0 0- җs 0 0 0 0 0Ѐr݉RO`تa=6jSd`````uZg31 0 À1l<3 0 0 0 0 0}cC&>&huTG`2 Ȕ?g`````0ee 0Z0 0 4 WK_ 0 0 0 0 0cC&u'J?```ܪMb````` juԲd 0 0p zǨ 0 0 0 0 0 a@XOX Q```ʀ#SF`````c@Pà3Lvj 0 0Ҁ_-}97_ 0 0 0 0 0 k@XOX (ם(d`cs6M`````^7 aPz&; 0 01 Ƴ:3 0 0 0 0 0Їa=a=:4`cVGud`)zLsF`````؎AZV3٩ 0 0@Kz||1 0 0 0 0 0a=a=:4`\wԟ`j@Xͭ.6`````x݀VA-+Lv 0 00 w: 0 0 0 0 0@Ѐ ZՑ` 12ea``````;: jYYo;d 0 0- җs 0 0 0 0 0Ѐr݉RO`تa=6jSd`````uZg31 0 À1l<3 0 0 0 0 0}cC&>&huTG`2 Ȕ?g`````0ee 0Z0 0 4 WK_ 0 0 0 0 0cC&u'J?```ܪMb````` juԲd 0 0p zǨ 0 0 0 0 0 a@XOX Q```ʀ#SF`````c@Pà3Lvj 0 0Ҁ_-}97_ 0 0 0 0 0 k@XOX (ם(d`cs6M`````^7 aPz&; 0 01 Ƴ:3 0 0 zŋo[ 0 0@_:/ 5' 0 0@΀```{wNok?~|裏N_|)B}=ܳ{0v``ccC&cN 0 πjn9 0 0 fo9ݻw/K~xp?L3 0пAZV՘`` -//ϟ{```ᄈzZa=> ]_x9&```:*gbĤ 3 0e??x /} 0 0 _N{ew, ὏?J{~wyLՙ`ƀ^ZL5cya`kHa^ 6H-}vX```?2cemwڽ;}t{;v:Ԕ7X`l@Xz&=OJ/ 0 0Pna/\:=ָ/J_1 0 DRX8֟>}ZXoFo} 0 lt_2[ߣq~mmYb`m@Xo1~ԇ``y^zѣ{ޗ_~) z߇3 02[XXn͟ 0 \πk} 0 0 ]:Ox\``Ҁ^Qa=d 0 0p zǨ 0 0G3 wlދ/~z}gNjB|}^߉mntǞ_`~ uTXjUK``1z|#``р)ױ~zgbNj{2^``}cC&}M^ 0 00׀;sx; 0 0[6 nVh/V: 0 0ҀVA-+4ZN 0 0z۩q 0 0 g@Xo_}zwVڋu{g 1 05 '@L۝tFm```Mz<ɹxb`؊a=k->}8wSW{ s 0 0AZV39198G 0 0 mFƑ1 0 0Po@X8;矟ݻW{葰^ߑ`؃a? |0h# 0 0rzC} 0 0 m&{'-n^Ϟ={ҽXN 05 Pah3 02 wz 0 0pz/?q2+ wjGl1 03 '@LTg`k\7``kcm kd`޽{^`we/e`fjZCsrfe~I?1 0 ݀{7 3 0 q[ViVXϗ3g`fjZCsr&WO<'``cxa``a=Z%;z9 0 0p5WP_bkL0 0 À1l<3 0 0 XY5?zhru/{9 0 0pWȚk4a>H1 0 `@X``. 1_N>Sa=_ޜ`\d5 tq``z0 q 0 0z b^?``EZv'Zc``QgY``fz̯m?\]N`;g`h~?L;/hz}đ>b`=8v3 0 XYɰ^lۺ: 0 0^Pa= 0 0p zǨ 0 0G3`e=6իӽ{F{~^ߛmO 0 0Ԁ^:L K'g`؇a}xR'`` _e_r4Sa75>Ƈ~O 0 \π^:7LV``?``a=ZzFz^ߛ(`Xb@Xz&% 0 ǀ~je\ 0 0裏Fz^ߛ#cD_+`c@Xz<&) 0 0pkz ڠ3 0 0€W-\ga+zw:޴%4G1 0z~3),```?S+J``(7 WW\ճgτ:^(J_1 0 z~(2ɩ 0 0@kz61 0 €w-}z~/Šs``a? 4ZN 0 0z۩q 0 0 g@Xo})Ǖ 0 l r 0 0@{zc} 0 0 ]Ϗ\X#8w3 0}ZgrT#``5 q#```klaRX+`5 '@j'{x0 04 Ϻo 0 0a=c㪅+`j juԲv"p<3 0 0> nƛ1 0 0 a9`x݀0y1 00 w:ܳ'O~_x`8+¿W-\9'W 0 0Pk@Pv"p<3 0 0> nƛ1wo7+N' 0 ۀޱj qʖ 05@$X ```[;NOzƂ 0@ʀ-a=ZrN``րVA-+j'3 0 Ӏ>f7 g< 0 1py@XkYs```̀0``c;Fguـ=vo|3 XYo~q;a=``` : jYY䲅E8d`kckۿ_`c]a=ZrN``ր 0 Ӏ>f7 g< 0 qbn㪅+`j juԲv"p<3 0 0> nƛ1 ǀy`qzH1"U W 0 cC=<``}g݌7uc@X 0z \ֻ~s`` juԲd 0 0p zǨ= .=vo|3 XYo~q;a=``` &mc`kckۿ_`c]a=ZrN``րVA-+j'3 0 Ӏ>f7 g< 0 qbn㪅+`j  1Сډ 0 0> nƛ1 ǀy`qzH1"U W 0 0ee=ADxf``}g݌7uc`yX﫯: [㿿q;/_\?j}^k5]uk|g{r͑~}/Ϻm} qu( 00 wHm5Ȅ1x[q^~``O+b mt=y_ow>lONovі q?Υ\|4twww{NG_zΕhLJ~8zUBkhe 鋱]3fǡ}\opY:;ssWmm ݦ{.U 0 À0cV'ub`Zj^Raq\ֺk_ksm^ӧOv_T~2R}9]kX3@*4tr[_FixEi,$U  F`*Wwl;֪Ya/֋kj`Sn6^Ƕ6܆|sqբݗu) ׌z kF;oRέ *˅jt9̗l<8e0LƽosտK Oz\p\1 0@a=a=:4P;8Ã`اa}xS7ndvS[l9*3pcb Qcra՜\&8~R_BnV06x }?)Wa.jqTwrZ6>ei@Xouxja`0 aPz} N:2 0 Lcdʈ3uSaMȆ{̝d8G* 8ݏyc[5[6'Ҁ_-| q•sr 0 coy\?``z\k $ՆVC+ iV+y累\["`U^mih_*TΑYr@Ym0.ږJ7 iOl;gTtZϹ~ /٠_k\ U W 0 cC=<``}g݌7ucƶ-]Q?s+nMrḱw;gIn,77Mwm+նT]? f`?S=+a=U[ye`_Z5- 0 0a= @*j=sQ7 ~rzzCX+`؂a=a=:4E<``1Zr|{V+ jEl*P"4]#0d[ג;&u!dן @\-HSu kA̗5k;?ǨAKz|%U W 0 0ee=ADxf``}g݌7ucZrA\0v%m-F.[su\ݝR>_1j-) qʍ^YosK4gaj;ޚXknk@X߫a=zf``_Ѐx_z 0 5 \;V 륶i-zϩPTz-LKWKZ*%&S!\]rԖsnjc㼏TS~J 鷩\ce`a}}(Ǖq 0 lVA-+\0h 0 0@{zc}@[-I[nhùTljVahW.ٳw.pupT7%efkn^9j 8]a-mt4 Ӛs q•sr 0@Dx```Y7MA="T+ x؊rE+pxEil{kwyo*V3εt'υ*B% LOɽzkS۟|g`]z'ٟz\ 0 0 juԲe 6p 0 7 ׾9 5"mpVj^7hKZP#Wڛ IYmesШu鱗Ʌr[SSm;_a=6%T S 0 1 '@L! 0 πjf?7"T m Fr*PTX/1mW{h3ka8mIR[u*8K/eJX3qc;F=յ͹s 0 02 aPz ``QgY{6"rǯk. C׹z{6ՏqݱۺwlԖj16RmH7S!qSB[X.Wj#_M0NڂCm`6s=׎ 0 ˀ޾e|hH \V+ "5 V;eƟ"5{ V{j-tjo=/7[qjɖܞ l߀kq$j3 0 g@XOX TM`` e@X s{7"Zll5ܪ_O<{ k{k+ ˗/F_jX]bl9y8s5kұ.`@Xj9b`ZZ ѵïqLp1 07 wj20pTj[M -on5iK6˵ߛmC.?ܬk]>X.Rc]6W?w zܵp'U W 0 cC=<``}g݌7ucr۔FgN,w`Q*H!%[qqΒu[R}3bj}nk"xRtK}nvNy,}룎[z\mͤ0 01 juԲ1I\``;^͍s5@.\^n ӱ-pDцX!s":gs ŒSựX?]˭(SAֹ!\g4Z>#f@Xj9b`Zzz thv"p 0 0Ozn L7ធbTfu\p08ٳl[J%|=x=_"W}a}hw k~:ORBSG9֋ws9/=U>aI-m ݦ{.U 0 ÀVA-+c$Չ```a=~nm`lem9c\[#@ W77h[٦čQj;6+aXr>'{A:Dߔr+-n{o#_r~Qhk@is& 5{盳uR9@;zn:? 01 '@LۙdB-``a=Zrna26bÊonʅmtkל W1֖ڀS^4=ޜ[yhoC7-]0p׈kE`vXojšku[sTmcƛ^MwI0vEjƄc=Khc@XMݫWG```Ѐ v: 0 6 XkcXkϞ=;E)Izi28v+hpZkXUßq\۰]_ՒFEІ*lsW,7ccjq%ׯAXAܗ}c#T0Z7W!}Ycͩx62pzyh/ 0 lӀVA-+msՅ```mzLmbOZ EiiVqڧSuUW87 C9AX+`5 '@j'{x0 04 Ϻo6ڶ6vK!RC b~㪅+`j juԲv"p<3 0 0> nƛ1 Bu[a=~`@Xkz]ӛk 09zz thog`a@Xu6ՙHn^|K 0Џa~jq)Ֆ}mE۳7Ϙ`5 omo9n?`Zg``a@Xu6ՙoO-k#`E.'|S rsߪzNsF`Ԁ+VjƋcya`V@ y=``mV=`-xI2d7"l]BzEom' 0/z^ƗW{2 0зAZV{К՗```0 ǂ1ގ,|Ϟ=kl9\kcjmSq>a=ZrN``ր^&g"  0 0Ozn 0pK! u4Hz j9b`Zzcv"p<3 0 0> nƛ1 <][Fӧz\jz,j9b`ZzÚv"p<3 0 0> nƛ1 |WxE?O>_|)#nѢ6#` qb.㪅+`j ulz&ډ0 04 Ϻo 0 0a=c㪅+`j  1Сډ 0 0> nƛ1 0 0 a9`x݀VA-+Lv 0 00 w: 0 0p4Vcya=ZrN``ր 0 Ӏ>f 0 0cDX+`5 aPz&ډ0 04 Ϻo 0 0ןs``uzz thd 0 À1l<3 0 0 XYj9b`ZZg"  0 0Ozn 0 0 3FZa=ZrN``ր 0 Ӏ>f 0 0z \ֻ~s`` juԲd 0 0p zǨ 0 0G3`e=[㪅+`j  1Сډ 0 0> nƛ1 0 00n@Xi1Fj9b`ZZg"  0 0Ozn 0 0 1py@X}ι>g`^7 '@Lvx 0 01 Ƴ:3 0 ̀oa^X+`5 aPz&ډ0 04 Ϻo 0 0a=c㪅+`j  1Сډ 0 0> nƛ1 0 0 a9`x݀VA-+Lv 0 00 w: 0 0p4Vcya=ZrN``ր 0 Ӏ>f 0 0cDX+`5 aPz&ډ0 04 Ϻo 0 0ןs``uzz thd 0 À1l<3 0 0 XYj9b`ZZg"  0 0Ozn 0 0 3FZa=ZrN``ր 0 Ӏ>f 0 0z \ֻ~s`` juԲd 0 0p zǨ 0 0G3`e=[㪅+`j  1Сډ 0 0> nƛ1 0 00n@Xi1Fj9b`ZZg"  0 0Ozn 0 0 1py@X}ι>g`^7 '@Lvx 0 01 Ƴ:3 0 ̀oa^X+`5 aPz&ډ0 04 Ϻo 0 0a=c㪅+`j  1Сډ 0 0> 1ϟ{``:67~_[K[tM\2 0p<ZwlVs``֋/ 0 00 wu[Ol9/[ 0 0Pc@XOX L``kHapK0 0 0п߬;վ+c` NXY$w0 0 0Pfha=.\' 0 0 n@Xϸ0.o}/~W{t?- h@XGɪ=q 0 n@Xϸ0.``` Lo=_-L8a?t o ՜`8acxWw```_~yB[>g @wֳmja w5 '@j'{x0 04 Ϻo 0 0 \_=~,j *zaXmW_b,+ۼiܓ=z&R+c`طa}S?```z_|/7 Ƈ~xz7zŪb+_|n._æ۟QxگW{}}lOCX+z&=MB+ 0 00߀N1 0 03;6."x>/J}jZ:[jL<8w8y6V@[SFsm26^& d`[?```X~_?~,ZVN ],BB|.ß |Ga&Nح 2>1>թN"ײgSY-s=#jz£<^{<f HZrN``^M5a``k/ }MC/|V劐Oװf} 5>zmR# [nss I9z,q a=a=:4`Vc5f`0 ǁ```WN z7, Elř Rֈ 땏ɶ* )uK1r_7}D=8m'l k6Ik/u me=H+[ 0 0-z۪ 0 0 0 {}7#75vՒj8*LǦM(zqӺraFήyai[7>;FlUX4[361 00 : 0 0 g&z=j~au3cwE@h{g?c( ϗa]6Vv ×ί)'@n= 0 0pzg3 0 0 0Џ~2[o˫`O[Vj0a~jZZc^ȭw{p^OX[[0ee=˭'g`a3``?{wN^ػwć~Wyn\*]nkR+zZ%KQaרq$a=Kc`OzƂ 0 0 0Po/޽{g9ӧ77fX/Η  ّƺgo.'@n= 0 0pzg3 0 0 0ПvSO?T` ߥQϟbخ3Kɓ'h˗/Wik{%;Ç*k^/ϽF:Cs혣-56,5ڞ E8w9֋XYSrSǔ8*jvަ=SYhgjE[ky~k1[QK >לoJ>O{m/k=Ok_P .Yиچ\!```Q'I```Oߟ E/\%AA.8q@R>bPIj%غ%[^^'}ޮKSC;W'lZ%kVJ5JLwjϭd{NZ!ƒyi{q-1Z҇Sc5d|ݭ 7+#3w[sĘ-zD^oa u_9?16Yi_ m KSF{zc[;FXOX lmў#  0}룎ƣ:2 0 01g"ǪS:Eh X#82v[ޜՑ.4_Rh0JsJKϞ= q\)ug8Z ]mpݚұyy@=\ E✥hvSө;Ά6S2WQK̍\8tDdnb,qx, (uKs0eev(bz2 0 a~```Xf+}W^\ w\;$5Pi#6 WmC'"j}6S+Zؗ ͕q0+ \PԸXkr.o=ŵkCrca/y\m,̤¥S|ҹ&ּ,uZ3gOi$WӶIi%ϓ%s+'@0h/H1 0Rz -5 1 0 0 7Nq`ŋ{ _ ME `-"ssA #4xmYRV*]H:BVKV+Lduϰ ЯSۇ\ss.WYJ3Fh+ޒiǚa\׆" 9h󹧩mHk ˅J`'S㩠/q0oM-52V8I͝-z[KBrsVb, åj1՞1$cu,\3ϙ϶A$o]\+]A``:C6͖'7C▊xa~)rM``00 0 0 k vݛVw9=~w@Fi`/Z Ƥ7(h SU@sqKBn}5w9HJ0ca4uAۖ oa xnkq_s $gi rlGcZl =el>Lcn9~Ű^.X2yl>j<ɅeBۗͅB>K<]oéՆZrm#؞ږwyco) &uq^n{ީj}.t[,Yۢm`߀^56՘``o;{իWz+}G;"hrctkl*"4wnŶ3sͅ9J温Uki`dnX(Nlk.S[kkeX/7~V̭wMyl^^.VX/է2z^\xvvgZa>NMm~if]K``€``` |{ԋ_lcjb]JVF jJ ~%/y*lz6Dvަ\+k*z~\ HqvUU26K{j8wn̔_lZҩ:;'DZfK\oa=a=:4IF[SS` `>```X@,[.}ݿ^oOmukz]yr@ڵz ќGJ5 cck/aTMyeIX/ږۂyjE[ŸѮAZ-0"H BqlJ{{MBX:nlIySo.[yRW{:NPà}V`` _cX```裏f{g}vnk#r\ u|]$|ᛸ~., '-ٲ00kٯSATIZZs-iҰ^\;uurydVA5V֫ @wm-!ԒPtSz=J-M͹WInK'S}ǟ b+0zU W ``J qR10 0 0"hWރNbt^`n5<ڑ 4j5k+jWK,L3"UYܰ˚m:Wjة-ιk䮙4\+Veˍ=wc[]z-1'BCmJ{esv ZmE.`Z%1UU,[[_XOX jBqm2 0@q 0 0 0@{/^ ݻwg ԯ}.82Ʌ>֬qer!C[2^*dZd[Q" O1>JE[jeXoΖ٥}mᴩs-לn<^K-^5\UpdsAZVֻ=~m`ؿa8TC```b?$Pյ68QiYk+\pt:׭rA-b[]{1Z+VT+]e8[[.{OJb5 8ͩkZbA "5?5t$-eT{`7 c5f``x闿eqP/UvXokCb Wj_k;( 2մ$ƖHɪY5RrzK%}䘵BaPbilv,VA6cۄGcc07 V۷%^n.u=ܘ)y.\+[a-Z_>qh?c 0 06 mƃ:0 0 04_[Xy/U}9"W][+L* Rem%\^njy_OK[je9.%S\'XV[Kb5$^d6k=Ora!htq;g$ZTԉ`> YWU]```b{MofKq5k_>N8VJ"|Qz͵ub"s,VZ?l9 F- هkrp\UlSc5晒a꼩Mrmjb_Sj^풱wḬ`9P2לöx.AZV/[ 0 0Џa~ji\% 0 0 0p]dP/V/:~*Q/0vU*J"ZW.vƖzJ_%iyrչޜ^nq 'ǹ9-s="uiX/77͒UR}[%YyIM}sCsm}zz th`6]f`QgY```u Jy%ju>?srh c!ke;ŽcvsAȩ9ֻfa܊öcZJ[i歒sVt W!rsԼ!XXnjҰ^.\QnE9+ ֞;j}mxAZV[-`mSk``]_```y}ɰޣGC1M&J*CGP$2) JBes\{v@X{K\$M%ԸsFF[KjX/7S[bY;p[լ4abN`,A8ojc+ )cAy+{Y[-ejzS|wVa9!rGD{K8&|I.{b^5-cC-& ~o 0 0Ҁ_-}97_ 0 0 0У/AXu믿. 8G׾Cc"7!E8`*43"TIbL+q?8oגRM8vኚd c׉*Y+~Tծ`հ^j%Vm?7P5v\Z.@ßT0*pyَ Լ3g}ޞc瘚k6=v! 2ױZ]t qQ省9o^n%h_Y?U۸X&/۵zcas_5Y{xVA-+y6r 0 ,7 9ԇ 0 0 0 |駓a_PߡVʅGj$s>΃(?e+ҶOͥ`XDZ-Y ma}՚5~"۾4X4%V3UT|'JWK4ן 2wֻ\ydKFXol!,~G%˅Ԣ亷K5!w#w_*ub`g@Xo{51NԄ``ضǏݻwu, Ԅ􆕑1{S!Ԭt핐JS+IqIoVPm1 WIɱ-zqݔҭlSusy|I3hֶ%m[2ZsW裢p_#P1)5EXolƸ,(sKi= M%۠>V*}96VcmS6Fحڗ+ T- 9v{W]'KMy JØp juԲyk; 0 0@q 0 0 0>ɰޗ_~)wOn9lW24lAeh$AjkʸvM0?S[bz/CjۼjkL's/sJWx- Kg%A8T,k犩鏘wf\srm.Q9Ϙ>y[)w+NV?ֻ[urNub`Xj@X!``8X5olUիW̓QG؊1WR'+˵%'k%*݂rν3\מqVjpKIK<,omX/5P氵\Oy:v5};8XzD{91 YckZ<FY1:{?FXOX }b~8 0 +' 0 0 0@/9{|oSH6gQ϶=jzt:}je/k^woeO8{t͜0 07 j 0 0 \Gz}hj VJmƪ'{]W_Fulٷ4zw; 0 0 1wms 0 0 hP//|,sH:%Ȳgj/{jwl #>֦k܀k> y0 0 00 w: 0 0 ,7e2 _& jR!O{vNXosg~-cE_uֻM``m@Xks=````"獽;_(,0W}̹ ˷~k#w1l=Ը~;D8QXσd 0 0p zǨ 0 0 0rdXիWPY`X>6ÇYkZg4\?7;čLv>0 00 w: 0 0 ,70{/}{DH>s -.lWƄ-p5n1n3w~]3 0 \j^``z1// ; /\My9M [Y/B,y̱ga¸}-"t]b5QIקFfPݦy 0 060Rq@``cz|'8wznz̥ |W_[ϸ?os vީ߳bOz}:&a=>F`` ?魷 0 0 0Ѝ~J})ǀ7Xπz}2ǩ`&v.HV+ 0 0 0 0 0$sSkr>8'Oq-x\G bezGc````دanNX-6>`8َ[X8# 0 0 0 0 0 z\]˚ 0cN믦&r5e````8a=[X㪅+`j  1Сډ 0 0 0 0 0[1 b z\p\1 0@AZV3Ng``````+XlaQX+`5 '@j'{x0 0 0 0 0 lŀ-, q•sr 0: jYYDP;8`````cEa=ZrN``ր 0 0 0 0 0z,(U W 0 0ee=ADxf`````b@Xj9b`Zzz thv"p 0 0 0 0 0V ¢W-\9'W 0 0Pk@PàLa````؊a=[X㪅+`j  1Сډ 0 0 0 0 0[1 b z\p\1 0@AZV3Ng``````+XlaQX+`5 '@j'{x0 0 0 0 0 lŀ-, q•sr 0: jYYDP;8`````cEa=ZrN``ր 0 0 0 0 0z,(U W 0 0ee=ADxf`````b@Xj9b`Zzz thv"p 0 0 0 0 0V ¢W-\9'W 0 0Pk@PàLa````؊a=[X㪅+`j  1Сډ 0 0 0 0 0[1 b z\p\1 0@AZV3Ng``````+XlaQX+`5 '@j'{x0 0 0 0 0 lŀ-, q•sr 0: jYYDP;8`````cEa=ZrN``ր 0 0 0 0 0z,(U W 0 0ee=ADxf`````b@Xj9b`Zzz thv"p 0 0 0 0 0V ¢W-\9'W 0 0Pk@PàLa````؊a=[X㪅+`j  1Сډ 0 0 0 0 0[1 b z\p\1 0@AZV3Ng``````+XlaQX+`5 '@j'{x0 0 0 0 0 lŀ-, q•sr 0: jYYDP;8`````cEa=ZrN``ր 0 0 0 0 0z,(U W 0 0ee=ADxf`````b@Xj9b`Zzz thv"p 0 0 0 0 0V ¢W-\9'W 0 0Pk@PàLa````؊a=[X㪅+`j  1Сډ 0ƱmmP23 ##@P# #QDFF ":S_zwOj^````ŀXńEW W`Z C-OsTa````ŀXńEW W`zb=ֻx0 0 0 0 0 b@b¢X+{r 0UB'90 0 0 0 0 b@b¢X+{r 0Ub= T]<`````F1 c1aQU•=b`VP˓Ճzf`````F1 c1aQU•=b`X. 0 0 0 0 0뱘(*ʞ\1 0@ՀPazA`=3 0 0 0 0 0뱘(*ʞ\1 0@ՀXO@CՃz`````Q XLXqpeO``j@0d=A `````Q XLXqpeO``j@'cA` 0 0 0 0 0(z,&,J'W 0 0P5 jjyzX  0 0 0 0 0(z,&,J'W 0 0P5 1@ Ń``````b=z\%\ٓ+`j5 'c93\``Xм̋````ǀXoעb3Oܫ+{f2 0q/C,Cd`````gb=&>'cf#ss޽s`` n 0mA=?#̈`````1 |]ӧ'C͍Xy``8{v}2 0 0 0 0 Xx2֛7?}ok?``~6 kX 0 0 0 0 0 K===}2[BLvd?g 0 ,a@X``````a@ݒvF钎\b` ~9 :  0 0 0 0 06 cn)sٓO՛ߋ3]ʑ}I 0 0^b=Ēxb````z-m~bVPҥ y 0K5)sP,}P؏)`````?e@ֶtrrl7W[ك[``] z 44˛ ````` \'rz_ 0 1 -rz͉'sb``````<b^C{\^^>?{h?`8lbeXߔU 0 0 0 0 01;w V(kxw`H5*sp3 0 0 0 0 02 c륶nnnbyK( 0 0K z 44s1a````ط/18?bZ{ 0 0^ 勾/f2+`````2 0~Ho͛i݊ܜw`؋|?'K3 0 0 0 0 fv?W3 0{3/\mvWf 0 0 0 0 0Xzc#?nnnjsOnğ< 0 0p<z KQ^k`````nzL/_LWWW/fS?~5/8`o@CX5f````j@wzwqz.O礟i`׀XO@C=v^;````8vb{Mo߾-Y ;==tgy`6 jjyo:ׇ`````_cNsT\xWW4Gkf` z 440sqd````qx޼ÃP=0A`` dW^M3`````8D?[7o,띝M! 01 ka۷oׯzbE`````8HwUX?^"֛0Gf`?a; 0 0 0 0 0 0 0{1Ç?Yo.//v+w/~E D h 0d\````````/V[{1{L1U< 0|!``````f`~2=ao^O6tww'toN fj 0hh`````````03+`````````5 1 0 0 0 0 0 0 0 0 06`C 0 0 0 0 0 0 0 0 0b= 0 0 0 0 0 0 0 0 0a"V 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 06`+b 0 0 0 0 0 0 0 0 0b= 0 0 0 0 0 0 0 0 0a"V 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 06`+b 0 0 0 0 0 0 0 0 0b= 0 0 0 0 0 0 0 0 0a"V 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 06`+b 0 0 0 0 0 0 0 0 0b= 0 0 0 0 0 0 0 0 0a"V 0 0 0 0 0 0 0 0 0 1 0 0 0ӞIDAT 0 0 0 0 0 06`+b 0 0 0 0 0 0 0 0 0b= 0 0 0 0 0 0 0 0 0a"V 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 06`+b 0 0 0 0 0 0 0 0 0b= 0 0 0 0 0 0 0 0 0a"V 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 06`+b 0 0 0 0 0 0 0 0 0b= 0 0 0 0 0 0 0 0 0a"V 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 06`+b 0 0 0 0 0 0 0 0 0b= 0 0 0 0 0 0 0 0 0a"V 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 06`+b 0 0 0 0 0 0 0 0 0b= 0 0 0 0 0 0 0 0 0a"V 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 06`+b 0 0 0 0 0 0 0 0 0b= 0 0 0 0 0 0 0 0 0a"V 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 06`+b 0 0 0 0 0 0 0 0 0b= 0 0 0 0 0 0 0 0 0a"V 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 06`+b 0 0 0 0 0 0 0 0 0b= 0 0 0 0 0 0 0 0 0a"V 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 06`+b 0 0 0 0 0 0 0 0 0b= 0 0 0 0 0 0 0 0 0a"V 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 06`+b 0 0 0 0 0 0 0 0 0b= 0 0 0 0 0 0 0 0 0a"V 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 06`+b 0 0 0 0 0 0 0 0 0b= 0 0 0 0 0 0 0 0 0a"V 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 06`+b 0 0 0 0 0 0 0 0 0b= 0 0 0 0 0 0 0 0 0a"V 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 06`+b 0 0 0 0 0 0 0 0 0b= 0 0 0 0 0 0 0 0 0a"V 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 06`+b 0 0 0 0 0 0 0 0 0b= 0 0 0 0 0 0 0 0 0a"V 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 06`+b 0 0 0 0 0 0 0 0 0b= 0 0 0 0 0 0 0 0 0a"V 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 06`+b 0 0 0 0 0 0 0 0 0b= 0 0 0 0 0 0 0 0 0a"V 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 06`+b 0 0 0 0 0 0 0 0 0b= 0 0 0 0 0 0 0 0 0a"V 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 06`+b 0 0 0 0 0 0 0 0 0b= 0 0 0 0 0 0 0 0 0a"V 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 06`+b 0 0 0 0 0 0 0 0 0b= 0 0 0 0 0 0 0 0 0a"V 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 06`+b 0 0 0 0 0 0 0 0 0b= 0 0 0 0 0 0 0 0 0a"V 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 06`+b 0 0 0 0 0 0 0 0 0b= 0 0 0 0 0 0 0 0 0a"V 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 06`+b 0 0 0 0 0 0 0 0 0b= 0 0 0 0 0 0 0 0 0a"V 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 06`+b 0 0 0 0 0 0 0 0 0b= 0 0 0 0 0 0 0 0 0a"V 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 06`+b 0 0 0 0 0 0 0 0 0b= 0 0 0 0 0 0 0 0 0a"V 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 067kKu`IIENDB`././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/internals/structure.vsd0000644000076500000240000030300014641074756017727 0ustar00twstaffࡱ> Root EntryRoot EntryFP7pVisioDocument pSummaryInformation( DocumentSummaryInformation8x  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~VisioInformation" ՜.+,D՜.+,HP X`hp x 8 Zeichenblatt-1SZeichenblatt-2SByte oder VariableK Rechteck Va Umgekehrte geschweifte KlammerDesigneffekte.1Dynamischer Verbinder KTextanmerkungrb ZeichenbltterMaster-Shapes0|_PID_LINKBASE_VPID_ALTERNATENAMES _TemplateIDATC010498411031Oh+'08@P\l mabemabeMicrosoft Visio@`7pVisio (TM) Drawing pR@ovRm:mAw:m:mAw:m0A<u8 !fffMMM333Iya͋V׻ę5@@@FFFG}PFٖ֠~dյ91UJ:DT5I[1hXT@. .Ub##/am0U\?dK[&/~&b%2~ ! oLh $c)P?#~)~,,J & "& ,i 4&?C"/.?L?\.?o A  },,,'p/%O6$X6Q (}j?k)?"   *I3#oC=S?#A:;A;dUdU@;*dUdUdUAOpNOD`;dUdUdUdUdUdUdUzUbS)R~;4OL%=Qip;RRRJggRph=Qj .@]E' %p3Ԣ~|bFp#| | | ~ui??p9[!i fTd',50fZOlO~C.ߐE#PQc:  A ,U345&6&9Eaaj6 8d7?!%3 URg L-ak@9$KtiQHeuDDT(!cp;/paM-uh\`(+AT %5+H>>5a%h34ovJuX0Hp(!MmcP=?`(z?84?D0pA D7!U/i 4?Q`_1_JD;a3(/@}_L/^/L%a$G[aY %//// ??.??R?d?v???V[l_ru@+y_w-uaDd/r*&oo*o_Qv4DOOO\U$/@__o/DA/Gj:d2(joG2O5j7@oo ooo?&s2;IO[Odd 6 S( $b4@SyYkO(Or&̗T4EDP7H+&g-.UEd \Uˏݏ____"LwU2 r?߱GXDeTePNkcc#ER¿{%ܶ/o Mv{&l|$6&w-!a!!!1Lpqq;PasqKwHVNT`F[ȓ !z䥶1 @Rdv%Iy -bbbbbbIbybb쩓DMv4,}J(̽~ .?Z//puR/MrGK9&/@:?LyǾٹ  /r p/9cߓAdUe?w?O2{OOOW _u// ??S?_,_?2Y?????oO@$F=OK]sOOfOOO"e 3C _#5@_R_d^uc,aYo-o@CgG$t$#hoIlZFoBQ`Ѡ1`ConectrWigtz70aϧAQ` Ed`cl&K`Pten´99K@q^Wc8Ii߹l‰ݣA͝>†p&U5Ruig;(X3a ŀ&U=HTaWsprnyC™ͺIJrBgt24`.SQȕ0xPt4"H$ @Y,b'@ @ A-?E7 ;Ut4"H$ @Y,b'@ [: C-pG*7 At4"H$ @Y,b'@ T7A-$p7 ;t4"H$ @Y,b'@ TA-$w7 ;U!U"#$%t4"H$ @Y,b'@ T4[iC-dp*7 A&'t4"H$ @Y,6@ ,AA>-`7"AU(+,t4"H$ @Y,6@ <\4C-pH*7 AU/0U1234U5678U9:;?@UABCDUEFGHUIJKLUMNOPUQRSTUUVWXUYZ[\U]^_`Uabcdt47"H$ @Y,b'@ `C-pV AUvefgUhijkUlmnoUpqrsUtuwxUyz{|U}~t4"H$ @Y,b'@ [_C-p At4"H$ @Y,b'@ lTiA-pw7 ;z23456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcd*t4^"H$ @Y,b'@ `6C-q_ A;X4@` MR@`QNR@dkPMR@kPMR@d`NR@`IR@D`RNR@DlP`PR@lPPR@$mPMR@mPQRH<(H<(H<(H<(H<(H<(H<(H<(H<(H<(H<(4E`{RE<`REkPRE lPRE`RE`RERE|lPRElPRE\mPREmPRUR/0 e UFD# Th(/TYTYBBUF~?x<F BP(?4P?+ O @HZUBH??!t 07{B`8Byte,BiC ,NK bU lE"KY"i;nG DaC"h!TA pG SoUfC wm rE"S{ d!cPe ,>bjE kC  e^| 7  3u ,7=OasNDas Shp}eaufudZicenbl]t) ze.HD   3 B>Tp[/Lp?as&;.h> ,b MJ=UF~?FV*JR?F\.?FM&d2n?Q6 U AMA333u` ? !+5ChMW]u$g>5 L@X!$5 /`Vis_81.chm!#4E"67M `_!b-"#"'?9h:AiA 9 $''2ǥqE0&!$E0&!qP \@6%A]Dc]3V:?Ka!Db1OCK%YEiO{OL@ODJv%YKOO"NBSB53^@M^U_g_y_Rg@14ot'2TALd"2(Ech,@!3qlf1U1 m3 =M!l+TM9M]a6 `($T 6D UF~@xTiC;'h>4bP9 EUF~?L&d2?F\.?Q6 U AM| ;;u` ?*#)3=KU_euo>5 L@X!#$5 /`Vis_Sba.chm!#57_ 2#`$g!-*#*'?9  %&/7 aJ=?Iy+#&Z&P?B#2N贁wNk?@J'q ,A MVq6q4!*#ekab1; ?Eq6 I-BCb:@e2C1%>> OO1EA5~%5]NGxOC9AOI%\O`JOOrn_gPo|'TAFd" (?cp,@&!iA%9 -$b]'/2q`&!gE0f*laUmHE?KlT(]9^]-Ma6 `r (QJE-Os~%_s%/\h}Mf!>zbcrA bb HUr ~L)uE/>F[*#DJB U6bbt'`xo@<QzoCPUFDfP h VTB UYuU??Fxha T,aaUQJ\UF BP(?@?F~?$-?P nL#l]dV^ ] $g]Q"U"Y*"]>"~#<?&#A&Br&C"u` ?PYu"bl""& M&u"u&u"u"u"u" ,u" ,u"4,u"H,66t#\"u"///$u)ar;21'u `Fxu21yB}BAABA"!^hO$,@ZLupO耑 @Ca4R#qt{u*gvXWcZufvvWuTj*uX{u ]ʤ *aGIJKMNOIQ"R$QTܝQVWXYC3333.3>3N3^3n3~33333333@33Vf4b@Vqf0φЬ uZ1[]^s@333'373Gc ƢEt&EAxÎ;BA}@c"3"3."c Ӣp x/3,S/e ~/iRfSIA62ab ZaLxVIǪ *:Jzךת'OgEa@braĠqAQJ`FWO@r ЀiC}F@`I@)@AEBsZeȓ3U ,puӐe(p 4>{ScNV:fcfR:bWKqP?@pA3VUbQw Sio@(h#FtϿF@ qRfa+_i&7=akVQhaRkQclQohaR2brˡF@#I~rW{ 3~TE}O bqO cy`I@Ё`sVRڀfK@ڀbooOlw wKuK`1s*8zK@JqyozI@ eoo /uB s!xx7SlP4;walPe,0kNq @Jq.-8r JqM9-t '-E1*dbt+r sQJQLŌH{M0tb;{O,=CƁS=ԯןƋM2'Kx~{עamzD1-?F|ǓnJ\˟ݟITjU˫ˬ7F:-˫YkIՎ_TF ?BP(!RQ!4 Iz{7 F.!`}~k QhaqY.!(SFxfb@&7! kRka},1ff",1~,1ff ,1WVHf312E1kaB12lQ12a(712,1HfWV3UYkaO} mlQYBaYO(B,1WVHf3ka lQ"(;" FHfWV3Y"]#kaS#" q#lQ]#"]#S#"QoDcjWV3,1HfEFWVCaHf``5d 䰈qGA8rL5k0BAK6 k0L5k5L5|0V!CBL5 = |5QQ5&t?U: =|5vŦ547 P@QzqE4HQ7b&qn24Dp)CTU+0F2o$0jjSRjaRD9Q#eM1sB=yIZR1s^lZLV_4pQL׌HH.5Oa 5.. ^fCmnfv3p` T]`avelShift`$xa_d@a3p`OΠ`fs`m!*_a@@ VV%Sr V:67sGr:2!l7s[r 27.1i$3s 1T$y@a@dvkQXU.q.'2rqty!,0}v`n$qqt7v-x8cʁEl@baa%]1]1!H$rI*J!1LLLDŽkq+MԄ .NAOAAsQRe.S"T/.rq.qqAWVqqFYpRBZ}/b[.)\r].QLQ_1(A`ٓza(.44.;[Rx a;`"[TBf"< 1W`B`sh]`cu g`f&+o]`m`t`l`g`l*?`0qH`.:jx +\T`x`bdvq_v!L5~*ϫ16DP`)_R`Ht%k` 7DVhzڠ2xQBuݿ)/\BanAM_0qx2Ϛ0AP*(O`a`*4dFxgy2?Wʷշۯ-K08&4Fb[mD{ǿDD!s 1ϱPGYϋ(6ѲĢϩȩ5hA`# &AsDEy3 UĻɯAv^2`OnwAQ9)(ĽBT0fAvH`Uta)Yp!3EWLnew@)ncbā Av9H`ER#t6Hl ~)99:'ϟoP$tm-At!BT)ங'7İDZEBs&1)/I4+r/o/Av(* t/% *Pa#/?4Vir4F:?@^?mAiCOOOO6O=nO Z\9?K8/ `v GAAtPT&xJb=rb+ Trt*P@?B#o54trptb T mkqőԁw`3P?squ{tcF~ϿF@ Y%ukp{`?u %,Vrq @V4`+AszSPsT3 )5>%j{ိqi!stgq xŕ2htbrQ? !3'󿂱/0 c{[яJar<`Ѡ 5 %*5}9ᙓ @r^rlA$Q2U lQQ؉uyhU+424r@1Ryɒ^rx@7.?@hzi?wԐH}߈7c6z#o/|UD`a1H_\"p1@&WrBdeKTv7.!ԟ@V) `aGo,o>oPobo1qyo>TooODowQS+F搞R6);=[vrrQv>LUF+q StFUevS߅x$~&qޗ݅ԯ1).UaO|tǢKT*ϰd4)'ߕr|<ߒM2/WkNȏ%rQ|evʭVlߟU[#Իg.gM1xweۿoo1CBSCS/e/w/S~eB]v KcVFO/GXiPdU:Ǽ ڄE-,/wb/cƻ͟E/?'?*&)BOZlcƄdUO7c*&tG);AEOb1ҿ)M_Cb.ϛ]!_R8Vb=x](' _ ݂?z-sT_Na2s/@.g(O]Sa5 _;;L7pwrra2wcCB|WV.gWi gU1gtO@|{럘p  D g,l;;.o@o*aa Oo0Ґjo2kJΆb`b~Mk 2(s.®%)nd\S?l$`-@K ay!*t1K쐴^VQ2CIUdUpς1aanOa7P7߸y!X16BòJa@a WE1!UަQb@72Ce$6N ¸ջVcIpb)L(aO[Ne4 (ga# f8 \ 2d T!bu-(;M_qڋgֿ`4@?F\oA`0ΉjM09 Q(3b8ye/˸?FƣE?Fp5Ys?F5&!Q@Ή( 0_Bԃa2U0*s3?ܵ0Ԃ2 k+ݓ0]'%Qn?Fѡ?FW^bd%?F?Ԋu-Q/c,DJ}?5^I,QIƥ,$~//'% ?F*^Y?F[E?F|{T?c,|гY,vݥ,-?C6*~??b'%OZ`?Fa)P?Fů$_?FPvϟ'͚?c, h"lxp_Qҏ,mV}b!)/L FAOSO+~'%`0DLJ?FNqVUO:Oc,~jt7A`,ףp= ,7d__Kh'% QuU?F`4pF?FLAD?X@t]_c,io?JY8FZ4? qۄV$N@a__'%X/~%l3!?FeY?FJ~ӗ oc,z6>LZ4kw#awivQooj'%'-q?FmUa`2#+?F(%oc,Y7 }j GfZ4 ~,ClL^!UFV{WE?FcJΦc  )?H},""3\ \ -YVqjǻ )1̶ Ѡn<δ m|ѠaQaCSVGh4cfUpi$5,)֝F3L&AP"iЧ Z3*p#q8 |`rXӗze2ZՊ@ #5.?\zi{B  ȧ#ޯ&&JJ\BMV㖿t侜+Ģz`rl%ǨΩ)1@8"4߀Hߒƿ./1*Tύrˤ]c-=( @=5-2-9#.@"~C Ȓ#@ 7?D`Ofrsetx %q,kڡv hE 5ɞ)3U+KGAb TrKvlԐhi"//ׅDzW280//?(?< ????QcOwOO)O7(QOأTx7HUI' Xߞ^Ba5a8_A88F[K"/}#ĠzT݆B _`$@eŴko\7hoj(PUFDfP h-VTYYU?"H$ @?Y,b'@?xTT;͑U@ !@ү&P6 lAu` u(Jݩ c?EDe34 D   J ũ2qL lvF BP(?L0 `LineTray sp r{ ncyz۶&` v%P t e n&$`u v%W{ igTyt&a` v%_Rouy dw")g&A0'2A{Gzm?>5Q?A^n"`Fw lo0~/+n"j?|?+5/!4`S:Ta ow?<*+` 9?& ` 9S5@y0eK $KXOf@s{ 'B $KYtO 6`9UM@gy i@i04Ai '. `%9Dw AcNul>k$Uhh2Q2QEXT/J> 09([_q_[_o!otgU__o_oTEooo,o1A>Te\Ls c!2TCt1MU$U<"itjt AktE*Q*QURmtQ!!otU p qU r s-3"!!uGRvTlwaExn11Uz{Y|})~ARɄ22քeㄐqJ"T c 14.m"?<%Rpsf0M8@H8 MEJUU8!r5GrK&HZ&H͟@G+G3"?GERml&Jlmyome>mGG-GAUV>6HԂyϿHႻFSP6HuANqe (=MQ_'0Uhv$on!3` LDnFxB'3` A@iBݞ"4` C m@bAxB}lewL9WIFE/HU= _6p9yEW49dF[L#dJhMB `]@eko+׈]:aG[NhPUFDf h-TYYU?~@x]@L'} V6lX-1u. Bj2u2Z2j2#u9r#ULH/MZ1+B#AD5 60`Vis_SE.cTm!#20AD%`>Copy<0wigTt ?DU1f@M)@c<0o+@'ofdBUArX@Aad@iV@n3@ WAl@ef@R@6AtBvBb@hB@lBAJ@=## AoG?9/#n"E&444 7I#$@HB59_lj#"SV6U8*l>(Uhn E /J$&9"(Ln eg5Le#pheo'T !! Js~o/|R12'"U7A%O3W_7xr5(-6 `F2 xqu\J@#:0b)&`AAs)@E T@xd@Di e i=M]UJh#HT0#3 UEJ\}|U@f?@3!?F~?FL&d2ٺ(1?P Ǜd#pa HkaQ"U$"Y8"Mx#BU<&?&@&A&C"u` ?F]o"fpy" & G&o"o&o"o"o"o",o",o".,o"B, 6 6n#V"o"///$u)ar;21'u `Fxq21uBAy B AA21"!XhQ$,@pup`Ca$Rou@+u*LfXQc* IRg fbY-H- M ZU ZZZZUZZZZUZZZZUZZZZya-yyIvJvqyyMvNvOvMyEQvRvQyTvTQyVvWvXvYv3* j|%5EUeuu 4 蕺!BZ)CT@x@U @n@o@a@%iEPn*Љ4J1[v}y]v^vc@x3+"" qؗAU2Aym@xcv$"" zp$E1u/w3,#? N?$hVW9AB[bSq20S hV1Aqׁסױ!1A7Ig?abrXqkiqruׂ6rS@6'_@rp9SR2MV@׌aV @aU-ܕ?XrcU:uJed*ɮ᧤N@q37sfjBA'b6bjB'#KPRQʾqjeArQ c@(3FA{aٿA3b!&»F_ v7_M%;f!xjB!s(a?xjB,2brrP#VFI%r'#7 3%Р$UM_ }uj_2 ׂP5GׂWsZ2bQwvPQrT_@|wu‹ׂPc?P 5uR܉͏Cgyc(` q(`e80{A @9-܎ Ʉ '؏bAP42Dr \sya@Q_X俋NZ]b6 O6͒z{ # Z{u£@%ЊׅqmϕDR1oL^c,ߛѯgZ $j%{|ב R{iۄ);qσ⥞occL&d21b}aN/9K!KG'!cpK1a81YNSFxBD $e0Bof$z:cRTrDBʩya#HuzR j"^vc ` T-pavelS/hit`RHq/tq `OfYsfps}1 oa@@VVSrlV F"1+-27i41Tb4_qt_;aXUZ'2rq_!n0^Spn4"1PT_sE<raa-A-A1Hc^IpJ}bL;M 2NQOQ1\Q\QQؔcWRS򔆮TqqW&o$Y@RZMb[Z\g]tpapa_TAQQAbpJvq;Ϥ+bܤoa pQ+d0AW`BfpsĠh-posugpf&+o-pmbptdp^lbpgfp<XR*R?`0ȁfHT` jd0+9TfpxrpbASv_vPQE~ 1;F`a`пҡ<Rfp%tknpr !3EWj|Ϸ2HaB^׺/9Bmqn*<0NHBew0yQ̀~`ϿOdpahp+=#bRdﷰ4z:$ߢ B<R ai*rp iisXmTZdj `F1H<zՕ{xMOai?ޯ!_` tD.Jr5<}= ` K* `[Z l v 3mAxD{z{.gMbeᒎcQɥģ"Ĕ,/ħ<w{) ѫcĔpĽ} ѮmJ5N13_MsSspy`ID?S/c}ba K"eb@o> )עa2¢ `DVh%# UD kmjBt2ߧ߹$c褣%!rr[Rf`}aTy7[C3DnUbe|b;ruv`Up0;nr`1:븁X%`?$2$N1} Y4Brb@qAa-aa;qa `//5?*?cT Z "!0ЏQƽP׳M+Q ܒ*QDb)QX\T׳a_uu`bېRIu}ܒQ (l\O~?hzP-îLޯ)ّ `{Cݕ2YǕT `ƲG . !ё1ɕHᝢ WGMĪ ?Ɓ%Qx?ˆt/$Ͳt ڔ,ş$O4  ,o>oPobotoobo1*BBZВՑ7zBoaa^屓aG9gl6ҩ$xrNPƯدk)D _& 3EWi{ߍߟ߱ /THZld Z_VjhRdv=X|w$%F / >Pbt~44FJ3x<T+///(/aNO:QN9O:////./??'?9?K?]?o???1???? OJEOcUQOOOOOOIYvotuoacVh͟y_T_ j &m toB)j ooQvwёʮhg_#F K?F&?x?0l}G{,:`@"   -?%aEr%Õ))EyXR} o`д$#?ęxQIr/xUt,bwXUl0i1ewvv֔tQ=Q)R}h4FƶwGYs?CpYՕY 4e%{QHvsLQgŘ{)tUbzf^ȯfܓ֔% E:a`*q>^TbtxoMdǏ@هT/f/˖{OtC]c VqǐI֒FV –nUF?vn qsɿ *Ys?F>?F:Xc?FMڪ﫰|JܡtQq&A=QngiC21MwZ漣A$rqg0N܏tE˔F*CUy ,Xjw=Oas߅<`ߦ7 {RC*OoNkrfŜo-?QKe_? Obweoz}&U.V@U4kW5wR<k 7 fwdůWdvw.ϒ,u6^.ڌ@(]/5Uk@ k@Dw,|@q K0/'LK9'Cm0ϾSBs2ّ5)\ls?1D@ q>Aw9#uQ y~qҰq٪$E)U5G1r9{ a`pM>AkVRbדL!.UEG!ܱ'kWH٤*Jn}viIpU'LG(A^|{Օ4߭9w7;Օ f!+S2)kt/'م"Nj$6HZl~P`4@?FEO jM󎣈PuY Qᦤ8%/˸?F#eֻ?Fp5Ys?FwtÊG?( 0O(LпDJգ<}?5^ITLQIjL$?~OOI5 ?F;?F[E?F3Ϛ)O(L|гY<ߍTLvߜjL-C6*C_U_'5OZ`?F3$i?Fů$_?Fir8_(L h"lxHOj?FeY?F܇]}(Lz6>19lTkw#N<vuqRd/%5'-q?F0 B,?F2g#+ׄ0]/٨(LYЍj@ T jLCl#15v?3FV{WE?FD~ΏJNk(@(+ WIHg}jLzB՟$q$D*P!)=6?zH7j A^ 3=< 2Aġa1aS~h4'+5.ϼ7O9H%F_p8Ɋ( b-SlJg&ǯٯ>qA>%7IWt?&t:NO/ag#mҳ31>ũ!bX,!.@-R^rC&Aϵπ!EWiSh:Mu^9a.^;g?&h&8!AOϓ{EEEW{>h"R7"(P!1('b!)1jUP-29Z3ˡ#@$ 1d>"wCCZ3Q%p1bؒC!p2@&7DZ3`O}f70seto?uܰA0&2,?>?P:v72p&1"E$A1oٿA32ÿ&A>+5R{w,0';)w-eV-jUCU+ a ?%A'; WTrvt0lghin0w8M=Bb7OOO;J!HR?+vOOOOO__????(?q>_]?u sEtjqttHD: #  h  T0]]9 # B 2AUAɿAhY?ٿA,c2ֹƿP6 Au` ?A@j$u#J.9axu`u]`bu`+u >ڍU@@M&d2}34"ÿDC'>"M-w'>"D(p A "'$"&H' O#&5 $s&]$2JD=#D> D6#U`l"_# #1?9#H1 uNWzIs;2 8J#2zGz3Fx$2[Ru(/YB DU_V?\.?/B:o:2A7P`BackgGPou_ndCM`lM`HQz@@bZ}H D?h1GA #X8P6d3662Q1CUBF4i7o117;y0~1Mr)Srm>de}mspTt "qq"1 1381812tMItBB Eb'b$4ANu13[h2AuBH1BʜA!ʩ¶jÄ[QЄT݄zrf>!$0 %3To1/u/u?8XxAC`IWsSwSwRs%o.@0RgPf KNC`teI`\ai!nn3uZR%d DM`kO`mtiM`5HQ-2HZv#`NC`o>!8V@MKsEŭAد3dVrbRaPags0bjkTykp~1])S搹qO`zfY`u^s;cTͱnA²oivlPA$*q#8@q#5$rQQR*E?eNRעQcBdg:b`OTndGPuNEb;StRaaGPdB[Ÿ-uijd[„6k~]QRƀ@gP@ A>LEs?e\/dϩs Aee"g 9bY`dt2D-Ÿpsr- Sqv߈;`aݔ֑#pS~>"ƒE*ȯ:b` Txk GPp}1Բydc j]aaAe(Se1dSrʴ &e%\g#d ɿRf);M_=7DßӁ„{81,[/O^kxÅi-ùƁ3 uI[Uu`  *L%LBW?AP)Es̲aٳTe"/)#We"ɧ??? ?:OOB&c_ //Y`6?H?Wis??]CJ_ oAUCGP?e`(__! m2oDoVohozooo0 siԛOo oW}_oOOOcV¯]WץR=Oas-](]uќoo~Gm#oTw {Ɔ҆΃S 6:0Bw)s͟ߟ'9ρJca:smQm Krаe/Ȯя- voP* V²#5VUo"/%Wo"O _._@_.o*o/**u(!S[mJ5li@eu+arw% UR°l;Q@nt9'G} !M @o#1Ϡt+o_1OCLRʿ.@=(*jMD`sprkND߂ϚByiϹV" ?5G&8߭\n߀޲5F/=$2&"4FXjj"j"/ɨu*FXjv_?q????9 ???Qc0OBOTOfOxOOO8B+DO!O=`Rotyfb)]O( !1idBm!?ȅKbB;rbrc`R@*@;H(iPB_)/BE!1v])g%oks{1tpnN;GWewyuPz%doaqm Bqo2;a2wtSkmQb@nvUaTtnsb bdds°bjTq3o: rrcjKbT!E!222?kl;!30kC2m2  aZZ!*kψC\\E&&BGO ='`C²!cRf Ot9d_D@qA,@"hi."4 b bA' Y! Pk?zz!!_lDZU!!'7!ƕP d>"p}9+6@,1X8d:PjH1/U0r4,,1)*AA/_"_o & #QMQ,0#` B scriftungm,1 `Cal PoPtQg1`E}u+iH5u1! 7 @@j&@@q`o?@rb?d-e?s)gUA$ ?$%vr;#xAZ%RiLPE" 2 0"U$2 ur! |u[]4 t&&s~rzlH1AUH1?iiu5UAA2zry$"!rByǤo VPQayl p-LPnPʡn/k?Pp rN 3Qiߢu PuPw 4EPtTIkrPo?PlΣV?PrPTRʧIEz!mr󢴳W 5D b9BTBnPnߤz 6VOLA !0jA_S_e_ŕ{W'&!3AP!|/2g1 D1y 3 H1D1oE7q;Eȧ{e|lE1@@~!@Fg#?F֌"??QkPyA`Q27W˚ATl 1<25l =cl@YmfxAj`PL!@@[g?+@@1#_  +??@*o4?PD}p\z׈-uru`u0`bcu ,0@@"o@a/ ("q6y B%#u2#*"0#ᝯ2,`6@@Ên`P @$Rxww &;01O5l^3);hK(a~"f''ׄ?[銞<<h.?l"dYկd#j_u bsUTK0a?DbB`@_bz I/!*98`P"3\ o"҂3q@551I7zrQQr 9:z:a:a9aaR=R>rrqdQhQrq(Qr q2aa0tQmO\[|RlqlqⴋrT,@rLQux҅t0q^qs pC&Av"rBpsx^֔u~*k sa4azuNu ca@bֵf7sa9ՐxU܅ŔrQ9PCaLJY„fD/@rF*PPV#Oj&TP@Yn`@Q.%Z$yaUBafp Uu!4q х4s q, Tto! ТZhQZi5,Qrc3WLP@*(B<@b@t^?A$@o.a#@PkIKr3b3KlqJj/ â\Ca/O Yn`PQFYYCOǐ2p:F>pKBrOgOq/LKHHKEKːYCJ=Aұ)VZn` OzOOOOE^Z___*_<_NXQ3|GCA|epPKd @A[-B^ cAY£jNT '_%k…Ž_Zoc ss&qg1]JSr|([w-v`DbKOb=~h>fkviKleN{>f8{gyjPsKϝ̏|vRTXc[HAmeZfDo1ock2DN&xݟ^pP*wwjo>f?ʗTٛg>f,GY^4Fܢhn??Qa%<}dAc)#]K2At^FA1?0_P_b_k؏?@ܑ9Zm(͖pB?@qK:?@W@ή8W?@S^H?ssZ*m(5=*/P#&?@!W/?@?@FD'A&a?@0?@vj6??@^ŴBI!O&J6/iлH$?@ T9_3`?f\Θm({E=T@m`m?@l6͊`$Zǂm/&0=ficUo@@K^9`lخgA%=,^?@tA XP@@z(fkT?@Ô1fe=j.ƀ?@P3{@@5 I]ͻ?@+ӟ wu=~@h{?@j"S~#HXt$'=)&3I{(?;3 BP6Oc= }…lO'ƯدH6?[0 O۶f_@3l~ !H<@)>Pbtφ X?y3yGPU)^BPԇOOOOOOO__)_;_M___q_______1i/{/^X" 6q'AS6m#p P:yad4//*/E$B ?' `?FM%:# %?Q.(%,",x>Pbt}R,>bMt=ζȏڏG"fFXj|ϲxU,įFX*pԯ8GB(ma AS4!̱ Dq 2aaJYPcy08̱u) {`gl6 @@L"@@Hh45?;C?FwG[r;1'u`Fx8<"\YP"Q!cZ"[!y!!02..ȣrq´"T,@-@<إN-9-L7Cz`WAoubҟ Ab;sż@.v̟6 ˟W'?̵A4!)4TB`xAp`n>@tzj7X3#|گ2п6=#@X)ܽ+?-ryN ~Au`u`@rb?5@ȩ.p@Őc)a&M/_)s6})7Up`uR!cA*qK@2-[!Ue)aYգҺ#@+("euF@X,@@cP?$9/f$Ptw2wy#wI`rSbK3`8q \~a, c֩hǐ⣰  ˩5< Nas i !3 w%;G/?/e u @N2 -< N6£1 h5s1.h fx sN!P 4b ?O0A&GWA///&6?+//O*`׹mD11CJ /"ǗNO`O//??M'X'jY K"K(;G"JK>1?/KK__O]?o?_"o??MR& vum]p0cKoeLlOe񑡡ojFxk@?vKuS@Rmw@|PmƁNaGy}A<"po Bpp9Lp A? vEqLJ PAdrHXLJ,HwX!kmieT~A#5@?MVl5^l6qBV0IPo oomDu׿߉Еe n`vc~ae` TmavlShi"ptпome`eOpfҳr$ ienюB@0wo0oO!~_=@`{U$erdT~?L&d2?qnSU^P^ e رT|E?U  ŕHfc IsJ026q6q|qLԣWM 2N&O@Qԗ`R`ԇAT&qUuVrIW)rX6KYCZPr[]8~~^]w2Ѡ%2_䨁@Ldq2јqq-;X |pnԛq'VUAAU{S@X,@@c?P?]2vÑrHTn?O#@2pcr2ql{ԑ١U^@dإʼnU~K/MEp2mԌq $SqU£rIdҥqҦ~ҧҨ(ҩ 5JJҫOI\ҭiҮvүҰD {VuPqM/|qf 1 q/$r89UƀdK/Eb].J?/ ћqXՈ!2яՁ=7&LMP5,Ku/?+/UF BP(m???*?og6oo?M@]f?qoooooo\ke?__O\Z ՁX9/ӘC_U_KXF_}6Z?Fe#?2”,zNt/DF`0 &F1l aPdl/BjZԘl-U%{ 酼N[b?zf^5OHƏ؏bo2oBbd?Ffl6&FF?FuWu~Z}1Ԛ\ ϥRsBTЯ*oo`GÊϮݢ${Կ̗ޟM2.RkO֨ϸ"4FX<ߺ̱ 2U9MSiO]yd!4q<|a|aSeOZAkQw9+OO!@ Ai1/C.</bsPbOo@nZA">Wi{;^5˩?@Fmtf~:G?@?@;:y?@A^}/9*[Jȏ :g}= A?@I l?@C"<%0Md 8#(m?@'`sI@DͰMUh>OmHaoW?@&N?@?@?+%U OmHg6D~)cK?9?@_1n`Um,H_mH揷P,P 5b?@|XYm˗_mHOgOw^ G/6/?@$!?@d%FV^_mH+5gf 밷?@qK"`:= ?@6NZ`4olI5gN@S:3ί?@f?ōo ȡ4$1qY?t@ O=$rb K{ӞvD '炏ÏՏ"?V N x4(1(<1>=ŸD?8Aį߬X,@@cPx114<1U??$yίU@?`0 Q/TSi^1ATs]<kQ'/2qqGaQ! Q#`Qn%bC6a i@bpCa zq`%>q,W,@Q"c,qB@>q݁oӂ_=@`{k*#upq95"+aq@uo5ubO lҊq徶#Ž#UU)*/023456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdTUUUUUt4l"H$ @X,b'@ >cC-$qJ A;X:+,234567J89;U<=>?U@ABCUDEFGUHIJKULMNOUPQRSUTUVWUXYZ[U\]^_U`abcUdUUUUt4N"H$ @Y,b'@  C-dw A;Xn@QTRR@jPRRH<(H<(nE$Q}RE,kPRU`8z{%@&d2@D" a@ LFDTyB Фuh$T UF"H$ @FY,b'@Fx"D"uTN)O  1̙/2// UetTE<$KUijklopqrs )G]1i4Q(q> i4Hu:Di4-q>)1e8#>@%1e8;-1e8>D11e8>51e8>D91e8>=1e8>DA1e8>M1e8>DQ1e8>U5i4:5P ,6AWAxAA,AAA"lQ>Q__ oo=1 O!"  9 #aa 1` B scr,0f ungn` `Ca80lB<0u""afoo`c V r;b,0nd;rk^2r ` C<0n`e`t<0Jr11u1}uy q0qyu @@{^k!@@p8@@< U^?%/7 1>/?X%i/!#.o}2bvuTQE z  @"1#0P贁Nk[T2gc= A [[sѤ1 (~&!ߟ 4" Qz91wUpQ U/tQHzJ-p-(4"b) 9}Q 2ǡWԯ|%}Q:`Se*:&毈ƿ*)2į1Sri0Z`c-1 :&QX#'_2q$"q1~  }u14! -AÞ|o@@ZT-H$@@ZVy6!2Џ(DPVhzل~N`rH )5 L^%/ϾSevv%+=ӑ1IYk}R$dTPd+))zԼn@Nӟ?@<" ?FhK% V#y6淚h&a廒Mat!ڑ1 r%t"&'s&'%81tR?+d+PF +(ŔbR`+ A`c`n`bqlaQz<< ґ1yGYk}AyCV"M&_+_zo\V%_____(OL^vvC1}O/1'<&/JRJ)r\)@sn.//C1#v//8,8n;?_?q<_4#1??;#bzy6;B9ޟOEOWOiO{OOOFOOOuo_Bo/_|d\_n_*___uXoo:booop'ooooo 2ПVhzzN%0uèzԱy 0BTfxߜҏ,>Pbtc_ïԱ }4$Imկy4[;:2G0@'ര1',G9<H/ł #7!|@@`0!@Į~s\ Lr#&'vӲ (w.&'@sa#va# ϐߜ/e $D /A/*F]!ܱ-7/?4!@J;'?4ԱJ7),>Pbtx.cgCrd1*F+FBF6/H(FFFFFFF///r_//??(?|9AJ?}8Ak?}8CWܱAؿ갚1??'9KϠ]oρϴzD@ u iDss(-DT! ~FԠF&1 7ߚtV$r6qۜrdK_]__jaӒcQ` AcentConorz0BA= dvAco+sAh vϟ)7uN`U+˶ACoUogoyooooozo@ }D}X4FXʴFԴFĶ!jŜv X/ew0Bʏ܏x"4FXjώ@M tA,$6ﱯl~ZXo ۯL*N`r곁ɿۿ#n@_BP(L_Ei^pypπϔjzFtFՠ <ݚwN!1Cu/gyߋߝ߯ -?Qcu.]j*` MFEdpO5OyLyOOAm4O#O_KOokRG6x5 551$  oj Jd@ @@9N!@@S( Bp&od2?d?d{?)81fff?Sbfffffd/r, 1:(1*?<9eAs7|3Ik1 6PYa#ar.lH!PeaasQuH i8eT5borg]sprvp @Ho=4EW8@@Vjx?@Md䚕?QNQd*=W$//$w?>?P?Rb=s=5(lHPbt@%LI.l /h.Rq/ * I I x$"Im8h@/d,yLoJL@@Vj5\ jZ?@ x??[r;I[1I'Iu`F` CO25vAvA ` AcnpfODV`ETnpny6VOO3o1`9OK2 ;SyIe6* ` 9X+OfehZ v[Y_~ `9Dit,G6`9UMgii['?qo?@FP(?oEELn O95 u`?uph@mf fW uFi` zeRu|a2 ;C `ze*_K"C ze?mmob4ɓKϟs #z^p#a{ ݥ鯊ϥ\~"vT pApAN3ۄ@o1o1uaaQ Q7"B"9)x2:6@bra=>jՒ2G"b`bPŔ a~"'"@6%Nށ'!m'#~1 !CdpA(qQ pᷴ'#Nآm xҮ P*JR?@klkF@@u.*x 40%B%pQx5V@eδ翐ॣu@RO4a{craS`1bb@r#ӹg@l.@ hŐMQeɠ=% 1 U+puRlMs*@jށȘQȁ5rl>j$ʯܩ$Itm2m9#mIrjb}38b \ q7߹g ubkbWgz `z"!;aNa]k$bt{awlo'9K@oO:ZaGFdwM (ui&w?CG@RF`0ΘZ򟟎}y̌.O$ 1CUgyJԈ>_a&v_ǜ"ٖ.nRkٖ}"ϡQmfW7+M_qyRoݿiA[*&[?RSߜπPϯ{l$>eQQQQߴߞѺ1AJ)zo.?XUoy p ՟oRON@1&q_*5w?@c&?@1S9S_O$$׀a+/߼@ n/ VЖQ*JRe@_R_d_v__K/w:Nٿ\f@{<o.o@oRo doѿ_Zv9_oo$6qo}oZvR얧4X $(!#ҎWM @y<@4xҮ@PR4Xb4)ـe5؏;/l%#ROT*G.>i q!Tq‰╁‹4q'_2q꠼4ڋ!0†"` TextCoror zې0` La=inFAn=J3` Asaa&4` @mpr:dj ({ҧ}FuP(?!3. jϩuu аBEgCri9h qHɴ1TEL .$$KL‚a̱/q wѥ?Q@a)q}hGдOGј(/ߋL -d2L@@b@3~߾g~[r}; 1 k' u`FH?u8uq_'!b0ց!ِJz@V4uq<@&10ABCdwy@xRb8-դ&M #zx,wcUK>V) $(JJČTıSq$ !~ ~ 惥3*4upVp/o.̀A{Gz?Q? ` uSnaow?'9` UFlP[t9rJSu?P`` u[` 2VIN=-1 Acx`u)TGsaG'cyI"/+/djqjqO0S 񐒿0q40s"tgWWޢ5T,@74?qc;a`񊁄 QVC[yAjia,pLs┴x f MZ[?7@Њ3@Bu@u]a?qPbHwV[d3`LsFx/P/b/t//+U//?;WцQ-aagԑT-qA }??p8Q1 J?F2}~&q#?RkȆR_vjTk-z^E|?@U?el?@ ]{ ҵ?@iLyp&Ӝ4V]Y-tA?@e"9c?@ZOFIvPPtq?@:S[?@Qn?@3jvP?-qC0qp2Z`?@#I e?@t:s[O, ?@bַ(?@6\,k?@?z@>?@BT!0/T51e$ݧJA3V5@ ?hhU 6-vQ*$Qk/////UPt5weB+sliMy?????."?FrUM?6OKO]OoOOO?MeOF_i(ݧl\\_n__ϴ@x<@sn(ֿ@MZ[@आQp\5oYop8gyoF= ǤoloNVQi50Q ݢT0QPi u?u޵c0QW'2KqGz!'ۿ0Of"ݡ` TextCoϠorz` L}ainFn3` Aspa&ݡ4;` mpϠWj%{/NFҰ(@[?N!3gh\NǟuE-޵Srv /%Rpہt*yH&\WT5L.W1pVas1)etR4Q ԡ-!s1Q!QQaWhx-&kᴡiWkL Qd2L@@*"= @eN q[ar;1'uv&`Ft?ud_ࣄ)bZ!ෲ.@V1d 1<1.TQABCd&"2y1 dҧs3Uhb@kX!1DKJnذA1h0lhlKlhhhh h h h h B{FF 1Cc{Cb34WQd@/o.ƒ̀\ pA{Gz?hQk? ^` S۠a5'ow_` Fpl(UPtnSbu `` ` 2@@㫁- Ac\eĂ0LK`T߁saac(9`P Sy*a ` XOfQs(LJ: @ YO^H `DpcÁ6a`Mgi{i\𹃰 {W1X?F?@O@@xqyД@Le廒5b up`T?upM @m±h Qh q@s1F5` DRudgӶ `DDQQ4WqXwKP.i#{KRӠQQ0+̰@a6E/b apz%At-8kH1\ k"@TQb::4r34Nb99"ii74AA 94B:D4Rm"PP+='D>4D bAAcQmnwxb,,0!QCQDԢ;xHTT,@BᑀAu10Q H1CǁiOpC?tXb _ X,?B@a*Rr@[U@dU07ArA2G& OD24G*OC BxèE2N4_EŸK_F :ko}hWPèEBU?uwoD dooZèEm% 'A+ܹJEc!rm~ܶ@rSsv@ưV @uYH/yj|ɨEM,ԡUuU6_=D!4_xp1*qȢHㅭ5r6AlR4r__hQ$lVϨWLBv tˏ2ИpA#I1r\bGP31~ \p ưѣA!lR*[0r[0Œ'>Eq W|ư r */I'[.U:ߝN(F U"/ H(%%t'6O?qہ// {K/ +6Fd4)?//&M(p?/.3k'CP~/ ?-G)<'O?q?? OO1OCEROvO+fFV4t__OgE/-L F/8_=fF56FG?ok=_0}g?oo)o;oMo_oCOUOo3| g%oN% XuWfJ_\TfFlV_$E_'/MUl~hٮDf"{C]R|{h:[i\hY;èpʯܯqˁ5w?@ Ѥovԩ?@_1eX{?@#>RؘR_vj,uk-޾bz^-E|?@UtWel?@ ]{ ?@iL@&Ӝ4߆=Y-tA?@e"9c?@ZOF~uI PA?@:S[a ?@Qn?@3j -qװhu0q`P2Z`?@#I e?@t:i Dŀu[O, ?@bַ(?@6\,k?@?zNŀu'@>?@?BT!؝ $JUϢk@ 88%vFQI*m!/؟d @.@R†80t7'V WeBo90 .oo$&Œ/;X-ҏHo$&gq/d(JoUm///X!@x<@>m_ @X,d,M!U/Ϣ??p8,?OQOL/0B>|/0BD>/;B>/.B>09B>N0-B>{02B>0;B4>08B> 1IBi1JBTheDoc"Gestur Fom a FhrungsliieGuideSTR Normal&msvNoAWutCn 7ecPage-1"Zeichnblat -1visVerion*Byte oudrVai bl&Byte o]rvai7bl0Byte oudrVai bl. 1,Byte o]rvaiwbl.1"Zeichnblat -2Page-2EinfachBasicRe_chtkRectan7gl0Byte oudrVai bl.2,Byte o]rvaibl.202Byte oudrVa]i bl.31.Byte o]rvaibl.231Flus normaFlow NrmaBUmgekhrt sucwif_Klamr Revrs bac6msvPreiwIconCopT Pa g&msvStrucueTyp 4msvSDTarge_tIn eusc io 4msvSDCaloutNHi'ght(msvSDCalou]ttye2msvSDCalou]ttyen *msvSha_peCtgorisOrientaioHi_deLaruAtachToSide"Re_sizW_thTxSideLewadrBginLeadrE n(WHBoxInterUscin IsEndnteri oExtens7ioInsetSideMpont&fnMidp}ontOfse&CaloutuSyeR oCStyle1CStyle2CStyle3CStyle4CStyle5CStyle6CStyle7CStyle8CStyle9CStyle10CStyle 1CStyle12CStyle13CStyle14CStyle15CStyle16CStyle17CStyle18CStyle19CStyle20$Orient]aioR oOrientTopOrientWBotmOrient5LfOrientRghOrientAuoLeadrRotLeadrH inLewadrC7nt$LeadrMipontsuAsociaton$Design}fekt.1visUSETypemsvTheeInfomsvTheeyp(msvTheeLatinFo t(msvTheeAia_nFo t,msvTheeCoplxFnt6msvTheeLinTra sprncy,msvTheeLinPate r *msvTheeLin]Wigt.msvTheeLin_Rou dg@msvTheeCon _ectrwra sprny6msvTheeCon ectrWPatr 4msvTheeCon ectr]Wigt8msvTheeCon ectruRu di g2msvTheeCon ectrBgi .msvTheeCon ectrE d0msvTheeCon ectrE d2:msvTheeCon ectr]Bgi S z6msvTheeCon ectrE dSi z6msvTheeFil Tranprncy,msvTheeFil Patern:msvTheeSadWowr np rncy0msvTheeSad_owP tern,msvTheeSadowty l0msvTheeSadowXOfst0msvTheeSadowYOfst<msvTheeSadowM g_nifc 5to4msvTheeSadowDircton"msvTheeCol r$msvTheeEfe7ctVerbin dCo}nectr0Dynamische_r Vb7nd(Dynamic onetrTextPoWsiin2Byte oudrVa]i bl.3.Byte o]rvaibl.2 32Byte oudrVa]i bl. 3.Byte o]rvaibl.2 32Byte oudrVa]i bl.34.Byte o]rvaibl.2342Byte oudrVa]i bl.35.Byte o]rvaibl.2352Byte oudrVa]i bl.36.Byte o]rvaibl.2362Byte oudrVa]i bl.37.Byte o]rvaibl.2372Byte oudrVa]i bl.38.Byte o]rvaibl.238JUmgekhrt sucwif_Klamr.239(Revrs bac.239JUmgekhrt sucwif_Klamr.240(Revrs bac.240JUmgekhrt sucwif_Klamr.241(Revrs bac.241 Textan}mrkug$Text AUnoainuAtribuesBpmnId"BpmnCategoris(BpmnDocueta in&BpmnArtifa]cTyeBpmnNaeBpmnStae"BpmnPruoetis,BpmnPruoetis_Nae,BpmnPruoetis_Ty.BpmnPruoetis_Va7luLBpmnPruoetis_Valu_EUxr s oBdyTBpmnPruoetis_Valu_EUxr s o]Lnga9e:BpmnPruoeti_s_Cr_ela oBpmnText$BpmnCatego_ryRf$BpmnEleetTye6BpmnConectigOb]jTye(BpmnCoditT ye4BpmnCoditExres  RBpmnCoditExres _BdyZBpmnCoditExres _Lagu;g"BpmnMe]sagRf,BpmnMe]sagR_f_Nm8BpmnMe]sagRf_PruoetiBpmnMesagRf_Proeti_5NmBpmnMesagRf_Proeti_7TyDBpmnMe]sagRf_Pruoetiw_VlubBpmnMe]sagRf_Pruoetiw_Vlu__ExrinodyjBpmnMe]sagRf_Pruoetiw_Vlu__Exr]inLn uPBpmnMe]sagRwf_roeti_uCrel o2BpmnMe]sagRf_Fro RBpmnMe]sagRf_Fro Prtic+pn.)TyeBpmnMesagRf_Froj Rl FBpmnMe]sagRwf_ro Eti'y .BpmnMe]sagRf_To NBpmnMe]sagRf_To Prtic'pn%Tye>BpmnMe]sagRf_To 5Rl BpmnMesagRf__To Eti#y  BpmnDirect o&Textan}mrkug.49*Text AUnoain.490msvWarwnOPesoal5If3hS3G3T3%G33$G3XT3E3T3G3`4A3`4A3`4A3`4A3Tg#4A3M'4A3a+4A3 a/4A334(G3hS[4G3p4%G3a4A3M4A3T4G3a4A3$a4A344+G3d4(G3܂51G3F5.G3Ԉt5%G3hS5G3iS5G3lT5E3K35G3K35G3M6A3M 6A3,a6A34a6A3G3 >"G3,B> G3b>,G3D>*G3t>.G3<>8G3?/G3M?+G3|x?.G3T3??G3<?8G3@5G3=R@9G3@4G3$@0G3\@2G3D=!A;G3=\A9G3=A8G3A/G3>A:G36B2G34hB/G3̆B2G3B2G3D>B=G3<8C7G3ToC%G3C'G3M3CG3M3CG3tC0G3dD)G3HD G3hD0G3D0G3D2G3TD0G3*E2G3Ĉ\E0G3E2G34E0G3lE2G3 F0G3܉PF2G3F0G3LF2G3F0G33GDG3XG)G3 3GDG3G)G3T 3GDG32H)G3Ta[HA3\a_HA3ԋcH#G3H%G3THG3jSHG3,H&G3$I)G3T+I)G3N3TIG3 N3mIG3TI$G3I.G3I-G3J1G3 38JIG3dJJPG3>J9G3rK4G3K(G3K1G3JK=G3$JG3D!3IM=G3!3MCG3MZG3#N]G3JNJG3,N1G3JNKG3!3FO5G34"3{O<G3dO-G3DJOGG3"3+P3G3"3^P6G3P$G3DP)G3tP+G3 Q2G3da>QA3laBQA3taFQA3|aJQA3aNQA3aRQA3aVQA3aZQA3a^QA3abQA3afQA3ajQA3anQA3arQA3avQA3azQA3a~QA3aQA3aQA3aQA3bQA3 bQA3bQA3bQA3$bQA3,bQA34bQA3RA3lcBRA3tcFRA3|cJRA3cNRA3cRRA3cVRA3cZRA3c^RA3cbRA3cfRA3cjRA3cnRA3crRA  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~     ]>rFxml:spaceprsrv]rFxmlns:vdhtp/%scea .i+ro of.+o/i iA/20*c6%et/ \n]rFxmlns:v14htp/'sUcea .i-ro oUf.-o/GUf=e'v=s=]o'200'Eet1 lnU&U-.t4 "H$ @Y,b'@  l!}C-dq+7 AU %t4 [l C>-D`7"AJ@ Q5lMR@Ql7RH<(H<(JEQmREQnR{dm]  g"4FXo 8)jJ(N1j@(yV4](\Ϡh^H }B`Z P`u~āz`S3 BvR̿R$TO!1ҡΥ)nPW'<^E+~1trd}51P24vR\$PjB="dikzK&DWGY ?pl*'"Dqn~%!././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/internals.rst0000644000076500000240000000321514641074756015710 0ustar00twstaff.. include:: global.rst.inc .. _internals: Internals ========= The internals chapter describes and analyses most of the inner workings of Borg. Borg uses a low-level, key-value store, the :ref:`repository`, and implements a more complex data structure on top of it, which is made up of the :ref:`manifest `, :ref:`archives `, :ref:`items ` and data :ref:`chunks`. Each repository can hold multiple :ref:`archives `, which represent individual backups that contain a full archive of the files specified when the backup was performed. Deduplication is performed globally across all data in the repository (multiple backups and even multiple hosts), both on data and file metadata, using :ref:`chunks` created by the chunker using the Buzhash_ algorithm ("buzhash" chunker) or a simpler fixed blocksize algorithm ("fixed" chunker). To actually perform the repository-wide deduplication, a hash of each chunk is checked against the :ref:`chunks cache `, which is a hash-table of all chunks that already exist. .. figure:: internals/structure.png :figwidth: 100% :width: 100% Layers in Borg. On the very top commands are implemented, using a data access layer provided by the Archive and Item classes. The "key" object provides both compression and authenticated encryption used by the data access layer. The "key" object represents the sole trust boundary in Borg. The lowest layer is the repository, either accessed directly (Repository) or remotely (RemoteRepository). .. toctree:: :caption: Internals contents internals/security internals/data-structures internals/frontends ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/introduction.rst0000644000076500000240000000035014641074756016427 0ustar00twstaffIntroduction ============ .. this shim is here to fix the structure in the PDF rendering. without this stub, the elements in the toctree of index.rst show up a level below the README file included .. include:: ../README.rst ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719958149.7745364 borgbackup-1.4.0/docs/man/0000755000076500000240000000000014641075206013720 5ustar00twstaff././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/man/borg-benchmark-crud.10000644000076500000240000000671214641074756017635 0ustar00twstaff.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "BORG-BENCHMARK-CRUD" 1 "2024-07-02" "" "borg backup tool" .SH NAME borg-benchmark-crud \- Benchmark Create, Read, Update, Delete for archives. .SH SYNOPSIS .sp borg [common options] benchmark crud [options] REPOSITORY PATH .SH DESCRIPTION .sp This command benchmarks borg CRUD (create, read, update, delete) operations. .sp It creates input data below the given PATH and backups this data into the given REPO. The REPO must already exist (it could be a fresh empty repo or an existing repo, the command will create / read / update / delete some archives named borg\-benchmark\-crud* there. .sp Make sure you have free space there, you\(aqll need about 1GB each (+ overhead). .sp If your repository is encrypted and borg needs a passphrase to unlock the key, use: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C BORG_PASSPHRASE=mysecret borg benchmark crud REPO PATH .ft P .fi .UNINDENT .UNINDENT .sp Measurements are done with different input file sizes and counts. The file contents are very artificial (either all zero or all random), thus the measurement results do not necessarily reflect performance with real data. Also, due to the kind of content used, no compression is used in these benchmarks. .INDENT 0.0 .TP .B C\- == borg create (1st archive creation, no compression, do not use files cache) C\-Z\- == all\-zero files. full dedup, this is primarily measuring reader/chunker/hasher. C\-R\- == random files. no dedup, measuring throughput through all processing stages. .TP .B R\- == borg extract (extract archive, dry\-run, do everything, but do not write files to disk) R\-Z\- == all zero files. Measuring heavily duplicated files. R\-R\- == random files. No duplication here, measuring throughput through all processing stages, except writing to disk. .TP .B U\- == borg create (2nd archive creation of unchanged input files, measure files cache speed) The throughput value is kind of virtual here, it does not actually read the file. U\-Z\- == needs to check the 2 all\-zero chunks\(aq existence in the repo. U\-R\- == needs to check existence of a lot of different chunks in the repo. .TP .B D\- == borg delete archive (delete last remaining archive, measure deletion + compaction) D\-Z\- == few chunks to delete / few segments to compact/remove. D\-R\- == many chunks to delete / many segments to compact/remove. .UNINDENT .sp Please note that there might be quite some variance in these measurements. Try multiple measurements and having a otherwise idle machine (and network, if you use it). .SH OPTIONS .sp See \fIborg\-common(1)\fP for common options of Borg commands. .SS arguments .INDENT 0.0 .TP .B REPOSITORY repository to use for benchmark (must exist) .TP .B PATH path were to create benchmark input data .UNINDENT .SH SEE ALSO .sp \fIborg\-common(1)\fP .SH AUTHOR The Borg Collective .\" Generated by docutils manpage writer. . ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/man/borg-benchmark.10000644000076500000240000000203414641074756016673 0ustar00twstaff.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "BORG-BENCHMARK" 1 "2024-07-02" "" "borg backup tool" .SH NAME borg-benchmark \- benchmark command .SH SYNOPSIS .nf borg [common options] benchmark crud ... .fi .sp .SH DESCRIPTION .sp These commands do various benchmarks. .SH SEE ALSO .sp \fIborg\-common(1)\fP, \fIborg\-benchmark\-crud(1)\fP .SH AUTHOR The Borg Collective .\" Generated by docutils manpage writer. . ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/man/borg-break-lock.10000644000076500000240000000255114641074756016757 0ustar00twstaff.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "BORG-BREAK-LOCK" 1 "2024-07-02" "" "borg backup tool" .SH NAME borg-break-lock \- Break the repository lock (e.g. in case it was left by a dead borg. .SH SYNOPSIS .sp borg [common options] break\-lock [options] [REPOSITORY] .SH DESCRIPTION .sp This command breaks the repository and cache locks. Please use carefully and only while no borg process (on any machine) is trying to access the Cache or the Repository. .SH OPTIONS .sp See \fIborg\-common(1)\fP for common options of Borg commands. .SS arguments .INDENT 0.0 .TP .B REPOSITORY repository for which to break the locks .UNINDENT .SH SEE ALSO .sp \fIborg\-common(1)\fP .SH AUTHOR The Borg Collective .\" Generated by docutils manpage writer. . ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/man/borg-change-passphrase.10000644000076500000240000000303314641074756020335 0ustar00twstaff.\" Man page generated from reStructuredText. . .TH BORG-CHANGE-PASSPHRASE 1 "2017-11-25" "" "borg backup tool" .SH NAME borg-change-passphrase \- Change repository key file passphrase . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .SH SYNOPSIS .sp borg [common options] change\-passphrase [options] [REPOSITORY] .SH DESCRIPTION .sp The key files used for repository encryption are optionally passphrase protected. This command can be used to change this passphrase. .sp Please note that this command only changes the passphrase, but not any secret protected by it (like e.g. encryption/MAC keys or chunker seed). Thus, changing the passphrase after passphrase and borg key got compromised does not protect future (nor past) backups to the same repository. .SH OPTIONS .sp See \fIborg\-common(1)\fP for common options of Borg commands. .SS arguments .sp REPOSITORY .SH SEE ALSO .sp \fIborg\-common(1)\fP .SH AUTHOR The Borg Collective .\" Generated by docutils manpage writer. . ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/man/borg-check.10000644000076500000240000002164514641074756016027 0ustar00twstaff.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "BORG-CHECK" 1 "2024-07-02" "" "borg backup tool" .SH NAME borg-check \- Check repository consistency .SH SYNOPSIS .sp borg [common options] check [options] [REPOSITORY_OR_ARCHIVE] .SH DESCRIPTION .sp The check command verifies the consistency of a repository and its archives. It consists of two major steps: .INDENT 0.0 .IP 1. 3 Checking the consistency of the repository itself. This includes checking the segment magic headers, and both the metadata and data of all objects in the segments. The read data is checked by size and CRC. Bit rot and other types of accidental damage can be detected this way. Running the repository check can be split into multiple partial checks using \fB\-\-max\-duration\fP\&. When checking a remote repository, please note that the checks run on the server and do not cause significant network traffic. .IP 2. 3 Checking consistency and correctness of the archive metadata and optionally archive data (requires \fB\-\-verify\-data\fP). This includes ensuring that the repository manifest exists, the archive metadata chunk is present, and that all chunks referencing files (items) in the archive exist. This requires reading archive and file metadata, but not data. To cryptographically verify the file (content) data integrity pass \fB\-\-verify\-data\fP, but keep in mind that this requires reading all data and is hence very time consuming. When checking archives of a remote repository, archive checks run on the client machine because they require decrypting data and therefore the encryption key. .UNINDENT .sp Both steps can also be run independently. Pass \fB\-\-repository\-only\fP to run the repository checks only, or pass \fB\-\-archives\-only\fP to run the archive checks only. .sp The \fB\-\-max\-duration\fP option can be used to split a long\-running repository check into multiple partial checks. After the given number of seconds the check is interrupted. The next partial check will continue where the previous one stopped, until the full repository has been checked. Assuming a complete check would take 7 hours, then running a daily check with \fB\-\-max\-duration=3600\fP (1 hour) would result in one full repository check per week. Doing a full repository check aborts any previous partial check; the next partial check will restart from the beginning. With partial repository checks you can run neither archive checks, nor enable repair mode. Consequently, if you want to use \fB\-\-max\-duration\fP you must also pass \fB\-\-repository\-only\fP, and must not pass \fB\-\-archives\-only\fP, nor \fB\-\-repair\fP\&. .sp \fBWarning:\fP Please note that partial repository checks (i.e. running it with \fB\-\-max\-duration\fP) can only perform non\-cryptographic checksum checks on the segment files. A full repository check (i.e. without \fB\-\-max\-duration\fP) can also do a repository index check. Enabling partial repository checks excepts archive checks for the same reason. Therefore partial checks may be useful with very large repositories only where a full check would take too long. .sp The \fB\-\-verify\-data\fP option will perform a full integrity verification (as opposed to checking the CRC32 of the segment) of data, which means reading the data from the repository, decrypting and decompressing it. It is a complete cryptographic verification and hence very time consuming, but will detect any accidental and malicious corruption. Tamper\-resistance is only guaranteed for encrypted repositories against attackers without access to the keys. You can not use \fB\-\-verify\-data\fP with \fB\-\-repository\-only\fP\&. .SS About repair mode .sp The check command is a readonly task by default. If any corruption is found, Borg will report the issue and proceed with checking. To actually repair the issues found, pass \fB\-\-repair\fP\&. .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 \fB\-\-repair\fP is a \fBPOTENTIALLY DANGEROUS FEATURE\fP and might lead to data loss! This does not just include data that was previously lost anyway, but might include more data for kinds of corruption it is not capable of dealing with. \fBBE VERY CAREFUL!\fP .UNINDENT .UNINDENT .sp Pursuant to the previous warning it is also highly recommended to test the reliability of the hardware running Borg with stress testing software. This especially includes storage and memory testers. Unreliable hardware might lead to additional data loss. .sp It is highly recommended to create a backup of your repository before running in repair mode (i.e. running it with \fB\-\-repair\fP). .sp Repair mode will attempt to fix any corruptions found. Fixing corruptions does not mean recovering lost data: Borg can not magically restore data lost due to e.g. a hardware failure. Repairing a repository means sacrificing some data for the sake of the repository as a whole and the remaining data. Hence it is, by definition, a potentially lossy task. .sp In practice, repair mode hooks into both the repository and archive checks: .INDENT 0.0 .IP 1. 3 When checking the repository\(aqs consistency, repair mode will try to recover as many objects from segments with integrity errors as possible, and ensure that the index is consistent with the data stored in the segments. .IP 2. 3 When checking the consistency and correctness of archives, repair mode might remove whole archives from the manifest if their archive metadata chunk is corrupt or lost. On a chunk level (i.e. the contents of files), repair mode will replace corrupt or lost chunks with a same\-size replacement chunk of zeroes. If a previously zeroed chunk reappears, repair mode will restore this lost chunk using the new chunk. Lastly, repair mode will also delete orphaned chunks (e.g. caused by read errors while creating the archive). .UNINDENT .sp Most steps taken by repair mode have a one\-time effect on the repository, like removing a lost archive from the repository. However, replacing a corrupt or lost chunk with an all\-zero replacement will have an ongoing effect on the repository: When attempting to extract a file referencing an all\-zero chunk, the \fBextract\fP command will distinctly warn about it. The FUSE filesystem created by the \fBmount\fP command will reject reading such a \(dqzero\-patched\(dq file unless a special mount option is given. .sp As mentioned earlier, Borg might be able to \(dqheal\(dq a \(dqzero\-patched\(dq file in repair mode, if all its previously lost chunks reappear (e.g. via a later backup). This is achieved by Borg not only keeping track of the all\-zero replacement chunks, but also by keeping metadata about the lost chunks. In repair mode Borg will check whether a previously lost chunk reappeared and will replace the all\-zero replacement chunk by the reappeared chunk. If all lost chunks of a \(dqzero\-patched\(dq file reappear, this effectively \(dqheals\(dq the file. Consequently, if lost chunks were repaired earlier, it is advised to run \fB\-\-repair\fP a second time after creating some new backups. .SH OPTIONS .sp See \fIborg\-common(1)\fP for common options of Borg commands. .SS arguments .INDENT 0.0 .TP .B REPOSITORY_OR_ARCHIVE repository or archive to check consistency of .UNINDENT .SS optional arguments .INDENT 0.0 .TP .B \-\-repository\-only only perform repository checks .TP .B \-\-archives\-only only perform archives checks .TP .B \-\-verify\-data perform cryptographic archive data integrity verification (conflicts with \fB\-\-repository\-only\fP) .TP .B \-\-repair attempt to repair any inconsistencies found .TP .B \-\-save\-space work slower, but using less space .TP .BI \-\-max\-duration \ SECONDS do only a partial repo check for max. SECONDS seconds (Default: unlimited) .UNINDENT .SS Archive filters .INDENT 0.0 .TP .BI \-P \ PREFIX\fR,\fB \ \-\-prefix \ PREFIX only consider archive names starting with this prefix. (deprecated) .TP .BI \-a \ GLOB\fR,\fB \ \-\-glob\-archives \ GLOB only consider archive names matching the glob. sh: rules apply (without actually using the sh: prefix), see \(dqborg help patterns\(dq. .TP .BI \-\-sort\-by \ KEYS Comma\-separated list of sorting keys; valid keys are: timestamp, archive, name, id; default is: timestamp .TP .BI \-\-first \ N consider first N archives after other filters were applied .TP .BI \-\-last \ N consider last N archives after other filters were applied .UNINDENT .SH SEE ALSO .sp \fIborg\-common(1)\fP .SH AUTHOR The Borg Collective .\" Generated by docutils manpage writer. . ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/man/borg-common.10000644000076500000240000000542414641074756016237 0ustar00twstaff.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "BORG-COMMON" 1 "2024-07-02" "" "borg backup tool" .SH NAME borg-common \- Common options of Borg commands .SH SYNOPSIS .INDENT 0.0 .TP .B \-h\fP,\fB \-\-help show this help message and exit .TP .B \-\-critical work on log level CRITICAL .TP .B \-\-error work on log level ERROR .TP .B \-\-warning work on log level WARNING (default) .TP .B \-\-info\fP,\fB \-v\fP,\fB \-\-verbose work on log level INFO .TP .B \-\-debug enable debug output, work on log level DEBUG .TP .BI \-\-debug\-topic \ TOPIC enable TOPIC debugging (can be specified multiple times). The logger path is borg.debug. if TOPIC is not fully qualified. .TP .B \-p\fP,\fB \-\-progress show progress information .TP .B \-\-iec format using IEC units (1KiB = 1024B) .TP .B \-\-log\-json Output one JSON object per log line instead of formatted text. .TP .BI \-\-lock\-wait \ SECONDS wait at most SECONDS for acquiring a repository/cache lock (default: 1). .TP .B \-\-bypass\-lock Bypass locking mechanism .TP .B \-\-show\-version show/log the borg version .TP .B \-\-show\-rc show/log the return code (rc) .TP .BI \-\-umask \ M set umask to M (local only, default: 0077) .TP .BI \-\-remote\-path \ PATH use PATH as borg executable on the remote (default: \(dqborg\(dq) .TP .BI \-\-remote\-ratelimit \ RATE deprecated, use \fB\-\-upload\-ratelimit\fP instead .TP .BI \-\-upload\-ratelimit \ RATE set network upload rate limit in kiByte/s (default: 0=unlimited) .TP .BI \-\-remote\-buffer \ UPLOAD_BUFFER deprecated, use \fB\-\-upload\-buffer\fP instead .TP .BI \-\-upload\-buffer \ UPLOAD_BUFFER set network upload buffer size in MiB. (default: 0=no buffer) .TP .B \-\-consider\-part\-files treat part files like normal files (e.g. to list/extract them) .TP .BI \-\-debug\-profile \ FILE Write execution profile in Borg format into FILE. For local use a Python\-compatible file can be generated by suffixing FILE with \(dq.pyprof\(dq. .TP .BI \-\-rsh \ RSH Use this command to connect to the \(aqborg serve\(aq process (default: \(aqssh\(aq) .UNINDENT .SH SEE ALSO .sp \fIborg\-common(1)\fP .SH AUTHOR The Borg Collective .\" Generated by docutils manpage writer. . ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/man/borg-compact.10000644000076500000240000000534514641074756016377 0ustar00twstaff.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "BORG-COMPACT" 1 "2024-07-02" "" "borg backup tool" .SH NAME borg-compact \- compact segment files in the repository .SH SYNOPSIS .sp borg [common options] compact [options] [REPOSITORY] .SH DESCRIPTION .sp This command frees repository space by compacting segments. .sp Use this regularly to avoid running out of space \- you do not need to use this after each borg command though. It is especially useful after deleting archives, because only compaction will really free repository space. .sp borg compact does not need a key, so it is possible to invoke it from the client or also from the server. .sp Depending on the amount of segments that need compaction, it may take a while, so consider using the \fB\-\-progress\fP option. .sp A segment is compacted if the amount of saved space is above the percentage value given by the \fB\-\-threshold\fP option. If omitted, a threshold of 10% is used. When using \fB\-\-verbose\fP, borg will output an estimate of the freed space. .sp After upgrading borg (server) to 1.2+, you can use \fBborg compact \-\-cleanup\-commits\fP to clean up the numerous 17byte commit\-only segments that borg 1.1 did not clean up due to a bug. It is enough to do that once per repository. After cleaning up the commits, borg will also do a normal compaction. .sp See \fIseparate_compaction\fP in Additional Notes for more details. .SH OPTIONS .sp See \fIborg\-common(1)\fP for common options of Borg commands. .SS arguments .INDENT 0.0 .TP .B REPOSITORY repository to compact .UNINDENT .SS optional arguments .INDENT 0.0 .TP .B \-\-cleanup\-commits cleanup commit\-only 17\-byte segment files .TP .BI \-\-threshold \ PERCENT set minimum threshold for saved space in PERCENT (Default: 10) .UNINDENT .SH EXAMPLES .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C # compact segments and free repo disk space $ borg compact /path/to/repo # same as above plus clean up 17byte commit\-only segments $ borg compact \-\-cleanup\-commits /path/to/repo .ft P .fi .UNINDENT .UNINDENT .SH SEE ALSO .sp \fIborg\-common(1)\fP .SH AUTHOR The Borg Collective .\" Generated by docutils manpage writer. . ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/man/borg-compression.10000644000076500000240000001130014641074756017276 0ustar00twstaff.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "BORG-COMPRESSION" 1 "2024-07-02" "" "borg backup tool" .SH NAME borg-compression \- Details regarding compression .SH DESCRIPTION .sp It is no problem to mix different compression methods in one repo, deduplication is done on the source data chunks (not on the compressed or encrypted data). .sp If some specific chunk was once compressed and stored into the repo, creating another backup that also uses this chunk will not change the stored chunk. So if you use different compression specs for the backups, whichever stores a chunk first determines its compression. See also borg recreate. .sp Compression is lz4 by default. If you want something else, you have to specify what you want. .sp Valid compression specifiers are: .INDENT 0.0 .TP .B none Do not compress. .TP .B lz4 Use lz4 compression. Very high speed, very low compression. (default) .TP .B zstd[,L] Use zstd (\(dqzstandard\(dq) compression, a modern wide\-range algorithm. If you do not explicitly give the compression level L (ranging from 1 to 22), it will use level 3. Archives compressed with zstd are not compatible with borg < 1.1.4. .TP .B zlib[,L] Use zlib (\(dqgz\(dq) compression. Medium speed, medium compression. If you do not explicitly give the compression level L (ranging from 0 to 9), it will use level 6. Giving level 0 (means \(dqno compression\(dq, but still has zlib protocol overhead) is usually pointless, you better use \(dqnone\(dq compression. .TP .B lzma[,L] Use lzma (\(dqxz\(dq) compression. Low speed, high compression. If you do not explicitly give the compression level L (ranging from 0 to 9), it will use level 6. Giving levels above 6 is pointless and counterproductive because it does not compress better due to the buffer size used by borg \- but it wastes lots of CPU cycles and RAM. .TP .B auto,C[,L] Use a built\-in heuristic to decide per chunk whether to compress or not. The heuristic tries with lz4 whether the data is compressible. For incompressible data, it will not use compression (uses \(dqnone\(dq). For compressible data, it uses the given C[,L] compression \- with C[,L] being any valid compression specifier. .TP .B obfuscate,SPEC,C[,L] Use compressed\-size obfuscation to make fingerprinting attacks based on the observable stored chunk size more difficult. Note: .INDENT 7.0 .IP \(bu 2 You must combine this with encryption, or it won\(aqt make any sense. .IP \(bu 2 Your repo size will be bigger, of course. .IP \(bu 2 A chunk is limited by the constant \fBMAX_DATA_SIZE\fP (cur. ~20MiB). .UNINDENT .sp The SPEC value determines how the size obfuscation works: .sp \fIRelative random reciprocal size variation\fP (multiplicative) .sp Size will increase by a factor, relative to the compressed data size. Smaller factors are used often, larger factors rarely. .sp Available factors: .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C 1: 0.01 .. 100 2: 0.1 .. 1,000 3: 1 .. 10,000 4: 10 .. 100,000 5: 100 .. 1,000,000 6: 1,000 .. 10,000,000 .ft P .fi .UNINDENT .UNINDENT .sp Example probabilities for SPEC \fB1\fP: .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C 90 % 0.01 .. 0.1 9 % 0.1 .. 1 0.9 % 1 .. 10 0.09% 10 .. 100 .ft P .fi .UNINDENT .UNINDENT .sp \fIRandomly sized padding up to the given size\fP (additive) .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C 110: 1kiB (2 ^ (SPEC \- 100)) \&... 120: 1MiB \&... 123: 8MiB (max.) .ft P .fi .UNINDENT .UNINDENT .UNINDENT .sp Examples: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C borg create \-\-compression lz4 REPO::ARCHIVE data borg create \-\-compression zstd REPO::ARCHIVE data borg create \-\-compression zstd,10 REPO::ARCHIVE data borg create \-\-compression zlib REPO::ARCHIVE data borg create \-\-compression zlib,1 REPO::ARCHIVE data borg create \-\-compression auto,lzma,6 REPO::ARCHIVE data borg create \-\-compression auto,lzma ... borg create \-\-compression obfuscate,110,none ... borg create \-\-compression obfuscate,3,auto,zstd,10 ... borg create \-\-compression obfuscate,2,zstd,6 ... .ft P .fi .UNINDENT .UNINDENT .SH AUTHOR The Borg Collective .\" Generated by docutils manpage writer. . ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/man/borg-config.10000644000076500000240000000533514641074756016215 0ustar00twstaff.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "BORG-CONFIG" 1 "2024-07-02" "" "borg backup tool" .SH NAME borg-config \- get, set, and delete values in a repository or cache config file .SH SYNOPSIS .sp borg [common options] config [options] [REPOSITORY] [NAME] [VALUE] .SH DESCRIPTION .sp This command gets and sets options in a local repository or cache config file. For security reasons, this command only works on local repositories. .sp To delete a config value entirely, use \fB\-\-delete\fP\&. To list the values of the configuration file or the default values, use \fB\-\-list\fP\&. To get and existing key, pass only the key name. To set a key, pass both the key name and the new value. Keys can be specified in the format \(dqsection.name\(dq or simply \(dqname\(dq; the section will default to \(dqrepository\(dq and \(dqcache\(dq for the repo and cache configs, respectively. .sp By default, borg config manipulates the repository config file. Using \fB\-\-cache\fP edits the repository cache\(aqs config file instead. .SH OPTIONS .sp See \fIborg\-common(1)\fP for common options of Borg commands. .SS arguments .INDENT 0.0 .TP .B REPOSITORY repository to configure .TP .B NAME name of config key .TP .B VALUE new value for key .UNINDENT .SS optional arguments .INDENT 0.0 .TP .B \-c\fP,\fB \-\-cache get and set values from the repo cache .TP .B \-d\fP,\fB \-\-delete delete the key from the config file .TP .B \-l\fP,\fB \-\-list list the configuration of the repo .UNINDENT .SH EXAMPLES .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 The repository & cache config files are some of the only directly manipulable parts of a repository that aren\(aqt versioned or backed up, so be careful when making changes! .UNINDENT .UNINDENT .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C # find cache directory $ cd ~/.cache/borg/$(borg config /path/to/repo id) # reserve some space $ borg config /path/to/repo additional_free_space 2G # make a repo append\-only $ borg config /path/to/repo append_only 1 .ft P .fi .UNINDENT .UNINDENT .SH SEE ALSO .sp \fIborg\-common(1)\fP .SH AUTHOR The Borg Collective .\" Generated by docutils manpage writer. . ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/man/borg-create.10000644000076500000240000004744214641074756016220 0ustar00twstaff.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "BORG-CREATE" 1 "2024-07-02" "" "borg backup tool" .SH NAME borg-create \- Create new archive .SH SYNOPSIS .sp borg [common options] create [options] ARCHIVE [PATH...] .SH DESCRIPTION .sp This command creates a backup archive containing all files found while recursively traversing all paths specified. Paths are added to the archive as they are given, that means if relative paths are desired, the command has to be run from the correct directory. .sp The slashdot hack in paths (recursion roots) is triggered by using \fB/./\fP: \fB/this/gets/stripped/./this/gets/archived\fP means to process that fs object, but strip the prefix on the left side of \fB\&./\fP from the archived items (in this case, \fBthis/gets/archived\fP will be the path in the archived item). .sp When giving \(aq\-\(aq as path, borg will read data from standard input and create a file \(aqstdin\(aq in the created archive from that data. In some cases it\(aqs more appropriate to use \-\-content\-from\-command, however. See section \fIReading from stdin\fP below for details. .sp The archive will consume almost no disk space for files or parts of files that have already been stored in other archives. .sp The archive name needs to be unique. It must not end in \(aq.checkpoint\(aq or \(aq.checkpoint.N\(aq (with N being a number), because these names are used for checkpoints and treated in special ways. .sp In the archive name, you may use the following placeholders: {now}, {utcnow}, {fqdn}, {hostname}, {user} and some others. .sp Backup speed is increased by not reprocessing files that are already part of existing archives and weren\(aqt modified. The detection of unmodified files is done by comparing multiple file metadata values with previous values kept in the files cache. .sp This comparison can operate in different modes as given by \fB\-\-files\-cache\fP: .INDENT 0.0 .IP \(bu 2 ctime,size,inode (default) .IP \(bu 2 mtime,size,inode (default behaviour of borg versions older than 1.1.0rc4) .IP \(bu 2 ctime,size (ignore the inode number) .IP \(bu 2 mtime,size (ignore the inode number) .IP \(bu 2 rechunk,ctime (all files are considered modified \- rechunk, cache ctime) .IP \(bu 2 rechunk,mtime (all files are considered modified \- rechunk, cache mtime) .IP \(bu 2 disabled (disable the files cache, all files considered modified \- rechunk) .UNINDENT .sp inode number: better safety, but often unstable on network filesystems .sp Normally, detecting file modifications will take inode information into consideration to improve the reliability of file change detection. This is problematic for files located on sshfs and similar network file systems which do not provide stable inode numbers, such files will always be considered modified. You can use modes without \fIinode\fP in this case to improve performance, but reliability of change detection might be reduced. .sp ctime vs. mtime: safety vs. speed .INDENT 0.0 .IP \(bu 2 ctime is a rather safe way to detect changes to a file (metadata and contents) as it can not be set from userspace. But, a metadata\-only change will already update the ctime, so there might be some unnecessary chunking/hashing even without content changes. Some filesystems do not support ctime (change time). E.g. doing a chown or chmod to a file will change its ctime. .IP \(bu 2 mtime usually works and only updates if file contents were changed. But mtime can be arbitrarily set from userspace, e.g. to set mtime back to the same value it had before a content change happened. This can be used maliciously as well as well\-meant, but in both cases mtime based cache modes can be problematic. .UNINDENT .sp The mount points of filesystems or filesystem snapshots should be the same for every creation of a new archive to ensure fast operation. This is because the file cache that is used to determine changed files quickly uses absolute filenames. If this is not possible, consider creating a bind mount to a stable location. .sp The \fB\-\-progress\fP option shows (from left to right) Original, Compressed and Deduplicated (O, C and D, respectively), then the Number of files (N) processed so far, followed by the currently processed path. .sp When using \fB\-\-stats\fP, you will get some statistics about how much data was added \- the \(dqThis Archive\(dq deduplicated size there is most interesting as that is how much your repository will grow. Please note that the \(dqAll archives\(dq stats refer to the state after creation. Also, the \fB\-\-stats\fP and \fB\-\-dry\-run\fP options are mutually exclusive because the data is not actually compressed and deduplicated during a dry run. .sp For more help on include/exclude patterns, see the \fIborg_patterns\fP command output. .sp For more help on placeholders, see the \fIborg_placeholders\fP command output. .SH OPTIONS .sp See \fIborg\-common(1)\fP for common options of Borg commands. .SS arguments .INDENT 0.0 .TP .B ARCHIVE name of archive to create (must be also a valid directory name) .TP .B PATH paths to archive .UNINDENT .SS optional arguments .INDENT 0.0 .TP .B \-n\fP,\fB \-\-dry\-run do not create a backup archive .TP .B \-s\fP,\fB \-\-stats print statistics for the created archive .TP .B \-\-list output verbose list of items (files, dirs, ...) .TP .BI \-\-filter \ STATUSCHARS only display items with the given status characters (see description) .TP .B \-\-json output stats as JSON. Implies \fB\-\-stats\fP\&. .TP .B \-\-no\-cache\-sync experimental: do not synchronize the cache. Implies not using the files cache. .TP .BI \-\-stdin\-name \ NAME use NAME in archive for stdin data (default: \(aqstdin\(aq) .TP .BI \-\-stdin\-user \ USER set user USER in archive for stdin data (default: \(aqroot\(aq) .TP .BI \-\-stdin\-group \ GROUP set group GROUP in archive for stdin data (default: \(aqwheel\(aq) .TP .BI \-\-stdin\-mode \ M set mode to M in archive for stdin data (default: 0660) .TP .B \-\-content\-from\-command interpret PATH as command and store its stdout. See also section Reading from stdin below. .TP .B \-\-paths\-from\-stdin read DELIM\-separated list of paths to backup from stdin. All control is external: it will back up all files given \- no more, no less. .TP .B \-\-paths\-from\-command interpret PATH as command and treat its output as \fB\-\-paths\-from\-stdin\fP .TP .BI \-\-paths\-delimiter \ DELIM set path delimiter for \fB\-\-paths\-from\-stdin\fP and \fB\-\-paths\-from\-command\fP (default: \fB\en\fP) .UNINDENT .SS Include/Exclude options .INDENT 0.0 .TP .BI \-e \ PATTERN\fR,\fB \ \-\-exclude \ PATTERN exclude paths matching PATTERN .TP .BI \-\-exclude\-from \ EXCLUDEFILE read exclude patterns from EXCLUDEFILE, one per line .TP .BI \-\-pattern \ PATTERN include/exclude paths matching PATTERN .TP .BI \-\-patterns\-from \ PATTERNFILE read include/exclude patterns from PATTERNFILE, one per line .TP .B \-\-exclude\-caches exclude directories that contain a CACHEDIR.TAG file (\fI\%http://www.bford.info/cachedir/spec.html\fP) .TP .BI \-\-exclude\-if\-present \ NAME exclude directories that are tagged by containing a filesystem object with the given NAME .TP .B \-\-keep\-exclude\-tags if tag objects are specified with \fB\-\-exclude\-if\-present\fP, don\(aqt omit the tag objects themselves from the backup archive .TP .B \-\-exclude\-nodump exclude files flagged NODUMP .UNINDENT .SS Filesystem options .INDENT 0.0 .TP .B \-x\fP,\fB \-\-one\-file\-system stay in the same file system and do not store mount points of other file systems \- this might behave different from your expectations, see the description below. .TP .B \-\-numeric\-owner deprecated, use \fB\-\-numeric\-ids\fP instead .TP .B \-\-numeric\-ids only store numeric user and group identifiers .TP .B \-\-noatime do not store atime into archive .TP .B \-\-atime do store atime into archive .TP .B \-\-noctime do not store ctime into archive .TP .B \-\-nobirthtime do not store birthtime (creation date) into archive .TP .B \-\-nobsdflags deprecated, use \fB\-\-noflags\fP instead .TP .B \-\-noflags do not read and store flags (e.g. NODUMP, IMMUTABLE) into archive .TP .B \-\-noacls do not read and store ACLs into archive .TP .B \-\-noxattrs do not read and store xattrs into archive .TP .B \-\-sparse detect sparse holes in input (supported only by fixed chunker) .TP .BI \-\-files\-cache \ MODE operate files cache in MODE. default: ctime,size,inode .TP .B \-\-read\-special open and read block and char device files as well as FIFOs as if they were regular files. Also follows symlinks pointing to these kinds of files. .UNINDENT .SS Archive options .INDENT 0.0 .TP .BI \-\-comment \ COMMENT add a comment text to the archive .TP .BI \-\-timestamp \ TIMESTAMP manually specify the archive creation date/time (UTC, yyyy\-mm\-ddThh:mm:ss format). Alternatively, give a reference file/directory. .TP .BI \-c \ SECONDS\fR,\fB \ \-\-checkpoint\-interval \ SECONDS write checkpoint every SECONDS seconds (Default: 1800) .TP .BI \-\-chunker\-params \ PARAMS specify the chunker parameters (ALGO, CHUNK_MIN_EXP, CHUNK_MAX_EXP, HASH_MASK_BITS, HASH_WINDOW_SIZE). default: buzhash,19,23,21,4095 .TP .BI \-C \ COMPRESSION\fR,\fB \ \-\-compression \ COMPRESSION select compression algorithm, see the output of the \(dqborg help compression\(dq command for details. .UNINDENT .SH EXAMPLES .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C # Backup ~/Documents into an archive named \(dqmy\-documents\(dq $ borg create /path/to/repo::my\-documents ~/Documents # same, but list all files as we process them $ borg create \-\-list /path/to/repo::my\-documents ~/Documents # Backup /mnt/disk/docs, but strip path prefix using the slashdot hack $ borg create /path/to/repo::docs /mnt/disk/./docs # Backup ~/Documents and ~/src but exclude pyc files $ borg create /path/to/repo::my\-files \e ~/Documents \e ~/src \e \-\-exclude \(aq*.pyc\(aq # Backup home directories excluding image thumbnails (i.e. only # /home//.thumbnails is excluded, not /home/*/*/.thumbnails etc.) $ borg create /path/to/repo::my\-files /home \e \-\-exclude \(aqsh:home/*/.thumbnails\(aq # Backup the root filesystem into an archive named \(dqroot\-YYYY\-MM\-DD\(dq # use zlib compression (good, but slow) \- default is lz4 (fast, low compression ratio) $ borg create \-C zlib,6 \-\-one\-file\-system /path/to/repo::root\-{now:%Y\-%m\-%d} / # Backup onto a remote host (\(dqpush\(dq style) via ssh to port 2222, # logging in as user \(dqborg\(dq and storing into /path/to/repo $ borg create ssh://borg@backup.example.org:2222/path/to/repo::{fqdn}\-root\-{now} / # Backup a remote host locally (\(dqpull\(dq style) using sshfs $ mkdir sshfs\-mount $ sshfs root@example.com:/ sshfs\-mount $ cd sshfs\-mount $ borg create /path/to/repo::example.com\-root\-{now:%Y\-%m\-%d} . $ cd .. $ fusermount \-u sshfs\-mount # Make a big effort in fine granular deduplication (big chunk management # overhead, needs a lot of RAM and disk space, see formula in internals # docs \- same parameters as borg < 1.0 or attic): $ borg create \-\-chunker\-params buzhash,10,23,16,4095 /path/to/repo::small /smallstuff # Backup a raw device (must not be active/in use/mounted at that time) $ borg create \-\-read\-special \-\-chunker\-params fixed,4194304 /path/to/repo::my\-sdx /dev/sdX # Backup a sparse disk image (must not be active/in use/mounted at that time) $ borg create \-\-sparse \-\-chunker\-params fixed,4194304 /path/to/repo::my\-disk my\-disk.raw # No compression (none) $ borg create \-\-compression none /path/to/repo::arch ~ # Super fast, low compression (lz4, default) $ borg create /path/to/repo::arch ~ # Less fast, higher compression (zlib, N = 0..9) $ borg create \-\-compression zlib,N /path/to/repo::arch ~ # Even slower, even higher compression (lzma, N = 0..9) $ borg create \-\-compression lzma,N /path/to/repo::arch ~ # Only compress compressible data with lzma,N (N = 0..9) $ borg create \-\-compression auto,lzma,N /path/to/repo::arch ~ # Use short hostname, user name and current time in archive name $ borg create /path/to/repo::{hostname}\-{user}\-{now} ~ # Similar, use the same datetime format that is default as of borg 1.1 $ borg create /path/to/repo::{hostname}\-{user}\-{now:%Y\-%m\-%dT%H:%M:%S} ~ # As above, but add nanoseconds $ borg create /path/to/repo::{hostname}\-{user}\-{now:%Y\-%m\-%dT%H:%M:%S.%f} ~ # Backing up relative paths by moving into the correct directory first $ cd /home/user/Documents # The root directory of the archive will be \(dqprojectA\(dq $ borg create /path/to/repo::daily\-projectA\-{now:%Y\-%m\-%d} projectA # Use external command to determine files to archive # Use \-\-paths\-from\-stdin with find to only backup files less than 1MB in size $ find ~ \-size \-1000k | borg create \-\-paths\-from\-stdin /path/to/repo::small\-files\-only # Use \-\-paths\-from\-command with find to only backup files from a given user $ borg create \-\-paths\-from\-command /path/to/repo::joes\-files \-\- find /srv/samba/shared \-user joe # Use \-\-paths\-from\-stdin with \-\-paths\-delimiter (for example, for filenames with newlines in them) $ find ~ \-size \-1000k \-print0 | borg create \e \-\-paths\-from\-stdin \e \-\-paths\-delimiter \(dq\e0\(dq \e /path/to/repo::smallfiles\-handle\-newline .ft P .fi .UNINDENT .UNINDENT .SH NOTES .sp The \fB\-\-exclude\fP patterns are not like tar. In tar \fB\-\-exclude\fP .bundler/gems will exclude foo/.bundler/gems. In borg it will not, you need to use \fB\-\-exclude\fP \(aq*/.bundler/gems\(aq to get the same effect. .sp In addition to using \fB\-\-exclude\fP patterns, it is possible to use \fB\-\-exclude\-if\-present\fP to specify the name of a filesystem object (e.g. a file or folder name) which, when contained within another folder, will prevent the containing folder from being backed up. By default, the containing folder and all of its contents will be omitted from the backup. If, however, you wish to only include the objects specified by \fB\-\-exclude\-if\-present\fP in your backup, and not include any other contents of the containing folder, this can be enabled through using the \fB\-\-keep\-exclude\-tags\fP option. .sp The \fB\-x\fP or \fB\-\-one\-file\-system\fP option excludes directories, that are mountpoints (and everything in them). It detects mountpoints by comparing the device number from the output of \fBstat()\fP of the directory and its parent directory. Specifically, it excludes directories for which \fBstat()\fP reports a device number different from the device number of their parent. In general: be aware that there are directories with device number different from their parent, which the kernel does not consider a mountpoint and also the other way around. Linux examples for this are bind mounts (possibly same device number, but always a mountpoint) and ALL subvolumes of a btrfs (different device number from parent but not necessarily a mountpoint). macOS examples are the apfs mounts of a typical macOS installation. Therefore, when using \fB\-\-one\-file\-system\fP, you should double\-check that the backup works as intended. .SS Item flags .sp \fB\-\-list\fP outputs a list of all files, directories and other file system items it considered (no matter whether they had content changes or not). For each item, it prefixes a single\-letter flag that indicates type and/or status of the item. .sp If you are interested only in a subset of that output, you can give e.g. \fB\-\-filter=AME\fP and it will only show regular files with A, M or E status (see below). .sp A uppercase character represents the status of a regular file relative to the \(dqfiles\(dq cache (not relative to the repo \-\- this is an issue if the files cache is not used). Metadata is stored in any case and for \(aqA\(aq and \(aqM\(aq also new data chunks are stored. For \(aqU\(aq all data chunks refer to already existing chunks. .INDENT 0.0 .IP \(bu 2 \(aqA\(aq = regular file, added (see also \fIa_status_oddity\fP in the FAQ) .IP \(bu 2 \(aqM\(aq = regular file, modified .IP \(bu 2 \(aqU\(aq = regular file, unchanged .IP \(bu 2 \(aqC\(aq = regular file, it changed while we backed it up .IP \(bu 2 \(aqE\(aq = regular file, an error happened while accessing/reading \fIthis\fP file .UNINDENT .sp A lowercase character means a file type other than a regular file, borg usually just stores their metadata: .INDENT 0.0 .IP \(bu 2 \(aqd\(aq = directory .IP \(bu 2 \(aqb\(aq = block device .IP \(bu 2 \(aqc\(aq = char device .IP \(bu 2 \(aqh\(aq = regular file, hardlink (to already seen inodes) .IP \(bu 2 \(aqs\(aq = symlink .IP \(bu 2 \(aqf\(aq = fifo .UNINDENT .sp Other flags used include: .INDENT 0.0 .IP \(bu 2 \(aqi\(aq = backup data was read from standard input (stdin) .IP \(bu 2 \(aq\-\(aq = dry run, item was \fInot\fP backed up .IP \(bu 2 \(aqx\(aq = excluded, item was \fInot\fP backed up .IP \(bu 2 \(aq?\(aq = missing status code (if you see this, please file a bug report!) .UNINDENT .SS Reading backup data from stdin .sp There are two methods to read from stdin. Either specify \fB\-\fP as path and pipe directly to borg: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C backup\-vm \-\-id myvm \-\-stdout | borg create REPO::ARCHIVE \- .ft P .fi .UNINDENT .UNINDENT .sp Or use \fB\-\-content\-from\-command\fP to have Borg manage the execution of the command and piping. If you do so, the first PATH argument is interpreted as command to execute and any further arguments are treated as arguments to the command: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C borg create \-\-content\-from\-command REPO::ARCHIVE \-\- backup\-vm \-\-id myvm \-\-stdout .ft P .fi .UNINDENT .UNINDENT .sp \fB\-\-\fP is used to ensure \fB\-\-id\fP and \fB\-\-stdout\fP are \fBnot\fP considered arguments to \fBborg\fP but rather \fBbackup\-vm\fP\&. .sp The difference between the two approaches is that piping to borg creates an archive even if the command piping to borg exits with a failure. In this case, \fBone can end up with truncated output being backed up\fP\&. Using \fB\-\-content\-from\-command\fP, in contrast, borg is guaranteed to fail without creating an archive should the command fail. The command is considered failed when it returned a non\-zero exit code. .sp Reading from stdin yields just a stream of data without file metadata associated with it, and the files cache is not needed at all. So it is safe to disable it via \fB\-\-files\-cache disabled\fP and speed up backup creation a bit. .sp By default, the content read from stdin is stored in a file called \(aqstdin\(aq. Use \fB\-\-stdin\-name\fP to change the name. .SS Feeding all file paths from externally .sp Usually, you give a starting path (recursion root) to borg and then borg automatically recurses, finds and backs up all fs objects contained in there (optionally considering include/exclude rules). .sp If you need more control and you want to give every single fs object path to borg (maybe implementing your own recursion or your own rules), you can use \fB\-\-paths\-from\-stdin\fP or \fB\-\-paths\-from\-command\fP (with the latter, borg will fail to create an archive should the command fail). .sp Borg supports paths with the slashdot hack to strip path prefixes here also. So, be careful not to unintentionally trigger that. .SH SEE ALSO .sp \fIborg\-common(1)\fP, \fIborg\-delete(1)\fP, \fIborg\-prune(1)\fP, \fIborg\-check(1)\fP, \fIborg\-patterns(1)\fP, \fIborg\-placeholders(1)\fP, \fIborg\-compression(1)\fP .SH AUTHOR The Borg Collective .\" Generated by docutils manpage writer. . ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/man/borg-delete.10000644000076500000240000001150714641074756016210 0ustar00twstaff.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "BORG-DELETE" 1 "2024-07-02" "" "borg backup tool" .SH NAME borg-delete \- Delete an existing repository or archives .SH SYNOPSIS .sp borg [common options] delete [options] [REPOSITORY_OR_ARCHIVE] [ARCHIVE...] .SH DESCRIPTION .sp This command deletes an archive from the repository or the complete repository. .sp Important: When deleting archives, repository disk space is \fBnot\fP freed until you run \fBborg compact\fP\&. .sp When you delete a complete repository, the security info and local cache for it (if any) are also deleted. Alternatively, you can delete just the local cache with the \fB\-\-cache\-only\fP option, or keep the security info with the \fB\-\-keep\-security\-info\fP option. .sp When in doubt, use \fB\-\-dry\-run \-\-list\fP to see what would be deleted. .sp When using \fB\-\-stats\fP, you will get some statistics about how much data was deleted \- the \(dqDeleted data\(dq deduplicated size there is most interesting as that is how much your repository will shrink. Please note that the \(dqAll archives\(dq stats refer to the state after deletion. .sp You can delete multiple archives by specifying a shell pattern to match multiple archives using the \fB\-\-glob\-archives GLOB\fP option (for more info on these patterns, see \fIborg_patterns\fP). .sp To avoid accidentally deleting archives, especially when using glob patterns, it might be helpful to use the \fB\-\-dry\-run\fP to test out the command without actually making any changes to the repository. .SH OPTIONS .sp See \fIborg\-common(1)\fP for common options of Borg commands. .SS arguments .INDENT 0.0 .TP .B REPOSITORY_OR_ARCHIVE repository or archive to delete .TP .B ARCHIVE archives to delete .UNINDENT .SS optional arguments .INDENT 0.0 .TP .B \-n\fP,\fB \-\-dry\-run do not change repository .TP .B \-\-list output verbose list of archives .TP .B \-s\fP,\fB \-\-stats print statistics for the deleted archive .TP .B \-\-cache\-only delete only the local cache for the given repository .TP .B \-\-force force deletion of corrupted archives, use \fB\-\-force \-\-force\fP in case \fB\-\-force\fP does not work. .TP .B \-\-keep\-security\-info keep the local security info when deleting a repository .TP .B \-\-save\-space work slower, but using less space .TP .BI \-c \ SECONDS\fR,\fB \ \-\-checkpoint\-interval \ SECONDS write checkpoint every SECONDS seconds (Default: 1800) .UNINDENT .SS Archive filters .INDENT 0.0 .TP .BI \-P \ PREFIX\fR,\fB \ \-\-prefix \ PREFIX only consider archive names starting with this prefix. (deprecated) .TP .BI \-a \ GLOB\fR,\fB \ \-\-glob\-archives \ GLOB only consider archive names matching the glob. sh: rules apply (without actually using the sh: prefix), see \(dqborg help patterns\(dq. .TP .BI \-\-sort\-by \ KEYS Comma\-separated list of sorting keys; valid keys are: timestamp, archive, name, id; default is: timestamp .TP .BI \-\-first \ N consider first N archives after other filters were applied .TP .BI \-\-last \ N consider last N archives after other filters were applied .UNINDENT .SH EXAMPLES .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C # delete a single backup archive: $ borg delete /path/to/repo::Monday # actually free disk space: $ borg compact /path/to/repo # delete all archives whose names begin with the machine\(aqs hostname followed by \(dq\-\(dq $ borg delete \-\-glob\-archives \(aq{hostname}\-*\(aq /path/to/repo # delete all archives whose names contain \(dq\-2012\-\(dq $ borg delete \-\-glob\-archives \(aq*\-2012\-*\(aq /path/to/repo # see what would be deleted if delete was run without \-\-dry\-run $ borg delete \-\-list \-\-dry\-run \-a \(aq*\-May\-*\(aq /path/to/repo # delete the whole repository and the related local cache: $ borg delete /path/to/repo You requested to completely DELETE the repository *including* all archives it contains: repo Mon, 2016\-02\-15 19:26:54 root\-2016\-02\-15 Mon, 2016\-02\-15 19:36:29 newname Mon, 2016\-02\-15 19:50:19 Type \(aqYES\(aq if you understand this and want to continue: YES .ft P .fi .UNINDENT .UNINDENT .SH SEE ALSO .sp \fIborg\-common(1)\fP, \fIborg\-compact(1)\fP .SH AUTHOR The Borg Collective .\" Generated by docutils manpage writer. . ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/man/borg-diff.10000644000076500000240000001054614641074756015660 0ustar00twstaff.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "BORG-DIFF" 1 "2024-07-02" "" "borg backup tool" .SH NAME borg-diff \- Diff contents of two archives .SH SYNOPSIS .sp borg [common options] diff [options] REPO::ARCHIVE1 ARCHIVE2 [PATH...] .SH DESCRIPTION .sp This command finds differences (file contents, user/group/mode) between archives. .sp A repository location and an archive name must be specified for REPO::ARCHIVE1. ARCHIVE2 is just another archive name in same repository (no repository location allowed). .sp For archives created with Borg 1.1 or newer diff automatically detects whether the archives are created with the same chunker params. If so, only chunk IDs are compared, which is very fast. .sp For archives prior to Borg 1.1 chunk contents are compared by default. If you did not create the archives with different chunker params, pass \fB\-\-same\-chunker\-params\fP\&. Note that the chunker params changed from Borg 0.xx to 1.0. .sp For more help on include/exclude patterns, see the \fIborg_patterns\fP command output. .SH OPTIONS .sp See \fIborg\-common(1)\fP for common options of Borg commands. .SS arguments .INDENT 0.0 .TP .B REPO::ARCHIVE1 repository location and ARCHIVE1 name .TP .B ARCHIVE2 ARCHIVE2 name (no repository location allowed) .TP .B PATH paths of items inside the archives to compare; patterns are supported .UNINDENT .SS optional arguments .INDENT 0.0 .TP .B \-\-numeric\-owner deprecated, use \fB\-\-numeric\-ids\fP instead .TP .B \-\-numeric\-ids only consider numeric user and group identifiers .TP .B \-\-same\-chunker\-params Override check of chunker parameters. .TP .B \-\-sort Sort the output lines by file path. .TP .B \-\-content\-only Only compare differences in content (exclude metadata differences) .TP .B \-\-json\-lines Format output as JSON Lines. .UNINDENT .SS Include/Exclude options .INDENT 0.0 .TP .BI \-e \ PATTERN\fR,\fB \ \-\-exclude \ PATTERN exclude paths matching PATTERN .TP .BI \-\-exclude\-from \ EXCLUDEFILE read exclude patterns from EXCLUDEFILE, one per line .TP .BI \-\-pattern \ PATTERN include/exclude paths matching PATTERN .TP .BI \-\-patterns\-from \ PATTERNFILE read include/exclude patterns from PATTERNFILE, one per line .UNINDENT .SH EXAMPLES .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ borg init \-e=none testrepo $ mkdir testdir $ cd testdir $ echo asdf > file1 $ dd if=/dev/urandom bs=1M count=4 > file2 $ touch file3 $ borg create ../testrepo::archive1 . $ chmod a+x file1 $ echo \(dqsomething\(dq >> file2 $ borg create ../testrepo::archive2 . $ echo \(dqtesting 123\(dq >> file1 $ rm file3 $ touch file4 $ borg create ../testrepo::archive3 . $ cd .. $ borg diff testrepo::archive1 archive2 [\-rw\-r\-\-r\-\- \-> \-rwxr\-xr\-x] file1 +135 B \-252 B file2 $ borg diff testrepo::archive2 archive3 +17 B \-5 B file1 added 0 B file4 removed 0 B file3 $ borg diff testrepo::archive1 archive3 +17 B \-5 B [\-rw\-r\-\-r\-\- \-> \-rwxr\-xr\-x] file1 +135 B \-252 B file2 added 0 B file4 removed 0 B file3 $ borg diff \-\-json\-lines testrepo::archive1 archive3 {\(dqpath\(dq: \(dqfile1\(dq, \(dqchanges\(dq: [{\(dqtype\(dq: \(dqmodified\(dq, \(dqadded\(dq: 17, \(dqremoved\(dq: 5}, {\(dqtype\(dq: \(dqmode\(dq, \(dqold_mode\(dq: \(dq\-rw\-r\-\-r\-\-\(dq, \(dqnew_mode\(dq: \(dq\-rwxr\-xr\-x\(dq}]} {\(dqpath\(dq: \(dqfile2\(dq, \(dqchanges\(dq: [{\(dqtype\(dq: \(dqmodified\(dq, \(dqadded\(dq: 135, \(dqremoved\(dq: 252}]} {\(dqpath\(dq: \(dqfile4\(dq, \(dqchanges\(dq: [{\(dqtype\(dq: \(dqadded\(dq, \(dqsize\(dq: 0}]} {\(dqpath\(dq: \(dqfile3\(dq, \(dqchanges\(dq: [{\(dqtype\(dq: \(dqremoved\(dq, \(dqsize\(dq: 0}] .ft P .fi .UNINDENT .UNINDENT .SH SEE ALSO .sp \fIborg\-common(1)\fP .SH AUTHOR The Borg Collective .\" Generated by docutils manpage writer. . ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/man/borg-export-tar.10000644000076500000240000001025314641074756017050 0ustar00twstaff.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "BORG-EXPORT-TAR" 1 "2024-07-02" "" "borg backup tool" .SH NAME borg-export-tar \- Export archive contents as a tarball .SH SYNOPSIS .sp borg [common options] export\-tar [options] ARCHIVE FILE [PATH...] .SH DESCRIPTION .sp This command creates a tarball from an archive. .sp When giving \(aq\-\(aq as the output FILE, Borg will write a tar stream to standard output. .sp By default (\fB\-\-tar\-filter=auto\fP) Borg will detect whether the FILE should be compressed based on its file extension and pipe the tarball through an appropriate filter before writing it to FILE: .INDENT 0.0 .IP \(bu 2 \&.tar.gz or .tgz: gzip .IP \(bu 2 \&.tar.bz2 or .tbz: bzip2 .IP \(bu 2 \&.tar.xz or .txz: xz .IP \(bu 2 \&.tar.zstd or .tar.zst: zstd .IP \(bu 2 \&.tar.lz4: lz4 .UNINDENT .sp Alternatively, a \fB\-\-tar\-filter\fP program may be explicitly specified. It should read the uncompressed tar stream from stdin and write a compressed/filtered tar stream to stdout. .sp The generated tarball uses the GNU tar format. .sp export\-tar is a lossy conversion: BSD flags, ACLs, extended attributes (xattrs), atime and ctime are not exported. Timestamp resolution is limited to whole seconds, not the nanosecond resolution otherwise supported by Borg. .sp A \fB\-\-sparse\fP option (as found in borg extract) is not supported. .sp By default the entire archive is extracted but a subset of files and directories can be selected by passing a list of \fBPATHs\fP as arguments. The file selection can further be restricted by using the \fB\-\-exclude\fP option. .sp For more help on include/exclude patterns, see the \fIborg_patterns\fP command output. .sp \fB\-\-progress\fP can be slower than no progress display, since it makes one additional pass over the archive metadata. .SH OPTIONS .sp See \fIborg\-common(1)\fP for common options of Borg commands. .SS arguments .INDENT 0.0 .TP .B ARCHIVE archive to export .TP .B FILE output tar file. \(dq\-\(dq to write to stdout instead. .TP .B PATH paths to extract; patterns are supported .UNINDENT .SS optional arguments .INDENT 0.0 .TP .B \-\-tar\-filter filter program to pipe data through .TP .B \-\-list output verbose list of items (files, dirs, ...) .UNINDENT .SS Include/Exclude options .INDENT 0.0 .TP .BI \-e \ PATTERN\fR,\fB \ \-\-exclude \ PATTERN exclude paths matching PATTERN .TP .BI \-\-exclude\-from \ EXCLUDEFILE read exclude patterns from EXCLUDEFILE, one per line .TP .BI \-\-pattern \ PATTERN include/exclude paths matching PATTERN .TP .BI \-\-patterns\-from \ PATTERNFILE read include/exclude patterns from PATTERNFILE, one per line .TP .BI \-\-strip\-components \ NUMBER Remove the specified number of leading path elements. Paths with fewer elements will be silently skipped. .UNINDENT .SH EXAMPLES .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C # export as uncompressed tar $ borg export\-tar /path/to/repo::Monday Monday.tar # exclude some types, compress using gzip $ borg export\-tar /path/to/repo::Monday Monday.tar.gz \-\-exclude \(aq*.so\(aq # use higher compression level with gzip $ borg export\-tar \-\-tar\-filter=\(dqgzip \-9\(dq testrepo::linux Monday.tar.gz # export a tar, but instead of storing it on disk, # upload it to a remote site using curl. $ borg export\-tar /path/to/repo::Monday \- | curl \-\-data\-binary @\- https://somewhere/to/POST # remote extraction via \(dqtarpipe\(dq $ borg export\-tar /path/to/repo::Monday \- | ssh somewhere \(dqcd extracted; tar x\(dq .ft P .fi .UNINDENT .UNINDENT .SH SEE ALSO .sp \fIborg\-common(1)\fP .SH AUTHOR The Borg Collective .\" Generated by docutils manpage writer. . ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/man/borg-extract.10000644000076500000240000001036714641074756016423 0ustar00twstaff.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "BORG-EXTRACT" 1 "2024-07-02" "" "borg backup tool" .SH NAME borg-extract \- Extract archive contents .SH SYNOPSIS .sp borg [common options] extract [options] ARCHIVE [PATH...] .SH DESCRIPTION .sp This command extracts the contents of an archive. By default the entire archive is extracted but a subset of files and directories can be selected by passing a list of \fBPATHs\fP as arguments. The file selection can further be restricted by using the \fB\-\-exclude\fP option. .sp For more help on include/exclude patterns, see the \fIborg_patterns\fP command output. .sp By using \fB\-\-dry\-run\fP, you can do all extraction steps except actually writing the output data: reading metadata and data chunks from the repo, checking the hash/hmac, decrypting, decompressing. .sp \fB\-\-progress\fP can be slower than no progress display, since it makes one additional pass over the archive metadata. .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 Currently, extract always writes into the current working directory (\(dq.\(dq), so make sure you \fBcd\fP to the right place before calling \fBborg extract\fP\&. .sp When parent directories are not extracted (because of using file/directory selection or any other reason), borg can not restore parent directories\(aq metadata, e.g. owner, group, permission, etc. .UNINDENT .UNINDENT .SH OPTIONS .sp See \fIborg\-common(1)\fP for common options of Borg commands. .SS arguments .INDENT 0.0 .TP .B ARCHIVE archive to extract .TP .B PATH paths to extract; patterns are supported .UNINDENT .SS optional arguments .INDENT 0.0 .TP .B \-\-list output verbose list of items (files, dirs, ...) .TP .B \-n\fP,\fB \-\-dry\-run do not actually change any files .TP .B \-\-numeric\-owner deprecated, use \fB\-\-numeric\-ids\fP instead .TP .B \-\-numeric\-ids only obey numeric user and group identifiers .TP .B \-\-nobsdflags deprecated, use \fB\-\-noflags\fP instead .TP .B \-\-noflags do not extract/set flags (e.g. NODUMP, IMMUTABLE) .TP .B \-\-noacls do not extract/set ACLs .TP .B \-\-noxattrs do not extract/set xattrs .TP .B \-\-stdout write all extracted data to stdout .TP .B \-\-sparse create holes in output sparse file from all\-zero chunks .UNINDENT .SS Include/Exclude options .INDENT 0.0 .TP .BI \-e \ PATTERN\fR,\fB \ \-\-exclude \ PATTERN exclude paths matching PATTERN .TP .BI \-\-exclude\-from \ EXCLUDEFILE read exclude patterns from EXCLUDEFILE, one per line .TP .BI \-\-pattern \ PATTERN include/exclude paths matching PATTERN .TP .BI \-\-patterns\-from \ PATTERNFILE read include/exclude patterns from PATTERNFILE, one per line .TP .BI \-\-strip\-components \ NUMBER Remove the specified number of leading path elements. Paths with fewer elements will be silently skipped. .UNINDENT .SH EXAMPLES .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C # Extract entire archive $ borg extract /path/to/repo::my\-files # Extract entire archive and list files while processing $ borg extract \-\-list /path/to/repo::my\-files # Verify whether an archive could be successfully extracted, but do not write files to disk $ borg extract \-\-dry\-run /path/to/repo::my\-files # Extract the \(dqsrc\(dq directory $ borg extract /path/to/repo::my\-files home/USERNAME/src # Extract the \(dqsrc\(dq directory but exclude object files $ borg extract /path/to/repo::my\-files home/USERNAME/src \-\-exclude \(aq*.o\(aq # Restore a raw device (must not be active/in use/mounted at that time) $ borg extract \-\-stdout /path/to/repo::my\-sdx | dd of=/dev/sdx bs=10M .ft P .fi .UNINDENT .UNINDENT .SH SEE ALSO .sp \fIborg\-common(1)\fP, \fIborg\-mount(1)\fP .SH AUTHOR The Borg Collective .\" Generated by docutils manpage writer. . ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/man/borg-import-tar.10000644000076500000240000000751614641074756017051 0ustar00twstaff.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "BORG-IMPORT-TAR" 1 "2024-07-02" "" "borg backup tool" .SH NAME borg-import-tar \- Create a backup archive from a tarball .SH SYNOPSIS .sp borg [common options] import\-tar [options] ARCHIVE TARFILE .SH DESCRIPTION .sp This command creates a backup archive from a tarball. .sp When giving \(aq\-\(aq as path, Borg will read a tar stream from standard input. .sp By default (\-\-tar\-filter=auto) Borg will detect whether the file is compressed based on its file extension and pipe the file through an appropriate filter: .INDENT 0.0 .IP \(bu 2 \&.tar.gz or .tgz: gzip \-d .IP \(bu 2 \&.tar.bz2 or .tbz: bzip2 \-d .IP \(bu 2 \&.tar.xz or .txz: xz \-d .IP \(bu 2 \&.tar.zstd or .tar.zst: zstd \-d .IP \(bu 2 \&.tar.lz4: lz4 \-d .UNINDENT .sp Alternatively, a \-\-tar\-filter program may be explicitly specified. It should read compressed data from stdin and output an uncompressed tar stream on stdout. .sp Most documentation of borg create applies. Note that this command does not support excluding files. .sp import\-tar is a lossy conversion: BSD flags, ACLs, extended attributes (xattrs), atime and ctime are not exported. Timestamp resolution is limited to whole seconds, not the nanosecond resolution otherwise supported by Borg. .sp A \fB\-\-sparse\fP option (as found in borg create) is not supported. .sp import\-tar reads POSIX.1\-1988 (ustar), POSIX.1\-2001 (pax), GNU tar, UNIX V7 tar and SunOS tar with extended attributes. .sp To import multiple tarballs into a single archive, they can be simply concatenated (e.g. using \(dqcat\(dq) into a single file, and imported with an \fB\-\-ignore\-zeros\fP option to skip through the stop markers between them. .SH OPTIONS .sp See \fIborg\-common(1)\fP for common options of Borg commands. .SS arguments .INDENT 0.0 .TP .B ARCHIVE name of archive to create (must be also a valid directory name) .TP .B TARFILE input tar file. \(dq\-\(dq to read from stdin instead. .UNINDENT .SS optional arguments .INDENT 0.0 .TP .B \-\-tar\-filter filter program to pipe data through .TP .B \-s\fP,\fB \-\-stats print statistics for the created archive .TP .B \-\-list output verbose list of items (files, dirs, ...) .TP .BI \-\-filter \ STATUSCHARS only display items with the given status characters .TP .B \-\-json output stats as JSON (implies \-\-stats) .TP .B \-\-ignore\-zeros ignore zero\-filled blocks in the input tarball .UNINDENT .SS Archive options .INDENT 0.0 .TP .BI \-\-comment \ COMMENT add a comment text to the archive .TP .BI \-\-timestamp \ TIMESTAMP manually specify the archive creation date/time (UTC, yyyy\-mm\-ddThh:mm:ss format). alternatively, give a reference file/directory. .TP .BI \-c \ SECONDS\fR,\fB \ \-\-checkpoint\-interval \ SECONDS write checkpoint every SECONDS seconds (Default: 1800) .TP .BI \-\-chunker\-params \ PARAMS specify the chunker parameters (ALGO, CHUNK_MIN_EXP, CHUNK_MAX_EXP, HASH_MASK_BITS, HASH_WINDOW_SIZE). default: buzhash,19,23,21,4095 .TP .BI \-C \ COMPRESSION\fR,\fB \ \-\-compression \ COMPRESSION select compression algorithm, see the output of the \(dqborg help compression\(dq command for details. .UNINDENT .SH SEE ALSO .sp \fIborg\-common(1)\fP .SH AUTHOR The Borg Collective .\" Generated by docutils manpage writer. . ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/man/borg-info.10000644000076500000240000001272114641074756015700 0ustar00twstaff.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "BORG-INFO" 1 "2024-07-02" "" "borg backup tool" .SH NAME borg-info \- Show archive details such as disk space used .SH SYNOPSIS .sp borg [common options] info [options] [REPOSITORY_OR_ARCHIVE] .SH DESCRIPTION .sp This command displays detailed information about the specified archive or repository. .sp Please note that the deduplicated sizes of the individual archives do not add up to the deduplicated size of the repository (\(dqall archives\(dq), because the two are meaning different things: .sp This archive / deduplicated size = amount of data stored ONLY for this archive = unique chunks of this archive. All archives / deduplicated size = amount of data stored in the repo = all chunks in the repository. .sp Borg archives can only contain a limited amount of file metadata. The size of an archive relative to this limit depends on a number of factors, mainly the number of files, the lengths of paths and other metadata stored for files. This is shown as \fIutilization of maximum supported archive size\fP\&. .SH OPTIONS .sp See \fIborg\-common(1)\fP for common options of Borg commands. .SS arguments .INDENT 0.0 .TP .B REPOSITORY_OR_ARCHIVE repository or archive to display information about .UNINDENT .SS optional arguments .INDENT 0.0 .TP .B \-\-json format output as JSON .UNINDENT .SS Archive filters .INDENT 0.0 .TP .BI \-P \ PREFIX\fR,\fB \ \-\-prefix \ PREFIX only consider archive names starting with this prefix. (deprecated) .TP .BI \-a \ GLOB\fR,\fB \ \-\-glob\-archives \ GLOB only consider archive names matching the glob. sh: rules apply (without actually using the sh: prefix), see \(dqborg help patterns\(dq. .TP .BI \-\-sort\-by \ KEYS Comma\-separated list of sorting keys; valid keys are: timestamp, archive, name, id; default is: timestamp .TP .BI \-\-first \ N consider first N archives after other filters were applied .TP .BI \-\-last \ N consider last N archives after other filters were applied .UNINDENT .SH EXAMPLES .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ borg info /path/to/repo::2017\-06\-29T11:00\-srv Archive name: 2017\-06\-29T11:00\-srv Archive fingerprint: b2f1beac2bd553b34e06358afa45a3c1689320d39163890c5bbbd49125f00fe5 Comment: Hostname: myhostname Username: root Time (start): Thu, 2017\-06\-29 11:03:07 Time (end): Thu, 2017\-06\-29 11:03:13 Duration: 5.66 seconds Number of files: 17037 Command line: /usr/sbin/borg create /path/to/repo::2017\-06\-29T11:00\-srv /srv Utilization of max. archive size: 0% \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- Original size Compressed size Deduplicated size This archive: 12.53 GB 12.49 GB 1.62 kB All archives: 121.82 TB 112.41 TB 215.42 GB Unique chunks Total chunks Chunk index: 1015213 626934122 $ borg info /path/to/repo \-\-last 1 Archive name: 2017\-06\-29T11:00\-srv Archive fingerprint: b2f1beac2bd553b34e06358afa45a3c1689320d39163890c5bbbd49125f00fe5 Comment: Hostname: myhostname Username: root Time (start): Thu, 2017\-06\-29 11:03:07 Time (end): Thu, 2017\-06\-29 11:03:13 Duration: 5.66 seconds Number of files: 17037 Command line: /usr/sbin/borg create /path/to/repo::2017\-06\-29T11:00\-srv /srv Utilization of max. archive size: 0% \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- Original size Compressed size Deduplicated size This archive: 12.53 GB 12.49 GB 1.62 kB All archives: 121.82 TB 112.41 TB 215.42 GB Unique chunks Total chunks Chunk index: 1015213 626934122 $ borg info /path/to/repo Repository ID: d857ce5788c51272c61535062e89eac4e8ef5a884ffbe976e0af9d8765dedfa5 Location: /path/to/repo Encrypted: Yes (repokey) Cache: /root/.cache/borg/d857ce5788c51272c61535062e89eac4e8ef5a884ffbe976e0af9d8765dedfa5 Security dir: /root/.config/borg/security/d857ce5788c51272c61535062e89eac4e8ef5a884ffbe976e0af9d8765dedfa5 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- Original size Compressed size Deduplicated size All archives: 121.82 TB 112.41 TB 215.42 GB Unique chunks Total chunks Chunk index: 1015213 626934122 .ft P .fi .UNINDENT .UNINDENT .SH SEE ALSO .sp \fIborg\-common(1)\fP, \fIborg\-list(1)\fP, \fIborg\-diff(1)\fP .SH AUTHOR The Borg Collective .\" Generated by docutils manpage writer. . ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/man/borg-init.10000644000076500000240000002134414641074756015711 0ustar00twstaff.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "BORG-INIT" 1 "2024-07-02" "" "borg backup tool" .SH NAME borg-init \- Initialize an empty repository .SH SYNOPSIS .sp borg [common options] init [options] [REPOSITORY] .SH DESCRIPTION .sp This command initializes an empty repository. A repository is a filesystem directory containing the deduplicated data from zero or more archives. .SS Encryption mode TLDR .sp The encryption mode can only be configured when creating a new repository \- you can neither configure it on a per\-archive basis nor change the encryption mode of an existing repository. .sp Use \fBrepokey\fP: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C borg init \-\-encryption repokey /path/to/repo .ft P .fi .UNINDENT .UNINDENT .sp Or \fBrepokey\-blake2\fP depending on which is faster on your client machines (see below): .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C borg init \-\-encryption repokey\-blake2 /path/to/repo .ft P .fi .UNINDENT .UNINDENT .sp Borg will: .INDENT 0.0 .IP 1. 3 Ask you to come up with a passphrase. .IP 2. 3 Create a borg key (which contains 3 random secrets. See \fIkey_files\fP). .IP 3. 3 Encrypt the key with your passphrase. .IP 4. 3 Store the encrypted borg key inside the repository directory (in the repo config). This is why it is essential to use a secure passphrase. .IP 5. 3 Encrypt and sign your backups to prevent anyone from reading or forging them unless they have the key and know the passphrase. Make sure to keep a backup of your key \fBoutside\fP the repository \- do not lock yourself out by \(dqleaving your keys inside your car\(dq (see \fIborg_key_export\fP). For remote backups the encryption is done locally \- the remote machine never sees your passphrase, your unencrypted key or your unencrypted files. Chunking and id generation are also based on your key to improve your privacy. .IP 6. 3 Use the key when extracting files to decrypt them and to verify that the contents of the backups have not been accidentally or maliciously altered. .UNINDENT .SS Picking a passphrase .sp Make sure you use a good passphrase. Not too short, not too simple. The real encryption / decryption key is encrypted with / locked by your passphrase. If an attacker gets your key, he can\(aqt unlock and use it without knowing the passphrase. .sp Be careful with special or non\-ascii characters in your passphrase: .INDENT 0.0 .IP \(bu 2 Borg processes the passphrase as unicode (and encodes it as utf\-8), so it does not have problems dealing with even the strangest characters. .IP \(bu 2 BUT: that does not necessarily apply to your OS / VM / keyboard configuration. .UNINDENT .sp So better use a long passphrase made from simple ascii chars than one that includes non\-ascii stuff or characters that are hard/impossible to enter on a different keyboard layout. .sp You can change your passphrase for existing repos at any time, it won\(aqt affect the encryption/decryption key or other secrets. .SS More encryption modes .sp Only use \fB\-\-encryption none\fP if you are OK with anyone who has access to your repository being able to read your backups and tamper with their contents without you noticing. .sp If you want \(dqpassphrase and having\-the\-key\(dq security, use \fB\-\-encryption keyfile\fP\&. The key will be stored in your home directory (in \fB~/.config/borg/keys\fP). .sp If you do \fBnot\fP want to encrypt the contents of your backups, but still want to detect malicious tampering use \fB\-\-encryption authenticated\fP\&. To normally work with \fBauthenticated\fP repos, you will need the passphrase, but there is an emergency workaround, see \fBBORG_WORKAROUNDS=authenticated_no_key\fP docs. .sp If \fBBLAKE2b\fP is faster than \fBSHA\-256\fP on your hardware, use \fB\-\-encryption authenticated\-blake2\fP, \fB\-\-encryption repokey\-blake2\fP or \fB\-\-encryption keyfile\-blake2\fP\&. Note: for remote backups the hashing is done on your local machine. .\" nanorst: inline-fill . .TS center; |l|l|l|l|. _ T{ Hash/MAC T} T{ Not encrypted no auth T} T{ Not encrypted, but authenticated T} T{ Encrypted (AEAD w/ AES) and authenticated T} _ T{ SHA\-256 T} T{ none T} T{ \fIauthenticated\fP T} T{ repokey keyfile T} _ T{ BLAKE2b T} T{ n/a T} T{ \fIauthenticated\-blake2\fP T} T{ \fIrepokey\-blake2\fP \fIkeyfile\-blake2\fP T} _ .TE .\" nanorst: inline-replace . .sp Modes \fImarked like this\fP in the above table are new in Borg 1.1 and are not backwards\-compatible with Borg 1.0.x. .sp On modern Intel/AMD CPUs (except very cheap ones), AES is usually hardware\-accelerated. BLAKE2b is faster than SHA256 on Intel/AMD 64\-bit CPUs (except AMD Ryzen and future CPUs with SHA extensions), which makes \fIauthenticated\-blake2\fP faster than \fInone\fP and \fIauthenticated\fP\&. .sp On modern ARM CPUs, NEON provides hardware acceleration for SHA256 making it faster than BLAKE2b\-256 there. NEON accelerates AES as well. .sp Hardware acceleration is always used automatically when available. .sp \fIrepokey\fP and \fIkeyfile\fP use AES\-CTR\-256 for encryption and HMAC\-SHA256 for authentication in an encrypt\-then\-MAC (EtM) construction. The chunk ID hash is HMAC\-SHA256 as well (with a separate key). These modes are compatible with Borg 1.0.x. .sp \fIrepokey\-blake2\fP and \fIkeyfile\-blake2\fP are also authenticated encryption modes, but use BLAKE2b\-256 instead of HMAC\-SHA256 for authentication. The chunk ID hash is a keyed BLAKE2b\-256 hash. These modes are new and \fInot\fP compatible with Borg 1.0.x. .sp \fIauthenticated\fP mode uses no encryption, but authenticates repository contents through the same HMAC\-SHA256 hash as the \fIrepokey\fP and \fIkeyfile\fP modes (it uses it as the chunk ID hash). The key is stored like \fIrepokey\fP\&. This mode is new and \fInot\fP compatible with Borg 1.0.x. .sp \fIauthenticated\-blake2\fP is like \fIauthenticated\fP, but uses the keyed BLAKE2b\-256 hash from the other blake2 modes. This mode is new and \fInot\fP compatible with Borg 1.0.x. .sp \fInone\fP mode uses no encryption and no authentication. It uses SHA256 as chunk ID hash. This mode is not recommended, you should rather consider using an authenticated or authenticated/encrypted mode. This mode has possible denial\-of\-service issues when running \fBborg create\fP on contents controlled by an attacker. Use it only for new repositories where no encryption is wanted \fBand\fP when compatibility with 1.0.x is important. If compatibility with 1.0.x is not important, use \fIauthenticated\-blake2\fP or \fIauthenticated\fP instead. This mode is compatible with Borg 1.0.x. .SH OPTIONS .sp See \fIborg\-common(1)\fP for common options of Borg commands. .SS arguments .INDENT 0.0 .TP .B REPOSITORY repository to create .UNINDENT .SS optional arguments .INDENT 0.0 .TP .BI \-e \ MODE\fR,\fB \ \-\-encryption \ MODE select encryption key mode \fB(required)\fP .TP .B \-\-append\-only create an append\-only mode repository. Note that this only affects the low level structure of the repository, and running \fIdelete\fP or \fIprune\fP will still be allowed. See \fIappend_only_mode\fP in Additional Notes for more details. .TP .BI \-\-storage\-quota \ QUOTA Set storage quota of the new repository (e.g. 5G, 1.5T). Default: no quota. .TP .B \-\-make\-parent\-dirs create the parent directories of the repository directory, if they are missing. .UNINDENT .SH EXAMPLES .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C # Local repository, repokey encryption, BLAKE2b (often faster, since Borg 1.1) $ borg init \-\-encryption=repokey\-blake2 /path/to/repo # Local repository (no encryption) $ borg init \-\-encryption=none /path/to/repo # Remote repository (accesses a remote borg via ssh) # repokey: stores the (encrypted) key into /config $ borg init \-\-encryption=repokey\-blake2 user@hostname:backup # Remote repository (accesses a remote borg via ssh) # keyfile: stores the (encrypted) key into ~/.config/borg/keys/ $ borg init \-\-encryption=keyfile user@hostname:backup .ft P .fi .UNINDENT .UNINDENT .SH SEE ALSO .sp \fIborg\-common(1)\fP, \fIborg\-create(1)\fP, \fIborg\-delete(1)\fP, \fIborg\-check(1)\fP, \fIborg\-list(1)\fP, \fIborg\-key\-import(1)\fP, \fIborg\-key\-export(1)\fP, \fIborg\-key\-change\-passphrase(1)\fP .SH AUTHOR The Borg Collective .\" Generated by docutils manpage writer. . ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/man/borg-key-change-passphrase.10000644000076500000240000000564614641074756021137 0ustar00twstaff.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "BORG-KEY-CHANGE-PASSPHRASE" 1 "2024-07-02" "" "borg backup tool" .SH NAME borg-key-change-passphrase \- Change repository key file passphrase .SH SYNOPSIS .sp borg [common options] key change\-passphrase [options] [REPOSITORY] .SH DESCRIPTION .sp The key files used for repository encryption are optionally passphrase protected. This command can be used to change this passphrase. .sp Please note that this command only changes the passphrase, but not any secret protected by it (like e.g. encryption/MAC keys or chunker seed). Thus, changing the passphrase after passphrase and borg key got compromised does not protect future (nor past) backups to the same repository. .SH OPTIONS .sp See \fIborg\-common(1)\fP for common options of Borg commands. .SS arguments .sp REPOSITORY .SH EXAMPLES .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C # Create a key file protected repository $ borg init \-\-encryption=keyfile \-v /path/to/repo Initializing repository at \(dq/path/to/repo\(dq Enter new passphrase: Enter same passphrase again: Remember your passphrase. Your data will be inaccessible without it. Key in \(dq/root/.config/borg/keys/mnt_backup\(dq created. Keep this key safe. Your data will be inaccessible without it. Synchronizing chunks cache... Archives: 0, w/ cached Idx: 0, w/ outdated Idx: 0, w/o cached Idx: 0. Done. # Change key file passphrase $ borg key change\-passphrase \-v /path/to/repo Enter passphrase for key /root/.config/borg/keys/mnt_backup: Enter new passphrase: Enter same passphrase again: Remember your passphrase. Your data will be inaccessible without it. Key updated # Import a previously\-exported key into the specified # key file (creating or overwriting the output key) # (keyfile repositories only) $ BORG_KEY_FILE=/path/to/output\-key borg key import /path/to/repo /path/to/exported .ft P .fi .UNINDENT .UNINDENT .sp Fully automated using environment variables: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ BORG_NEW_PASSPHRASE=old borg init \-e=repokey repo # now \(dqold\(dq is the current passphrase. $ BORG_PASSPHRASE=old BORG_NEW_PASSPHRASE=new borg key change\-passphrase repo # now \(dqnew\(dq is the current passphrase. .ft P .fi .UNINDENT .UNINDENT .SH SEE ALSO .sp \fIborg\-common(1)\fP .SH AUTHOR The Borg Collective .\" Generated by docutils manpage writer. . ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/man/borg-key-export.10000644000076500000240000000612514641074756017055 0ustar00twstaff.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "BORG-KEY-EXPORT" 1 "2024-07-02" "" "borg backup tool" .SH NAME borg-key-export \- Export the repository key for backup .SH SYNOPSIS .sp borg [common options] key export [options] [REPOSITORY] [PATH] .SH DESCRIPTION .sp If repository encryption is used, the repository is inaccessible without the key. This command allows one to backup this essential key. Note that the backup produced does not include the passphrase itself (i.e. the exported key stays encrypted). In order to regain access to a repository, one needs both the exported key and the original passphrase. .sp There are three backup formats. The normal backup format is suitable for digital storage as a file. The \fB\-\-paper\fP backup format is optimized for printing and typing in while importing, with per line checks to reduce problems with manual input. The \fB\-\-qr\-html\fP creates a printable HTML template with a QR code and a copy of the \fB\-\-paper\fP\-formatted key. .sp For repositories using keyfile encryption the key is saved locally on the system that is capable of doing backups. To guard against loss of this key, the key needs to be backed up independently of the main data backup. .sp For repositories using the repokey encryption the key is saved in the repository in the config file. A backup is thus not strictly needed, but guards against the repository becoming inaccessible if the file is damaged for some reason. .sp Examples: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C borg key export /path/to/repo > encrypted\-key\-backup borg key export \-\-paper /path/to/repo > encrypted\-key\-backup.txt borg key export \-\-qr\-html /path/to/repo > encrypted\-key\-backup.html # Or pass the output file as an argument instead of redirecting stdout: borg key export /path/to/repo encrypted\-key\-backup borg key export \-\-paper /path/to/repo encrypted\-key\-backup.txt borg key export \-\-qr\-html /path/to/repo encrypted\-key\-backup.html .ft P .fi .UNINDENT .UNINDENT .SH OPTIONS .sp See \fIborg\-common(1)\fP for common options of Borg commands. .SS arguments .sp REPOSITORY .INDENT 0.0 .TP .B PATH where to store the backup .UNINDENT .SS optional arguments .INDENT 0.0 .TP .B \-\-paper Create an export suitable for printing and later type\-in .TP .B \-\-qr\-html Create an html file suitable for printing and later type\-in or qr scan .UNINDENT .SH SEE ALSO .sp \fIborg\-common(1)\fP, \fIborg\-key\-import(1)\fP .SH AUTHOR The Borg Collective .\" Generated by docutils manpage writer. . ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/man/borg-key-import.10000644000076500000240000000426114641074756017045 0ustar00twstaff.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "BORG-KEY-IMPORT" 1 "2024-07-02" "" "borg backup tool" .SH NAME borg-key-import \- Import the repository key from backup .SH SYNOPSIS .sp borg [common options] key import [options] [REPOSITORY] [PATH] .SH DESCRIPTION .sp This command restores a key previously backed up with the export command. .sp If the \fB\-\-paper\fP option is given, the import will be an interactive process in which each line is checked for plausibility before proceeding to the next line. For this format PATH must not be given. .sp For repositories using keyfile encryption, the key file which \fBborg key import\fP writes to depends on several factors. If the \fBBORG_KEY_FILE\fP environment variable is set and non\-empty, \fBborg key import\fP creates or overwrites that file named by \fB$BORG_KEY_FILE\fP\&. Otherwise, \fBborg key import\fP searches in the \fB$BORG_KEYS_DIR\fP directory for a key file associated with the repository. If a key file is found in \fB$BORG_KEYS_DIR\fP, \fBborg key import\fP overwrites it; otherwise, \fBborg key import\fP creates a new key file in \fB$BORG_KEYS_DIR\fP\&. .SH OPTIONS .sp See \fIborg\-common(1)\fP for common options of Borg commands. .SS arguments .sp REPOSITORY .INDENT 0.0 .TP .B PATH path to the backup (\(aq\-\(aq to read from stdin) .UNINDENT .SS optional arguments .INDENT 0.0 .TP .B \-\-paper interactively import from a backup done with \fB\-\-paper\fP .UNINDENT .SH SEE ALSO .sp \fIborg\-common(1)\fP, \fIborg\-key\-export(1)\fP .SH AUTHOR The Borg Collective .\" Generated by docutils manpage writer. . ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/man/borg-key-migrate-to-repokey.10000644000076500000240000000364314641074756021262 0ustar00twstaff.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "BORG-KEY-MIGRATE-TO-REPOKEY" 1 "2024-07-02" "" "borg backup tool" .SH NAME borg-key-migrate-to-repokey \- Migrate passphrase -> repokey .SH SYNOPSIS .sp borg [common options] key migrate\-to\-repokey [options] [REPOSITORY] .SH DESCRIPTION .sp This command migrates a repository from passphrase mode (removed in Borg 1.0) to repokey mode. .sp You will be first asked for the repository passphrase (to open it in passphrase mode). This is the same passphrase as you used to use for this repo before 1.0. .sp It will then derive the different secrets from this passphrase. .sp Then you will be asked for a new passphrase (twice, for safety). This passphrase will be used to protect the repokey (which contains these same secrets in encrypted form). You may use the same passphrase as you used to use, but you may also use a different one. .sp After migrating to repokey mode, you can change the passphrase at any time. But please note: the secrets will always stay the same and they could always be derived from your (old) passphrase\-mode passphrase. .SH OPTIONS .sp See \fIborg\-common(1)\fP for common options of Borg commands. .SS arguments .sp REPOSITORY .SH SEE ALSO .sp \fIborg\-common(1)\fP .SH AUTHOR The Borg Collective .\" Generated by docutils manpage writer. . ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/man/borg-key.10000644000076500000240000000233714641074756015537 0ustar00twstaff.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "BORG-KEY" 1 "2024-07-02" "" "borg backup tool" .SH NAME borg-key \- Manage a keyfile or repokey of a repository .SH SYNOPSIS .nf borg [common options] key export ... borg [common options] key import ... borg [common options] key change\-passphrase ... borg [common options] key migrate\-to\-repokey ... .fi .sp .SH SEE ALSO .sp \fIborg\-common(1)\fP, \fIborg\-key\-export(1)\fP, \fIborg\-key\-import(1)\fP, \fIborg\-key\-change\-passphrase(1)\fP, \fIborg\-key\-migrate\-to\-repokey(1)\fP .SH AUTHOR The Borg Collective .\" Generated by docutils manpage writer. . ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/man/borg-list.10000644000076500000240000002264314641074756015724 0ustar00twstaff.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "BORG-LIST" 1 "2024-07-02" "" "borg backup tool" .SH NAME borg-list \- List archive or repository contents .SH SYNOPSIS .sp borg [common options] list [options] [REPOSITORY_OR_ARCHIVE] [PATH...] .SH DESCRIPTION .sp This command lists the contents of a repository or an archive. .sp For more help on include/exclude patterns, see the \fIborg_patterns\fP command output. .SH OPTIONS .sp See \fIborg\-common(1)\fP for common options of Borg commands. .SS arguments .INDENT 0.0 .TP .B REPOSITORY_OR_ARCHIVE repository or archive to list contents of .TP .B PATH paths to list; patterns are supported .UNINDENT .SS optional arguments .INDENT 0.0 .TP .B \-\-consider\-checkpoints Show checkpoint archives in the repository contents list (default: hidden). .TP .B \-\-short only print file/directory names, nothing else .TP .BI \-\-format \ FORMAT specify format for file or archive listing (default for files: \(dq{mode} {user:6} {group:6} {size:8} {mtime} {path}{extra}{NL}\(dq; for archives: \(dq{archive:<36} {time} [{id}]{NL}\(dq) .TP .B \-\-json Only valid for listing repository contents. Format output as JSON. The form of \fB\-\-format\fP is ignored, but keys used in it are added to the JSON output. Some keys are always present. Note: JSON can only represent text. A \(dqbarchive\(dq key is therefore not available. .TP .B \-\-json\-lines Only valid for listing archive contents. Format output as JSON Lines. The form of \fB\-\-format\fP is ignored, but keys used in it are added to the JSON output. Some keys are always present. Note: JSON can only represent text. A \(dqbpath\(dq key is therefore not available. .UNINDENT .SS Archive filters .INDENT 0.0 .TP .BI \-P \ PREFIX\fR,\fB \ \-\-prefix \ PREFIX only consider archive names starting with this prefix. (deprecated) .TP .BI \-a \ GLOB\fR,\fB \ \-\-glob\-archives \ GLOB only consider archive names matching the glob. sh: rules apply (without actually using the sh: prefix), see \(dqborg help patterns\(dq. .TP .BI \-\-sort\-by \ KEYS Comma\-separated list of sorting keys; valid keys are: timestamp, archive, name, id; default is: timestamp .TP .BI \-\-first \ N consider first N archives after other filters were applied .TP .BI \-\-last \ N consider last N archives after other filters were applied .UNINDENT .SS Include/Exclude options .INDENT 0.0 .TP .BI \-e \ PATTERN\fR,\fB \ \-\-exclude \ PATTERN exclude paths matching PATTERN .TP .BI \-\-exclude\-from \ EXCLUDEFILE read exclude patterns from EXCLUDEFILE, one per line .TP .BI \-\-pattern \ PATTERN include/exclude paths matching PATTERN .TP .BI \-\-patterns\-from \ PATTERNFILE read include/exclude patterns from PATTERNFILE, one per line .UNINDENT .SH EXAMPLES .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ borg list /path/to/repo Monday Mon, 2016\-02\-15 19:15:11 repo Mon, 2016\-02\-15 19:26:54 root\-2016\-02\-15 Mon, 2016\-02\-15 19:36:29 newname Mon, 2016\-02\-15 19:50:19 \&... $ borg list /path/to/repo::root\-2016\-02\-15 drwxr\-xr\-x root root 0 Mon, 2016\-02\-15 17:44:27 . drwxrwxr\-x root root 0 Mon, 2016\-02\-15 19:04:49 bin \-rwxr\-xr\-x root root 1029624 Thu, 2014\-11\-13 00:08:51 bin/bash lrwxrwxrwx root root 0 Fri, 2015\-03\-27 20:24:26 bin/bzcmp \-> bzdiff \-rwxr\-xr\-x root root 2140 Fri, 2015\-03\-27 20:24:22 bin/bzdiff \&... $ borg list /path/to/repo::root\-2016\-02\-15 \-\-pattern \(dq\- bin/ba*\(dq drwxr\-xr\-x root root 0 Mon, 2016\-02\-15 17:44:27 . drwxrwxr\-x root root 0 Mon, 2016\-02\-15 19:04:49 bin lrwxrwxrwx root root 0 Fri, 2015\-03\-27 20:24:26 bin/bzcmp \-> bzdiff \-rwxr\-xr\-x root root 2140 Fri, 2015\-03\-27 20:24:22 bin/bzdiff \&... $ borg list /path/to/repo::archiveA \-\-format=\(dq{mode} {user:6} {group:6} {size:8d} {isomtime} {path}{extra}{NEWLINE}\(dq drwxrwxr\-x user user 0 Sun, 2015\-02\-01 11:00:00 . drwxrwxr\-x user user 0 Sun, 2015\-02\-01 11:00:00 code drwxrwxr\-x user user 0 Sun, 2015\-02\-01 11:00:00 code/myproject \-rw\-rw\-r\-\- user user 1416192 Sun, 2015\-02\-01 11:00:00 code/myproject/file.ext \-rw\-rw\-r\-\- user user 1416192 Sun, 2015\-02\-01 11:00:00 code/myproject/file.text \&... $ borg list /path/to/repo/::archiveA \-\-pattern \(aq+ re:\e.ext$\(aq \-\-pattern \(aq\- re:^.*$\(aq \-rw\-rw\-r\-\- user user 1416192 Sun, 2015\-02\-01 11:00:00 code/myproject/file.ext \&... $ borg list /path/to/repo/::archiveA \-\-pattern \(aq+ re:.ext$\(aq \-\-pattern \(aq\- re:^.*$\(aq \-rw\-rw\-r\-\- user user 1416192 Sun, 2015\-02\-01 11:00:00 code/myproject/file.ext \-rw\-rw\-r\-\- user user 1416192 Sun, 2015\-02\-01 11:00:00 code/myproject/file.text \&... .ft P .fi .UNINDENT .UNINDENT .SH NOTES .SS The FORMAT specifier syntax .sp The \fB\-\-format\fP option uses python\(aqs \fI\%format string syntax\fP\&. .sp Examples: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ borg list \-\-format \(aq{archive}{NL}\(aq /path/to/repo ArchiveFoo ArchiveBar \&... # {VAR:NUMBER} \- pad to NUMBER columns. # Strings are left\-aligned, numbers are right\-aligned. # Note: time columns except \(ga\(gaisomtime\(ga\(ga, \(ga\(gaisoctime\(ga\(ga and \(ga\(gaisoatime\(ga\(ga cannot be padded. $ borg list \-\-format \(aq{archive:36} {time} [{id}]{NL}\(aq /path/to/repo ArchiveFoo Thu, 2021\-12\-09 10:22:28 [0b8e9a312bef3f2f6e2d0fc110c196827786c15eba0188738e81697a7fa3b274] $ borg list \-\-format \(aq{mode} {user:6} {group:6} {size:8} {mtime} {path}{extra}{NL}\(aq /path/to/repo::ArchiveFoo \-rw\-rw\-r\-\- user user 1024 Thu, 2021\-12\-09 10:22:17 file\-foo \&... # {VAR:NUMBER} \- pad to NUMBER columns right\-aligned. $ borg list \-\-format \(aq{mode} {user:>6} {group:>6} {size:<8} {mtime} {path}{extra}{NL}\(aq /path/to/repo::ArchiveFoo \-rw\-rw\-r\-\- user user 1024 Thu, 2021\-12\-09 10:22:17 file\-foo \&... .ft P .fi .UNINDENT .UNINDENT .sp The following keys are always available: .INDENT 0.0 .IP \(bu 2 NEWLINE: OS dependent line separator .IP \(bu 2 NL: alias of NEWLINE .IP \(bu 2 NUL: NUL character for creating print0 / xargs \-0 like output, see barchive and bpath keys below .IP \(bu 2 SPACE .IP \(bu 2 TAB .IP \(bu 2 CR .IP \(bu 2 LF .UNINDENT .sp Keys available only when listing archives in a repository: .INDENT 0.0 .IP \(bu 2 archive: archive name interpreted as text (might be missing non\-text characters, see barchive) .IP \(bu 2 name: alias of \(dqarchive\(dq .IP \(bu 2 barchive: verbatim archive name, can contain any character except NUL .IP \(bu 2 comment: archive comment interpreted as text (might be missing non\-text characters, see bcomment) .IP \(bu 2 bcomment: verbatim archive comment, can contain any character except NUL .IP \(bu 2 id: internal ID of the archive .IP \(bu 2 tam: TAM authentication state of this archive .IP \(bu 2 start: time (start) of creation of the archive .IP \(bu 2 time: alias of \(dqstart\(dq .IP \(bu 2 end: time (end) of creation of the archive .IP \(bu 2 command_line: command line which was used to create the archive .IP \(bu 2 hostname: hostname of host on which this archive was created .IP \(bu 2 username: username of user who created this archive .UNINDENT .sp Keys available only when listing files in an archive: .INDENT 0.0 .IP \(bu 2 type .IP \(bu 2 mode .IP \(bu 2 uid .IP \(bu 2 gid .IP \(bu 2 user .IP \(bu 2 group .IP \(bu 2 path: path interpreted as text (might be missing non\-text characters, see bpath) .IP \(bu 2 bpath: verbatim POSIX path, can contain any character except NUL .IP \(bu 2 source: link target for links (identical to linktarget) .IP \(bu 2 linktarget .IP \(bu 2 flags .IP \(bu 2 size .IP \(bu 2 csize: compressed size .IP \(bu 2 dsize: deduplicated size .IP \(bu 2 dcsize: deduplicated compressed size .IP \(bu 2 num_chunks: number of chunks in this file .IP \(bu 2 unique_chunks: number of unique chunks in this file .IP \(bu 2 mtime .IP \(bu 2 ctime .IP \(bu 2 atime .IP \(bu 2 isomtime .IP \(bu 2 isoctime .IP \(bu 2 isoatime .IP \(bu 2 blake2b .IP \(bu 2 blake2s .IP \(bu 2 md5 .IP \(bu 2 sha1 .IP \(bu 2 sha224 .IP \(bu 2 sha256 .IP \(bu 2 sha384 .IP \(bu 2 sha3_224 .IP \(bu 2 sha3_256 .IP \(bu 2 sha3_384 .IP \(bu 2 sha3_512 .IP \(bu 2 sha512 .IP \(bu 2 xxh64: XXH64 checksum of this file (note: this is NOT a cryptographic hash!) .IP \(bu 2 archiveid .IP \(bu 2 archivename .IP \(bu 2 extra: prepends {source} with \(dq \-> \(dq for soft links and \(dq link to \(dq for hard links .IP \(bu 2 health: either \(dqhealthy\(dq (file ok) or \(dqbroken\(dq (if file has all\-zero replacement chunks) .UNINDENT .SH SEE ALSO .sp \fIborg\-common(1)\fP, \fIborg\-info(1)\fP, \fIborg\-diff(1)\fP, \fIborg\-prune(1)\fP, \fIborg\-patterns(1)\fP .SH AUTHOR The Borg Collective .\" Generated by docutils manpage writer. . ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/man/borg-mount.10000644000076500000240000001322414641074756016106 0ustar00twstaff.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "BORG-MOUNT" 1 "2024-07-02" "" "borg backup tool" .SH NAME borg-mount \- Mount archive or an entire repository as a FUSE filesystem .SH SYNOPSIS .sp borg [common options] mount [options] REPOSITORY_OR_ARCHIVE MOUNTPOINT [PATH...] .SH DESCRIPTION .sp This command mounts an archive as a FUSE filesystem. This can be useful for browsing an archive or restoring individual files. Unless the \fB\-\-foreground\fP option is given the command will run in the background until the filesystem is \fBumounted\fP\&. .sp The command \fBborgfs\fP provides a wrapper for \fBborg mount\fP\&. This can also be used in fstab entries: \fB/path/to/repo /mnt/point fuse.borgfs defaults,noauto 0 0\fP .sp To allow a regular user to use fstab entries, add the \fBuser\fP option: \fB/path/to/repo /mnt/point fuse.borgfs defaults,noauto,user 0 0\fP .sp For FUSE configuration and mount options, see the mount.fuse(8) manual page. .sp Borg\(aqs default behavior is to use the archived user and group names of each file and map them to the system\(aqs respective user and group ids. Alternatively, using \fBnumeric\-ids\fP will instead use the archived user and group ids without any mapping. .sp The \fBuid\fP and \fBgid\fP mount options (implemented by Borg) can be used to override the user and group ids of all files (i.e., \fBborg mount \-o uid=1000,gid=1000\fP). .sp The man page references \fBuser_id\fP and \fBgroup_id\fP mount options (implemented by fuse) which specify the user and group id of the mount owner (aka, the user who does the mounting). It is set automatically by libfuse (or the filesystem if libfuse is not used). However, you should not specify these manually. Unlike the \fBuid\fP and \fBgid\fP mount options which affect all files, \fBuser_id\fP and \fBgroup_id\fP affect the user and group id of the mounted (base) directory. .sp Additional mount options supported by borg: .INDENT 0.0 .IP \(bu 2 \fBversions\fP: when used with a repository mount, this gives a merged, versioned view of the files in the archives. EXPERIMENTAL, layout may change in future. .IP \(bu 2 \fBallow_damaged_files\fP: by default damaged files (where missing chunks were replaced with runs of zeros by \fBborg check \-\-repair\fP) are not readable and return EIO (I/O error). Set this option to read such files. .IP \(bu 2 \fBignore_permissions\fP: for security reasons the \fBdefault_permissions\fP mount option is internally enforced by borg. \fBignore_permissions\fP can be given to not enforce \fBdefault_permissions\fP\&. .UNINDENT .sp The BORG_MOUNT_DATA_CACHE_ENTRIES environment variable is meant for advanced users to tweak the performance. It sets the number of cached data chunks; additional memory usage can be up to ~8 MiB times this number. The default is the number of CPU cores. .sp When the daemonized process receives a signal or crashes, it does not unmount. Unmounting in these cases could cause an active rsync or similar process to unintentionally delete data. .sp When running in the foreground ^C/SIGINT unmounts cleanly, but other signals or crashes do not. .SH OPTIONS .sp See \fIborg\-common(1)\fP for common options of Borg commands. .SS arguments .INDENT 0.0 .TP .B REPOSITORY_OR_ARCHIVE repository or archive to mount .TP .B MOUNTPOINT where to mount filesystem .TP .B PATH paths to extract; patterns are supported .UNINDENT .SS optional arguments .INDENT 0.0 .TP .B \-\-consider\-checkpoints Show checkpoint archives in the repository contents list (default: hidden). .TP .B \-f\fP,\fB \-\-foreground stay in foreground, do not daemonize .TP .B \-o Extra mount options .TP .B \-\-numeric\-owner deprecated, use \fB\-\-numeric\-ids\fP instead .TP .B \-\-numeric\-ids use numeric user and group identifiers from archive(s) .UNINDENT .SS Archive filters .INDENT 0.0 .TP .BI \-P \ PREFIX\fR,\fB \ \-\-prefix \ PREFIX only consider archive names starting with this prefix. (deprecated) .TP .BI \-a \ GLOB\fR,\fB \ \-\-glob\-archives \ GLOB only consider archive names matching the glob. sh: rules apply (without actually using the sh: prefix), see \(dqborg help patterns\(dq. .TP .BI \-\-sort\-by \ KEYS Comma\-separated list of sorting keys; valid keys are: timestamp, archive, name, id; default is: timestamp .TP .BI \-\-first \ N consider first N archives after other filters were applied .TP .BI \-\-last \ N consider last N archives after other filters were applied .UNINDENT .SS Include/Exclude options .INDENT 0.0 .TP .BI \-e \ PATTERN\fR,\fB \ \-\-exclude \ PATTERN exclude paths matching PATTERN .TP .BI \-\-exclude\-from \ EXCLUDEFILE read exclude patterns from EXCLUDEFILE, one per line .TP .BI \-\-pattern \ PATTERN include/exclude paths matching PATTERN .TP .BI \-\-patterns\-from \ PATTERNFILE read include/exclude patterns from PATTERNFILE, one per line .TP .BI \-\-strip\-components \ NUMBER Remove the specified number of leading path elements. Paths with fewer elements will be silently skipped. .UNINDENT .SH SEE ALSO .sp \fIborg\-common(1)\fP, \fIborg\-umount(1)\fP, \fIborg\-extract(1)\fP .SH AUTHOR The Borg Collective .\" Generated by docutils manpage writer. . ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/man/borg-patterns.10000644000076500000240000002776514641074756016623 0ustar00twstaff.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "BORG-PATTERNS" 1 "2024-07-02" "" "borg backup tool" .SH NAME borg-patterns \- Details regarding patterns .SH DESCRIPTION .sp The path/filenames used as input for the pattern matching start from the currently active recursion root. You usually give the recursion root(s) when invoking borg and these can be either relative or absolute paths. .sp Starting with Borg 1.2, paths that are matched against patterns always appear relative. If you give \fB/absolute/\fP as root, the paths going into the matcher will start with \fBabsolute/\fP\&. If you give \fB\&../../relative\fP as root, the paths will be normalized as \fBrelative/\fP\&. .sp A directory exclusion pattern can end either with or without a slash (\(aq/\(aq). If it ends with a slash, such as \fIsome/path/\fP, the directory will be included but not its content. If it does not end with a slash, such as \fIsome/path\fP, both the directory and content will be excluded. .sp Borg supports different pattern styles. To define a non\-default style for a specific pattern, prefix it with two characters followed by a colon \(aq:\(aq (i.e. \fBfm:path/*\fP, \fBsh:path/**\fP). .INDENT 0.0 .TP .B \fI\%Fnmatch\fP, selector \fIfm:\fP This is the default style for \fB\-\-exclude\fP and \fB\-\-exclude\-from\fP\&. These patterns use a variant of shell pattern syntax, with \(aq*\(aq matching any number of characters, \(aq?\(aq matching any single character, \(aq[...]\(aq matching any single character specified, including ranges, and \(aq[!...]\(aq matching any character not specified. For the purpose of these patterns, the path separator (backslash for Windows and \(aq/\(aq on other systems) is not treated specially. Wrap meta\-characters in brackets for a literal match (i.e. \fI[?]\fP to match the literal character \fI?\fP). For a path to match a pattern, the full path must match, or it must match from the start of the full path to just before a path separator. Except for the root path, paths will never end in the path separator when matching is attempted. Thus, if a given pattern ends in a path separator, a \(aq*\(aq is appended before matching is attempted. A leading path separator is always removed. .TP .B Shell\-style patterns, selector \fIsh:\fP This is the default style for \fB\-\-pattern\fP and \fB\-\-patterns\-from\fP\&. Like fnmatch patterns these are similar to shell patterns. The difference is that the pattern may include \fI**/\fP for matching zero or more directory levels, \fI*\fP for matching zero or more arbitrary characters with the exception of any path separator. A leading path separator is always removed. .TP .B Regular expressions, selector \fIre:\fP Regular expressions similar to those found in Perl are supported. Unlike shell patterns regular expressions are not required to match the full path and any substring match is sufficient. It is strongly recommended to anchor patterns to the start (\(aq^\(aq), to the end (\(aq$\(aq) or both. Path separators (backslash for Windows and \(aq/\(aq on other systems) in paths are always normalized to a forward slash (\(aq/\(aq) before applying a pattern. The regular expression syntax is described in the \fI\%Python documentation for the re module\fP\&. .TP .B Path prefix, selector \fIpp:\fP This pattern style is useful to match whole sub\-directories. The pattern \fIpp:root/somedir\fP matches \fIroot/somedir\fP and everything therein. A leading path separator is always removed. .TP .B Path full\-match, selector \fIpf:\fP This pattern style is (only) useful to match full paths. This is kind of a pseudo pattern as it can not have any variable or unspecified parts \- the full path must be given. \fIpf:root/file.ext\fP matches \fIroot/file.ext\fP only. A leading path separator is always removed. .sp Implementation note: this is implemented via very time\-efficient O(1) hashtable lookups (this means you can have huge amounts of such patterns without impacting performance much). Due to that, this kind of pattern does not respect any context or order. If you use such a pattern to include a file, it will always be included (if the directory recursion encounters it). Other include/exclude patterns that would normally match will be ignored. Same logic applies for exclude. .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 \fIre:\fP, \fIsh:\fP and \fIfm:\fP patterns are all implemented on top of the Python SRE engine. It is very easy to formulate patterns for each of these types which requires an inordinate amount of time to match paths. If untrusted users are able to supply patterns, ensure they cannot supply \fIre:\fP patterns. Further, ensure that \fIsh:\fP and \fIfm:\fP patterns only contain a handful of wildcards at most. .UNINDENT .UNINDENT .sp Exclusions can be passed via the command line option \fB\-\-exclude\fP\&. When used from within a shell, the patterns should be quoted to protect them from expansion. .sp The \fB\-\-exclude\-from\fP option permits loading exclusion patterns from a text file with one pattern per line. Lines empty or starting with the number sign (\(aq#\(aq) after removing whitespace on both ends are ignored. The optional style selector prefix is also supported for patterns loaded from a file. Due to whitespace removal, paths with whitespace at the beginning or end can only be excluded using regular expressions. .sp To test your exclusion patterns without performing an actual backup you can run \fBborg create \-\-list \-\-dry\-run ...\fP\&. .sp Examples: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C # Exclude \(aq/home/user/file.o\(aq but not \(aq/home/user/file.odt\(aq: $ borg create \-e \(aq*.o\(aq backup / # Exclude \(aq/home/user/junk\(aq and \(aq/home/user/subdir/junk\(aq but # not \(aq/home/user/importantjunk\(aq or \(aq/etc/junk\(aq: $ borg create \-e \(aqhome/*/junk\(aq backup / # Exclude the contents of \(aq/home/user/cache\(aq but not the directory itself: $ borg create \-e home/user/cache/ backup / # The file \(aq/home/user/cache/important\(aq is *not* backed up: $ borg create \-e home/user/cache/ backup / /home/user/cache/important # The contents of directories in \(aq/home\(aq are not backed up when their name # ends in \(aq.tmp\(aq $ borg create \-\-exclude \(aqre:^home/[^/]+\e.tmp/\(aq backup / # Load exclusions from file $ cat >exclude.txt <\(dq, where char is \(dqH\(dq, \(dqd\(dq, \(dqw\(dq, \(dqm\(dq, \(dqy\(dq. For example, \fB\-\-keep\-within 2d\fP means to keep all archives that were created within the past 48 hours. \(dq1m\(dq is taken to mean \(dq31d\(dq. The archives kept with this option do not count towards the totals specified by any other options. .sp A good procedure is to thin out more and more the older your backups get. As an example, \fB\-\-keep\-daily 7\fP means to keep the latest backup on each day, up to 7 most recent days with backups (days without backups do not count). The rules are applied from secondly to yearly, and backups selected by previous rules do not count towards those of later rules. The time that each backup starts is used for pruning purposes. Dates and times are interpreted in the local timezone, and weeks go from Monday to Sunday. Specifying a negative number of archives to keep means that there is no limit. As of borg 1.2.0, borg will retain the oldest archive if any of the secondly, minutely, hourly, daily, weekly, monthly, or yearly rules was not otherwise able to meet its retention target. This enables the first chronological archive to continue aging until it is replaced by a newer archive that meets the retention criteria. .sp The \fB\-\-keep\-last N\fP option is doing the same as \fB\-\-keep\-secondly N\fP (and it will keep the last N archives under the assumption that you do not create more than one backup archive in the same second). .sp When using \fB\-\-stats\fP, you will get some statistics about how much data was deleted \- the \(dqDeleted data\(dq deduplicated size there is most interesting as that is how much your repository will shrink. Please note that the \(dqAll archives\(dq stats refer to the state after pruning. .SH OPTIONS .sp See \fIborg\-common(1)\fP for common options of Borg commands. .SS arguments .INDENT 0.0 .TP .B REPOSITORY repository to prune .UNINDENT .SS optional arguments .INDENT 0.0 .TP .B \-n\fP,\fB \-\-dry\-run do not change repository .TP .B \-\-force force pruning of corrupted archives, use \fB\-\-force \-\-force\fP in case \fB\-\-force\fP does not work. .TP .B \-s\fP,\fB \-\-stats print statistics for the deleted archive .TP .B \-\-list output verbose list of archives it keeps/prunes .TP .BI \-\-keep\-within \ INTERVAL keep all archives within this time interval .TP .B \-\-keep\-last\fP,\fB \-\-keep\-secondly number of secondly archives to keep .TP .B \-\-keep\-minutely number of minutely archives to keep .TP .B \-H\fP,\fB \-\-keep\-hourly number of hourly archives to keep .TP .B \-d\fP,\fB \-\-keep\-daily number of daily archives to keep .TP .B \-w\fP,\fB \-\-keep\-weekly number of weekly archives to keep .TP .B \-m\fP,\fB \-\-keep\-monthly number of monthly archives to keep .TP .B \-y\fP,\fB \-\-keep\-yearly number of yearly archives to keep .TP .B \-\-save\-space work slower, but using less space .TP .BI \-c \ SECONDS\fR,\fB \ \-\-checkpoint\-interval \ SECONDS write checkpoint every SECONDS seconds (Default: 1800) .UNINDENT .SS Archive filters .INDENT 0.0 .TP .BI \-P \ PREFIX\fR,\fB \ \-\-prefix \ PREFIX only consider archive names starting with this prefix. (deprecated) .TP .BI \-a \ GLOB\fR,\fB \ \-\-glob\-archives \ GLOB only consider archive names matching the glob. sh: rules apply (without actually using the sh: prefix), see \(dqborg help patterns\(dq. .UNINDENT .SH EXAMPLES .sp Be careful, prune is a potentially dangerous command, it will remove backup archives. .sp The default of prune is to apply to \fBall archives in the repository\fP unless you restrict its operation to a subset of the archives using \fB\-\-glob\-archives\fP\&. When using \fB\-\-glob\-archives\fP, be careful to choose a good matching pattern \- e.g. do not use \(dqfoo*\(dq if you do not also want to match \(dqfoobar\(dq. .sp It is strongly recommended to always run \fBprune \-v \-\-list \-\-dry\-run ...\fP first so you will see what it would do without it actually doing anything. .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C # Keep 7 end of day and 4 additional end of week archives. # Do a dry\-run without actually deleting anything. $ borg prune \-v \-\-list \-\-dry\-run \-\-keep\-daily=7 \-\-keep\-weekly=4 /path/to/repo # Same as above but only apply to archive names starting with the hostname # of the machine followed by a \(dq\-\(dq character: $ borg prune \-v \-\-list \-\-keep\-daily=7 \-\-keep\-weekly=4 \-\-glob\-archives=\(aq{hostname}\-*\(aq /path/to/repo # actually free disk space: $ borg compact /path/to/repo # Keep 7 end of day, 4 additional end of week archives, # and an end of month archive for every month: $ borg prune \-v \-\-list \-\-keep\-daily=7 \-\-keep\-weekly=4 \-\-keep\-monthly=\-1 /path/to/repo # Keep all backups in the last 10 days, 4 additional end of week archives, # and an end of month archive for every month: $ borg prune \-v \-\-list \-\-keep\-within=10d \-\-keep\-weekly=4 \-\-keep\-monthly=\-1 /path/to/repo .ft P .fi .UNINDENT .UNINDENT .sp There is also a visualized prune example in \fBdocs/misc/prune\-example.txt\fP\&. .SH SEE ALSO .sp \fIborg\-common(1)\fP, \fIborg\-compact(1)\fP .SH AUTHOR The Borg Collective .\" Generated by docutils manpage writer. . ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/man/borg-recreate.10000644000076500000240000001747014641074756016545 0ustar00twstaff.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "BORG-RECREATE" 1 "2024-07-02" "" "borg backup tool" .SH NAME borg-recreate \- Re-create archives .SH SYNOPSIS .sp borg [common options] recreate [options] [REPOSITORY_OR_ARCHIVE] [PATH...] .SH DESCRIPTION .sp Recreate the contents of existing archives. .sp recreate is a potentially dangerous function and might lead to data loss (if used wrongly). BE VERY CAREFUL! .sp Important: Repository disk space is \fBnot\fP freed until you run \fBborg compact\fP\&. .sp \fB\-\-exclude\fP, \fB\-\-exclude\-from\fP, \fB\-\-exclude\-if\-present\fP, \fB\-\-keep\-exclude\-tags\fP and PATH have the exact same semantics as in \(dqborg create\(dq, but they only check for files in the archives and not in the local file system. If PATHs are specified, the resulting archives will only contain files from these PATHs. .sp Note that all paths in an archive are relative, therefore absolute patterns/paths will \fInot\fP match (\fB\-\-exclude\fP, \fB\-\-exclude\-from\fP, PATHs). .sp \fB\-\-recompress\fP allows one to change the compression of existing data in archives. Due to how Borg stores compressed size information this might display incorrect information for archives that were not recreated at the same time. There is no risk of data loss by this. .sp \fB\-\-chunker\-params\fP will re\-chunk all files in the archive, this can be used to have upgraded Borg 0.xx or Attic archives deduplicate with Borg 1.x archives. .sp \fBUSE WITH CAUTION.\fP Depending on the PATHs and patterns given, recreate can be used to permanently delete files from archives. When in doubt, use \fB\-\-dry\-run \-\-verbose \-\-list\fP to see how patterns/PATHS are interpreted. See \fIlist_item_flags\fP in \fBborg create\fP for details. .sp The archive being recreated is only removed after the operation completes. The archive that is built during the operation exists at the same time at \(dq.recreate\(dq. The new archive will have a different archive ID. .sp With \fB\-\-target\fP the original archive is not replaced, instead a new archive is created. .sp When rechunking (or recompressing), space usage can be substantial \- expect at least the entire deduplicated size of the archives using the previous chunker (or compression) params. .sp If you recently ran borg check \-\-repair and it had to fix lost chunks with all\-zero replacement chunks, please first run another backup for the same data and re\-run borg check \-\-repair afterwards to heal any archives that had lost chunks which are still generated from the input data. .sp Important: running borg recreate to re\-chunk will remove the chunks_healthy metadata of all items with replacement chunks, so healing will not be possible any more after re\-chunking (it is also unlikely it would ever work: due to the change of chunking parameters, the missing chunk likely will never be seen again even if you still have the data that produced it). .SH OPTIONS .sp See \fIborg\-common(1)\fP for common options of Borg commands. .SS arguments .INDENT 0.0 .TP .B REPOSITORY_OR_ARCHIVE repository or archive to recreate .TP .B PATH paths to recreate; patterns are supported .UNINDENT .SS optional arguments .INDENT 0.0 .TP .B \-\-list output verbose list of items (files, dirs, ...) .TP .BI \-\-filter \ STATUSCHARS only display items with the given status characters (listed in borg create \-\-help) .TP .B \-n\fP,\fB \-\-dry\-run do not change anything .TP .B \-s\fP,\fB \-\-stats print statistics at end .UNINDENT .SS Include/Exclude options .INDENT 0.0 .TP .BI \-e \ PATTERN\fR,\fB \ \-\-exclude \ PATTERN exclude paths matching PATTERN .TP .BI \-\-exclude\-from \ EXCLUDEFILE read exclude patterns from EXCLUDEFILE, one per line .TP .BI \-\-pattern \ PATTERN include/exclude paths matching PATTERN .TP .BI \-\-patterns\-from \ PATTERNFILE read include/exclude patterns from PATTERNFILE, one per line .TP .B \-\-exclude\-caches exclude directories that contain a CACHEDIR.TAG file (\fI\%http://www.bford.info/cachedir/spec.html\fP) .TP .BI \-\-exclude\-if\-present \ NAME exclude directories that are tagged by containing a filesystem object with the given NAME .TP .B \-\-keep\-exclude\-tags if tag objects are specified with \fB\-\-exclude\-if\-present\fP, don\(aqt omit the tag objects themselves from the backup archive .UNINDENT .SS Archive options .INDENT 0.0 .TP .BI \-\-target \ TARGET create a new archive with the name ARCHIVE, do not replace existing archive (only applies for a single archive) .TP .BI \-c \ SECONDS\fR,\fB \ \-\-checkpoint\-interval \ SECONDS write checkpoint every SECONDS seconds (Default: 1800) .TP .BI \-\-comment \ COMMENT add a comment text to the archive .TP .BI \-\-timestamp \ TIMESTAMP manually specify the archive creation date/time (UTC, yyyy\-mm\-ddThh:mm:ss format). alternatively, give a reference file/directory. .TP .BI \-C \ COMPRESSION\fR,\fB \ \-\-compression \ COMPRESSION select compression algorithm, see the output of the \(dqborg help compression\(dq command for details. .TP .BI \-\-recompress \ MODE recompress data chunks according to \fIMODE\fP and \fB\-\-compression\fP\&. Possible modes are \fIif\-different\fP: recompress if current compression is with a different compression algorithm (the level is not considered); \fIalways\fP: recompress even if current compression is with the same compression algorithm (use this to change the compression level); and \fInever\fP: do not recompress (use this option to explicitly prevent recompression). If no MODE is given, \fIif\-different\fP will be used. Not passing \-\-recompress is equivalent to \(dq\-\-recompress never\(dq. .TP .BI \-\-chunker\-params \ PARAMS rechunk using given chunker parameters (ALGO, CHUNK_MIN_EXP, CHUNK_MAX_EXP, HASH_MASK_BITS, HASH_WINDOW_SIZE) or \fIdefault\fP to use the chunker defaults. default: do not rechunk .UNINDENT .SH EXAMPLES .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C # Make old (Attic / Borg 0.xx) archives deduplicate with Borg 1.x archives. # Archives created with Borg 1.1+ and the default chunker params are skipped # (archive ID stays the same). $ borg recreate /mnt/backup \-\-chunker\-params default \-\-progress # Create a backup with little but fast compression $ borg create /mnt/backup::archive /some/files \-\-compression lz4 # Then compress it \- this might take longer, but the backup has already completed, # so no inconsistencies from a long\-running backup job. $ borg recreate /mnt/backup::archive \-\-recompress \-\-compression zlib,9 # Remove unwanted files from all archives in a repository. # Note the relative path for the \-\-exclude option \- archives only contain relative paths. $ borg recreate /mnt/backup \-\-exclude home/icke/Pictures/drunk_photos # Change archive comment $ borg create \-\-comment \(dqThis is a comment\(dq /mnt/backup::archivename ~ $ borg info /mnt/backup::archivename Name: archivename Fingerprint: ... Comment: This is a comment \&... $ borg recreate \-\-comment \(dqThis is a better comment\(dq /mnt/backup::archivename $ borg info /mnt/backup::archivename Name: archivename Fingerprint: ... Comment: This is a better comment \&... .ft P .fi .UNINDENT .UNINDENT .SH SEE ALSO .sp \fIborg\-common(1)\fP, \fIborg\-patterns(1)\fP, \fIborg\-placeholders(1)\fP, \fIborg\-compression(1)\fP .SH AUTHOR The Borg Collective .\" Generated by docutils manpage writer. . ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/man/borg-rename.10000644000076500000240000000313714641074756016215 0ustar00twstaff.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "BORG-RENAME" 1 "2024-07-02" "" "borg backup tool" .SH NAME borg-rename \- Rename an existing archive .SH SYNOPSIS .sp borg [common options] rename [options] ARCHIVE NEWNAME .SH DESCRIPTION .sp This command renames an archive in the repository. .sp This results in a different archive ID. .SH OPTIONS .sp See \fIborg\-common(1)\fP for common options of Borg commands. .SS arguments .INDENT 0.0 .TP .B ARCHIVE archive to rename .TP .B NEWNAME the new archive name to use .UNINDENT .SH EXAMPLES .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ borg create /path/to/repo::archivename ~ $ borg list /path/to/repo archivename Mon, 2016\-02\-15 19:50:19 $ borg rename /path/to/repo::archivename newname $ borg list /path/to/repo newname Mon, 2016\-02\-15 19:50:19 .ft P .fi .UNINDENT .UNINDENT .SH SEE ALSO .sp \fIborg\-common(1)\fP .SH AUTHOR The Borg Collective .\" Generated by docutils manpage writer. . ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/man/borg-serve.10000644000076500000240000001554414641074756016077 0ustar00twstaff.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "BORG-SERVE" 1 "2024-07-02" "" "borg backup tool" .SH NAME borg-serve \- Start in server mode. This command is usually not used manually. .SH SYNOPSIS .sp borg [common options] serve [options] .SH DESCRIPTION .sp This command starts a repository server process. This command is usually not used manually. .SH OPTIONS .sp See \fIborg\-common(1)\fP for common options of Borg commands. .SS optional arguments .INDENT 0.0 .TP .BI \-\-restrict\-to\-path \ PATH restrict repository access to PATH. Can be specified multiple times to allow the client access to several directories. Access to all sub\-directories is granted implicitly; PATH doesn\(aqt need to directly point to a repository. .TP .BI \-\-restrict\-to\-repository \ PATH restrict repository access. Only the repository located at PATH (no sub\-directories are considered) is accessible. Can be specified multiple times to allow the client access to several repositories. Unlike \fB\-\-restrict\-to\-path\fP sub\-directories are not accessible; PATH needs to directly point at a repository location. PATH may be an empty directory or the last element of PATH may not exist, in which case the client may initialize a repository there. .TP .B \-\-append\-only only allow appending to repository segment files. Note that this only affects the low level structure of the repository, and running \fIdelete\fP or \fIprune\fP will still be allowed. See \fIappend_only_mode\fP in Additional Notes for more details. .TP .BI \-\-storage\-quota \ QUOTA Override storage quota of the repository (e.g. 5G, 1.5T). When a new repository is initialized, sets the storage quota on the new repository as well. Default: no quota. .UNINDENT .SH EXAMPLES .sp \fBborg serve\fP has special support for ssh forced commands (see \fBauthorized_keys\fP example below): if the environment variable SSH_ORIGINAL_COMMAND is set it will ignore some options given on the command line and use the values from the variable instead. This only applies to a carefully controlled allowlist of safe options. This list currently contains: .INDENT 0.0 .IP \(bu 2 Options that control the log level and debug topics printed such as \fB\-\-verbose\fP, \fB\-\-info\fP, \fB\-\-debug\fP, \fB\-\-debug\-topic\fP, etc. .IP \(bu 2 \fB\-\-lock\-wait\fP to allow the client to control how long to wait before giving up and aborting the operation when another process is holding a lock. .UNINDENT .sp Environment variables (such as BORG_XXX) contained in the original command sent by the client are \fInot\fP interpreted, but ignored. If BORG_XXX environment variables should be set on the \fBborg serve\fP side, then these must be set in system\-specific locations like \fB/etc/environment\fP or in the forced command itself (example below). .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C # Allow an SSH keypair to only run borg, and only have access to /path/to/repo. # Use key options to disable unneeded and potentially dangerous SSH functionality. # This will help to secure an automated remote backup system. $ cat ~/.ssh/authorized_keys command=\(dqborg serve \-\-restrict\-to\-path /path/to/repo\(dq,restrict ssh\-rsa AAAAB3[...] # Set a BORG_XXX environment variable on the \(dqborg serve\(dq side $ cat ~/.ssh/authorized_keys command=\(dqexport BORG_XXX=value; borg serve [...]\(dq,restrict ssh\-rsa [...] .ft P .fi .UNINDENT .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 The examples above use the \fBrestrict\fP directive. This does automatically block potential dangerous ssh features, even when they are added in a future update. Thus, this option should be preferred. .sp If you\(aqre using openssh\-server < 7.2, however, you have to explicitly specify the ssh features to restrict and cannot simply use the restrict option as it has been introduced in v7.2. We recommend to use \fBno\-port\-forwarding,no\-X11\-forwarding,no\-pty,no\-agent\-forwarding,no\-user\-rc\fP in this case. .UNINDENT .UNINDENT .sp Details about sshd usage: \fI\%sshd(8)\fP .SS SSH Configuration .sp \fBborg serve\fP\(aqs pipes (\fBstdin\fP/\fBstdout\fP/\fBstderr\fP) are connected to the \fBsshd\fP process on the server side. In the event that the SSH connection between \fBborg serve\fP and the client is disconnected or stuck abnormally (for example, due to a network outage), it can take a long time for \fBsshd\fP to notice the client is disconnected. In the meantime, \fBsshd\fP continues running, and as a result so does the \fBborg serve\fP process holding the lock on the repository. This can cause subsequent \fBborg\fP operations on the remote repository to fail with the error: \fBFailed to create/acquire the lock\fP\&. .sp In order to avoid this, it is recommended to perform the following additional SSH configuration: .sp Either in the client side\(aqs \fB~/.ssh/config\fP file, or in the client\(aqs \fB/etc/ssh/ssh_config\fP file: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C Host backupserver ServerAliveInterval 10 ServerAliveCountMax 30 .ft P .fi .UNINDENT .UNINDENT .sp Replacing \fBbackupserver\fP with the hostname, FQDN or IP address of the borg server. .sp This will cause the client to send a keepalive to the server every 10 seconds. If 30 consecutive keepalives are sent without a response (a time of 300 seconds), the ssh client process will be terminated, causing the borg process to terminate gracefully. .sp On the server side\(aqs \fBsshd\fP configuration file (typically \fB/etc/ssh/sshd_config\fP): .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C ClientAliveInterval 10 ClientAliveCountMax 30 .ft P .fi .UNINDENT .UNINDENT .sp This will cause the server to send a keep alive to the client every 10 seconds. If 30 consecutive keepalives are sent without a response (a time of 300 seconds), the server\(aqs sshd process will be terminated, causing the \fBborg serve\fP process to terminate gracefully and release the lock on the repository. .sp If you then run borg commands with \fB\-\-lock\-wait 600\fP, this gives sufficient time for the borg serve processes to terminate after the SSH connection is torn down after the 300 second wait for the keepalives to fail. .sp You may, of course, modify the timeout values demonstrated above to values that suit your environment and use case. .SH SEE ALSO .sp \fIborg\-common(1)\fP .SH AUTHOR The Borg Collective .\" Generated by docutils manpage writer. . ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/man/borg-umount.10000644000076500000240000000750314641074756016276 0ustar00twstaff.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "BORG-UMOUNT" 1 "2024-07-02" "" "borg backup tool" .SH NAME borg-umount \- un-mount the FUSE filesystem .SH SYNOPSIS .sp borg [common options] umount [options] MOUNTPOINT .SH DESCRIPTION .sp This command un\-mounts a FUSE filesystem that was mounted with \fBborg mount\fP\&. .sp This is a convenience wrapper that just calls the platform\-specific shell command \- usually this is either umount or fusermount \-u. .SH OPTIONS .sp See \fIborg\-common(1)\fP for common options of Borg commands. .SS arguments .INDENT 0.0 .TP .B MOUNTPOINT mountpoint of the filesystem to umount .UNINDENT .SH EXAMPLES .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C # Mounting the repository shows all archives. # Archives are loaded lazily, expect some delay when navigating to an archive # for the first time. $ borg mount /path/to/repo /tmp/mymountpoint $ ls /tmp/mymountpoint root\-2016\-02\-14 root\-2016\-02\-15 $ borg umount /tmp/mymountpoint # Mounting a specific archive is possible as well. $ borg mount /path/to/repo::root\-2016\-02\-15 /tmp/mymountpoint $ ls /tmp/mymountpoint bin boot etc home lib lib64 lost+found media mnt opt root sbin srv tmp usr var $ borg umount /tmp/mymountpoint # The \(dqversions view\(dq merges all archives in the repository # and provides a versioned view on files. $ borg mount \-o versions /path/to/repo /tmp/mymountpoint $ ls \-l /tmp/mymountpoint/home/user/doc.txt/ total 24 \-rw\-rw\-r\-\- 1 user group 12357 Aug 26 21:19 doc.cda00bc9.txt \-rw\-rw\-r\-\- 1 user group 12204 Aug 26 21:04 doc.fa760f28.txt $ borg umount /tmp/mymountpoint # Archive filters are supported. # These are especially handy for the \(dqversions view\(dq, # which does not support lazy processing of archives. $ borg mount \-o versions \-\-glob\-archives \(aq*\-my\-home\(aq \-\-last 10 /path/to/repo /tmp/mymountpoint # Exclusion options are supported. # These can speed up mounting and lower memory needs significantly. $ borg mount /path/to/repo /tmp/mymountpoint only/that/path $ borg mount \-\-exclude \(aq...\(aq /path/to/repo /tmp/mymountpoint # When using BORG_REPO env var, use :: as positional argument: export BORG_REPO=/path/to/repo # Mount the whole repo: borg mount :: /tmp/mymountpoint # Mount some specific archive: borg mount ::root\-2016\-02\-15 /tmp/mymountpoint .ft P .fi .UNINDENT .UNINDENT .SS borgfs .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ echo \(aq/mnt/backup /tmp/myrepo fuse.borgfs defaults,noauto 0 0\(aq >> /etc/fstab $ echo \(aq/mnt/backup::root\-2016\-02\-15 /tmp/myarchive fuse.borgfs defaults,noauto 0 0\(aq >> /etc/fstab $ mount /tmp/myrepo $ mount /tmp/myarchive $ ls /tmp/myrepo root\-2016\-02\-01 root\-2016\-02\-2015 $ ls /tmp/myarchive bin boot etc home lib lib64 lost+found media mnt opt root sbin srv tmp usr var .ft P .fi .UNINDENT .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 \fBborgfs\fP will be automatically provided if you used a distribution package or \fBpip\fP to install Borg. Users of the standalone binary will have to manually create a symlink (see \fIpyinstaller\-binary\fP). .UNINDENT .UNINDENT .SH SEE ALSO .sp \fIborg\-common(1)\fP, \fIborg\-mount(1)\fP .SH AUTHOR The Borg Collective .\" Generated by docutils manpage writer. . ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/man/borg-upgrade.10000644000076500000240000001561614641074756016402 0ustar00twstaff.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "BORG-UPGRADE" 1 "2024-07-02" "" "borg backup tool" .SH NAME borg-upgrade \- upgrade a repository from a previous version .SH SYNOPSIS .sp borg [common options] upgrade [options] [REPOSITORY] .SH DESCRIPTION .sp Upgrade an existing, local Borg repository. .SS When you do not need borg upgrade .sp Not every change requires that you run \fBborg upgrade\fP\&. .sp You do \fBnot\fP need to run it when: .INDENT 0.0 .IP \(bu 2 moving your repository to a different place .IP \(bu 2 upgrading to another point release (like 1.0.x to 1.0.y), except when noted otherwise in the changelog .IP \(bu 2 upgrading from 1.0.x to 1.1.x, except when noted otherwise in the changelog .UNINDENT .SS Borg 1.x.y upgrades .sp Archive TAM authentication: .sp Use \fBborg upgrade \-\-archives\-tam REPO\fP to add archive TAMs to all archives that are not TAM authenticated yet. This is a convenient method to just trust all archives present \- if an archive does not have TAM authentication yet, a TAM will be added. Archives created by old borg versions < 1.0.9 do not have TAMs. Archives created by newer borg version should have TAMs already. If you have a high risk environment, you should not just run this, but first verify that the archives are authentic and not malicious (== have good content, have a good timestamp). Borg 1.2.5+ needs all archives to be TAM authenticated for safety reasons. .sp This upgrade needs to be done once per repository. .sp Manifest TAM authentication: .sp Use \fBborg upgrade \-\-tam REPO\fP to require manifest authentication introduced with Borg 1.0.9 to address security issues. This means that modifying the repository after doing this with a version prior to 1.0.9 will raise a validation error, so only perform this upgrade after updating all clients using the repository to 1.0.9 or newer. .sp This upgrade should be done on each client for safety reasons. .sp If a repository is accidentally modified with a pre\-1.0.9 client after this upgrade, use \fBborg upgrade \-\-tam \-\-force REPO\fP to remedy it. .sp If you routinely do this you might not want to enable this upgrade (which will leave you exposed to the security issue). You can reverse the upgrade by issuing \fBborg upgrade \-\-disable\-tam REPO\fP\&. .sp See \fI\%https://borgbackup.readthedocs.io/en/stable/changes.html#pre\-1\-0\-9\-manifest\-spoofing\-vulnerability\fP for details. .SS Attic and Borg 0.xx to Borg 1.x .sp This currently supports converting an Attic repository to Borg and also helps with converting Borg 0.xx to 1.0. .sp Currently, only LOCAL repositories can be upgraded (issue #465). .sp Please note that \fBborg create\fP (since 1.0.0) uses bigger chunks by default than old borg or attic did, so the new chunks won\(aqt deduplicate with the old chunks in the upgraded repository. See \fB\-\-chunker\-params\fP option of \fBborg create\fP and \fBborg recreate\fP\&. .sp \fBborg upgrade\fP will change the magic strings in the repository\(aqs segments to match the new Borg magic strings. The keyfiles found in $ATTIC_KEYS_DIR or ~/.attic/keys/ will also be converted and copied to $BORG_KEYS_DIR or ~/.config/borg/keys. .sp The cache files are converted, from $ATTIC_CACHE_DIR or ~/.cache/attic to $BORG_CACHE_DIR or ~/.cache/borg, but the cache layout between Borg and Attic changed, so it is possible the first backup after the conversion takes longer than expected due to the cache resync. .sp Upgrade should be able to resume if interrupted, although it will still iterate over all segments. If you want to start from scratch, use \fIborg delete\fP over the copied repository to make sure the cache files are also removed: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C borg delete borg .ft P .fi .UNINDENT .UNINDENT .sp Unless \fB\-\-inplace\fP is specified, the upgrade process first creates a backup copy of the repository, in REPOSITORY.before\-upgrade\-DATETIME, using hardlinks. This requires that the repository and its parent directory reside on same filesystem so the hardlink copy can work. This takes longer than in place upgrades, but is much safer and gives progress information (as opposed to \fBcp \-al\fP). Once you are satisfied with the conversion, you can safely destroy the backup copy. .sp WARNING: Running the upgrade in place will make the current copy unusable with older version, with no way of going back to previous versions. This can PERMANENTLY DAMAGE YOUR REPOSITORY! Attic CAN NOT READ BORG REPOSITORIES, as the magic strings have changed. You have been warned. .SH OPTIONS .sp See \fIborg\-common(1)\fP for common options of Borg commands. .SS arguments .INDENT 0.0 .TP .B REPOSITORY path to the repository to be upgraded .UNINDENT .SS optional arguments .INDENT 0.0 .TP .B \-n\fP,\fB \-\-dry\-run do not change repository .TP .B \-\-inplace rewrite repository in place, with no chance of going back to older versions of the repository. .TP .B \-\-force Force upgrade .TP .B \-\-tam Enable manifest authentication (in key and cache) (Borg 1.0.9 and later). .TP .B \-\-check\-tam check manifest authentication (in key and cache). .TP .B \-\-disable\-tam Disable manifest authentication (in key and cache). .TP .B \-\-check\-archives\-tam check TAM authentication for all archives. .TP .B \-\-archives\-tam add TAM authentication for all archives. .UNINDENT .SH EXAMPLES .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C # Upgrade the borg repository to the most recent version. $ borg upgrade \-v /path/to/repo making a hardlink copy in /path/to/repo.before\-upgrade\-2016\-02\-15\-20:51:55 opening attic repository with borg and converting no key file found for repository converting repo index /path/to/repo/index.0 converting 1 segments... converting borg 0.xx to borg current no key file found for repository .ft P .fi .UNINDENT .UNINDENT .SS Upgrading a passphrase encrypted attic repo .sp attic offered a \(dqpassphrase\(dq encryption mode, but this was removed in borg 1.0 and replaced by the \(dqrepokey\(dq mode (which stores the passphrase\-protected encryption key into the repository config). .sp Thus, to upgrade a \(dqpassphrase\(dq attic repo to a \(dqrepokey\(dq borg repo, 2 steps are needed, in this order: .INDENT 0.0 .IP \(bu 2 borg upgrade repo .IP \(bu 2 borg key migrate\-to\-repokey repo .UNINDENT .SH SEE ALSO .sp \fIborg\-common(1)\fP .SH AUTHOR The Borg Collective .\" Generated by docutils manpage writer. . ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/man/borg-version.10000644000076500000240000000403414641074756016430 0ustar00twstaff.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "BORG-VERSION" 1 "2024-07-02" "" "borg backup tool" .SH NAME borg-version \- Display the borg client / borg server version .SH SYNOPSIS .sp borg [common options] version [options] [REPOSITORY] .SH DESCRIPTION .sp This command displays the borg client version / borg server version. .sp If a local repo is given, the client code directly accesses the repository, thus we show the client version also as the server version. .sp If a remote repo is given (e.g. ssh:), the remote borg is queried and its version is displayed as the server version. .sp Examples: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C # local repo (client uses 1.4.0 alpha version) $ borg version /mnt/backup 1.4.0a / 1.4.0a # remote repo (client uses 1.4.0 alpha, server uses 1.2.7 release) $ borg version ssh://borg@borgbackup:repo 1.4.0a / 1.2.7 .ft P .fi .UNINDENT .UNINDENT .sp Due to the version tuple format used in borg client/server negotiation, only a simplified version is displayed (as provided by borg.version.format_version). .sp There is also borg \-\-version to display a potentially more precise client version. .SH OPTIONS .sp See \fIborg\-common(1)\fP for common options of Borg commands. .SS arguments .INDENT 0.0 .TP .B REPOSITORY repository (used to determine client/server situation) .UNINDENT .SH SEE ALSO .sp \fIborg\-common(1)\fP .SH AUTHOR The Borg Collective .\" Generated by docutils manpage writer. . ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/man/borg-with-lock.10000644000076500000240000000412014641074756016640 0ustar00twstaff.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "BORG-WITH-LOCK" 1 "2024-07-02" "" "borg backup tool" .SH NAME borg-with-lock \- run a user specified command with the repository lock held .SH SYNOPSIS .sp borg [common options] with\-lock [options] REPOSITORY COMMAND [ARGS...] .SH DESCRIPTION .sp This command runs a user\-specified command while locking the repository. For example: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ borg with\-lock /mnt/borgrepo rsync \-av /mnt/borgrepo /somewhere/else/borgrepo .ft P .fi .UNINDENT .UNINDENT .sp It will first try to acquire the lock (make sure that no other operation is running in the repo), then execute the given command as a subprocess and wait for its termination, release the lock and return the user command\(aqs return code as borg\(aqs return code. .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 If you copy a repository with the lock held, the lock will be present in the copy. Thus, before using borg on the copy from a different host, you need to use \(dqborg break\-lock\(dq on the copied repository, because Borg is cautious and does not automatically remove stale locks made by a different host. .UNINDENT .UNINDENT .SH OPTIONS .sp See \fIborg\-common(1)\fP for common options of Borg commands. .SS arguments .INDENT 0.0 .TP .B REPOSITORY repository to lock .TP .B COMMAND command to run .TP .B ARGS command arguments .UNINDENT .SH SEE ALSO .sp \fIborg\-common(1)\fP .SH AUTHOR The Borg Collective .\" Generated by docutils manpage writer. . ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/man/borg.10000644000076500000240000010110414641074756014741 0ustar00twstaff.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "BORG" 1 "2024-07-02" "" "borg backup tool" .SH NAME borg \- deduplicating and encrypting backup tool .SH SYNOPSIS .sp borg [common options] [options] [arguments] .SH DESCRIPTION .\" we don't include the README.rst here since we want to keep this terse. . .sp BorgBackup (short: Borg) is a deduplicating backup program. Optionally, it supports compression and authenticated encryption. .sp The main goal of Borg is to provide an efficient and secure way to backup data. The data deduplication technique used makes Borg suitable for daily backups since only changes are stored. The authenticated encryption technique makes it suitable for backups to not fully trusted targets. .sp Borg stores a set of files in an \fIarchive\fP\&. A \fIrepository\fP is a collection of \fIarchives\fP\&. The format of repositories is Borg\-specific. Borg does not distinguish archives from each other in any way other than their name, it does not matter when or where archives were created (e.g. different hosts). .SH EXAMPLES .SS A step\-by\-step example .INDENT 0.0 .IP 1. 3 Before a backup can be made a repository has to be initialized: .INDENT 3.0 .INDENT 3.5 .sp .nf .ft C $ borg init \-\-encryption=repokey /path/to/repo .ft P .fi .UNINDENT .UNINDENT .IP 2. 3 Backup the \fB~/src\fP and \fB~/Documents\fP directories into an archive called \fIMonday\fP: .INDENT 3.0 .INDENT 3.5 .sp .nf .ft C $ borg create /path/to/repo::Monday ~/src ~/Documents .ft P .fi .UNINDENT .UNINDENT .IP 3. 3 The next day create a new archive called \fITuesday\fP: .INDENT 3.0 .INDENT 3.5 .sp .nf .ft C $ borg create \-\-stats /path/to/repo::Tuesday ~/src ~/Documents .ft P .fi .UNINDENT .UNINDENT .sp This backup will be a lot quicker and a lot smaller since only new never before seen data is stored. The \fB\-\-stats\fP option causes Borg to output statistics about the newly created archive such as the amount of unique data (not shared with other archives): .INDENT 3.0 .INDENT 3.5 .sp .nf .ft C \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- Archive name: Tuesday Archive fingerprint: bd31004d58f51ea06ff735d2e5ac49376901b21d58035f8fb05dbf866566e3c2 Time (start): Tue, 2016\-02\-16 18:15:11 Time (end): Tue, 2016\-02\-16 18:15:11 Duration: 0.19 seconds Number of files: 127 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- Original size Compressed size Deduplicated size This archive: 4.16 MB 4.17 MB 26.78 kB All archives: 8.33 MB 8.34 MB 4.19 MB Unique chunks Total chunks Chunk index: 132 261 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- .ft P .fi .UNINDENT .UNINDENT .IP 4. 3 List all archives in the repository: .INDENT 3.0 .INDENT 3.5 .sp .nf .ft C $ borg list /path/to/repo Monday Mon, 2016\-02\-15 19:14:44 Tuesday Tue, 2016\-02\-16 19:15:11 .ft P .fi .UNINDENT .UNINDENT .IP 5. 3 List the contents of the \fIMonday\fP archive: .INDENT 3.0 .INDENT 3.5 .sp .nf .ft C $ borg list /path/to/repo::Monday drwxr\-xr\-x user group 0 Mon, 2016\-02\-15 18:22:30 home/user/Documents \-rw\-r\-\-r\-\- user group 7961 Mon, 2016\-02\-15 18:22:30 home/user/Documents/Important.doc \&... .ft P .fi .UNINDENT .UNINDENT .IP 6. 3 Restore the \fIMonday\fP archive by extracting the files relative to the current directory: .INDENT 3.0 .INDENT 3.5 .sp .nf .ft C $ borg extract /path/to/repo::Monday .ft P .fi .UNINDENT .UNINDENT .IP 7. 3 Delete the \fIMonday\fP archive (please note that this does \fBnot\fP free repo disk space): .INDENT 3.0 .INDENT 3.5 .sp .nf .ft C $ borg delete /path/to/repo::Monday .ft P .fi .UNINDENT .UNINDENT .IP 8. 3 Recover disk space by compacting the segment files in the repo: .INDENT 3.0 .INDENT 3.5 .sp .nf .ft C $ borg compact /path/to/repo .ft P .fi .UNINDENT .UNINDENT .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 Borg is quiet by default (it works on WARNING log level). You can use options like \fB\-\-progress\fP or \fB\-\-list\fP to get specific reports during command execution. You can also add the \fB\-v\fP (or \fB\-\-verbose\fP or \fB\-\-info\fP) option to adjust the log level to INFO to get other informational messages. .UNINDENT .UNINDENT .SH NOTES .SS Positional Arguments and Options: Order matters .sp Borg only supports taking options (\fB\-s\fP and \fB\-\-progress\fP in the example) to the left or right of all positional arguments (\fBrepo::archive\fP and \fBpath\fP in the example), but not in between them: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C borg create \-s \-\-progress repo::archive path # good and preferred borg create repo::archive path \-s \-\-progress # also works borg create \-s repo::archive path \-\-progress # works, but ugly borg create repo::archive \-s \-\-progress path # BAD .ft P .fi .UNINDENT .UNINDENT .sp This is due to a problem in the argparse module: \fI\%https://bugs.python.org/issue15112\fP .SS Repository URLs .sp \fBLocal filesystem\fP (or locally mounted network filesystem): .sp \fB/path/to/repo\fP \- filesystem path to repo directory, absolute path .sp \fBpath/to/repo\fP \- filesystem path to repo directory, relative path .sp Also, stuff like \fB~/path/to/repo\fP or \fB~other/path/to/repo\fP works (this is expanded by your shell). .sp Note: you may also prepend a \fBfile://\fP to a filesystem path to get URL style. .sp \fBRemote repositories\fP accessed via ssh \fI\%user@host\fP: .sp \fBuser@host:/path/to/repo\fP \- remote repo, absolute path .sp \fBssh://user@host:port/path/to/repo\fP \- same, alternative syntax, port can be given .sp \fBRemote repositories with relative paths\fP can be given using this syntax: .sp \fBuser@host:path/to/repo\fP \- path relative to current directory .sp \fBuser@host:~/path/to/repo\fP \- path relative to user\(aqs home directory .sp \fBuser@host:~other/path/to/repo\fP \- path relative to other\(aqs home directory .sp Note: giving \fBuser@host:/./path/to/repo\fP or \fBuser@host:/~/path/to/repo\fP or \fBuser@host:/~other/path/to/repo\fP is also supported, but not required here. .sp \fBRemote repositories with relative paths, alternative syntax with port\fP: .sp \fBssh://user@host:port/./path/to/repo\fP \- path relative to current directory .sp \fBssh://user@host:port/~/path/to/repo\fP \- path relative to user\(aqs home directory .sp \fBssh://user@host:port/~other/path/to/repo\fP \- path relative to other\(aqs home directory .sp If you frequently need the same repo URL, it is a good idea to set the \fBBORG_REPO\fP environment variable to set a default for the repo URL: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C export BORG_REPO=\(aqssh://user@host:port/path/to/repo\(aq .ft P .fi .UNINDENT .UNINDENT .sp Then just leave away the repo URL if only a repo URL is needed and you want to use the default \- it will be read from BORG_REPO then. .sp Use \fB::\fP syntax to give the repo URL when syntax requires giving a positional argument for the repo (e.g. \fBborg mount :: /mnt\fP). .SS Repository / Archive Locations .sp Many commands want either a repository (just give the repo URL, see above) or an archive location, which is a repo URL followed by \fB::archive_name\fP\&. .sp Archive names must not contain the \fB/\fP (slash) character. For simplicity, maybe also avoid blanks or other characters that have special meaning on the shell or in a filesystem (borg mount will use the archive name as directory name). .sp If you have set BORG_REPO (see above) and an archive location is needed, use \fB::archive_name\fP \- the repo URL part is then read from BORG_REPO. .SS Logging .sp Borg writes all log output to stderr by default. But please note that something showing up on stderr does \fInot\fP indicate an error condition just because it is on stderr. Please check the log levels of the messages and the return code of borg for determining error, warning or success conditions. .sp If you want to capture the log output to a file, just redirect it: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C borg create repo::archive myfiles 2>> logfile .ft P .fi .UNINDENT .UNINDENT .sp Custom logging configurations can be implemented via BORG_LOGGING_CONF. .sp The log level of the builtin logging configuration defaults to WARNING. This is because we want Borg to be mostly silent and only output warnings, errors and critical messages, unless output has been requested by supplying an option that implies output (e.g. \fB\-\-list\fP or \fB\-\-progress\fP). .sp Log levels: DEBUG < INFO < WARNING < ERROR < CRITICAL .sp Use \fB\-\-debug\fP to set DEBUG log level \- to get debug, info, warning, error and critical level output. .sp Use \fB\-\-info\fP (or \fB\-v\fP or \fB\-\-verbose\fP) to set INFO log level \- to get info, warning, error and critical level output. .sp Use \fB\-\-warning\fP (default) to set WARNING log level \- to get warning, error and critical level output. .sp Use \fB\-\-error\fP to set ERROR log level \- to get error and critical level output. .sp Use \fB\-\-critical\fP to set CRITICAL log level \- to get critical level output. .sp While you can set misc. log levels, do not expect that every command will give different output on different log levels \- it\(aqs just a possibility. .sp \fBWARNING:\fP .INDENT 0.0 .INDENT 3.5 Options \fB\-\-critical\fP and \fB\-\-error\fP are provided for completeness, their usage is not recommended as you might miss important information. .UNINDENT .UNINDENT .SS Return codes .sp Borg can exit with the following return codes (rc): .TS center; |l|l|. _ T{ Return code T} T{ Meaning T} _ T{ 0 T} T{ success (logged as INFO) T} _ T{ 1 T} T{ generic warning (operation reached its normal end, but there were warnings \-\- you should check the log, logged as WARNING) T} _ T{ 2 T} T{ generic error (like a fatal error, a local or remote exception, the operation did not reach its normal end, logged as ERROR) T} _ T{ 3..99 T} T{ specific error (enabled by BORG_EXIT_CODES=modern) T} _ T{ 100..127 T} T{ specific warning (enabled by BORG_EXIT_CODES=modern) T} _ T{ 128+N T} T{ killed by signal N (e.g. 137 == kill \-9) T} _ .TE .sp If you use \fB\-\-show\-rc\fP, the return code is also logged at the indicated level as the last log entry. .SS Environment Variables .sp Borg uses some environment variables for automation: .INDENT 0.0 .TP .B General: .INDENT 7.0 .TP .B BORG_REPO When set, use the value to give the default repository location. If a command needs an archive parameter, you can abbreviate as \fB::archive\fP\&. If a command needs a repository parameter, you can either leave it away or abbreviate as \fB::\fP, if a positional parameter is required. .TP .B BORG_PASSPHRASE When set, use the value to answer the passphrase question for encrypted repositories. It is used when a passphrase is needed to access an encrypted repo as well as when a new passphrase should be initially set when initializing an encrypted repo. See also BORG_NEW_PASSPHRASE. .TP .B BORG_PASSCOMMAND When set, use the standard output of the command (trailing newlines are stripped) to answer the passphrase question for encrypted repositories. It is used when a passphrase is needed to access an encrypted repo as well as when a new passphrase should be initially set when initializing an encrypted repo. Note that the command is executed without a shell. So variables, like \fB$HOME\fP will work, but \fB~\fP won\(aqt. If BORG_PASSPHRASE is also set, it takes precedence. See also BORG_NEW_PASSPHRASE. .TP .B BORG_PASSPHRASE_FD When set, specifies a file descriptor to read a passphrase from. Programs starting borg may choose to open an anonymous pipe and use it to pass a passphrase. This is safer than passing via BORG_PASSPHRASE, because on some systems (e.g. Linux) environment can be examined by other processes. If BORG_PASSPHRASE or BORG_PASSCOMMAND are also set, they take precedence. .TP .B BORG_NEW_PASSPHRASE When set, use the value to answer the passphrase question when a \fBnew\fP passphrase is asked for. This variable is checked first. If it is not set, BORG_PASSPHRASE and BORG_PASSCOMMAND will also be checked. Main usecase for this is to fully automate \fBborg change\-passphrase\fP\&. .TP .B BORG_DISPLAY_PASSPHRASE When set, use the value to answer the \(dqdisplay the passphrase for verification\(dq question when defining a new passphrase for encrypted repositories. .TP .B BORG_EXIT_CODES When set to \(dqmodern\(dq, the borg process will return more specific exit codes (rc). Default is \(dqlegacy\(dq and returns rc 2 for all errors, 1 for all warnings, 0 for success. .TP .B BORG_HOST_ID Borg usually computes a host id from the FQDN plus the results of \fBuuid.getnode()\fP (which usually returns a unique id based on the MAC address of the network interface. Except if that MAC happens to be all\-zero \- in that case it returns a random value, which is not what we want (because it kills automatic stale lock removal). So, if you have a all\-zero MAC address or other reasons to better externally control the host id, just set this environment variable to a unique value. If all your FQDNs are unique, you can just use the FQDN. If not, use \fI\%fqdn@uniqueid\fP\&. .TP .B BORG_LOGGING_CONF When set, use the given filename as \fI\%INI\fP\-style logging configuration. A basic example conf can be found at \fBdocs/misc/logging.conf\fP\&. .TP .B BORG_RSH When set, use this command instead of \fBssh\fP\&. This can be used to specify ssh options, such as a custom identity file \fBssh \-i /path/to/private/key\fP\&. See \fBman ssh\fP for other options. Using the \fB\-\-rsh CMD\fP commandline option overrides the environment variable. .TP .B BORG_REMOTE_PATH When set, use the given path as borg executable on the remote (defaults to \(dqborg\(dq if unset). Using \fB\-\-remote\-path PATH\fP commandline option overrides the environment variable. .TP .B BORG_FILES_CACHE_SUFFIX When set to a value at least one character long, instructs borg to use a specifically named (based on the suffix) alternative files cache. This can be used to avoid loading and saving cache entries for backup sources other than the current sources. .TP .B BORG_FILES_CACHE_TTL When set to a numeric value, this determines the maximum \(dqtime to live\(dq for the files cache entries (default: 20). The files cache is used to quickly determine whether a file is unchanged. The FAQ explains this more detailed in: \fIalways_chunking\fP .TP .B BORG_SHOW_SYSINFO When set to no (default: yes), system information (like OS, Python version, ...) in exceptions is not shown. Please only use for good reasons as it makes issues harder to analyze. .TP .B BORG_FUSE_IMPL Choose the lowlevel FUSE implementation borg shall use for \fBborg mount\fP\&. This is a comma\-separated list of implementation names, they are tried in the given order, e.g.: .INDENT 7.0 .IP \(bu 2 \fBpyfuse3,llfuse\fP: default, first try to load pyfuse3, then try to load llfuse. .IP \(bu 2 \fBllfuse,pyfuse3\fP: first try to load llfuse, then try to load pyfuse3. .IP \(bu 2 \fBpyfuse3\fP: only try to load pyfuse3 .IP \(bu 2 \fBllfuse\fP: only try to load llfuse .IP \(bu 2 \fBnone\fP: do not try to load an implementation .UNINDENT .TP .B BORG_SELFTEST This can be used to influence borg\(aqs builtin self\-tests. The default is to execute the tests at the beginning of each borg command invocation. .sp BORG_SELFTEST=disabled can be used to switch off the tests and rather save some time. Disabling is not recommended for normal borg users, but large scale borg storage providers can use this to optimize production servers after at least doing a one\-time test borg (with selftests not disabled) when installing or upgrading machines / OS / borg. .TP .B BORG_WORKAROUNDS A list of comma separated strings that trigger workarounds in borg, e.g. to work around bugs in other software. .sp Currently known strings are: .INDENT 7.0 .TP .B basesyncfile Use the more simple BaseSyncFile code to avoid issues with sync_file_range. You might need this to run borg on WSL (Windows Subsystem for Linux) or in systemd.nspawn containers on some architectures (e.g. ARM). Using this does not affect data safety, but might result in a more bursty write to disk behaviour (not continuously streaming to disk). .TP .B retry_erofs Retry opening a file without O_NOATIME if opening a file with O_NOATIME caused EROFS. You will need this to make archives from volume shadow copies in WSL1 (Windows Subsystem for Linux 1). .TP .B authenticated_no_key Work around a lost passphrase or key for an \fBauthenticated\fP mode repository (these are only authenticated, but not encrypted). If the key is missing in the repository config, add \fBkey = anything\fP there. .sp This workaround is \fBonly\fP for emergencies and \fBonly\fP to extract data from an affected repository (read\-only access): .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C BORG_WORKAROUNDS=authenticated_no_key borg extract repo::archive .ft P .fi .UNINDENT .UNINDENT .sp After you have extracted all data you need, you MUST delete the repository: .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C BORG_WORKAROUNDS=authenticated_no_key borg delete repo .ft P .fi .UNINDENT .UNINDENT .sp Now you can init a fresh repo. Make sure you do not use the workaround any more. .TP .B ignore_invalid_archive_tam Work around invalid archive TAMs created by borg < 1.2.5, see #7791\&. .sp This workaround likely needs to get used only once when following the upgrade instructions for CVE\-2023\-36811, see \fIarchives_tam_vuln\fP\&. .sp In normal production operations, this workaround should never be used. .UNINDENT .UNINDENT .TP .B Some automatic \(dqanswerers\(dq (if set, they automatically answer confirmation questions): .INDENT 7.0 .TP .B BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=no (or =yes) For \(dqWarning: Attempting to access a previously unknown unencrypted repository\(dq .TP .B BORG_RELOCATED_REPO_ACCESS_IS_OK=no (or =yes) For \(dqWarning: The repository at location ... was previously located at ...\(dq .TP .B BORG_CHECK_I_KNOW_WHAT_I_AM_DOING=NO (or =YES) For \(dqThis is a potentially dangerous function...\(dq (check \-\-repair) .TP .B BORG_DELETE_I_KNOW_WHAT_I_AM_DOING=NO (or =YES) For \(dqYou requested to completely DELETE the repository \fIincluding\fP all archives it contains:\(dq .UNINDENT .sp Note: answers are case sensitive. setting an invalid answer value might either give the default answer or ask you interactively, depending on whether retries are allowed (they by default are allowed). So please test your scripts interactively before making them a non\-interactive script. .UNINDENT .INDENT 0.0 .TP .B Directories and files: .INDENT 7.0 .TP .B BORG_BASE_DIR Defaults to \fB$HOME\fP or \fB~$USER\fP or \fB~\fP (in that order). If you want to move all borg\-specific folders to a custom path at once, all you need to do is to modify \fBBORG_BASE_DIR\fP: the other paths for cache, config etc. will adapt accordingly (assuming you didn\(aqt set them to a different custom value). .TP .B BORG_CACHE_DIR Defaults to \fB$BORG_BASE_DIR/.cache/borg\fP\&. If \fBBORG_BASE_DIR\fP is not explicitly set while \fI\%XDG env var\fP \fBXDG_CACHE_HOME\fP is set, then \fB$XDG_CACHE_HOME/borg\fP is being used instead. This directory contains the local cache and might need a lot of space for dealing with big repositories. Make sure you\(aqre aware of the associated security aspects of the cache location: \fIcache_security\fP .TP .B BORG_CONFIG_DIR Defaults to \fB$BORG_BASE_DIR/.config/borg\fP\&. If \fBBORG_BASE_DIR\fP is not explicitly set while \fI\%XDG env var\fP \fBXDG_CONFIG_HOME\fP is set, then \fB$XDG_CONFIG_HOME/borg\fP is being used instead. This directory contains all borg configuration directories, see the FAQ for a security advisory about the data in this directory: \fIhome_config_borg\fP .TP .B BORG_SECURITY_DIR Defaults to \fB$BORG_CONFIG_DIR/security\fP\&. This directory contains information borg uses to track its usage of NONCES (\(dqnumbers used once\(dq \- usually in encryption context) and other security relevant data. .TP .B BORG_KEYS_DIR Defaults to \fB$BORG_CONFIG_DIR/keys\fP\&. This directory contains keys for encrypted repositories. .TP .B BORG_KEY_FILE When set, use the given path as repository key file. Please note that this is only for rather special applications that externally fully manage the key files: .INDENT 7.0 .IP \(bu 2 this setting only applies to the keyfile modes (not to the repokey modes). .IP \(bu 2 using a full, absolute path to the key file is recommended. .IP \(bu 2 all directories in the given path must exist. .IP \(bu 2 this setting forces borg to use the key file at the given location. .IP \(bu 2 the key file must either exist (for most commands) or will be created (\fBborg init\fP). .IP \(bu 2 you need to give a different path for different repositories. .IP \(bu 2 you need to point to the correct key file matching the repository the command will operate on. .UNINDENT .TP .B TMPDIR This is where temporary files are stored (might need a lot of temporary space for some operations), see \fI\%tempfile\fP for details. .UNINDENT .TP .B Building: .INDENT 7.0 .TP .B BORG_OPENSSL_PREFIX Adds given OpenSSL header file directory to the default locations (setup.py). .TP .B BORG_LIBLZ4_PREFIX Adds given prefix directory to the default locations. If a \(aqinclude/lz4.h\(aq is found Borg will be linked against the system liblz4 instead of a bundled implementation. (setup.py) .TP .B BORG_LIBZSTD_PREFIX Adds given prefix directory to the default locations. If a \(aqinclude/zstd.h\(aq is found Borg will be linked against the system libzstd instead of a bundled implementation. (setup.py) .UNINDENT .UNINDENT .sp Please note: .INDENT 0.0 .IP \(bu 2 Be very careful when using the \(dqyes\(dq sayers, the warnings with prompt exist for your / your data\(aqs security/safety. .IP \(bu 2 Also be very careful when putting your passphrase into a script, make sure it has appropriate file permissions (e.g. mode 600, root:root). .UNINDENT .SS File systems .sp We strongly recommend against using Borg (or any other database\-like software) on non\-journaling file systems like FAT, since it is not possible to assume any consistency in case of power failures (or a sudden disconnect of an external drive or similar failures). .sp While Borg uses a data store that is resilient against these failures when used on journaling file systems, it is not possible to guarantee this with some hardware \-\- independent of the software used. We don\(aqt know a list of affected hardware. .sp If you are suspicious whether your Borg repository is still consistent and readable after one of the failures mentioned above occurred, run \fBborg check \-\-verify\-data\fP to make sure it is consistent. Requirements for Borg repository file systems .INDENT 0.0 .IP \(bu 2 Long file names .IP \(bu 2 At least three directory levels with short names .IP \(bu 2 Typically, file sizes up to a few hundred MB. Large repositories may require large files (>2 GB). .IP \(bu 2 Up to 1000 files per directory. .IP \(bu 2 rename(2) / MoveFile(Ex) should work as specified, i.e. on the same file system it should be a move (not a copy) operation, and in case of a directory it should fail if the destination exists and is not an empty directory, since this is used for locking. .IP \(bu 2 Hardlinks are needed for \fIborg_upgrade\fP (if \fB\-\-inplace\fP option is not used). Also hardlinks are used for more safe and secure file updating (e.g. of the repo config file), but the code tries to work also if hardlinks are not supported. .UNINDENT .SS Units .sp To display quantities, Borg takes care of respecting the usual conventions of scale. Disk sizes are displayed in \fI\%decimal\fP, using powers of ten (so \fBkB\fP means 1000 bytes). For memory usage, \fI\%binary prefixes\fP are used, and are indicated using the \fI\%IEC binary prefixes\fP, using powers of two (so \fBKiB\fP means 1024 bytes). .SS Date and Time .sp We format date and time conforming to ISO\-8601, that is: YYYY\-MM\-DD and HH:MM:SS (24h clock). .sp For more information about that, see: \fI\%https://xkcd.com/1179/\fP .sp Unless otherwise noted, we display local date and time. Internally, we store and process date and time as UTC. .SS Resource Usage .sp Borg might use a lot of resources depending on the size of the data set it is dealing with. .sp If one uses Borg in a client/server way (with a ssh: repository), the resource usage occurs in part on the client and in another part on the server. .sp If one uses Borg as a single process (with a filesystem repo), all the resource usage occurs in that one process, so just add up client + server to get the approximate resource usage. .INDENT 0.0 .TP .B CPU client: .INDENT 7.0 .IP \(bu 2 \fBborg create:\fP does chunking, hashing, compression, crypto (high CPU usage) .IP \(bu 2 \fBchunks cache sync:\fP quite heavy on CPU, doing lots of hashtable operations. .IP \(bu 2 \fBborg extract:\fP crypto, decompression (medium to high CPU usage) .IP \(bu 2 \fBborg check:\fP similar to extract, but depends on options given. .IP \(bu 2 \fBborg prune / borg delete archive:\fP low to medium CPU usage .IP \(bu 2 \fBborg delete repo:\fP done on the server .UNINDENT .sp It won\(aqt go beyond 100% of 1 core as the code is currently single\-threaded. Especially higher zlib and lzma compression levels use significant amounts of CPU cycles. Crypto might be cheap on the CPU (if hardware accelerated) or expensive (if not). .TP .B CPU server: It usually doesn\(aqt need much CPU, it just deals with the key/value store (repository) and uses the repository index for that. .sp borg check: the repository check computes the checksums of all chunks (medium CPU usage) borg delete repo: low CPU usage .TP .B CPU (only for client/server operation): When using borg in a client/server way with a \fI\%ssh:\-type\fP repo, the ssh processes used for the transport layer will need some CPU on the client and on the server due to the crypto they are doing \- esp. if you are pumping big amounts of data. .TP .B Memory (RAM) client: The chunks index and the files index are read into memory for performance reasons. Might need big amounts of memory (see below). Compression, esp. lzma compression with high levels might need substantial amounts of memory. .TP .B Memory (RAM) server: The server process will load the repository index into memory. Might need considerable amounts of memory, but less than on the client (see below). .TP .B Chunks index (client only): Proportional to the amount of data chunks in your repo. Lots of chunks in your repo imply a big chunks index. It is possible to tweak the chunker params (see create options). .TP .B Files index (client only): Proportional to the amount of files in your last backups. Can be switched off (see create options), but next backup might be much slower if you do. The speed benefit of using the files cache is proportional to file size. .TP .B Repository index (server only): Proportional to the amount of data chunks in your repo. Lots of chunks in your repo imply a big repository index. It is possible to tweak the chunker params (see create options) to influence the amount of chunks being created. .TP .B Temporary files (client): Reading data and metadata from a FUSE mounted repository will consume up to the size of all deduplicated, small chunks in the repository. Big chunks won\(aqt be locally cached. .TP .B Temporary files (server): A non\-trivial amount of data will be stored on the remote temp directory for each client that connects to it. For some remotes, this can fill the default temporary directory at /tmp. This can be remediated by ensuring the $TMPDIR, $TEMP, or $TMP environment variable is properly set for the sshd process. For some OSes, this can be done just by setting the correct value in the \&.bashrc (or equivalent login config file for other shells), however in other cases it may be necessary to first enable \fBPermitUserEnvironment yes\fP in your \fBsshd_config\fP file, then add \fBenvironment=\(dqTMPDIR=/my/big/tmpdir\(dq\fP at the start of the public key to be used in the \fBauthorized_hosts\fP file. .TP .B Cache files (client only): Contains the chunks index and files index (plus a collection of single\- archive chunk indexes which might need huge amounts of disk space, depending on archive count and size \- see FAQ about how to reduce). .TP .B Network (only for client/server operation): If your repository is remote, all deduplicated (and optionally compressed/ encrypted) data of course has to go over the connection (\fBssh://\fP repo url). If you use a locally mounted network filesystem, additionally some copy operations used for transaction support also go over the connection. If you backup multiple sources to one target repository, additional traffic happens for cache resynchronization. .UNINDENT .SS Support for file metadata .sp Besides regular file and directory structures, Borg can preserve .INDENT 0.0 .IP \(bu 2 symlinks (stored as symlink, the symlink is not followed) .IP \(bu 2 special files: .INDENT 2.0 .IP \(bu 2 character and block device files (restored via mknod) .IP \(bu 2 FIFOs (\(dqnamed pipes\(dq) .IP \(bu 2 special file \fIcontents\fP can be backed up in \fB\-\-read\-special\fP mode. By default the metadata to create them with mknod(2), mkfifo(2) etc. is stored. .UNINDENT .IP \(bu 2 hardlinked regular files, devices, FIFOs (considering all items in the same archive) .IP \(bu 2 timestamps in nanosecond precision: mtime, atime, ctime .IP \(bu 2 other timestamps: birthtime (on platforms supporting it) .IP \(bu 2 permissions: .INDENT 2.0 .IP \(bu 2 IDs of owning user and owning group .IP \(bu 2 names of owning user and owning group (if the IDs can be resolved) .IP \(bu 2 Unix Mode/Permissions (u/g/o permissions, suid, sgid, sticky) .UNINDENT .UNINDENT .sp On some platforms additional features are supported: .\" Yes/No's are grouped by reason/mechanism/reference. . .TS center; |l|l|l|l|. _ T{ Platform T} T{ ACLs [5] T} T{ xattr [6] T} T{ Flags [7] T} _ T{ Linux T} T{ Yes T} T{ Yes T} T{ Yes [1] T} _ T{ macOS T} T{ Yes T} T{ Yes T} T{ Yes (all) T} _ T{ FreeBSD T} T{ Yes T} T{ Yes T} T{ Yes (all) T} _ T{ OpenBSD T} T{ n/a T} T{ n/a T} T{ Yes (all) T} _ T{ NetBSD T} T{ n/a T} T{ No [2] T} T{ Yes (all) T} _ T{ Solaris and derivatives T} T{ No [3] T} T{ No [3] T} T{ n/a T} _ T{ Windows (cygwin) T} T{ No [4] T} T{ No T} T{ No T} _ .TE .sp Other Unix\-like operating systems may work as well, but have not been tested at all. .sp Note that most of the platform\-dependent features also depend on the file system. For example, ntfs\-3g on Linux isn\(aqt able to convey NTFS ACLs. .IP [1] 5 Only \(dqnodump\(dq, \(dqimmutable\(dq, \(dqcompressed\(dq and \(dqappend\(dq are supported. Feature request #618 for more flags. .IP [2] 5 Feature request #1332 .IP [3] 5 Feature request #1337 .IP [4] 5 Cygwin tries to map NTFS ACLs to permissions with varying degrees of success. .IP [5] 5 The native access control list mechanism of the OS. This normally limits access to non\-native ACLs. For example, NTFS ACLs aren\(aqt completely accessible on Linux with ntfs\-3g. .IP [6] 5 extended attributes; key\-value pairs attached to a file, mainly used by the OS. This includes resource forks on Mac OS X. .IP [7] 5 aka \fIBSD flags\fP\&. The Linux set of flags [1] is portable across platforms. The BSDs define additional flags. .SH SEE ALSO .sp \fIborg\-common(1)\fP for common command line options .sp \fIborg\-init(1)\fP, \fIborg\-create(1)\fP, \fIborg\-mount(1)\fP, \fIborg\-extract(1)\fP, \fIborg\-list(1)\fP, \fIborg\-info(1)\fP, \fIborg\-delete(1)\fP, \fIborg\-prune(1)\fP, \fIborg\-recreate(1)\fP .sp \fIborg\-compression(1)\fP, \fIborg\-patterns(1)\fP, \fIborg\-placeholders(1)\fP .INDENT 0.0 .IP \(bu 2 Main web site \fI\%https://www.borgbackup.org/\fP .IP \(bu 2 Releases \fI\%https://github.com/borgbackup/borg/releases\fP .IP \(bu 2 Changelog \fI\%https://github.com/borgbackup/borg/blob/master/docs/changes.rst\fP .IP \(bu 2 GitHub \fI\%https://github.com/borgbackup/borg\fP .IP \(bu 2 Security contact \fI\%https://borgbackup.readthedocs.io/en/latest/support.html#security\-contact\fP .UNINDENT .SH AUTHOR The Borg Collective orphan: .\" Generated by docutils manpage writer. . ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/man/borgfs.10000644000076500000240000001320514641074756015276 0ustar00twstaff.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "BORGFS" 1 "2024-07-02" "" "borg backup tool" .SH NAME borgfs \- Mount archive or an entire repository as a FUSE filesystem .SH SYNOPSIS .sp borgfs [options] REPOSITORY_OR_ARCHIVE MOUNTPOINT [PATH...] .SH DESCRIPTION .sp This command mounts an archive as a FUSE filesystem. This can be useful for browsing an archive or restoring individual files. Unless the \fB\-\-foreground\fP option is given the command will run in the background until the filesystem is \fBumounted\fP\&. .sp The command \fBborgfs\fP provides a wrapper for \fBborg mount\fP\&. This can also be used in fstab entries: \fB/path/to/repo /mnt/point fuse.borgfs defaults,noauto 0 0\fP .sp To allow a regular user to use fstab entries, add the \fBuser\fP option: \fB/path/to/repo /mnt/point fuse.borgfs defaults,noauto,user 0 0\fP .sp For FUSE configuration and mount options, see the mount.fuse(8) manual page. .sp Borg\(aqs default behavior is to use the archived user and group names of each file and map them to the system\(aqs respective user and group ids. Alternatively, using \fBnumeric\-ids\fP will instead use the archived user and group ids without any mapping. .sp The \fBuid\fP and \fBgid\fP mount options (implemented by Borg) can be used to override the user and group ids of all files (i.e., \fBborg mount \-o uid=1000,gid=1000\fP). .sp The man page references \fBuser_id\fP and \fBgroup_id\fP mount options (implemented by fuse) which specify the user and group id of the mount owner (aka, the user who does the mounting). It is set automatically by libfuse (or the filesystem if libfuse is not used). However, you should not specify these manually. Unlike the \fBuid\fP and \fBgid\fP mount options which affect all files, \fBuser_id\fP and \fBgroup_id\fP affect the user and group id of the mounted (base) directory. .sp Additional mount options supported by borg: .INDENT 0.0 .IP \(bu 2 \fBversions\fP: when used with a repository mount, this gives a merged, versioned view of the files in the archives. EXPERIMENTAL, layout may change in future. .IP \(bu 2 \fBallow_damaged_files\fP: by default damaged files (where missing chunks were replaced with runs of zeros by \fBborg check \-\-repair\fP) are not readable and return EIO (I/O error). Set this option to read such files. .IP \(bu 2 \fBignore_permissions\fP: for security reasons the \fBdefault_permissions\fP mount option is internally enforced by borg. \fBignore_permissions\fP can be given to not enforce \fBdefault_permissions\fP\&. .UNINDENT .sp The BORG_MOUNT_DATA_CACHE_ENTRIES environment variable is meant for advanced users to tweak the performance. It sets the number of cached data chunks; additional memory usage can be up to ~8 MiB times this number. The default is the number of CPU cores. .sp When the daemonized process receives a signal or crashes, it does not unmount. Unmounting in these cases could cause an active rsync or similar process to unintentionally delete data. .sp When running in the foreground ^C/SIGINT unmounts cleanly, but other signals or crashes do not. .SH OPTIONS .sp See \fIborg\-common(1)\fP for common options of Borg commands. .SS arguments .INDENT 0.0 .TP .B REPOSITORY_OR_ARCHIVE repository or archive to mount .TP .B MOUNTPOINT where to mount filesystem .TP .B PATH paths to extract; patterns are supported .UNINDENT .SS optional arguments .INDENT 0.0 .TP .B \-V\fP,\fB \-\-version show version number and exit .TP .B \-\-consider\-checkpoints Show checkpoint archives in the repository contents list (default: hidden). .TP .B \-f\fP,\fB \-\-foreground stay in foreground, do not daemonize .TP .B \-o Extra mount options .TP .B \-\-numeric\-owner deprecated, use \fB\-\-numeric\-ids\fP instead .TP .B \-\-numeric\-ids use numeric user and group identifiers from archive(s) .UNINDENT .SS Archive filters .INDENT 0.0 .TP .BI \-P \ PREFIX\fR,\fB \ \-\-prefix \ PREFIX only consider archive names starting with this prefix. (deprecated) .TP .BI \-a \ GLOB\fR,\fB \ \-\-glob\-archives \ GLOB only consider archive names matching the glob. sh: rules apply (without actually using the sh: prefix), see \(dqborg help patterns\(dq. .TP .BI \-\-sort\-by \ KEYS Comma\-separated list of sorting keys; valid keys are: timestamp, archive, name, id; default is: timestamp .TP .BI \-\-first \ N consider first N archives after other filters were applied .TP .BI \-\-last \ N consider last N archives after other filters were applied .UNINDENT .SS Include/Exclude options .INDENT 0.0 .TP .BI \-e \ PATTERN\fR,\fB \ \-\-exclude \ PATTERN exclude paths matching PATTERN .TP .BI \-\-exclude\-from \ EXCLUDEFILE read exclude patterns from EXCLUDEFILE, one per line .TP .BI \-\-pattern \ PATTERN include/exclude paths matching PATTERN .TP .BI \-\-patterns\-from \ PATTERNFILE read include/exclude patterns from PATTERNFILE, one per line .TP .BI \-\-strip\-components \ NUMBER Remove the specified number of leading path elements. Paths with fewer elements will be silently skipped. .UNINDENT .SH SEE ALSO .sp \fIborg\-common(1)\fP .SH AUTHOR The Borg Collective .\" Generated by docutils manpage writer. . ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/man_intro.rst0000644000076500000240000000317314641074756015702 0ustar00twstaff:orphan: SYNOPSIS -------- borg [common options] [options] [arguments] DESCRIPTION ----------- .. we don't include the README.rst here since we want to keep this terse. BorgBackup (short: Borg) is a deduplicating backup program. Optionally, it supports compression and authenticated encryption. The main goal of Borg is to provide an efficient and secure way to backup data. The data deduplication technique used makes Borg suitable for daily backups since only changes are stored. The authenticated encryption technique makes it suitable for backups to not fully trusted targets. Borg stores a set of files in an *archive*. A *repository* is a collection of *archives*. The format of repositories is Borg-specific. Borg does not distinguish archives from each other in any way other than their name, it does not matter when or where archives were created (e.g. different hosts). EXAMPLES -------- A step-by-step example ~~~~~~~~~~~~~~~~~~~~~~ .. include:: quickstart_example.rst.inc NOTES ----- .. include:: usage_general.rst.inc SEE ALSO -------- `borg-common(1)` for common command line options `borg-init(1)`, `borg-create(1)`, `borg-mount(1)`, `borg-extract(1)`, `borg-list(1)`, `borg-info(1)`, `borg-delete(1)`, `borg-prune(1)`, `borg-recreate(1)` `borg-compression(1)`, `borg-patterns(1)`, `borg-placeholders(1)` * Main web site https://www.borgbackup.org/ * Releases https://github.com/borgbackup/borg/releases * Changelog https://github.com/borgbackup/borg/blob/master/docs/changes.rst * GitHub https://github.com/borgbackup/borg * Security contact https://borgbackup.readthedocs.io/en/latest/support.html#security-contact ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719958149.7772975 borgbackup-1.4.0/docs/misc/0000755000076500000240000000000014641075206014100 5ustar00twstaff././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719958149.7804284 borgbackup-1.4.0/docs/misc/asciinema/0000755000076500000240000000000014641075206016031 5ustar00twstaff././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/misc/asciinema/README0000644000076500000240000000026514641074756016725 0ustar00twstaffDo NOT run the examples without isolation (e.g Vagrant) or this code may make undesirable changes to your host. Running `vagrant up` in this directory will update the screencasts. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/misc/asciinema/Vagrantfile0000644000076500000240000000622714641074756020236 0ustar00twstaffVagrant.configure("2") do |config| config.vm.box = "debian/bullseye64" config.vm.provision "install dependencies", type: "shell", inline: <<-SHELL apt-get update apt-get install -y wget expect gpg asciinema ssh adduser fuse mkdir -p /wallpaper wget \ --user-agent="borgbackup demo screencast" \ --input-file=/vagrant/sample-wallpapers.txt \ --directory-prefix=/wallpaper SHELL config.vm.provision "record install", type: "shell", inline: <<-SHELL gpg --recv-keys "6D5B EF9A DD20 7580 5747 B70F 9F88 FB52 FAF7 B393" asciinema rec -c 'expect /vagrant/install.tcl' --overwrite /vagrant/install.json < /dev/null SHELL config.vm.provision "record basic usage", type: "shell", inline: <<-SHELL # `rm` below allows quick re-exec via: # vagrant vagrant provision --provision-with "record basic usage" # this is useful when testing changes rm -r /media/backup/borgdemo || true rm -r ~/.ssh/ || true rm -r Wallpaper || true deluser --remove-home borgdemo || true # In case we have skipped "record install" if [ ! -e /usr/local/bin/borg ] ; then wget https://github.com/borgbackup/borg/releases/download/1.2.1/borg-linux64 install --owner root --group root --mode 755 borg-linux64 /usr/local/bin/borg fi mkdir -p /media/backup/borgdemo mkdir Wallpaper cp -r /wallpaper Wallpaper/bigcollection cp /wallpaper/Trapper_cabin.jpg Wallpaper/deer.jpg adduser --disabled-password borgdemo echo '127.0.0.1 remoteserver.example' >> /etc/hosts ssh-keygen -f ~/.ssh/id_rsa -N '' ssh-keyscan remoteserver.example > ~/.ssh/known_hosts runuser -u borgdemo mkdir ~borgdemo/.ssh runuser -u borgdemo tee ~borgdemo/.ssh/authorized_keys < ~/.ssh/id_rsa.pub asciinema rec -c 'expect /vagrant/basic.tcl' --overwrite /vagrant/basic.json < /dev/null SHELL config.vm.provision "record advanced usage", type: "shell", inline: <<-SHELL rm -r /media/backup/borgdemo || true rm -r Wallpaper || true # In case we have skipped "record install" if [ ! -e /usr/local/bin/borg ] ; then wget https://github.com/borgbackup/borg/releases/download/1.2.1/borg-linux64 install --owner root --group root --mode 755 borg-linux64 /usr/local/bin/borg fi mkdir -p /media/backup/borgdemo mkdir Wallpaper cp -r /wallpaper Wallpaper/bigcollection cp /wallpaper/Trapper_cabin.jpg Wallpaper/deer.jpg mkdir -p ~/Downloads/big dd if=/dev/zero of=loopbackfile.img bs=100M count=4 losetup /dev/loop0 loopbackfile.img # Make it look as if the adv. usage screencast was recorded after basic usage export BORG_PASSPHRASE='1234' borg init --encryption=repokey /media/backup/borgdemo borg create --compression lz4 /media/backup/borgdemo::backup1 Wallpaper echo "new nice file" > Wallpaper/newfile.txt borg create --compression lz4 /media/backup/borgdemo::backup2 Wallpaper mv Wallpaper/bigcollection Wallpaper/bigcollection_NEW borg create --compression lz4 /media/backup/borgdemo::backup3 Wallpaper unset BORG_PASSPHRASE asciinema rec -c 'expect /vagrant/advanced.tcl' --overwrite /vagrant/advanced.json < /dev/null SHELL end ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/misc/asciinema/advanced.json0000644000076500000240000053726014641074756020517 0ustar00twstaff{"version": 2, "width": 80, "height": 24, "timestamp": 1657143034, "env": {"SHELL": "/bin/bash", "TERM": "vt100"}} [0.768648, "o", "$ #"] [0.819047, "o", " "] [0.842504, "o", "F"] [0.878977, "o", "o"] [0.899264, "o", "r"] [0.943053, "o", " "] [0.978278, "o", "t"] [0.987772, "o", "h"] [1.031408, "o", "e"] [1.056081, "o", " "] [1.086997, "o", "p"] [1.152571, "o", "r"] [1.209285, "o", "o"] [1.255887, "o", " "] [1.26543, "o", "u"] [1.274899, "o", "s"] [1.315128, "o", "e"] [1.40852, "o", "r"] [1.431039, "o", "s"] [1.447279, "o", ","] [1.519005, "o", " "] [1.575052, "o", "h"] [1.58459, "o", "e"] [1.594101, "o", "r"] [1.606992, "o", "e"] [1.748322, "o", " "] [1.87594, "o", "a"] [1.945731, "o", "r"] [2.000125, "o", "e"] [2.024668, "o", " "] [2.203154, "o", "s"] [2.263049, "o", "o"] [2.309367, "o", "m"] [2.33112, "o", "e"] [2.352861, "o", " "] [2.490625, "o", "a"] [2.551042, "o", "d"] [2.583045, "o", "v"] [2.690816, "o", "a"] [2.700252, "o", "n"] [2.759018, "o", "c"] [2.768529, "o", "e"] [2.808619, "o", "d"] [2.855074, "o", " "] [2.884555, "o", "f"] [2.914707, "o", "e"] [2.929256, "o", "a"] [3.129633, "o", "t"] [3.138965, "o", "u"] [3.184356, "o", "r"] [3.311044, "o", "e"] [3.396778, "o", "s"] [3.406265, "o", " "] [3.415762, "o", "o"] [3.471532, "o", "f"] [3.675, "o", " "] [3.757453, "o", "b"] [3.801838, "o", "o"] [3.838019, "o", "r"] [3.85161, "o", "g"] [4.018913, "o", ","] [4.052867, "o", " "] [4.179986, "o", "s"] [4.190396, "o", "o"] [4.372854, "o", " "] [4.481366, "o", "y"] [4.490884, "o", "o"] [4.511015, "o", "u"] [4.555555, "o", " "] [4.630529, "o", "c"] [4.640007, "o", "a"] [4.724636, "o", "n"] [4.910983, "o", " "] [4.938589, "o", "i"] [5.095055, "o", "m"] [5.107011, "o", "p"] [5.214923, "o", "r"] [5.226529, "o", "e"] [5.315333, "o", "s"] [5.471155, "o", "s"] [5.555004, "o", " "] [5.622492, "o", "y"] [5.661749, "o", "o"] [5.707342, "o", "u"] [5.787235, "o", "r"] [5.811207, "o", " "] [5.857214, "o", "f"] [5.88323, "o", "r"] [5.964393, "o", "i"] [5.97392, "o", "e"] [6.021398, "o", "n"] [6.044981, "o", "d"] [6.069829, "o", "s"] [6.106061, "o", "."] [6.147432, "o", " "] [6.351264, "o", ";"] [6.361522, "o", ")"] [6.392543, "o", "\r\n"] [6.39289, "o", "$ "] [6.392956, "o", "#"] [6.412913, "o", " "] [6.425579, "o", "N"] [6.435148, "o", "o"] [6.444729, "o", "t"] [6.539217, "o", "e"] [6.632652, "o", ":"] [6.642205, "o", " "] [6.697711, "o", "T"] [6.715209, "o", "h"] [6.7247, "o", "i"] [6.759216, "o", "s"] [6.95973, "o", " "] [7.008323, "o", "s"] [7.019203, "o", "c"] [7.057184, "o", "r"] [7.257712, "o", "e"] [7.338241, "o", "e"] [7.40562, "o", "n"] [7.43121, "o", "c"] [7.572713, "o", "a"] [7.612116, "o", "s"] [7.626855, "o", "t"] [7.66643, "o", " "] [7.727205, "o", "w"] [7.777758, "o", "a"] [7.827163, "o", "s"] [7.858017, "o", " "] [7.907525, "o", "m"] [7.952253, "o", "a"] [8.014485, "o", "d"] [8.0731, "o", "e"] [8.273661, "o", " "] [8.336051, "o", "w"] [8.439208, "o", "i"] [8.448307, "o", "t"] [8.470845, "o", "h"] [8.499491, "o", " "] [8.614968, "o", "b"] [8.816062, "o", "o"] [8.832931, "o", "r"] [8.991667, "o", "g"] [9.021108, "o", " "] [9.039006, "o", "1"] [9.126149, "o", "."] [9.140746, "o", "2"] [9.298244, "o", "."] [9.319537, "o", "1"] [9.49402, "o", " "] [9.533047, "o", "–"] [9.594869, "o", " "] [9.667117, "o", "o"] [9.761801, "o", "l"] [9.923825, "o", "d"] [10.02222, "o", "e"] [10.062303, "o", "r"] [10.15542, "o", " "] [10.1914, "o", "o"] [10.235464, "o", "r"] [10.263389, "o", " "] [10.272554, "o", "n"] [10.282136, "o", "e"] [10.339477, "o", "w"] [10.54022, "o", "e"] [10.615052, "o", "r"] [10.654864, "o", " "] [10.735194, "o", "b"] [10.744688, "o", "o"] [10.786952, "o", "r"] [10.81902, "o", "g"] [11.010552, "o", " "] [11.105492, "o", "v"] [11.133374, "o", "e"] [11.142911, "o", "r"] [11.25048, "o", "s"] [11.327051, "o", "i"] [11.349735, "o", "o"] [11.406042, "o", "n"] [11.415592, "o", "s"] [11.436237, "o", " "] [11.635499, "o", "m"] [11.723838, "o", "a"] [11.788201, "o", "y"] [11.879904, "o", " "] [11.958149, "o", "b"] [12.001343, "o", "e"] [12.126177, "o", "h"] [12.135508, "o", "a"] [12.230989, "o", "v"] [12.264373, "o", "e"] [12.280025, "o", " "] [12.410209, "o", "d"] [12.450914, "o", "i"] [12.539827, "o", "f"] [12.598996, "o", "f"] [12.608261, "o", "e"] [12.617685, "o", "r"] [12.632187, "o", "e"] [12.790989, "o", "n"] [12.826976, "o", "t"] [12.89162, "o", "l"] [12.975071, "o", "y"] [12.986557, "o", "."] [12.999146, "o", "\r\n"] [12.999751, "o", "$ \r\n$ #"] [13.060331, "o", " "] [13.069688, "o", "F"] [13.099036, "o", "i"] [13.185258, "o", "r"] [13.198792, "o", "s"] [13.209188, "o", "t"] [13.263526, "o", " "] [13.329055, "o", "o"] [13.407171, "o", "f"] [13.608135, "o", " "] [13.626983, "o", "a"] [13.688315, "o", "l"] [13.697764, "o", "l"] [13.715004, "o", ","] [13.892359, "o", " "] [13.901819, "o", "w"] [13.998468, "o", "e"] [14.032986, "o", " "] [14.087043, "o", "c"] [14.125877, "o", "a"] [14.151009, "o", "n"] [14.235155, "o", " "] [14.313567, "o", "u"] [14.335062, "o", "s"] [14.344804, "o", "e"] [14.379354, "o", " "] [14.509748, "o", "s"] [14.652207, "o", "e"] [14.680643, "o", "v"] [14.728477, "o", "e"] [14.788854, "o", "r"] [14.90724, "o", "a"] [14.961741, "o", "l"] [15.162007, "o", " "] [15.227757, "o", "e"] [15.282232, "o", "n"] [15.291691, "o", "v"] [15.417971, "o", "i"] [15.443234, "o", "r"] [15.555707, "o", "o"] [15.611088, "o", "n"] [15.672888, "o", "m"] [15.696164, "o", "e"] [15.778922, "o", "n"] [15.829436, "o", "t"] [15.871693, "o", " "] [15.922998, "o", "v"] [15.957608, "o", "a"] [15.9844, "o", "r"] [16.001013, "o", "i"] [16.082567, "o", "a"] [16.124326, "o", "b"] [16.219488, "o", "l"] [16.242184, "o", "e"] [16.367007, "o", "s"] [16.482485, "o", " "] [16.535034, "o", "f"] [16.582985, "o", "o"] [16.608749, "o", "r"] [16.805253, "o", " "] [16.817763, "o", "b"] [16.827346, "o", "o"] [16.902962, "o", "r"] [17.010552, "o", "g"] [17.019948, "o", "."] [17.035642, "o", "\r\n$ #"] [17.045132, "o", " "] [17.055624, "o", "E"] [17.182999, "o", "."] [17.25914, "o", "g"] [17.454545, "o", "."] [17.464707, "o", " "] [17.474183, "o", "w"] [17.503023, "o", "e"] [17.68359, "o", " "] [17.698943, "o", "d"] [17.791032, "o", "o"] [17.801167, "o", " "] [17.831033, "o", "n"] [17.842921, "o", "o"] [17.959138, "o", "t"] [17.96848, "o", " "] [18.145872, "o", "w"] [18.161406, "o", "a"] [18.292528, "o", "n"] [18.320058, "o", "t"] [18.437598, "o", " "] [18.45628, "o", "t"] [18.541798, "o", "o"] [18.62301, "o", " "] [18.661202, "o", "t"] [18.786572, "o", "y"] [18.796032, "o", "p"] [18.807045, "o", "e"] [18.928807, "o", " "] [18.950521, "o", "i"] [18.987044, "o", "n"] [19.075581, "o", " "] [19.0942, "o", "o"] [19.106641, "o", "u"] [19.130251, "o", "r"] [19.330682, "o", " "] [19.341078, "o", "r"] [19.358696, "o", "e"] [19.368058, "o", "p"] [19.377522, "o", "o"] [19.419039, "o", " "] [19.608443, "o", "p"] [19.617959, "o", "a"] [19.694452, "o", "t"] [19.794913, "o", "h"] [19.952455, "o", " "] [20.035038, "o", "a"] [20.083042, "o", "n"] [20.171973, "o", "d"] [20.243033, "o", " "] [20.254983, "o", "p"] [20.291367, "o", "a"] [20.3727, "o", "s"] [20.466977, "o", "s"] [20.558116, "o", "w"] [20.567538, "o", "o"] [20.607054, "o", "r"] [20.666378, "o", "d"] [20.678977, "o", " "] [20.690985, "o", "a"] [20.702998, "o", "g"] [20.744796, "o", "a"] [20.790992, "o", "i"] [20.800385, "o", "n"] [20.881913, "o", " "] [20.950979, "o", "a"] [21.040524, "o", "n"] [21.11104, "o", "d"] [21.275424, "o", " "] [21.463012, "o", "a"] [21.503013, "o", "g"] [21.512508, "o", "a"] [21.57893, "o", "i"] [21.606392, "o", "n"] [21.725122, "o", "…"] [21.769809, "o", "\r\n$ e"] [21.803359, "o", "x"] [21.815009, "o", "p"] [21.824309, "o", "o"] [21.89458, "o", "r"] [21.906961, "o", "t"] [21.948228, "o", " "] [21.967744, "o", "B"] [21.977193, "o", "O"] [22.12507, "o", "R"] [22.154999, "o", "G"] [22.202465, "o", "_"] [22.253869, "o", "R"] [22.269407, "o", "E"] [22.294996, "o", "P"] [22.327029, "o", "O"] [22.416502, "o", "="] [22.617292, "o", "'"] [22.662825, "o", "/"] [22.67222, "o", "m"] [22.707279, "o", "e"] [22.734538, "o", "d"] [22.790948, "o", "i"] [22.810998, "o", "a"] [22.829427, "o", "/"] [23.031009, "o", "b"] [23.043435, "o", "a"] [23.155688, "o", "c"] [23.182287, "o", "k"] [23.303009, "o", "u"] [23.335461, "o", "p"] [23.434866, "o", "/"] [23.444346, "o", "b"] [23.499795, "o", "o"] [23.531013, "o", "r"] [23.661517, "o", "g"] [23.715646, "o", "d"] [23.755832, "o", "e"] [23.765272, "o", "m"] [23.802991, "o", "o"] [23.872678, "o", "'"] [23.903462, "o", "\r\n"] [23.903965, "o", "$ e"] [23.913483, "o", "x"] [23.947622, "o", "p"] [23.964186, "o", "o"] [24.011565, "o", "r"] [24.031009, "o", "t"] [24.040478, "o", " "] [24.225827, "o", "B"] [24.241378, "o", "O"] [24.279005, "o", "R"] [24.28844, "o", "G"] [24.410795, "o", "_"] [24.457036, "o", "P"] [24.478998, "o", "A"] [24.537176, "o", "S"] [24.622476, "o", "S"] [24.63584, "o", "P"] [24.645319, "o", "H"] [24.679837, "o", "R"] [24.713232, "o", "A"] [24.747347, "o", "S"] [24.802772, "o", "E"] [24.939031, "o", "="] [25.063414, "o", "'"] [25.085883, "o", "1"] [25.131182, "o", "2"] [25.146789, "o", "3"] [25.17097, "o", "4"] [25.181406, "o", "'"] [25.255167, "o", "\r\n$ #"] [25.455604, "o", " "] [25.515004, "o", "P"] [25.524401, "o", "r"] [25.533815, "o", "o"] [25.551117, "o", "b"] [25.563604, "o", "l"] [25.652944, "o", "e"] [25.662389, "o", "m"] [25.69001, "o", " "] [25.712501, "o", "s"] [25.724796, "o", "o"] [25.874974, "o", "l"] [25.941505, "o", "v"] [25.982985, "o", "e"] [26.010991, "o", "d"] [26.050291, "o", ","] [26.093324, "o", " "] [26.111054, "o", "b"] [26.198394, "o", "o"] [26.286561, "o", "r"] [26.326204, "o", "g"] [26.356889, "o", " "] [26.430982, "o", "w"] [26.44645, "o", "i"] [26.472184, "o", "l"] [26.494997, "o", "l"] [26.530965, "o", " "] [26.607747, "o", "u"] [26.63889, "o", "s"] [26.728184, "o", "e"] [26.746538, "o", " "] [26.776367, "o", "t"] [26.812555, "o", "h"] [26.821996, "o", "i"] [26.838955, "o", "s"] [26.927322, "o", " "] [26.936757, "o", "a"] [26.946151, "o", "u"] [26.995406, "o", "t"] [27.011962, "o", "o"] [27.024437, "o", "m"] [27.117245, "o", "a"] [27.126966, "o", "t"] [27.279335, "o", "i"] [27.288775, "o", "c"] [27.314968, "o", "a"] [27.334924, "o", "l"] [27.371544, "o", "l"] [27.431022, "o", "y"] [27.631831, "o", "…"] [27.65508, "o", " "] [27.668634, "o", ":"] [27.678135, "o", ")"] [27.687675, "o", "\r\n"] [27.688086, "o", "$ #"] [27.70553, "o", " "] [27.736874, "o", "W"] [27.778417, "o", "e"] [27.787855, "o", "'"] [27.847064, "o", "l"] [27.872775, "o", "l"] [27.882286, "o", " "] [28.006994, "o", "u"] [28.131631, "o", "s"] [28.225535, "o", "e"] [28.246953, "o", " "] [28.262315, "o", "t"] [28.370427, "o", "h"] [28.384875, "o", "i"] [28.502982, "o", "s"] [28.703165, "o", " "] [28.7349, "o", "r"] [28.770977, "o", "i"] [28.832334, "o", "g"] [28.842777, "o", "h"] [28.874993, "o", "t"] [28.888544, "o", " "] [28.902979, "o", "a"] [29.076391, "o", "w"] [29.120581, "o", "a"] [29.225466, "o", "y"] [29.235041, "o", "…"] [29.283084, "o", "\r\n"] [29.283646, "o", "$ \r\n"] [29.284034, "o", "$ #"] [29.383424, "o", "#"] [29.392808, "o", " "] [29.420544, "o", "A"] [29.4309, "o", "D"] [29.440364, "o", "V"] [29.449873, "o", "A"] [29.495251, "o", "N"] [29.639413, "o", "C"] [29.64894, "o", "E"] [29.66553, "o", "D"] [29.746904, "o", " "] [29.758356, "o", "C"] [29.798779, "o", "R"] [29.830964, "o", "E"] [29.843403, "o", "A"] [29.858925, "o", "T"] [29.868203, "o", "I"] [29.899006, "o", "O"] [29.965264, "o", "N"] [30.162763, "o", " "] [30.191018, "o", "#"] [30.201373, "o", "#"] [30.272056, "o", "\r\n"] [30.272614, "o", "$ \r\n"] [30.272946, "o", "$ #"] [30.293589, "o", " "] [30.33099, "o", "W"] [30.340457, "o", "e"] [30.542977, "o", " "] [30.560565, "o", "c"] [30.572165, "o", "a"] [30.614991, "o", "n"] [30.663027, "o", " "] [30.71139, "o", "a"] [30.783952, "o", "l"] [30.801481, "o", "s"] [30.839011, "o", "o"] [30.852338, "o", " "] [30.861725, "o", "u"] [30.900896, "o", "s"] [30.927412, "o", "e"] [31.014982, "o", " "] [31.055047, "o", "s"] [31.223032, "o", "o"] [31.302948, "o", "m"] [31.339396, "o", "e"] [31.539842, "o", " "] [31.676113, "o", "p"] [31.857625, "o", "l"] [31.916215, "o", "a"] [31.9574, "o", "c"] [31.981896, "o", "e"] [32.088152, "o", "h"] [32.107751, "o", "o"] [32.188877, "o", "l"] [32.272549, "o", "d"] [32.301495, "o", "e"] [32.321059, "o", "r"] [32.408185, "o", "s"] [32.422845, "o", " "] [32.451011, "o", "i"] [32.529593, "o", "n"] [32.593158, "o", " "] [32.632624, "o", "o"] [32.642958, "o", "u"] [32.65631, "o", "r"] [32.838845, "o", " "] [32.898746, "o", "a"] [32.922951, "o", "r"] [32.971394, "o", "c"] [32.982984, "o", "h"] [33.022383, "o", "i"] [33.032879, "o", "v"] [33.051246, "o", "e"] [33.084787, "o", " "] [33.26713, "o", "n"] [33.353287, "o", "a"] [33.366472, "o", "m"] [33.422971, "o", "e"] [33.581748, "o", "…"] [33.713408, "o", "\r\n"] [33.713891, "o", "$ b"] [33.867002, "o", "o"] [33.91104, "o", "r"] [33.932041, "o", "g"] [34.075293, "o", " "] [34.084734, "o", "c"] [34.121825, "o", "r"] [34.219301, "o", "e"] [34.288629, "o", "a"] [34.343252, "o", "t"] [34.357744, "o", "e"] [34.435105, "o", " "] [34.444706, "o", "-"] [34.52727, "o", "-"] [34.564482, "o", "s"] [34.574039, "o", "t"] [34.599311, "o", "a"] [34.755245, "o", "t"] [34.771806, "o", "s"] [34.78124, "o", " "] [34.851131, "o", "-"] [34.939052, "o", "-"] [34.951559, "o", "p"] [34.961005, "o", "r"] [34.97031, "o", "o"] [35.12819, "o", "g"] [35.228805, "o", "r"] [35.251403, "o", "e"] [35.276778, "o", "s"] [35.307296, "o", "s"] [35.316668, "o", " "] [35.343066, "o", "-"] [35.367632, "o", "-"] [35.415702, "o", "c"] [35.452671, "o", "o"] [35.574231, "o", "m"] [35.650388, "o", "p"] [35.659845, "o", "r"] [35.735001, "o", "e"] [35.752448, "o", "s"] [35.787031, "o", "s"] [35.796485, "o", "i"] [35.843758, "o", "o"] [35.870949, "o", "n"] [35.958837, "o", " "] [35.970931, "o", "l"] [36.010975, "o", "z"] [36.211339, "o", "4"] [36.220814, "o", " "] [36.303384, "o", ":"] [36.312833, "o", ":"] [36.392376, "o", "{"] [36.442668, "o", "u"] [36.64288, "o", "s"] [36.690147, "o", "e"] [36.72678, "o", "r"] [36.927231, "o", "}"] [36.963512, "o", "-"] [37.061838, "o", "{"] [37.083465, "o", "n"] [37.14301, "o", "o"] [37.260484, "o", "w"] [37.33903, "o", "}"] [37.428115, "o", " "] [37.44573, "o", "W"] [37.455225, "o", "a"] [37.526439, "o", "l"] [37.535647, "o", "l"] [37.545066, "o", "p"] [37.561417, "o", "a"] [37.570742, "o", "p"] [37.615839, "o", "e"] [37.633475, "o", "r"] [37.77723, "o", "\r\n"] [38.728182, "o", "0 B O 0 B C 0 B D 0 N Wallpaper \r"] [38.729483, "o", "Initializing cache transaction: Reading config \r"] [38.73014, "o", "Initializing cache transaction: Reading chunks \r"] [38.73084, "o", "Initializing cache transaction: Reading files \r"] [38.731497, "o", " \r"] [38.740067, "o", " \r"] [38.75526, "o", "Saving files cache \r"] [38.756708, "o", "Saving chunks cache \r"] [38.757468, "o", "Saving cache config \r"] [38.759071, "o", " \r"] [38.761562, "o", "------------------------------------------------------------------------------"] [38.761744, "o", "\r\r\n"] [38.761989, "o", "Repository: /media/backup/borgdemo"] [38.762153, "o", "\r\r\n"] [38.762386, "o", "Archive name: root-2022-07-06T21:31:12"] [38.762674, "o", "\r\r\n"] [38.762747, "o", "Archive fingerprint: 280fe9e3d92e2e61f04f0ef98de32b4d0a797ec9e3b0b29ddb2b0946c4a0236b"] [38.762885, "o", "\r\r\n"] [38.763095, "o", "Time (start): Wed, 2022-07-06 21:31:12"] [38.763338, "o", "\r\r\n"] [38.763535, "o", "Time (end): Wed, 2022-07-06 21:31:12"] [38.763775, "o", "\r\r\n"] [38.763962, "o", "Duration: 0.02 seconds"] [38.764202, "o", "\r\r\n"] [38.764463, "o", "Number of files: 32\r\r\n"] [38.764682, "o", "Utilization of max. archive size: 0%"] [38.764874, "o", "\r\r\n"] [38.76508, "o", "------------------------------------------------------------------------------"] [38.765384, "o", "\r\r\n Original size Compressed size Deduplicated size"] [38.765551, "o", "\r\r\n"] [38.765757, "o", "This archive: 401.15 MB 399.73 MB 542 B"] [38.76595, "o", "\r\r\n"] [38.766157, "o", "All archives: 1.60 GB 1.60 GB 399.57 MB"] [38.766321, "o", "\r\r\n"] [38.766523, "o", "\r\r\n"] [38.766796, "o", " Unique chunks Total chunks"] [38.767025, "o", "\r\r\n"] [38.767238, "o", "Chunk index: 182 711"] [38.767399, "o", "\r\r\n"] [38.767602, "o", "------------------------------------------------------------------------------"] [38.767957, "o", "\r\r\n"] [38.815857, "o", "$ #"] [38.923502, "o", " "] [39.027, "o", "N"] [39.043393, "o", "o"] [39.095046, "o", "t"] [39.154595, "o", "i"] [39.167017, "o", "c"] [39.219356, "o", "e"] [39.25099, "o", " "] [39.284613, "o", "t"] [39.336021, "o", "h"] [39.439378, "o", "e"] [39.448858, "o", " "] [39.471101, "o", "b"] [39.480542, "o", "a"] [39.530899, "o", "c"] [39.564044, "o", "k"] [39.606444, "o", "u"] [39.645591, "o", "p"] [39.65497, "o", " "] [39.681416, "o", "n"] [39.772835, "o", "a"] [39.782316, "o", "m"] [39.910022, "o", "e"] [40.02652, "o", "."] [40.199614, "o", "\r\n$ \r\n$ #"] [40.243003, "o", " "] [40.259433, "o", "A"] [40.282203, "o", "n"] [40.299793, "o", "d"] [40.500115, "o", " "] [40.513573, "o", "w"] [40.555786, "o", "e"] [40.640486, "o", " "] [40.700229, "o", "c"] [40.728957, "o", "a"] [40.929419, "o", "n"] [41.12993, "o", " "] [41.256333, "o", "p"] [41.306777, "o", "u"] [41.352942, "o", "t"] [41.471912, "o", " "] [41.545122, "o", "c"] [41.609493, "o", "o"] [41.630075, "o", "m"] [41.645445, "o", "p"] [41.662961, "o", "l"] [41.714345, "o", "e"] [41.72384, "o", "t"] [41.759022, "o", "e"] [41.773394, "o", "l"] [41.782732, "o", "y"] [41.833383, "o", " "] [41.895001, "o", "d"] [41.904433, "o", "i"] [41.926981, "o", "f"] [41.946971, "o", "f"] [41.979006, "o", "e"] [42.03056, "o", "r"] [42.087944, "o", "e"] [42.123277, "o", "n"] [42.143987, "o", "t"] [42.260474, "o", " "] [42.26997, "o", "d"] [42.391003, "o", "a"] [42.415766, "o", "t"] [42.432303, "o", "a"] [42.63498, "o", ","] [42.644225, "o", " "] [42.827016, "o", "w"] [42.845569, "o", "i"] [42.908977, "o", "t"] [42.964603, "o", "h"] [42.974094, "o", " "] [42.98695, "o", "d"] [43.063018, "o", "i"] [43.072434, "o", "f"] [43.107612, "o", "f"] [43.135052, "o", "e"] [43.14441, "o", "r"] [43.214774, "o", "e"] [43.270106, "o", "n"] [43.27948, "o", "t"] [43.294946, "o", " "] [43.319007, "o", "b"] [43.494978, "o", "a"] [43.511473, "o", "c"] [43.570849, "o", "k"] [43.58022, "o", "u"] [43.639716, "o", "p"] [43.654954, "o", " "] [43.715076, "o", "s"] [43.724678, "o", "e"] [43.815095, "o", "t"] [43.854662, "o", "t"] [43.916752, "o", "i"] [43.929157, "o", "n"] [44.019065, "o", "g"] [44.066708, "o", "s"] [44.078303, "o", ","] [44.159135, "o", " "] [44.216838, "o", "i"] [44.307253, "o", "n"] [44.334797, "o", " "] [44.372032, "o", "o"] [44.381394, "o", "u"] [44.390774, "o", "r"] [44.442241, "o", " "] [44.463309, "o", "b"] [44.473591, "o", "a"] [44.49526, "o", "c"] [44.50448, "o", "k"] [44.602902, "o", "u"] [44.631293, "o", "p"] [44.8315, "o", "."] [44.841097, "o", " "] [44.850531, "o", "I"] [44.866947, "o", "t"] [44.930496, "o", " "] [44.951657, "o", "w"] [45.01905, "o", "i"] [45.067479, "o", "l"] [45.076954, "o", "l"] [45.227241, "o", " "] [45.239817, "o", "b"] [45.26112, "o", "e"] [45.290566, "o", " "] [45.303406, "o", "d"] [45.312421, "o", "e"] [45.363008, "o", "d"] [45.382612, "o", "u"] [45.454977, "o", "p"] [45.474444, "o", "l"] [45.483814, "o", "i"] [45.686687, "o", "c"] [45.734982, "o", "a"] [45.909772, "o", "t"] [46.110364, "o", "e"] [46.119831, "o", "d"] [46.154955, "o", ","] [46.31846, "o", " "] [46.342976, "o", "a"] [46.365482, "o", "n"] [46.451798, "o", "y"] [46.493003, "o", "w"] [46.502493, "o", "a"] [46.548, "o", "y"] [46.618954, "o", ":"] [46.645599, "o", "\r\n"] [46.646017, "o", "$ b"] [46.737468, "o", "o"] [46.862935, "o", "r"] [46.875431, "o", "g"] [46.979005, "o", " "] [47.038989, "o", "c"] [47.071029, "o", "r"] [47.271454, "o", "e"] [47.423014, "o", "a"] [47.478504, "o", "t"] [47.623367, "o", "e"] [47.667711, "o", " "] [47.868353, "o", "-"] [47.927624, "o", "-"] [47.987025, "o", "s"] [48.115443, "o", "t"] [48.146002, "o", "a"] [48.164393, "o", "t"] [48.275588, "o", "s"] [48.33613, "o", " "] [48.345597, "o", "-"] [48.50091, "o", "-"] [48.511465, "o", "p"] [48.524985, "o", "r"] [48.534442, "o", "o"] [48.543773, "o", "g"] [48.624086, "o", "r"] [48.636604, "o", "e"] [48.662972, "o", "s"] [48.672252, "o", "s"] [48.723547, "o", " "] [48.923935, "o", "-"] [49.043023, "o", "-"] [49.062581, "o", "c"] [49.075033, "o", "o"] [49.095001, "o", "m"] [49.174991, "o", "p"] [49.231004, "o", "r"] [49.240489, "o", "e"] [49.274596, "o", "s"] [49.29506, "o", "s"] [49.375731, "o", "i"] [49.474879, "o", "o"] [49.484391, "o", "n"] [49.551834, "o", " "] [49.591234, "o", "z"] [49.600649, "o", "l"] [49.746253, "o", "i"] [49.795017, "o", "b"] [49.913498, "o", ","] [49.922915, "o", "6"] [49.991003, "o", " "] [50.043696, "o", "-"] [50.05315, "o", "-"] [50.119, "o", "e"] [50.187581, "o", "x"] [50.199004, "o", "c"] [50.216452, "o", "l"] [50.386885, "o", "u"] [50.403456, "o", "d"] [50.427008, "o", "e"] [50.47501, "o", " "] [50.490128, "o", "~"] [50.499528, "o", "/"] [50.557048, "o", "D"] [50.589507, "o", "o"] [50.614943, "o", "w"] [50.646175, "o", "n"] [50.772655, "o", "l"] [50.788527, "o", "o"] [50.96277, "o", "a"] [50.972183, "o", "d"] [50.981668, "o", "s"] [51.159808, "o", "/"] [51.169272, "o", "b"] [51.18588, "o", "i"] [51.195007, "o", "g"] [51.395579, "o", " "] [51.598979, "o", ":"] [51.637314, "o", ":"] [51.687702, "o", "{"] [51.819, "o", "u"] [51.828341, "o", "s"] [51.844681, "o", "e"] [51.854996, "o", "r"] [51.931009, "o", "}"] [51.940417, "o", "-"] [52.082583, "o", "{"] [52.168797, "o", "n"] [52.24168, "o", "o"] [52.442577, "o", "w"] [52.464135, "o", "}"] [52.473611, "o", " "] [52.483012, "o", "~"] [52.510975, "o", "/"] [52.555894, "o", "D"] [52.571294, "o", "o"] [52.593995, "o", "w"] [52.680131, "o", "n"] [52.690653, "o", "l"] [52.733071, "o", "o"] [52.77442, "o", "a"] [52.97502, "o", "d"] [52.999044, "o", "s"] [53.019388, "o", "\r\n"] [53.963521, "o", "0 B O 0 B C 0 B D 0 N root/Downloads \r"] [53.964284, "o", " \r"] [53.964921, "o", "Initializing cache transaction: Reading config \r"] [53.965567, "o", "Initializing cache transaction: Reading chunks \r"] [53.966217, "o", "Initializing cache transaction: Reading files \r"] [53.96692, "o", " \r"] [53.982311, "o", "Saving files cache \r"] [53.983834, "o", "Saving chunks cache \r"] [53.984584, "o", "Saving cache config \r"] [53.986341, "o", " \r"] [53.989445, "o", "------------------------------------------------------------------------------"] [53.989754, "o", "\r\r\n"] [53.990138, "o", "Repository: /media/backup/borgdemo"] [53.990438, "o", "\r\r\n"] [53.990824, "o", "Archive name: root-2022-07-06T21:31:28"] [53.991138, "o", "\r\r\n"] [53.991518, "o", "Archive fingerprint: d292c218f6c32423a9de2e3fbdf51c8ee865dc83ac78f62624216ebdae7ca55e"] [53.991813, "o", "\r\r\n"] [53.992184, "o", "Time (start): Wed, 2022-07-06 21:31:28"] [53.992478, "o", "\r\r\n"] [53.992851, "o", "Time (end): Wed, 2022-07-06 21:31:28"] [53.99314, "o", "\r\r\n"] [53.993512, "o", "Duration: 0.01 seconds"] [53.993812, "o", "\r\r\n"] [53.99419, "o", "Number of files: 0"] [53.994479, "o", "\r\r\n"] [53.994893, "o", "Utilization of max. archive size: 0%"] [53.995216, "o", "\r\r\n"] [53.99559, "o", "------------------------------------------------------------------------------"] [53.995881, "o", "\r\r\n"] [53.996319, "o", " Original size Compressed size Deduplicated size"] [53.99661, "o", "\r\r\n"] [53.996989, "o", "This archive: 576 B 549 B 549 B"] [53.997279, "o", "\r\r\n"] [53.99766, "o", "All archives: 1.60 GB 1.60 GB 399.57 MB"] [53.997951, "o", "\r\r\n"] [53.998329, "o", "\r\r\n"] [53.998748, "o", " Unique chunks Total chunks"] [53.999041, "o", "\r\r\n"] [53.999436, "o", "Chunk index: 184 713"] [53.999731, "o", "\r\r\n"] [54.000115, "o", "------------------------------------------------------------------------------"] [54.000409, "o", "\r\r\n"] [54.049234, "o", "$ \r\n"] [54.049753, "o", "$ #"] [54.068119, "o", " "] [54.07753, "o", "O"] [54.086991, "o", "r"] [54.18121, "o", " "] [54.24303, "o", "l"] [54.342987, "o", "e"] [54.371024, "o", "t"] [54.513575, "o", "'"] [54.569014, "o", "s"] [54.769663, "o", " "] [54.847339, "o", "b"] [54.872046, "o", "a"] [54.942801, "o", "c"] [54.962407, "o", "k"] [54.985108, "o", "u"] [55.129751, "o", "p"] [55.191004, "o", " "] [55.200452, "o", "a"] [55.401184, "o", " "] [55.485684, "o", "d"] [55.515004, "o", "e"] [55.533494, "o", "v"] [55.585263, "o", "i"] [55.608998, "o", "c"] [55.661538, "o", "e"] [55.684062, "o", " "] [55.706779, "o", "v"] [55.718956, "o", "i"] [55.741305, "o", "a"] [55.774956, "o", " "] [55.784238, "o", "S"] [55.81504, "o", "T"] [55.834466, "o", "D"] [55.843769, "o", "I"] [55.930083, "o", "N"] [56.09109, "o", "."] [56.25442, "o", "\r\n$ s"] [56.27403, "o", "u"] [56.32435, "o", "d"] [56.333722, "o", "o"] [56.535107, "o", " "] [56.611262, "o", "d"] [56.669831, "o", "d"] [56.695163, "o", " "] [56.822363, "o", "i"] [56.848108, "o", "f"] [56.876998, "o", "="] [56.886385, "o", "/"] [56.90777, "o", "d"] [56.922055, "o", "e"] [56.956174, "o", "v"] [57.06045, "o", "/"] [57.114878, "o", "l"] [57.166361, "o", "o"] [57.187001, "o", "o"] [57.237174, "o", "p"] [57.246641, "o", "0"] [57.256116, "o", " "] [57.329709, "o", "b"] [57.339104, "o", "s"] [57.353578, "o", "="] [57.551207, "o", "1"] [57.562974, "o", "0"] [57.584427, "o", "M"] [57.751007, "o", " "] [57.884754, "o", "|"] [57.894982, "o", " "] [57.978933, "o", "b"] [57.993342, "o", "o"] [58.02676, "o", "r"] [58.198989, "o", "g"] [58.399364, "o", " "] [58.414833, "o", "c"] [58.442568, "o", "r"] [58.454953, "o", "e"] [58.46519, "o", "a"] [58.55284, "o", "t"] [58.593169, "o", "e"] [58.624302, "o", " "] [58.765138, "o", "-"] [58.847729, "o", "-"] [58.886836, "o", "p"] [58.931277, "o", "r"] [58.944868, "o", "o"] [59.098028, "o", "g"] [59.1514, "o", "r"] [59.25589, "o", "e"] [59.423182, "o", "s"] [59.48791, "o", "s"] [59.591304, "o", " "] [59.666137, "o", "-"] [59.735141, "o", "-"] [59.764108, "o", "s"] [59.883644, "o", "t"] [59.984319, "o", "a"] [59.995915, "o", "t"] [60.087205, "o", "s"] [60.288136, "o", " "] [60.297505, "o", ":"] [60.398272, "o", ":"] [60.409597, "o", "s"] [60.478088, "o", "p"] [60.555086, "o", "e"] [60.587356, "o", "c"] [60.596772, "o", "i"] [60.650928, "o", "a"] [60.683017, "o", "l"] [60.75472, "o", "b"] [60.767219, "o", "a"] [60.80299, "o", "c"] [60.863321, "o", "k"] [60.942935, "o", "u"] [61.021254, "o", "p"] [61.030747, "o", " "] [61.040178, "o", "-"] [61.111171, "o", "\r\n"] [62.112352, "o", "Initializing cache transaction: Reading config \r"] [62.112873, "o", "Initializing cache transaction: Reading chunks \r"] [62.113327, "o", "Initializing cache transaction: Reading files \r"] [62.113941, "o", " \r"] [62.125566, "o", "8.39 MB O 32.95 kB C 32.95 kB D 0 N stdin \r"] [62.360058, "o", "67.11 MB O 263.60 kB C 32.95 kB D 0 N stdin \r"] [62.576735, "o", "125.83 MB O 494.25 kB C 32.95 kB D 0 N stdin \r"] [62.800828, "o", "184.55 MB O 724.90 kB C 32.95 kB D 0 N stdin \r"] [63.001059, "o", "234.88 MB O 922.60 kB C 32.95 kB D 0 N stdin \r"] [63.212902, "o", "285.21 MB O 1.12 MB C 32.95 kB D 0 N stdin \r"] [63.433125, "o", "335.54 MB O 1.32 MB C 32.95 kB D 0 N stdin \r"] [63.636129, "o", "385.88 MB O 1.52 MB C 32.95 kB D 0 N stdin \r"] [63.787663, "o", "40+0 records in\r\r\n40+0 records out\r\r\n419430400 bytes (419 MB, 400 MiB) copied, 2.66153 s, 158 MB/s\r\r\n"] [63.795318, "o", " \r"] [63.815459, "o", "Saving files cache \r"] [63.817002, "o", "Saving chunks cache \r"] [63.817775, "o", "Saving cache config \r"] [63.820066, "o", " \r"] [63.829239, "o", "------------------------------------------------------------------------------\r\r\nRepository: /media/backup/borgdemo\r\r\nArchive name: specialbackup\r\r\nArchive fingerprint: 05e096b07e9031a5d8527f2a4014717c22d9d9005554c6867b608d0f0f670561\r\r\nTime (start): Wed, 2022-07-06 21:31:36\r\r\nTime (end): Wed, 2022-07-06 21:31:38\r\r\n"] [63.829424, "o", "Duration: 1.74 seconds\r\r\n"] [63.830396, "o", "Number of files: 1\r\r\nUtilization of max. archive size: 0%\r\r\n------------------------------------------------------------------------------\r\r\n Original size Compressed size Deduplicated size\r\r\nThis archive: 419.43 MB 1.65 MB 33.47 kB\r\r\nAll archives: 2.02 GB 1.60 GB 399.61 MB\r\r\n\r\r\n Unique chunks Total chunks\r\r\n"] [63.830571, "o", "Chunk index: 187 765\r\r\n"] [63.831243, "o", "------------------------------------------------------------------------------\r\r\n"] [63.876336, "o", "$ \r\n"] [63.876652, "o", "$ #"] [63.910702, "o", " "] [63.92204, "o", "L"] [63.93149, "o", "e"] [63.947129, "o", "t"] [64.147375, "o", "'"] [64.181549, "o", "s"] [64.19927, "o", " "] [64.285772, "o", "c"] [64.317175, "o", "o"] [64.390987, "o", "n"] [64.430118, "o", "t"] [64.462988, "o", "i"] [64.489445, "o", "n"] [64.55958, "o", "u"] [64.759862, "o", "e"] [64.960077, "o", " "] [64.969536, "o", "w"] [65.097873, "o", "i"] [65.145536, "o", "t"] [65.175076, "o", "h"] [65.291736, "o", " "] [65.337115, "o", "s"] [65.397665, "o", "o"] [65.407179, "o", "m"] [65.435062, "o", "e"] [65.503335, "o", " "] [65.518915, "o", "s"] [65.530115, "o", "i"] [65.543504, "o", "m"] [65.606961, "o", "p"] [65.660102, "o", "l"] [65.693965, "o", "e"] [65.895054, "o", " "] [65.965676, "o", "t"] [66.034322, "o", "h"] [66.139148, "o", "i"] [66.148314, "o", "n"] [66.270932, "o", "g"] [66.302594, "o", "s"] [66.371076, "o", ":"] [66.400889, "o", "\r\n$ #"] [66.466516, "o", "#"] [66.562937, "o", " "] [66.601084, "o", "U"] [66.664675, "o", "S"] [66.747098, "o", "E"] [66.765397, "o", "F"] [66.817143, "o", "U"] [66.827826, "o", "L"] [66.903094, "o", " "] [66.912246, "o", "C"] [66.991072, "o", "O"] [67.004464, "o", "M"] [67.01897, "o", "M"] [67.167193, "o", "A"] [67.231511, "o", "N"] [67.246067, "o", "D"] [67.255524, "o", "S"] [67.391135, "o", " "] [67.545458, "o", "#"] [67.590966, "o", "#"] [67.604457, "o", "\r\n$ #"] [67.613944, "o", " "] [67.800648, "o", "Y"] [67.83914, "o", "o"] [67.848506, "o", "u"] [67.954889, "o", " "] [68.026487, "o", "c"] [68.050923, "o", "a"] [68.060401, "o", "n"] [68.136499, "o", " "] [68.145993, "o", "s"] [68.211723, "o", "h"] [68.302823, "o", "o"] [68.391106, "o", "w"] [68.427221, "o", " "] [68.436687, "o", "s"] [68.450242, "o", "o"] [68.487072, "o", "m"] [68.54245, "o", "e"] [68.584131, "o", " "] [68.593457, "o", "i"] [68.711179, "o", "n"] [68.734, "o", "f"] [68.93436, "o", "o"] [68.963047, "o", "r"] [68.987598, "o", "m"] [69.109977, "o", "a"] [69.11933, "o", "t"] [69.142931, "o", "i"] [69.176318, "o", "o"] [69.199092, "o", "n"] [69.399296, "o", " "] [69.44696, "o", "a"] [69.456119, "o", "b"] [69.47174, "o", "o"] [69.505723, "o", "u"] [69.542938, "o", "t"] [69.552441, "o", " "] [69.654686, "o", "a"] [69.680471, "o", "n"] [69.720608, "o", " "] [69.921506, "o", "a"] [69.93091, "o", "r"] [69.940379, "o", "c"] [69.983696, "o", "h"] [69.995146, "o", "i"] [70.00694, "o", "v"] [70.052253, "o", "e"] [70.173065, "o", "."] [70.209802, "o", " "] [70.344882, "o", "Y"] [70.38098, "o", "o"] [70.391455, "o", "u"] [70.400885, "o", " "] [70.436288, "o", "c"] [70.479658, "o", "a"] [70.511128, "o", "n"] [70.532543, "o", " "] [70.564681, "o", "e"] [70.605056, "o", "v"] [70.663093, "o", "e"] [70.710312, "o", "n"] [70.746508, "o", " "] [70.75596, "o", "d"] [70.789044, "o", "o"] [70.874953, "o", " "] [70.8951, "o", "i"] [70.904455, "o", "t"] [70.951104, "o", " "] [70.960345, "o", "w"] [70.990959, "o", "i"] [71.049385, "o", "t"] [71.178649, "o", "h"] [71.199039, "o", "o"] [71.247286, "o", "u"] [71.263928, "o", "t"] [71.341404, "o", " "] [71.400933, "o", "n"] [71.504487, "o", "e"] [71.513992, "o", "e"] [71.702213, "o", "d"] [71.745271, "o", "i"] [71.78307, "o", "n"] [71.792346, "o", "g"] [71.846181, "o", " "] [71.927444, "o", "t"] [71.963354, "o", "o"] [72.167077, "o", " "] [72.367322, "o", "s"] [72.567847, "o", "p"] [72.578326, "o", "e"] [72.608109, "o", "c"] [72.63193, "o", "i"] [72.666017, "o", "f"] [72.681392, "o", "y"] [72.880734, "o", " "] [72.891089, "o", "t"] [72.911506, "o", "h"] [72.964726, "o", "e"] [73.022153, "o", " "] [73.05761, "o", "a"] [73.067139, "o", "r"] [73.178498, "o", "c"] [73.191079, "o", "h"] [73.201342, "o", "i"] [73.237445, "o", "v"] [73.254932, "o", "e"] [73.324386, "o", " "] [73.51517, "o", "n"] [73.627725, "o", "a"] [73.663138, "o", "m"] [73.7273, "o", "e"] [73.790958, "o", ":"] [73.872668, "o", "\r\n"] [73.873096, "o", "$ b"] [73.926405, "o", "o"] [73.949729, "o", "r"] [73.958792, "o", "g"] [73.993115, "o", " "] [74.002344, "o", "i"] [74.011562, "o", "n"] [74.043878, "o", "f"] [74.088185, "o", "o"] [74.121451, "o", " "] [74.310737, "o", ":"] [74.359159, "o", ":"] [74.368338, "o", " "] [74.453642, "o", "-"] [74.615093, "o", "-"] [74.698272, "o", "l"] [74.707464, "o", "a"] [74.720773, "o", "s"] [74.776057, "o", "t"] [74.976332, "o", " "] [74.987519, "o", "1"] [75.085858, "o", "\r\n"] [76.043124, "o", "Archive name: specialbackup\r\r\n"] [76.043213, "o", "Archive fingerprint: 05e096b07e9031a5d8527f2a4014717c22d9d9005554c6867b608d0f0f670561\r\r\n"] [76.043561, "o", "Comment: \r\r\nHostname: bullseye\r\r\n"] [76.043782, "o", "Username: root"] [76.043834, "o", "\r\r\n"] [76.04424, "o", "Time (start): Wed, 2022-07-06 21:31:36\r\r\n"] [76.044293, "o", "Time (end): Wed, 2022-07-06 21:31:38\r\r\n"] [76.044483, "o", "Duration: 1.74 seconds"] [76.044742, "o", "\r\r\n"] [76.044782, "o", "Number of files: 1"] [76.04487, "o", "\r\r\n"] [76.045065, "o", "Command line: borg create --progress --stats ::specialbackup -"] [76.045356, "o", "\r\r\n"] [76.045395, "o", "Utilization of maximum supported archive size: 0%"] [76.045614, "o", "\r\r\n"] [76.045653, "o", "------------------------------------------------------------------------------"] [76.045739, "o", "\r\r\n"] [76.046056, "o", " Original size Compressed size Deduplicated size"] [76.046095, "o", "\r\r\n"] [76.046303, "o", "This archive: 419.43 MB 1.65 MB 33.67 kB"] [76.046342, "o", "\r\r\n"] [76.046558, "o", "All archives: 2.02 GB 1.60 GB 399.61 MB"] [76.046597, "o", "\r\r\n"] [76.046854, "o", "\r\r\n"] [76.046895, "o", " Unique chunks Total chunks"] [76.047217, "o", "\r\r\n"] [76.047276, "o", "Chunk index: 187 765"] [76.047573, "o", "\r\r\n"] [76.101724, "o", "$ \r\n"] [76.10207, "o", "$ #"] [76.110849, "o", " "] [76.25529, "o", "S"] [76.27759, "o", "o"] [76.379077, "o", " "] [76.40714, "o", "l"] [76.452484, "o", "e"] [76.46365, "o", "t"] [76.501988, "o", "'"] [76.516262, "o", "s"] [76.604546, "o", " "] [76.618853, "o", "r"] [76.637128, "o", "e"] [76.702425, "o", "n"] [76.71163, "o", "a"] [76.789956, "o", "m"] [76.799176, "o", "e"] [76.859403, "o", " "] [76.932679, "o", "o"] [76.965959, "o", "u"] [76.989297, "o", "r"] [77.033601, "o", " "] [77.063032, "o", "l"] [77.073168, "o", "a"] [77.09649, "o", "s"] [77.12679, "o", "t"] [77.224094, "o", " "] [77.233311, "o", "a"] [77.287591, "o", "r"] [77.3018, "o", "c"] [77.311098, "o", "h"] [77.320311, "o", "i"] [77.343514, "o", "v"] [77.411844, "o", "e"] [77.442132, "o", ":"] [77.518449, "o", "\r\n"] [77.518821, "o", "$ b"] [77.568049, "o", "o"] [77.640406, "o", "r"] [77.655604, "o", "g"] [77.76192, "o", " "] [77.771152, "o", "r"] [77.80733, "o", "e"] [77.977601, "o", "n"] [78.025855, "o", "a"] [78.082105, "o", "m"] [78.153352, "o", "e"] [78.278704, "o", " "] [78.393852, "o", ":"] [78.411165, "o", ":"] [78.422273, "o", "s"] [78.437519, "o", "p"] [78.464756, "o", "e"] [78.491126, "o", "c"] [78.50326, "o", "i"] [78.58451, "o", "a"] [78.685851, "o", "l"] [78.779088, "o", "b"] [78.829332, "o", "a"] [78.867606, "o", "c"] [78.876858, "o", "k"] [78.905176, "o", "u"] [78.933486, "o", "p"] [78.960769, "o", " "] [78.971173, "o", "b"] [79.002474, "o", "a"] [79.081807, "o", "c"] [79.091086, "o", "k"] [79.190364, "o", "u"] [79.231594, "o", "p"] [79.282855, "o", "-"] [79.319118, "o", "b"] [79.376382, "o", "l"] [79.434706, "o", "o"] [79.448864, "o", "c"] [79.467102, "o", "k"] [79.512354, "o", "-"] [79.58843, "o", "d"] [79.667638, "o", "e"] [79.682887, "o", "v"] [79.778153, "o", "i"] [79.850387, "o", "c"] [79.888649, "o", "e"] [79.92093, "o", "\r\n"] [80.929653, "o", "$ \r\n"] [80.930152, "o", "$ b"] [81.026102, "o", "o"] [81.110369, "o", "r"] [81.134711, "o", "g"] [81.201937, "o", " "] [81.21108, "o", "i"] [81.225431, "o", "n"] [81.35772, "o", "f"] [81.377012, "o", "o"] [81.407296, "o", " "] [81.513619, "o", ":"] [81.591079, "o", ":"] [81.600193, "o", " "] [81.60944, "o", "-"] [81.661749, "o", "-"] [81.686048, "o", "l"] [81.71232, "o", "a"] [81.852605, "o", "s"] [81.874732, "o", "t"] [82.0751, "o", " "] [82.085265, "o", "1"] [82.101556, "o", "\r\n"] [83.06916, "o", "Archive name: backup-block-device\r\r\nArchive fingerprint: c416cbf604ab7dce6512f4d48cb9ea3fc56e311d9c794e2ec0814703a7561551\r\r\nComment: \r\r\nHostname: bullseye\r\r\nUsername: root\r\r\nTime (start): Wed, 2022-07-06 21:31:36\r\r\nTime (end): Wed, 2022-07-06 21:31:38\r\r\nDuration: 1.74 seconds\r\r\nNumber of files: 1\r\r\nCommand line: borg create --progress --stats ::specialbackup -\r\r\nUtilization of maximum supported archive size: 0%\r\r\n------------------------------------------------------------------------------\r\r\n Original size Compressed size Deduplicated size\r\r\nThis archive: 419.43 MB 1.65 MB 33.69 kB\r\r\nAll archives: 2.02 GB 1.60 GB 399.61 MB\r\r\n\r\r\n Unique chunks Total chunks\r\r\nChunk index: 187 765"] [83.069711, "o", "\r\r\n"] [83.116244, "o", "$ "] [83.116346, "o", "\r\n"] [83.117641, "o", "$ #"] [83.180969, "o", " "] [83.197222, "o", "A"] [83.373416, "o", " "] [83.387658, "o", "v"] [83.431926, "o", "e"] [83.537164, "o", "r"] [83.548425, "o", "y"] [83.561647, "o", " "] [83.627053, "o", "i"] [83.63615, "o", "m"] [83.671335, "o", "p"] [83.871559, "o", "o"] [83.880773, "o", "r"] [83.918114, "o", "t"] [83.976375, "o", "a"] [83.989643, "o", "n"] [84.067881, "o", "t"] [84.152154, "o", " "] [84.161334, "o", "s"] [84.255576, "o", "t"] [84.299837, "o", "e"] [84.329092, "o", "p"] [84.356372, "o", " "] [84.429601, "o", "i"] [84.438781, "o", "f"] [84.44806, "o", " "] [84.499307, "o", "y"] [84.508554, "o", "o"] [84.5178, "o", "u"] [84.623066, "o", " "] [84.632231, "o", "c"] [84.69749, "o", "h"] [84.757754, "o", "o"] [84.81601, "o", "o"] [84.885254, "o", "s"] [84.901535, "o", "e"] [84.984793, "o", " "] [85.13606, "o", "k"] [85.162302, "o", "e"] [85.171486, "o", "y"] [85.345714, "o", "f"] [85.40499, "o", "i"] [85.414189, "o", "l"] [85.518496, "o", "e"] [85.543521, "o", " "] [85.612764, "o", "m"] [85.621973, "o", "o"] [85.698247, "o", "d"] [85.717486, "o", "e"] [85.917778, "o", " "] [85.96802, "o", "("] [86.024313, "o", "w"] [86.033549, "o", "h"] [86.084714, "o", "e"] [86.097024, "o", "r"] [86.106266, "o", "e"] [86.235495, "o", " "] [86.284754, "o", "t"] [86.293941, "o", "h"] [86.328215, "o", "e"] [86.337408, "o", " "] [86.346629, "o", "k"] [86.355891, "o", "e"] [86.425154, "o", "y"] [86.456417, "o", "f"] [86.525668, "o", "i"] [86.534847, "o", "l"] [86.617122, "o", "e"] [86.738378, "o", " "] [86.750643, "o", "i"] [86.85383, "o", "s"] [86.912086, "o", " "] [86.969355, "o", "o"] [87.106606, "o", "n"] [87.115827, "o", "l"] [87.172088, "o", "y"] [87.232346, "o", " "] [87.242557, "o", "s"] [87.272829, "o", "a"] [87.312082, "o", "v"] [87.412313, "o", "e"] [87.511544, "o", "d"] [87.711795, "o", " "] [87.781041, "o", "l"] [87.816298, "o", "o"] [87.828552, "o", "c"] [87.904814, "o", "a"] [88.105062, "o", "l"] [88.152317, "o", "l"] [88.287535, "o", "y"] [88.356789, "o", ")"] [88.412023, "o", " "] [88.555231, "o", "i"] [88.570459, "o", "s"] [88.624724, "o", " "] [88.634834, "o", "t"] [88.644101, "o", "o"] [88.669362, "o", " "] [88.869623, "o", "e"] [88.933856, "o", "x"] [88.963068, "o", "p"] [89.062317, "o", "o"] [89.199564, "o", "r"] [89.31488, "o", "t"] [89.399071, "o", " "] [89.408282, "o", "y"] [89.451519, "o", "o"] [89.460707, "o", "u"] [89.660976, "o", "r"] [89.670172, "o", " "] [89.691403, "o", "k"] [89.740641, "o", "e"] [89.795877, "o", "y"] [89.816131, "o", "f"] [89.83932, "o", "i"] [89.848581, "o", "l"] [89.867845, "o", "e"] [90.068096, "o", " "] [90.077304, "o", "a"] [90.219558, "o", "n"] [90.317806, "o", "d"] [90.376045, "o", " "] [90.423241, "o", "p"] [90.465504, "o", "o"] [90.527757, "o", "s"] [90.536949, "o", "s"] [90.607156, "o", "i"] [90.642411, "o", "b"] [90.651607, "o", "l"] [90.68693, "o", "y"] [90.88709, "o", " "] [90.919294, "o", "p"] [90.942543, "o", "r"] [91.078836, "o", "i"] [91.102079, "o", "n"] [91.246364, "o", "t"] [91.446583, "o", " "] [91.511009, "o", "i"] [91.578199, "o", "t"] [91.704476, "o", ","] [91.741724, "o", " "] [91.750942, "o", "e"] [91.771117, "o", "t"] [91.782313, "o", "c"] [91.803545, "o", "."] [91.865929, "o", "\r\n"] [91.866312, "o", "$ b"] [91.902524, "o", "o"] [91.929281, "o", "r"] [91.938795, "o", "g"] [92.001495, "o", " "] [92.019245, "o", "k"] [92.055794, "o", "e"] [92.148098, "o", "y"] [92.243444, "o", " "] [92.252817, "o", "e"] [92.304265, "o", "x"] [92.313724, "o", "p"] [92.330183, "o", "o"] [92.385758, "o", "r"] [92.438182, "o", "t"] [92.470969, "o", " "] [92.595227, "o", "-"] [92.674856, "o", "-"] [92.687324, "o", "q"] [92.707309, "o", "r"] [92.778481, "o", "-"] [92.920862, "o", "h"] [92.999202, "o", "t"] [93.008599, "o", "m"] [93.062016, "o", "l"] [93.071322, "o", " "] [93.080847, "o", ":"] [93.154772, "o", ":"] [93.171063, "o", " "] [93.180511, "o", "f"] [93.19507, "o", "i"] [93.223267, "o", "l"] [93.267445, "o", "e"] [93.377017, "o", "."] [93.395205, "o", "h"] [93.404616, "o", "t"] [93.466142, "o", "m"] [93.507241, "o", "l"] [93.614841, "o", " "] [93.634433, "o", " "] [93.676532, "o", "#"] [93.695231, "o", " "] [93.708813, "o", "t"] [93.756113, "o", "h"] [93.930579, "o", "i"] [93.982926, "o", "s"] [94.183278, "o", " "] [94.290766, "o", "c"] [94.303095, "o", "r"] [94.407434, "o", "e"] [94.549651, "o", "a"] [94.615164, "o", "t"] [94.700689, "o", "e"] [94.735132, "o", "s"] [94.874051, "o", " "] [94.888609, "o", "a"] [94.975046, "o", " "] [95.023542, "o", "n"] [95.032912, "o", "i"] [95.131124, "o", "c"] [95.189662, "o", "e"] [95.220861, "o", " "] [95.230334, "o", "H"] [95.239715, "o", "T"] [95.303126, "o", "M"] [95.31252, "o", "L"] [95.508921, "o", ","] [95.535693, "o", " "] [95.588304, "o", "b"] [95.624524, "o", "u"] [95.660455, "o", "t"] [95.863076, "o", " "] [95.951101, "o", "w"] [96.019068, "o", "h"] [96.064404, "o", "e"] [96.104629, "o", "n"] [96.122201, "o", " "] [96.159079, "o", "y"] [96.170341, "o", "o"] [96.194989, "o", "u"] [96.242074, "o", " "] [96.251522, "o", "w"] [96.359109, "o", "a"] [96.518803, "o", "n"] [96.57115, "o", "t"] [96.622541, "o", " "] [96.806376, "o", "s"] [96.818953, "o", "o"] [96.897732, "o", "m"] [96.971108, "o", "e"] [97.067593, "o", "t"] [97.103142, "o", "h"] [97.183278, "o", "i"] [97.239756, "o", "n"] [97.259141, "o", "g"] [97.329703, "o", " "] [97.403076, "o", "s"] [97.412422, "o", "i"] [97.53864, "o", "m"] [97.549121, "o", "p"] [97.604583, "o", "l"] [97.635096, "o", "e"] [97.64439, "o", "r"] [97.675134, "o", "…"] [97.814542, "o", "\r\n"] [98.722178, "o", "$ b"] [98.807795, "o", "o"] [98.910336, "o", "r"] [98.919913, "o", "g"] [98.929377, "o", " "] [98.938952, "o", "k"] [98.965665, "o", "e"] [99.11715, "o", "y"] [99.317399, "o", " "] [99.326787, "o", "e"] [99.350517, "o", "x"] [99.359844, "o", "p"] [99.4675, "o", "o"] [99.489996, "o", "r"] [99.589275, "o", "t"] [99.691859, "o", " "] [99.704219, "o", "-"] [99.713707, "o", "-"] [99.743603, "o", "p"] [99.798054, "o", "a"] [99.823767, "o", "p"] [99.885944, "o", "e"] [99.897636, "o", "r"] [99.9767, "o", " "] [100.027386, "o", ":"] [100.052192, "o", ":"] [100.067352, "o", " "] [100.156712, "o", " "] [100.19786, "o", "#"] [100.212631, "o", " "] [100.287297, "o", "t"] [100.29679, "o", "h"] [100.306215, "o", "i"] [100.359208, "o", "s"] [100.374671, "o", " "] [100.474986, "o", "i"] [100.503798, "o", "s"] [100.541912, "o", " "] [100.626098, "o", "a"] [100.666332, "o", " "] [100.697183, "o", "\""] [100.711032, "o", "m"] [100.737775, "o", "a"] [100.758421, "o", "n"] [100.797571, "o", "u"] [100.806956, "o", "a"] [100.87637, "o", "l"] [100.955112, "o", " "] [100.964372, "o", "i"] [100.975112, "o", "n"] [100.986557, "o", "p"] [101.026035, "o", "u"] [101.08241, "o", "t"] [101.103095, "o", "\""] [101.20461, "o", "-"] [101.223075, "o", "o"] [101.264982, "o", "n"] [101.362331, "o", "l"] [101.485717, "o", "y"] [101.686062, "o", " "] [101.695543, "o", "b"] [101.726369, "o", "a"] [101.926959, "o", "c"] [101.936329, "o", "k"] [101.947079, "o", "u"] [101.956316, "o", "p"] [102.123084, "o", " "] [102.163099, "o", "("] [102.176215, "o", "b"] [102.22553, "o", "u"] [102.279082, "o", "t"] [102.396342, "o", " "] [102.483081, "o", "i"] [102.567065, "o", "t"] [102.728838, "o", " "] [102.738243, "o", "i"] [102.786531, "o", "s"] [102.867342, "o", " "] [102.923016, "o", "a"] [102.998953, "o", "l"] [103.035273, "o", "s"] [103.087168, "o", "o"] [103.096547, "o", " "] [103.262476, "o", "i"] [103.347847, "o", "n"] [103.415063, "o", "c"] [103.427066, "o", "l"] [103.439044, "o", "u"] [103.482403, "o", "d"] [103.645195, "o", "e"] [103.655053, "o", "d"] [103.771462, "o", " "] [103.799107, "o", "i"] [103.879238, "o", "n"] [103.979692, "o", " "] [103.996193, "o", "t"] [104.057759, "o", "h"] [104.087079, "o", "e"] [104.175264, "o", " "] [104.315076, "o", "-"] [104.405243, "o", "-"] [104.605975, "o", "q"] [104.631634, "o", "r"] [104.735842, "o", "-"] [104.778042, "o", "c"] [104.788574, "o", "o"] [104.827883, "o", "d"] [104.838226, "o", "e"] [104.911691, "o", " "] [104.92405, "o", "o"] [104.988546, "o", "p"] [105.070922, "o", "t"] [105.121393, "o", "i"] [105.204919, "o", "o"] [105.243122, "o", "n"] [105.267738, "o", ")"] [105.286747, "o", "\r\n"] [106.149824, "o", "To restore key use borg key import --paper /path/to/repo\r\r\n\r\r\nBORG PAPER KEY v1\r\r\nid: 20 / 543b72 bac0b1 5cfa3d / 816b0a 201520 - 52\r\r\n 1: 86a961 6c676f 726974 686da6 736861 323536 - 14\r\r\n 2: a46461 7461da 00de7c 327081 c876c2 86754c - bc\r\r\n 3: dbfb68 784ce2 8047f6 1f7067 063d08 ecbe39 - 60\r\r\n 4: abd2be 2f5165 6a1641 ddbb49 32fc4a c7e391 - 30\r\r\n 5: d90522 c569ed 80d96c 1ae06f 3e50a0 3dbef6 - 0e\r\r\n 6: 499ee6 cacd65 727cc5 cb3ba2 5f7f79 5b852a - 07\r\r\n 7: 7e2b22 2ed3b8 41e1b7 0b7db2 24b1d7 1ba0bb - 80\r\r\n 8: 2967ab 7776fd 5c23c8 5366e9 256824 3d8df1 - d5\r\r\n 9: b2d3d5 c60f1b 5a68b0 7294e9 87fa86 18a987 - b0\r\r\n10: 944388 909b57 df48ce 8a8600 527a8f 637584 - c9\r\r\n11: 170511 8963a1 554fce f2ba95 5a758b 429719 - ee\r\r\n12: 88bee4 9720ba f725de dcdec0 894143 8a7ebc - 29\r\r\n13: a0d2e5 eb0ce8 956541 8cef38 c7194e b8b5fe - e6\r\r\n"] [106.149893, "o", "14: 2b9282 a8c540 ae69e9 0bca48 9b52a4 686173 - ba\r\r\n15: 68da00 207ba4 f1d621 e8edc4 57978b 04fe04 - af\r\r\n16: 45af0a eefb96 051947 106f38 b44520 1002cc - dd\r\r\n17: aa6974 657261 74696f 6e73ce 000186 a0a473 - 15\r\r\n18: 616c74 da0020 738815 8e60fb 2b5cc4 662110 - dd\r\r\n19: 9cdaff 4c7f78 b95f81 57009d ac0c27 f2e160 - 69\r\r\n"] [106.150871, "o", "20: facfa7 766572 73696f 6e01 - 49\r\r\n"] [106.200923, "o", "$ \r\n"] [106.201933, "o", "$ #"] [106.311069, "o", "#"] [106.350876, "o", " "] [106.360114, "o", "M"] [106.381845, "o", "A"] [106.448659, "o", "I"] [106.631657, "o", "N"] [106.819891, "o", "T"] [106.829408, "o", "E"] [106.886858, "o", "N"] [106.897164, "o", "A"] [106.921071, "o", "N"] [106.947049, "o", "C"] [106.959083, "o", "E"] [107.007196, "o", " "] [107.083581, "o", "#"] [107.112356, "o", "#"] [107.250885, "o", "\r\n"] [107.251287, "o", "$ #"] [107.451883, "o", " "] [107.461255, "o", "S"] [107.470909, "o", "o"] [107.657323, "o", "m"] [107.753465, "o", "e"] [107.801524, "o", "t"] [107.848903, "o", "i"] [107.879027, "o", "m"] [107.88862, "o", "e"] [107.977214, "o", "s"] [108.110259, "o", " "] [108.179155, "o", "b"] [108.351926, "o", "a"] [108.400699, "o", "c"] [108.410203, "o", "k"] [108.419646, "o", "u"] [108.486479, "o", "p"] [108.567209, "o", "s"] [108.767773, "o", " "] [108.803208, "o", "g"] [108.846873, "o", "e"] [108.867075, "o", "t"] [108.977561, "o", " "] [109.136181, "o", "b"] [109.200763, "o", "r"] [109.259374, "o", "o"] [109.278942, "o", "k"] [109.3141, "o", "e"] [109.43095, "o", "n"] [109.46321, "o", " "] [109.47754, "o", "o"] [109.588012, "o", "r"] [109.605532, "o", " "] [109.61509, "o", "w"] [109.715362, "o", "e"] [109.724883, "o", " "] [109.782594, "o", "w"] [109.797213, "o", "a"] [109.808586, "o", "n"] [109.900685, "o", "t"] [109.911137, "o", " "] [110.056022, "o", "a"] [110.099232, "o", " "] [110.182919, "o", "r"] [110.203243, "o", "e"] [110.230058, "o", "g"] [110.385779, "o", "u"] [110.39538, "o", "l"] [110.406829, "o", "a"] [110.454471, "o", "r"] [110.539017, "o", " "] [110.61907, "o", "\""] [110.765729, "o", "c"] [110.96699, "o", "h"] [111.035241, "o", "e"] [111.090908, "o", "c"] [111.121846, "o", "k"] [111.214881, "o", "u"] [111.224693, "o", "p"] [111.268192, "o", "\""] [111.372347, "o", " "] [111.387051, "o", "t"] [111.396725, "o", "h"] [111.406456, "o", "a"] [111.422276, "o", "t"] [111.526997, "o", " "] [111.6099, "o", "e"] [111.755036, "o", "v"] [111.867197, "o", "e"] [111.87702, "o", "r"] [111.919062, "o", "y"] [111.986004, "o", "t"] [112.051883, "o", "h"] [112.171044, "o", "i"] [112.21494, "o", "n"] [112.227013, "o", "g"] [112.265067, "o", " "] [112.28199, "o", "i"] [112.400713, "o", "s"] [112.435962, "o", " "] [112.544903, "o", "o"] [112.557869, "o", "k"] [112.652822, "o", "a"] [112.742943, "o", "y"] [112.943874, "o", "…"] [112.989623, "o", "\r\n"] [112.990358, "o", "$ "] [112.990917, "o", "b"] [113.020704, "o", "o"] [113.0326, "o", "r"] [113.062861, "o", "g"] [113.146392, "o", " "] [113.158985, "o", "c"] [113.187026, "o", "h"] [113.230546, "o", "e"] [113.240481, "o", "c"] [113.270414, "o", "k"] [113.298937, "o", " "] [113.42575, "o", "-"] [113.43564, "o", "v"] [113.448634, "o", " "] [113.51099, "o", ":"] [113.572617, "o", ":"] [113.623082, "o", "\r\n"] [114.468125, "o", "Starting repository check\r\r\n"] [114.970867, "o", "finished segment check at segment 29\r\r\n"] [114.973282, "o", "Starting repository index check\r\r\n"] [114.973326, "o", "Index object count match.\r\r\n"] [114.974106, "o", "Finished full repository check, no problems found.\r\r\n"] [114.974507, "o", "Starting archive consistency check...\r\r\n"] [115.054678, "o", "Analyzing archive backup1 (1/6)\r\r\n"] [115.060833, "o", "Analyzing archive backup2 (2/6)\r\r\n"] [115.063603, "o", "Analyzing archive backup3 (3/6)\r\r\n"] [115.066201, "o", "Analyzing archive root-2022-07-06T21:31:12 (4/6)\r\r\n"] [115.068866, "o", "Analyzing archive root-2022-07-06T21:31:28 (5/6)\r\r\n"] [115.069725, "o", "Analyzing archive backup-block-device (6/6)\r\r\n"] [115.070801, "o", "Archive consistency check complete, no problems found.\r\r\n"] [115.13231, "o", "$ \r\n"] [115.132383, "o", "$ #"] [115.141656, "o", " "] [115.157976, "o", "N"] [115.18922, "o", "e"] [115.20151, "o", "x"] [115.354755, "o", "t"] [115.495108, "o", " "] [115.504182, "o", "p"] [115.514429, "o", "r"] [115.560709, "o", "o"] [115.700955, "o", "b"] [115.710156, "o", "l"] [115.889298, "o", "e"] [115.900524, "o", "m"] [115.948777, "o", ":"] [116.100016, "o", " "] [116.127186, "o", "U"] [116.273465, "o", "s"] [116.28276, "o", "u"] [116.372945, "o", "a"] [116.390155, "o", "l"] [116.399296, "o", "l"] [116.408552, "o", "y"] [116.481705, "o", " "] [116.571974, "o", "y"] [116.583156, "o", "o"] [116.609289, "o", "u"] [116.687464, "o", " "] [116.744699, "o", "d"] [116.753796, "o", "o"] [116.894075, "o", " "] [116.903189, "o", "n"] [117.10336, "o", "o"] [117.11259, "o", "t"] [117.185751, "o", " "] [117.197017, "o", "h"] [117.397254, "o", "a"] [117.406473, "o", "v"] [117.415684, "o", "e"] [117.61584, "o", " "] [117.643157, "o", "i"] [117.652315, "o", "n"] [117.757616, "o", "f"] [117.781874, "o", "i"] [117.791149, "o", "n"] [117.80637, "o", "i"] [117.827596, "o", "t"] [117.854946, "o", "e"] [118.055148, "o", " "] [118.064193, "o", "d"] [118.073447, "o", "i"] [118.088702, "o", "s"] [118.105948, "o", "k"] [118.115157, "o", " "] [118.155353, "o", "s"] [118.272461, "o", "p"] [118.288573, "o", "a"] [118.461837, "o", "c"] [118.474126, "o", "e"] [118.67441, "o", "."] [118.748669, "o", " "] [118.93194, "o", "S"] [119.010054, "o", "o"] [119.085321, "o", " "] [119.094526, "o", "y"] [119.112808, "o", "o"] [119.148083, "o", "u"] [119.291238, "o", " "] [119.300456, "o", "m"] [119.344754, "o", "a"] [119.405028, "o", "y"] [119.48428, "o", " "] [119.508528, "o", "n"] [119.551619, "o", "e"] [119.613877, "o", "e"] [119.638147, "o", "d"] [119.731323, "o", " "] [119.818835, "o", "t"] [119.86185, "o", "o"] [119.947949, "o", " "] [120.135432, "o", "p"] [120.182617, "o", "r"] [120.230827, "o", "u"] [120.240039, "o", "n"] [120.27029, "o", "e"] [120.289402, "o", " "] [120.436641, "o", "y"] [120.471903, "o", "o"] [120.595072, "o", "u"] [120.604288, "o", "r"] [120.631553, "o", " "] [120.66179, "o", "a"] [120.782954, "o", "r"] [120.792152, "o", "c"] [120.992294, "o", "h"] [121.117555, "o", "i"] [121.126807, "o", "v"] [121.161076, "o", "e"] [121.220316, "o", "…"] [121.23366, "o", "\r\n$ #"] [121.242855, "o", " "] [121.321154, "o", "Y"] [121.352419, "o", "o"] [121.386668, "o", "u"] [121.456777, "o", " "] [121.506033, "o", "c"] [121.515201, "o", "a"] [121.535296, "o", "n"] [121.55855, "o", " "] [121.588801, "o", "t"] [121.597994, "o", "u"] [121.642252, "o", "n"] [121.651435, "o", "e"] [121.66472, "o", " "] [121.673911, "o", "t"] [121.683098, "o", "h"] [121.692328, "o", "i"] [121.733587, "o", "s"] [121.933824, "o", " "] [121.94297, "o", "i"] [122.023164, "o", "n"] [122.073434, "o", " "] [122.197695, "o", "e"] [122.242944, "o", "v"] [122.267127, "o", "e"] [122.313365, "o", "r"] [122.375621, "o", "y"] [122.480878, "o", " "] [122.49007, "o", "d"] [122.555315, "o", "e"] [122.590572, "o", "t"] [122.601763, "o", "a"] [122.618969, "o", "i"] [122.818095, "o", "l"] [122.938459, "o", "."] [123.01755, "o", " "] [123.064808, "o", "S"] [123.106838, "o", "e"] [123.221128, "o", "e"] [123.310401, "o", " "] [123.319655, "o", "t"] [123.508935, "o", "h"] [123.519109, "o", "e"] [123.71934, "o", " "] [123.728563, "o", "d"] [123.741784, "o", "o"] [123.850044, "o", "c"] [123.989291, "o", "s"] [124.071531, "o", " "] [124.156791, "o", "f"] [124.301032, "o", "o"] [124.31025, "o", "r"] [124.510545, "o", " "] [124.608805, "o", "d"] [124.674988, "o", "e"] [124.684186, "o", "t"] [124.715408, "o", "a"] [124.727663, "o", "i"] [124.805915, "o", "l"] [124.842176, "o", "s"] [125.042443, "o", "."] [125.059688, "o", " "] [125.093771, "o", "H"] [125.102879, "o", "e"] [125.112002, "o", "r"] [125.2784, "o", "e"] [125.440604, "o", " "] [125.468854, "o", "o"] [125.507037, "o", "n"] [125.538304, "o", "l"] [125.547524, "o", "y"] [125.587786, "o", " "] [125.599977, "o", "a"] [125.622256, "o", " "] [125.63238, "o", "s"] [125.641635, "o", "i"] [125.652865, "o", "m"] [125.662088, "o", "p"] [125.671289, "o", "l"] [125.709579, "o", "e"] [125.820831, "o", " "] [125.888074, "o", "e"] [125.943287, "o", "x"] [125.996545, "o", "a"] [126.019798, "o", "m"] [126.028994, "o", "p"] [126.108255, "o", "l"] [126.154535, "o", "e"] [126.203713, "o", ":"] [126.247947, "o", "\r\n"] [126.248396, "o", "$ b"] [126.257524, "o", "o"] [126.310761, "o", "r"] [126.33483, "o", "g"] [126.346943, "o", " "] [126.40812, "o", "p"] [126.417361, "o", "r"] [126.475452, "o", "u"] [126.484575, "o", "n"] [126.538756, "o", "e"] [126.738889, "o", " "] [126.869013, "o", "-"] [127.069159, "o", "-"] [127.192274, "o", "l"] [127.201392, "o", "i"] [127.211523, "o", "s"] [127.220653, "o", "t"] [127.231777, "o", " "] [127.240901, "o", "-"] [127.320174, "o", "-"] [127.346272, "o", "k"] [127.407534, "o", "e"] [127.445718, "o", "e"] [127.454727, "o", "p"] [127.499843, "o", "-"] [127.554949, "o", "l"] [127.569072, "o", "a"] [127.699194, "o", "s"] [127.715297, "o", "t"] [127.769524, "o", " "] [127.80476, "o", "1"] [127.827003, "o", " "] [127.844259, "o", "-"] [127.981519, "o", "-"] [128.022874, "o", "d"] [128.033089, "o", "r"] [128.084347, "o", "y"] [128.201627, "o", "-"] [128.30488, "o", "r"] [128.344133, "o", "u"] [128.35339, "o", "n"] [128.437824, "o", "\r\n"] [129.45361, "o", "Keeping archive (rule: secondly #1): backup-block-device Wed, 2022-07-06 21:31:36 [c416cbf604ab7dce6512f4d48cb9ea3fc56e311d9c794e2ec0814703a7561551]"] [129.454727, "o", "\r\r\n"] [129.455338, "o", "Would prune: root-2022-07-06T21:31:28 Wed, 2022-07-06 21:31:28 [d292c218f6c32423a9de2e3fbdf51c8ee865dc83ac78f62624216ebdae7ca55e]"] [129.455722, "o", "\r\r\n"] [129.456283, "o", "Would prune: root-2022-07-06T21:31:12 Wed, 2022-07-06 21:31:12 [280fe9e3d92e2e61f04f0ef98de32b4d0a797ec9e3b0b29ddb2b0946c4a0236b]"] [129.456658, "o", "\r\r\n"] [129.457213, "o", "Would prune: backup3 Wed, 2022-07-06 21:30:32 [b715e25edecebd717c06cca04bcc1dc73a73fd87a9b126d1f190a15a068c0f69]"] [129.457618, "o", "\r\r\n"] [129.458159, "o", "Would prune: backup2 Wed, 2022-07-06 21:30:31 [cbd3400dcea913c0611a75681c2e2ee192d7b9f915f6d9e8e77cbabde976c239]"] [129.458583, "o", "\r\r\n"] [129.459193, "o", "Would prune: backup1 Wed, 2022-07-06 21:30:25 [a1f88905bc1f341893c92a4757ab3975b4dcd36ca6669dabc76c5ea073a9095b]"] [129.459581, "o", "\r\r\n"] [129.51897, "o", "$ #"] [129.625084, "o", " "] [129.65835, "o", "W"] [129.681607, "o", "h"] [129.772895, "o", "e"] [129.806128, "o", "n"] [129.834381, "o", " "] [129.938653, "o", "a"] [129.947855, "o", "c"] [130.001121, "o", "t"] [130.022385, "o", "u"] [130.043634, "o", "a"] [130.110916, "o", "l"] [130.174201, "o", "l"] [130.183388, "o", "y"] [130.328666, "o", " "] [130.379911, "o", "e"] [130.398181, "o", "x"] [130.555408, "o", "e"] [130.684651, "o", "c"] [130.717891, "o", "u"] [130.732147, "o", "t"] [130.831375, "o", "i"] [130.917655, "o", "n"] [130.946912, "o", "g"] [130.978155, "o", " "] [130.994409, "o", "i"] [131.003618, "o", "t"] [131.174879, "o", " "] [131.184112, "o", "i"] [131.236365, "o", "n"] [131.270612, "o", " "] [131.27982, "o", "a"] [131.294113, "o", " "] [131.322373, "o", "s"] [131.376617, "o", "c"] [131.40187, "o", "r"] [131.458129, "o", "i"] [131.476372, "o", "p"] [131.505657, "o", "t"] [131.545909, "o", ","] [131.600166, "o", " "] [131.642413, "o", "y"] [131.651619, "o", "o"] [131.675712, "o", "u"] [131.767878, "o", " "] [131.814969, "o", "h"] [131.894152, "o", "a"] [131.951416, "o", "v"] [131.993679, "o", "e"] [132.060965, "o", " "] [132.070207, "o", "t"] [132.115432, "o", "o"] [132.128652, "o", " "] [132.199925, "o", "u"] [132.281178, "o", "s"] [132.306425, "o", "e"] [132.473677, "o", " "] [132.526977, "o", "i"] [132.539148, "o", "t"] [132.739381, "o", " "] [132.75765, "o", "w"] [132.773923, "o", "i"] [132.859107, "o", "t"] [132.871348, "o", "h"] [132.932614, "o", "o"] [132.965873, "o", "u"] [132.990116, "o", "t"] [133.039327, "o", " "] [133.118587, "o", "t"] [133.16384, "o", "h"] [133.197097, "o", "e"] [133.258298, "o", " "] [133.26755, "o", "-"] [133.30881, "o", "-"] [133.356063, "o", "d"] [133.431264, "o", "r"] [133.579521, "o", "y"] [133.598889, "o", "-"] [133.611051, "o", "r"] [133.627291, "o", "u"] [133.682531, "o", "n"] [133.699785, "o", " "] [133.752037, "o", "o"] [133.83033, "o", "p"] [133.958481, "o", "t"] [133.98858, "o", "i"] [134.144897, "o", "o"] [134.211076, "o", "n"] [134.222281, "o", ","] [134.363538, "o", " "] [134.397804, "o", "o"] [134.408005, "o", "f"] [134.608297, "o", " "] [134.626522, "o", "c"] [134.635763, "o", "o"] [134.694895, "o", "u"] [134.774151, "o", "r"] [134.815387, "o", "s"] [134.911629, "o", "e"] [134.955897, "o", "."] [134.9656, "o", "\r\n$ \r\n"] [134.965766, "o", "$ #"] [134.974883, "o", "#"] [135.032143, "o", " "] [135.212403, "o", "R"] [135.320667, "o", "E"] [135.34591, "o", "S"] [135.355073, "o", "T"] [135.462336, "o", "O"] [135.520591, "o", "R"] [135.564825, "o", "E"] [135.574095, "o", " "] [135.583294, "o", "#"] [135.59252, "o", "#"] [135.76985, "o", "\r\n"] [135.77021, "o", "$ \r\n"] [135.770371, "o", "$ #"] [135.802643, "o", " "] [135.831898, "o", "W"] [135.841141, "o", "h"] [136.024428, "o", "e"] [136.074669, "o", "n"] [136.083752, "o", " "] [136.092876, "o", "y"] [136.177024, "o", "o"] [136.211126, "o", "u"] [136.308445, "o", " "] [136.317628, "o", "w"] [136.326945, "o", "a"] [136.527133, "o", "n"] [136.545348, "o", "t"] [136.572621, "o", " "] [136.59388, "o", "t"] [136.621124, "o", "o"] [136.74037, "o", " "] [136.759632, "o", "s"] [136.768838, "o", "e"] [136.870121, "o", "e"] [136.933357, "o", " "] [136.998616, "o", "t"] [137.01787, "o", "h"] [137.106114, "o", "e"] [137.256375, "o", " "] [137.284629, "o", "d"] [137.476905, "o", "i"] [137.546163, "o", "f"] [137.746423, "o", "f"] [137.755642, "o", " "] [137.955914, "o", "b"] [137.968135, "o", "e"] [138.083376, "o", "t"] [138.15063, "o", "w"] [138.19896, "o", "e"] [138.259157, "o", "e"] [138.339242, "o", "n"] [138.362365, "o", " "] [138.547758, "o", "t"] [138.574956, "o", "w"] [138.597213, "o", "o"] [138.797472, "o", " "] [138.80677, "o", "a"] [138.83602, "o", "r"] [138.845271, "o", "c"] [138.882571, "o", "h"] [138.932833, "o", "i"] [138.976096, "o", "v"] [139.069357, "o", "e"] [139.101615, "o", "s"] [139.160879, "o", " "] [139.170074, "o", "u"] [139.181311, "o", "s"] [139.254593, "o", "e"] [139.454948, "o", " "] [139.655134, "o", "t"] [139.840393, "o", "h"] [139.894686, "o", "i"] [139.929925, "o", "s"] [140.130188, "o", " "] [140.198433, "o", "c"] [140.233719, "o", "o"] [140.390928, "o", "m"] [140.418192, "o", "m"] [140.432452, "o", "a"] [140.475737, "o", "n"] [140.586824, "o", "d"] [140.757161, "o", "."] [140.833578, "o", "\r\n"] [140.834316, "o", "$ #"] [140.843373, "o", " "] [140.964668, "o", "E"] [141.09793, "o", "."] [141.108182, "o", "g"] [141.151418, "o", "."] [141.19968, "o", " "] [141.232918, "o", "w"] [141.433168, "o", "h"] [141.444444, "o", "a"] [141.463703, "o", "t"] [141.490935, "o", " "] [141.51719, "o", "h"] [141.5274, "o", "a"] [141.557672, "o", "p"] [141.711926, "o", "p"] [141.813187, "o", "e"] [141.842439, "o", "n"] [141.974914, "o", "e"] [142.011958, "o", "d"] [142.141211, "o", " "] [142.196474, "o", "b"] [142.205729, "o", "e"] [142.218871, "o", "t"] [142.268159, "o", "w"] [142.281389, "o", "e"] [142.295658, "o", "e"] [142.485918, "o", "n"] [142.499102, "o", " "] [142.59036, "o", "t"] [142.662621, "o", "h"] [142.86285, "o", "e"] [143.053083, "o", " "] [143.109365, "o", "f"] [143.174629, "o", "i"] [143.183817, "o", "r"] [143.264078, "o", "s"] [143.273304, "o", "t"] [143.347578, "o", " "] [143.38783, "o", "t"] [143.397029, "o", "w"] [143.445305, "o", "o"] [143.604558, "o", " "] [143.61982, "o", "b"] [143.662984, "o", "a"] [143.677246, "o", "c"] [143.68947, "o", "k"] [143.718812, "o", "u"] [143.750062, "o", "p"] [143.878314, "o", "s"] [144.014587, "o", "?"] [144.024937, "o", "\r\n"] [144.025577, "o", "$ b"] [144.103775, "o", "o"] [144.11397, "o", "r"] [144.314265, "o", "g"] [144.323463, "o", " "] [144.33574, "o", "d"] [144.404002, "o", "i"] [144.413199, "o", "f"] [144.422432, "o", "f"] [144.492721, "o", " "] [144.616987, "o", ":"] [144.735188, "o", ":"] [144.887429, "o", "b"] [144.913512, "o", "a"] [144.976805, "o", "c"] [145.012882, "o", "k"] [145.050988, "o", "u"] [145.06411, "o", "p"] [145.073236, "o", "1"] [145.122529, "o", " "] [145.172773, "o", "b"] [145.274964, "o", "a"] [145.329206, "o", "c"] [145.340477, "o", "k"] [145.451743, "o", "u"] [145.559999, "o", "p"] [145.587202, "o", "2"] [145.630681, "o", "\r\n"] [146.646473, "o", "added 14 B Wallpaper/newfile.txt"] [146.647431, "o", "\r\r\n"] [146.706774, "o", "$ #"] [146.716059, "o", " "] [146.755468, "o", "A"] [146.901789, "o", "h"] [147.035155, "o", ","] [147.070453, "o", " "] [147.132464, "o", "w"] [147.170608, "o", "e"] [147.298155, "o", " "] [147.328469, "o", "a"] [147.358818, "o", "d"] [147.434065, "o", "d"] [147.500279, "o", "e"] [147.523549, "o", "d"] [147.583913, "o", " "] [147.642189, "o", "a"] [147.724483, "o", " "] [147.733697, "o", "f"] [147.744978, "o", "i"] [147.754216, "o", "l"] [147.764569, "o", "e"] [147.773825, "o", ","] [147.807202, "o", " "] [147.892481, "o", "r"] [148.021787, "o", "i"] [148.148093, "o", "g"] [148.228377, "o", "h"] [148.312729, "o", "t"] [148.476959, "o", "…"] [148.677268, "o", "\r\n"] [148.678159, "o", "$ \r\n"] [148.678976, "o", "$ #"] [148.821721, "o", " "] [148.839132, "o", "T"] [148.848356, "o", "h"] [148.87758, "o", "e"] [148.951243, "o", "r"] [149.035959, "o", "e"] [149.239284, "o", " "] [149.272524, "o", "a"] [149.288132, "o", "r"] [149.299294, "o", "e"] [149.32949, "o", " "] [149.404801, "o", "a"] [149.425843, "o", "l"] [149.459032, "o", "s"] [149.490519, "o", "o"] [149.691261, "o", " "] [149.74465, "o", "o"] [149.775182, "o", "t"] [149.849871, "o", "h"] [149.940396, "o", "e"] [149.97516, "o", "r"] [149.984609, "o", " "] [150.015151, "o", "w"] [150.025493, "o", "a"] [150.179023, "o", "y"] [150.379968, "o", "s"] [150.528559, "o", " "] [150.566363, "o", "t"] [150.766933, "o", "o"] [150.892125, "o", " "] [150.95061, "o", "e"] [151.015184, "o", "x"] [151.191108, "o", "t"] [151.269469, "o", "r"] [151.278897, "o", "a"] [151.344629, "o", "c"] [151.37102, "o", "t"] [151.57479, "o", " "] [151.779091, "o", "t"] [151.807215, "o", "h"] [151.817017, "o", "e"] [151.826812, "o", " "] [151.837693, "o", "d"] [151.870989, "o", "a"] [151.906995, "o", "t"] [151.935865, "o", "a"] [151.951634, "o", "."] [151.961314, "o", "\r\n"] [151.961915, "o", "$ "] [151.962215, "o", "#"] [152.087058, "o", " "] [152.291084, "o", "E"] [152.491848, "o", "."] [152.643011, "o", "g"] [152.667003, "o", "."] [152.679008, "o", " "] [152.738984, "o", "a"] [152.750962, "o", "s"] [152.850896, "o", " "] [152.862923, "o", "a"] [153.066925, "o", " "] [153.09013, "o", "t"] [153.20094, "o", "a"] [153.254436, "o", "r"] [153.267051, "o", " "] [153.299031, "o", "a"] [153.342374, "o", "r"] [153.38735, "o", "c"] [153.433121, "o", "h"] [153.4661, "o", "i"] [153.508774, "o", "v"] [153.585774, "o", "e"] [153.630565, "o", "."] [153.675714, "o", "\r\n"] [153.676317, "o", "$ "] [153.676694, "o", "b"] [153.762637, "o", "o"] [153.772338, "o", "r"] [153.781992, "o", "g"] [153.912578, "o", " "] [153.92756, "o", "e"] [154.013549, "o", "x"] [154.066538, "o", "p"] [154.076608, "o", "o"] [154.140459, "o", "r"] [154.16366, "o", "t"] [154.364435, "o", "-"] [154.408099, "o", "t"] [154.418034, "o", "a"] [154.428065, "o", "r"] [154.455016, "o", " "] [154.469614, "o", "-"] [154.579003, "o", "-"] [154.599039, "o", "p"] [154.717754, "o", "r"] [154.735811, "o", "o"] [154.763071, "o", "g"] [154.775033, "o", "r"] [154.882988, "o", "e"] [155.083346, "o", "s"] [155.146533, "o", "s"] [155.189637, "o", " "] [155.23149, "o", ":"] [155.267181, "o", ":"] [155.330171, "o", "b"] [155.462667, "o", "a"] [155.477237, "o", "c"] [155.494642, "o", "k"] [155.503974, "o", "u"] [155.515675, "o", "p"] [155.595249, "o", "2"] [155.604431, "o", " "] [155.614019, "o", "b"] [155.643395, "o", "a"] [155.652943, "o", "c"] [155.691221, "o", "k"] [155.734922, "o", "u"] [155.744399, "o", "p"] [155.753882, "o", "."] [155.802861, "o", "t"] [155.977131, "o", "a"] [155.986236, "o", "r"] [156.087515, "o", "."] [156.136273, "o", "g"] [156.160903, "o", "z"] [156.198554, "o", "\r\n"] [157.172127, "o", "Calculating size \r"] [157.219086, "o", " 0.0% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [157.232012, "o", " 0.1% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [157.247489, "o", " 0.2% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [157.262907, "o", " 0.3% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [157.279081, "o", " 0.4% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [157.300524, "o", " 0.5% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [157.315831, "o", " 0.6% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [157.330977, "o", " 0.7% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [157.345515, "o", " 0.8% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [157.360863, "o", " 0.9% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [157.375449, "o", " 1.0% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [157.408876, "o", " 1.1% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [157.422884, "o", " 1.2% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [157.438354, "o", " 1.3% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [157.452712, "o", " 1.4% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [157.467172, "o", " 1.5% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [157.499915, "o", " 1.6% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [157.515169, "o", " 1.7% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [157.529275, "o", " 1.8% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [157.543338, "o", " 1.9% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [157.581406, "o", " 2.0% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [157.596978, "o", " 2.1% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [157.611373, "o", " 2.2% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [157.626227, "o", " 2.3% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [157.640994, "o", " 2.4% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [157.725886, "o", " 2.5% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [157.745778, "o", " 2.6% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [157.760489, "o", " 2.7% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [157.775759, "o", " 2.8% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [157.791933, "o", " 2.9% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [157.80658, "o", " 3.0% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [157.821733, "o", " 3.1% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [157.836702, "o", " 3.2% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [157.85165, "o", " 3.3% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [157.868112, "o", " 3.4% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [157.882944, "o", " 3.5% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [157.897961, "o", " 3.6% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [157.912838, "o", " 3.7% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [157.92886, "o", " 3.8% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [157.943857, "o", " 3.9% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [157.959085, "o", " 4.0% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [158.006007, "o", " 4.1% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [158.025829, "o", " 4.2% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [158.041193, "o", " 4.3% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [158.056682, "o", " 4.4% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [158.072103, "o", " 4.5% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [158.088539, "o", " 4.6% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [158.103897, "o", " 4.7% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [158.119636, "o", " 4.8% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [158.134689, "o", " 4.9% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [158.205307, "o", " 5.0% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [158.221344, "o", " 5.1% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [158.236706, "o", " 5.2% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [158.252215, "o", " 5.3% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [158.268821, "o", " 5.4% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [158.284465, "o", " 5.5% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [158.300428, "o", " 5.6% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [158.315921, "o", " 5.7% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [158.332981, "o", " 5.8% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [158.348576, "o", " 5.9% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [158.364666, "o", " 6.0% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [158.380214, "o", " 6.1% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [158.397047, "o", " 6.2% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [158.412564, "o", " 6.3% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [158.42787, "o", " 6.4% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [158.443443, "o", " 6.5% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [158.48121, "o", " 6.6% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [158.500545, "o", " 6.7% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [158.516723, "o", " 6.8% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [158.533792, "o", " 6.9% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [158.548206, "o", " 7.0% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [158.58743, "o", " 7.1% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [158.607343, "o", " 7.2% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [158.622246, "o", " 7.3% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [158.637241, "o", " 7.4% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [158.653785, "o", " 7.5% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [158.669092, "o", " 7.6% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [158.68441, "o", " 7.7% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [158.704085, "o", " 7.8% Processing: Wallpaper/bigcollection/Pse...nian_001_OpenCL_45154214_8K.jpg\r"] [158.744556, "o", " 7.9% Processing: Wallpaper/bigcollection/Men...bulb_OpenCL_528814521414_8K.jpg\r"] [158.760259, "o", " 8.0% Processing: Wallpaper/bigcollection/Men...bulb_OpenCL_528814521414_8K.jpg\r"] [158.776392, "o", " 8.1% Processing: Wallpaper/bigcollection/Men...bulb_OpenCL_528814521414_8K.jpg\r"] [158.793498, "o", " 8.2% Processing: Wallpaper/bigcollection/Men...bulb_OpenCL_528814521414_8K.jpg\r"] [158.8327, "o", " 8.3% Processing: Wallpaper/bigcollection/Men...bulb_OpenCL_528814521414_8K.jpg\r"] [158.850863, "o", " 8.4% Processing: Wallpaper/bigcollection/Men...bulb_OpenCL_528814521414_8K.jpg\r"] [158.866562, "o", " 8.5% Processing: Wallpaper/bigcollection/Men...bulb_OpenCL_528814521414_8K.jpg\r"] [158.88326, "o", " 8.6% Processing: Wallpaper/bigcollection/Men...bulb_OpenCL_528814521414_8K.jpg\r"] [158.899004, "o", " 8.7% Processing: Wallpaper/bigcollection/Men...bulb_OpenCL_528814521414_8K.jpg\r"] [158.918108, "o", " 8.8% Processing: Wallpaper/bigcollection/Men...bulb_OpenCL_528814521414_8K.jpg\r"] [158.947114, "o", " 8.9% Processing: Wallpaper/bigcollection/Men...bulb_OpenCL_528814521414_8K.jpg\r"] [158.969053, "o", " 9.0% Processing: Wallpaper/bigcollection/Men...bulb_OpenCL_528814521414_8K.jpg\r"] [158.984936, "o", " 9.1% Processing: Wallpaper/bigcollection/Men...bulb_OpenCL_528814521414_8K.jpg\r"] [159.010189, "o", " 9.2% Processing: Wallpaper/bigcollection/Men...bulb_OpenCL_528814521414_8K.jpg\r"] [159.028139, "o", " 9.3% Processing: Wallpaper/bigcollection/Men...bulb_OpenCL_528814521414_8K.jpg\r"] [159.108276, "o", " 9.4% Processing: Wallpaper/bigcollection/Men...bulb_OpenCL_528814521414_8K.jpg\r"] [159.127413, "o", " 9.5% Processing: Wallpaper/bigcollection/Men...bulb_OpenCL_528814521414_8K.jpg\r"] [159.142793, "o", " 9.6% Processing: Wallpaper/bigcollection/Men...bulb_OpenCL_528814521414_8K.jpg\r"] [159.158279, "o", " 9.7% Processing: Wallpaper/bigcollection/Men...bulb_OpenCL_528814521414_8K.jpg\r"] [159.17327, "o", " 9.8% Processing: Wallpaper/bigcollection/Men...bulb_OpenCL_528814521414_8K.jpg\r"] [159.189834, "o", " 9.9% Processing: Wallpaper/bigcollection/Men...bulb_OpenCL_528814521414_8K.jpg\r"] [159.205214, "o", " 10.0% Processing: Wallpaper/bigcollection/Men...bulb_OpenCL_528814521414_8K.jpg\r"] [159.220659, "o", " 10.1% Processing: Wallpaper/bigcollection/Men...bulb_OpenCL_528814521414_8K.jpg\r"] [159.236247, "o", " 10.2% Processing: Wallpaper/bigcollection/Men...bulb_OpenCL_528814521414_8K.jpg\r"] [159.25289, "o", " 10.3% Processing: Wallpaper/bigcollection/Men...bulb_OpenCL_528814521414_8K.jpg\r"] [159.268312, "o", " 10.4% Processing: Wallpaper/bigcollection/Men...bulb_OpenCL_528814521414_8K.jpg\r"] [159.284074, "o", " 10.5% Processing: Wallpaper/bigcollection/Men...bulb_OpenCL_528814521414_8K.jpg\r"] [159.300031, "o", " 10.6% Processing: Wallpaper/bigcollection/Men...bulb_OpenCL_528814521414_8K.jpg\r"] [159.332223, "o", " 10.7% Processing: Wallpaper/bigcollection/Men...bulb_OpenCL_528814521414_8K.jpg\r"] [159.34777, "o", " 10.8% Processing: Wallpaper/bigcollection/Men...bulb_OpenCL_528814521414_8K.jpg\r"] [159.38522, "o", " 10.9% Processing: Wallpaper/bigcollection/Men...bulb_OpenCL_528814521414_8K.jpg\r"] [159.402322, "o", " 11.0% Processing: Wallpaper/bigcollection/Men...bulb_OpenCL_528814521414_8K.jpg\r"] [159.419323, "o", " 11.1% Processing: Wallpaper/bigcollection/Men...bulb_OpenCL_528814521414_8K.jpg\r"] [159.434845, "o", " 11.2% Processing: Wallpaper/bigcollection/Men...bulb_OpenCL_528814521414_8K.jpg\r"] [159.449991, "o", " 11.3% Processing: Wallpaper/bigcollection/Men...bulb_OpenCL_528814521414_8K.jpg\r"] [159.465728, "o", " 11.4% Processing: Wallpaper/bigcollection/Men...bulb_OpenCL_528814521414_8K.jpg\r"] [159.504174, "o", " 11.5% Processing: Wallpaper/bigcollection/Men...bulb_OpenCL_528814521414_8K.jpg\r"] [159.521585, "o", " 11.6% Processing: Wallpaper/bigcollection/Men...bulb_OpenCL_528814521414_8K.jpg\r"] [159.53715, "o", " 11.7% Processing: Wallpaper/bigcollection/Men...bulb_OpenCL_528814521414_8K.jpg\r"] [159.553172, "o", " 11.8% Processing: Wallpaper/bigcollection/Men...bulb_OpenCL_528814521414_8K.jpg\r"] [159.570076, "o", " 11.9% Processing: Wallpaper/bigcollection/Men...bulb_OpenCL_528814521414_8K.jpg\r"] [159.592397, "o", " 12.0% Processing: Wallpaper/bigcollection/Gre...ng_under_tree_in_foreground.jpg\r"] [159.613245, "o", " 12.1% Processing: Wallpaper/bigcollection/Gre...ng_under_tree_in_foreground.jpg\r"] [159.64795, "o", " 12.2% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [159.663153, "o", " 12.3% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [159.679807, "o", " 12.4% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [159.695152, "o", " 12.5% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [159.744481, "o", " 12.6% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [159.760973, "o", " 12.7% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [159.776544, "o", " 12.8% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [159.792091, "o", " 12.9% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [159.807627, "o", " 13.0% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [159.824415, "o", " 13.1% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [159.839658, "o", " 13.2% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [159.856632, "o", " 13.3% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [159.886813, "o", " 13.4% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [159.907035, "o", " 13.5% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [159.922753, "o", " 13.6% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [159.938148, "o", " 13.7% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [159.969351, "o", " 13.8% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [159.986611, "o", " 13.9% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.002259, "o", " 14.0% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.018123, "o", " 14.1% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.066077, "o", " 14.2% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.0814, "o", " 14.3% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.098185, "o", " 14.4% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.11377, "o", " 14.5% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.185687, "o", " 14.6% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.204434, "o", " 14.7% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.220251, "o", " 14.8% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.236801, "o", " 14.9% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.25281, "o", " 15.0% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.269864, "o", " 15.1% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.284684, "o", " 15.2% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.301911, "o", " 15.3% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.318073, "o", " 15.4% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.339029, "o", " 15.5% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.356267, "o", " 15.6% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.372204, "o", " 15.7% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.388185, "o", " 15.8% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.404526, "o", " 15.9% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.421391, "o", " 16.0% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.447583, "o", " 16.1% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.466393, "o", " 16.2% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.485417, "o", " 16.3% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.519291, "o", " 16.4% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.53441, "o", " 16.5% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.551411, "o", " 16.6% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.567197, "o", " 16.7% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.606136, "o", " 16.8% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.621928, "o", " 16.9% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.638135, "o", " 17.0% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.653872, "o", " 17.1% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.669626, "o", " 17.2% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.694603, "o", " 17.3% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.712689, "o", " 17.4% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.756749, "o", " 17.5% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.772771, "o", " 17.6% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.789625, "o", " 17.7% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.805609, "o", " 17.8% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.821556, "o", " 17.9% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.838879, "o", " 18.0% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.871146, "o", " 18.1% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.889911, "o", " 18.2% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.905901, "o", " 18.3% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.925349, "o", " 18.4% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.941677, "o", " 18.5% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.978467, "o", " 18.6% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [160.994806, "o", " 18.7% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [161.01088, "o", " 18.8% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [161.027933, "o", " 18.9% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [161.082066, "o", " 19.0% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [161.098727, "o", " 19.1% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [161.114477, "o", " 19.2% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [161.131563, "o", " 19.3% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [161.145861, "o", " 19.4% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [161.162872, "o", " 19.5% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [161.178381, "o", " 19.6% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [161.195497, "o", " 19.7% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [161.210998, "o", " 19.8% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [161.226604, "o", " 19.9% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [161.281901, "o", " 20.0% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [161.301155, "o", " 20.1% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [161.317754, "o", " 20.2% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [161.333414, "o", " 20.3% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [161.349715, "o", " 20.4% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [161.367718, "o", " 20.5% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [161.386536, "o", " 20.6% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [161.402073, "o", " 20.7% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [161.417741, "o", " 20.8% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [161.434854, "o", " 20.9% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [161.449254, "o", " 21.0% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [161.466199, "o", " 21.1% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [161.508892, "o", " 21.2% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [161.525813, "o", " 21.3% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [161.541559, "o", " 21.4% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [161.557149, "o", " 21.5% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [161.572844, "o", " 21.6% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [161.588465, "o", " 21.7% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [161.645283, "o", " 21.8% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [161.659307, "o", " 21.9% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [161.676184, "o", " 22.0% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [161.691533, "o", " 22.1% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [161.70822, "o", " 22.2% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [161.723919, "o", " 22.3% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [161.73965, "o", " 22.4% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [161.755492, "o", " 22.5% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [161.772282, "o", " 22.6% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [161.787919, "o", " 22.7% Processing: Wallpaper/bigcollection/Men...Fold_Box_OpenCL_18915424_8K.jpg\r"] [161.831364, "o", " 22.8% Processing: Wallpaper/bigcollection/KIFS_OpenCL_54815_5K.jpg \r"] [161.8508, "o", " 22.9% Processing: Wallpaper/bigcollection/KIF...penCL_54815_5K.jpg \r"] [161.872417, "o", " 23.0% Processing: Wallpaper/bigcollection/KIF...penCL_54815_5K.jpg \r"] [161.893537, "o", " 23.1% Processing: Wallpaper/bigcollection/KIF...penCL_54815_5K.jpg \r"] [161.91235, "o", " 23.2% Processing: Wallpaper/bigcollection/KIF...penCL_54815_5K.jpg \r"] [161.929587, "o", " 23.3% Processing: Wallpaper/bigcollection/KIF...penCL_54815_5K.jpg \r"] [161.968449, "o", " 23.4% Processing: Wallpaper/bigcollection/KIF...penCL_54815_5K.jpg \r"] [161.990515, "o", " 23.5% Processing: Wallpaper/bigcollection/KIF...penCL_54815_5K.jpg \r"] [162.00623, "o", " 23.6% Processing: Wallpaper/bigcollection/KIF...penCL_54815_5K.jpg \r"] [162.023164, "o", " 23.7% Processing: Wallpaper/bigcollection/KIF...penCL_54815_5K.jpg \r"] [162.039545, "o", " 23.8% Processing: Wallpaper/bigcollection/KIF...penCL_54815_5K.jpg \r"] [162.05695, "o", " 23.9% Processing: Wallpaper/bigcollection/KIF...penCL_54815_5K.jpg \r"] [162.085475, "o", " 24.0% Processing: Wallpaper/bigcollection/ProjectStealth.png \r"] [162.099031, "o", " 24.1% Processing: Wallpaper/bigcollection/Pro...tStealth.png \r"] [162.112845, "o", " 24.2% Processing: Wallpaper/bigcollection/Pro...tStealth.png \r"] [162.131599, "o", " 24.3% Processing: Wallpaper/bigcollection/Pro...tStealth.png \r"] [162.158098, "o", " 24.4% Processing: Wallpaper/bigcollection/KIFS_OpenCL_5434735835_5K.jpg \r"] [162.173267, "o", " 24.5% Processing: Wallpaper/bigcollection/KIF...penCL_5434735835_5K.jpg \r"] [162.244066, "o", " 24.6% Processing: Wallpaper/bigcollection/KIF...penCL_5434735835_5K.jpg \r"] [162.260231, "o", " 24.7% Processing: Wallpaper/bigcollection/KIF...penCL_5434735835_5K.jpg \r"] [162.275372, "o", " 24.8% Processing: Wallpaper/bigcollection/KIF...penCL_5434735835_5K.jpg \r"] [162.290501, "o", " 24.9% Processing: Wallpaper/bigcollection/KIF...penCL_5434735835_5K.jpg \r"] [162.305736, "o", " 25.0% Processing: Wallpaper/bigcollection/KIF...penCL_5434735835_5K.jpg \r"] [162.322345, "o", " 25.1% Processing: Wallpaper/bigcollection/KIF...penCL_5434735835_5K.jpg \r"] [162.337761, "o", " 25.2% Processing: Wallpaper/bigcollection/KIF...penCL_5434735835_5K.jpg \r"] [162.353173, "o", " 25.3% Processing: Wallpaper/bigcollection/KIF...penCL_5434735835_5K.jpg \r"] [162.368582, "o", " 25.4% Processing: Wallpaper/bigcollection/KIF...penCL_5434735835_5K.jpg \r"] [162.383992, "o", " 25.5% Processing: Wallpaper/bigcollection/KIF...penCL_5434735835_5K.jpg \r"] [162.400764, "o", " 25.6% Processing: Wallpaper/bigcollection/KIF...penCL_5434735835_5K.jpg \r"] [162.416352, "o", " 25.7% Processing: Wallpaper/bigcollection/KIF...penCL_5434735835_5K.jpg \r"] [162.432005, "o", " 25.8% Processing: Wallpaper/bigcollection/KIF...penCL_5434735835_5K.jpg \r"] [162.447552, "o", " 25.9% Processing: Wallpaper/bigcollection/KIF...penCL_5434735835_5K.jpg \r"] [162.46454, "o", " 26.0% Processing: Wallpaper/bigcollection/KIF...penCL_5434735835_5K.jpg \r"] [162.480048, "o", " 26.1% Processing: Wallpaper/bigcollection/KIF...penCL_5434735835_5K.jpg \r"] [162.514279, "o", " 26.2% Processing: Wallpaper/bigcollection/KIF...penCL_5434735835_5K.jpg \r"] [162.529417, "o", " 26.3% Processing: Wallpaper/bigcollection/KIF...penCL_5434735835_5K.jpg \r"] [162.546059, "o", " 26.4% Processing: Wallpaper/bigcollection/KIF...penCL_5434735835_5K.jpg \r"] [162.561448, "o", " 26.5% Processing: Wallpaper/bigcollection/KIF...penCL_5434735835_5K.jpg \r"] [162.576586, "o", " 26.6% Processing: Wallpaper/bigcollection/KIF...penCL_5434735835_5K.jpg \r"] [162.611597, "o", " 26.7% Processing: Wallpaper/bigcollection/KIF...penCL_5434735835_5K.jpg \r"] [162.631237, "o", " 26.8% Processing: Wallpaper/bigcollection/KIF...penCL_5434735835_5K.jpg \r"] [162.646638, "o", " 26.9% Processing: Wallpaper/bigcollection/KIF...penCL_5434735835_5K.jpg \r"] [162.66206, "o", " 27.0% Processing: Wallpaper/bigcollection/KIF...penCL_5434735835_5K.jpg \r"] [162.677412, "o", " 27.1% Processing: Wallpaper/bigcollection/KIF...penCL_5434735835_5K.jpg \r"] [162.693949, "o", " 27.2% Processing: Wallpaper/bigcollection/KIF...penCL_5434735835_5K.jpg \r"] [162.724496, "o", " 27.3% Processing: Wallpaper/bigcollection/KIF...penCL_5434735835_5K.jpg \r"] [162.739752, "o", " 27.4% Processing: Wallpaper/bigcollection/KIF...penCL_5434735835_5K.jpg \r"] [162.755092, "o", " 27.5% Processing: Wallpaper/bigcollection/KIF...penCL_5434735835_5K.jpg \r"] [162.781252, "o", " 27.6% Processing: Wallpaper/bigcollection/KIF...penCL_5434735835_5K.jpg \r"] [162.797449, "o", " 27.7% Processing: Wallpaper/bigcollection/KIF...penCL_5434735835_5K.jpg \r"] [162.827407, "o", " 27.8% Processing: Wallpaper/bigcollection/KIF...penCL_5434735835_5K.jpg \r"] [162.847733, "o", " 27.9% Processing: Wallpaper/bigcollection/KIF...penCL_5434735835_5K.jpg \r"] [162.864316, "o", " 28.0% Processing: Wallpaper/bigcollection/KIF...penCL_5434735835_5K.jpg \r"] [162.879641, "o", " 28.1% Processing: Wallpaper/bigcollection/KIF...penCL_5434735835_5K.jpg \r"] [162.896474, "o", " 28.2% Processing: Wallpaper/bigcollection/KIF...penCL_5434735835_5K.jpg \r"] [162.95962, "o", " 28.3% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [162.974269, "o", " 28.4% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [162.988897, "o", " 28.5% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.003383, "o", " 28.6% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.018078, "o", " 28.7% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.03435, "o", " 28.8% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.049134, "o", " 28.9% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.06415, "o", " 29.0% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.079264, "o", " 29.1% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.095033, "o", " 29.2% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.109954, "o", " 29.3% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.145147, "o", " 29.4% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.163279, "o", " 29.5% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.17801, "o", " 29.6% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.193503, "o", " 29.7% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.208067, "o", " 29.8% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.222848, "o", " 29.9% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.265416, "o", " 30.0% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.281955, "o", " 30.1% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.296749, "o", " 30.2% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.311728, "o", " 30.3% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.32726, "o", " 30.4% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.343787, "o", " 30.5% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.358255, "o", " 30.6% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.386172, "o", " 30.7% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.401217, "o", " 30.8% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.487853, "o", " 30.9% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.50415, "o", " 31.0% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.518983, "o", " 31.1% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.535014, "o", " 31.2% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.549825, "o", " 31.3% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.564416, "o", " 31.4% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.579236, "o", " 31.5% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.593644, "o", " 31.6% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.60972, "o", " 31.7% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.624526, "o", " 31.8% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.639323, "o", " 31.9% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.654362, "o", " 32.0% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.670841, "o", " 32.1% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.686164, "o", " 32.2% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.702037, "o", " 32.3% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.717948, "o", " 32.4% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.733275, "o", " 32.5% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.749689, "o", " 32.6% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.764971, "o", " 32.7% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.792328, "o", " 32.8% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.809063, "o", " 32.9% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.825566, "o", " 33.0% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.862521, "o", " 33.1% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.877663, "o", " 33.2% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.892846, "o", " 33.3% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.909113, "o", " 33.4% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.933228, "o", " 33.5% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.950611, "o", " 33.6% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [163.965592, "o", " 33.7% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [164.010098, "o", " 33.8% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [164.026093, "o", " 33.9% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [164.041194, "o", " 34.0% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [164.05754, "o", " 34.1% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [164.072675, "o", " 34.2% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [164.087708, "o", " 34.3% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [164.105121, "o", " 34.4% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [164.205315, "o", " 34.5% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [164.221054, "o", " 34.6% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [164.236048, "o", " 34.7% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [164.251256, "o", " 34.8% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [164.266101, "o", " 34.9% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [164.282491, "o", " 35.0% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [164.297453, "o", " 35.1% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [164.312481, "o", " 35.2% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [164.327597, "o", " 35.3% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [164.342124, "o", " 35.4% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [164.358177, "o", " 35.5% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [164.373151, "o", " 35.6% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [164.38827, "o", " 35.7% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [164.403196, "o", " 35.8% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [164.419188, "o", " 35.9% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [164.434077, "o", " 36.0% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [164.449026, "o", " 36.1% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [164.463925, "o", " 36.2% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [164.479708, "o", " 36.3% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [164.494372, "o", " 36.4% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [164.509307, "o", " 36.5% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [164.549395, "o", " 36.6% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [164.564805, "o", " 36.7% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [164.579672, "o", " 36.8% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [164.594262, "o", " 36.9% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [164.609097, "o", " 37.0% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [164.625262, "o", " 37.1% Processing: Wallpaper/bigcollection/Gen...ld_Box_OpenCL_4258952414_8K.jpg\r"] [164.71211, "o", " 37.2% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [164.725461, "o", " 37.3% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [164.740883, "o", " 37.4% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [164.755236, "o", " 37.5% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [164.76952, "o", " 37.6% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [164.783476, "o", " 37.7% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [164.798959, "o", " 37.8% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [164.811597, "o", " 37.9% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [164.827098, "o", " 38.0% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [164.841882, "o", " 38.1% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [164.857076, "o", " 38.2% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [164.871356, "o", " 38.3% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [164.885444, "o", " 38.4% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [164.90003, "o", " 38.5% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [164.915101, "o", " 38.6% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [164.929158, "o", " 38.7% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [164.943635, "o", " 38.8% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [164.95983, "o", " 38.9% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.016768, "o", " 39.0% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.031747, "o", " 39.1% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.045748, "o", " 39.2% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.060048, "o", " 39.3% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.074101, "o", " 39.4% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.089652, "o", " 39.5% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.104215, "o", " 39.6% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.118366, "o", " 39.7% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.132477, "o", " 39.8% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.146595, "o", " 39.9% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.161775, "o", " 40.0% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.216091, "o", " 40.1% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.235223, "o", " 40.2% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.250335, "o", " 40.3% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.264513, "o", " 40.4% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.27882, "o", " 40.5% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.29292, "o", " 40.6% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.308386, "o", " 40.7% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.325042, "o", " 40.8% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.339423, "o", " 40.9% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.354481, "o", " 41.0% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.370932, "o", " 41.1% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.386144, "o", " 41.2% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.406262, "o", " 41.3% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.439308, "o", " 41.4% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.457374, "o", " 41.5% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.471511, "o", " 41.6% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.485641, "o", " 41.7% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.499622, "o", " 41.8% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.540815, "o", " 41.9% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.555849, "o", " 42.0% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.5697, "o", " 42.1% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.584235, "o", " 42.2% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.598363, "o", " 42.3% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.613715, "o", " 42.4% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.679444, "o", " 42.5% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.693115, "o", " 42.6% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.707433, "o", " 42.7% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.721651, "o", " 42.8% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.739409, "o", " 42.9% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.753223, "o", " 43.0% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.767281, "o", " 43.1% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r"] [165.767825, "o", "l"] [165.808885, "o", "s"] [165.832142, "o", " "] [165.911302, "o", "-"] [165.931544, "o", "l"] [166.132117, "o", "\r\n 43.2% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r 43.3% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r 43.4% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r 43.5% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r 43.6% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r 43.7% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r 43.8% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r 43.9% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r 44.0% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r 44.1% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r 44.2% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r 44.3% Processing: Wallpaper/bigcollection/Man...ale_4D_OpenCL_9648145412_8K.jpg\r 44.4% Processing: Wallpaper/bigcollection/Man...a"] [166.132282, "o", "le_4D_OpenCL_9648145412_8K.jpg\r 44.5% Processing: Wallpaper/bigcollection/Trapper_cabin.jpg \r 44.6% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r 44.7% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r 44.8% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r 44.9% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r 45.0% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r 45.1% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.137111, "o", " 45.2% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.22457, "o", " 45.3% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.239156, "o", " 45.4% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.253881, "o", " 45.5% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.268644, "o", " 45.6% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.28505, "o", " 45.7% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.300194, "o", " 45.8% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.315375, "o", " 45.9% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.330249, "o", " 46.0% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.346349, "o", " 46.1% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.361565, "o", " 46.2% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.377064, "o", " 46.3% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.392388, "o", " 46.4% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.408886, "o", " 46.5% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.423419, "o", " 46.6% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.438061, "o", " 46.7% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.452779, "o", " 46.8% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.467486, "o", " 46.9% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.48437, "o", " 47.0% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.503504, "o", " 47.1% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.552176, "o", " 47.2% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.566378, "o", " 47.3% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.582761, "o", " 47.4% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.597476, "o", " 47.5% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.68726, "o", " 47.6% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.703484, "o", " 47.7% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.719492, "o", " 47.8% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.733919, "o", " 47.9% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.749032, "o", " 48.0% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.763838, "o", " 48.1% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.779922, "o", " 48.2% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.794452, "o", " 48.3% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.809086, "o", " 48.4% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.823751, "o", " 48.5% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.839424, "o", " 48.6% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.853844, "o", " 48.7% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.868371, "o", " 48.8% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.883116, "o", " 48.9% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.899475, "o", " 49.0% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.914904, "o", " 49.1% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.929672, "o", " 49.2% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.944956, "o", " 49.3% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.961651, "o", " 49.4% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.97701, "o", " 49.5% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [166.992797, "o", " 49.6% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [167.027683, "o", " 49.7% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [167.044163, "o", " 49.8% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [167.059611, "o", " 49.9% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [167.074996, "o", " 50.0% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [167.105621, "o", " 50.1% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [167.121448, "o", " 50.2% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [167.137932, "o", " 50.3% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [167.15341, "o", " 50.4% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [167.195728, "o", " 50.5% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [167.210778, "o", " 50.6% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [167.227386, "o", " 50.7% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [167.242559, "o", " 50.8% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [167.257732, "o", " 50.9% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [167.272797, "o", " 51.0% Processing: Wallpaper/bigcollection/Man...elbox_-_Variable_8K_6595424.jpg\r"] [167.309495, "o", " 51.1% Processing: Wallpaper/bigcollection/Men...ox_OpenCL_14048152404910_8K.jpg\r"] [167.325907, "o", " 51.2% Processing: Wallpaper/bigcollection/Men...ox_OpenCL_14048152404910_8K.jpg\r"] [167.342154, "o", " 51.3% Processing: Wallpaper/bigcollection/Men...ox_OpenCL_14048152404910_8K.jpg\r"] [167.359718, "o", " 51.4% Processing: Wallpaper/bigcollection/Men...ox_OpenCL_14048152404910_8K.jpg\r"] [167.398424, "o", " 51.5% Processing: Wallpaper/bigcollection/Men...ox_OpenCL_14048152404910_8K.jpg\r"] [167.421304, "o", " 51.6% Processing: Wallpaper/bigcollection/Men...ox_OpenCL_14048152404910_8K.jpg\r"] [167.437025, "o", " 51.7% Processing: Wallpaper/bigcollection/Men...ox_OpenCL_14048152404910_8K.jpg\r"] [167.453464, "o", " 51.8% Processing: Wallpaper/bigcollection/Men...ox_OpenCL_14048152404910_8K.jpg\r"] [167.468683, "o", " 51.9% Processing: Wallpaper/bigcollection/Men...ox_OpenCL_14048152404910_8K.jpg\r"] [167.484422, "o", " 52.0% Processing: Wallpaper/bigcollection/Men...ox_OpenCL_14048152404910_8K.jpg\r"] [167.49948, "o", " 52.1% Processing: Wallpaper/bigcollection/Men...ox_OpenCL_14048152404910_8K.jpg\r"] [167.544858, "o", " 52.2% Processing: Wallpaper/bigcollection/Sie...er_4D_OpenCL_51241841541_8K.jpg\r"] [167.561287, "o", " 52.3% Processing: Wallpaper/bigcollection/Sie...er_4D_OpenCL_51241841541_8K.jpg\r"] [167.575551, "o", " 52.4% Processing: Wallpaper/bigcollection/Sie...er_4D_OpenCL_51241841541_8K.jpg\r"] [167.589573, "o", " 52.5% Processing: Wallpaper/bigcollection/Sie...er_4D_OpenCL_51241841541_8K.jpg\r"] [167.604085, "o", " 52.6% Processing: Wallpaper/bigcollection/Sie...er_4D_OpenCL_51241841541_8K.jpg\r"] [167.620028, "o", " 52.7% Processing: Wallpaper/bigcollection/Sie...er_4D_OpenCL_51241841541_8K.jpg\r"] [167.63516, "o", " 52.8% Processing: Wallpaper/bigcollection/Sie...er_4D_OpenCL_51241841541_8K.jpg\r"] [167.655216, "o", " 52.9% Processing: Wallpaper/bigcollection/Sie...er_4D_OpenCL_51241841541_8K.jpg\r"] [167.673546, "o", " 53.0% Processing: Wallpaper/bigcollection/Sie...er_4D_OpenCL_51241841541_8K.jpg\r"] [167.712002, "o", " 53.1% Processing: Wallpaper/bigcollection/Sie...er_4D_OpenCL_51241841541_8K.jpg\r"] [167.726797, "o", " 53.2% Processing: Wallpaper/bigcollection/Sie...er_4D_OpenCL_51241841541_8K.jpg\r"] [167.741734, "o", " 53.3% Processing: Wallpaper/bigcollection/Sie...er_4D_OpenCL_51241841541_8K.jpg\r"] [167.756963, "o", " 53.4% Processing: Wallpaper/bigcollection/Sie...er_4D_OpenCL_51241841541_8K.jpg\r"] [167.772975, "o", " 53.5% Processing: Wallpaper/bigcollection/Sie...er_4D_OpenCL_51241841541_8K.jpg\r"] [167.794887, "o", " 53.6% Processing: Wallpaper/bigcollection/Sie...er_4D_OpenCL_51241841541_8K.jpg\r"] [167.820943, "o", " 53.7% Processing: Wallpaper/bigcollection/Sie...er_4D_OpenCL_51241841541_8K.jpg\r"] [167.841302, "o", " 53.8% Processing: Wallpaper/bigcollection/Sie...er_4D_OpenCL_51241841541_8K.jpg\r"] [167.857191, "o", " 53.9% Processing: Wallpaper/bigcollection/Sie...er_4D_OpenCL_51241841541_8K.jpg\r"] [167.878906, "o", " 54.0% Processing: Wallpaper/bigcollection/Sie...er_4D_OpenCL_51241841541_8K.jpg\r"] [167.898181, "o", " 54.1% Processing: Wallpaper/bigcollection/Sie...er_4D_OpenCL_51241841541_8K.jpg\r"] [167.920781, "o", " 54.2% Processing: Wallpaper/bigcollection/Sie...er_4D_OpenCL_51241841541_8K.jpg\r"] [167.940917, "o", " 54.3% Processing: Wallpaper/bigcollection/Sie...er_4D_OpenCL_51241841541_8K.jpg\r"] [167.971271, "o", " 54.4% Processing: Wallpaper/bigcollection/Airbus_Wing_01798_changed.jpg \r"] [167.989545, "o", " 54.5% Processing: Wallpaper/bigcollection/Air..._Wing_01798_changed.jpg \r"] [168.003567, "o", " 54.6% Processing: Wallpaper/bigcollection/Air..._Wing_01798_changed.jpg \r"] [168.019075, "o", " 54.7% Processing: Wallpaper/bigcollection/Air..._Wing_01798_changed.jpg \r"] [168.032985, "o", " 54.8% Processing: Wallpaper/bigcollection/Air..._Wing_01798_changed.jpg \r"] [168.066013, "o", " 54.9% Processing: Wallpaper/bigcollection/Holytrinfruitlandpark1b.jpg \r"] [168.080007, "o", " 55.0% Processing: Wallpaper/bigcollection/Hol...infruitlandpark1b.jpg \r"] [168.095155, "o", " 55.1% Processing: Wallpaper/bigcollection/Hol...infruitlandpark1b.jpg \r"] [168.11164, "o", " 55.2% Processing: Wallpaper/bigcollection/Hol...infruitlandpark1b.jpg \r"] [168.149798, "o", " 55.3% Processing: Wallpaper/bigcollection/Abo...od_12_OpenCL_45184521485_5K.jpg\r"] [168.16731, "o", " 55.4% Processing: Wallpaper/bigcollection/Abo...od_12_OpenCL_45184521485_5K.jpg\r"] [168.182878, "o", " 55.5% Processing: Wallpaper/bigcollection/Abo...od_12_OpenCL_45184521485_5K.jpg\r"] [168.197377, "o", " 55.6% Processing: Wallpaper/bigcollection/Abo...od_12_OpenCL_45184521485_5K.jpg\r"] [168.212045, "o", " 55.7% Processing: Wallpaper/bigcollection/Abo...od_12_OpenCL_45184521485_5K.jpg\r"] [168.251289, "o", " 55.8% Processing: Wallpaper/bigcollection/Abo...od_12_OpenCL_45184521485_5K.jpg\r"] [168.267957, "o", " 55.9% Processing: Wallpaper/bigcollection/Abo...od_12_OpenCL_45184521485_5K.jpg\r"] [168.283528, "o", " 56.0% Processing: Wallpaper/bigcollection/Abo...od_12_OpenCL_45184521485_5K.jpg\r"] [168.299004, "o", " 56.1% Processing: Wallpaper/bigcollection/Abo...od_12_OpenCL_45184521485_5K.jpg\r"] [168.31406, "o", " 56.2% Processing: Wallpaper/bigcollection/Abo...od_12_OpenCL_45184521485_5K.jpg\r"] [168.329499, "o", " 56.3% Processing: Wallpaper/bigcollection/Abo...od_12_OpenCL_45184521485_5K.jpg\r"] [168.345926, "o", " 56.4% Processing: Wallpaper/bigcollection/Abo...od_12_OpenCL_45184521485_5K.jpg\r"] [168.366048, "o", " 56.5% Processing: Wallpaper/bigcollection/Abo...od_12_OpenCL_45184521485_5K.jpg\r"] [168.379607, "o", " 56.6% Processing: Wallpaper/bigcollection/Abo...od_12_OpenCL_45184521485_5K.jpg\r"] [168.400899, "o", " 56.7% Processing: Wallpaper/bigcollection/Abo...od_12_OpenCL_45184521485_5K.jpg\r"] [168.417018, "o", " 56.8% Processing: Wallpaper/bigcollection/Abo...od_12_OpenCL_45184521485_5K.jpg\r"] [168.450473, "o", " 56.9% Processing: Wallpaper/bigcollection/Abo...od_12_OpenCL_45184521485_5K.jpg\r"] [168.464717, "o", " 57.0% Processing: Wallpaper/bigcollection/Abo...od_12_OpenCL_45184521485_5K.jpg\r"] [168.479182, "o", " 57.1% Processing: Wallpaper/bigcollection/Abo...od_12_OpenCL_45184521485_5K.jpg\r"] [168.503588, "o", " 57.2% Processing: Wallpaper/bigcollection/Abo...od_12_OpenCL_45184521485_5K.jpg\r"] [168.524622, "o", " 57.3% Processing: Wallpaper/bigcollection/Abo...od_12_OpenCL_45184521485_5K.jpg\r"] [168.538213, "o", " 57.4% Processing: Wallpaper/bigcollection/Abo...od_12_OpenCL_45184521485_5K.jpg\r"] [168.639859, "o", " 57.5% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [168.655102, "o", " 57.6% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [168.671064, "o", " 57.7% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [168.686236, "o", " 57.8% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [168.703022, "o", " 57.9% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [168.717008, "o", " 58.0% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [168.733435, "o", " 58.1% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [168.748353, "o", " 58.2% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [168.764338, "o", " 58.3% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [168.777824, "o", " 58.4% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [168.793721, "o", " 58.5% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [168.808616, "o", " 58.6% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [168.823499, "o", " 58.7% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [168.839317, "o", " 58.8% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [168.852967, "o", " 58.9% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [168.869026, "o", " 59.0% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [168.883509, "o", " 59.1% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [168.900077, "o", " 59.2% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [168.914409, "o", " 59.3% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [168.930421, "o", " 59.4% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [168.945342, "o", " 59.5% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [168.999211, "o", " 59.6% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [169.016832, "o", " 59.7% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [169.031617, "o", " 59.8% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [169.046268, "o", " 59.9% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [169.061, "o", " 60.0% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [169.076713, "o", " 60.1% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [169.091634, "o", " 60.2% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [169.106464, "o", " 60.3% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [169.121532, "o", " 60.4% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [169.136652, "o", " 60.5% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [169.152763, "o", " 60.6% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [169.190922, "o", " 60.7% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [169.206963, "o", " 60.8% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [169.220276, "o", " 60.9% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [169.235989, "o", " 61.0% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [169.250363, "o", " 61.1% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [169.297467, "o", " 61.2% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [169.319013, "o", " 61.3% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [169.333854, "o", " 61.4% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [169.348863, "o", " 61.5% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [169.363703, "o", " 61.6% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [169.379802, "o", " 61.7% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [169.394659, "o", " 61.8% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [169.40965, "o", " 61.9% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [169.424664, "o", " 62.0% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [169.440895, "o", " 62.1% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [169.486794, "o", " 62.2% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [169.501244, "o", " 62.3% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [169.51593, "o", " 62.4% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [169.530869, "o", " 62.5% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [169.54712, "o", " 62.6% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [169.561963, "o", " 62.7% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [169.576793, "o", " 62.8% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [169.591753, "o", " 62.9% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [169.60768, "o", " 63.0% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [169.643056, "o", " 63.1% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [169.660544, "o", " 63.2% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [169.67538, "o", " 63.3% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [169.691966, "o", " 63.4% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [169.70663, "o", " 63.5% Processing: Wallpaper/bigcollection/Men...ternion_OpenCL_644289452_8K.jpg\r"] [169.724173, "o", " 63.6% Processing: Wallpaper/bigcollection/Gabrielsond.jpg \r"] [169.755422, "o", " 63.7% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [169.77475, "o", " 63.8% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [169.789891, "o", " 63.9% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [169.805116, "o", " 64.0% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [169.831568, "o", " 64.1% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [169.852789, "o", " 64.2% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [169.868043, "o", " 64.3% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [169.88704, "o", " 64.4% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [169.903364, "o", " 64.5% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [169.936235, "o", " 64.6% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [169.9512, "o", " 64.7% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [169.982339, "o", " 64.8% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [169.999446, "o", " 64.9% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.015661, "o", " 65.0% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.03056, "o", " 65.1% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.092201, "o", " 65.2% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.106882, "o", " 65.3% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.123126, "o", " 65.4% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.1399, "o", " 65.5% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.155076, "o", " 65.6% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.169973, "o", " 65.7% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.186293, "o", " 65.8% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.201513, "o", " 65.9% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.21664, "o", " 66.0% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.231604, "o", " 66.1% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.248006, "o", " 66.2% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.263039, "o", " 66.3% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.355062, "o", " 66.4% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.369727, "o", " 66.5% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.384513, "o", " 66.6% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.40045, "o", " 66.7% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.415694, "o", " 66.8% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.430163, "o", " 66.9% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.44498, "o", " 67.0% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.461066, "o", " 67.1% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.475821, "o", " 67.2% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.490933, "o", " 67.3% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.50695, "o", " 67.4% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.523218, "o", " 67.5% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.538283, "o", " 67.6% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.553378, "o", " 67.7% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.568527, "o", " 67.8% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.584645, "o", " 67.9% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.599594, "o", " 68.0% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.614904, "o", " 68.1% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.629862, "o", " 68.2% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.659018, "o", " 68.3% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.678932, "o", " 68.4% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.693859, "o", " 68.5% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.716413, "o", " 68.6% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.734956, "o", " 68.7% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.763419, "o", " 68.8% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.781631, "o", " 68.9% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.796773, "o", " 69.0% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.813144, "o", " 69.1% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.837495, "o", " 69.2% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.854888, "o", " 69.3% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.869913, "o", " 69.4% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.90722, "o", " 69.5% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.923005, "o", " 69.6% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.937825, "o", " 69.7% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.952976, "o", " 69.8% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.981995, "o", " 69.9% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [170.999233, "o", " 70.0% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [171.013875, "o", " 70.1% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [171.034083, "o", " 70.2% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [171.05009, "o", " 70.3% Processing: Wallpaper/bigcollection/Mix...schwamm_OpenCL_461481542_8K.jpg\r"] [171.071759, "o", " 70.4% Processing: Wallpaper/bigcollection/Bel..._hair_variant)_(16x9_ratio).jpg\r"] [171.101, "o", " 70.5% Processing: Wallpaper/bigcollection/Sie..._4D_OpenCL_2154188450481_8K.jpg\r"] [171.120041, "o", " 70.6% Processing: Wallpaper/bigcollection/Sie..._4D_OpenCL_2154188450481_8K.jpg\r"] [171.133117, "o", " 70.7% Processing: Wallpaper/bigcollection/Sie..._4D_OpenCL_2154188450481_8K.jpg\r"] [171.148628, "o", " 70.8% Processing: Wallpaper/bigcollection/Sie..._4D_OpenCL_2154188450481_8K.jpg\r"] [171.170476, "o", " 70.9% Processing: Wallpaper/bigcollection/Sie..._4D_OpenCL_2154188450481_8K.jpg\r"] [171.189523, "o", " 71.0% Processing: Wallpaper/bigcollection/Sie..._4D_OpenCL_2154188450481_8K.jpg\r"] [171.204942, "o", " 71.1% Processing: Wallpaper/bigcollection/Sie..._4D_OpenCL_2154188450481_8K.jpg\r"] [171.231339, "o", " 71.2% Processing: Wallpaper/bigcollection/Sie..._4D_OpenCL_2154188450481_8K.jpg\r"] [171.247225, "o", " 71.3% Processing: Wallpaper/bigcollection/Sie..._4D_OpenCL_2154188450481_8K.jpg\r"] [171.278438, "o", " 71.4% Processing: Wallpaper/bigcollection/Sie..._4D_OpenCL_2154188450481_8K.jpg\r"] [171.294749, "o", " 71.5% Processing: Wallpaper/bigcollection/Sie..._4D_OpenCL_2154188450481_8K.jpg\r"] [171.308543, "o", " 71.6% Processing: Wallpaper/bigcollection/Sie..._4D_OpenCL_2154188450481_8K.jpg\r"] [171.32423, "o", " 71.7% Processing: Wallpaper/bigcollection/Sie..._4D_OpenCL_2154188450481_8K.jpg\r"] [171.343463, "o", " 71.8% Processing: Wallpaper/bigcollection/Sie..._4D_OpenCL_2154188450481_8K.jpg\r"] [171.358279, "o", " 71.9% Processing: Wallpaper/bigcollection/Sie..._4D_OpenCL_2154188450481_8K.jpg\r"] [171.401928, "o", " 72.0% Processing: Wallpaper/bigcollection/Sie..._4D_OpenCL_2154188450481_8K.jpg\r"] [171.417339, "o", " 72.1% Processing: Wallpaper/bigcollection/Sie..._4D_OpenCL_2154188450481_8K.jpg\r"] [171.433765, "o", " 72.2% Processing: Wallpaper/bigcollection/Sie..._4D_OpenCL_2154188450481_8K.jpg\r"] [171.448139, "o", " 72.3% Processing: Wallpaper/bigcollection/Sie..._4D_OpenCL_2154188450481_8K.jpg\r"] [171.463803, "o", " 72.4% Processing: Wallpaper/bigcollection/Sie..._4D_OpenCL_2154188450481_8K.jpg\r"] [171.478013, "o", " 72.5% Processing: Wallpaper/bigcollection/Sie..._4D_OpenCL_2154188450481_8K.jpg\r"] [171.492003, "o", " 72.6% Processing: Wallpaper/bigcollection/Sie..._4D_OpenCL_2154188450481_8K.jpg\r"] [171.528374, "o", " 72.7% Processing: Wallpaper/bigcollection/Abox_4D_OpenCL_545185481_8K.jpg \r"] [171.544588, "o", " 72.8% Processing: Wallpaper/bigcollection/Abo...D_OpenCL_545185481_8K.jpg \r"] [171.559642, "o", " 72.9% Processing: Wallpaper/bigcollection/Abo...D_OpenCL_545185481_8K.jpg \r"] [171.573521, "o", " 73.0% Processing: Wallpaper/bigcollection/Abo...D_OpenCL_545185481_8K.jpg \r"] [171.587608, "o", " 73.1% Processing: Wallpaper/bigcollection/Abo...D_OpenCL_545185481_8K.jpg \r"] [171.6351, "o", " 73.2% Processing: Wallpaper/bigcollection/Abo...D_OpenCL_545185481_8K.jpg \r"] [171.652608, "o", " 73.3% Processing: Wallpaper/bigcollection/Abo...D_OpenCL_545185481_8K.jpg \r"] [171.666452, "o", " 73.4% Processing: Wallpaper/bigcollection/Abo...D_OpenCL_545185481_8K.jpg \r"] [171.680621, "o", " 73.5% Processing: Wallpaper/bigcollection/Abo...D_OpenCL_545185481_8K.jpg \r"] [171.69472, "o", " 73.6% Processing: Wallpaper/bigcollection/Abo...D_OpenCL_545185481_8K.jpg \r"] [171.709747, "o", " 73.7% Processing: Wallpaper/bigcollection/Abo...D_OpenCL_545185481_8K.jpg \r"] [171.723682, "o", " 73.8% Processing: Wallpaper/bigcollection/Abo...D_OpenCL_545185481_8K.jpg \r"] [171.738028, "o", " 73.9% Processing: Wallpaper/bigcollection/Abo...D_OpenCL_545185481_8K.jpg \r"] [171.752058, "o", " 74.0% Processing: Wallpaper/bigcollection/Abo...D_OpenCL_545185481_8K.jpg \r"] [171.76719, "o", " 74.1% Processing: Wallpaper/bigcollection/Abo...D_OpenCL_545185481_8K.jpg \r"] [171.790642, "o", " 74.2% Processing: Wallpaper/bigcollection/Abo...D_OpenCL_545185481_8K.jpg \r"] [171.820514, "o", " 74.3% Processing: Wallpaper/bigcollection/Abo...D_OpenCL_545185481_8K.jpg \r"] [171.834545, "o", " 74.4% Processing: Wallpaper/bigcollection/Abo...D_OpenCL_545185481_8K.jpg \r"] [171.849766, "o", " 74.5% Processing: Wallpaper/bigcollection/Abo...D_OpenCL_545185481_8K.jpg \r"] [171.863903, "o", " 74.6% Processing: Wallpaper/bigcollection/Abo...D_OpenCL_545185481_8K.jpg \r"] [171.923574, "o", " 74.7% Processing: Wallpaper/bigcollection/Abo...D_OpenCL_545185481_8K.jpg \r"] [171.942274, "o", " 74.8% Processing: Wallpaper/bigcollection/Abo...D_OpenCL_545185481_8K.jpg \r"] [171.957763, "o", " 74.9% Processing: Wallpaper/bigcollection/Abo...D_OpenCL_545185481_8K.jpg \r"] [171.971772, "o", " 75.0% Processing: Wallpaper/bigcollection/Abo...D_OpenCL_545185481_8K.jpg \r"] [171.986089, "o", " 75.1% Processing: Wallpaper/bigcollection/Abo...D_OpenCL_545185481_8K.jpg \r"] [172.000346, "o", " 75.2% Processing: Wallpaper/bigcollection/Abo...D_OpenCL_545185481_8K.jpg \r"] [172.015555, "o", " 75.3% Processing: Wallpaper/bigcollection/Abo...D_OpenCL_545185481_8K.jpg \r"] [172.029527, "o", " 75.4% Processing: Wallpaper/bigcollection/Abo...D_OpenCL_545185481_8K.jpg \r"] [172.043727, "o", " 75.5% Processing: Wallpaper/bigcollection/Abo...D_OpenCL_545185481_8K.jpg \r"] [172.057704, "o", " 75.6% Processing: Wallpaper/bigcollection/Abo...D_OpenCL_545185481_8K.jpg \r"] [172.072116, "o", " 75.7% Processing: Wallpaper/bigcollection/Abo...D_OpenCL_545185481_8K.jpg \r"] [172.087552, "o", " 75.8% Processing: Wallpaper/bigcollection/Abo...D_OpenCL_545185481_8K.jpg \r"] [172.102046, "o", " 75.9% Processing: Wallpaper/bigcollection/Abo...D_OpenCL_545185481_8K.jpg \r"] [172.147613, "o", " 76.0% Processing: Wallpaper/bigcollection/Abo...D_OpenCL_545185481_8K.jpg \r"] [172.161519, "o", " 76.1% Processing: Wallpaper/bigcollection/Abo...D_OpenCL_545185481_8K.jpg \r"] [172.176861, "o", " 76.2% Processing: Wallpaper/bigcollection/Abo...D_OpenCL_545185481_8K.jpg \r"] [172.191243, "o", " 76.3% Processing: Wallpaper/bigcollection/Abo...D_OpenCL_545185481_8K.jpg \r"] [172.205521, "o", " 76.4% Processing: Wallpaper/bigcollection/Abo...D_OpenCL_545185481_8K.jpg \r"] [172.219614, "o", " 76.5% Processing: Wallpaper/bigcollection/Abo...D_OpenCL_545185481_8K.jpg \r"] [172.235435, "o", " 76.6% Processing: Wallpaper/bigcollection/Abo...D_OpenCL_545185481_8K.jpg \r"] [172.335066, "o", " 76.7% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [172.349849, "o", " 76.8% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [172.365366, "o", " 76.9% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [172.381936, "o", " 77.0% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [172.397341, "o", " 77.1% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [172.412546, "o", " 77.2% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [172.427934, "o", " 77.3% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [172.444458, "o", " 77.4% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [172.459873, "o", " 77.5% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [172.475137, "o", " 77.6% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [172.490889, "o", " 77.7% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [172.507471, "o", " 77.8% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [172.522782, "o", " 77.9% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [172.537746, "o", " 78.0% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [172.553095, "o", " 78.1% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [172.568446, "o", " 78.2% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [172.585084, "o", " 78.3% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [172.600602, "o", " 78.4% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [172.616157, "o", " 78.5% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [172.636866, "o", " 78.6% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [172.656337, "o", " 78.7% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [172.676685, "o", " 78.8% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [172.695044, "o", " 78.9% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [172.795084, "o", " 79.0% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [172.811192, "o", " 79.1% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [172.826313, "o", " 79.2% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [172.841796, "o", " 79.3% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [172.857509, "o", " 79.4% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [172.873717, "o", " 79.5% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [172.888989, "o", " 79.6% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [172.904218, "o", " 79.7% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [172.920812, "o", " 79.8% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [172.936174, "o", " 79.9% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [172.951402, "o", " 80.0% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [172.966554, "o", " 80.1% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [172.981776, "o", " 80.2% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [172.998078, "o", " 80.3% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [173.017396, "o", " 80.4% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [173.034055, "o", " 80.5% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [173.049362, "o", " 80.6% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [173.065899, "o", " 80.7% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [173.081107, "o", " 80.8% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [173.097665, "o", " 80.9% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [173.111775, "o", " 81.0% Processing: Wallpaper/bigcollection/Sie...nski_4D_OpenCL_485274854_5K.jpg\r"] [173.148292, "o", " 81.1% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [173.165472, "o", " 81.2% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [173.181997, "o", " 81.3% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [173.198583, "o", " 81.4% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [173.216137, "o", " 81.5% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [173.245988, "o", " 81.6% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [173.262544, "o", " 81.7% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [173.278612, "o", " 81.8% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [173.313541, "o", " 81.9% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [173.333354, "o", " 82.0% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [173.349458, "o", " 82.1% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [173.366892, "o", " 82.2% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [173.381392, "o", " 82.3% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [173.416691, "o", " 82.4% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [173.433961, "o", " 82.5% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [173.451384, "o", " 82.6% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [173.467403, "o", " 82.7% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [173.516534, "o", " 82.8% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [173.531702, "o", " 82.9% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [173.547214, "o", " 83.0% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [173.564017, "o", " 83.1% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [173.578307, "o", " 83.2% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [173.595338, "o", " 83.3% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [173.610696, "o", " 83.4% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [173.627217, "o", " 83.5% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [173.653623, "o", " 83.6% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [173.669272, "o", " 83.7% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [173.684708, "o", " 83.8% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [173.727221, "o", " 83.9% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [173.746924, "o", " 84.0% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [173.762108, "o", " 84.1% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [173.777159, "o", " 84.2% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [173.792423, "o", " 84.3% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [173.80903, "o", " 84.4% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [173.82715, "o", " 84.5% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [173.847467, "o", " 84.6% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [173.922477, "o", " 84.7% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [173.939391, "o", " 84.8% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [173.956239, "o", " 84.9% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [173.971558, "o", " 85.0% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [173.988201, "o", " 85.1% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.002262, "o", " 85.2% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.018968, "o", " 85.3% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.034114, "o", " 85.4% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.051034, "o", " 85.5% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.065118, "o", " 85.6% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.08173, "o", " 85.7% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.097284, "o", " 85.8% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.112741, "o", " 85.9% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.129045, "o", " 86.0% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.184503, "o", " 86.1% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.206856, "o", " 86.2% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.223262, "o", " 86.3% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.239863, "o", " 86.4% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.253836, "o", " 86.5% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.270586, "o", " 86.6% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.286007, "o", " 86.7% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.30157, "o", " 86.8% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.318006, "o", " 86.9% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.333644, "o", " 87.0% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.350304, "o", " 87.1% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.36464, "o", " 87.2% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.389727, "o", " 87.3% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.407212, "o", " 87.4% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.422833, "o", " 87.5% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.453296, "o", " 87.6% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.467395, "o", " 87.7% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.520985, "o", " 87.8% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.533525, "o", " 87.9% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.55016, "o", " 88.0% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.56416, "o", " 88.1% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.580874, "o", " 88.2% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.596654, "o", " 88.3% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.614557, "o", " 88.4% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.628951, "o", " 88.5% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.645523, "o", " 88.6% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.660816, "o", " 88.7% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.675584, "o", " 88.8% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.704816, "o", " 88.9% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.722559, "o", " 89.0% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.737936, "o", " 89.1% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.756118, "o", " 89.2% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.77368, "o", " 89.3% Processing: Wallpaper/bigcollection/Ver...engerschwamm_OpenCl_6184524.jpg\r"] [174.799303, "o", " 89.4% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [174.832351, "o", " 89.5% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [174.845368, "o", " 89.6% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [174.863336, "o", " 89.7% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [174.879711, "o", " 89.8% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [174.896108, "o", " 89.9% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [174.916611, "o", " 90.0% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [174.939868, "o", " 90.1% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [174.956109, "o", " 90.2% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [174.980547, "o", " 90.3% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [174.99835, "o", " 90.4% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.024687, "o", " 90.5% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.042584, "o", " 90.6% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.075226, "o", " 90.7% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.090554, "o", " 90.8% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.107221, "o", " 90.9% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.148647, "o", " 91.0% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.163581, "o", " 91.1% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.178784, "o", " 91.2% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.193848, "o", " 91.3% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.210235, "o", " 91.4% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.22529, "o", " 91.5% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.280281, "o", " 91.6% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.295515, "o", " 91.7% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.31194, "o", " 91.8% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.327947, "o", " 91.9% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.342733, "o", " 92.0% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.357877, "o", " 92.1% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.374404, "o", " 92.2% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.388429, "o", " 92.3% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.40491, "o", " 92.4% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.425357, "o", " 92.5% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.442092, "o", " 92.6% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.483321, "o", " 92.7% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.498389, "o", " 92.8% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.513452, "o", " 92.9% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.530094, "o", " 93.0% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.545353, "o", " 93.1% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.579634, "o", " 93.2% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.593214, "o", " 93.3% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.609788, "o", " 93.4% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.625037, "o", " 93.5% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.640266, "o", " 93.6% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.656135, "o", " 93.7% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.688247, "o", " 93.8% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.703239, "o", " 93.9% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.718576, "o", " 94.0% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.754452, "o", " 94.1% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.769853, "o", " 94.2% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.770073, "o", "\r\n"] [175.784359, "o", " 94.3% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.800622, "o", " 94.4% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.815985, "o", " 94.5% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.837175, "o", " 94.6% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.857703, "o", " 94.7% Processing: Wallpaper/bigcollection/Men...schwamm_OpenCL_955141845_8K.jpg\r"] [175.942193, "o", " 94.8% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [175.961827, "o", " 94.9% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [175.97792, "o", " 95.0% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [175.995471, "o", " 95.1% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.01187, "o", " 95.2% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.028298, "o", " 95.3% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.045597, "o", " 95.4% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.060698, "o", " 95.5% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.078263, "o", " 95.6% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.093876, "o", " 95.7% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.10991, "o", " 95.8% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.125699, "o", " 95.9% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.142577, "o", " 96.0% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.158303, "o", " 96.1% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.173966, "o", " 96.2% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.190604, "o", " 96.3% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.206311, "o", " 96.4% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.222587, "o", " 96.5% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.238229, "o", " 96.6% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.259845, "o", " 96.7% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.276799, "o", " 96.8% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.301942, "o", " 96.9% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.31995, "o", " 97.0% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.350236, "o", " 97.1% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.37165, "o", " 97.2% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.387226, "o", " 97.3% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.402999, "o", " 97.4% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.418169, "o", " 97.5% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.511296, "o", " 97.6% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.526762, "o", " 97.7% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.542462, "o", " 97.8% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.558234, "o", " 97.9% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.575231, "o", " 98.0% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.590746, "o", " 98.1% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.606485, "o", " 98.2% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.622891, "o", " 98.3% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.636901, "o", " 98.4% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.653178, "o", " 98.5% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.667977, "o", " 98.6% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.68731, "o", " 98.7% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.70233, "o", " 98.8% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.718126, "o", " 98.9% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.733087, "o", " 99.0% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.748853, "o", " 99.1% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.765928, "o", " 99.2% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.78199, "o", " 99.3% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.797818, "o", " 99.4% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.813269, "o", " 99.5% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.847059, "o", " 99.6% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.865025, "o", " 99.7% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.881058, "o", " 99.8% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.89715, "o", " 99.9% Processing: Wallpaper/bigcollection/Fre...ial_projects._(14168975789).jpg\r"] [176.913918, "o", " \r"] [176.990837, "o", "$ #"] [177.002124, "o", " "] [177.031029, "o", "Y"] [177.07908, "o", "o"] [177.091476, "o", "u"] [177.155024, "o", " "] [177.179734, "o", "c"] [177.207211, "o", "a"] [177.22278, "o", "n"] [177.27989, "o", " "] [177.292519, "o", "m"] [177.326473, "o", "o"] [177.341919, "o", "u"] [177.40636, "o", "n"] [177.415817, "o", "t"] [177.425138, "o", " "] [177.469067, "o", "a"] [177.499804, "o", "n"] [177.509376, "o", " "] [177.539022, "o", "a"] [177.637345, "o", "r"] [177.665967, "o", "c"] [177.711071, "o", "h"] [177.852891, "o", "i"] [177.875061, "o", "v"] [177.996486, "o", "e"] [178.014829, "o", " "] [178.139564, "o", "o"] [178.153, "o", "r"] [178.340782, "o", " "] [178.431104, "o", "e"] [178.554985, "o", "v"] [178.640138, "o", "e"] [178.653782, "o", "n"] [178.68707, "o", " "] [178.696599, "o", "t"] [178.73106, "o", "h"] [178.785567, "o", "e"] [178.815053, "o", " "] [178.882046, "o", "w"] [178.891573, "o", "h"] [178.922301, "o", "o"] [178.934767, "o", "l"] [178.944116, "o", "e"] [179.14435, "o", " "] [179.153748, "o", "r"] [179.165375, "o", "e"] [179.182938, "o", "p"] [179.19851, "o", "o"] [179.211035, "o", "s"] [179.273267, "o", "i"] [179.282781, "o", "t"] [179.313448, "o", "o"] [179.323019, "o", "r"] [179.334972, "o", "y"] [179.503097, "o", ":"] [179.680855, "o", "\r\ntotal 821176\r\r\ndrwxr-xr-x 3 root root 4096 Jul 6 21:30 Wallpaper\r\r\ndrwxr-xr-x 3 root root 4096 Jul 6 21:28 Wallpaper.orig\r\r\n-rw------- 1 root root 398438415 Jul 6 21:33 backup.tar.gz\r\r\n-rw-r--r-- 1 root root 22929200 Jun 5 21:42 borg-linux64\r\r\n-rw-r--r-- 1 root root 862 Jun 5 21:42 borg-linux64.asc\r\r\n-rw------- 1 root root 66582 Jul 6 21:32 file.html\r\r\n-rw-r--r-- 1 root root 419430400 Jul 6 21:30 loopbackfile.img\r\r\n$ $ $ m"] [179.746167, "o", "k"] [179.758958, "o", "d"] [179.768486, "o", "i"] [179.791088, "o", "r"] [179.991469, "o", " "] [180.098874, "o", "/"] [180.119267, "o", "t"] [180.260824, "o", "m"] [180.320436, "o", "p"] [180.486884, "o", "/"] [180.510496, "o", "m"] [180.570831, "o", "o"] [180.5904, "o", "u"] [180.623022, "o", "n"] [180.632463, "o", "t"] [180.671542, "o", "\r\nb"] [180.774426, "o", "o"] [180.796051, "o", "r"] [180.843047, "o", "g"] [180.861582, "o", " "] [180.909768, "o", "m"] [180.959072, "o", "o"] [181.012766, "o", "u"] [181.050466, "o", "n"] [181.059659, "o", "t"] [181.125752, "o", " "] [181.171124, "o", ":"] [181.225894, "o", ":"] [181.256531, "o", " "] [181.303266, "o", "/"] [181.315278, "o", "t"] [181.343582, "o", "m"] [181.371377, "o", "p"] [181.439985, "o", "/"] [181.46064, "o", "m"] [181.479426, "o", "o"] [181.56903, "o", "u"] [181.578686, "o", "n"] [181.651202, "o", "t"] [181.70471, "o", "\r\nl"] [181.735837, "o", "s"] [181.867009, "o", " "] [181.92209, "o", "-"] [181.947235, "o", "l"] [182.02963, "o", "a"] [182.038794, "o", " "] [182.053892, "o", "/"] [182.062896, "o", "t"] [182.119006, "o", "m"] [182.130552, "o", "p"] [182.211559, "o", "/"] [182.230681, "o", "m"] [182.282454, "o", "o"] [182.291818, "o", "u"] [182.301301, "o", "n"] [182.31049, "o", "t"] [182.368951, "o", "\r\n"] [182.369429, "o", "$ b"] [182.413573, "o", "o"] [182.423034, "o", "r"] [182.598887, "o", "g"] [182.751119, "o", " "] [182.783431, "o", "u"] [182.796922, "o", "m"] [182.806458, "o", "o"] [182.843154, "o", "u"] [182.935406, "o", "n"] [183.062912, "o", "t"] [183.099442, "o", " "] [183.113601, "o", "/"] [183.135259, "o", "t"] [183.175463, "o", "m"] [183.247234, "o", "p"] [183.256812, "o", "/"] [183.384711, "o", "m"] [183.427408, "o", "o"] [183.436978, "o", "u"] [183.599101, "o", "n"] [183.632998, "o", "t"] [183.702153, "o", "\r\n$ total 4\r"] [183.702958, "o", "\r\ndrwxr-xr-x 1 root root 0 Jul 6 21:33 .\r\r\ndrwxrwxrwt 10 root root 4096 Jul 6 21:33 ..\r\r\ndrwxr-xr-x 1 root root 0 Jul 6 21:31 backup-block-device\r\r\ndrwxr-xr-x 1 root root 0 Jul 6 21:30 backup1\r\r\ndrwxr-xr-x 1 root root 0 Jul 6 21:30 backup2\r\r\n"] [183.70361, "o", "drwxr-xr-x 1 root root 0 Jul 6 21:30 backup3\r\r\ndrwxr-xr-x 1 root root 0 Jul 6 21:31 root-2022-07-06T21:31:12\r\r\ndrwxr-xr-x 1 root root 0 Jul 6 21:31 root-2022-07-06T21:31:28\r\r\n$ \r\n"] [183.704007, "o", "#"] [183.782891, "o", " "] [183.825479, "o", "T"] [183.938756, "o", "h"] [184.065807, "o", "a"] [184.095759, "o", "t"] [184.106989, "o", "'"] [184.172356, "o", "s"] [184.333635, "o", " "] [184.450955, "o", "i"] [184.482269, "o", "t"] [184.568569, "o", ","] [184.589754, "o", " "] [184.650885, "o", "b"] [184.680299, "o", "u"] [184.730828, "o", "t"] [184.768041, "o", " "] [184.791356, "o", "o"] [184.849649, "o", "f"] [184.932911, "o", " "] [184.966199, "o", "c"] [184.977311, "o", "o"] [184.986748, "o", "u"] [185.020926, "o", "r"] [185.13723, "o", "s"] [185.189548, "o", "e"] [185.230866, "o", " "] [185.331133, "o", "t"] [185.454426, "o", "h"] [185.544653, "o", "e"] [185.586996, "o", "r"] [185.653352, "o", "e"] [185.701637, "o", " "] [185.710915, "o", "i"] [185.7361, "o", "s"] [185.745458, "o", " "] [185.769768, "o", "m"] [185.805076, "o", "o"] [185.886372, "o", "r"] [185.896491, "o", "e"] [185.948792, "o", " "] [185.958167, "o", "t"] [186.029468, "o", "o"] [186.104744, "o", " "] [186.139952, "o", "e"] [186.340348, "o", "x"] [186.349559, "o", "p"] [186.435894, "o", "l"] [186.458035, "o", "o"] [186.506422, "o", "r"] [186.515622, "o", "e"] [186.707953, "o", ","] [186.79823, "o", " "] [186.812457, "o", "s"] [186.821601, "o", "o"] [186.892955, "o", " "] [186.951022, "o", "h"] [186.964333, "o", "a"] [186.973626, "o", "v"] [187.018026, "o", "e"] [187.201321, "o", " "] [187.264622, "o", "a"] [187.302927, "o", " "] [187.314958, "o", "l"] [187.366361, "o", "o"] [187.429373, "o", "o"] [187.446645, "o", "k"] [187.455846, "o", " "] [187.656118, "o", "a"] [187.759311, "o", "t"] [187.959528, "o", " "] [187.98579, "o", "t"] [188.042958, "o", "h"] [188.078209, "o", "e"] [188.278473, "o", " "] [188.289572, "o", "d"] [188.323028, "o", "o"] [188.425315, "o", "c"] [188.43457, "o", "s"] [188.532843, "o", "."] [188.567197, "o", "\r\n"] [188.567499, "o", "$ $ "] ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/misc/asciinema/advanced.tcl0000644000076500000240000000616714641074756020325 0ustar00twstaff# Configuration for send -h # Tries to emulate a human typing # Tweak this if typing is too fast or too slow set send_human {.05 .1 1 .01 .2} set script { # For the pro users, here are some advanced features of borg, so you can impress your friends. ;) # Note: This screencast was made with __BORG_VERSION__ – older or newer borg versions may behave differently. # First of all, we can use several environment variables for borg. # E.g. we do not want to type in our repo path and password again and again… export BORG_REPO='/media/backup/borgdemo' export BORG_PASSPHRASE='1234' # Problem solved, borg will use this automatically… :) # We'll use this right away… ## ADVANCED CREATION ## # We can also use some placeholders in our archive name… borg create --stats --progress --compression lz4 ::{user}-{now} Wallpaper # Notice the backup name. # And we can put completely different data, with different backup settings, in our backup. It will be deduplicated, anyway: borg create --stats --progress --compression zlib,6 --exclude ~/Downloads/big ::{user}-{now} ~/Downloads # Or let's backup a device via STDIN. sudo dd if=/dev/loop0 bs=10M | borg create --progress --stats ::specialbackup - # Let's continue with some simple things: ## USEFUL COMMANDS ## # You can show some information about an archive. You can even do it without needing to specify the archive name: borg info :: --last 1 # So let's rename our last archive: borg rename ::specialbackup backup-block-device borg info :: --last 1 # A very important step if you choose keyfile mode (where the keyfile is only saved locally) is to export your keyfile and possibly print it, etc. borg key export --qr-html :: file.html # this creates a nice HTML, but when you want something simpler… borg key export --paper :: # this is a "manual input"-only backup (but it is also included in the --qr-code option) ## MAINTENANCE ## # Sometimes backups get broken or we want a regular "checkup" that everything is okay… borg check -v :: # Next problem: Usually you do not have infinite disk space. So you may need to prune your archive… # You can tune this in every detail. See the docs for details. Here only a simple example: borg prune --list --keep-last 1 --dry-run # When actually executing it in a script, you have to use it without the --dry-run option, of course. ## RESTORE ## # When you want to see the diff between two archives use this command. # E.g. what happened between the first two backups? borg diff ::backup1 backup2 # Ah, we added a file, right… # There are also other ways to extract the data. # E.g. as a tar archive. borg export-tar --progress ::backup2 backup.tar.gz ls -l # You can mount an archive or even the whole repository: mkdir /tmp/mount borg mount :: /tmp/mount ls -la /tmp/mount borg umount /tmp/mount # That's it, but of course there is more to explore, so have a look at the docs. } set script [string trim $script] set script [string map [list __BORG_VERSION__ [exec borg -V]] $script] set script [split $script \n] set ::env(PS1) "$ " set stty_init -echo spawn -noecho /bin/sh foreach line $script { expect "$ " send_user -h $line\n send $line\n } expect "$ " ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/misc/asciinema/basic.json0000644000076500000240000022017514641074756020025 0ustar00twstaff{"version": 2, "width": 80, "height": 24, "timestamp": 1657142858, "env": {"SHELL": "/bin/bash", "TERM": "vt100"}} [0.901997, "o", "$ #"] [0.911859, "o", " "] [0.945252, "o", "H"] [1.145466, "o", "e"] [1.219717, "o", "r"] [1.32403, "o", "e"] [1.380192, "o", " "] [1.430453, "o", "y"] [1.440629, "o", "o"] [1.477854, "o", "u"] [1.592158, "o", "'"] [1.604339, "o", "l"] [1.667607, "o", "l"] [1.740872, "o", " "] [1.762133, "o", "s"] [1.783381, "o", "e"] [1.823622, "o", "e"] [1.914891, "o", " "] [1.942144, "o", "s"] [2.003381, "o", "o"] [2.012556, "o", "m"] [2.061939, "o", "e"] [2.071228, "o", " "] [2.15549, "o", "b"] [2.326771, "o", "a"] [2.387008, "o", "s"] [2.449353, "o", "i"] [2.474589, "o", "c"] [2.674869, "o", " "] [2.697142, "o", "c"] [2.719411, "o", "o"] [2.753587, "o", "m"] [2.766854, "o", "m"] [2.815101, "o", "a"] [2.830358, "o", "n"] [2.903606, "o", "d"] [2.918861, "o", "s"] [2.982125, "o", " "] [3.008327, "o", "t"] [3.020509, "o", "o"] [3.165753, "o", " "] [3.174937, "o", "s"] [3.204287, "o", "t"] [3.237478, "o", "a"] [3.261594, "o", "r"] [3.338838, "o", "t"] [3.430109, "o", " "] [3.569377, "o", "w"] [3.593565, "o", "o"] [3.670838, "o", "r"] [3.697097, "o", "k"] [3.714347, "o", "i"] [3.724362, "o", "n"] [3.757578, "o", "g"] [3.957829, "o", " "] [4.086061, "o", "w"] [4.096274, "o", "i"] [4.141494, "o", "t"] [4.160749, "o", "h"] [4.180015, "o", " "] [4.245245, "o", "b"] [4.275507, "o", "o"] [4.304763, "o", "r"] [4.465051, "o", "g"] [4.474258, "o", "."] [4.537729, "o", "\r\n"] [4.543921, "o", "$ #"] [4.565316, "o", " "] [4.575589, "o", "N"] [4.696831, "o", "o"] [4.738093, "o", "t"] [4.801261, "o", "e"] [4.810475, "o", ":"] [4.819702, "o", " "] [4.830927, "o", "T"] [4.855195, "o", "h"] [4.89738, "o", "i"] [4.939628, "o", "s"] [4.948905, "o", " "] [5.013207, "o", "t"] [5.02248, "o", "e"] [5.057704, "o", "a"] [5.135974, "o", "s"] [5.155228, "o", "e"] [5.229419, "o", "r"] [5.341645, "o", " "] [5.350881, "o", "s"] [5.521412, "o", "c"] [5.536707, "o", "r"] [5.545931, "o", "e"] [5.668293, "o", "e"] [5.741519, "o", "n"] [5.783892, "o", "c"] [5.793081, "o", "a"] [5.858403, "o", "s"] [5.910676, "o", "t"] [6.096058, "o", " "] [6.126284, "o", "w"] [6.198546, "o", "a"] [6.277777, "o", "s"] [6.293117, "o", " "] [6.313411, "o", "m"] [6.349414, "o", "a"] [6.358599, "o", "d"] [6.36784, "o", "e"] [6.434105, "o", " "] [6.452354, "o", "w"] [6.481555, "o", "i"] [6.490802, "o", "t"] [6.499992, "o", "h"] [6.519263, "o", " "] [6.682501, "o", "b"] [6.711788, "o", "o"] [6.779036, "o", "r"] [6.788232, "o", "g"] [6.813434, "o", " "] [6.839723, "o", "1"] [6.848893, "o", "."] [7.008256, "o", "2"] [7.068455, "o", "."] [7.077624, "o", "1"] [7.179898, "o", " "] [7.192112, "o", "–"] [7.227365, "o", " "] [7.301542, "o", "o"] [7.364789, "o", "l"] [7.496018, "o", "d"] [7.544279, "o", "e"] [7.694535, "o", "r"] [7.81182, "o", " "] [7.822025, "o", "o"] [7.83126, "o", "r"] [7.988502, "o", " "] [8.019762, "o", "n"] [8.028979, "o", "e"] [8.146233, "o", "w"] [8.301411, "o", "e"] [8.310614, "o", "r"] [8.353893, "o", " "] [8.43015, "o", "b"] [8.444415, "o", "o"] [8.461635, "o", "r"] [8.529875, "o", "g"] [8.652126, "o", " "] [8.661253, "o", "v"] [8.740513, "o", "e"] [8.872782, "o", "r"] [8.884992, "o", "s"] [8.934245, "o", "i"] [8.987505, "o", "o"] [9.016764, "o", "n"] [9.058061, "o", "s"] [9.093246, "o", " "] [9.148492, "o", "m"] [9.157691, "o", "a"] [9.166916, "o", "y"] [9.184181, "o", " "] [9.257366, "o", "b"] [9.288631, "o", "e"] [9.297848, "o", "h"] [9.328139, "o", "a"] [9.379388, "o", "v"] [9.390641, "o", "e"] [9.399821, "o", " "] [9.507092, "o", "d"] [9.519377, "o", "i"] [9.57966, "o", "f"] [9.670911, "o", "f"] [9.689196, "o", "e"] [9.698414, "o", "r"] [9.722689, "o", "e"] [9.741948, "o", "n"] [9.751156, "o", "t"] [9.760393, "o", "l"] [9.769577, "o", "y"] [9.969826, "o", "."] [10.032, "o", "\r\n"] [10.038957, "o", "$ #"] [10.048219, "o", " "] [10.057455, "o", "B"] [10.0818, "o", "u"] [10.128106, "o", "t"] [10.237374, "o", " "] [10.295841, "o", "l"] [10.305257, "o", "e"] [10.341361, "o", "t"] [10.417542, "o", "'"] [10.429003, "o", "s"] [10.461357, "o", " "] [10.661763, "o", "s"] [10.671353, "o", "t"] [10.706527, "o", "a"] [10.733207, "o", "r"] [10.750995, "o", "t"] [10.829478, "o", "."] [10.847759, "o", "\r\n"] [10.853699, "o", "$ \r\n"] [10.857297, "o", "$ #"] [10.974637, "o", " "] [11.021433, "o", "F"] [11.030913, "o", "i"] [11.048388, "o", "r"] [11.106915, "o", "s"] [11.11632, "o", "t"] [11.140345, "o", " "] [11.204803, "o", "o"] [11.313637, "o", "f"] [11.429012, "o", " "] [11.442311, "o", "a"] [11.451818, "o", "l"] [11.529721, "o", "l"] [11.579317, "o", ","] [11.607295, "o", " "] [11.619676, "o", "y"] [11.714946, "o", "o"] [11.729578, "o", "u"] [11.860181, "o", " "] [11.884661, "o", "c"] [11.897179, "o", "a"] [11.97332, "o", "n"] [11.989804, "o", " "] [12.009297, "o", "a"] [12.025623, "o", "l"] [12.069382, "o", "w"] [12.117614, "o", "a"] [12.201573, "o", "y"] [12.251935, "o", "s"] [12.364579, "o", " "] [12.374052, "o", "g"] [12.413268, "o", "e"] [12.422739, "o", "t"] [12.623041, "o", " "] [12.670536, "o", "h"] [12.737348, "o", "e"] [12.821793, "o", "l"] [12.866273, "o", "p"] [12.893446, "o", ":"] [12.95329, "o", "\r\n"] [12.959698, "o", "$ b"] [12.99345, "o", "o"] [13.060998, "o", "r"] [13.149973, "o", "g"] [13.244305, "o", " "] [13.380017, "o", "h"] [13.389332, "o", "e"] [13.421149, "o", "l"] [13.430532, "o", "p"] [13.514054, "o", "\r\n"] [14.368385, "o", "usage: borg [-V] [-h] [--critical] [--error] [--warning] [--info] [--debug]"] [14.369035, "o", "\r\r\n"] [14.369334, "o", " [--debug-topic TOPIC] [-p] [--iec] [--log-json]"] [14.369527, "o", "\r\r\n"] [14.369709, "o", " [--lock-wait SECONDS] [--bypass-lock] [--show-version] [--show-rc]"] [14.36989, "o", "\r\r\n"] [14.370079, "o", " [--umask M] [--remote-path PATH] [--remote-ratelimit RATE]"] [14.370256, "o", "\r\r\n"] [14.370441, "o", " [--upload-ratelimit RATE] [--remote-buffer UPLOAD_BUFFER]"] [14.370624, "o", "\r\r\n"] [14.370801, "o", " [--upload-buffer UPLOAD_BUFFER] [--consider-part-files]"] [14.370976, "o", "\r\r\n"] [14.371151, "o", " [--debug-profile FILE] [--rsh RSH]"] [14.371358, "o", "\r\r\n"] [14.371536, "o", " ..."] [14.371713, "o", "\r\r\n"] [14.371888, "o", "\r\r\n"] [14.372204, "o", "Borg - Deduplicated Backups"] [14.372752, "o", "\r\r\n"] [14.373316, "o", "\r\r\n"] [14.373744, "o", "optional arguments:"] [14.374157, "o", "\r\r\n"] [14.374567, "o", " -V, --version show version number and exit"] [14.374875, "o", "\r\r\n"] [14.375184, "o", "\r\r\n"] [14.375501, "o", "Common options:"] [14.375811, "o", "\r\r\n"] [14.376121, "o", " -h, --help show this help message and exit"] [14.376429, "o", "\r\r\n"] [14.376733, "o", " --critical work on log level CRITICAL"] [14.377062, "o", "\r\r\n"] [14.37727, "o", " --error work on log level ERROR"] [14.37747, "o", "\r\r\n"] [14.377667, "o", " --warning work on log level WARNING (default)"] [14.377871, "o", "\r\r\n"] [14.378072, "o", " --info, -v, --verbose"] [14.378271, "o", "\r\r\n"] [14.378472, "o", " work on log level INFO"] [14.378671, "o", "\r\r\n"] [14.378873, "o", " --debug enable debug output, work on log level DEBUG"] [14.379071, "o", "\r\r\n"] [14.379314, "o", " --debug-topic TOPIC enable TOPIC debugging (can be specified multiple"] [14.379542, "o", "\r\r\n"] [14.379737, "o", " times). The logger path is borg.debug. if TOPIC"] [14.37995, "o", "\r\r\n"] [14.380162, "o", " is not fully qualified."] [14.380372, "o", "\r\r\n"] [14.380593, "o", " -p, --progress show progress information"] [14.38081, "o", "\r\r\n"] [14.381071, "o", " --iec format using IEC units (1KiB = 1024B)"] [14.381241, "o", "\r"] [14.381315, "o", "\r\n"] [14.381543, "o", " --log-json Output one JSON object per log line instead of"] [14.381761, "o", "\r"] [14.381844, "o", "\r\n"] [14.382072, "o", " formatted text."] [14.382294, "o", "\r"] [14.382368, "o", "\r\n"] [14.382586, "o", " --lock-wait SECONDS wait at most SECONDS for acquiring a repository/cache"] [14.382805, "o", "\r"] [14.382887, "o", "\r\n"] [14.383122, "o", " lock (default: 1)."] [14.383368, "o", "\r"] [14.383442, "o", "\r\n"] [14.383674, "o", " --bypass-lock Bypass locking mechanism"] [14.383904, "o", "\r"] [14.38399, "o", "\r\n"] [14.384227, "o", " --show-version show/log the borg version"] [14.38446, "o", "\r"] [14.384533, "o", "\r\n"] [14.384765, "o", " --show-rc show/log the return code (rc)"] [14.384993, "o", "\r"] [14.3851, "o", "\r\n"] [14.385332, "o", " --umask M set umask to M (local only, default: 0077)"] [14.38558, "o", "\r"] [14.385653, "o", "\r\n"] [14.38589, "o", " --remote-path PATH use PATH as borg executable on the remote (default:"] [14.386122, "o", "\r"] [14.386195, "o", "\r\n"] [14.386434, "o", " \"borg\")"] [14.386666, "o", "\r"] [14.386806, "o", "\r\n"] [14.387039, "o", " --remote-ratelimit RATE"] [14.387292, "o", "\r"] [14.387434, "o", "\r\n"] [14.387668, "o", " deprecated, use ``--upload-ratelimit`` instead"] [14.387898, "o", "\r"] [14.388037, "o", "\r\n"] [14.388279, "o", " --upload-ratelimit RATE"] [14.388509, "o", "\r"] [14.388648, "o", "\r\n"] [14.388884, "o", " set network upload rate limit in kiByte/s (default:"] [14.389135, "o", "\r"] [14.389273, "o", "\r\n"] [14.389509, "o", " "] [14.389743, "o", " 0=unlimited)"] [14.389979, "o", "\r"] [14.390123, "o", "\r\n"] [14.390378, "o", " --remote-buffer UPLOAD_BUFFER"] [14.390614, "o", "\r"] [14.390752, "o", "\r\n"] [14.390991, "o", " deprecated, use ``--upload-buffer`` instead"] [14.391273, "o", "\r"] [14.391422, "o", "\r\n"] [14.391661, "o", " --upload-buffer UPLOAD_BUFFER"] [14.391918, "o", "\r"] [14.392057, "o", "\r\n"] [14.392288, "o", " set network upload buffer size in MiB. (default: 0=no"] [14.39254, "o", "\r"] [14.392692, "o", "\r\n"] [14.392919, "o", " buffer)"] [14.393165, "o", "\r"] [14.393321, "o", "\r\n"] [14.39355, "o", " --consider-part-files"] [14.39378, "o", "\r"] [14.393956, "o", "\r\n"] [14.394208, "o", " treat part files like normal files (e.g. to"] [14.394468, "o", "\r"] [14.39462, "o", "\r\n"] [14.394868, "o", " list/extract them)"] [14.39511, "o", "\r"] [14.395272, "o", "\r\n"] [14.395511, "o", " --debug-profile FILE Write execution profile in Borg format into FILE. For"] [14.395745, "o", "\r"] [14.395915, "o", "\r\n"] [14.397106, "o", " local use a Python-compatible file can be generated by\r\r\n suffixing FILE with \".pyprof\".\r\r\n --rsh RSH Use this command to connect to the 'borg serve'\r\r\n process (default: 'ssh')\r\r\n\r\r\nrequired arguments:\r\r\n \r\r\n benchmark benchmark command\r\r\n break-lock break repository and cache locks\r\r\n check verify repository\r\r\n compact compact segment files / free space in repo\r\r\n config get and set configuration values\r\r\n create create backup\r\r\n debug debugging command (not intended for normal use)\r\r\n delete delete archive\r\r\n diff find differences in archive contents\r\r\n export-tar create tarball from archive\r\r\n extract extract archive contents\r\r\n info show repository or archive information\r\r\n init initialize empty repository\r\r\n k"] [14.397135, "o", "ey manage repository key\r\r\n list list archive or repository contents\r\r\n mount mount repository\r\r\n prune prune archives\r\r\n recreate Re-create archives\r\r\n rename rename archive\r\r\n serve start repository server process\r\r\n umount umount repository\r\r\n upgrade upgrade repository format\r\r\n with-lock run user command with lock held\r\r\n import-tar Create a backup archive from a tarball\r\r\n"] [14.44226, "o", "$ #"] [14.467585, "o", " "] [14.48689, "o", "T"] [14.561135, "o", "h"] [14.623399, "o", "e"] [14.66958, "o", "s"] [14.678779, "o", "e"] [14.689048, "o", " "] [14.69935, "o", "a"] [14.768546, "o", "r"] [14.807766, "o", "e"] [15.008011, "o", " "] [15.017332, "o", "a"] [15.104611, "o", " "] [15.204869, "o", "l"] [15.234109, "o", "o"] [15.252376, "o", "t"] [15.366682, "o", " "] [15.375836, "o", "o"] [15.39412, "o", "f"] [15.441422, "o", " "] [15.450632, "o", "c"] [15.52093, "o", "o"] [15.630962, "o", "m"] [15.750214, "o", "m"] [15.759497, "o", "a"] [15.845708, "o", "n"] [15.910964, "o", "d"] [15.957243, "o", "s"] [16.102504, "o", ","] [16.118774, "o", " "] [16.130979, "o", "s"] [16.266236, "o", "o"] [16.312506, "o", " "] [16.384774, "o", "b"] [16.437017, "o", "e"] [16.505236, "o", "t"] [16.612532, "o", "t"] [16.64879, "o", "e"] [16.781204, "o", "r"] [16.833255, "o", " "] [16.92251, "o", "w"] [17.053713, "o", "e"] [17.081033, "o", " "] [17.107308, "o", "s"] [17.185495, "o", "t"] [17.243755, "o", "a"] [17.277997, "o", "r"] [17.292215, "o", "t"] [17.35945, "o", " "] [17.439708, "o", "w"] [17.463952, "o", "i"] [17.506213, "o", "t"] [17.525383, "o", "h"] [17.558644, "o", " "] [17.572897, "o", "a"] [17.636143, "o", " "] [17.741311, "o", "f"] [17.810552, "o", "e"] [17.90177, "o", "w"] [18.005029, "o", ":"] [18.014935, "o", "\r\n"] [18.020184, "o", "$ #"] [18.063288, "o", " "] [18.072418, "o", "L"] [18.160547, "o", "e"] [18.360844, "o", "t"] [18.561132, "o", "'"] [18.593287, "o", "s"] [18.62653, "o", " "] [18.717781, "o", "c"] [18.826025, "o", "r"] [18.835218, "o", "e"] [18.873402, "o", "a"] [18.882603, "o", "t"] [18.899863, "o", "e"] [18.910079, "o", " "] [18.953439, "o", "a"] [19.11271, "o", " "] [19.133755, "o", "r"] [19.14299, "o", "e"] [19.16526, "o", "p"] [19.232505, "o", "o"] [19.286765, "o", " "] [19.346037, "o", "o"] [19.424305, "o", "n"] [19.481493, "o", " "] [19.616742, "o", "a"] [19.671994, "o", "n"] [19.692266, "o", " "] [19.766499, "o", "e"] [19.775721, "o", "x"] [19.975975, "o", "t"] [20.022241, "o", "e"] [20.05052, "o", "r"] [20.059738, "o", "n"] [20.071001, "o", "a"] [20.082205, "o", "l"] [20.091424, "o", " "] [20.148692, "o", "d"] [20.180965, "o", "r"] [20.236208, "o", "i"] [20.256457, "o", "v"] [20.278716, "o", "e"] [20.301976, "o", "…"] [20.333963, "o", "\r\n"] [20.339852, "o", "$ b"] [20.358126, "o", "o"] [20.442379, "o", "r"] [20.455655, "o", "g"] [20.510921, "o", " "] [20.565184, "o", "i"] [20.610429, "o", "n"] [20.619643, "o", "i"] [20.628869, "o", "t"] [20.638114, "o", " "] [20.794374, "o", "-"] [20.810588, "o", "-"] [20.88284, "o", "e"] [20.90811, "o", "n"] [20.940365, "o", "c"] [20.978597, "o", "r"] [21.01085, "o", "y"] [21.041143, "o", "p"] [21.162394, "o", "t"] [21.219624, "o", "i"] [21.242904, "o", "o"] [21.252069, "o", "n"] [21.358325, "o", "="] [21.369514, "o", "r"] [21.410761, "o", "e"] [21.433035, "o", "p"] [21.535257, "o", "o"] [21.649448, "o", "k"] [21.683731, "o", "e"] [21.77799, "o", "y"] [21.823212, "o", " "] [21.957402, "o", "/"] [22.088666, "o", "m"] [22.236898, "o", "e"] [22.24612, "o", "d"] [22.267377, "o", "i"] [22.314631, "o", "a"] [22.389887, "o", "/"] [22.406138, "o", "b"] [22.464386, "o", "a"] [22.486629, "o", "c"] [22.499854, "o", "k"] [22.569172, "o", "u"] [22.578364, "o", "p"] [22.630618, "o", "/"] [22.642925, "o", "b"] [22.698191, "o", "o"] [22.751434, "o", "r"] [22.780696, "o", "g"] [22.801933, "o", "d"] [22.822192, "o", "e"] [22.907435, "o", "m"] [22.938691, "o", "o"] [22.964601, "o", "\r\n"] [23.832422, "o", "Enter new passphrase: "] [25.486059, "o", "\r\r\n"] [25.487658, "o", "Enter same passphrase again: "] [26.856445, "o", "\r\r\n"] [26.857204, "o", "Do you want your passphrase to be displayed for verification? [yN]: \r\r\n"] [26.966484, "o", "\r\r\n"] [26.966685, "o", "By default repositories initialized with this version will produce security"] [26.966829, "o", "\r\r\n"] [26.966962, "o", "errors if written to with an older version (up to and including Borg 1.0.8)."] [26.967109, "o", "\r\r\n"] [26.967228, "o", "\r\r\n"] [26.967349, "o", "If you want to use these older versions, you can disable the check by running:"] [26.967488, "o", "\r\r\n"] [26.967607, "o", "borg upgrade --disable-tam /media/backup/borgdemo"] [26.96775, "o", "\r\r\n"] [26.967866, "o", "\r\r\n"] [26.968011, "o", "See https://borgbackup.readthedocs.io/en/stable/changes.html#pre-1-0-9-manifest-spoofing-vulnerability for details about the security implications."] [26.968147, "o", "\r\r\n"] [26.968375, "o", "\r\r\n"] [26.968503, "o", "IMPORTANT: you will need both KEY AND PASSPHRASE to access this repo!"] [26.968625, "o", "\r\r\n"] [26.968777, "o", "If you used a repokey mode, the key is stored in the repo, but you should back it up separately."] [26.968901, "o", "\r\r\n"] [26.969071, "o", "Use \"borg key export\" to export the key, optionally in printable format."] [26.969224, "o", "\r\r\n"] [26.969358, "o", "Write down the passphrase. Store both at safe place(s)."] [26.969507, "o", "\r\r\n"] [26.969633, "o", "\r\r\n"] [27.013625, "o", "$ #"] [27.13268, "o", " "] [27.147032, "o", "T"] [27.156512, "o", "h"] [27.177304, "o", "i"] [27.223151, "o", "s"] [27.27742, "o", " "] [27.286916, "o", "u"] [27.296388, "o", "s"] [27.325338, "o", "e"] [27.334603, "o", "s"] [27.359038, "o", " "] [27.369472, "o", "t"] [27.499665, "o", "h"] [27.521345, "o", "e"] [27.585341, "o", " "] [27.697371, "o", "r"] [27.706903, "o", "e"] [27.907207, "o", "p"] [27.920745, "o", "o"] [27.976277, "o", "k"] [28.085507, "o", "e"] [28.097114, "o", "y"] [28.293222, "o", " "] [28.302812, "o", "e"] [28.503212, "o", "n"] [28.554895, "o", "c"] [28.568404, "o", "r"] [28.769382, "o", "y"] [28.901385, "o", "p"] [28.961879, "o", "t"] [28.971352, "o", "i"] [29.017917, "o", "o"] [29.167349, "o", "n"] [29.34115, "o", "."] [29.46939, "o", " "] [29.509408, "o", "Y"] [29.518829, "o", "o"] [29.529334, "o", "u"] [29.585778, "o", " "] [29.613184, "o", "m"] [29.622616, "o", "a"] [29.677445, "o", "y"] [29.727828, "o", " "] [29.737091, "o", "l"] [29.807396, "o", "o"] [29.905617, "o", "o"] [29.971877, "o", "k"] [30.151165, "o", " "] [30.24344, "o", "a"] [30.432734, "o", "t"] [30.464016, "o", " "] [30.498308, "o", "\""] [30.508566, "o", "b"] [30.623871, "o", "o"] [30.66712, "o", "r"] [30.81244, "o", "g"] [30.890789, "o", " "] [30.974011, "o", "h"] [31.106339, "o", "e"] [31.119612, "o", "l"] [31.154894, "o", "p"] [31.278174, "o", " "] [31.325429, "o", "i"] [31.338742, "o", "n"] [31.377071, "o", "i"] [31.415261, "o", "t"] [31.494554, "o", "\""] [31.533795, "o", " "] [31.583029, "o", "o"] [31.652322, "o", "r"] [31.85262, "o", " "] [31.891954, "o", "t"] [31.901285, "o", "h"] [31.910553, "o", "e"] [31.959826, "o", " "] [32.090128, "o", "o"] [32.290413, "o", "n"] [32.299633, "o", "l"] [32.336944, "o", "i"] [32.383206, "o", "n"] [32.392447, "o", "e"] [32.476764, "o", " "] [32.485995, "o", "d"] [32.495203, "o", "o"] [32.526555, "o", "c"] [32.587775, "o", " "] [32.597044, "o", "a"] [32.673383, "o", "t"] [32.682665, "o", " "] [32.743954, "o", "h"] [32.823241, "o", "t"] [32.84252, "o", "t"] [32.868801, "o", "p"] [32.895065, "o", "s"] [32.974332, "o", ":"] [33.121548, "o", "/"] [33.183875, "o", "/"] [33.284921, "o", "b"] [33.300185, "o", "o"] [33.320424, "o", "r"] [33.368691, "o", "g"] [33.377904, "o", "b"] [33.431174, "o", "a"] [33.471457, "o", "c"] [33.480708, "o", "k"] [33.489935, "o", "u"] [33.522193, "o", "p"] [33.536454, "o", "."] [33.545628, "o", "r"] [33.620889, "o", "e"] [33.689179, "o", "a"] [33.698404, "o", "d"] [33.719676, "o", "t"] [33.768939, "o", "h"] [33.778141, "o", "e"] [33.822397, "o", "d"] [33.917604, "o", "o"] [34.021836, "o", "c"] [34.03105, "o", "s"] [34.231324, "o", "."] [34.274564, "o", "i"] [34.335814, "o", "o"] [34.359041, "o", "/"] [34.431296, "o", " "] [34.440495, "o", "f"] [34.477712, "o", "o"] [34.510921, "o", "r"] [34.603179, "o", " "] [34.628416, "o", "o"] [34.696681, "o", "t"] [34.758901, "o", "h"] [34.836318, "o", "e"] [34.905349, "o", "r"] [34.951592, "o", " "] [34.96081, "o", "m"] [35.073058, "o", "o"] [35.099305, "o", "d"] [35.144574, "o", "e"] [35.22482, "o", "s"] [35.268061, "o", "."] [35.277927, "o", "\r\n"] [35.283574, "o", "$ \r\n"] [35.287762, "o", "$ #"] [35.32211, "o", " "] [35.385009, "o", "S"] [35.401365, "o", "o"] [35.410748, "o", " "] [35.451919, "o", "n"] [35.461356, "o", "o"] [35.474934, "o", "w"] [35.536488, "o", ","] [35.570013, "o", " "] [35.631873, "o", "l"] [35.661368, "o", "e"] [35.670835, "o", "t"] [35.845321, "o", "'"] [36.021655, "o", "s"] [36.090853, "o", " "] [36.101264, "o", "c"] [36.110857, "o", "r"] [36.120334, "o", "e"] [36.241347, "o", "a"] [36.300965, "o", "t"] [36.339197, "o", "e"] [36.371614, "o", " "] [36.45487, "o", "o"] [36.466427, "o", "u"] [36.496514, "o", "r"] [36.516156, "o", " "] [36.525617, "o", "f"] [36.609341, "o", "i"] [36.628943, "o", "r"] [36.638409, "o", "s"] [36.6533, "o", "t"] [36.742041, "o", " "] [36.823533, "o", "("] [36.836112, "o", "c"] [36.891684, "o", "o"] [36.915431, "o", "m"] [36.937742, "o", "p"] [36.993129, "o", "r"] [37.038448, "o", "e"] [37.130855, "o", "s"] [37.14035, "o", "s"] [37.223271, "o", "e"] [37.273744, "o", "d"] [37.473926, "o", ")"] [37.549739, "o", " "] [37.559237, "o", "b"] [37.70135, "o", "a"] [37.759843, "o", "c"] [37.888108, "o", "k"] [37.985378, "o", "u"] [37.99491, "o", "p"] [38.057312, "o", "."] [38.070071, "o", "\r\n"] [38.076517, "o", "$ b"] [38.131758, "o", "o"] [38.176021, "o", "r"] [38.232284, "o", "g"] [38.290526, "o", " "] [38.299745, "o", "c"] [38.373041, "o", "r"] [38.391283, "o", "e"] [38.400486, "o", "a"] [38.422774, "o", "t"] [38.431987, "o", "e"] [38.477263, "o", " "] [38.557434, "o", "-"] [38.571684, "o", "-"] [38.635942, "o", "s"] [38.649196, "o", "t"] [38.696452, "o", "a"] [38.716708, "o", "t"] [38.74095, "o", "s"] [38.795156, "o", " "] [38.971421, "o", "-"] [38.980619, "o", "-"] [39.154846, "o", "p"] [39.259082, "o", "r"] [39.268286, "o", "o"] [39.295549, "o", "g"] [39.375798, "o", "r"] [39.505049, "o", "e"] [39.548298, "o", "s"] [39.55747, "o", "s"] [39.729698, "o", " "] [39.738886, "o", "-"] [39.770147, "o", "-"] [39.780361, "o", "c"] [39.851606, "o", "o"] [39.908862, "o", "m"] [39.9303, "o", "p"] [39.967419, "o", "r"] [40.167693, "o", "e"] [40.182868, "o", "s"] [40.236139, "o", "s"] [40.338402, "o", "i"] [40.387653, "o", "o"] [40.417878, "o", "n"] [40.431077, "o", " "] [40.440317, "o", "l"] [40.471602, "o", "z"] [40.50683, "o", "4"] [40.533153, "o", " "] [40.632398, "o", "/"] [40.765597, "o", "m"] [40.939842, "o", "e"] [41.013163, "o", "d"] [41.068403, "o", "i"] [41.161609, "o", "a"] [41.34683, "o", "/"] [41.35603, "o", "b"] [41.382307, "o", "a"] [41.420551, "o", "c"] [41.449776, "o", "k"] [41.461978, "o", "u"] [41.47121, "o", "p"] [41.505394, "o", "/"] [41.535648, "o", "b"] [41.553906, "o", "o"] [41.563104, "o", "r"] [41.572335, "o", "g"] [41.600598, "o", "d"] [41.621833, "o", "e"] [41.631044, "o", "m"] [41.690289, "o", "o"] [41.842576, "o", ":"] [41.9168, "o", ":"] [41.926071, "o", "b"] [41.939284, "o", "a"] [41.994532, "o", "c"] [42.006819, "o", "k"] [42.039076, "o", "u"] [42.048303, "o", "p"] [42.060532, "o", "1"] [42.102826, "o", " "] [42.207072, "o", "W"] [42.217211, "o", "a"] [42.226429, "o", "l"] [42.265646, "o", "l"] [42.344914, "o", "p"] [42.410163, "o", "a"] [42.436418, "o", "p"] [42.633625, "o", "e"] [42.64884, "o", "r"] [42.746842, "o", "\r\n"] [43.682327, "o", "Enter passphrase for key /media/backup/borgdemo: "] [45.082307, "o", "\r\r\n"] [45.169184, "o", "0 B O 0 B C 0 B D 0 N Wallpaper \r"] [45.187613, "o", "Initializing cache transaction: Reading config \r"] [45.188516, "o", "Initializing cache transaction: Reading chunks \r"] [45.189235, "o", "Initializing cache transaction: Reading files \r"] [45.189931, "o", " \r"] [45.382861, "o", "18.70 MB O 18.70 MB C 18.70 MB D 0 N Wallpaper/bigcolle...OpenCL_45154214_8K.jpg\r"] [45.589911, "o", "37.45 MB O 37.36 MB C 37.36 MB D 1 N Wallpaper/bigcolle...CL_528814521414_8K.jpg\r"] [45.792693, "o", "54.88 MB O 54.62 MB C 54.62 MB D 4 N Wallpaper/bigcolle...OpenCL_18915424_8K.jpg\r"] [46.015974, "o", "75.03 MB O 74.77 MB C 74.77 MB D 4 N Wallpaper/bigcolle...OpenCL_18915424_8K.jpg\r"] [46.256392, "o", "96.05 MB O 95.78 MB C 95.78 MB D 6 N Wallpaper/bigcolle...FS_OpenCL_54815_5K.jpg\r"] [46.475686, "o", "116.05 MB O 115.77 MB C 115.77 MB D 10 N Wallpaper/bigcol...CL_4258952414_8K.jpg\r"] [46.718361, "o", "138.21 MB O 137.93 MB C 137.93 MB D 10 N Wallpaper/bigcol...CL_4258952414_8K.jpg\r"] [46.933739, "o", "158.88 MB O 158.61 MB C 158.61 MB D 11 N Wallpaper/bigcol...CL_9648145412_8K.jpg\r"] [47.134629, "o", "177.87 MB O 177.59 MB C 177.59 MB D 11 N Wallpaper/bigcol...CL_9648145412_8K.jpg\r"] [47.337235, "o", "195.94 MB O 195.67 MB C 195.67 MB D 14 N Wallpaper/bigcol...iable_8K_6595424.jpg\r"] [47.56114, "o", "217.13 MB O 216.29 MB C 216.29 MB D 16 N Wallpaper/bigcol...L_51241841541_8K.jpg\r"] [47.769682, "o", "235.09 MB O 234.13 MB C 234.13 MB D 20 N Wallpaper/bigcol...nCL_644289452_8K.jpg\r"] [47.975793, "o", "252.58 MB O 251.62 MB C 251.62 MB D 20 N Wallpaper/bigcol...nCL_644289452_8K.jpg\r"] [48.183523, "o", "270.49 MB O 269.52 MB C 269.52 MB D 22 N Wallpaper/bigcol...nCL_461481542_8K.jpg\r"] [48.384239, "o", "288.97 MB O 287.80 MB C 287.80 MB D 24 N Wallpaper/bigcol...2154188450481_8K.jpg\r"] [48.587528, "o", "307.41 MB O 306.10 MB C 306.10 MB D 25 N Wallpaper/bigcol...nCL_545185481_8K.jpg\r"] [48.798353, "o", "326.35 MB O 324.95 MB C 324.95 MB D 27 N Wallpaper/bigcol...m_OpenCl_6184524.jpg\r"] [49.018803, "o", "347.31 MB O 345.91 MB C 345.91 MB D 27 N Wallpaper/bigcol...m_OpenCl_6184524.jpg\r"] [49.234361, "o", "366.64 MB O 365.24 MB C 365.24 MB D 28 N Wallpaper/bigcol...nCL_955141845_8K.jpg\r"] [49.438542, "o", "384.57 MB O 383.17 MB C 383.17 MB D 29 N Wallpaper/bigcol...s._(14168975789).jpg\r"] [49.616544, "o", " \r"] [49.707316, "o", "Saving files cache \r"] [49.708504, "o", "Saving chunks cache \r"] [49.709375, "o", "Saving cache config \r"] [49.711438, "o", " \r"] [49.713185, "o", "------------------------------------------------------------------------------\r\r\n"] [49.713432, "o", "Repository: /media/backup/borgdemo"] [49.713781, "o", "\r\r\n"] [49.713824, "o", "Archive name: backup1"] [49.714201, "o", "\r\r\nArchive fingerprint: 4b2f146af02ce3a4df8018411ce46d97fe7eaad0512c969a4bbcd4f113900746"] [49.71452, "o", "\r\r\nTime (start): Wed, 2022-07-06 21:28:23"] [49.714706, "o", "\r\r\n"] [49.715114, "o", "Time (end): Wed, 2022-07-06 21:28:28\r\r\n"] [49.715288, "o", "Duration: 4.45 seconds"] [49.715701, "o", "\r\r\nNumber of files: 31"] [49.715975, "o", "\r\r\n"] [49.716017, "o", "Utilization of max. archive size: 0%"] [49.716177, "o", "\r\r\n"] [49.716452, "o", "------------------------------------------------------------------------------"] [49.716679, "o", "\r\r\n"] [49.71705, "o", " Original size Compressed size Deduplicated size\r\r\n"] [49.717685, "o", "This archive: 401.15 MB 399.74 MB 399.55 MB\r\r\nAll archives: 401.15 MB 399.74 MB 399.56 MB\r\r\n\r\r\n Unique chunks Total chunks\r\r\nChunk index: 208 209\r\r\n"] [49.718032, "o", "------------------------------------------------------------------------------\r\r\n"] [49.763286, "o", "$ \r\n"] [49.769027, "o", "$ #"] [49.889538, "o", " "] [49.907123, "o", "T"] [49.98155, "o", "h"] [50.001932, "o", "a"] [50.077298, "o", "t"] [50.149538, "o", "'"] [50.265474, "o", "s"] [50.328143, "o", " "] [50.353649, "o", "n"] [50.376936, "o", "i"] [50.424241, "o", "c"] [50.433748, "o", "e"] [50.530161, "o", ","] [50.57866, "o", " "] [50.633469, "o", "s"] [50.652226, "o", "o"] [50.7495, "o", " "] [50.8277, "o", "f"] [50.85347, "o", "a"] [50.86547, "o", "r"] [50.897494, "o", "."] [51.013237, "o", "\r\n"] [51.019506, "o", "$ #"] [51.045786, "o", " "] [51.195486, "o", "S"] [51.225488, "o", "o"] [51.297491, "o", " "] [51.32406, "o", "l"] [51.333277, "o", "e"] [51.361489, "o", "t"] [51.391215, "o", "'"] [51.400666, "o", "s"] [51.525492, "o", " "] [51.534974, "o", "a"] [51.561475, "o", "d"] [51.575956, "o", "d"] [51.610233, "o", " "] [51.626877, "o", "a"] [51.753372, "o", " "] [51.806885, "o", "n"] [51.837461, "o", "e"] [51.846818, "o", "w"] [51.90324, "o", " "] [51.912612, "o", "f"] [51.945692, "o", "i"] [51.955259, "o", "l"] [51.976908, "o", "e"] [51.989371, "o", "…"] [52.09749, "o", "\r\n"] [52.104127, "o", "$ e"] [52.249858, "o", "c"] [52.381469, "o", "h"] [52.409548, "o", "o"] [52.429558, "o", " "] [52.450022, "o", "\""] [52.472755, "o", "n"] [52.494909, "o", "e"] [52.541666, "o", "w"] [52.621531, "o", " "] [52.657476, "o", "n"] [52.666897, "o", "i"] [52.749532, "o", "c"] [52.789582, "o", "e"] [52.857092, "o", " "] [52.901226, "o", "f"] [53.022805, "o", "i"] [53.091341, "o", "l"] [53.143908, "o", "e"] [53.34533, "o", "\""] [53.358764, "o", " "] [53.377334, "o", ">"] [53.424655, "o", " "] [53.434072, "o", "W"] [53.469238, "o", "a"] [53.479684, "o", "l"] [53.525369, "o", "l"] [53.569647, "o", "p"] [53.607808, "o", "a"] [53.640682, "o", "p"] [53.657289, "o", "e"] [53.741474, "o", "r"] [53.79733, "o", "/"] [53.933274, "o", "n"] [53.945655, "o", "e"] [53.993338, "o", "w"] [54.002684, "o", "f"] [54.024254, "o", "i"] [54.177552, "o", "l"] [54.228957, "o", "e"] [54.336453, "o", "."] [54.348932, "o", "t"] [54.377374, "o", "x"] [54.389764, "o", "t"] [54.531118, "o", "\r\n"] [54.538791, "o", "$ \r\n"] [54.541962, "o", "$ b"] [54.570224, "o", "o"] [54.597517, "o", "r"] [54.62934, "o", "g"] [54.680347, "o", " "] [54.708874, "o", "c"] [54.74704, "o", "r"] [54.789626, "o", "e"] [54.827188, "o", "a"] [54.836664, "o", "t"] [54.901889, "o", "e"] [55.102264, "o", " "] [55.128036, "o", "-"] [55.143576, "o", "-"] [55.169344, "o", "s"] [55.195965, "o", "t"] [55.291014, "o", "a"] [55.367836, "o", "t"] [55.388423, "o", "s"] [55.571545, "o", " "] [55.581105, "o", "-"] [55.604771, "o", "-"] [55.617271, "o", "p"] [55.717512, "o", "r"] [55.795014, "o", "o"] [55.889328, "o", "g"] [55.898787, "o", "r"] [56.099465, "o", "e"] [56.191812, "o", "s"] [56.282367, "o", "s"] [56.392067, "o", " "] [56.444626, "o", "-"] [56.453934, "o", "-"] [56.554258, "o", "c"] [56.661366, "o", "o"] [56.672796, "o", "m"] [56.690574, "o", "p"] [56.700005, "o", "r"] [56.76936, "o", "e"] [56.813887, "o", "s"] [57.01435, "o", "s"] [57.046765, "o", "i"] [57.061266, "o", "o"] [57.070634, "o", "n"] [57.143411, "o", " "] [57.169351, "o", "l"] [57.213313, "o", "z"] [57.237415, "o", "4"] [57.437721, "o", " "] [57.556322, "o", "/"] [57.569348, "o", "m"] [57.57873, "o", "e"] [57.588073, "o", "d"] [57.59747, "o", "i"] [57.740032, "o", "a"] [57.833541, "o", "/"] [57.910749, "o", "b"] [57.990587, "o", "a"] [58.03506, "o", "c"] [58.084774, "o", "k"] [58.110399, "o", "u"] [58.119855, "o", "p"] [58.129364, "o", "/"] [58.16133, "o", "b"] [58.272751, "o", "o"] [58.332329, "o", "r"] [58.384694, "o", "g"] [58.541406, "o", "d"] [58.593907, "o", "e"] [58.621372, "o", "m"] [58.640502, "o", "o"] [58.741339, "o", ":"] [58.792742, "o", ":"] [58.834033, "o", "b"] [58.913401, "o", "a"] [58.922796, "o", "c"] [59.073337, "o", "k"] [59.082618, "o", "u"] [59.101057, "o", "p"] [59.208574, "o", "2"] [59.217983, "o", " "] [59.233577, "o", "W"] [59.301331, "o", "a"] [59.396659, "o", "l"] [59.408194, "o", "l"] [59.437392, "o", "p"] [59.467902, "o", "a"] [59.668385, "o", "p"] [59.68178, "o", "e"] [59.766896, "o", "r"] [59.818201, "o", "\r\n"] [60.775328, "o", "Enter passphrase for key /media/backup/borgdemo: "] [62.286369, "o", "\r\r\n"] [62.373384, "o", "0 B O 0 B C 0 B D 0 N Wallpaper \r"] [62.374541, "o", "Initializing cache transaction: Reading config \r"] [62.375102, "o", "Initializing cache transaction: Reading chunks \r"] [62.37576, "o", "Initializing cache transaction: Reading files \r"] [62.376372, "o", " \r"] [62.390566, "o", " \r"] [62.405895, "o", "Saving files cache \r"] [62.407022, "o", "Saving chunks cache \r"] [62.407729, "o", "Saving cache config \r"] [62.409963, "o", " \r"] [62.41203, "o", "------------------------------------------------------------------------------\r\r\n"] [62.412335, "o", "Repository: /media/backup/borgdemo"] [62.412659, "o", "\r\r\n"] [62.412993, "o", "Archive name: backup2"] [62.413341, "o", "\r\r\n"] [62.413707, "o", "Archive fingerprint: 70d0bd96eb512ca96356308fb4aab162ae7d868c9fe491a36b1d8b00190e8e97"] [62.413751, "o", "\r\r\n"] [62.414127, "o", "Time (start): Wed, 2022-07-06 21:28:40"] [62.414342, "o", "\r\r\n"] [62.414764, "o", "Time (end): Wed, 2022-07-06 21:28:40"] [62.414975, "o", "\r\r\n"] [62.415392, "o", "Duration: 0.02 seconds"] [62.415608, "o", "\r\r\n"] [62.41596, "o", "Number of files: 32"] [62.416062, "o", "\r\r\n"] [62.416542, "o", "Utilization of max. archive size: 0%"] [62.416767, "o", "\r\r\n"] [62.417159, "o", "------------------------------------------------------------------------------"] [62.417305, "o", "\r\r\n"] [62.417746, "o", " Original size Compressed size Deduplicated size"] [62.417864, "o", "\r\r\n"] [62.418171, "o", "This archive: 401.15 MB 399.74 MB 604 B"] [62.418576, "o", "\r\r\n"] [62.418965, "o", "All archives: 802.29 MB 799.48 MB 399.57 MB"] [62.419161, "o", "\r\r\n"] [62.419577, "o", "\r\r\n"] [62.419938, "o", " Unique chunks Total chunks"] [62.420131, "o", "\r\r\n"] [62.420581, "o", "Chunk index: 211 419"] [62.420775, "o", "\r\r\n"] [62.421247, "o", "------------------------------------------------------------------------------"] [62.421462, "o", "\r\r\n"] [62.4692, "o", "$ \r\n"] [62.472497, "o", "$ #"] [62.48179, "o", " "] [62.651124, "o", "W"] [62.660372, "o", "o"] [62.786678, "o", "w"] [62.850953, "o", ","] [62.942261, "o", " "] [62.952488, "o", "t"] [63.093759, "o", "h"] [63.102987, "o", "i"] [63.150301, "o", "s"] [63.217527, "o", " "] [63.226846, "o", "w"] [63.286129, "o", "a"] [63.309429, "o", "s"] [63.364749, "o", " "] [63.425058, "o", "a"] [63.449431, "o", " "] [63.458651, "o", "l"] [63.467865, "o", "o"] [63.500253, "o", "t"] [63.573463, "o", " "] [63.616768, "o", "f"] [63.648075, "o", "a"] [63.692378, "o", "s"] [63.714715, "o", "t"] [63.829065, "o", "e"] [63.938338, "o", "r"] [64.13862, "o", "!"] [64.15888, "o", "\r\n"] [64.165067, "o", "$ #"] [64.215376, "o", " "] [64.241616, "o", "N"] [64.252934, "o", "o"] [64.294204, "o", "t"] [64.303462, "o", "i"] [64.332765, "o", "c"] [64.358045, "o", "e"] [64.36728, "o", " "] [64.391572, "o", "t"] [64.411851, "o", "h"] [64.467152, "o", "e"] [64.572418, "o", " "] [64.585626, "o", "\""] [64.594877, "o", "D"] [64.604145, "o", "e"] [64.658491, "o", "d"] [64.747708, "o", "u"] [64.756943, "o", "p"] [64.823255, "o", "l"] [64.914556, "o", "i"] [64.948846, "o", "c"] [64.958142, "o", "a"] [64.985391, "o", "t"] [65.152715, "o", "e"] [65.177085, "o", "d"] [65.259267, "o", " "] [65.309462, "o", "s"] [65.325649, "o", "i"] [65.357957, "o", "z"] [65.528257, "o", "e"] [65.600556, "o", "\""] [65.707856, "o", " "] [65.717101, "o", "f"] [65.750507, "o", "o"] [65.779701, "o", "r"] [65.788939, "o", " "] [65.849319, "o", "\""] [65.942606, "o", "T"] [65.951859, "o", "h"] [65.961183, "o", "i"] [66.115428, "o", "s"] [66.184735, "o", " "] [66.220023, "o", "a"] [66.230285, "o", "r"] [66.279587, "o", "c"] [66.297785, "o", "h"] [66.395105, "o", "i"] [66.408354, "o", "v"] [66.428654, "o", "e"] [66.473928, "o", "\""] [66.483134, "o", "!"] [66.571433, "o", "\r\n"] [66.576919, "o", "$ #"] [66.592225, "o", " "] [66.633417, "o", "B"] [66.708708, "o", "o"] [66.753999, "o", "r"] [66.76423, "o", "g"] [66.773413, "o", " "] [66.867707, "o", "r"] [66.877054, "o", "e"] [66.897308, "o", "c"] [66.962672, "o", "o"] [66.971899, "o", "g"] [67.017259, "o", "n"] [67.026475, "o", "i"] [67.035723, "o", "z"] [67.053037, "o", "e"] [67.132276, "o", "d"] [67.14758, "o", " "] [67.156806, "o", "t"] [67.226104, "o", "h"] [67.252425, "o", "a"] [67.307794, "o", "t"] [67.508065, "o", " "] [67.517322, "o", "m"] [67.717495, "o", "o"] [67.797754, "o", "s"] [67.80702, "o", "t"] [67.816244, "o", " "] [67.949494, "o", "f"] [68.062791, "o", "i"] [68.121067, "o", "l"] [68.140367, "o", "e"] [68.276663, "o", "s"] [68.304952, "o", " "] [68.407232, "o", "d"] [68.445403, "o", "i"] [68.474727, "o", "d"] [68.593061, "o", " "] [68.617374, "o", "n"] [68.640634, "o", "o"] [68.649862, "o", "t"] [68.662149, "o", " "] [68.69242, "o", "c"] [68.71764, "o", "h"] [68.726846, "o", "a"] [68.765193, "o", "n"] [68.79645, "o", "g"] [68.893677, "o", "e"] [68.953943, "o", " "] [69.002217, "o", "a"] [69.025452, "o", "n"] [69.127777, "o", "d"] [69.13708, "o", " "] [69.156345, "o", "d"] [69.214641, "o", "e"] [69.300936, "o", "d"] [69.409271, "o", "u"] [69.476576, "o", "p"] [69.596893, "o", "l"] [69.68111, "o", "i"] [69.706158, "o", "c"] [69.728513, "o", "a"] [69.846752, "o", "t"] [69.867018, "o", "e"] [69.9153, "o", "d"] [70.065545, "o", " "] [70.168883, "o", "t"] [70.258152, "o", "h"] [70.271501, "o", "e"] [70.28073, "o", "m"] [70.481093, "o", "."] [70.490785, "o", "\r\n"] [70.496448, "o", "$ \r\n"] [70.501664, "o", "$ #"] [70.529964, "o", " "] [70.714221, "o", "B"] [70.750476, "o", "u"] [70.866685, "o", "t"] [70.958924, "o", " "] [71.149225, "o", "w"] [71.166498, "o", "h"] [71.359756, "o", "a"] [71.407991, "o", "t"] [71.421261, "o", " "] [71.430476, "o", "h"] [71.448747, "o", "a"] [71.599001, "o", "p"] [71.750234, "o", "p"] [71.833426, "o", "e"] [71.882648, "o", "n"] [71.920917, "o", "s"] [71.945239, "o", ","] [72.145414, "o", " "] [72.174626, "o", "w"] [72.214867, "o", "h"] [72.239108, "o", "e"] [72.439393, "o", "n"] [72.461603, "o", " "] [72.473817, "o", "w"] [72.487089, "o", "e"] [72.687371, "o", " "] [72.86364, "o", "m"] [72.879841, "o", "o"] [72.999103, "o", "v"] [73.009202, "o", "e"] [73.075457, "o", " "] [73.127698, "o", "a"] [73.248951, "o", " "] [73.258159, "o", "d"] [73.272426, "o", "i"] [73.329649, "o", "r"] [73.354882, "o", " "] [73.364101, "o", "a"] [73.381275, "o", "n"] [73.402546, "o", "d"] [73.411758, "o", " "] [73.435011, "o", "c"] [73.44422, "o", "r"] [73.453394, "o", "e"] [73.610611, "o", "a"] [73.670846, "o", "t"] [73.711101, "o", "e"] [73.730366, "o", " "] [73.761533, "o", "a"] [73.909763, "o", " "] [73.94401, "o", "n"] [74.037243, "o", "e"] [74.109435, "o", "w"] [74.173634, "o", " "] [74.262874, "o", "b"] [74.335139, "o", "a"] [74.366424, "o", "c"] [74.447673, "o", "k"] [74.531912, "o", "u"] [74.555155, "o", "p"] [74.75541, "o", "?"] [74.765242, "o", "\r\n"] [74.77042, "o", "$ m"] [74.828702, "o", "v"] [75.028952, "o", " "] [75.038207, "o", "W"] [75.047413, "o", "a"] [75.059647, "o", "l"] [75.068871, "o", "l"] [75.080099, "o", "p"] [75.122399, "o", "a"] [75.131582, "o", "p"] [75.174824, "o", "e"] [75.201146, "o", "r"] [75.401312, "o", "/"] [75.439551, "o", "b"] [75.543797, "o", "i"] [75.558018, "o", "g"] [75.590267, "o", "c"] [75.610529, "o", "o"] [75.687784, "o", "l"] [75.888044, "o", "l"] [75.898236, "o", "e"] [75.938527, "o", "c"] [75.950758, "o", "t"] [76.027992, "o", "i"] [76.037221, "o", "o"] [76.097415, "o", "n"] [76.186636, "o", " "] [76.241869, "o", "W"] [76.251078, "o", "a"] [76.294356, "o", "l"] [76.361534, "o", "l"] [76.465786, "o", "p"] [76.478756, "o", "a"] [76.546004, "o", "p"] [76.606267, "o", "e"] [76.615487, "o", "r"] [76.745722, "o", "/"] [76.816982, "o", "b"] [76.826175, "o", "i"] [76.843447, "o", "g"] [76.896703, "o", "c"] [76.96194, "o", "o"] [76.994172, "o", "l"] [77.014431, "o", "l"] [77.023644, "o", "e"] [77.044914, "o", "c"] [77.067174, "o", "t"] [77.084444, "o", "i"] [77.142665, "o", "o"] [77.151852, "o", "n"] [77.161129, "o", "_"] [77.213291, "o", "N"] [77.244548, "o", "E"] [77.260819, "o", "W"] [77.318801, "o", "\r\n"] [77.329679, "o", "$ \r\n"] [77.33314, "o", "$ b"] [77.342305, "o", "o"] [77.54254, "o", "r"] [77.628787, "o", "g"] [77.676116, "o", " "] [77.743374, "o", "c"] [77.774609, "o", "r"] [77.801173, "o", "e"] [77.815449, "o", "a"] [77.825401, "o", "t"] [77.846987, "o", "e"] [78.047448, "o", " "] [78.106935, "o", "-"] [78.14254, "o", "-"] [78.153344, "o", "s"] [78.16262, "o", "t"] [78.172102, "o", "a"] [78.209331, "o", "t"] [78.241352, "o", "s"] [78.411208, "o", " "] [78.513499, "o", "-"] [78.59962, "o", "-"] [78.609363, "o", "p"] [78.6297, "o", "r"] [78.798934, "o", "o"] [78.808385, "o", "g"] [79.008927, "o", "r"] [79.020447, "o", "e"] [79.049225, "o", "s"] [79.059695, "o", "s"] [79.205329, "o", " "] [79.214453, "o", "-"] [79.227016, "o", "-"] [79.297294, "o", "c"] [79.49812, "o", "o"] [79.520796, "o", "m"] [79.536348, "o", "p"] [79.553311, "o", "r"] [79.592977, "o", "e"] [79.629942, "o", "s"] [79.656728, "o", "s"] [79.774107, "o", "i"] [79.808919, "o", "o"] [79.911941, "o", "n"] [79.933374, "o", " "] [79.951845, "o", "l"] [80.152409, "o", "z"] [80.313323, "o", "4"] [80.493778, "o", " "] [80.525364, "o", "/"] [80.601345, "o", "m"] [80.634233, "o", "e"] [80.643571, "o", "d"] [80.750189, "o", "i"] [80.83339, "o", "a"] [80.985813, "o", "/"] [81.068058, "o", "b"] [81.109491, "o", "a"] [81.309927, "o", "c"] [81.323449, "o", "k"] [81.392508, "o", "u"] [81.428703, "o", "p"] [81.449275, "o", "/"] [81.516755, "o", "b"] [81.526222, "o", "o"] [81.536684, "o", "r"] [81.546145, "o", "g"] [81.555588, "o", "d"] [81.582746, "o", "e"] [81.636297, "o", "m"] [81.681736, "o", "o"] [81.773332, "o", ":"] [81.793656, "o", ":"] [81.895127, "o", "b"] [81.926675, "o", "a"] [81.962742, "o", "c"] [81.973139, "o", "k"] [82.004992, "o", "u"] [82.021323, "o", "p"] [82.10136, "o", "3"] [82.217881, "o", " "] [82.229341, "o", "W"] [82.244659, "o", "a"] [82.281391, "o", "l"] [82.335922, "o", "l"] [82.345291, "o", "p"] [82.357335, "o", "a"] [82.389372, "o", "p"] [82.414494, "o", "e"] [82.497747, "o", "r"] [82.566107, "o", "\r\n"] [83.485219, "o", "Enter passphrase for key /media/backup/borgdemo: "] [85.045519, "o", "\r"] [85.046073, "o", "\r\n"] [85.13408, "o", "0 B O 0 B C 0 B D 0 N Wallpaper \r"] [85.151946, "o", "Initializing cache transaction: Reading config \r"] [85.152609, "o", "Initializing cache transaction: Reading chunks \r"] [85.153323, "o", "Initializing cache transaction: Reading files \r"] [85.153874, "o", " \r"] [85.3408, "o", "41.33 MB O 41.19 MB C 0 B D 1 N Wallpaper/bigcollecti...enCL_528814521414_8K.jpg\r"] [85.554348, "o", "85.57 MB O 85.31 MB C 0 B D 4 N Wallpaper/bigcollecti...x_OpenCL_18915424_8K.jpg\r"] [85.756273, "o", "126.96 MB O 126.69 MB C 0 B D 10 N Wallpaper/bigcollec...penCL_4258952414_8K.jpg\r"] [85.966979, "o", "170.79 MB O 170.51 MB C 0 B D 11 N Wallpaper/bigcollec...penCL_9648145412_8K.jpg\r"] [86.170995, "o", "212.59 MB O 211.81 MB C 0 B D 16 N Wallpaper/bigcollec...enCL_51241841541_8K.jpg\r"] [86.372217, "o", "255.05 MB O 254.10 MB C 0 B D 20 N Wallpaper/bigcollec...OpenCL_644289452_8K.jpg\r"] [86.585677, "o", "298.20 MB O 296.90 MB C 0 B D 25 N Wallpaper/bigcollec...OpenCL_545185481_8K.jpg\r"] [86.794185, "o", "342.20 MB O 340.79 MB C 0 B D 27 N Wallpaper/bigcollec...wamm_OpenCl_6184524.jpg\r"] [86.996936, "o", "384.57 MB O 383.17 MB C 0 B D 29 N Wallpaper/bigcollec...ects._(14168975789).jpg\r"] [87.073155, "o", " \r"] [87.092608, "o", "Saving files cache \r"] [87.094182, "o", "Saving chunks cache \r"] [87.094972, "o", "Saving cache config \r"] [87.096986, "o", " \r"] [87.099604, "o", "------------------------------------------------------------------------------\r\r\nRepository: /media/backup/borgdemo\r\r\n"] [87.099914, "o", "Archive name: backup3\r\r\n"] [87.100242, "o", "Archive fingerprint: 5ae78abd6558856f14289b7af3ea13f8550655c46624ad18d76e40da6ed1ee04\r\r\n"] [87.100603, "o", "Time (start): Wed, 2022-07-06 21:29:03\r\r\n"] [87.100876, "o", "Time (end): Wed, 2022-07-06 21:29:05\r\r\n"] [87.101208, "o", "Duration: 1.95 seconds\r\r\n"] [87.1015, "o", "Number of files: 32\r\r\n"] [87.10179, "o", "Utilization of max. archive size: 0%\r\r\n"] [87.102078, "o", "------------------------------------------------------------------------------\r\r\n"] [87.102524, "o", " Original size Compressed size Deduplicated size\r\r\n"] [87.102832, "o", "This archive: 401.15 MB 399.74 MB 550 B\r\r\n"] [87.103139, "o", "All archives: 1.20 GB 1.20 GB 399.58 MB\r\r\n"] [87.103436, "o", "\r\r\n"] [87.103734, "o", " Unique chunks Total chunks\r\r\n"] [87.104117, "o", "Chunk index: 213 629\r\r\n"] [87.104448, "o", "------------------------------------------------------------------------------\r\r\n"] [87.152849, "o", "$ \r\n"] [87.156745, "o", "$ #"] [87.209512, "o", " "] [87.293916, "o", "S"] [87.348284, "o", "t"] [87.366999, "o", "i"] [87.520505, "o", "l"] [87.53834, "o", "l"] [87.575493, "o", " "] [87.717844, "o", "q"] [87.821336, "o", "u"] [87.893612, "o", "i"] [87.933639, "o", "t"] [87.94296, "o", "e"] [87.976865, "o", " "] [88.014021, "o", "f"] [88.075291, "o", "a"] [88.097374, "o", "s"] [88.159006, "o", "t"] [88.203224, "o", "…"] [88.229661, "o", "\r\n"] [88.236034, "o", "$ #"] [88.37343, "o", " "] [88.40558, "o", "B"] [88.528518, "o", "u"] [88.569622, "o", "t"] [88.773509, "o", " "] [88.845482, "o", "w"] [88.876157, "o", "h"] [89.02846, "o", "e"] [89.037858, "o", "n"] [89.238437, "o", " "] [89.38946, "o", "y"] [89.441827, "o", "o"] [89.514261, "o", "u"] [89.610734, "o", " "] [89.677386, "o", "l"] [89.710803, "o", "o"] [89.767294, "o", "o"] [89.777491, "o", "k"] [89.833962, "o", " "] [89.873237, "o", "a"] [89.913382, "o", "t"] [90.045417, "o", " "] [90.06921, "o", "t"] [90.116559, "o", "h"] [90.131995, "o", "e"] [90.323428, "o", " "] [90.473531, "o", "\""] [90.648246, "o", "d"] [90.661648, "o", "e"] [90.670834, "o", "d"] [90.723701, "o", "u"] [90.849449, "o", "p"] [90.892885, "o", "l"] [90.9136, "o", "i"] [90.945812, "o", "c"] [90.986109, "o", "a"] [91.08574, "o", "t"] [91.146406, "o", "e"] [91.16304, "o", "d"] [91.363904, "o", " "] [91.417291, "o", "f"] [91.433481, "o", "i"] [91.451001, "o", "l"] [91.481545, "o", "e"] [91.57759, "o", " "] [91.58698, "o", "s"] [91.706954, "o", "i"] [91.724347, "o", "z"] [91.8136, "o", "e"] [91.825139, "o", "\""] [91.872525, "o", " "] [91.881863, "o", "a"] [91.973617, "o", "g"] [92.177436, "o", "a"] [92.251273, "o", "i"] [92.353509, "o", "n"] [92.537927, "o", ","] [92.571284, "o", " "] [92.663267, "o", "y"] [92.750934, "o", "o"] [92.797332, "o", "u"] [92.829397, "o", " "] [92.897956, "o", "s"] [92.908352, "o", "e"] [92.931057, "o", "e"] [92.955633, "o", " "] [92.992248, "o", "t"] [93.192829, "o", "h"] [93.320984, "o", "a"] [93.40135, "o", "t"] [93.60199, "o", " "] [93.645112, "o", "b"] [93.724391, "o", "o"] [93.862343, "o", "r"] [93.937373, "o", "g"] [93.990798, "o", " "] [94.150589, "o", "a"] [94.207057, "o", "l"] [94.241414, "o", "s"] [94.283425, "o", "o"] [94.436593, "o", " "] [94.446044, "o", "r"] [94.509642, "o", "e"] [94.535483, "o", "c"] [94.631229, "o", "o"] [94.665375, "o", "g"] [94.680755, "o", "n"] [94.713345, "o", "i"] [94.782818, "o", "z"] [94.792313, "o", "e"] [94.809509, "o", "d"] [94.853814, "o", " "] [94.863216, "o", "t"] [94.872586, "o", "h"] [94.89334, "o", "a"] [94.908753, "o", "t"] [94.941284, "o", " "] [94.987778, "o", "o"] [95.002399, "o", "n"] [95.147681, "o", "l"] [95.157126, "o", "y"] [95.173363, "o", " "] [95.19082, "o", "t"] [95.365301, "o", "h"] [95.454473, "o", "e"] [95.463921, "o", " "] [95.473274, "o", "d"] [95.551342, "o", "i"] [95.618296, "o", "r"] [95.718537, "o", " "] [95.741359, "o", "a"] [95.758986, "o", "n"] [95.793351, "o", "d"] [95.97488, "o", " "] [96.032312, "o", "n"] [96.05375, "o", "o"] [96.063143, "o", "t"] [96.26534, "o", " "] [96.349141, "o", "t"] [96.442503, "o", "h"] [96.52983, "o", "e"] [96.540245, "o", " "] [96.551714, "o", "f"] [96.616104, "o", "i"] [96.625488, "o", "l"] [96.642864, "o", "e"] [96.843732, "o", "s"] [96.861188, "o", " "] [96.977283, "o", "c"] [96.991812, "o", "h"] [97.095082, "o", "a"] [97.1045, "o", "n"] [97.113948, "o", "g"] [97.123416, "o", "e"] [97.209317, "o", "d"] [97.4101, "o", " "] [97.425341, "o", "i"] [97.589299, "o", "n"] [97.665522, "o", " "] [97.733363, "o", "t"] [97.755937, "o", "h"] [97.808313, "o", "i"] [97.817807, "o", "s"] [98.014252, "o", " "] [98.04937, "o", "b"] [98.081819, "o", "a"] [98.26958, "o", "c"] [98.317334, "o", "k"] [98.344896, "o", "u"] [98.385091, "o", "p"] [98.441567, "o", "."] [98.451772, "o", "\r\n"] [98.456939, "o", "$ \r\n"] [98.461066, "o", "$ #"] [98.529239, "o", " "] [98.570449, "o", "N"] [98.63069, "o", "o"] [98.696949, "o", "w"] [98.7642, "o", " "] [98.78642, "o", "l"] [98.855663, "o", "e"] [98.87792, "o", "t"] [98.906218, "o", "s"] [99.106438, "o", " "] [99.143675, "o", "l"] [99.152895, "o", "o"] [99.203156, "o", "o"] [99.240405, "o", "k"] [99.376664, "o", " "] [99.385854, "o", "i"] [99.400081, "o", "n"] [99.409194, "o", "t"] [99.495504, "o", "o"] [99.504768, "o", " "] [99.572024, "o", "a"] [99.581179, "o", " "] [99.617371, "o", "r"] [99.650628, "o", "e"] [99.705883, "o", "p"] [99.852135, "o", "o"] [99.861273, "o", "."] [99.964328, "o", "\r\n"] [99.969277, "o", "$ b"] [100.000532, "o", "o"] [100.009762, "o", "r"] [100.043017, "o", "g"] [100.052226, "o", " "] [100.0885, "o", "l"] [100.288738, "o", "i"] [100.305975, "o", "s"] [100.414237, "o", "t"] [100.549426, "o", " "] [100.576746, "o", "/"] [100.585934, "o", "m"] [100.63621, "o", "e"] [100.793379, "o", "d"] [100.802584, "o", "i"] [100.811831, "o", "a"] [100.840099, "o", "/"] [100.934358, "o", "b"] [100.945531, "o", "a"] [100.980793, "o", "c"] [101.046051, "o", "k"] [101.127323, "o", "u"] [101.146544, "o", "p"] [101.208799, "o", "/"] [101.316059, "o", "b"] [101.408305, "o", "o"] [101.559559, "o", "r"] [101.57882, "o", "g"] [101.619053, "o", "d"] [101.690318, "o", "e"] [101.851581, "o", "m"] [101.868834, "o", "o"] [101.895837, "o", "\r\n"] [102.82836, "o", "Enter passphrase for key /media/backup/borgdemo: "] [104.226926, "o", "\r\r\n"] [104.317737, "o", "backup1 Wed, 2022-07-06 21:28:23 [4b2f146af02ce3a4df8018411ce46d97fe7eaad0512c969a4bbcd4f113900746]\r\r\nbackup2 Wed, 2022-07-06 21:28:40 [70d0bd96eb512ca96356308fb4aab162ae7d868c9fe491a36b1d8b00190e8e97]\r\r\n"] [104.318451, "o", "backup3 Wed, 2022-07-06 21:29:03 [5ae78abd6558856f14289b7af3ea13f8550655c46624ad18d76e40da6ed1ee04]\r\r\n"] [104.367169, "o", "$ "] [104.368499, "o", "\r\n"] [104.373216, "o", "$ "] [104.373787, "o", "#"] [104.385513, "o", " "] [104.40682, "o", "Y"] [104.441491, "o", "o"] [104.477718, "o", "u"] [104.678172, "o", "'"] [104.762495, "o", "l"] [104.794922, "o", "l"] [104.812639, "o", " "] [104.833147, "o", "s"] [104.901743, "o", "e"] [104.950219, "o", "e"] [105.122774, "o", " "] [105.177278, "o", "a"] [105.221438, "o", " "] [105.240947, "o", "l"] [105.26949, "o", "i"] [105.289501, "o", "s"] [105.301427, "o", "t"] [105.501757, "o", " "] [105.544171, "o", "o"] [105.555657, "o", "f"] [105.665411, "o", " "] [105.835304, "o", "a"] [105.84469, "o", "l"] [105.853955, "o", "l"] [105.878739, "o", " "] [105.93132, "o", "b"] [105.952058, "o", "a"] [105.981516, "o", "c"] [105.993763, "o", "k"] [106.035503, "o", "u"] [106.065513, "o", "p"] [106.109516, "o", "s"] [106.118728, "o", "."] [106.182447, "o", "\r\n"] [106.188985, "o", "$ #"] [106.289073, "o", " "] [106.29939, "o", "Y"] [106.308874, "o", "o"] [106.321566, "o", "u"] [106.521863, "o", " "] [106.596728, "o", "c"] [106.67751, "o", "a"] [106.700634, "o", "n"] [106.714282, "o", " "] [106.723841, "o", "a"] [106.807925, "o", "l"] [106.821467, "o", "s"] [107.025494, "o", "o"] [107.098377, "o", " "] [107.169619, "o", "u"] [107.180018, "o", "s"] [107.329587, "o", "e"] [107.397557, "o", " "] [107.419245, "o", "t"] [107.511283, "o", "h"] [107.572895, "o", "e"] [107.717994, "o", " "] [107.870106, "o", "s"] [107.993322, "o", "a"] [108.194277, "o", "m"] [108.229638, "o", "e"] [108.271397, "o", " "] [108.290782, "o", "c"] [108.333358, "o", "o"] [108.422361, "o", "m"] [108.46158, "o", "m"] [108.472043, "o", "a"] [108.481327, "o", "n"] [108.541571, "o", "d"] [108.56016, "o", " "] [108.625484, "o", "t"] [108.661281, "o", "o"] [108.861774, "o", " "] [108.871238, "o", "l"] [108.89738, "o", "o"] [108.993343, "o", "o"] [109.118797, "o", "k"] [109.201386, "o", " "] [109.29193, "o", "i"] [109.303382, "o", "n"] [109.321804, "o", "t"] [109.402727, "o", "o"] [109.419369, "o", " "] [109.46062, "o", "a"] [109.470188, "o", "n"] [109.670891, "o", " "] [109.687394, "o", "a"] [109.745313, "o", "r"] [109.807824, "o", "c"] [109.969317, "o", "h"] [110.023573, "o", "i"] [110.036116, "o", "v"] [110.045485, "o", "e"] [110.245943, "o", "."] [110.324697, "o", " "] [110.441361, "o", "B"] [110.459869, "o", "u"] [110.52936, "o", "t"] [110.729573, "o", " "] [110.738933, "o", "w"] [110.864128, "o", "e"] [110.969566, "o", " "] [110.984119, "o", "b"] [111.037292, "o", "e"] [111.108067, "o", "t"] [111.156532, "o", "t"] [111.172115, "o", "e"] [111.201326, "o", "r"] [111.405311, "o", " "] [111.506429, "o", "f"] [111.533961, "o", "i"] [111.548383, "o", "l"] [111.603669, "o", "t"] [111.645926, "o", "e"] [111.730354, "o", "r"] [111.817926, "o", " "] [111.838689, "o", "t"] [111.937146, "o", "h"] [111.953327, "o", "e"] [111.962645, "o", " "] [112.009343, "o", "o"] [112.13978, "o", "u"] [112.149267, "o", "t"] [112.205358, "o", "p"] [112.262791, "o", "u"] [112.309253, "o", "t"] [112.393456, "o", " "] [112.594288, "o", "h"] [112.617351, "o", "e"] [112.650093, "o", "r"] [112.721339, "o", "e"] [112.730808, "o", ":"] [112.846207, "o", "\r\n"] [112.851859, "o", "$ b"] [112.911145, "o", "o"] [112.938366, "o", "r"] [112.963629, "o", "g"] [113.163858, "o", " "] [113.215117, "o", "l"] [113.235372, "o", "i"] [113.322596, "o", "s"] [113.331815, "o", "t"] [113.376114, "o", " "] [113.391322, "o", "/"] [113.416594, "o", "m"] [113.425798, "o", "e"] [113.519058, "o", "d"] [113.554283, "o", "i"] [113.636552, "o", "a"] [113.647766, "o", "/"] [113.667031, "o", "b"] [113.676302, "o", "a"] [113.757516, "o", "c"] [113.780751, "o", "k"] [113.869002, "o", "u"] [113.902268, "o", "p"] [114.040515, "o", "/"] [114.049714, "o", "b"] [114.063965, "o", "o"] [114.169232, "o", "r"] [114.195472, "o", "g"] [114.204679, "o", "d"] [114.334957, "o", "e"] [114.353261, "o", "m"] [114.362488, "o", "o"] [114.411742, "o", ":"] [114.446012, "o", ":"] [114.47327, "o", "b"] [114.494521, "o", "a"] [114.503728, "o", "c"] [114.575963, "o", "k"] [114.72126, "o", "u"] [114.903516, "o", "p"] [114.912735, "o", "3"] [114.936005, "o", " "] [114.959221, "o", "|"] [114.9684, "o", " "] [115.055677, "o", "g"] [115.107938, "o", "r"] [115.160181, "o", "e"] [115.220437, "o", "p"] [115.420688, "o", " "] [115.505923, "o", "'"] [115.540179, "o", "d"] [115.54932, "o", "e"] [115.576685, "o", "e"] [115.64793, "o", "r"] [115.847168, "o", "."] [115.889359, "o", "j"] [115.898548, "o", "p"] [115.965835, "o", "g"] [116.166111, "o", "'"] [116.175915, "o", "\r\n"] [117.125741, "o", "Enter passphrase for key /media/backup/borgdemo: "] [118.933873, "o", "\r\r\n"] [119.024246, "o", "-rw-r--r-- root root 193033 Wed, 2022-07-06 21:27:37 Wallpaper/deer.jpg\r\r\n"] [119.077744, "o", "$ \r\n"] [119.081473, "o", "$ #"] [119.201982, "o", " "] [119.211507, "o", "O"] [119.253728, "o", "h"] [119.389612, "o", ","] [119.439978, "o", " "] [119.461686, "o", "w"] [119.52014, "o", "e"] [119.721157, "o", " "] [119.829452, "o", "f"] [119.853429, "o", "o"] [119.873001, "o", "u"] [119.891743, "o", "n"] [119.905595, "o", "d"] [120.10608, "o", " "] [120.148696, "o", "o"] [120.209153, "o", "u"] [120.333417, "o", "r"] [120.364325, "o", " "] [120.466866, "o", "p"] [120.581481, "o", "i"] [120.621287, "o", "c"] [120.640078, "o", "t"] [120.840575, "o", "u"] [120.857471, "o", "r"] [120.893922, "o", "e"] [121.020255, "o", "."] [121.036901, "o", " "] [121.071178, "o", "N"] [121.081806, "o", "o"] [121.099482, "o", "w"] [121.131093, "o", " "] [121.232917, "o", "e"] [121.242505, "o", "x"] [121.290029, "o", "t"] [121.337675, "o", "r"] [121.377245, "o", "a"] [121.534948, "o", "c"] [121.545462, "o", "t"] [121.60099, "o", " "] [121.649524, "o", "i"] [121.677501, "o", "t"] [121.749168, "o", "…"] [121.870956, "o", "\r\n"] [121.878453, "o", "$ m"] [121.905742, "o", "v"] [121.937554, "o", " "] [121.946689, "o", "W"] [121.967065, "o", "a"] [121.985499, "o", "l"] [121.994821, "o", "l"] [122.009501, "o", "p"] [122.057426, "o", "a"] [122.066873, "o", "p"] [122.267285, "o", "e"] [122.360793, "o", "r"] [122.453415, "o", " "] [122.513784, "o", "W"] [122.6265, "o", "a"] [122.730453, "o", "l"] [122.841305, "o", "l"] [123.009354, "o", "p"] [123.129353, "o", "a"] [123.169359, "o", "p"] [123.275878, "o", "e"] [123.313358, "o", "r"] [123.513655, "o", "."] [123.545339, "o", "o"] [123.559582, "o", "r"] [123.749344, "o", "i"] [123.801308, "o", "g"] [123.994717, "o", "\r\n"] [124.003853, "o", "$ b"] [124.013117, "o", "o"] [124.051773, "o", "r"] [124.098153, "o", "g"] [124.181336, "o", " "] [124.225346, "o", "e"] [124.291694, "o", "x"] [124.345105, "o", "t"] [124.442852, "o", "r"] [124.478188, "o", "a"] [124.531671, "o", "c"] [124.545143, "o", "t"] [124.634767, "o", " "] [124.689277, "o", "/"] [124.701314, "o", "m"] [124.870659, "o", "e"] [124.893388, "o", "d"] [124.961893, "o", "i"] [125.0534, "o", "a"] [125.062828, "o", "/"] [125.125355, "o", "b"] [125.193722, "o", "a"] [125.232321, "o", "c"] [125.277111, "o", "k"] [125.286592, "o", "u"] [125.317362, "o", "p"] [125.473543, "o", "/"] [125.493323, "o", "b"] [125.505356, "o", "o"] [125.531743, "o", "r"] [125.652233, "o", "g"] [125.677305, "o", "d"] [125.717712, "o", "e"] [125.747622, "o", "m"] [125.909364, "o", "o"] [126.110164, "o", ":"] [126.185459, "o", ":"] [126.217306, "o", "b"] [126.235863, "o", "a"] [126.261279, "o", "c"] [126.437637, "o", "k"] [126.610395, "o", "u"] [126.660867, "o", "p"] [126.681269, "o", "3"] [126.774683, "o", " "] [126.808707, "o", "W"] [126.826052, "o", "a"] [126.889457, "o", "l"] [126.902847, "o", "l"] [126.913333, "o", "p"] [126.977672, "o", "a"] [127.040095, "o", "p"] [127.093863, "o", "e"] [127.108476, "o", "r"] [127.117779, "o", "/"] [127.177324, "o", "d"] [127.208027, "o", "e"] [127.258753, "o", "e"] [127.328181, "o", "r"] [127.430698, "o", "."] [127.440219, "o", "j"] [127.493813, "o", "p"] [127.69734, "o", "g"] [127.745783, "o", "\r\n"] [128.676873, "o", "Enter passphrase for key /media/backup/borgdemo: "] [130.262495, "o", "\r\r\n"] [130.40589, "o", "$ \r\n"] [130.408917, "o", "$ \r\n"] [130.411592, "o", "$ #"] [130.447042, "o", " "] [130.469463, "o", "A"] [130.486668, "o", "n"] [130.547045, "o", "d"] [130.610389, "o", " "] [130.619584, "o", "c"] [130.644904, "o", "h"] [130.684187, "o", "e"] [130.727571, "o", "c"] [130.781692, "o", "k"] [130.808069, "o", " "] [130.845396, "o", "t"] [131.045606, "o", "h"] [131.07192, "o", "a"] [131.104099, "o", "t"] [131.16738, "o", " "] [131.185618, "o", "i"] [131.305944, "o", "t"] [131.350278, "o", "'"] [131.362387, "o", "s"] [131.41572, "o", " "] [131.479032, "o", "t"] [131.525219, "o", "h"] [131.565355, "o", "e"] [131.739788, "o", " "] [131.765128, "o", "s"] [131.800433, "o", "a"] [131.844706, "o", "m"] [131.854797, "o", "e"] [131.949151, "o", ":"] [132.150155, "o", "\r\n"] [132.155207, "o", "$ d"] [132.222684, "o", "i"] [132.231755, "o", "f"] [132.241114, "o", "f"] [132.264447, "o", " "] [132.408761, "o", "-"] [132.429115, "o", "s"] [132.568351, "o", " "] [132.604616, "o", "W"] [132.613685, "o", "a"] [132.683021, "o", "l"] [132.768332, "o", "l"] [132.777539, "o", "p"] [132.786743, "o", "a"] [132.804149, "o", "p"] [132.817466, "o", "e"] [132.848787, "o", "r"] [132.872136, "o", "/"] [132.895368, "o", "d"] [132.925566, "o", "e"] [132.949702, "o", "e"] [133.049156, "o", "r"] [133.05835, "o", "."] [133.203686, "o", "j"] [133.261883, "o", "p"] [133.293183, "o", "g"] [133.31844, "o", " "] [133.327651, "o", "W"] [133.355059, "o", "a"] [133.445333, "o", "l"] [133.529542, "o", "l"] [133.635825, "o", "p"] [133.657146, "o", "a"] [133.761233, "o", "p"] [133.846807, "o", "e"] [133.887209, "o", "r"] [134.059607, "o", "."] [134.068957, "o", "o"] [134.078295, "o", "r"] [134.087635, "o", "i"] [134.097002, "o", "g"] [134.188374, "o", "/"] [134.322782, "o", "d"] [134.464061, "o", "e"] [134.534314, "o", "e"] [134.734581, "o", "r"] [134.934851, "o", "."] [135.135128, "o", "j"] [135.320397, "o", "p"] [135.339681, "o", "g"] [135.399624, "o", "\r\n"] [135.408642, "o", "Files Wallpaper/deer.jpg and Wallpaper.orig/deer.jpg are identical"] [135.409223, "o", "\r\r\n"] [135.409952, "o", "$ \r\n"] [135.413234, "o", "$ #"] [135.429446, "o", " "] [135.438723, "o", "A"] [135.491005, "o", "n"] [135.527292, "o", "d"] [135.563541, "o", ","] [135.594797, "o", " "] [135.732052, "o", "o"] [135.854273, "o", "f"] [135.887539, "o", " "] [135.972804, "o", "c"] [135.988043, "o", "o"] [136.120305, "o", "u"] [136.146563, "o", "r"] [136.190803, "o", "s"] [136.227062, "o", "e"] [136.310282, "o", ","] [136.338551, "o", " "] [136.388793, "o", "w"] [136.423051, "o", "e"] [136.432242, "o", " "] [136.473487, "o", "c"] [136.501693, "o", "a"] [136.544266, "o", "n"] [136.626521, "o", " "] [136.650782, "o", "a"] [136.689019, "o", "l"] [136.707277, "o", "s"] [136.740528, "o", "o"] [136.881757, "o", " "] [136.938024, "o", "c"] [136.968272, "o", "r"] [136.977439, "o", "e"] [137.048718, "o", "a"] [137.150961, "o", "t"] [137.191223, "o", "e"] [137.371461, "o", " "] [137.391709, "o", "r"] [137.406966, "o", "e"] [137.443207, "o", "m"] [137.467471, "o", "o"] [137.561694, "o", "t"] [137.600935, "o", "e"] [137.610129, "o", " "] [137.624379, "o", "r"] [137.63356, "o", "e"] [137.680854, "o", "p"] [137.766106, "o", "o"] [137.786347, "o", "s"] [137.813574, "o", " "] [137.832788, "o", "v"] [137.856081, "o", "i"] [137.89933, "o", "a"] [138.040577, "o", " "] [138.169867, "o", "s"] [138.290282, "o", "s"] [138.416402, "o", "h"] [138.442662, "o", " "] [138.454915, "o", "w"] [138.481224, "o", "h"] [138.552458, "o", "e"] [138.606708, "o", "n"] [138.805983, "o", " "] [138.886205, "o", "b"] [138.913396, "o", "o"] [138.948659, "o", "r"] [138.957905, "o", "g"] [138.967112, "o", " "] [139.060381, "o", "i"] [139.084639, "o", "s"] [139.162897, "o", " "] [139.172116, "o", "s"] [139.185255, "o", "e"] [139.194524, "o", "t"] [139.203728, "o", "u"] [139.218969, "o", "p"] [139.228203, "o", " "] [139.289406, "o", "t"] [139.298608, "o", "h"] [139.318866, "o", "e"] [139.383122, "o", "r"] [139.408376, "o", "e"] [139.473599, "o", "."] [139.490838, "o", " "] [139.623075, "o", "T"] [139.632287, "o", "h"] [139.82857, "o", "i"] [139.876831, "o", "s"] [139.896088, "o", " "] [139.907357, "o", "c"] [139.987619, "o", "o"] [140.128858, "o", "m"] [140.228101, "o", "m"] [140.256356, "o", "a"] [140.323596, "o", "n"] [140.332852, "o", "d"] [140.533173, "o", " "] [140.583433, "o", "c"] [140.677646, "o", "r"] [140.753916, "o", "e"] [140.834173, "o", "a"] [140.843438, "o", "t"] [140.883697, "o", "e"] [140.965972, "o", "s"] [140.995221, "o", " "] [141.022466, "o", "a"] [141.031666, "o", " "] [141.04089, "o", "n"] [141.050092, "o", "e"] [141.059315, "o", "w"] [141.073493, "o", " "] [141.122761, "o", "r"] [141.14304, "o", "e"] [141.167297, "o", "m"] [141.226536, "o", "o"] [141.235739, "o", "t"] [141.276996, "o", "e"] [141.389249, "o", " "] [141.41551, "o", "r"] [141.482767, "o", "e"] [141.534045, "o", "p"] [141.546224, "o", "o"] [141.606491, "o", " "] [141.641716, "o", "i"] [141.693986, "o", "n"] [141.894212, "o", " "] [141.913388, "o", "a"] [142.001611, "o", " "] [142.047848, "o", "s"] [142.057089, "o", "u"] [142.066324, "o", "b"] [142.075553, "o", "d"] [142.096819, "o", "i"] [142.156056, "o", "r"] [142.351298, "o", "e"] [142.37455, "o", "c"] [142.383749, "o", "t"] [142.470022, "o", "o"] [142.479243, "o", "r"] [142.488459, "o", "y"] [142.688723, "o", " "] [142.70696, "o", "c"] [142.734179, "o", "a"] [142.743376, "o", "l"] [142.802639, "o", "l"] [142.811856, "o", "e"] [142.917176, "o", "d"] [142.926375, "o", " "] [143.00463, "o", "\""] [143.02188, "o", "d"] [143.096092, "o", "e"] [143.124341, "o", "m"] [143.140599, "o", "o"] [143.165884, "o", "\""] [143.228134, "o", ":"] [143.358243, "o", "\r\n"] [143.365151, "o", "$ b"] [143.448537, "o", "o"] [143.48368, "o", "r"] [143.525012, "o", "g"] [143.725553, "o", " "] [143.753366, "o", "i"] [143.821405, "o", "n"] [143.830651, "o", "i"] [143.941335, "o", "t"] [144.008199, "o", " "] [144.021391, "o", "-"] [144.03068, "o", "-"] [144.049269, "o", "e"] [144.077379, "o", "n"] [144.158636, "o", "c"] [144.168094, "o", "r"] [144.201268, "o", "y"] [144.213931, "o", "p"] [144.332512, "o", "t"] [144.34301, "o", "i"] [144.352454, "o", "o"] [144.429126, "o", "n"] [144.441555, "o", "="] [144.498294, "o", "r"] [144.593347, "o", "e"] [144.666045, "o", "p"] [144.772517, "o", "o"] [144.781762, "o", "k"] [144.853563, "o", "e"] [144.899268, "o", "y"] [145.073332, "o", " "] [145.138026, "o", "b"] [145.1648, "o", "o"] [145.174212, "o", "r"] [145.185355, "o", "g"] [145.1947, "o", "d"] [145.231028, "o", "e"] [145.27231, "o", "m"] [145.281718, "o", "o"] [145.33316, "o", "@"] [145.345321, "o", "r"] [145.354569, "o", "e"] [145.363955, "o", "m"] [145.385359, "o", "o"] [145.417098, "o", "t"] [145.617375, "o", "e"] [145.626779, "o", "s"] [145.789323, "o", "e"] [145.974634, "o", "r"] [145.984032, "o", "v"] [146.109293, "o", "e"] [146.118745, "o", "r"] [146.220215, "o", "."] [146.229573, "o", "e"] [146.300845, "o", "x"] [146.315386, "o", "a"] [146.371957, "o", "m"] [146.423406, "o", "p"] [146.432879, "o", "l"] [146.461326, "o", "e"] [146.470777, "o", ":"] [146.649372, "o", "."] [146.781057, "o", "/"] [146.79142, "o", "d"] [146.883059, "o", "e"] [147.083607, "o", "m"] [147.093004, "o", "o"] [147.137975, "o", "\r\n"] [149.114901, "o", "Enter new passphrase: "] [150.597186, "o", "\r\r\n"] [150.598088, "o", "Enter same passphrase again: "] [151.665595, "o", "\r\r\n"] [151.666627, "o", "Do you want your passphrase to be displayed for verification? [yN]: "] [151.667848, "o", "\r\r\n"] [151.782469, "o", "\r"] [151.782892, "o", "\r\n"] [151.783244, "o", "By default repositories initialized with this version will produce security\r"] [151.783615, "o", "\r\n"] [151.783964, "o", "errors if written to with an older version (up to and including Borg 1.0.8).\r"] [151.784342, "o", "\r\n"] [151.784708, "o", "\r"] [151.785137, "o", "\r\n"] [151.785483, "o", "If you want to use these older versions, you can disable the check by running:\r"] [151.785943, "o", "\r\n"] [151.786346, "o", "borg upgrade --disable-tam ssh://borgdemo@remoteserver.example/./demo\r"] [151.787328, "o", "\r\n"] [151.787744, "o", "\r"] [151.788193, "o", "\r\n"] [151.788604, "o", "See https://borgbackup.readthedocs.io/en/stable/changes.html#pre-1-0-9-manifest-spoofing-vulnerability for details about the security implications.\r"] [151.789148, "o", "\r\n"] [151.789649, "o", "\r"] [151.79011, "o", "\r\n"] [151.790513, "o", "IMPORTANT: you will need both KEY AND PASSPHRASE to access this repo!\r"] [151.790949, "o", "\r\n"] [151.791357, "o", "If you used a repokey mode, the key is stored in the repo, but you should back it up separately.\r"] [151.791803, "o", "\r\n"] [151.792205, "o", "Use \"borg key export\" to export the key, optionally in printable format.\r"] [151.792628, "o", "\r\n"] [151.793095, "o", "Write down the passphrase. Store both at safe place(s).\r"] [151.793499, "o", "\r\n"] [151.793912, "o", "\r"] [151.794148, "o", "\r\n"] [151.895133, "o", "$ \r\n"] [151.898504, "o", "$ #"] [151.907686, "o", " "] [151.970961, "o", "E"] [152.046187, "o", "a"] [152.072458, "o", "s"] [152.089663, "o", "y"] [152.169934, "o", ","] [152.22125, "o", " "] [152.241441, "o", "i"] [152.250723, "o", "s"] [152.259967, "o", "n"] [152.356266, "o", "'"] [152.365406, "o", "t"] [152.431677, "o", " "] [152.44087, "o", "i"] [152.53011, "o", "t"] [152.602336, "o", "?"] [152.629528, "o", " "] [152.680785, "o", "T"] [152.72004, "o", "h"] [152.762269, "o", "a"] [152.859548, "o", "t"] [152.943805, "o", "'"] [153.102059, "o", "s"] [153.202278, "o", " "] [153.216515, "o", "a"] [153.238773, "o", "l"] [153.301008, "o", "l"] [153.31021, "o", " "] [153.320433, "o", "y"] [153.451705, "o", "o"] [153.460955, "o", "u"] [153.473202, "o", " "] [153.499452, "o", "n"] [153.562694, "o", "e"] [153.599963, "o", "e"] [153.661289, "o", "d"] [153.692535, "o", " "] [153.701752, "o", "t"] [153.786055, "o", "o"] [153.795264, "o", " "] [153.804528, "o", "k"] [153.832785, "o", "n"] [153.842005, "o", "o"] [153.859276, "o", "w"] [153.896547, "o", " "] [153.945818, "o", "f"] [154.028037, "o", "o"] [154.063319, "o", "r"] [154.094576, "o", " "] [154.103766, "o", "b"] [154.112993, "o", "a"] [154.122204, "o", "s"] [154.182445, "o", "i"] [154.265671, "o", "c"] [154.407925, "o", " "] [154.47121, "o", "u"] [154.48045, "o", "s"] [154.51172, "o", "a"] [154.583955, "o", "g"] [154.59321, "o", "e"] [154.643476, "o", "."] [154.705542, "o", "\r\n"] [154.710326, "o", "$ #"] [154.794577, "o", " "] [154.822836, "o", "I"] [154.900102, "o", "f"] [154.934346, "o", " "] [154.965547, "o", "y"] [155.030799, "o", "o"] [155.039994, "o", "u"] [155.078232, "o", " "] [155.116495, "o", "w"] [155.13473, "o", "a"] [155.154984, "o", "n"] [155.243264, "o", "t"] [155.339518, "o", " "] [155.512774, "o", "t"] [155.563011, "o", "o"] [155.576324, "o", " "] [155.585503, "o", "s"] [155.623775, "o", "e"] [155.819025, "o", "e"] [155.832295, "o", " "] [155.841447, "o", "m"] [155.919707, "o", "o"] [155.972905, "o", "r"] [156.038151, "o", "e"] [156.168404, "o", ","] [156.281607, "o", " "] [156.296815, "o", "h"] [156.347095, "o", "a"] [156.356281, "o", "v"] [156.423555, "o", "e"] [156.62379, "o", " "] [156.72804, "o", "a"] [156.928302, "o", " "] [156.957503, "o", "l"] [157.093718, "o", "o"] [157.102981, "o", "o"] [157.25025, "o", "k"] [157.414462, "o", " "] [157.448727, "o", "a"] [157.482013, "o", "t"] [157.494193, "o", " "] [157.586441, "o", "t"] [157.604659, "o", "h"] [157.638907, "o", "e"] [157.725193, "o", " "] [157.789369, "o", "s"] [157.814605, "o", "c"] [157.835888, "o", "r"] [157.851084, "o", "e"] [157.874326, "o", "e"] [157.907588, "o", "n"] [157.922828, "o", "c"] [158.06203, "o", "a"] [158.183285, "o", "s"] [158.255522, "o", "t"] [158.312769, "o", " "] [158.356027, "o", "s"] [158.43626, "o", "h"] [158.445422, "o", "o"] [158.496674, "o", "w"] [158.534909, "o", "i"] [158.600166, "o", "n"] [158.616418, "o", "g"] [158.681622, "o", " "] [158.827882, "o", "t"] [158.840093, "o", "h"] [158.896394, "o", "e"] [159.096639, "o", " "] [159.105862, "o", "\""] [159.238097, "o", "a"] [159.247287, "o", "d"] [159.36655, "o", "v"] [159.404799, "o", "a"] [159.436042, "o", "n"] [159.462286, "o", "c"] [159.471478, "o", "e"] [159.625717, "o", "d"] [159.79098, "o", " "] [159.823215, "o", "u"] [159.835412, "o", "s"] [159.99268, "o", "a"] [160.057935, "o", "g"] [160.072129, "o", "e"] [160.181283, "o", "\""] [160.207533, "o", "."] [160.217424, "o", "\r\n"] [160.222722, "o", "$ #"] [160.422984, "o", " "] [160.50824, "o", "I"] [160.650484, "o", "n"] [160.749699, "o", " "] [160.758908, "o", "a"] [160.78818, "o", "n"] [160.845324, "o", "y"] [160.892602, "o", " "] [160.916871, "o", "c"] [161.034093, "o", "a"] [161.116346, "o", "s"] [161.125547, "o", "e"] [161.245789, "o", ","] [161.311995, "o", " "] [161.323216, "o", "e"] [161.346473, "o", "n"] [161.362715, "o", "j"] [161.390948, "o", "o"] [161.469285, "o", "y"] [161.487562, "o", " "] [161.511806, "o", "u"] [161.53403, "o", "s"] [161.586248, "o", "i"] [161.609441, "o", "n"] [161.628709, "o", "g"] [161.64495, "o", " "] [161.694222, "o", "b"] [161.765407, "o", "o"] [161.785601, "o", "r"] [161.836877, "o", "g"] [162.041912, "o", "!"] [162.062134, "o", "\r\n"] ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/misc/asciinema/basic.tcl0000644000076500000240000000621214641074756017630 0ustar00twstaff# Configuration for send -h # Tries to emulate a human typing # Tweak this if typing is too fast or too slow set send_human {.05 .1 1 .01 .2} set script { # Here you'll see some basic commands to start working with borg. # Note: This teaser screencast was made with __BORG_VERSION__ – older or newer borg versions may behave differently. # But let's start. # First of all, you can always get help: borg help # These are a lot of commands, so better we start with a few: # Let's create a repo on an external drive… borg init --encryption=repokey /media/backup/borgdemo # This uses the repokey encryption. You may look at "borg help init" or the online doc at https://borgbackup.readthedocs.io/ for other modes. # So now, let's create our first (compressed) backup. borg create --stats --progress --compression lz4 /media/backup/borgdemo::backup1 Wallpaper # That's nice, so far. # So let's add a new file… echo "new nice file" > Wallpaper/newfile.txt borg create --stats --progress --compression lz4 /media/backup/borgdemo::backup2 Wallpaper # Wow, this was a lot faster! # Notice the "Deduplicated size" for "This archive"! # Borg recognized that most files did not change and deduplicated them. # But what happens, when we move a dir and create a new backup? mv Wallpaper/bigcollection Wallpaper/bigcollection_NEW borg create --stats --progress --compression lz4 /media/backup/borgdemo::backup3 Wallpaper # Still quite fast… # But when you look at the "deduplicated file size" again, you see that borg also recognized that only the dir and not the files changed in this backup. # Now lets look into a repo. borg list /media/backup/borgdemo # You'll see a list of all backups. # You can also use the same command to look into an archive. But we better filter the output here: borg list /media/backup/borgdemo::backup3 | grep 'deer.jpg' # Oh, we found our picture. Now extract it… mv Wallpaper Wallpaper.orig borg extract /media/backup/borgdemo::backup3 Wallpaper/deer.jpg # And check that it's the same: diff -s Wallpaper/deer.jpg Wallpaper.orig/deer.jpg # And, of course, we can also create remote repos via ssh when borg is setup there. This command creates a new remote repo in a subdirectory called "demo": borg init --encryption=repokey borgdemo@remoteserver.example:./demo # Easy, isn't it? That's all you need to know for basic usage. # If you want to see more, have a look at the screencast showing the "advanced usage". # In any case, enjoy using borg! } set script [string trim $script] set script [string map [list __BORG_VERSION__ [exec borg -V]] $script] set script [split $script \n] foreach line $script { send_user "$ " send_user -h $line\n spawn -noecho /bin/sh -c $line expect { "Enter new passphrase: " { send -h "correct horse battery staple\n" exp_continue } "Enter same passphrase again: " { send -h "correct horse battery staple\n" exp_continue } "Enter passphrase for key /media/backup/borgdemo: " { send -h "correct horse battery staple\n" exp_continue } -ex {Do you want your passphrase to be displayed for verification? [yN]: } { send \n exp_continue } eof } } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/misc/asciinema/install.json0000644000076500000240000005725614641074756020422 0ustar00twstaff{"version": 2, "width": 80, "height": 24, "timestamp": 1657142795, "env": {"SHELL": "/bin/bash", "TERM": "vt100"}} [0.014053, "o", "$ "] [0.014802, "o", "#"] [0.145809, "o", " "] [0.154894, "o", "T"] [0.185287, "o", "h"] [0.19475, "o", "i"] [0.211085, "o", "s"] [0.321388, "o", " "] [0.389817, "o", "a"] [0.433819, "o", "s"] [0.465846, "o", "c"] [0.477783, "o", "i"] [0.489867, "o", "i"] [0.502142, "o", "n"] [0.562389, "o", "e"] [0.584049, "o", "m"] [0.621852, "o", "a"] [0.657828, "o", " "] [0.667252, "o", "w"] [0.701711, "o", "i"] [0.721812, "o", "l"] [0.761768, "o", "l"] [0.842137, "o", " "] [0.977783, "o", "s"] [1.072032, "o", "h"] [1.117847, "o", "o"] [1.28305, "o", "w"] [1.347577, "o", " "] [1.420286, "o", "y"] [1.441849, "o", "o"] [1.465377, "o", "u"] [1.52183, "o", " "] [1.531208, "o", "t"] [1.548712, "o", "h"] [1.566005, "o", "e"] [1.609195, "o", " "] [1.621698, "o", "i"] [1.663977, "o", "n"] [1.741742, "o", "s"] [1.809851, "o", "t"] [1.929424, "o", "a"] [1.943799, "o", "l"] [2.039221, "o", "l"] [2.129831, "o", "a"] [2.144218, "o", "t"] [2.165843, "o", "i"] [2.17517, "o", "o"] [2.244748, "o", "n"] [2.294097, "o", " "] [2.304666, "o", "o"] [2.319139, "o", "f"] [2.436131, "o", " "] [2.469029, "o", "b"] [2.511209, "o", "o"] [2.558617, "o", "r"] [2.567952, "o", "g"] [2.768307, "o", " "] [2.813853, "o", "a"] [2.83777, "o", "s"] [2.901612, "o", " "] [2.957777, "o", "a"] [3.080693, "o", " "] [3.197825, "o", "s"] [3.240999, "o", "t"] [3.31471, "o", "a"] [3.486239, "o", "n"] [3.545799, "o", "d"] [3.746438, "o", "a"] [3.765807, "o", "l"] [3.799391, "o", "o"] [3.86407, "o", "n"] [3.877844, "o", "e"] [4.010577, "o", " "] [4.033887, "o", "b"] [4.119113, "o", "i"] [4.312337, "o", "n"] [4.341142, "o", "a"] [4.541664, "o", "r"] [4.576179, "o", "y"] [4.753067, "o", "."] [4.898458, "o", " "] [4.969834, "o", "U"] [4.986322, "o", "s"] [4.996775, "o", "u"] [5.016159, "o", "a"] [5.071603, "o", "l"] [5.088116, "o", "l"] [5.102688, "o", "y"] [5.113827, "o", " "] [5.165786, "o", "y"] [5.201829, "o", "o"] [5.233547, "o", "u"] [5.243953, "o", " "] [5.269861, "o", "o"] [5.279354, "o", "n"] [5.379507, "o", "l"] [5.388926, "o", "y"] [5.461163, "o", " "] [5.510869, "o", "n"] [5.539994, "o", "e"] [5.740252, "o", "e"] [5.749606, "o", "d"] [5.858895, "o", " "] [5.893866, "o", "t"] [5.907335, "o", "h"] [5.940743, "o", "i"] [5.955261, "o", "s"] [6.013788, "o", " "] [6.027155, "o", "i"] [6.097878, "o", "f"] [6.12984, "o", " "] [6.29044, "o", "y"] [6.32487, "o", "o"] [6.344524, "o", "u"] [6.361864, "o", " "] [6.406259, "o", "w"] [6.480319, "o", "a"] [6.491805, "o", "n"] [6.539051, "o", "t"] [6.621658, "o", " "] [6.666422, "o", "t"] [6.677777, "o", "o"] [6.687147, "o", " "] [6.745773, "o", "h"] [6.761323, "o", "a"] [6.857807, "o", "v"] [6.877241, "o", "e"] [6.928841, "o", " "] [6.953838, "o", "a"] [7.018219, "o", "n"] [7.204957, "o", " "] [7.214395, "o", "u"] [7.308934, "o", "p"] [7.341736, "o", "-"] [7.391894, "o", "t"] [7.488804, "o", "o"] [7.565371, "o", "-"] [7.673841, "o", "d"] [7.691235, "o", "a"] [7.730541, "o", "t"] [7.779885, "o", "e"] [7.82105, "o", " "] [7.857857, "o", "v"] [7.973835, "o", "e"] [8.005875, "o", "r"] [8.03317, "o", "s"] [8.04773, "o", "i"] [8.05921, "o", "o"] [8.108989, "o", "n"] [8.309151, "o", " "] [8.382718, "o", "o"] [8.395123, "o", "f"] [8.53363, "o", " "] [8.575906, "o", "b"] [8.633447, "o", "o"] [8.710623, "o", "r"] [8.738389, "o", "g"] [8.887713, "o", " "] [9.045955, "o", "o"] [9.085246, "o", "r"] [9.157826, "o", " "] [9.241871, "o", "n"] [9.2714, "o", "o"] [9.285859, "o", " "] [9.381743, "o", "p"] [9.391193, "o", "a"] [9.572886, "o", "c"] [9.582362, "o", "k"] [9.648051, "o", "a"] [9.657843, "o", "g"] [9.718129, "o", "e"] [9.732774, "o", " "] [9.757155, "o", "i"] [9.946487, "o", "s"] [10.107944, "o", " "] [10.195191, "o", "a"] [10.22102, "o", "v"] [10.230446, "o", "a"] [10.311846, "o", "i"] [10.393675, "o", "l"] [10.453805, "o", "a"] [10.475504, "o", "b"] [10.55474, "o", "l"] [10.585603, "o", "e"] [10.785858, "o", " "] [10.81877, "o", "f"] [10.828264, "o", "o"] [10.83782, "o", "r"] [10.869826, "o", " "] [11.040749, "o", "y"] [11.069832, "o", "o"] [11.106365, "o", "u"] [11.144892, "o", "r"] [11.345408, "o", " "] [11.396637, "o", "d"] [11.421235, "o", "i"] [11.577404, "o", "s"] [11.602081, "o", "t"] [11.621845, "o", "r"] [11.652436, "o", "o"] [11.709814, "o", "/"] [11.719056, "o", "O"] [11.763376, "o", "S"] [11.849898, "o", "."] [11.923473, "o", "\r\n"] [11.930008, "o", "$ \r\n"] [11.934924, "o", "$ #"] [12.07232, "o", " "] [12.084395, "o", "F"] [12.280637, "o", "i"] [12.347896, "o", "r"] [12.477136, "o", "s"] [12.486354, "o", "t"] [12.562609, "o", ","] [12.571853, "o", " "] [12.581063, "o", "w"] [12.656333, "o", "e"] [12.672544, "o", " "] [12.78082, "o", "n"] [12.789995, "o", "e"] [12.799208, "o", "e"] [12.81747, "o", "d"] [12.897764, "o", " "] [12.951046, "o", "t"] [12.961262, "o", "o"] [13.161539, "o", " "] [13.246799, "o", "d"] [13.367039, "o", "o"] [13.388292, "o", "w"] [13.397491, "o", "n"] [13.406729, "o", "l"] [13.44496, "o", "o"] [13.57222, "o", "a"] [13.60648, "o", "d"] [13.618687, "o", " "] [13.64895, "o", "t"] [13.758167, "o", "h"] [13.7754, "o", "e"] [13.824655, "o", " "] [13.929823, "o", "v"] [13.939035, "o", "e"] [14.053307, "o", "r"] [14.134551, "o", "s"] [14.143768, "o", "i"] [14.155002, "o", "o"] [14.304273, "o", "n"] [14.504522, "o", ","] [14.702776, "o", " "] [14.805964, "o", "w"] [14.84922, "o", "e"] [15.001462, "o", "'"] [15.073745, "o", "d"] [15.18095, "o", " "] [15.19016, "o", "l"] [15.200396, "o", "i"] [15.292691, "o", "k"] [15.301811, "o", "e"] [15.311038, "o", " "] [15.348299, "o", "t"] [15.358512, "o", "o"] [15.558793, "o", " "] [15.612999, "o", "i"] [15.677237, "o", "n"] [15.724497, "o", "s"] [15.733689, "o", "t"] [15.826957, "o", "a"] [15.836163, "o", "l"] [15.920434, "o", "l"] [16.120714, "o", "…"] [16.133834, "o", "\r\n"] [16.140577, "o", "$ w"] [16.205727, "o", "g"] [16.214938, "o", "e"] [16.230177, "o", "t"] [16.331425, "o", " "] [16.34063, "o", "-"] [16.540913, "o", "q"] [16.581185, "o", " "] [16.590402, "o", "-"] [16.689716, "o", "-"] [16.80895, "o", "s"] [16.858176, "o", "h"] [16.883419, "o", "o"] [16.924718, "o", "w"] [17.055923, "o", "-"] [17.100182, "o", "p"] [17.109385, "o", "r"] [17.189703, "o", "o"] [17.212934, "o", "g"] [17.24417, "o", "r"] [17.439442, "o", "e"] [17.456641, "o", "s"] [17.572948, "o", "s"] [17.636192, "o", " "] [17.692451, "o", "h"] [17.780737, "o", "t"] [17.789845, "o", "t"] [17.825103, "o", "p"] [17.876375, "o", "s"] [18.076633, "o", ":"] [18.142884, "o", "/"] [18.152087, "o", "/"] [18.186329, "o", "g"] [18.235563, "o", "i"] [18.244785, "o", "t"] [18.253969, "o", "h"] [18.31823, "o", "u"] [18.327417, "o", "b"] [18.389743, "o", "."] [18.431976, "o", "c"] [18.50525, "o", "o"] [18.514446, "o", "m"] [18.536746, "o", "/"] [18.54586, "o", "b"] [18.578085, "o", "o"] [18.638338, "o", "r"] [18.708609, "o", "g"] [18.735857, "o", "b"] [18.770084, "o", "a"] [18.779288, "o", "c"] [18.834558, "o", "k"] [18.84879, "o", "u"] [18.859012, "o", "p"] [18.944287, "o", "/"] [18.978548, "o", "b"] [19.079789, "o", "o"] [19.105012, "o", "r"] [19.148268, "o", "g"] [19.164519, "o", "/"] [19.249746, "o", "r"] [19.271014, "o", "e"] [19.37926, "o", "l"] [19.438524, "o", "e"] [19.530793, "o", "a"] [19.546996, "o", "s"] [19.64026, "o", "e"] [19.70851, "o", "s"] [19.860819, "o", "/"] [19.931099, "o", "d"] [20.12236, "o", "o"] [20.131597, "o", "w"] [20.168902, "o", "n"] [20.178072, "o", "l"] [20.19734, "o", "o"] [20.255574, "o", "a"] [20.278822, "o", "d"] [20.441069, "o", "/"] [20.453262, "o", "1"] [20.613542, "o", "."] [20.631798, "o", "2"] [20.643995, "o", "."] [20.657161, "o", "1"] [20.696419, "o", "/"] [20.714662, "o", "b"] [20.797846, "o", "o"] [20.84203, "o", "r"] [20.988304, "o", "g"] [21.012612, "o", "-"] [21.021913, "o", "l"] [21.031187, "o", "i"] [21.111465, "o", "n"] [21.147724, "o", "u"] [21.217034, "o", "x"] [21.25131, "o", "6"] [21.260514, "o", "4"] [21.425711, "o", "\r\n"] [22.122156, "o", "\rborg-linux64 0%[ ] 0 --.-KB/s "] [22.325471, "o", "\rborg-linux64 6%[> ] 1.33M 6.59MB/s "] [22.526514, "o", "\rborg-linux64 13%[=> ] 3.04M 7.52MB/s "] [22.728037, "o", "\rborg-linux64 22%[===> ] 4.88M 8.06MB/s "] [22.928693, "o", "\rborg-linux64 30%[=====> ] 6.69M 8.30MB/s "] [23.130437, "o", "\rborg-linux64 38%[======> ] 8.35M 8.28MB/s "] [23.331937, "o", "\rborg-linux64 45%[========> ] 10.01M 8.27MB/s "] [23.589691, "o", "\rborg-linux64 53%[=========> ] 11.65M 7.95MB/s "] [23.789016, "o", "\rborg-linux64 64%[===========> ] 14.08M 8.45MB/s "] [23.989182, "o", "\rborg-linux64 72%[=============> ] 15.90M 8.52MB/s "] [24.189963, "o", "\rborg-linux64 81%[===============> ] 17.74M 8.58MB/s "] [24.391128, "o", "\rborg-linux64 90%[=================> ] 19.71M 8.69MB/s "] [24.591843, "o", "\rborg-linux64 99%[==================> ] 21.73M 8.80MB/s "] [24.605717, "o", "\rborg-linux64 100%[===================>] 21.87M 8.80MB/s in 2.5s \r\r\n"] [24.607438, "o", "$ #"] [24.711803, "o", " "] [24.756021, "o", "a"] [24.857266, "o", "n"] [24.95354, "o", "d"] [25.079747, "o", " "] [25.105032, "o", "d"] [25.173253, "o", "o"] [25.342493, "o", " "] [25.437792, "o", "n"] [25.545976, "o", "o"] [25.57012, "o", "t"] [25.750321, "o", " "] [25.780607, "o", "f"] [25.839866, "o", "o"] [25.989118, "o", "r"] [26.047359, "o", "g"] [26.125925, "o", "e"] [26.13532, "o", "t"] [26.205567, "o", " "] [26.229863, "o", "t"] [26.297164, "o", "h"] [26.330399, "o", "e"] [26.369653, "o", " "] [26.41591, "o", "G"] [26.42509, "o", "P"] [26.472358, "o", "G"] [26.485557, "o", " "] [26.525908, "o", "s"] [26.594062, "o", "i"] [26.730283, "o", "g"] [26.785586, "o", "n"] [26.809996, "o", "a"] [26.827218, "o", "t"] [26.865434, "o", "u"] [26.874623, "o", "r"] [26.949922, "o", "e"] [27.071147, "o", "…"] [27.108423, "o", "!"] [27.13146, "o", "\r\n"] [27.138689, "o", "$ w"] [27.164997, "o", "g"] [27.235295, "o", "e"] [27.24448, "o", "t"] [27.44489, "o", " "] [27.456982, "o", "-"] [27.466218, "o", "q"] [27.548499, "o", " "] [27.557754, "o", "-"] [27.676013, "o", "-"] [27.765225, "o", "s"] [27.774412, "o", "h"] [27.82672, "o", "o"] [27.835881, "o", "w"] [27.903196, "o", "-"] [27.912432, "o", "p"] [27.921642, "o", "r"] [27.930901, "o", "o"] [27.940177, "o", "g"] [28.000419, "o", "r"] [28.049667, "o", "e"] [28.058871, "o", "s"] [28.068098, "o", "s"] [28.077311, "o", " "] [28.086537, "o", "h"] [28.116886, "o", "t"] [28.125965, "o", "t"] [28.262193, "o", "p"] [28.271401, "o", "s"] [28.354675, "o", ":"] [28.371903, "o", "/"] [28.4042, "o", "/"] [28.473444, "o", "g"] [28.482611, "o", "i"] [28.533931, "o", "t"] [28.581202, "o", "h"] [28.596485, "o", "u"] [28.633743, "o", "b"] [28.833992, "o", "."] [28.84319, "o", "c"] [28.854415, "o", "o"] [28.893704, "o", "m"] [28.917922, "o", "/"] [28.966099, "o", "b"] [29.016343, "o", "o"] [29.048615, "o", "r"] [29.099864, "o", "g"] [29.176115, "o", "b"] [29.198358, "o", "a"] [29.239604, "o", "c"] [29.253897, "o", "k"] [29.454082, "o", "u"] [29.507152, "o", "p"] [29.525347, "o", "/"] [29.599604, "o", "b"] [29.682859, "o", "o"] [29.731069, "o", "r"] [29.774349, "o", "g"] [29.846616, "o", "/"] [29.885768, "o", "r"] [30.007016, "o", "e"] [30.091268, "o", "l"] [30.170547, "o", "e"] [30.224826, "o", "a"] [30.327058, "o", "s"] [30.338255, "o", "e"] [30.347493, "o", "s"] [30.362751, "o", "/"] [30.428961, "o", "d"] [30.629286, "o", "o"] [30.640516, "o", "w"] [30.700784, "o", "n"] [30.740021, "o", "l"] [30.75024, "o", "o"] [30.769489, "o", "a"] [30.920759, "o", "d"] [30.978979, "o", "/"] [31.143241, "o", "1"] [31.213513, "o", "."] [31.294751, "o", "2"] [31.369956, "o", "."] [31.441199, "o", "1"] [31.522445, "o", "/"] [31.681726, "o", "b"] [31.7419, "o", "o"] [31.762117, "o", "r"] [31.800363, "o", "g"] [31.809617, "o", "-"] [31.93189, "o", "l"] [31.941089, "o", "i"] [31.991348, "o", "n"] [32.078615, "o", "u"] [32.181768, "o", "x"] [32.192943, "o", "6"] [32.207217, "o", "4"] [32.279486, "o", "."] [32.305741, "o", "a"] [32.324004, "o", "s"] [32.352294, "o", "c"] [32.553465, "o", "\r\n"] [33.113725, "o", "\rborg-linux64.asc 0%[ ] 0 --.-KB/s "] [33.114471, "o", "\rborg-linux64.asc 100%[===================>] 862 --.-KB/s in 0s "] [33.115443, "o", "\r\r\n"] [33.116813, "o", "$ "] [33.116988, "o", "\r\n"] [33.121869, "o", "$ #"] [33.16912, "o", " "] [33.216381, "o", "I"] [33.238635, "o", "n"] [33.438905, "o", " "] [33.45917, "o", "t"] [33.540412, "o", "h"] [33.594643, "o", "i"] [33.684918, "o", "s"] [33.777142, "o", " "] [33.9464, "o", "c"] [33.968656, "o", "a"] [33.977801, "o", "s"] [34.107087, "o", "e"] [34.116346, "o", ","] [34.131568, "o", " "] [34.144888, "o", "w"] [34.15405, "o", "e"] [34.174323, "o", " "] [34.183524, "o", "h"] [34.223794, "o", "a"] [34.298019, "o", "v"] [34.359288, "o", "e"] [34.501551, "o", " "] [34.510743, "o", "a"] [34.523012, "o", "l"] [34.663265, "o", "r"] [34.68352, "o", "e"] [34.710755, "o", "a"] [34.759018, "o", "d"] [34.784347, "o", "y"] [34.957675, "o", " "] [34.966934, "o", "i"] [35.042172, "o", "m"] [35.052399, "o", "p"] [35.113748, "o", "o"] [35.123019, "o", "r"] [35.323308, "o", "t"] [35.346586, "o", "e"] [35.408868, "o", "d"] [35.453094, "o", " "] [35.46233, "o", "t"] [35.471566, "o", "h"] [35.488874, "o", "e"] [35.498087, "o", " "] [35.507337, "o", "p"] [35.548601, "o", "u"] [35.55776, "o", "b"] [35.566991, "o", "l"] [35.635262, "o", "i"] [35.644481, "o", "c"] [35.745742, "o", " "] [35.763015, "o", "k"] [35.845261, "o", "e"] [35.854518, "o", "y"] [35.893716, "o", " "] [35.973922, "o", "o"] [36.078141, "o", "f"] [36.13339, "o", " "] [36.145654, "o", "a"] [36.213852, "o", " "] [36.259106, "o", "b"] [36.268328, "o", "o"] [36.303574, "o", "r"] [36.326849, "o", "g"] [36.527126, "o", " "] [36.72738, "o", "d"] [36.741621, "o", "e"] [36.81091, "o", "v"] [36.833128, "o", "e"] [37.011383, "o", "l"] [37.020627, "o", "o"] [37.051895, "o", "p"] [37.139138, "o", "e"] [37.165375, "o", "r"] [37.196621, "o", "."] [37.387884, "o", " "] [37.455143, "o", "S"] [37.46434, "o", "o"] [37.638618, "o", " "] [37.671888, "o", "w"] [37.682073, "o", "e"] [37.744311, "o", " "] [37.783588, "o", "o"] [37.98384, "o", "n"] [38.009046, "o", "l"] [38.060303, "o", "y"] [38.216548, "o", " "] [38.231823, "o", "n"] [38.323064, "o", "e"] [38.398326, "o", "e"] [38.436586, "o", "d"] [38.493752, "o", " "] [38.581003, "o", "t"] [38.664281, "o", "o"] [38.751561, "o", " "] [38.79584, "o", "v"] [38.87505, "o", "e"] [38.92131, "o", "r"] [38.930503, "o", "i"] [39.0568, "o", "f"] [39.077954, "o", "y"] [39.103209, "o", " "] [39.112401, "o", "i"] [39.121714, "o", "t"] [39.173003, "o", ":"] [39.184854, "o", "\r\n"] [39.190079, "o", "$ g"] [39.199322, "o", "p"] [39.215605, "o", "g"] [39.415869, "o", " "] [39.441075, "o", "-"] [39.472334, "o", "-"] [39.483535, "o", "v"] [39.546835, "o", "e"] [39.560054, "o", "r"] [39.583316, "o", "i"] [39.605629, "o", "f"] [39.683888, "o", "y"] [39.738098, "o", " "] [39.749313, "o", "b"] [39.791608, "o", "o"] [39.951853, "o", "r"] [40.003141, "o", "g"] [40.021369, "o", "-"] [40.06064, "o", "l"] [40.260916, "o", "i"] [40.298124, "o", "n"] [40.318369, "o", "u"] [40.363631, "o", "x"] [40.41488, "o", "6"] [40.424082, "o", "4"] [40.624368, "o", "."] [40.674613, "o", "a"] [40.684742, "o", "s"] [40.693927, "o", "c"] [40.860898, "o", "\r\n"] [40.870862, "o", "gpg: assuming signed data in 'borg-linux64'\r\r\n"] [40.991536, "o", "gpg: Signature made Sun Jun 5 21:37:49 2022 UTC\r\r\ngpg: using RSA key 2F81AFFBAB04E11FE8EE65D4243ACFA951F78E01\r\r\ngpg: issuer \"tw@waldmann-edv.de\"\r\r\n"] [40.993561, "o", "gpg: Good signature from \"Thomas Waldmann \" [unknown]\r\r\ngpg: aka \"Thomas Waldmann \" [unknown]\r\r\ngpg: aka \"Thomas Waldmann \" [unknown]\r\r\n"] [40.993881, "o", "gpg: aka \"Thomas Waldmann \" [unknown]\r\r\n"] [40.995059, "o", "gpg: WARNING: This key is not certified with a trusted signature!\r\r\ngpg: There is no indication that the signature belongs to the owner.\r\r\nPrimary key fingerprint: 6D5B EF9A DD20 7580 5747 B70F 9F88 FB52 FAF7 B393\r\r\n Subkey fingerprint: 2F81 AFFB AB04 E11F E8EE 65D4 243A CFA9 51F7 8E01\r\r\n"] [40.995876, "o", "$ #"] [41.005075, "o", " "] [41.069956, "o", "O"] [41.098443, "o", "k"] [41.17776, "o", "a"] [41.292576, "o", "y"] [41.493851, "o", ","] [41.569465, "o", " "] [41.617829, "o", "t"] [41.738039, "o", "h"] [41.747542, "o", "e"] [41.94792, "o", " "] [41.979034, "o", "b"] [42.021223, "o", "i"] [42.1784, "o", "n"] [42.262162, "o", "a"] [42.281862, "o", "r"] [42.327452, "o", "y"] [42.465774, "o", " "] [42.559207, "o", "i"] [42.581862, "o", "s"] [42.614201, "o", " "] [42.624612, "o", "v"] [42.782706, "o", "a"] [42.841839, "o", "l"] [42.853148, "o", "i"] [42.909309, "o", "d"] [42.949832, "o", "!"] [42.960042, "o", "\r\n"] [42.966483, "o", "$ \r\n"] [42.970541, "o", "$ #"] [43.010934, "o", " "] [43.061848, "o", "N"] [43.113854, "o", "o"] [43.314271, "o", "w"] [43.367734, "o", " "] [43.38522, "o", "i"] [43.440638, "o", "n"] [43.453794, "o", "s"] [43.58115, "o", "t"] [43.602848, "o", "a"] [43.612287, "o", "l"] [43.66838, "o", "l"] [43.757865, "o", " "] [43.816951, "o", "i"] [43.867188, "o", "t"] [43.918628, "o", ":"] [44.119535, "o", "\r\n"] [44.126514, "o", "$ s"] [44.137836, "o", "u"] [44.230129, "o", "d"] [44.252649, "o", "o"] [44.277864, "o", " "] [44.357858, "o", "c"] [44.37639, "o", "p"] [44.483759, "o", " "] [44.558149, "o", "b"] [44.629854, "o", "o"] [44.701844, "o", "r"] [44.763291, "o", "g"] [44.845639, "o", "-"] [44.900115, "o", "l"] [44.909474, "o", "i"] [45.058144, "o", "n"] [45.067669, "o", "u"] [45.077063, "o", "x"] [45.09981, "o", "6"] [45.122149, "o", "4"] [45.183708, "o", " "] [45.205868, "o", "/"] [45.222081, "o", "u"] [45.265325, "o", "s"] [45.297806, "o", "r"] [45.429847, "o", "/"] [45.439219, "o", "l"] [45.448719, "o", "o"] [45.473872, "o", "c"] [45.494395, "o", "a"] [45.609828, "o", "l"] [45.654127, "o", "/"] [45.688425, "o", "b"] [45.72362, "o", "i"] [45.787042, "o", "n"] [45.849829, "o", "/"] [45.859297, "o", "b"] [45.939606, "o", "o"] [45.949095, "o", "r"] [46.042557, "o", "g"] [46.12613, "o", "\r\n"] [46.172357, "o", "$ s"] [46.212876, "o", "u"] [46.325809, "o", "d"] [46.344195, "o", "o"] [46.431558, "o", " "] [46.522936, "o", "c"] [46.546729, "o", "h"] [46.570006, "o", "o"] [46.7523, "o", "w"] [46.819922, "o", "n"] [46.911633, "o", " "] [46.929206, "o", "r"] [47.008063, "o", "o"] [47.157866, "o", "o"] [47.225417, "o", "t"] [47.301865, "o", ":"] [47.31111, "o", "r"] [47.362558, "o", "o"] [47.41601, "o", "o"] [47.446448, "o", "t"] [47.482538, "o", " "] [47.560369, "o", "/"] [47.623683, "o", "u"] [47.708182, "o", "s"] [47.743531, "o", "r"] [47.764228, "o", "/"] [47.872949, "o", "l"] [47.882292, "o", "o"] [47.891809, "o", "c"] [47.926001, "o", "a"] [47.952744, "o", "l"] [48.082119, "o", "/"] [48.168883, "o", "b"] [48.181753, "o", "i"] [48.191226, "o", "n"] [48.242791, "o", "/"] [48.298909, "o", "b"] [48.325598, "o", "o"] [48.364784, "o", "r"] [48.41717, "o", "g"] [48.618559, "o", "\r\n"] [48.636317, "o", "$ #"] [48.699577, "o", " "] [48.761734, "o", "a"] [48.860994, "o", "n"] [48.891258, "o", "d"] [48.90051, "o", " "] [49.089716, "o", "m"] [49.191956, "o", "a"] [49.220201, "o", "k"] [49.231415, "o", "e"] [49.250657, "o", " "] [49.262875, "o", "i"] [49.389135, "o", "t"] [49.58942, "o", " "] [49.623673, "o", "e"] [49.726909, "o", "x"] [49.778141, "o", "e"] [49.820374, "o", "c"] [49.883634, "o", "u"] [49.89287, "o", "t"] [49.96108, "o", "a"] [49.99032, "o", "b"] [50.164588, "o", "l"] [50.248871, "o", "e"] [50.315101, "o", "…"] [50.324917, "o", "\r\n"] [50.33024, "o", "$ s"] [50.444521, "o", "u"] [50.474784, "o", "d"] [50.600042, "o", "o"] [50.771296, "o", " "] [50.794535, "o", "c"] [50.845756, "o", "h"] [50.864021, "o", "m"] [50.873172, "o", "o"] [50.974454, "o", "d"] [50.983643, "o", " "] [51.052941, "o", "7"] [51.120224, "o", "5"] [51.15648, "o", "5"] [51.357071, "o", " "] [51.41431, "o", "/"] [51.481616, "o", "u"] [51.532876, "o", "s"] [51.562085, "o", "r"] [51.588324, "o", "/"] [51.604621, "o", "l"] [51.613907, "o", "o"] [51.656228, "o", "c"] [51.665393, "o", "a"] [51.67459, "o", "l"] [51.683892, "o", "/"] [51.696188, "o", "b"] [51.764495, "o", "i"] [51.820817, "o", "n"] [51.945194, "o", "/"] [52.055405, "o", "b"] [52.195699, "o", "o"] [52.218896, "o", "r"] [52.228068, "o", "g"] [52.424062, "o", "\r\n"] [52.440156, "o", "$ \r\n"] [52.442959, "o", "$ #"] [52.45844, "o", " "] [52.473717, "o", "N"] [52.508037, "o", "o"] [52.51717, "o", "w"] [52.56058, "o", " "] [52.574808, "o", "c"] [52.625984, "o", "h"] [52.728251, "o", "e"] [52.906625, "o", "c"] [52.926856, "o", "k"] [52.974077, "o", " "] [52.9983, "o", "i"] [53.037619, "o", "t"] [53.085974, "o", ":"] [53.141237, "o", " "] [53.167627, "o", "("] [53.231899, "o", "p"] [53.261185, "o", "o"] [53.287514, "o", "s"] [53.371779, "o", "s"] [53.427951, "o", "i"] [53.437239, "o", "b"] [53.470586, "o", "l"] [53.494825, "o", "y"] [53.665141, "o", " "] [53.693108, "o", "n"] [53.765334, "o", "e"] [53.902605, "o", "e"] [53.911802, "o", "d"] [53.977067, "o", "s"] [53.998324, "o", " "] [54.017644, "o", "a"] [54.026845, "o", " "] [54.058086, "o", "t"] [54.071336, "o", "e"] [54.080542, "o", "r"] [54.112803, "o", "m"] [54.218011, "o", "i"] [54.291263, "o", "n"] [54.321518, "o", "a"] [54.513747, "o", "l"] [54.529947, "o", " "] [54.621171, "o", "r"] [54.65843, "o", "e"] [54.675688, "o", "s"] [54.69193, "o", "t"] [54.752183, "o", "a"] [54.761376, "o", "r"] [54.826641, "o", "t"] [54.837793, "o", ")"] [54.929883, "o", "\r\n"] [54.936116, "o", "$ b"] [54.945364, "o", "o"] [54.954567, "o", "r"] [54.995831, "o", "g"] [55.094044, "o", " "] [55.1113, "o", "-"] [55.120527, "o", "V"] [55.161722, "o", "\r\n"] [55.941702, "o", "borg 1.2.1"] [55.942305, "o", "\r\r\n"] [55.993719, "o", "$ \r\n"] [55.997213, "o", "$ #"] [56.034666, "o", " "] [56.063952, "o", "T"] [56.110197, "o", "h"] [56.182455, "o", "a"] [56.23975, "o", "t"] [56.309047, "o", "'"] [56.32334, "o", "s"] [56.405649, "o", " "] [56.420997, "o", "i"] [56.452158, "o", "t"] [56.489524, "o", "!"] [56.499708, "o", " "] [56.517909, "o", "C"] [56.564198, "o", "h"] [56.597539, "o", "e"] [56.619709, "o", "c"] [56.63787, "o", "k"] [56.67012, "o", " "] [56.679362, "o", "o"] [56.689617, "o", "u"] [56.79894, "o", "t"] [56.808157, "o", " "] [56.820469, "o", "t"] [57.020769, "o", "h"] [57.067066, "o", "e"] [57.164398, "o", " "] [57.180648, "o", "o"] [57.211946, "o", "t"] [57.370177, "o", "h"] [57.396486, "o", "e"] [57.405783, "o", "r"] [57.435073, "o", " "] [57.484351, "o", "s"] [57.513656, "o", "c"] [57.591941, "o", "r"] [57.610164, "o", "e"] [57.754423, "o", "e"] [57.76372, "o", "n"] [57.815018, "o", "c"] [58.015317, "o", "a"] [58.050594, "o", "s"] [58.2029, "o", "t"] [58.212147, "o", "s"] [58.300444, "o", " "] [58.340736, "o", "t"] [58.394987, "o", "o"] [58.595282, "o", " "] [58.693538, "o", "s"] [58.755821, "o", "e"] [58.838122, "o", "e"] [58.847379, "o", " "] [58.892674, "o", "h"] [58.986978, "o", "o"] [58.996253, "o", "w"] [59.084591, "o", " "] [59.096866, "o", "t"] [59.124943, "o", "o"] [59.226381, "o", " "] [59.256843, "o", "a"] [59.26637, "o", "c"] [59.350895, "o", "t"] [59.388513, "o", "u"] [59.399086, "o", "a"] [59.42835, "o", "l"] [59.495588, "o", "l"] [59.695833, "o", "y"] [59.837075, "o", " "] [59.867315, "o", "u"] [59.945609, "o", "s"] [59.954833, "o", "e"] [60.01306, "o", " "] [60.030314, "o", "b"] [60.039559, "o", "o"] [60.086806, "o", "r"] [60.14006, "o", "g"] [60.169338, "o", "b"] [60.178534, "o", "a"] [60.201718, "o", "c"] [60.210988, "o", "k"] [60.28122, "o", "u"] [60.43448, "o", "p"] [60.447748, "o", "."] [60.469955, "o", "\r\n"] ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/misc/asciinema/install.tcl0000644000076500000240000000244014641074756020214 0ustar00twstaff# Configuration for send -h # Tries to emulate a human typing # Tweak this if typing is too fast or too slow set send_human {.05 .1 1 .01 .2} set script [string trim { # This asciinema will show you the installation of borg as a standalone binary. Usually you only need this if you want to have an up-to-date version of borg or no package is available for your distro/OS. # First, we need to download the version, we'd like to install… wget -q --show-progress https://github.com/borgbackup/borg/releases/download/1.2.1/borg-linux64 # and do not forget the GPG signature…! wget -q --show-progress https://github.com/borgbackup/borg/releases/download/1.2.1/borg-linux64.asc # In this case, we have already imported the public key of a borg developer. So we only need to verify it: gpg --verify borg-linux64.asc # Okay, the binary is valid! # Now install it: sudo cp borg-linux64 /usr/local/bin/borg sudo chown root:root /usr/local/bin/borg # and make it executable… sudo chmod 755 /usr/local/bin/borg # Now check it: (possibly needs a terminal restart) borg -V # That's it! Check out the other screencasts to see how to actually use borgbackup. }] # wget may be slow set timeout -1 foreach line [split $script \n] { send_user "$ " send_user -h $line\n spawn -noecho /bin/sh -c $line expect eof } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/misc/asciinema/sample-wallpapers.txt0000644000076500000240000000567714641074756022253 0ustar00twstaffhttps://upload.wikimedia.org/wikipedia/commons/2/22/Pseudo_kleinian_001_OpenCL_45154214_8K.jpg https://upload.wikimedia.org/wikipedia/commons/d/da/Mengerschwamm_Iteration_5_x_Mandelbulb_OpenCL_528814521414_8K.jpg https://upload.wikimedia.org/wikipedia/commons/e/eb/Blixos_logon_screen.jpg https://upload.wikimedia.org/wikipedia/commons/9/90/Great_smokey_mountains_national_park_with_woman_sitting_under_tree_in_foreground.jpg https://upload.wikimedia.org/wikipedia/commons/d/d2/Mengerschwamm_x_Generalized_Fold_Box_OpenCL_18915424_8K.jpg https://upload.wikimedia.org/wikipedia/commons/3/3d/Red_interesting_background.jpg https://upload.wikimedia.org/wikipedia/commons/4/43/KIFS_OpenCL_54815_5K.jpg https://upload.wikimedia.org/wikipedia/commons/a/a1/ProjectStealth.png https://upload.wikimedia.org/wikipedia/commons/8/8d/KIFS_OpenCL_5434735835_5K.jpg https://upload.wikimedia.org/wikipedia/commons/d/db/Harvett_Fox_-_Wallpaper_%2816x9_ratio%2C_without_character_logo%2C_transparent_variant%29_%28vector_version%29.svg https://upload.wikimedia.org/wikipedia/commons/7/7f/Generalized_Fold_Box_OpenCL_4258952414_8K.jpg https://upload.wikimedia.org/wikipedia/commons/5/58/Mandelbox_Vary_Scale_4D_OpenCL_9648145412_8K.jpg https://upload.wikimedia.org/wikipedia/commons/6/62/Trapper_cabin.jpg https://upload.wikimedia.org/wikipedia/commons/f/fd/Openarch.png https://upload.wikimedia.org/wikipedia/commons/a/a5/Mandelbox_-_Variable_8K_6595424.jpg https://upload.wikimedia.org/wikipedia/commons/d/d6/Mengerschwamm_Iteration_6_x_Generalized_Fold_Box_OpenCL_14048152404910_8K.jpg https://upload.wikimedia.org/wikipedia/commons/c/cf/Sierp_Oktaeder_x_Menger_4D_OpenCL_51241841541_8K.jpg https://upload.wikimedia.org/wikipedia/commons/5/59/Airbus_Wing_01798_changed.jpg https://upload.wikimedia.org/wikipedia/commons/8/8a/Holytrinfruitlandpark1b.jpg https://upload.wikimedia.org/wikipedia/commons/5/5c/Abox_-_Mod_12_OpenCL_45184521485_5K.jpg https://upload.wikimedia.org/wikipedia/commons/d/d2/Menger_4D_x_Quaternion_OpenCL_644289452_8K.jpg https://upload.wikimedia.org/wikipedia/commons/3/3e/Gabrielsond.jpg https://upload.wikimedia.org/wikipedia/commons/8/80/Mix_Pinski_4D_x_Mengerschwamm_OpenCL_461481542_8K.jpg https://upload.wikimedia.org/wikipedia/commons/8/84/Belinda_Vixen_-_Wallpaper_%28without_character_wordmark_and_hair_variant%29_%2816x9_ratio%29.jpg https://upload.wikimedia.org/wikipedia/commons/0/00/Sierp_Oktaeder_Iteration_7_x_Menger_4D_OpenCL_2154188450481_8K.jpg https://upload.wikimedia.org/wikipedia/commons/2/24/Abox_4D_OpenCL_545185481_8K.jpg https://upload.wikimedia.org/wikipedia/commons/0/08/Sierpinski_4D_OpenCL_485274854_5K.jpg https://upload.wikimedia.org/wikipedia/commons/0/09/Vereinigung_Sierpinski_4D_und_Mengerschwamm_OpenCl_6184524.jpg https://upload.wikimedia.org/wikipedia/commons/a/ae/Mengerschwamm_OpenCL_955141845_8K.jpg https://upload.wikimedia.org/wikipedia/commons/6/64/Free_high-resolution_pictures_you_can_use_on_your_personal_and_commercial_projects._%2814168975789%29.jpg ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/misc/benchmark-crud.txt0000644000076500000240000000677414641074756017555 0ustar00twstaffborg benchmark crud =================== Here is some example of borg benchmark crud output. I ran it on my laptop, Core i5-4200u, 8GB RAM, SATA SSD, Linux, ext4 fs. "src" as well as repo is local, on this SSD. $ BORG_PASSPHRASE=secret borg init --encryption repokey-blake2 repo $ BORG_PASSPHRASE=secret borg benchmark crud repo src C-Z-BIG 116.06 MB/s (10 * 100.00 MB all-zero files: 8.62s) R-Z-BIG 197.00 MB/s (10 * 100.00 MB all-zero files: 5.08s) U-Z-BIG 418.07 MB/s (10 * 100.00 MB all-zero files: 2.39s) D-Z-BIG 724.94 MB/s (10 * 100.00 MB all-zero files: 1.38s) C-R-BIG 42.21 MB/s (10 * 100.00 MB random files: 23.69s) R-R-BIG 134.45 MB/s (10 * 100.00 MB random files: 7.44s) U-R-BIG 316.83 MB/s (10 * 100.00 MB random files: 3.16s) D-R-BIG 251.10 MB/s (10 * 100.00 MB random files: 3.98s) C-Z-MEDIUM 118.53 MB/s (1000 * 1.00 MB all-zero files: 8.44s) R-Z-MEDIUM 218.49 MB/s (1000 * 1.00 MB all-zero files: 4.58s) U-Z-MEDIUM 591.59 MB/s (1000 * 1.00 MB all-zero files: 1.69s) D-Z-MEDIUM 730.04 MB/s (1000 * 1.00 MB all-zero files: 1.37s) C-R-MEDIUM 31.46 MB/s (1000 * 1.00 MB random files: 31.79s) R-R-MEDIUM 129.64 MB/s (1000 * 1.00 MB random files: 7.71s) U-R-MEDIUM 621.86 MB/s (1000 * 1.00 MB random files: 1.61s) D-R-MEDIUM 234.82 MB/s (1000 * 1.00 MB random files: 4.26s) C-Z-SMALL 19.81 MB/s (10000 * 10.00 kB all-zero files: 5.05s) R-Z-SMALL 97.69 MB/s (10000 * 10.00 kB all-zero files: 1.02s) U-Z-SMALL 36.35 MB/s (10000 * 10.00 kB all-zero files: 2.75s) D-Z-SMALL 57.04 MB/s (10000 * 10.00 kB all-zero files: 1.75s) C-R-SMALL 9.81 MB/s (10000 * 10.00 kB random files: 10.19s) R-R-SMALL 92.21 MB/s (10000 * 10.00 kB random files: 1.08s) U-R-SMALL 64.62 MB/s (10000 * 10.00 kB random files: 1.55s) D-R-SMALL 51.62 MB/s (10000 * 10.00 kB random files: 1.94s) A second run some time later gave: C-Z-BIG 115.22 MB/s (10 * 100.00 MB all-zero files: 8.68s) R-Z-BIG 196.06 MB/s (10 * 100.00 MB all-zero files: 5.10s) U-Z-BIG 439.50 MB/s (10 * 100.00 MB all-zero files: 2.28s) D-Z-BIG 671.11 MB/s (10 * 100.00 MB all-zero files: 1.49s) C-R-BIG 43.40 MB/s (10 * 100.00 MB random files: 23.04s) R-R-BIG 133.17 MB/s (10 * 100.00 MB random files: 7.51s) U-R-BIG 464.50 MB/s (10 * 100.00 MB random files: 2.15s) D-R-BIG 245.19 MB/s (10 * 100.00 MB random files: 4.08s) C-Z-MEDIUM 110.82 MB/s (1000 * 1.00 MB all-zero files: 9.02s) R-Z-MEDIUM 217.96 MB/s (1000 * 1.00 MB all-zero files: 4.59s) U-Z-MEDIUM 601.54 MB/s (1000 * 1.00 MB all-zero files: 1.66s) D-Z-MEDIUM 686.99 MB/s (1000 * 1.00 MB all-zero files: 1.46s) C-R-MEDIUM 39.91 MB/s (1000 * 1.00 MB random files: 25.06s) R-R-MEDIUM 128.91 MB/s (1000 * 1.00 MB random files: 7.76s) U-R-MEDIUM 599.00 MB/s (1000 * 1.00 MB random files: 1.67s) D-R-MEDIUM 230.69 MB/s (1000 * 1.00 MB random files: 4.33s) C-Z-SMALL 14.78 MB/s (10000 * 10.00 kB all-zero files: 6.76s) R-Z-SMALL 96.86 MB/s (10000 * 10.00 kB all-zero files: 1.03s) U-Z-SMALL 35.22 MB/s (10000 * 10.00 kB all-zero files: 2.84s) D-Z-SMALL 64.93 MB/s (10000 * 10.00 kB all-zero files: 1.54s) C-R-SMALL 11.08 MB/s (10000 * 10.00 kB random files: 9.02s) R-R-SMALL 92.34 MB/s (10000 * 10.00 kB random files: 1.08s) U-R-SMALL 64.49 MB/s (10000 * 10.00 kB random files: 1.55s) D-R-SMALL 46.96 MB/s (10000 * 10.00 kB random files: 2.13s) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/misc/borg-data-flow.png0000644000076500000240000030354714641074756017440 0ustar00twstaffPNG  IHDRPEehJsRGBgAMA a pHYs.#.#x?vIDATxee}'/c~q*fƤ*Qz2vc &# ( D*\HQ"vM7ܺ|~X}9g_^?}^k^{>~ T*@ @PT*T*@ @PT*̃_WՏ~Y,韪O#xSl2N*ծ]FW_]=<9"YSw)u]|WTVTi-sΩ~{mIlê8۰ϟKp~\L=<o߭y;GDx/+`u>3>lkN:묳_5wn4za'@S)e]xUҲ*?Emt:͠{. J9B Y8.(]}ub:'5 @-(IuuԢVFGZVӼ#Q1?Ou kޫ;!H)+N؋c0~Su]-(Hk\v @XؐKS˳uj^YѣU߁uE{5u~n|i9B 23 Q} @X8y@RȓW1u)1Қji?unT Pg5G}n9g4jb8էTSVo[R tgem595ny=GPauԸ>l(5UPN~'tTU*@u϶_^k:P}#B,U*@e5.Y;B=߶/{cz?I`=W{ibYmF:ry%ܴM5m[|,߇i/kj:.m)CCXf \㱱=igZ~|Խ]$1=\~5H7@ͷ)g6 =M6{$C)xsjlwy#\nzqna,oTMMMsT퇮m}mt[爟 ܻ!l<6w?~D/R}} *cMzӡJ΃FU]woXJH6 PRb@O5[w*@m R`5]]'MZu׾z RK Pc=c}i]έ'4n~v_xsF<>jY!1uu  P S4]wjlYu:5 0*?Zimm]aTjʧ>!$-eAΤ爍 Psl ZR{y.(_x|9EBk8/;U9 ?;ƻtgJ:zkP3Pf4w.qԲ+] hR\Ƿ]|mJIԴt Z0#1P.5-4HLAF˝FZR m0:i~n]Kh8֣Y7z i+/)tȕ牾XItJź*qH_ \'9N#Ю B4vLk,*UI^Ce窺ף sێqM򘙇y}ާ;3<7}֗oۗu]wXθ- m7TBm fv ~C߶uUIuhjF:Iq5P7Cv5 *^]Ig0صMf]-e2iz4o"Ug[ PWקmȹ-ɏIZO>C7#6:@mIPջ*֥Pu_پ׫\Iot4)Պt}.h_&}.ZN;@m߷I^ۨgs6UI2@` }|[3b bԡP>-dZ54++%~' PjuQj>3ry}C!UBIþce>%}˂\狰WylםTWW֭;N]_ YY P L`u]O8jנ >i1 bԡs:[CKU},!Q8>AH)$y6`r =N  5uyo:8ب׷ܶq煮sIZ |;P*B k0gP:mR5jW:r TL#u{k#q{1֧6?9L+Vh\.zx `lq޷Z~ ר|瞭/ðPohuzOs*q|nqq?S!@tZBK) MAjS,YY}yPˁP~'6mUINk@-C#@]u@oTkˬ;njH㴎pv8tL30:翜4)<1*@M7죜fCsn>"*cgZDu.' P^cuCJ4b^XdqξUPgQ7nM 26Mc1@]MsOYP0ɃuԺ,s:E:؈u Ϻh37+ۖ^u9ԺEyo6jӗN]濭 iۖ5odϭlN R7pZ 1o()b=6"@,}ץi|_?In3vU*O3@mzmgsҪMum.PN9Pg]!ڬYFܿ*?{OU~oZs6M#ljJTi8+yPWl^|Tԕ PM{ԲiYΫٵ_4eVc#I1ЩO9t{1_i/}"ljL!7[=-M8#Q>~q6 Y״?TC:\,y4Ui܎4Biչܞ>aJ;a7U2N3@ZP -yi]QV0cohLj}]L *hjyvdVjIFYvI>Z*ˆeT7Y*az=@bMYڵuszN+ZV \Ԯj}?ب| .ægi CuI~U(afCu{Ӽ P*@{U;4tܛHM3g+/]tW2{"i`7 @ڶmr{{طuw4(MS7_w\ˮc ;ب[둞i}-{Yyi \ofUO_۶ж-qѵO#@M.o/M|R嗨iۮwmm1|/FE/wuyLa2iЛ_ @@ |P46]/jZ:1Dj]5Qw4 4AZn:sN)7sGi>;TX}Z9*T UMw dR]Juq1?PXVQCT'gOS@ܳ>*2"Ϳ+Ej̓T @PSO=U߿_kc=PÇ={T~uꤓNٲeKu'?0=:F~׻Um߾袋{:v`nGV7p(0=Sւ`}E`w޵/2"\?uN-)0|g1Pg쮻Z N_|ꭷ3<6/<ꌪ٢mǎաCR~BԛoY P%:?^zB(X;wU; ۷ڲeK `\/Fܹav_W'XBGs Qm۷o~`1 @ Z{:MoUW]%D} fo`D+w!DmzM|M`yTe&<|j֭kjx饗 @]M{mV#'t *T F? p %\"4֜uYBzA*PWϮ]}kB#`ٟ͟U{9!@ ; @])gqFuw5q^=zT 7MT Pj&>4@*@ o)Dj:T Pj^{M T* @/ P@*@uz-*P{O~#?/~Q}cO#y{n:&YuNEH8rx953X[N?K8Z~wT@:GjT\F@GTW!a -bې~pFͷ-XX.Y~]5)@q$wmKzL7F:\LTŋmՖM0w_1E_NP?n﯅~;vX瞧>rG PT*T@<??/{m;FaYh}C}lY,+^{ ˉ>\xmuԮOGt ,¬M8ۑ¼&ed[d}ٶM}-۶'7>_.ak].7m۶+_umq,6=_ PcCyYX.e3ƨ +;RRK P%P+~oƱ^Ө R*RyN}|cnv͛T@*@]u[i6B HZSվ_'ۙu!uS P+. ǑϿeo}V95[},@T*!|i |m7DN#TRy+ySXh^nlcX>Aml[ii{=NuT P#(? P`ܤCT*Km#D P̭C4۽}"@Tnv7{Uʊ9O/C P P* @T@*@T PU PT* @3P_}U5T@*@U PuE|wVW\q PɽQ[u\x#< Pyx˘F PYj"6UzUp P $Pqj-@{@ PT*T@*@G_~y|`&1?em߾:x`2w?pg?뵭x|ܷv mJj],ZWU"1u" mna,'~dc5jW5iXզi]TꂋJ<$LTj˴rYJ3=117!B9"ĭ{ض|=j|[SțTʫV T* @.<4lCǼ:.@Md]-miWֵ5usl2w@T wuAk]e6Co*mnԦ3DJ P+.BϺ`:&RmOmj~yZ.#IU P7<@}嗙% n޼mԶl۶mm9̦i]qmuuz>U>o mAd[ / PY5%dz! P}ц-CޡU P 4Mv9v80: PUbPPM7qON>ۂֶnkT@*@wUfS0-'u2 Pk֖?CئJ٘75~W]S @%)`2 CyV] ֶ+@OXƿg6r=bmMqSl7~/˱$@KNM=Ӹoq{9!t-㚖?O j/}ie?mZ]׶OMt Puä3IQQtˊ8pq}O׮kZX~~]WMfU P Ph%`SڧTVF>wxU\nU P+#NCܘ)BoTʋVB ;w~i* @ P= F P P* @T@:M'|ru} 5[n]vU\sXs PjkQF@uϞ='?I^=T@wn"PKV/"@CU7odս+<.KW_}U Ւn$%<n %@Jڿ1#XmO?tiӦ4;vL ճe˖܇B$X]\sMuo{=\!COPIs='@ڻwoug `۷ڼysgi<ֹ+mǎ7׿5".ꪫj O@ ѣG[V=` V@|aryu(40~0$Zx#Pb>ԏ}c`yOSo)@*?g8UFxwO;E̅|z衇O$sF~UO@J5*Q `AEz%ng䥗^Ng>ͥo `ADW_]~ե^;8 /oTu9*R#H=r0~_V7t(8{'z-* @رcp;//GAM6կ~Qw}ɂO~26/8wW\pAE:dS@:W^ye-hoQPMބۿ6o\tI̹]o' رcxM6M iFs @52|@5›pWrAn[ O/s.g1u]7z}SYn<SUj,a9OEZ[%@e1 @]G17jR PC>lu7)R|WFAM6es M '@:j7ᥗ^^}UAΜxBwkﳘ_^{/PA PA PA PA T @@ T @@ T @@ T @@ T @@ T @_*P*P*P*P*PPPA PA PA PA PA PT @@ T @@ T @@ T @@ T @@ T @ @*T @*T @*T @*T @*T @*P*PBGy:vXtСCs+wR}_~_v~~wվB8S38+'x4@{}s{޵TX*<MZt˖-k"RUNS*BU} @UO U)TES*BU} UO U)TES*BU} UOUO U)TT*LR;UOB*TէPQ*BU} PU @*TէP U)TBU} PU @c=VuYխ*@S{ꢋ.o^mݺ:餓ZعsLGVÇG?_}gp;Vu]'< q"ٳgOa 狋p7qt)ޗs @ev 7Tgqh <-[Twbn_kN;jǎѣGae|Z @ KЮ]^{A 8Fpﭷد~Q5j\[f",M?Oz b`}|"LbkxƵ@ 7gP_[? ہ˭}{(XpqvǠdyѼǏw}PaQ䣏>:.Bm 7P]r%$XQQr-_wmPaڢ3Ө\~էMF_,s# @)GgTs.[[?bØvEFsFÇX ¤J]?8"?S رcN$Xmzku /0Ksz.Z-[Tvb'|rꫯ @g-@ qnp0]&0O_?V6?xQۮ۶mU5+*l׏+WnݺU[?vY}#]vYu饗B02)W^x㍕裏Vgu~`w߽wDַN58p *?j׏΃P__״K%*K"x 6<@ k@ ]+qm v(kEt;0:9r5 @h׏+Xv}m*9餓Ӂ5~[ϺÇBo6m"`?aF zc=u=Տ~*Y*PB8g8wTVn|׎n]ۿ?c(xƅ^Xi<ԅu}Rw~wFۿەI*0@ʵGe]]mG;wdtWW5y{; ) yP#0La L$@6:@5* @ee?Q~$ a6qT٫X@%Ԯ 5_F PìP;>y*j\Gv,h?S~믿Ό hEWAc0UFغU]93Zר?<O P\SSv,{VK/z #<,m2ըP*T`Z>< PYv;vT۶mlh `mgyaU*@)@|T6]?NovmKhn2|MmO4 3A`<>M0͹HxySSxio5g޴I 9崭ws`Զnw}†xL~ T@ @eBʥv 濭o04@`)C|)(+obUY]۞~D8tí9TG^;Xлv1lWxZ(4[lS~sg=2]t(ӮXmxp v onc^we4E@inw6oO1ީR3.붡k]EMmzS)U㿳 T@J-Bo}[._be˖l'@̓2*?Nsp85jܮiIJfM5mC^y?G[ڏenr_7=@5* @RسgϨ]nr1 m{V5@ͫ B/|́?oh>O9Fg1(@SO?hק۶mՎ;hgYwgzja]ai^M6wn*a,Q{tGm^{m*j^=xjb> >j?!* @e?j׏^ 1X!SOi+T~}^xσ4W^w@W^y.3_F>z Pc8N͟ɟ,|;a]}ծ]e*9m3-D\Պ}WkT꒷Gp/}i]S6`AHT"@ew 0s07ImMm/w]S R=@׿~BH_D@4>3#\M]V5I' P,]߾}r4QyZV`qjWL#H]5Mb?LOT꒶Gks8G~^y)鶬u:tm~Wg]}咖g$*u:Qkz1ii@UTc38C[?G] R͟ӣ]-ߥ@.>S.>k9g P糾iYܨ5J딮n'";2]?Z9Z5IiUIgQqI "-K7ꪂp/mAf>]|*wiV>A5@KǙ30p/s9 R%@_y>?74}ʗ?]5TH¼ Me9Ш`;ALܦ[|S05G]wN+ HiJ-G\MaoXeB[?^|Y1n:$H]5?yM/Ϩ|^z_u5}Z~>` rC ׶r4mCmuziWa** @޽{Gz뷅t}˪պVՓm1mj>)[ ַ2̧(()X͟/oL>m]3,C~H1-7緝Am0{]tj u&޷u]G{uɟ/3 9i-Mܶk|_q __ P*;v>яnH~b$o PPԺ^]H9IgeźVśoOf惱AlSUᛷiA]{l4Hev"T 6m4-H] P/tԝeMwy #lnr3;庭JާNV}+k},zȽyzzȗG @%Gm6M;@m3i.׺隿t|?Ե;ߕU]!h}n`6 uԼ.Hm]csz|]]Ug4;6:@}4:BY 矽wV?}T8 '-c6Xs6Zm5 zyuK9l iNզi^^;3S`bU Pn\g.jِ22e@uqU5?O-y:jԛßn0#ڎ8BhGuHf^RΓ6IpKqt(6i{ZvקWy P}O  NSJ 9K>oCmkx %@B Gzȩn/*HD%Ngo5ɅzC2 Pc鮿MVyPZo]M7ׯk?+_JuW_}uUWUg}+g7?=y7 ep*@(?f柁C>K%@$ Bs~Vk77+PnT l?Fꆸ+Nt=oߧ n=<{ۗ+M_qמ+M>iQj}Q=qT[n~5Bܠ7pcϡYy:Y+Ժϝt~R̾W.'>k$m]*Cn2@:/"*@4*Tn6uJ;ڴiӨE׿⢽m@(>Bݲ` [&>so} r#<2ѠǦ0k@oAi۾']ol NK1-[oB8Sf P?k /1Btί,+񙺈$_}& PJӦ'~!]$ƍE90~=l^]鎳~~7oSD"` 2 b1e`o[,7_X4Y`1X8U/)mʍ}Qޥπ2_rWVԔ\ԮWT:@?Gyp j7*nsl2?7}1 !/Z-@ͫ~~?aU 0 F`Zw>KL.h;'],Fm6?½/gA<_|CֺϘXVۗM".ofǿR3Ӷƶڶ?s]5oG6ym) อCŔqC˛I+.`ᬃUP%难j : ھ˃˰>74@ #+uhO_}׻WuUz} CTi:~ږVwPWBs8 haVUOR>,(ؼy), N=oX1DU5M#Sj)} R3. 2 PӾP~׾-DݽfNjAn8w[F`cԼkj1EELU]6N#8]le[YF>xI1{ōd_[ @KV矽m!< Xj_!w_&i>U01Ev}XGp* @X9QKE+}TmY[gY?mlW\D9R9@ծg˖-j|P&T TrѪՇ>ӟt_r/4^Clonu޷-M0zu N`vT*PiJtqyu׍8sȑ#՗c 0}w^T Pf'*N*'~yD s|Ali?sc< @Sze9P.YOqg??ծP*΅z/QR мN_wqκGSIDK$1E4P&@y[/~s)PO}?#m̴]?K.D> @3~\ T?~:tw߭?* @@7^}ZR_~[[T |.ѮP*;nRҷ׿څ?^]pG}](@u.rTy~w.*o޼0RuOg* @cqӨFRǏ^zQt0]SzݻwOܮ!kέ`FC8i}ՓO>b;SڴiDj`}PAʔ;v섶̢ѣ]s듴>* @o4]^z饣 [ouabܸ* @T#Gyi_vϵT@ @?s'GEbT&F }* @mY[T$FebT(qUk6$@urT*PYT'xE|vh@ THmMb1G%45p{T*P!sѷ}n9բv~ܸ* @:fRm6lOj 0gnQpaik@ T;mQGP{nmsҮgWwv}@ PQK.?'wyv}@ P PT,cp]@ P @XojӦMՕW^Y>|x1}/]Xy P @eeӅoܹ:3~ SVv횸]* @To1:M?яFm{n_€aBַ&n׏4x@ Pߠa_/v}@ Pyi.~Q[3xٮڼysuwOTuz1pѕG @*oݺ'>7Q_]XhvZӟԹX묉/TBW_8vq|7joi׿ Ka:5qј#_ @* h?3Ggǎ pWԧTB_￿Ї>T}򓟬7 YW??jݻ+b@]vU^z@ T_`FA5\zH>[}ق#`$n(GT*Pʶ/xp)M]0is=]XrJv'M65^ĔFΙTS#p\׾av^z"0.t%$Xm1G|s&W^9<.!i]?nㆧGѮ,{:sHb:;S:'Lwl1Ek٨jZJ_o2Y)1}Qίk:TǏ:vQ"vծBU cXgϞ랣G/OB~{u9t^ĜΕTm֕. .1mXQv}*y8gm?p @*̪?Jwtݨ4c]Xvw݉[K..련Tu(E_>j馛uP`*,8o%Xr7;׵*Pazf: xgO~G5j⼷uֹ͗>߷o_鋜 @;sT-chG˿ip%Ba,{w۝k&֫k1V>6J _]` >\m߾}ji`ż۶m}ϻ&ֻȑ#'[]wծ0 _/O⦞1/|$n\ @*lЀ<7o橭?!).cMxGٻ/;_9ț[0F]0 3b&*$3ʨd$b*41a((~sfש׋k]*zקދ?|i`T|*۷tQG*co^}lْ֭%KթqDq}w34W\qE_L.[ti ؞R8߽ Bo&g>>ָ~\'s5ScE[GL_|$AoV}WԂz_s?>D=C-8MTq"*"/| z`r "KS_|Ŵ@osp3{+~q,bH<PA@>pފGʸ#t~?ާۉ5@_4PA@>K/M9cǎO8A= BHM%>gϞ͎9"FA~ 8q}}4~a{ @@4Ι3';}tvA=*VHpV00ҊST_g39~J MT8[=wI*0T@@E@PPTT@@PA@@@PA@TPA@TP[lٲ;Te˖,ݻ7:#~TˀhѢӟtC]vYV+**0pD'W+OPPA@ gZbƪX}ZHTTPa`j~;TTPA@PPA@B6l޽{.]u{T@@ .l@kZz CPryT4ƟvC@@ThѢW\Yy#zT@@ gҲUⲱڴ}a* 0czՀ+N,*iq8Ȕ@@T*`N5ƪdzf_Q *t5N>PӃGՋiPT@@kA * O@{-TTP-Z4qZ( W+W8T CP۽]T@@ *kYT@@ !hqRq]gq6 *h@ ]vY6F ZѴSZ +ݛEt-Ŀ* * * *  * * *  *T@@PA@@@TPP=/ *  * * *  * ** * ** * * *  * * *  'U@@@TPPTT@@U@TPA@TP[Aщm *̈5kd/6o3gdټyݻw *_~D ]|yj@FFFYfXy@@jjECDV">|8kPٓd]bEdɒ좋.z>@@vj>6}^OPA@YiV C ST@@*TOPP>@@TUV VZ} 'P>@@TBPP>@@BP ST@@VZ} *Xj)* bV * STP*TOP_j)*I*TOP_j)* bj*TOPjBPbէ 5VZ} P ST@@;wfsV^ @_oݺ5[jUbŊl޼yhߜ9sKgw}@@Ç6oޜ@馛={a#ccc{Y f˗/h6>>=:l߾}W|[|_Lc|_zTPa~Oci|8H!5V4Ň_pE4_n ;ߛߗ]tQlٲ,PA@@>G8q_`r?oDȂ^!X*0ʋqΟ?СCLbbԧOn}y/TP]6ߨ'`ӦM(V/;&HAsLx_PA@>׏###m(?OpXu*@`_8/Y/TP#F<}W;X?@ޫ}f ={ ұ~Mh}i"_`@/G"zPA@{|%tC;wn3Ф/Iwm$T8H~+c h`͚5!|IG*0SW>qԞ_xJ0,d׮]B *Խ{" *tp\?Vqj^7֭[ H`j 5"cl B;Μ9318CC:R:bdd${$r>`v=5P/~ c@x se-PBPA@Ҹ~sF$ܸq"(ELw`b뮻 ;v6 *ĸ~0E]=K/_ :|ĸUHS_v@g>$5i7TPqUV2jXΝ;0T`m 2\1~~}Xe###{ٶPA@e8/^!K}|e~@@%9rv *-/f>lvYѣ=c@T@V@=tT֭[/ٽޛ8qi+Tm 2xK,,X@0b?Vvwfc?A~@m3*ո~:}}0#>O7|nl2qT@@PA@"|X),N!& * ұqKQθ~G^fM&~$?+^ * JS"EokOgڱ4\r"MTP@@T<-q?)_A+m? q@j]ve qP@@CcX.>7C7֟5f .k+Kd-v ׊0,u~ *kf_?я%KԵnݺHz7V_6m.Gr@E,aÆl*5{nMZ|݊TT@@>ן?~}/kb,"je>O m@- a MEJ@-v6ʧ/ZhRD^  ҇###yD۾}{_G?_sjyꫯO~2_PC_VjzU*;* cFGGq_W}ҪU^߰X֭[aA/mPk]J+PPA@e޽;Pos:(cjZPPTTz|\ٲeq\SZyL@ۊw*~:_jU6BV/53PU@PA@G#? .S/׊ӋpĪT0fsF5==~A@T@@gϞqggΜ(i@m2i@u}7nyZ*֭tڠ=_ϾX33p vec L Jό/_<_um۶/׿3롇 tr J@mfkqG 뫱fG}FLj6RG! /\0[r\^,IZ"bŊ+]]6l8_=k]&=0Tfn; PTTYl/PmO>PV%Vǿ9h˔cڵk/8Ox{hO#^ V}  *  2|qqPꉃUyޛG{yvɈRvN> 0A@PA@ۗht݆*me>OּLq}/⤯[~ N}޽'a:!uj"߿\3cǎyjE<ύ7~y\PT@@q+VG8mp`@ ZQS׼.~X? /!ujC!ZUig~KOϳ G8cǎخ!>Ƈ_M_&VZR\_l4˗i\&{]jR=ϋ4ϑ|!~.4[qAsСaYhfE*PX8{챑j80bdɐ:5}ZZkjiACω*Pt\?Fcٸ>4+#.rh&v"z@m7 P㵪ObJ4" 2^{m>l\a]U̝;X?LC+*v/APk3U (Ǻf|݈~8O~kW|.TPZ1#؅~O9RiܦrZjUԫKPi(q oo'F-h* R3V4=pU=}USP,zkk5xqaW* *u͈CX?̤KP P#W$:TULdĵt<|t%c9U"E+n3n<<>P״ZWl(^}X@@@u(,Y}k_3Si螱<0z!ujyf!}*:Tsv+PxV+ej4}^(S]tE>gR!VLCjgPH(*堙^3.]ډC@m岵buթ^a8x}a\VTPA@{4VZ)4a i l@Mh ջVV+,,-s'LP_Oa(k~7َTPJqDG u}tWRG/^fj4jtbVPӐ8J'_b?Pշ&#PA@*q 8 Ny]y꧛oYYf|gj8}Si}v*֋qS )<ٕo `Rx/y&:48bOGq jӑ_twy'?Kv5 n@R9Հ/qzZ`G=Z/?SޟaQ4VզBjO@u(obL׿[g[l+>|8;w *Ps遫f2*tӻGg/[_5#jf*Ceݺue({٩S``ۋ]4}ꩧt{W^8o`r@uw˖C:vˠO="jS P(6R1|5dccc"C)\k\Y{ 4Kna'׬YS<ꅱ"e3 rL-GFN5 *@bڟUF۾ई*:b8O ,WXA$~Zq$XyhuRrKSٳgm$@"v;C@-"%\R"?\+RWa4i8j@Hm>?>:QdN+hӛ i)̪]<ױMSq$ ]}T\J@uh~8F?ċQ~8.>$,-P.j}8iˊ?hu\|0'O8]tjw/h%cⱸza/mֺVj_YVYkPR7U._~*tRpjߨ+{2PA@؇c#1/9mPԪXhHzʜn/~]U\uU؅Ti||6 ` 9TtXVn&jjc|m645sZySwf@mj4ISW *@E/_!PA@m~PP;ӕ3SqEE¸>O/袮a ilx.%Kh+x/^,~6i~#5x>˯Mf._<ߵ#cכ_*ycW ذ|/D@"=uo+N/V\[oy8G|+b_w217Ŀ*NӀ:?%ݣ+GTP{?g? bUchſ׬YSP#KYu[5ʷU/ OoFM/Su$4 WZN 2ՀZ\Oܯf?O׏]Xׇ[bŴSPG^PA@J0|_n"E=W^Y4Z5Beru`͈d9+96YuٸLoնX\+:Kܧq}m5Qկ҉q8F]X@Plk~,Jc/nmzD4,jgѱ8}*% qj^lzʁ(}Ǒj"֊iDmPܝէqto|Pڟ HbG_v|C7b+t5gQQ,fN*Z/[gk+Fk]1f4V7N{+ѶcA@T{c*Lu;ȾկvtHX/6訙ZG8{* ̐o} O:4sutVtv@Uڧd@MOyEhz@ td6]ԺPqPfPA@U'N`?V ]j8=Bj`O i(|7j cnz=T@@=~T:{Mlk-ܒر#ڪ8z蚽?2i@M^{r"vWfPӯ[h8Zu}}iX~j~ضmD[{@[K@P:ͻTPX*V6tZw;+LEN"GMCN}Mos*bPzWՁTPǏņiv,"nZvj7XP((V\FLm9-G\>^p([qlmG?} F %KukT:9 7dvjjc7?h"2ƟqZy̽LlVzЦncXYWx qr`%}NӸ(M;uٳ׏pj\P`z agΜ4,VkSciLbիWw$VVq0PoS +8-V6ܤZZ<4kqP#ǸEθsT@@PA@#{oRx≦(Ut?Wk俈ΪӋ9zӫ㴪"Vݯz1"d-"iG(?7wE.zke1<Ɵ1^>8U9rĸ>0#u~PTPX+? Xя~t"#Ɵcj=8p> * *cAbb1+y>VNTX"zwb\?^7PTP!1>>~XjшW^ye[o\ *`?&Uln߾=_+x zO<ӈS `#T@@PA@$XHL#-_|e\nnf * 2bEbLX=cGׯ_o\P@@܀J/JX~o b1dzٳgg+V>9:q}om % 2cņod\sMAϖ-[;c\P@@TӹsU-[o}[_qq]*  GK#X ^m=zԸ> * Xc&6_|K_R/~쪫ʞ{V9sP@@zb/PTPX~xUj\X_CT{_ *XbCOӡm6{g^ G@ *Ь;饗þ}}s\v!\l]zQնM& *8156CΞ=qǏn){g$rۢz?m*ɓ''?Cypj׿;USq}]6-v#Ή_{PA@)Gxocz6A5 "W\q1~b15_{& *?l i׏UajժlٲeB {]_ 8q₱+2ߏq}̙>*mTPͱ{ob^Br۶mi3-ҥK԰f͚|Z/g4߿?;TXUW] N8p>0P.\`Hlذ![`AS7'TP"4Fp,6cZ1_jZ?Dĸ~\q}`ϟ޽[\s|2m'OPA@|zoo{\?VM1~4@wmSB۷ooj > *ty$4_~}{ʇ+W͛7g7x OڱMvm"TƱwygbc{Co~󛎍_}wm\ap=ciST8A:75֟oܸѸ>@^=S>۷ST聱N1_7;;}tVBXEl^hQKS:qP9*Cc)gϞľL~=~o}fޛomlH*cB"^ꫯ׿Σi|Xdq}p]<@d8~7cl7g|kI1 t9I*ЋcAFGG9sdgr\rI[q'N `N>x?_x]|??Y ӳ´)>g?_>?S^KfTq!uӦM4q}vԩIildd$?@Mw饗N|~pIS@@hѣ 16q([0> *^ziո>@E|vS:*Яn:j\`?~<;p}&o@@,^qz3!'.T:gΜ,]q} ޿X=b߾}3~ @@8+zwUScǎJ *t_|s߇ޓTPa** * ** * * `ԏY?uxmPA@^{ayuwʕymPA@{WFm4VymPA@ͮBݰaէ fV^veV P˫P-[4k\Gf-u4s˗ݵk* tjtO#S׻e˖_hQ *H@-B]re~էABDbiUϪqzmt+TPA@j@ZZDFOch9biqH˧;-w+ 0tڵѳfΗ^wyjq8@@TɀzOciF,*@yEi =Pӕͬ>MǛZZ^iZB,* Œ*zOCzOOkTPf413gm&bVZ@@TԾ͜Y4.x PE&Bg#gl*7* B_X-ZDݺ/* B_P췴 *]qbj\vÆ \n˖-ٵ^{AUq;qvЍխ "l\OY"ty˥QP'j\.bh9~a4"kX}ZLqX 3]{bdnrvt9? 0pTPA@TP@@TPA@TPA@TP@@T?hPTT@@PA@@@ * *  * * *  * *   * * * * *  * * *TPA@@@TPPTTTP@@TPA@TPA@TP@@TPA@TPa@f̙3Mh'>|8[jUsN?PA@Q.f͚-[,۽{w:66-]4?y`@@Gr6oޜ۷/k5F}g%Kq6=T9*wPYp]w5r5bkK]է @BOPA@]Ox~p+Vv VZ} 0bN~f͚, PA@P>FۄX**`է$P0wlϞ=T S+K/_(FKv@@B`mݺ5[tmE@@B*|Acǎ믯\jPA@]jE{;Kw@@B! @4i*>Ys ЬBpI5V^uU/Ξ=kPA@_j)*cǎemߟ=lC槝:uʶ$ S9sLvWOچ[&V * *TOhڵk'mG^|5VTPa WZ} @3b_m۷ODw PA@Zj)(oO>s8u ۗ * *TOhŬY&mO>쳓j?6& SZ5gΜI۔7oPӧmg*P>݀u|ߧi@}wmg*߫P>S{TUVЩz ϝ;g{PA@\j) r@=smN@@sէt:ؾ  B߯Bn **TOPP 6FFF %/[jUg P{3<-]45kVo֮]o I~[|y6w,>Ċ;w^T@@ci,Yfޘ۷/[fM6즛nv{PPcL?ŋz+;<6mڔ,~a{ * v+1W_}U>~<:P * vPlʵ"cǎ+c * )NNc#0522bPP* ;5˖.]jPP"`p-_<[j @@T@@mE4 _xݺu6.Pqp?7* j qШ9uTCb׮]UW]?~F * +OW^-(w={gCPPۗ͝;SU]w]gϞwߵ ŋg$bsOjmp* jPr[} Cnǎ*ɓ'mt* 3|F *P#P4۷F ** VTAT@@U@:ٳ6DPA@AP/>}چ ** V9q @@TPT@@T@@T@@P~{O}*=z4Kk t@CPTul޼y~ N" Ah#~}c_?   ~|^"@kqZVT;H* **j[b|*Vԟ']_9کzWw9կ~֏cU@P@@uPjD4ƿӱ{"FpvwPؿ/£*  J@}ULM?V~}Yd}it?zA{(Q#*  "3TC@PPgj˴M*]n]bQ ֏~kq+]k;w6}9ߗ#wzk={|إAF.n+[z{q;(|y<v_fjq;q]7ʯQ܏z+* 4XV0ZXuVV6 h*A+a뮧jmmX㾴mTuiz^nʸצ?o :$5]AʺvjZ2 ʿ fjX4Ubeb[-VJfnB2to1<S}mi<|zzqC"U@T! wTjl@wfV網ձFN</ۮ_.Z *  j42ubl_jڬF1ـ FcߡSm;N</~/^:  F7!o'R5]smtt@}k6T@@PA@/aƍR;וzKX q::[4M4{=+V4[n<95z;}_Rm\|_?ت?M@T@@ij tR>W3G 8=W6*  i@ 3PwXas4VV./* @@Mʸ:=#xPGy&~בV./* q@M~PӀZo%fv|Wew bLZܖ/>T@@T@@퓀VF+Y5YXP(hTChzѲޘ{t:j'~aP7PTP(QQD0~#.Zq+q:|p˷QuXuk4cLNLs/zcqUT@@PA@ЀZBFG3OXqYu7c5:> qǖ> !7u7Dkww (n#W~xʫ`;|_K/;޾ cz뭺LzmNܗFMC}駟mcMPP{ ,fD""E`wQ˗+E"jEz#.sܧ8Q z[Mo|-NT /ZСCGkߺq_P'__1 :=* *  * *   ** *   **  * **  * *  **   ** * N%:u `  * *   *v%\}cwme' >x`}WtqxmSO=  j+|<}"@O_wW  j+"Ջk֬XXK:xPPU@mRx{"5ҫ+=s# :4>6Ӏ珨FX*^@U :ɓUj[ox/By~L'gPx^uhxھ} PPJXw޷PH)?O]* * MƹXO!^-n/W ck|؅@35+^#Λ^˗o7Vzj簙zrT@@T@@PfhV+*zEꩺ:1Ժ9Rr@H[:fw  0L@MS+ v"V, i-V7#V#VƿoˆtEj۫ V6TPTOgiNOof_ZҀAժ3k5@}CDVwPu`rE-/o[u fT?4PA@P:6niˤOG@Mbrܬ)=HSimegzzSY'J% *Pӫ̀Z݃,պ|me_fGTPP'N4;_Im۶-_yUWM Z[1,X`6W^u69)Ի|y?1Bus*To *v%FFF&nԈcۉl9Z[}# * :rt@MP4CjՊTU@TTujd@MS|mX;P Yc+** :QTF@5L=f3݀fLeQ5VTPTuh5:_z2UFaX (v262Pu;Z * *PK`FtjfDqzzPYof7jPPU@#:QUNE8,ZuJGr#cȗN-ߏT74tc(|w\w<4p^[A@PPA@P^L\#±V< W[D_`S.[VOaq;˗e>Ճ>P  ǏWG:O)-ܒیe6 z˗ջ/.ş[qҶr.)_=5/~u #PPJ~P# o b7 b** `hZB_mh** *R[ߞd|_@T@@TU\A$?,* * M6݃\@T@@Tu bolloυ  * * T8PPT@@T@@TPPuJf͚mٲE4&|s֯_/* Hzj~7{GT@@T@@]bEv}Fn T@@T@@ .l* * n޼97!" eW;v {׳ٳg :F3o^m6~ӟfw}ẁ *C8x;T8y @@TPΝ;믿^G{W]'`j~é]LәkLiojlB0ct(ǔ-E=(-8aPjRJC MPHyIr#gf?Ow?"t?kwߵ0 n?իWwnO[={A *AG?b ]vW_}uөW_u *͛oYd! xm۶4:u *6nX|ӟ6t֭[[v *_`HPA@;wW\qESO P0fff Fi{PTطo_^>OT(ŕW^Yr-ݻ[,Ξ=PT/B+ g˖-e]V^`^( ۷KpY)ɁLT@@v;v<K/vw=`5^#/6Qxyd=83:}G ):u * vȑ# >1n+G-G_wu: v]x]@lY5g_(y   zUa޶圀s`5OP"DxTӾ}^{8{ @@T@@],fѨ*СCӧX* RQcD8%ҟ[w ̙3űcPFPY>{)>\?~: o"R8rHITPY3H?w~* *t OPq *  ** *uTTTPPTPA@@@PA@ **   * * ** *   * *   ** ** *  * * U@@@T@@PTT@@TPPU@TTTPPTPA@@@PA@U@TPA@@@PTP@@TPA@PA@U@@@T@@PTT@@TPPU@TTTPPTPA@@@PA@U@TPA@@@PTP@@TPA@PA@U@@@T@@PTT@@TPPU@TTTPPTPA@@@PA@U@TPA@@@PTP@@TPA@PA@  ** *   TPPTPA@@@PA@@@TT *  * * * * 2dNJ[;^v ²xmb?-=쩓MwԈ{LPPTny{Cw^__߳8<1,^ڕ ݃c@@TPaFQ4՗54iDz5bi|Gn+~O)6PA@>@@TPaFѧ *j)* F} QF * bB5PA@P>@@T@@(TOPP1 ST@@TXQF *`ѧ j)* *t= ST@@B5PPn)* *t3 ST@@j)* *> ST@@TB5PZj)* *j)* *j)* *j)* *j)* *j)* bF]ʃ{ظqcjժs_xǼ"~glܞ={ * [n-֭[W,ڵkחq'K MʟkK.˟;'% b[D]tQݻwT@@ԥ@Nc[:OR+W,a? * .G"?-Ξ= z wy@@T@@k?`@+=Slذ0H5.{zallq<* v%\"X .;^s }4+V&''߀ 5k֔Wq b@M"Tڒ[D#`Aر(T`(jkF8PA@Զ HF@~ I{:6&q T@@mI\,h,-[7Nt]IcԔP;+W,~򓟈FTz!@x| * v,j#E¾}3?'=/9PTZa dzzza4jS_  <8A i4Ą jg T1* _݁ ** ֺ   ."X@/T@@P:;;[SäQvSSS͛  *0uffhՀ}TPT`j$M4hBi$j5kPA@PU@614㤏 &'' SN,Pai4iLͯVkTPT@@P Gg* * j* * #P;@PA@U@TڀE+5_75FzA@U@TڀW#jJTPT@@Py,Ma4?2,Nj6gPA@PU@>V#j3TPG4 @"P9Os *|i{OA@TPPU@T@@T@@PPk ڍ8dyVMOO;&TPT`ěgmjj1 *P#QtŊ%#PA@ԡ _җ-ݻw6֕W^Y~/moPKKS8DA@Ԧɓ=#7p9~9rƋ<öm[o-_~mug]mmܸ}|?ַ^%PSPujĦ; m__Zy{''q^V*}/GPT`8j> KPS#X|,TG>Gb4ezxIZ WW\q*j5O߀ P(ϵчRP; PxyL*jU\ *bR7Puj[ M1JW  cU@Ԫمi1{* .J@M)PG+֊ݬ* Ž * .^@j`4uZ@Z5k8pfhZmK5uiugCfׯ w~OWW "Gʹj]Pk;/~ o%"PKMTNK54S+k6yLjۅ4}"ϧF_-^XR]R!FY5zf#:2vޥ>F6 HC?*0*#P;a* KPcdiSU+B6lVmXk-kN_z#mwTbn֑ͷiPyNuɆZQ>7Z~B@F=* .j@̓b_d'W+5vRV7E@M_OѥvP]ʀ{׋Z9A  P\jP5^vA Ջmw.OX~\K@T@@ T<) IKPc}ϸM*&g7Se z:v1@NǏ4[U@T \5pNk@X.kU@]KqZO-.V@ ydM]k=^P;7;;[LMM\G *B@5OgN)9#P +_r@ 1+/V@cj]ǃoO@X<6x'"zA@U@m*DFZSS+u)9f@Ŵ3vVh7j{]^kF* vPcT@@m+m׿~Nٿۏ/~q1~ᚷƯ竡*\ݶw׽Mlslݿצ֮]L+3,{c{Z}m{T`Xd166V|eDu9@@U@m)pHfV"ӦM:\s|mK/T7B5U׿q7ZOV~ ~o-e@{ʶ :5Fk֊tAV-ng>EY@Coɸm<_lK;Q-._"zz_ *PSPȬSkyj8B$VG ]ZͶ5zx= }m1W/呮s/f'qNF.U@ktFX@މuQBRmmG멦uU7oTPBj|daf1,*GTOֺPzfa,nW}O%!zHU?YzU_6Zѐ\)mk6;굗Vk~ܾ|C޻pgM" Z[\=(Ąc$PA@PQ"PciwRſ7TPT@@P c_G-PA@z *0*5;550rrradi>5?nS+גF:VTPCPcdis14j@VoFF=** qP#tVih#U}PA@P` juKJ׊1_@TPT`(|K#PuMiJ *05_(:%?"i6m6PA@P`jZ4D0K4J4,l{:m6PA@P`j>ҴLpZw5zA@u(I#5OCDuR@߼ysQ/(U? LX4?k<OA@U@Tɀ ** *  * jKbrMVMOO;&TPT`ěgmjj1 *P#QtŊ%#PA@Ԛرc T`jNQPU@T@@sss #OSPU@T@@Pc T@@PP3iS7  ZQq1)** ffggǔ~** ffffDTPU@T@@/bQ[5==TPG-=z` {@MMTPT`$FvTPA@PU@:* |gqAXp/  ׯ/~FoT@@T@@;7F}c֭[T@@T@@ݴiS/~Q4\uUŶmT`j\).411ŅVX"R :j{3h,^@>NMMywAQfff|cm1 :Bpq;T@106* .z׻h"O=Tzt޽o@P :Z֭[W<#Plذ뮻@=~@@^ hmxP-vQ7>hxΜ9 :??_NxL5 _<V#0hPuQիi oM74 *jD]v M0fggɦ랆89{@@TPEXYjUSO N0Dfff5kִO>T@@ =z?^|;`|-R8 0PT/B#qps7_~Y>P}-S'7 چ-[^ziy8ܹ'?Y\}?V<5uPPxRwuWR/۷o/^}U{8N0?p~.+PMgΜ)D|ː.2DT/xPF'|\Dq}v8 ) * v~2Drj~EyNJ|?--e]z;Q^Ѧw( ڭ7x -B̶mۊ;vtrXmYauiLT@@Qj1}XP|. ĉEk;F9SSS-{A@F6!U@e0ą^uԙbŊo^ЖkPA@c6jնw^J@CǏ;F:n޼01* Ә&MHUœ~S^-*Ѧ1R&@@-.GNLLc j_8uTqı:'? 8/IM *”}NA@TPPk@=PA@@@Hk8PA@@@MOO/B=z_PTDQ   #P4?!7ov * z]ހi'"zA@T CP;% *v4 u@T@@PTT@@PA@@@Tԥ233S׼`Xނ U@`jlG <%l&n7778TPA@PZiiFQA@TSSS.-R * 05,m5:)ZTPA@`hB 7є  iZӴi *v4* *:?jlKPA@T!]D*FrG>R  q!t!Yc}PClKuiUTPTvsM:VGEr1+*֭;'yPPA@`Qmܸ񜀺rJPA@Ν; a׮]  iPcӱr=wڪy ąP~s'sŊo]PyD5* @bt%\rN@}׻Uرc!;vlj *,͛77 K/-ʀzȑb#gL?c[:qQ |E /}9TPA@`^F~7PA@^DM֮][Z~}k׮%9MS۹O}TPhH 64"Rѱ>TTPk[ 6mˀDH~ *^eݻ2NNN  @ *v4 u@A4Bj+mNq * z]΀#NhؖvkPA@voGwԳN|^{!ƚLO * ~ 7iqo_{u@=wWwTuX`j\lJ@T/s_?{gqӀ݃)l~x\9PCZtzzh> * (zv""އ>_5Ŏs;ʏ_}ʠZq>`jZ4͛nDy{TQS1.4-?8IҘF*0bPe)PC<6}T0 S>rMF!5>Sc F} $)4 *F} T@@TB5P{ѧ *j)PՏud͎A@B5O/x/>ޮTP(TO~S* QF05knnѧ QF0Pdѧ *j)* *F^i)* *t3 S5XX ӎA@B5 ssso](# *j)=u||9#PA@B5 hP>@@T@@:P>@@T@@P>`Tj\|*~ PsѧJ@m(VXQ$},>?;;TP(TO:33s^4m$BTPaG} (͛77tll<* *;w7M~x_NOEظqcq7k׮-V^}Nz/~† ʟ8fh8jE'''mju #xo߾Xn]qwﶳXf{E]TF8[n-K/.'38u~~~!NMMqQQBT6m*V\Yjժ;۫ 5!֯__>zGsVCӴF#O"bTPaȧG .9R={<'O, swoL>p@@Q1`vUTPA@!t^x8y7`iaAVZ>gP@MYt||~PA@a CutROӁ[?(pqPME@@t~Tz[eZ?@ڵU3sϕ?-o@ O[Q_@jrrq0 °L׏h4{yR`Z?@oeSεQ{)1s1=?F֒im} €+ƁE=1ȧ:4@{#D8VAZ5ISiTiq2/v~W\Y]?FwF|gD! 7`Z?شiSqmI0b˖-e<<} *,4FwɂiF˗^zi@@TPGcgoQkƲ+"Z<8:>>^u$.j*'t9,#/Ҵ]v١#c啸$m=Pq/DÇ dŊo ^Б)DZ -6]iV*zoZ?0 袋_]@/ J4#P7oTPa9_{EFa￿aSټھ}{9mW<š5k)$1&&&? *,tOHXpզCiÆ =(}_-㎡:J5Fڷ *,Ȥ8М)N8Q9sf$=E u?~uPCa԰|8nTX{)Ǵ}9MJ?m۶N<)2;NTX7n,#a@;8_eaw_ 禦LTXNt}Qt PzP+* "9xt}:ֿyf;A`f@U^APiOCL巏T[^$t _(ܹ0: 3n%Fͤ G%o =Ͽկi 6`DbV3;;[0T`0:(F[s*Ћ֭+E$,~^ϕDovtQ81 ,O@HFmTP,ÇMoPC0Pa@^@%TTR/N 3 5Bi7u~~B+Z`0h񶷽m_\|_PԞW,*`7\F9kZM6P ?oVj,w/"r}}vU@ZzTPi"?p4cd˪UFbZ54%,ݍ_IQ@m/WMkv=~ǩfm7 y g#0Z .H`z{޳?z3=b?c^~6F˟sK3/=Wͷ#>qv}[ ܧQDOz,DU@]ѧ,9cPA@e?.FTDZkgXU.1LzbP ͞G^Dx<֚PowoIrZRK'k{FۛOYoL^F!5>辵q'&exzTٔNU1Y6 HٺukUOj>2i)֟1.  2"1.<ҥY:#>,H|Cu|c]5.m_1_KXo{}di4h5֊r [}N:Q~T⩀_0F%V׮ ca.ZɿEkixWkOk~# \R@Pc Yk^TPA@eG;v7걓Qy7->VĠQt7m0FLip:UW5Hz#cs6j4G){Ű$ nFTԺOIFƪ`jf=J־$k_}Jkfh͍8fk&hU/ݿ&ܧQFC? j/KM>o q%Tr~İo}[=X+SD)iQkcjMu'^ѫNvrj~Έf5Vixu`iwqGrʁf7:OF|4~h[CdoiKUG}c~ͷz͖I>f}:J@mA@P)&1T1RD6f؀ *C+NBt{k|EsO1bwϧzy@~.űqs>ۑz۝Im:zj}-Xi;[yNޓV?Z_W>z^|ki\ĩzRP>ylǯGeZP;ٿ<Ѿ>6~_^k>%Z_[moGmS[}|}fu]FnӊZ55:~W4&Yڌx * t;Su"* OZ_[5vO!6}І~Pc Z+5|FX'05`;nw|/RFN@ͷ'AQK&gⱫ>FCmVDmI@P{%J3Q!F*^c^Xl$gW^lvwO%6{Įww};Zv>iuj~_<}#Yڋ 95Dhp}Zq\( jŶ`* tkgkN_Z=臀^59jRvuZ:og t[ˆiQ05R>݀^PګUG6I}r=\Z5^$ * RCl(xZkKP9iZZkZ`Xjuꚤjjuq: Xr TF5 ^P<70aYDPiV*ong }̉ w1.[6vPU_;5_?Ja}ZZ/Sjډ5Q,Pf^[_u$N!FlgZbNcr|Znݺ/{L{3^),CYnZϳQDmA;hj«NΨ"*.|-\u ԸT) 20'&&z'hF.1M@Ojit^_"#]J_j2;;[6ɽg>ųKR));coW1: =\̪Q^|h9jڦx!ZvjO>_>3:{$j5@ۚNמ?~zׯffکtjHogy@@%S#J},9RoU??posN"G?QMv؆V_Fۗ<{XH]k܍Ni^ڕeD][A56c[~Ecq>Lj}Tu>ε^؞-qMĿO׬^W?6H@]1W;EUko *={cjt{1dĦՓ8U@Oڪ'+tT5?iti@wҔ>Nڵ˴~#羷P"c@M-~G8XGtjtM2bvXvi{&=j<}^V*Tu~jtXc8ީ>~*.4CԸm|4~PA@IA\'\8QZ4Q NX笞8_/6 a۝NrZj=WiTOlCkvsr lZ?􁸐TjD]:Sm1bzku$h'Mg;_G+QW@P[q4Mٯ7ʴQ@؟ *}3]?t~''Kzi0l~?P#B@v: uj* !8qa |Z,Kg;^TU@T@@M׏1y)C?i1:]aX_k)" *j\D*.:e_ *,t81]{Z,UrJa Am'vRT q!ZI8^Tv~La15,X´~X|_EvC:ŽQA@:;;D#F h"nb ʒKc ib atevB PC$Ma*X *=QLa9]VB P͛F6PcD' ׯ__\s5CbW_3~gQHPj>jj TC;>& K6]?F?fpZ[c8*jT@@e#NÁ0C`Ż>w *׭[WNC6u:?G? R0 ~qVa ? @ C%냀 *.jժQFB7Y\zŃ>X}?űbmއ>xoE @ DbŊRQX5?T@@0qƕŭ =ˊ 6O:WܯYT@ N1~TPK˵Q_x_CLā5k;v= tЁnlQiPnrUZoi֨}' ,~#nrZjFY ~_^lݺa8gϞumx?\p*jF6Z4>cj^TT~u]w!u˖-ڵkŦM#p ~x饗F%-g;8o~b4-К3'^[p*jԙsFs|jj? *,ӎ:p_}WWΝ;\/qPs)+(򖷜7M*>={ST3I8MEq* G@M4FOFHVQPA@eB_8z)kZu45mKx={<{p'#'Nppm= 5SSS?g7EXQPA@eYڍG-,K/-xCP#_;25EzTw_㝆Y)t/\T@]fZ\р5ܧ뛇ع9_ y7Ç/XM7TNq/74XFn߾ꪫ[nf~,wtk,I8PgЊ~ڗ X;'R??>/~8APx]wսm\ĸ_ܿǍ_ۥxidܯ{WZϟ ǯjo|v5]?0]zc-o_pAgPu0h=U@TPQS~;`uMC;v,6_P֕z꩚qjj ۑ?_5zvN"OÆ ݻ;E ]q-Y8PTU@TPYi19tTSrD0boD|hnnD2?QqUOw|T/>*#ݯ\狏}cŚ5kʯKubd% jؗTgoIGfbLۓqV{1M_S>#6iX#?.HK|?  * ,FH*);<2ƉT~U=L'6)) !gm5^mՓضAio/.b֭ގq?0<i4K>3&i?.%ymkcV.% PP@."% *3^;gZL~_N|fFT'>I`}`[o;ZI[ܶ_NL#q]M׏iA@eqj2 UZ;՚mQ Q<4Tg_4Mڎyu;KTGsmTPA@e8p`@lnn:O}^x4 ꈕF3YѸQZqeds=W\s5?q8=x`q);xPY[6f䑴ߋH̐~6Ԭ$O#B5Pa 7o.GR< 2p?^Ĥ-[W>׾V^NkIRkKNl'換Z#TrͶ)0][o-?]M׏3 *fz<,_q Mommgeu-jPa 4Soi@me`j୊ xqRi8ȑ#ٳgA@`ͧW/8Q4}:zcfTNϯ~V g_CVTU@T@@b1:D8iqe8Ѫ!'a'7ϧ'|rctB<|FI,'UW]UtM嚻L?s挝9t1zUVJ@XX v2j+vt>ejE]U@PPG@Ӆ~^ȟMo_rdyZ5x\Xkjx]p닫ضm[4?#hv< kmq茀**մ*O+XrNbzVdXO'=NӀ]1wXNl"(>tG*j[>W@PT@@PA@#O>gZ\1}rr???dNҕ{tT=| X>rk+VO aQ5KiebXnML׏ }1ClwfYTU@]cccŊ+JSSS@@wvu7Ϋ1cѣn-] 8AJІ2h>)!CATR\! FS*`A@&E.䞐7}=3\sy}~|3TPW@P3E8OXqF{ t]C!sZZR&0󪗍4^7].j ҥ ѸnYcn[Y+PchD>h8Ç Ԁ:5ƦꇐcNP<m_*Pso.+dTR [ 7P\}s=h' ]NeXa2g\HE4cFDcO8`w}@@Z Mq2VV3h@Dۥ-=|ukRZG@PM<)w T3ic.N.~[?K#"y {)N8apE C&鄌 P=G"2s!j<=w~!uS[uj]H?@@߭?v7bt?nLqd0b4ѣG ʀգ !S>XP^3>uR5uuY") »b}ۭn*>O* -V1Qq ]T>P$VOVѰ>bim$mcd  (w7 Eb{'"bw+b /0p8} +0 * +Fa?O?OM];]81l=j@T@@PPYl[/Otd0￿ wuPvT@@PPYjG)]HE7a>D+[ou5?yAPU@T@@evnq£.n=-R\qO<1Ԫcǎ<ms=W@PTX6yr}s L&拓oj{wpO>m<&8 v%\" *ԉ6m*7W^mwŪq_~yxo>9ƲeˊzJ8wtU@TPA G}t&'2+N80͊+G0wb8j PA@>w$-_Gdv{)ON$[ÄÇ f͚u(><PT@@:EL=XczΝS;yxGUqRX;h<=p >'mF@PA@X!?TMbumXm4U8#mqif׮]* *9up ŕW^Y CUc09r`L+W$qq88YfvݻTTt|'K.#D8m;Wpew}`m޼HPTPL]wUu}M$WUznjwLI^a70{]@PA@>Ŋ}mlƱn2LF Bo/r0N$[~PIw6mjTTPldFPw@rNLo]{8vVB&#JvxmUK~ ,K/x{~< s* c[[o5oq_rQ'Zb֭CoCk֬)-*l;;H3V *0w=!+b/~ed 7&qR|pp: Ǎ7X<L 7ihZ  X:|ponذܝ~T+b+*={4?~qN,VPE&NWPwVM@TPaw돍|UV]tQy|҅l۶+>dn־q4m. *Ln1^zi~6?Gޚ$PA@vyLct ssPΧ7̍_e܃o_?>ϔO||xfcT@@>uv7bhmP/첹Exf+qi1J@eγv|xPA@tӿ+gWw_]WZ} 0߉'86**4>Y|PTܹԊk.J@ea=嬭8PTـ:jV4n/kOt^ɭE|{ć^!V* q7!p?hPTPA@ 5bilH4.bkU| o/7z词/* jPQ>O2M+H/_>/EXe[n5  zP&VWVjэ7СCEsq؀l]ܭ: * .+AchVѺ^zuQwXT@@Eՠ]VFwlrvrUJSTPPaljR˪|7ؕJmƊz TPTP$P{> l mePۊێz * qx{'f ް5_?* *,l*#H@1ih׀|F4yPTPaW[2-&hOdͼKzwo+WkSfvjXcfkx~je޸^\..WΩ=OPTPaVէX:ZV" "B](V`#k>E@PA@ ^j)V>o) *Xj),*TOPTPaWZ} ]j)* *L*TO`P>E@PA@ ^j)vէ*0P>ѮB@@&xէ0UV" „BF STTUVhWZ}  S*TOPTPaWZ} ]j)* *L*TO`P>E@PA@ ^j)vէ*0P>ѮB@@&xէ0UV" „BF ST  S*TOP^ *L*TO`P>E@PTUVhWZ}**0P>ѮBU@TPaWZ} ]j)  „BF STPA@ ^j)vէ* :[n kז.yPvbBVmܸq]۷?񏍳//۞ݼyswcc  ҿ;wׯ/-[VCu`4.VZ5wwg+V(6mT:tLKW^]D`Z"oq۶mT@@v%6 c)6"RXz1͕+WsNquי(k-GMCK ,}Xǫ\l! ۼys/|(8vX^x8y 89O>fL/_8p@! ꄊ /x7l ]p ĉ66`lR|3*V?޽{˕  NN`bWNjD&_~3 5ٷzK@PIбfC=TtMfݎ (5\|X9aeU@5>*b۶mml㲝{Ŏ;ʉʹbiժU<fw]"ѣG @@u]ܘQ 8j.byW /p^Hc cS/nypo^=y晹qv߾}* 8۹sggcB .7]==u]S U@TPΖ-[ũSJ1'8Ӹ{!,+V>[獳Ӵ U@TPΦM/6f9] m-[V?O˗/+T@@ujw+1 $I]vOƄ{+8#8zo{l|]@PA@C_|q)Y X8`#{ x!' :AÇ *&uNAiC@TPMꀙӰk!kqk' ɓskэ{PTPMIq&qkьvPTPMIԽ&;`Fa jRԁ0 +T:-R}+ Ns=jR'0 I_/韖&r6kl2T@ۈfR'v|[ߚCcJci|Soo>mV@T@@5{^{\ ^zIkiYGYߏ)^tc jR7RL-ƪڴ%Vԁ{0x.ɿW7}ϘlPPԝ8qE裏M>;PbŊ/~1~`'_4Ƹm6cZPTPM&YLҪ;vEʘ ԁ31. r}cZPդn(V 3)U61) ~je2iIkaƤ3V6]zٮZ>} Ou>X+*&u,igr;q,i*֘ u qiЀ!g-\jxM-ִ&&u`!oX4& zii; Atx9fC { qLZPA@5cP:')4 Dzi M+UউkAVbRɖ0@I8Z}.QCjtIAVZ#?DTc  Ա(W'yX5)'2*^uP&Ր9H'|v5yčǗOx`1 AǤ|ϐ+^AqB淕O4q\o+pո* jRG.x&yl\5MIо}Zw[cqmAwĤ:6Rz都roqBCPc{]A0 I#=FX?'hۅ??knxDu5ZY?vC5c5v~b m إL{aV6|6kT@@u&'u䓎~'?|ev*~:qdry&{0T0֎-׆b5wͮU>]rL1X+* --ʎ^XQ~L"lH&8XuOSǏIkkЮcRאXA>OUgqY@5 &uc/~1qiNzE~&Pyԁv6|wꇕAjWM+mTc *&u)_ҏX*ZjRZWV 3Z=BX:jPU@դn'tvς[ B5?85jRZ=\Nݸo@]cg{uPV@T@@5|ʣm5F,c5\]4n:NlbR 9ȇzbfdu~bcJqP@5 *&uSy~_?t].:E*A&J&yn:V #;;y_]V:zFZٻwo=XKI]xL>'6-kTT}kˣkjbӴ{~4D2#L&Չm uUZj?p _*O׿i8ki1>}xcFC3&UjЌw!qcajPU@uDǏ3dmkO~r^D?Xʯկ~u2O=s͋ko}'n<3I]NߔZjǬC1%^uLqigfUkh~6qtݛoq sbiZPTPM^+}dM~\m1&Di#1Lx 0mzu)=߭ɞՅӰ?qFwkicD1)"j|4Չ>E.q  jRdb*uӸ"'&ZIA;Bo*&qUǖ#:)&k7k)ƣQrLq5w}i|t{vA5k5Bl I`R1&wmq0 *&ulL꺆O7;6kc jRLp Dkc jRLnpw6l0Z@@դI049V6kc jRLϤn!ir6kc jRL_zvibX kTT:`'uNW NöK?O[U@TPT`&u 0閳cxTPA@PiԽoNaz.1***0 :OacU@TPT`&u OͿw'Wz/***0RO,m0Z@@դIN~6|iBAc-`PTP~Rw19]&u Rnc-`PTPM R<Ɇ ZX+ 1}n9㎩}n R;m`* I}{߻=);m>QO m`* I]O~ehqY `ԓ!5q7k]>l9.;* LRKԚ& 2R𮧞z* LM&y~q)TU@I][H÷ٸX zWV:MZ@@դn8' xNBj6p0BoU^c HG< r<-czg^׽3ksOcRW _cc-1X\  -j@vgKLm+.tuεt1Q.n3].n'n\f1ZWz~swנ.twy_e璘u]>8lİ{lٲ۬{,k=NŜԥ?vJXY҇H>J0\z~?L.3L@C?Cϥ9 * Ij?'ʵm@VbEk{P{|Dt~=b1(U_I^ m˿mܶ4Vo{=Ƕ.B1N4F(VNj>t{l{ϭ_Mwn~hKRhL}6Ocv0\kzlbm* ԘF}.~{Rzi5K7u)M1'Oz,FH>x1LIi+x.vdi9zz^un  x~9ߍ^֤P>lW߫=1>kTë0=m4W%on<[a }181}8g<*{C@PTPMniU$~B zmcRug6N^+M ^so7.Ik%x?@6~WJ~.m47痉1{}H0Zao]kVڽc'Lq:Ӈ:<,s;ZP. # y īi2+.<k@bԶ4y@*6̃I=ه BԮj][\媿ߗ\r@U\dq?V?fc] ]s{.iA:> vc5x0u!?Ouw*V\W^}qYV@TPMFxq<^1a ckRTP:vQ޹KЌhZ}O'6z@>C4  MA@9DF@/V')a&&u`g{n\˪ʸ\<~]D])j.{>ݾPTT1mMz@'Tm/ǜ煈uqT .E@[]]kq n,^ewzmez܃G@PTPMFPL~FJs5.~c:A]Ȁ%X+|*a^QLLX;5;kӱK1Oz=դ](jRm9H@w׏(~^'U@PA@5a@Xyf(j>atUȰP*ϻ8-U@]o0c$ԮwW/PIĠAW8>L@um!8<?N * jR7TkV U|hem['6S=VC7k8aT@@ul&u^R }{;vLMytMO'&Dm=o>o~Cx{1٩~^Gz]/W~&mOU_\~;Mv.=ζ4qy,b"K%ύՎ]Ƨ{|u_'mϩmu-קQ<ƶ6uf2TPA@5KشiS9Jl~H56o5Ly~93!⶛izϷߟS1NU_?~sL8{2s5c,DAxoOMq>{x?]Dzxm^U.in  jRԁxmőVqX+* &u`P%* I`Ru& Z@@դ0c-TzIc jRԁej`x.**&uI`* :CPX kT@@T:@@c-`PPM:0ZPu G]vِ|.^~eT@@PPW\Y<6d9rKq #JU@TP'Ě5kkژ|s+6m$9_ P~W\x  NwqY`E]TlݺU@ڠgz⪫PT@@uRl޼m #r7>Ϻ馛TPA@۶m+Ş={}CS;jժ"TPA@f۹s ZOZ\s58;cCҗ=(]}c=& $Yre-Pr-Ž8;r ʏ|# o30b¹[رJ@@`Ť^h Ǐ!g`Ţ㟾* 8ٟwyVկ~U\qpI"07~qhaÆ ޽{Tqg~Gl Zu]:@E?Ja\и~ؿ :xL]t̨ӶI]Ox};)V^=|P(.' }߶ 3/|I4VK}2 A4DEPA@ w]8pK.iЅ#G!_\fcC>}Z@PA@5I|`|x'zNfeˊ_ރ`F<5\i8  Όw ^"fN#,W]uU}vC0mVc_9=zT@PA@$]w]i _^wyg.>|,8W^Y}y?qgy8qqvPԙrСru] a:*nS<է2qe˖kQaJi"*T@@uv1?! S$q뭷vЅcǎټysYӷ~x:MOT@@ufOvq7 _ swuWx'^ӟ>` ?/֭[;rSPA@yk֬)WȘdq|O*vkq.'Jbi{?Pԙ>Q/'ť^Zp Nb1+b`2o\pAǛo} oQm?{xc;* 45V]x{^hz:B0>^zbݺu駟kBDr`1Y]_@TPY#d~ ;wPYI\8tLf59rطo_nOXc]'r4PTjQoFA* *ɷ+T@@TرcGQ q.PA@qyەsv  l/]rJPA@6o|[lPTPmCO?yt׮]* *gŊg>ݴiӼm<'NTPA@`WZxzUW۞|X8TPA@`W9r\eN  * z]PTT@@PA@@@ * *  * * *  * *   * * * * *  * * *^TPA@@@TPPTTTP@@TPA@TPA@TP@@TPA@TPA@PPiiӦb˖-ao]mxPA@}2^|ƍ{ PwQY8KR DE/ KK@ybժU˯_ *L*&jtٲeeT<{sNv2e>۱TU`)*0Pe)f֭b\Kxq~ VZ} 8*|OIǷ˗!Km' UV0V^]vm=mܸ^/cWoZ0+EXqz VZ} bl)NV7.a2<ǒ/ **TO1bb>nHM9c5խP@@&dէC@m S? *0P>`jW4?0a2Kn\j_?r_=@?3]]!=V-_dVxqJTPa*VZ} t㐶tGø^+?b61P#xhm>vo\mB  S1RԮ)v]u5_}Zzvm7)6W^ *0P>`j7u ]g{$Q)*q_TA*0UP>`wᯋv|Ef:qT qvm>zȏc<֭Rr@@&zէk@]̓HU^K\ߕP{cUV6LTUV &N\tq yW"M~>mW{TPaWZ} z.܆ XSM_>=mn@@vէ1'Ur©|Wzt,C]@@nէ1 ڎ?f:J+KcM @@rէ1阡yČظ5_5<#*c6: ԯByubUf8*nܸqvǙ?*8 @:u5VmVܹӶ 0*TOZ1A#Ir/T@MLUXr * S&!8aѠm]F$DDSmoǙ?zUq=t^RT@@]4m͚5ŲeJsNށO|[늵k6m((,c v`z!'Vb|;)~ߔe˖2/>h@vpRHPui/ ;vc$j|UVq7 1N!:j8fT_ӧ1!5V[.RT@@,?䓢LǏ˿XA= s~!@@Ջ*VFcD1 &מ={ؼy f^QHPA@e~e?VO0=Q:_}Y 7 *̋q(tk׮QZ~UHPA@=+V({1 Xٸq fҖ-[B* ꌊivۇpu/l\0s~,X@RTPgȦM ?a fK+60`Lm۶d7RTP޽{O|If%/Rq%ǎc(N&H Xzuq0c/>`q!0fPB X&&yU/xc)*K(I`jQ>l$R* vosէ0~_'x Ֆ-[SPټysL@Ô_~y.he:6l&P=`Io:)SG[0XYVs Iم?}<<#h^:$@vzREǏkO=7<|,o}{vUkV>0I?9NPY ]VRVauEfǐ|z̃5g;P\HsʶM!@@u#lXM2*ͥӺգMSs:A~B}i= :UUǦ2~{#*oZ;5`~T@@]䀚κ%5Oud*t QvuMXɛn;?, NE@We"K@rXugu ~PC@f=Vh_gZj~] ?kz~ZJKԉ  rBni 3U@P#&Ns@XmIzV6Lԉ2Xq9$  P{ sƀ|i*tKn#_:k*:5sw5kNOHcG淑4Np5}-ǿاM+py =6fs5Ա yp^籧RlZYw"|1P ]۞ CcmU Wxf3Zs膴Z.揷g?۬L;7ǰxHvu sՀY~ML+?yQnƍ#5mI m4N*SPS([Kc`Դڮ1[5J7kЀVKDea.I^ÀmuUt!gו qaNx%!?fW]"jR2&*̺uB^OR@ͿkhXe<PuW鲻|וjjxWcrFPߓJ ռ]f3uѶBR}uPI)Yzq>b: kN ϡ^j[: :\ B*  JѦ]Od5ϹԴuj{ {tT-Ԫ.PY߅~#V>Fq;]ϪOn#̟߯o:uSeϷPj{c?` * $vY)G֦vjH'~MJ@;P(j~xa&]BԈN5+pɜ!1oT/iu-z&:x@M}gXO@V"h9.d@XT8ӍW9# * .H@Oӏ-t@m:T? -d@w 5?j7.[ mij~bXZP}مmOk jm@=vXgG煪6˖-!^׏6]y >.9=w1cu}~׻]޽{T?=5 * P_}yO46y PThwtB* J,g:52Mq*?e]zcc@WnFLԀZ}Vuvym!K(Su+::c6M6]nz󿗶?^_]* }_]M$"P[4V ӊ<\źicz٣i"t>* km; B)4$͖{-q[5rz1[5_ߺXnikϴi{{?UkӲ5.0 ^}́ *Ϊ>B?q0PɸalI="Ym7AcX,F@*vwVeTߋO?C B*  L/{zRTPX@=r o}P!TP*`(w * !0m) * @ * T* NT@@P,^-**E,)**) * * -:t` **   *   **  ** $ԃPPT@@T@@PP/~0`s K.-V\)3nb* ˋ{W4f|/֮]+* YE#`_\lܸQ@T@@]~}q׋Fs=ضm dŁ[]tQe<Pԩ`bP<wQP? :]-[VP\wuE.9r@@ulڴꪫ#rnqԞ Tlz*^9s(~Gzb{$u9 /D ?^tM4:u?|jϡzK/4|d9؎ֳ :gZXtS//֭[WOcӧ}"pf4[Y** ˝7oY0znh}cBψP)Ӄgk, )>hd1 ݻ;An}C0pKQ/"i̒p/qR$ zOy  j??txW:.'M4;v̇`98^?u85G@@@!Cc&Zmm +sx}v?4gN  *ccu]'.owƍ>}|x&Ōaq6"`.f~#-VᄏzLui/y,+8 i{ũ9~Mm$[ޞ~PTPgͪUKL0Gڵ>V|}ق)EF@?GX+̺ևPҠR/ɷWfPeźE0oqt{,<6\mc2D✨07lڴKk׶f]ӹ8{ Iycn]P]ṛ {9P\5;<|x}mm9v N*zΉFx`rŠ9Ox@م<՝3YP.y(bY|]f}Tֹ)$sO P=Ӷt>*c?yq%t ψQ09^yLkغukx{>x}g'zHl19:uIft5XNӅʡ|<$oKϟ*֦= * ܱcNJ袋~ů~b߾}z7|3C۞4Nh PۮK Ì\+_NyqSHN9_74? @l_PA@+*mVu]yיojɵaÆbѢE[oeL2~qeu~ٱzirq8>5?%iMgV=_ݲs5 }TP'JwYmwqG'D&<ꄘ?~q9t,^6qnGy^)a6[pbu0䁮|%Pt噩UsZ kf.* Lrt`A5MRRMaxovmZDԵktq*v2|V.480)}SZa@@Y5oyYqS`TPό).t6jCaM-_$*36@@PA@['N(v)@ L={HQpe,QK~Af]Pl6MlͣtYZӈU Dҿc1J@e!w Z̬|G;/aDPx̳Py o:|k߯Pi9=.* ӧO(o.N eǑ#G|fMRxx.4rѲ|J9bpyjȃ4gF/n|ۄuHqQ-T@@;1mf I0٦ 8톟QيylR5qX5~)gv;WlN M3@GPٰۙyT~Q:^"DPxkʈ{k߾}Z:~Ccu8rK,BaUTKA04&_)ʇW=zLŴQKuHqju}ICwM3O랯)O+6}-KBHPٰau޼yv4JL?pkٯWZCHPṮ[f *%LUHPT* *; *T|B* *0u޺UHPA@PT`z=T!@@T FUHPA@նCo0p@RTPA@` :3I*'#_~eC B* *%~w!@@Tf//HԘg *;_hTzvYq1TPA@`TNQrŵ/my)  TCSPA@yNT@@ŽNT@@JhNTPA@-KB8PT^)  SPA@ * PuOp *e7NT@@/)  k)  T9@@TPPTTTP@@TPA@TPA@TP@@TPA@TF@@PPTT@@PA@@@PA@TPA@TP@@TPA@TPA@T8{iG1s@~Up) ,(֬YS?~N߀tٲe OT\uђE.ٶX{+yx֘T+?Xxq3^jG}[fw047|䮙WhmjDo}W3s߫iA@eZgQ4k;F#F8ZP#m>`t"E>O,r /_ޙ9^D q['Ă4TB)O,Q1TBi<5ٞ:Lf #j): SPaP>`g} *t٧L,TOA@B5Ij)0Yf0P>F: S&y٧ Hg} B5T,TOYf #j): SPaP>`g} *t٧L,TOA@B5Ij)0Yf0P>F: S&y٧ Hg} B5T,TOYf #j): SPaP>`g} *t٧L,TOA@B5Ij)0Yf0P>F: S&y٧ Hg} B5ԉe˖bÆ 3WmL;Y ϻҶ1mm۶ sWf͚[nokXhv[jU=O}77.Xxq}wq=">7}w>Wck;{+cѓ=`NWGX cy… _ެ0G~sgMr$% oF=i&cZus4uQDPhD꫋8}̥sWfAv4p7x sBL)gbG5PgO^{͛ˋ{xph˖-+VXs>L'xg?[:uʘV@;yokϞ=ϵ|.q4u뜢N@f{׽` \XdI'N`,ZXv0t7pCgL3Q@5,͛7wv8f0Ilҙ=LZ=XgLk&: ,(z-o80 ƹd|S`ŕW^Ӛ$ݶmۊl0vU\p3;{0bم^X߿zr Yib:T>`qz… {n&8p~ⓟ@/~793ݷo1:Lb7bŊbҥ3;ogϯ|_|kӺP:={t7{!΅|%C,W1Q<g֭[N@ 6t|X s9gTPW,?|Gu֝1gڷ5k+6nh*co˖-Xs<|c=vƘ6.(gڷt)o0 ϸTؾ} c']@x )_HʑPN~ hm]8~ _u]5=t1ڟ  ̈HU0V>3őC\HM/qo.EΝ;l0&v\0~&i`L LĉƵ 0ڀq`L Lѣƴj;'Oh .$1-0ZPlTq# v6Hw4q)cZ`ǵ~v v6Hgi`L  v6 ƴL/şv;q- `G1\yb~0-'L6S~c^q- `G1휎)%]w]_3]@ŸV@vrE+..DTz_pPcvo:E#<{׸V@͉'f`L;y^|řWW3җr|-z狠81^kzݱMGuv55Pl;0ms1;R@PkPl;id@CO?Šg+ wkT;ig=n۶ YK!|x@ 5ź]u{ǧ&ֽˎ(?&5}\ v6 Ӷ٘c}Lж5TPf)9kܺ窊6*?"fS@ Ga3M?¸V@hE@pbRlt65ِ1s2器4y,$issſ|}i B<>ݖʪoߴi1<7nאk 0Pl;0myn6MQ/-ѵpwޮi{Ԉ娚cq,Ѫ9^Ws>qqjg %3.&Uun/^÷sM3VB_ݹKa$5q6eFXn'fu/4̀s v6 -\>4\иO?Ԉ@=w1׀*z #\ƵƵ `G3|3JU3S55OO@#bܿuf@M,wÜ:s v6 -\"fv; ;֝ֈ|&oݩua>G6+0˸ָV@i-~P7@~Gmvm {xF@eHP{mPܖooݭOu%NIDvucb}[69詧L7m&źe0˸ָV@i^C2u?p7ssY:)+fVjG׶UQT0Pot3WMiܤ8U-#=ioAf v4?w6FaT0P!3 P@Phhh+Ww *`\+ C<|* tS'o˵9Na,3Fq;; {bOZAB  j/3P}ϟttZ "_|\dhL6!U@kTubVb ж!9P٢Mh:yiN)ngjf=|?:|_/sjVݧϗ"t-κrL/fuwfZ\ʷ]|n<&k y85i9U[@`t># hŸ2DU7iWu'q*WwǾn3VcG3s^Ӷ { m]mM2"jv4 2qOs<dTո/iΰȜmiRT/1Pԁ!olwM?|c'Y~xLXWu>6M3/XAΏ֧~mLҶHiq,j'ֵ|zKٵk x_6p: c MP"v#J'q|O<ZU@hhòGܖ߷,-kz]^_ q`sM4jAl+ =叉/Vu(yx=m_CkH)sξƵ `L;ҀYxlfˋ iaSE@c)-ُԦfV-;-_um Mѵ*3iYU_תy@M<~? v6 ƴC c-}uHكM65?mP PS m_.oYmρ-泅+ݶS]ο&ܸƵ  Ma-gZ^SKWE6,Pˇݯ*P~ܣf,E:۩i[, v6jG1n%jypק)XyaԺm^5N>$~6z~|Ƶ>|` ƴ|F1ΙYv5,#_<*޴y@=<|mu|bV} Qz]n_m!an3ZP@@9#U^䑫%ZEu* `L;5X%vj%6gGH, v6 ƴC y$}7 nmҥK'&vu@-&)~P֣: *`G1Ԉuga\zC UYu:Aj~o@m:]BۯS]xt.nPPTcڱC_y啞X[ 6[@mZNmjSDHW] m_GȟMD\r<7nQ\@E@P;i2}b6h~ѡ8:6~?W,<5}w;S7ⶸOzuI֬Yyn=s㛾u#Ӵ=6i5ړ\v*Gi>öjYZP40m-fFt.wd1K2"\)6&kcz:s4-'Ba{kzU1.֡z.n)ox-M۲j+}}~C86q{:Nͺ v6 ƴ `f3b\`Lq- `G1-*Ƶv6 ƴ v6 ƴLv@bZ`\+v4`L;ĕc٧ 9x ;iZT;cZ05P|سg70+njG?Xl߾x`Fts=W@PgѢE~o0`^:ҸV@3wnvL~cZ?骅h@?jƍ;cǎ0Vlҹ7Xs>Lox衇i=jL+P'|қ@CCLI.(>}?pqwtO6P{… ;z34-\~^xkz:{ 9jD-[xS7pC͎;tv0lڴK[ӾƴhDX+p`yZS&;G196!(.qVcxw8'p`XxqdɒV;{nO虨8o<sgBPaΝf É+ŕ ~moX@?O7:x9ַU\wu*N1] AƴzNJ.4x㍝{v4`.я~9gbDCEZzuOcZ gE:߸_HOqK._~`+qG1m!`?G1={N@={N:9'bk"cV\ 5TعĹ?Ow^q 7=P;w^;Ġ+7No=ά<1cڅ vޣm/~۵k gɓ';ߌs͝P;sNe]MA70<_|+>n6gtL+)Rt|NϟoL #{,;{7tS/@T݅cuXp[ظqc@8_`fƬ/Rg\k0eF2T@0\0 i`$#G;v 7?~܎uر3NSLQѥ,P'f6jNH:z NI)NQ8fm߾ݛH'[>|Nq٘6sQ?PTLP;x~عĹc veJ({K.%N'NNM#39ydZF * * *  * * ** * *  * * ** ЏxVt#X:vIENDB`././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/misc/borg-data-flow.vsd0000644000076500000240000033100014641074756017431 0ustar00twstaffࡱ>  Root EntryRoot EntryF`?np@VisioDocument SummaryInformation( DocumentSummaryInformation8  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~VisioInformation" ՜.+,D՜.+, `ht  D Zeichenblatt-1SProzessEntscheidung1SDynamischer VerbindermmDesigneffekte.1 Umgekehrte geschweifte Klammer ZeichenbltterMaster-Shapes0|_PID_LINKBASE_VPID_ALTERNATENAMES _TemplateIDATC010497201031Oh+'0 X`lx  Microsoft Visio@pgpVisio (TM) Drawing R`RP>w PP>u P>d le !K]oei (fT׀'50"fZOlO~C.ߐE#LQc:U  APn,34%5&6e&9Eaaj6ru8X7?!3mnv?? ?8t= =>URgL-Bak4quBtiQHe9DbT!c#1-r$9Ah\`(*'ut+A4)%%u+H>(>5ah34LQov9V0 H(MmcPr?`8`?=H9D?0 AEN`r$7U3/E/ 4?O@ Q`__J;a/_//\% a$G[A a i%&?8?J?\?n???O?????[!%_w} o-9aD/*jo|ooiAs2qR?QcWOF_cDU/@}_o/^#5=DAt5?=+jt28oFz7@o'9 O!6K]sH{O(Od"<6VHqS]ňƖ`!2PŷyϖO_a re'F^#Tfx0T"ɘP6?5ᰱ !5f| &-!|˰q.бܿ՟HN贁Nk?kGzHIGVAl~J\?u@ ϫ弅.- -L-e(hzyա{}|V̽t?ńxr>a#KH&_y+I@kQӄ\nπϱvAI"0 7AU_)_;_M__]Pp_G/L kk[xKKtV /(A&f,'Gр߳߬iI 0lcF]{3`'a1`Con@ect@rW!@ig&`tz`7P1O*O``H^3D}8AGOAlTBeM,@lMd3Dla`OUP@tR@e;n7Fa9ABO_hO@QT4 Cp5A"_URH@uJ@dn1@8E;ABq__C_H`] _rERSzN@8DJ2OrBN@gReqG` oSe4!`@o&g]1U E=AhouT;aJ@sp@UrN@nP@y7FCAB@ooklML25X%&qvqvqvqvqvqvqv  r1r~M/V+@A`B@cw g;UNb!wIWLVw b !w//+T@yQ#5Gą1UBUUUt4Y,b'@~/@  8C-9  AUBUUUt4Y,b'@~/@ c 8C-9 *7 A"#$t4Y,b'@~/@ lDG A-9 : ;UBUUU'(t4Y,b'@~/@ GX8C-v*7 AU)*U+,-.U/012U3456U789:U;<=>U?@ABUCDEFUGHIJUKLMNOt4(Y,b'@~/@ GC~-lkGn AU+,U-./0U1234U5678U9:;CDEUFGHIUJKLMUNORSUTUVWUXYZ[U\]^_t4/Y,b'@~/@ dC-袅T/AZU^+,U-./0U1689U<=>HU`abcUdefgt4Y,b'@~/@ TFNC>-nG7"AUZ+,U-./0U158HbUcdefghit4Y,b'@~/@ DCKC>-nG7"AUn+,U-./0U1678U;<=>UBGITUZjklmopt4Y,b'@~/@ XC-1/AZU]^rst4Y,b'@~/@ C-v*7 Az+,OtuvwxyT{|}U~UUUUUUUUUUUUUUUUUUt4^Y,b'@~/@ j5C-v( A;XUvUUUUUUt4Y,b'@~/@ bC-9 *7 AUFUUU^t4Y,b'@~/@ >;C-vy*7 At4Y,b'@~/@ DGA-w7 ;"W  t4Y,b'@~/@ 6C-$U*7 A+6t4Y,b'@~/@ ĞC>-tkG7"A+6./t4Y,b'@~/@ 䖍 C>-\kG"7"A+645t4Y,b'@~/@ mC-7AZ+689t4Y,b'@~/@ $C-ܥ7AZ+6:;t4Y,b'@~/@ D=C-wR*7 A+6>?t4Y,b'@~/@ dC-4w*7 AU_,-@At4Y,b'@~/@ C-Dw3*7 AUn+,U-./0U1678U;<=>UBGITUZlmo pY>Yt4Y,b'@~/@ XC-h 7AZU+U,OvwUxyz{U|}~UUUUUUUUU}ijwt47Y,b'@~/@ 7C-9 *7 AR@ PR@-G NR@t.G MR@tGNR@pHR@~ZPR@< IR@*IR@(7PR@TNR@̝2RR@!GNR@.GNR@-GMR@*G_NR@$GIR@#G$IR@TGMR@TGMR@,\NR@NR@ =NR@|NR@#GNRH<(H<(H<(H<(H<(H<(H<(H<(H<(H<(H<(H<(H<(H<(H<(H<(H<(H<(H<(H<(H<(H<(H<(H<(RE$-GMRE.G[REGiREGwRE~RE REGRE GRE)RERE<.GRET!GRE\-GREL*GRE,$GRE GREG-REG;REGIREdWREԔeREDsRERETRUFDfP h(TPYYBUe@xTVmt(1B~ٟh> @b(P9 Q# BAUF~? ?F\.u?P6 #A >AA mm u` ? 5AAA/ i#F/8&ur#rI$>-yU5 HLa##԰# `0"$Z'1/45 13Vis_PRXY.chm!#5?902q00- `5G)#6367?9 (###&A6/&7 a"# !=$/M=z@C71SE@7366 2$#@C2NoNk?\C*GB@CX_ @w-ab rTw"R24RI'f_BIq$i@A159 MX@G4"]'2qN`6!41fJmoGɊ_T E"d"d2!!2 t2$t3 (^c*5*5 `y8"`K}oS0ten1&2`Bx36Aq%jN`zp%^s Prpzp]sS0nue0mpru6261`_w~cs}!pBAip~5T74SewFnkpipn" atP`SwQ0ml n`VwISEAWIN0TQX]` A7AnPgnE/ISCW0SI1v5dD`zݏPq USpatԐap|3CyEpd.=uM%`zsvsZ1sO;Yia2t0bpgBn ;Kn0*Tg9A)gb1lrs5ZrKa0k]ql=]tWuf0EQ0 Ta) 7qՑȫW2/]rҲ!qoiiA+cqqA@?CR$U!2%c]yW42?()3E%&]b1avy8y22p}NQTWOY0K0NsE0X1OR]IQQ&ȣCΌ4 pC3&ГdvrWߧfl+F"vBd%~Sr3x3%2"w"c % 65HZl~7V3Gm ]ex%䏢rJ`Umr_0RTHKg#%7*H$ 'qIa{a"qaid 1/UF0VFF5^Sw"S%RJV&%MS]T:%'Vs|HSH5Z .V F"cS"g,tYj5m8c11"!س41g!!2X(1T,@2y<%d`V3y8$dפQRRq" HSVuE5<%@UL/^&q-\ -5/y82b'R_3nCuLPPR#.Wя2P"`@@lcDQoaURZiQ7E5/gCA0'(<#Uj6j6bLTްrTcS)Fa# bDF"x4[ O|Z3H^E%nNUO.IQ^EnE  M*MI2O5yN3 jR-pShYgUHU# !v͗)uBGF #w"MB ]Ba\T@oTPUEU5"#ij+UFDfP h(TPYYBUe@xTR9NR[h> @b(P9 Q# BAUF~? ?F\.u?P6 A >AAA AmmG u` ?5AAAAIi yF/8&ur#r$>Fs(??FůbX%%̖@w-:1*5w)4"I#a Iq$񉄰-#5 HL3=l4)Z# AD5 1`Vis_PRXY.chm!#590o23 2 `UA<:%G )C0`EGuI#CG?9 EY2#6J6uO&7 a21A!/=#AECFF B$B##2NNk?! >Wq@a% F#VVVE?5Aa%R*dovh534w"g5koj3g23f5Md& ,5JemnW_"T TU"%2A22AA"LBY3 2(^ E E YH"`K}o3@tenUA&B`RXC_Fv·5j%^ Przǀ]s3@nuE@mǀrUF_B܏6_A`!B]@L'} V6lX-1u. Bj2u2Z2j2#u9r#ULH/MZ1+B#AD5 60`Vis_SE.cTm!#20AD%`>Copy<0wigTt ?DU1f@M)@c<0o+@'ofdBUArX@Aad@iV@n3@ WAl@ef@R@6AtBvBb@hB@lBAJ@=## AoG?9/#n"E&444 7I0#AHB59_lj#"SV6U8*l>(Uhn E /J$&9"(Ln eg5Le#pheo'T ll Js~o/|R12'"U7A%O3W_7xr5(-6 `F2 xqu\J@Q:0b)&`AAs)@E T@xd@Di e i=M]UTP;7͑4U@ !@ү&P lA4u7` u(Jݩ c?EDe347 D    4ũ2qL lvF BP(?7L04 `LineTray sp r{ ncmyz۶&4W` v%P t e n&$4` v%W{ igTt&a` v%Rouy dw"g&Al'2A{Gz?6>5Q?An"/`Fw lo0~/+n"j?|?+5/z!44`STa ow?<*+` 9?& `U 9S5@y0eK} $KXOf@Qs{ 'B $KYO 64`9M*@gy i@i04Ai '.4 `9Dw AcNl:>k$Uhh@2Q2QE,T/JH> 04[_q_[_o!otgU__o_oTEooo,o17>Te\Lsc!2TtM$t7tt ItEtURtUttU  U -3":GqTlan{TARɄքeㄐqJ"4T c 14.m"?7Rpsf0M8@H8 MEJUU8!r5GrK&HZ&H͟@G+G3"?GERml&Jlmyome>mGG-GAUV>6HԂyϿHႻFSP6HiKte (=MQ_'0Uhv$on!3` LDnFxB'3` A@iBݞ"4` C m@bAxB}lewL9WIFE/HU= _6p9yEW49dFT( s>#d9>?B T]@ekVo+$M X]:aGl)+ ]UFDfP h VTB UYuU??Fxha T,aaUQJ\UF BP(?@?F~?$-?P nLel]V^ ] $g]#Q"U"Y*"]>"~#}&&&Or&"u` ?PYu"bl""& M&u"u&u"u"u"u" ,u" ,u"4,u"H,66t#\"u"///$u)a}r 1'u `Fx3N3^3n3~3333333333Vf4bVqfH0φЬ u"Z1qٝܦaٟ333'373Gc ƢEt&EAxÎ;ܢܗ"3@"3."c Ӣpp V/3,S/e p>{/ RfSIA62abZHaLxV3Ǫ *:Jz׊ך@'OgEa@GraĠAQJ`FWO@rF ЀiC}F@`I@)@AEBsZeȓ3U,puӐe(p 4zTcNV:fcfR:bWKBpY!UbSi@(h#FtϿF?@ ЯqRfa+_i&7=akVQhaRkQclQohaR2brlˡF@#I~urW{ 3~@J}O qO Xy`I@Ё`sRUڀfK@ڀbooOlw wKuK`1s8zK@JqyozI@ eoo /u& s!x7SlP;walPe,0kq @Jq.-8r cJqM-Nt 'E1 *dbt+r sQJQLŌH{M$0tb;{O,=CƁS=ԯןƋM2'Kx~{׵am(zD1-?F|!ǓnJ\˟ݟITjU˫ˬ7F:-˫˴YkIՎ_TF BP(?UQ!@>1 Iz{7 Fgcfb@&7 kRka},1ff,1~,1ff,1WVHf312E1kaB12lQ12a712 ,1HfWV3UYkaO} mlQYBaYOB ,1WVHf3ka lQ"(;"FHfWV3Y"]#kaS#" q#lQ]#"]#S#"QocjQWV3,1HfFWVCaHf``xd䰈qGA8rL5k08QL5 Hk0L5k5L5|0V!CTBL5 = |5QQ5&t? : =|5Q-5S47 PQ zqE4Hd7&qn24Dp)TU+0F2o$0jjSRaR9Q#HeM1sB=yIZR1s^lZLªV_4pQL׌$H.5Oa 5. ^fapnfỀ3p` T]`avelShiftH/$xa_d@a}3p`O`gfs`m!*_a@@ VV%Sr V:67sGr:2!7s[r 27.i$3s 1T$y@aP@dvkQXU.q.'2rq⺏y!,0}Mv`n$@qqt7v-ɏxI8cʁl@byf%!r*򊭄!DŽkqԄ .A\.A"rkQ.Xa Xa.IᒟcFpBT}/b.񜗔*r.񞱔1?A?A1˔(Aؔz ..񯑯[Rx a;`"[TBf"< A`B`sc`rdu g`f&+o]`m`t`l`g`l*?`0qH/.:jx +\T`x`bdvq_v!L5~*ϫ16DPᦄ/);\R`Ht%k ` cTfx8wQ02xQᦎuݿ)/&\BanAM`_qx2Ϛ0dP*(O`a`*4FxgyQ2?Wʷշhۯ-K0&4Fb@[mD{ǿD!As 1ϱPGϠYϋ6ѲĢϩ5hA`#^ &AsEy)3UĻɯxAv2`OQnwzT9ߠ)ഉĽBTfAvH`U ta)Yp!3EWLnew)ncbĿ Av9H`R#t6Hl~)99:'@ϟo$tm-t!BT)ங'7İZE9Bs&1)/I4+r/o/Av(* t/% *M{Sa#/?4Vr4F:?^?mAiCOOOO6O=nO Z\9?K8/ ` GAAtPT&pa=rb+ rt*P@?#o54trp8tb T mkqőԁw`3PtquːtcF~ϿF@g п%ukp`?u %Vrq t@V4`AszSPsT3 5jːqi!stgq xʬŕhtbrQ?l !3'󿂱/ cː[яJakr}`Ѡ ː *ː}<9ᙓ @ː^rlA$Q2U lQQ؉uhU+24rH1yɒ^rx@7.?@hzi?wԐH}߈7!c6z#o/|U`a1H_\"p1&WrBdeKTv7.Cԟ@V@)`aGo ,o>oPobo1qyo>TooODow QS+F搞R6);=[v+rrQvq>LUF+q StFUevS߅x$?~&qޗ݅ԯ1).UaO|㱩ǢKT*ϰd4)'ߕr|$<b/WkNȏ%rQ|evʭVlߟU[#Իg.gaxweۿoo1τCϟSCS/e/w/S~eB]v KcVO/GXidU:@ڄE-,/wb/cƻ͟E/?'?*&)BOZlcƄdUO7c*&tG);AEOb1ҿ)M_b.ϛ]!_R8Vb=x]@('_ ݂?z-sT_Na2s/.g(O]Sa5 _;;L7pwrra2wcCB|WV.gWi gU1gtO|{럘p*7 7D g,l;;.o@o*aa Oo0jo2kJΆb`b~Mk 2(s.®R%nd\Sl$Z`@K ay!Tt1K쐴^VQ2CƒUdUpς1aan9Oa7Pp7߈y!X16BòÀJaa WE$1߂!UަQbЀŦ72Ce$6N@¸ջVcIpRbL(aO[Ne4 (ga@# f8 \ 2@dT!bu-(;M_qgֿ`hT4@?F\A`0ΉjM09 Q)(3b8ye/˸?FƣE?Fp5Ys?F5&!Q@Ή( 0̿Bԃa2U0*s3?+0QԂ2 k+ݓ0]'%Qn?Fѡ?FW^bd%?FԊu-Q/c,DJ}?5^I,QI,$~//'% ?F*^Y?F[E?F?|{T?c,|гY,vݥ,-C6*~??b'%OZ`?Fa)P?Fů$_?FPv'͚?c,տ h"lxp_Qҏ,mV}b!)?/L FAOSO+'%`0DLJ?FNqVUO:Oc,~jt7A`,׿p= ,?7d__Kh'% QuU?F`4p?F?FLADX@t]_c,io~JY8F~Z4 qۄV$N@a__'%X/~%l3!?FeY?FJ~ӗ oc,z6>LZ4?kw#awi?vQooj'%'-q?FmUa`2#+?F(%oc,Yo }j GfZ4 ץ,ClL^!UFV{WE?FcJ(c  )H},""3\ \ -Y@qjǻ )1̶ Ւ Ѡn}δS m|ݠaQaCS@Gh4cfUpHi5,)֝F3L&DAPiЧ Z3*#q@8|`rӗze2ZՀ #5.?\zi{B Aȧ#ޯ&&JJ\M @㖿+Ģz`rl%ǨΩ)1π8"4߀ߒƿ./1*Tύrˤ]!c-=( =5-52Z{#.,"~T Ȓ@@ 7ӄ`Ofrsetx%@p6'<g ( "^p7'(] #5GYk}Favorit_en.s] 2DVhz D BASFLO_M/.VS] 2DVhzD XFUNC_M.oVS] 2DVhzD BLOCK_M.VS] 2DVhzD CONE_M.oVS] 2DVhz BASIC_M.VS( I*pnC! qU/Dן_=Q/ן=OSO PrPSRS/)#) ~  !"#$%&+,Otuvwxyz{|}TUUUUUUUUUUUUUUUUUUUUUUUU+ - - - - !- D- E- F- G- H- I- J- K*- L- M- N- t4&d26@~/@ sC-Dvu A T !U"#$%U&UU"#$%&'()*+012*367t4GY,b'@~/@ *uC-Tvʯv A"  !T#$%U&UUJ !#U()*+U0123UBCbcUdefgt4H&d26@~/@ D+$wC-dvx A "#$)+,Ovwxyz{|}~JUUUUU $%QRSTUfgijx}~+t4dY,b'@~/@ ڟixHC-@GyA;X@LFuPR@\FvPR@<'GxPR@*GyQRH<(H<(H<(H<(EFzRE]FzRE*GzREԛzRUC`8\Uu?Ƹ1n@qc7@ LFDTyB uhn0CT w0UFY,b'@F~/@Fx%@@p6@??0!s#?2?/M8"mu ` 4p2lBrBu|IgO7+ P D=2!!" Tp2g(T}DB @=2'Q%7VoBSw2_="@`_{0B'Qp53[CWB(P,~zFF?6Kmo $BU fs#3aGQS3aP` Verbind]bPQTb _` Coe`n]`ct`lbe=5n-o?oP%Uc F_lus`dc`a@r`m`noaaow`h`r`h%oo0!X` B]`srrc`f`ue`Ai}cUC`l ruweAaq Q!Q!"Qa(D/1:!5 <>g2Hu&%rA/r!f=5x %xp5x5xxxu%xtqttqQtUxQQt!!tQt!tt&!&!ttTTttrArAt``xt0!Q taat&"t)At, t$t:!:!"t3,t60tD!4t2gxq2xQAZ"!Pi)jDq ST> , 0!cQ|~Yf!!ex}&!fgrAR~`$% 0!1:!%D!22EHr!$}L.E nBrq1SI[}F_< AL,@P(W@@hl6@@2?@ZV™?SJ[rq$'u}@`FF?uՁ _0b 0pg@VcB}244 417l7r.);M_p=2l1$|<=23{3) `p22tRX`:!BB)y9CQB`)lBQ{Q"GR $    {GR$ RU&TGSQ3U&4ؘ /o.ƒ̀!BpA{Gz?%Q;?{ٱ` Srd ra q&lazیQ"//` Fc`qPB`t`^aa#SRu`q'3 >` XP? "߃1݃1Q-c A`c]`n`s?4*B` )-?Q<`U%5Tbn`pr.1cy;?O<#|!`)-OTK" +S`y`q#2 ;Xfkps]`qH ;YxOP `)Dc`oAaib%`)Mbniri`1[yx2qP?@@@}FP(?QBr#"0Lcbe?"xb $u`,?u' X֑@aV FV '!yDF壮$` URrnbrs" 3 `UaO?K` U ?S.>pesô2;Ta.BbvHzqecka{v%px8)ٱ=TF vw6QQWAAx pU{`"|mH>~_¢㢱!F!!gўrivT,,@*!09~p**4!CP)A_aA; p&s$*܊R t^? @дF@ؕ@*"ev57|!)*4s{ D"4g%5EE1د%'s%wUMew\$8wdZ&RrVQ !RRl+@r˓Ф=WQ0@\Zep@᜹ @\4U>@uBdaq-QBVPiPգnroMu钡$'>t<82<p#ue5+mFvգG/Y"//,/>/{*F`0(p////?o;1[/??+?=?O?P"u???`--wF&cOO*O>N-8Ϧ&8.q(:Lgyӯh䄆{@ƆHQEatt: @@ `@@p8@@q#Y0' grAU޲s@wѤq axMSU &41qldcx*pef|34T޲HDDDUD D D D D%L޲4k )bwrdq0 Auaq(Ѝ`-̀A{Gz?Q?t`K F@l!2*3BG+6`9Ml?@@`uR%L@eD%Wih\Jr` %RAg* `%qxqcdҡa+"bGvсaGāzZsxe~??;CAmEÓ{?O;ȅ_TcbDbD`q`q(aa"qqcsu5O~XO+mCѴ qC(x9mCZUZYOGQS_e_w_ۅRl4K?M?t-1Lc\MRmC뱬bww d(qq"ٴTt,@aau71bp@F5qfu`ogqaEjE␂rZaW+=ruL pu p+ @FbI3l@@2[@XfNgB@0a%dcos¿_=沎@`{񣰁c72Mї%ff@ $֏o@,hŏq3ҘMɇcLyИ בk DLИq'))asυϗϩϻ'9K]o߁ߓ߽R}kf)m5i'@jZV?@Nq:<#@@?@hQ F??,AaIIhI¦IpH;K}_m}‹•Ox?s~PbtʓţUBBPK"`BtBO?S7g*H<@TDWX=A m幅hdhge%1ikakg8qEq D1jZV?@-Wu"@@L&d2?@@i_9]ֿgƿPh"ϱp8o"@tufSv=@`uA `zpArUguq`} ?A% |Ah"Qs0UB ׁ[g ?Eq@0sNaNgkm? tNLC;zsA "Q#x?C&BB?w#TS'&&&U& & & & &&"""d_2 &3& 4\(26"222??22??|Adgw~Oà9AsA{Gz۔?EEQk?@J al`C`l`r2!J" sOE&` S2a`owOCOO` EP@tbrURC`ET@aUPsp@r*`n`y[)_;_:C4a`Ic_TE[B KS`ybڇE*"` IXO`f`e`Z [Y_}1 `EID`Qai`W6a`IM*@gtPibcRQkO5tO(C2q`?\000F B_P(??pUsa* ` Lz`nJ`Net9Mssٜ>* oo @mr{acV31a{An(rTMaAWJ`iv`h&g7ryOaYgu3a _q9r@gu5a$R|@uPd&rt;rsE gua=ba_uZCr t[Q}O8O@A%EjEso?@~@rb?@I5?הߕ? iwwOL$cO9(!TsJ,J/Rş0|o(?5)\.k?֤1@%µA>2Paam ejRB@`mf9SQvo~"_=]@`{i@­,(`%'0cs&\!hSQ+ 2ETJ`x&`OBbcnFRb'gB/3` AIiE.B4` {AmKQx0qEA1kCU@Fy!)9%޷UujCPʰ8rյ}Q^ L{^D>+鍖+m3,@r)8A15 CN~G@@gl6@@8?@U??P(-DT!s!׵%y/ y %my-/TL!7'a9YӬdl?@@лh|mrb[sE%EkE@į@ X `ABu[E_c3B.B9OKO]K!`OqOIOOO(_a_C_U_xy_______ oo-o?oQocouo oFd#bCV>1A2ֲ"A2 6.2_232237 6 6 6 6 6 6 6H6ֲL2L2 R6p3R62!6$}qL߃U`߂‘qłRL%@AaErO OINOO6WgaN _OD_qaOO_O.@Rdvд$3ݿ%9K]oρϓϥǼqu˼6Ep졥hTaq" D" dq+ N 6qs6ᠡᤅ rF Y`yч'M6sFh4@@:@@JRT?@ vHfMnpus`u 9Aeu V`:aj pu:N @@}o=!@@~@@il,-_@)p V`@z3e p .1<]I\n6r5ⲨDΧ%9ؓGa/uw"tNzM@, 2;)2  ݢ83\6L36ܣ.2T`3\\\ \U \ \ \ 523 5#32d gq|w uH4` P"t r(dJ\߾//*/
&(é4*[Z,FtBѦѦѦѦUѦ Ѧ Ѧ Ѧ Ѧe٣]F ] a">q#uq7aF8I[ewYp y,@߂dvߚK*q>qxbr EE2#I4F,@L0 Ap[IOTFL6u`/f:a1:&?#AuWI?h@=br[uLo0uo0{@Ffbu d@2 -?/OAIUOgOyOV,!5S ,! o'o9oRoٰOmӾGuNJ_O*zq @d,?wQ@y"uM0;Bxze_̴_!A2D?ux`*0#۟ XocQuk#?^o.h$uu`Ms&­kYtRDdlrڳH<TDX0ZA0QT5hT Yp8gki*[Oq䆱HMjZV@@2}!@@D*JR?@L&d2?:j$r%?PQu`u[`f@@mQs&#DJ"@@_z^g![!@@}o=]g )p9Q%$ 7Op@z312 ??"pE>1_6K?^?p>$D4U$7WQrs`BsOos+!G$29۰r Cagh"g tN9Qzs&Q B*C&A>CB*B!BB)B4BFFF F F F F0q>C^R4^R!B^R F3F4ZV۲O~g0pr~̀Q;A{Gz۔?UQ?z۰$3 FiWlC`lb2}1" oe&"` Sad`w1oCcJo\oW` *ePu`tbrnf`*eT`a`spu`r`ncykooc4PriokDb pkS`y`ef*B` riX@fps`tg{ v{Y A `riD`8qcҥ`i`g6`riMu`g`ipi`a{K޻S2q@?@@@F BP(?ꙠFva䊀c*0` L`n`~nUx0۱x0ѓy{faj1vEanqaW`5i hw7Ə"ޅlqo9k}?@"ޅpq5vR`u`d g;}1 ޅq=bv*jCmkȍ:(EJ@6?@uT"?@U ob4ɓK*wAwAA^B1T۱QQ۱/ A(>\.5?Ŀ,A @&ATu {0@wAN1$B@޲Ro_=/@`{Q%i6H"kES`'0@ l$u"eT`x `~o"bxnqw"b3` AiDb4` am dqxހa{U ю,wA$ՉX@U"?U@?& 1BH$մ@l%B8{7{L@V 5O&s, lkd`ve4 QQSQ&A"E0ղU5 0+=Oa/28}t߆߿+# r.) Xo))A-Y"?@eo" @@Y!?@fl6?Bˍ+3s}ORJBQUBJCQTCLB&CL&K"B2 1B2 1:Ct&1n#5n?02^AGS)kCMɅCO@CUV*#S64C.6+"S.6.6.6;"S.6.6.6 .6 .6 .6 .6^S6+"hS6 AA")XCj@?@?Fh$E/C4&"K20#U{ _V___ ooCo{ogo_ooiyv{^_oooo_ _BTfxH,#?lGk[EEERu0LWRu_V `Ruo[S%CTbCec1R e 5P?m/6R5f_&!&!!""!!4HZZn"Q!!-U4 oI+!!0$փ/p!R&R㏎?K]oUn8`~b7~?<DmR11!"11"))0!0!4n`"2,@"0"%TF# u`춻(&"bG4aKG2r3]uF `u*`@?6vb'!d@벞@.lϾ%>RTݍ%vl%RNـ->dnq!ߑc&!4 zS>?á׀›H M&8wdnңL/2"P-ՓϦt/S-B&!PtOfB!TDڰ !!pE%Su<`A>`)[!@!j!~u#L&d2jȧ9]ֿ͹ƿA%u6j `u `sAIγP( B!@տ< @ufDZ*`uN``zp.a1`mp5@g. @z3]gy&"K"!!&#%E/ QrmH; >2K/Z3t!#p!/$a 3tN*zs.a "#323&P3&&3&n3&&& & & & &&3&*"3& "3&42:2W+&fD2?02=hE gyOFOOOOOY_9_%_OI_[____ __o<_'o9oKo]oooooooooot%3't/uP(G?Cp^KroaPK-`QAnUr#aTWANىPbfbQ{"e1a9o|@7a,idrez`IOa!i2`BeA5aR*V@u@d`n)sB !&b*QU ea=aG m_ZCCr[mѿэQ֨ED_Ep8?@z`s;@rb?@b4ɓK?yF? mCe 6-]!CAAAA5/gC?=%)Rk?6a=8=P]^+ɓ?Qciܥ8(`'0c&u9A)Q+/eET@xPOeB` LXdnʐ)aWeB3` Ait͍R4` QAm퀧Qx@sΊьq=ACUᑠՊщU<pPѓ9ߚ(ڔWAJ\tԚ^$bACϓչ캂d4W-@Rv$8?bϖϐϺL1+hz+.LW\gy-?`ϳq[!a@&!%1(`#@JRT @@ # @@?@hQ GF?˜`&" [j/+, 1#:#j`//%#҄X$٩*# Xb2&" a" a36ާTadWE@qoکo+38C>ä`eBdOQkJ?*?ڼ޼cHEMATDyOCY rEO!ӷ h9T8\OQHHL@90lZV@@.T" @@<*JR?@L&d2?0T8U?Ppơu0`uL`6W@^9VtS[O$@@eo-Q!Q@@ #7 @uf[;`u``zpʁ)_`)Wpg@@z3VonBZg0$p|E;`ڷ1#Ӥ^0YpӵzR tNkLzsvV :r1CsOӓdvӒbӒ@ctu[wwӒdvUdvdv dv dv dv dvvdȐrbr vF3Bv4r@rJ.rdlg۠0q̀A{Gz?Qڻz?$c FiWlCl2Uq'a" &{R` S@adw'.@W` PYtqrw`uTawspYncy(43Vڟ$( TyP*5r` VXWOfkstK ZYiP K`VD뀮cii62`VUMYgiiHȫ=Ė񑟃2q$?@@@F BP(?G^ a'`KEA`Bn£b^'`b.'a{LVA1Z_Wf5ih7ͿdRL᠎&``꿄9p7I @{R\LP5ZgURludn۵aχϟ{Q LUK`C9KߨXEO Fh4?@0?@r$?@b_4ɓKSZ#$ q qWD*\OTq !(/`X߂u(CAI5\.?俄OF ;=FG# q15bc@(XDB@"l%1|o2_=@@`{!UioD?OY,Y(Oe&"'0$:y2562G;6Tfxjb` Lnʡ/3` Aiҳ .(4` mHxQ-ArAA!UT-rArA qd${.U@"?,7U@?,>1B@2UByhAQ wKα BI٠e0 5Nl LBAYLO#tCA#|e -#?QcuAE#!R:yhBpCE Ys@j Q?@~i+,?@hQ F?yD@CS[`bBcBBCdCCC(BBaCa BF&SBBBB(CFRapYpmpbBbcc !acVRW# dVRxa?o`ba3aCs#_rEsjf3jf4E%VFR|sffRsfUff f f f f%csPvRv @R!%1NyOJTR@S:͏p(`L:pNZ؟̟ڏ &8J\nȯگ@q5~df0 @I2LE*4l+(pZLes8† `:@q5H. ύ2Fx_fդqѹ 0 EJ%Cgt``ntoU hgk UBgzYsY)~ @rHSOD RX!PqPqpZqZq!!QQRR:_0LBlPr},@ bRu0eTF c~u`Sև᾵ꀾRwlRW=rdsuLuԐ@=F^b%I@P@8 B@Kah2LEoB2_=K@`{h1 $!! ͑!LE4O8ZUtup~uqD$l!!l!%hFG$!G!Q!/q^Bd?uTh52 (nu`/))z{}W._/̆'{!_PrR]Tq~q /i(/t"&"$&_ 3?T^\WzO?Ua $z" jFX?$&"o+'u5`??M%6QòO0L5"J.VOhOMP#,4ޑO0L5NCOOM =_0Ly9?m;_M_Nsލw_0L_____.JBFP<HB$ u(Hx}aTD[̱=̿cidqԶ Ū xK 'w"A 8T퐑xB88&nʗ83` Ai}*4` qmtx~ h &Wx ZjZV?@PۗA@n>=?PfAib7^ @2 `@?% B@@a/r!$So C{r_=@`_{/q21l(!;U7 !mlj7a0($n/cU@6EͶOaNֵG N:_O7 q2aXq7 aeOe5 e71X_ɱ`_{A`ckd?fbtcQ/u[#/^ o2h7u7`@oRi7zno73gfa#"$Ua۱oh`1bObt6saQ\Dz!xE6d;>E>>K>U>> > > > >DP;[ "ms!DӬ31KAja@@Fh~6=@3[y7`qP~xj?̀;`A{Gzm?QE?3 -$ F"lH2ذ1` ]S adBw8*` P!r*e1` @ njB`T%sFae&cy¥ o`@  9 > S yH| XOfsܰ DŽ Y}0 `@ D"0c 6e1`@ Mg&iiP1Xu2q8 l?@@@6QTиLeK*b%Wܰi h.c8b% `b%" 1DAE ~DCbu&k I  "cbe?Pm?sCTQ?VW80&AN44XttB4!RѲLR)Q)QB4BqqNzLQLQG?W:Dr9I+3!Q/DXqERBID!RH93ilE!dlE?#YA!UeOwOOW;Qh8S4W9~?74g@/L5oz0 S?a0ow?'3.?@?` 5P Y0tPePA3UW`5TPaPsPaRQy;??3!`PV9?;(2 T;SPyHe&*` V9XOfk@s*PtKK ZKYiOB.R `V9D QcPi 76%`V9MY0gPiB@iP1KJ4џ#2q$P?JdRF BP(?p|rakA݁G+`W` APc2ta8y5%d9ASqAᡓ]_o__TR{%aNS@1ZQb1n@C!Wj0i@hG7R_o_UI~`*o?Q9pRwooKo@UpUQQ`oR* u@d n@eA;RooA%e UUQq`( O:CRy;]JEk p?@|01@r$R?@I'?%?d$^>#U !1OEi#s3U Ja[[*JEOasSLT8    KV#j#K~#4a[e  /////// ??V?B?I[x?????O/,O>OPObOtOOOOOOOO__(_:_L_____~???__-oo$o$OZolooooObOoo-? _DVhC_)/_U@S.$6H`Zl~4l?pM8YJrObT2!L-ReeLWO@qG U_ `_" _83 ̔})C{g Y //A/S/e/w//////P//??,87׀@lqA`j IbbKU U   )P-- 33;^^7A4rg5\k@2?.Jst?V2` AOׁ+:L^'a=VHSEڲhڲ!j/"/4)IH.a/s/'j/5///jeZ/?~/to /ASew 5@b`T29c)bCVh28ΟvM_煒Ju'1+OM+ODbCa_,_>_P_bVbżDbOO_Db_!o3oEoWob_t___ٚ%4X(G'\SAE5TeQSh=se, ,થapfwpoB  b8gpce  ,!zzmlj܈zPj=@cF6GL7@rs7IՔXj!A0.IM4bh'Ǣf(!3DGFaijBk>32lgkۏ폀h Cȡڱį$ڱE18GP # 80s64^ځ 4Erq$#o0@@X2L&?@d2+?u0`u`[W@)D:\؈Nn6f ʳڱ!Jg2ׄI'aEHƾ;'1%~1t J~1hTǻj9 ) tNp0~1zs< x1~1PƗU }h3d7ť$ ~13VֵV֥2bU?̀A{Gz-?տQk?yC` }g2N{`"0/` Pq9rv`չQs}ѣ> DSHy@rOu*s` XOpfeLxD JYYP..zA `FDdp cbrIqOu6`JFMugsc`t-A4-A2bq?@W F BP(?G-A^ba0K`Rn R!A0±wbrSq{zB<z1JOWpiphLwA7}o *,<|3Jtx9'9@A<pE5J*WRWuddr1챓wzA <E=JC)/;/ -AHEޤFRiѯtI%?@"J3}b4ɓK%#s}qetA+e7>B?ƜAA?jE=6@!AXyAyA!Ab/ C/?M(nUm1bU@[UC@@3@U@kqD[Uex )r)8:\r631y1UY@vFίx<@+=OanvjubPO8!?fІa4?E@0_ߋ@`Bjc⹐g ^b'ȿڿé (ω1W?Qcuq#AATAAAAA A A AF2æFӢæ d3u@’142ߔߦ߸J6߿Zl~}/Se 2DVhzў JdR 17>aG%! Acf YRD9Prq .1L,p//$/o/Z/0B//.Rgk)/?1l3OLG'?9?K?]?o??9n???B??AyO)O;OMO_OqOOOOOOO(rO!@DGO%'YҀQ+?_Q]+b_OXh___[s"8#U%&a>_P_Pc?u4OXHr????6_ o_Oo0oBoTofoxooooo&p,VWQWQM?)HWSPж#TRO[_TPz[ ooiI6mjjtj!d06x/-ŕHFo!32bm7n6h!I0Jw2/-v>d#s"7ktooBLHS#H$|aqTH!`0!1uWՕAn8!'$FnYYP|a`qf!HqXT @@x<1@WPkP?Tj ̣u;`u`p`$܃a[Qt:Nj6f K0rH/>TqF@wBPJhuI0Vg 4U 9<U#R0W ,05* Ⱑ0/D9UDDDDQ D D D0JʢWʢ9ʢʢ 7H9RW9R3>Pbtοÿ(:Lyp7IϦ$6HZl~ߐߢߴ =!m߆eڇ` On=VKo#nGY%~ b4ɓK ODI3;$6HZl~/&/_J/\/n///////"dvL(9{e?O"Oy795ROdOOOxOIOOOO __0_B_T_f_x__ "HIi8!YhCkkjq#]t|(A0As-K(\!3E/// ?80?B?T?f?x???????׀S#WQZ@X3I!s@JRT\M@@?@hQ GF?d ps GqARAS;r:s:s!:sA:sb;rC:sؑ ,r'A7 iN?h(?ZqytA%!YA;U/gCQ|qqX!??̄f!\Y$?upoNEU>uOHu`OI^E0NO@\WAG@)>_H[_nBB]V`rR__USPC\4?zЙ_75߁Dr&!/(99>)@S p5UGRuodw n;>h =b`C> /+/_t +˜1Ee M 2'0ƔAn᎛(F FTxM` LnFxm3` A=qih"]4` Q mn x^+ n*a,Ua e1E%L|1('a@"3@Fe2?o6o1BiEe@k=u ,쵘Bw+bQ)Q4zXj|ğ֘T @@Dv}@B?@ܪo'ӿ /<'6%up`u4Qq2vD΂ɏۏ#4ơ!Q<ѳmRdvQߖ|̳ߖAQܿ$F;EJQZË|nBRËU U GrólӽGr"1CUgyߋߝ-?h/czόϙ);M_qBTf7=Om/P3K]{ /V/A/Oaw//.S?@9D'I)/8`?'?9?K?]?o?0;a?9??9QOO)O;OMO_OqOOOOOOOO__%_7_I_[_m_________fa"bu_k=oWoiol;NoM2-t"?[!Cߑ+ PqÁqPDi0_{djZV?@HP&piȧ'9]8SJ\nVk@W QIf1oo!IfooVڒÁq#wϝÁ㓕v2rvvÁ#5GYQj!Á A2rAÃuArգAAA A A A Aixdu9i sBWsfxҿ.Ϫ,ΟPbtϝ0Bt(:L^p߂ߔߦ߸zd@@@ 1^ K.mQ`hMqb P'9zoϓ HZ5G}ߚ~E&f?b4ɓKv&8J\n[us7Yya/+/=/O/a/s////////??'?9?K?]?o?????????O#O@5OGOYOkO}OCPOĨO ,TOD6ňzB?NouDUYؠsPQ,T_$_/C[ouY_k_}____]_vX^3_o#o5oGoQE>CQdh?i¨vgNqu!BoO.OcsoF[OnO r!'yG=Oas}!s2VBs2Vt!1&5!EVBYV!m!wVORVUVV V V V Vf"fBf" f.@RdvGk*N̯ޯ&8J\n4ͬ!Sm ֳӹBS` Apc@9;@-Q!'9xϊo-ϥϲϩ#5xߊk%ߡ߳߭wC3s?s@4lIO|OÎ 4!9Ke_q)!#5GYk} 1CUgy //D/V+|4J?mFdӣ!q/Wq///??(?:?L?^??@ / }y8>:?????1Lmf7HX?GJEOiC]#LC%&/$/O-RqIv'OOO_"]q6S&"JS&YTqd_v___ZWXAY%S6u"cr@&c62(c66U6 6 6 6 66c6u"c6c6oooo%7IO!___!3_Wi{ÏՏ /ASewʟܟFXX=OυدTf(X9Ko޿_ɿXj#5GYk}ϡϳ 0B߄Ql~ߐߢߴ 2DVhz .@Rdv@ߣ/ =1FnD!YYAY A=1  %xCDV]2}It]o4]ϯπ p8?2.Ŏ}++^"ǧ!)]]䈡M0BT~@8q!8w!%M ġ1ј%{ȡjZV?@\M@@?@hQ F? #$AA7#,8" "9&#e#BQ"¾!}/28"23A3L"P3&"u# a#&a#)A%b}IY@q(ҤԨo&ȡf3CT'(T1/%BT36364C%p&B&\"2."26"2666 6 6 6 6$3EB8"EB\"EB."EB 9%#wB2TFH2ԡ"A"A֑ D .O"H\"#cg1̀WQ0A{Gz?6cUQ{?.k.__/` Fpl2f$z/>$/bj2āAAô,νŕϸUy6/?!3K2a+kG12~T86VFPνP>3É`J$Vk?//ϼӼXHbP=ATD^C> ?ENOj=VhkµqϹ|rיX=|A5$ i.jZV?@ҵ}@@L&d2?@@C{Կ:T UĿPeCkV<@u@`u5`CSVMUr,@Gv@ufPр`uN``zpa_ p)eUj4R 3tN<zs74RQ rrraP@5v_*bP@eGsPHwO5vU5v5v 5v 5v 5v 5v]vEarOar*bar gvEP3gv4`rZE`rr5dg0X̀nA{Gz?Qϻx$Af` FiWlClr+z۴Q" υ]&JR` Sa'ow` ߅P*t✲r\у`߅Tʀa\sp*rnyb(qу43'T %SyдPЄ*r` 'XOfH*?@t~<@r?@b4ɓKk?'/?%YPH5WYs@!!LDQbTpAAp/ x(DguQ\.?IQOP1 Da=#!1%#$  6B@2%S1om2_=B@`{/aB\Ui{3XU_\` 2%Q3(l?@C@@5WuLe27f5TFW3ȑ u`o'")WDѤWJGrCuL)u)p@Fb @ q.'V%KT@baT%&W%hE@{EפK((Uhq#0+h !}K2hiA4":?u+l@/u`=O݅F}ìQA$QOA*Lѳ?B\dm!A՟13<^ sލ?LQ61!Pz6aL P{PHF]1PTD#4 1$"+]1Piؤs;kK1єdYQ3't6Jќ1@aK2݄#|T7pxH;p|psnx@qw|3` Acqi_-tR4` u!mex.8H2DQ3A+/$-7/I"R(d/v///.݅$#/#/(aS3f4U VVR0{R0Qfb0ffUf f f f fqctrRtrRtr{Rtr USrb҃vxbӜD䂽1Z-yD_V_H©R)ՑBÙ8A{Gz?QH?#{B`s S@ow:OzCЏ` ]FlPBtrԒC*w` pg{` TB@[As@aB@e.@cyKZl:C4w`扔Tv{B S@y" 0XO f(V@" 0Y# ^vQ `D@֑cBA%6w`M@g@i cD+E ` ί2J)d4l?@@@F BP(?~L*Bee@g@,p N>P `Nȟv+EN֯7 NR<@u@dBg%Fxa 6"ze+@Z5l:qD >a9l`!G28|/A/dp?uz`%/(nduP`/)Pe%4&>.?PU7J1'zeh 0?P88?oB"zV oz1Ozb!%)@m?ea$<EI2 sލ?N4"p#*a%5P ]~OC?'.md!`! >a@o-ё9#P'+R>_)Te_)T_L@jQAqKŕtfo!36bTJ2a2dfOp>RyB2Ok^__wHL@k\!qTDsl *u95щ'\!;Oh@衑!)!\! $`!TAOM,1jZV?@*"@@L&d2?@C{ԿtuĿEArkvk@ѷup`uT`.A }Z)@w 1@0ufo`uN`zp1 )kp_!ćwT@z3ď֎)kb)AXwHqJ$„Yx;tz5CQkA7(Awmm3A%' tNsfQ _1k@ %k@!2o3 U   HrLLL Rro3R4z5Br5Bzu 5%g wl0A{Goz?xQSqQ FlPзݲ" &5` SkpaKdwѿ^` ʵPtrҼ$`ʵTaspncyM\nϼ4cɖx ˼yh*` _XOf'st Y%ߠx_ `DJciL6b`MgKiBQiyBAQzA[2q?@@@F BP(?^3^aKL@-8L@`nK~T΁(ُ@b>搀b{j2lq1UWih/׃7Iw;Y `@D9@5幀U5#RuKEdnЗjqC[ 倌_`xʣCwPA xwftnBB霬tAE4s?@ @r?@I??gdh!!/|t#k7AX2TSqqS/Q{1!A]C(xtRY\.?< qaQ]U@S!aUB2C3L@(QDB@Se!m5>au&o#Xb_=r@`+{Sli'toDo\X m.B'0Ӽbj1bZe>fgµTxxY²` LanPZ²3`ݠsE=4` mJx>AdqQU!u )()tS%$NUt;T^U@PHfR }\wHuA8D:?~GiqA $A*_N`rs"uLKx[TxS!3EWpވ4sil,-goAfڏoAg0BTfxAavAʟܟAA$vb8vALAVvjrjvvv v *v v v!Bģ!bأ+B+avBۏ.HZl~ƿؿϯӟ2DVCz5Gy .@dv߈߬߾*feArial UncodeMiS6?/?`4 R$fSymbol$67fWingds*7 fECalibr@  ?$fSwimunt(S$fPMingLU(w$fMS PGothicj@ $fDotum"|i0@ S$fESylaen  $fEstrangeloU dsaC 9$fEVrind1a8 Q$fEShrutqi| Q$fEM_angl$fETunga<"@ Q$fGSendya*/ (   R$fERavi"o Q$fGDhenu"*/ (  R$fELath#/ R$fEGautmqi | Q$fECordia NewE R$fEArial"*Cx /@~4 R$fMalgun Gothic |w L$fETimes NwRoan*Ax /@4$fDConsla@ `  $,F>EB4F!?.BFO?%BFt?=B$?3B?5B@GBt`@:B䷌@7BT@ABĸA0B4BA1BsA0BA0BA;BB.BdNG3,XN"G3lMzNE3$MNG3NG3N*G3TN$G3 OG3+OG3IO)G3rO'G3iLOG3iLOG3jLOG3jLOG34jLOG3LjLPG3djL)PG3jLAPG3jLYPG3<qPG3XPG3PG3PG3PG3آPG3 QG3 'QG3<AQG3X[QG3uQG3Q&G3QG3ԏQ G3DMQG3dMRG3M-RG3MJRG3fRG3,RG3TR&G3,aGRE3MRG34aGRE3SE3aGBSE3aGFSE3aGJSE3aGNSE3bGRSE3 bGVSE3bGZSE3bG^SE3$bGbSE3,bGfSE34bGjSE3TE3TˆBTE3`FTE3`JTE3`NTE3RT"G3ԱtT G3dT,G3T*G3T.G3>U8G3PU/G34U+G3U.G3kU?G3?V8G34OV5G3D?V9G3lV4G3V0G3܉!W2G3?SW;G3?W9G3W8G3dW/G3D.X:G3hX2G3X/G3LX2G3X2G3-Y=G3jY7G3Y&G3`YE30YE30YE3`YE3`YE30YE30YE30YE31YE3 1YE31YE31YE3$1YE3,1YE341YE3<1ZE3D1ZE3` ZE3L1ZE3`ZE3`ZE3ZG3ؤ6ZG3`QZE3`UZE3$<YZE3<]ZE3<aZE3 <eZE3<iZE3;mZE3;qZE3;uZE3T1yZE3\1}ZE3;ZE3T7ZE3<ZE3䈽ZE3Z6G3Z/G3܈ZE3;ZE3;ZE38[E37[E37 [E3d1[E3l1[E3t1[E3|1[E37[E37"[E3|7&[E3*[E31.[E312[E3Ԉ6[E3̈:[E31>[E31B[E31F[E31J[E31N[E34<R[E3D<V[E3L<Z[E3T<^[E3ˆb[E3Ĉf[E3t7j[E3l7n[E3d7r[E34`Gv[E3`Gz[E3`G~[E3`G[E3`G[E3`G[E3`G[E3`G[E3`G[E3`G[E3`G[E3[G3D[6G3[G3\G3,)\/G3< GX\2G3l<\A3\<\A3Dˆ\E3Lˆ\E3L>\E3T>\E3d>\E3l>\E3t>\E3?\E3?\E3`G\E3aG\E3 aG\E3aG\E3D\6G3\/G3?+]E3k/];G3j]!G3?]E3\]E3d]E3l]E3t]E3|]E3t<]A3|<]A3<]A3<]A3]E3]E3]9G3Jw](G3<^A3< ^A3<$^A3<(^A30,^G3,RK^(G3$s^G3DI^G3TS^(G3A^G3䛍^G3_G3<0_E3<4_E3<8_E3<<_E3<@_E3<D_E3<H_E3<L_E3<P_E3dT_G3<q_E3=u_E3 =y_E3=}_E3=_E3$=_E3,=_E34=_E3<=_E3D=_E3L=_E3T=_E3\=_E3d=_E3l=_E3t=_E3|=_E3=_E3=_E3=_E3=_E3=_E3=_E3=_E3=_E3=_E3=_E3=_E3=_E3=_E3=_E3=_E3=_E3>_E3 >_E3\>_E3>`E3>`E3> `E3> `E3>`E3>`E3>`E3>`E3>!`E3>%`E3>)`E3>-`E3>1`E3>5`E3>9`E3>=`E3?A`E3E`E3I`E3M`E3Q`E3|U`E3Y`E3 ?]`E3?a`E3?e`E3$?i`E3,?m`E34?q`E3?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~]>rFxml:spaceprsrv]rFxmlns:v14htp/'sUcea .i-ro oUf.-o/GUf=e'v=s=]o'200'Eet1 ln]rFxmlns:vdhtp/%scea .i+ro of.+o/i iA/20*c6%et/ \nbQueMarkrEvntsol=BASFLO /cmd#DcUCetd`QueMarkrEvntsol=BASFLO /cWmd#Dc/5pe9"CF14/cmd="wCF14/cmd=2"/ ]C/T _[C/a/a/a/a/a/a/a/a/0a/2a/5a/7a/:a/<a/a/a/a/$C/,ތ%C Ut4Y,b'@~/@ MC-9  W AUPQV%t4 MdC>-dkGx7"AJ@NR@#Gz7RH<(H<(JEߐREd$GR$qFv14:ValidtonZ<>' Prpeges Sh_wIgog}e='0]/E Rue{es D1 NSmTmFuwsiSggm Uc}aoDucgikbmpgfRmnyt,yoK) -{akxdugwgmmyv*mbdYsI.e UTrCnmcCeyK&kvtP*<^!ryV$z#iwn"Ba[LZEkbFl/"rEROL ()1G//*/TutEAD0AGS0C UT0G U D{HI0P S040)y=By1eR?d?v35}:) ?=:?e+?2{t%WQ"~u@1r$/6'Af"g%Z/l+awp$Ik"! DhY/ 'E1rGs|G/?H7O(o2S A?0E0QY0"P)*eOLI0Y Q_SQN 1_[,G|ESS?0R{ASM21F2MRRQR.e700R9R oo0oBoTi1Yd"COgS~1???B7??x111&.t;y0o???3O$6OHOZOlO~OOOOOMaAO__$_6_H_l_~_______"hozoooVoğ֟oooof.r72KsoH4o+HV 0BA-hEDҏ &t"FL1S n9LP{3f"%\DFX)o^ϊϜϮ $6&>Hbhp߸NE $̯~16Հ.@d5AS#tο(:LFpφߘߪ߸$Z0Zl~D*//%a/Omv?\? ??H?2_l?~??s7?/I %@M%dp`Q??@OO$MDVbsREopl5xl/BzAxcO>_O////j|/oh_B__fUxn__$?69/4=6__Zl8ocPoUFw*u?pC4s;oMo_oqo#FEoB btɒa2aAcialO.arhnEAoCcbOAASPƑc[Bcw8t vb_G PUY1 %!3Em9an_?͟+F(Oaiw%r" e4OFOa kr4tO__B(U$ Zl_S=_ߧi`xW,cv^$OϺglG )B"i`tߖ4pXV&_ @ vέJXTbr".@@=~ACFy9FBJðsKkrnAfG@Cz.vATzAtbqllCnA$cBD -fBBtIF鰥LSSqPڡs@RqmzAe$#87@&s~: -p?71//("R`ց܃TՠIҡ %/$),/>#@%=r7V/4DFOS"O4Gs=LVb2a>2&G   g"4FX88 F(t~7@(REu ey zvBPWF P QFN|`S>> BvRoR$~FXp !4Fx)r2'<1J=\d5D8P25`TGOΊ$ B="Ĺ}K&Y zK". P?DU*"DVϑ%>!(7) 7!././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/misc/create_chunker-params.txt0000644000076500000240000001046714641074756021125 0ustar00twstaffAbout borg create --chunker-params ================================== --chunker-params CHUNK_MIN_EXP,CHUNK_MAX_EXP,HASH_MASK_BITS,HASH_WINDOW_SIZE CHUNK_MIN_EXP and CHUNK_MAX_EXP give the exponent N of the 2^N minimum and maximum chunk size. Required: CHUNK_MIN_EXP < CHUNK_MAX_EXP. Defaults: 19 (2^19 == 512KiB) minimum, 23 (2^23 == 8MiB) maximum. Currently it is not supported to give more than 23 as maximum. HASH_MASK_BITS is the number of least-significant bits of the rolling hash that need to be zero to trigger a chunk cut. Recommended: CHUNK_MIN_EXP + X <= HASH_MASK_BITS <= CHUNK_MAX_EXP - X, X >= 2 (this allows the rolling hash some freedom to make its cut at a place determined by the windows contents rather than the min/max. chunk size). Default: 21 (statistically, chunks will be about 2^21 == 2MiB in size) HASH_WINDOW_SIZE: the size of the window used for the rolling hash computation. Default: 4095B Trying it out ============= I backed up a VM directory to demonstrate how different chunker parameters influence repo size, index size / chunk count, compression, deduplication. repo-sm: ~64kiB chunks (16 bits chunk mask), min chunk size 1kiB (2^10B) (these are attic / borg 0.23 internal defaults) repo-lg: ~1MiB chunks (20 bits chunk mask), min chunk size 64kiB (2^16B) repo-xl: 8MiB chunks (2^23B max chunk size), min chunk size 64kiB (2^16B). The chunk mask bits was set to 31, so it (almost) never triggers. This degrades the rolling hash based dedup to a fixed-offset dedup as the cutting point is now (almost) always the end of the buffer (at 2^23B == 8MiB). The repo index size is an indicator for the RAM needs of Borg. In this special case, the total RAM needs are about 2.1x the repo index size. You see index size of repo-sm is 16x larger than of repo-lg, which corresponds to the ratio of the different target chunk sizes. Note: RAM needs were not a problem in this specific case (37GB data size). But just imagine, you have 37TB of such data and much less than 42GB RAM, then you'ld definitely want the "lg" chunker params so you only need 2.6GB RAM. Or even bigger chunks than shown for "lg" (see "xl"). You also see compression works better for larger chunks, as expected. Duplication works worse for larger chunks, also as expected. small chunks ============ $ borg info /extra/repo-sm::1 Command line: /home/tw/w/borg-env/bin/borg create --chunker-params 10,23,16,4095 /extra/repo-sm::1 /home/tw/win Number of files: 3 Original size Compressed size Deduplicated size This archive: 37.12 GB 14.81 GB 12.18 GB All archives: 37.12 GB 14.81 GB 12.18 GB Unique chunks Total chunks Chunk index: 378374 487316 $ ls -l /extra/repo-sm/index* -rw-rw-r-- 1 tw tw 20971538 Jun 20 23:39 index.2308 $ du -sk /extra/repo-sm 11930840 /extra/repo-sm large chunks ============ $ borg info /extra/repo-lg::1 Command line: /home/tw/w/borg-env/bin/borg create --chunker-params 16,23,20,4095 /extra/repo-lg::1 /home/tw/win Number of files: 3 Original size Compressed size Deduplicated size This archive: 37.10 GB 14.60 GB 13.38 GB All archives: 37.10 GB 14.60 GB 13.38 GB Unique chunks Total chunks Chunk index: 25889 29349 $ ls -l /extra/repo-lg/index* -rw-rw-r-- 1 tw tw 1310738 Jun 20 23:10 index.2264 $ du -sk /extra/repo-lg 13073928 /extra/repo-lg xl chunks ========= (borg-env)tw@tux:~/w/borg$ borg info /extra/repo-xl::1 Command line: /home/tw/w/borg-env/bin/borg create --chunker-params 16,23,31,4095 /extra/repo-xl::1 /home/tw/win Number of files: 3 Original size Compressed size Deduplicated size This archive: 37.10 GB 14.59 GB 14.59 GB All archives: 37.10 GB 14.59 GB 14.59 GB Unique chunks Total chunks Chunk index: 4319 4434 $ ls -l /extra/repo-xl/index* -rw-rw-r-- 1 tw tw 327698 Jun 21 00:52 index.2011 $ du -sk /extra/repo-xl/ 14253464 /extra/repo-xl/ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/misc/internals-picture.txt0000644000076500000240000000344114641074756020324 0ustar00twstaffBorgBackup from 10.000m ======================= +--------+ +--------+ +--------+ |archive0| |archive1| ... |archiveN| +--------+ +--------+ +--+-----+ | | | | | | | +---+ | | | | | | | +------+-------+ | | | | | /chunk\/chunk\/chunk\... /maybe different chunks lists\ +-----------------------------------------------------------------+ |item list | +-----------------------------------------------------------------+ | +-------------------------------------+--------------+ | | | | | | +-------------+ +-------------+ | |item0 | |item1 | | | - owner | | - owner | | | - size | | - size | ... | - ... | | - ... | | - chunks | | - chunks | +----+--------+ +-----+-------+ | | | +-----+----------------------------+-----------------+ | | | | +-o-----o------------+ | | | | | | /chunk0\/chunk1\ ... /chunkN\ /chunk0\/chunk1\ ... /chunkN'\ +-----------------------------+ +------------------------------+ |file0 | |file0' | +-----------------------------+ +------------------------------+ Thanks to anarcat for drawing the picture! ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/misc/logging.conf0000644000076500000240000000046114641074756016407 0ustar00twstaff[loggers] keys=root [handlers] keys=logfile [formatters] keys=logfile [logger_root] level=NOTSET handlers=logfile [handler_logfile] class=FileHandler level=INFO formatter=logfile args=('borg.log', 'w') [formatter_logfile] format=%(asctime)s %(levelname)s %(message)s datefmt= class=logging.Formatter ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/misc/prune-example.txt0000644000076500000240000001021314641074756017431 0ustar00twstaffborg prune visualized ===================== Assume it is 2016-01-01, today's backup has not yet been made, you have created at least one backup on each day in 2015 except on 2015-12-19 (no backup made on that day), and you started backing up with borg on 2015-01-01. This is what borg prune --keep-daily 14 --keep-monthly 6 --keep-yearly 1 would keep. Backups kept by the --keep-daily rule are marked by a "d" to the right, backups kept by the --keep-monthly rule are marked by a "m" to the right, and backups kept by the --keep-yearly rule are marked by a "y" to the right. Calendar view ------------- 2015 January February March Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su 1y 2 3 4 1 1 5 6 7 8 9 10 11 2 3 4 5 6 7 8 2 3 4 5 6 7 8 12 13 14 15 16 17 18 9 10 11 12 13 14 15 9 10 11 12 13 14 15 19 20 21 22 23 24 25 16 17 18 19 20 21 22 16 17 18 19 20 21 22 26 27 28 29 30 31 23 24 25 26 27 28 23 24 25 26 27 28 29 30 31 April May June Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su 1 2 3 4 5 1 2 3 1 2 3 4 5 6 7 6 7 8 9 10 11 12 4 5 6 7 8 9 10 8 9 10 11 12 13 14 13 14 15 16 17 18 19 11 12 13 14 15 16 17 15 16 17 18 19 20 21 20 21 22 23 24 25 26 18 19 20 21 22 23 24 22 23 24 25 26 27 28 27 28 29 30 25 26 27 28 29 30 31 29 30m July August September Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su 1 2 3 4 5 1 2 1 2 3 4 5 6 6 7 8 9 10 11 12 3 4 5 6 7 8 9 7 8 9 10 11 12 13 13 14 15 16 17 18 19 10 11 12 13 14 15 16 14 15 16 17 18 19 20 20 21 22 23 24 25 26 17 18 19 20 21 22 23 21 22 23 24 25 26 27 27 28 29 30 31m 24 25 26 27 28 29 30 28 29 30m 31m October November December Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su 1 2 3 4 1 1 2 3 4 5 6 5 6 7 8 9 10 11 2 3 4 5 6 7 8 7 8 9 10 11 12 13 12 13 14 15 16 17 18 9 10 11 12 13 14 15 14 15 16 17d18d19 20d 19 20 21 22 23 24 25 16 17 18 19 20 21 22 21d22d23d24d25d26d27d 26 27 28 29 30 31m 23 24 25 26 27 28 29 28d29d30d31d 30m List view --------- --keep-daily 14 --keep-monthly 6 --keep-yearly 1 ---------------------------------------------------------------- 1. 2015-12-31 (2015-12-31 kept (2015-12-31 kept 2. 2015-12-30 by daily rule) by daily rule) 3. 2015-12-29 1. 2015-11-30 1. 2015-01-01 (oldest) 4. 2015-12-28 2. 2015-10-31 5. 2015-12-27 3. 2015-09-30 6. 2015-12-26 4. 2015-08-31 7. 2015-12-25 5. 2015-07-31 8. 2015-12-24 6. 2015-06-30 9. 2015-12-23 10. 2015-12-22 11. 2015-12-21 12. 2015-12-20 (no backup made on 2015-12-19) 13. 2015-12-18 14. 2015-12-17 Notes ----- 2015-12-31 is kept due to the --keep-daily 14 rule (because it is applied first), not due to the --keep-monthly or --keep-yearly rule. The --keep-yearly 1 rule does not consider the December 31st backup because it has already been kept due to the daily rule. There are no backups available from previous years, so the --keep-yearly target of 1 backup is not satisfied. Because of this, the 2015-01-01 archive (the oldest archive available) is kept. The --keep-monthly 6 rule keeps Nov, Oct, Sep, Aug, Jul and Jun. December is not considered for this rule, because that backup was already kept because of the daily rule. 2015-12-17 is kept to satisfy the --keep-daily 14 rule - because no backup was made on 2015-12-19. If a backup had been made on that day, it would not keep the one from 2015-12-17. We did not include weekly, hourly, minutely or secondly rules to keep this example simple. They all work in basically the same way. The weekly rule is easy to understand roughly, but hard to understand in all details. If interested, read "ISO 8601:2000 standard week-based year". ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/quickstart.rst0000644000076500000240000005312514641074756016110 0ustar00twstaff.. include:: global.rst.inc .. highlight:: bash .. _quickstart: Quick Start =========== This chapter will get you started with Borg and covers various use cases. A step by step example ---------------------- .. include:: quickstart_example.rst.inc Archives and repositories ------------------------- A *Borg archive* is the result of a single backup (``borg create``). An archive stores a snapshot of the data of the files "inside" it. One can later extract or mount an archive to restore from a backup. *Repositories* are filesystem directories acting as self-contained stores of archives. Repositories can be accessed locally via path or remotely via ssh. Under the hood, repositories contain data blocks and a manifest tracking which blocks are in each archive. If some data hasn't changed from one backup to another, Borg can simply reference an already uploaded data chunk (deduplication). .. _about_free_space: Important note about free space ------------------------------- Before you start creating backups, please make sure that there is *always* a good amount of free space on the filesystem that has your backup repository (and also on ~/.cache). A few GB should suffice for most hard-drive sized repositories. See also :ref:`cache-memory-usage`. Borg doesn't use space reserved for root on repository disks (even when run as root), on file systems which do not support this mechanism (e.g. XFS) we recommend to reserve some space in Borg itself just to be safe by adjusting the ``additional_free_space`` setting (a good starting point is ``2G``):: borg config /path/to/repo additional_free_space 2G If Borg runs out of disk space, it tries to free as much space as it can while aborting the current operation safely, which allows the user to free more space by deleting/pruning archives. This mechanism is not bullet-proof in some circumstances [1]_. If you *really* run out of disk space, it can be hard or impossible to free space, because Borg needs free space to operate - even to delete backup archives. You can use some monitoring process or just include the free space information in your backup log files (you check them regularly anyway, right?). Also helpful: - create a big file as a "space reserve", that you can delete to free space - if you use LVM: use a LV + a filesystem that you can resize later and have some unallocated PEs you can add to the LV. - consider using quotas - use `prune` and `compact` regularly .. [1] This failsafe can fail in these circumstances: - The underlying file system doesn't support statvfs(2), or returns incorrect data, or the repository doesn't reside on a single file system - Other tasks fill the disk simultaneously - Hard quotas (which may not be reflected in statvfs(2)) Important note about permissions -------------------------------- To avoid permissions issues (in your borg repository or borg cache), **always access the repository using the same user account**. If you want to backup files of other users or the operating system, running borg as root likely will be required (otherwise you'ld get `Permission denied` errors). If you only back up your own files, you neither need nor want to run borg as root, just run it as your normal user. For a local repository just always use the same user to invoke borg. For a remote repository: always use e.g. borg@remote_host. You can use this from different local users, the remote user running borg and accessing the repo will always be `borg`. If you need to access a local repository from different users, you can use the same method by using ssh to borg@localhost. Important note about files changing during the backup process ------------------------------------------------------------- Borg does not do anything about the internal consistency of the data it backs up. It just reads and backs up each file in whatever state that file is when Borg gets to it. On an active system, this can lead to two kinds of inconsistency: - By the time Borg backs up a file, it might have changed since the backup process was initiated - A file could change while Borg is backing it up, making the file internally inconsistent If you have a set of files and want to ensure that they are backed up in a specific or consistent state, you must take steps to prevent changes to those files during the backup process. There are a few common techniques to achieve this. - Avoid running any programs that might change the files. - Snapshot files, filesystems, container storage volumes, or logical volumes. LVM or ZFS might be useful here. - Dump databases or stop the database servers. - Shut down virtual machines before backing up their images. - Shut down containers before backing up their storage volumes. For some systems Borg might work well enough without these precautions. If you are simply backing up the files on a system that isn't very active (e.g. in a typical home directory), Borg usually works well enough without further care for consistency. Log files and caches might not be in a perfect state, but this is rarely a problem. For databases, virtual machines, and containers, there are specific techniques for backing them up that do not simply use Borg to backup the underlying filesystem. For databases, check your database documentation for techniques that will save the database state between transactions. For virtual machines, consider running the backup on the VM itself or mounting the filesystem while the VM is shut down. For Docker containers, perhaps docker's "save" command can help. Automating backups ------------------ The following example script is meant to be run daily by the ``root`` user on different local machines. It backs up a machine's important files (but not the complete operating system) to a repository ``~/backup/main`` on a remote server. Some files which aren't necessarily needed in this backup are excluded. See :ref:`borg_patterns` on how to add more exclude options. After the backup this script also uses the :ref:`borg_prune` subcommand to keep only a certain number of old archives and deletes the others. Finally, it uses the :ref:`borg_compact` subcommand to remove deleted objects from the segment files in the repository to preserve disk space. Before running, make sure that the repository is initialized as documented in :ref:`remote_repos` and that the script has the correct permissions to be executable by the root user, but not executable or readable by anyone else, i.e. root:root 0700. You can use this script as a starting point and modify it where it's necessary to fit your setup. Do not forget to test your created backups to make sure everything you need is being backed up and that the ``prune`` command is keeping and deleting the correct backups. :: #!/bin/sh # Setting this, so the repo does not need to be given on the commandline: export BORG_REPO=ssh://username@example.com:2022/~/backup/main # See the section "Passphrase notes" for more infos. export BORG_PASSPHRASE='XYZl0ngandsecurepa_55_phrasea&&123' # some helpers and error handling: info() { printf "\n%s %s\n\n" "$( date )" "$*" >&2; } trap 'echo $( date ) Backup interrupted >&2; exit 2' INT TERM info "Starting backup" # Backup the most important directories into an archive named after # the machine this script is currently running on: borg create \ --verbose \ --filter AME \ --list \ --stats \ --show-rc \ --compression lz4 \ --exclude-caches \ --exclude 'home/*/.cache/*' \ --exclude 'var/tmp/*' \ \ ::'{hostname}-{now}' \ /etc \ /home \ /root \ /var backup_exit=$? info "Pruning repository" # Use the `prune` subcommand to maintain 7 daily, 4 weekly and 6 monthly # archives of THIS machine. The '{hostname}-*' matching is very important to # limit prune's operation to this machine's archives and not apply to # other machines' archives also: borg prune \ --list \ --glob-archives '{hostname}-*' \ --show-rc \ --keep-daily 7 \ --keep-weekly 4 \ --keep-monthly 6 prune_exit=$? # actually free repo disk space by compacting segments info "Compacting repository" borg compact compact_exit=$? # use highest exit code as global exit code global_exit=$(( backup_exit > prune_exit ? backup_exit : prune_exit )) global_exit=$(( compact_exit > global_exit ? compact_exit : global_exit )) if [ ${global_exit} -eq 0 ]; then info "Backup, Prune, and Compact finished successfully" elif [ ${global_exit} -eq 1 ]; then info "Backup, Prune, and/or Compact finished with warnings" else info "Backup, Prune, and/or Compact finished with errors" fi exit ${global_exit} Pitfalls with shell variables and environment variables ------------------------------------------------------- This applies to all environment variables you want Borg to see, not just ``BORG_PASSPHRASE``. The short explanation is: always ``export`` your variable, and use single quotes if you're unsure of the details of your shell's expansion behavior. E.g.:: export BORG_PASSPHRASE='complicated & long' This is because ``export`` exposes variables to subprocesses, which Borg may be one of. More on ``export`` can be found in the "ENVIRONMENT" section of the bash(1) man page. Beware of how ``sudo`` interacts with environment variables. For example, you may be surprised that the following ``export`` has no effect on your command:: export BORG_PASSPHRASE='complicated & long' sudo ./yourborgwrapper.sh # still prompts for password For more information, refer to the sudo(8) man page and ``env_keep`` in the sudoers(5) man page. .. Tip:: To debug what your borg process is actually seeing, find its PID (``ps aux|grep borg``) and then look into ``/proc//environ``. .. passphrase_notes: Passphrase notes ---------------- If you use encryption (or authentication), Borg will interactively ask you for a passphrase to encrypt/decrypt the keyfile / repokey. A passphrase should be a single line of text, a trailing linefeed will be stripped. For your own safety, you maybe want to avoid empty passphrases as well extremely long passphrase (much more than 256 bits of entropy). Also avoid passphrases containing non-ASCII characters. Borg is technically able to process all unicode text, but you might get into trouble reproducing the same encoded utf-8 bytes or with keyboard layouts, so better just avoid non-ASCII stuff. If you want to automate, you can alternatively supply the passphrase directly or indirectly using some environment variables. You can directly give a passphrase:: # use this passphrase (use safe permissions on the script!): export BORG_PASSPHRASE='my super secret passphrase' Or ask an external program to supply the passphrase:: # use the "pass" password manager to get the passphrase: export BORG_PASSCOMMAND='pass show backup' # use GPG to get the passphrase contained in a gpg-encrypted file: export BORG_PASSCOMMAND='gpg --decrypt borg-passphrase.gpg' Or read the passphrase from an open file descriptor:: export BORG_PASSPHRASE_FD=42 Using hardware crypto devices (like Nitrokey, Yubikey and others) is not directly supported by borg, but you can use these indirectly. E.g. if your crypto device supports GPG and borg calls ``gpg`` via ``BORG_PASSCOMMAND``, it should just work. .. backup_compression: Backup compression ------------------ The default is lz4 (very fast, but low compression ratio), but other methods are supported for different situations. You can use zstd for a wide range from high speed (and relatively low compression) using N=1 to high compression (and lower speed) using N=22. zstd is a modern compression algorithm and might be preferable over zlib and lzma, except if you need compatibility to older borg versions (< 1.1.4) that did not yet offer zstd.:: $ borg create --compression zstd,N /path/to/repo::arch ~ Other options are: If you have a fast repo storage and you want minimum CPU usage, no compression:: $ borg create --compression none /path/to/repo::arch ~ If you have a less fast repo storage and you want a bit more compression (N=0..9, 0 means no compression, 9 means high compression): :: $ borg create --compression zlib,N /path/to/repo::arch ~ If you have a very slow repo storage and you want high compression (N=0..9, 0 means low compression, 9 means high compression): :: $ borg create --compression lzma,N /path/to/repo::arch ~ You'll need to experiment a bit to find the best compression for your use case. Keep an eye on CPU load and throughput. .. _encrypted_repos: Repository encryption --------------------- You can choose the repository encryption mode at repository creation time:: $ borg init --encryption=MODE PATH For a list of available encryption MODEs and their descriptions, please refer to :ref:`borg_init`. If you use encryption, all data is encrypted on the client before being written to the repository. This means that an attacker who manages to compromise the host containing an encrypted repository will not be able to access any of the data, even while the backup is being made. Key material is stored in encrypted form and can be only decrypted by providing the correct passphrase. For automated backups the passphrase can be specified using the `BORG_PASSPHRASE` environment variable. .. note:: Be careful about how you set that environment, see :ref:`this note about password environments ` for more information. .. warning:: The repository data is totally inaccessible without the key and the key passphrase. Make a backup copy of the key file (``keyfile`` mode) or repo config file (``repokey`` mode) and keep it at a safe place, so you still have the key in case it gets corrupted or lost. Also keep your passphrase at a safe place. You can make backups using :ref:`borg_key_export` subcommand. If you want to print a backup of your key to paper use the ``--paper`` option of this command and print the result, or print this `template`_ if you need a version with QR-Code. A backup inside of the backup that is encrypted with that key/passphrase won't help you with that, of course. In case you lose your repository and the security information, but have an older copy of it to restore from, don't use that later for creating new backups – you would run into security issues (reuse of nonce counter values). It is better to initialize a new Borg repository. See also: :ref:`faq_corrupt_repo` .. _template: paperkey.html .. _remote_repos: Remote repositories ------------------- Borg can initialize and access repositories on remote hosts if the host is accessible using SSH. This is fastest and easiest when Borg is installed on the remote host, in which case the following syntax is used:: $ borg init user@hostname:/path/to/repo Note: please see the usage chapter for a full documentation of repo URLs. Remote operations over SSH can be automated with SSH keys. You can restrict the use of the SSH keypair by prepending a forced command to the SSH public key in the remote server's `authorized_keys` file. This example will start Borg in server mode and limit it to a specific filesystem path:: command="borg serve --restrict-to-path /path/to/repo",restrict ssh-rsa AAAAB3[...] If it is not possible to install Borg on the remote host, it is still possible to use the remote host to store a repository by mounting the remote filesystem, for example, using sshfs:: $ sshfs user@hostname:/path/to /path/to $ borg init /path/to/repo $ fusermount -u /path/to You can also use other remote filesystems in a similar way. Just be careful, not all filesystems out there are really stable and working good enough to be acceptable for backup usage. Restoring a backup ------------------ Please note that we are only describing the most basic commands and options here - please refer to the command reference to see more. For restoring, you usually want to work **on the same machine as the same user** that was also used to create the backups of the wanted files. Doing it like that avoids quite some issues: - no confusion relating to paths - same mapping of user/group names to user/group IDs - no permission issues - you likely already have a working borg setup there, - maybe including a environment variable for the key passphrase (for encrypted repos), - maybe including a keyfile for the repo (not needed for repokey mode), - maybe including a ssh key for the repo server (not needed for locally mounted repos), - maybe including a valid borg cache for that repo (quicker than cache rebuild). The **user** might be: - root (if full backups, backups including system stuff or multiple users' files were made) - some specific user using sudo to execute borg as root - some specific user (if backups of that user's files were made) A borg **backup repository** can be either: - in a local directory (like e.g. a locally mounted USB disk) - on a remote backup server machine that is reachable via ssh (client/server) If the repository is encrypted, you will also need the **key** and the **passphrase** (which is protecting the key). The **key** can be located: - in the repository (**repokey** mode). Easy, this will usually "just work". - in the home directory of the user who did the backup (**keyfile** mode). This may cause a bit more effort: - if you have just lost that home directory and you first need to restore the borg key (e.g. from the separate backup you have made of it or from another user or machine accessing the same repository). - if you first must find out the correct machine / user / home directory (where the borg client was run to make the backups). The **passphrase** for the key has been either: - entered interactively at backup time (not practical if backup is automated / unattended). - acquired via some environment variable driven mechanism in the backup script (look there for BORG_PASSPHRASE, BORG_PASSCOMMAND, etc. and just do it like that). There are **2 ways to restore** files from a borg backup repository: - **borg mount** - use this if: - you don't precisely know what files you want to restore - you don't know which archive contains the files (in the state) you want - you need to look into files / directories before deciding what you want - you need a relatively low volume of data restored - you don't care for restoring stuff that the FUSE mount is not implementing yet (like special fs flags, ACLs) - you have a client with good resources (RAM, CPU, temp. disk space) - you want to rather use some filemanager to restore (copy) files than borg extract shell commands - **borg extract** - use this if: - you precisely know what you want (repo, archive, path) - you need a high volume of files restored (best speed) - you want a as-complete-as-it-gets reproduction of file metadata (like special fs flags, ACLs) - you have a client with low resources (RAM, CPU, temp. disk space) Example with **borg mount**: :: # open a new, separate terminal (this terminal will be blocked until umount) # now we find out the archive names we have in the repo: borg list /mnt/backup/borg_repo # mount one archive from a borg repo: borg mount /mnt/backup/borg_repo::myserver-system-2019-08-11 /mnt/borg # alternatively, mount all archives from a borg repo (slower): borg mount /mnt/backup/borg_repo /mnt/borg # it may take a while until you will see stuff in /mnt/borg. # now use another terminal or file browser and look into /mnt/borg. # when finished, umount to unlock the repo and unblock the terminal: borg umount /mnt/borg Example with **borg extract**: :: # borg extract always extracts into current directory and that directory # should be empty (borg does not support transforming a non-empty dir to # the state as present in your backup archive). mkdir borg_restore cd borg_restore # now we find out the archive names we have in the repo: borg list /mnt/backup/borg_repo # we could find out the archive contents, esp. the path layout: borg list /mnt/backup/borg_repo::myserver-system-2019-08-11 # we extract only some specific path (note: no leading / !): borg extract /mnt/backup/borg_repo::myserver-system-2019-08-11 path/to/extract # alternatively, we could fully extract the archive: borg extract /mnt/backup/borg_repo::myserver-system-2019-08-11 # now move the files to the correct place... Difference when using a **remote borg backup server**: It is basically all the same as with the local repository, but you need to refer to the repo using a ``ssh://`` URL. In the given example, ``borg`` is the user name used to log into the machine ``backup.example.org`` which runs ssh on port ``2222`` and has the borg repo in ``/path/to/repo``. Instead of giving a FQDN or a hostname, you can also give an IP address. As usual, you either need a password to log in or the backup server might have authentication set up via ssh ``authorized_keys`` (which is likely the case if unattended, automated backups were done). :: borg mount ssh://borg@backup.example.org:2222/path/to/repo /mnt/borg # or borg extract ssh://borg@backup.example.org:2222/path/to/repo ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/quickstart_example.rst.inc0000644000076500000240000000525214641074756020371 0ustar00twstaff1. Before a backup can be made a repository has to be initialized:: $ borg init --encryption=repokey /path/to/repo 2. Backup the ``~/src`` and ``~/Documents`` directories into an archive called *Monday*:: $ borg create /path/to/repo::Monday ~/src ~/Documents 3. The next day create a new archive called *Tuesday*:: $ borg create --stats /path/to/repo::Tuesday ~/src ~/Documents This backup will be a lot quicker and a lot smaller since only new never before seen data is stored. The ``--stats`` option causes Borg to output statistics about the newly created archive such as the amount of unique data (not shared with other archives):: ------------------------------------------------------------------------------ Archive name: Tuesday Archive fingerprint: bd31004d58f51ea06ff735d2e5ac49376901b21d58035f8fb05dbf866566e3c2 Time (start): Tue, 2016-02-16 18:15:11 Time (end): Tue, 2016-02-16 18:15:11 Duration: 0.19 seconds Number of files: 127 ------------------------------------------------------------------------------ Original size Compressed size Deduplicated size This archive: 4.16 MB 4.17 MB 26.78 kB All archives: 8.33 MB 8.34 MB 4.19 MB Unique chunks Total chunks Chunk index: 132 261 ------------------------------------------------------------------------------ 4. List all archives in the repository:: $ borg list /path/to/repo Monday Mon, 2016-02-15 19:14:44 Tuesday Tue, 2016-02-16 19:15:11 5. List the contents of the *Monday* archive:: $ borg list /path/to/repo::Monday drwxr-xr-x user group 0 Mon, 2016-02-15 18:22:30 home/user/Documents -rw-r--r-- user group 7961 Mon, 2016-02-15 18:22:30 home/user/Documents/Important.doc ... 6. Restore the *Monday* archive by extracting the files relative to the current directory:: $ borg extract /path/to/repo::Monday 7. Delete the *Monday* archive (please note that this does **not** free repo disk space):: $ borg delete /path/to/repo::Monday 8. Recover disk space by compacting the segment files in the repo:: $ borg compact /path/to/repo .. Note:: Borg is quiet by default (it works on WARNING log level). You can use options like ``--progress`` or ``--list`` to get specific reports during command execution. You can also add the ``-v`` (or ``--verbose`` or ``--info``) option to adjust the log level to INFO to get other informational messages. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/support.rst0000644000076500000240000000400714641074756015425 0ustar00twstaff.. _support: Support ======= Support and Services -------------------- Please see https://www.borgbackup.org/ for free and paid support and service options. .. _security-contact: Security -------- In case you discover a security issue, please use this contact for reporting it privately and please, if possible, use encrypted E-Mail: Thomas Waldmann GPG Key Fingerprint: 6D5B EF9A DD20 7580 5747 B70F 9F88 FB52 FAF7 B393 The public key can be fetched from any GPG keyserver, but be careful: you must use the **full fingerprint** to check that you got the correct key. Verifying signed releases ------------------------- `Releases `_ are signed with the same GPG key and a .asc file is provided for each binary. To verify a signature, the public key needs to be known to GPG. It can be imported into the local keystore from a keyserver with the fingerprint:: gpg --recv-keys "6D5B EF9A DD20 7580 5747 B70F 9F88 FB52 FAF7 B393" If GPG successfully imported the key, the output should include (among other things):: ... gpg: Total number processed: 1 ... To verify for example the signature of the borg-linux64 binary:: gpg --verify borg-linux64.asc GPG outputs if it finds a good signature. The output should look similar to this:: gpg: Signature made Sat 30 Dec 2017 01:07:36 PM CET using RSA key ID 51F78E01 gpg: Good signature from "Thomas Waldmann " gpg: aka "Thomas Waldmann " gpg: aka "Thomas Waldmann " gpg: aka "Thomas Waldmann " gpg: WARNING: This key is not certified with a trusted signature! gpg: There is no indication that the signature belongs to the owner. Primary key fingerprint: 6D5B EF9A DD20 7580 5747 B70F 9F88 FB52 FAF7 B393 Subkey fingerprint: 2F81 AFFB AB04 E11F E8EE 65D4 243A CFA9 51F7 8E01 If you want to make absolutely sure that you have the right key, you need to verify it via another channel and assign a trust-level to it. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719958149.7930987 borgbackup-1.4.0/docs/usage/0000755000076500000240000000000014641075206014251 5ustar00twstaff././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/benchmark.rst0000644000076500000240000000004414641074756016744 0ustar00twstaff.. include:: benchmark_crud.rst.inc ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/benchmark_crud.rst.inc0000644000076500000240000001021114641074756020526 0ustar00twstaff.. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit! .. _borg_benchmark_crud: borg benchmark crud ------------------- .. code-block:: none borg [common options] benchmark crud [options] REPOSITORY PATH .. only:: html .. class:: borg-options-table +-------------------------------------------------------+----------------+----------------------------------------------+ | **positional arguments** | +-------------------------------------------------------+----------------+----------------------------------------------+ | | ``REPOSITORY`` | repository to use for benchmark (must exist) | +-------------------------------------------------------+----------------+----------------------------------------------+ | | ``PATH`` | path were to create benchmark input data | +-------------------------------------------------------+----------------+----------------------------------------------+ | .. class:: borg-common-opt-ref | | | | :ref:`common_options` | +-------------------------------------------------------+----------------+----------------------------------------------+ .. raw:: html .. only:: latex REPOSITORY repository to use for benchmark (must exist) PATH path were to create benchmark input data :ref:`common_options` | Description ~~~~~~~~~~~ This command benchmarks borg CRUD (create, read, update, delete) operations. It creates input data below the given PATH and backups this data into the given REPO. The REPO must already exist (it could be a fresh empty repo or an existing repo, the command will create / read / update / delete some archives named borg-benchmark-crud\* there. Make sure you have free space there, you'll need about 1GB each (+ overhead). If your repository is encrypted and borg needs a passphrase to unlock the key, use:: BORG_PASSPHRASE=mysecret borg benchmark crud REPO PATH Measurements are done with different input file sizes and counts. The file contents are very artificial (either all zero or all random), thus the measurement results do not necessarily reflect performance with real data. Also, due to the kind of content used, no compression is used in these benchmarks. C- == borg create (1st archive creation, no compression, do not use files cache) C-Z- == all-zero files. full dedup, this is primarily measuring reader/chunker/hasher. C-R- == random files. no dedup, measuring throughput through all processing stages. R- == borg extract (extract archive, dry-run, do everything, but do not write files to disk) R-Z- == all zero files. Measuring heavily duplicated files. R-R- == random files. No duplication here, measuring throughput through all processing stages, except writing to disk. U- == borg create (2nd archive creation of unchanged input files, measure files cache speed) The throughput value is kind of virtual here, it does not actually read the file. U-Z- == needs to check the 2 all-zero chunks' existence in the repo. U-R- == needs to check existence of a lot of different chunks in the repo. D- == borg delete archive (delete last remaining archive, measure deletion + compaction) D-Z- == few chunks to delete / few segments to compact/remove. D-R- == many chunks to delete / many segments to compact/remove. Please note that there might be quite some variance in these measurements. Try multiple measurements and having a otherwise idle machine (and network, if you use it).././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/borgfs.rst0000644000076500000240000000004614641074756016276 0ustar00twstaff:orphan: .. include:: borgfs.rst.inc ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/borgfs.rst.inc0000644000076500000240000003737514641074756017065 0ustar00twstaff.. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit! .. _borg_borgfs: borg borgfs ----------- .. code-block:: none borg [common options] borgfs [options] REPOSITORY_OR_ARCHIVE MOUNTPOINT [PATH...] .. only:: html .. class:: borg-options-table +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ | **positional arguments** | +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``REPOSITORY_OR_ARCHIVE`` | repository/archive to mount | +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``MOUNTPOINT`` | where to mount filesystem | +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``PATH`` | paths to extract; patterns are supported | +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ | **optional arguments** | +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``-V``, ``--version`` | show version number and exit | +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``-f``, ``--foreground`` | stay in foreground, do not daemonize | +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``-o`` | Extra mount options | +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ | .. class:: borg-common-opt-ref | | | | :ref:`common_options` | +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ | **Archive filters** — Archive filters can be applied to repository targets. | +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``-P PREFIX``, ``--prefix PREFIX`` | only consider archive names starting with this prefix. | +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``-a GLOB``, ``--glob-archives GLOB`` | only consider archive names matching the glob. sh: rules apply, see "borg help patterns". ``--prefix`` and ``--glob-archives`` are mutually exclusive. | +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--sort-by KEYS`` | Comma-separated list of sorting keys; valid keys are: timestamp, name, id; default is: timestamp | +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--first N`` | consider first N archives after other filters were applied | +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--last N`` | consider last N archives after other filters were applied | +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ | **Exclusion options** | +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``-e PATTERN``, ``--exclude PATTERN`` | exclude paths matching PATTERN | +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--exclude-from EXCLUDEFILE`` | read exclude patterns from EXCLUDEFILE, one per line | +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--pattern PATTERN`` | experimental: include/exclude paths matching PATTERN | +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--patterns-from PATTERNFILE`` | experimental: read include/exclude patterns from PATTERNFILE, one per line | +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--strip-components NUMBER`` | Remove the specified number of leading path elements. Paths with fewer elements will be silently skipped. | +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ .. raw:: html .. only:: latex REPOSITORY_OR_ARCHIVE repository/archive to mount MOUNTPOINT where to mount filesystem PATH paths to extract; patterns are supported optional arguments -V, --version show version number and exit -f, --foreground stay in foreground, do not daemonize -o Extra mount options :ref:`common_options` | Archive filters -P PREFIX, --prefix PREFIX only consider archive names starting with this prefix. -a GLOB, --glob-archives GLOB only consider archive names matching the glob. sh: rules apply, see "borg help patterns". ``--prefix`` and ``--glob-archives`` are mutually exclusive. --sort-by KEYS Comma-separated list of sorting keys; valid keys are: timestamp, name, id; default is: timestamp --first N consider first N archives after other filters were applied --last N consider last N archives after other filters were applied Exclusion options -e PATTERN, --exclude PATTERN exclude paths matching PATTERN --exclude-from EXCLUDEFILE read exclude patterns from EXCLUDEFILE, one per line --pattern PATTERN experimental: include/exclude paths matching PATTERN --patterns-from PATTERNFILE experimental: read include/exclude patterns from PATTERNFILE, one per line --strip-components NUMBER Remove the specified number of leading path elements. Paths with fewer elements will be silently skipped. Description ~~~~~~~~~~~ This command mounts an archive as a FUSE filesystem. This can be useful for browsing an archive or restoring individual files. Unless the ``--foreground`` option is given the command will run in the background until the filesystem is ``umounted``. The command ``borgfs`` provides a wrapper for ``borg mount``. This can also be used in fstab entries: ``/path/to/repo /mnt/point fuse.borgfs defaults,noauto 0 0`` To allow a regular user to use fstab entries, add the ``user`` option: ``/path/to/repo /mnt/point fuse.borgfs defaults,noauto,user 0 0`` For mount options, see the fuse(8) manual page. Additional mount options supported by borg: - versions: when used with a repository mount, this gives a merged, versioned view of the files in the archives. EXPERIMENTAL, layout may change in future. - allow_damaged_files: by default damaged files (where missing chunks were replaced with runs of zeros by borg check ``--repair``) are not readable and return EIO (I/O error). Set this option to read such files. The BORG_MOUNT_DATA_CACHE_ENTRIES environment variable is meant for advanced users to tweak the performance. It sets the number of cached data chunks; additional memory usage can be up to ~8 MiB times this number. The default is the number of CPU cores. When the daemonized process receives a signal or crashes, it does not unmount. Unmounting in these cases could cause an active rsync or similar process to unintentionally delete data. When running in the foreground ^C/SIGINT unmounts cleanly, but other signals or crashes do not.././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/break-lock.rst.inc0000644000076500000240000000350314641074756017577 0ustar00twstaff.. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit! .. _borg_break-lock: borg break-lock --------------- .. code-block:: none borg [common options] break-lock [options] [REPOSITORY] .. only:: html .. class:: borg-options-table +-------------------------------------------------------+----------------+-----------------------------------------+ | **positional arguments** | +-------------------------------------------------------+----------------+-----------------------------------------+ | | ``REPOSITORY`` | repository for which to break the locks | +-------------------------------------------------------+----------------+-----------------------------------------+ | .. class:: borg-common-opt-ref | | | | :ref:`common_options` | +-------------------------------------------------------+----------------+-----------------------------------------+ .. raw:: html .. only:: latex REPOSITORY repository for which to break the locks :ref:`common_options` | Description ~~~~~~~~~~~ This command breaks the repository and cache locks. Please use carefully and only while no borg process (on any machine) is trying to access the Cache or the Repository.././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/change-passphrase.rst.inc0000644000076500000240000000331414641074756021161 0ustar00twstaff.. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit! .. _borg_change-passphrase: borg change-passphrase ---------------------- .. code-block:: none borg [common options] change-passphrase [options] [REPOSITORY] .. only:: html .. class:: borg-options-table +-------------------------------------------------------+----------------+--+ | **positional arguments** | +-------------------------------------------------------+----------------+--+ | | ``REPOSITORY`` | | +-------------------------------------------------------+----------------+--+ | .. class:: borg-common-opt-ref | | | | :ref:`common_options` | +-------------------------------------------------------+----------------+--+ .. raw:: html .. only:: latex REPOSITORY :ref:`common_options` | Description ~~~~~~~~~~~ The key files used for repository encryption are optionally passphrase protected. This command can be used to change this passphrase. Please note that this command only changes the passphrase, but not any secret protected by it (like e.g. encryption/MAC keys or chunker seed). Thus, changing the passphrase after passphrase and borg key got compromised does not protect future (nor past) backups to the same repository.././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/check.rst0000644000076500000240000000003314641074756016065 0ustar00twstaff.. include:: check.rst.inc ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/check.rst.inc0000644000076500000240000004161714641074756016652 0ustar00twstaff.. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit! .. _borg_check: borg check ---------- .. code-block:: none borg [common options] check [options] [REPOSITORY_OR_ARCHIVE] .. only:: html .. class:: borg-options-table +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | **positional arguments** | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``REPOSITORY_OR_ARCHIVE`` | repository or archive to check consistency of | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | **optional arguments** | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``--repository-only`` | only perform repository checks | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``--archives-only`` | only perform archives checks | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``--verify-data`` | perform cryptographic archive data integrity verification (conflicts with ``--repository-only``) | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``--repair`` | attempt to repair any inconsistencies found | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``--save-space`` | work slower, but using less space | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``--max-duration SECONDS`` | do only a partial repo check for max. SECONDS seconds (Default: unlimited) | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | .. class:: borg-common-opt-ref | | | | :ref:`common_options` | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | **Archive filters** — Archive filters can be applied to repository targets. | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``-P PREFIX``, ``--prefix PREFIX`` | only consider archive names starting with this prefix. (deprecated) | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``-a GLOB``, ``--glob-archives GLOB`` | only consider archive names matching the glob. sh: rules apply (without actually using the sh: prefix), see "borg help patterns". | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``--sort-by KEYS`` | Comma-separated list of sorting keys; valid keys are: timestamp, archive, name, id; default is: timestamp | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``--first N`` | consider first N archives after other filters were applied | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``--last N`` | consider last N archives after other filters were applied | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ .. raw:: html .. only:: latex REPOSITORY_OR_ARCHIVE repository or archive to check consistency of optional arguments --repository-only only perform repository checks --archives-only only perform archives checks --verify-data perform cryptographic archive data integrity verification (conflicts with ``--repository-only``) --repair attempt to repair any inconsistencies found --save-space work slower, but using less space --max-duration SECONDS do only a partial repo check for max. SECONDS seconds (Default: unlimited) :ref:`common_options` | Archive filters -P PREFIX, --prefix PREFIX only consider archive names starting with this prefix. (deprecated) -a GLOB, --glob-archives GLOB only consider archive names matching the glob. sh: rules apply (without actually using the sh: prefix), see "borg help patterns". --sort-by KEYS Comma-separated list of sorting keys; valid keys are: timestamp, archive, name, id; default is: timestamp --first N consider first N archives after other filters were applied --last N consider last N archives after other filters were applied Description ~~~~~~~~~~~ The check command verifies the consistency of a repository and its archives. It consists of two major steps: 1. Checking the consistency of the repository itself. This includes checking the segment magic headers, and both the metadata and data of all objects in the segments. The read data is checked by size and CRC. Bit rot and other types of accidental damage can be detected this way. Running the repository check can be split into multiple partial checks using ``--max-duration``. When checking a remote repository, please note that the checks run on the server and do not cause significant network traffic. 2. Checking consistency and correctness of the archive metadata and optionally archive data (requires ``--verify-data``). This includes ensuring that the repository manifest exists, the archive metadata chunk is present, and that all chunks referencing files (items) in the archive exist. This requires reading archive and file metadata, but not data. To cryptographically verify the file (content) data integrity pass ``--verify-data``, but keep in mind that this requires reading all data and is hence very time consuming. When checking archives of a remote repository, archive checks run on the client machine because they require decrypting data and therefore the encryption key. Both steps can also be run independently. Pass ``--repository-only`` to run the repository checks only, or pass ``--archives-only`` to run the archive checks only. The ``--max-duration`` option can be used to split a long-running repository check into multiple partial checks. After the given number of seconds the check is interrupted. The next partial check will continue where the previous one stopped, until the full repository has been checked. Assuming a complete check would take 7 hours, then running a daily check with ``--max-duration=3600`` (1 hour) would result in one full repository check per week. Doing a full repository check aborts any previous partial check; the next partial check will restart from the beginning. With partial repository checks you can run neither archive checks, nor enable repair mode. Consequently, if you want to use ``--max-duration`` you must also pass ``--repository-only``, and must not pass ``--archives-only``, nor ``--repair``. **Warning:** Please note that partial repository checks (i.e. running it with ``--max-duration``) can only perform non-cryptographic checksum checks on the segment files. A full repository check (i.e. without ``--max-duration``) can also do a repository index check. Enabling partial repository checks excepts archive checks for the same reason. Therefore partial checks may be useful with very large repositories only where a full check would take too long. The ``--verify-data`` option will perform a full integrity verification (as opposed to checking the CRC32 of the segment) of data, which means reading the data from the repository, decrypting and decompressing it. It is a complete cryptographic verification and hence very time consuming, but will detect any accidental and malicious corruption. Tamper-resistance is only guaranteed for encrypted repositories against attackers without access to the keys. You can not use ``--verify-data`` with ``--repository-only``. About repair mode +++++++++++++++++ The check command is a readonly task by default. If any corruption is found, Borg will report the issue and proceed with checking. To actually repair the issues found, pass ``--repair``. .. note:: ``--repair`` is a **POTENTIALLY DANGEROUS FEATURE** and might lead to data loss! This does not just include data that was previously lost anyway, but might include more data for kinds of corruption it is not capable of dealing with. **BE VERY CAREFUL!** Pursuant to the previous warning it is also highly recommended to test the reliability of the hardware running Borg with stress testing software. This especially includes storage and memory testers. Unreliable hardware might lead to additional data loss. It is highly recommended to create a backup of your repository before running in repair mode (i.e. running it with ``--repair``). Repair mode will attempt to fix any corruptions found. Fixing corruptions does not mean recovering lost data: Borg can not magically restore data lost due to e.g. a hardware failure. Repairing a repository means sacrificing some data for the sake of the repository as a whole and the remaining data. Hence it is, by definition, a potentially lossy task. In practice, repair mode hooks into both the repository and archive checks: 1. When checking the repository's consistency, repair mode will try to recover as many objects from segments with integrity errors as possible, and ensure that the index is consistent with the data stored in the segments. 2. When checking the consistency and correctness of archives, repair mode might remove whole archives from the manifest if their archive metadata chunk is corrupt or lost. On a chunk level (i.e. the contents of files), repair mode will replace corrupt or lost chunks with a same-size replacement chunk of zeroes. If a previously zeroed chunk reappears, repair mode will restore this lost chunk using the new chunk. Lastly, repair mode will also delete orphaned chunks (e.g. caused by read errors while creating the archive). Most steps taken by repair mode have a one-time effect on the repository, like removing a lost archive from the repository. However, replacing a corrupt or lost chunk with an all-zero replacement will have an ongoing effect on the repository: When attempting to extract a file referencing an all-zero chunk, the ``extract`` command will distinctly warn about it. The FUSE filesystem created by the ``mount`` command will reject reading such a "zero-patched" file unless a special mount option is given. As mentioned earlier, Borg might be able to "heal" a "zero-patched" file in repair mode, if all its previously lost chunks reappear (e.g. via a later backup). This is achieved by Borg not only keeping track of the all-zero replacement chunks, but also by keeping metadata about the lost chunks. In repair mode Borg will check whether a previously lost chunk reappeared and will replace the all-zero replacement chunk by the reappeared chunk. If all lost chunks of a "zero-patched" file reappear, this effectively "heals" the file. Consequently, if lost chunks were repaired earlier, it is advised to run ``--repair`` a second time after creating some new backups.././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/common-options.rst.inc0000644000076500000240000000324714641074756020553 0ustar00twstaff-h, --help show this help message and exit --critical work on log level CRITICAL --error work on log level ERROR --warning work on log level WARNING (default) --info, -v, --verbose work on log level INFO --debug enable debug output, work on log level DEBUG --debug-topic TOPIC enable TOPIC debugging (can be specified multiple times). The logger path is borg.debug. if TOPIC is not fully qualified. -p, --progress show progress information --iec format using IEC units (1KiB = 1024B) --log-json Output one JSON object per log line instead of formatted text. --lock-wait SECONDS wait at most SECONDS for acquiring a repository/cache lock (default: 1). --bypass-lock Bypass locking mechanism --show-version show/log the borg version --show-rc show/log the return code (rc) --umask M set umask to M (local only, default: 0077) --remote-path PATH use PATH as borg executable on the remote (default: "borg") --remote-ratelimit RATE deprecated, use ``--upload-ratelimit`` instead --upload-ratelimit RATE set network upload rate limit in kiByte/s (default: 0=unlimited) --remote-buffer UPLOAD_BUFFER deprecated, use ``--upload-buffer`` instead --upload-buffer UPLOAD_BUFFER set network upload buffer size in MiB. (default: 0=no buffer) --consider-part-files treat part files like normal files (e.g. to list/extract them) --debug-profile FILE Write execution profile in Borg format into FILE. For local use a Python-compatible file can be generated by suffixing FILE with ".pyprof". --rsh RSH Use this command to connect to the 'borg serve' process (default: 'ssh') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/compact.rst0000644000076500000240000000037114641074756016443 0ustar00twstaff.. include:: compact.rst.inc Examples ~~~~~~~~ :: # compact segments and free repo disk space $ borg compact /path/to/repo # same as above plus clean up 17byte commit-only segments $ borg compact --cleanup-commits /path/to/repo ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/compact.rst.inc0000644000076500000240000001012014641074756017204 0ustar00twstaff.. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit! .. _borg_compact: borg compact ------------ .. code-block:: none borg [common options] compact [options] [REPOSITORY] .. only:: html .. class:: borg-options-table +-------------------------------------------------------+-------------------------+----------------------------------------------------------------+ | **positional arguments** | +-------------------------------------------------------+-------------------------+----------------------------------------------------------------+ | | ``REPOSITORY`` | repository to compact | +-------------------------------------------------------+-------------------------+----------------------------------------------------------------+ | **optional arguments** | +-------------------------------------------------------+-------------------------+----------------------------------------------------------------+ | | ``--cleanup-commits`` | cleanup commit-only 17-byte segment files | +-------------------------------------------------------+-------------------------+----------------------------------------------------------------+ | | ``--threshold PERCENT`` | set minimum threshold for saved space in PERCENT (Default: 10) | +-------------------------------------------------------+-------------------------+----------------------------------------------------------------+ | .. class:: borg-common-opt-ref | | | | :ref:`common_options` | +-------------------------------------------------------+-------------------------+----------------------------------------------------------------+ .. raw:: html .. only:: latex REPOSITORY repository to compact optional arguments --cleanup-commits cleanup commit-only 17-byte segment files --threshold PERCENT set minimum threshold for saved space in PERCENT (Default: 10) :ref:`common_options` | Description ~~~~~~~~~~~ This command frees repository space by compacting segments. Use this regularly to avoid running out of space - you do not need to use this after each borg command though. It is especially useful after deleting archives, because only compaction will really free repository space. borg compact does not need a key, so it is possible to invoke it from the client or also from the server. Depending on the amount of segments that need compaction, it may take a while, so consider using the ``--progress`` option. A segment is compacted if the amount of saved space is above the percentage value given by the ``--threshold`` option. If omitted, a threshold of 10% is used. When using ``--verbose``, borg will output an estimate of the freed space. After upgrading borg (server) to 1.2+, you can use ``borg compact --cleanup-commits`` to clean up the numerous 17byte commit-only segments that borg 1.1 did not clean up due to a bug. It is enough to do that once per repository. After cleaning up the commits, borg will also do a normal compaction. See :ref:`separate_compaction` in Additional Notes for more details.././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/config.rst0000644000076500000240000000075014641074756016263 0ustar00twstaff.. include:: config.rst.inc .. note:: The repository & cache config files are some of the only directly manipulable parts of a repository that aren't versioned or backed up, so be careful when making changes\! Examples ~~~~~~~~ :: # find cache directory $ cd ~/.cache/borg/$(borg config /path/to/repo id) # reserve some space $ borg config /path/to/repo additional_free_space 2G # make a repo append-only $ borg config /path/to/repo append_only 1 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/config.rst.inc0000644000076500000240000001015014641074756017026 0ustar00twstaff.. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit! .. _borg_config: borg config ----------- .. code-block:: none borg [common options] config [options] [REPOSITORY] [NAME] [VALUE] .. only:: html .. class:: borg-options-table +-------------------------------------------------------+----------------------+----------------------------------------+ | **positional arguments** | +-------------------------------------------------------+----------------------+----------------------------------------+ | | ``REPOSITORY`` | repository to configure | +-------------------------------------------------------+----------------------+----------------------------------------+ | | ``NAME`` | name of config key | +-------------------------------------------------------+----------------------+----------------------------------------+ | | ``VALUE`` | new value for key | +-------------------------------------------------------+----------------------+----------------------------------------+ | **optional arguments** | +-------------------------------------------------------+----------------------+----------------------------------------+ | | ``-c``, ``--cache`` | get and set values from the repo cache | +-------------------------------------------------------+----------------------+----------------------------------------+ | | ``-d``, ``--delete`` | delete the key from the config file | +-------------------------------------------------------+----------------------+----------------------------------------+ | | ``-l``, ``--list`` | list the configuration of the repo | +-------------------------------------------------------+----------------------+----------------------------------------+ | .. class:: borg-common-opt-ref | | | | :ref:`common_options` | +-------------------------------------------------------+----------------------+----------------------------------------+ .. raw:: html .. only:: latex REPOSITORY repository to configure NAME name of config key VALUE new value for key optional arguments -c, --cache get and set values from the repo cache -d, --delete delete the key from the config file -l, --list list the configuration of the repo :ref:`common_options` | Description ~~~~~~~~~~~ This command gets and sets options in a local repository or cache config file. For security reasons, this command only works on local repositories. To delete a config value entirely, use ``--delete``. To list the values of the configuration file or the default values, use ``--list``. To get and existing key, pass only the key name. To set a key, pass both the key name and the new value. Keys can be specified in the format "section.name" or simply "name"; the section will default to "repository" and "cache" for the repo and cache configs, respectively. By default, borg config manipulates the repository config file. Using ``--cache`` edits the repository cache's config file instead.././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/create.rst0000644000076500000240000001001414641074756016253 0ustar00twstaff.. include:: create.rst.inc Examples ~~~~~~~~ :: # Backup ~/Documents into an archive named "my-documents" $ borg create /path/to/repo::my-documents ~/Documents # same, but list all files as we process them $ borg create --list /path/to/repo::my-documents ~/Documents # Backup /mnt/disk/docs, but strip path prefix using the slashdot hack $ borg create /path/to/repo::docs /mnt/disk/./docs # Backup ~/Documents and ~/src but exclude pyc files $ borg create /path/to/repo::my-files \ ~/Documents \ ~/src \ --exclude '*.pyc' # Backup home directories excluding image thumbnails (i.e. only # /home//.thumbnails is excluded, not /home/*/*/.thumbnails etc.) $ borg create /path/to/repo::my-files /home \ --exclude 'sh:home/*/.thumbnails' # Backup the root filesystem into an archive named "root-YYYY-MM-DD" # use zlib compression (good, but slow) - default is lz4 (fast, low compression ratio) $ borg create -C zlib,6 --one-file-system /path/to/repo::root-{now:%Y-%m-%d} / # Backup onto a remote host ("push" style) via ssh to port 2222, # logging in as user "borg" and storing into /path/to/repo $ borg create ssh://borg@backup.example.org:2222/path/to/repo::{fqdn}-root-{now} / # Backup a remote host locally ("pull" style) using sshfs $ mkdir sshfs-mount $ sshfs root@example.com:/ sshfs-mount $ cd sshfs-mount $ borg create /path/to/repo::example.com-root-{now:%Y-%m-%d} . $ cd .. $ fusermount -u sshfs-mount # Make a big effort in fine granular deduplication (big chunk management # overhead, needs a lot of RAM and disk space, see formula in internals # docs - same parameters as borg < 1.0 or attic): $ borg create --chunker-params buzhash,10,23,16,4095 /path/to/repo::small /smallstuff # Backup a raw device (must not be active/in use/mounted at that time) $ borg create --read-special --chunker-params fixed,4194304 /path/to/repo::my-sdx /dev/sdX # Backup a sparse disk image (must not be active/in use/mounted at that time) $ borg create --sparse --chunker-params fixed,4194304 /path/to/repo::my-disk my-disk.raw # No compression (none) $ borg create --compression none /path/to/repo::arch ~ # Super fast, low compression (lz4, default) $ borg create /path/to/repo::arch ~ # Less fast, higher compression (zlib, N = 0..9) $ borg create --compression zlib,N /path/to/repo::arch ~ # Even slower, even higher compression (lzma, N = 0..9) $ borg create --compression lzma,N /path/to/repo::arch ~ # Only compress compressible data with lzma,N (N = 0..9) $ borg create --compression auto,lzma,N /path/to/repo::arch ~ # Use short hostname, user name and current time in archive name $ borg create /path/to/repo::{hostname}-{user}-{now} ~ # Similar, use the same datetime format that is default as of borg 1.1 $ borg create /path/to/repo::{hostname}-{user}-{now:%Y-%m-%dT%H:%M:%S} ~ # As above, but add nanoseconds $ borg create /path/to/repo::{hostname}-{user}-{now:%Y-%m-%dT%H:%M:%S.%f} ~ # Backing up relative paths by moving into the correct directory first $ cd /home/user/Documents # The root directory of the archive will be "projectA" $ borg create /path/to/repo::daily-projectA-{now:%Y-%m-%d} projectA # Use external command to determine files to archive # Use --paths-from-stdin with find to only backup files less than 1MB in size $ find ~ -size -1000k | borg create --paths-from-stdin /path/to/repo::small-files-only # Use --paths-from-command with find to only backup files from a given user $ borg create --paths-from-command /path/to/repo::joes-files -- find /srv/samba/shared -user joe # Use --paths-from-stdin with --paths-delimiter (for example, for filenames with newlines in them) $ find ~ -size -1000k -print0 | borg create \ --paths-from-stdin \ --paths-delimiter "\0" \ /path/to/repo::smallfiles-handle-newline ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/create.rst.inc0000644000076500000240000012347614641074756017044 0ustar00twstaff.. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit! .. _borg_create: borg create ----------- .. code-block:: none borg [common options] create [options] ARCHIVE [PATH...] .. only:: html .. class:: borg-options-table +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | **positional arguments** | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``ARCHIVE`` | name of archive to create (must be also a valid directory name) | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``PATH`` | paths to archive | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | **optional arguments** | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``-n``, ``--dry-run`` | do not create a backup archive | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``-s``, ``--stats`` | print statistics for the created archive | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--list`` | output verbose list of items (files, dirs, ...) | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--filter STATUSCHARS`` | only display items with the given status characters (see description) | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--json`` | output stats as JSON. Implies ``--stats``. | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--no-cache-sync`` | experimental: do not synchronize the cache. Implies not using the files cache. | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--stdin-name NAME`` | use NAME in archive for stdin data (default: 'stdin') | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--stdin-user USER`` | set user USER in archive for stdin data (default: 'root') | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--stdin-group GROUP`` | set group GROUP in archive for stdin data (default: 'wheel') | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--stdin-mode M`` | set mode to M in archive for stdin data (default: 0660) | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--content-from-command`` | interpret PATH as command and store its stdout. See also section Reading from stdin below. | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--paths-from-stdin`` | read DELIM-separated list of paths to backup from stdin. All control is external: it will back up all files given - no more, no less. | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--paths-from-command`` | interpret PATH as command and treat its output as ``--paths-from-stdin`` | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--paths-delimiter DELIM`` | set path delimiter for ``--paths-from-stdin`` and ``--paths-from-command`` (default: ``\n``) | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | .. class:: borg-common-opt-ref | | | | :ref:`common_options` | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | **Include/Exclude options** | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``-e PATTERN``, ``--exclude PATTERN`` | exclude paths matching PATTERN | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--exclude-from EXCLUDEFILE`` | read exclude patterns from EXCLUDEFILE, one per line | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--pattern PATTERN`` | include/exclude paths matching PATTERN | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--patterns-from PATTERNFILE`` | read include/exclude patterns from PATTERNFILE, one per line | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--exclude-caches`` | exclude directories that contain a CACHEDIR.TAG file (http://www.bford.info/cachedir/spec.html) | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--exclude-if-present NAME`` | exclude directories that are tagged by containing a filesystem object with the given NAME | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--keep-exclude-tags`` | if tag objects are specified with ``--exclude-if-present``, don't omit the tag objects themselves from the backup archive | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--exclude-nodump`` | exclude files flagged NODUMP | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | **Filesystem options** | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``-x``, ``--one-file-system`` | stay in the same file system and do not store mount points of other file systems - this might behave different from your expectations, see the description below. | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--numeric-owner`` | deprecated, use ``--numeric-ids`` instead | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--numeric-ids`` | only store numeric user and group identifiers | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--noatime`` | do not store atime into archive | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--atime`` | do store atime into archive | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--noctime`` | do not store ctime into archive | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--nobirthtime`` | do not store birthtime (creation date) into archive | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--nobsdflags`` | deprecated, use ``--noflags`` instead | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--noflags`` | do not read and store flags (e.g. NODUMP, IMMUTABLE) into archive | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--noacls`` | do not read and store ACLs into archive | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--noxattrs`` | do not read and store xattrs into archive | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--sparse`` | detect sparse holes in input (supported only by fixed chunker) | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--files-cache MODE`` | operate files cache in MODE. default: ctime,size,inode | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--read-special`` | open and read block and char device files as well as FIFOs as if they were regular files. Also follows symlinks pointing to these kinds of files. | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | **Archive options** | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--comment COMMENT`` | add a comment text to the archive | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--timestamp TIMESTAMP`` | manually specify the archive creation date/time (UTC, yyyy-mm-ddThh:mm:ss format). Alternatively, give a reference file/directory. | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``-c SECONDS``, ``--checkpoint-interval SECONDS`` | write checkpoint every SECONDS seconds (Default: 1800) | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--chunker-params PARAMS`` | specify the chunker parameters (ALGO, CHUNK_MIN_EXP, CHUNK_MAX_EXP, HASH_MASK_BITS, HASH_WINDOW_SIZE). default: buzhash,19,23,21,4095 | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``-C COMPRESSION``, ``--compression COMPRESSION`` | select compression algorithm, see the output of the "borg help compression" command for details. | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. raw:: html .. only:: latex ARCHIVE name of archive to create (must be also a valid directory name) PATH paths to archive optional arguments -n, --dry-run do not create a backup archive -s, --stats print statistics for the created archive --list output verbose list of items (files, dirs, ...) --filter STATUSCHARS only display items with the given status characters (see description) --json output stats as JSON. Implies ``--stats``. --no-cache-sync experimental: do not synchronize the cache. Implies not using the files cache. --stdin-name NAME use NAME in archive for stdin data (default: 'stdin') --stdin-user USER set user USER in archive for stdin data (default: 'root') --stdin-group GROUP set group GROUP in archive for stdin data (default: 'wheel') --stdin-mode M set mode to M in archive for stdin data (default: 0660) --content-from-command interpret PATH as command and store its stdout. See also section Reading from stdin below. --paths-from-stdin read DELIM-separated list of paths to backup from stdin. All control is external: it will back up all files given - no more, no less. --paths-from-command interpret PATH as command and treat its output as ``--paths-from-stdin`` --paths-delimiter DELIM set path delimiter for ``--paths-from-stdin`` and ``--paths-from-command`` (default: ``\n``) :ref:`common_options` | Include/Exclude options -e PATTERN, --exclude PATTERN exclude paths matching PATTERN --exclude-from EXCLUDEFILE read exclude patterns from EXCLUDEFILE, one per line --pattern PATTERN include/exclude paths matching PATTERN --patterns-from PATTERNFILE read include/exclude patterns from PATTERNFILE, one per line --exclude-caches exclude directories that contain a CACHEDIR.TAG file (http://www.bford.info/cachedir/spec.html) --exclude-if-present NAME exclude directories that are tagged by containing a filesystem object with the given NAME --keep-exclude-tags if tag objects are specified with ``--exclude-if-present``, don't omit the tag objects themselves from the backup archive --exclude-nodump exclude files flagged NODUMP Filesystem options -x, --one-file-system stay in the same file system and do not store mount points of other file systems - this might behave different from your expectations, see the description below. --numeric-owner deprecated, use ``--numeric-ids`` instead --numeric-ids only store numeric user and group identifiers --noatime do not store atime into archive --atime do store atime into archive --noctime do not store ctime into archive --nobirthtime do not store birthtime (creation date) into archive --nobsdflags deprecated, use ``--noflags`` instead --noflags do not read and store flags (e.g. NODUMP, IMMUTABLE) into archive --noacls do not read and store ACLs into archive --noxattrs do not read and store xattrs into archive --sparse detect sparse holes in input (supported only by fixed chunker) --files-cache MODE operate files cache in MODE. default: ctime,size,inode --read-special open and read block and char device files as well as FIFOs as if they were regular files. Also follows symlinks pointing to these kinds of files. Archive options --comment COMMENT add a comment text to the archive --timestamp TIMESTAMP manually specify the archive creation date/time (UTC, yyyy-mm-ddThh:mm:ss format). Alternatively, give a reference file/directory. -c SECONDS, --checkpoint-interval SECONDS write checkpoint every SECONDS seconds (Default: 1800) --chunker-params PARAMS specify the chunker parameters (ALGO, CHUNK_MIN_EXP, CHUNK_MAX_EXP, HASH_MASK_BITS, HASH_WINDOW_SIZE). default: buzhash,19,23,21,4095 -C COMPRESSION, --compression COMPRESSION select compression algorithm, see the output of the "borg help compression" command for details. Description ~~~~~~~~~~~ This command creates a backup archive containing all files found while recursively traversing all paths specified. Paths are added to the archive as they are given, that means if relative paths are desired, the command has to be run from the correct directory. The slashdot hack in paths (recursion roots) is triggered by using ``/./``: ``/this/gets/stripped/./this/gets/archived`` means to process that fs object, but strip the prefix on the left side of ``./`` from the archived items (in this case, ``this/gets/archived`` will be the path in the archived item). When giving '-' as path, borg will read data from standard input and create a file 'stdin' in the created archive from that data. In some cases it's more appropriate to use --content-from-command, however. See section *Reading from stdin* below for details. The archive will consume almost no disk space for files or parts of files that have already been stored in other archives. The archive name needs to be unique. It must not end in '.checkpoint' or '.checkpoint.N' (with N being a number), because these names are used for checkpoints and treated in special ways. In the archive name, you may use the following placeholders: {now}, {utcnow}, {fqdn}, {hostname}, {user} and some others. Backup speed is increased by not reprocessing files that are already part of existing archives and weren't modified. The detection of unmodified files is done by comparing multiple file metadata values with previous values kept in the files cache. This comparison can operate in different modes as given by ``--files-cache``: - ctime,size,inode (default) - mtime,size,inode (default behaviour of borg versions older than 1.1.0rc4) - ctime,size (ignore the inode number) - mtime,size (ignore the inode number) - rechunk,ctime (all files are considered modified - rechunk, cache ctime) - rechunk,mtime (all files are considered modified - rechunk, cache mtime) - disabled (disable the files cache, all files considered modified - rechunk) inode number: better safety, but often unstable on network filesystems Normally, detecting file modifications will take inode information into consideration to improve the reliability of file change detection. This is problematic for files located on sshfs and similar network file systems which do not provide stable inode numbers, such files will always be considered modified. You can use modes without `inode` in this case to improve performance, but reliability of change detection might be reduced. ctime vs. mtime: safety vs. speed - ctime is a rather safe way to detect changes to a file (metadata and contents) as it can not be set from userspace. But, a metadata-only change will already update the ctime, so there might be some unnecessary chunking/hashing even without content changes. Some filesystems do not support ctime (change time). E.g. doing a chown or chmod to a file will change its ctime. - mtime usually works and only updates if file contents were changed. But mtime can be arbitrarily set from userspace, e.g. to set mtime back to the same value it had before a content change happened. This can be used maliciously as well as well-meant, but in both cases mtime based cache modes can be problematic. The mount points of filesystems or filesystem snapshots should be the same for every creation of a new archive to ensure fast operation. This is because the file cache that is used to determine changed files quickly uses absolute filenames. If this is not possible, consider creating a bind mount to a stable location. The ``--progress`` option shows (from left to right) Original, Compressed and Deduplicated (O, C and D, respectively), then the Number of files (N) processed so far, followed by the currently processed path. When using ``--stats``, you will get some statistics about how much data was added - the "This Archive" deduplicated size there is most interesting as that is how much your repository will grow. Please note that the "All archives" stats refer to the state after creation. Also, the ``--stats`` and ``--dry-run`` options are mutually exclusive because the data is not actually compressed and deduplicated during a dry run. For more help on include/exclude patterns, see the :ref:`borg_patterns` command output. For more help on placeholders, see the :ref:`borg_placeholders` command output. .. man NOTES The ``--exclude`` patterns are not like tar. In tar ``--exclude`` .bundler/gems will exclude foo/.bundler/gems. In borg it will not, you need to use ``--exclude`` '\*/.bundler/gems' to get the same effect. In addition to using ``--exclude`` patterns, it is possible to use ``--exclude-if-present`` to specify the name of a filesystem object (e.g. a file or folder name) which, when contained within another folder, will prevent the containing folder from being backed up. By default, the containing folder and all of its contents will be omitted from the backup. If, however, you wish to only include the objects specified by ``--exclude-if-present`` in your backup, and not include any other contents of the containing folder, this can be enabled through using the ``--keep-exclude-tags`` option. The ``-x`` or ``--one-file-system`` option excludes directories, that are mountpoints (and everything in them). It detects mountpoints by comparing the device number from the output of ``stat()`` of the directory and its parent directory. Specifically, it excludes directories for which ``stat()`` reports a device number different from the device number of their parent. In general: be aware that there are directories with device number different from their parent, which the kernel does not consider a mountpoint and also the other way around. Linux examples for this are bind mounts (possibly same device number, but always a mountpoint) and ALL subvolumes of a btrfs (different device number from parent but not necessarily a mountpoint). macOS examples are the apfs mounts of a typical macOS installation. Therefore, when using ``--one-file-system``, you should double-check that the backup works as intended. .. _list_item_flags: Item flags ++++++++++ ``--list`` outputs a list of all files, directories and other file system items it considered (no matter whether they had content changes or not). For each item, it prefixes a single-letter flag that indicates type and/or status of the item. If you are interested only in a subset of that output, you can give e.g. ``--filter=AME`` and it will only show regular files with A, M or E status (see below). A uppercase character represents the status of a regular file relative to the "files" cache (not relative to the repo -- this is an issue if the files cache is not used). Metadata is stored in any case and for 'A' and 'M' also new data chunks are stored. For 'U' all data chunks refer to already existing chunks. - 'A' = regular file, added (see also :ref:`a_status_oddity` in the FAQ) - 'M' = regular file, modified - 'U' = regular file, unchanged - 'C' = regular file, it changed while we backed it up - 'E' = regular file, an error happened while accessing/reading *this* file A lowercase character means a file type other than a regular file, borg usually just stores their metadata: - 'd' = directory - 'b' = block device - 'c' = char device - 'h' = regular file, hardlink (to already seen inodes) - 's' = symlink - 'f' = fifo Other flags used include: - 'i' = backup data was read from standard input (stdin) - '-' = dry run, item was *not* backed up - 'x' = excluded, item was *not* backed up - '?' = missing status code (if you see this, please file a bug report!) Reading backup data from stdin ++++++++++++++++++++++++++++++ There are two methods to read from stdin. Either specify ``-`` as path and pipe directly to borg:: backup-vm --id myvm --stdout | borg create REPO::ARCHIVE - Or use ``--content-from-command`` to have Borg manage the execution of the command and piping. If you do so, the first PATH argument is interpreted as command to execute and any further arguments are treated as arguments to the command:: borg create --content-from-command REPO::ARCHIVE -- backup-vm --id myvm --stdout ``--`` is used to ensure ``--id`` and ``--stdout`` are **not** considered arguments to ``borg`` but rather ``backup-vm``. The difference between the two approaches is that piping to borg creates an archive even if the command piping to borg exits with a failure. In this case, **one can end up with truncated output being backed up**. Using ``--content-from-command``, in contrast, borg is guaranteed to fail without creating an archive should the command fail. The command is considered failed when it returned a non-zero exit code. Reading from stdin yields just a stream of data without file metadata associated with it, and the files cache is not needed at all. So it is safe to disable it via ``--files-cache disabled`` and speed up backup creation a bit. By default, the content read from stdin is stored in a file called 'stdin'. Use ``--stdin-name`` to change the name. Feeding all file paths from externally ++++++++++++++++++++++++++++++++++++++ Usually, you give a starting path (recursion root) to borg and then borg automatically recurses, finds and backs up all fs objects contained in there (optionally considering include/exclude rules). If you need more control and you want to give every single fs object path to borg (maybe implementing your own recursion or your own rules), you can use ``--paths-from-stdin`` or ``--paths-from-command`` (with the latter, borg will fail to create an archive should the command fail). Borg supports paths with the slashdot hack to strip path prefixes here also. So, be careful not to unintentionally trigger that.././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/debug.rst0000644000076500000240000000330214641074756016100 0ustar00twstaffDebugging Facilities -------------------- There is a ``borg debug`` command that has some subcommands which are all **not intended for normal use** and **potentially very dangerous** if used incorrectly. For example, ``borg debug put-obj`` and ``borg debug delete-obj`` will only do what their name suggests: put objects into repo / delete objects from repo. Please note: - they will not update the chunks cache (chunks index) about the object - they will not update the manifest (so no automatic chunks index resync is triggered) - they will not check whether the object is in use (e.g. before delete-obj) - they will not update any metadata which may point to the object They exist to improve debugging capabilities without direct system access, e.g. in case you ever run into some severe malfunction. Use them only if you know what you are doing or if a trusted Borg developer tells you what to do. Borg has a ``--debug-topic TOPIC`` option to enable specific debugging messages. Topics are generally not documented. A ``--debug-profile FILE`` option exists which writes a profile of the main program's execution to a file. The format of these files is not directly compatible with the Python profiling tools, since these use the "marshal" format, which is not intended to be secure (quoting the Python docs: "Never unmarshal data received from an untrusted or unauthenticated source."). The ``borg debug profile-convert`` command can be used to take a Borg profile and convert it to a profile file that is compatible with the Python tools. Additionally, if the filename specified for ``--debug-profile`` ends with ".pyprof" a Python compatible profile is generated. This is only intended for local use by developers. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/delete.rst0000644000076500000240000000202214641074756016252 0ustar00twstaff.. include:: delete.rst.inc Examples ~~~~~~~~ :: # delete a single backup archive: $ borg delete /path/to/repo::Monday # actually free disk space: $ borg compact /path/to/repo # delete all archives whose names begin with the machine's hostname followed by "-" $ borg delete --glob-archives '{hostname}-*' /path/to/repo # delete all archives whose names contain "-2012-" $ borg delete --glob-archives '*-2012-*' /path/to/repo # see what would be deleted if delete was run without --dry-run $ borg delete --list --dry-run -a '*-May-*' /path/to/repo # delete the whole repository and the related local cache: $ borg delete /path/to/repo You requested to completely DELETE the repository *including* all archives it contains: repo Mon, 2016-02-15 19:26:54 root-2016-02-15 Mon, 2016-02-15 19:36:29 newname Mon, 2016-02-15 19:50:19 Type 'YES' if you understand this and want to continue: YES ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/delete.rst.inc0000644000076500000240000003346614641074756017042 0ustar00twstaff.. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit! .. _borg_delete: borg delete ----------- .. code-block:: none borg [common options] delete [options] [REPOSITORY_OR_ARCHIVE] [ARCHIVE...] .. only:: html .. class:: borg-options-table +-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | **positional arguments** | +-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``REPOSITORY_OR_ARCHIVE`` | repository or archive to delete | +-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``ARCHIVE`` | archives to delete | +-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | **optional arguments** | +-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``-n``, ``--dry-run`` | do not change repository | +-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``--list`` | output verbose list of archives | +-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``-s``, ``--stats`` | print statistics for the deleted archive | +-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``--cache-only`` | delete only the local cache for the given repository | +-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``--force`` | force deletion of corrupted archives, use ``--force --force`` in case ``--force`` does not work. | +-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``--keep-security-info`` | keep the local security info when deleting a repository | +-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``--save-space`` | work slower, but using less space | +-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``-c SECONDS``, ``--checkpoint-interval SECONDS`` | write checkpoint every SECONDS seconds (Default: 1800) | +-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | .. class:: borg-common-opt-ref | | | | :ref:`common_options` | +-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | **Archive filters** — Archive filters can be applied to repository targets. | +-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``-P PREFIX``, ``--prefix PREFIX`` | only consider archive names starting with this prefix. (deprecated) | +-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``-a GLOB``, ``--glob-archives GLOB`` | only consider archive names matching the glob. sh: rules apply (without actually using the sh: prefix), see "borg help patterns". | +-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``--sort-by KEYS`` | Comma-separated list of sorting keys; valid keys are: timestamp, archive, name, id; default is: timestamp | +-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``--first N`` | consider first N archives after other filters were applied | +-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``--last N`` | consider last N archives after other filters were applied | +-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ .. raw:: html .. only:: latex REPOSITORY_OR_ARCHIVE repository or archive to delete ARCHIVE archives to delete optional arguments -n, --dry-run do not change repository --list output verbose list of archives -s, --stats print statistics for the deleted archive --cache-only delete only the local cache for the given repository --force force deletion of corrupted archives, use ``--force --force`` in case ``--force`` does not work. --keep-security-info keep the local security info when deleting a repository --save-space work slower, but using less space -c SECONDS, --checkpoint-interval SECONDS write checkpoint every SECONDS seconds (Default: 1800) :ref:`common_options` | Archive filters -P PREFIX, --prefix PREFIX only consider archive names starting with this prefix. (deprecated) -a GLOB, --glob-archives GLOB only consider archive names matching the glob. sh: rules apply (without actually using the sh: prefix), see "borg help patterns". --sort-by KEYS Comma-separated list of sorting keys; valid keys are: timestamp, archive, name, id; default is: timestamp --first N consider first N archives after other filters were applied --last N consider last N archives after other filters were applied Description ~~~~~~~~~~~ This command deletes an archive from the repository or the complete repository. Important: When deleting archives, repository disk space is **not** freed until you run ``borg compact``. When you delete a complete repository, the security info and local cache for it (if any) are also deleted. Alternatively, you can delete just the local cache with the ``--cache-only`` option, or keep the security info with the ``--keep-security-info`` option. When in doubt, use ``--dry-run --list`` to see what would be deleted. When using ``--stats``, you will get some statistics about how much data was deleted - the "Deleted data" deduplicated size there is most interesting as that is how much your repository will shrink. Please note that the "All archives" stats refer to the state after deletion. You can delete multiple archives by specifying a shell pattern to match multiple archives using the ``--glob-archives GLOB`` option (for more info on these patterns, see :ref:`borg_patterns`). To avoid accidentally deleting archives, especially when using glob patterns, it might be helpful to use the ``--dry-run`` to test out the command without actually making any changes to the repository.././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/diff.rst0000644000076500000240000000247214641074756015731 0ustar00twstaff.. include:: diff.rst.inc Examples ~~~~~~~~ :: $ borg init -e=none testrepo $ mkdir testdir $ cd testdir $ echo asdf > file1 $ dd if=/dev/urandom bs=1M count=4 > file2 $ touch file3 $ borg create ../testrepo::archive1 . $ chmod a+x file1 $ echo "something" >> file2 $ borg create ../testrepo::archive2 . $ echo "testing 123" >> file1 $ rm file3 $ touch file4 $ borg create ../testrepo::archive3 . $ cd .. $ borg diff testrepo::archive1 archive2 [-rw-r--r-- -> -rwxr-xr-x] file1 +135 B -252 B file2 $ borg diff testrepo::archive2 archive3 +17 B -5 B file1 added 0 B file4 removed 0 B file3 $ borg diff testrepo::archive1 archive3 +17 B -5 B [-rw-r--r-- -> -rwxr-xr-x] file1 +135 B -252 B file2 added 0 B file4 removed 0 B file3 $ borg diff --json-lines testrepo::archive1 archive3 {"path": "file1", "changes": [{"type": "modified", "added": 17, "removed": 5}, {"type": "mode", "old_mode": "-rw-r--r--", "new_mode": "-rwxr-xr-x"}]} {"path": "file2", "changes": [{"type": "modified", "added": 135, "removed": 252}]} {"path": "file4", "changes": [{"type": "added", "size": 0}]} {"path": "file3", "changes": [{"type": "removed", "size": 0}]}././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/diff.rst.inc0000644000076500000240000002111314641074756016472 0ustar00twstaff.. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit! .. _borg_diff: borg diff --------- .. code-block:: none borg [common options] diff [options] REPO::ARCHIVE1 ARCHIVE2 [PATH...] .. only:: html .. class:: borg-options-table +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------+ | **positional arguments** | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------+ | | ``REPO::ARCHIVE1`` | repository location and ARCHIVE1 name | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------+ | | ``ARCHIVE2`` | ARCHIVE2 name (no repository location allowed) | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------+ | | ``PATH`` | paths of items inside the archives to compare; patterns are supported | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------+ | **optional arguments** | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------+ | | ``--numeric-owner`` | deprecated, use ``--numeric-ids`` instead | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------+ | | ``--numeric-ids`` | only consider numeric user and group identifiers | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------+ | | ``--same-chunker-params`` | Override check of chunker parameters. | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------+ | | ``--sort`` | Sort the output lines by file path. | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------+ | | ``--content-only`` | Only compare differences in content (exclude metadata differences) | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------+ | | ``--json-lines`` | Format output as JSON Lines. | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------+ | .. class:: borg-common-opt-ref | | | | :ref:`common_options` | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------+ | **Include/Exclude options** | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------+ | | ``-e PATTERN``, ``--exclude PATTERN`` | exclude paths matching PATTERN | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------+ | | ``--exclude-from EXCLUDEFILE`` | read exclude patterns from EXCLUDEFILE, one per line | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------+ | | ``--pattern PATTERN`` | include/exclude paths matching PATTERN | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------+ | | ``--patterns-from PATTERNFILE`` | read include/exclude patterns from PATTERNFILE, one per line | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------+ .. raw:: html .. only:: latex REPO::ARCHIVE1 repository location and ARCHIVE1 name ARCHIVE2 ARCHIVE2 name (no repository location allowed) PATH paths of items inside the archives to compare; patterns are supported optional arguments --numeric-owner deprecated, use ``--numeric-ids`` instead --numeric-ids only consider numeric user and group identifiers --same-chunker-params Override check of chunker parameters. --sort Sort the output lines by file path. --content-only Only compare differences in content (exclude metadata differences) --json-lines Format output as JSON Lines. :ref:`common_options` | Include/Exclude options -e PATTERN, --exclude PATTERN exclude paths matching PATTERN --exclude-from EXCLUDEFILE read exclude patterns from EXCLUDEFILE, one per line --pattern PATTERN include/exclude paths matching PATTERN --patterns-from PATTERNFILE read include/exclude patterns from PATTERNFILE, one per line Description ~~~~~~~~~~~ This command finds differences (file contents, user/group/mode) between archives. A repository location and an archive name must be specified for REPO::ARCHIVE1. ARCHIVE2 is just another archive name in same repository (no repository location allowed). For archives created with Borg 1.1 or newer diff automatically detects whether the archives are created with the same chunker params. If so, only chunk IDs are compared, which is very fast. For archives prior to Borg 1.1 chunk contents are compared by default. If you did not create the archives with different chunker params, pass ``--same-chunker-params``. Note that the chunker params changed from Borg 0.xx to 1.0. For more help on include/exclude patterns, see the :ref:`borg_patterns` command output.././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/export-tar.rst.inc0000644000076500000240000002213514641074756017674 0ustar00twstaff.. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit! .. _borg_export-tar: borg export-tar --------------- .. code-block:: none borg [common options] export-tar [options] ARCHIVE FILE [PATH...] .. only:: html .. class:: borg-options-table +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+ | **positional arguments** | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+ | | ``ARCHIVE`` | archive to export | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+ | | ``FILE`` | output tar file. "-" to write to stdout instead. | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+ | | ``PATH`` | paths to extract; patterns are supported | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+ | **optional arguments** | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+ | | ``--tar-filter`` | filter program to pipe data through | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+ | | ``--list`` | output verbose list of items (files, dirs, ...) | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+ | .. class:: borg-common-opt-ref | | | | :ref:`common_options` | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+ | **Include/Exclude options** | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+ | | ``-e PATTERN``, ``--exclude PATTERN`` | exclude paths matching PATTERN | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+ | | ``--exclude-from EXCLUDEFILE`` | read exclude patterns from EXCLUDEFILE, one per line | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+ | | ``--pattern PATTERN`` | include/exclude paths matching PATTERN | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+ | | ``--patterns-from PATTERNFILE`` | read include/exclude patterns from PATTERNFILE, one per line | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+ | | ``--strip-components NUMBER`` | Remove the specified number of leading path elements. Paths with fewer elements will be silently skipped. | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+ .. raw:: html .. only:: latex ARCHIVE archive to export FILE output tar file. "-" to write to stdout instead. PATH paths to extract; patterns are supported optional arguments --tar-filter filter program to pipe data through --list output verbose list of items (files, dirs, ...) :ref:`common_options` | Include/Exclude options -e PATTERN, --exclude PATTERN exclude paths matching PATTERN --exclude-from EXCLUDEFILE read exclude patterns from EXCLUDEFILE, one per line --pattern PATTERN include/exclude paths matching PATTERN --patterns-from PATTERNFILE read include/exclude patterns from PATTERNFILE, one per line --strip-components NUMBER Remove the specified number of leading path elements. Paths with fewer elements will be silently skipped. Description ~~~~~~~~~~~ This command creates a tarball from an archive. When giving '-' as the output FILE, Borg will write a tar stream to standard output. By default (``--tar-filter=auto``) Borg will detect whether the FILE should be compressed based on its file extension and pipe the tarball through an appropriate filter before writing it to FILE: - .tar.gz or .tgz: gzip - .tar.bz2 or .tbz: bzip2 - .tar.xz or .txz: xz - .tar.zstd or .tar.zst: zstd - .tar.lz4: lz4 Alternatively, a ``--tar-filter`` program may be explicitly specified. It should read the uncompressed tar stream from stdin and write a compressed/filtered tar stream to stdout. The generated tarball uses the GNU tar format. export-tar is a lossy conversion: BSD flags, ACLs, extended attributes (xattrs), atime and ctime are not exported. Timestamp resolution is limited to whole seconds, not the nanosecond resolution otherwise supported by Borg. A ``--sparse`` option (as found in borg extract) is not supported. By default the entire archive is extracted but a subset of files and directories can be selected by passing a list of ``PATHs`` as arguments. The file selection can further be restricted by using the ``--exclude`` option. For more help on include/exclude patterns, see the :ref:`borg_patterns` command output. ``--progress`` can be slower than no progress display, since it makes one additional pass over the archive metadata.././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/extract.rst0000644000076500000240000000140214641074756016463 0ustar00twstaff.. include:: extract.rst.inc Examples ~~~~~~~~ :: # Extract entire archive $ borg extract /path/to/repo::my-files # Extract entire archive and list files while processing $ borg extract --list /path/to/repo::my-files # Verify whether an archive could be successfully extracted, but do not write files to disk $ borg extract --dry-run /path/to/repo::my-files # Extract the "src" directory $ borg extract /path/to/repo::my-files home/USERNAME/src # Extract the "src" directory but exclude object files $ borg extract /path/to/repo::my-files home/USERNAME/src --exclude '*.o' # Restore a raw device (must not be active/in use/mounted at that time) $ borg extract --stdout /path/to/repo::my-sdx | dd of=/dev/sdx bs=10M ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/extract.rst.inc0000644000076500000240000003007014641074756017236 0ustar00twstaff.. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit! .. _borg_extract: borg extract ------------ .. code-block:: none borg [common options] extract [options] ARCHIVE [PATH...] .. only:: html .. class:: borg-options-table +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+ | **positional arguments** | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+ | | ``ARCHIVE`` | archive to extract | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+ | | ``PATH`` | paths to extract; patterns are supported | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+ | **optional arguments** | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+ | | ``--list`` | output verbose list of items (files, dirs, ...) | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+ | | ``-n``, ``--dry-run`` | do not actually change any files | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+ | | ``--numeric-owner`` | deprecated, use ``--numeric-ids`` instead | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+ | | ``--numeric-ids`` | only obey numeric user and group identifiers | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+ | | ``--nobsdflags`` | deprecated, use ``--noflags`` instead | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+ | | ``--noflags`` | do not extract/set flags (e.g. NODUMP, IMMUTABLE) | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+ | | ``--noacls`` | do not extract/set ACLs | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+ | | ``--noxattrs`` | do not extract/set xattrs | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+ | | ``--stdout`` | write all extracted data to stdout | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+ | | ``--sparse`` | create holes in output sparse file from all-zero chunks | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+ | .. class:: borg-common-opt-ref | | | | :ref:`common_options` | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+ | **Include/Exclude options** | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+ | | ``-e PATTERN``, ``--exclude PATTERN`` | exclude paths matching PATTERN | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+ | | ``--exclude-from EXCLUDEFILE`` | read exclude patterns from EXCLUDEFILE, one per line | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+ | | ``--pattern PATTERN`` | include/exclude paths matching PATTERN | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+ | | ``--patterns-from PATTERNFILE`` | read include/exclude patterns from PATTERNFILE, one per line | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+ | | ``--strip-components NUMBER`` | Remove the specified number of leading path elements. Paths with fewer elements will be silently skipped. | +-------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------+ .. raw:: html .. only:: latex ARCHIVE archive to extract PATH paths to extract; patterns are supported optional arguments --list output verbose list of items (files, dirs, ...) -n, --dry-run do not actually change any files --numeric-owner deprecated, use ``--numeric-ids`` instead --numeric-ids only obey numeric user and group identifiers --nobsdflags deprecated, use ``--noflags`` instead --noflags do not extract/set flags (e.g. NODUMP, IMMUTABLE) --noacls do not extract/set ACLs --noxattrs do not extract/set xattrs --stdout write all extracted data to stdout --sparse create holes in output sparse file from all-zero chunks :ref:`common_options` | Include/Exclude options -e PATTERN, --exclude PATTERN exclude paths matching PATTERN --exclude-from EXCLUDEFILE read exclude patterns from EXCLUDEFILE, one per line --pattern PATTERN include/exclude paths matching PATTERN --patterns-from PATTERNFILE read include/exclude patterns from PATTERNFILE, one per line --strip-components NUMBER Remove the specified number of leading path elements. Paths with fewer elements will be silently skipped. Description ~~~~~~~~~~~ This command extracts the contents of an archive. By default the entire archive is extracted but a subset of files and directories can be selected by passing a list of ``PATHs`` as arguments. The file selection can further be restricted by using the ``--exclude`` option. For more help on include/exclude patterns, see the :ref:`borg_patterns` command output. By using ``--dry-run``, you can do all extraction steps except actually writing the output data: reading metadata and data chunks from the repo, checking the hash/hmac, decrypting, decompressing. ``--progress`` can be slower than no progress display, since it makes one additional pass over the archive metadata. .. note:: Currently, extract always writes into the current working directory ("."), so make sure you ``cd`` to the right place before calling ``borg extract``. When parent directories are not extracted (because of using file/directory selection or any other reason), borg can not restore parent directories' metadata, e.g. owner, group, permission, etc.././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719958149.7956812 borgbackup-1.4.0/docs/usage/general/0000755000076500000240000000000014641075206015666 5ustar00twstaff././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/general/date-time.rst.inc0000644000076500000240000000045114641074756021052 0ustar00twstaffDate and Time ~~~~~~~~~~~~~ We format date and time conforming to ISO-8601, that is: YYYY-MM-DD and HH:MM:SS (24h clock). For more information about that, see: https://xkcd.com/1179/ Unless otherwise noted, we display local date and time. Internally, we store and process date and time as UTC. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/general/environment.rst.inc0000644000076500000240000003001114641074756021540 0ustar00twstaffEnvironment Variables ~~~~~~~~~~~~~~~~~~~~~ Borg uses some environment variables for automation: General: BORG_REPO When set, use the value to give the default repository location. If a command needs an archive parameter, you can abbreviate as ``::archive``. If a command needs a repository parameter, you can either leave it away or abbreviate as ``::``, if a positional parameter is required. BORG_PASSPHRASE When set, use the value to answer the passphrase question for encrypted repositories. It is used when a passphrase is needed to access an encrypted repo as well as when a new passphrase should be initially set when initializing an encrypted repo. See also BORG_NEW_PASSPHRASE. BORG_PASSCOMMAND When set, use the standard output of the command (trailing newlines are stripped) to answer the passphrase question for encrypted repositories. It is used when a passphrase is needed to access an encrypted repo as well as when a new passphrase should be initially set when initializing an encrypted repo. Note that the command is executed without a shell. So variables, like ``$HOME`` will work, but ``~`` won't. If BORG_PASSPHRASE is also set, it takes precedence. See also BORG_NEW_PASSPHRASE. BORG_PASSPHRASE_FD When set, specifies a file descriptor to read a passphrase from. Programs starting borg may choose to open an anonymous pipe and use it to pass a passphrase. This is safer than passing via BORG_PASSPHRASE, because on some systems (e.g. Linux) environment can be examined by other processes. If BORG_PASSPHRASE or BORG_PASSCOMMAND are also set, they take precedence. BORG_NEW_PASSPHRASE When set, use the value to answer the passphrase question when a **new** passphrase is asked for. This variable is checked first. If it is not set, BORG_PASSPHRASE and BORG_PASSCOMMAND will also be checked. Main usecase for this is to fully automate ``borg change-passphrase``. BORG_DISPLAY_PASSPHRASE When set, use the value to answer the "display the passphrase for verification" question when defining a new passphrase for encrypted repositories. BORG_EXIT_CODES When set to "modern", the borg process will return more specific exit codes (rc). Default is "legacy" and returns rc 2 for all errors, 1 for all warnings, 0 for success. BORG_HOST_ID Borg usually computes a host id from the FQDN plus the results of ``uuid.getnode()`` (which usually returns a unique id based on the MAC address of the network interface. Except if that MAC happens to be all-zero - in that case it returns a random value, which is not what we want (because it kills automatic stale lock removal). So, if you have a all-zero MAC address or other reasons to better externally control the host id, just set this environment variable to a unique value. If all your FQDNs are unique, you can just use the FQDN. If not, use fqdn@uniqueid. BORG_LOGGING_CONF When set, use the given filename as INI_-style logging configuration. A basic example conf can be found at ``docs/misc/logging.conf``. BORG_RSH When set, use this command instead of ``ssh``. This can be used to specify ssh options, such as a custom identity file ``ssh -i /path/to/private/key``. See ``man ssh`` for other options. Using the ``--rsh CMD`` commandline option overrides the environment variable. BORG_REMOTE_PATH When set, use the given path as borg executable on the remote (defaults to "borg" if unset). Using ``--remote-path PATH`` commandline option overrides the environment variable. BORG_FILES_CACHE_SUFFIX When set to a value at least one character long, instructs borg to use a specifically named (based on the suffix) alternative files cache. This can be used to avoid loading and saving cache entries for backup sources other than the current sources. BORG_FILES_CACHE_TTL When set to a numeric value, this determines the maximum "time to live" for the files cache entries (default: 20). The files cache is used to quickly determine whether a file is unchanged. The FAQ explains this more detailed in: :ref:`always_chunking` BORG_SHOW_SYSINFO When set to no (default: yes), system information (like OS, Python version, ...) in exceptions is not shown. Please only use for good reasons as it makes issues harder to analyze. BORG_FUSE_IMPL Choose the lowlevel FUSE implementation borg shall use for ``borg mount``. This is a comma-separated list of implementation names, they are tried in the given order, e.g.: - ``pyfuse3,llfuse``: default, first try to load pyfuse3, then try to load llfuse. - ``llfuse,pyfuse3``: first try to load llfuse, then try to load pyfuse3. - ``pyfuse3``: only try to load pyfuse3 - ``llfuse``: only try to load llfuse - ``none``: do not try to load an implementation BORG_SELFTEST This can be used to influence borg's builtin self-tests. The default is to execute the tests at the beginning of each borg command invocation. BORG_SELFTEST=disabled can be used to switch off the tests and rather save some time. Disabling is not recommended for normal borg users, but large scale borg storage providers can use this to optimize production servers after at least doing a one-time test borg (with selftests not disabled) when installing or upgrading machines / OS / borg. BORG_WORKAROUNDS A list of comma separated strings that trigger workarounds in borg, e.g. to work around bugs in other software. Currently known strings are: basesyncfile Use the more simple BaseSyncFile code to avoid issues with sync_file_range. You might need this to run borg on WSL (Windows Subsystem for Linux) or in systemd.nspawn containers on some architectures (e.g. ARM). Using this does not affect data safety, but might result in a more bursty write to disk behaviour (not continuously streaming to disk). retry_erofs Retry opening a file without O_NOATIME if opening a file with O_NOATIME caused EROFS. You will need this to make archives from volume shadow copies in WSL1 (Windows Subsystem for Linux 1). authenticated_no_key Work around a lost passphrase or key for an ``authenticated`` mode repository (these are only authenticated, but not encrypted). If the key is missing in the repository config, add ``key = anything`` there. This workaround is **only** for emergencies and **only** to extract data from an affected repository (read-only access):: BORG_WORKAROUNDS=authenticated_no_key borg extract repo::archive After you have extracted all data you need, you MUST delete the repository:: BORG_WORKAROUNDS=authenticated_no_key borg delete repo Now you can init a fresh repo. Make sure you do not use the workaround any more. ignore_invalid_archive_tam Work around invalid archive TAMs created by borg < 1.2.5, see :issue:`7791`. This workaround likely needs to get used only once when following the upgrade instructions for CVE-2023-36811, see :ref:`archives_tam_vuln`. In normal production operations, this workaround should never be used. Some automatic "answerers" (if set, they automatically answer confirmation questions): BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=no (or =yes) For "Warning: Attempting to access a previously unknown unencrypted repository" BORG_RELOCATED_REPO_ACCESS_IS_OK=no (or =yes) For "Warning: The repository at location ... was previously located at ..." BORG_CHECK_I_KNOW_WHAT_I_AM_DOING=NO (or =YES) For "This is a potentially dangerous function..." (check --repair) BORG_DELETE_I_KNOW_WHAT_I_AM_DOING=NO (or =YES) For "You requested to completely DELETE the repository *including* all archives it contains:" Note: answers are case sensitive. setting an invalid answer value might either give the default answer or ask you interactively, depending on whether retries are allowed (they by default are allowed). So please test your scripts interactively before making them a non-interactive script. .. _XDG env var: https://specifications.freedesktop.org/basedir-spec/0.6/ar01s03.html Directories and files: BORG_BASE_DIR Defaults to ``$HOME`` or ``~$USER`` or ``~`` (in that order). If you want to move all borg-specific folders to a custom path at once, all you need to do is to modify ``BORG_BASE_DIR``: the other paths for cache, config etc. will adapt accordingly (assuming you didn't set them to a different custom value). BORG_CACHE_DIR Defaults to ``$BORG_BASE_DIR/.cache/borg``. If ``BORG_BASE_DIR`` is not explicitly set while `XDG env var`_ ``XDG_CACHE_HOME`` is set, then ``$XDG_CACHE_HOME/borg`` is being used instead. This directory contains the local cache and might need a lot of space for dealing with big repositories. Make sure you're aware of the associated security aspects of the cache location: :ref:`cache_security` BORG_CONFIG_DIR Defaults to ``$BORG_BASE_DIR/.config/borg``. If ``BORG_BASE_DIR`` is not explicitly set while `XDG env var`_ ``XDG_CONFIG_HOME`` is set, then ``$XDG_CONFIG_HOME/borg`` is being used instead. This directory contains all borg configuration directories, see the FAQ for a security advisory about the data in this directory: :ref:`home_config_borg` BORG_SECURITY_DIR Defaults to ``$BORG_CONFIG_DIR/security``. This directory contains information borg uses to track its usage of NONCES ("numbers used once" - usually in encryption context) and other security relevant data. BORG_KEYS_DIR Defaults to ``$BORG_CONFIG_DIR/keys``. This directory contains keys for encrypted repositories. BORG_KEY_FILE When set, use the given path as repository key file. Please note that this is only for rather special applications that externally fully manage the key files: - this setting only applies to the keyfile modes (not to the repokey modes). - using a full, absolute path to the key file is recommended. - all directories in the given path must exist. - this setting forces borg to use the key file at the given location. - the key file must either exist (for most commands) or will be created (``borg init``). - you need to give a different path for different repositories. - you need to point to the correct key file matching the repository the command will operate on. TMPDIR This is where temporary files are stored (might need a lot of temporary space for some operations), see tempfile_ for details. Building: BORG_OPENSSL_PREFIX Adds given OpenSSL header file directory to the default locations (setup.py). BORG_LIBLZ4_PREFIX Adds given prefix directory to the default locations. If a 'include/lz4.h' is found Borg will be linked against the system liblz4 instead of a bundled implementation. (setup.py) BORG_LIBZSTD_PREFIX Adds given prefix directory to the default locations. If a 'include/zstd.h' is found Borg will be linked against the system libzstd instead of a bundled implementation. (setup.py) Please note: - Be very careful when using the "yes" sayers, the warnings with prompt exist for your / your data's security/safety. - Also be very careful when putting your passphrase into a script, make sure it has appropriate file permissions (e.g. mode 600, root:root). .. _INI: https://docs.python.org/3/library/logging.config.html#configuration-file-format .. _tempfile: https://docs.python.org/3/library/tempfile.html#tempfile.gettempdir ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/general/file-metadata.rst.inc0000644000076500000240000000577414641074756021713 0ustar00twstaffSupport for file metadata ~~~~~~~~~~~~~~~~~~~~~~~~~ Besides regular file and directory structures, Borg can preserve * symlinks (stored as symlink, the symlink is not followed) * special files: * character and block device files (restored via mknod) * FIFOs ("named pipes") * special file *contents* can be backed up in ``--read-special`` mode. By default the metadata to create them with mknod(2), mkfifo(2) etc. is stored. * hardlinked regular files, devices, FIFOs (considering all items in the same archive) * timestamps in nanosecond precision: mtime, atime, ctime * other timestamps: birthtime (on platforms supporting it) * permissions: * IDs of owning user and owning group * names of owning user and owning group (if the IDs can be resolved) * Unix Mode/Permissions (u/g/o permissions, suid, sgid, sticky) On some platforms additional features are supported: .. Yes/No's are grouped by reason/mechanism/reference. +-------------------------+----------+-----------+------------+ | Platform | ACLs | xattr | Flags | | | [#acls]_ | [#xattr]_ | [#flags]_ | +=========================+==========+===========+============+ | Linux | Yes | Yes | Yes [1]_ | +-------------------------+----------+-----------+------------+ | macOS | Yes | Yes | Yes (all) | +-------------------------+----------+-----------+------------+ | FreeBSD | Yes | Yes | Yes (all) | +-------------------------+----------+-----------+------------+ | OpenBSD | n/a | n/a | Yes (all) | +-------------------------+----------+-----------+------------+ | NetBSD | n/a | No [2]_ | Yes (all) | +-------------------------+----------+-----------+------------+ | Solaris and derivatives | No [3]_ | No [3]_ | n/a | +-------------------------+----------+-----------+------------+ | Windows (cygwin) | No [4]_ | No | No | +-------------------------+----------+-----------+------------+ Other Unix-like operating systems may work as well, but have not been tested at all. Note that most of the platform-dependent features also depend on the file system. For example, ntfs-3g on Linux isn't able to convey NTFS ACLs. .. [1] Only "nodump", "immutable", "compressed" and "append" are supported. Feature request :issue:`618` for more flags. .. [2] Feature request :issue:`1332` .. [3] Feature request :issue:`1337` .. [4] Cygwin tries to map NTFS ACLs to permissions with varying degrees of success. .. [#acls] The native access control list mechanism of the OS. This normally limits access to non-native ACLs. For example, NTFS ACLs aren't completely accessible on Linux with ntfs-3g. .. [#xattr] extended attributes; key-value pairs attached to a file, mainly used by the OS. This includes resource forks on Mac OS X. .. [#flags] aka *BSD flags*. The Linux set of flags [1]_ is portable across platforms. The BSDs define additional flags. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/general/file-systems.rst.inc0000644000076500000240000000275214641074756021633 0ustar00twstaffFile systems ~~~~~~~~~~~~ We strongly recommend against using Borg (or any other database-like software) on non-journaling file systems like FAT, since it is not possible to assume any consistency in case of power failures (or a sudden disconnect of an external drive or similar failures). While Borg uses a data store that is resilient against these failures when used on journaling file systems, it is not possible to guarantee this with some hardware -- independent of the software used. We don't know a list of affected hardware. If you are suspicious whether your Borg repository is still consistent and readable after one of the failures mentioned above occurred, run ``borg check --verify-data`` to make sure it is consistent. .. rubric:: Requirements for Borg repository file systems - Long file names - At least three directory levels with short names - Typically, file sizes up to a few hundred MB. Large repositories may require large files (>2 GB). - Up to 1000 files per directory. - rename(2) / MoveFile(Ex) should work as specified, i.e. on the same file system it should be a move (not a copy) operation, and in case of a directory it should fail if the destination exists and is not an empty directory, since this is used for locking. - Hardlinks are needed for :ref:`borg_upgrade` (if ``--inplace`` option is not used). Also hardlinks are used for more safe and secure file updating (e.g. of the repo config file), but the code tries to work also if hardlinks are not supported. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/general/logging.rst.inc0000644000076500000240000000320214641074756020624 0ustar00twstaffLogging ~~~~~~~ Borg writes all log output to stderr by default. But please note that something showing up on stderr does *not* indicate an error condition just because it is on stderr. Please check the log levels of the messages and the return code of borg for determining error, warning or success conditions. If you want to capture the log output to a file, just redirect it: :: borg create repo::archive myfiles 2>> logfile Custom logging configurations can be implemented via BORG_LOGGING_CONF. The log level of the builtin logging configuration defaults to WARNING. This is because we want Borg to be mostly silent and only output warnings, errors and critical messages, unless output has been requested by supplying an option that implies output (e.g. ``--list`` or ``--progress``). Log levels: DEBUG < INFO < WARNING < ERROR < CRITICAL Use ``--debug`` to set DEBUG log level - to get debug, info, warning, error and critical level output. Use ``--info`` (or ``-v`` or ``--verbose``) to set INFO log level - to get info, warning, error and critical level output. Use ``--warning`` (default) to set WARNING log level - to get warning, error and critical level output. Use ``--error`` to set ERROR log level - to get error and critical level output. Use ``--critical`` to set CRITICAL log level - to get critical level output. While you can set misc. log levels, do not expect that every command will give different output on different log levels - it's just a possibility. .. warning:: Options ``--critical`` and ``--error`` are provided for completeness, their usage is not recommended as you might miss important information. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/general/positional-arguments.rst.inc0000644000076500000240000000120514641074756023363 0ustar00twstaffPositional Arguments and Options: Order matters ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Borg only supports taking options (``-s`` and ``--progress`` in the example) to the left or right of all positional arguments (``repo::archive`` and ``path`` in the example), but not in between them: :: borg create -s --progress repo::archive path # good and preferred borg create repo::archive path -s --progress # also works borg create -s repo::archive path --progress # works, but ugly borg create repo::archive -s --progress path # BAD This is due to a problem in the argparse module: https://bugs.python.org/issue15112 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/general/repository-locations.rst.inc0000644000076500000240000000112514641074756023410 0ustar00twstaffRepository / Archive Locations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Many commands want either a repository (just give the repo URL, see above) or an archive location, which is a repo URL followed by ``::archive_name``. Archive names must not contain the ``/`` (slash) character. For simplicity, maybe also avoid blanks or other characters that have special meaning on the shell or in a filesystem (borg mount will use the archive name as directory name). If you have set BORG_REPO (see above) and an archive location is needed, use ``::archive_name`` - the repo URL part is then read from BORG_REPO. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/general/repository-urls.rst.inc0000644000076500000240000000350614641074756022407 0ustar00twstaffRepository URLs ~~~~~~~~~~~~~~~ **Local filesystem** (or locally mounted network filesystem): ``/path/to/repo`` - filesystem path to repo directory, absolute path ``path/to/repo`` - filesystem path to repo directory, relative path Also, stuff like ``~/path/to/repo`` or ``~other/path/to/repo`` works (this is expanded by your shell). Note: you may also prepend a ``file://`` to a filesystem path to get URL style. **Remote repositories** accessed via ssh user@host: ``user@host:/path/to/repo`` - remote repo, absolute path ``ssh://user@host:port/path/to/repo`` - same, alternative syntax, port can be given **Remote repositories with relative paths** can be given using this syntax: ``user@host:path/to/repo`` - path relative to current directory ``user@host:~/path/to/repo`` - path relative to user's home directory ``user@host:~other/path/to/repo`` - path relative to other's home directory Note: giving ``user@host:/./path/to/repo`` or ``user@host:/~/path/to/repo`` or ``user@host:/~other/path/to/repo`` is also supported, but not required here. **Remote repositories with relative paths, alternative syntax with port**: ``ssh://user@host:port/./path/to/repo`` - path relative to current directory ``ssh://user@host:port/~/path/to/repo`` - path relative to user's home directory ``ssh://user@host:port/~other/path/to/repo`` - path relative to other's home directory If you frequently need the same repo URL, it is a good idea to set the ``BORG_REPO`` environment variable to set a default for the repo URL: :: export BORG_REPO='ssh://user@host:port/path/to/repo' Then just leave away the repo URL if only a repo URL is needed and you want to use the default - it will be read from BORG_REPO then. Use ``::`` syntax to give the repo URL when syntax requires giving a positional argument for the repo (e.g. ``borg mount :: /mnt``). ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/general/resources.rst.inc0000644000076500000240000001101414641074756021210 0ustar00twstaffResource Usage ~~~~~~~~~~~~~~ Borg might use a lot of resources depending on the size of the data set it is dealing with. If one uses Borg in a client/server way (with a ssh: repository), the resource usage occurs in part on the client and in another part on the server. If one uses Borg as a single process (with a filesystem repo), all the resource usage occurs in that one process, so just add up client + server to get the approximate resource usage. CPU client: - **borg create:** does chunking, hashing, compression, crypto (high CPU usage) - **chunks cache sync:** quite heavy on CPU, doing lots of hashtable operations. - **borg extract:** crypto, decompression (medium to high CPU usage) - **borg check:** similar to extract, but depends on options given. - **borg prune / borg delete archive:** low to medium CPU usage - **borg delete repo:** done on the server It won't go beyond 100% of 1 core as the code is currently single-threaded. Especially higher zlib and lzma compression levels use significant amounts of CPU cycles. Crypto might be cheap on the CPU (if hardware accelerated) or expensive (if not). CPU server: It usually doesn't need much CPU, it just deals with the key/value store (repository) and uses the repository index for that. borg check: the repository check computes the checksums of all chunks (medium CPU usage) borg delete repo: low CPU usage CPU (only for client/server operation): When using borg in a client/server way with a ssh:-type repo, the ssh processes used for the transport layer will need some CPU on the client and on the server due to the crypto they are doing - esp. if you are pumping big amounts of data. Memory (RAM) client: The chunks index and the files index are read into memory for performance reasons. Might need big amounts of memory (see below). Compression, esp. lzma compression with high levels might need substantial amounts of memory. Memory (RAM) server: The server process will load the repository index into memory. Might need considerable amounts of memory, but less than on the client (see below). Chunks index (client only): Proportional to the amount of data chunks in your repo. Lots of chunks in your repo imply a big chunks index. It is possible to tweak the chunker params (see create options). Files index (client only): Proportional to the amount of files in your last backups. Can be switched off (see create options), but next backup might be much slower if you do. The speed benefit of using the files cache is proportional to file size. Repository index (server only): Proportional to the amount of data chunks in your repo. Lots of chunks in your repo imply a big repository index. It is possible to tweak the chunker params (see create options) to influence the amount of chunks being created. Temporary files (client): Reading data and metadata from a FUSE mounted repository will consume up to the size of all deduplicated, small chunks in the repository. Big chunks won't be locally cached. Temporary files (server): A non-trivial amount of data will be stored on the remote temp directory for each client that connects to it. For some remotes, this can fill the default temporary directory at /tmp. This can be remediated by ensuring the $TMPDIR, $TEMP, or $TMP environment variable is properly set for the sshd process. For some OSes, this can be done just by setting the correct value in the .bashrc (or equivalent login config file for other shells), however in other cases it may be necessary to first enable ``PermitUserEnvironment yes`` in your ``sshd_config`` file, then add ``environment="TMPDIR=/my/big/tmpdir"`` at the start of the public key to be used in the ``authorized_hosts`` file. Cache files (client only): Contains the chunks index and files index (plus a collection of single- archive chunk indexes which might need huge amounts of disk space, depending on archive count and size - see FAQ about how to reduce). Network (only for client/server operation): If your repository is remote, all deduplicated (and optionally compressed/ encrypted) data of course has to go over the connection (``ssh://`` repo url). If you use a locally mounted network filesystem, additionally some copy operations used for transaction support also go over the connection. If you backup multiple sources to one target repository, additional traffic happens for cache resynchronization. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/general/return-codes.rst.inc0000644000076500000240000000141214641074756021611 0ustar00twstaffReturn codes ~~~~~~~~~~~~ Borg can exit with the following return codes (rc): =========== ======= Return code Meaning =========== ======= 0 success (logged as INFO) 1 generic warning (operation reached its normal end, but there were warnings -- you should check the log, logged as WARNING) 2 generic error (like a fatal error, a local or remote exception, the operation did not reach its normal end, logged as ERROR) 3..99 specific error (enabled by BORG_EXIT_CODES=modern) 100..127 specific warning (enabled by BORG_EXIT_CODES=modern) 128+N killed by signal N (e.g. 137 == kill -9) =========== ======= If you use ``--show-rc``, the return code is also logged at the indicated level as the last log entry. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/general/units.rst.inc0000644000076500000240000000076314641074756020351 0ustar00twstaffUnits ~~~~~ To display quantities, Borg takes care of respecting the usual conventions of scale. Disk sizes are displayed in `decimal `_, using powers of ten (so ``kB`` means 1000 bytes). For memory usage, `binary prefixes `_ are used, and are indicated using the `IEC binary prefixes `_, using powers of two (so ``KiB`` means 1024 bytes). ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/general.rst0000644000076500000240000000361514641074756016436 0ustar00twstaffGeneral ------- Borg consists of a number of commands. Each command accepts a number of arguments and options and interprets various environment variables. The following sections will describe each command in detail. Commands, options, parameters, paths and such are ``set in fixed-width``. Option values are `underlined`. Borg has few options accepting a fixed set of values (e.g. ``--encryption`` of :ref:`borg_init`). .. container:: experimental Experimental features are marked with red stripes on the sides, like this paragraph. Experimental features are not stable, which means that they may be changed in incompatible ways or even removed entirely without prior notice in following releases. .. include:: usage_general.rst.inc In case you are interested in more details (like formulas), please see :ref:`internals`. For details on the available JSON output, refer to :ref:`json_output`. .. _common_options: Common options ~~~~~~~~~~~~~~ All Borg commands share these options: .. include:: common-options.rst.inc Option ``--bypass-lock`` allows you to access the repository while bypassing borg's locking mechanism. This is necessary if your repository is on a read-only storage where you don't have write permissions or capabilities and therefore cannot create a lock. Examples are repositories stored on a Bluray disc or a read-only network storage. Avoid this option if you are able to use locks as that is the safer way; see the warning below. .. warning:: If you do use ``--bypass-lock``, you are responsible to ensure that no other borg instances have write access to the repository. Otherwise, you might experience errors and read broken data if changes to that repository are being made at the same time. Examples ~~~~~~~~ :: # Create an archive and log: borg version, files list, return code $ borg create --show-version --list --show-rc /path/to/repo::my-files files ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/help.rst0000644000076500000240000000010114641074756015734 0ustar00twstaffMiscellaneous Help ------------------ .. include:: help.rst.inc ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/help.rst.inc0000644000076500000240000004077114641074756016525 0ustar00twstaff.. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit! .. _borg_patterns: borg help patterns ~~~~~~~~~~~~~~~~~~ The path/filenames used as input for the pattern matching start from the currently active recursion root. You usually give the recursion root(s) when invoking borg and these can be either relative or absolute paths. Starting with Borg 1.2, paths that are matched against patterns always appear relative. If you give ``/absolute/`` as root, the paths going into the matcher will start with ``absolute/``. If you give ``../../relative`` as root, the paths will be normalized as ``relative/``. A directory exclusion pattern can end either with or without a slash ('/'). If it ends with a slash, such as `some/path/`, the directory will be included but not its content. If it does not end with a slash, such as `some/path`, both the directory and content will be excluded. Borg supports different pattern styles. To define a non-default style for a specific pattern, prefix it with two characters followed by a colon ':' (i.e. ``fm:path/*``, ``sh:path/**``). `Fnmatch `_, selector `fm:` This is the default style for ``--exclude`` and ``--exclude-from``. These patterns use a variant of shell pattern syntax, with '\*' matching any number of characters, '?' matching any single character, '[...]' matching any single character specified, including ranges, and '[!...]' matching any character not specified. For the purpose of these patterns, the path separator (backslash for Windows and '/' on other systems) is not treated specially. Wrap meta-characters in brackets for a literal match (i.e. `[?]` to match the literal character `?`). For a path to match a pattern, the full path must match, or it must match from the start of the full path to just before a path separator. Except for the root path, paths will never end in the path separator when matching is attempted. Thus, if a given pattern ends in a path separator, a '\*' is appended before matching is attempted. A leading path separator is always removed. Shell-style patterns, selector `sh:` This is the default style for ``--pattern`` and ``--patterns-from``. Like fnmatch patterns these are similar to shell patterns. The difference is that the pattern may include `**/` for matching zero or more directory levels, `*` for matching zero or more arbitrary characters with the exception of any path separator. A leading path separator is always removed. Regular expressions, selector `re:` Regular expressions similar to those found in Perl are supported. Unlike shell patterns regular expressions are not required to match the full path and any substring match is sufficient. It is strongly recommended to anchor patterns to the start ('^'), to the end ('$') or both. Path separators (backslash for Windows and '/' on other systems) in paths are always normalized to a forward slash ('/') before applying a pattern. The regular expression syntax is described in the `Python documentation for the re module `_. Path prefix, selector `pp:` This pattern style is useful to match whole sub-directories. The pattern `pp:root/somedir` matches `root/somedir` and everything therein. A leading path separator is always removed. Path full-match, selector `pf:` This pattern style is (only) useful to match full paths. This is kind of a pseudo pattern as it can not have any variable or unspecified parts - the full path must be given. `pf:root/file.ext` matches `root/file.ext` only. A leading path separator is always removed. Implementation note: this is implemented via very time-efficient O(1) hashtable lookups (this means you can have huge amounts of such patterns without impacting performance much). Due to that, this kind of pattern does not respect any context or order. If you use such a pattern to include a file, it will always be included (if the directory recursion encounters it). Other include/exclude patterns that would normally match will be ignored. Same logic applies for exclude. .. note:: `re:`, `sh:` and `fm:` patterns are all implemented on top of the Python SRE engine. It is very easy to formulate patterns for each of these types which requires an inordinate amount of time to match paths. If untrusted users are able to supply patterns, ensure they cannot supply `re:` patterns. Further, ensure that `sh:` and `fm:` patterns only contain a handful of wildcards at most. Exclusions can be passed via the command line option ``--exclude``. When used from within a shell, the patterns should be quoted to protect them from expansion. The ``--exclude-from`` option permits loading exclusion patterns from a text file with one pattern per line. Lines empty or starting with the number sign ('#') after removing whitespace on both ends are ignored. The optional style selector prefix is also supported for patterns loaded from a file. Due to whitespace removal, paths with whitespace at the beginning or end can only be excluded using regular expressions. To test your exclusion patterns without performing an actual backup you can run ``borg create --list --dry-run ...``. Examples:: # Exclude '/home/user/file.o' but not '/home/user/file.odt': $ borg create -e '*.o' backup / # Exclude '/home/user/junk' and '/home/user/subdir/junk' but # not '/home/user/importantjunk' or '/etc/junk': $ borg create -e 'home/*/junk' backup / # Exclude the contents of '/home/user/cache' but not the directory itself: $ borg create -e home/user/cache/ backup / # The file '/home/user/cache/important' is *not* backed up: $ borg create -e home/user/cache/ backup / /home/user/cache/important # The contents of directories in '/home' are not backed up when their name # ends in '.tmp' $ borg create --exclude 're:^home/[^/]+\.tmp/' backup / # Load exclusions from file $ cat >exclude.txt <`_, e.g. {now:%Y-%m-%d_%H:%M:%S} {utcnow} The current UTC date and time, by default in ISO-8601 format. You can also supply your own `format string `_, e.g. {utcnow:%Y-%m-%d_%H:%M:%S} {user} The user name (or UID, if no name is available) of the user running borg. {pid} The current process ID. {borgversion} The version of borg, e.g.: 1.0.8rc1 {borgmajor} The version of borg, only the major version, e.g.: 1 {borgminor} The version of borg, only major and minor version, e.g.: 1.0 {borgpatch} The version of borg, only major, minor and patch version, e.g.: 1.0.8 If literal curly braces need to be used, double them for escaping:: borg create /path/to/repo::{{literal_text}} Examples:: borg create /path/to/repo::{hostname}-{user}-{utcnow} ... borg create /path/to/repo::{hostname}-{now:%Y-%m-%d_%H:%M:%S} ... borg prune --glob-archives '{hostname}-*' ... .. note:: systemd uses a difficult, non-standard syntax for command lines in unit files (refer to the `systemd.unit(5)` manual page). When invoking borg from unit files, pay particular attention to escaping, especially when using the now/utcnow placeholders, since systemd performs its own %-based variable replacement even in quoted text. To avoid interference from systemd, double all percent signs (``{hostname}-{now:%Y-%m-%d_%H:%M:%S}`` becomes ``{hostname}-{now:%%Y-%%m-%%d_%%H:%%M:%%S}``). .. _borg_compression: borg help compression ~~~~~~~~~~~~~~~~~~~~~ It is no problem to mix different compression methods in one repo, deduplication is done on the source data chunks (not on the compressed or encrypted data). If some specific chunk was once compressed and stored into the repo, creating another backup that also uses this chunk will not change the stored chunk. So if you use different compression specs for the backups, whichever stores a chunk first determines its compression. See also borg recreate. Compression is lz4 by default. If you want something else, you have to specify what you want. Valid compression specifiers are: none Do not compress. lz4 Use lz4 compression. Very high speed, very low compression. (default) zstd[,L] Use zstd ("zstandard") compression, a modern wide-range algorithm. If you do not explicitly give the compression level L (ranging from 1 to 22), it will use level 3. Archives compressed with zstd are not compatible with borg < 1.1.4. zlib[,L] Use zlib ("gz") compression. Medium speed, medium compression. If you do not explicitly give the compression level L (ranging from 0 to 9), it will use level 6. Giving level 0 (means "no compression", but still has zlib protocol overhead) is usually pointless, you better use "none" compression. lzma[,L] Use lzma ("xz") compression. Low speed, high compression. If you do not explicitly give the compression level L (ranging from 0 to 9), it will use level 6. Giving levels above 6 is pointless and counterproductive because it does not compress better due to the buffer size used by borg - but it wastes lots of CPU cycles and RAM. auto,C[,L] Use a built-in heuristic to decide per chunk whether to compress or not. The heuristic tries with lz4 whether the data is compressible. For incompressible data, it will not use compression (uses "none"). For compressible data, it uses the given C[,L] compression - with C[,L] being any valid compression specifier. obfuscate,SPEC,C[,L] Use compressed-size obfuscation to make fingerprinting attacks based on the observable stored chunk size more difficult. Note: - You must combine this with encryption, or it won't make any sense. - Your repo size will be bigger, of course. - A chunk is limited by the constant ``MAX_DATA_SIZE`` (cur. ~20MiB). The SPEC value determines how the size obfuscation works: *Relative random reciprocal size variation* (multiplicative) Size will increase by a factor, relative to the compressed data size. Smaller factors are used often, larger factors rarely. Available factors:: 1: 0.01 .. 100 2: 0.1 .. 1,000 3: 1 .. 10,000 4: 10 .. 100,000 5: 100 .. 1,000,000 6: 1,000 .. 10,000,000 Example probabilities for SPEC ``1``:: 90 % 0.01 .. 0.1 9 % 0.1 .. 1 0.9 % 1 .. 10 0.09% 10 .. 100 *Randomly sized padding up to the given size* (additive) :: 110: 1kiB (2 ^ (SPEC - 100)) ... 120: 1MiB ... 123: 8MiB (max.) Examples:: borg create --compression lz4 REPO::ARCHIVE data borg create --compression zstd REPO::ARCHIVE data borg create --compression zstd,10 REPO::ARCHIVE data borg create --compression zlib REPO::ARCHIVE data borg create --compression zlib,1 REPO::ARCHIVE data borg create --compression auto,lzma,6 REPO::ARCHIVE data borg create --compression auto,lzma ... borg create --compression obfuscate,110,none ... borg create --compression obfuscate,3,auto,zstd,10 ... borg create --compression obfuscate,2,zstd,6 ... ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/import-tar.rst.inc0000644000076500000240000003022514641074756017664 0ustar00twstaff.. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit! .. _borg_import-tar: borg import-tar --------------- .. code-block:: none borg [common options] import-tar [options] ARCHIVE TARFILE .. only:: html .. class:: borg-options-table +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | **positional arguments** | +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | | ``ARCHIVE`` | name of archive to create (must be also a valid directory name) | +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | | ``TARFILE`` | input tar file. "-" to read from stdin instead. | +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | **optional arguments** | +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | | ``--tar-filter`` | filter program to pipe data through | +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | | ``-s``, ``--stats`` | print statistics for the created archive | +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | | ``--list`` | output verbose list of items (files, dirs, ...) | +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | | ``--filter STATUSCHARS`` | only display items with the given status characters | +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | | ``--json`` | output stats as JSON (implies --stats) | +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | | ``--ignore-zeros`` | ignore zero-filled blocks in the input tarball | +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | .. class:: borg-common-opt-ref | | | | :ref:`common_options` | +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | **Archive options** | +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | | ``--comment COMMENT`` | add a comment text to the archive | +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | | ``--timestamp TIMESTAMP`` | manually specify the archive creation date/time (UTC, yyyy-mm-ddThh:mm:ss format). alternatively, give a reference file/directory. | +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | | ``-c SECONDS``, ``--checkpoint-interval SECONDS`` | write checkpoint every SECONDS seconds (Default: 1800) | +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | | ``--chunker-params PARAMS`` | specify the chunker parameters (ALGO, CHUNK_MIN_EXP, CHUNK_MAX_EXP, HASH_MASK_BITS, HASH_WINDOW_SIZE). default: buzhash,19,23,21,4095 | +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | | ``-C COMPRESSION``, ``--compression COMPRESSION`` | select compression algorithm, see the output of the "borg help compression" command for details. | +-------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ .. raw:: html .. only:: latex ARCHIVE name of archive to create (must be also a valid directory name) TARFILE input tar file. "-" to read from stdin instead. optional arguments --tar-filter filter program to pipe data through -s, --stats print statistics for the created archive --list output verbose list of items (files, dirs, ...) --filter STATUSCHARS only display items with the given status characters --json output stats as JSON (implies --stats) --ignore-zeros ignore zero-filled blocks in the input tarball :ref:`common_options` | Archive options --comment COMMENT add a comment text to the archive --timestamp TIMESTAMP manually specify the archive creation date/time (UTC, yyyy-mm-ddThh:mm:ss format). alternatively, give a reference file/directory. -c SECONDS, --checkpoint-interval SECONDS write checkpoint every SECONDS seconds (Default: 1800) --chunker-params PARAMS specify the chunker parameters (ALGO, CHUNK_MIN_EXP, CHUNK_MAX_EXP, HASH_MASK_BITS, HASH_WINDOW_SIZE). default: buzhash,19,23,21,4095 -C COMPRESSION, --compression COMPRESSION select compression algorithm, see the output of the "borg help compression" command for details. Description ~~~~~~~~~~~ This command creates a backup archive from a tarball. When giving '-' as path, Borg will read a tar stream from standard input. By default (--tar-filter=auto) Borg will detect whether the file is compressed based on its file extension and pipe the file through an appropriate filter: - .tar.gz or .tgz: gzip -d - .tar.bz2 or .tbz: bzip2 -d - .tar.xz or .txz: xz -d - .tar.zstd or .tar.zst: zstd -d - .tar.lz4: lz4 -d Alternatively, a --tar-filter program may be explicitly specified. It should read compressed data from stdin and output an uncompressed tar stream on stdout. Most documentation of borg create applies. Note that this command does not support excluding files. import-tar is a lossy conversion: BSD flags, ACLs, extended attributes (xattrs), atime and ctime are not exported. Timestamp resolution is limited to whole seconds, not the nanosecond resolution otherwise supported by Borg. A ``--sparse`` option (as found in borg create) is not supported. import-tar reads POSIX.1-1988 (ustar), POSIX.1-2001 (pax), GNU tar, UNIX V7 tar and SunOS tar with extended attributes. To import multiple tarballs into a single archive, they can be simply concatenated (e.g. using "cat") into a single file, and imported with an ``--ignore-zeros`` option to skip through the stop markers between them.././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/info.rst0000644000076500000240000000521214641074756015747 0ustar00twstaff.. include:: info.rst.inc Examples ~~~~~~~~ :: $ borg info /path/to/repo::2017-06-29T11:00-srv Archive name: 2017-06-29T11:00-srv Archive fingerprint: b2f1beac2bd553b34e06358afa45a3c1689320d39163890c5bbbd49125f00fe5 Comment: Hostname: myhostname Username: root Time (start): Thu, 2017-06-29 11:03:07 Time (end): Thu, 2017-06-29 11:03:13 Duration: 5.66 seconds Number of files: 17037 Command line: /usr/sbin/borg create /path/to/repo::2017-06-29T11:00-srv /srv Utilization of max. archive size: 0% ------------------------------------------------------------------------------ Original size Compressed size Deduplicated size This archive: 12.53 GB 12.49 GB 1.62 kB All archives: 121.82 TB 112.41 TB 215.42 GB Unique chunks Total chunks Chunk index: 1015213 626934122 $ borg info /path/to/repo --last 1 Archive name: 2017-06-29T11:00-srv Archive fingerprint: b2f1beac2bd553b34e06358afa45a3c1689320d39163890c5bbbd49125f00fe5 Comment: Hostname: myhostname Username: root Time (start): Thu, 2017-06-29 11:03:07 Time (end): Thu, 2017-06-29 11:03:13 Duration: 5.66 seconds Number of files: 17037 Command line: /usr/sbin/borg create /path/to/repo::2017-06-29T11:00-srv /srv Utilization of max. archive size: 0% ------------------------------------------------------------------------------ Original size Compressed size Deduplicated size This archive: 12.53 GB 12.49 GB 1.62 kB All archives: 121.82 TB 112.41 TB 215.42 GB Unique chunks Total chunks Chunk index: 1015213 626934122 $ borg info /path/to/repo Repository ID: d857ce5788c51272c61535062e89eac4e8ef5a884ffbe976e0af9d8765dedfa5 Location: /path/to/repo Encrypted: Yes (repokey) Cache: /root/.cache/borg/d857ce5788c51272c61535062e89eac4e8ef5a884ffbe976e0af9d8765dedfa5 Security dir: /root/.config/borg/security/d857ce5788c51272c61535062e89eac4e8ef5a884ffbe976e0af9d8765dedfa5 ------------------------------------------------------------------------------ Original size Compressed size Deduplicated size All archives: 121.82 TB 112.41 TB 215.42 GB Unique chunks Total chunks Chunk index: 1015213 626934122 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/info.rst.inc0000644000076500000240000002050414641074756016520 0ustar00twstaff.. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit! .. _borg_info: borg info --------- .. code-block:: none borg [common options] info [options] [REPOSITORY_OR_ARCHIVE] .. only:: html .. class:: borg-options-table +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | **positional arguments** | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``REPOSITORY_OR_ARCHIVE`` | repository or archive to display information about | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | **optional arguments** | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``--json`` | format output as JSON | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | .. class:: borg-common-opt-ref | | | | :ref:`common_options` | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | **Archive filters** — Archive filters can be applied to repository targets. | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``-P PREFIX``, ``--prefix PREFIX`` | only consider archive names starting with this prefix. (deprecated) | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``-a GLOB``, ``--glob-archives GLOB`` | only consider archive names matching the glob. sh: rules apply (without actually using the sh: prefix), see "borg help patterns". | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``--sort-by KEYS`` | Comma-separated list of sorting keys; valid keys are: timestamp, archive, name, id; default is: timestamp | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``--first N`` | consider first N archives after other filters were applied | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``--last N`` | consider last N archives after other filters were applied | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ .. raw:: html .. only:: latex REPOSITORY_OR_ARCHIVE repository or archive to display information about optional arguments --json format output as JSON :ref:`common_options` | Archive filters -P PREFIX, --prefix PREFIX only consider archive names starting with this prefix. (deprecated) -a GLOB, --glob-archives GLOB only consider archive names matching the glob. sh: rules apply (without actually using the sh: prefix), see "borg help patterns". --sort-by KEYS Comma-separated list of sorting keys; valid keys are: timestamp, archive, name, id; default is: timestamp --first N consider first N archives after other filters were applied --last N consider last N archives after other filters were applied Description ~~~~~~~~~~~ This command displays detailed information about the specified archive or repository. Please note that the deduplicated sizes of the individual archives do not add up to the deduplicated size of the repository ("all archives"), because the two are meaning different things: This archive / deduplicated size = amount of data stored ONLY for this archive = unique chunks of this archive. All archives / deduplicated size = amount of data stored in the repo = all chunks in the repository. Borg archives can only contain a limited amount of file metadata. The size of an archive relative to this limit depends on a number of factors, mainly the number of files, the lengths of paths and other metadata stored for files. This is shown as *utilization of maximum supported archive size*.././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/init.rst0000644000076500000240000000121214641074756015753 0ustar00twstaff.. include:: init.rst.inc Examples ~~~~~~~~ :: # Local repository, repokey encryption, BLAKE2b (often faster, since Borg 1.1) $ borg init --encryption=repokey-blake2 /path/to/repo # Local repository (no encryption) $ borg init --encryption=none /path/to/repo # Remote repository (accesses a remote borg via ssh) # repokey: stores the (encrypted) key into /config $ borg init --encryption=repokey-blake2 user@hostname:backup # Remote repository (accesses a remote borg via ssh) # keyfile: stores the (encrypted) key into ~/.config/borg/keys/ $ borg init --encryption=keyfile user@hostname:backup ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/init.rst.inc0000644000076500000240000003306114641074756016532 0ustar00twstaff.. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit! .. _borg_init: borg init --------- .. code-block:: none borg [common options] init [options] [REPOSITORY] .. only:: html .. class:: borg-options-table +-------------------------------------------------------+------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | **positional arguments** | +-------------------------------------------------------+------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``REPOSITORY`` | repository to create | +-------------------------------------------------------+------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | **optional arguments** | +-------------------------------------------------------+------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``-e MODE``, ``--encryption MODE`` | select encryption key mode **(required)** | +-------------------------------------------------------+------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--append-only`` | create an append-only mode repository. Note that this only affects the low level structure of the repository, and running `delete` or `prune` will still be allowed. See :ref:`append_only_mode` in Additional Notes for more details. | +-------------------------------------------------------+------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--storage-quota QUOTA`` | Set storage quota of the new repository (e.g. 5G, 1.5T). Default: no quota. | +-------------------------------------------------------+------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--make-parent-dirs`` | create the parent directories of the repository directory, if they are missing. | +-------------------------------------------------------+------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | .. class:: borg-common-opt-ref | | | | :ref:`common_options` | +-------------------------------------------------------+------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. raw:: html .. only:: latex REPOSITORY repository to create optional arguments -e MODE, --encryption MODE select encryption key mode **(required)** --append-only create an append-only mode repository. Note that this only affects the low level structure of the repository, and running `delete` or `prune` will still be allowed. See :ref:`append_only_mode` in Additional Notes for more details. --storage-quota QUOTA Set storage quota of the new repository (e.g. 5G, 1.5T). Default: no quota. --make-parent-dirs create the parent directories of the repository directory, if they are missing. :ref:`common_options` | Description ~~~~~~~~~~~ This command initializes an empty repository. A repository is a filesystem directory containing the deduplicated data from zero or more archives. Encryption mode TLDR ++++++++++++++++++++ The encryption mode can only be configured when creating a new repository - you can neither configure it on a per-archive basis nor change the encryption mode of an existing repository. Use ``repokey``:: borg init --encryption repokey /path/to/repo Or ``repokey-blake2`` depending on which is faster on your client machines (see below):: borg init --encryption repokey-blake2 /path/to/repo Borg will: 1. Ask you to come up with a passphrase. 2. Create a borg key (which contains 3 random secrets. See :ref:`key_files`). 3. Encrypt the key with your passphrase. 4. Store the encrypted borg key inside the repository directory (in the repo config). This is why it is essential to use a secure passphrase. 5. Encrypt and sign your backups to prevent anyone from reading or forging them unless they have the key and know the passphrase. Make sure to keep a backup of your key **outside** the repository - do not lock yourself out by "leaving your keys inside your car" (see :ref:`borg_key_export`). For remote backups the encryption is done locally - the remote machine never sees your passphrase, your unencrypted key or your unencrypted files. Chunking and id generation are also based on your key to improve your privacy. 6. Use the key when extracting files to decrypt them and to verify that the contents of the backups have not been accidentally or maliciously altered. Picking a passphrase ++++++++++++++++++++ Make sure you use a good passphrase. Not too short, not too simple. The real encryption / decryption key is encrypted with / locked by your passphrase. If an attacker gets your key, he can't unlock and use it without knowing the passphrase. Be careful with special or non-ascii characters in your passphrase: - Borg processes the passphrase as unicode (and encodes it as utf-8), so it does not have problems dealing with even the strangest characters. - BUT: that does not necessarily apply to your OS / VM / keyboard configuration. So better use a long passphrase made from simple ascii chars than one that includes non-ascii stuff or characters that are hard/impossible to enter on a different keyboard layout. You can change your passphrase for existing repos at any time, it won't affect the encryption/decryption key or other secrets. More encryption modes +++++++++++++++++++++ Only use ``--encryption none`` if you are OK with anyone who has access to your repository being able to read your backups and tamper with their contents without you noticing. If you want "passphrase and having-the-key" security, use ``--encryption keyfile``. The key will be stored in your home directory (in ``~/.config/borg/keys``). If you do **not** want to encrypt the contents of your backups, but still want to detect malicious tampering use ``--encryption authenticated``. To normally work with ``authenticated`` repos, you will need the passphrase, but there is an emergency workaround, see ``BORG_WORKAROUNDS=authenticated_no_key`` docs. If ``BLAKE2b`` is faster than ``SHA-256`` on your hardware, use ``--encryption authenticated-blake2``, ``--encryption repokey-blake2`` or ``--encryption keyfile-blake2``. Note: for remote backups the hashing is done on your local machine. .. nanorst: inline-fill +----------+---------------+------------------------+--------------------------+ | Hash/MAC | Not encrypted | Not encrypted, | Encrypted (AEAD w/ AES) | | | no auth | but authenticated | and authenticated | +----------+---------------+------------------------+--------------------------+ | SHA-256 | none | `authenticated` | repokey | | | | | keyfile | +----------+---------------+------------------------+--------------------------+ | BLAKE2b | n/a | `authenticated-blake2` | `repokey-blake2` | | | | | `keyfile-blake2` | +----------+---------------+------------------------+--------------------------+ .. nanorst: inline-replace Modes `marked like this` in the above table are new in Borg 1.1 and are not backwards-compatible with Borg 1.0.x. On modern Intel/AMD CPUs (except very cheap ones), AES is usually hardware-accelerated. BLAKE2b is faster than SHA256 on Intel/AMD 64-bit CPUs (except AMD Ryzen and future CPUs with SHA extensions), which makes `authenticated-blake2` faster than `none` and `authenticated`. On modern ARM CPUs, NEON provides hardware acceleration for SHA256 making it faster than BLAKE2b-256 there. NEON accelerates AES as well. Hardware acceleration is always used automatically when available. `repokey` and `keyfile` use AES-CTR-256 for encryption and HMAC-SHA256 for authentication in an encrypt-then-MAC (EtM) construction. The chunk ID hash is HMAC-SHA256 as well (with a separate key). These modes are compatible with Borg 1.0.x. `repokey-blake2` and `keyfile-blake2` are also authenticated encryption modes, but use BLAKE2b-256 instead of HMAC-SHA256 for authentication. The chunk ID hash is a keyed BLAKE2b-256 hash. These modes are new and *not* compatible with Borg 1.0.x. `authenticated` mode uses no encryption, but authenticates repository contents through the same HMAC-SHA256 hash as the `repokey` and `keyfile` modes (it uses it as the chunk ID hash). The key is stored like `repokey`. This mode is new and *not* compatible with Borg 1.0.x. `authenticated-blake2` is like `authenticated`, but uses the keyed BLAKE2b-256 hash from the other blake2 modes. This mode is new and *not* compatible with Borg 1.0.x. `none` mode uses no encryption and no authentication. It uses SHA256 as chunk ID hash. This mode is not recommended, you should rather consider using an authenticated or authenticated/encrypted mode. This mode has possible denial-of-service issues when running ``borg create`` on contents controlled by an attacker. Use it only for new repositories where no encryption is wanted **and** when compatibility with 1.0.x is important. If compatibility with 1.0.x is not important, use `authenticated-blake2` or `authenticated` instead. This mode is compatible with Borg 1.0.x.././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/key.rst0000644000076500000240000000272314641074756015610 0ustar00twstaff.. _borg-change-passphrase: .. include:: key_change-passphrase.rst.inc Examples ~~~~~~~~ :: # Create a key file protected repository $ borg init --encryption=keyfile -v /path/to/repo Initializing repository at "/path/to/repo" Enter new passphrase: Enter same passphrase again: Remember your passphrase. Your data will be inaccessible without it. Key in "/root/.config/borg/keys/mnt_backup" created. Keep this key safe. Your data will be inaccessible without it. Synchronizing chunks cache... Archives: 0, w/ cached Idx: 0, w/ outdated Idx: 0, w/o cached Idx: 0. Done. # Change key file passphrase $ borg key change-passphrase -v /path/to/repo Enter passphrase for key /root/.config/borg/keys/mnt_backup: Enter new passphrase: Enter same passphrase again: Remember your passphrase. Your data will be inaccessible without it. Key updated # Import a previously-exported key into the specified # key file (creating or overwriting the output key) # (keyfile repositories only) $ BORG_KEY_FILE=/path/to/output-key borg key import /path/to/repo /path/to/exported Fully automated using environment variables: :: $ BORG_NEW_PASSPHRASE=old borg init -e=repokey repo # now "old" is the current passphrase. $ BORG_PASSPHRASE=old BORG_NEW_PASSPHRASE=new borg key change-passphrase repo # now "new" is the current passphrase. .. include:: key_export.rst.inc .. include:: key_import.rst.inc ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/key_change-passphrase.rst.inc0000644000076500000240000000333414641074756022033 0ustar00twstaff.. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit! .. _borg_key_change-passphrase: borg key change-passphrase -------------------------- .. code-block:: none borg [common options] key change-passphrase [options] [REPOSITORY] .. only:: html .. class:: borg-options-table +-------------------------------------------------------+----------------+--+ | **positional arguments** | +-------------------------------------------------------+----------------+--+ | | ``REPOSITORY`` | | +-------------------------------------------------------+----------------+--+ | .. class:: borg-common-opt-ref | | | | :ref:`common_options` | +-------------------------------------------------------+----------------+--+ .. raw:: html .. only:: latex REPOSITORY :ref:`common_options` | Description ~~~~~~~~~~~ The key files used for repository encryption are optionally passphrase protected. This command can be used to change this passphrase. Please note that this command only changes the passphrase, but not any secret protected by it (like e.g. encryption/MAC keys or chunker seed). Thus, changing the passphrase after passphrase and borg key got compromised does not protect future (nor past) backups to the same repository.././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/key_export.rst.inc0000644000076500000240000001164614641074756017765 0ustar00twstaff.. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit! .. _borg_key_export: borg key export --------------- .. code-block:: none borg [common options] key export [options] [REPOSITORY] [PATH] .. only:: html .. class:: borg-options-table +-------------------------------------------------------+----------------+------------------------------------------------------------------------+ | **positional arguments** | +-------------------------------------------------------+----------------+------------------------------------------------------------------------+ | | ``REPOSITORY`` | | +-------------------------------------------------------+----------------+------------------------------------------------------------------------+ | | ``PATH`` | where to store the backup | +-------------------------------------------------------+----------------+------------------------------------------------------------------------+ | **optional arguments** | +-------------------------------------------------------+----------------+------------------------------------------------------------------------+ | | ``--paper`` | Create an export suitable for printing and later type-in | +-------------------------------------------------------+----------------+------------------------------------------------------------------------+ | | ``--qr-html`` | Create an html file suitable for printing and later type-in or qr scan | +-------------------------------------------------------+----------------+------------------------------------------------------------------------+ | .. class:: borg-common-opt-ref | | | | :ref:`common_options` | +-------------------------------------------------------+----------------+------------------------------------------------------------------------+ .. raw:: html .. only:: latex REPOSITORY PATH where to store the backup optional arguments --paper Create an export suitable for printing and later type-in --qr-html Create an html file suitable for printing and later type-in or qr scan :ref:`common_options` | Description ~~~~~~~~~~~ If repository encryption is used, the repository is inaccessible without the key. This command allows one to backup this essential key. Note that the backup produced does not include the passphrase itself (i.e. the exported key stays encrypted). In order to regain access to a repository, one needs both the exported key and the original passphrase. There are three backup formats. The normal backup format is suitable for digital storage as a file. The ``--paper`` backup format is optimized for printing and typing in while importing, with per line checks to reduce problems with manual input. The ``--qr-html`` creates a printable HTML template with a QR code and a copy of the ``--paper``-formatted key. For repositories using keyfile encryption the key is saved locally on the system that is capable of doing backups. To guard against loss of this key, the key needs to be backed up independently of the main data backup. For repositories using the repokey encryption the key is saved in the repository in the config file. A backup is thus not strictly needed, but guards against the repository becoming inaccessible if the file is damaged for some reason. Examples:: borg key export /path/to/repo > encrypted-key-backup borg key export --paper /path/to/repo > encrypted-key-backup.txt borg key export --qr-html /path/to/repo > encrypted-key-backup.html # Or pass the output file as an argument instead of redirecting stdout: borg key export /path/to/repo encrypted-key-backup borg key export --paper /path/to/repo encrypted-key-backup.txt borg key export --qr-html /path/to/repo encrypted-key-backup.html ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/key_import.rst.inc0000644000076500000240000000704414641074756017753 0ustar00twstaff.. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit! .. _borg_key_import: borg key import --------------- .. code-block:: none borg [common options] key import [options] [REPOSITORY] [PATH] .. only:: html .. class:: borg-options-table +-------------------------------------------------------+----------------+----------------------------------------------------------+ | **positional arguments** | +-------------------------------------------------------+----------------+----------------------------------------------------------+ | | ``REPOSITORY`` | | +-------------------------------------------------------+----------------+----------------------------------------------------------+ | | ``PATH`` | path to the backup ('-' to read from stdin) | +-------------------------------------------------------+----------------+----------------------------------------------------------+ | **optional arguments** | +-------------------------------------------------------+----------------+----------------------------------------------------------+ | | ``--paper`` | interactively import from a backup done with ``--paper`` | +-------------------------------------------------------+----------------+----------------------------------------------------------+ | .. class:: borg-common-opt-ref | | | | :ref:`common_options` | +-------------------------------------------------------+----------------+----------------------------------------------------------+ .. raw:: html .. only:: latex REPOSITORY PATH path to the backup ('-' to read from stdin) optional arguments --paper interactively import from a backup done with ``--paper`` :ref:`common_options` | Description ~~~~~~~~~~~ This command restores a key previously backed up with the export command. If the ``--paper`` option is given, the import will be an interactive process in which each line is checked for plausibility before proceeding to the next line. For this format PATH must not be given. For repositories using keyfile encryption, the key file which ``borg key import`` writes to depends on several factors. If the ``BORG_KEY_FILE`` environment variable is set and non-empty, ``borg key import`` creates or overwrites that file named by ``$BORG_KEY_FILE``. Otherwise, ``borg key import`` searches in the ``$BORG_KEYS_DIR`` directory for a key file associated with the repository. If a key file is found in ``$BORG_KEYS_DIR``, ``borg key import`` overwrites it; otherwise, ``borg key import`` creates a new key file in ``$BORG_KEYS_DIR``.././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/key_migrate-to-repokey.rst.inc0000644000076500000240000000412414641074756022161 0ustar00twstaff.. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit! .. _borg_key_migrate-to-repokey: borg key migrate-to-repokey --------------------------- .. code-block:: none borg [common options] key migrate-to-repokey [options] [REPOSITORY] .. only:: html .. class:: borg-options-table +-------------------------------------------------------+----------------+--+ | **positional arguments** | +-------------------------------------------------------+----------------+--+ | | ``REPOSITORY`` | | +-------------------------------------------------------+----------------+--+ | .. class:: borg-common-opt-ref | | | | :ref:`common_options` | +-------------------------------------------------------+----------------+--+ .. raw:: html .. only:: latex REPOSITORY :ref:`common_options` | Description ~~~~~~~~~~~ This command migrates a repository from passphrase mode (removed in Borg 1.0) to repokey mode. You will be first asked for the repository passphrase (to open it in passphrase mode). This is the same passphrase as you used to use for this repo before 1.0. It will then derive the different secrets from this passphrase. Then you will be asked for a new passphrase (twice, for safety). This passphrase will be used to protect the repokey (which contains these same secrets in encrypted form). You may use the same passphrase as you used to use, but you may also use a different one. After migrating to repokey mode, you can change the passphrase at any time. But please note: the secrets will always stay the same and they could always be derived from your (old) passphrase-mode passphrase.././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/list.rst0000644000076500000240000000407014641074756015770 0ustar00twstaff.. include:: list.rst.inc Examples ~~~~~~~~ :: $ borg list /path/to/repo Monday Mon, 2016-02-15 19:15:11 repo Mon, 2016-02-15 19:26:54 root-2016-02-15 Mon, 2016-02-15 19:36:29 newname Mon, 2016-02-15 19:50:19 ... $ borg list /path/to/repo::root-2016-02-15 drwxr-xr-x root root 0 Mon, 2016-02-15 17:44:27 . drwxrwxr-x root root 0 Mon, 2016-02-15 19:04:49 bin -rwxr-xr-x root root 1029624 Thu, 2014-11-13 00:08:51 bin/bash lrwxrwxrwx root root 0 Fri, 2015-03-27 20:24:26 bin/bzcmp -> bzdiff -rwxr-xr-x root root 2140 Fri, 2015-03-27 20:24:22 bin/bzdiff ... $ borg list /path/to/repo::root-2016-02-15 --pattern "- bin/ba*" drwxr-xr-x root root 0 Mon, 2016-02-15 17:44:27 . drwxrwxr-x root root 0 Mon, 2016-02-15 19:04:49 bin lrwxrwxrwx root root 0 Fri, 2015-03-27 20:24:26 bin/bzcmp -> bzdiff -rwxr-xr-x root root 2140 Fri, 2015-03-27 20:24:22 bin/bzdiff ... $ borg list /path/to/repo::archiveA --format="{mode} {user:6} {group:6} {size:8d} {isomtime} {path}{extra}{NEWLINE}" drwxrwxr-x user user 0 Sun, 2015-02-01 11:00:00 . drwxrwxr-x user user 0 Sun, 2015-02-01 11:00:00 code drwxrwxr-x user user 0 Sun, 2015-02-01 11:00:00 code/myproject -rw-rw-r-- user user 1416192 Sun, 2015-02-01 11:00:00 code/myproject/file.ext -rw-rw-r-- user user 1416192 Sun, 2015-02-01 11:00:00 code/myproject/file.text ... $ borg list /path/to/repo/::archiveA --pattern '+ re:\.ext$' --pattern '- re:^.*$' -rw-rw-r-- user user 1416192 Sun, 2015-02-01 11:00:00 code/myproject/file.ext ... $ borg list /path/to/repo/::archiveA --pattern '+ re:.ext$' --pattern '- re:^.*$' -rw-rw-r-- user user 1416192 Sun, 2015-02-01 11:00:00 code/myproject/file.ext -rw-rw-r-- user user 1416192 Sun, 2015-02-01 11:00:00 code/myproject/file.text ... ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/list.rst.inc0000644000076500000240000005616714641074756016556 0ustar00twstaff.. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit! .. _borg_list: borg list --------- .. code-block:: none borg [common options] list [options] [REPOSITORY_OR_ARCHIVE] [PATH...] .. only:: html .. class:: borg-options-table +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | **positional arguments** | +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``REPOSITORY_OR_ARCHIVE`` | repository or archive to list contents of | +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``PATH`` | paths to list; patterns are supported | +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | **optional arguments** | +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--consider-checkpoints`` | Show checkpoint archives in the repository contents list (default: hidden). | +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--short`` | only print file/directory names, nothing else | +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--format FORMAT`` | specify format for file or archive listing (default for files: "{mode} {user:6} {group:6} {size:8} {mtime} {path}{extra}{NL}"; for archives: "{archive:<36} {time} [{id}]{NL}") | +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--json`` | Only valid for listing repository contents. Format output as JSON. The form of ``--format`` is ignored, but keys used in it are added to the JSON output. Some keys are always present. Note: JSON can only represent text. A "barchive" key is therefore not available. | +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--json-lines`` | Only valid for listing archive contents. Format output as JSON Lines. The form of ``--format`` is ignored, but keys used in it are added to the JSON output. Some keys are always present. Note: JSON can only represent text. A "bpath" key is therefore not available. | +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | .. class:: borg-common-opt-ref | | | | :ref:`common_options` | +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | **Archive filters** — Archive filters can be applied to repository targets. | +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``-P PREFIX``, ``--prefix PREFIX`` | only consider archive names starting with this prefix. (deprecated) | +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``-a GLOB``, ``--glob-archives GLOB`` | only consider archive names matching the glob. sh: rules apply (without actually using the sh: prefix), see "borg help patterns". | +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--sort-by KEYS`` | Comma-separated list of sorting keys; valid keys are: timestamp, archive, name, id; default is: timestamp | +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--first N`` | consider first N archives after other filters were applied | +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--last N`` | consider last N archives after other filters were applied | +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | **Include/Exclude options** | +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``-e PATTERN``, ``--exclude PATTERN`` | exclude paths matching PATTERN | +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--exclude-from EXCLUDEFILE`` | read exclude patterns from EXCLUDEFILE, one per line | +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--pattern PATTERN`` | include/exclude paths matching PATTERN | +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--patterns-from PATTERNFILE`` | read include/exclude patterns from PATTERNFILE, one per line | +-----------------------------------------------------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. raw:: html .. only:: latex REPOSITORY_OR_ARCHIVE repository or archive to list contents of PATH paths to list; patterns are supported optional arguments --consider-checkpoints Show checkpoint archives in the repository contents list (default: hidden). --short only print file/directory names, nothing else --format FORMAT specify format for file or archive listing (default for files: "{mode} {user:6} {group:6} {size:8} {mtime} {path}{extra}{NL}"; for archives: "{archive:<36} {time} [{id}]{NL}") --json Only valid for listing repository contents. Format output as JSON. The form of ``--format`` is ignored, but keys used in it are added to the JSON output. Some keys are always present. Note: JSON can only represent text. A "barchive" key is therefore not available. --json-lines Only valid for listing archive contents. Format output as JSON Lines. The form of ``--format`` is ignored, but keys used in it are added to the JSON output. Some keys are always present. Note: JSON can only represent text. A "bpath" key is therefore not available. :ref:`common_options` | Archive filters -P PREFIX, --prefix PREFIX only consider archive names starting with this prefix. (deprecated) -a GLOB, --glob-archives GLOB only consider archive names matching the glob. sh: rules apply (without actually using the sh: prefix), see "borg help patterns". --sort-by KEYS Comma-separated list of sorting keys; valid keys are: timestamp, archive, name, id; default is: timestamp --first N consider first N archives after other filters were applied --last N consider last N archives after other filters were applied Include/Exclude options -e PATTERN, --exclude PATTERN exclude paths matching PATTERN --exclude-from EXCLUDEFILE read exclude patterns from EXCLUDEFILE, one per line --pattern PATTERN include/exclude paths matching PATTERN --patterns-from PATTERNFILE read include/exclude patterns from PATTERNFILE, one per line Description ~~~~~~~~~~~ This command lists the contents of a repository or an archive. For more help on include/exclude patterns, see the :ref:`borg_patterns` command output. .. man NOTES The FORMAT specifier syntax +++++++++++++++++++++++++++ The ``--format`` option uses python's `format string syntax `_. Examples: :: $ borg list --format '{archive}{NL}' /path/to/repo ArchiveFoo ArchiveBar ... # {VAR:NUMBER} - pad to NUMBER columns. # Strings are left-aligned, numbers are right-aligned. # Note: time columns except ``isomtime``, ``isoctime`` and ``isoatime`` cannot be padded. $ borg list --format '{archive:36} {time} [{id}]{NL}' /path/to/repo ArchiveFoo Thu, 2021-12-09 10:22:28 [0b8e9a312bef3f2f6e2d0fc110c196827786c15eba0188738e81697a7fa3b274] $ borg list --format '{mode} {user:6} {group:6} {size:8} {mtime} {path}{extra}{NL}' /path/to/repo::ArchiveFoo -rw-rw-r-- user user 1024 Thu, 2021-12-09 10:22:17 file-foo ... # {VAR:NUMBER} - pad to NUMBER columns right-aligned. $ borg list --format '{mode} {user:>6} {group:>6} {size:<8} {mtime} {path}{extra}{NL}' /path/to/repo::ArchiveFoo -rw-rw-r-- user user 1024 Thu, 2021-12-09 10:22:17 file-foo ... The following keys are always available: - NEWLINE: OS dependent line separator - NL: alias of NEWLINE - NUL: NUL character for creating print0 / xargs -0 like output, see barchive and bpath keys below - SPACE - TAB - CR - LF Keys available only when listing archives in a repository: - archive: archive name interpreted as text (might be missing non-text characters, see barchive) - name: alias of "archive" - barchive: verbatim archive name, can contain any character except NUL - comment: archive comment interpreted as text (might be missing non-text characters, see bcomment) - bcomment: verbatim archive comment, can contain any character except NUL - id: internal ID of the archive - tam: TAM authentication state of this archive - start: time (start) of creation of the archive - time: alias of "start" - end: time (end) of creation of the archive - command_line: command line which was used to create the archive - hostname: hostname of host on which this archive was created - username: username of user who created this archive Keys available only when listing files in an archive: - type - mode - uid - gid - user - group - path: path interpreted as text (might be missing non-text characters, see bpath) - bpath: verbatim POSIX path, can contain any character except NUL - source: link target for links (identical to linktarget) - linktarget - flags - size - csize: compressed size - dsize: deduplicated size - dcsize: deduplicated compressed size - num_chunks: number of chunks in this file - unique_chunks: number of unique chunks in this file - mtime - ctime - atime - isomtime - isoctime - isoatime - blake2b - blake2s - md5 - sha1 - sha224 - sha256 - sha384 - sha3_224 - sha3_256 - sha3_384 - sha3_512 - sha512 - xxh64: XXH64 checksum of this file (note: this is NOT a cryptographic hash!) - archiveid - archivename - extra: prepends {source} with " -> " for soft links and " link to " for hard links - health: either "healthy" (file ok) or "broken" (if file has all-zero replacement chunks) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/lock.rst0000644000076500000240000000010014641074756015733 0ustar00twstaff.. include:: with-lock.rst.inc .. include:: break-lock.rst.inc ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/mount.rst0000644000076500000240000000466614641074756016172 0ustar00twstaff.. include:: mount.rst.inc .. include:: umount.rst.inc Examples ~~~~~~~~ :: # Mounting the repository shows all archives. # Archives are loaded lazily, expect some delay when navigating to an archive # for the first time. $ borg mount /path/to/repo /tmp/mymountpoint $ ls /tmp/mymountpoint root-2016-02-14 root-2016-02-15 $ borg umount /tmp/mymountpoint # Mounting a specific archive is possible as well. $ borg mount /path/to/repo::root-2016-02-15 /tmp/mymountpoint $ ls /tmp/mymountpoint bin boot etc home lib lib64 lost+found media mnt opt root sbin srv tmp usr var $ borg umount /tmp/mymountpoint # The "versions view" merges all archives in the repository # and provides a versioned view on files. $ borg mount -o versions /path/to/repo /tmp/mymountpoint $ ls -l /tmp/mymountpoint/home/user/doc.txt/ total 24 -rw-rw-r-- 1 user group 12357 Aug 26 21:19 doc.cda00bc9.txt -rw-rw-r-- 1 user group 12204 Aug 26 21:04 doc.fa760f28.txt $ borg umount /tmp/mymountpoint # Archive filters are supported. # These are especially handy for the "versions view", # which does not support lazy processing of archives. $ borg mount -o versions --glob-archives '*-my-home' --last 10 /path/to/repo /tmp/mymountpoint # Exclusion options are supported. # These can speed up mounting and lower memory needs significantly. $ borg mount /path/to/repo /tmp/mymountpoint only/that/path $ borg mount --exclude '...' /path/to/repo /tmp/mymountpoint # When using BORG_REPO env var, use :: as positional argument: export BORG_REPO=/path/to/repo # Mount the whole repo: borg mount :: /tmp/mymountpoint # Mount some specific archive: borg mount ::root-2016-02-15 /tmp/mymountpoint borgfs ++++++ :: $ echo '/mnt/backup /tmp/myrepo fuse.borgfs defaults,noauto 0 0' >> /etc/fstab $ echo '/mnt/backup::root-2016-02-15 /tmp/myarchive fuse.borgfs defaults,noauto 0 0' >> /etc/fstab $ mount /tmp/myrepo $ mount /tmp/myarchive $ ls /tmp/myrepo root-2016-02-01 root-2016-02-2015 $ ls /tmp/myarchive bin boot etc home lib lib64 lost+found media mnt opt root sbin srv tmp usr var .. Note:: ``borgfs`` will be automatically provided if you used a distribution package or ``pip`` to install Borg. Users of the standalone binary will have to manually create a symlink (see :ref:`pyinstaller-binary`). ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/mount.rst.inc0000644000076500000240000004214714641074756016736 0ustar00twstaff.. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit! .. _borg_mount: borg mount ---------- .. code-block:: none borg [common options] mount [options] REPOSITORY_OR_ARCHIVE MOUNTPOINT [PATH...] .. only:: html .. class:: borg-options-table +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | **positional arguments** | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``REPOSITORY_OR_ARCHIVE`` | repository or archive to mount | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``MOUNTPOINT`` | where to mount filesystem | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``PATH`` | paths to extract; patterns are supported | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | **optional arguments** | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``--consider-checkpoints`` | Show checkpoint archives in the repository contents list (default: hidden). | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``-f``, ``--foreground`` | stay in foreground, do not daemonize | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``-o`` | Extra mount options | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``--numeric-owner`` | deprecated, use ``--numeric-ids`` instead | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``--numeric-ids`` | use numeric user and group identifiers from archive(s) | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | .. class:: borg-common-opt-ref | | | | :ref:`common_options` | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | **Archive filters** — Archive filters can be applied to repository targets. | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``-P PREFIX``, ``--prefix PREFIX`` | only consider archive names starting with this prefix. (deprecated) | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``-a GLOB``, ``--glob-archives GLOB`` | only consider archive names matching the glob. sh: rules apply (without actually using the sh: prefix), see "borg help patterns". | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``--sort-by KEYS`` | Comma-separated list of sorting keys; valid keys are: timestamp, archive, name, id; default is: timestamp | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``--first N`` | consider first N archives after other filters were applied | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``--last N`` | consider last N archives after other filters were applied | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | **Include/Exclude options** | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``-e PATTERN``, ``--exclude PATTERN`` | exclude paths matching PATTERN | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``--exclude-from EXCLUDEFILE`` | read exclude patterns from EXCLUDEFILE, one per line | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``--pattern PATTERN`` | include/exclude paths matching PATTERN | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``--patterns-from PATTERNFILE`` | read include/exclude patterns from PATTERNFILE, one per line | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``--strip-components NUMBER`` | Remove the specified number of leading path elements. Paths with fewer elements will be silently skipped. | +-----------------------------------------------------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ .. raw:: html .. only:: latex REPOSITORY_OR_ARCHIVE repository or archive to mount MOUNTPOINT where to mount filesystem PATH paths to extract; patterns are supported optional arguments --consider-checkpoints Show checkpoint archives in the repository contents list (default: hidden). -f, --foreground stay in foreground, do not daemonize -o Extra mount options --numeric-owner deprecated, use ``--numeric-ids`` instead --numeric-ids use numeric user and group identifiers from archive(s) :ref:`common_options` | Archive filters -P PREFIX, --prefix PREFIX only consider archive names starting with this prefix. (deprecated) -a GLOB, --glob-archives GLOB only consider archive names matching the glob. sh: rules apply (without actually using the sh: prefix), see "borg help patterns". --sort-by KEYS Comma-separated list of sorting keys; valid keys are: timestamp, archive, name, id; default is: timestamp --first N consider first N archives after other filters were applied --last N consider last N archives after other filters were applied Include/Exclude options -e PATTERN, --exclude PATTERN exclude paths matching PATTERN --exclude-from EXCLUDEFILE read exclude patterns from EXCLUDEFILE, one per line --pattern PATTERN include/exclude paths matching PATTERN --patterns-from PATTERNFILE read include/exclude patterns from PATTERNFILE, one per line --strip-components NUMBER Remove the specified number of leading path elements. Paths with fewer elements will be silently skipped. Description ~~~~~~~~~~~ This command mounts an archive as a FUSE filesystem. This can be useful for browsing an archive or restoring individual files. Unless the ``--foreground`` option is given the command will run in the background until the filesystem is ``umounted``. The command ``borgfs`` provides a wrapper for ``borg mount``. This can also be used in fstab entries: ``/path/to/repo /mnt/point fuse.borgfs defaults,noauto 0 0`` To allow a regular user to use fstab entries, add the ``user`` option: ``/path/to/repo /mnt/point fuse.borgfs defaults,noauto,user 0 0`` For FUSE configuration and mount options, see the mount.fuse(8) manual page. Borg's default behavior is to use the archived user and group names of each file and map them to the system's respective user and group ids. Alternatively, using ``numeric-ids`` will instead use the archived user and group ids without any mapping. The ``uid`` and ``gid`` mount options (implemented by Borg) can be used to override the user and group ids of all files (i.e., ``borg mount -o uid=1000,gid=1000``). The man page references ``user_id`` and ``group_id`` mount options (implemented by fuse) which specify the user and group id of the mount owner (aka, the user who does the mounting). It is set automatically by libfuse (or the filesystem if libfuse is not used). However, you should not specify these manually. Unlike the ``uid`` and ``gid`` mount options which affect all files, ``user_id`` and ``group_id`` affect the user and group id of the mounted (base) directory. Additional mount options supported by borg: - ``versions``: when used with a repository mount, this gives a merged, versioned view of the files in the archives. EXPERIMENTAL, layout may change in future. - ``allow_damaged_files``: by default damaged files (where missing chunks were replaced with runs of zeros by ``borg check --repair``) are not readable and return EIO (I/O error). Set this option to read such files. - ``ignore_permissions``: for security reasons the ``default_permissions`` mount option is internally enforced by borg. ``ignore_permissions`` can be given to not enforce ``default_permissions``. The BORG_MOUNT_DATA_CACHE_ENTRIES environment variable is meant for advanced users to tweak the performance. It sets the number of cached data chunks; additional memory usage can be up to ~8 MiB times this number. The default is the number of CPU cores. When the daemonized process receives a signal or crashes, it does not unmount. Unmounting in these cases could cause an active rsync or similar process to unintentionally delete data. When running in the foreground ^C/SIGINT unmounts cleanly, but other signals or crashes do not.././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/notes.rst0000644000076500000240000003400514641074756016146 0ustar00twstaffAdditional Notes ---------------- Here are misc. notes about topics that are maybe not covered in enough detail in the usage section. .. _chunker-params: ``--chunker-params`` ~~~~~~~~~~~~~~~~~~~~ The chunker params influence how input files are cut into pieces (chunks) which are then considered for deduplication. They also have a big impact on resource usage (RAM and disk space) as the amount of resources needed is (also) determined by the total amount of chunks in the repository (see :ref:`cache-memory-usage` for details). ``--chunker-params=buzhash,10,23,16,4095`` results in a fine-grained deduplication and creates a big amount of chunks and thus uses a lot of resources to manage them. This is good for relatively small data volumes and if the machine has a good amount of free RAM and disk space. ``--chunker-params=buzhash,19,23,21,4095`` (default) results in a coarse-grained deduplication and creates a much smaller amount of chunks and thus uses less resources. This is good for relatively big data volumes and if the machine has a relatively low amount of free RAM and disk space. ``--chunker-params=fixed,4194304`` results in fixed 4MiB sized block deduplication and is more efficient than the previous example when used for for block devices (like disks, partitions, LVM LVs) or raw disk image files. ``--chunker-params=fixed,4096,512`` results in fixed 4kiB sized blocks, but the first header block will only be 512B long. This might be useful to dedup files with 1 header + N fixed size data blocks. Be careful to not produce a too big amount of chunks (like using small block size for huge files). If you already have made some archives in a repository and you then change chunker params, this of course impacts deduplication as the chunks will be cut differently. In the worst case (all files are big and were touched in between backups), this will store all content into the repository again. Usually, it is not that bad though: - usually most files are not touched, so it will just re-use the old chunks it already has in the repo - files smaller than the (both old and new) minimum chunksize result in only one chunk anyway, so the resulting chunks are same and deduplication will apply If you switch chunker params to save resources for an existing repo that already has some backup archives, you will see an increasing effect over time, when more and more files have been touched and stored again using the bigger chunksize **and** all references to the smaller older chunks have been removed (by deleting / pruning archives). If you want to see an immediate big effect on resource usage, you better start a new repository when changing chunker params. For more details, see :ref:`chunker_details`. ``--noatime / --noctime`` ~~~~~~~~~~~~~~~~~~~~~~~~~ You can use these ``borg create`` options to not store the respective timestamp into the archive, in case you do not really need it. Besides saving a little space for the not archived timestamp, it might also affect metadata stream deduplication: if only this timestamp changes between backups and is stored into the metadata stream, the metadata stream chunks won't deduplicate just because of that. ``--nobsdflags / --noflags`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ You can use this to not query and store (or not extract and set) flags - in case you don't need them or if they are broken somehow for your fs. On Linux, dealing with the flags needs some additional syscalls. Especially when dealing with lots of small files, this causes a noticeable overhead, so you can use this option also for speeding up operations. ``--umask`` ~~~~~~~~~~~ borg uses a safe default umask of 077 (that means the files borg creates have only permissions for owner, but no permissions for group and others) - so there should rarely be a need to change the default behaviour. This option only affects the process to which it is given. Thus, when you run borg in client/server mode and you want to change the behaviour on the server side, you need to use ``borg serve --umask=XXX ...`` as a ssh forced command in ``authorized_keys``. The ``--umask`` value given on the client side is **not** transferred to the server side. Also, if you choose to use the ``--umask`` option, always be consistent and use the same umask value so you do not create a mixup of permissions in a borg repository or with other files borg creates. ``--read-special`` ~~~~~~~~~~~~~~~~~~ The ``--read-special`` option is special - you do not want to use it for normal full-filesystem backups, but rather after carefully picking some targets for it. The option ``--read-special`` triggers special treatment for block and char device files as well as FIFOs. Instead of storing them as such a device (or FIFO), they will get opened, their content will be read and in the backup archive they will show up like a regular file. Symlinks will also get special treatment if (and only if) they point to such a special file: instead of storing them as a symlink, the target special file will get processed as described above. One intended use case of this is backing up the contents of one or multiple block devices, like e.g. LVM snapshots or inactive LVs or disk partitions. You need to be careful about what you include when using ``--read-special``, e.g. if you include ``/dev/zero``, your backup will never terminate. Restoring such files' content is currently only supported one at a time via ``--stdout`` option (and you have to redirect stdout to where ever it shall go, maybe directly into an existing device file of your choice or indirectly via ``dd``). To some extent, mounting a backup archive with the backups of special files via ``borg mount`` and then loop-mounting the image files from inside the mount point will work. If you plan to access a lot of data in there, it likely will scale and perform better if you do not work via the FUSE mount. Example +++++++ Imagine you have made some snapshots of logical volumes (LVs) you want to backup. .. note:: For some scenarios, this is a good method to get "crash-like" consistency (I call it crash-like because it is the same as you would get if you just hit the reset button or your machine would abruptly and completely crash). This is better than no consistency at all and a good method for some use cases, but likely not good enough if you have databases running. Then you create a backup archive of all these snapshots. The backup process will see a "frozen" state of the logical volumes, while the processes working in the original volumes continue changing the data stored there. You also add the output of ``lvdisplay`` to your backup, so you can see the LV sizes in case you ever need to recreate and restore them. After the backup has completed, you remove the snapshots again. :: $ # create snapshots here $ lvdisplay > lvdisplay.txt $ borg create --read-special /path/to/repo::arch lvdisplay.txt /dev/vg0/*-snapshot $ # remove snapshots here Now, let's see how to restore some LVs from such a backup. :: $ borg extract /path/to/repo::arch lvdisplay.txt $ # create empty LVs with correct sizes here (look into lvdisplay.txt). $ # we assume that you created an empty root and home LV and overwrite it now: $ borg extract --stdout /path/to/repo::arch dev/vg0/root-snapshot > /dev/vg0/root $ borg extract --stdout /path/to/repo::arch dev/vg0/home-snapshot > /dev/vg0/home .. _separate_compaction: Separate compaction ~~~~~~~~~~~~~~~~~~~ Borg does not auto-compact the segment files in the repository at commit time (at the end of each repository-writing command) any more. This is new since borg 1.2.0 and requires borg >= 1.2.0 on client and server. This causes a similar behaviour of the repository as if it was in append-only mode (see below) most of the time (until ``borg compact`` is invoked or an old client triggers auto-compaction). This has some notable consequences: - repository space is not freed immediately when deleting / pruning archives - commands finish quicker - repository is more robust and might be easier to recover after damages (as it contains data in a more sequential manner, historic manifests, multiple commits - until you run ``borg compact``) - user can choose when to run compaction (it should be done regularly, but not necessarily after each single borg command) - user can choose from where to invoke ``borg compact`` to do the compaction (from client or from server, it does not need a key) - less repo sync data traffic in case you create a copy of your repository by using a sync tool (like rsync, rclone, ...) You can manually run compaction by invoking the ``borg compact`` command. .. _append_only_mode: Append-only mode (forbid compaction) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A repository can be made "append-only", which means that Borg will never overwrite or delete committed data (append-only refers to the segment files, but borg will also reject to delete the repository completely). If ``borg compact`` command is used on a repo in append-only mode, there will be no warning or error, but no compaction will happen. append-only is useful for scenarios where a backup client machine backups remotely to a backup server using ``borg serve``, since a hacked client machine cannot delete backups on the server permanently. To activate append-only mode, set ``append_only`` to 1 in the repository config: :: borg config /path/to/repo append_only 1 Note that you can go back-and-forth between normal and append-only operation with ``borg config``; it's not a "one way trip." In append-only mode Borg will create a transaction log in the ``transactions`` file, where each line is a transaction and a UTC timestamp. In addition, ``borg serve`` can act as if a repository is in append-only mode with its option ``--append-only``. This can be very useful for fine-tuning access control in ``.ssh/authorized_keys``: :: command="borg serve --append-only ..." ssh-rsa command="borg serve ..." ssh-rsa Running ``borg init`` via a ``borg serve --append-only`` server will *not* create an append-only repository. Running ``borg init --append-only`` creates an append-only repository regardless of server settings. Example +++++++ Suppose an attacker remotely deleted all backups, but your repository was in append-only mode. A transaction log in this situation might look like this: :: transaction 1, UTC time 2016-03-31T15:53:27.383532 transaction 5, UTC time 2016-03-31T15:53:52.588922 transaction 11, UTC time 2016-03-31T15:54:23.887256 transaction 12, UTC time 2016-03-31T15:55:54.022540 transaction 13, UTC time 2016-03-31T15:55:55.472564 From your security logs you conclude the attacker gained access at 15:54:00 and all the backups where deleted or replaced by compromised backups. From the log you know that transactions 11 and later are compromised. Note that the transaction ID is the name of the *last* file in the transaction. For example, transaction 11 spans files 6 to 11. In a real attack you'll likely want to keep the compromised repository intact to analyze what the attacker tried to achieve. It's also a good idea to make this copy just in case something goes wrong during the recovery. Since recovery is done by deleting some files, a hard link copy (``cp -al``) is sufficient. The first step to reset the repository to transaction 5, the last uncompromised transaction, is to remove the ``hints.N``, ``index.N`` and ``integrity.N`` files in the repository (these files are always expendable). In this example N is 13. Then remove or move all segment files from the segment directories in ``data/`` starting with file 6:: rm data/**/{6..13} That's all to do in the repository. If you want to access this rolled back repository from a client that already has a cache for this repository, the cache will reflect a newer repository state than what you actually have in the repository now, after the rollback. Thus, you need to clear the cache:: borg delete --cache-only repo The cache will get rebuilt automatically. Depending on repo size and archive count, it may take a while. You also will need to remove ~/.config/borg/security/REPOID/manifest-timestamp. Drawbacks +++++++++ As data is only appended, and nothing removed, commands like ``prune`` or ``delete`` won't free disk space, they merely tag data as deleted in a new transaction. Be aware that as soon as you write to the repo in non-append-only mode (e.g. prune, delete or create archives from an admin machine), it will remove the deleted objects permanently (including the ones that were already marked as deleted, but not removed, in append-only mode). Automated edits to the repository (such as a cron job running ``borg prune``) will render append-only mode moot if data is deleted. Even if an archive appears to be available, it is possible an attacker could delete just a few chunks from an archive and silently corrupt its data. While in append-only mode, this is reversible, but ``borg check`` should be run before a writing/pruning operation on an append-only repository to catch accidental or malicious corruption:: # run without append-only mode borg check --verify-data repo && borg compact repo Aside from checking repository & archive integrity you may want to also manually check backups to ensure their content seems correct. Further considerations ++++++++++++++++++++++ Append-only mode is not respected by tools other than Borg. ``rm`` still works on the repository. Make sure that backup client machines only get to access the repository via ``borg serve``. Ensure that no remote access is possible if the repository is temporarily set to normal mode for e.g. regular pruning. Further protections can be implemented, but are outside of Borg's scope. For example, file system snapshots or wrapping ``borg serve`` to set special permissions or ACLs on new data files. SSH batch mode ~~~~~~~~~~~~~~ When running Borg using an automated script, ``ssh`` might still ask for a password, even if there is an SSH key for the target server. Use this to make scripts more robust:: export BORG_RSH='ssh -oBatchMode=yes' ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/prune.rst0000644000076500000240000000320714641074756016147 0ustar00twstaff.. include:: prune.rst.inc Examples ~~~~~~~~ Be careful, prune is a potentially dangerous command, it will remove backup archives. The default of prune is to apply to **all archives in the repository** unless you restrict its operation to a subset of the archives using ``--glob-archives``. When using ``--glob-archives``, be careful to choose a good matching pattern - e.g. do not use "foo*" if you do not also want to match "foobar". It is strongly recommended to always run ``prune -v --list --dry-run ...`` first so you will see what it would do without it actually doing anything. :: # Keep 7 end of day and 4 additional end of week archives. # Do a dry-run without actually deleting anything. $ borg prune -v --list --dry-run --keep-daily=7 --keep-weekly=4 /path/to/repo # Same as above but only apply to archive names starting with the hostname # of the machine followed by a "-" character: $ borg prune -v --list --keep-daily=7 --keep-weekly=4 --glob-archives='{hostname}-*' /path/to/repo # actually free disk space: $ borg compact /path/to/repo # Keep 7 end of day, 4 additional end of week archives, # and an end of month archive for every month: $ borg prune -v --list --keep-daily=7 --keep-weekly=4 --keep-monthly=-1 /path/to/repo # Keep all backups in the last 10 days, 4 additional end of week archives, # and an end of month archive for every month: $ borg prune -v --list --keep-within=10d --keep-weekly=4 --keep-monthly=-1 /path/to/repo There is also a visualized prune example in ``docs/misc/prune-example.txt``: .. highlight:: none .. include:: ../misc/prune-example.txt :literal: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/prune.rst.inc0000644000076500000240000004140214641074756016716 0ustar00twstaff.. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit! .. _borg_prune: borg prune ---------- .. code-block:: none borg [common options] prune [options] [REPOSITORY] .. only:: html .. class:: borg-options-table +-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | **positional arguments** | +-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``REPOSITORY`` | repository to prune | +-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | **optional arguments** | +-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``-n``, ``--dry-run`` | do not change repository | +-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``--force`` | force pruning of corrupted archives, use ``--force --force`` in case ``--force`` does not work. | +-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``-s``, ``--stats`` | print statistics for the deleted archive | +-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``--list`` | output verbose list of archives it keeps/prunes | +-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``--keep-within INTERVAL`` | keep all archives within this time interval | +-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``--keep-last``, ``--keep-secondly`` | number of secondly archives to keep | +-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``--keep-minutely`` | number of minutely archives to keep | +-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``-H``, ``--keep-hourly`` | number of hourly archives to keep | +-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``-d``, ``--keep-daily`` | number of daily archives to keep | +-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``-w``, ``--keep-weekly`` | number of weekly archives to keep | +-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``-m``, ``--keep-monthly`` | number of monthly archives to keep | +-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``-y``, ``--keep-yearly`` | number of yearly archives to keep | +-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``--save-space`` | work slower, but using less space | +-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``-c SECONDS``, ``--checkpoint-interval SECONDS`` | write checkpoint every SECONDS seconds (Default: 1800) | +-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | .. class:: borg-common-opt-ref | | | | :ref:`common_options` | +-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | **Archive filters** — Archive filters can be applied to repository targets. | +-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``-P PREFIX``, ``--prefix PREFIX`` | only consider archive names starting with this prefix. (deprecated) | +-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ | | ``-a GLOB``, ``--glob-archives GLOB`` | only consider archive names matching the glob. sh: rules apply (without actually using the sh: prefix), see "borg help patterns". | +-----------------------------------------------------------------------------+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ .. raw:: html .. only:: latex REPOSITORY repository to prune optional arguments -n, --dry-run do not change repository --force force pruning of corrupted archives, use ``--force --force`` in case ``--force`` does not work. -s, --stats print statistics for the deleted archive --list output verbose list of archives it keeps/prunes --keep-within INTERVAL keep all archives within this time interval --keep-last, --keep-secondly number of secondly archives to keep --keep-minutely number of minutely archives to keep -H, --keep-hourly number of hourly archives to keep -d, --keep-daily number of daily archives to keep -w, --keep-weekly number of weekly archives to keep -m, --keep-monthly number of monthly archives to keep -y, --keep-yearly number of yearly archives to keep --save-space work slower, but using less space -c SECONDS, --checkpoint-interval SECONDS write checkpoint every SECONDS seconds (Default: 1800) :ref:`common_options` | Archive filters -P PREFIX, --prefix PREFIX only consider archive names starting with this prefix. (deprecated) -a GLOB, --glob-archives GLOB only consider archive names matching the glob. sh: rules apply (without actually using the sh: prefix), see "borg help patterns". Description ~~~~~~~~~~~ The prune command prunes a repository by deleting all archives not matching any of the specified retention options. Important: Repository disk space is **not** freed until you run ``borg compact``. This command is normally used by automated backup scripts wanting to keep a certain number of historic backups. This retention policy is commonly referred to as `GFS `_ (Grandfather-father-son) backup rotation scheme. Also, prune automatically removes checkpoint archives (incomplete archives left behind by interrupted backup runs) except if the checkpoint is the latest archive (and thus still needed). Checkpoint archives are not considered when comparing archive counts against the retention limits (``--keep-X``). If a prefix is set with -P, then only archives that start with the prefix are considered for deletion and only those archives count towards the totals specified by the rules. Otherwise, *all* archives in the repository are candidates for deletion! There is no automatic distinction between archives representing different contents. These need to be distinguished by specifying matching prefixes. If you have multiple sequences of archives with different data sets (e.g. from different machines) in one shared repository, use one prune call per data set that matches only the respective archives using the -P option. The ``--keep-within`` option takes an argument of the form "", where char is "H", "d", "w", "m", "y". For example, ``--keep-within 2d`` means to keep all archives that were created within the past 48 hours. "1m" is taken to mean "31d". The archives kept with this option do not count towards the totals specified by any other options. A good procedure is to thin out more and more the older your backups get. As an example, ``--keep-daily 7`` means to keep the latest backup on each day, up to 7 most recent days with backups (days without backups do not count). The rules are applied from secondly to yearly, and backups selected by previous rules do not count towards those of later rules. The time that each backup starts is used for pruning purposes. Dates and times are interpreted in the local timezone, and weeks go from Monday to Sunday. Specifying a negative number of archives to keep means that there is no limit. As of borg 1.2.0, borg will retain the oldest archive if any of the secondly, minutely, hourly, daily, weekly, monthly, or yearly rules was not otherwise able to meet its retention target. This enables the first chronological archive to continue aging until it is replaced by a newer archive that meets the retention criteria. The ``--keep-last N`` option is doing the same as ``--keep-secondly N`` (and it will keep the last N archives under the assumption that you do not create more than one backup archive in the same second). When using ``--stats``, you will get some statistics about how much data was deleted - the "Deleted data" deduplicated size there is most interesting as that is how much your repository will shrink. Please note that the "All archives" stats refer to the state after pruning.././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/recreate.rst0000644000076500000240000000247014641074756016611 0ustar00twstaff.. include:: recreate.rst.inc Examples ~~~~~~~~ :: # Make old (Attic / Borg 0.xx) archives deduplicate with Borg 1.x archives. # Archives created with Borg 1.1+ and the default chunker params are skipped # (archive ID stays the same). $ borg recreate /mnt/backup --chunker-params default --progress # Create a backup with little but fast compression $ borg create /mnt/backup::archive /some/files --compression lz4 # Then compress it - this might take longer, but the backup has already completed, # so no inconsistencies from a long-running backup job. $ borg recreate /mnt/backup::archive --recompress --compression zlib,9 # Remove unwanted files from all archives in a repository. # Note the relative path for the --exclude option - archives only contain relative paths. $ borg recreate /mnt/backup --exclude home/icke/Pictures/drunk_photos # Change archive comment $ borg create --comment "This is a comment" /mnt/backup::archivename ~ $ borg info /mnt/backup::archivename Name: archivename Fingerprint: ... Comment: This is a comment ... $ borg recreate --comment "This is a better comment" /mnt/backup::archivename $ borg info /mnt/backup::archivename Name: archivename Fingerprint: ... Comment: This is a better comment ... ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/recreate.rst.inc0000644000076500000240000011734014641074756017364 0ustar00twstaff.. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit! .. _borg_recreate: borg recreate ------------- .. code-block:: none borg [common options] recreate [options] [REPOSITORY_OR_ARCHIVE] [PATH...] .. only:: html .. class:: borg-options-table +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | **positional arguments** | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``REPOSITORY_OR_ARCHIVE`` | repository or archive to recreate | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``PATH`` | paths to recreate; patterns are supported | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | **optional arguments** | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--list`` | output verbose list of items (files, dirs, ...) | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--filter STATUSCHARS`` | only display items with the given status characters (listed in borg create --help) | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``-n``, ``--dry-run`` | do not change anything | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``-s``, ``--stats`` | print statistics at end | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | .. class:: borg-common-opt-ref | | | | :ref:`common_options` | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | **Include/Exclude options** | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``-e PATTERN``, ``--exclude PATTERN`` | exclude paths matching PATTERN | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--exclude-from EXCLUDEFILE`` | read exclude patterns from EXCLUDEFILE, one per line | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--pattern PATTERN`` | include/exclude paths matching PATTERN | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--patterns-from PATTERNFILE`` | read include/exclude patterns from PATTERNFILE, one per line | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--exclude-caches`` | exclude directories that contain a CACHEDIR.TAG file (http://www.bford.info/cachedir/spec.html) | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--exclude-if-present NAME`` | exclude directories that are tagged by containing a filesystem object with the given NAME | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--keep-exclude-tags`` | if tag objects are specified with ``--exclude-if-present``, don't omit the tag objects themselves from the backup archive | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | **Archive options** | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--target TARGET`` | create a new archive with the name ARCHIVE, do not replace existing archive (only applies for a single archive) | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``-c SECONDS``, ``--checkpoint-interval SECONDS`` | write checkpoint every SECONDS seconds (Default: 1800) | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--comment COMMENT`` | add a comment text to the archive | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--timestamp TIMESTAMP`` | manually specify the archive creation date/time (UTC, yyyy-mm-ddThh:mm:ss format). alternatively, give a reference file/directory. | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``-C COMPRESSION``, ``--compression COMPRESSION`` | select compression algorithm, see the output of the "borg help compression" command for details. | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--recompress MODE`` | recompress data chunks according to `MODE` and ``--compression``. Possible modes are `if-different`: recompress if current compression is with a different compression algorithm (the level is not considered); `always`: recompress even if current compression is with the same compression algorithm (use this to change the compression level); and `never`: do not recompress (use this option to explicitly prevent recompression). If no MODE is given, `if-different` will be used. Not passing --recompress is equivalent to "--recompress never". | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--chunker-params PARAMS`` | rechunk using given chunker parameters (ALGO, CHUNK_MIN_EXP, CHUNK_MAX_EXP, HASH_MASK_BITS, HASH_WINDOW_SIZE) or `default` to use the chunker defaults. default: do not rechunk | +-------------------------------------------------------+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. raw:: html .. only:: latex REPOSITORY_OR_ARCHIVE repository or archive to recreate PATH paths to recreate; patterns are supported optional arguments --list output verbose list of items (files, dirs, ...) --filter STATUSCHARS only display items with the given status characters (listed in borg create --help) -n, --dry-run do not change anything -s, --stats print statistics at end :ref:`common_options` | Include/Exclude options -e PATTERN, --exclude PATTERN exclude paths matching PATTERN --exclude-from EXCLUDEFILE read exclude patterns from EXCLUDEFILE, one per line --pattern PATTERN include/exclude paths matching PATTERN --patterns-from PATTERNFILE read include/exclude patterns from PATTERNFILE, one per line --exclude-caches exclude directories that contain a CACHEDIR.TAG file (http://www.bford.info/cachedir/spec.html) --exclude-if-present NAME exclude directories that are tagged by containing a filesystem object with the given NAME --keep-exclude-tags if tag objects are specified with ``--exclude-if-present``, don't omit the tag objects themselves from the backup archive Archive options --target TARGET create a new archive with the name ARCHIVE, do not replace existing archive (only applies for a single archive) -c SECONDS, --checkpoint-interval SECONDS write checkpoint every SECONDS seconds (Default: 1800) --comment COMMENT add a comment text to the archive --timestamp TIMESTAMP manually specify the archive creation date/time (UTC, yyyy-mm-ddThh:mm:ss format). alternatively, give a reference file/directory. -C COMPRESSION, --compression COMPRESSION select compression algorithm, see the output of the "borg help compression" command for details. --recompress MODE recompress data chunks according to `MODE` and ``--compression``. Possible modes are `if-different`: recompress if current compression is with a different compression algorithm (the level is not considered); `always`: recompress even if current compression is with the same compression algorithm (use this to change the compression level); and `never`: do not recompress (use this option to explicitly prevent recompression). If no MODE is given, `if-different` will be used. Not passing --recompress is equivalent to "--recompress never". --chunker-params PARAMS rechunk using given chunker parameters (ALGO, CHUNK_MIN_EXP, CHUNK_MAX_EXP, HASH_MASK_BITS, HASH_WINDOW_SIZE) or `default` to use the chunker defaults. default: do not rechunk Description ~~~~~~~~~~~ Recreate the contents of existing archives. recreate is a potentially dangerous function and might lead to data loss (if used wrongly). BE VERY CAREFUL! Important: Repository disk space is **not** freed until you run ``borg compact``. ``--exclude``, ``--exclude-from``, ``--exclude-if-present``, ``--keep-exclude-tags`` and PATH have the exact same semantics as in "borg create", but they only check for files in the archives and not in the local file system. If PATHs are specified, the resulting archives will only contain files from these PATHs. Note that all paths in an archive are relative, therefore absolute patterns/paths will *not* match (``--exclude``, ``--exclude-from``, PATHs). ``--recompress`` allows one to change the compression of existing data in archives. Due to how Borg stores compressed size information this might display incorrect information for archives that were not recreated at the same time. There is no risk of data loss by this. ``--chunker-params`` will re-chunk all files in the archive, this can be used to have upgraded Borg 0.xx or Attic archives deduplicate with Borg 1.x archives. **USE WITH CAUTION.** Depending on the PATHs and patterns given, recreate can be used to permanently delete files from archives. When in doubt, use ``--dry-run --verbose --list`` to see how patterns/PATHS are interpreted. See :ref:`list_item_flags` in ``borg create`` for details. The archive being recreated is only removed after the operation completes. The archive that is built during the operation exists at the same time at ".recreate". The new archive will have a different archive ID. With ``--target`` the original archive is not replaced, instead a new archive is created. When rechunking (or recompressing), space usage can be substantial - expect at least the entire deduplicated size of the archives using the previous chunker (or compression) params. If you recently ran borg check --repair and it had to fix lost chunks with all-zero replacement chunks, please first run another backup for the same data and re-run borg check --repair afterwards to heal any archives that had lost chunks which are still generated from the input data. Important: running borg recreate to re-chunk will remove the chunks_healthy metadata of all items with replacement chunks, so healing will not be possible any more after re-chunking (it is also unlikely it would ever work: due to the change of chunking parameters, the missing chunk likely will never be seen again even if you still have the data that produced it).././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/rename.rst0000644000076500000240000000053014641074756016261 0ustar00twstaff.. include:: rename.rst.inc Examples ~~~~~~~~ :: $ borg create /path/to/repo::archivename ~ $ borg list /path/to/repo archivename Mon, 2016-02-15 19:50:19 $ borg rename /path/to/repo::archivename newname $ borg list /path/to/repo newname Mon, 2016-02-15 19:50:19 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/rename.rst.inc0000644000076500000240000000351414641074756017036 0ustar00twstaff.. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit! .. _borg_rename: borg rename ----------- .. code-block:: none borg [common options] rename [options] ARCHIVE NEWNAME .. only:: html .. class:: borg-options-table +-------------------------------------------------------+-------------+-----------------------------+ | **positional arguments** | +-------------------------------------------------------+-------------+-----------------------------+ | | ``ARCHIVE`` | archive to rename | +-------------------------------------------------------+-------------+-----------------------------+ | | ``NEWNAME`` | the new archive name to use | +-------------------------------------------------------+-------------+-----------------------------+ | .. class:: borg-common-opt-ref | | | | :ref:`common_options` | +-------------------------------------------------------+-------------+-----------------------------+ .. raw:: html .. only:: latex ARCHIVE archive to rename NEWNAME the new archive name to use :ref:`common_options` | Description ~~~~~~~~~~~ This command renames an archive in the repository. This results in a different archive ID.././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/serve.rst0000644000076500000240000001030114641074756016133 0ustar00twstaff.. include:: serve.rst.inc Examples ~~~~~~~~ ``borg serve`` has special support for ssh forced commands (see ``authorized_keys`` example below): if the environment variable SSH_ORIGINAL_COMMAND is set it will ignore some options given on the command line and use the values from the variable instead. This only applies to a carefully controlled allowlist of safe options. This list currently contains: - Options that control the log level and debug topics printed such as ``--verbose``, ``--info``, ``--debug``, ``--debug-topic``, etc. - ``--lock-wait`` to allow the client to control how long to wait before giving up and aborting the operation when another process is holding a lock. Environment variables (such as BORG_XXX) contained in the original command sent by the client are *not* interpreted, but ignored. If BORG_XXX environment variables should be set on the ``borg serve`` side, then these must be set in system-specific locations like ``/etc/environment`` or in the forced command itself (example below). :: # Allow an SSH keypair to only run borg, and only have access to /path/to/repo. # Use key options to disable unneeded and potentially dangerous SSH functionality. # This will help to secure an automated remote backup system. $ cat ~/.ssh/authorized_keys command="borg serve --restrict-to-path /path/to/repo",restrict ssh-rsa AAAAB3[...] # Set a BORG_XXX environment variable on the "borg serve" side $ cat ~/.ssh/authorized_keys command="export BORG_XXX=value; borg serve [...]",restrict ssh-rsa [...] .. note:: The examples above use the ``restrict`` directive. This does automatically block potential dangerous ssh features, even when they are added in a future update. Thus, this option should be preferred. If you're using openssh-server < 7.2, however, you have to explicitly specify the ssh features to restrict and cannot simply use the restrict option as it has been introduced in v7.2. We recommend to use ``no-port-forwarding,no-X11-forwarding,no-pty,no-agent-forwarding,no-user-rc`` in this case. Details about sshd usage: `sshd(8) `_ SSH Configuration ~~~~~~~~~~~~~~~~~ ``borg serve``'s pipes (``stdin``/``stdout``/``stderr``) are connected to the ``sshd`` process on the server side. In the event that the SSH connection between ``borg serve`` and the client is disconnected or stuck abnormally (for example, due to a network outage), it can take a long time for ``sshd`` to notice the client is disconnected. In the meantime, ``sshd`` continues running, and as a result so does the ``borg serve`` process holding the lock on the repository. This can cause subsequent ``borg`` operations on the remote repository to fail with the error: ``Failed to create/acquire the lock``. In order to avoid this, it is recommended to perform the following additional SSH configuration: Either in the client side's ``~/.ssh/config`` file, or in the client's ``/etc/ssh/ssh_config`` file: :: Host backupserver ServerAliveInterval 10 ServerAliveCountMax 30 Replacing ``backupserver`` with the hostname, FQDN or IP address of the borg server. This will cause the client to send a keepalive to the server every 10 seconds. If 30 consecutive keepalives are sent without a response (a time of 300 seconds), the ssh client process will be terminated, causing the borg process to terminate gracefully. On the server side's ``sshd`` configuration file (typically ``/etc/ssh/sshd_config``): :: ClientAliveInterval 10 ClientAliveCountMax 30 This will cause the server to send a keep alive to the client every 10 seconds. If 30 consecutive keepalives are sent without a response (a time of 300 seconds), the server's sshd process will be terminated, causing the ``borg serve`` process to terminate gracefully and release the lock on the repository. If you then run borg commands with ``--lock-wait 600``, this gives sufficient time for the borg serve processes to terminate after the SSH connection is torn down after the 300 second wait for the keepalives to fail. You may, of course, modify the timeout values demonstrated above to values that suit your environment and use case. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/serve.rst.inc0000644000076500000240000002366514641074756016724 0ustar00twstaff.. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit! .. _borg_serve: borg serve ---------- .. code-block:: none borg [common options] serve [options] .. only:: html .. class:: borg-options-table +-------------------------------------------------------+-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | **optional arguments** | +-------------------------------------------------------+-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--restrict-to-path PATH`` | restrict repository access to PATH. Can be specified multiple times to allow the client access to several directories. Access to all sub-directories is granted implicitly; PATH doesn't need to directly point to a repository. | +-------------------------------------------------------+-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--restrict-to-repository PATH`` | restrict repository access. Only the repository located at PATH (no sub-directories are considered) is accessible. Can be specified multiple times to allow the client access to several repositories. Unlike ``--restrict-to-path`` sub-directories are not accessible; PATH needs to directly point at a repository location. PATH may be an empty directory or the last element of PATH may not exist, in which case the client may initialize a repository there. | +-------------------------------------------------------+-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--append-only`` | only allow appending to repository segment files. Note that this only affects the low level structure of the repository, and running `delete` or `prune` will still be allowed. See :ref:`append_only_mode` in Additional Notes for more details. | +-------------------------------------------------------+-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | ``--storage-quota QUOTA`` | Override storage quota of the repository (e.g. 5G, 1.5T). When a new repository is initialized, sets the storage quota on the new repository as well. Default: no quota. | +-------------------------------------------------------+-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | .. class:: borg-common-opt-ref | | | | :ref:`common_options` | +-------------------------------------------------------+-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. raw:: html .. only:: latex optional arguments --restrict-to-path PATH restrict repository access to PATH. Can be specified multiple times to allow the client access to several directories. Access to all sub-directories is granted implicitly; PATH doesn't need to directly point to a repository. --restrict-to-repository PATH restrict repository access. Only the repository located at PATH (no sub-directories are considered) is accessible. Can be specified multiple times to allow the client access to several repositories. Unlike ``--restrict-to-path`` sub-directories are not accessible; PATH needs to directly point at a repository location. PATH may be an empty directory or the last element of PATH may not exist, in which case the client may initialize a repository there. --append-only only allow appending to repository segment files. Note that this only affects the low level structure of the repository, and running `delete` or `prune` will still be allowed. See :ref:`append_only_mode` in Additional Notes for more details. --storage-quota QUOTA Override storage quota of the repository (e.g. 5G, 1.5T). When a new repository is initialized, sets the storage quota on the new repository as well. Default: no quota. :ref:`common_options` | Description ~~~~~~~~~~~ This command starts a repository server process. This command is usually not used manually.././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/tar.rst0000644000076500000240000000134314641074756015603 0ustar00twstaff.. include:: import-tar.rst.inc .. include:: export-tar.rst.inc Examples ~~~~~~~~ :: # export as uncompressed tar $ borg export-tar /path/to/repo::Monday Monday.tar # exclude some types, compress using gzip $ borg export-tar /path/to/repo::Monday Monday.tar.gz --exclude '*.so' # use higher compression level with gzip $ borg export-tar --tar-filter="gzip -9" testrepo::linux Monday.tar.gz # export a tar, but instead of storing it on disk, # upload it to a remote site using curl. $ borg export-tar /path/to/repo::Monday - | curl --data-binary @- https://somewhere/to/POST # remote extraction via "tarpipe" $ borg export-tar /path/to/repo::Monday - | ssh somewhere "cd extracted; tar x" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/umount.rst.inc0000644000076500000240000000352114641074756017114 0ustar00twstaff.. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit! .. _borg_umount: borg umount ----------- .. code-block:: none borg [common options] umount [options] MOUNTPOINT .. only:: html .. class:: borg-options-table +-------------------------------------------------------+----------------+----------------------------------------+ | **positional arguments** | +-------------------------------------------------------+----------------+----------------------------------------+ | | ``MOUNTPOINT`` | mountpoint of the filesystem to umount | +-------------------------------------------------------+----------------+----------------------------------------+ | .. class:: borg-common-opt-ref | | | | :ref:`common_options` | +-------------------------------------------------------+----------------+----------------------------------------+ .. raw:: html .. only:: latex MOUNTPOINT mountpoint of the filesystem to umount :ref:`common_options` | Description ~~~~~~~~~~~ This command un-mounts a FUSE filesystem that was mounted with ``borg mount``. This is a convenience wrapper that just calls the platform-specific shell command - usually this is either umount or fusermount -u.././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/upgrade.rst0000644000076500000240000000167514641074756016454 0ustar00twstaff.. include:: upgrade.rst.inc Examples ~~~~~~~~ :: # Upgrade the borg repository to the most recent version. $ borg upgrade -v /path/to/repo making a hardlink copy in /path/to/repo.before-upgrade-2016-02-15-20:51:55 opening attic repository with borg and converting no key file found for repository converting repo index /path/to/repo/index.0 converting 1 segments... converting borg 0.xx to borg current no key file found for repository .. _borg_key_migrate-to-repokey: Upgrading a passphrase encrypted attic repo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ attic offered a "passphrase" encryption mode, but this was removed in borg 1.0 and replaced by the "repokey" mode (which stores the passphrase-protected encryption key into the repository config). Thus, to upgrade a "passphrase" attic repo to a "repokey" borg repo, 2 steps are needed, in this order: - borg upgrade repo - borg key migrate-to-repokey repo ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/upgrade.rst.inc0000644000076500000240000002417514641074756017224 0ustar00twstaff.. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit! .. _borg_upgrade: borg upgrade ------------ .. code-block:: none borg [common options] upgrade [options] [REPOSITORY] .. only:: html .. class:: borg-options-table +-------------------------------------------------------+--------------------------+------------------------------------------------------------------------------------------------+ | **positional arguments** | +-------------------------------------------------------+--------------------------+------------------------------------------------------------------------------------------------+ | | ``REPOSITORY`` | path to the repository to be upgraded | +-------------------------------------------------------+--------------------------+------------------------------------------------------------------------------------------------+ | **optional arguments** | +-------------------------------------------------------+--------------------------+------------------------------------------------------------------------------------------------+ | | ``-n``, ``--dry-run`` | do not change repository | +-------------------------------------------------------+--------------------------+------------------------------------------------------------------------------------------------+ | | ``--inplace`` | rewrite repository in place, with no chance of going back to older versions of the repository. | +-------------------------------------------------------+--------------------------+------------------------------------------------------------------------------------------------+ | | ``--force`` | Force upgrade | +-------------------------------------------------------+--------------------------+------------------------------------------------------------------------------------------------+ | | ``--tam`` | Enable manifest authentication (in key and cache) (Borg 1.0.9 and later). | +-------------------------------------------------------+--------------------------+------------------------------------------------------------------------------------------------+ | | ``--check-tam`` | check manifest authentication (in key and cache). | +-------------------------------------------------------+--------------------------+------------------------------------------------------------------------------------------------+ | | ``--disable-tam`` | Disable manifest authentication (in key and cache). | +-------------------------------------------------------+--------------------------+------------------------------------------------------------------------------------------------+ | | ``--check-archives-tam`` | check TAM authentication for all archives. | +-------------------------------------------------------+--------------------------+------------------------------------------------------------------------------------------------+ | | ``--archives-tam`` | add TAM authentication for all archives. | +-------------------------------------------------------+--------------------------+------------------------------------------------------------------------------------------------+ | .. class:: borg-common-opt-ref | | | | :ref:`common_options` | +-------------------------------------------------------+--------------------------+------------------------------------------------------------------------------------------------+ .. raw:: html .. only:: latex REPOSITORY path to the repository to be upgraded optional arguments -n, --dry-run do not change repository --inplace rewrite repository in place, with no chance of going back to older versions of the repository. --force Force upgrade --tam Enable manifest authentication (in key and cache) (Borg 1.0.9 and later). --check-tam check manifest authentication (in key and cache). --disable-tam Disable manifest authentication (in key and cache). --check-archives-tam check TAM authentication for all archives. --archives-tam add TAM authentication for all archives. :ref:`common_options` | Description ~~~~~~~~~~~ Upgrade an existing, local Borg repository. When you do not need borg upgrade +++++++++++++++++++++++++++++++++ Not every change requires that you run ``borg upgrade``. You do **not** need to run it when: - moving your repository to a different place - upgrading to another point release (like 1.0.x to 1.0.y), except when noted otherwise in the changelog - upgrading from 1.0.x to 1.1.x, except when noted otherwise in the changelog Borg 1.x.y upgrades +++++++++++++++++++ Archive TAM authentication: Use ``borg upgrade --archives-tam REPO`` to add archive TAMs to all archives that are not TAM authenticated yet. This is a convenient method to just trust all archives present - if an archive does not have TAM authentication yet, a TAM will be added. Archives created by old borg versions < 1.0.9 do not have TAMs. Archives created by newer borg version should have TAMs already. If you have a high risk environment, you should not just run this, but first verify that the archives are authentic and not malicious (== have good content, have a good timestamp). Borg 1.2.5+ needs all archives to be TAM authenticated for safety reasons. This upgrade needs to be done once per repository. Manifest TAM authentication: Use ``borg upgrade --tam REPO`` to require manifest authentication introduced with Borg 1.0.9 to address security issues. This means that modifying the repository after doing this with a version prior to 1.0.9 will raise a validation error, so only perform this upgrade after updating all clients using the repository to 1.0.9 or newer. This upgrade should be done on each client for safety reasons. If a repository is accidentally modified with a pre-1.0.9 client after this upgrade, use ``borg upgrade --tam --force REPO`` to remedy it. If you routinely do this you might not want to enable this upgrade (which will leave you exposed to the security issue). You can reverse the upgrade by issuing ``borg upgrade --disable-tam REPO``. See https://borgbackup.readthedocs.io/en/stable/changes.html#pre-1-0-9-manifest-spoofing-vulnerability for details. Attic and Borg 0.xx to Borg 1.x +++++++++++++++++++++++++++++++ This currently supports converting an Attic repository to Borg and also helps with converting Borg 0.xx to 1.0. Currently, only LOCAL repositories can be upgraded (issue #465). Please note that ``borg create`` (since 1.0.0) uses bigger chunks by default than old borg or attic did, so the new chunks won't deduplicate with the old chunks in the upgraded repository. See ``--chunker-params`` option of ``borg create`` and ``borg recreate``. ``borg upgrade`` will change the magic strings in the repository's segments to match the new Borg magic strings. The keyfiles found in $ATTIC_KEYS_DIR or ~/.attic/keys/ will also be converted and copied to $BORG_KEYS_DIR or ~/.config/borg/keys. The cache files are converted, from $ATTIC_CACHE_DIR or ~/.cache/attic to $BORG_CACHE_DIR or ~/.cache/borg, but the cache layout between Borg and Attic changed, so it is possible the first backup after the conversion takes longer than expected due to the cache resync. Upgrade should be able to resume if interrupted, although it will still iterate over all segments. If you want to start from scratch, use `borg delete` over the copied repository to make sure the cache files are also removed:: borg delete borg Unless ``--inplace`` is specified, the upgrade process first creates a backup copy of the repository, in REPOSITORY.before-upgrade-DATETIME, using hardlinks. This requires that the repository and its parent directory reside on same filesystem so the hardlink copy can work. This takes longer than in place upgrades, but is much safer and gives progress information (as opposed to ``cp -al``). Once you are satisfied with the conversion, you can safely destroy the backup copy. WARNING: Running the upgrade in place will make the current copy unusable with older version, with no way of going back to previous versions. This can PERMANENTLY DAMAGE YOUR REPOSITORY! Attic CAN NOT READ BORG REPOSITORIES, as the magic strings have changed. You have been warned.././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/usage_general.rst.inc0000644000076500000240000000101314641074756020360 0ustar00twstaff.. include:: general/positional-arguments.rst.inc .. include:: general/repository-urls.rst.inc .. include:: general/repository-locations.rst.inc .. include:: general/logging.rst.inc .. include:: general/return-codes.rst.inc .. _env_vars: .. include:: general/environment.rst.inc .. _file-systems: .. include:: general/file-systems.rst.inc .. include:: general/units.rst.inc .. include:: general/date-time.rst.inc .. include:: general/resources.rst.inc .. _platforms: .. include:: general/file-metadata.rst.inc ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/version.rst0000644000076500000240000000003514641074756016477 0ustar00twstaff.. include:: version.rst.inc ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/version.rst.inc0000644000076500000240000000512614641074756017255 0ustar00twstaff.. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit! .. _borg_version: borg version ------------ .. code-block:: none borg [common options] version [options] [REPOSITORY] .. only:: html .. class:: borg-options-table +-------------------------------------------------------+----------------+--------------------------------------------------------+ | **positional arguments** | +-------------------------------------------------------+----------------+--------------------------------------------------------+ | | ``REPOSITORY`` | repository (used to determine client/server situation) | +-------------------------------------------------------+----------------+--------------------------------------------------------+ | .. class:: borg-common-opt-ref | | | | :ref:`common_options` | +-------------------------------------------------------+----------------+--------------------------------------------------------+ .. raw:: html .. only:: latex REPOSITORY repository (used to determine client/server situation) :ref:`common_options` | Description ~~~~~~~~~~~ This command displays the borg client version / borg server version. If a local repo is given, the client code directly accesses the repository, thus we show the client version also as the server version. If a remote repo is given (e.g. ssh:), the remote borg is queried and its version is displayed as the server version. Examples:: # local repo (client uses 1.4.0 alpha version) $ borg version /mnt/backup 1.4.0a / 1.4.0a # remote repo (client uses 1.4.0 alpha, server uses 1.2.7 release) $ borg version ssh://borg@borgbackup:repo 1.4.0a / 1.2.7 Due to the version tuple format used in borg client/server negotiation, only a simplified version is displayed (as provided by borg.version.format_version). There is also borg --version to display a potentially more precise client version.././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage/with-lock.rst.inc0000644000076500000240000000524114641074756017467 0ustar00twstaff.. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit! .. _borg_with-lock: borg with-lock -------------- .. code-block:: none borg [common options] with-lock [options] REPOSITORY COMMAND [ARGS...] .. only:: html .. class:: borg-options-table +-------------------------------------------------------+----------------+--------------------+ | **positional arguments** | +-------------------------------------------------------+----------------+--------------------+ | | ``REPOSITORY`` | repository to lock | +-------------------------------------------------------+----------------+--------------------+ | | ``COMMAND`` | command to run | +-------------------------------------------------------+----------------+--------------------+ | | ``ARGS`` | command arguments | +-------------------------------------------------------+----------------+--------------------+ | .. class:: borg-common-opt-ref | | | | :ref:`common_options` | +-------------------------------------------------------+----------------+--------------------+ .. raw:: html .. only:: latex REPOSITORY repository to lock COMMAND command to run ARGS command arguments :ref:`common_options` | Description ~~~~~~~~~~~ This command runs a user-specified command while locking the repository. For example: :: $ borg with-lock /mnt/borgrepo rsync -av /mnt/borgrepo /somewhere/else/borgrepo It will first try to acquire the lock (make sure that no other operation is running in the repo), then execute the given command as a subprocess and wait for its termination, release the lock and return the user command's return code as borg's return code. .. note:: If you copy a repository with the lock held, the lock will be present in the copy. Thus, before using borg on the copy from a different host, you need to use "borg break-lock" on the copied repository, because Borg is cautious and does not automatically remove stale locks made by a different host.././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage.rst0000644000076500000240000000305614641074756015020 0ustar00twstaff.. include:: global.rst.inc .. highlight:: none .. _detailed_usage: Usage ===== .. raw:: html Redirecting... .. toctree:: usage/general usage/init usage/create usage/extract usage/check usage/rename usage/list usage/diff usage/delete usage/prune usage/compact usage/info usage/version usage/mount usage/key usage/upgrade usage/recreate usage/tar usage/serve usage/config usage/lock usage/benchmark usage/help usage/debug usage/notes ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/docs/usage_general.rst.inc0000644000076500000240000000103314641074756017256 0ustar00twstaff.. include:: usage/general/positional-arguments.rst.inc .. include:: usage/general/repository-urls.rst.inc .. include:: usage/general/repository-locations.rst.inc .. include:: usage/general/logging.rst.inc .. include:: usage/general/return-codes.rst.inc .. include:: usage/general/environment.rst.inc .. include:: usage/general/file-systems.rst.inc .. include:: usage/general/units.rst.inc .. include:: usage/general/date-time.rst.inc .. include:: usage/general/resources.rst.inc .. include:: usage/general/file-metadata.rst.inc ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/pyproject.toml0000644000076500000240000001401214641074756015140 0ustar00twstaff[project] name = "borgbackup" dynamic = ["version", "readme"] authors = [{name="The Borg Collective (see AUTHORS file)"}] maintainers = [ {name="Thomas Waldmann", email="tw@waldmann-edv.de"}, ] description = "Deduplicated, encrypted, authenticated and compressed backups" requires-python = ">=3.9" keywords = ["backup", "borgbackup"] classifiers = [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: System Administrators", "License :: OSI Approved :: BSD License", "Operating System :: POSIX :: BSD :: FreeBSD", "Operating System :: POSIX :: BSD :: OpenBSD", "Operating System :: POSIX :: BSD :: NetBSD", "Operating System :: MacOS :: MacOS X", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Topic :: Security :: Cryptography", "Topic :: System :: Archiving :: Backup", ] license = {text="BSD"} dependencies = [ # we are rather picky about msgpack versions, because a good working msgpack is # very important for borg, see: https://github.com/borgbackup/borg/issues/3753 # Please note: # using any other msgpack version is not supported by borg development and # any feedback related to issues caused by this will be ignored. "msgpack >=1.0.3, <=1.1.0", "packaging", ] # note for package maintainers: if you package borgbackup for distribution, # please (if available) add pyfuse3 (preferably) or llfuse as a *requirement*. # "borg mount" needs one of them to work. # if neither is available, do not require it, most of borgbackup will work. [project.optional-dependencies] llfuse = ["llfuse >= 1.3.8"] pyfuse3 = ["pyfuse3 >= 3.1.1"] nofuse = [] [project.urls] "Homepage" = "https://borgbackup.org/" "Bug Tracker" = "https://github.com/borgbackup/borg/issues" "Documentation" = "https://borgbackup.readthedocs.io/" "Repository" = "https://github.com/borgbackup/borg" "Changelog" = "https://github.com/borgbackup/borg/blob/1.4-maint/docs/changes.rst" [project.scripts] borg = "borg.archiver:main" borgfs = "borg.archiver:main" [tool.setuptools] # See also the MANIFEST.in file. # We want to install all the files in the package directories... include-package-data = true [tool.setuptools.packages.find] where = ["src"] [tool.setuptools.exclude-package-data] # ...except the source files which have been compiled (C extensions): "*" = ["*.c", "*.h", "*.pyx"] [build-system] requires = ["setuptools>=64", "setuptools_scm>=8", "wheel", "pkgconfig", "Cython>=3.0.3"] build-backend = "setuptools.build_meta" [tool.setuptools_scm] # make sure we have the same versioning scheme with all setuptools_scm versions, to avoid different autogenerated files # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1015052 # https://github.com/borgbackup/borg/issues/6875 write_to = "src/borg/_version.py" write_to_template = "__version__ = version = {version!r}\n" [tool.ruff] line-length = 120 target-version = "py39" # Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default. select = ["E", "F"] # for reference ... # E402 module level import not at top # E501 line too long # F401 import unused # F405 undefined or defined from star imports # F811 redef of unused var # borg code style guidelines: # Ignoring E203 due to https://github.com/PyCQA/pycodestyle/issues/373 ignore = ["E203", "F405", "E402"] # Allow autofix for all enabled rules (when `--fix`) is provided. fixable = ["A", "B", "C", "D", "E", "F", "G", "I", "N", "Q", "S", "T", "W", "ANN", "ARG", "BLE", "COM", "DJ", "DTZ", "EM", "ERA", "EXE", "FBT", "ICN", "INP", "ISC", "NPY", "PD", "PGH", "PIE", "PL", "PT", "PTH", "PYI", "RET", "RSE", "RUF", "SIM", "SLF", "TCH", "TID", "TRY", "UP", "YTT"] unfixable = [] # Exclude a variety of commonly ignored directories. exclude = [ ".cache", ".eggs", ".git", ".git-rewrite", ".idea", ".mypy_cache", ".ruff_cache", ".tox", "build", "dist", ] # Allow unused variables when underscore-prefixed. dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" # Code style violation exceptions: # please note that the values are adjusted so that they do not cause failures # with existing code. if you want to change them, you should first fix all # ruff failures that appear with your change. [tool.ruff.per-file-ignores] "setup.py" = ["E501"] "scripts/make.py" = ["E501"] "src/borg/archive.py" = ["E501", "F401"] "src/borg/archiver.py" = ["E501", "F401", "E722", "E741"] "src/borg/cache.py" = ["E501", "E722"] "src/borg/crypto/key.py" = ["E501", "F401"] "src/borg/crypto/keymanager.py" = ["E501", "F401"] "src/borg/crypto/nonces.py" = ["E501"] "src/borg/fuse.py" = ["E501", "E722"] "src/borg/fuse_impl.py" = ["F811"] "src/borg/helpers/__init__.py" = ["F401"] "src/borg/helpers/checks.py" = ["F401"] "src/borg/helpers/manifest.py" = ["E501"] "src/borg/helpers/misc.py" = ["F401", "E722"] "src/borg/helpers/parseformat.py" = ["E501", "F401", "E741"] "src/borg/helpers/process.py" = ["F401"] "src/borg/locking.py" = ["E501", "E722"] "src/borg/platform/__init__.py" = ["F401", "F811"] "src/borg/remote.py" = ["E501"] "src/borg/repository.py" = ["E501", "F401"] "src/borg/shellpattern.py" = ["E501"] "src/borg/testsuite/__init__.py" = ["E501", "F401"] "src/borg/testsuite/archiver.py" = ["E501", "E722", "F401"] "src/borg/testsuite/benchmark.py" = ["F811", "F401"] "src/borg/testsuite/chunker.py" = ["E501"] "src/borg/testsuite/crypto.py" = ["E501", "E741"] "src/borg/testsuite/file_integrity.py" = ["F401"] "src/borg/testsuite/hashindex.py" = ["F401"] "src/borg/testsuite/helpers.py" = ["E501"] "src/borg/testsuite/key.py" = ["F401"] "src/borg/testsuite/locking.py" = ["E501", "E722", "F401"] "src/borg/testsuite/platform.py" = ["E501", "F811", "F401"] "src/borg/testsuite/repository.py" = ["E501", "F401"] "src/borg/upgrader.py" = ["E501"] [tool.pytest.ini_options] python_files = "testsuite/*.py" markers = [ "allow_cache_wipe", ] ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719958149.7960422 borgbackup-1.4.0/requirements.d/0000755000076500000240000000000014641075206015162 5ustar00twstaff././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/requirements.d/development.lock.txt0000644000076500000240000000031614641074756021205 0ustar00twstaffsetuptools==69.0.3 setuptools-scm==8.0.4 pip==23.3.2 virtualenv==20.25.0 build==1.0.3 pkgconfig==1.5.5 tox==4.11.4 pytest==7.4.3 pytest-xdist==3.5.0 pytest-cov==4.1.0 pytest-benchmark==4.0.0 Cython==3.0.10 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/requirements.d/development.txt0000644000076500000240000000020614641074756020254 0ustar00twstaffsetuptools>=64 setuptools_scm>=8 pip virtualenv build pkgconfig tox pytest pytest-xdist pytest-cov pytest-benchmark Cython pre-commit ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/requirements.d/docs.txt0000644000076500000240000000003314641074756016660 0ustar00twstaffsphinx guzzle_sphinx_theme ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1719958149.797483 borgbackup-1.4.0/scripts/0000755000076500000240000000000014641075206013704 5ustar00twstaff././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/scripts/borg.exe.spec0000644000076500000240000000425314641074756016306 0ustar00twstaff# -*- mode: python -*- # this pyinstaller spec file is used to build borg binaries on posix platforms import os, sys is_win32 = sys.platform.startswith('win32') # Note: SPEC contains the spec file argument given to pyinstaller here = os.path.dirname(os.path.abspath(SPEC)) basepath = os.path.abspath(os.path.join(here, '..')) if is_win32: hiddenimports = [] else: hiddenimports = ['borg.platform.posix', 'pkg_resources.py2_warn', ] block_cipher = None a = Analysis([os.path.join(basepath, 'src', 'borg', '__main__.py'), ], pathex=[basepath, ], binaries=[], datas=[ (os.path.join(basepath, 'src', 'borg', 'paperkey.html'), 'borg'), ], hiddenimports=hiddenimports, hookspath=[], runtime_hooks=[], excludes=[ '_ssl', 'ssl', ], win_no_prefer_redirects=False, win_private_assemblies=False, cipher=block_cipher) if sys.platform == 'darwin': # do not bundle the osxfuse libraries, so we do not get a version # mismatch to the installed kernel driver of osxfuse. a.binaries = [b for b in a.binaries if 'libosxfuse' not in b[0]] pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) exe = EXE(pyz, a.scripts, a.binaries, a.zipfiles, a.datas, name='borg.exe', debug=False, strip=False, upx=True, console=True) # Build a directory-based binary in addition to a packed # single file. This allows one to easily look at all included # files (e.g. without having to strace or halt the built binary # and introspect /tmp). Also avoids unpacking all libs when # running the app, which is better for app signing on various OS. slim_exe = EXE(pyz, a.scripts, exclude_binaries=True, name='borg.exe', debug=False, strip=False, upx=False, console=True) coll = COLLECT(slim_exe, a.binaries, a.zipfiles, a.datas, strip=False, upx=False, name='borg-dir') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/scripts/errorlist.py0000755000076500000240000000470114641074756016321 0ustar00twstaff#!/usr/bin/env python3 # this script automatically generates the error list for the docs by # looking at the "Error" class and its subclasses. from textwrap import indent import borg.archiver # noqa: F401 - need import to get Error subclasses. from borg.constants import * # NOQA from borg.helpers import Error, BackupError, BorgWarning def subclasses(cls): direct_subclasses = cls.__subclasses__() return set(direct_subclasses) | set(s for c in direct_subclasses for s in subclasses(c)) # 0, 1, 2 are used for success, generic warning, generic error # 3..99 are available for specific errors # 100..127 are available for specific warnings # 128+ are reserved for signals free_error_rcs = set(range(EXIT_ERROR_BASE, EXIT_WARNING_BASE)) # 3 .. 99 free_warning_rcs = set(range(EXIT_WARNING_BASE, EXIT_SIGNAL_BASE)) # 100 .. 127 # these classes map to rc 2 generic_error_rc_classes = set() generic_warning_rc_classes = set() error_classes = {Error} | subclasses(Error) for cls in sorted(error_classes, key=lambda cls: (cls.__module__, cls.__qualname__)): traceback = "yes" if cls.traceback else "no" rc = cls.exit_mcode print(' ', cls.__qualname__, 'rc:', rc, 'traceback:', traceback) print(indent(cls.__doc__, ' ' * 8)) if rc in free_error_rcs: free_error_rcs.remove(rc) elif rc == 2: generic_error_rc_classes.add(cls.__qualname__) else: # rc != 2 # if we did not intentionally map this to the generic error rc, this might be an issue: print(f'ERROR: {rc} is not a free/available RC, but either duplicate or invalid') print() print('free error RCs:', sorted(free_error_rcs)) print('generic errors:', sorted(generic_error_rc_classes)) warning_classes = {BorgWarning} | subclasses(BorgWarning) | {BackupError} | subclasses(BackupError) for cls in sorted(warning_classes, key=lambda cls: (cls.__module__, cls.__qualname__)): rc = cls.exit_mcode print(' ', cls.__qualname__, 'rc:', rc) print(indent(cls.__doc__, ' ' * 8)) if rc in free_warning_rcs: free_warning_rcs.remove(rc) elif rc == 1: generic_warning_rc_classes.add(cls.__qualname__) else: # rc != 1 # if we did not intentionally map this to the generic warning rc, this might be an issue: print(f'ERROR: {rc} is not a free/available RC, but either duplicate or invalid') print("\n") print('free warning RCs:', sorted(free_warning_rcs)) print('generic warnings:', sorted(generic_warning_rc_classes)) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/scripts/fetch-binaries0000755000076500000240000000117514641074756016532 0ustar00twstaff#!/bin/bash mkdir -p dist/ check_and_copy () { echo "--- EXE $2 -----------------------------------------------" vagrant ssh $1 -c "/vagrant/borg/borg.exe -V" vagrant scp $1:/vagrant/borg/borg.exe dist/$2 echo "--- DIR $2 -----------------------------------------------" vagrant ssh $1 -c "/vagrant/borg/borg-dir/borg.exe -V" vagrant scp $1:/vagrant/borg/borg.tgz dist/$2.tgz echo "" } check_and_copy buster64 borg-linux-glibc228 check_and_copy bullseye64 borg-linux-glibc231 check_and_copy bookworm64 borg-linux-glibc236 check_and_copy freebsd64 borg-freebsd check_and_copy darwin64 borg-macos ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1719958149.797714 borgbackup-1.4.0/scripts/fuzz-cache-sync/0000755000076500000240000000000014641075206016715 5ustar00twstaff././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/scripts/fuzz-cache-sync/HOWTO0000644000076500000240000000055114641074756017552 0ustar00twstaff- Install AFL and the requirements for LLVM mode (see docs) - Compile the fuzzing target, e.g. AFL_HARDEN=1 afl-clang-fast main.c -o fuzz-target -O3 (other options, like using ASan or MSan are possible as well) - Add additional test cases to testcase_dir - Run afl, easiest (but inefficient) way; afl-fuzz -i testcase_dir -o findings_dir ./fuzz-target ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/scripts/fuzz-cache-sync/main.c0000644000076500000240000000130114641074756020011 0ustar00twstaff #define BORG_NO_PYTHON #include "../../src/borg/_hashindex.c" #include "../../src/borg/cache_sync/cache_sync.c" #define BUFSZ 32768 int main() { char buf[BUFSZ]; int len, ret; CacheSyncCtx *ctx; HashIndex *idx; /* capacity, key size, value size */ idx = hashindex_init(0, 32, 12); ctx = cache_sync_init(idx); while (1) { len = read(0, buf, BUFSZ); if (!len) { break; } ret = cache_sync_feed(ctx, buf, len); if(!ret && cache_sync_error(ctx)) { fprintf(stderr, "error: %s\n", cache_sync_error(ctx)); return 1; } } hashindex_free(idx); cache_sync_free(ctx); return 0; } ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719958149.7978365 borgbackup-1.4.0/scripts/fuzz-cache-sync/testcase_dir/0000755000076500000240000000000014641075206021366 5ustar00twstaff././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/scripts/fuzz-cache-sync/testcase_dir/test_simple0000644000076500000240000000022314641074756023647 0ustar00twstaff��foo�bar�baz�ңbar�.�user�chunks�chunks��� 00000000000000000000000000000001�� 00000000000000000000000000000002././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/scripts/glibc_check.py0000755000076500000240000000320614641074756016510 0ustar00twstaff#!/usr/bin/env python3 """ Check if all given binaries work with the given glibc version. glibc_check.py 2.11 bin [bin ...] rc = 0 means "yes", rc = 1 means "no". """ import re import subprocess import sys verbose = True objdump = "objdump -T %s" glibc_re = re.compile(r'GLIBC_([0-9]\.[0-9]+)') def parse_version(v): major, minor = v.split('.') return int(major), int(minor) def format_version(version): return "%d.%d" % version def main(): given = parse_version(sys.argv[1]) filenames = sys.argv[2:] overall_versions = set() for filename in filenames: try: output = subprocess.check_output(objdump % filename, shell=True, stderr=subprocess.STDOUT) output = output.decode() versions = {parse_version(match.group(1)) for match in glibc_re.finditer(output)} requires_glibc = max(versions) overall_versions.add(requires_glibc) if verbose: print(f"{filename} {format_version(requires_glibc)}") except subprocess.CalledProcessError: if verbose: print("%s errored." % filename) wanted = max(overall_versions) ok = given >= wanted if verbose: if ok: print("The binaries work with the given glibc %s." % format_version(given)) else: print("The binaries do not work with the given glibc %s. " "Minimum is: %s" % (format_version(given), format_version(wanted))) return ok if __name__ == '__main__': ok = main() sys.exit(0 if ok else 1) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/scripts/hash_sizes.py0000644000076500000240000000543714641074756016440 0ustar00twstaff""" Compute hashtable sizes with nices properties - prime sizes (for small to medium sizes) - 2 prime-factor sizes (for big sizes) - fast growth for small sizes - slow growth for big sizes Note: this is just a tool for developers. within borgbackup, it is just used to generate hash_sizes definition for _hashindex.c. """ from collections import namedtuple K, M, G = 2**10, 2**20, 2**30 # hash table size (in number of buckets) start, end_p1, end_p2 = 1 * K, 127 * M, 2 * G - 10 * M # stay well below 2^31 - 1 Policy = namedtuple("Policy", "upto grow") policies = [ # which growth factor to use when growing a hashtable of size < upto # grow fast (*2.0) at the start so we do not have to resize too often (expensive). # grow slow (*1.1) for huge hash tables (do not jump too much in memory usage) Policy(256*K, 2.0), Policy(2*M, 1.7), Policy(16*M, 1.4), Policy(128*M, 1.2), Policy(2*G-1, 1.1), ] # slightly modified version of: # http://www.macdevcenter.com/pub/a/python/excerpt/pythonckbk_chap1/index1.html?page=2 def eratosthenes(): """Yields the sequence of prime numbers via the Sieve of Eratosthenes.""" D = {} # map each composite integer to its first-found prime factor q = 2 # q gets 2, 3, 4, 5, ... ad infinitum while True: p = D.pop(q, None) if p is None: # q not a key in D, so q is prime, therefore, yield it yield q # mark q squared as not-prime (with q as first-found prime factor) D[q * q] = q else: # let x <- smallest (N*p)+q which wasn't yet known to be composite # we just learned x is composite, with p first-found prime factor, # since p is the first-found prime factor of q -- find and mark it x = p + q while x in D: x += p D[x] = p q += 1 def two_prime_factors(pfix=65537): """Yields numbers with 2 prime factors pfix and p.""" for p in eratosthenes(): yield pfix * p def get_grow_factor(size): for p in policies: if size < p.upto: return p.grow def find_bigger_prime(gen, i): while True: p = next(gen) if p >= i: return p def main(): sizes = [] i = start gen = eratosthenes() while i < end_p1: grow_factor = get_grow_factor(i) p = find_bigger_prime(gen, i) sizes.append(p) i = int(i * grow_factor) gen = two_prime_factors() # for lower ram consumption while i < end_p2: grow_factor = get_grow_factor(i) p = find_bigger_prime(gen, i) sizes.append(p) i = int(i * grow_factor) print("""\ static int hash_sizes[] = { %s }; """ % ', '.join(str(size) for size in sizes)) if __name__ == '__main__': main() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/scripts/make.py0000644000076500000240000005374414641074756015221 0ustar00twstaff# Support code for building docs (build_usage, build_man) import glob import os import io import re import sys import textwrap from collections import OrderedDict from datetime import datetime, timezone import time def format_metavar(option): if option.nargs in ('*', '...'): return '[%s...]' % option.metavar elif option.nargs == '?': return '[%s]' % option.metavar elif option.nargs is None: return option.metavar else: raise ValueError(f'Can\'t format metavar {option.metavar}, unknown nargs {option.nargs}!') class BuildUsage: """generate usage docs for each command""" def run(self): print('generating usage docs') import borg borg.doc_mode = 'build_man' if not os.path.exists('docs/usage'): os.mkdir('docs/usage') # allows us to build docs without the C modules fully loaded during help generation from borg.archiver import Archiver parser = Archiver(prog='borg').build_parser() # borgfs has a separate man page to satisfy debian's "every program from a package # must have a man page" requirement, but it doesn't need a separate HTML docs page #borgfs_parser = Archiver(prog='borgfs').build_parser() self.generate_level("", parser, Archiver) return 0 def generate_level(self, prefix, parser, Archiver, extra_choices=None): is_subcommand = False choices = {} for action in parser._actions: if action.choices is not None and 'SubParsersAction' in str(action.__class__): is_subcommand = True for cmd, parser in action.choices.items(): choices[prefix + cmd] = parser if extra_choices is not None: choices.update(extra_choices) if prefix and not choices: return print('found commands: %s' % list(choices.keys())) for command, parser in sorted(choices.items()): if command.startswith('debug'): print('skipping', command) continue print('generating help for %s' % command) if self.generate_level(command + " ", parser, Archiver): continue with open('docs/usage/%s.rst.inc' % command.replace(" ", "_"), 'w') as doc: doc.write(".. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!\n\n") if command == 'help': for topic in Archiver.helptext: params = {"topic": topic, "underline": '~' * len('borg help ' + topic)} doc.write(".. _borg_{topic}:\n\n".format(**params)) doc.write("borg help {topic}\n{underline}\n\n".format(**params)) doc.write(Archiver.helptext[topic]) else: params = {"command": command, "command_": command.replace(' ', '_'), "underline": '-' * len('borg ' + command)} doc.write(".. _borg_{command_}:\n\n".format(**params)) doc.write("borg {command}\n{underline}\n.. code-block:: none\n\n borg [common options] {command}".format(**params)) self.write_usage(parser, doc) epilog = parser.epilog parser.epilog = None self.write_options(parser, doc) doc.write("\n\nDescription\n~~~~~~~~~~~\n") doc.write(epilog) if 'create' in choices: common_options = [group for group in choices['create']._action_groups if group.title == 'Common options'][0] with open('docs/usage/common-options.rst.inc', 'w') as doc: self.write_options_group(common_options, doc, False, base_indent=0) return is_subcommand def write_usage(self, parser, fp): if any(len(o.option_strings) for o in parser._actions): fp.write(' [options]') for option in parser._actions: if option.option_strings: continue fp.write(' ' + format_metavar(option)) fp.write('\n\n') def write_options(self, parser, fp): def is_positional_group(group): return any(not o.option_strings for o in group._group_actions) # HTML output: # A table using some column-spans rows = [] for group in parser._action_groups: if group.title == 'Common options': # (no of columns used, columns, ...) rows.append((1, '.. class:: borg-common-opt-ref\n\n:ref:`common_options`')) else: if not group._group_actions: continue group_header = '**%s**' % group.title if group.description: group_header += ' — ' + group.description rows.append((1, group_header)) if is_positional_group(group): for option in group._group_actions: rows.append((3, '', '``%s``' % option.metavar, option.help or '')) else: for option in group._group_actions: if option.metavar: option_fmt = '``%s ' + option.metavar + '``' else: option_fmt = '``%s``' option_str = ', '.join(option_fmt % s for s in option.option_strings) option_desc = textwrap.dedent((option.help or '') % option.__dict__) rows.append((3, '', option_str, option_desc)) fp.write('.. only:: html\n\n') table = io.StringIO() table.write('.. class:: borg-options-table\n\n') self.rows_to_table(rows, table.write) fp.write(textwrap.indent(table.getvalue(), ' ' * 4)) # LaTeX output: # Regular rST option lists (irregular column widths) latex_options = io.StringIO() for group in parser._action_groups: if group.title == 'Common options': latex_options.write('\n\n:ref:`common_options`\n') latex_options.write(' |') else: self.write_options_group(group, latex_options) fp.write('\n.. only:: latex\n\n') fp.write(textwrap.indent(latex_options.getvalue(), ' ' * 4)) def rows_to_table(self, rows, write): def write_row_separator(): write('+') for column_width in column_widths: write('-' * (column_width + 1)) write('+') write('\n') # Find column count and width column_count = max(columns for columns, *_ in rows) column_widths = [0] * column_count for columns, *cells in rows: for i in range(columns): # "+ 1" because we want a space between the cell contents and the delimiting "|" in the output column_widths[i] = max(column_widths[i], len(cells[i]) + 1) for columns, *original_cells in rows: write_row_separator() # If a cell contains newlines, then the row must be split up in individual rows # where each cell contains no newline. rowspanning_cells = [] original_cells = list(original_cells) while any('\n' in cell for cell in original_cells): cell_bloc = [] for i, cell in enumerate(original_cells): pre, _, original_cells[i] = cell.partition('\n') cell_bloc.append(pre) rowspanning_cells.append(cell_bloc) rowspanning_cells.append(original_cells) for cells in rowspanning_cells: for i, column_width in enumerate(column_widths): if i < columns: write('| ') write(cells[i].ljust(column_width)) else: write(' ') write(''.ljust(column_width)) write('|\n') write_row_separator() # This bit of JavaScript kills the that is invariably inserted by docutils, # but does absolutely no good here. It sets bogus column widths which cannot be overridden # with CSS alone. # Since this is HTML-only output, it would be possible to just generate a directly, # but then we'd lose rST formatting. write(textwrap.dedent(""" .. raw:: html """)) def write_options_group(self, group, fp, with_title=True, base_indent=4): def is_positional_group(group): return any(not o.option_strings for o in group._group_actions) indent = ' ' * base_indent if is_positional_group(group): for option in group._group_actions: fp.write(option.metavar + '\n') fp.write(textwrap.indent(option.help or '', ' ' * base_indent) + '\n') return if not group._group_actions: return if with_title: fp.write('\n\n') fp.write(group.title + '\n') opts = OrderedDict() for option in group._group_actions: if option.metavar: option_fmt = '%s ' + option.metavar else: option_fmt = '%s' option_str = ', '.join(option_fmt % s for s in option.option_strings) option_desc = textwrap.dedent((option.help or '') % option.__dict__) opts[option_str] = textwrap.indent(option_desc, ' ' * 4) padding = len(max(opts)) + 1 for option, desc in opts.items(): fp.write(indent + option.ljust(padding) + desc + '\n') class BuildMan: """build man pages""" see_also = { 'create': ('delete', 'prune', 'check', 'patterns', 'placeholders', 'compression'), 'recreate': ('patterns', 'placeholders', 'compression'), 'list': ('info', 'diff', 'prune', 'patterns'), 'info': ('list', 'diff'), 'init': ('create', 'delete', 'check', 'list', 'key-import', 'key-export', 'key-change-passphrase'), 'key-import': ('key-export', ), 'key-export': ('key-import', ), 'mount': ('umount', 'extract'), # Would be cooler if these two were on the same page 'umount': ('mount', ), 'extract': ('mount', ), 'delete': ('compact', ), 'prune': ('compact', ), } rst_prelude = textwrap.dedent(""" .. role:: ref(title) .. |project_name| replace:: Borg """) usage_group = { 'break-lock': 'lock', 'with-lock': 'lock', 'key_change-passphrase': 'key', 'key_export': 'key', 'key_import': 'key', 'key_migrate-to-repokey': 'key', 'export-tar': 'tar', 'import-tar': 'tar', 'benchmark_crud': 'benchmark', 'umount': 'mount', } def run(self): print('building man pages (in docs/man)', file=sys.stderr) import borg borg.doc_mode = 'build_man' os.makedirs('docs/man', exist_ok=True) # allows us to build docs without the C modules fully loaded during help generation from borg.archiver import Archiver parser = Archiver(prog='borg').build_parser() borgfs_parser = Archiver(prog='borgfs').build_parser() self.generate_level('', parser, Archiver, {'borgfs': borgfs_parser}) self.build_topic_pages(Archiver) self.build_intro_page() return 0 def generate_level(self, prefix, parser, Archiver, extra_choices=None): is_subcommand = False choices = {} for action in parser._actions: if action.choices is not None and 'SubParsersAction' in str(action.__class__): is_subcommand = True for cmd, parser in action.choices.items(): choices[prefix + cmd] = parser if extra_choices is not None: choices.update(extra_choices) if prefix and not choices: return for command, parser in sorted(choices.items()): if command.startswith('debug') or command == 'help': continue if command == "borgfs": man_title = command else: man_title = 'borg-' + command.replace(' ', '-') print('building man page', man_title + '(1)', file=sys.stderr) is_intermediary = self.generate_level(command + ' ', parser, Archiver) doc, write = self.new_doc() self.write_man_header(write, man_title, parser.description) self.write_heading(write, 'SYNOPSIS') if is_intermediary: subparsers = [action for action in parser._actions if 'SubParsersAction' in str(action.__class__)][0] for subcommand in subparsers.choices: write('| borg', '[common options]', command, subcommand, '...') self.see_also.setdefault(command, []).append(f'{command}-{subcommand}') else: if command == "borgfs": write(command, end='') else: write('borg', '[common options]', command, end='') self.write_usage(write, parser) write('\n') description, _, notes = parser.epilog.partition('\n.. man NOTES') if description: self.write_heading(write, 'DESCRIPTION') write(description) if not is_intermediary: self.write_heading(write, 'OPTIONS') write('See `borg-common(1)` for common options of Borg commands.') write() self.write_options(write, parser) self.write_examples(write, command) if notes: self.write_heading(write, 'NOTES') write(notes) self.write_see_also(write, man_title) self.gen_man_page(man_title, doc.getvalue()) # Generate the borg-common(1) man page with the common options. if 'create' in choices: doc, write = self.new_doc() man_title = 'borg-common' self.write_man_header(write, man_title, 'Common options of Borg commands') common_options = [group for group in choices['create']._action_groups if group.title == 'Common options'][0] self.write_heading(write, 'SYNOPSIS') self.write_options_group(write, common_options) self.write_see_also(write, man_title) self.gen_man_page(man_title, doc.getvalue()) return is_subcommand def build_topic_pages(self, Archiver): for topic, text in Archiver.helptext.items(): doc, write = self.new_doc() man_title = 'borg-' + topic print('building man page', man_title + '(1)', file=sys.stderr) self.write_man_header(write, man_title, 'Details regarding ' + topic) self.write_heading(write, 'DESCRIPTION') write(text) self.gen_man_page(man_title, doc.getvalue()) def build_intro_page(self): doc, write = self.new_doc() man_title = 'borg' print('building man page borg(1)', file=sys.stderr) with open('docs/man_intro.rst') as fd: man_intro = fd.read() self.write_man_header(write, man_title, "deduplicating and encrypting backup tool") self.gen_man_page(man_title, doc.getvalue() + man_intro) def new_doc(self): doc = io.StringIO(self.rst_prelude) doc.read() write = self.printer(doc) return doc, write def printer(self, fd): def write(*args, **kwargs): print(*args, file=fd, **kwargs) return write def write_heading(self, write, header, char='-', double_sided=False): write() if double_sided: write(char * len(header)) write(header) write(char * len(header)) write() def write_man_header(self, write, title, description): self.write_heading(write, title, '=', double_sided=True) self.write_heading(write, description, double_sided=True) # man page metadata write(':Author: The Borg Collective') source_date_epoch = int(os.environ.get("SOURCE_DATE_EPOCH", time.time())) write(':Date:', datetime.fromtimestamp(source_date_epoch, timezone.utc).date().isoformat()) write(':Manual section: 1') write(':Manual group: borg backup tool') write() def write_examples(self, write, command): command = command.replace(' ', '_') with open('docs/usage/%s.rst' % self.usage_group.get(command, command)) as fd: usage = fd.read() usage_include = '.. include:: %s.rst.inc' % command begin = usage.find(usage_include) end = usage.find('.. include', begin + 1) # If a command has a dedicated anchor, it will occur before the command's include. if 0 < usage.find('.. _', begin + 1) < end: end = usage.find('.. _', begin + 1) examples = usage[begin:end] examples = examples.replace(usage_include, '') examples = examples.replace('Examples\n~~~~~~~~', '') examples = examples.replace('Miscellaneous Help\n------------------', '') examples = examples.replace('``docs/misc/prune-example.txt``:', '``docs/misc/prune-example.txt``.') examples = examples.replace('.. highlight:: none\n', '') # we don't support highlight examples = re.sub('^(~+)$', lambda matches: '+' * len(matches.group(0)), examples, flags=re.MULTILINE) examples = examples.strip() if examples: self.write_heading(write, 'EXAMPLES', '-') write(examples) def write_see_also(self, write, man_title): see_also = self.see_also.get(man_title.replace('borg-', ''), ()) see_also = ['`borg-%s(1)`' % s for s in see_also] see_also.insert(0, '`borg-common(1)`') self.write_heading(write, 'SEE ALSO') write(', '.join(see_also)) def gen_man_page(self, name, rst): from docutils.writers import manpage from docutils.core import publish_string from docutils.nodes import inline from docutils.parsers.rst import roles def issue(name, rawtext, text, lineno, inliner, options={}, content=[]): return [inline(rawtext, '#' + text)], [] roles.register_local_role('issue', issue) # We give the source_path so that docutils can find relative includes # as-if the document where located in the docs/ directory. man_page = publish_string(source=rst, source_path='docs/%s.rst' % name, writer=manpage.Writer()) with open('docs/man/%s.1' % name, 'wb') as fd: fd.write(man_page) def write_usage(self, write, parser): if any(len(o.option_strings) for o in parser._actions): write(' [options] ', end='') for option in parser._actions: if option.option_strings: continue write(format_metavar(option), end=' ') def write_options(self, write, parser): for group in parser._action_groups: if group.title == 'Common options' or not group._group_actions: continue title = 'arguments' if group.title == 'positional arguments' else group.title self.write_heading(write, title, '+') self.write_options_group(write, group) def write_options_group(self, write, group): def is_positional_group(group): return any(not o.option_strings for o in group._group_actions) if is_positional_group(group): for option in group._group_actions: write(option.metavar) write(textwrap.indent(option.help or '', ' ' * 4)) return opts = OrderedDict() for option in group._group_actions: if option.metavar: option_fmt = '%s ' + option.metavar else: option_fmt = '%s' option_str = ', '.join(option_fmt % s for s in option.option_strings) option_desc = textwrap.dedent((option.help or '') % option.__dict__) opts[option_str] = textwrap.indent(option_desc, ' ' * 4) padding = len(max(opts)) + 1 for option, desc in opts.items(): write(option.ljust(padding), desc) cython_sources = """ src/borg/compress.pyx src/borg/crypto/low_level.pyx src/borg/chunker.pyx src/borg/hashindex.pyx src/borg/item.pyx src/borg/algorithms/checksums.pyx src/borg/platform/posix.pyx src/borg/platform/linux.pyx src/borg/platform/syncfilerange.pyx src/borg/platform/darwin.pyx src/borg/platform/freebsd.pyx src/borg/platform/windows.pyx """.strip().splitlines() def rm(file): try: os.unlink(file) except FileNotFoundError: return False else: return True class Clean: def run(self): for source in cython_sources: genc = source.replace('.pyx', '.c') rm(genc) compiled_glob = source.replace('.pyx', '.cpython*') for compiled in sorted(glob.glob(compiled_glob)): rm(compiled) return 0 def usage(): print(textwrap.dedent(""" Usage: python scripts/make.py clean # clean workdir (remove generated files) python scripts/make.py build_usage # build usage documentation python scripts/make.py build_man # build man pages """)) def main(argv): if len(argv) < 2 or len(argv) == 2 and argv[1] in ("-h", "--help"): usage() return 0 command = argv[1] if command == "clean": return Clean().run() if command == "build_usage": return BuildUsage().run() if command == "build_man": return BuildMan().run() usage() return 1 if __name__ == '__main__': rc = main(sys.argv) sys.exit(rc) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/scripts/msys2-build0000644000076500000240000000031114641074756016005 0ustar00twstaff#!/bin/bash # build borg.exe SETUPTOOLS_USE_DISTUTILS=stdlib pip install -e . pyinstaller -y scripts/borg.exe.spec # build sdist and wheel in dist/... SETUPTOOLS_USE_DISTUTILS=stdlib python -m build ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/scripts/msys2-install-deps0000644000076500000240000000040714641074756017313 0ustar00twstaff#!/bin/bash pacman -S --needed --noconfirm git mingw-w64-ucrt-x86_64-{toolchain,pkgconf,zstd,lz4,xxhash,openssl,python,cython,python-setuptools,python-wheel,python-build,python-pkgconfig,python-packaging,python-msgpack,python-pip} pip install pyinstaller==6.3.0 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/scripts/sdist-sign0000755000076500000240000000046114641074756015730 0ustar00twstaff#!/bin/bash R=$1 if [ "$R" = "" ]; then echo "Usage: sdist-sign 1.2.3" exit fi if [ "$QUBES_GPG_DOMAIN" = "" ]; then GPG=gpg else GPG=qubes-gpg-client-wrapper fi python -m build D=dist/borgbackup-$R.tar.gz $GPG --detach-sign --local-user "Thomas Waldmann" --armor --output $D.asc $D ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719958149.7385921 borgbackup-1.4.0/scripts/shell_completions/0000755000076500000240000000000014641075206017427 5ustar00twstaff././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719958149.7979572 borgbackup-1.4.0/scripts/shell_completions/bash/0000755000076500000240000000000014641075206020344 5ustar00twstaff././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/scripts/shell_completions/bash/borg0000644000076500000240000002144214641074756021234 0ustar00twstaff# Completions for borg # https://www.borgbackup.org/ # Note: # Listing archives works on password protected repositories only if $BORG_PASSPHRASE is set. # Install: # Copy this file to /usr/share/bash-completion/completions/ or /etc/bash_completion.d/ _borg() { compopt -o default COMPREPLY=() local cur="${COMP_WORDS[COMP_CWORD]}" local prev="${COMP_WORDS[COMP_CWORD-1]}" local prevprev="${COMP_WORDS[COMP_CWORD-2]}" local common_opts="-h --help --version --critical --error --warning --info -v --verbose --debug --debug-topic -p --progress --log-json --lock-wait --show-version --show-rc --umask --remote-path --remote-ratelimit --consider-part-files --debug-profile --rsh" local opts="${common_opts}" # Commands if [[ ${COMP_CWORD} == 1 ]] ; then local borg_commands="init create extract check rename list diff delete prune compact info mount umount key serve upgrade recreate export-tar with-lock break-lock config benchmark help" COMPREPLY=( $(compgen -W "${borg_commands}" -- ${cur}) ) compopt +o default return 0 fi case "${prev}" in 'key') COMPREPLY=( $(compgen -W "import export change-passphrase" -- ${cur}) ) return 0 ;; 'benchmark') COMPREPLY=( $(compgen -W "crud" -- ${cur}) ) return 0 ;; 'help') COMPREPLY=( $(compgen -W "patterns placeholders compression" -- ${cur}) ) return 0 ;; '--encryption' | '-e') local encryption_modes="none keyfile keyfile-blake2 repokey repokey-blake2 authenticated authenticated-blake2" COMPREPLY=( $(compgen -W "${encryption_modes}" -- ${cur}) ) return 0 ;; '--files-cache') local files_cache_mode="ctime,size,inode mtime,size,inode ctime,size mtime,size rechunk,ctime rechunk,mtime size disabled" COMPREPLY=( $(compgen -W "${files_cache_mode}" -- ${cur}) ) return 0 ;; '--compression' | '-C') local compression_methods="none auto lz4 zstd,1 zstd,2 zstd,3 zstd,4 zstd,5 zstd,6 zstd,7 zstd,8 zstd,9 zstd,10 zstd,11 zstd,12 zstd,13 zstd,14 zstd,15 zstd,16 zstd,17 zstd,18 zstd,19 zstd,20 zstd,21 zstd,22 zlib,1 zlib,2 zlib,3 zlib,4 zlib,5 zlib,6 zlib,7 zlib,8 zlib,9 lzma,0 lzma,1 lzma,2 lzma,3 lzma,4 lzma,5 lzma,6 lzma,7 lzma,8 lzma,9" COMPREPLY=( $(compgen -W "${compression_methods}" -- ${cur}) ) return 0 ;; '--sort-by') local sort_keys="timestamp name id" COMPREPLY=( $(compgen -W "${sort_keys}" -- ${cur}) ) return 0 ;; '-o') # FIXME This list is probably not full, but I tried to pick only those that are relevant to borg mount -o: local fuse_options="ac_attr_timeout= allow_damaged_files allow_other allow_root attr_timeout= auto auto_cache auto_unmount default_permissions entry_timeout= gid= group_id= kernel_cache max_read= negative_timeout= noauto noforget remember= remount rootmode= uid= umask= user user_id= versions" COMPREPLY=( $(compgen -W "${fuse_options}" -- ${cur}) ) return 0 ;; '--recompress') local recompress_when="if-different always never" COMPREPLY=( $(compgen -W "${recompress_when}" -- ${cur}) ) return 0 ;; esac if [[ ${cur} == -* ]] ; then case "${COMP_LINE}" in *' init '*) local opts="-e --encryption --append-only --storage-quota --make-parent-dirs ${common_opts}" ;; *' create '*) local opts="-n --dry-run -s --stats --list --filter --json --no-cache-sync --stdin-name --content-from-command -e --exclude --exclude-from --pattern --patterns-from --exclude-caches --exclude-if-present --keep-exclude-tags --exclude-nodump -x --one-file-system --numeric-owner --noatime --noctime --nobirthtime --nobsdflags --noacls --noxattrs --noflags --files-cache --read-special --comment --timestamp -c --checkpoint-interval --chunker-params -C --compression ${common_opts}" ;; *' extract '*) local opts="--list -n --dry-run --numeric-owner --nobsdflags --noacls --noxattrs --stdout --sparse -e --exclude --exclude-from --pattern --patterns-from --strip-components ${common_opts}" ;; *' check '*) local opts="--repository-only --archives-only --verify-data --repair --save-space --max-duration -P --prefix -a --glob-archives --sort-by --first --last ${common_opts}" ;; # rename # no specific options *" list "*) local opts="--short --format --json --json-lines -P --prefix -a --glob-archives --sort-by --first --last -e --exclude --exclude-from --pattern --patterns-from ${common_opts}" ;; *' diff '*) local opts="--numeric-owner --same-chunker-params --sort --json-lines -e --exclude --exclude-from --pattern --patterns-from ${common_opts}" ;; *' delete '*) local opts="-n --dry-run -s --stats --cache-only --force --save-space -P --prefix -a --glob-archives --sort-by --first --last ${common_opts}" ;; *' prune '*) local opts="-n --dry-run --force -s --stats --list --keep-within --keep-last --keep-secondly --keep-minutely -H --keep-hourly -d --keep-daily -w --keep-weekly -m --keep-monthly -y --keep-yearly --save-space -P --prefix -a --glob-archives ${common_opts}" ;; *' compact '*) local opts="--cleanup-commits ${common_opts}" ;; *' info '*) local opts="--json -P --prefix -a --glob-archives --sort-by --first --last ${common_opts}" ;; *' mount '*) local opts="-f --foreground -o -P --prefix -a --glob-archives --sort-by --first --last -e --exclude --exclude-from --pattern --patterns-from --strip-components ${common_opts}" ;; # umount # no specific options # key change-passphrase # no specific options *' export '*) local opts="--paper --qr-html ${common_opts}" ;; *' import '*) local opts="--paper ${common_opts}" ;; *' upgrade '*) local opts="-n --dry-run --inplace --force --tam --disable-tam ${common_opts}" ;; *' recreate '*) local opts="--list --filter -n dry-run -s stats -e exclude --exclude-from --pattern --patterns-from --exclude-caches --exclude-if-present --keep-exclude-tags --target -c checkpoint-interval --comment --timestamp --timestamp -C compression --recompress --chunker-params ${common_opts}" ;; *' export-tar '*) local opts="--tar-filter --list -e exclude --exclude-from --pattern --patterns-from --strip-components ${common_opts}" ;; *' serve '*) local opts="--restrict-to-path --restrict-to-repository --append-only --storage-quota ${common_opts}" ;; *' config '*) local opts="-c --cache -d --delete --list ${common_opts}" ;; # with-lock # no specific options # break-lock # no specific options # benchmark crud # no specific options esac COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) return 0 fi # Get the repository name if available # If there is a space before the "::" it means that no repository name was typed, # so probably $BORG_REPO was set and we can still list the archives. local repository_name="${COMP_LINE%%::*}" repository_name=${repository_name##* } # Listing archives. # Since "::" is treated as separate word in Bash, # it is $cur when the cursor is right behind it # and $prev if the user has started to type an archive name. local typed_word=${cur} local -i list_archives=0 if [[ ${cur} == "::" ]] ; then list_archives=1 typed_word="" fi if [[ ${prev} == "::" ]] ; then list_archives=1 fi # Second archive listing for borg diff if [[ ${COMP_LINE} =~ ^.*\ diff\ .*::[^\ ]+\ ${cur}$ ]] ; then list_archives=1 fi # Additional archive listing for borg delete if [[ ${COMP_LINE} =~ ^.*\ delete\ .*::[^\ ]+.*${cur}$ ]] ; then list_archives=1 fi if (( $list_archives )) ; then local archives=$(borg list --short "${repository_name}" 2>/dev/null) COMPREPLY=( $(compgen -W "${archives}" -- "${typed_word}" ) ) return 0 fi return 0 } complete -F _borg borg ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719958149.7981985 borgbackup-1.4.0/scripts/shell_completions/fish/0000755000076500000240000000000014641075206020360 5ustar00twstaff././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/scripts/shell_completions/fish/borg.fish0000644000076500000240000010157014641074756022201 0ustar00twstaff# Completions for borg # https://www.borgbackup.org/ # Note: # Listing archives works on password protected repositories only if $BORG_PASSPHRASE is set. # Install: # Copy this file to /usr/share/fish/vendor_completions.d/ # Commands complete -c borg -f -n __fish_is_first_token -a 'init' -d 'Initialize an empty repository' complete -c borg -f -n __fish_is_first_token -a 'create' -d 'Create new archive' complete -c borg -f -n __fish_is_first_token -a 'extract' -d 'Extract archive contents' complete -c borg -f -n __fish_is_first_token -a 'check' -d 'Check repository consistency' complete -c borg -f -n __fish_is_first_token -a 'rename' -d 'Rename an existing archive' complete -c borg -f -n __fish_is_first_token -a 'list' -d 'List archive or repository contents' complete -c borg -f -n __fish_is_first_token -a 'diff' -d 'Find differences between archives' complete -c borg -f -n __fish_is_first_token -a 'delete' -d 'Delete a repository or archive' complete -c borg -f -n __fish_is_first_token -a 'prune' -d 'Prune repository archives' complete -c borg -f -n __fish_is_first_token -a 'compact' -d 'Free repository space' complete -c borg -f -n __fish_is_first_token -a 'info' -d 'Show archive details' complete -c borg -f -n __fish_is_first_token -a 'mount' -d 'Mount archive or a repository' complete -c borg -f -n __fish_is_first_token -a 'umount' -d 'Un-mount the mounted archive' function __fish_borg_seen_key if __fish_seen_subcommand_from key and not __fish_seen_subcommand_from import export change-passphrase return 0 end return 1 end complete -c borg -f -n __fish_is_first_token -a 'key' -d 'Manage a repository key' complete -c borg -f -n __fish_borg_seen_key -a 'import' -d 'Import a repository key' complete -c borg -f -n __fish_borg_seen_key -a 'export' -d 'Export a repository key' complete -c borg -f -n __fish_borg_seen_key -a 'change-passphrase' -d 'Change key file passphrase' complete -c borg -f -n __fish_is_first_token -a 'serve' -d 'Start in server mode' complete -c borg -f -n __fish_is_first_token -a 'upgrade' -d 'Upgrade a repository' complete -c borg -f -n __fish_is_first_token -a 'recreate' -d 'Recreate contents of existing archives' complete -c borg -f -n __fish_is_first_token -a 'export-tar' -d 'Create tarball from an archive' complete -c borg -f -n __fish_is_first_token -a 'with-lock' -d 'Run a command while repository lock held' complete -c borg -f -n __fish_is_first_token -a 'break-lock' -d 'Break the repository lock' complete -c borg -f -n __fish_is_first_token -a 'config' -d 'Get/set options in repo/cache config' function __fish_borg_seen_benchmark if __fish_seen_subcommand_from benchmark and not __fish_seen_subcommand_from crud return 0 end return 1 end complete -c borg -f -n __fish_is_first_token -a 'benchmark' -d 'Benchmark borg operations' complete -c borg -f -n __fish_borg_seen_benchmark -a 'crud' -d 'Benchmark borg CRUD operations' function __fish_borg_seen_help if __fish_seen_subcommand_from help and not __fish_seen_subcommand_from patterns placeholders compression return 0 end return 1 end complete -c borg -f -n __fish_is_first_token -a 'help' -d 'Miscellaneous Help' complete -c borg -f -n __fish_borg_seen_help -a 'patterns' -d 'Help for patterns' complete -c borg -f -n __fish_borg_seen_help -a 'placeholders' -d 'Help for placeholders' complete -c borg -f -n __fish_borg_seen_help -a 'compression' -d 'Help for compression' # Common options complete -c borg -f -s h -l 'help' -d 'Show help information' complete -c borg -f -l 'version' -d 'Show version information' complete -c borg -f -l 'critical' -d 'Log level CRITICAL' complete -c borg -f -l 'error' -d 'Log level ERROR' complete -c borg -f -l 'warning' -d 'Log level WARNING (default)' complete -c borg -f -l 'info' -d 'Log level INFO' complete -c borg -f -s v -l 'verbose' -d 'Log level INFO' complete -c borg -f -l 'debug' -d 'Log level DEBUG' complete -c borg -f -l 'debug-topic' -d 'Enable TOPIC debugging' complete -c borg -f -s p -l 'progress' -d 'Show progress information' complete -c borg -f -l 'log-json' -d 'Output one JSON object per log line' complete -c borg -f -l 'lock-wait' -d 'Wait for lock max N seconds [1]' complete -c borg -f -l 'show-version' -d 'Log version information' complete -c borg -f -l 'show-rc' -d 'Log the return code' complete -c borg -f -l 'umask' -d 'Set umask to M [0077]' complete -c borg -l 'remote-path' -d 'Use PATH as remote borg executable' complete -c borg -f -l 'remote-ratelimit' -d 'Set remote network upload RATE limit' complete -c borg -f -l 'consider-part-files' -d 'Treat part files like normal files' complete -c borg -l 'debug-profile' -d 'Write execution profile into FILE' complete -c borg -l 'rsh' -d 'Use COMMAND instead of ssh' # borg init options set -l encryption_modes "none keyfile keyfile-blake2 repokey repokey-blake2 authenticated authenticated-blake2" complete -c borg -f -s e -l 'encryption' -d 'Encryption key MODE' -a "$encryption_modes" -n "__fish_seen_subcommand_from init" complete -c borg -f -l 'append-only' -d 'Create an append-only mode repository' -n "__fish_seen_subcommand_from init" complete -c borg -f -l 'storage-quota' -d 'Set storage QUOTA of the repository' -n "__fish_seen_subcommand_from init" complete -c borg -f -l 'make-parent-dirs' -d 'Create parent directories' -n "__fish_seen_subcommand_from init" # borg create options complete -c borg -f -s n -l 'dry-run' -d 'Do not change the repository' -n "__fish_seen_subcommand_from create" complete -c borg -f -s s -l 'stats' -d 'Print verbose statistics' -n "__fish_seen_subcommand_from create" complete -c borg -f -l 'list' -d 'Print verbose list of items' -n "__fish_seen_subcommand_from create" complete -c borg -f -l 'filter' -d 'Only items with given STATUSCHARS' -n "__fish_seen_subcommand_from create" complete -c borg -f -l 'json' -d 'Print verbose stats as json' -n "__fish_seen_subcommand_from create" complete -c borg -f -l 'no-cache-sync' -d 'Do not synchronize the cache' -n "__fish_seen_subcommand_from create" complete -c borg -f -l 'stdin-name' -d 'Use NAME in archive for stdin data' -n "__fish_seen_subcommand_from create" complete -c borg -f -l 'content-from-command' -d 'Interpret PATH as command and store its stdout' -n "__fish_seen_subcommand_from create" # Exclusion options complete -c borg -s e -l 'exclude' -d 'Exclude paths matching PATTERN' -n "__fish_seen_subcommand_from create" complete -c borg -l 'exclude-from' -d 'Read exclude patterns from EXCLUDEFILE' -n "__fish_seen_subcommand_from create" complete -c borg -f -l 'pattern' -d 'Include/exclude paths matching PATTERN' -n "__fish_seen_subcommand_from create" complete -c borg -l 'patterns-from' -d 'Include/exclude paths from PATTERNFILE' -n "__fish_seen_subcommand_from create" complete -c borg -f -l 'exclude-caches' -d 'Exclude directories tagged as cache' -n "__fish_seen_subcommand_from create" complete -c borg -l 'exclude-if-present' -d 'Exclude directories that contain FILENAME' -n "__fish_seen_subcommand_from create" complete -c borg -f -l 'keep-exclude-tags' -d 'Keep tag files of excluded directories' -n "__fish_seen_subcommand_from create" complete -c borg -f -l 'keep-tag-files' -d 'Keep tag files of excluded directories' -n "__fish_seen_subcommand_from create" complete -c borg -f -l 'exclude-nodump' -d 'Exclude files flagged NODUMP' -n "__fish_seen_subcommand_from create" # Filesystem options complete -c borg -f -s x -l 'one-file-system' -d 'Stay in the same file system' -n "__fish_seen_subcommand_from create" complete -c borg -f -l 'numeric-owner' -d 'Only store numeric user:group identifiers' -n "__fish_seen_subcommand_from create" complete -c borg -f -l 'noatime' -d 'Do not store atime' -n "__fish_seen_subcommand_from create" complete -c borg -f -l 'noctime' -d 'Do not store ctime' -n "__fish_seen_subcommand_from create" complete -c borg -f -l 'nobirthtime' -d 'Do not store creation date' -n "__fish_seen_subcommand_from create" complete -c borg -f -l 'nobsdflags' -d 'Do not store bsdflags' -n "__fish_seen_subcommand_from create" complete -c borg -f -l 'noacls' -d 'Do not read and store ACLs into archive' -n "__fish_seen_subcommand_from create" complete -c borg -f -l 'noxattrs' -d 'Do not read and store xattrs into archive' -n "__fish_seen_subcommand_from create" complete -c borg -f -l 'noflags' -d 'Do not store flags' -n "__fish_seen_subcommand_from create" set -l files_cache_mode "ctime,size,inode mtime,size,inode ctime,size mtime,size rechunk,ctime rechunk,mtime size disabled" complete -c borg -f -l 'files-cache' -d 'Operate files cache in MODE' -a "$files_cache_mode" -n "__fish_seen_subcommand_from create" complete -c borg -f -l 'read-special' -d 'Open device files like regular files' -n "__fish_seen_subcommand_from create" # Archive options complete -c borg -f -l 'comment' -d 'Add COMMENT to the archive' -n "__fish_seen_subcommand_from create" complete -c borg -f -l 'timestamp' -d 'Set creation TIME (yyyy-mm-ddThh:mm:ss)' -n "__fish_seen_subcommand_from create" complete -c borg -l 'timestamp' -d 'Set creation time by reference FILE' -n "__fish_seen_subcommand_from create" complete -c borg -f -s c -l 'checkpoint-interval' -d 'Write checkpoint every N seconds [1800]' -n "__fish_seen_subcommand_from create" complete -c borg -f -l 'chunker-params' -d 'Chunker PARAMETERS [19,23,21,4095]' -n "__fish_seen_subcommand_from create" set -l compression_methods "none auto lz4 zstd,1 zstd,2 zstd,3 zstd,4 zstd,5 zstd,6 zstd,7 zstd,8 zstd,9 zstd,10 zstd,11 zstd,12 zstd,13 zstd,14 zstd,15 zstd,16 zstd,17 zstd,18 zstd,19 zstd,20 zstd,21 zstd,22 zlib,1 zlib,2 zlib,3 zlib,4 zlib,5 zlib,6 zlib,7 zlib,8 zlib,9 lzma,0 lzma,1 lzma,2 lzma,3 lzma,4 lzma,5 lzma,6 lzma,7 lzma,8 lzma,9" complete -c borg -f -s C -l 'compression' -d 'Select compression ALGORITHM,LEVEL [lz4]' -a "$compression_methods" -n "__fish_seen_subcommand_from create" # borg extract options complete -c borg -f -l 'list' -d 'Print verbose list of items' -n "__fish_seen_subcommand_from extract" complete -c borg -f -s n -l 'dry-run' -d 'Do not actually extract any files' -n "__fish_seen_subcommand_from extract" complete -c borg -f -l 'numeric-owner' -d 'Only obey numeric user:group identifiers' -n "__fish_seen_subcommand_from extract" complete -c borg -f -l 'nobsdflags' -d 'Do not extract/set bsdflags' -n "__fish_seen_subcommand_from extract" complete -c borg -f -l 'noflags' -d 'Do not extract/set flags' -n "__fish_seen_subcommand_from extract" complete -c borg -f -l 'noacls' -d 'Do not extract/set ACLs' -n "__fish_seen_subcommand_from extract" complete -c borg -f -l 'noxattrs' -d 'Do not extract/set xattrs' -n "__fish_seen_subcommand_from extract" complete -c borg -f -l 'stdout' -d 'Write all extracted data to stdout' -n "__fish_seen_subcommand_from extract" complete -c borg -f -l 'sparse' -d 'Create holes in output sparse file' -n "__fish_seen_subcommand_from extract" # Exclusion options complete -c borg -s e -l 'exclude' -d 'Exclude paths matching PATTERN' -n "__fish_seen_subcommand_from extract" complete -c borg -l 'exclude-from' -d 'Read exclude patterns from EXCLUDEFILE' -n "__fish_seen_subcommand_from extract" complete -c borg -l 'pattern' -d 'Include/exclude paths matching PATTERN' -n "__fish_seen_subcommand_from extract" complete -c borg -l 'patterns-from' -d 'Include/exclude paths from PATTERNFILE' -n "__fish_seen_subcommand_from extract" complete -c borg -f -l 'strip-components' -d 'Remove NUMBER of leading path elements' -n "__fish_seen_subcommand_from extract" # borg check options complete -c borg -f -l 'repository-only' -d 'Only perform repository checks' -n "__fish_seen_subcommand_from check" complete -c borg -f -l 'archives-only' -d 'Only perform archives checks' -n "__fish_seen_subcommand_from check" complete -c borg -f -l 'verify-data' -d 'Cryptographic integrity verification' -n "__fish_seen_subcommand_from check" complete -c borg -f -l 'repair' -d 'Attempt to repair found inconsistencies' -n "__fish_seen_subcommand_from check" complete -c borg -f -l 'save-space' -d 'Work slower but using less space' -n "__fish_seen_subcommand_from check" complete -c borg -f -l 'max-duration' -d 'Partial repo check for max. SECONDS' -n "__fish_seen_subcommand_from check" # Archive filters complete -c borg -f -s P -l 'prefix' -d 'Only archive names starting with PREFIX' -n "__fish_seen_subcommand_from check" complete -c borg -f -s a -l 'glob-archives' -d 'Only archive names matching GLOB' -n "__fish_seen_subcommand_from check" set -l sort_keys "timestamp name id" complete -c borg -f -l 'sort-by' -d 'Sorting KEYS [timestamp]' -a "$sort_keys" -n "__fish_seen_subcommand_from check" complete -c borg -f -l 'first' -d 'Only first N archives' -n "__fish_seen_subcommand_from check" complete -c borg -f -l 'last' -d 'Only last N archives' -n "__fish_seen_subcommand_from check" # borg rename # no specific options # borg list options complete -c borg -f -l 'short' -d 'Only print file/directory names' -n "__fish_seen_subcommand_from list" complete -c borg -f -l 'format' -d 'Specify FORMAT for file listing' -n "__fish_seen_subcommand_from list" complete -c borg -f -l 'json' -d 'List contents in json format' -n "__fish_seen_subcommand_from list" complete -c borg -f -l 'json-lines' -d 'List contents in json lines format' -n "__fish_seen_subcommand_from list" # Archive filters complete -c borg -f -s P -l 'prefix' -d 'Only archive names starting with PREFIX' -n "__fish_seen_subcommand_from list" complete -c borg -f -s a -l 'glob-archives' -d 'Only archive names matching GLOB' -n "__fish_seen_subcommand_from list" complete -c borg -f -l 'sort-by' -d 'Sorting KEYS [timestamp]' -a "$sort_keys" -n "__fish_seen_subcommand_from list" complete -c borg -f -l 'first' -d 'Only first N archives' -n "__fish_seen_subcommand_from list" complete -c borg -f -l 'last' -d 'Only last N archives' -n "__fish_seen_subcommand_from list" # Exclusion options complete -c borg -s e -l 'exclude' -d 'Exclude paths matching PATTERN' -n "__fish_seen_subcommand_from list" complete -c borg -l 'exclude-from' -d 'Read exclude patterns from EXCLUDEFILE' -n "__fish_seen_subcommand_from list" complete -c borg -f -l 'pattern' -d 'Include/exclude paths matching PATTERN' -n "__fish_seen_subcommand_from list" complete -c borg -l 'patterns-from' -d 'Include/exclude paths from PATTERNFILE' -n "__fish_seen_subcommand_from list" # borg diff options complete -c borg -f -l 'numeric-owner' -d 'Only consider numeric user:group' -n "__fish_seen_subcommand_from diff" complete -c borg -f -l 'same-chunker-params' -d 'Override check of chunker parameters' -n "__fish_seen_subcommand_from diff" complete -c borg -f -l 'sort' -d 'Sort the output lines by file path' -n "__fish_seen_subcommand_from diff" complete -c borg -f -l 'json-lines' -d 'Format output as JSON Lines' -n "__fish_seen_subcommand_from diff" # Exclusion options complete -c borg -s e -l 'exclude' -d 'Exclude paths matching PATTERN' -n "__fish_seen_subcommand_from diff" complete -c borg -l 'exclude-from' -d 'Read exclude patterns from EXCLUDEFILE' -n "__fish_seen_subcommand_from diff" complete -c borg -f -l 'pattern' -d 'Include/exclude paths matching PATTERN' -n "__fish_seen_subcommand_from diff" complete -c borg -l 'patterns-from' -d 'Include/exclude paths from PATTERNFILE' -n "__fish_seen_subcommand_from diff" # borg delete options complete -c borg -f -s n -l 'dry-run' -d 'Do not change the repository' -n "__fish_seen_subcommand_from delete" complete -c borg -f -s s -l 'stats' -d 'Print verbose statistics' -n "__fish_seen_subcommand_from delete" complete -c borg -f -l 'cache-only' -d "Delete only the local cache" -n "__fish_seen_subcommand_from delete" complete -c borg -f -l 'force' -d 'Force deletion of corrupted archives' -n "__fish_seen_subcommand_from delete" complete -c borg -f -l 'save-space' -d 'Work slower but using less space' -n "__fish_seen_subcommand_from delete" # Archive filters complete -c borg -f -s P -l 'prefix' -d 'Only archive names starting with PREFIX' -n "__fish_seen_subcommand_from delete" complete -c borg -f -s a -l 'glob-archives' -d 'Only archive names matching GLOB' -n "__fish_seen_subcommand_from delete" complete -c borg -f -l 'sort-by' -d 'Sorting KEYS [timestamp]' -a "$sort_keys" -n "__fish_seen_subcommand_from delete" complete -c borg -f -l 'first' -d 'Only first N archives' -n "__fish_seen_subcommand_from delete" complete -c borg -f -l 'last' -d 'Only last N archives' -n "__fish_seen_subcommand_from delete" # borg prune options complete -c borg -f -s n -l 'dry-run' -d 'Do not change the repository' -n "__fish_seen_subcommand_from prune" complete -c borg -f -l 'force' -d 'Force pruning of corrupted archives' -n "__fish_seen_subcommand_from prune" complete -c borg -f -s s -l 'stats' -d 'Print verbose statistics' -n "__fish_seen_subcommand_from prune" complete -c borg -f -l 'list' -d 'Print verbose list of items' -n "__fish_seen_subcommand_from prune" complete -c borg -f -l 'keep-within' -d 'Keep archives within time INTERVAL' -n "__fish_seen_subcommand_from prune" complete -c borg -f -l 'keep-last' -d 'NUMBER of secondly archives to keep' -n "__fish_seen_subcommand_from prune" complete -c borg -f -l 'keep-secondly' -d 'NUMBER of secondly archives to keep' -n "__fish_seen_subcommand_from prune" complete -c borg -f -l 'keep-minutely' -d 'NUMBER of minutely archives to keep' -n "__fish_seen_subcommand_from prune" complete -c borg -f -s H -l 'keep-hourly' -d 'NUMBER of hourly archives to keep' -n "__fish_seen_subcommand_from prune" complete -c borg -f -s d -l 'keep-daily' -d 'NUMBER of daily archives to keep' -n "__fish_seen_subcommand_from prune" complete -c borg -f -s w -l 'keep-weekly' -d 'NUMBER of weekly archives to keep' -n "__fish_seen_subcommand_from prune" complete -c borg -f -s m -l 'keep-monthly' -d 'NUMBER of monthly archives to keep' -n "__fish_seen_subcommand_from prune" complete -c borg -f -s y -l 'keep-yearly' -d 'NUMBER of yearly archives to keep' -n "__fish_seen_subcommand_from prune" complete -c borg -f -l 'save-space' -d 'Work slower but using less space' -n "__fish_seen_subcommand_from prune" # Archive filters complete -c borg -f -s P -l 'prefix' -d 'Only archive names starting with PREFIX' -n "__fish_seen_subcommand_from prune" complete -c borg -f -s a -l 'glob-archives' -d 'Only archive names matching GLOB' -n "__fish_seen_subcommand_from prune" # borg compact options complete -c borg -f -s n -l 'cleanup-commits' -d 'Cleanup commit-only segment files' -n "__fish_seen_subcommand_from compact" # borg info options complete -c borg -f -l 'json' -d 'Format output in json format' -n "__fish_seen_subcommand_from info" # Archive filters complete -c borg -f -s P -l 'prefix' -d 'Only archive names starting with PREFIX' -n "__fish_seen_subcommand_from info" complete -c borg -f -s a -l 'glob-archives' -d 'Only archive names matching GLOB' -n "__fish_seen_subcommand_from info" complete -c borg -f -l 'sort-by' -d 'Sorting KEYS [timestamp]' -a "$sort_keys" -n "__fish_seen_subcommand_from info" complete -c borg -f -l 'first' -d 'Only first N archives' -n "__fish_seen_subcommand_from info" complete -c borg -f -l 'last' -d 'Only last N archives' -n "__fish_seen_subcommand_from info" # borg mount options complete -c borg -f -s f -l 'foreground' -d 'Stay in foreground, do not daemonize' -n "__fish_seen_subcommand_from mount" # FIXME This list is probably not full, but I tried to pick only those that are relevant to borg mount -o: set -l fuse_options "ac_attr_timeout= allow_damaged_files allow_other allow_root attr_timeout= auto auto_cache auto_unmount default_permissions entry_timeout= gid= group_id= kernel_cache max_read= negative_timeout= noauto noforget remember= remount rootmode= uid= umask= user user_id= versions" complete -c borg -f -s o -d 'Fuse mount OPTION' -a "$fuse_options" -n "__fish_seen_subcommand_from mount" # Archive filters complete -c borg -f -s P -l 'prefix' -d 'Only archive names starting with PREFIX' -n "__fish_seen_subcommand_from mount" complete -c borg -f -s a -l 'glob-archives' -d 'Only archive names matching GLOB' -n "__fish_seen_subcommand_from mount" complete -c borg -f -l 'sort-by' -d 'Sorting KEYS [timestamp]' -a "$sort_keys" -n "__fish_seen_subcommand_from mount" complete -c borg -f -l 'first' -d 'Only first N archives' -n "__fish_seen_subcommand_from mount" complete -c borg -f -l 'last' -d 'Only last N archives' -n "__fish_seen_subcommand_from mount" # Exclusion options complete -c borg -s e -l 'exclude' -d 'Exclude paths matching PATTERN' -n "__fish_seen_subcommand_from mount" complete -c borg -l 'exclude-from' -d 'Read exclude patterns from EXCLUDEFILE' -n "__fish_seen_subcommand_from mount" complete -c borg -f -l 'pattern' -d 'Include/exclude paths matching PATTERN' -n "__fish_seen_subcommand_from mount" complete -c borg -l 'patterns-from' -d 'Include/exclude paths from PATTERNFILE' -n "__fish_seen_subcommand_from mount" complete -c borg -f -l 'strip-components' -d 'Remove NUMBER of leading path elements' -n "__fish_seen_subcommand_from mount" # borg umount # no specific options # borg key change-passphrase # no specific options # borg key export complete -c borg -f -l 'paper' -d 'Create an export for printing' -n "__fish_seen_subcommand_from export" complete -c borg -f -l 'qr-html' -d 'Create an html file for printing and qr' -n "__fish_seen_subcommand_from export" # borg key import complete -c borg -f -l 'paper' -d 'Import from a backup done with --paper' -n "__fish_seen_subcommand_from import" # borg upgrade complete -c borg -f -s n -l 'dry-run' -d 'Do not change the repository' -n "__fish_seen_subcommand_from upgrade" complete -c borg -f -l 'inplace' -d 'Rewrite repository in place' -n "__fish_seen_subcommand_from upgrade" complete -c borg -f -l 'force' -d 'Force upgrade' -n "__fish_seen_subcommand_from upgrade" complete -c borg -f -l 'tam' -d 'Enable manifest authentication' -n "__fish_seen_subcommand_from upgrade" complete -c borg -f -l 'disable-tam' -d 'Disable manifest authentication' -n "__fish_seen_subcommand_from upgrade" # borg recreate complete -c borg -f -l 'list' -d 'Print verbose list of items' -n "__fish_seen_subcommand_from recreate" complete -c borg -f -l 'filter' -d 'Only items with given STATUSCHARS' -n "__fish_seen_subcommand_from recreate" complete -c borg -f -s n -l 'dry-run' -d 'Do not change the repository' -n "__fish_seen_subcommand_from recreate" complete -c borg -f -s s -l 'stats' -d 'Print verbose statistics' -n "__fish_seen_subcommand_from recreate" # Exclusion options complete -c borg -s e -l 'exclude' -d 'Exclude paths matching PATTERN' -n "__fish_seen_subcommand_from recreate" complete -c borg -l 'exclude-from' -d 'Read exclude patterns from EXCLUDEFILE' -n "__fish_seen_subcommand_from recreate" complete -c borg -f -l 'pattern' -d 'Include/exclude paths matching PATTERN' -n "__fish_seen_subcommand_from recreate" complete -c borg -l 'patterns-from' -d 'Include/exclude paths from PATTERNFILE' -n "__fish_seen_subcommand_from recreate" complete -c borg -f -l 'exclude-caches' -d 'Exclude directories tagged as cache' -n "__fish_seen_subcommand_from recreate" complete -c borg -l 'exclude-if-present' -d 'Exclude directories that contain FILENAME' -n "__fish_seen_subcommand_from recreate" complete -c borg -f -l 'keep-exclude-tags' -d 'Keep tag files of excluded directories' -n "__fish_seen_subcommand_from recreate" # Archive options complete -c borg -f -l 'target' -d "Create a new ARCHIVE" -n "__fish_seen_subcommand_from recreate" complete -c borg -f -s c -l 'checkpoint-interval' -d 'Write checkpoint every N seconds [1800]' -n "__fish_seen_subcommand_from recreate" complete -c borg -f -l 'comment' -d 'Add COMMENT to the archive' -n "__fish_seen_subcommand_from recreate" complete -c borg -f -l 'timestamp' -d 'Set creation TIME (yyyy-mm-ddThh:mm:ss)' -n "__fish_seen_subcommand_from recreate" complete -c borg -l 'timestamp' -d 'Set creation time using reference FILE' -n "__fish_seen_subcommand_from recreate" complete -c borg -f -s C -l 'compression' -d 'Select compression ALGORITHM,LEVEL [lz4]' -a "$compression_methods" -n "__fish_seen_subcommand_from recreate" set -l recompress_when "if-different always never" complete -c borg -f -l 'recompress' -d 'Recompress chunks CONDITION' -a "$recompress_when" -n "__fish_seen_subcommand_from recreate" complete -c borg -f -l 'chunker-params' -d 'Chunker PARAMETERS [19,23,21,4095]' -n "__fish_seen_subcommand_from recreate" # borg export-tar options complete -c borg -l 'tar-filter' -d 'Filter program to pipe data through' -n "__fish_seen_subcommand_from export-tar" complete -c borg -f -l 'list' -d 'Print verbose list of items' -n "__fish_seen_subcommand_from export-tar" # Exclusion options complete -c borg -s e -l 'exclude' -d 'Exclude paths matching PATTERN' -n "__fish_seen_subcommand_from recreate" complete -c borg -l 'exclude-from' -d 'Read exclude patterns from EXCLUDEFILE' -n "__fish_seen_subcommand_from recreate" complete -c borg -f -l 'pattern' -d 'Include/exclude paths matching PATTERN' -n "__fish_seen_subcommand_from recreate" complete -c borg -l 'patterns-from' -d 'Include/exclude paths from PATTERNFILE' -n "__fish_seen_subcommand_from recreate" complete -c borg -f -l 'strip-components' -d 'Remove NUMBER of leading path elements' -n "__fish_seen_subcommand_from recreate" # borg serve complete -c borg -l 'restrict-to-path' -d 'Restrict repository access to PATH' -n "__fish_seen_subcommand_from serve" complete -c borg -l 'restrict-to-repository' -d 'Restrict repository access at PATH' -n "__fish_seen_subcommand_from serve" complete -c borg -f -l 'append-only' -d 'Only allow appending to repository' -n "__fish_seen_subcommand_from serve" complete -c borg -f -l 'storage-quota' -d 'Override storage QUOTA of the repository' -n "__fish_seen_subcommand_from serve" # borg config complete -c borg -f -s c -l 'cache' -d 'Get/set/list values in the repo cache' -n "__fish_seen_subcommand_from config" complete -c borg -f -s d -l 'delete' -d 'Delete the KEY from the config' -n "__fish_seen_subcommand_from config" complete -c borg -f -l 'list' -d 'List the configuration of the repo' -n "__fish_seen_subcommand_from config" # borg with-lock # no specific options # borg break-lock # no specific options # borg benchmark # no specific options # borg help # no specific options # List repositories::archives function __fish_borg_is_argument_n --description 'Test if current argument is on Nth place' --argument n set tokens (commandline --current-process --tokenize --cut-at-cursor) set -l tokencount 0 for token in $tokens switch $token case '-*' # ignore command line switches case '*' set tokencount (math $tokencount+1) end end return (test $tokencount -eq $n) end function __fish_borg_is_dir_a_repository set -l config_content if test -f $argv[1]/README and test -f $argv[1]/config read config_content < $argv[1]/config 2>/dev/null end return (string match --quiet '[repository]' $config_content) end function __fish_borg_list_repos_or_archives if string match --quiet --regex '.*::' '"'(commandline --current-token)'"' # If the current token contains "::" then list the archives: set -l repository_name (string replace --regex '::.*' '' (commandline --current-token)) borg list --format="$repository_name::{archive}{TAB}{comment}{NEWLINE}" "$repository_name" 2>/dev/null else # Otherwise list the repositories, directories and user@host entries: set -l directories (commandline --cut-at-cursor --current-token)*/ for directoryname in $directories if __fish_borg_is_dir_a_repository $directoryname printf '%s::\t%s\n' (string trim --right --chars='/' $directoryname) "Repository" else printf '%s\n' $directoryname end end __fish_complete_user_at_hosts | string replace --regex '$' ':' end end complete -c borg -f -n "__fish_borg_is_argument_n 2" -a '(__fish_borg_list_repos_or_archives)' # Additional archive listings function __fish_borg_is_diff_second_archive return (string match --quiet --regex ' diff .*::[^ ]+ '(commandline --current-token)'$' (commandline)) end function __fish_borg_is_delete_additional_archive return (string match --quiet --regex ' delete .*::[^ ]+ ' (commandline)) end function __fish_borg_list_only_archives set -l repo_matches (string match --regex '([^ ]*)::' (commandline)) borg list --format="{archive}{TAB}{comment}{NEWLINE}" "$repo_matches[2]" 2>/dev/null end complete -c borg -f -n __fish_borg_is_diff_second_archive -a '(__fish_borg_list_only_archives)' complete -c borg -f -n __fish_borg_is_delete_additional_archive -a '(__fish_borg_list_only_archives)' ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719958149.7989101 borgbackup-1.4.0/scripts/shell_completions/zsh/0000755000076500000240000000000014641075206020233 5ustar00twstaff././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/scripts/shell_completions/zsh/_borg0000644000076500000240000015723114641074756021270 0ustar00twstaff#compdef borg borgfs -P -value-,BORG_*,-default- # Zsh completion for Borg Backup 1.2.0a9 (2020-09-27). # # Recommended _borg specific settings: # # zstyle -e ':completion:*:*:borg-*:argument-rest:*' tag-order \ # '[[ $words[CURRENT] == -* ]] && reply=( "! archives archive-files" "-" )' # zstyle ':completion:*:*:(borg|-value-,BORG_)*' sort false # zstyle ':completion:*:*:borg-config:argument-2:keys' list-grouped false # zstyle ':completion:*:*:borg-*:*' gain-privileges true # zstyle ':completion:*' fake-parameters 'BORG_REPO:scalar' # # Custom styles: # # archive-description-format # Default: `{archive:<36} {time} [{id}]`. # archive-sort # In which order archive names should be listed. # Possible values are: `inverse`, `timestamp`, `name`, `id`. # file-description-format # Default: `{mode} {user:6} {group:6} {size:8d} {mtime} {path}{extra}`. # path-style-selector # Style selector used to select a path (when Borg would use either `pp` or `pf`). # Default: `fm`. # repository-suffix # This boolean style controls whether to add the `::` auto-removable suffix to a repository. # Default: `true`. (( $+functions[_borg_commands] )) || _borg_commands() { local -a commands_=( 'benchmark:benchmark command' 'break-lock:break the repository lock' 'check:check repository consistency' 'compact:compact segment files in the repository' 'config:get, set, and delete values in a repository or cache config file' 'create:create new archive' 'debug:debugging command (not intended for normal use)' 'delete:delete an existing repository or archives' 'diff:diff contents of two archives' 'export-tar:export archive contents as a tarball' 'extract:extract archive contents' 'help:extra help' 'info:show repository or archive information' 'init:initialize an empty repository' 'key:manage repository key' 'list:list archive or repository contents' 'mount:mount archive or an entire repository as a FUSE filesystem' 'prune:prune repository archives according to specified rules' 'recreate:re-create archives' 'rename:rename an existing archive' 'serve:start in server mode' 'umount:un-mount the FUSE filesystem' 'upgrade:upgrade a repository from a previous version' 'with-lock:run a user specified command with the repository lock held' ) _describe -t commands 'borg commands' commands_ } (( $+functions[_borg-benchmark] )) || _borg-benchmark() { local -a common_options __borg_setup_common_options _arguments -s -w -S : \ $common_options \ ':type:(crud)' \ ': :_borg_repository' \ ':PATH:_files' } (( $+functions[_borg-break-lock] )) || _borg-break-lock() { local -a common_options __borg_setup_common_options _arguments -s -w -S : \ $common_options \ ':: :_borg_repository' } (( $+functions[_borg-check] )) || _borg-check() { local -a common_options common_archive_filters_options __borg_setup_common_options __borg_setup_common_archive_filters_options _arguments -s -w -S : \ '--repository-only[only perform repository checks]' \ '--archives-only[only perform archives checks]' \ '(--repository-only)--verify-data[perform cryptographic archive data integrity verification]' \ '--repair[attempt to repair any inconsistencies found]' \ '--save-space[work slower, but using less space]' \ '--max-duration=[partial repo check for max. SECONDS]: : _borg_guard_unsigned_number "SECONDS"' \ $common_archive_filters_options \ $common_options \ '::REPOSITORY_OR_ARCHIVE: _borg_repository_or_archive' } (( $+functions[_borg-compact] )) || _borg-compact() { local -a common_options __borg_setup_common_options _arguments -s -w -S : \ $common_options \ '--cleanup-commits[cleanup commit-only 17-byte segment files]' \ '--threshold=[set minimum threshold for saved space in PERCENT (default: 10)]: : _borg_guard_unsigned_number "PERCENT (default\: 10)"' \ ':: :_borg_repository' } (( $+functions[_borg-config] )) || _borg-config() { local -a common_options __borg_setup_common_options _arguments -s -w -S : \ '(-c --cache)'{-c,--cache}'[get and set values from the repo cache]' \ '(-d --delete)'{-d,--delete}'[delete the key from the config]' \ '(-l --list)'{-l,--list}'[list the configuration of the repo]' \ $common_options \ ': :_borg_repository' \ ': : _borg_config $line[1]' \ '::VALUE' } (( $+functions[_borg-create] )) || _borg-create() { local -a common_options common_create_options state line local curcontext="$curcontext" state_descr declare -A opt_args local -i ret=1 __borg_setup_common_options __borg_setup_common_create_options local lastspec='*:PATH:_files' (( $words[(I)--content-from-command] )) && lastspec='*:::PATH:->command' _arguments -C -s -w -S : \ '*'{-e,--exclude}'=[exclude paths matching PATTERN]: : _borg_style_selector_or_archive_files -f -e "$line[1]" fm "${(@)line[2,-1]}"' \ '*--pattern=[experimental: include/exclude paths matching PATTERN]: : _borg_style_selector_or_archive_files -p -f -e "$line[1]" sh "${(@)line[2,-1]}"' \ $common_create_options \ '(-s --stats)--json[Output stats as JSON. Implies --stats.]' \ '--no-cache-sync[experimental: do not synchronize the cache. Implies not using the files cache.]' \ '--stdin-name=[use NAME in archive for stdin data (default: "stdin")]:NAME' \ '--content-from-command[interpret PATH as command and store its stdout]' \ '--exclude-nodump[exclude files flagged NODUMP]' \ '(-x --one-file-system)'{-x,--one-file-system}'[stay in the same file system]' \ '--numeric-owner[only store numeric user and group identifiers]' \ '--noatime[do not store atime into archive]' \ '--atime[do store atime into archive]' \ '--noctime[do not store ctime into archive]' \ '--nobirthtime[do not store birthtime (creation date) into archive]' \ '--nobsdflags[deprecated, use --noflags instead]' \ '--noacls[do not read and store ACLs into archive]' \ '--noxattrs[do not read and store xattrs into archive]' \ '--noflags[do not read and store flags (e.g. NODUMP, IMMUTABLE) into archive]' \ '--files-cache=[operate files cache in MODE. default: ctime,size,inode]:MODE:(ctime,size,inode mtime,size,inode ctime,size mtime,size rechunk,ctime rechunk,mtime size disabled)' \ '--read-special[open and read block and char device files as well as FIFOs as if they were regular files]' \ $common_options \ ':ARCHIVE: _borg_repository_or_archive -a -p' \ $lastspec && ret=0 case $state in (command) if (( CURRENT <= 1 )); then _command_names -e && ret=0 else _normal && ret=0 fi ;; esac return ret } (( $+functions[_borg-debug] )) || _borg-debug() { local -a state line common_options local curcontext="$curcontext" state_descr declare -A opt_args local -i ret=1 __borg_setup_common_options _arguments -s -w -C : \ $common_options \ ': :->command' \ '*:: :->option-or-argument' && ret=0 case $state in (command) local -a debug_commands=( 'info:show system infos for debugging / bug reports' 'dump-archive-items:dump archive items (metadata)' 'dump-archive:dump decoded archive metadata' 'dump-manifest:dump decoded repository metadata' 'dump-repo-objs:dump repo objects' 'search-repo-objs:search repo objects' 'get-obj:get object from repository' 'put-obj:put object to repository' 'delete-obj:delete object from repository' 'refcount-obj:show refcount for object from repository' 'dump-hints:dump repository hints' 'convert-profile:convert Borg profile to Python profile' ) _describe -t commands 'command' debug_commands && ret=0 ;; (option-or-argument) curcontext="${curcontext%:*}-$line[1]:" case $line[1] in (info) _arguments -s -w -S : \ $common_options && ret=0 ;; (dump-archive-items) _arguments -s -w -S : \ $common_options \ ':ARCHIVE: _borg_repository_or_archive -a' && ret=0 ;; (dump-archive) _arguments -s -w -S : \ $common_options \ ':ARCHIVE: _borg_repository_or_archive -a' \ ':PATH:_files' && ret=0 ;; (dump-manifest) _arguments -s -w -S : \ $common_options \ ': :_borg_repository' \ ':PATH:_files' && ret=0 ;; (dump-repo-objs) _arguments -s -w -S : \ $common_options \ ': :_borg_repository' && ret=0 ;; (search-repo-objs) _arguments -s -w -S : \ $common_options \ ': :_borg_repository' \ ':WANTED (hex or string):' && ret=0 ;; (get-obj) _arguments -s -w -S : \ $common_options \ ': :_borg_repository' \ ':ID (hex object):' \ ':PATH:_files' && ret=0 ;; (put-obj) _arguments -s -w -S : \ $common_options \ ': :_borg_repository' \ '*:PATH:_files' && ret=0 ;; (delete-obj) _arguments -s -w -S : \ $common_options \ ': :_borg_repository' \ '*:ID (hex object):' && ret=0 ;; (refcount-obj) _arguments -s -w -S : \ $common_options \ ': :_borg_repository' \ '*:ID (hex object):' && ret=0 ;; (dump-hints) _arguments -s -w -S : \ $common_options \ ': :_borg_repository' \ '*:PATH:_files' && ret=0 ;; (convert-profile) _arguments -s -w -S : \ $common_options \ ':INPUT:_files' \ ':OUTPUT:_files' && ret=0 ;; (*) if ! _call_function ret _borg_debug_$line[1]; then _default && ret=0 fi ;; esac ;; esac return ret } (( $+functions[_borg-delete] )) || _borg-delete() { local -a common_options common_archive_filters_options common_dry_run_stats_options __borg_setup_common_options __borg_setup_common_archive_filters_options __borg_setup_common_dry_run_stats_options _arguments -s -w -S : \ $common_dry_run_stats_options \ '--cache-only[delete only the local cache for the given repository]' \ '*--force[force deletion of corrupted archives, use "--force --force" in case "--force" does not work]' \ '--keep-security-info[keep the local security info when deleting a repository]' \ '--save-space[work slower, but using less space]' \ $common_archive_filters_options \ $common_options \ ':REPOSITORY_OR_ARCHIVE: _borg_repository_or_archive' \ '*:ARCHIVE: _borg_archive "${line[1]%%::*}"' } (( $+functions[_borg-diff] )) || _borg-diff() { local -a common_options common_exclude_options __borg_setup_common_options __borg_setup_common_exclude_options _arguments -s -w -S : \ '--numeric-owner[only obey numeric user and group identifiers]' \ '--same-chunker-params[override check of chunker parameters]' \ '--sort[sort the output lines by file path]' \ '--json-lines[format output as JSON Lines]' \ $common_exclude_options \ $common_options \ ':ARCHIVE1: _borg_repository_or_archive -a' \ ':ARCHIVE2: _borg_archive "${line[1]%%::*}"' \ '*: : _borg_style_selector_or_archive_files -e "$line[1]" pp' } (( $+functions[_borg-export-tar] )) || _borg-export-tar() { local -a common_options common_exclude_extract_options __borg_setup_common_options __borg_setup_common_exclude_extract_options _arguments -s -w -S : \ '--tar-filter[filter program to pipe data through]: :_cmdstring' \ '--list[output verbose list of items (files, dirs, ...)]' \ $common_exclude_extract_options \ $common_options \ ':ARCHIVE: _borg_repository_or_archive -a' \ ':FILE:_files' \ '*: : _borg_style_selector_or_archive_files -e "$line[1]" pp' } (( $+functions[_borg-extract] )) || _borg-extract() { local -a common_options common_exclude_extract_options __borg_setup_common_options __borg_setup_common_exclude_extract_options _arguments -s -w -S : \ '--list[output verbose list of items (files, dirs, ...)]' \ '(-n --dry-run)'{-n,--dry-run}'[do not actually change any files]' \ '--numeric-owner[only obey numeric user and group identifiers]' \ '--nobsdflags[deprecated, use --noflags instead]' \ '--noacls[do not extract/set ACLs]' \ '--noxattrs[do not extract/set xattrs]' \ '--noflags[do not extract/set flags (e.g. NODUMP, IMMUTABLE)]' \ '--stdout[write all extracted data to stdout]' \ '--sparse[create holes in output sparse file from all-zero chunks]' \ $common_exclude_extract_options \ $common_options \ ':ARCHIVE: _borg_repository_or_archive -a' \ '*: : _borg_style_selector_or_archive_files -e "$line[1]" pp' } (( $+functions[_borg-help] )) || _borg-help() { local -a common_options __borg_setup_common_options _arguments -s -w -S : \ '--epilog-only' \ '--usage-only' \ $common_options \ ':: : _alternative "topics:TOPIC:(patterns placeholders compression)" ": :_borg_commands"' } (( $+functions[_borg-info] )) || _borg-info() { local -a common_options common_archive_filters_options __borg_setup_common_options __borg_setup_common_archive_filters_options _arguments -s -w -S : \ '--json[format output as JSON]' \ $common_archive_filters_options \ $common_options \ '::REPOSITORY_OR_ARCHIVE: _borg_repository_or_archive' } (( $+functions[_borg-init] )) || _borg-init() { local -i ret=1 local -a common_options common_init_options __borg_setup_common_options __borg_setup_common_init_options # special handling for the required optional argument if (( ! ${words[(I)(-e|--encryption)(|=*)]} )); then local desc='select encryption key mode' local -a long=( "--encryption:$desc" ) short=( "-e:$desc" ) remove_chars=( -r '= \t\n\-' ) _describe -t required-options 'required option' long -S '=' $remove_chars -- short $remove_chars && ret=0 fi _arguments -s -w -S : \ '(-e --encryption)'{-e,--encryption}'=[select encryption key mode (required)]:MODE:(none keyfile keyfile-blake2 repokey repokey-blake2 authenticated authenticated-blake2)' \ $common_init_options \ '--make-parent-dirs[create parent directories]' \ '::REPOSITORY:_directories' && ret=0 return ret } (( $+functions[_borg-key] )) || _borg-key() { local -a state line common_options local curcontext="$curcontext" state_descr declare -A opt_args local -i ret=1 __borg_setup_common_options _arguments -s -w -C : \ $common_options \ ': :->command' \ '*:: :->option-or-argument' && ret=0 case $state in (command) local -a key_commands=( 'change-passphrase:Change repository key file passphrase' 'export:Export the repository key for backup' 'import:Import the repository key from backup' 'migrate-to-repokey:Migrate passphrase -> repokey' ) _describe -t commands 'command' key_commands && ret=0 ;; (option-or-argument) curcontext="${curcontext%:*}-$line[1]:" case $line[1] in (change-passphrase) _arguments -s -w -S : \ $common_options \ ': :_borg_repository' && ret=0 ;; (export) _arguments -s -w -S : \ '--paper[create an export suitable for printing and later type-in]' \ '--qr-html[create an html file suitable for printing and later type-in or qr scan]' \ $common_options \ ': :_borg_repository' \ '::PATH:_files' && ret=0 ;; (import) _arguments -s -w -S : \ '--paper[interactively import from a backup done with --paper]' \ $common_options \ ': :_borg_repository' \ '::PATH:_files' && ret=0 ;; (migrate-to-repokey) _arguments -s -w -S : \ $common_options \ ':: :_borg_repository' && ret=0 ;; (*) if ! _call_function ret _borg_key_$line[1]; then _default && ret=0 fi ;; esac ;; esac return ret } (( $+functions[_borg-list] )) || _borg-list() { local -a common_options common_exclude_options common_archive_filters_options __borg_setup_common_options __borg_setup_common_exclude_options __borg_setup_common_archive_filters_options _arguments -s -w -S : \ '--consider-checkpoints[show checkpoint archives in the repository contents list (default: hidden)]' \ '--short[only print file/directory names, nothing else]' \ {--format,--list-format}'=[specify format for file listing]:FORMAT: _borg_format_keys $line[1]' \ '--json[Only valid for listing repository contents. Format output as JSON.]' \ '--json-lines[Only valid for listing archive contents. Format output as JSON Lines.]' \ $common_archive_filters_options \ $common_exclude_options \ $common_options \ ':REPOSITORY_OR_ARCHIVE: _borg_repository_or_archive' \ '*: : _borg_style_selector_or_archive_files -e "$line[1]" pp' } (( $+functions[_borg-mount] )) || _borg-mount() { local -a common_options common_exclude_extract_options common_archive_filters_options __borg_setup_common_options __borg_setup_common_exclude_extract_options __borg_setup_common_archive_filters_options _arguments -s -w -S : \ $* \ '--consider-checkpoints[show checkpoint archives in the repository contents list (default: hidden)]' \ '(-f --foreground)'{-f,--foreground}'[stay in foreground, do not daemonize]' \ '-o[mount options]: :_fuse_values "mount options" "versions[merged, versioned view of the files in the archives]" "allow_damaged_files[read damaged files]" "ignore_permissions[not enforce \"default_permissions\"]"' \ $common_archive_filters_options \ $common_exclude_extract_options \ $common_options \ ':REPOSITORY_OR_ARCHIVE: _borg_repository_or_archive' \ ':MOUNTPOINT:_directories' \ '*: : _borg_style_selector_or_archive_files "$line[1]" pp' } (( $+functions[_borg-prune] )) || _borg-prune() { local -a common_options common_prefix_and_glob_archives_filter_options common_dry_run_stats_options __borg_setup_common_options __borg_setup_common_prefix_and_glob_archives_filter_options __borg_setup_common_dry_run_stats_options _arguments -s -w -S : \ $common_dry_run_stats_options \ '*--force[force pruning of corrupted archives, use "--force --force" in case "--force" does not work]' \ '--list[output verbose list of archives it keeps/prunes]' \ '--keep-within[keep all archives within this time interval]: : _borg_guard_unsigned_number "INTERVAL"' \ '(--keep-last --keep-secondly)'{--keep-last,--keep-secondly}'[number of secondly archives to keep]: : _borg_guard_unsigned_number "N"' \ '--keep-minutely[number of minutely archives to keep]: : _borg_guard_unsigned_number "N"' \ '(-H --keep-hourly)'{-H,--keep-hourly}'[number of hourly archives to keep]: : _borg_guard_unsigned_number "N"' \ '(-d --keep-daily)'{-d,--keep-daily}'[number of daily archives to keep]: : _borg_guard_unsigned_number "N"' \ '(-w --keep-weekly)'{-w,--keep-weekly}'[number of weekly archives to keep]: : _borg_guard_unsigned_number "N"' \ '(-m --keep-monthly)'{-m,--keep-monthly}'[number of monthly archives to keep]: : _borg_guard_unsigned_number "N"' \ '(-y --keep-yearly)'{-y,--keep-yearly}'[number of yearly archives to keep]: : _borg_guard_unsigned_number "N"' \ '--save-space[work slower, but using less space]' \ $common_prefix_and_glob_archives_filter_options \ $common_options \ ':: :_borg_repository' } (( $+functions[_borg-recreate] )) || _borg-recreate() { local -a common_options common_create_options __borg_setup_common_options __borg_setup_common_create_options local -a mods=( 'if-different:recompress if current compression is with a different compression algorithm (the level is not considered)' 'always:recompress even if current compression is with the same compression algorithm (use this to change the compression level)' 'never:do not recompress (use this option to explicitly prevent recompression)' ) mods=( ${(q)mods//\\/\\\\} ) mods=( ${mods//:/\\:} ) _arguments -s -w -S : \ $common_create_options \ '--target=[create a new archive with the name ARCHIVE]:ARCHIVE: _borg_placeholder_or_archive "${line[1]%%\:\:*}"' \ '--recompress=[recompress data chunks according to "MODE" and "--compression"]:MODE:'"(($mods))" \ $common_options \ ':REPOSITORY_OR_ARCHIVE: _borg_repository_or_archive' \ '*: : _borg_style_selector_or_archive_files -e "$line[1]" pp' } (( $+functions[_borg-rename] )) || _borg-rename() { local -a common_options __borg_setup_common_options _arguments -s -w -S : \ $common_options \ ':ARCHIVE: _borg_repository_or_archive -a' \ ':NEWNAME' } (( $+functions[_borg-serve] )) || _borg-serve() { local -a common_options common_init_options __borg_setup_common_options __borg_setup_common_init_options _arguments -s -w -S : \ $common_init_options \ '*--restrict-to-path=[restrict repository access to PATH]:PATH:_files' \ '*--restrict-to-repository=[restrict repository access]: :_borg_repository' } (( $+functions[_borg-umount] )) || _borg-umount() { local -a common_options __borg_setup_common_options _arguments -s -w -S : \ $common_options \ ':MOUNTPOINT:_umountable' } (( $+functions[_borg-upgrade] )) || _borg-upgrade() { local -a common_options __borg_setup_common_options _arguments -s -w -S : \ '(-n --dry-run)'{-n,--dry-run}'[do not change repository]' \ '--inplace[rewrite repository in place, with no chance of going back to older versions of the repository]' \ '--force[force upgrade]' \ '--tam[enable manifest authentication (in key and cache)]' \ '--disable-tam[disable manifest authentication (in key and cache)]' \ $common_options \ ':: :_borg_repository' } (( $+functions[_borg-with-lock] )) || _borg-with-lock() { local -a state line common_options local curcontext="$curcontext" state_descr declare -A opt_args local -i ret=1 __borg_setup_common_options _arguments -s -w -C -S : \ $common_options \ '(-): :_borg_repository' \ '(-):COMMAND: _command_names -e' \ '(-)*:ARGS:->normal' && ret=0 case $state in (normal) shift 2 words (( CURRENT -= 2 )) _normal && ret=0 ;; esac return ret } (( $+functions[__borg_setup_common_options] )) || __borg_setup_common_options() { typeset -ga common_options=( '(- :)'{-h,--help}'[show this help message and exit]' '--critical[work on log level CRITICAL]' '--error[work on log level ERROR]' '--warning[work on log level WARNING (default)]' '(--info -v --verbose)'{--info,-v,--verbose}'[work on log level INFO]' '--debug[work on log level DEBUG]' '--debug-topic=[enable TOPIC debugging (can be specified multiple times)]:TOPIC' '(-p --progress)'{-p,--progress}'[show progress information]' '--log-json[Output one JSON object per log line instead of formatted text.]' '--lock-wait=[wait at most SECONDS for acquiring a repository/cache lock (default: 1)]: : _borg_guard_unsigned_number "SECONDS"' '--bypass-lock[bypass locking mechanism]' '(- :)--show-version[show/log the borg version]' '--show-rc[show/log the return code (rc)]' '--umask=[set umask to M (local only, default: 0077)]:M' '--remote-path=[set remote path to executable (default: "borg")]: :_cmdstring' '--remote-ratelimit=[set remote network upload rate limit in kiByte/s (default: 0=unlimited)]: : _borg_guard_unsigned_number "RATE"' '--remote-buffer=[set upload buffer size in MiB. (default: 0=no buffer)]: : _borg_guard_unsigned_number "UPLOAD_BUFFER"' '--consider-part-files[treat part files like normal files (e.g. to list/extract them)]' '--debug-profile=[write execution profile in Borg format into FILE]:FILE:_files' '--rsh=[use COMMAND instead of ssh]: :_cmdstring' ) } (( $+functions[__borg_setup_common_exclude_options] )) || __borg_setup_common_exclude_options() { typeset -ga common_exclude_options=( '*'{-e,--exclude}'=[exclude paths matching PATTERN]: : _borg_style_selector_or_archive_files "$line[1]" fm' '*--exclude-from=[read exclude patterns from EXCLUDEFILE, one per line]:EXCLUDEFILE:_files' '*--pattern=[experimental: include/exclude paths matching PATTERN]: : _borg_style_selector_or_archive_files -p "$line[1]" sh' '*--patterns-from=[experimental: read include/exclude patterns from PATTERNFILE, one per line]:PATTERNFILE:_files' ) } (( $+functions[__borg_setup_common_exclude_extract_options] )) || __borg_setup_common_exclude_extract_options() { local -a common_exclude_options __borg_setup_common_exclude_options typeset -ga common_exclude_extract_options=( $common_exclude_options '--strip-components=[Remove the specified number of leading path elements. Paths with fewer elements will be silently skipped.]: : _borg_guard_unsigned_number "NUMBER"' ) } (( $+functions[__borg_setup_common_prefix_and_glob_archives_filter_options] )) || __borg_setup_common_prefix_and_glob_archives_filter_options() { typeset -ga common_prefix_and_glob_archives_filter_options=( '(-P --prefix -a --glob-archives)'{-P,--prefix}'=[only consider archive names starting with this prefix]:PREFIX: _borg_archive -n "${line[1]%%\:\:*}"' '(-P --prefix)*'{-a,--glob-archives}'=[only consider archive names matching the glob]:GLOB: _borg_archive -n "${line[1]%%\:\:*}"' ) } (( $+functions[__borg_setup_common_archive_filters_options] )) || __borg_setup_common_archive_filters_options() { local -a common_prefix_and_glob_archives_filter_options __borg_setup_common_prefix_and_glob_archives_filter_options typeset -ga common_archive_filters_options=( $common_prefix_and_glob_archives_filter_options '--sort-by=[Comma-separated list of sorting keys, default: timestamp]:KEYS:(timestamp name id)' '(--last)--first=[consider first N archives after other filters were applied]:N: _borg_archive -n "${line[1]%%\:\:*}"' '(--first)--last=[consider last N archives after other filters were applied]:N: _borg_archive -n "${line[1]%%\:\:*}"' ) } (( $+functions[__borg_setup_common_dry_run_stats_options] )) || __borg_setup_common_dry_run_stats_options() { typeset -ga common_dry_run_stats_options=( '(-n --dry-run -s --stats)'{-n,--dry-run}'[do not change anything]' '(-n --dry-run -s --stats)'{-s,--stats}'[print statistics at end]' # NOTE: actual messages for subcommands differ in details ) } (( $+functions[__borg_setup_common_create_options] )) || __borg_setup_common_create_options() { local -a common_dry_run_stats_options common_exclude_options __borg_setup_common_dry_run_stats_options __borg_setup_common_exclude_options typeset -ga common_create_options=( $common_dry_run_stats_options '--list[output verbose list of items (files, dirs, ...)]' '--filter=[only display items with the given status characters]: :_borg_statuschars' $common_exclude_options '--exclude-caches[exclude directories that contain a CACHEDIR.TAG file]' '*--exclude-if-present=[exclude directories that are tagged by containing a filesystem object with the given NAME]:NAME:_files' '--keep-exclude-tags[if tag objects are specified with --exclude-if-present, don'\''t omit the tag objects themselves]' '--comment=[add a comment text to the archive]:COMMENT:_borg_placeholders' '--timestamp=[manually specify the archive creation date/time]:TIMESTAMP:_borg_timestamp' '(-c --checkpoint-interval)'{-c,--checkpoint-interval}'=[write checkpoint every SECONDS seconds (default: 1800)]: : _borg_guard_unsigned_number "SECONDS"' '--chunker-params=[specify the chunker parameters]: :_borg_chunker_params_examples' '(-C --compression)'{-C,--compression}'=[select compression algorithm]: :_borg_compression' ) } (( $+functions[__borg_setup_common_init_options] )) || __borg_setup_common_init_options() { local -a common_options __borg_setup_common_options typeset -ga common_init_options=( $common_options '--append-only[only allow appending to repository segment files]' '--storage-quota=[override storage quota of the repository]: :_borg_quota_suffixes' ) } (( $+functions[_borgfs] )) || _borgfs() { _borg-mount '(- :)'{-V,--version}'[show version number and exit]' } (( $+functions[_borg_parameters] )) || _borg_parameters() { local name=$1 shift local -i ret=1 local -a expl case $name in (REPO) local BORG_REPO unset BORG_REPO _borg_repository && ret=0 ;; ((|NEW_)PASSPHRASE) _message -e 'passphrase' && ret=0 ;; (DISPLAY_PASSPHRASE) _message -e 'answer to the "display the passphrase for verification" question' && ret=0 ;; (HOST_ID) _message -e 'unique ID' && ret=0 ;; (FILES_CACHE_TTL) _borg_guard_unsigned_number 'time to live (default: 20)' && ret=0 ;; (MOUNT_DATA_CACHE_ENTRIES) _borg_guard_unsigned_number 'number of cached data chunks' && ret=0 ;; (PASSCOMMAND|RSH|REMOTE_PATH) _cmdstring && ret=0 ;; (HOSTNAME_IS_UNIQUE|SHOW_SYSINFO|(UNKNOWN_UNENCRYPTED|RELOCATED)_REPO_ACCESS_IS_OK) _description values expl 'value' compadd "$expl[@]" yes no && ret=0 ;; ((CHECK|DELETE)_I_KNOW_WHAT_I_AM_DOING) _description values expl 'value' compadd "$expl[@]" YES NO && ret=0 ;; (SELFTEST) _description values expl 'value' compadd "$expl[@]" disabled && ret=0 ;; (WORKAROUNDS) _wanted workarounds expl 'workaround' _sequence compadd - basesyncfile && ret=0 ;; (KEYS_DIR) _directories && ret=0 ;; (*) _default && ret=0 ;; esac return ret } (( $+functions[_borg_repository] )) || _borg_repository() { local -a alts opts qopts zparseopts -E -a opts S: qopts=( ${(q)opts} ) [[ -n $BORG_REPO ]] && alts+=( "default-repository: : __borg_default_repository $qopts" ) alts+=( "cached-repositories:cached repositories:_borg_cached_repositories $qopts" ) alts+=( 'directories: :_directories -r ":/ \t\n\-"' ) alts+=( 'remote-repositories: : _borg_remote_repositories' ) _alternative $alts } (( $+functions[__borg_default_repository] )) || __borg_default_repository() { local -a opts suf zparseopts -E -a opts S: (( $opts[(I)-S] )) && suf=( -S '' ) local -a default_repository=( "\:\::$BORG_REPO" ) _describe -t default-repository 'default repository' default_repository "$suf[@]" } (( $+functions[_borg_cached_repositories] )) || _borg_cached_repositories() { local -a cached_repos local sed_script='/^previous_location = / { s/// # no port was given /ssh:\/\/[^/:]+:[0-9]+/! { # lstrip the `ssh://` prefix and add a colon before the first slash s!ssh://([^:/]+)/(.*)!\1:/\2! } p }' local cachedir=${BORG_CACHE_DIR:-${XDG_CACHE_HOME:-${BORG_BASE_DIR:-$HOME}/.cache}/borg} cached_repos=( ${(f)"$(_call_program -p cached-repositories sed -n -E ${(q)sed_script} \ "${(q)cachedir}/*/config(#qN.om)" 2>/dev/null)"} ) if [[ $compstate[quote] != (\'|\") ]]; then # hide ~BORG_REPO and other scalars local BORG_REPO unset BORG_REPO sed_script cachedir cached_repos=( "${(@D)cached_repos}" ) fi compadd -Q "$@" -r ': \t\n\-' -a cached_repos } (( $+functions[_borg_remote_repositories] )) || _borg_remote_repositories() { local -a match mbegin mend expl alts if compset -P '(#b)ssh://[^/]##@[^/]##:([0-9]##)/'; then _remote_files -/ -- ssh -p $match[1] return fi local -i have_scheme=0 compset -P 'ssh://' && have_scheme=1 if compset -P '*:'; then (( have_scheme )) && alts+=( 'ports: : _borg_guard_unsigned_number "port"' ) alts+=( 'remote-files:remote file: _remote_files -/ -- ssh' ) _alternative $alts elif compset -P 1 '(#b)(*)@'; then local user=$match[1] _wanted -C user-at hosts expl "host for $user" \ _combination -s '[:@]' accounts users-hosts users="$user" hosts -S ':' - elif compset -S '@*'; then _wanted users expl "user" \ _combination -s '[:@]' accounts users-hosts users -q - else alts=( 'users:user:_users -S "@"' 'hosts:host:_hosts -S ":"' ) (( ! have_scheme )) && alts+=( 'prefixes:ssh:compadd -S "" ssh://' ) _alternative $alts fi } # _borg_repository_or_archive [-a] [-p] # # -a archive is mandatory. The suffix `::` will be added to the repository if possible. # -p complete placeholders (( $+functions[_borg_repository_or_archive] )) || _borg_repository_or_archive() { local -A opts zparseopts -A opts -D -E a p if compset -P 1 '*::'; then local qrepo=$IPREFIX[1,-3] local -i def_repo=0 [[ -z $qrepo && -n $BORG_REPO ]] && qrepo=${(q)BORG_REPO} && def_repo=1 if [[ -n $qrepo ]]; then if (( ! def_repo )); then case $compstate[quote] in (\') qrepo=${(qq)qrepo} ;; (\") qrepo=${(qqq)${(e)qrepo}} ;; # NOTE: currently `(e)` don't have any effect, but maybe one day zsh will stop to change the quoting method # of double quoted parameters esac fi if (( $+opts[-p] )); then _borg_placeholder_or_archive $qrepo else _borg_archive $qrepo fi else _message "not a borg repository: ${(Q)qrepo}" return 1 fi else local -a suf if ! compset -S '::*'; then if (( $+opts[-a] )) || zstyle -T ":completion:${curcontext}:repositories" repository-suffix; then suf=( -S '::' ) fi local oqrepo="$PREFIX$SUFFIX" local qrepo=$oqrepo [[ $compstate[quote] != (\'|\") ]] && qrepo=${(Q)qrepo} if __borg_is_borg_repo $qrepo; then qrepo=${oqrepo%%/} [[ -z $SUFFIX ]] && PREFIX=${PREFIX%%/} || SUFFIX=${SUFFIX%%/} compadd -S '::' -r ':/ \t\n\-' -Q -- $qrepo return fi fi _borg_repository "$suf[@]" fi } # _borg_archive [-F] [-n] [qrepo] # # -F don't apply archive filter options on the command line # -n reverse order, disable matchers and don't do menu completion/selection (( $+functions[_borg_archive] )) || _borg_archive() { local -A opts zparseopts -A opts -D -E F n local qrepo=$1 if [[ -z $qrepo ]]; then if [[ -n $BORG_REPO ]]; then qrepo=${(q)BORG_REPO} else _message 'no repository specified' return 1 fi fi local -i ret=1 _tags archives while _tags; do if _requested archives; then local -a expl disp archive_filters local -i reversed_order=1 if (( ! $+opts[-F] )); then local -a archive_filter_options=( -P --prefix -a --glob-archives --first --last --sort-by ) tmp local k for k in $archive_filter_options; do if [[ -n $opt_args[$k] ]]; then IFS=: read -A tmp <<<$opt_args[$k] archive_filters+=( $k=${^tmp:#} ) fi done fi if (( $+opts[-n] )); then __borg_skip_pattern_matching || return 1 disp+=( -U ) compstate[insert]='' compstate[list]='list force' reversed_order=0 fi local -a asort zstyle -a ":completion:${curcontext}:archives" archive-sort asort if (( $asort[(I)inverse] )); then (( reversed_order = ! reversed_order )) fi local -a sort_by=( --sort-by=${(M)^asort:#(timestamp|name|id)} ) # NOTE: in case of option repetition, the later one takes precedence if (( ! $+__borg_archives_need_update )); then comppostfuncs+=( __borg_unset_archives_need_update ) typeset -gHi __borg_archives_need_update=1 if (( ! $#archive_filters && ! $+opts[-n] )); then local erepo [[ -n $1 ]] && __borg_expand_path ${(Q)qrepo} erepo local -a newest_file=( $erepo/(hints|index|integrity).<1->(#qN.om[1]) ) if [[ -n $newest_file ]]; then if zmodload -F zsh/stat b:zstat 2>/dev/null; then local -a stats zstat -A stats +mtime $newest_file local -i mtime=$stats[1] if [[ $__borg_prev_repo == $erepo && __borg_prev_mtime -ge mtime && $__borg_prev_order == $reversed_order && $__borg_prev_sort_by == $sort_by ]] then __borg_archives_need_update=0 else typeset -gH __borg_prev_repo=$erepo typeset -gHi __borg_prev_mtime=mtime __borg_prev_order=reversed_order typeset -gHa __borg_prev_sort_by=( $sort_by ) fi fi fi else unset __borg_prev_{repo,mtime,order,sort_by} comppostfuncs+=( __borg_unset_archives ) fi fi if zstyle -t ":completion:${curcontext}:archives" verbose; then if (( __borg_archives_need_update || ! $+__borg_archive_names || ! $+__borg_archive_descriptions )); then __borg_archives_need_update=0 typeset -gHa __borg_archive_names=() __borg_archive_descriptions=() local fmt descfmt name desc zstyle -s ":completion:${curcontext}:archives" archive-description-format descfmt || descfmt='{archive:<36} {time} [{id}]' fmt="{barchive}{NUL}$descfmt{NUL}" _call_program -p archive-descriptions \ ${(q)__borg_command:-borg} list --format=${(q)fmt} ${(q)sort_by} $archive_filters $qrepo 2>/dev/null | while IFS= read -r -d $'\0' name && IFS= read -r -d $'\0' descr; do __borg_archive_names[1,0]=( $name ) __borg_archive_descriptions[1,0]=( "$descr" ) done (( $pipestatus[1] )) && { _message "couldn't list repository: ${(Q)qrepo}" unset __borg_prev_{repo,mtime,order,sort_by} return 1 } (( ! reversed_order )) && __borg_archive_names=( "${(@aO)__borg_archive_names}" ) && __borg_archive_descriptions=( "${(@aO)__borg_archive_descriptions}" ) fi disp+=( -ld __borg_archive_descriptions ) elif (( __borg_archives_need_update || ! $+__borg_archive_names )); then __borg_archives_need_update=0 typeset -gHa __borg_archive_names=() local fmt='{barchive}{NUL}' __borg_archive_names=( ${(@0aO)"$(_call_program -p archives \ ${(q)__borg_command:-borg} list --format=${(q)fmt} ${(q)sort_by} $archive_filters $qrepo 2>/dev/null)"} ) (( $pipestatus[1] )) && { _message "couldn't list repository: ${(Q)qrepo}" unset __borg_prev_{repo,mtime,order,sort_by} return 1 } (( ! reversed_order )) && __borg_archive_names=( "${(@aO)__borg_archive_names}" ) fi _all_labels archives expl 'ARCHIVE' compadd "$disp[@]" -a __borg_archive_names && ret=0 fi (( ret )) || return 0 done return 1 } (( $+functions[__borg_unset_archives] )) || __borg_unset_archives() { unset __borg_archive_names __borg_archive_descriptions } (( $+functions[__borg_unset_archives_need_update] )) || __borg_unset_archives_need_update() { unset __borg_archives_need_update } (( $+functions[__borg_is_borg_repo] )) || __borg_is_borg_repo() { local repo=$1 __borg_expand_path $repo repo if [[ -d $repo && -d $repo/data ]]; then local -a files=( $repo/(hints|index|integrity).<1->(#qN.) ) (( $#files >= 3 )) && return 0 fi return 1 } (( $+functions[__borg_expand_path] )) || __borg_expand_path() { local _path=$1 local -a match mbegin mend if [[ $_path == (#b)(\~[^/]#)(|/*) ]]; then local etilde etilde=$~match[1] 2>/dev/null _path="$etilde$match[2]" fi _path=${(e)_path//\\\\/\\\\\\\\} eval typeset -g ${2:-REPLY}=\$_path } (( $+functions[_borg_placeholder_or_archive] )) || _borg_placeholder_or_archive() { local qrepo=$1 shift _alternative \ 'placeholders: :_borg_placeholders' \ "archives: : _borg_archive ${(q)qrepo}" } (( $+functions[_borg_placeholders] )) || _borg_placeholders() { local -a placeholders=( 'hostname:The (short) hostname of the machine.' 'fqdn:The full name of the machine.' 'reverse-fqdn:The full name of the machine in reverse domain name notation.' 'now:The current local date and time, by default in ISO-8601 format. You can also supply your own format string, e.g. {now:%Y-%m-%d_%H:%M:%S}' 'utcnow:The current UTC date and time, by default in ISO-8601 format. You can also supply your own format string, e.g. {utcnow:%Y-%m-%d_%H:%M:%S}' 'user:The user name (or UID, if no name is available) of the user running borg.' 'pid:The current process ID.' 'borgversion:The version of borg, e.g.: 1.0.8rc1' 'borgmajor:The version of borg, only the major version, e.g.: 1' 'borgminor:The version of borg, only major and minor version, e.g.: 1.0' 'borgpatch:The version of borg, only major, minor and patch version, e.g.: 1.0.8' ) __borg_complete_keys _describe -t placeholders 'placeholder' placeholders '"$copts[@]"' } (( $+functions[_borg_format_keys] )) || _borg_format_keys() { local repo_or_arch=${(Q)1} local -a keys=( NEWLINE NL NUL SPACE TAB CR LF ) local -a repository_keys=( archive name barchive comment bcomment id start time end command_line hostname username ) local -a archive_keys=( type mode uid gid user group path bpath source linktarget flags size csize dsize dcsize num_chunks unique_chunks mtime ctime atime isomtime isoctime isoatime blake2b blake2s md5 sha1 sha224 sha256 sha384 sha3_224 sha3_256 sha3_384 sha3_512 sha512 shake_128 shake_256 archiveid archivename extra health ) local akeys rkeys akeys='archive-keys:archive keys:compadd -a archive_keys' rkeys='repository-keys:repository keys:compadd -a repository_keys' local -a alts=( 'keys:keys:compadd -a keys' ) if [[ $repo_or_arch == *::?* ]]; then alts+=( $akeys ) elif [[ -n $repo_or_arch ]]; then alts+=( $rkeys ) else alts+=( $rkeys $akeys ) fi __borg_complete_keys _alternative -O copts ${(q)alts} } (( $+functions[__borg_complete_keys] )) || __borg_complete_keys() { compset -P '*[^A-Za-z]##' compset -S '[^A-Za-z]##*' [[ -n $ISUFFIX ]] && compstate[to_end]='' # NOTE: `[[ -n $ISUFFIX ]]` is a workaround for a bug that causes cursor movement to the right further than it should # NOTE: the _oldlist completer doesn't respect compstate[to_end]='' local ipref suf if [[ $IPREFIX[-1] != '{' ]]; then ipref='{' [[ $compstate[quote] != (\'|\") ]] && ipref='\{' fi if [[ $ISUFFIX[1] != (|\\)\} ]]; then suf='}' [[ $compstate[quote] != (\'|\") ]] && suf='\}' fi local -a copts=( -i "$ipref" -S "$suf" ) eval "$@" } # _borg_style_selector_or_archive_files [-e] [-p] archive default_style_selector # # -e apply exclusion options on the command line # -p complete `--pattern` # -f complete files rather than borg paths (( $+functions[_borg_style_selector_or_archive_files] )) || _borg_style_selector_or_archive_files() { local -A opts zparseopts -A opts -D -E e p f local arch=$1 default_style_selector=$2 shift 2 local -a match mbegin mend expl tags=( style-selectors archive-files ) ss_suf=( -S ':' -r ':' ) (( $+opts[-f] )) && tags=( style-selectors files ) local -i ret=1 if (( $+opts[-p] )); then if ! compset -P '(#b)([RP\+\-\!])'; then local -a pattern_rules=( 'P:pattern style' 'R:root path' '+:include' '-:exclude' '!:exclude non-recurse' ) _describe -t pattern-rules 'pattern rule' pattern_rules -S '' return else if [[ $compstate[quote] == (\'|\") ]]; then compset -P ' #' else compset -P '(\\ )#' fi if [[ $match[1] == 'R' ]]; then default_style_selector='pp' elif [[ $match[1] == 'P' ]]; then tags=( style-selectors ) ss_suf=() fi fi fi _tags $tags while _tags; do if _requested style-selectors; then _all_labels style-selectors expl 'style selector' \ __borg_style_selectors $default_style_selector "$ss_suf[@]" - && ret=0 fi if _requested archive-files; then _all_labels archive-files expl 'PATTERN' \ __borg_archive_files ${(k)opts} "$arch" $default_style_selector - && ret=0 fi if _requested files; then local -a borg_paths=( ${(Q)${(e)${~@}}} ) _all_labels files expl 'PATH' \ __borg_pattern_files ${(k)opts} borg_paths - && ret=0 fi (( ret )) || return 0 done return 1 } (( $+functions[__borg_style_selectors] )) || __borg_style_selectors() { local default_style_selector=$1 path_style_selector shift zstyle -s ":completion:${curcontext}:archive-files" path-style-selector path_style_selector || path_style_selector='fm' local -a disp local -A style_selectors __borg_setup_style_selectors if zstyle -T ":completion:${curcontext}:style-selectors" verbose; then local -a style_selector_descriptions extra local k v sep for k v in ${(kv)style_selectors}; do extra=() [[ $k == $default_style_selector ]] && extra+=( 'default' ) [[ $k == $path_style_selector ]] && __borg_choose_path_or_pattern "" "$default_style_selector" && extra+=( 'path' ) (( $#extra )) && v+=" (${(j:, :)extra})" style_selector_descriptions+=( "${${k//\\/\\\\}//:/\\:}:$v" ) done zstyle -s ":completion:${curcontext}:style-selectors" list-separator sep || sep=-- zformat -a style_selector_descriptions " $sep " $style_selector_descriptions disp=( -ld style_selector_descriptions ) fi compadd "$disp[@]" "$@" -k style_selectors } (( $+functions[__borg_archive_files] )) || __borg_archive_files() { local -A opts zparseopts -A opts -D e p local arch=$1 default_style_selector=$2 shift 2 if [[ -z $arch || $arch != *::?* ]]; then _message 'no archive specified' return 1 fi local -a qargs tmp disp pref match mbegin mend archive_files descs local -A style_selectors local k cword fmt descfmt style_selector path_style_selector name descr # take into account exclude options on the command line if (( $+opts[-e] )); then local -a exclude_options=( -e --exclude --exclude-from --pattern --pattern-from ) local -a excludes for k in $exclude_options; do if [[ -n $opt_args[$k] ]]; then IFS=: read -A tmp <<<$opt_args[$k] excludes+=( $k="${^tmp[@]}" ) fi done [[ -n $excludes ]] && qargs+=( "$excludes[@]" ) fi (( $_matcher_num > 1 )) && return 1 __borg_skip_pattern_matching || return 1 cword="$PREFIX$SUFFIX" [[ $compstate[quote] != (\'|\") ]] && cword=${(Q)cword} [[ -z $cword ]] && return 1 if zstyle -t ":completion:${curcontext}:archive-files" verbose; then zstyle -s ":completion:${curcontext}:archive-files" file-description-format descfmt || descfmt='{mode} {user:6} {group:6} {size:8d} {mtime} {path}{extra}' fmt="{bpath}{NUL}$descfmt{NUL}" else fmt='{bpath}{NUL}' fi qargs+=( --format=${(q)fmt} ) qargs+=( $arch ) __borg_setup_style_selectors [[ $cword == (#b)(${~${(j:|:)${(kb)style_selectors}}}):* ]] && style_selector=$match[1] local -i path_expected=0 __borg_choose_path_or_pattern "$style_selector" $default_style_selector $cword && path_expected=1 if [[ -n $cword ]]; then if (( path_expected )); then [[ -n $style_selector ]] && compset -P "$style_selector:" && pref=( -P "$style_selector:" ) cword="$PREFIX$SUFFIX" [[ $compstate[quote] != (\'|\") ]] && cword=${(Q)cword} zstyle -s ":completion:${curcontext}:archive-files" path-style-selector path_style_selector || path_style_selector='fm' cword="$path_style_selector:$cword" else [[ -z $style_selector ]] && cword="$default_style_selector:$cword" fi qargs+=( ${(q)cword} ) fi if zstyle -t ":completion:${curcontext}:archive-files" verbose; then _call_program -p archive-file-descriptions ${(q)__borg_command:-borg} list $qargs 2>/dev/null | while IFS= read -r -d $'\0' name && IFS= read -r -d $'\0' descr; do archive_files+=( $name ) descs+=( $descr ) done (( $pipestatus[1] )) && { _message "couldn't list archive: ${(Q)arch}"; return 1 } disp=( -ld descs ) else archive_files=( ${(0)"$(_call_program -p archive-files ${(q)__borg_command:-borg} list $qargs 2>/dev/null)"} ) (( $pipestatus[1] )) && { _message "couldn't list archive: ${(Q)arch}"; return 1 } fi if (( $#archive_files )); then if (( path_expected )); then compstate[insert]='automenu' else compstate[insert]='' compstate[list]='list force' fi fi compadd "$pref[@]" -U "$disp[@]" "$@" -a archive_files } (( $+functions[__borg_choose_path_or_pattern] )) || __borg_choose_path_or_pattern() { local ss=$1 defss=$2 cword=$3 shift 2 [[ $ss == (pp|pf) || ( -z $ss && $defss == (pp|pf) ) ]] } # transform borg exclude patterns into zsh ignore patterns and then complete files (( $+functions[__borg_pattern_files] )) || __borg_pattern_files() { local -A opts zparseopts -A opts -D -E e p f local paths_varname=$1 shift local -a args local -A style_selectors __borg_setup_style_selectors local pr_pat='[RP\+\-\!]' ss_pat="(${(j:|:)${(@kb)style_selectors}}):" local prs_pat="$pr_pat #" if (( $+opts[-e] )); then local -a borg_excludes exclude_options=( -e --exclude --pattern ) tmp local k cword local -i i for k in $exclude_options; do if [[ -n $opt_args[$k] ]]; then IFS=: read -A tmp <<<$opt_args[$k] tmp=( ${(Q)tmp} ) # lstrip style selectors and pattern rules [[ $+opts[-p] -gt 0 || $k == --pattern ]] && tmp=( ${tmp#$~prs_pat} ) tmp=( ${tmp#$~ss_pat} ) # don't take into account the word under the cursor cword="$PREFIX$SUFFIX" [[ $compstate[quote] != (\'|\") ]] && cword=${(Q)cword} [[ $+opts[-p] -gt 0 || $k == --pattern ]] && cword=${cword#$~prs_pat} cword=${cword#$~ss_pat} i=$tmp[(I)$cword] (( i )) && tmp=( "${(@)tmp[1,i-1]}" "${(@)tmp[i+1,-1]}" ) borg_excludes+=( "$tmp[@]" ) fi done [[ -n $borg_excludes ]] && args+=( -F borg_excludes ) fi [[ -n ${(P)paths_varname} ]] && args+=( -W $paths_varname ) args+=( "$@" ) # lstrip style selectors and pattern rules if (( $+opts[-p] )); then if [[ $compstate[quote] != (\'|\") ]]; then compset -P $pr_pat compset -P '(\\ )#' else compset -P $prs_pat fi fi compset -P $ss_pat compstate[insert]='' compstate[list]='list force' _path_files "$args[@]" } (( $+functions[__borg_setup_style_selectors] )) || __borg_setup_style_selectors() { typeset -gA style_selectors=( fm 'Fnmatch' sh 'Shell-style patterns' re 'Regular expressions' pp 'Path prefix' pf 'Path full-match' ) } (( $+functions[__borg_skip_pattern_matching] )) || __borg_skip_pattern_matching() { # unset glob_complete [[ $compstate[pattern_match] == '*' ]] && compstate[pattern_match]='' # skip the _match completer [[ -n $compstate[pattern_match] ]] && return 1 return 0 } (( $+functions[_borg_config] )) || _borg_config() { local qrepo=$1 shift if (( ! $+__borg_config_sect )); then comppostfuncs+=( __borg_unset_config ) typeset -gH __borg_config_sect= typeset -gHa __borg_config_keys=() local sect line local -a match mbegin mend _call_program -p keys ${(q)__borg_command:-borg} config --list $qrepo 2>/dev/null | { IFS= read -r sect sect=${${sect#\[}%\]} __borg_config_sect=$sect while IFS= read -r line && [[ $line == (#b)(*)\ =\ (*) ]]; do __borg_config_keys+=( "${${match[1]//\\/\\\\}//:/\\:}:(current: $match[2])" ) done } fi local -a alts=( 'keys:key: _describe -t keys "key" __borg_config_keys' ) compset -P "${__borg_config_sect}." || alts+=( 'sections:section:compadd -S "." $__borg_config_sect' ) _alternative $alts } (( $+functions[__borg_unset_config] )) || __borg_unset_config() { unset __borg_config_sect __borg_config_keys } # A simple prefix-oriented completion function for compressors. Can be improved by supporting the suffix. (( $+functions[_borg_compression] )) || _borg_compression() { local -a nolvl=( 'none:do not compress' 'lz4:very high speed, very low compression' ) local -a havelvl=( 'zstd:("zstandart")' 'zlib:("gz") medium speed, medium compression' 'lzma:("xz") low speed, high compression' ) local -a auto=( 'auto:compress compressible, otherwise "none"' ) local -a match mbegin mend # NOTE: Zsh's `-prefix` condition is confused by the leading parenthesis in the pattern. # Fortunately, we simply need to show a message. if compset -P '(#b)(|auto,)(zstd|zlib|lzma),'; then local -i from to def case $match[2] in (zstd) from=1 to=22 def=3 ;; (zlib|lzma) from=0 to=9 def=6 ;; esac _message -e "compression level (from $from to $to, default: $def)" elif compset -P 'auto,'; then _describe -t compression 'compression' nolvl -- havelvl -qS, else _describe -t compression 'compression' nolvl -- havelvl -qS, -- auto -S, fi } (( $+functions[_borg_chunker_params] )) || _borg_chunker_params() { if compset -P 'buzhash,'; then if compset -P '*,*,*,'; then _message -e 'HASH_WINDOW_SIZE' elif compset -P '*,*,'; then _message -e 'HASH_MASK_BITS (statistical medium chunk size ~= 2^HASH_MASK_BITS B)' elif compset -P '*,'; then _message -e 'CHUNK_MAX_EXP (maximum chunk size = 2^CHUNK_MAX_EXP B)' else _message -e 'CHUNK_MIN_EXP (minimum chunk size = 2^CHUNK_MIN_EXP B)' fi elif compset -P 'fixed,'; then if compset -P '*,'; then _message -e 'HEADER_SIZE (B)' else _message -e 'BLOCK_SIZE (B)' fi else local -a algorithms=( 'fixed:a simple, low cpu overhead, fixed blocksize chunker, optionally supporting a header block of different size' 'buzhash:variable, content-defined blocksize, uses a rolling hash computed by the Buzhash algorithm' ) _describe -t algorithm 'ALGO' algorithms -S , fi } (( $+functions[_borg_chunker_params_examples] )) || _borg_chunker_params_examples() { local -a params=( 'default:buzhash,19,23,21,4095' 'buzhash,19,23,21,4095:small amount of chunks (default)' 'buzhash,10,23,16,4095:big amount of chunks' ) params=( ${(q)params} ) _alternative \ 'chunker-params: :_borg_chunker_params' \ "chunker-params-examples:chunker params examples:(($params))" } (( $+functions[_borg_statuschars] )) || _borg_statuschars() { _values -s '' 'STATUSCHARS' \ 'A[regular file, added]' \ 'M[regular file, modified]' \ 'U[regular file, unchanged]' \ 'C[regular file, it changed while we backed it up]' \ 'E[regular file, an error happened while accessing/reading this file]' \ 'd[directory]' \ 'b[block device]' \ 'c[char device]' \ 'h[regular file, hardlink (to already seen inodes)]' \ 's[symlink]' \ 'f[fifo]' \ 'i[backup data was read from standard input (stdin)]' \ '-[dry run, item was not backed up]' \ 'x[excluded, item was not backed up]' \ '?[missing status code]' } (( $+functions[_borg_quota_suffixes] )) || _borg_quota_suffixes() { if compset -P '[0-9]##'; then local -a suffixes=( 'K:10 ** 3 bytes' 'M:10 ** 6 bytes' 'G:10 ** 9 bytes' 'T:10 ** 12 bytes' 'P:10 ** 15 bytes' ) # NOTE: tag `suffixes` is already in use (file extensions) _describe -t multiplier 'suffix' suffixes else _message -e 'QUOTA' fi } (( $+functions[_borg_timestamp] )) || _borg_timestamp() { _alternative \ "dates:TIMESTAMP: _dates -f '%FT%T'" \ 'files:reference:_files' } (( $+functions[_borg_guard_unsigned_number] )) || _borg_guard_unsigned_number() { local -A opts zparseopts -K -D -A opts M+: J+: V+: 1 2 o+: n F: x+: X+: _guard '[0-9]#' ${1:-number} } _borg() { local -a match mbegin mend line state local curcontext="$curcontext" state_descr typeset -A opt_args local -i ret=1 if [[ $service == 'borg' ]]; then local __borg_command=$words[1] local -a common_options __borg_setup_common_options _arguments -s -w -C : \ '(- :)'{-V,--version}'[show version number and exit]' \ $common_options \ '(-): :->command' \ '(-)*:: :->option-or-argument' && return case $state in (command) _borg_commands && ret=0 ;; (option-or-argument) curcontext="${curcontext%:*:*}:borg-$words[1]:" if ! _call_function ret _borg-$words[1]; then _default && ret=0 fi ;; esac elif [[ $service == (#b)-value-,BORG_(*),-default- ]]; then _borg_parameters $match[1] && ret=0 elif ! _call_function ret _$service; then _default && ret=0 fi return ret } _borg "$@" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/scripts/sign-binaries0000755000076500000240000000051414641074756016375 0ustar00twstaff#!/bin/bash D=$1 if [ "$D" = "" ]; then echo "Usage: sign-binaries 201912312359" exit fi if [ "$QUBES_GPG_DOMAIN" = "" ]; then GPG=gpg else GPG=qubes-gpg-client-wrapper fi for file in dist/borg-*; do $GPG --local-user "Thomas Waldmann" --armor --detach-sign --output $file.asc $file done touch -t $D dist/* ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/scripts/upload-pypi0000755000076500000240000000037114641074756016107 0ustar00twstaff#!/bin/bash R=$1 if [ "$R" = "" ]; then echo "Usage: upload-pypi 1.2.3 [test]" exit fi if [ "$2" = "test" ]; then export TWINE_REPOSITORY=testpypi else export TWINE_REPOSITORY=pypi fi D=dist/borgbackup-$R.tar.gz twine upload $D ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719958149.8488278 borgbackup-1.4.0/setup.cfg0000644000076500000240000000004614641075206014036 0ustar00twstaff[egg_info] tag_build = tag_date = 0 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/setup.py0000644000076500000240000002255514641074756013751 0ustar00twstaff# borgbackup - main setup code (extension building here, rest see pyproject.toml) import os import re import sys from collections import defaultdict try: import multiprocessing except ImportError: multiprocessing = None from setuptools.command.build_ext import build_ext from setuptools import setup, Extension from setuptools.command.sdist import sdist try: from Cython.Build import cythonize cythonize_import_error_msg = None except ImportError as exc: # either there is no Cython installed or there is some issue with it. cythonize = None cythonize_import_error_msg = "ImportError: " + str(exc) if "failed to map segment from shared object" in cythonize_import_error_msg: cythonize_import_error_msg += " Check if the borg build uses a +exec filesystem." sys.path += [os.path.dirname(__file__)] is_win32 = sys.platform.startswith("win32") # Number of threads to use for cythonize, not used on windows cpu_threads = multiprocessing.cpu_count() if multiprocessing and multiprocessing.get_start_method() != "spawn" else None # How the build process finds the system libs: # # 1. if BORG_{LIBXXX,OPENSSL}_PREFIX is set, it will use headers and libs from there. # 2. if not and pkg-config can locate the lib, the lib located by # pkg-config will be used. We use the pkg-config tool via the pkgconfig # python package, which must be installed before invoking setup.py. # if pkgconfig is not installed, this step is skipped. # 3. otherwise raise a fatal error. # Are we building on ReadTheDocs? on_rtd = os.environ.get("READTHEDOCS") # Extra cflags for all extensions, usually just warnings we want to enable explicitly cflags = ["-Wall", "-Wextra", "-Wpointer-arith"] compress_source = "src/borg/compress.pyx" crypto_ll_source = "src/borg/crypto/low_level.pyx" chunker_source = "src/borg/chunker.pyx" hashindex_source = "src/borg/hashindex.pyx" item_source = "src/borg/item.pyx" checksums_source = "src/borg/algorithms/checksums.pyx" platform_posix_source = "src/borg/platform/posix.pyx" platform_linux_source = "src/borg/platform/linux.pyx" platform_syncfilerange_source = "src/borg/platform/syncfilerange.pyx" platform_darwin_source = "src/borg/platform/darwin.pyx" platform_freebsd_source = "src/borg/platform/freebsd.pyx" platform_windows_source = "src/borg/platform/windows.pyx" cython_sources = [ compress_source, crypto_ll_source, chunker_source, hashindex_source, item_source, checksums_source, platform_posix_source, platform_linux_source, platform_syncfilerange_source, platform_freebsd_source, platform_darwin_source, platform_windows_source, ] if cythonize: Sdist = sdist else: class Sdist(sdist): def __init__(self, *args, **kwargs): raise Exception("Cython is required to run sdist") cython_c_files = [fn.replace(".pyx", ".c") for fn in cython_sources] if not on_rtd and not all(os.path.exists(path) for path in cython_c_files): raise ImportError("The GIT version of Borg needs a working Cython. " + "Install or fix Cython or use a released borg version. " + "Importing cythonize failed with: " + cythonize_import_error_msg) cmdclass = {"build_ext": build_ext, "sdist": Sdist} ext_modules = [] if not on_rtd: def members_appended(*ds): result = defaultdict(list) for d in ds: for k, v in d.items(): assert isinstance(v, list) result[k].extend(v) return result try: import pkgconfig as pc except ImportError: print("Warning: can not import pkgconfig python package.") pc = None def lib_ext_kwargs(pc, prefix_env_var, lib_name, lib_pkg_name, pc_version, lib_subdir="lib"): system_prefix = os.environ.get(prefix_env_var) if system_prefix: print(f"Detected and preferring {lib_pkg_name} [via {prefix_env_var}]") return dict( include_dirs=[os.path.join(system_prefix, "include")], library_dirs=[os.path.join(system_prefix, lib_subdir)], libraries=[lib_name], ) if pc and pc.installed(lib_pkg_name, pc_version): print(f"Detected and preferring {lib_pkg_name} [via pkg-config]") return pc.parse(lib_pkg_name) raise Exception( f"Could not find {lib_name} lib/headers, please set {prefix_env_var} " f"or ensure {lib_pkg_name}.pc is in PKG_CONFIG_PATH." ) crypto_extra_objects = [] if is_win32: crypto_ext_lib = lib_ext_kwargs(pc, "BORG_OPENSSL_PREFIX", "libcrypto", "libcrypto", ">=1.1.1", lib_subdir="") else: crypto_ext_lib = lib_ext_kwargs(pc, "BORG_OPENSSL_PREFIX", "crypto", "libcrypto", ">=1.1.1") crypto_ext_kwargs = members_appended( dict(sources=[crypto_ll_source]), crypto_ext_lib, dict(extra_compile_args=cflags), dict(extra_objects=crypto_extra_objects), ) compress_ext_kwargs = members_appended( dict(sources=[compress_source]), lib_ext_kwargs(pc, "BORG_LIBLZ4_PREFIX", "lz4", "liblz4", ">= 1.7.0"), lib_ext_kwargs(pc, "BORG_LIBZSTD_PREFIX", "zstd", "libzstd", ">= 1.3.0"), dict(extra_compile_args=cflags), ) checksums_ext_kwargs = members_appended( dict(sources=[checksums_source]), lib_ext_kwargs(pc, "BORG_LIBXXHASH_PREFIX", "xxhash", "libxxhash", ">= 0.7.3"), dict(extra_compile_args=cflags), ) if sys.platform == "linux": linux_ext_kwargs = members_appended( dict(sources=[platform_linux_source]), lib_ext_kwargs(pc, "BORG_LIBACL_PREFIX", "acl", "libacl", ">= 2.2.47"), dict(extra_compile_args=cflags), ) else: linux_ext_kwargs = members_appended( dict(sources=[platform_linux_source], libraries=["acl"], extra_compile_args=cflags) ) # note: _chunker.c and _hashindex.c are relatively complex/large pieces of handwritten C code, # thus we undef NDEBUG for them, so the compiled code will contain and execute assert(). ext_modules += [ Extension("borg.crypto.low_level", **crypto_ext_kwargs), Extension("borg.compress", **compress_ext_kwargs), Extension("borg.hashindex", [hashindex_source], extra_compile_args=cflags, undef_macros=["NDEBUG"]), Extension("borg.item", [item_source], extra_compile_args=cflags), Extension("borg.chunker", [chunker_source], extra_compile_args=cflags, undef_macros=["NDEBUG"]), Extension("borg.algorithms.checksums", **checksums_ext_kwargs), ] posix_ext = Extension("borg.platform.posix", [platform_posix_source], extra_compile_args=cflags) linux_ext = Extension("borg.platform.linux", **linux_ext_kwargs) syncfilerange_ext = Extension( "borg.platform.syncfilerange", [platform_syncfilerange_source], extra_compile_args=cflags ) freebsd_ext = Extension("borg.platform.freebsd", [platform_freebsd_source], extra_compile_args=cflags) darwin_ext = Extension("borg.platform.darwin", [platform_darwin_source], extra_compile_args=cflags) windows_ext = Extension("borg.platform.windows", [platform_windows_source], extra_compile_args=cflags) if not is_win32: ext_modules.append(posix_ext) else: ext_modules.append(windows_ext) if sys.platform == "linux": ext_modules.append(linux_ext) ext_modules.append(syncfilerange_ext) elif sys.platform.startswith("freebsd"): ext_modules.append(freebsd_ext) elif sys.platform == "darwin": ext_modules.append(darwin_ext) # sometimes there's no need to cythonize # this breaks chained commands like 'clean sdist' cythonizing = ( len(sys.argv) > 1 and sys.argv[1] not in (("clean", "egg_info", "--help-commands", "--version")) and "--help" not in sys.argv[1:] ) if cythonize and cythonizing: # 3str is the default in Cython3 and we do not support older Cython releases. # we only set this to avoid the related FutureWarning from Cython3. cython_opts = dict(compiler_directives={"language_level": "3str"}) if not is_win32: # compile .pyx extensions to .c in parallel, does not work on windows cython_opts["nthreads"] = cpu_threads # generate C code from Cython for ALL supported platforms, so we have them in the sdist. # the sdist does not require Cython at install time, so we need all as C. cythonize([posix_ext, linux_ext, syncfilerange_ext, freebsd_ext, darwin_ext, windows_ext], **cython_opts) # generate C code from Cython for THIS platform (and for all platform-independent Cython parts). ext_modules = cythonize(ext_modules, **cython_opts) def long_desc_from_readme(): with open("README.rst") as fd: long_description = fd.read() # remove header, but have one \n before first headline start = long_description.find("What is BorgBackup?") assert start >= 0 long_description = "\n" + long_description[start:] # remove badges long_description = re.compile(r"^\.\. start-badges.*^\.\. end-badges", re.M | re.S).sub("", long_description) # remove unknown directives long_description = re.compile(r"^\.\. highlight:: \w+$", re.M).sub("", long_description) return long_description setup(cmdclass=cmdclass, ext_modules=ext_modules, long_description=long_desc_from_readme()) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719958149.7390683 borgbackup-1.4.0/src/0000755000076500000240000000000014641075206013004 5ustar00twstaff././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719958149.8231945 borgbackup-1.4.0/src/borg/0000755000076500000240000000000014641075206013735 5ustar00twstaff././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/__init__.py0000644000076500000240000000153314641074756016061 0ustar00twstafffrom packaging.version import parse as parse_version # IMPORTANT keep imports from borg here to a minimum because our testsuite depends on # being able to import borg.constants and then monkey patching borg.constants.PBKDF2_ITERATIONS from ._version import version as __version__ _v = parse_version(__version__) __version_tuple__ = _v._version.release # assert that all semver components are integers # this is mainly to show errors when people repackage poorly # and setuptools_scm determines a 0.1.dev... version assert all(isinstance(v, int) for v in __version_tuple__), \ """\ broken borgbackup version metadata: %r version metadata is obtained dynamically on installation via setuptools_scm, please ensure your git repo has the correct tags or you provide the version using SETUPTOOLS_SCM_PRETEND_VERSION in your build script. """ % __version__ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/__main__.py0000644000076500000240000000114314641074756016037 0ustar00twstaffimport sys import os # On windows loading the bundled libcrypto dll fails if the folder # containing the dll is not in the search path. The dll is shipped # with python in the "DLLs" folder, so let's add this folder # to the path. The folder is always in sys.path, get it from there. if sys.platform.startswith('win32'): # Keep it an iterable to support multiple folder which contain "DLLs". dll_path = (p for p in sys.path if 'DLLs' in os.path.normpath(p).split(os.path.sep)) os.environ['PATH'] = os.pathsep.join(dll_path) + os.pathsep + os.environ['PATH'] from borg.archiver import main main() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/_chunker.c0000644000076500000240000002750214641074756015716 0ustar00twstaff#include #include #if !defined(_MSC_VER) # include #endif /* Cyclic polynomial / buzhash https://en.wikipedia.org/wiki/Rolling_hash http://www.serve.net/buz/Notes.1st.year/HTML/C6/rand.012.html (by "BUZ", the inventor) http://www.dcs.gla.ac.uk/~hamer/cakes-talk.pdf (see buzhash slide) Some properties of buzhash / of this implementation: (1) the hash is designed for inputs <= 32 bytes, but the chunker uses it on a 4095 byte window; any repeating bytes at distance 32 within those 4095 bytes can cause cancellation within the hash function, e.g. in "X X", the last X would cancel out the influence of the first X on the hash value. (2) the hash table is supposed to have (according to the BUZ) exactly a 50% distribution of 0/1 bit values per position, but the hard coded table below doesn't fit that property. (3) if you would use a window size divisible by 64, the seed would cancel itself out completely. this is why we use a window size of 4095 bytes. Another quirk is that, even with the 4095 byte window, XORing the entire table by a constant is equivalent to XORing the hash output with a different constant. but since the seed is stored encrypted, i think it still serves its purpose. */ static uint32_t table_base[] = { 0xe7f831ec, 0xf4026465, 0xafb50cae, 0x6d553c7a, 0xd639efe3, 0x19a7b895, 0x9aba5b21, 0x5417d6d4, 0x35fd2b84, 0xd1f6a159, 0x3f8e323f, 0xb419551c, 0xf444cebf, 0x21dc3b80, 0xde8d1e36, 0x84a32436, 0xbeb35a9d, 0xa36f24aa, 0xa4e60186, 0x98d18ffe, 0x3f042f9e, 0xdb228bcd, 0x096474b7, 0x5c20c2f7, 0xf9eec872, 0xe8625275, 0xb9d38f80, 0xd48eb716, 0x22a950b4, 0x3cbaaeaa, 0xc37cddd3, 0x8fea6f6a, 0x1d55d526, 0x7fd6d3b3, 0xdaa072ee, 0x4345ac40, 0xa077c642, 0x8f2bd45b, 0x28509110, 0x55557613, 0xffc17311, 0xd961ffef, 0xe532c287, 0xaab95937, 0x46d38365, 0xb065c703, 0xf2d91d0f, 0x92cd4bb0, 0x4007c712, 0xf35509dd, 0x505b2f69, 0x557ead81, 0x310f4563, 0xbddc5be8, 0x9760f38c, 0x701e0205, 0x00157244, 0x14912826, 0xdc4ca32b, 0x67b196de, 0x5db292e8, 0x8c1b406b, 0x01f34075, 0xfa2520f7, 0x73bc37ab, 0x1e18bc30, 0xfe2c6cb3, 0x20c522d0, 0x5639e3db, 0x942bda35, 0x899af9d1, 0xced44035, 0x98cc025b, 0x255f5771, 0x70fefa24, 0xe928fa4d, 0x2c030405, 0xb9325590, 0x20cb63bd, 0xa166305d, 0x80e52c0a, 0xa8fafe2f, 0x1ad13f7d, 0xcfaf3685, 0x6c83a199, 0x7d26718a, 0xde5dfcd9, 0x79cf7355, 0x8979d7fb, 0xebf8c55e, 0xebe408e4, 0xcd2affba, 0xe483be6e, 0xe239d6de, 0x5dc1e9e0, 0x0473931f, 0x851b097c, 0xac5db249, 0x09c0f9f2, 0xd8d2f134, 0xe6f38e41, 0xb1c71bf1, 0x52b6e4db, 0x07224424, 0x6cf73e85, 0x4f25d89c, 0x782a7d74, 0x10a68dcd, 0x3a868189, 0xd570d2dc, 0x69630745, 0x9542ed86, 0x331cd6b2, 0xa84b5b28, 0x07879c9d, 0x38372f64, 0x7185db11, 0x25ba7c83, 0x01061523, 0xe6792f9f, 0xe5df07d1, 0x4321b47f, 0x7d2469d8, 0x1a3a4f90, 0x48be29a3, 0x669071af, 0x8ec8dd31, 0x0810bfbf, 0x813a06b4, 0x68538345, 0x65865ddc, 0x43a71b8e, 0x78619a56, 0x5a34451d, 0x5bdaa3ed, 0x71edc7e9, 0x17ac9a20, 0x78d10bfa, 0x6c1e7f35, 0xd51839d9, 0x240cbc51, 0x33513cc1, 0xd2b4f795, 0xccaa8186, 0x0babe682, 0xa33cf164, 0x18c643ea, 0xc1ca105f, 0x9959147a, 0x6d3d94de, 0x0b654fbe, 0xed902ca0, 0x7d835cb5, 0x99ba1509, 0x6445c922, 0x495e76c2, 0xf07194bc, 0xa1631d7e, 0x677076a5, 0x89fffe35, 0x1a49bcf3, 0x8e6c948a, 0x0144c917, 0x8d93aea1, 0x16f87ddf, 0xc8f25d49, 0x1fb11297, 0x27e750cd, 0x2f422da1, 0xdee89a77, 0x1534c643, 0x457b7b8b, 0xaf172f7a, 0x6b9b09d6, 0x33573f7f, 0xf14e15c4, 0x526467d5, 0xaf488241, 0x87c3ee0d, 0x33be490c, 0x95aa6e52, 0x43ec242e, 0xd77de99b, 0xd018334f, 0x5b78d407, 0x498eb66b, 0xb1279fa8, 0xb38b0ea6, 0x90718376, 0xe325dee2, 0x8e2f2cba, 0xcaa5bdec, 0x9d652c56, 0xad68f5cb, 0xa77591af, 0x88e37ee8, 0xf8faa221, 0xfcbbbe47, 0x4f407786, 0xaf393889, 0xf444a1d9, 0x15ae1a2f, 0x40aa7097, 0x6f9486ac, 0x29d232a3, 0xe47609e9, 0xe8b631ff, 0xba8565f4, 0x11288749, 0x46c9a838, 0xeb1b7cd8, 0xf516bbb1, 0xfb74fda0, 0x010996e6, 0x4c994653, 0x1d889512, 0x53dcd9a3, 0xdd074697, 0x1e78e17c, 0x637c98bf, 0x930bb219, 0xcf7f75b0, 0xcb9355fb, 0x9e623009, 0xe466d82c, 0x28f968d3, 0xfeb385d9, 0x238e026c, 0xb8ed0560, 0x0c6a027a, 0x3d6fec4b, 0xbb4b2ec2, 0xe715031c, 0xeded011d, 0xcdc4d3b9, 0xc456fc96, 0xdd0eea20, 0xb3df8ec9, 0x12351993, 0xd9cbb01c, 0x603147a2, 0xcf37d17d, 0xf7fcd9dc, 0xd8556fa3, 0x104c8131, 0x13152774, 0xb4715811, 0x6a72c2c9, 0xc5ae37bb, 0xa76ce12a, 0x8150d8f3, 0x2ec29218, 0xa35f0984, 0x48c0647e, 0x0b5ff98c, 0x71893f7b }; #define BARREL_SHIFT(v, shift) ( ((v) << (shift)) | ((v) >> ((32 - (shift)) & 0x1f)) ) size_t pagemask; static uint32_t * buzhash_init_table(uint32_t seed) { int i; uint32_t *table = malloc(1024); for(i = 0; i < 256; i++) { table[i] = table_base[i] ^ seed; } return table; } static uint32_t buzhash(const unsigned char *data, size_t len, const uint32_t *h) { uint32_t i; uint32_t sum = 0, imod; for(i = len - 1; i > 0; i--) { imod = i & 0x1f; sum ^= BARREL_SHIFT(h[*data], imod); data++; } return sum ^ h[*data]; } static uint32_t buzhash_update(uint32_t sum, unsigned char remove, unsigned char add, size_t len, const uint32_t *h) { uint32_t lenmod = len & 0x1f; /* Note: replace by constant to get small speedup */ return BARREL_SHIFT(sum, 1) ^ BARREL_SHIFT(h[remove], lenmod) ^ h[add]; } typedef struct { uint32_t chunk_mask; uint32_t *table; uint8_t *data; PyObject *fd; int fh; int done, eof; size_t min_size, buf_size, window_size, remaining, position, last; off_t bytes_read, bytes_yielded; } Chunker; static Chunker * chunker_init(size_t window_size, uint32_t chunk_mask, size_t min_size, size_t max_size, uint32_t seed) { Chunker *c = calloc(sizeof(Chunker), 1); c->window_size = window_size; c->chunk_mask = chunk_mask; c->min_size = min_size; c->table = buzhash_init_table(seed); c->buf_size = max_size; c->data = malloc(c->buf_size); c->fh = -1; return c; } static void chunker_set_fd(Chunker *c, PyObject *fd, int fh) { Py_XDECREF(c->fd); c->fd = fd; Py_INCREF(fd); c->fh = fh; c->done = 0; c->remaining = 0; c->bytes_read = 0; c->bytes_yielded = 0; c->position = 0; c->last = 0; c->eof = 0; } static void chunker_free(Chunker *c) { Py_XDECREF(c->fd); free(c->table); free(c->data); free(c); } static int chunker_fill(Chunker *c) { ssize_t n; PyObject *data; PyThreadState *thread_state; memmove(c->data, c->data + c->last, c->position + c->remaining - c->last); c->position -= c->last; c->last = 0; n = c->buf_size - c->position - c->remaining; if(c->eof || n == 0) { return 1; } if(c->fh >= 0) { thread_state = PyEval_SaveThread(); #if ( ( _XOPEN_SOURCE >= 600 || _POSIX_C_SOURCE >= 200112L ) && defined(POSIX_FADV_DONTNEED) ) off_t offset = c->bytes_read; #endif // if we have a os-level file descriptor, use os-level API n = read(c->fh, c->data + c->position + c->remaining, n); if(n > 0) { c->remaining += n; c->bytes_read += n; } else if(n == 0) { c->eof = 1; } else { PyEval_RestoreThread(thread_state); // some error happened PyErr_SetFromErrno(PyExc_OSError); return 0; } #if ( ( _XOPEN_SOURCE >= 600 || _POSIX_C_SOURCE >= 200112L ) && defined(POSIX_FADV_DONTNEED) ) off_t length = c->bytes_read - offset; // Only do it once per run. if (pagemask == 0) pagemask = getpagesize() - 1; // We tell the OS that we do not need the data that we just have read any // more (that it maybe has in the cache). This avoids that we spoil the // complete cache with data that we only read once and (due to cache // size limit) kick out data from the cache that might be still useful // for the OS or other processes. // We rollback the initial offset back to the start of the page, // to avoid it not being truncated as a partial page request. int overshoot; if (length > 0) { // All Linux kernels (at least up to and including 4.6(.0)) have a bug where // they truncate last partial page of POSIX_FADV_DONTNEED request, so we need // to page-align it ourselves. We'll need the rest of this page on the next // read (assuming this was not EOF). overshoot = (offset + length) & pagemask; } else { // For length == 0 we set overshoot 0, so the below // length - overshoot is 0, which means till end of file for // fadvise. This will cancel the final page and is not part // of the above workaround. overshoot = 0; } posix_fadvise(c->fh, offset & ~pagemask, length - overshoot, POSIX_FADV_DONTNEED); #endif PyEval_RestoreThread(thread_state); } else { // no os-level file descriptor, use Python file object API data = PyObject_CallMethod(c->fd, "read", "i", n); if(!data) { return 0; } n = PyBytes_Size(data); if(PyErr_Occurred()) { // we wanted bytes(), but got something else return 0; } if(n) { memcpy(c->data + c->position + c->remaining, PyBytes_AsString(data), n); c->remaining += n; c->bytes_read += n; } else { c->eof = 1; } Py_DECREF(data); } return 1; } static PyObject * chunker_process(Chunker *c) { uint32_t sum, chunk_mask = c->chunk_mask; size_t n, old_last, min_size = c->min_size, window_size = c->window_size; if(c->done) { if(c->bytes_read == c->bytes_yielded) PyErr_SetNone(PyExc_StopIteration); else PyErr_SetString(PyExc_Exception, "chunkifier byte count mismatch"); return NULL; } while(c->remaining < min_size + window_size + 1 && !c->eof) { /* see assert in Chunker init */ if(!chunker_fill(c)) { return NULL; } } /* here we either are at eof ... */ if(c->eof) { c->done = 1; if(c->remaining) { c->bytes_yielded += c->remaining; return PyMemoryView_FromMemory((char *)(c->data + c->position), c->remaining, PyBUF_READ); } else { if(c->bytes_read == c->bytes_yielded) PyErr_SetNone(PyExc_StopIteration); else PyErr_SetString(PyExc_Exception, "chunkifier byte count mismatch"); return NULL; } } /* ... or we have at least min_size + window_size + 1 bytes remaining. * We do not want to "cut" a chunk smaller than min_size and the hash * window starts at the potential cutting place. */ c->position += min_size; c->remaining -= min_size; sum = buzhash(c->data + c->position, window_size, c->table); while(c->remaining > c->window_size && (sum & chunk_mask)) { uint8_t *p = c->data + c->position; uint8_t *stop_at = p + c->remaining - window_size; size_t did_bytes; while (p < stop_at && (sum & chunk_mask)) { sum = buzhash_update(sum, p[0], p[window_size], window_size, c->table); p++; } did_bytes = p - (c->data + c->position); c->position += did_bytes; c->remaining -= did_bytes; if(c->remaining <= window_size) { if(!chunker_fill(c)) { return NULL; } } } if(c->remaining <= window_size) { c->position += c->remaining; c->remaining = 0; } old_last = c->last; c->last = c->position; n = c->last - old_last; c->bytes_yielded += n; return PyMemoryView_FromMemory((char *)(c->data + old_last), n, PyBUF_READ); } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/_endian.h0000644000076500000240000000201714641074756015514 0ustar00twstaff#if !defined(_MSC_VER) # include #endif #include #include #if defined (__SVR4) && defined (__sun) #include #endif #if (defined(BYTE_ORDER) && defined(BIG_ENDIAN) && (BYTE_ORDER == BIG_ENDIAN)) || \ (defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)) || \ (defined(_BIG_ENDIAN) && defined(__SVR4) && defined(__sun)) #define BORG_BIG_ENDIAN 1 #elif (defined(BYTE_ORDER) && defined(LITTLE_ENDIAN) && (BYTE_ORDER == LITTLE_ENDIAN)) || \ (defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)) || \ (defined(_LITTLE_ENDIAN) && defined(__SVR4) && defined(__sun)) || \ (defined(_MSC_VER) && (defined(_M_AMD64) || defined(_M_IX86))) #define BORG_BIG_ENDIAN 0 #else #error Unknown byte order #endif #if BORG_BIG_ENDIAN #define _le32toh(x) __builtin_bswap32(x) #define _htole32(x) __builtin_bswap32(x) #else #define _le32toh(x) (x) #define _htole32(x) (x) #endif ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/_hashindex.c0000644000076500000240000005702314641074756016233 0ustar00twstaff #include #include #include #include #include #include #include #include #include #if !defined(_MSC_VER) # include #endif #include "_endian.h" #if defined(_MSC_VER) # define BORG_PACKED(x) __pragma(pack(push, 1)) x __pragma(pack(pop)) #else # define BORG_PACKED(x) x __attribute__((packed)) #endif #define MAGIC "BORG_IDX" #define MAGIC_LEN 8 #define DEBUG 0 #define debug_print(fmt, ...) \ do { \ if (DEBUG) { \ fprintf(stderr, fmt, __VA_ARGS__); \ fflush(NULL); \ } \ } while (0) BORG_PACKED( typedef struct { char magic[MAGIC_LEN]; int32_t num_entries; int32_t num_buckets; int8_t key_size; int8_t value_size; }) HashHeader; typedef struct { unsigned char *buckets; int num_entries; int num_buckets; int num_empty; int key_size; int value_size; off_t bucket_size; int lower_limit; int upper_limit; int min_empty; #ifndef BORG_NO_PYTHON /* buckets may be backed by a Python buffer. If buckets_buffer.buf is NULL then this is not used. */ Py_buffer buckets_buffer; #endif } HashIndex; /* prime (or w/ big prime factors) hash table sizes * not sure we need primes for borg's usage (as we have a hash function based * on sha256, we can assume an even, seemingly random distribution of values), * but OTOH primes don't harm. * also, growth of the sizes starts with fast-growing 2x steps, but slows down * more and more down to 1.1x. this is to avoid huge jumps in memory allocation, * like e.g. 4G -> 8G. * these values are generated by hash_sizes.py. * * update: no, we don't need primes or w/ big prime factors, we followed some * incomplete / irrelevant advice here that did not match our use case. * otoh, for now, we do not need to change the sizes as they do no harm. * see ticket #2830. */ static int hash_sizes[] = { 1031, 2053, 4099, 8209, 16411, 32771, 65537, 131101, 262147, 445649, 757607, 1287917, 2189459, 3065243, 4291319, 6007867, 8410991, 11775359, 16485527, 23079703, 27695653, 33234787, 39881729, 47858071, 57429683, 68915617, 82698751, 99238507, 119086189, 144378011, 157223263, 173476439, 190253911, 209915011, 230493629, 253169431, 278728861, 306647623, 337318939, 370742809, 408229973, 449387209, 493428073, 543105119, 596976533, 657794869, 722676499, 795815791, 874066969, 962279771, 1057701643, 1164002657, 1280003147, 1407800297, 1548442699, 1703765389, 1873768367, 2062383853, /* 32bit int ends about here */ }; #define HASH_MIN_LOAD .25 #define HASH_MAX_LOAD .75 /* don't go higher than 0.75, otherwise performance severely suffers! */ #define HASH_MAX_EFF_LOAD .93 #define MAX(x, y) ((x) > (y) ? (x): (y)) #define NELEMS(x) (sizeof(x) / sizeof((x)[0])) #define EMPTY _htole32(0xffffffff) #define DELETED _htole32(0xfffffffe) #define BUCKET_ADDR(index, idx) (index->buckets + ((idx) * index->bucket_size)) #define BUCKET_MATCHES_KEY(index, idx, key) (memcmp(key, BUCKET_ADDR(index, idx), index->key_size) == 0) #define BUCKET_IS_DELETED(index, idx) (*((uint32_t *)(BUCKET_ADDR(index, idx) + index->key_size)) == DELETED) #define BUCKET_IS_EMPTY(index, idx) (*((uint32_t *)(BUCKET_ADDR(index, idx) + index->key_size)) == EMPTY) #define BUCKET_MARK_DELETED(index, idx) (*((uint32_t *)(BUCKET_ADDR(index, idx) + index->key_size)) = DELETED) #define BUCKET_MARK_EMPTY(index, idx) (*((uint32_t *)(BUCKET_ADDR(index, idx) + index->key_size)) = EMPTY) #define EPRINTF_MSG(msg, ...) fprintf(stderr, "hashindex: " msg "\n", ##__VA_ARGS__) #define EPRINTF_MSG_PATH(path, msg, ...) fprintf(stderr, "hashindex: %s: " msg "\n", path, ##__VA_ARGS__) #define EPRINTF(msg, ...) fprintf(stderr, "hashindex: " msg "(%s)\n", ##__VA_ARGS__, strerror(errno)) #define EPRINTF_PATH(path, msg, ...) fprintf(stderr, "hashindex: %s: " msg " (%s)\n", path, ##__VA_ARGS__, strerror(errno)) #ifndef BORG_NO_PYTHON static HashIndex *hashindex_read(PyObject *file_py, int permit_compact); static void hashindex_write(HashIndex *index, PyObject *file_py); #endif static uint64_t hashindex_compact(HashIndex *index); static HashIndex *hashindex_init(int capacity, int key_size, int value_size); static const unsigned char *hashindex_get(HashIndex *index, const unsigned char *key); static int hashindex_set(HashIndex *index, const unsigned char *key, const void *value); static int hashindex_delete(HashIndex *index, const unsigned char *key); static unsigned char *hashindex_next_key(HashIndex *index, const unsigned char *key); /* Private API */ static void hashindex_free(HashIndex *index); static void hashindex_free_buckets(HashIndex *index) { #ifndef BORG_NO_PYTHON if(index->buckets_buffer.buf) { PyBuffer_Release(&index->buckets_buffer); } else #endif { free(index->buckets); } } static int hashindex_index(HashIndex *index, const unsigned char *key) { return _le32toh(*((uint32_t *)key)) % index->num_buckets; } static int hashindex_lookup(HashIndex *index, const unsigned char *key, int *start_idx) { int didx = -1; int start = hashindex_index(index, key); /* perfect index for this key, if there is no collision. */ int idx = start; for(;;) { if(BUCKET_IS_EMPTY(index, idx)) { break; /* if we encounter an empty bucket, we do not need to look any further. */ } if(BUCKET_IS_DELETED(index, idx)) { if(didx == -1) { didx = idx; /* remember the index of the first deleted bucket. */ } } else if(BUCKET_MATCHES_KEY(index, idx, key)) { /* we found the bucket with the key we are looking for! */ if (didx != -1) { // note: although lookup is logically a read-only operation, // we optimize (change) the hashindex here "on the fly": // swap this full bucket with a previous deleted/tombstone bucket. memcpy(BUCKET_ADDR(index, didx), BUCKET_ADDR(index, idx), index->bucket_size); BUCKET_MARK_DELETED(index, idx); idx = didx; } return idx; } idx++; if (idx >= index->num_buckets) { /* triggers at == already */ idx = 0; } /* When idx == start, we have done a full pass over all buckets. * - We did not find a bucket with the key we searched for. * - We did not find an empty bucket either. * So all buckets are either full or deleted/tombstones. * This is an invalid state we never should get into, see * upper_limit and min_empty. */ assert(idx != start); } /* we get here if we did not find a bucket with the key we searched for. */ if (start_idx != NULL) { /* by giving a non-NULL pointer in start_idx, caller can request to * get the index of the first empty or deleted bucket we encountered, * e.g. to add a new entry for that key into that bucket. */ (*start_idx) = (didx == -1) ? idx : didx; } return -1; } static int hashindex_resize(HashIndex *index, int capacity) { HashIndex *new; unsigned char *key = NULL; int32_t key_size = index->key_size; if(!(new = hashindex_init(capacity, key_size, index->value_size))) { return 0; } while((key = hashindex_next_key(index, key))) { if(!hashindex_set(new, key, key + key_size)) { /* This can only happen if there's a bug in the code calculating capacity */ hashindex_free(new); return 0; } } assert(index->num_entries == new->num_entries); hashindex_free_buckets(index); index->buckets = new->buckets; index->num_buckets = new->num_buckets; index->num_empty = index->num_buckets - index->num_entries; index->lower_limit = new->lower_limit; index->upper_limit = new->upper_limit; index->min_empty = new->min_empty; free(new); return 1; } int get_lower_limit(int num_buckets){ int min_buckets = hash_sizes[0]; if (num_buckets <= min_buckets) return 0; return (int)(num_buckets * HASH_MIN_LOAD); } int get_upper_limit(int num_buckets){ int max_buckets = hash_sizes[NELEMS(hash_sizes) - 1]; if (num_buckets >= max_buckets) return num_buckets; return (int)(num_buckets * HASH_MAX_LOAD); } int get_min_empty(int num_buckets){ /* Differently from load, the effective load also considers tombstones (deleted buckets). * We always add 1, so this never can return 0 (0 empty buckets would be a bad HT state). */ return 1 + (int)(num_buckets * (1.0 - HASH_MAX_EFF_LOAD)); } int size_idx(int size){ /* find the smallest hash_sizes index with entry >= size */ int i = NELEMS(hash_sizes) - 1; while(i >= 0 && hash_sizes[i] >= size) i--; return i + 1; } int fit_size(int current){ int i = size_idx(current); return hash_sizes[i]; } int grow_size(int current){ int i = size_idx(current) + 1; int elems = NELEMS(hash_sizes); if (i >= elems) return hash_sizes[elems - 1]; return hash_sizes[i]; } int shrink_size(int current){ int i = size_idx(current) - 1; if (i < 0) return hash_sizes[0]; return hash_sizes[i]; } int count_empty(HashIndex *index) { /* count empty (never used) buckets. this does NOT include deleted buckets (tombstones). * TODO: if we ever change HashHeader, save the count there so we do not need this function. */ int i, count = 0, capacity = index->num_buckets; for(i = 0; i < capacity; i++) { if(BUCKET_IS_EMPTY(index, i)) count++; } return count; } /* Public API */ #ifndef BORG_NO_PYTHON static HashIndex * hashindex_read(PyObject *file_py, int permit_compact) { Py_ssize_t length, buckets_length, bytes_read; Py_buffer header_buffer; PyObject *header_bytes, *length_object, *bucket_bytes, *tmp; HashHeader *header; HashIndex *index = NULL; header_bytes = PyObject_CallMethod(file_py, "read", "n", (Py_ssize_t)sizeof(HashHeader)); if(!header_bytes) { assert(PyErr_Occurred()); goto fail; } bytes_read = PyBytes_Size(header_bytes); if(PyErr_Occurred()) { /* TypeError, not a bytes() object */ goto fail_decref_header; } if(bytes_read != sizeof(HashHeader)) { /* Truncated file */ /* Note: %zd is the format for Py_ssize_t, %zu is for size_t */ PyErr_Format(PyExc_ValueError, "Could not read header (expected %zu, but read %zd bytes)", sizeof(HashHeader), bytes_read); goto fail_decref_header; } /* * Hash the header * If the header is corrupted this bails before doing something stupid (like allocating 3.8 TB of memory) */ tmp = PyObject_CallMethod(file_py, "hash_part", "s", "HashHeader"); Py_XDECREF(tmp); if(PyErr_Occurred()) { if(PyErr_ExceptionMatches(PyExc_AttributeError)) { /* Be able to work with regular file objects which do not have a hash_part method. */ PyErr_Clear(); } else { goto fail_decref_header; } } /* Find length of file */ length_object = PyObject_CallMethod(file_py, "seek", "ni", (Py_ssize_t)0, SEEK_END); if(PyErr_Occurred()) { goto fail_decref_header; } length = PyNumber_AsSsize_t(length_object, PyExc_OverflowError); Py_DECREF(length_object); if(PyErr_Occurred()) { /* This shouldn't generally happen; but can if seek() returns something that's not a number */ goto fail_decref_header; } tmp = PyObject_CallMethod(file_py, "seek", "ni", (Py_ssize_t)sizeof(HashHeader), SEEK_SET); Py_XDECREF(tmp); if(PyErr_Occurred()) { goto fail_decref_header; } /* Set up the in-memory header */ if(!(index = malloc(sizeof(HashIndex)))) { PyErr_NoMemory(); goto fail_decref_header; } PyObject_GetBuffer(header_bytes, &header_buffer, PyBUF_SIMPLE); if(PyErr_Occurred()) { goto fail_free_index; } header = (HashHeader*) header_buffer.buf; if(memcmp(header->magic, MAGIC, MAGIC_LEN)) { PyErr_Format(PyExc_ValueError, "Unknown MAGIC in header"); goto fail_release_header_buffer; } buckets_length = (Py_ssize_t)_le32toh(header->num_buckets) * (header->key_size + header->value_size); if((Py_ssize_t)length != (Py_ssize_t)sizeof(HashHeader) + buckets_length) { PyErr_Format(PyExc_ValueError, "Incorrect file length (expected %zd, got %zd)", sizeof(HashHeader) + buckets_length, length); goto fail_release_header_buffer; } index->num_entries = _le32toh(header->num_entries); index->num_buckets = _le32toh(header->num_buckets); index->key_size = header->key_size; index->value_size = header->value_size; index->bucket_size = index->key_size + index->value_size; index->lower_limit = get_lower_limit(index->num_buckets); index->upper_limit = get_upper_limit(index->num_buckets); /* * For indices read from disk we don't malloc() the buckets ourselves, * we have them backed by a Python bytes() object instead, and go through * Python I/O. * * Note: Issuing read(buckets_length) is okay here, because buffered readers * will issue multiple underlying reads if necessary. This supports indices * >2 GB on Linux. We also compare lengths later. */ bucket_bytes = PyObject_CallMethod(file_py, "read", "n", buckets_length); if(!bucket_bytes) { assert(PyErr_Occurred()); goto fail_release_header_buffer; } bytes_read = PyBytes_Size(bucket_bytes); if(PyErr_Occurred()) { /* TypeError, not a bytes() object */ goto fail_decref_buckets; } if(bytes_read != buckets_length) { PyErr_Format(PyExc_ValueError, "Could not read buckets (expected %zd, got %zd)", buckets_length, bytes_read); goto fail_decref_buckets; } PyObject_GetBuffer(bucket_bytes, &index->buckets_buffer, PyBUF_SIMPLE); if(PyErr_Occurred()) { goto fail_decref_buckets; } index->buckets = index->buckets_buffer.buf; if(!permit_compact) { index->min_empty = get_min_empty(index->num_buckets); index->num_empty = count_empty(index); if(index->num_empty < index->min_empty) { /* too many tombstones here / not enough empty buckets, do a same-size rebuild */ if(!hashindex_resize(index, index->num_buckets)) { PyErr_Format(PyExc_ValueError, "Failed to rebuild table"); goto fail_free_buckets; } } } /* * Clean intermediary objects up. Note that index is only freed if an error has occurred. * Also note that the buffer in index->buckets_buffer holds a reference to buckets_bytes. */ fail_free_buckets: if(PyErr_Occurred()) { hashindex_free_buckets(index); } fail_decref_buckets: Py_DECREF(bucket_bytes); fail_release_header_buffer: PyBuffer_Release(&header_buffer); fail_free_index: if(PyErr_Occurred()) { free(index); index = NULL; } fail_decref_header: Py_DECREF(header_bytes); fail: return index; } #endif static HashIndex * hashindex_init(int capacity, int key_size, int value_size) { HashIndex *index; int i; capacity = fit_size(capacity); if(!(index = malloc(sizeof(HashIndex)))) { EPRINTF("malloc header failed"); return NULL; } if(!(index->buckets = calloc(capacity, key_size + value_size))) { EPRINTF("malloc buckets failed"); free(index); return NULL; } index->num_entries = 0; index->key_size = key_size; index->value_size = value_size; index->num_buckets = capacity; index->num_empty = capacity; index->bucket_size = index->key_size + index->value_size; index->lower_limit = get_lower_limit(index->num_buckets); index->upper_limit = get_upper_limit(index->num_buckets); index->min_empty = get_min_empty(index->num_buckets); #ifndef BORG_NO_PYTHON index->buckets_buffer.buf = NULL; #endif for(i = 0; i < capacity; i++) { BUCKET_MARK_EMPTY(index, i); } return index; } static void hashindex_free(HashIndex *index) { hashindex_free_buckets(index); free(index); } #ifndef BORG_NO_PYTHON static void hashindex_write(HashIndex *index, PyObject *file_py) { PyObject *length_object, *buckets_view, *tmp; Py_ssize_t length; Py_ssize_t buckets_length = (Py_ssize_t)index->num_buckets * index->bucket_size; HashHeader header = { .magic = MAGIC, .num_entries = _htole32(index->num_entries), .num_buckets = _htole32(index->num_buckets), .key_size = index->key_size, .value_size = index->value_size }; length_object = PyObject_CallMethod(file_py, "write", "y#", &header, (Py_ssize_t)sizeof(HashHeader)); if(PyErr_Occurred()) { return; } length = PyNumber_AsSsize_t(length_object, PyExc_OverflowError); Py_DECREF(length_object); if(PyErr_Occurred()) { return; } if(length != sizeof(HashHeader)) { PyErr_SetString(PyExc_ValueError, "Failed to write header"); return; } /* * Hash the header */ tmp = PyObject_CallMethod(file_py, "hash_part", "s", "HashHeader"); Py_XDECREF(tmp); if(PyErr_Occurred()) { if(PyErr_ExceptionMatches(PyExc_AttributeError)) { /* Be able to work with regular file objects which do not have a hash_part method. */ PyErr_Clear(); } else { return; } } /* Note: explicitly construct view; BuildValue can convert (pointer, length) to Python objects, but copies them for doing so */ buckets_view = PyMemoryView_FromMemory((char*)index->buckets, buckets_length, PyBUF_READ); if(!buckets_view) { assert(PyErr_Occurred()); return; } length_object = PyObject_CallMethod(file_py, "write", "O", buckets_view); Py_DECREF(buckets_view); if(PyErr_Occurred()) { return; } length = PyNumber_AsSsize_t(length_object, PyExc_OverflowError); Py_DECREF(length_object); if(PyErr_Occurred()) { return; } if(length != buckets_length) { PyErr_SetString(PyExc_ValueError, "Failed to write buckets"); return; } } #endif static const unsigned char * hashindex_get(HashIndex *index, const unsigned char *key) { int idx = hashindex_lookup(index, key, NULL); if(idx < 0) { return NULL; } return BUCKET_ADDR(index, idx) + index->key_size; } static int hashindex_set(HashIndex *index, const unsigned char *key, const void *value) { int start_idx; int idx = hashindex_lookup(index, key, &start_idx); /* if idx < 0: start_idx -> EMPTY or DELETED */ uint8_t *ptr; if(idx < 0) { if(index->num_entries > index->upper_limit) { /* hashtable too full, grow it! */ if(!hashindex_resize(index, grow_size(index->num_buckets))) { return 0; } /* we have just built a fresh hashtable and removed all tombstones, * so we only have EMPTY or USED buckets, but no DELETED ones any more. */ idx = hashindex_lookup(index, key, &start_idx); assert(idx < 0); assert(BUCKET_IS_EMPTY(index, start_idx)); } idx = start_idx; if(BUCKET_IS_EMPTY(index, idx)){ if(index->num_empty <= index->min_empty) { /* too many tombstones here / not enough empty buckets, do a same-size rebuild */ if(!hashindex_resize(index, index->num_buckets)) { return 0; } /* we have just built a fresh hashtable and removed all tombstones, * so we only have EMPTY or USED buckets, but no DELETED ones any more. */ idx = hashindex_lookup(index, key, &start_idx); assert(idx < 0); assert(BUCKET_IS_EMPTY(index, start_idx)); idx = start_idx; } index->num_empty--; } else { /* Bucket must be either EMPTY (see above) or DELETED. */ assert(BUCKET_IS_DELETED(index, idx)); } ptr = BUCKET_ADDR(index, idx); memcpy(ptr, key, index->key_size); memcpy(ptr + index->key_size, value, index->value_size); index->num_entries += 1; } else { memcpy(BUCKET_ADDR(index, idx) + index->key_size, value, index->value_size); } return 1; } static int hashindex_delete(HashIndex *index, const unsigned char *key) { int idx = hashindex_lookup(index, key, NULL); if (idx < 0) { return -1; } BUCKET_MARK_DELETED(index, idx); index->num_entries -= 1; if(index->num_entries < index->lower_limit) { if(!hashindex_resize(index, shrink_size(index->num_buckets))) { return 0; } } return 1; } static unsigned char * hashindex_next_key(HashIndex *index, const unsigned char *key) { int idx = 0; if(key) { idx = 1 + (key - index->buckets) / index->bucket_size; } if (idx == index->num_buckets) { return NULL; } while(BUCKET_IS_EMPTY(index, idx) || BUCKET_IS_DELETED(index, idx)) { idx ++; if (idx == index->num_buckets) { return NULL; } } return BUCKET_ADDR(index, idx); } static uint64_t hashindex_compact(HashIndex *index) { int idx = 0; int start_idx; int begin_used_idx; int empty_slot_count, count, buckets_to_copy; int compact_tail_idx = 0; uint64_t saved_size = (index->num_buckets - index->num_entries) * (uint64_t)index->bucket_size; if(index->num_buckets - index->num_entries == 0) { /* already compact */ return 0; } while(idx < index->num_buckets) { /* Phase 1: Find some empty slots */ start_idx = idx; while((idx < index->num_buckets) && (BUCKET_IS_EMPTY(index, idx) || BUCKET_IS_DELETED(index, idx))) { idx++; } /* everything from start_idx to idx-1 (inclusive) is empty or deleted */ count = empty_slot_count = idx - start_idx; begin_used_idx = idx; if(!empty_slot_count) { /* In case idx==compact_tail_idx, the areas overlap */ memmove(BUCKET_ADDR(index, compact_tail_idx), BUCKET_ADDR(index, idx), index->bucket_size); idx++; compact_tail_idx++; continue; } /* Phase 2: Find some non-empty/non-deleted slots we can move to the compact tail */ while(empty_slot_count && (idx < index->num_buckets) && !(BUCKET_IS_EMPTY(index, idx) || BUCKET_IS_DELETED(index, idx))) { idx++; empty_slot_count--; } buckets_to_copy = count - empty_slot_count; if(!buckets_to_copy) { /* Nothing to move, reached end of the buckets array with no used buckets. */ break; } memcpy(BUCKET_ADDR(index, compact_tail_idx), BUCKET_ADDR(index, begin_used_idx), buckets_to_copy * index->bucket_size); compact_tail_idx += buckets_to_copy; } index->num_buckets = index->num_entries; return saved_size; } static int hashindex_len(HashIndex *index) { return index->num_entries; } static int hashindex_size(HashIndex *index) { return sizeof(HashHeader) + index->num_buckets * index->bucket_size; } /* * Used by the FuseVersionsIndex. */ BORG_PACKED( typedef struct { uint32_t version; char hash[16]; } ) FuseVersionsElement; ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/_item.c0000644000076500000240000000271614641074756015215 0ustar00twstaff#include "Python.h" /* * This is not quite as dark magic as it looks. We just convert the address of (pointer to) * a PyObject into a bytes object in _wrap_object, and convert these bytes back to the * pointer to the original object. * * This mainly looks a bit confusing due to our mental special-casing of "char*" from other * pointers. * * The big upside to this is that this neither does *any* serialization (beyond creating tiny * bytes objects as "stand-ins"), nor has to copy the entire object that's passed around. */ static PyObject * _object_to_optr(PyObject *obj) { /* * Create a temporary reference to the object being passed around so it does not vanish. * Note that we never decref this one in _unwrap_object, since we just transfer that reference * there, i.e. there is an elided "Py_INCREF(x); Py_DECREF(x)". * Since the reference is transferred, calls to _wrap_object and _unwrap_object must be symmetric. */ Py_INCREF(obj); return PyBytes_FromStringAndSize((const char*) &obj, sizeof(void*)); } static PyObject * _optr_to_object(PyObject *bytes) { if(!PyBytes_Check(bytes)) { PyErr_SetString(PyExc_TypeError, "Cannot unwrap non-bytes object"); return NULL; } if(PyBytes_Size(bytes) != sizeof(void*)) { PyErr_SetString(PyExc_TypeError, "Invalid length of bytes object"); return NULL; } PyObject *object = * (PyObject **) PyBytes_AsString(bytes); return object; } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719958149.0 borgbackup-1.4.0/src/borg/_version.py0000644000076500000240000000004014641075205016124 0ustar00twstaff__version__ = version = '1.4.0' ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719958149.8245573 borgbackup-1.4.0/src/borg/algorithms/0000755000076500000240000000000014641075206016106 5ustar00twstaff././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/algorithms/__init__.py0000644000076500000240000000046014641074756020230 0ustar00twstaff""" borg.algorithms =============== This package is intended for hash and checksum functions. Ideally these would be sourced from existing libraries, but: - are frequently not available yet (lz4, zstd), - are available but in poor form (crc32), or - don't really make sense as a library (xxHash). """ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719958149.0 borgbackup-1.4.0/src/borg/algorithms/checksums.c0000644000076500000240000150712714641075205020253 0ustar00twstaff/* Generated by Cython 3.0.10 */ /* BEGIN: Cython Metadata { "distutils": { "depends": [ "/opt/homebrew/Cellar/xxhash/0.8.2/include/xxhash.h", "src/borg/algorithms/crc32_dispatch.c" ], "extra_compile_args": [ "-Wall", "-Wextra", "-Wpointer-arith" ], "include_dirs": [ "src/borg/algorithms", "/opt/homebrew/Cellar/xxhash/0.8.2/include" ], "libraries": [ "xxhash" ], "library_dirs": [ "/opt/homebrew/Cellar/xxhash/0.8.2/lib" ], "name": "borg.algorithms.checksums", "sources": [ "src/borg/algorithms/checksums.pyx" ] }, "module_name": "borg.algorithms.checksums" } END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_10" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x03000AF0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 1 #endif #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #if PY_VERSION_HEX >= 0x030d00A4 # define __Pyx_PyCFunctionFast PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords #else # define __Pyx_PyCFunctionFast _PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__borg__algorithms__checksums #define __PYX_HAVE_API__borg__algorithms__checksums /* Early includes */ #include #include #include #include "crc32_dispatch.c" #include "xxhash.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "", "src/borg/algorithms/checksums.pyx", "type.pxd", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_4borg_10algorithms_9checksums_StreamingXXH64; /* "borg/algorithms/checksums.pyx":84 * * * cdef class StreamingXXH64: # <<<<<<<<<<<<<< * cdef XXH64_state_t* state * */ struct __pyx_obj_4borg_10algorithms_9checksums_StreamingXXH64 { PyObject_HEAD XXH64_state_t *state; }; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* SwapException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif /* GetTopmostException.proto */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); #endif /* SaveResetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* KeywordStringCheck.proto */ static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* PyObjectCallNoArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* ValidateBasesTuple.proto */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); #endif /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* SetupReduce.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce(PyObject* type_obj); #endif /* TypeImport.proto */ #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_10 #define __PYX_HAVE_RT_ImportType_proto_3_0_10 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L #define __PYX_GET_STRUCT_ALIGNMENT_3_0_10(s) alignof(s) #else #define __PYX_GET_STRUCT_ALIGNMENT_3_0_10(s) sizeof(void*) #endif enum __Pyx_ImportType_CheckSize_3_0_10 { __Pyx_ImportType_CheckSize_Error_3_0_10 = 0, __Pyx_ImportType_CheckSize_Warn_3_0_10 = 1, __Pyx_ImportType_CheckSize_Ignore_3_0_10 = 2 }; static PyTypeObject *__Pyx_ImportType_3_0_10(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_10 check_size); #endif /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntFromPy.proto */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value); /* CIntFromPy.proto */ static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_As_unsigned_PY_LONG_LONG(PyObject *); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc.stdint" */ /* Module declarations from "cpython.buffer" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "__builtin__" */ /* Module declarations from "cpython.type" */ /* Module declarations from "cpython" */ /* Module declarations from "cpython.object" */ /* Module declarations from "cpython.bytes" */ /* Module declarations from "borg.algorithms.checksums" */ static Py_buffer __pyx_f_4borg_10algorithms_9checksums_ro_buffer(PyObject *); /*proto*/ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "borg.algorithms.checksums" extern int __pyx_module_is_main_borg__algorithms__checksums; int __pyx_module_is_main_borg__algorithms__checksums = 0; /* Implementation of "borg.algorithms.checksums" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_TypeError; /* #### Code section: string_decls ### */ static const char __pyx_k__3[] = "."; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k__19[] = "?"; static const char __pyx_k_val[] = "val"; static const char __pyx_k_data[] = "data"; static const char __pyx_k_hash[] = "hash"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_seed[] = "seed"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_crc32[] = "crc32"; static const char __pyx_k_value[] = "value"; static const char __pyx_k_xxh64[] = "xxh64"; static const char __pyx_k_digest[] = "digest"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_seed_2[] = "_seed"; static const char __pyx_k_update[] = "update"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_helpers[] = "helpers"; static const char __pyx_k_data_buf[] = "data_buf"; static const char __pyx_k_getstate[] = "__getstate__"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_hexdigest[] = "hexdigest"; static const char __pyx_k_isenabled[] = "isenabled"; static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_bin_to_hex[] = "bin_to_hex"; static const char __pyx_k_have_clmul[] = "have_clmul"; static const char __pyx_k_crc32_clmul[] = "crc32_clmul"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_stringsource[] = ""; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_StreamingXXH64[] = "StreamingXXH64"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_crc32_slice_by_8[] = "crc32_slice_by_8"; static const char __pyx_k_XXH64_reset_failed[] = "XXH64_reset failed"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_XXH64_update_failed[] = "XXH64_update failed"; static const char __pyx_k_StreamingXXH64_digest[] = "StreamingXXH64.digest"; static const char __pyx_k_StreamingXXH64_update[] = "StreamingXXH64.update"; static const char __pyx_k_StreamingXXH64_hexdigest[] = "StreamingXXH64.hexdigest"; static const char __pyx_k_borg_algorithms_checksums[] = "borg.algorithms.checksums"; static const char __pyx_k_StreamingXXH64___reduce_cython[] = "StreamingXXH64.__reduce_cython__"; static const char __pyx_k_StreamingXXH64___setstate_cython[] = "StreamingXXH64.__setstate_cython__"; static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; static const char __pyx_k_src_borg_algorithms_checksums_py[] = "src/borg/algorithms/checksums.pyx"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_4borg_10algorithms_9checksums_crc32_slice_by_8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_4borg_10algorithms_9checksums_2crc32_clmul(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_4borg_10algorithms_9checksums_4xxh64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_seed); /* proto */ static int __pyx_pf_4borg_10algorithms_9checksums_14StreamingXXH64___cinit__(struct __pyx_obj_4borg_10algorithms_9checksums_StreamingXXH64 *__pyx_v_self, PyObject *__pyx_v_seed); /* proto */ static void __pyx_pf_4borg_10algorithms_9checksums_14StreamingXXH64_2__dealloc__(struct __pyx_obj_4borg_10algorithms_9checksums_StreamingXXH64 *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_10algorithms_9checksums_14StreamingXXH64_4update(struct __pyx_obj_4borg_10algorithms_9checksums_StreamingXXH64 *__pyx_v_self, PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_4borg_10algorithms_9checksums_14StreamingXXH64_6digest(struct __pyx_obj_4borg_10algorithms_9checksums_StreamingXXH64 *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_10algorithms_9checksums_14StreamingXXH64_8hexdigest(struct __pyx_obj_4borg_10algorithms_9checksums_StreamingXXH64 *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_10algorithms_9checksums_14StreamingXXH64_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_10algorithms_9checksums_StreamingXXH64 *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_10algorithms_9checksums_14StreamingXXH64_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_10algorithms_9checksums_StreamingXXH64 *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_tp_new_4borg_10algorithms_9checksums_StreamingXXH64(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_7cpython_4type_type; #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE PyObject *__pyx_type_4borg_10algorithms_9checksums_StreamingXXH64; #endif PyTypeObject *__pyx_ptype_4borg_10algorithms_9checksums_StreamingXXH64; PyObject *__pyx_n_s_StreamingXXH64; PyObject *__pyx_n_s_StreamingXXH64___reduce_cython; PyObject *__pyx_n_s_StreamingXXH64___setstate_cython; PyObject *__pyx_n_s_StreamingXXH64_digest; PyObject *__pyx_n_s_StreamingXXH64_hexdigest; PyObject *__pyx_n_s_StreamingXXH64_update; PyObject *__pyx_n_s_TypeError; PyObject *__pyx_kp_s_XXH64_reset_failed; PyObject *__pyx_kp_s_XXH64_update_failed; PyObject *__pyx_n_s__19; PyObject *__pyx_kp_u__3; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_bin_to_hex; PyObject *__pyx_n_s_borg_algorithms_checksums; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_crc32; PyObject *__pyx_n_s_crc32_clmul; PyObject *__pyx_n_s_crc32_slice_by_8; PyObject *__pyx_n_s_data; PyObject *__pyx_n_s_data_buf; PyObject *__pyx_n_s_digest; PyObject *__pyx_kp_u_disable; PyObject *__pyx_kp_u_enable; PyObject *__pyx_kp_u_gc; PyObject *__pyx_n_s_getstate; PyObject *__pyx_n_s_hash; PyObject *__pyx_n_s_have_clmul; PyObject *__pyx_n_s_helpers; PyObject *__pyx_n_s_hexdigest; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_kp_u_isenabled; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_name; PyObject *__pyx_kp_s_no_default___reduce___due_to_non; PyObject *__pyx_n_s_pyx_state; PyObject *__pyx_n_s_reduce; PyObject *__pyx_n_s_reduce_cython; PyObject *__pyx_n_s_reduce_ex; PyObject *__pyx_n_s_seed; PyObject *__pyx_n_s_seed_2; PyObject *__pyx_n_s_self; PyObject *__pyx_n_s_setstate; PyObject *__pyx_n_s_setstate_cython; PyObject *__pyx_kp_s_src_borg_algorithms_checksums_py; PyObject *__pyx_kp_s_stringsource; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_update; PyObject *__pyx_n_s_val; PyObject *__pyx_n_s_value; PyObject *__pyx_n_s_xxh64; PyObject *__pyx_int_0; PyObject *__pyx_tuple_; PyObject *__pyx_tuple__2; PyObject *__pyx_tuple__4; PyObject *__pyx_tuple__6; PyObject *__pyx_tuple__8; PyObject *__pyx_tuple__10; PyObject *__pyx_tuple__12; PyObject *__pyx_tuple__14; PyObject *__pyx_tuple__17; PyObject *__pyx_codeobj__5; PyObject *__pyx_codeobj__7; PyObject *__pyx_codeobj__9; PyObject *__pyx_codeobj__11; PyObject *__pyx_codeobj__13; PyObject *__pyx_codeobj__15; PyObject *__pyx_codeobj__16; PyObject *__pyx_codeobj__18; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type); Py_CLEAR(clear_module_state->__pyx_ptype_4borg_10algorithms_9checksums_StreamingXXH64); Py_CLEAR(clear_module_state->__pyx_type_4borg_10algorithms_9checksums_StreamingXXH64); Py_CLEAR(clear_module_state->__pyx_n_s_StreamingXXH64); Py_CLEAR(clear_module_state->__pyx_n_s_StreamingXXH64___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_StreamingXXH64___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_StreamingXXH64_digest); Py_CLEAR(clear_module_state->__pyx_n_s_StreamingXXH64_hexdigest); Py_CLEAR(clear_module_state->__pyx_n_s_StreamingXXH64_update); Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); Py_CLEAR(clear_module_state->__pyx_kp_s_XXH64_reset_failed); Py_CLEAR(clear_module_state->__pyx_kp_s_XXH64_update_failed); Py_CLEAR(clear_module_state->__pyx_n_s__19); Py_CLEAR(clear_module_state->__pyx_kp_u__3); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_bin_to_hex); Py_CLEAR(clear_module_state->__pyx_n_s_borg_algorithms_checksums); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_crc32); Py_CLEAR(clear_module_state->__pyx_n_s_crc32_clmul); Py_CLEAR(clear_module_state->__pyx_n_s_crc32_slice_by_8); Py_CLEAR(clear_module_state->__pyx_n_s_data); Py_CLEAR(clear_module_state->__pyx_n_s_data_buf); Py_CLEAR(clear_module_state->__pyx_n_s_digest); Py_CLEAR(clear_module_state->__pyx_kp_u_disable); Py_CLEAR(clear_module_state->__pyx_kp_u_enable); Py_CLEAR(clear_module_state->__pyx_kp_u_gc); Py_CLEAR(clear_module_state->__pyx_n_s_getstate); Py_CLEAR(clear_module_state->__pyx_n_s_hash); Py_CLEAR(clear_module_state->__pyx_n_s_have_clmul); Py_CLEAR(clear_module_state->__pyx_n_s_helpers); Py_CLEAR(clear_module_state->__pyx_n_s_hexdigest); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state); Py_CLEAR(clear_module_state->__pyx_n_s_reduce); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex); Py_CLEAR(clear_module_state->__pyx_n_s_seed); Py_CLEAR(clear_module_state->__pyx_n_s_seed_2); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_n_s_setstate); Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython); Py_CLEAR(clear_module_state->__pyx_kp_s_src_borg_algorithms_checksums_py); Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_update); Py_CLEAR(clear_module_state->__pyx_n_s_val); Py_CLEAR(clear_module_state->__pyx_n_s_value); Py_CLEAR(clear_module_state->__pyx_n_s_xxh64); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_tuple_); Py_CLEAR(clear_module_state->__pyx_tuple__2); Py_CLEAR(clear_module_state->__pyx_tuple__4); Py_CLEAR(clear_module_state->__pyx_tuple__6); Py_CLEAR(clear_module_state->__pyx_tuple__8); Py_CLEAR(clear_module_state->__pyx_tuple__10); Py_CLEAR(clear_module_state->__pyx_tuple__12); Py_CLEAR(clear_module_state->__pyx_tuple__14); Py_CLEAR(clear_module_state->__pyx_tuple__17); Py_CLEAR(clear_module_state->__pyx_codeobj__5); Py_CLEAR(clear_module_state->__pyx_codeobj__7); Py_CLEAR(clear_module_state->__pyx_codeobj__9); Py_CLEAR(clear_module_state->__pyx_codeobj__11); Py_CLEAR(clear_module_state->__pyx_codeobj__13); Py_CLEAR(clear_module_state->__pyx_codeobj__15); Py_CLEAR(clear_module_state->__pyx_codeobj__16); Py_CLEAR(clear_module_state->__pyx_codeobj__18); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type); Py_VISIT(traverse_module_state->__pyx_ptype_4borg_10algorithms_9checksums_StreamingXXH64); Py_VISIT(traverse_module_state->__pyx_type_4borg_10algorithms_9checksums_StreamingXXH64); Py_VISIT(traverse_module_state->__pyx_n_s_StreamingXXH64); Py_VISIT(traverse_module_state->__pyx_n_s_StreamingXXH64___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_StreamingXXH64___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_StreamingXXH64_digest); Py_VISIT(traverse_module_state->__pyx_n_s_StreamingXXH64_hexdigest); Py_VISIT(traverse_module_state->__pyx_n_s_StreamingXXH64_update); Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); Py_VISIT(traverse_module_state->__pyx_kp_s_XXH64_reset_failed); Py_VISIT(traverse_module_state->__pyx_kp_s_XXH64_update_failed); Py_VISIT(traverse_module_state->__pyx_n_s__19); Py_VISIT(traverse_module_state->__pyx_kp_u__3); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_bin_to_hex); Py_VISIT(traverse_module_state->__pyx_n_s_borg_algorithms_checksums); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_crc32); Py_VISIT(traverse_module_state->__pyx_n_s_crc32_clmul); Py_VISIT(traverse_module_state->__pyx_n_s_crc32_slice_by_8); Py_VISIT(traverse_module_state->__pyx_n_s_data); Py_VISIT(traverse_module_state->__pyx_n_s_data_buf); Py_VISIT(traverse_module_state->__pyx_n_s_digest); Py_VISIT(traverse_module_state->__pyx_kp_u_disable); Py_VISIT(traverse_module_state->__pyx_kp_u_enable); Py_VISIT(traverse_module_state->__pyx_kp_u_gc); Py_VISIT(traverse_module_state->__pyx_n_s_getstate); Py_VISIT(traverse_module_state->__pyx_n_s_hash); Py_VISIT(traverse_module_state->__pyx_n_s_have_clmul); Py_VISIT(traverse_module_state->__pyx_n_s_helpers); Py_VISIT(traverse_module_state->__pyx_n_s_hexdigest); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state); Py_VISIT(traverse_module_state->__pyx_n_s_reduce); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex); Py_VISIT(traverse_module_state->__pyx_n_s_seed); Py_VISIT(traverse_module_state->__pyx_n_s_seed_2); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_n_s_setstate); Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython); Py_VISIT(traverse_module_state->__pyx_kp_s_src_borg_algorithms_checksums_py); Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_update); Py_VISIT(traverse_module_state->__pyx_n_s_val); Py_VISIT(traverse_module_state->__pyx_n_s_value); Py_VISIT(traverse_module_state->__pyx_n_s_xxh64); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_tuple_); Py_VISIT(traverse_module_state->__pyx_tuple__2); Py_VISIT(traverse_module_state->__pyx_tuple__4); Py_VISIT(traverse_module_state->__pyx_tuple__6); Py_VISIT(traverse_module_state->__pyx_tuple__8); Py_VISIT(traverse_module_state->__pyx_tuple__10); Py_VISIT(traverse_module_state->__pyx_tuple__12); Py_VISIT(traverse_module_state->__pyx_tuple__14); Py_VISIT(traverse_module_state->__pyx_tuple__17); Py_VISIT(traverse_module_state->__pyx_codeobj__5); Py_VISIT(traverse_module_state->__pyx_codeobj__7); Py_VISIT(traverse_module_state->__pyx_codeobj__9); Py_VISIT(traverse_module_state->__pyx_codeobj__11); Py_VISIT(traverse_module_state->__pyx_codeobj__13); Py_VISIT(traverse_module_state->__pyx_codeobj__15); Py_VISIT(traverse_module_state->__pyx_codeobj__16); Py_VISIT(traverse_module_state->__pyx_codeobj__18); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #define __pyx_type_4borg_10algorithms_9checksums_StreamingXXH64 __pyx_mstate_global->__pyx_type_4borg_10algorithms_9checksums_StreamingXXH64 #endif #define __pyx_ptype_4borg_10algorithms_9checksums_StreamingXXH64 __pyx_mstate_global->__pyx_ptype_4borg_10algorithms_9checksums_StreamingXXH64 #define __pyx_n_s_StreamingXXH64 __pyx_mstate_global->__pyx_n_s_StreamingXXH64 #define __pyx_n_s_StreamingXXH64___reduce_cython __pyx_mstate_global->__pyx_n_s_StreamingXXH64___reduce_cython #define __pyx_n_s_StreamingXXH64___setstate_cython __pyx_mstate_global->__pyx_n_s_StreamingXXH64___setstate_cython #define __pyx_n_s_StreamingXXH64_digest __pyx_mstate_global->__pyx_n_s_StreamingXXH64_digest #define __pyx_n_s_StreamingXXH64_hexdigest __pyx_mstate_global->__pyx_n_s_StreamingXXH64_hexdigest #define __pyx_n_s_StreamingXXH64_update __pyx_mstate_global->__pyx_n_s_StreamingXXH64_update #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError #define __pyx_kp_s_XXH64_reset_failed __pyx_mstate_global->__pyx_kp_s_XXH64_reset_failed #define __pyx_kp_s_XXH64_update_failed __pyx_mstate_global->__pyx_kp_s_XXH64_update_failed #define __pyx_n_s__19 __pyx_mstate_global->__pyx_n_s__19 #define __pyx_kp_u__3 __pyx_mstate_global->__pyx_kp_u__3 #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_bin_to_hex __pyx_mstate_global->__pyx_n_s_bin_to_hex #define __pyx_n_s_borg_algorithms_checksums __pyx_mstate_global->__pyx_n_s_borg_algorithms_checksums #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_crc32 __pyx_mstate_global->__pyx_n_s_crc32 #define __pyx_n_s_crc32_clmul __pyx_mstate_global->__pyx_n_s_crc32_clmul #define __pyx_n_s_crc32_slice_by_8 __pyx_mstate_global->__pyx_n_s_crc32_slice_by_8 #define __pyx_n_s_data __pyx_mstate_global->__pyx_n_s_data #define __pyx_n_s_data_buf __pyx_mstate_global->__pyx_n_s_data_buf #define __pyx_n_s_digest __pyx_mstate_global->__pyx_n_s_digest #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate #define __pyx_n_s_hash __pyx_mstate_global->__pyx_n_s_hash #define __pyx_n_s_have_clmul __pyx_mstate_global->__pyx_n_s_have_clmul #define __pyx_n_s_helpers __pyx_mstate_global->__pyx_n_s_helpers #define __pyx_n_s_hexdigest __pyx_mstate_global->__pyx_n_s_hexdigest #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex #define __pyx_n_s_seed __pyx_mstate_global->__pyx_n_s_seed #define __pyx_n_s_seed_2 __pyx_mstate_global->__pyx_n_s_seed_2 #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython #define __pyx_kp_s_src_borg_algorithms_checksums_py __pyx_mstate_global->__pyx_kp_s_src_borg_algorithms_checksums_py #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_update __pyx_mstate_global->__pyx_n_s_update #define __pyx_n_s_val __pyx_mstate_global->__pyx_n_s_val #define __pyx_n_s_value __pyx_mstate_global->__pyx_n_s_value #define __pyx_n_s_xxh64 __pyx_mstate_global->__pyx_n_s_xxh64 #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_ #define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 #define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 #define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6 #define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 #define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10 #define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12 #define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 #define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17 #define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 #define __pyx_codeobj__7 __pyx_mstate_global->__pyx_codeobj__7 #define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 #define __pyx_codeobj__11 __pyx_mstate_global->__pyx_codeobj__11 #define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 #define __pyx_codeobj__16 __pyx_mstate_global->__pyx_codeobj__16 #define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 /* #### Code section: module_code ### */ /* "borg/algorithms/checksums.pyx":40 * * * cdef Py_buffer ro_buffer(object data) except *: # <<<<<<<<<<<<<< * cdef Py_buffer view * PyObject_GetBuffer(data, &view, PyBUF_SIMPLE) */ static Py_buffer __pyx_f_4borg_10algorithms_9checksums_ro_buffer(PyObject *__pyx_v_data) { Py_buffer __pyx_v_view; Py_buffer __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "borg/algorithms/checksums.pyx":42 * cdef Py_buffer ro_buffer(object data) except *: * cdef Py_buffer view * PyObject_GetBuffer(data, &view, PyBUF_SIMPLE) # <<<<<<<<<<<<<< * return view * */ __pyx_t_1 = PyObject_GetBuffer(__pyx_v_data, (&__pyx_v_view), PyBUF_SIMPLE); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 42, __pyx_L1_error) /* "borg/algorithms/checksums.pyx":43 * cdef Py_buffer view * PyObject_GetBuffer(data, &view, PyBUF_SIMPLE) * return view # <<<<<<<<<<<<<< * * */ __pyx_r = __pyx_v_view; goto __pyx_L0; /* "borg/algorithms/checksums.pyx":40 * * * cdef Py_buffer ro_buffer(object data) except *: # <<<<<<<<<<<<<< * cdef Py_buffer view * PyObject_GetBuffer(data, &view, PyBUF_SIMPLE) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.algorithms.checksums.ro_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_pretend_to_initialize(&__pyx_r); __pyx_L0:; return __pyx_r; } /* "borg/algorithms/checksums.pyx":46 * * * def crc32_slice_by_8(data, value=0): # <<<<<<<<<<<<<< * cdef Py_buffer data_buf = ro_buffer(data) * cdef uint32_t val = value */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_10algorithms_9checksums_1crc32_slice_by_8(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_10algorithms_9checksums_1crc32_slice_by_8 = {"crc32_slice_by_8", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_10algorithms_9checksums_1crc32_slice_by_8, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_10algorithms_9checksums_1crc32_slice_by_8(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_data = 0; PyObject *__pyx_v_value = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("crc32_slice_by_8 (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_value,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_0))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 46, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 46, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "crc32_slice_by_8") < 0)) __PYX_ERR(1, 46, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_data = values[0]; __pyx_v_value = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("crc32_slice_by_8", 0, 1, 2, __pyx_nargs); __PYX_ERR(1, 46, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.algorithms.checksums.crc32_slice_by_8", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_10algorithms_9checksums_crc32_slice_by_8(__pyx_self, __pyx_v_data, __pyx_v_value); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_10algorithms_9checksums_crc32_slice_by_8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_value) { Py_buffer __pyx_v_data_buf; uint32_t __pyx_v_val; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_buffer __pyx_t_1; uint32_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; char const *__pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("crc32_slice_by_8", 1); /* "borg/algorithms/checksums.pyx":47 * * def crc32_slice_by_8(data, value=0): * cdef Py_buffer data_buf = ro_buffer(data) # <<<<<<<<<<<<<< * cdef uint32_t val = value * try: */ __pyx_t_1 = __pyx_f_4borg_10algorithms_9checksums_ro_buffer(__pyx_v_data); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 47, __pyx_L1_error) __pyx_v_data_buf = __pyx_t_1; /* "borg/algorithms/checksums.pyx":48 * def crc32_slice_by_8(data, value=0): * cdef Py_buffer data_buf = ro_buffer(data) * cdef uint32_t val = value # <<<<<<<<<<<<<< * try: * return _crc32_slice_by_8(data_buf.buf, data_buf.len, val) */ __pyx_t_2 = __Pyx_PyInt_As_uint32_t(__pyx_v_value); if (unlikely((__pyx_t_2 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 48, __pyx_L1_error) __pyx_v_val = __pyx_t_2; /* "borg/algorithms/checksums.pyx":49 * cdef Py_buffer data_buf = ro_buffer(data) * cdef uint32_t val = value * try: # <<<<<<<<<<<<<< * return _crc32_slice_by_8(data_buf.buf, data_buf.len, val) * finally: */ /*try:*/ { /* "borg/algorithms/checksums.pyx":50 * cdef uint32_t val = value * try: * return _crc32_slice_by_8(data_buf.buf, data_buf.len, val) # <<<<<<<<<<<<<< * finally: * PyBuffer_Release(&data_buf) */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_uint32_t(crc32_slice_by_8(__pyx_v_data_buf.buf, __pyx_v_data_buf.len, __pyx_v_val)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 50, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L3_return; } /* "borg/algorithms/checksums.pyx":52 * return _crc32_slice_by_8(data_buf.buf, data_buf.len, val) * finally: * PyBuffer_Release(&data_buf) # <<<<<<<<<<<<<< * * */ /*finally:*/ { __pyx_L4_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename; { PyBuffer_Release((&__pyx_v_data_buf)); } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); } __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9); __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6; goto __pyx_L1_error; } __pyx_L3_return: { __pyx_t_12 = __pyx_r; __pyx_r = 0; PyBuffer_Release((&__pyx_v_data_buf)); __pyx_r = __pyx_t_12; __pyx_t_12 = 0; goto __pyx_L0; } } /* "borg/algorithms/checksums.pyx":46 * * * def crc32_slice_by_8(data, value=0): # <<<<<<<<<<<<<< * cdef Py_buffer data_buf = ro_buffer(data) * cdef uint32_t val = value */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("borg.algorithms.checksums.crc32_slice_by_8", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/algorithms/checksums.pyx":55 * * * def crc32_clmul(data, value=0): # <<<<<<<<<<<<<< * cdef Py_buffer data_buf = ro_buffer(data) * cdef uint32_t val = value */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_10algorithms_9checksums_3crc32_clmul(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_10algorithms_9checksums_3crc32_clmul = {"crc32_clmul", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_10algorithms_9checksums_3crc32_clmul, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_10algorithms_9checksums_3crc32_clmul(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_data = 0; PyObject *__pyx_v_value = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("crc32_clmul (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_value,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_0))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 55, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 55, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "crc32_clmul") < 0)) __PYX_ERR(1, 55, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_data = values[0]; __pyx_v_value = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("crc32_clmul", 0, 1, 2, __pyx_nargs); __PYX_ERR(1, 55, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.algorithms.checksums.crc32_clmul", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_10algorithms_9checksums_2crc32_clmul(__pyx_self, __pyx_v_data, __pyx_v_value); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_10algorithms_9checksums_2crc32_clmul(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_value) { Py_buffer __pyx_v_data_buf; uint32_t __pyx_v_val; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_buffer __pyx_t_1; uint32_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; char const *__pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("crc32_clmul", 1); /* "borg/algorithms/checksums.pyx":56 * * def crc32_clmul(data, value=0): * cdef Py_buffer data_buf = ro_buffer(data) # <<<<<<<<<<<<<< * cdef uint32_t val = value * try: */ __pyx_t_1 = __pyx_f_4borg_10algorithms_9checksums_ro_buffer(__pyx_v_data); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 56, __pyx_L1_error) __pyx_v_data_buf = __pyx_t_1; /* "borg/algorithms/checksums.pyx":57 * def crc32_clmul(data, value=0): * cdef Py_buffer data_buf = ro_buffer(data) * cdef uint32_t val = value # <<<<<<<<<<<<<< * try: * return _crc32_clmul(data_buf.buf, data_buf.len, val) */ __pyx_t_2 = __Pyx_PyInt_As_uint32_t(__pyx_v_value); if (unlikely((__pyx_t_2 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 57, __pyx_L1_error) __pyx_v_val = __pyx_t_2; /* "borg/algorithms/checksums.pyx":58 * cdef Py_buffer data_buf = ro_buffer(data) * cdef uint32_t val = value * try: # <<<<<<<<<<<<<< * return _crc32_clmul(data_buf.buf, data_buf.len, val) * finally: */ /*try:*/ { /* "borg/algorithms/checksums.pyx":59 * cdef uint32_t val = value * try: * return _crc32_clmul(data_buf.buf, data_buf.len, val) # <<<<<<<<<<<<<< * finally: * PyBuffer_Release(&data_buf) */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_uint32_t(crc32_clmul(__pyx_v_data_buf.buf, __pyx_v_data_buf.len, __pyx_v_val)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 59, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L3_return; } /* "borg/algorithms/checksums.pyx":61 * return _crc32_clmul(data_buf.buf, data_buf.len, val) * finally: * PyBuffer_Release(&data_buf) # <<<<<<<<<<<<<< * * */ /*finally:*/ { __pyx_L4_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename; { PyBuffer_Release((&__pyx_v_data_buf)); } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); } __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9); __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6; goto __pyx_L1_error; } __pyx_L3_return: { __pyx_t_12 = __pyx_r; __pyx_r = 0; PyBuffer_Release((&__pyx_v_data_buf)); __pyx_r = __pyx_t_12; __pyx_t_12 = 0; goto __pyx_L0; } } /* "borg/algorithms/checksums.pyx":55 * * * def crc32_clmul(data, value=0): # <<<<<<<<<<<<<< * cdef Py_buffer data_buf = ro_buffer(data) * cdef uint32_t val = value */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("borg.algorithms.checksums.crc32_clmul", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/algorithms/checksums.pyx":71 * * * def xxh64(data, seed=0): # <<<<<<<<<<<<<< * cdef unsigned long long _seed = seed * cdef XXH64_hash_t hash */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_10algorithms_9checksums_5xxh64(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_10algorithms_9checksums_5xxh64 = {"xxh64", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_10algorithms_9checksums_5xxh64, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_10algorithms_9checksums_5xxh64(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_data = 0; PyObject *__pyx_v_seed = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("xxh64 (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_seed,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_0))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 71, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_seed); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 71, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "xxh64") < 0)) __PYX_ERR(1, 71, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_data = values[0]; __pyx_v_seed = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("xxh64", 0, 1, 2, __pyx_nargs); __PYX_ERR(1, 71, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.algorithms.checksums.xxh64", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_10algorithms_9checksums_4xxh64(__pyx_self, __pyx_v_data, __pyx_v_seed); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_10algorithms_9checksums_4xxh64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_seed) { unsigned PY_LONG_LONG __pyx_v__seed; XXH64_hash_t __pyx_v_hash; XXH64_canonical_t __pyx_v_digest; Py_buffer __pyx_v_data_buf; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations unsigned PY_LONG_LONG __pyx_t_1; Py_buffer __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("xxh64", 1); /* "borg/algorithms/checksums.pyx":72 * * def xxh64(data, seed=0): * cdef unsigned long long _seed = seed # <<<<<<<<<<<<<< * cdef XXH64_hash_t hash * cdef XXH64_canonical_t digest */ __pyx_t_1 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_v_seed); if (unlikely((__pyx_t_1 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 72, __pyx_L1_error) __pyx_v__seed = __pyx_t_1; /* "borg/algorithms/checksums.pyx":75 * cdef XXH64_hash_t hash * cdef XXH64_canonical_t digest * cdef Py_buffer data_buf = ro_buffer(data) # <<<<<<<<<<<<<< * try: * hash = XXH64(data_buf.buf, data_buf.len, _seed) */ __pyx_t_2 = __pyx_f_4borg_10algorithms_9checksums_ro_buffer(__pyx_v_data); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 75, __pyx_L1_error) __pyx_v_data_buf = __pyx_t_2; /* "borg/algorithms/checksums.pyx":76 * cdef XXH64_canonical_t digest * cdef Py_buffer data_buf = ro_buffer(data) * try: # <<<<<<<<<<<<<< * hash = XXH64(data_buf.buf, data_buf.len, _seed) * finally: */ /*try:*/ { /* "borg/algorithms/checksums.pyx":77 * cdef Py_buffer data_buf = ro_buffer(data) * try: * hash = XXH64(data_buf.buf, data_buf.len, _seed) # <<<<<<<<<<<<<< * finally: * PyBuffer_Release(&data_buf) */ __pyx_v_hash = XXH64(__pyx_v_data_buf.buf, __pyx_v_data_buf.len, __pyx_v__seed); } /* "borg/algorithms/checksums.pyx":79 * hash = XXH64(data_buf.buf, data_buf.len, _seed) * finally: * PyBuffer_Release(&data_buf) # <<<<<<<<<<<<<< * XXH64_canonicalFromHash(&digest, hash) * return PyBytes_FromStringAndSize( digest.digest, 8) */ /*finally:*/ { /*normal exit:*/{ PyBuffer_Release((&__pyx_v_data_buf)); goto __pyx_L5; } __pyx_L5:; } /* "borg/algorithms/checksums.pyx":80 * finally: * PyBuffer_Release(&data_buf) * XXH64_canonicalFromHash(&digest, hash) # <<<<<<<<<<<<<< * return PyBytes_FromStringAndSize( digest.digest, 8) * */ XXH64_canonicalFromHash((&__pyx_v_digest), __pyx_v_hash); /* "borg/algorithms/checksums.pyx":81 * PyBuffer_Release(&data_buf) * XXH64_canonicalFromHash(&digest, hash) * return PyBytes_FromStringAndSize( digest.digest, 8) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyBytes_FromStringAndSize(((char const *)__pyx_v_digest.digest), 8); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "borg/algorithms/checksums.pyx":71 * * * def xxh64(data, seed=0): # <<<<<<<<<<<<<< * cdef unsigned long long _seed = seed * cdef XXH64_hash_t hash */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("borg.algorithms.checksums.xxh64", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/algorithms/checksums.pyx":87 * cdef XXH64_state_t* state * * def __cinit__(self, seed=0): # <<<<<<<<<<<<<< * self.state = XXH64_createState() * cdef unsigned long long _seed = seed */ /* Python wrapper */ static int __pyx_pw_4borg_10algorithms_9checksums_14StreamingXXH64_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_4borg_10algorithms_9checksums_14StreamingXXH64_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_seed = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_seed,0}; values[0] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_int_0)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_seed); if (value) { values[0] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 87, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(1, 87, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_seed = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 1, __pyx_nargs); __PYX_ERR(1, 87, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.algorithms.checksums.StreamingXXH64.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_10algorithms_9checksums_14StreamingXXH64___cinit__(((struct __pyx_obj_4borg_10algorithms_9checksums_StreamingXXH64 *)__pyx_v_self), __pyx_v_seed); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_4borg_10algorithms_9checksums_14StreamingXXH64___cinit__(struct __pyx_obj_4borg_10algorithms_9checksums_StreamingXXH64 *__pyx_v_self, PyObject *__pyx_v_seed) { unsigned PY_LONG_LONG __pyx_v__seed; int __pyx_r; __Pyx_RefNannyDeclarations unsigned PY_LONG_LONG __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 1); /* "borg/algorithms/checksums.pyx":88 * * def __cinit__(self, seed=0): * self.state = XXH64_createState() # <<<<<<<<<<<<<< * cdef unsigned long long _seed = seed * if XXH64_reset(self.state, _seed) != XXH_OK: */ __pyx_v_self->state = XXH64_createState(); /* "borg/algorithms/checksums.pyx":89 * def __cinit__(self, seed=0): * self.state = XXH64_createState() * cdef unsigned long long _seed = seed # <<<<<<<<<<<<<< * if XXH64_reset(self.state, _seed) != XXH_OK: * raise Exception('XXH64_reset failed') */ __pyx_t_1 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_v_seed); if (unlikely((__pyx_t_1 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 89, __pyx_L1_error) __pyx_v__seed = __pyx_t_1; /* "borg/algorithms/checksums.pyx":90 * self.state = XXH64_createState() * cdef unsigned long long _seed = seed * if XXH64_reset(self.state, _seed) != XXH_OK: # <<<<<<<<<<<<<< * raise Exception('XXH64_reset failed') * */ __pyx_t_2 = (XXH64_reset(__pyx_v_self->state, __pyx_v__seed) != XXH_OK); if (unlikely(__pyx_t_2)) { /* "borg/algorithms/checksums.pyx":91 * cdef unsigned long long _seed = seed * if XXH64_reset(self.state, _seed) != XXH_OK: * raise Exception('XXH64_reset failed') # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 91, __pyx_L1_error) /* "borg/algorithms/checksums.pyx":90 * self.state = XXH64_createState() * cdef unsigned long long _seed = seed * if XXH64_reset(self.state, _seed) != XXH_OK: # <<<<<<<<<<<<<< * raise Exception('XXH64_reset failed') * */ } /* "borg/algorithms/checksums.pyx":87 * cdef XXH64_state_t* state * * def __cinit__(self, seed=0): # <<<<<<<<<<<<<< * self.state = XXH64_createState() * cdef unsigned long long _seed = seed */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("borg.algorithms.checksums.StreamingXXH64.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/algorithms/checksums.pyx":93 * raise Exception('XXH64_reset failed') * * def __dealloc__(self): # <<<<<<<<<<<<<< * XXH64_freeState(self.state) * */ /* Python wrapper */ static void __pyx_pw_4borg_10algorithms_9checksums_14StreamingXXH64_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_4borg_10algorithms_9checksums_14StreamingXXH64_3__dealloc__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_4borg_10algorithms_9checksums_14StreamingXXH64_2__dealloc__(((struct __pyx_obj_4borg_10algorithms_9checksums_StreamingXXH64 *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_4borg_10algorithms_9checksums_14StreamingXXH64_2__dealloc__(struct __pyx_obj_4borg_10algorithms_9checksums_StreamingXXH64 *__pyx_v_self) { /* "borg/algorithms/checksums.pyx":94 * * def __dealloc__(self): * XXH64_freeState(self.state) # <<<<<<<<<<<<<< * * def update(self, data): */ (void)(XXH64_freeState(__pyx_v_self->state)); /* "borg/algorithms/checksums.pyx":93 * raise Exception('XXH64_reset failed') * * def __dealloc__(self): # <<<<<<<<<<<<<< * XXH64_freeState(self.state) * */ /* function exit code */ } /* "borg/algorithms/checksums.pyx":96 * XXH64_freeState(self.state) * * def update(self, data): # <<<<<<<<<<<<<< * cdef Py_buffer data_buf = ro_buffer(data) * try: */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_10algorithms_9checksums_14StreamingXXH64_5update(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_10algorithms_9checksums_14StreamingXXH64_5update = {"update", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_10algorithms_9checksums_14StreamingXXH64_5update, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_10algorithms_9checksums_14StreamingXXH64_5update(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_data = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("update (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 96, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "update") < 0)) __PYX_ERR(1, 96, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_data = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("update", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 96, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.algorithms.checksums.StreamingXXH64.update", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_10algorithms_9checksums_14StreamingXXH64_4update(((struct __pyx_obj_4borg_10algorithms_9checksums_StreamingXXH64 *)__pyx_v_self), __pyx_v_data); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_10algorithms_9checksums_14StreamingXXH64_4update(struct __pyx_obj_4borg_10algorithms_9checksums_StreamingXXH64 *__pyx_v_self, PyObject *__pyx_v_data) { Py_buffer __pyx_v_data_buf; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_buffer __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; char const *__pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("update", 1); /* "borg/algorithms/checksums.pyx":97 * * def update(self, data): * cdef Py_buffer data_buf = ro_buffer(data) # <<<<<<<<<<<<<< * try: * if XXH64_update(self.state, data_buf.buf, data_buf.len) != XXH_OK: */ __pyx_t_1 = __pyx_f_4borg_10algorithms_9checksums_ro_buffer(__pyx_v_data); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 97, __pyx_L1_error) __pyx_v_data_buf = __pyx_t_1; /* "borg/algorithms/checksums.pyx":98 * def update(self, data): * cdef Py_buffer data_buf = ro_buffer(data) * try: # <<<<<<<<<<<<<< * if XXH64_update(self.state, data_buf.buf, data_buf.len) != XXH_OK: * raise Exception('XXH64_update failed') */ /*try:*/ { /* "borg/algorithms/checksums.pyx":99 * cdef Py_buffer data_buf = ro_buffer(data) * try: * if XXH64_update(self.state, data_buf.buf, data_buf.len) != XXH_OK: # <<<<<<<<<<<<<< * raise Exception('XXH64_update failed') * finally: */ __pyx_t_2 = (XXH64_update(__pyx_v_self->state, __pyx_v_data_buf.buf, __pyx_v_data_buf.len) != XXH_OK); if (unlikely(__pyx_t_2)) { /* "borg/algorithms/checksums.pyx":100 * try: * if XXH64_update(self.state, data_buf.buf, data_buf.len) != XXH_OK: * raise Exception('XXH64_update failed') # <<<<<<<<<<<<<< * finally: * PyBuffer_Release(&data_buf) */ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 100, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 100, __pyx_L4_error) /* "borg/algorithms/checksums.pyx":99 * cdef Py_buffer data_buf = ro_buffer(data) * try: * if XXH64_update(self.state, data_buf.buf, data_buf.len) != XXH_OK: # <<<<<<<<<<<<<< * raise Exception('XXH64_update failed') * finally: */ } } /* "borg/algorithms/checksums.pyx":102 * raise Exception('XXH64_update failed') * finally: * PyBuffer_Release(&data_buf) # <<<<<<<<<<<<<< * * def digest(self): */ /*finally:*/ { /*normal exit:*/{ PyBuffer_Release((&__pyx_v_data_buf)); goto __pyx_L5; } __pyx_L4_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename; { PyBuffer_Release((&__pyx_v_data_buf)); } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); } __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9); __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6; goto __pyx_L1_error; } __pyx_L5:; } /* "borg/algorithms/checksums.pyx":96 * XXH64_freeState(self.state) * * def update(self, data): # <<<<<<<<<<<<<< * cdef Py_buffer data_buf = ro_buffer(data) * try: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("borg.algorithms.checksums.StreamingXXH64.update", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/algorithms/checksums.pyx":104 * PyBuffer_Release(&data_buf) * * def digest(self): # <<<<<<<<<<<<<< * cdef XXH64_hash_t hash * cdef XXH64_canonical_t digest */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_10algorithms_9checksums_14StreamingXXH64_7digest(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_10algorithms_9checksums_14StreamingXXH64_7digest = {"digest", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_10algorithms_9checksums_14StreamingXXH64_7digest, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_10algorithms_9checksums_14StreamingXXH64_7digest(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("digest (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("digest", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "digest", 0))) return NULL; __pyx_r = __pyx_pf_4borg_10algorithms_9checksums_14StreamingXXH64_6digest(((struct __pyx_obj_4borg_10algorithms_9checksums_StreamingXXH64 *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_10algorithms_9checksums_14StreamingXXH64_6digest(struct __pyx_obj_4borg_10algorithms_9checksums_StreamingXXH64 *__pyx_v_self) { XXH64_hash_t __pyx_v_hash; XXH64_canonical_t __pyx_v_digest; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("digest", 1); /* "borg/algorithms/checksums.pyx":107 * cdef XXH64_hash_t hash * cdef XXH64_canonical_t digest * hash = XXH64_digest(self.state) # <<<<<<<<<<<<<< * XXH64_canonicalFromHash(&digest, hash) * return PyBytes_FromStringAndSize( digest.digest, 8) */ __pyx_v_hash = XXH64_digest(__pyx_v_self->state); /* "borg/algorithms/checksums.pyx":108 * cdef XXH64_canonical_t digest * hash = XXH64_digest(self.state) * XXH64_canonicalFromHash(&digest, hash) # <<<<<<<<<<<<<< * return PyBytes_FromStringAndSize( digest.digest, 8) * */ XXH64_canonicalFromHash((&__pyx_v_digest), __pyx_v_hash); /* "borg/algorithms/checksums.pyx":109 * hash = XXH64_digest(self.state) * XXH64_canonicalFromHash(&digest, hash) * return PyBytes_FromStringAndSize( digest.digest, 8) # <<<<<<<<<<<<<< * * def hexdigest(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyBytes_FromStringAndSize(((char const *)__pyx_v_digest.digest), 8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/algorithms/checksums.pyx":104 * PyBuffer_Release(&data_buf) * * def digest(self): # <<<<<<<<<<<<<< * cdef XXH64_hash_t hash * cdef XXH64_canonical_t digest */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("borg.algorithms.checksums.StreamingXXH64.digest", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/algorithms/checksums.pyx":111 * return PyBytes_FromStringAndSize( digest.digest, 8) * * def hexdigest(self): # <<<<<<<<<<<<<< * return bin_to_hex(self.digest()) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_10algorithms_9checksums_14StreamingXXH64_9hexdigest(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_10algorithms_9checksums_14StreamingXXH64_9hexdigest = {"hexdigest", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_10algorithms_9checksums_14StreamingXXH64_9hexdigest, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_10algorithms_9checksums_14StreamingXXH64_9hexdigest(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("hexdigest (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("hexdigest", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "hexdigest", 0))) return NULL; __pyx_r = __pyx_pf_4borg_10algorithms_9checksums_14StreamingXXH64_8hexdigest(((struct __pyx_obj_4borg_10algorithms_9checksums_StreamingXXH64 *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_10algorithms_9checksums_14StreamingXXH64_8hexdigest(struct __pyx_obj_4borg_10algorithms_9checksums_StreamingXXH64 *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("hexdigest", 1); /* "borg/algorithms/checksums.pyx":112 * * def hexdigest(self): * return bin_to_hex(self.digest()) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_bin_to_hex); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_digest); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/algorithms/checksums.pyx":111 * return PyBytes_FromStringAndSize( digest.digest, 8) * * def hexdigest(self): # <<<<<<<<<<<<<< * return bin_to_hex(self.digest()) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("borg.algorithms.checksums.StreamingXXH64.hexdigest", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_10algorithms_9checksums_14StreamingXXH64_11__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_10algorithms_9checksums_14StreamingXXH64_11__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_10algorithms_9checksums_14StreamingXXH64_11__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_10algorithms_9checksums_14StreamingXXH64_11__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_4borg_10algorithms_9checksums_14StreamingXXH64_10__reduce_cython__(((struct __pyx_obj_4borg_10algorithms_9checksums_StreamingXXH64 *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_10algorithms_9checksums_14StreamingXXH64_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_10algorithms_9checksums_StreamingXXH64 *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(0, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.algorithms.checksums.StreamingXXH64.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_10algorithms_9checksums_14StreamingXXH64_13__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_10algorithms_9checksums_14StreamingXXH64_13__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_10algorithms_9checksums_14StreamingXXH64_13__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_10algorithms_9checksums_14StreamingXXH64_13__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(0, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.algorithms.checksums.StreamingXXH64.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_10algorithms_9checksums_14StreamingXXH64_12__setstate_cython__(((struct __pyx_obj_4borg_10algorithms_9checksums_StreamingXXH64 *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_10algorithms_9checksums_14StreamingXXH64_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_10algorithms_9checksums_StreamingXXH64 *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(0, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.algorithms.checksums.StreamingXXH64.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_4borg_10algorithms_9checksums_StreamingXXH64(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif if (unlikely(__pyx_pw_4borg_10algorithms_9checksums_14StreamingXXH64_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_4borg_10algorithms_9checksums_StreamingXXH64(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4borg_10algorithms_9checksums_StreamingXXH64) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_4borg_10algorithms_9checksums_14StreamingXXH64_3__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static PyMethodDef __pyx_methods_4borg_10algorithms_9checksums_StreamingXXH64[] = { {"update", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_10algorithms_9checksums_14StreamingXXH64_5update, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"digest", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_10algorithms_9checksums_14StreamingXXH64_7digest, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"hexdigest", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_10algorithms_9checksums_14StreamingXXH64_9hexdigest, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_10algorithms_9checksums_14StreamingXXH64_11__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_10algorithms_9checksums_14StreamingXXH64_13__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_4borg_10algorithms_9checksums_StreamingXXH64_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4borg_10algorithms_9checksums_StreamingXXH64}, {Py_tp_methods, (void *)__pyx_methods_4borg_10algorithms_9checksums_StreamingXXH64}, {Py_tp_new, (void *)__pyx_tp_new_4borg_10algorithms_9checksums_StreamingXXH64}, {0, 0}, }; static PyType_Spec __pyx_type_4borg_10algorithms_9checksums_StreamingXXH64_spec = { "borg.algorithms.checksums.StreamingXXH64", sizeof(struct __pyx_obj_4borg_10algorithms_9checksums_StreamingXXH64), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_4borg_10algorithms_9checksums_StreamingXXH64_slots, }; #else static PyTypeObject __pyx_type_4borg_10algorithms_9checksums_StreamingXXH64 = { PyVarObject_HEAD_INIT(0, 0) "borg.algorithms.checksums.""StreamingXXH64", /*tp_name*/ sizeof(struct __pyx_obj_4borg_10algorithms_9checksums_StreamingXXH64), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4borg_10algorithms_9checksums_StreamingXXH64, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_4borg_10algorithms_9checksums_StreamingXXH64, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4borg_10algorithms_9checksums_StreamingXXH64, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_StreamingXXH64, __pyx_k_StreamingXXH64, sizeof(__pyx_k_StreamingXXH64), 0, 0, 1, 1}, {&__pyx_n_s_StreamingXXH64___reduce_cython, __pyx_k_StreamingXXH64___reduce_cython, sizeof(__pyx_k_StreamingXXH64___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_StreamingXXH64___setstate_cython, __pyx_k_StreamingXXH64___setstate_cython, sizeof(__pyx_k_StreamingXXH64___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_StreamingXXH64_digest, __pyx_k_StreamingXXH64_digest, sizeof(__pyx_k_StreamingXXH64_digest), 0, 0, 1, 1}, {&__pyx_n_s_StreamingXXH64_hexdigest, __pyx_k_StreamingXXH64_hexdigest, sizeof(__pyx_k_StreamingXXH64_hexdigest), 0, 0, 1, 1}, {&__pyx_n_s_StreamingXXH64_update, __pyx_k_StreamingXXH64_update, sizeof(__pyx_k_StreamingXXH64_update), 0, 0, 1, 1}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_kp_s_XXH64_reset_failed, __pyx_k_XXH64_reset_failed, sizeof(__pyx_k_XXH64_reset_failed), 0, 0, 1, 0}, {&__pyx_kp_s_XXH64_update_failed, __pyx_k_XXH64_update_failed, sizeof(__pyx_k_XXH64_update_failed), 0, 0, 1, 0}, {&__pyx_n_s__19, __pyx_k__19, sizeof(__pyx_k__19), 0, 0, 1, 1}, {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_bin_to_hex, __pyx_k_bin_to_hex, sizeof(__pyx_k_bin_to_hex), 0, 0, 1, 1}, {&__pyx_n_s_borg_algorithms_checksums, __pyx_k_borg_algorithms_checksums, sizeof(__pyx_k_borg_algorithms_checksums), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_crc32, __pyx_k_crc32, sizeof(__pyx_k_crc32), 0, 0, 1, 1}, {&__pyx_n_s_crc32_clmul, __pyx_k_crc32_clmul, sizeof(__pyx_k_crc32_clmul), 0, 0, 1, 1}, {&__pyx_n_s_crc32_slice_by_8, __pyx_k_crc32_slice_by_8, sizeof(__pyx_k_crc32_slice_by_8), 0, 0, 1, 1}, {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, {&__pyx_n_s_data_buf, __pyx_k_data_buf, sizeof(__pyx_k_data_buf), 0, 0, 1, 1}, {&__pyx_n_s_digest, __pyx_k_digest, sizeof(__pyx_k_digest), 0, 0, 1, 1}, {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_n_s_hash, __pyx_k_hash, sizeof(__pyx_k_hash), 0, 0, 1, 1}, {&__pyx_n_s_have_clmul, __pyx_k_have_clmul, sizeof(__pyx_k_have_clmul), 0, 0, 1, 1}, {&__pyx_n_s_helpers, __pyx_k_helpers, sizeof(__pyx_k_helpers), 0, 0, 1, 1}, {&__pyx_n_s_hexdigest, __pyx_k_hexdigest, sizeof(__pyx_k_hexdigest), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, {&__pyx_n_s_seed, __pyx_k_seed, sizeof(__pyx_k_seed), 0, 0, 1, 1}, {&__pyx_n_s_seed_2, __pyx_k_seed_2, sizeof(__pyx_k_seed_2), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, {&__pyx_kp_s_src_borg_algorithms_checksums_py, __pyx_k_src_borg_algorithms_checksums_py, sizeof(__pyx_k_src_borg_algorithms_checksums_py), 0, 0, 1, 0}, {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1}, {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, {&__pyx_n_s_xxh64, __pyx_k_xxh64, sizeof(__pyx_k_xxh64), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 2, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "borg/algorithms/checksums.pyx":91 * cdef unsigned long long _seed = seed * if XXH64_reset(self.state, _seed) != XXH_OK: * raise Exception('XXH64_reset failed') # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_XXH64_reset_failed); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "borg/algorithms/checksums.pyx":100 * try: * if XXH64_update(self.state, data_buf.buf, data_buf.len) != XXH_OK: * raise Exception('XXH64_update failed') # <<<<<<<<<<<<<< * finally: * PyBuffer_Release(&data_buf) */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_XXH64_update_failed); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "borg/algorithms/checksums.pyx":46 * * * def crc32_slice_by_8(data, value=0): # <<<<<<<<<<<<<< * cdef Py_buffer data_buf = ro_buffer(data) * cdef uint32_t val = value */ __pyx_tuple__4 = PyTuple_Pack(4, __pyx_n_s_data, __pyx_n_s_value, __pyx_n_s_data_buf, __pyx_n_s_val); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_algorithms_checksums_py, __pyx_n_s_crc32_slice_by_8, 46, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(1, 46, __pyx_L1_error) __pyx_tuple__6 = PyTuple_Pack(1, ((PyObject *)__pyx_int_0)); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); /* "borg/algorithms/checksums.pyx":55 * * * def crc32_clmul(data, value=0): # <<<<<<<<<<<<<< * cdef Py_buffer data_buf = ro_buffer(data) * cdef uint32_t val = value */ __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_algorithms_checksums_py, __pyx_n_s_crc32_clmul, 55, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(1, 55, __pyx_L1_error) /* "borg/algorithms/checksums.pyx":71 * * * def xxh64(data, seed=0): # <<<<<<<<<<<<<< * cdef unsigned long long _seed = seed * cdef XXH64_hash_t hash */ __pyx_tuple__8 = PyTuple_Pack(6, __pyx_n_s_data, __pyx_n_s_seed, __pyx_n_s_seed_2, __pyx_n_s_hash, __pyx_n_s_digest, __pyx_n_s_data_buf); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_algorithms_checksums_py, __pyx_n_s_xxh64, 71, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(1, 71, __pyx_L1_error) /* "borg/algorithms/checksums.pyx":96 * XXH64_freeState(self.state) * * def update(self, data): # <<<<<<<<<<<<<< * cdef Py_buffer data_buf = ro_buffer(data) * try: */ __pyx_tuple__10 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_data, __pyx_n_s_data_buf); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_algorithms_checksums_py, __pyx_n_s_update, 96, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(1, 96, __pyx_L1_error) /* "borg/algorithms/checksums.pyx":104 * PyBuffer_Release(&data_buf) * * def digest(self): # <<<<<<<<<<<<<< * cdef XXH64_hash_t hash * cdef XXH64_canonical_t digest */ __pyx_tuple__12 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_hash, __pyx_n_s_digest); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_algorithms_checksums_py, __pyx_n_s_digest, 104, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(1, 104, __pyx_L1_error) /* "borg/algorithms/checksums.pyx":111 * return PyBytes_FromStringAndSize( digest.digest, 8) * * def hexdigest(self): # <<<<<<<<<<<<<< * return bin_to_hex(self.digest()) */ __pyx_tuple__14 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_algorithms_checksums_py, __pyx_n_s_hexdigest, 111, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(1, 111, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_tuple__17 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(1, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(1, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS __pyx_ptype_4borg_10algorithms_9checksums_StreamingXXH64 = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4borg_10algorithms_9checksums_StreamingXXH64_spec, NULL); if (unlikely(!__pyx_ptype_4borg_10algorithms_9checksums_StreamingXXH64)) __PYX_ERR(1, 84, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4borg_10algorithms_9checksums_StreamingXXH64_spec, __pyx_ptype_4borg_10algorithms_9checksums_StreamingXXH64) < 0) __PYX_ERR(1, 84, __pyx_L1_error) #else __pyx_ptype_4borg_10algorithms_9checksums_StreamingXXH64 = &__pyx_type_4borg_10algorithms_9checksums_StreamingXXH64; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_4borg_10algorithms_9checksums_StreamingXXH64) < 0) __PYX_ERR(1, 84, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_4borg_10algorithms_9checksums_StreamingXXH64->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4borg_10algorithms_9checksums_StreamingXXH64->tp_dictoffset && __pyx_ptype_4borg_10algorithms_9checksums_StreamingXXH64->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_4borg_10algorithms_9checksums_StreamingXXH64->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_StreamingXXH64, (PyObject *) __pyx_ptype_4borg_10algorithms_9checksums_StreamingXXH64) < 0) __PYX_ERR(1, 84, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_4borg_10algorithms_9checksums_StreamingXXH64) < 0) __PYX_ERR(1, 84, __pyx_L1_error) #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_10(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_10(PyTypeObject), #elif CYTHON_COMPILING_IN_LIMITED_API sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_10(PyTypeObject), #else sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_10(PyHeapTypeObject), #endif __Pyx_ImportType_CheckSize_Warn_3_0_10); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_checksums(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_checksums}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "checksums", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initchecksums(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initchecksums(void) #else __Pyx_PyMODINIT_FUNC PyInit_checksums(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_checksums(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_checksums(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'checksums' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("checksums", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "checksums" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(1, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_checksums(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_borg__algorithms__checksums) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "borg.algorithms.checksums")) { if (unlikely((PyDict_SetItemString(modules, "borg.algorithms.checksums", __pyx_m) < 0))) __PYX_ERR(1, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(1, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(1, 1, __pyx_L1_error) (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif /* "borg/algorithms/checksums.pyx":1 * from ..helpers import bin_to_hex # <<<<<<<<<<<<<< * * from libc.stdint cimport uint32_t */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_bin_to_hex); __Pyx_GIVEREF(__pyx_n_s_bin_to_hex); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_bin_to_hex)) __PYX_ERR(1, 1, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_helpers, __pyx_t_2, 2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_bin_to_hex); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_bin_to_hex, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/algorithms/checksums.pyx":46 * * * def crc32_slice_by_8(data, value=0): # <<<<<<<<<<<<<< * cdef Py_buffer data_buf = ro_buffer(data) * cdef uint32_t val = value */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_10algorithms_9checksums_1crc32_slice_by_8, 0, __pyx_n_s_crc32_slice_by_8, NULL, __pyx_n_s_borg_algorithms_checksums, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__6); if (PyDict_SetItem(__pyx_d, __pyx_n_s_crc32_slice_by_8, __pyx_t_3) < 0) __PYX_ERR(1, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/algorithms/checksums.pyx":55 * * * def crc32_clmul(data, value=0): # <<<<<<<<<<<<<< * cdef Py_buffer data_buf = ro_buffer(data) * cdef uint32_t val = value */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_10algorithms_9checksums_3crc32_clmul, 0, __pyx_n_s_crc32_clmul, NULL, __pyx_n_s_borg_algorithms_checksums, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__6); if (PyDict_SetItem(__pyx_d, __pyx_n_s_crc32_clmul, __pyx_t_3) < 0) __PYX_ERR(1, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/algorithms/checksums.pyx":64 * * * have_clmul = _have_clmul() # <<<<<<<<<<<<<< * if have_clmul: * crc32 = crc32_clmul */ __pyx_t_3 = __Pyx_PyInt_From_int(have_clmul()); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_have_clmul, __pyx_t_3) < 0) __PYX_ERR(1, 64, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/algorithms/checksums.pyx":65 * * have_clmul = _have_clmul() * if have_clmul: # <<<<<<<<<<<<<< * crc32 = crc32_clmul * else: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_have_clmul); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { /* "borg/algorithms/checksums.pyx":66 * have_clmul = _have_clmul() * if have_clmul: * crc32 = crc32_clmul # <<<<<<<<<<<<<< * else: * crc32 = crc32_slice_by_8 */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_crc32_clmul); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_crc32, __pyx_t_3) < 0) __PYX_ERR(1, 66, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/algorithms/checksums.pyx":65 * * have_clmul = _have_clmul() * if have_clmul: # <<<<<<<<<<<<<< * crc32 = crc32_clmul * else: */ goto __pyx_L2; } /* "borg/algorithms/checksums.pyx":68 * crc32 = crc32_clmul * else: * crc32 = crc32_slice_by_8 # <<<<<<<<<<<<<< * * */ /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_crc32_slice_by_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_crc32, __pyx_t_3) < 0) __PYX_ERR(1, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L2:; /* "borg/algorithms/checksums.pyx":71 * * * def xxh64(data, seed=0): # <<<<<<<<<<<<<< * cdef unsigned long long _seed = seed * cdef XXH64_hash_t hash */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_10algorithms_9checksums_5xxh64, 0, __pyx_n_s_xxh64, NULL, __pyx_n_s_borg_algorithms_checksums, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__6); if (PyDict_SetItem(__pyx_d, __pyx_n_s_xxh64, __pyx_t_3) < 0) __PYX_ERR(1, 71, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/algorithms/checksums.pyx":96 * XXH64_freeState(self.state) * * def update(self, data): # <<<<<<<<<<<<<< * cdef Py_buffer data_buf = ro_buffer(data) * try: */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_10algorithms_9checksums_14StreamingXXH64_5update, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_StreamingXXH64_update, NULL, __pyx_n_s_borg_algorithms_checksums, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_10algorithms_9checksums_StreamingXXH64, __pyx_n_s_update, __pyx_t_3) < 0) __PYX_ERR(1, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_4borg_10algorithms_9checksums_StreamingXXH64); /* "borg/algorithms/checksums.pyx":104 * PyBuffer_Release(&data_buf) * * def digest(self): # <<<<<<<<<<<<<< * cdef XXH64_hash_t hash * cdef XXH64_canonical_t digest */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_10algorithms_9checksums_14StreamingXXH64_7digest, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_StreamingXXH64_digest, NULL, __pyx_n_s_borg_algorithms_checksums, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_10algorithms_9checksums_StreamingXXH64, __pyx_n_s_digest, __pyx_t_3) < 0) __PYX_ERR(1, 104, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_4borg_10algorithms_9checksums_StreamingXXH64); /* "borg/algorithms/checksums.pyx":111 * return PyBytes_FromStringAndSize( digest.digest, 8) * * def hexdigest(self): # <<<<<<<<<<<<<< * return bin_to_hex(self.digest()) */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_10algorithms_9checksums_14StreamingXXH64_9hexdigest, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_StreamingXXH64_hexdigest, NULL, __pyx_n_s_borg_algorithms_checksums, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_10algorithms_9checksums_StreamingXXH64, __pyx_n_s_hexdigest, __pyx_t_3) < 0) __PYX_ERR(1, 111, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_4borg_10algorithms_9checksums_StreamingXXH64); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_10algorithms_9checksums_14StreamingXXH64_11__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_StreamingXXH64___reduce_cython, NULL, __pyx_n_s_borg_algorithms_checksums, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_10algorithms_9checksums_14StreamingXXH64_13__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_StreamingXXH64___setstate_cython, NULL, __pyx_n_s_borg_algorithms_checksums, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/algorithms/checksums.pyx":1 * from ..helpers import bin_to_hex # <<<<<<<<<<<<<< * * from libc.stdint cimport uint32_t */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init borg.algorithms.checksums", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init borg.algorithms.checksums"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* GetException */ #if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) #endif { PyObject *local_type = NULL, *local_value, *local_tb = NULL; #if CYTHON_FAST_THREAD_STATE PyObject *tmp_type, *tmp_value, *tmp_tb; #if PY_VERSION_HEX >= 0x030C00A6 local_value = tstate->current_exception; tstate->current_exception = 0; if (likely(local_value)) { local_type = (PyObject*) Py_TYPE(local_value); Py_INCREF(local_type); local_tb = PyException_GetTraceback(local_value); } #else local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 if (unlikely(tstate->current_exception)) #elif CYTHON_FAST_THREAD_STATE if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE #if CYTHON_USE_EXC_INFO_STACK { _PyErr_StackItem *exc_info = tstate->exc_info; #if PY_VERSION_HEX >= 0x030B00a4 tmp_value = exc_info->exc_value; exc_info->exc_value = local_value; tmp_type = NULL; tmp_tb = NULL; Py_XDECREF(local_type); Py_XDECREF(local_tb); #else tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = local_type; exc_info->exc_value = local_value; exc_info->exc_traceback = local_tb; #endif } #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } /* SwapException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; tmp_value = exc_info->exc_value; exc_info->exc_value = *value; if (tmp_value == NULL || tmp_value == Py_None) { Py_XDECREF(tmp_value); tmp_value = NULL; tmp_type = NULL; tmp_tb = NULL; } else { tmp_type = (PyObject*) Py_TYPE(tmp_value); Py_INCREF(tmp_type); #if CYTHON_COMPILING_IN_CPYTHON tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback; Py_XINCREF(tmp_tb); #else tmp_tb = PyException_GetTraceback(tmp_value); #endif } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = *type; exc_info->exc_value = *value; exc_info->exc_traceback = *tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = *type; tstate->exc_value = *value; tstate->exc_traceback = *tb; #endif *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); PyErr_SetExcInfo(*type, *value, *tb); *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #endif /* GetTopmostException */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) { _PyErr_StackItem *exc_info = tstate->exc_info; while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && exc_info->previous_item != NULL) { exc_info = exc_info->previous_item; } return exc_info; } #endif /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); PyObject *exc_value = exc_info->exc_value; if (exc_value == NULL || exc_value == Py_None) { *value = NULL; *type = NULL; *tb = NULL; } else { *value = exc_value; Py_INCREF(*value); *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); *tb = PyException_GetTraceback(exc_value); } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); *type = exc_info->exc_type; *value = exc_info->exc_value; *tb = exc_info->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #else *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #endif } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; PyObject *tmp_value = exc_info->exc_value; exc_info->exc_value = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = type; exc_info->exc_value = value; exc_info->exc_traceback = tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* KeywordStringCheck */ static int __Pyx_CheckKeywordStrings( PyObject *kw, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0)) goto invalid_keyword; return 1; #else if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) { Py_ssize_t kwsize; #if CYTHON_ASSUME_SAFE_MACROS kwsize = PyTuple_GET_SIZE(kw); #else kwsize = PyTuple_Size(kw); if (kwsize < 0) return 0; #endif if (unlikely(kwsize == 0)) return 1; if (!kw_allowed) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, 0); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif goto invalid_keyword; } #if PY_VERSION_HEX < 0x03090000 for (pos = 0; pos < kwsize; pos++) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, pos); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } #endif return 1; } while (PyDict_Next(kw, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if (!kw_allowed && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP __Pyx_TypeName type_name; PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) #elif PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (likely(descr != NULL)) { *method = descr; return 0; } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(name)); #endif __Pyx_DECREF_TypeName(type_name); return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_CallOneArg(method, obj); Py_DECREF(method); return result; } if (unlikely(!method)) goto bad; result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* ValidateBasesTuple */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; #if CYTHON_ASSUME_SAFE_MACROS n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); if (n < 0) return -1; #endif for (i = 1; i < n; i++) { #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; #elif CYTHON_ASSUME_SAFE_MACROS PyObject *b0 = PyTuple_GET_ITEM(bases, i); #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; #endif PyTypeObject *b; #if PY_MAJOR_VERSION < 3 if (PyClass_Check(b0)) { PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); __Pyx_DECREF_TypeName(b_name); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); if (!py_b_dictoffset) goto dictoffset_return; b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); Py_DECREF(py_b_dictoffset); if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; #endif if (b_dictoffset) { { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "extension type '%.200s' has no __dict__ slot, " "but base type '" __Pyx_FMT_TYPENAME "' has: " "either add 'cdef dict __dict__' to the extension type " "or add '__slots__ = [...]' to the base type", type_name, b_name); __Pyx_DECREF_TypeName(b_name); } #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif } return 0; } #endif /* PyType_Ready */ static int __Pyx_PyType_Ready(PyTypeObject *t) { #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS (void)__Pyx_validate_bases_tuple; #endif return PyType_Ready(t); #else int r; PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 gc_was_enabled = PyGC_Disable(); (void)__Pyx_PyObject_CallMethod0; #else PyObject *ret, *py_status; PyObject *gc = NULL; #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) gc = PyImport_GetModule(__pyx_kp_u_gc); #endif if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); if (unlikely(!gc)) return -1; py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; } gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; } Py_DECREF(ret); } else if (unlikely(gc_was_enabled == -1)) { Py_DECREF(gc); return -1; } #endif t->tp_flags |= Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A0000 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; #endif #else (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) PyGC_Enable(); #else if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); } else { Py_XDECREF(tp); Py_XDECREF(v); Py_XDECREF(tb); r = -1; } } Py_DECREF(gc); #endif } #endif return r; #endif } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, attr_name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(attr_name)); #endif __Pyx_DECREF_TypeName(type_name); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* PyObject_GenericGetAttr */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { return PyObject_GenericGetAttr(obj, attr_name); } return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); } #endif /* SetupReduce */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { int ret; PyObject *name_attr; name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name); if (likely(name_attr)) { ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); } else { ret = -1; } if (unlikely(ret < 0)) { PyErr_Clear(); ret = 0; } Py_XDECREF(name_attr); return ret; } static int __Pyx_setup_reduce(PyObject* type_obj) { int ret = 0; PyObject *object_reduce = NULL; PyObject *object_getstate = NULL; PyObject *object_reduce_ex = NULL; PyObject *reduce = NULL; PyObject *reduce_ex = NULL; PyObject *reduce_cython = NULL; PyObject *setstate = NULL; PyObject *setstate_cython = NULL; PyObject *getstate = NULL; #if CYTHON_USE_PYTYPE_LOOKUP getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate); #else getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate); if (!getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (getstate) { #if CYTHON_USE_PYTYPE_LOOKUP object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate); #else object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate); if (!object_getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (object_getstate != getstate) { goto __PYX_GOOD; } } #if CYTHON_USE_PYTYPE_LOOKUP object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #else object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #endif reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; if (reduce_ex == object_reduce_ex) { #if CYTHON_USE_PYTYPE_LOOKUP object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #else object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #endif reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); if (likely(reduce_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (reduce == object_reduce || PyErr_Occurred()) { goto __PYX_BAD; } setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate); if (!setstate) PyErr_Clear(); if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); if (likely(setstate_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (!setstate || PyErr_Occurred()) { goto __PYX_BAD; } } PyType_Modified((PyTypeObject*)type_obj); } } goto __PYX_GOOD; __PYX_BAD: if (!PyErr_Occurred()) { __Pyx_TypeName type_obj_name = __Pyx_PyType_GetName((PyTypeObject*)type_obj); PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name); __Pyx_DECREF_TypeName(type_obj_name); } ret = -1; __PYX_GOOD: #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); Py_XDECREF(object_getstate); Py_XDECREF(getstate); #endif Py_XDECREF(reduce); Py_XDECREF(reduce_ex); Py_XDECREF(reduce_cython); Py_XDECREF(setstate); Py_XDECREF(setstate_cython); return ret; } #endif /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType_3_0_10 #define __PYX_HAVE_RT_ImportType_3_0_10 static PyTypeObject *__Pyx_ImportType_3_0_10(PyObject *module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_10 check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; Py_ssize_t itemsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; PyObject *py_itemsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #if !CYTHON_COMPILING_IN_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; itemsize = ((PyTypeObject *)result)->tp_itemsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); if (!py_itemsize) goto bad; itemsize = PyLong_AsSsize_t(py_itemsize); Py_DECREF(py_itemsize); py_itemsize = 0; if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (itemsize) { if (size % alignment) { alignment = size % alignment; } if (itemsize < (Py_ssize_t)alignment) itemsize = (Py_ssize_t)alignment; } if ((size_t)(basicsize + itemsize) < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize+itemsize); goto bad; } if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_10 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd-%zd from PyObject", module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_10 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(result); return NULL; } #endif /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__3); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(uint32_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint32_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint32_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(uint32_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 2 * PyLong_SHIFT)) { return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 3: if ((8 * sizeof(uint32_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 3 * PyLong_SHIFT)) { return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 4: if ((8 * sizeof(uint32_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 4 * PyLong_SHIFT)) { return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint32_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(uint32_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint32_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(uint32_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 2: if ((8 * sizeof(uint32_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { return (uint32_t) ((((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -3: if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 3: if ((8 * sizeof(uint32_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { return (uint32_t) ((((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -4: if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 4: if ((8 * sizeof(uint32_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT)) { return (uint32_t) ((((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; } } #endif if ((sizeof(uint32_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint32_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { uint32_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (uint32_t) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (uint32_t) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint32_t) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (uint32_t) -1; } else { stepval = __Pyx_NewRef(v); } val = (uint32_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(uint32_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((uint32_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(uint32_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((uint32_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((uint32_t) 1) << (sizeof(uint32_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (uint32_t) -1; } } else { uint32_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint32_t) -1; val = __Pyx_PyInt_As_uint32_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint32_t"); return (uint32_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint32_t"); return (uint32_t) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint32_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint32_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint32_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(uint32_t), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint32_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_As_unsigned_PY_LONG_LONG(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG) -1, const_zero = (unsigned PY_LONG_LONG) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(unsigned PY_LONG_LONG) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (unsigned PY_LONG_LONG) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(unsigned PY_LONG_LONG) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned PY_LONG_LONG) >= 2 * PyLong_SHIFT)) { return (unsigned PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); } } break; case 3: if ((8 * sizeof(unsigned PY_LONG_LONG) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned PY_LONG_LONG) >= 3 * PyLong_SHIFT)) { return (unsigned PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); } } break; case 4: if ((8 * sizeof(unsigned PY_LONG_LONG) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned PY_LONG_LONG) >= 4 * PyLong_SHIFT)) { return (unsigned PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (unsigned PY_LONG_LONG) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(unsigned PY_LONG_LONG) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(unsigned PY_LONG_LONG, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(unsigned PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(unsigned PY_LONG_LONG, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(unsigned PY_LONG_LONG) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT)) { return (unsigned PY_LONG_LONG) (((unsigned PY_LONG_LONG)-1)*(((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]))); } } break; case 2: if ((8 * sizeof(unsigned PY_LONG_LONG) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT)) { return (unsigned PY_LONG_LONG) ((((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]))); } } break; case -3: if ((8 * sizeof(unsigned PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT)) { return (unsigned PY_LONG_LONG) (((unsigned PY_LONG_LONG)-1)*(((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]))); } } break; case 3: if ((8 * sizeof(unsigned PY_LONG_LONG) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT)) { return (unsigned PY_LONG_LONG) ((((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]))); } } break; case -4: if ((8 * sizeof(unsigned PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT)) { return (unsigned PY_LONG_LONG) (((unsigned PY_LONG_LONG)-1)*(((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]))); } } break; case 4: if ((8 * sizeof(unsigned PY_LONG_LONG) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT)) { return (unsigned PY_LONG_LONG) ((((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]))); } } break; } } #endif if ((sizeof(unsigned PY_LONG_LONG) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(unsigned PY_LONG_LONG, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(unsigned PY_LONG_LONG) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(unsigned PY_LONG_LONG, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { unsigned PY_LONG_LONG val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (unsigned PY_LONG_LONG) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (unsigned PY_LONG_LONG) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (unsigned PY_LONG_LONG) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (unsigned PY_LONG_LONG) -1; } else { stepval = __Pyx_NewRef(v); } val = (unsigned PY_LONG_LONG) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(unsigned PY_LONG_LONG) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((unsigned PY_LONG_LONG) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(unsigned PY_LONG_LONG) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((unsigned PY_LONG_LONG) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((unsigned PY_LONG_LONG) 1) << (sizeof(unsigned PY_LONG_LONG) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (unsigned PY_LONG_LONG) -1; } } else { unsigned PY_LONG_LONG val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (unsigned PY_LONG_LONG) -1; val = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to unsigned PY_LONG_LONG"); return (unsigned PY_LONG_LONG) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to unsigned PY_LONG_LONG"); return (unsigned PY_LONG_LONG) -1; } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__19); } return name; } #endif /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (long) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (long) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = __Pyx_NewRef(v); } val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (int) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (int) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = __Pyx_NewRef(v); } val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/algorithms/checksums.pyx0000644000076500000240000000644214641074756020654 0ustar00twstafffrom ..helpers import bin_to_hex from libc.stdint cimport uint32_t from cpython.buffer cimport PyBUF_SIMPLE, PyObject_GetBuffer, PyBuffer_Release from cpython.bytes cimport PyBytes_FromStringAndSize cdef extern from "crc32_dispatch.c": uint32_t _crc32_slice_by_8 "crc32_slice_by_8"(const void* data, size_t length, uint32_t initial_crc) uint32_t _crc32_clmul "crc32_clmul"(const void* data, size_t length, uint32_t initial_crc) int _have_clmul "have_clmul"() cdef extern from "xxhash.h": ctypedef struct XXH64_canonical_t: char digest[8] ctypedef struct XXH64_state_t: pass # opaque ctypedef unsigned long long XXH64_hash_t ctypedef enum XXH_errorcode: XXH_OK, XXH_ERROR XXH64_state_t* XXH64_createState() XXH_errorcode XXH64_freeState(XXH64_state_t* statePtr) XXH64_hash_t XXH64(const void* input, size_t length, unsigned long long seed) XXH_errorcode XXH64_reset(XXH64_state_t* statePtr, unsigned long long seed) XXH_errorcode XXH64_update(XXH64_state_t* statePtr, const void* input, size_t length) XXH64_hash_t XXH64_digest(const XXH64_state_t* statePtr) void XXH64_canonicalFromHash(XXH64_canonical_t* dst, XXH64_hash_t hash) XXH64_hash_t XXH64_hashFromCanonical(const XXH64_canonical_t* src) cdef Py_buffer ro_buffer(object data) except *: cdef Py_buffer view PyObject_GetBuffer(data, &view, PyBUF_SIMPLE) return view def crc32_slice_by_8(data, value=0): cdef Py_buffer data_buf = ro_buffer(data) cdef uint32_t val = value try: return _crc32_slice_by_8(data_buf.buf, data_buf.len, val) finally: PyBuffer_Release(&data_buf) def crc32_clmul(data, value=0): cdef Py_buffer data_buf = ro_buffer(data) cdef uint32_t val = value try: return _crc32_clmul(data_buf.buf, data_buf.len, val) finally: PyBuffer_Release(&data_buf) have_clmul = _have_clmul() if have_clmul: crc32 = crc32_clmul else: crc32 = crc32_slice_by_8 def xxh64(data, seed=0): cdef unsigned long long _seed = seed cdef XXH64_hash_t hash cdef XXH64_canonical_t digest cdef Py_buffer data_buf = ro_buffer(data) try: hash = XXH64(data_buf.buf, data_buf.len, _seed) finally: PyBuffer_Release(&data_buf) XXH64_canonicalFromHash(&digest, hash) return PyBytes_FromStringAndSize( digest.digest, 8) cdef class StreamingXXH64: cdef XXH64_state_t* state def __cinit__(self, seed=0): self.state = XXH64_createState() cdef unsigned long long _seed = seed if XXH64_reset(self.state, _seed) != XXH_OK: raise Exception('XXH64_reset failed') def __dealloc__(self): XXH64_freeState(self.state) def update(self, data): cdef Py_buffer data_buf = ro_buffer(data) try: if XXH64_update(self.state, data_buf.buf, data_buf.len) != XXH_OK: raise Exception('XXH64_update failed') finally: PyBuffer_Release(&data_buf) def digest(self): cdef XXH64_hash_t hash cdef XXH64_canonical_t digest hash = XXH64_digest(self.state) XXH64_canonicalFromHash(&digest, hash) return PyBytes_FromStringAndSize( digest.digest, 8) def hexdigest(self): return bin_to_hex(self.digest()) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/algorithms/crc32_clmul.c0000644000076500000240000004225014641074756020376 0ustar00twstaff/* * Compute the CRC32 using a parallelized folding approach with the PCLMULQDQ * instruction. * * A white paper describing this algorithm can be found at: * http://www.intel.com/content/dam/www/public/us/en/documents/white-papers/fast-crc-computation-generic-polynomials-pclmulqdq-paper.pdf * * Copyright (C) 2013 Intel Corporation. All rights reserved. * Authors: * Wajdi Feghali * Jim Guilford * Vinodh Gopal * Erdinc Ozturk * Jim Kukunas * * Copyright (c) 2016 Marian Beermann (add support for initial value, restructuring) * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages * arising from the use of this software. * * Permission is granted to anyone to use this software for any purpose, * including commercial applications, and to alter it and redistribute it * freely, subject to the following restrictions: * * 1. The origin of this software must not be misrepresented; you must not * claim that you wrote the original software. If you use this software * in a product, an acknowledgment in the product documentation would be * appreciated but is not required. * 2. Altered source versions must be plainly marked as such, and must not be * misrepresented as being the original software. * 3. This notice may not be removed or altered from any source distribution. */ #include #include #include #ifdef _MSC_VER #include #else /* * Newer versions of GCC and clang come with cpuid.h * (ftr GCC 4.7 in Debian Wheezy has this) */ #include #endif static void cpuid(int info, unsigned* eax, unsigned* ebx, unsigned* ecx, unsigned* edx) { #ifdef _MSC_VER unsigned int registers[4]; __cpuid(registers, info); *eax = registers[0]; *ebx = registers[1]; *ecx = registers[2]; *edx = registers[3]; #else /* GCC, clang */ unsigned int _eax; unsigned int _ebx; unsigned int _ecx; unsigned int _edx; __cpuid(info, _eax, _ebx, _ecx, _edx); *eax = _eax; *ebx = _ebx; *ecx = _ecx; *edx = _edx; #endif } static int have_clmul(void) { unsigned eax, ebx, ecx, edx; int has_pclmulqdq; int has_sse41; cpuid(1 /* feature bits */, &eax, &ebx, &ecx, &edx); has_pclmulqdq = ecx & 0x2; /* bit 1 */ has_sse41 = ecx & 0x80000; /* bit 19 */ return has_pclmulqdq && has_sse41; } CLMUL static void fold_1(__m128i *xmm_crc0, __m128i *xmm_crc1, __m128i *xmm_crc2, __m128i *xmm_crc3) { const __m128i xmm_fold4 = _mm_set_epi32( 0x00000001, 0x54442bd4, 0x00000001, 0xc6e41596); __m128i x_tmp3; __m128 ps_crc0, ps_crc3, ps_res; x_tmp3 = *xmm_crc3; *xmm_crc3 = *xmm_crc0; *xmm_crc0 = _mm_clmulepi64_si128(*xmm_crc0, xmm_fold4, 0x01); *xmm_crc3 = _mm_clmulepi64_si128(*xmm_crc3, xmm_fold4, 0x10); ps_crc0 = _mm_castsi128_ps(*xmm_crc0); ps_crc3 = _mm_castsi128_ps(*xmm_crc3); ps_res = _mm_xor_ps(ps_crc0, ps_crc3); *xmm_crc0 = *xmm_crc1; *xmm_crc1 = *xmm_crc2; *xmm_crc2 = x_tmp3; *xmm_crc3 = _mm_castps_si128(ps_res); } CLMUL static void fold_2(__m128i *xmm_crc0, __m128i *xmm_crc1, __m128i *xmm_crc2, __m128i *xmm_crc3) { const __m128i xmm_fold4 = _mm_set_epi32( 0x00000001, 0x54442bd4, 0x00000001, 0xc6e41596); __m128i x_tmp3, x_tmp2; __m128 ps_crc0, ps_crc1, ps_crc2, ps_crc3, ps_res31, ps_res20; x_tmp3 = *xmm_crc3; x_tmp2 = *xmm_crc2; *xmm_crc3 = *xmm_crc1; *xmm_crc1 = _mm_clmulepi64_si128(*xmm_crc1, xmm_fold4, 0x01); *xmm_crc3 = _mm_clmulepi64_si128(*xmm_crc3, xmm_fold4, 0x10); ps_crc3 = _mm_castsi128_ps(*xmm_crc3); ps_crc1 = _mm_castsi128_ps(*xmm_crc1); ps_res31 = _mm_xor_ps(ps_crc3, ps_crc1); *xmm_crc2 = *xmm_crc0; *xmm_crc0 = _mm_clmulepi64_si128(*xmm_crc0, xmm_fold4, 0x01); *xmm_crc2 = _mm_clmulepi64_si128(*xmm_crc2, xmm_fold4, 0x10); ps_crc0 = _mm_castsi128_ps(*xmm_crc0); ps_crc2 = _mm_castsi128_ps(*xmm_crc2); ps_res20 = _mm_xor_ps(ps_crc0, ps_crc2); *xmm_crc0 = x_tmp2; *xmm_crc1 = x_tmp3; *xmm_crc2 = _mm_castps_si128(ps_res20); *xmm_crc3 = _mm_castps_si128(ps_res31); } CLMUL static void fold_3(__m128i *xmm_crc0, __m128i *xmm_crc1, __m128i *xmm_crc2, __m128i *xmm_crc3) { const __m128i xmm_fold4 = _mm_set_epi32( 0x00000001, 0x54442bd4, 0x00000001, 0xc6e41596); __m128i x_tmp3; __m128 ps_crc0, ps_crc1, ps_crc2, ps_crc3, ps_res32, ps_res21, ps_res10; x_tmp3 = *xmm_crc3; *xmm_crc3 = *xmm_crc2; *xmm_crc2 = _mm_clmulepi64_si128(*xmm_crc2, xmm_fold4, 0x01); *xmm_crc3 = _mm_clmulepi64_si128(*xmm_crc3, xmm_fold4, 0x10); ps_crc2 = _mm_castsi128_ps(*xmm_crc2); ps_crc3 = _mm_castsi128_ps(*xmm_crc3); ps_res32 = _mm_xor_ps(ps_crc2, ps_crc3); *xmm_crc2 = *xmm_crc1; *xmm_crc1 = _mm_clmulepi64_si128(*xmm_crc1, xmm_fold4, 0x01); *xmm_crc2 = _mm_clmulepi64_si128(*xmm_crc2, xmm_fold4, 0x10); ps_crc1 = _mm_castsi128_ps(*xmm_crc1); ps_crc2 = _mm_castsi128_ps(*xmm_crc2); ps_res21 = _mm_xor_ps(ps_crc1, ps_crc2); *xmm_crc1 = *xmm_crc0; *xmm_crc0 = _mm_clmulepi64_si128(*xmm_crc0, xmm_fold4, 0x01); *xmm_crc1 = _mm_clmulepi64_si128(*xmm_crc1, xmm_fold4, 0x10); ps_crc0 = _mm_castsi128_ps(*xmm_crc0); ps_crc1 = _mm_castsi128_ps(*xmm_crc1); ps_res10 = _mm_xor_ps(ps_crc0, ps_crc1); *xmm_crc0 = x_tmp3; *xmm_crc1 = _mm_castps_si128(ps_res10); *xmm_crc2 = _mm_castps_si128(ps_res21); *xmm_crc3 = _mm_castps_si128(ps_res32); } CLMUL static void fold_4(__m128i *xmm_crc0, __m128i *xmm_crc1, __m128i *xmm_crc2, __m128i *xmm_crc3) { const __m128i xmm_fold4 = _mm_set_epi32( 0x00000001, 0x54442bd4, 0x00000001, 0xc6e41596); __m128i x_tmp0, x_tmp1, x_tmp2, x_tmp3; __m128 ps_crc0, ps_crc1, ps_crc2, ps_crc3; __m128 ps_t0, ps_t1, ps_t2, ps_t3; __m128 ps_res0, ps_res1, ps_res2, ps_res3; x_tmp0 = *xmm_crc0; x_tmp1 = *xmm_crc1; x_tmp2 = *xmm_crc2; x_tmp3 = *xmm_crc3; *xmm_crc0 = _mm_clmulepi64_si128(*xmm_crc0, xmm_fold4, 0x01); x_tmp0 = _mm_clmulepi64_si128(x_tmp0, xmm_fold4, 0x10); ps_crc0 = _mm_castsi128_ps(*xmm_crc0); ps_t0 = _mm_castsi128_ps(x_tmp0); ps_res0 = _mm_xor_ps(ps_crc0, ps_t0); *xmm_crc1 = _mm_clmulepi64_si128(*xmm_crc1, xmm_fold4, 0x01); x_tmp1 = _mm_clmulepi64_si128(x_tmp1, xmm_fold4, 0x10); ps_crc1 = _mm_castsi128_ps(*xmm_crc1); ps_t1 = _mm_castsi128_ps(x_tmp1); ps_res1 = _mm_xor_ps(ps_crc1, ps_t1); *xmm_crc2 = _mm_clmulepi64_si128(*xmm_crc2, xmm_fold4, 0x01); x_tmp2 = _mm_clmulepi64_si128(x_tmp2, xmm_fold4, 0x10); ps_crc2 = _mm_castsi128_ps(*xmm_crc2); ps_t2 = _mm_castsi128_ps(x_tmp2); ps_res2 = _mm_xor_ps(ps_crc2, ps_t2); *xmm_crc3 = _mm_clmulepi64_si128(*xmm_crc3, xmm_fold4, 0x01); x_tmp3 = _mm_clmulepi64_si128(x_tmp3, xmm_fold4, 0x10); ps_crc3 = _mm_castsi128_ps(*xmm_crc3); ps_t3 = _mm_castsi128_ps(x_tmp3); ps_res3 = _mm_xor_ps(ps_crc3, ps_t3); *xmm_crc0 = _mm_castps_si128(ps_res0); *xmm_crc1 = _mm_castps_si128(ps_res1); *xmm_crc2 = _mm_castps_si128(ps_res2); *xmm_crc3 = _mm_castps_si128(ps_res3); } static const unsigned ALIGNED_(32) pshufb_shf_table[60] = { 0x84838281, 0x88878685, 0x8c8b8a89, 0x008f8e8d, /* shl 15 (16 - 1)/shr1 */ 0x85848382, 0x89888786, 0x8d8c8b8a, 0x01008f8e, /* shl 14 (16 - 3)/shr2 */ 0x86858483, 0x8a898887, 0x8e8d8c8b, 0x0201008f, /* shl 13 (16 - 4)/shr3 */ 0x87868584, 0x8b8a8988, 0x8f8e8d8c, 0x03020100, /* shl 12 (16 - 4)/shr4 */ 0x88878685, 0x8c8b8a89, 0x008f8e8d, 0x04030201, /* shl 11 (16 - 5)/shr5 */ 0x89888786, 0x8d8c8b8a, 0x01008f8e, 0x05040302, /* shl 10 (16 - 6)/shr6 */ 0x8a898887, 0x8e8d8c8b, 0x0201008f, 0x06050403, /* shl 9 (16 - 7)/shr7 */ 0x8b8a8988, 0x8f8e8d8c, 0x03020100, 0x07060504, /* shl 8 (16 - 8)/shr8 */ 0x8c8b8a89, 0x008f8e8d, 0x04030201, 0x08070605, /* shl 7 (16 - 9)/shr9 */ 0x8d8c8b8a, 0x01008f8e, 0x05040302, 0x09080706, /* shl 6 (16 -10)/shr10*/ 0x8e8d8c8b, 0x0201008f, 0x06050403, 0x0a090807, /* shl 5 (16 -11)/shr11*/ 0x8f8e8d8c, 0x03020100, 0x07060504, 0x0b0a0908, /* shl 4 (16 -12)/shr12*/ 0x008f8e8d, 0x04030201, 0x08070605, 0x0c0b0a09, /* shl 3 (16 -13)/shr13*/ 0x01008f8e, 0x05040302, 0x09080706, 0x0d0c0b0a, /* shl 2 (16 -14)/shr14*/ 0x0201008f, 0x06050403, 0x0a090807, 0x0e0d0c0b /* shl 1 (16 -15)/shr15*/ }; CLMUL static void partial_fold(const size_t len, __m128i *xmm_crc0, __m128i *xmm_crc1, __m128i *xmm_crc2, __m128i *xmm_crc3, __m128i *xmm_crc_part) { const __m128i xmm_fold4 = _mm_set_epi32( 0x00000001, 0x54442bd4, 0x00000001, 0xc6e41596); const __m128i xmm_mask3 = _mm_set1_epi32(0x80808080); __m128i xmm_shl, xmm_shr, xmm_tmp1, xmm_tmp2, xmm_tmp3; __m128i xmm_a0_0, xmm_a0_1; __m128 ps_crc3, psa0_0, psa0_1, ps_res; xmm_shl = _mm_load_si128((__m128i *)pshufb_shf_table + (len - 1)); xmm_shr = xmm_shl; xmm_shr = _mm_xor_si128(xmm_shr, xmm_mask3); xmm_a0_0 = _mm_shuffle_epi8(*xmm_crc0, xmm_shl); *xmm_crc0 = _mm_shuffle_epi8(*xmm_crc0, xmm_shr); xmm_tmp1 = _mm_shuffle_epi8(*xmm_crc1, xmm_shl); *xmm_crc0 = _mm_or_si128(*xmm_crc0, xmm_tmp1); *xmm_crc1 = _mm_shuffle_epi8(*xmm_crc1, xmm_shr); xmm_tmp2 = _mm_shuffle_epi8(*xmm_crc2, xmm_shl); *xmm_crc1 = _mm_or_si128(*xmm_crc1, xmm_tmp2); *xmm_crc2 = _mm_shuffle_epi8(*xmm_crc2, xmm_shr); xmm_tmp3 = _mm_shuffle_epi8(*xmm_crc3, xmm_shl); *xmm_crc2 = _mm_or_si128(*xmm_crc2, xmm_tmp3); *xmm_crc3 = _mm_shuffle_epi8(*xmm_crc3, xmm_shr); *xmm_crc_part = _mm_shuffle_epi8(*xmm_crc_part, xmm_shl); *xmm_crc3 = _mm_or_si128(*xmm_crc3, *xmm_crc_part); xmm_a0_1 = _mm_clmulepi64_si128(xmm_a0_0, xmm_fold4, 0x10); xmm_a0_0 = _mm_clmulepi64_si128(xmm_a0_0, xmm_fold4, 0x01); ps_crc3 = _mm_castsi128_ps(*xmm_crc3); psa0_0 = _mm_castsi128_ps(xmm_a0_0); psa0_1 = _mm_castsi128_ps(xmm_a0_1); ps_res = _mm_xor_ps(ps_crc3, psa0_0); ps_res = _mm_xor_ps(ps_res, psa0_1); *xmm_crc3 = _mm_castps_si128(ps_res); } static const unsigned ALIGNED_(16) crc_k[] = { 0xccaa009e, 0x00000000, /* rk1 */ 0x751997d0, 0x00000001, /* rk2 */ 0xccaa009e, 0x00000000, /* rk5 */ 0x63cd6124, 0x00000001, /* rk6 */ 0xf7011640, 0x00000001, /* rk7 */ 0xdb710640, 0x00000001 /* rk8 */ }; static const unsigned ALIGNED_(16) crc_mask[4] = { 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000, 0x00000000 }; static const unsigned ALIGNED_(16) crc_mask2[4] = { 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF }; #define ONCE(op) if(first) { \ first = 0; \ (op); \ } /* * somewhat surprisingly the "naive" way of doing this, ie. with a flag and a cond. branch, * is consistently ~5 % faster on average than the implied-recommended branchless way (always xor, * always zero xmm_initial). Guess speculative execution and branch prediction got the better of * yet another "optimization tip". */ #define XOR_INITIAL(where) ONCE(where = _mm_xor_si128(where, xmm_initial)) CLMUL static uint32_t crc32_clmul(const uint8_t *src, long len, uint32_t initial_crc) { unsigned long algn_diff; __m128i xmm_t0, xmm_t1, xmm_t2, xmm_t3; __m128i xmm_initial = _mm_cvtsi32_si128(initial_crc); __m128i xmm_crc0 = _mm_cvtsi32_si128(0x9db42487); __m128i xmm_crc1 = _mm_setzero_si128(); __m128i xmm_crc2 = _mm_setzero_si128(); __m128i xmm_crc3 = _mm_setzero_si128(); __m128i xmm_crc_part; int first = 1; /* fold 512 to 32 step variable declarations for ISO-C90 compat. */ const __m128i xmm_mask = _mm_load_si128((__m128i *)crc_mask); const __m128i xmm_mask2 = _mm_load_si128((__m128i *)crc_mask2); uint32_t crc; __m128i x_tmp0, x_tmp1, x_tmp2, crc_fold; if (len < 16) { if (len == 0) return initial_crc; if (len < 4) { /* * no idea how to do this for <4 bytes, delegate to classic impl. */ uint32_t crc = ~initial_crc; switch (len) { case 3: crc = (crc >> 8) ^ Crc32Lookup[0][(crc & 0xFF) ^ *src++]; // fallthrough case 2: crc = (crc >> 8) ^ Crc32Lookup[0][(crc & 0xFF) ^ *src++]; // fallthrough case 1: crc = (crc >> 8) ^ Crc32Lookup[0][(crc & 0xFF) ^ *src++]; } return ~crc; } xmm_crc_part = _mm_loadu_si128((__m128i *)src); XOR_INITIAL(xmm_crc_part); goto partial; } /* this alignment computation would be wrong for len<16 handled above */ algn_diff = (0 - (uintptr_t)src) & 0xF; if (algn_diff) { xmm_crc_part = _mm_loadu_si128((__m128i *)src); XOR_INITIAL(xmm_crc_part); src += algn_diff; len -= algn_diff; partial_fold(algn_diff, &xmm_crc0, &xmm_crc1, &xmm_crc2, &xmm_crc3, &xmm_crc_part); } while ((len -= 64) >= 0) { xmm_t0 = _mm_load_si128((__m128i *)src); xmm_t1 = _mm_load_si128((__m128i *)src + 1); xmm_t2 = _mm_load_si128((__m128i *)src + 2); xmm_t3 = _mm_load_si128((__m128i *)src + 3); XOR_INITIAL(xmm_t0); fold_4(&xmm_crc0, &xmm_crc1, &xmm_crc2, &xmm_crc3); xmm_crc0 = _mm_xor_si128(xmm_crc0, xmm_t0); xmm_crc1 = _mm_xor_si128(xmm_crc1, xmm_t1); xmm_crc2 = _mm_xor_si128(xmm_crc2, xmm_t2); xmm_crc3 = _mm_xor_si128(xmm_crc3, xmm_t3); src += 64; } /* * len = num bytes left - 64 */ if (len + 16 >= 0) { len += 16; xmm_t0 = _mm_load_si128((__m128i *)src); xmm_t1 = _mm_load_si128((__m128i *)src + 1); xmm_t2 = _mm_load_si128((__m128i *)src + 2); XOR_INITIAL(xmm_t0); fold_3(&xmm_crc0, &xmm_crc1, &xmm_crc2, &xmm_crc3); xmm_crc1 = _mm_xor_si128(xmm_crc1, xmm_t0); xmm_crc2 = _mm_xor_si128(xmm_crc2, xmm_t1); xmm_crc3 = _mm_xor_si128(xmm_crc3, xmm_t2); if (len == 0) goto done; xmm_crc_part = _mm_load_si128((__m128i *)src + 3); } else if (len + 32 >= 0) { len += 32; xmm_t0 = _mm_load_si128((__m128i *)src); xmm_t1 = _mm_load_si128((__m128i *)src + 1); XOR_INITIAL(xmm_t0); fold_2(&xmm_crc0, &xmm_crc1, &xmm_crc2, &xmm_crc3); xmm_crc2 = _mm_xor_si128(xmm_crc2, xmm_t0); xmm_crc3 = _mm_xor_si128(xmm_crc3, xmm_t1); if (len == 0) goto done; xmm_crc_part = _mm_load_si128((__m128i *)src + 2); } else if (len + 48 >= 0) { len += 48; xmm_t0 = _mm_load_si128((__m128i *)src); XOR_INITIAL(xmm_t0); fold_1(&xmm_crc0, &xmm_crc1, &xmm_crc2, &xmm_crc3); xmm_crc3 = _mm_xor_si128(xmm_crc3, xmm_t0); if (len == 0) goto done; xmm_crc_part = _mm_load_si128((__m128i *)src + 1); } else { len += 64; if (len == 0) goto done; xmm_crc_part = _mm_load_si128((__m128i *)src); XOR_INITIAL(xmm_crc_part); } partial: partial_fold(len, &xmm_crc0, &xmm_crc1, &xmm_crc2, &xmm_crc3, &xmm_crc_part); done: (void)0; /* fold 512 to 32 */ /* * k1 */ crc_fold = _mm_load_si128((__m128i *)crc_k); x_tmp0 = _mm_clmulepi64_si128(xmm_crc0, crc_fold, 0x10); xmm_crc0 = _mm_clmulepi64_si128(xmm_crc0, crc_fold, 0x01); xmm_crc1 = _mm_xor_si128(xmm_crc1, x_tmp0); xmm_crc1 = _mm_xor_si128(xmm_crc1, xmm_crc0); x_tmp1 = _mm_clmulepi64_si128(xmm_crc1, crc_fold, 0x10); xmm_crc1 = _mm_clmulepi64_si128(xmm_crc1, crc_fold, 0x01); xmm_crc2 = _mm_xor_si128(xmm_crc2, x_tmp1); xmm_crc2 = _mm_xor_si128(xmm_crc2, xmm_crc1); x_tmp2 = _mm_clmulepi64_si128(xmm_crc2, crc_fold, 0x10); xmm_crc2 = _mm_clmulepi64_si128(xmm_crc2, crc_fold, 0x01); xmm_crc3 = _mm_xor_si128(xmm_crc3, x_tmp2); xmm_crc3 = _mm_xor_si128(xmm_crc3, xmm_crc2); /* * k5 */ crc_fold = _mm_load_si128((__m128i *)crc_k + 1); xmm_crc0 = xmm_crc3; xmm_crc3 = _mm_clmulepi64_si128(xmm_crc3, crc_fold, 0); xmm_crc0 = _mm_srli_si128(xmm_crc0, 8); xmm_crc3 = _mm_xor_si128(xmm_crc3, xmm_crc0); xmm_crc0 = xmm_crc3; xmm_crc3 = _mm_slli_si128(xmm_crc3, 4); xmm_crc3 = _mm_clmulepi64_si128(xmm_crc3, crc_fold, 0x10); xmm_crc3 = _mm_xor_si128(xmm_crc3, xmm_crc0); xmm_crc3 = _mm_and_si128(xmm_crc3, xmm_mask2); /* * k7 */ xmm_crc1 = xmm_crc3; xmm_crc2 = xmm_crc3; crc_fold = _mm_load_si128((__m128i *)crc_k + 2); xmm_crc3 = _mm_clmulepi64_si128(xmm_crc3, crc_fold, 0); xmm_crc3 = _mm_xor_si128(xmm_crc3, xmm_crc2); xmm_crc3 = _mm_and_si128(xmm_crc3, xmm_mask); xmm_crc2 = xmm_crc3; xmm_crc3 = _mm_clmulepi64_si128(xmm_crc3, crc_fold, 0x10); xmm_crc3 = _mm_xor_si128(xmm_crc3, xmm_crc2); xmm_crc3 = _mm_xor_si128(xmm_crc3, xmm_crc1); /* * could just as well write xmm_crc3[2], doing a movaps and truncating, but * no real advantage - it's a tiny bit slower per call, while no additional CPUs * would be supported by only requiring SSSE3 and CLMUL instead of SSE4.1 + CLMUL */ crc = _mm_extract_epi32(xmm_crc3, 2); return ~crc; } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/algorithms/crc32_dispatch.c0000644000076500000240000000542214641074756021061 0ustar00twstaff /* always compile slice by 8 as a runtime fallback */ #include "crc32_slice_by_8.c" #ifdef __GNUC__ /* * GCC 4.4(.7) has a bug that causes it to recurse infinitely if an unknown option * is pushed onto the options stack. GCC 4.5 was not tested, so is excluded as well. * GCC 4.6 is known good. */ #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) /* * clang also has or had GCC bug #56298 explained below, but doesn't support * target attributes or the options stack. So we disable this faster code path for clang. */ #ifndef __clang__ /* * While OpenBSD uses GCC, they don't have Intel intrinsics, so we can't compile this code * on OpenBSD. */ #ifndef __OpenBSD__ #if __x86_64__ /* * Because we don't want a configure script we need compiler-dependent pre-defined macros for detecting this, * also some compiler-dependent stuff to invoke SSE modes and align things. */ #define FOLDING_CRC /* * SSE2 misses _mm_shuffle_epi32, and _mm_extract_epi32 * SSSE3 added _mm_shuffle_epi32 * SSE4.1 added _mm_extract_epi32 * Also requires CLMUL of course (all AES-NI CPUs have it) * Note that there are no CPUs with AES-NI/CLMUL but without SSE4.1 */ #define CLMUL __attribute__ ((target ("pclmul,sse4.1"))) #define ALIGNED_(n) __attribute__ ((aligned(n))) /* * Work around https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56298 * These are taken from GCC 6.x, so apparently the above bug has been resolved in that version, * but it still affects widely used GCC 4.x. * Part 2 of 2 follows below. */ #ifndef __PCLMUL__ #pragma GCC push_options #pragma GCC target("pclmul") #define __BORG_DISABLE_PCLMUL__ #endif #ifndef __SSE3__ #pragma GCC push_options #pragma GCC target("sse3") #define __BORG_DISABLE_SSE3__ #endif #ifndef __SSSE3__ #pragma GCC push_options #pragma GCC target("ssse3") #define __BORG_DISABLE_SSSE3__ #endif #ifndef __SSE4_1__ #pragma GCC push_options #pragma GCC target("sse4.1") #define __BORG_DISABLE_SSE4_1__ #endif #endif /* if __x86_64__ */ #endif /* ifndef __OpenBSD__ */ #endif /* ifndef __clang__ */ #endif /* __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) */ #endif /* ifdef __GNUC__ */ #ifdef FOLDING_CRC #include "crc32_clmul.c" #else static uint32_t crc32_clmul(const uint8_t *src, long len, uint32_t initial_crc) { (void)src; (void)len; (void)initial_crc; assert(0); return 0; } static int have_clmul(void) { return 0; } #endif /* * Part 2 of 2 of the GCC workaround. */ #ifdef __BORG_DISABLE_PCLMUL__ #undef __BORG_DISABLE_PCLMUL__ #pragma GCC pop_options #endif #ifdef __BORG_DISABLE_SSE3__ #undef __BORG_DISABLE_SSE3__ #pragma GCC pop_options #endif #ifdef __BORG_DISABLE_SSSE3__ #undef __BORG_DISABLE_SSSE3__ #pragma GCC pop_options #endif #ifdef __BORG_DISABLE_SSE4_1__ #undef __BORG_DISABLE_SSE4_1__ #pragma GCC pop_options #endif ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/algorithms/crc32_slice_by_8.c0000644000076500000240000006634414641074756021314 0ustar00twstaff// ////////////////////////////////////////////////////////// // Crc32.h // Copyright (c) 2011-2016 Stephan Brumme. All rights reserved. // see http://create.stephan-brumme.com/disclaimer.html // // uint8_t, uint32_t, int32_t #include // size_t #include #include "../_endian.h" /// compute CRC32 (Slicing-by-8 algorithm), unroll inner loop 4 times uint32_t crc32_4x8bytes(const void* data, size_t length, uint32_t previousCrc32); // ////////////////////////////////////////////////////////// // Crc32.cpp // Copyright (c) 2011-2016 Stephan Brumme. All rights reserved. // Slicing-by-16 contributed by Bulat Ziganshin // Tableless bytewise CRC contributed by Hagai Gold // see http://create.stephan-brumme.com/disclaimer.html // /// zlib's CRC32 polynomial const uint32_t Polynomial = 0xEDB88320; // ////////////////////////////////////////////////////////// // constants /// look-up table, already declared above const uint32_t Crc32Lookup[8][256] = { //// same algorithm as crc32_bitwise //for (int i = 0; i <= 0xFF; i++) //{ // uint32_t crc = i; // for (int j = 0; j < 8; j++) // crc = (crc >> 1) ^ ((crc & 1) * Polynomial); // Crc32Lookup[0][i] = crc; //} //// ... and the following slicing-by-8 algorithm (from Intel): //// http://www.intel.com/technology/comms/perfnet/download/CRC_generators.pdf //// http://sourceforge.net/projects/slicing-by-8/ //for (int slice = 1; slice < MaxSlice; slice++) // Crc32Lookup[slice][i] = (Crc32Lookup[slice - 1][i] >> 8) ^ Crc32Lookup[0][Crc32Lookup[slice - 1][i] & 0xFF]; { // note: the first number of every second row corresponds to the half-byte look-up table ! 0x00000000,0x77073096,0xEE0E612C,0x990951BA,0x076DC419,0x706AF48F,0xE963A535,0x9E6495A3, 0x0EDB8832,0x79DCB8A4,0xE0D5E91E,0x97D2D988,0x09B64C2B,0x7EB17CBD,0xE7B82D07,0x90BF1D91, 0x1DB71064,0x6AB020F2,0xF3B97148,0x84BE41DE,0x1ADAD47D,0x6DDDE4EB,0xF4D4B551,0x83D385C7, 0x136C9856,0x646BA8C0,0xFD62F97A,0x8A65C9EC,0x14015C4F,0x63066CD9,0xFA0F3D63,0x8D080DF5, 0x3B6E20C8,0x4C69105E,0xD56041E4,0xA2677172,0x3C03E4D1,0x4B04D447,0xD20D85FD,0xA50AB56B, 0x35B5A8FA,0x42B2986C,0xDBBBC9D6,0xACBCF940,0x32D86CE3,0x45DF5C75,0xDCD60DCF,0xABD13D59, 0x26D930AC,0x51DE003A,0xC8D75180,0xBFD06116,0x21B4F4B5,0x56B3C423,0xCFBA9599,0xB8BDA50F, 0x2802B89E,0x5F058808,0xC60CD9B2,0xB10BE924,0x2F6F7C87,0x58684C11,0xC1611DAB,0xB6662D3D, 0x76DC4190,0x01DB7106,0x98D220BC,0xEFD5102A,0x71B18589,0x06B6B51F,0x9FBFE4A5,0xE8B8D433, 0x7807C9A2,0x0F00F934,0x9609A88E,0xE10E9818,0x7F6A0DBB,0x086D3D2D,0x91646C97,0xE6635C01, 0x6B6B51F4,0x1C6C6162,0x856530D8,0xF262004E,0x6C0695ED,0x1B01A57B,0x8208F4C1,0xF50FC457, 0x65B0D9C6,0x12B7E950,0x8BBEB8EA,0xFCB9887C,0x62DD1DDF,0x15DA2D49,0x8CD37CF3,0xFBD44C65, 0x4DB26158,0x3AB551CE,0xA3BC0074,0xD4BB30E2,0x4ADFA541,0x3DD895D7,0xA4D1C46D,0xD3D6F4FB, 0x4369E96A,0x346ED9FC,0xAD678846,0xDA60B8D0,0x44042D73,0x33031DE5,0xAA0A4C5F,0xDD0D7CC9, 0x5005713C,0x270241AA,0xBE0B1010,0xC90C2086,0x5768B525,0x206F85B3,0xB966D409,0xCE61E49F, 0x5EDEF90E,0x29D9C998,0xB0D09822,0xC7D7A8B4,0x59B33D17,0x2EB40D81,0xB7BD5C3B,0xC0BA6CAD, 0xEDB88320,0x9ABFB3B6,0x03B6E20C,0x74B1D29A,0xEAD54739,0x9DD277AF,0x04DB2615,0x73DC1683, 0xE3630B12,0x94643B84,0x0D6D6A3E,0x7A6A5AA8,0xE40ECF0B,0x9309FF9D,0x0A00AE27,0x7D079EB1, 0xF00F9344,0x8708A3D2,0x1E01F268,0x6906C2FE,0xF762575D,0x806567CB,0x196C3671,0x6E6B06E7, 0xFED41B76,0x89D32BE0,0x10DA7A5A,0x67DD4ACC,0xF9B9DF6F,0x8EBEEFF9,0x17B7BE43,0x60B08ED5, 0xD6D6A3E8,0xA1D1937E,0x38D8C2C4,0x4FDFF252,0xD1BB67F1,0xA6BC5767,0x3FB506DD,0x48B2364B, 0xD80D2BDA,0xAF0A1B4C,0x36034AF6,0x41047A60,0xDF60EFC3,0xA867DF55,0x316E8EEF,0x4669BE79, 0xCB61B38C,0xBC66831A,0x256FD2A0,0x5268E236,0xCC0C7795,0xBB0B4703,0x220216B9,0x5505262F, 0xC5BA3BBE,0xB2BD0B28,0x2BB45A92,0x5CB36A04,0xC2D7FFA7,0xB5D0CF31,0x2CD99E8B,0x5BDEAE1D, 0x9B64C2B0,0xEC63F226,0x756AA39C,0x026D930A,0x9C0906A9,0xEB0E363F,0x72076785,0x05005713, 0x95BF4A82,0xE2B87A14,0x7BB12BAE,0x0CB61B38,0x92D28E9B,0xE5D5BE0D,0x7CDCEFB7,0x0BDBDF21, 0x86D3D2D4,0xF1D4E242,0x68DDB3F8,0x1FDA836E,0x81BE16CD,0xF6B9265B,0x6FB077E1,0x18B74777, 0x88085AE6,0xFF0F6A70,0x66063BCA,0x11010B5C,0x8F659EFF,0xF862AE69,0x616BFFD3,0x166CCF45, 0xA00AE278,0xD70DD2EE,0x4E048354,0x3903B3C2,0xA7672661,0xD06016F7,0x4969474D,0x3E6E77DB, 0xAED16A4A,0xD9D65ADC,0x40DF0B66,0x37D83BF0,0xA9BCAE53,0xDEBB9EC5,0x47B2CF7F,0x30B5FFE9, 0xBDBDF21C,0xCABAC28A,0x53B39330,0x24B4A3A6,0xBAD03605,0xCDD70693,0x54DE5729,0x23D967BF, 0xB3667A2E,0xC4614AB8,0x5D681B02,0x2A6F2B94,0xB40BBE37,0xC30C8EA1,0x5A05DF1B,0x2D02EF8D, } ,{ 0x00000000,0x191B3141,0x32366282,0x2B2D53C3,0x646CC504,0x7D77F445,0x565AA786,0x4F4196C7, 0xC8D98A08,0xD1C2BB49,0xFAEFE88A,0xE3F4D9CB,0xACB54F0C,0xB5AE7E4D,0x9E832D8E,0x87981CCF, 0x4AC21251,0x53D92310,0x78F470D3,0x61EF4192,0x2EAED755,0x37B5E614,0x1C98B5D7,0x05838496, 0x821B9859,0x9B00A918,0xB02DFADB,0xA936CB9A,0xE6775D5D,0xFF6C6C1C,0xD4413FDF,0xCD5A0E9E, 0x958424A2,0x8C9F15E3,0xA7B24620,0xBEA97761,0xF1E8E1A6,0xE8F3D0E7,0xC3DE8324,0xDAC5B265, 0x5D5DAEAA,0x44469FEB,0x6F6BCC28,0x7670FD69,0x39316BAE,0x202A5AEF,0x0B07092C,0x121C386D, 0xDF4636F3,0xC65D07B2,0xED705471,0xF46B6530,0xBB2AF3F7,0xA231C2B6,0x891C9175,0x9007A034, 0x179FBCFB,0x0E848DBA,0x25A9DE79,0x3CB2EF38,0x73F379FF,0x6AE848BE,0x41C51B7D,0x58DE2A3C, 0xF0794F05,0xE9627E44,0xC24F2D87,0xDB541CC6,0x94158A01,0x8D0EBB40,0xA623E883,0xBF38D9C2, 0x38A0C50D,0x21BBF44C,0x0A96A78F,0x138D96CE,0x5CCC0009,0x45D73148,0x6EFA628B,0x77E153CA, 0xBABB5D54,0xA3A06C15,0x888D3FD6,0x91960E97,0xDED79850,0xC7CCA911,0xECE1FAD2,0xF5FACB93, 0x7262D75C,0x6B79E61D,0x4054B5DE,0x594F849F,0x160E1258,0x0F152319,0x243870DA,0x3D23419B, 0x65FD6BA7,0x7CE65AE6,0x57CB0925,0x4ED03864,0x0191AEA3,0x188A9FE2,0x33A7CC21,0x2ABCFD60, 0xAD24E1AF,0xB43FD0EE,0x9F12832D,0x8609B26C,0xC94824AB,0xD05315EA,0xFB7E4629,0xE2657768, 0x2F3F79F6,0x362448B7,0x1D091B74,0x04122A35,0x4B53BCF2,0x52488DB3,0x7965DE70,0x607EEF31, 0xE7E6F3FE,0xFEFDC2BF,0xD5D0917C,0xCCCBA03D,0x838A36FA,0x9A9107BB,0xB1BC5478,0xA8A76539, 0x3B83984B,0x2298A90A,0x09B5FAC9,0x10AECB88,0x5FEF5D4F,0x46F46C0E,0x6DD93FCD,0x74C20E8C, 0xF35A1243,0xEA412302,0xC16C70C1,0xD8774180,0x9736D747,0x8E2DE606,0xA500B5C5,0xBC1B8484, 0x71418A1A,0x685ABB5B,0x4377E898,0x5A6CD9D9,0x152D4F1E,0x0C367E5F,0x271B2D9C,0x3E001CDD, 0xB9980012,0xA0833153,0x8BAE6290,0x92B553D1,0xDDF4C516,0xC4EFF457,0xEFC2A794,0xF6D996D5, 0xAE07BCE9,0xB71C8DA8,0x9C31DE6B,0x852AEF2A,0xCA6B79ED,0xD37048AC,0xF85D1B6F,0xE1462A2E, 0x66DE36E1,0x7FC507A0,0x54E85463,0x4DF36522,0x02B2F3E5,0x1BA9C2A4,0x30849167,0x299FA026, 0xE4C5AEB8,0xFDDE9FF9,0xD6F3CC3A,0xCFE8FD7B,0x80A96BBC,0x99B25AFD,0xB29F093E,0xAB84387F, 0x2C1C24B0,0x350715F1,0x1E2A4632,0x07317773,0x4870E1B4,0x516BD0F5,0x7A468336,0x635DB277, 0xCBFAD74E,0xD2E1E60F,0xF9CCB5CC,0xE0D7848D,0xAF96124A,0xB68D230B,0x9DA070C8,0x84BB4189, 0x03235D46,0x1A386C07,0x31153FC4,0x280E0E85,0x674F9842,0x7E54A903,0x5579FAC0,0x4C62CB81, 0x8138C51F,0x9823F45E,0xB30EA79D,0xAA1596DC,0xE554001B,0xFC4F315A,0xD7626299,0xCE7953D8, 0x49E14F17,0x50FA7E56,0x7BD72D95,0x62CC1CD4,0x2D8D8A13,0x3496BB52,0x1FBBE891,0x06A0D9D0, 0x5E7EF3EC,0x4765C2AD,0x6C48916E,0x7553A02F,0x3A1236E8,0x230907A9,0x0824546A,0x113F652B, 0x96A779E4,0x8FBC48A5,0xA4911B66,0xBD8A2A27,0xF2CBBCE0,0xEBD08DA1,0xC0FDDE62,0xD9E6EF23, 0x14BCE1BD,0x0DA7D0FC,0x268A833F,0x3F91B27E,0x70D024B9,0x69CB15F8,0x42E6463B,0x5BFD777A, 0xDC656BB5,0xC57E5AF4,0xEE530937,0xF7483876,0xB809AEB1,0xA1129FF0,0x8A3FCC33,0x9324FD72, }, { 0x00000000,0x01C26A37,0x0384D46E,0x0246BE59,0x0709A8DC,0x06CBC2EB,0x048D7CB2,0x054F1685, 0x0E1351B8,0x0FD13B8F,0x0D9785D6,0x0C55EFE1,0x091AF964,0x08D89353,0x0A9E2D0A,0x0B5C473D, 0x1C26A370,0x1DE4C947,0x1FA2771E,0x1E601D29,0x1B2F0BAC,0x1AED619B,0x18ABDFC2,0x1969B5F5, 0x1235F2C8,0x13F798FF,0x11B126A6,0x10734C91,0x153C5A14,0x14FE3023,0x16B88E7A,0x177AE44D, 0x384D46E0,0x398F2CD7,0x3BC9928E,0x3A0BF8B9,0x3F44EE3C,0x3E86840B,0x3CC03A52,0x3D025065, 0x365E1758,0x379C7D6F,0x35DAC336,0x3418A901,0x3157BF84,0x3095D5B3,0x32D36BEA,0x331101DD, 0x246BE590,0x25A98FA7,0x27EF31FE,0x262D5BC9,0x23624D4C,0x22A0277B,0x20E69922,0x2124F315, 0x2A78B428,0x2BBADE1F,0x29FC6046,0x283E0A71,0x2D711CF4,0x2CB376C3,0x2EF5C89A,0x2F37A2AD, 0x709A8DC0,0x7158E7F7,0x731E59AE,0x72DC3399,0x7793251C,0x76514F2B,0x7417F172,0x75D59B45, 0x7E89DC78,0x7F4BB64F,0x7D0D0816,0x7CCF6221,0x798074A4,0x78421E93,0x7A04A0CA,0x7BC6CAFD, 0x6CBC2EB0,0x6D7E4487,0x6F38FADE,0x6EFA90E9,0x6BB5866C,0x6A77EC5B,0x68315202,0x69F33835, 0x62AF7F08,0x636D153F,0x612BAB66,0x60E9C151,0x65A6D7D4,0x6464BDE3,0x662203BA,0x67E0698D, 0x48D7CB20,0x4915A117,0x4B531F4E,0x4A917579,0x4FDE63FC,0x4E1C09CB,0x4C5AB792,0x4D98DDA5, 0x46C49A98,0x4706F0AF,0x45404EF6,0x448224C1,0x41CD3244,0x400F5873,0x4249E62A,0x438B8C1D, 0x54F16850,0x55330267,0x5775BC3E,0x56B7D609,0x53F8C08C,0x523AAABB,0x507C14E2,0x51BE7ED5, 0x5AE239E8,0x5B2053DF,0x5966ED86,0x58A487B1,0x5DEB9134,0x5C29FB03,0x5E6F455A,0x5FAD2F6D, 0xE1351B80,0xE0F771B7,0xE2B1CFEE,0xE373A5D9,0xE63CB35C,0xE7FED96B,0xE5B86732,0xE47A0D05, 0xEF264A38,0xEEE4200F,0xECA29E56,0xED60F461,0xE82FE2E4,0xE9ED88D3,0xEBAB368A,0xEA695CBD, 0xFD13B8F0,0xFCD1D2C7,0xFE976C9E,0xFF5506A9,0xFA1A102C,0xFBD87A1B,0xF99EC442,0xF85CAE75, 0xF300E948,0xF2C2837F,0xF0843D26,0xF1465711,0xF4094194,0xF5CB2BA3,0xF78D95FA,0xF64FFFCD, 0xD9785D60,0xD8BA3757,0xDAFC890E,0xDB3EE339,0xDE71F5BC,0xDFB39F8B,0xDDF521D2,0xDC374BE5, 0xD76B0CD8,0xD6A966EF,0xD4EFD8B6,0xD52DB281,0xD062A404,0xD1A0CE33,0xD3E6706A,0xD2241A5D, 0xC55EFE10,0xC49C9427,0xC6DA2A7E,0xC7184049,0xC25756CC,0xC3953CFB,0xC1D382A2,0xC011E895, 0xCB4DAFA8,0xCA8FC59F,0xC8C97BC6,0xC90B11F1,0xCC440774,0xCD866D43,0xCFC0D31A,0xCE02B92D, 0x91AF9640,0x906DFC77,0x922B422E,0x93E92819,0x96A63E9C,0x976454AB,0x9522EAF2,0x94E080C5, 0x9FBCC7F8,0x9E7EADCF,0x9C381396,0x9DFA79A1,0x98B56F24,0x99770513,0x9B31BB4A,0x9AF3D17D, 0x8D893530,0x8C4B5F07,0x8E0DE15E,0x8FCF8B69,0x8A809DEC,0x8B42F7DB,0x89044982,0x88C623B5, 0x839A6488,0x82580EBF,0x801EB0E6,0x81DCDAD1,0x8493CC54,0x8551A663,0x8717183A,0x86D5720D, 0xA9E2D0A0,0xA820BA97,0xAA6604CE,0xABA46EF9,0xAEEB787C,0xAF29124B,0xAD6FAC12,0xACADC625, 0xA7F18118,0xA633EB2F,0xA4755576,0xA5B73F41,0xA0F829C4,0xA13A43F3,0xA37CFDAA,0xA2BE979D, 0xB5C473D0,0xB40619E7,0xB640A7BE,0xB782CD89,0xB2CDDB0C,0xB30FB13B,0xB1490F62,0xB08B6555, 0xBBD72268,0xBA15485F,0xB853F606,0xB9919C31,0xBCDE8AB4,0xBD1CE083,0xBF5A5EDA,0xBE9834ED, }, { 0x00000000,0xB8BC6765,0xAA09C88B,0x12B5AFEE,0x8F629757,0x37DEF032,0x256B5FDC,0x9DD738B9, 0xC5B428EF,0x7D084F8A,0x6FBDE064,0xD7018701,0x4AD6BFB8,0xF26AD8DD,0xE0DF7733,0x58631056, 0x5019579F,0xE8A530FA,0xFA109F14,0x42ACF871,0xDF7BC0C8,0x67C7A7AD,0x75720843,0xCDCE6F26, 0x95AD7F70,0x2D111815,0x3FA4B7FB,0x8718D09E,0x1ACFE827,0xA2738F42,0xB0C620AC,0x087A47C9, 0xA032AF3E,0x188EC85B,0x0A3B67B5,0xB28700D0,0x2F503869,0x97EC5F0C,0x8559F0E2,0x3DE59787, 0x658687D1,0xDD3AE0B4,0xCF8F4F5A,0x7733283F,0xEAE41086,0x525877E3,0x40EDD80D,0xF851BF68, 0xF02BF8A1,0x48979FC4,0x5A22302A,0xE29E574F,0x7F496FF6,0xC7F50893,0xD540A77D,0x6DFCC018, 0x359FD04E,0x8D23B72B,0x9F9618C5,0x272A7FA0,0xBAFD4719,0x0241207C,0x10F48F92,0xA848E8F7, 0x9B14583D,0x23A83F58,0x311D90B6,0x89A1F7D3,0x1476CF6A,0xACCAA80F,0xBE7F07E1,0x06C36084, 0x5EA070D2,0xE61C17B7,0xF4A9B859,0x4C15DF3C,0xD1C2E785,0x697E80E0,0x7BCB2F0E,0xC377486B, 0xCB0D0FA2,0x73B168C7,0x6104C729,0xD9B8A04C,0x446F98F5,0xFCD3FF90,0xEE66507E,0x56DA371B, 0x0EB9274D,0xB6054028,0xA4B0EFC6,0x1C0C88A3,0x81DBB01A,0x3967D77F,0x2BD27891,0x936E1FF4, 0x3B26F703,0x839A9066,0x912F3F88,0x299358ED,0xB4446054,0x0CF80731,0x1E4DA8DF,0xA6F1CFBA, 0xFE92DFEC,0x462EB889,0x549B1767,0xEC277002,0x71F048BB,0xC94C2FDE,0xDBF98030,0x6345E755, 0x6B3FA09C,0xD383C7F9,0xC1366817,0x798A0F72,0xE45D37CB,0x5CE150AE,0x4E54FF40,0xF6E89825, 0xAE8B8873,0x1637EF16,0x048240F8,0xBC3E279D,0x21E91F24,0x99557841,0x8BE0D7AF,0x335CB0CA, 0xED59B63B,0x55E5D15E,0x47507EB0,0xFFEC19D5,0x623B216C,0xDA874609,0xC832E9E7,0x708E8E82, 0x28ED9ED4,0x9051F9B1,0x82E4565F,0x3A58313A,0xA78F0983,0x1F336EE6,0x0D86C108,0xB53AA66D, 0xBD40E1A4,0x05FC86C1,0x1749292F,0xAFF54E4A,0x322276F3,0x8A9E1196,0x982BBE78,0x2097D91D, 0x78F4C94B,0xC048AE2E,0xD2FD01C0,0x6A4166A5,0xF7965E1C,0x4F2A3979,0x5D9F9697,0xE523F1F2, 0x4D6B1905,0xF5D77E60,0xE762D18E,0x5FDEB6EB,0xC2098E52,0x7AB5E937,0x680046D9,0xD0BC21BC, 0x88DF31EA,0x3063568F,0x22D6F961,0x9A6A9E04,0x07BDA6BD,0xBF01C1D8,0xADB46E36,0x15080953, 0x1D724E9A,0xA5CE29FF,0xB77B8611,0x0FC7E174,0x9210D9CD,0x2AACBEA8,0x38191146,0x80A57623, 0xD8C66675,0x607A0110,0x72CFAEFE,0xCA73C99B,0x57A4F122,0xEF189647,0xFDAD39A9,0x45115ECC, 0x764DEE06,0xCEF18963,0xDC44268D,0x64F841E8,0xF92F7951,0x41931E34,0x5326B1DA,0xEB9AD6BF, 0xB3F9C6E9,0x0B45A18C,0x19F00E62,0xA14C6907,0x3C9B51BE,0x842736DB,0x96929935,0x2E2EFE50, 0x2654B999,0x9EE8DEFC,0x8C5D7112,0x34E11677,0xA9362ECE,0x118A49AB,0x033FE645,0xBB838120, 0xE3E09176,0x5B5CF613,0x49E959FD,0xF1553E98,0x6C820621,0xD43E6144,0xC68BCEAA,0x7E37A9CF, 0xD67F4138,0x6EC3265D,0x7C7689B3,0xC4CAEED6,0x591DD66F,0xE1A1B10A,0xF3141EE4,0x4BA87981, 0x13CB69D7,0xAB770EB2,0xB9C2A15C,0x017EC639,0x9CA9FE80,0x241599E5,0x36A0360B,0x8E1C516E, 0x866616A7,0x3EDA71C2,0x2C6FDE2C,0x94D3B949,0x090481F0,0xB1B8E695,0xA30D497B,0x1BB12E1E, 0x43D23E48,0xFB6E592D,0xE9DBF6C3,0x516791A6,0xCCB0A91F,0x740CCE7A,0x66B96194,0xDE0506F1, } ,{ 0x00000000,0x3D6029B0,0x7AC05360,0x47A07AD0,0xF580A6C0,0xC8E08F70,0x8F40F5A0,0xB220DC10, 0x30704BC1,0x0D106271,0x4AB018A1,0x77D03111,0xC5F0ED01,0xF890C4B1,0xBF30BE61,0x825097D1, 0x60E09782,0x5D80BE32,0x1A20C4E2,0x2740ED52,0x95603142,0xA80018F2,0xEFA06222,0xD2C04B92, 0x5090DC43,0x6DF0F5F3,0x2A508F23,0x1730A693,0xA5107A83,0x98705333,0xDFD029E3,0xE2B00053, 0xC1C12F04,0xFCA106B4,0xBB017C64,0x866155D4,0x344189C4,0x0921A074,0x4E81DAA4,0x73E1F314, 0xF1B164C5,0xCCD14D75,0x8B7137A5,0xB6111E15,0x0431C205,0x3951EBB5,0x7EF19165,0x4391B8D5, 0xA121B886,0x9C419136,0xDBE1EBE6,0xE681C256,0x54A11E46,0x69C137F6,0x2E614D26,0x13016496, 0x9151F347,0xAC31DAF7,0xEB91A027,0xD6F18997,0x64D15587,0x59B17C37,0x1E1106E7,0x23712F57, 0x58F35849,0x659371F9,0x22330B29,0x1F532299,0xAD73FE89,0x9013D739,0xD7B3ADE9,0xEAD38459, 0x68831388,0x55E33A38,0x124340E8,0x2F236958,0x9D03B548,0xA0639CF8,0xE7C3E628,0xDAA3CF98, 0x3813CFCB,0x0573E67B,0x42D39CAB,0x7FB3B51B,0xCD93690B,0xF0F340BB,0xB7533A6B,0x8A3313DB, 0x0863840A,0x3503ADBA,0x72A3D76A,0x4FC3FEDA,0xFDE322CA,0xC0830B7A,0x872371AA,0xBA43581A, 0x9932774D,0xA4525EFD,0xE3F2242D,0xDE920D9D,0x6CB2D18D,0x51D2F83D,0x167282ED,0x2B12AB5D, 0xA9423C8C,0x9422153C,0xD3826FEC,0xEEE2465C,0x5CC29A4C,0x61A2B3FC,0x2602C92C,0x1B62E09C, 0xF9D2E0CF,0xC4B2C97F,0x8312B3AF,0xBE729A1F,0x0C52460F,0x31326FBF,0x7692156F,0x4BF23CDF, 0xC9A2AB0E,0xF4C282BE,0xB362F86E,0x8E02D1DE,0x3C220DCE,0x0142247E,0x46E25EAE,0x7B82771E, 0xB1E6B092,0x8C869922,0xCB26E3F2,0xF646CA42,0x44661652,0x79063FE2,0x3EA64532,0x03C66C82, 0x8196FB53,0xBCF6D2E3,0xFB56A833,0xC6368183,0x74165D93,0x49767423,0x0ED60EF3,0x33B62743, 0xD1062710,0xEC660EA0,0xABC67470,0x96A65DC0,0x248681D0,0x19E6A860,0x5E46D2B0,0x6326FB00, 0xE1766CD1,0xDC164561,0x9BB63FB1,0xA6D61601,0x14F6CA11,0x2996E3A1,0x6E369971,0x5356B0C1, 0x70279F96,0x4D47B626,0x0AE7CCF6,0x3787E546,0x85A73956,0xB8C710E6,0xFF676A36,0xC2074386, 0x4057D457,0x7D37FDE7,0x3A978737,0x07F7AE87,0xB5D77297,0x88B75B27,0xCF1721F7,0xF2770847, 0x10C70814,0x2DA721A4,0x6A075B74,0x576772C4,0xE547AED4,0xD8278764,0x9F87FDB4,0xA2E7D404, 0x20B743D5,0x1DD76A65,0x5A7710B5,0x67173905,0xD537E515,0xE857CCA5,0xAFF7B675,0x92979FC5, 0xE915E8DB,0xD475C16B,0x93D5BBBB,0xAEB5920B,0x1C954E1B,0x21F567AB,0x66551D7B,0x5B3534CB, 0xD965A31A,0xE4058AAA,0xA3A5F07A,0x9EC5D9CA,0x2CE505DA,0x11852C6A,0x562556BA,0x6B457F0A, 0x89F57F59,0xB49556E9,0xF3352C39,0xCE550589,0x7C75D999,0x4115F029,0x06B58AF9,0x3BD5A349, 0xB9853498,0x84E51D28,0xC34567F8,0xFE254E48,0x4C059258,0x7165BBE8,0x36C5C138,0x0BA5E888, 0x28D4C7DF,0x15B4EE6F,0x521494BF,0x6F74BD0F,0xDD54611F,0xE03448AF,0xA794327F,0x9AF41BCF, 0x18A48C1E,0x25C4A5AE,0x6264DF7E,0x5F04F6CE,0xED242ADE,0xD044036E,0x97E479BE,0xAA84500E, 0x4834505D,0x755479ED,0x32F4033D,0x0F942A8D,0xBDB4F69D,0x80D4DF2D,0xC774A5FD,0xFA148C4D, 0x78441B9C,0x4524322C,0x028448FC,0x3FE4614C,0x8DC4BD5C,0xB0A494EC,0xF704EE3C,0xCA64C78C, }, { 0x00000000,0xCB5CD3A5,0x4DC8A10B,0x869472AE,0x9B914216,0x50CD91B3,0xD659E31D,0x1D0530B8, 0xEC53826D,0x270F51C8,0xA19B2366,0x6AC7F0C3,0x77C2C07B,0xBC9E13DE,0x3A0A6170,0xF156B2D5, 0x03D6029B,0xC88AD13E,0x4E1EA390,0x85427035,0x9847408D,0x531B9328,0xD58FE186,0x1ED33223, 0xEF8580F6,0x24D95353,0xA24D21FD,0x6911F258,0x7414C2E0,0xBF481145,0x39DC63EB,0xF280B04E, 0x07AC0536,0xCCF0D693,0x4A64A43D,0x81387798,0x9C3D4720,0x57619485,0xD1F5E62B,0x1AA9358E, 0xEBFF875B,0x20A354FE,0xA6372650,0x6D6BF5F5,0x706EC54D,0xBB3216E8,0x3DA66446,0xF6FAB7E3, 0x047A07AD,0xCF26D408,0x49B2A6A6,0x82EE7503,0x9FEB45BB,0x54B7961E,0xD223E4B0,0x197F3715, 0xE82985C0,0x23755665,0xA5E124CB,0x6EBDF76E,0x73B8C7D6,0xB8E41473,0x3E7066DD,0xF52CB578, 0x0F580A6C,0xC404D9C9,0x4290AB67,0x89CC78C2,0x94C9487A,0x5F959BDF,0xD901E971,0x125D3AD4, 0xE30B8801,0x28575BA4,0xAEC3290A,0x659FFAAF,0x789ACA17,0xB3C619B2,0x35526B1C,0xFE0EB8B9, 0x0C8E08F7,0xC7D2DB52,0x4146A9FC,0x8A1A7A59,0x971F4AE1,0x5C439944,0xDAD7EBEA,0x118B384F, 0xE0DD8A9A,0x2B81593F,0xAD152B91,0x6649F834,0x7B4CC88C,0xB0101B29,0x36846987,0xFDD8BA22, 0x08F40F5A,0xC3A8DCFF,0x453CAE51,0x8E607DF4,0x93654D4C,0x58399EE9,0xDEADEC47,0x15F13FE2, 0xE4A78D37,0x2FFB5E92,0xA96F2C3C,0x6233FF99,0x7F36CF21,0xB46A1C84,0x32FE6E2A,0xF9A2BD8F, 0x0B220DC1,0xC07EDE64,0x46EAACCA,0x8DB67F6F,0x90B34FD7,0x5BEF9C72,0xDD7BEEDC,0x16273D79, 0xE7718FAC,0x2C2D5C09,0xAAB92EA7,0x61E5FD02,0x7CE0CDBA,0xB7BC1E1F,0x31286CB1,0xFA74BF14, 0x1EB014D8,0xD5ECC77D,0x5378B5D3,0x98246676,0x852156CE,0x4E7D856B,0xC8E9F7C5,0x03B52460, 0xF2E396B5,0x39BF4510,0xBF2B37BE,0x7477E41B,0x6972D4A3,0xA22E0706,0x24BA75A8,0xEFE6A60D, 0x1D661643,0xD63AC5E6,0x50AEB748,0x9BF264ED,0x86F75455,0x4DAB87F0,0xCB3FF55E,0x006326FB, 0xF135942E,0x3A69478B,0xBCFD3525,0x77A1E680,0x6AA4D638,0xA1F8059D,0x276C7733,0xEC30A496, 0x191C11EE,0xD240C24B,0x54D4B0E5,0x9F886340,0x828D53F8,0x49D1805D,0xCF45F2F3,0x04192156, 0xF54F9383,0x3E134026,0xB8873288,0x73DBE12D,0x6EDED195,0xA5820230,0x2316709E,0xE84AA33B, 0x1ACA1375,0xD196C0D0,0x5702B27E,0x9C5E61DB,0x815B5163,0x4A0782C6,0xCC93F068,0x07CF23CD, 0xF6999118,0x3DC542BD,0xBB513013,0x700DE3B6,0x6D08D30E,0xA65400AB,0x20C07205,0xEB9CA1A0, 0x11E81EB4,0xDAB4CD11,0x5C20BFBF,0x977C6C1A,0x8A795CA2,0x41258F07,0xC7B1FDA9,0x0CED2E0C, 0xFDBB9CD9,0x36E74F7C,0xB0733DD2,0x7B2FEE77,0x662ADECF,0xAD760D6A,0x2BE27FC4,0xE0BEAC61, 0x123E1C2F,0xD962CF8A,0x5FF6BD24,0x94AA6E81,0x89AF5E39,0x42F38D9C,0xC467FF32,0x0F3B2C97, 0xFE6D9E42,0x35314DE7,0xB3A53F49,0x78F9ECEC,0x65FCDC54,0xAEA00FF1,0x28347D5F,0xE368AEFA, 0x16441B82,0xDD18C827,0x5B8CBA89,0x90D0692C,0x8DD55994,0x46898A31,0xC01DF89F,0x0B412B3A, 0xFA1799EF,0x314B4A4A,0xB7DF38E4,0x7C83EB41,0x6186DBF9,0xAADA085C,0x2C4E7AF2,0xE712A957, 0x15921919,0xDECECABC,0x585AB812,0x93066BB7,0x8E035B0F,0x455F88AA,0xC3CBFA04,0x089729A1, 0xF9C19B74,0x329D48D1,0xB4093A7F,0x7F55E9DA,0x6250D962,0xA90C0AC7,0x2F987869,0xE4C4ABCC, }, { 0x00000000,0xA6770BB4,0x979F1129,0x31E81A9D,0xF44F2413,0x52382FA7,0x63D0353A,0xC5A73E8E, 0x33EF4E67,0x959845D3,0xA4705F4E,0x020754FA,0xC7A06A74,0x61D761C0,0x503F7B5D,0xF64870E9, 0x67DE9CCE,0xC1A9977A,0xF0418DE7,0x56368653,0x9391B8DD,0x35E6B369,0x040EA9F4,0xA279A240, 0x5431D2A9,0xF246D91D,0xC3AEC380,0x65D9C834,0xA07EF6BA,0x0609FD0E,0x37E1E793,0x9196EC27, 0xCFBD399C,0x69CA3228,0x582228B5,0xFE552301,0x3BF21D8F,0x9D85163B,0xAC6D0CA6,0x0A1A0712, 0xFC5277FB,0x5A257C4F,0x6BCD66D2,0xCDBA6D66,0x081D53E8,0xAE6A585C,0x9F8242C1,0x39F54975, 0xA863A552,0x0E14AEE6,0x3FFCB47B,0x998BBFCF,0x5C2C8141,0xFA5B8AF5,0xCBB39068,0x6DC49BDC, 0x9B8CEB35,0x3DFBE081,0x0C13FA1C,0xAA64F1A8,0x6FC3CF26,0xC9B4C492,0xF85CDE0F,0x5E2BD5BB, 0x440B7579,0xE27C7ECD,0xD3946450,0x75E36FE4,0xB044516A,0x16335ADE,0x27DB4043,0x81AC4BF7, 0x77E43B1E,0xD19330AA,0xE07B2A37,0x460C2183,0x83AB1F0D,0x25DC14B9,0x14340E24,0xB2430590, 0x23D5E9B7,0x85A2E203,0xB44AF89E,0x123DF32A,0xD79ACDA4,0x71EDC610,0x4005DC8D,0xE672D739, 0x103AA7D0,0xB64DAC64,0x87A5B6F9,0x21D2BD4D,0xE47583C3,0x42028877,0x73EA92EA,0xD59D995E, 0x8BB64CE5,0x2DC14751,0x1C295DCC,0xBA5E5678,0x7FF968F6,0xD98E6342,0xE86679DF,0x4E11726B, 0xB8590282,0x1E2E0936,0x2FC613AB,0x89B1181F,0x4C162691,0xEA612D25,0xDB8937B8,0x7DFE3C0C, 0xEC68D02B,0x4A1FDB9F,0x7BF7C102,0xDD80CAB6,0x1827F438,0xBE50FF8C,0x8FB8E511,0x29CFEEA5, 0xDF879E4C,0x79F095F8,0x48188F65,0xEE6F84D1,0x2BC8BA5F,0x8DBFB1EB,0xBC57AB76,0x1A20A0C2, 0x8816EAF2,0x2E61E146,0x1F89FBDB,0xB9FEF06F,0x7C59CEE1,0xDA2EC555,0xEBC6DFC8,0x4DB1D47C, 0xBBF9A495,0x1D8EAF21,0x2C66B5BC,0x8A11BE08,0x4FB68086,0xE9C18B32,0xD82991AF,0x7E5E9A1B, 0xEFC8763C,0x49BF7D88,0x78576715,0xDE206CA1,0x1B87522F,0xBDF0599B,0x8C184306,0x2A6F48B2, 0xDC27385B,0x7A5033EF,0x4BB82972,0xEDCF22C6,0x28681C48,0x8E1F17FC,0xBFF70D61,0x198006D5, 0x47ABD36E,0xE1DCD8DA,0xD034C247,0x7643C9F3,0xB3E4F77D,0x1593FCC9,0x247BE654,0x820CEDE0, 0x74449D09,0xD23396BD,0xE3DB8C20,0x45AC8794,0x800BB91A,0x267CB2AE,0x1794A833,0xB1E3A387, 0x20754FA0,0x86024414,0xB7EA5E89,0x119D553D,0xD43A6BB3,0x724D6007,0x43A57A9A,0xE5D2712E, 0x139A01C7,0xB5ED0A73,0x840510EE,0x22721B5A,0xE7D525D4,0x41A22E60,0x704A34FD,0xD63D3F49, 0xCC1D9F8B,0x6A6A943F,0x5B828EA2,0xFDF58516,0x3852BB98,0x9E25B02C,0xAFCDAAB1,0x09BAA105, 0xFFF2D1EC,0x5985DA58,0x686DC0C5,0xCE1ACB71,0x0BBDF5FF,0xADCAFE4B,0x9C22E4D6,0x3A55EF62, 0xABC30345,0x0DB408F1,0x3C5C126C,0x9A2B19D8,0x5F8C2756,0xF9FB2CE2,0xC813367F,0x6E643DCB, 0x982C4D22,0x3E5B4696,0x0FB35C0B,0xA9C457BF,0x6C636931,0xCA146285,0xFBFC7818,0x5D8B73AC, 0x03A0A617,0xA5D7ADA3,0x943FB73E,0x3248BC8A,0xF7EF8204,0x519889B0,0x6070932D,0xC6079899, 0x304FE870,0x9638E3C4,0xA7D0F959,0x01A7F2ED,0xC400CC63,0x6277C7D7,0x539FDD4A,0xF5E8D6FE, 0x647E3AD9,0xC209316D,0xF3E12BF0,0x55962044,0x90311ECA,0x3646157E,0x07AE0FE3,0xA1D90457, 0x579174BE,0xF1E67F0A,0xC00E6597,0x66796E23,0xA3DE50AD,0x05A95B19,0x34414184,0x92364A30, }, { 0x00000000,0xCCAA009E,0x4225077D,0x8E8F07E3,0x844A0EFA,0x48E00E64,0xC66F0987,0x0AC50919, 0xD3E51BB5,0x1F4F1B2B,0x91C01CC8,0x5D6A1C56,0x57AF154F,0x9B0515D1,0x158A1232,0xD92012AC, 0x7CBB312B,0xB01131B5,0x3E9E3656,0xF23436C8,0xF8F13FD1,0x345B3F4F,0xBAD438AC,0x767E3832, 0xAF5E2A9E,0x63F42A00,0xED7B2DE3,0x21D12D7D,0x2B142464,0xE7BE24FA,0x69312319,0xA59B2387, 0xF9766256,0x35DC62C8,0xBB53652B,0x77F965B5,0x7D3C6CAC,0xB1966C32,0x3F196BD1,0xF3B36B4F, 0x2A9379E3,0xE639797D,0x68B67E9E,0xA41C7E00,0xAED97719,0x62737787,0xECFC7064,0x205670FA, 0x85CD537D,0x496753E3,0xC7E85400,0x0B42549E,0x01875D87,0xCD2D5D19,0x43A25AFA,0x8F085A64, 0x562848C8,0x9A824856,0x140D4FB5,0xD8A74F2B,0xD2624632,0x1EC846AC,0x9047414F,0x5CED41D1, 0x299DC2ED,0xE537C273,0x6BB8C590,0xA712C50E,0xADD7CC17,0x617DCC89,0xEFF2CB6A,0x2358CBF4, 0xFA78D958,0x36D2D9C6,0xB85DDE25,0x74F7DEBB,0x7E32D7A2,0xB298D73C,0x3C17D0DF,0xF0BDD041, 0x5526F3C6,0x998CF358,0x1703F4BB,0xDBA9F425,0xD16CFD3C,0x1DC6FDA2,0x9349FA41,0x5FE3FADF, 0x86C3E873,0x4A69E8ED,0xC4E6EF0E,0x084CEF90,0x0289E689,0xCE23E617,0x40ACE1F4,0x8C06E16A, 0xD0EBA0BB,0x1C41A025,0x92CEA7C6,0x5E64A758,0x54A1AE41,0x980BAEDF,0x1684A93C,0xDA2EA9A2, 0x030EBB0E,0xCFA4BB90,0x412BBC73,0x8D81BCED,0x8744B5F4,0x4BEEB56A,0xC561B289,0x09CBB217, 0xAC509190,0x60FA910E,0xEE7596ED,0x22DF9673,0x281A9F6A,0xE4B09FF4,0x6A3F9817,0xA6959889, 0x7FB58A25,0xB31F8ABB,0x3D908D58,0xF13A8DC6,0xFBFF84DF,0x37558441,0xB9DA83A2,0x7570833C, 0x533B85DA,0x9F918544,0x111E82A7,0xDDB48239,0xD7718B20,0x1BDB8BBE,0x95548C5D,0x59FE8CC3, 0x80DE9E6F,0x4C749EF1,0xC2FB9912,0x0E51998C,0x04949095,0xC83E900B,0x46B197E8,0x8A1B9776, 0x2F80B4F1,0xE32AB46F,0x6DA5B38C,0xA10FB312,0xABCABA0B,0x6760BA95,0xE9EFBD76,0x2545BDE8, 0xFC65AF44,0x30CFAFDA,0xBE40A839,0x72EAA8A7,0x782FA1BE,0xB485A120,0x3A0AA6C3,0xF6A0A65D, 0xAA4DE78C,0x66E7E712,0xE868E0F1,0x24C2E06F,0x2E07E976,0xE2ADE9E8,0x6C22EE0B,0xA088EE95, 0x79A8FC39,0xB502FCA7,0x3B8DFB44,0xF727FBDA,0xFDE2F2C3,0x3148F25D,0xBFC7F5BE,0x736DF520, 0xD6F6D6A7,0x1A5CD639,0x94D3D1DA,0x5879D144,0x52BCD85D,0x9E16D8C3,0x1099DF20,0xDC33DFBE, 0x0513CD12,0xC9B9CD8C,0x4736CA6F,0x8B9CCAF1,0x8159C3E8,0x4DF3C376,0xC37CC495,0x0FD6C40B, 0x7AA64737,0xB60C47A9,0x3883404A,0xF42940D4,0xFEEC49CD,0x32464953,0xBCC94EB0,0x70634E2E, 0xA9435C82,0x65E95C1C,0xEB665BFF,0x27CC5B61,0x2D095278,0xE1A352E6,0x6F2C5505,0xA386559B, 0x061D761C,0xCAB77682,0x44387161,0x889271FF,0x825778E6,0x4EFD7878,0xC0727F9B,0x0CD87F05, 0xD5F86DA9,0x19526D37,0x97DD6AD4,0x5B776A4A,0x51B26353,0x9D1863CD,0x1397642E,0xDF3D64B0, 0x83D02561,0x4F7A25FF,0xC1F5221C,0x0D5F2282,0x079A2B9B,0xCB302B05,0x45BF2CE6,0x89152C78, 0x50353ED4,0x9C9F3E4A,0x121039A9,0xDEBA3937,0xD47F302E,0x18D530B0,0x965A3753,0x5AF037CD, 0xFF6B144A,0x33C114D4,0xBD4E1337,0x71E413A9,0x7B211AB0,0xB78B1A2E,0x39041DCD,0xF5AE1D53, 0x2C8E0FFF,0xE0240F61,0x6EAB0882,0xA201081C,0xA8C40105,0x646E019B,0xEAE10678,0x264B06E6, } }; /// compute CRC32 (Slicing-by-8 algorithm), unroll inner loop 4 times uint32_t crc32_slice_by_8(const void* data, size_t length, uint32_t previousCrc32) { uint32_t crc = ~previousCrc32; // same as previousCrc32 ^ 0xFFFFFFFF const uint32_t* current; const uint8_t* currentChar = (const uint8_t*) data; // enabling optimization (at least -O2) automatically unrolls the inner for-loop const size_t Unroll = 4; const size_t BytesAtOnce = 8 * Unroll; // wanted: 32 bit / 4 Byte alignment, compute leading, unaligned bytes length uintptr_t unaligned_length = (4 - (((uintptr_t) currentChar) & 3)) & 3; // process unaligned bytes, if any (standard algorithm) while ((length != 0) && (unaligned_length != 0)) { crc = (crc >> 8) ^ Crc32Lookup[0][(crc & 0xFF) ^ *currentChar++]; length--; unaligned_length--; } // pointer points to 32bit aligned address now current = (const uint32_t*) currentChar; // process 4x eight bytes at once (Slicing-by-8) while (length >= BytesAtOnce) { size_t unrolling; for (unrolling = 0; unrolling < Unroll; unrolling++) { #if BORG_BIG_ENDIAN uint32_t one = *current++ ^ _le32toh(crc); uint32_t two = *current++; crc = Crc32Lookup[0][ two & 0xFF] ^ Crc32Lookup[1][(two>> 8) & 0xFF] ^ Crc32Lookup[2][(two>>16) & 0xFF] ^ Crc32Lookup[3][(two>>24) & 0xFF] ^ Crc32Lookup[4][ one & 0xFF] ^ Crc32Lookup[5][(one>> 8) & 0xFF] ^ Crc32Lookup[6][(one>>16) & 0xFF] ^ Crc32Lookup[7][(one>>24) & 0xFF]; #else uint32_t one = *current++ ^ crc; uint32_t two = *current++; crc = Crc32Lookup[0][(two>>24) & 0xFF] ^ Crc32Lookup[1][(two>>16) & 0xFF] ^ Crc32Lookup[2][(two>> 8) & 0xFF] ^ Crc32Lookup[3][ two & 0xFF] ^ Crc32Lookup[4][(one>>24) & 0xFF] ^ Crc32Lookup[5][(one>>16) & 0xFF] ^ Crc32Lookup[6][(one>> 8) & 0xFF] ^ Crc32Lookup[7][ one & 0xFF]; #endif } length -= BytesAtOnce; } currentChar = (const uint8_t*) current; // remaining 1 to 31 bytes (standard algorithm) while (length-- != 0) crc = (crc >> 8) ^ Crc32Lookup[0][(crc & 0xFF) ^ *currentChar++]; return ~crc; // same as crc ^ 0xFFFFFFFF } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/archive.py0000644000076500000240000033302014641074756015742 0ustar00twstaffimport errno import json import os import socket import stat import sys import time from collections import OrderedDict from contextlib import contextmanager from datetime import timezone, timedelta from functools import partial from getpass import getuser from io import BytesIO from itertools import groupby, zip_longest from shutil import get_terminal_size from .platformflags import is_win32, is_linux, is_freebsd, is_darwin from .logger import create_logger logger = create_logger() from . import xattr from .chunker import get_chunker, Chunk from .cache import ChunkListEntry from .crypto.key import key_factory, UnsupportedPayloadError from .compress import Compressor, CompressionSpec from .constants import * # NOQA from .crypto.low_level import IntegrityError as IntegrityErrorBase from .helpers import BackupError, BackupRaceConditionError from .helpers import BackupOSError, BackupPermissionError, BackupFileNotFoundError, BackupIOError from .hashindex import ChunkIndex, ChunkIndexEntry, CacheSynchronizer from .helpers import Manifest from .helpers import hardlinkable from .helpers import ChunkIteratorFileWrapper, normalize_chunker_params, open_item from .helpers import Error, IntegrityError, set_ec from .platform import uid2user, user2uid, gid2group, group2gid from .helpers import parse_timestamp, to_localtime from .helpers import OutputTimestamp, format_timedelta, format_file_size, file_status, FileSize from .helpers import safe_encode, safe_decode, make_path_safe, remove_surrogates from .helpers import StableDict from .helpers import bin_to_hex from .helpers import safe_ns from .helpers import ellipsis_truncate, ProgressIndicatorPercent, log_multi from .helpers import os_open, flags_normal, flags_dir from .helpers import os_stat from .helpers import msgpack from .helpers import sig_int from .helpers import utcnow from .lrucache import LRUCache from .patterns import PathPrefixPattern, FnmatchPattern, IECommand from .item import Item, ArchiveItem, ItemDiff from .platform import acl_get, acl_set, set_flags, get_flags, swidth, hostname from .remote import cache_if_remote from .repository import Repository, LIST_SCAN_LIMIT has_link = hasattr(os, 'link') class Statistics: def __init__(self, output_json=False, iec=False): self.output_json = output_json self.iec = iec self.osize = self.csize = self.usize = self.nfiles = 0 self.osize_parts = self.csize_parts = self.usize_parts = self.nfiles_parts = 0 self.last_progress = 0 # timestamp when last progress was shown def update(self, size, csize, unique, part=False): if not part: self.osize += size self.csize += csize if unique: self.usize += csize else: self.osize_parts += size self.csize_parts += csize if unique: self.usize_parts += csize def __add__(self, other): if not isinstance(other, Statistics): raise TypeError('can only add Statistics objects') stats = Statistics(self.output_json, self.iec) stats.osize = self.osize + other.osize stats.csize = self.csize + other.csize stats.usize = self.usize + other.usize stats.nfiles = self.nfiles + other.nfiles stats.osize_parts = self.osize_parts + other.osize_parts stats.csize_parts = self.csize_parts + other.csize_parts stats.usize_parts = self.usize_parts + other.usize_parts stats.nfiles_parts = self.nfiles_parts + other.nfiles_parts return stats summary = "{label:15} {stats.osize_fmt:>20s} {stats.csize_fmt:>20s} {stats.usize_fmt:>20s}" def __str__(self): return self.summary.format(stats=self, label='This archive:') def __repr__(self): return "<{cls} object at {hash:#x} ({self.osize}, {self.csize}, {self.usize})>".format( cls=type(self).__name__, hash=id(self), self=self) def as_dict(self): return { 'original_size': FileSize(self.osize, iec=self.iec), 'compressed_size': FileSize(self.csize, iec=self.iec), 'deduplicated_size': FileSize(self.usize, iec=self.iec), 'nfiles': self.nfiles, } def as_raw_dict(self): return { 'size': self.osize, 'csize': self.csize, 'nfiles': self.nfiles, 'size_parts': self.osize_parts, 'csize_parts': self.csize_parts, 'nfiles_parts': self.nfiles_parts, } @classmethod def from_raw_dict(cls, **kw): self = cls() self.osize = kw['size'] self.csize = kw['csize'] self.nfiles = kw['nfiles'] self.osize_parts = kw['size_parts'] self.csize_parts = kw['csize_parts'] self.nfiles_parts = kw['nfiles_parts'] return self @property def osize_fmt(self): return format_file_size(self.osize, iec=self.iec) @property def usize_fmt(self): return format_file_size(self.usize, iec=self.iec) @property def csize_fmt(self): return format_file_size(self.csize, iec=self.iec) def show_progress(self, item=None, final=False, stream=None, dt=None): now = time.monotonic() if dt is None or now - self.last_progress > dt: self.last_progress = now if self.output_json: if not final: data = self.as_dict() data['path'] = remove_surrogates(item.path if item else '') else: data = {} data.update({ 'time': time.time(), 'type': 'archive_progress', 'finished': final, }) msg = json.dumps(data) end = '\n' else: columns, lines = get_terminal_size() if not final: msg = '{0.osize_fmt} O {0.csize_fmt} C {0.usize_fmt} D {0.nfiles} N '.format(self) path = remove_surrogates(item.path) if item else '' space = columns - swidth(msg) if space < 12: msg = '' space = columns - swidth(msg) if space >= 8: msg += ellipsis_truncate(path, space) else: msg = ' ' * columns end = '\r' print(msg, end=end, file=stream or sys.stderr, flush=True) def is_special(mode): # file types that get special treatment in --read-special mode return stat.S_ISBLK(mode) or stat.S_ISCHR(mode) or stat.S_ISFIFO(mode) class BackupIO: op = '' def __call__(self, op=''): self.op = op return self def __enter__(self): pass def __exit__(self, exc_type, exc_val, exc_tb): if exc_type and issubclass(exc_type, OSError): E_MAP = { errno.EPERM: BackupPermissionError, errno.EACCES: BackupPermissionError, errno.EBUSY: BackupPermissionError, errno.ENOENT: BackupFileNotFoundError, errno.EIO: BackupIOError, } e_cls = E_MAP.get(exc_val.errno, BackupOSError) raise e_cls(self.op, exc_val) from exc_val backup_io = BackupIO() def backup_io_iter(iterator): backup_io.op = 'read' while True: with backup_io: try: item = next(iterator) except StopIteration: return yield item def stat_update_check(st_old, st_curr): """ this checks for some race conditions between the first filename-based stat() we did before dispatching to the (hopefully correct) file type backup handler and the (hopefully) fd-based fstat() we did in the handler. if there is a problematic difference (e.g. file type changed), we rather skip the file than being tricked into a security problem. such races should only happen if: - we are backing up a live filesystem (no snapshot, not inactive) - if files change due to normal fs activity at an unfortunate time - if somebody is doing an attack against us """ # assuming that a file type change implicates a different inode change AND that inode numbers # are not duplicate in a short timeframe, this check is redundant and solved by the ino check: if stat.S_IFMT(st_old.st_mode) != stat.S_IFMT(st_curr.st_mode): # in this case, we dispatched to wrong handler - abort raise BackupRaceConditionError('file type changed (race condition), skipping file') if st_old.st_ino != st_curr.st_ino: # in this case, the hardlinks-related code in create_helper has the wrong inode - abort! raise BackupRaceConditionError('file inode changed (race condition), skipping file') # looks ok, we are still dealing with the same thing - return current stat: return st_curr @contextmanager def OsOpen(*, flags, path=None, parent_fd=None, name=None, noatime=False, op='open'): with backup_io(op): fd = os_open(path=path, parent_fd=parent_fd, name=name, flags=flags, noatime=noatime) try: yield fd finally: # On windows fd is None for directories. if fd is not None: os.close(fd) class DownloadPipeline: def __init__(self, repository, key): self.repository = repository self.key = key def unpack_many(self, ids, filter=None, partial_extract=False, preload=False, hardlink_masters=None): """ Return iterator of items. *ids* is a chunk ID list of an item stream. *filter* is a callable to decide whether an item will be yielded. *preload* preloads the data chunks of every yielded item. Warning: if *preload* is True then all data chunks of every yielded item have to be retrieved, otherwise preloaded chunks will accumulate in RemoteRepository and create a memory leak. """ def _preload(chunks): self.repository.preload([c.id for c in chunks]) masters_preloaded = set() unpacker = msgpack.Unpacker(use_list=False) for data in self.fetch_many(ids): unpacker.feed(data) items = [Item(internal_dict=item) for item in unpacker] for item in items: if 'chunks' in item: item.chunks = [ChunkListEntry(*e) for e in item.chunks] if filter: items = [item for item in items if filter(item)] if preload: if filter and partial_extract: # if we do only a partial extraction, it gets a bit # complicated with computing the preload items: if a hardlink master item is not # selected (== not extracted), we will still need to preload its chunks if a # corresponding hardlink slave is selected (== is extracted). # due to a side effect of the filter() call, we now have hardlink_masters dict populated. for item in items: if hardlinkable(item.mode): source = item.get('source') if source is None: # maybe a hardlink master if 'chunks' in item: _preload(item.chunks) # if this is a hl master, remember that we already preloaded all chunks of it (if any): if item.get('hardlink_master', True): masters_preloaded.add(item.path) else: # hardlink slave if source not in masters_preloaded: # we only need to preload *once* (for the 1st selected slave) chunks, _ = hardlink_masters[source] if chunks is not None: _preload(chunks) masters_preloaded.add(source) else: # easy: we do not have a filter, thus all items are selected, thus we need to preload all chunks. for item in items: if 'chunks' in item: _preload(item.chunks) for item in items: yield item def fetch_many(self, ids, is_preloaded=False): for id_, data in zip(ids, self.repository.get_many(ids, is_preloaded=is_preloaded)): yield self.key.decrypt(id_, data) class ChunkBuffer: BUFFER_SIZE = 8 * 1024 * 1024 def __init__(self, key, chunker_params=ITEMS_CHUNKER_PARAMS): self.buffer = BytesIO() self.packer = msgpack.Packer() self.chunks = [] self.key = key self.chunker = get_chunker(*chunker_params, seed=self.key.chunk_seed, sparse=False) def add(self, item): self.buffer.write(self.packer.pack(item.as_dict())) if self.is_full(): self.flush() def write_chunk(self, chunk): raise NotImplementedError def flush(self, flush=False): if self.buffer.tell() == 0: return self.buffer.seek(0) # The chunker returns a memoryview to its internal buffer, # thus a copy is needed before resuming the chunker iterator. # the metadata stream may produce all-zero chunks, so deal # with CH_ALLOC (and CH_HOLE, for completeness) here. chunks = [] for chunk in self.chunker.chunkify(self.buffer): alloc = chunk.meta['allocation'] if alloc == CH_DATA: data = bytes(chunk.data) elif alloc in (CH_ALLOC, CH_HOLE): data = zeros[:chunk.meta['size']] else: raise ValueError("chunk allocation has unsupported value of %r" % alloc) chunks.append(data) self.buffer.seek(0) self.buffer.truncate(0) # Leave the last partial chunk in the buffer unless flush is True end = None if flush or len(chunks) == 1 else -1 for chunk in chunks[:end]: self.chunks.append(self.write_chunk(chunk)) if end == -1: self.buffer.write(chunks[-1]) def is_full(self): return self.buffer.tell() > self.BUFFER_SIZE class CacheChunkBuffer(ChunkBuffer): def __init__(self, cache, key, stats, chunker_params=ITEMS_CHUNKER_PARAMS): super().__init__(key, chunker_params) self.cache = cache self.stats = stats def write_chunk(self, chunk): id_, _, _ = self.cache.add_chunk(self.key.id_hash(chunk), chunk, self.stats, wait=False) self.cache.repository.async_response(wait=False) return id_ def get_item_uid_gid(item, *, numeric, uid_forced=None, gid_forced=None, uid_default=0, gid_default=0): if uid_forced is not None: uid = uid_forced else: uid = None if numeric else user2uid(item.user) uid = item.uid if uid is None else uid if uid < 0: uid = uid_default if gid_forced is not None: gid = gid_forced else: gid = None if numeric else group2gid(item.group) gid = item.gid if gid is None else gid if gid < 0: gid = gid_default return uid, gid class Archive: class AlreadyExists(Error): """Archive {} already exists""" exit_mcode = 30 class DoesNotExist(Error): """Archive {} does not exist""" exit_mcode = 31 class IncompatibleFilesystemEncodingError(Error): """Failed to encode filename "{}" into file system encoding "{}". Consider configuring the LANG environment variable.""" exit_mcode = 32 def __init__(self, repository, key, manifest, name, cache=None, create=False, checkpoint_interval=1800, numeric_ids=False, noatime=False, noctime=False, noflags=False, noacls=False, noxattrs=False, progress=False, chunker_params=CHUNKER_PARAMS, start=None, start_monotonic=None, end=None, consider_part_files=False, log_json=False, iec=False): self.cwd = os.getcwd() self.key = key self.repository = repository self.cache = cache self.manifest = manifest self.hard_links = {} self.stats = Statistics(output_json=log_json, iec=iec) self.iec = iec self.show_progress = progress self.name = name # overwritten later with name from archive metadata self.name_in_manifest = name # can differ from .name later (if borg check fixed duplicate archive names) self.comment = None self.tam_verified = False self.checkpoint_interval = checkpoint_interval self.numeric_ids = numeric_ids self.noatime = noatime self.noctime = noctime self.noflags = noflags self.noacls = noacls self.noxattrs = noxattrs assert (start is None) == (start_monotonic is None), 'Logic error: if start is given, start_monotonic must be given as well and vice versa.' if start is None: start = utcnow() start_monotonic = time.monotonic() self.chunker_params = chunker_params self.start = start self.start_monotonic = start_monotonic if end is None: end = utcnow() self.end = end self.consider_part_files = consider_part_files self.pipeline = DownloadPipeline(self.repository, self.key) self.create = create if self.create: self.items_buffer = CacheChunkBuffer(self.cache, self.key, self.stats) if name in manifest.archives: raise self.AlreadyExists(name) i = 0 while True: self.checkpoint_name = '{}.checkpoint{}'.format(name, i and ('.%d' % i) or '') if self.checkpoint_name not in manifest.archives: break i += 1 else: info = self.manifest.archives.get(name) if info is None: raise self.DoesNotExist(name) self.load(info.id) def _load_meta(self, id): data = self.key.decrypt(id, self.repository.get(id)) # we do not require TAM for archives, otherwise we can not even borg list a repo with old archives. archive, self.tam_verified, _ = self.key.unpack_and_verify_archive(data, force_tam_not_required=True) metadata = ArchiveItem(internal_dict=archive) if metadata.version != 1: raise Exception('Unknown archive metadata version') return metadata def load(self, id): self.id = id self.metadata = self._load_meta(self.id) self.metadata.cmdline = [safe_decode(arg) for arg in self.metadata.cmdline] self.name = self.metadata.name self.comment = self.metadata.get('comment', '') @property def ts(self): """Timestamp of archive creation (start) in UTC""" ts = self.metadata.time return parse_timestamp(ts) @property def ts_end(self): """Timestamp of archive creation (end) in UTC""" # fall back to time if there is no time_end present in metadata ts = self.metadata.get('time_end') or self.metadata.time return parse_timestamp(ts) @property def fpr(self): return bin_to_hex(self.id) @property def duration(self): return format_timedelta(self.end - self.start) @property def duration_from_meta(self): return format_timedelta(self.ts_end - self.ts) def info(self): if self.create: stats = self.stats start = self.start.replace(tzinfo=timezone.utc) end = self.end.replace(tzinfo=timezone.utc) else: stats = self.calc_stats(self.cache) start = self.ts end = self.ts_end info = { 'name': self.name, 'id': self.fpr, 'start': OutputTimestamp(start), 'end': OutputTimestamp(end), 'duration': (end - start).total_seconds(), 'stats': stats.as_dict(), 'limits': { 'max_archive_size': self.cache.chunks[self.id].csize / MAX_DATA_SIZE, }, } if self.create: info['command_line'] = sys.argv else: cp = self.metadata.get('chunker_params') cp = normalize_chunker_params(cp) if cp is not None else '' info.update({ 'command_line': self.metadata.cmdline, 'hostname': self.metadata.hostname, 'username': self.metadata.username, 'comment': self.metadata.get('comment', ''), 'chunker_params': cp, }) return info def __str__(self): return '''\ Repository: {location} Archive name: {0.name} Archive fingerprint: {0.fpr} Time (start): {start} Time (end): {end} Duration: {0.duration} Number of files: {0.stats.nfiles} Utilization of max. archive size: {csize_max:.0%} '''.format( self, start=OutputTimestamp(self.start.replace(tzinfo=timezone.utc)), end=OutputTimestamp(self.end.replace(tzinfo=timezone.utc)), csize_max=self.cache.chunks[self.id].csize / MAX_DATA_SIZE, location=self.repository._location.canonical_path() ) def __repr__(self): return 'Archive(%r)' % self.name def item_filter(self, item, filter=None): if not self.consider_part_files and 'part' in item: # this is a part(ial) file, we usually don't want to consider it. return False return filter(item) if filter else True def iter_items(self, filter=None, partial_extract=False, preload=False, hardlink_masters=None): # note: when calling this with preload=True, later fetch_many() must be called with # is_preloaded=True or the RemoteRepository code will leak memory! assert not (filter and partial_extract and preload) or hardlink_masters is not None for item in self.pipeline.unpack_many(self.metadata.items, partial_extract=partial_extract, preload=preload, hardlink_masters=hardlink_masters, filter=lambda item: self.item_filter(item, filter)): yield item def add_item(self, item, show_progress=True, stats=None): if show_progress and self.show_progress: if stats is None: stats = self.stats stats.show_progress(item=item, dt=0.2) self.items_buffer.add(item) def write_checkpoint(self): self.save(self.checkpoint_name) del self.manifest.archives[self.checkpoint_name] self.cache.chunk_decref(self.id, self.stats) def save(self, name=None, comment=None, timestamp=None, stats=None, additional_metadata=None): name = name or self.name if name in self.manifest.archives: raise self.AlreadyExists(name) self.items_buffer.flush(flush=True) duration = timedelta(seconds=time.monotonic() - self.start_monotonic) if timestamp is None: end = utcnow() start = end - duration else: end = timestamp + duration start = timestamp self.start = start self.end = end metadata = { 'version': 1, 'name': name, 'comment': comment or '', 'items': self.items_buffer.chunks, 'cmdline': sys.argv, 'hostname': hostname, 'username': getuser(), 'time': start.strftime(ISO_FORMAT), 'time_end': end.strftime(ISO_FORMAT), 'chunker_params': self.chunker_params, } # we always want to create archives with the addtl. metadata (nfiles, etc.), # because borg info relies on them. so, either use the given stats (from args) # or fall back to self.stats if it was not given. stats = stats or self.stats metadata.update({ 'size': stats.osize, 'csize': stats.csize, 'nfiles': stats.nfiles, 'size_parts': stats.osize_parts, 'csize_parts': stats.csize_parts, 'nfiles_parts': stats.nfiles_parts}) metadata.update(additional_metadata or {}) metadata = ArchiveItem(metadata) data = self.key.pack_and_authenticate_metadata(metadata.as_dict(), context=b'archive') self.id = self.key.id_hash(data) try: self.cache.add_chunk(self.id, data, self.stats) except IntegrityError as err: err_msg = str(err) # hack to avoid changing the RPC protocol by introducing new (more specific) exception class if 'More than allowed put data' in err_msg: raise Error('%s - archive too big (issue #1473)!' % err_msg) else: raise while self.repository.async_response(wait=True) is not None: pass self.manifest.archives[name] = (self.id, metadata.time) self.manifest.write() self.repository.commit(compact=False) self.cache.commit() def calc_stats(self, cache, want_unique=True): # caching wrapper around _calc_stats which is rather slow for archives made with borg < 1.2 have_borg12_meta = self.metadata.get('nfiles') is not None try: if want_unique: # usize is neither contained in the borg 1.2 archive metadata nor in the # pre12_meta cache entry representing the same information for 1.1 archives. # usize is not a static property of an archive, but must get dynamically calculated, # thus we must trigger a call to self._calc_stats() to get it. raise KeyError stats = Statistics.from_raw_dict(**cache.pre12_meta[self.fpr]) except KeyError: # not in pre12_meta cache stats = self._calc_stats(cache, want_unique=want_unique) if not have_borg12_meta: cache.pre12_meta[self.fpr] = stats.as_raw_dict() return stats def _calc_stats(self, cache, want_unique=True): have_borg12_meta = self.metadata.get('nfiles') is not None if have_borg12_meta and not want_unique: unique_csize = 0 else: def add(id): entry = cache.chunks[id] archive_index.add(id, 1, entry.size, entry.csize) archive_index = ChunkIndex() sync = CacheSynchronizer(archive_index) add(self.id) # we must escape any % char in the archive name, because we use it in a format string, see #6500 arch_name_escd = self.name.replace('%', '%%') pi = ProgressIndicatorPercent(total=len(self.metadata.items), msg='Calculating statistics for archive %s ... %%3.0f%%%%' % arch_name_escd, msgid='archive.calc_stats') for id, chunk in zip(self.metadata.items, self.repository.get_many(self.metadata.items)): pi.show(increase=1) add(id) data = self.key.decrypt(id, chunk) sync.feed(data) unique_csize = archive_index.stats_against(cache.chunks)[3] pi.finish() stats = Statistics(iec=self.iec) stats.usize = unique_csize # the part files use same chunks as the full file if not have_borg12_meta: if self.consider_part_files: stats.nfiles = sync.num_files_totals stats.osize = sync.size_totals stats.csize = sync.csize_totals else: stats.nfiles = sync.num_files_totals - sync.num_files_parts stats.osize = sync.size_totals - sync.size_parts stats.csize = sync.csize_totals - sync.csize_parts else: if self.consider_part_files: stats.nfiles = self.metadata.nfiles_parts + self.metadata.nfiles stats.osize = self.metadata.size_parts + self.metadata.size stats.csize = self.metadata.csize_parts + self.metadata.csize else: stats.nfiles = self.metadata.nfiles stats.osize = self.metadata.size stats.csize = self.metadata.csize return stats @contextmanager def extract_helper(self, dest, item, path, stripped_components, original_path, hardlink_masters): hardlink_set = False # Hard link? if 'source' in item: source = os.path.join(dest, *item.source.split(os.sep)[stripped_components:]) chunks, link_target = hardlink_masters.get(item.source, (None, source)) if link_target and has_link: # Hard link was extracted previously, just link with backup_io('link'): os.link(link_target, path) hardlink_set = True elif chunks is not None: # assign chunks to this item, since the item which had the chunks was not extracted item.chunks = chunks yield hardlink_set if not hardlink_set and hardlink_masters: if has_link: # Update master entry with extracted item path, so that following hardlinks don't extract twice. # We have hardlinking support, so we will hardlink not extract. hardlink_masters[item.get('source') or original_path] = (None, path) else: # Broken platform with no hardlinking support. # In this case, we *want* to extract twice, because there is no other way. pass def extract_item(self, item, restore_attrs=True, dry_run=False, stdout=False, sparse=False, hardlink_masters=None, stripped_components=0, original_path=None, pi=None): """ Extract archive item. :param item: the item to extract :param restore_attrs: restore file attributes :param dry_run: do not write any data :param stdout: write extracted data to stdout :param sparse: write sparse files (chunk-granularity, independent of the original being sparse) :param hardlink_masters: maps paths to (chunks, link_target) for extracting subtrees with hardlinks correctly :param stripped_components: stripped leading path components to correct hard link extraction :param original_path: 'path' key as stored in archive :param pi: ProgressIndicatorPercent (or similar) for file extraction progress (in bytes) """ hardlink_masters = hardlink_masters or {} has_damaged_chunks = 'chunks_healthy' in item if dry_run or stdout: if 'chunks' in item: item_chunks_size = 0 for data in self.pipeline.fetch_many([c.id for c in item.chunks], is_preloaded=True): if pi: pi.show(increase=len(data), info=[remove_surrogates(item.path)]) if stdout: sys.stdout.buffer.write(data) item_chunks_size += len(data) if stdout: sys.stdout.buffer.flush() if 'size' in item: item_size = item.size if item_size != item_chunks_size: raise BackupError('Size inconsistency detected: size {}, chunks size {}'.format( item_size, item_chunks_size)) if has_damaged_chunks: raise BackupError('File has damaged (all-zero) chunks. Try running borg check --repair.') return original_path = original_path or item.path dest = self.cwd if item.path.startswith(('/', '../')): raise Exception('Path should be relative and local') path = os.path.join(dest, item.path) # Attempt to remove existing files, ignore errors on failure try: st = os.stat(path, follow_symlinks=False) if stat.S_ISDIR(st.st_mode): os.rmdir(path) else: os.unlink(path) except UnicodeEncodeError: raise self.IncompatibleFilesystemEncodingError(path, sys.getfilesystemencoding()) from None except OSError: pass def make_parent(path): parent_dir = os.path.dirname(path) if not os.path.exists(parent_dir): os.makedirs(parent_dir) mode = item.mode if stat.S_ISREG(mode): with backup_io('makedirs'): make_parent(path) with self.extract_helper(dest, item, path, stripped_components, original_path, hardlink_masters) as hardlink_set: if hardlink_set: return with backup_io('open'): fd = open(path, 'wb') with fd: ids = [c.id for c in item.chunks] for data in self.pipeline.fetch_many(ids, is_preloaded=True): if pi: pi.show(increase=len(data), info=[remove_surrogates(item.path)]) with backup_io('write'): if sparse and zeros.startswith(data): # all-zero chunk: create a hole in a sparse file fd.seek(len(data), 1) else: fd.write(data) with backup_io('truncate_and_attrs'): pos = item_chunks_size = fd.tell() fd.truncate(pos) fd.flush() self.restore_attrs(path, item, fd=fd.fileno()) if 'size' in item: item_size = item.size if item_size != item_chunks_size: raise BackupError('Size inconsistency detected: size {}, chunks size {}'.format( item_size, item_chunks_size)) if has_damaged_chunks: raise BackupError('File has damaged (all-zero) chunks. Try running borg check --repair.') return with backup_io: # No repository access beyond this point. if stat.S_ISDIR(mode): make_parent(path) if not os.path.exists(path): os.mkdir(path) if restore_attrs: self.restore_attrs(path, item) elif stat.S_ISLNK(mode): make_parent(path) source = item.source try: os.symlink(source, path) except UnicodeEncodeError: raise self.IncompatibleFilesystemEncodingError(source, sys.getfilesystemencoding()) from None self.restore_attrs(path, item, symlink=True) elif stat.S_ISFIFO(mode): make_parent(path) with self.extract_helper(dest, item, path, stripped_components, original_path, hardlink_masters) as hardlink_set: if hardlink_set: return os.mkfifo(path) self.restore_attrs(path, item) elif stat.S_ISCHR(mode) or stat.S_ISBLK(mode): make_parent(path) with self.extract_helper(dest, item, path, stripped_components, original_path, hardlink_masters) as hardlink_set: if hardlink_set: return os.mknod(path, item.mode, item.rdev) self.restore_attrs(path, item) else: raise Exception('Unknown archive item type %r' % item.mode) def restore_attrs(self, path, item, symlink=False, fd=None): """ Restore filesystem attributes on *path* (*fd*) from *item*. Does not access the repository. """ backup_io.op = 'attrs' uid, gid = get_item_uid_gid(item, numeric=self.numeric_ids) # This code is a bit of a mess due to os specific differences if not is_win32: try: if fd: os.fchown(fd, uid, gid) else: os.chown(path, uid, gid, follow_symlinks=False) except OSError: pass if fd: os.fchmod(fd, item.mode) else: # To check whether a particular function in the os module accepts False for its # follow_symlinks parameter, the in operator on supports_follow_symlinks should be # used. However, os.chmod is special as some platforms without a working lchmod() do # have fchmodat(), which has a flag that makes it behave like lchmod(). fchmodat() # is ignored when deciding whether or not os.chmod should be set in # os.supports_follow_symlinks. Work around this by using try/except. try: os.chmod(path, item.mode, follow_symlinks=False) except NotImplementedError: if not symlink: os.chmod(path, item.mode) if not self.noacls: try: acl_set(path, item, self.numeric_ids, fd=fd) except OSError as e: if e.errno not in (errno.ENOTSUP, ): raise if not self.noxattrs: # chown removes Linux capabilities, so set the extended attributes at the end, after chown, since they include # the Linux capabilities in the "security.capability" attribute. warning = xattr.set_all(fd or path, item.get('xattrs', {}), follow_symlinks=False) if warning: set_ec(EXIT_WARNING) # set timestamps rather late mtime = item.mtime if 'atime' in item: atime = item.atime else: # old archives only had mtime in item metadata atime = mtime if 'birthtime' in item: birthtime = item.birthtime try: # This should work on FreeBSD, NetBSD, and Darwin and be harmless on other platforms. # See utimes(2) on either of the BSDs for details. if fd: os.utime(fd, None, ns=(atime, birthtime)) else: os.utime(path, None, ns=(atime, birthtime), follow_symlinks=False) except OSError: # some systems don't support calling utime on a symlink pass try: if fd: os.utime(fd, None, ns=(atime, mtime)) else: os.utime(path, None, ns=(atime, mtime), follow_symlinks=False) except OSError: # some systems don't support calling utime on a symlink pass # bsdflags include the immutable flag and need to be set last: if not self.noflags and 'bsdflags' in item: try: set_flags(path, item.bsdflags, fd=fd) except OSError: pass def set_meta(self, key, value): metadata = self._load_meta(self.id) setattr(metadata, key, value) data = self.key.pack_and_authenticate_metadata(metadata.as_dict(), context=b'archive') new_id = self.key.id_hash(data) self.cache.add_chunk(new_id, data, self.stats) self.manifest.archives[self.name] = (new_id, metadata.time) self.cache.chunk_decref(self.id, self.stats) self.id = new_id def rename(self, name): if name in self.manifest.archives: raise self.AlreadyExists(name) oldname = self.name self.name = name self.set_meta('name', name) del self.manifest.archives[oldname] def delete(self, stats, progress=False, forced=False): class ChunksIndexError(Error): """Chunk ID {} missing from chunks index, corrupted chunks index - aborting transaction.""" exception_ignored = object() def fetch_async_response(wait=True): try: return self.repository.async_response(wait=wait) except Repository.ObjectNotFound: nonlocal error # object not in repo - strange, but we wanted to delete it anyway. if forced == 0: raise error = True return exception_ignored # must not return None here def chunk_decref(id, stats, part=False): try: self.cache.chunk_decref(id, stats, wait=False, part=part) except KeyError: cid = bin_to_hex(id) raise ChunksIndexError(cid) else: fetch_async_response(wait=False) error = False try: unpacker = msgpack.Unpacker(use_list=False) items_ids = self.metadata.items pi = ProgressIndicatorPercent(total=len(items_ids), msg="Decrementing references %3.0f%%", msgid='archive.delete') for (i, (items_id, data)) in enumerate(zip(items_ids, self.repository.get_many(items_ids))): if progress: pi.show(i) data = self.key.decrypt(items_id, data) unpacker.feed(data) chunk_decref(items_id, stats) try: for item in unpacker: item = Item(internal_dict=item) if 'chunks' in item: part = not self.consider_part_files and 'part' in item for chunk_id, size, csize in item.chunks: chunk_decref(chunk_id, stats, part=part) except (TypeError, ValueError): # if items metadata spans multiple chunks and one chunk got dropped somehow, # it could be that unpacker yields bad types if forced == 0: raise error = True if progress: pi.finish() except (msgpack.UnpackException, Repository.ObjectNotFound): # items metadata corrupted if forced == 0: raise error = True # in forced delete mode, we try hard to delete at least the manifest entry, # if possible also the archive superblock, even if processing the items raises # some harmless exception. chunk_decref(self.id, stats) del self.manifest.archives[self.name] while fetch_async_response(wait=True) is not None: # we did async deletes, process outstanding results (== exceptions), # so there is nothing pending when we return and our caller wants to commit. pass if error: logger.warning('forced deletion succeeded, but the deleted archive was corrupted.') logger.warning('borg check --repair is required to free all space.') @staticmethod def compare_archives_iter(archive1, archive2, matcher=None, can_compare_chunk_ids=False, content_only=False): """ Yields tuples with a path and an ItemDiff instance describing changes/indicating equality. :param matcher: PatternMatcher class to restrict results to only matching paths. :param can_compare_chunk_ids: Whether --chunker-params are the same for both archives. """ def hardlink_master_seen(item): return 'source' not in item or not hardlinkable(item.mode) or item.source in hardlink_masters def is_hardlink_master(item): return item.get('hardlink_master', True) and 'source' not in item and hardlinkable(item.mode) def update_hardlink_masters(item1, item2): if is_hardlink_master(item1) or is_hardlink_master(item2): hardlink_masters[item1.path] = (item1, item2) def has_hardlink_master(item, hardlink_masters): return hardlinkable(item.mode) and item.get('source') in hardlink_masters def compare_items(item1, item2): if has_hardlink_master(item1, hardlink_masters): item1 = hardlink_masters[item1.source][0] if has_hardlink_master(item2, hardlink_masters): item2 = hardlink_masters[item2.source][1] return ItemDiff(item1, item2, archive1.pipeline.fetch_many([c.id for c in item1.get('chunks', [])]), archive2.pipeline.fetch_many([c.id for c in item2.get('chunks', [])]), can_compare_chunk_ids=can_compare_chunk_ids, content_only=content_only) def defer_if_necessary(item1, item2): """Adds item tuple to deferred if necessary and returns True, if items were deferred""" update_hardlink_masters(item1, item2) defer = not hardlink_master_seen(item1) or not hardlink_master_seen(item2) if defer: deferred.append((item1, item2)) return defer orphans_archive1 = OrderedDict() orphans_archive2 = OrderedDict() deferred = [] hardlink_masters = {} for item1, item2 in zip_longest( archive1.iter_items(lambda item: matcher.match(item.path)), archive2.iter_items(lambda item: matcher.match(item.path)), ): if item1 and item2 and item1.path == item2.path: if not defer_if_necessary(item1, item2): yield (item1.path, compare_items(item1, item2)) continue if item1: matching_orphan = orphans_archive2.pop(item1.path, None) if matching_orphan: if not defer_if_necessary(item1, matching_orphan): yield (item1.path, compare_items(item1, matching_orphan)) else: orphans_archive1[item1.path] = item1 if item2: matching_orphan = orphans_archive1.pop(item2.path, None) if matching_orphan: if not defer_if_necessary(matching_orphan, item2): yield (matching_orphan.path, compare_items(matching_orphan, item2)) else: orphans_archive2[item2.path] = item2 # At this point orphans_* contain items that had no matching partner in the other archive for added in orphans_archive2.values(): path = added.path deleted_item = Item.create_deleted(path) update_hardlink_masters(deleted_item, added) yield (path, compare_items(deleted_item, added)) for deleted in orphans_archive1.values(): path = deleted.path deleted_item = Item.create_deleted(path) update_hardlink_masters(deleted, deleted_item) yield (path, compare_items(deleted, deleted_item)) for item1, item2 in deferred: assert hardlink_master_seen(item1) assert hardlink_master_seen(item2) assert item1.path == item2.path, "Deferred items have different paths" yield (item1.path, compare_items(item1, item2)) class MetadataCollector: def __init__(self, *, noatime, noctime, nobirthtime, numeric_ids, noflags, noacls, noxattrs): self.noatime = noatime self.noctime = noctime self.numeric_ids = numeric_ids self.noflags = noflags self.noacls = noacls self.noxattrs = noxattrs self.nobirthtime = nobirthtime def stat_simple_attrs(self, st): attrs = dict( mode=st.st_mode, uid=st.st_uid, gid=st.st_gid, mtime=safe_ns(st.st_mtime_ns), ) # borg can work with archives only having mtime (older attic archives do not have # atime/ctime). it can be useful to omit atime/ctime, if they change without the # file content changing - e.g. to get better metadata deduplication. if not self.noatime: attrs['atime'] = safe_ns(st.st_atime_ns) if not self.noctime: attrs['ctime'] = safe_ns(st.st_ctime_ns) if not self.nobirthtime and hasattr(st, 'st_birthtime'): # sadly, there's no stat_result.st_birthtime_ns attrs['birthtime'] = safe_ns(int(st.st_birthtime * 10**9)) if self.numeric_ids: attrs['user'] = attrs['group'] = None else: attrs['user'] = uid2user(st.st_uid) attrs['group'] = gid2group(st.st_gid) return attrs def stat_ext_attrs(self, st, path, fd=None): attrs = {} if not self.noflags: with backup_io('extended stat (flags)'): flags = get_flags(path, st, fd=fd) if flags: attrs['bsdflags'] = flags if not self.noxattrs: with backup_io('extended stat (xattrs)'): xattrs = xattr.get_all(fd or path, follow_symlinks=False) if xattrs: attrs['xattrs'] = StableDict(xattrs) if not self.noacls: with backup_io('extended stat (ACLs)'): try: acl_get(path, attrs, st, self.numeric_ids, fd=fd) except OSError as e: if e.errno not in (errno.ENOTSUP, ): raise return attrs def stat_attrs(self, st, path, fd=None): attrs = self.stat_simple_attrs(st) attrs.update(self.stat_ext_attrs(st, path, fd=fd)) return attrs # remember a few recently used all-zero chunk hashes in this mapping. # (hash_func, chunk_length) -> chunk_hash # we play safe and have the hash_func in the mapping key, in case we # have different hash_funcs within the same borg run. zero_chunk_ids = LRUCache(10, dispose=lambda _: None) def cached_hash(chunk, id_hash): allocation = chunk.meta['allocation'] if allocation == CH_DATA: data = chunk.data chunk_id = id_hash(data) elif allocation in (CH_HOLE, CH_ALLOC): size = chunk.meta['size'] assert size <= len(zeros) data = memoryview(zeros)[:size] try: chunk_id = zero_chunk_ids[(id_hash, size)] except KeyError: chunk_id = id_hash(data) zero_chunk_ids[(id_hash, size)] = chunk_id else: raise ValueError('unexpected allocation type') return chunk_id, data class ChunksProcessor: # Processes an iterator of chunks for an Item def __init__(self, *, key, cache, add_item, write_checkpoint, checkpoint_interval, rechunkify): self.key = key self.cache = cache self.add_item = add_item self.write_checkpoint = write_checkpoint self.checkpoint_interval = checkpoint_interval self.last_checkpoint = time.monotonic() self.rechunkify = rechunkify def write_part_file(self, item, from_chunk, number): item = Item(internal_dict=item.as_dict()) length = len(item.chunks) # the item should only have the *additional* chunks we processed after the last partial item: item.chunks = item.chunks[from_chunk:] # for borg recreate, we already have a size member in the source item (giving the total file size), # but we consider only a part of the file here, thus we must recompute the size from the chunks: item.get_size(memorize=True, from_chunks=True) item.path += '.borg_part_%d' % number item.part = number number += 1 self.add_item(item, show_progress=False) self.write_checkpoint() return length, number def maybe_checkpoint(self, item, from_chunk, part_number, forced=False): sig_int_triggered = sig_int and sig_int.action_triggered() if forced or sig_int_triggered or \ self.checkpoint_interval and time.monotonic() - self.last_checkpoint > self.checkpoint_interval: if sig_int_triggered: logger.info('checkpoint requested: starting checkpoint creation...') from_chunk, part_number = self.write_part_file(item, from_chunk, part_number) self.last_checkpoint = time.monotonic() if sig_int_triggered: sig_int.action_completed() logger.info('checkpoint requested: finished checkpoint creation!') return from_chunk, part_number def process_file_chunks(self, item, cache, stats, show_progress, chunk_iter, chunk_processor=None): if not chunk_processor: def chunk_processor(chunk): chunk_id, data = cached_hash(chunk, self.key.id_hash) chunk_entry = cache.add_chunk(chunk_id, data, stats, wait=False) self.cache.repository.async_response(wait=False) return chunk_entry item.chunks = [] # if we rechunkify, we'll get a fundamentally different chunks list, thus we need # to get rid of .chunks_healthy, as it might not correspond to .chunks any more. if self.rechunkify and 'chunks_healthy' in item: del item.chunks_healthy from_chunk = 0 part_number = 1 for chunk in chunk_iter: item.chunks.append(chunk_processor(chunk)) if show_progress: stats.show_progress(item=item, dt=0.2) from_chunk, part_number = self.maybe_checkpoint(item, from_chunk, part_number, forced=False) else: if part_number > 1: if item.chunks[from_chunk:]: # if we already have created a part item inside this file, we want to put the final # chunks (if any) into a part item also (so all parts can be concatenated to get # the complete file): from_chunk, part_number = self.maybe_checkpoint(item, from_chunk, part_number, forced=True) # if we created part files, we have referenced all chunks from the part files, # but we also will reference the same chunks also from the final, complete file: for chunk in item.chunks: cache.chunk_incref(chunk.id, stats, size=chunk.size, part=True) stats.nfiles_parts += part_number - 1 class FilesystemObjectProcessors: # When ported to threading, then this doesn't need chunker, cache, key any more. # write_checkpoint should then be in the item buffer, # and process_file becomes a callback passed to __init__. def __init__(self, *, metadata_collector, cache, key, add_item, process_file_chunks, chunker_params, show_progress, sparse, log_json, iec, file_status_printer=None): self.metadata_collector = metadata_collector self.cache = cache self.key = key self.add_item = add_item self.process_file_chunks = process_file_chunks self.show_progress = show_progress self.print_file_status = file_status_printer or (lambda *args: None) self.hard_links = {} self.stats = Statistics(output_json=log_json, iec=iec) # threading: done by cache (including progress) self.cwd = os.getcwd() self.chunker = get_chunker(*chunker_params, seed=key.chunk_seed, sparse=sparse) @contextmanager def create_helper(self, path, st, status=None, hardlinkable=True, strip_prefix=None): if strip_prefix is not None: assert not path.endswith(os.sep) if strip_prefix.startswith(path + os.sep): # still on a directory level that shall be stripped - do not create an item for this! yield None, 'x', False, False return # adjust path, remove stripped directory levels path = path.removeprefix(strip_prefix) safe_path = make_path_safe(path) item = Item(path=safe_path) hardlink_master = False hardlinked = hardlinkable and st.st_nlink > 1 if hardlinked: source = self.hard_links.get((st.st_ino, st.st_dev)) if source is not None: item.source = source status = 'h' # hardlink (to already seen inodes) else: hardlink_master = True yield item, status, hardlinked, hardlink_master # if we get here, "with"-block worked ok without error/exception, the item was processed ok... self.add_item(item, stats=self.stats) # ... and added to the archive, so we can remember it to refer to it later in the archive: if hardlink_master: self.hard_links[(st.st_ino, st.st_dev)] = safe_path def process_dir_with_fd(self, *, path, fd, st, strip_prefix): with self.create_helper(path, st, 'd', hardlinkable=False, strip_prefix=strip_prefix) as (item, status, hardlinked, hardlink_master): if item is not None: item.update(self.metadata_collector.stat_attrs(st, path, fd=fd)) return status def process_dir(self, *, path, parent_fd, name, st, strip_prefix): with self.create_helper(path, st, 'd', hardlinkable=False, strip_prefix=strip_prefix) as (item, status, hardlinked, hardlink_master): if item is None: return status with OsOpen(path=path, parent_fd=parent_fd, name=name, flags=flags_dir, noatime=True, op='dir_open') as fd: # fd is None for directories on windows, in that case a race condition check is not possible. if fd is not None: with backup_io('fstat'): st = stat_update_check(st, os.fstat(fd)) item.update(self.metadata_collector.stat_attrs(st, path, fd=fd)) return status def process_fifo(self, *, path, parent_fd, name, st, strip_prefix): with self.create_helper(path, st, 'f', strip_prefix=strip_prefix) as (item, status, hardlinked, hardlink_master): # fifo if item is None: return status with OsOpen(path=path, parent_fd=parent_fd, name=name, flags=flags_normal, noatime=True) as fd: with backup_io('fstat'): st = stat_update_check(st, os.fstat(fd)) if not hardlinked or hardlink_master: item.hardlink_master = hardlinked item.update(self.metadata_collector.stat_attrs(st, path, fd=fd)) return status def process_dev(self, *, path, parent_fd, name, st, dev_type, strip_prefix): with self.create_helper(path, st, dev_type, strip_prefix=strip_prefix) as (item, status, hardlinked, hardlink_master): # char/block device # looks like we can not work fd-based here without causing issues when trying to open/close the device if item is None: return status with backup_io('stat'): st = stat_update_check(st, os_stat(path=path, parent_fd=parent_fd, name=name, follow_symlinks=False)) item.rdev = st.st_rdev if not hardlinked or hardlink_master: item.hardlink_master = hardlinked item.update(self.metadata_collector.stat_attrs(st, path)) return status def process_symlink(self, *, path, parent_fd, name, st, strip_prefix): # note: using hardlinkable=False because we can not support hardlinked symlinks, # due to the dual-use of item.source, see issue #2343: # hardlinked symlinks will be archived [and extracted] as non-hardlinked symlinks. with self.create_helper(path, st, 's', hardlinkable=False, strip_prefix=strip_prefix) as (item, status, hardlinked, hardlink_master): if item is None: return status fname = name if name is not None and parent_fd is not None else path with backup_io('readlink'): source = os.readlink(fname, dir_fd=parent_fd) item.source = source item.update(self.metadata_collector.stat_attrs(st, path)) # can't use FD here? return status def process_pipe(self, *, path, cache, fd, mode, user, group): status = 'i' # stdin (or other pipe) self.print_file_status(status, path) status = None # we already printed the status uid = user2uid(user) if uid is None: raise Error("no such user: %s" % user) gid = group2gid(group) if gid is None: raise Error("no such group: %s" % group) t = int(time.time()) * 1000000000 item = Item( path=path, mode=mode & 0o107777 | 0o100000, # forcing regular file mode uid=uid, user=user, gid=gid, group=group, mtime=t, atime=t, ctime=t, ) self.process_file_chunks(item, cache, self.stats, self.show_progress, backup_io_iter(self.chunker.chunkify(fd))) item.get_size(memorize=True) self.stats.nfiles += 1 item.hardlink_master = False self.add_item(item, stats=self.stats) return status def process_file(self, *, path, parent_fd, name, st, cache, flags=flags_normal, strip_prefix): with self.create_helper(path, st, None, strip_prefix=strip_prefix) as (item, status, hardlinked, hardlink_master): # no status yet if item is None: return status with OsOpen(path=path, parent_fd=parent_fd, name=name, flags=flags, noatime=True) as fd: with backup_io('fstat'): st = stat_update_check(st, os.fstat(fd)) item.update(self.metadata_collector.stat_simple_attrs(st)) is_special_file = is_special(st.st_mode) if is_special_file: # we process a special file like a regular file. reflect that in mode, # so it can be extracted / accessed in FUSE mount like a regular file. # this needs to be done early, so that part files also get the patched mode. item.mode = stat.S_IFREG | stat.S_IMODE(item.mode) if not hardlinked or hardlink_master: if not is_special_file: hashed_path = safe_encode(os.path.join(self.cwd, path)) path_hash = self.key.id_hash(hashed_path) known, ids = cache.file_known_and_unchanged(hashed_path, path_hash, st) else: # in --read-special mode, we may be called for special files. # there should be no information in the cache about special files processed in # read-special mode, but we better play safe as this was wrong in the past: hashed_path = path_hash = None known, ids = False, None chunks = None if ids is not None: # Make sure all ids are available for id_ in ids: if not cache.seen_chunk(id_): status = 'M' # cache said it is unmodified, but we lost a chunk: process file like modified break else: chunks = [cache.chunk_incref(id_, self.stats) for id_ in ids] status = 'U' # regular file, unchanged else: status = 'M' if known else 'A' # regular file, modified or added self.print_file_status(status, path) status = None # we already printed the status item.hardlink_master = hardlinked # Only chunkify the file if needed if chunks is not None: item.chunks = chunks else: with backup_io('read'): self.process_file_chunks(item, cache, self.stats, self.show_progress, backup_io_iter(self.chunker.chunkify(None, fd))) if is_win32: changed_while_backup = False # TODO else: with backup_io('fstat2'): st2 = os.fstat(fd) # special files: # - fifos change naturally, because they are fed from the other side. no problem. # - blk/chr devices don't change ctime anyway. changed_while_backup = not is_special_file and st.st_ctime_ns != st2.st_ctime_ns if changed_while_backup: status = 'C' # regular file changed while we backed it up, might be inconsistent/corrupt! if not is_special_file and not changed_while_backup: # we must not memorize special files, because the contents of e.g. a # block or char device will change without its mtime/size/inode changing. # also, we must not memorize a potentially inconsistent/corrupt file that # changed while we backed it up. cache.memorize_file(hashed_path, path_hash, st, [c.id for c in item.chunks]) self.stats.nfiles += 1 item.update(self.metadata_collector.stat_ext_attrs(st, path, fd=fd)) item.get_size(memorize=True) return status class TarfileObjectProcessors: def __init__(self, *, cache, key, add_item, process_file_chunks, chunker_params, show_progress, log_json, iec, file_status_printer=None): self.cache = cache self.key = key self.add_item = add_item self.process_file_chunks = process_file_chunks self.show_progress = show_progress self.print_file_status = file_status_printer or (lambda *args: None) self.stats = Statistics(output_json=log_json, iec=iec) # threading: done by cache (including progress) self.chunker = get_chunker(*chunker_params, seed=key.chunk_seed, sparse=False) @contextmanager def create_helper(self, tarinfo, status=None, type=None): item = Item(path=make_path_safe(tarinfo.name), mode=tarinfo.mode | type, uid=tarinfo.uid, gid=tarinfo.gid, user=tarinfo.uname or None, group=tarinfo.gname or None, mtime=safe_ns(int(tarinfo.mtime * 1000**3))) yield item, status # if we get here, "with"-block worked ok without error/exception, the item was processed ok... self.add_item(item, stats=self.stats) def process_dir(self, *, tarinfo, status, type): with self.create_helper(tarinfo, status, type) as (item, status): return status def process_fifo(self, *, tarinfo, status, type): with self.create_helper(tarinfo, status, type) as (item, status): return status def process_dev(self, *, tarinfo, status, type): with self.create_helper(tarinfo, status, type) as (item, status): item.rdev = os.makedev(tarinfo.devmajor, tarinfo.devminor) return status def process_link(self, *, tarinfo, status, type): with self.create_helper(tarinfo, status, type) as (item, status): item.source = tarinfo.linkname return status def process_file(self, *, tarinfo, status, type, tar): with self.create_helper(tarinfo, status, type) as (item, status): self.print_file_status(status, tarinfo.name) status = None # we already printed the status fd = tar.extractfile(tarinfo) self.process_file_chunks(item, self.cache, self.stats, self.show_progress, backup_io_iter(self.chunker.chunkify(fd))) item.get_size(memorize=True) self.stats.nfiles += 1 return status def valid_msgpacked_dict(d, keys_serialized): """check if the data looks like a msgpacked dict""" d_len = len(d) if d_len == 0: return False if d[0] & 0xf0 == 0x80: # object is a fixmap (up to 15 elements) offs = 1 elif d[0] == 0xde: # object is a map16 (up to 2^16-1 elements) offs = 3 else: # object is not a map (dict) # note: we must not have dicts with > 2^16-1 elements return False if d_len <= offs: return False # is the first dict key a bytestring? if d[offs] & 0xe0 == 0xa0: # key is a small bytestring (up to 31 chars) pass elif d[offs] in (0xd9, 0xda, 0xdb): # key is a str8, str16 or str32 pass else: # key is not a bytestring return False # is the bytestring any of the expected key names? key_serialized = d[offs:] return any(key_serialized.startswith(pattern) for pattern in keys_serialized) class RobustUnpacker: """A restartable/robust version of the streaming msgpack unpacker """ def __init__(self, validator, item_keys): super().__init__() self.item_keys = [msgpack.packb(name.encode()) for name in item_keys] self.validator = validator self._buffered_data = [] self._resync = False self._unpacker = msgpack.Unpacker(object_hook=StableDict) def resync(self): self._buffered_data = [] self._resync = True def feed(self, data): if self._resync: self._buffered_data.append(data) else: self._unpacker.feed(data) def __iter__(self): return self def __next__(self): if self._resync: data = b''.join(self._buffered_data) while self._resync: if not data: raise StopIteration # Abort early if the data does not look like a serialized item dict if not valid_msgpacked_dict(data, self.item_keys): data = data[1:] continue self._unpacker = msgpack.Unpacker(object_hook=StableDict) self._unpacker.feed(data) try: item = next(self._unpacker) except (msgpack.UnpackException, StopIteration): # as long as we are resyncing, we also ignore StopIteration pass else: if self.validator(item): self._resync = False return item data = data[1:] else: return next(self._unpacker) class ArchiveChecker: def __init__(self): self.error_found = False self.possibly_superseded = set() def check(self, repository, repair=False, archive=None, first=0, last=0, sort_by='', glob=None, verify_data=False, save_space=False): """Perform a set of checks on 'repository' :param repair: enable repair mode, write updated or corrected data into repository :param archive: only check this archive :param first/last/sort_by: only check this number of first/last archives ordered by sort_by :param glob: only check archives matching this glob :param verify_data: integrity verification of data referenced by archives :param save_space: Repository.commit(save_space) """ logger.info('Starting archive consistency check...') self.check_all = archive is None and not any((first, last, glob)) self.repair = repair self.repository = repository self.init_chunks() if not self.chunks: logger.error('Repository contains no apparent data at all, cannot continue check/repair.') return False self.key = self.make_key(repository) if verify_data: self.verify_data() if Manifest.MANIFEST_ID not in self.chunks: logger.error("Repository manifest not found!") self.error_found = True self.manifest = self.rebuild_manifest() else: try: self.manifest, _ = Manifest.load(repository, (Manifest.Operation.CHECK,), key=self.key) except IntegrityErrorBase as exc: logger.error('Repository manifest is corrupted: %s', exc) self.error_found = True del self.chunks[Manifest.MANIFEST_ID] self.manifest = self.rebuild_manifest() self.rebuild_refcounts(archive=archive, first=first, last=last, sort_by=sort_by, glob=glob) self.orphan_chunks_check() self.finish(save_space=save_space) if self.error_found: logger.error('Archive consistency check complete, problems found.') else: logger.info('Archive consistency check complete, no problems found.') return self.repair or not self.error_found def init_chunks(self): """Fetch a list of all object keys from repository """ # Explicitly set the initial usable hash table capacity to avoid performance issues # due to hash table "resonance". # Since reconstruction of archive items can add some new chunks, add 10 % headroom. self.chunks = ChunkIndex(usable=len(self.repository) * 1.1) marker = None while True: result = self.repository.list(limit=LIST_SCAN_LIMIT, marker=marker) if not result: break marker = result[-1] init_entry = ChunkIndexEntry(refcount=0, size=0, csize=0) for id_ in result: self.chunks[id_] = init_entry def make_key(self, repository): attempt = 0 for chunkid, _ in self.chunks.iteritems(): attempt += 1 if attempt > 999: # we did a lot of attempts, but could not create the key via key_factory, give up. break cdata = repository.get(chunkid) try: return key_factory(repository, cdata) except UnsupportedPayloadError: # we get here, if the cdata we got has a corrupted key type byte pass # ignore it, just try the next chunk if attempt == 0: msg = 'make_key: repository has no chunks at all!' else: msg = 'make_key: failed to create the key (tried %d chunks)' % attempt raise IntegrityError(msg) def verify_data(self): logger.info('Starting cryptographic data integrity verification...') chunks_count_index = len(self.chunks) chunks_count_segments = 0 errors = 0 defect_chunks = [] pi = ProgressIndicatorPercent(total=chunks_count_index, msg="Verifying data %6.2f%%", step=0.01, msgid='check.verify_data') marker = None while True: chunk_ids = self.repository.scan(limit=100, marker=marker) if not chunk_ids: break chunks_count_segments += len(chunk_ids) marker = chunk_ids[-1] chunk_data_iter = self.repository.get_many(chunk_ids) chunk_ids_revd = list(reversed(chunk_ids)) while chunk_ids_revd: pi.show() chunk_id = chunk_ids_revd.pop(-1) # better efficiency try: encrypted_data = next(chunk_data_iter) except (Repository.ObjectNotFound, IntegrityErrorBase) as err: self.error_found = True errors += 1 logger.error('chunk %s: %s', bin_to_hex(chunk_id), err) if isinstance(err, IntegrityErrorBase): defect_chunks.append(chunk_id) # as the exception killed our generator, make a new one for remaining chunks: if chunk_ids_revd: chunk_ids = list(reversed(chunk_ids_revd)) chunk_data_iter = self.repository.get_many(chunk_ids) else: _chunk_id = None if chunk_id == Manifest.MANIFEST_ID else chunk_id try: self.key.decrypt(_chunk_id, encrypted_data) except IntegrityErrorBase as integrity_error: self.error_found = True errors += 1 logger.error('chunk %s, integrity error: %s', bin_to_hex(chunk_id), integrity_error) defect_chunks.append(chunk_id) pi.finish() if chunks_count_index != chunks_count_segments: logger.error('Repo/Chunks index object count vs. segment files object count mismatch.') logger.error('Repo/Chunks index: %d objects != segment files: %d objects', chunks_count_index, chunks_count_segments) if defect_chunks: if self.repair: # if we kill the defect chunk here, subsequent actions within this "borg check" # run will find missing chunks and replace them with all-zero replacement # chunks and flag the files as "repaired". # if another backup is done later and the missing chunks get backupped again, # a "borg check" afterwards can heal all files where this chunk was missing. logger.warning('Found defect chunks. They will be deleted now, so affected files can ' 'get repaired now and maybe healed later.') for defect_chunk in defect_chunks: # remote repo (ssh): retry might help for strange network / NIC / RAM errors # as the chunk will be retransmitted from remote server. # local repo (fs): as chunks.iteritems loop usually pumps a lot of data through, # a defect chunk is likely not in the fs cache any more and really gets re-read # from the underlying media. try: encrypted_data = self.repository.get(defect_chunk) _chunk_id = None if defect_chunk == Manifest.MANIFEST_ID else defect_chunk self.key.decrypt(_chunk_id, encrypted_data) except IntegrityErrorBase: # failed twice -> get rid of this chunk del self.chunks[defect_chunk] self.repository.delete(defect_chunk) logger.debug('chunk %s deleted.', bin_to_hex(defect_chunk)) else: logger.warning('chunk %s not deleted, did not consistently fail.', bin_to_hex(defect_chunk)) else: logger.warning('Found defect chunks. With --repair, they would get deleted, so affected ' 'files could get repaired then and maybe healed later.') for defect_chunk in defect_chunks: logger.debug('chunk %s is defect.', bin_to_hex(defect_chunk)) log = logger.error if errors else logger.info log('Finished cryptographic data integrity verification, verified %d chunks with %d integrity errors.', chunks_count_segments, errors) def rebuild_manifest(self): """Rebuild the manifest object if it is missing Iterates through all objects in the repository looking for archive metadata blocks. """ required_archive_keys = frozenset(key.encode() for key in REQUIRED_ARCHIVE_KEYS) def valid_archive(obj): if not isinstance(obj, dict): return False keys = set(obj) return required_archive_keys.issubset(keys) logger.info('Rebuilding missing manifest, this might take some time...') # as we have lost the manifest, we do not know any more what valid item keys we had. # collecting any key we encounter in a damaged repo seems unwise, thus we just use # the hardcoded list from the source code. thus, it is not recommended to rebuild a # lost manifest on a older borg version than the most recent one that was ever used # within this repository (assuming that newer borg versions support more item keys). manifest = Manifest(self.key, self.repository) archive_keys_serialized = [msgpack.packb(name.encode()) for name in ARCHIVE_KEYS] pi = ProgressIndicatorPercent(total=len(self.chunks), msg="Rebuilding manifest %6.2f%%", step=0.01, msgid='check.rebuild_manifest') for chunk_id, _ in self.chunks.iteritems(): pi.show() cdata = self.repository.get(chunk_id) try: data = self.key.decrypt(chunk_id, cdata) except IntegrityErrorBase as exc: logger.error('Skipping corrupted chunk: %s', exc) self.error_found = True continue if not valid_msgpacked_dict(data, archive_keys_serialized): continue if b'cmdline' not in data or b'\xa7version\x01' not in data: continue try: archive = msgpack.unpackb(data) # Ignore exceptions that might be raised when feeding msgpack with invalid data except msgpack.UnpackException: continue if valid_archive(archive): # **after** doing the low-level checks and having a strong indication that we # are likely looking at an archive item here, also check the TAM authentication: try: archive, verified, _ = self.key.unpack_and_verify_archive(data, force_tam_not_required=False) except IntegrityError as integrity_error: # TAM issues - do not accept this archive! # either somebody is trying to attack us with a fake archive data or # we have an ancient archive made before TAM was a thing (borg < 1.0.9) **and** this repo # was not correctly upgraded to borg 1.2.5 (see advisory at top of the changelog). # borg can't tell the difference, so it has to assume this archive might be an attack # and drops this archive. name = archive.get(b'name', b'').decode('ascii', 'replace') logger.error('Archive TAM authentication issue for archive %s: %s', name, integrity_error) logger.error('This archive will *not* be added to the rebuilt manifest! It will be deleted.') self.error_found = True continue # note: if we get here and verified is False, a TAM is not required. archive = ArchiveItem(internal_dict=archive) name = archive.name logger.info('Found archive %s', name) if name in manifest.archives: i = 1 while True: new_name = '%s.%d' % (name, i) if new_name not in manifest.archives: break i += 1 logger.warning('Duplicate archive name %s, storing as %s', name, new_name) name = new_name manifest.archives[name] = (chunk_id, archive.time) pi.finish() logger.info('Manifest rebuild complete.') return manifest def rebuild_refcounts(self, archive=None, first=0, last=0, sort_by='', glob=None): """Rebuild object reference counts by walking the metadata Missing and/or incorrect data is repaired when detected """ # Exclude the manifest from chunks (manifest entry might be already deleted from self.chunks) self.chunks.pop(Manifest.MANIFEST_ID, None) def mark_as_possibly_superseded(id_): if self.chunks.get(id_, ChunkIndexEntry(0, 0, 0)).refcount == 0: self.possibly_superseded.add(id_) def add_callback(chunk): id_ = self.key.id_hash(chunk) cdata = self.key.encrypt(chunk) add_reference(id_, len(chunk), len(cdata), cdata) return id_ def add_reference(id_, size, csize, cdata=None): try: self.chunks.incref(id_) except KeyError: assert cdata is not None self.chunks[id_] = ChunkIndexEntry(refcount=1, size=size, csize=csize) if self.repair: self.repository.put(id_, cdata) def verify_file_chunks(archive_name, item): """Verifies that all file chunks are present. Missing file chunks will be replaced with new chunks of the same length containing all zeros. If a previously missing file chunk re-appears, the replacement chunk is replaced by the correct one. """ def replacement_chunk(size): chunk = Chunk(None, allocation=CH_ALLOC, size=size) chunk_id, data = cached_hash(chunk, self.key.id_hash) cdata = self.key.encrypt(data) csize = len(cdata) return chunk_id, size, csize, cdata offset = 0 chunk_list = [] chunks_replaced = False has_chunks_healthy = 'chunks_healthy' in item chunks_current = item.chunks chunks_healthy = item.chunks_healthy if has_chunks_healthy else chunks_current if has_chunks_healthy and len(chunks_current) != len(chunks_healthy): # should never happen, but there was issue #3218. logger.warning(f'{archive_name}: {item.path}: Invalid chunks_healthy metadata removed!') del item.chunks_healthy has_chunks_healthy = False chunks_healthy = chunks_current for chunk_current, chunk_healthy in zip(chunks_current, chunks_healthy): chunk_id, size, csize = chunk_healthy if chunk_id not in self.chunks: # a chunk of the healthy list is missing if chunk_current == chunk_healthy: logger.error('{}: {}: New missing file chunk detected (Byte {}-{}, Chunk {}). ' 'Replacing with all-zero chunk.'.format( archive_name, item.path, offset, offset + size, bin_to_hex(chunk_id))) self.error_found = chunks_replaced = True chunk_id, size, csize, cdata = replacement_chunk(size) add_reference(chunk_id, size, csize, cdata) else: logger.info('{}: {}: Previously missing file chunk is still missing (Byte {}-{}, Chunk {}). ' 'It has an all-zero replacement chunk already.'.format( archive_name, item.path, offset, offset + size, bin_to_hex(chunk_id))) chunk_id, size, csize = chunk_current if chunk_id in self.chunks: add_reference(chunk_id, size, csize) else: logger.warning('{}: {}: Missing all-zero replacement chunk detected (Byte {}-{}, Chunk {}). ' 'Generating new replacement chunk.'.format( archive_name, item.path, offset, offset + size, bin_to_hex(chunk_id))) self.error_found = chunks_replaced = True chunk_id, size, csize, cdata = replacement_chunk(size) add_reference(chunk_id, size, csize, cdata) else: if chunk_current == chunk_healthy: # normal case, all fine. add_reference(chunk_id, size, csize) else: logger.info('{}: {}: Healed previously missing file chunk! (Byte {}-{}, Chunk {}).'.format( archive_name, item.path, offset, offset + size, bin_to_hex(chunk_id))) add_reference(chunk_id, size, csize) mark_as_possibly_superseded(chunk_current[0]) # maybe orphaned the all-zero replacement chunk chunk_list.append([chunk_id, size, csize]) # list-typed element as chunks_healthy is list-of-lists offset += size if chunks_replaced and not has_chunks_healthy: # if this is first repair, remember the correct chunk IDs, so we can maybe heal the file later item.chunks_healthy = item.chunks if has_chunks_healthy and chunk_list == chunks_healthy: logger.info(f'{archive_name}: {item.path}: Completely healed previously damaged file!') del item.chunks_healthy item.chunks = chunk_list if 'size' in item: item_size = item.size item_chunks_size = item.get_size(compressed=False, from_chunks=True) if item_size != item_chunks_size: # just warn, but keep the inconsistency, so that borg extract can warn about it. logger.warning('{}: {}: size inconsistency detected: size {}, chunks size {}'.format( archive_name, item.path, item_size, item_chunks_size)) def robust_iterator(archive): """Iterates through all archive items Missing item chunks will be skipped and the msgpack stream will be restarted """ item_keys = frozenset(key.encode() for key in self.manifest.item_keys) required_item_keys = frozenset(key.encode() for key in REQUIRED_ITEM_KEYS) unpacker = RobustUnpacker(lambda item: isinstance(item, StableDict) and b'path' in item, self.manifest.item_keys) _state = 0 def missing_chunk_detector(chunk_id): nonlocal _state if _state % 2 != int(chunk_id not in self.chunks): _state += 1 return _state def report(msg, chunk_id, chunk_no): cid = bin_to_hex(chunk_id) msg += ' [chunk: %06d_%s]' % (chunk_no, cid) # see "debug dump-archive-items" self.error_found = True logger.error(msg) def list_keys_safe(keys): return ', '.join(k.decode(errors='replace') if isinstance(k, bytes) else str(k) for k in keys) def valid_item(obj): if not isinstance(obj, StableDict): return False, 'not a dictionary' # A bug in Attic up to and including release 0.13 added a (meaningless) b'acl' key to every item. # We ignore it here, should it exist. See test_attic013_acl_bug for details. obj.pop(b'acl', None) keys = set(obj) if not required_item_keys.issubset(keys): return False, 'missing required keys: ' + list_keys_safe(required_item_keys - keys) if not keys.issubset(item_keys): return False, 'invalid keys: ' + list_keys_safe(keys - item_keys) return True, '' i = 0 for state, items in groupby(archive.items, missing_chunk_detector): items = list(items) if state % 2: for chunk_id in items: report('item metadata chunk missing', chunk_id, i) i += 1 continue if state > 0: unpacker.resync() for chunk_id, cdata in zip(items, repository.get_many(items)): try: data = self.key.decrypt(chunk_id, cdata) unpacker.feed(data) for item in unpacker: valid, reason = valid_item(item) if valid: yield Item(internal_dict=item) else: report('Did not get expected metadata dict when unpacking item metadata (%s)' % reason, chunk_id, i) except IntegrityError as integrity_error: # key.decrypt() detected integrity issues. # maybe the repo gave us a valid cdata, but not for the chunk_id we wanted. # or the authentication of cdata failed, meaning the encrypted data was corrupted. report(str(integrity_error), chunk_id, i) except msgpack.UnpackException: report('Unpacker crashed while unpacking item metadata, trying to resync...', chunk_id, i) unpacker.resync() except Exception: report('Exception while decrypting or unpacking item metadata', chunk_id, i) raise i += 1 if archive is None: sort_by = sort_by.split(',') if any((first, last, glob)): archive_infos = self.manifest.archives.list(sort_by=sort_by, glob=glob, first=first, last=last) if glob and not archive_infos: logger.warning('--glob-archives %s does not match any archives', glob) if first and len(archive_infos) < first: logger.warning('--first %d archives: only found %d archives', first, len(archive_infos)) if last and len(archive_infos) < last: logger.warning('--last %d archives: only found %d archives', last, len(archive_infos)) else: archive_infos = self.manifest.archives.list(sort_by=sort_by) else: # we only want one specific archive try: archive_infos = [self.manifest.archives[archive]] except KeyError: logger.error("Archive '%s' not found.", archive) self.error_found = True return num_archives = len(archive_infos) pi = ProgressIndicatorPercent(total=num_archives, msg='Checking archives %3.1f%%', step=0.1, msgid='check.rebuild_refcounts') with cache_if_remote(self.repository) as repository: for i, info in enumerate(archive_infos): pi.show(i) logger.info(f'Analyzing archive {info.name} ({i + 1}/{num_archives})') archive_id = info.id if archive_id not in self.chunks: logger.error('Archive metadata block %s is missing!', bin_to_hex(archive_id)) self.error_found = True del self.manifest.archives[info.name] continue mark_as_possibly_superseded(archive_id) cdata = self.repository.get(archive_id) try: data = self.key.decrypt(archive_id, cdata) except IntegrityError as integrity_error: logger.error('Archive metadata block %s is corrupted: %s', bin_to_hex(archive_id), integrity_error) self.error_found = True del self.manifest.archives[info.name] continue try: archive, verified, salt = self.key.unpack_and_verify_archive(data, force_tam_not_required=False) except IntegrityError as integrity_error: # looks like there is a TAM issue with this archive, this might be an attack! # when upgrading to borg 1.2.5, users are expected to TAM-authenticate all archives they # trust, so there shouldn't be any without TAM. logger.error('Archive TAM authentication issue for archive %s: %s', info.name, integrity_error) logger.error('This archive will be *removed* from the manifest! It will be deleted.') self.error_found = True del self.manifest.archives[info.name] continue archive = ArchiveItem(internal_dict=archive) if archive.version != 1: raise Exception('Unknown archive metadata version') archive.cmdline = [safe_decode(arg) for arg in archive.cmdline] items_buffer = ChunkBuffer(self.key) items_buffer.write_chunk = add_callback for item in robust_iterator(archive): if 'chunks' in item: verify_file_chunks(info.name, item) items_buffer.add(item) items_buffer.flush(flush=True) for previous_item_id in archive.items: mark_as_possibly_superseded(previous_item_id) archive.items = items_buffer.chunks data = self.key.pack_and_authenticate_metadata(archive.as_dict(), context=b'archive', salt=salt) new_archive_id = self.key.id_hash(data) cdata = self.key.encrypt(data) add_reference(new_archive_id, len(data), len(cdata), cdata) self.manifest.archives[info.name] = (new_archive_id, info.ts) pi.finish() def orphan_chunks_check(self): if self.check_all: unused = {id_ for id_, entry in self.chunks.iteritems() if entry.refcount == 0} orphaned = unused - self.possibly_superseded if orphaned: logger.error(f'{len(orphaned)} orphaned objects found!') self.error_found = True if self.repair and unused: logger.info('Deleting %d orphaned and %d superseded objects...' % ( len(orphaned), len(self.possibly_superseded))) for id_ in unused: self.repository.delete(id_) logger.info('Finished deleting orphaned/superseded objects.') else: logger.info('Orphaned objects check skipped (needs all archives checked).') def finish(self, save_space=False): if self.repair: logger.info('Writing Manifest.') self.manifest.write() logger.info('Committing repo.') self.repository.commit(compact=False, save_space=save_space) class ArchiveRecreater: class Interrupted(Exception): def __init__(self, metadata=None): self.metadata = metadata or {} @staticmethod def is_temporary_archive(archive_name): return archive_name.endswith('.recreate') def __init__(self, repository, manifest, key, cache, matcher, exclude_caches=False, exclude_if_present=None, keep_exclude_tags=False, chunker_params=None, compression=None, recompress=False, always_recompress=False, dry_run=False, stats=False, progress=False, file_status_printer=None, timestamp=None, checkpoint_interval=1800): self.repository = repository self.key = key self.manifest = manifest self.cache = cache self.matcher = matcher self.exclude_caches = exclude_caches self.exclude_if_present = exclude_if_present or [] self.keep_exclude_tags = keep_exclude_tags self.rechunkify = chunker_params is not None if self.rechunkify: logger.debug('Rechunking archives to %s', chunker_params) self.chunker_params = chunker_params or CHUNKER_PARAMS self.recompress = recompress self.always_recompress = always_recompress self.compression = compression or CompressionSpec('none') self.seen_chunks = set() self.timestamp = timestamp self.dry_run = dry_run self.stats = stats self.progress = progress self.print_file_status = file_status_printer or (lambda *args: None) self.checkpoint_interval = None if dry_run else checkpoint_interval def recreate(self, archive_name, comment=None, target_name=None): assert not self.is_temporary_archive(archive_name) archive = self.open_archive(archive_name) target = self.create_target(archive, target_name) if self.exclude_if_present or self.exclude_caches: self.matcher_add_tagged_dirs(archive) if ( self.matcher.empty() and not self.recompress and not target.recreate_rechunkify and comment is None and target_name is None ): # nothing to do return False self.process_items(archive, target) replace_original = target_name is None self.save(archive, target, comment, replace_original=replace_original) return True def process_items(self, archive, target): matcher = self.matcher target_is_subset = not matcher.empty() hardlink_masters = {} if target_is_subset else None def item_is_hardlink_master(item): return (target_is_subset and hardlinkable(item.mode) and item.get('hardlink_master', True) and 'source' not in item) for item in archive.iter_items(): if not matcher.match(item.path): self.print_file_status('x', item.path) if item_is_hardlink_master(item): hardlink_masters[item.path] = (item.get('chunks'), item.get('chunks_healthy'), None) continue if target_is_subset and hardlinkable(item.mode) and item.get('source') in hardlink_masters: # master of this hard link is outside the target subset chunks, chunks_healthy, new_source = hardlink_masters[item.source] if new_source is None: # First item to use this master, move the chunks item.chunks = chunks if chunks_healthy is not None: item.chunks_healthy = chunks_healthy hardlink_masters[item.source] = (None, None, item.path) del item.source else: # Master was already moved, only update this item's source item.source = new_source if self.dry_run: self.print_file_status('-', item.path) else: self.process_item(archive, target, item) if self.progress: target.stats.show_progress(final=True) def process_item(self, archive, target, item): status = file_status(item.mode) if 'chunks' in item: self.print_file_status(status, item.path) status = None self.process_chunks(archive, target, item) target.stats.nfiles += 1 target.add_item(item, stats=target.stats) self.print_file_status(status, item.path) def process_chunks(self, archive, target, item): if not self.recompress and not target.recreate_rechunkify: for chunk_id, size, csize in item.chunks: self.cache.chunk_incref(chunk_id, target.stats) return item.chunks chunk_iterator = self.iter_chunks(archive, target, list(item.chunks)) chunk_processor = partial(self.chunk_processor, target) target.process_file_chunks(item, self.cache, target.stats, self.progress, chunk_iterator, chunk_processor) def chunk_processor(self, target, chunk): chunk_id, data = cached_hash(chunk, self.key.id_hash) if chunk_id in self.seen_chunks: return self.cache.chunk_incref(chunk_id, target.stats) overwrite = self.recompress if self.recompress and not self.always_recompress and chunk_id in self.cache.chunks: # Check if this chunk is already compressed the way we want it old_chunk = self.key.decrypt(None, self.repository.get(chunk_id), decompress=False) if Compressor.detect(old_chunk).name == self.key.compressor.decide(data).name: # Stored chunk has the same compression we wanted overwrite = False chunk_entry = self.cache.add_chunk(chunk_id, data, target.stats, overwrite=overwrite, wait=False) self.cache.repository.async_response(wait=False) self.seen_chunks.add(chunk_entry.id) return chunk_entry def iter_chunks(self, archive, target, chunks): chunk_iterator = archive.pipeline.fetch_many([chunk_id for chunk_id, _, _ in chunks]) if target.recreate_rechunkify: # The target.chunker will read the file contents through ChunkIteratorFileWrapper chunk-by-chunk # (does not load the entire file into memory) file = ChunkIteratorFileWrapper(chunk_iterator) yield from target.chunker.chunkify(file) else: for chunk in chunk_iterator: yield Chunk(chunk, size=len(chunk), allocation=CH_DATA) def save(self, archive, target, comment=None, replace_original=True): if self.dry_run: return if comment is None: comment = archive.metadata.get('comment', '') # Keep for the statistics if necessary if self.stats: _start = target.start if self.timestamp is None: additional_metadata = { 'time': archive.metadata.time, 'time_end': archive.metadata.get('time_end') or archive.metadata.time, 'cmdline': archive.metadata.cmdline, # but also remember recreate metadata: 'recreate_cmdline': sys.argv, } else: additional_metadata = { 'cmdline': archive.metadata.cmdline, # but also remember recreate metadata: 'recreate_cmdline': sys.argv, } target.save(comment=comment, timestamp=self.timestamp, additional_metadata=additional_metadata) if replace_original: archive.delete(Statistics(), progress=self.progress) target.rename(archive.name) if self.stats: target.start = _start target.end = utcnow() log_multi(DASHES, str(target), DASHES, str(target.stats), str(self.cache), DASHES) def matcher_add_tagged_dirs(self, archive): """Add excludes to the matcher created by exclude_cache and exclude_if_present.""" def exclude(dir, tag_item): if self.keep_exclude_tags: tag_files.append(PathPrefixPattern(tag_item.path, recurse_dir=False)) tagged_dirs.append(FnmatchPattern(dir + '/', recurse_dir=False)) else: tagged_dirs.append(PathPrefixPattern(dir, recurse_dir=False)) matcher = self.matcher tag_files = [] tagged_dirs = [] # to support reading hard-linked CACHEDIR.TAGs (aka CACHE_TAG_NAME), similar to hardlink_masters: cachedir_masters = {} if self.exclude_caches: # sadly, due to how CACHEDIR.TAG works (filename AND file [header] contents) and # how borg deals with hardlinks (slave hardlinks referring back to master hardlinks), # we need to pass over the archive collecting hardlink master paths. # as seen in issue #4911, the master paths can have an arbitrary filenames, # not just CACHEDIR.TAG. for item in archive.iter_items(filter=lambda item: os.path.basename(item.path) == CACHE_TAG_NAME): if stat.S_ISREG(item.mode) and 'chunks' not in item and 'source' in item: # this is a hardlink slave, referring back to its hardlink master (via item.source) cachedir_masters[item.source] = None # we know the key (path), but not the value (item) yet for item in archive.iter_items( filter=lambda item: os.path.basename(item.path) == CACHE_TAG_NAME or matcher.match(item.path)): if self.exclude_caches and item.path in cachedir_masters: cachedir_masters[item.path] = item dir, tag_file = os.path.split(item.path) if tag_file in self.exclude_if_present: exclude(dir, item) elif self.exclude_caches and tag_file == CACHE_TAG_NAME and stat.S_ISREG(item.mode): content_item = item if 'chunks' in item else cachedir_masters[item.source] file = open_item(archive, content_item) if file.read(len(CACHE_TAG_CONTENTS)) == CACHE_TAG_CONTENTS: exclude(dir, item) matcher.add(tag_files, IECommand.Include) matcher.add(tagged_dirs, IECommand.ExcludeNoRecurse) def create_target(self, archive, target_name=None): """Create target archive.""" target_name = target_name or archive.name + '.recreate' target = self.create_target_archive(target_name) # If the archives use the same chunker params, then don't rechunkify src_cp = archive.metadata.get('chunker_params') src_cp = normalize_chunker_params(src_cp) if src_cp is not None else None dst_cp = target.chunker_params target.recreate_rechunkify = self.rechunkify and src_cp != dst_cp if target.recreate_rechunkify: logger.debug('Rechunking archive from %s to %s', src_cp or '(unknown)', dst_cp) target.process_file_chunks = ChunksProcessor( cache=self.cache, key=self.key, add_item=target.add_item, write_checkpoint=target.write_checkpoint, checkpoint_interval=self.checkpoint_interval, rechunkify=target.recreate_rechunkify).process_file_chunks target.chunker = get_chunker(*target.chunker_params, seed=self.key.chunk_seed, sparse=False) return target def create_target_archive(self, name): target = Archive(self.repository, self.key, self.manifest, name, create=True, progress=self.progress, chunker_params=self.chunker_params, cache=self.cache, checkpoint_interval=self.checkpoint_interval) return target def open_archive(self, name, **kwargs): return Archive(self.repository, self.key, self.manifest, name, cache=self.cache, **kwargs) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/archiver.py0000644000076500000240000112273214641074756016133 0ustar00twstaff# borg cli interface / toplevel archiver code import sys import traceback try: import argparse import collections import configparser import faulthandler import functools import inspect import itertools import json import logging import os import re import shlex import shutil import signal import stat import subprocess import tarfile import textwrap import time from contextlib import contextmanager from datetime import datetime, timedelta from io import TextIOWrapper from .logger import create_logger, setup_logging logger = create_logger() import borg from . import __version__ from . import helpers from .algorithms.checksums import crc32 from .archive import Archive, ArchiveChecker, ArchiveRecreater, Statistics, is_special from .archive import BackupError, BackupRaceConditionError, BackupOSError, backup_io, OsOpen, stat_update_check from .archive import FilesystemObjectProcessors, TarfileObjectProcessors, MetadataCollector, ChunksProcessor from .archive import has_link from .cache import Cache, assert_secure, SecurityManager from .constants import * # NOQA from .compress import CompressionSpec from .crypto.key import key_creator, key_argument_names, tam_required_file, tam_required, RepoKey, PassphraseKey from .crypto.keymanager import KeyManager from .helpers import EXIT_SUCCESS, EXIT_WARNING, EXIT_ERROR, EXIT_SIGNAL_BASE, classify_ec from .helpers import Error, NoManifestError, CancelledByUser, RTError, CommandError from .helpers import modern_ec, set_ec, get_ec, get_reset_ec from .helpers import add_warning, BorgWarning, FileChangedWarning, BackupWarning, IncludePatternNeverMatchedWarning from .helpers import positive_int_validator, location_validator, archivename_validator, ChunkerParams, Location from .helpers import PrefixSpec, GlobSpec, CommentSpec, PathSpec, SortBySpec, FilesCacheMode from .helpers import BaseFormatter, ItemFormatter, ArchiveFormatter from .helpers import format_timedelta, format_file_size, parse_file_size, format_archive from .helpers import safe_encode, remove_surrogates, bin_to_hex, hex_to_bin, prepare_dump_dict, eval_escapes from .helpers import interval, prune_within, prune_split, PRUNING_PATTERNS from .helpers import timestamp, utcnow from .helpers import get_cache_dir, os_stat, get_strip_prefix from .helpers import Manifest, AI_HUMAN_SORT_KEYS from .helpers import hardlinkable from .helpers import StableDict from .helpers import check_python, check_extension_modules from .helpers import dir_is_tagged, is_slow_msgpack, is_supported_msgpack, yes, sysinfo from .helpers import log_multi from .helpers import signal_handler, raising_signal_handler, SigHup, SigTerm from .helpers import ErrorIgnoringTextIOWrapper from .helpers import ProgressIndicatorPercent from .helpers import basic_json_data, json_print from .helpers import replace_placeholders from .helpers import ChunkIteratorFileWrapper, normalize_chunker_params from .helpers import popen_with_error_handling, prepare_subprocess_env, create_filter_process from .helpers import dash_open from .helpers import umount from .helpers import flags_dir, flags_special_follow, flags_special from .helpers import msgpack from .helpers import sig_int, ignore_sigint from .helpers import iter_separated from .helpers import get_tar_filter from .helpers import ignore_invalid_archive_tam from .helpers.parseformat import BorgJsonEncoder, safe_decode from .nanorst import rst_to_terminal from .patterns import ArgparsePatternAction, ArgparseExcludeFileAction, ArgparsePatternFileAction, parse_exclude_pattern from .patterns import PatternMatcher from .item import Item, ArchiveItem from .platform import get_flags, get_process_id, SyncFile from .platform import uid2user, gid2group from .remote import RepositoryServer, RemoteRepository, cache_if_remote from .repository import Repository, LIST_SCAN_LIMIT, TAG_PUT, TAG_DELETE, TAG_COMMIT from .selftest import selftest from .upgrader import AtticRepositoryUpgrader, BorgRepositoryUpgrader except BaseException: # an unhandled exception in the try-block would cause the borg cli command to exit with rc 1 due to python's # default behavior, see issue #4424. # as borg defines rc 1 as WARNING, this would be a mismatch, because a crash should be an ERROR (rc 2). traceback.print_exc() sys.exit(2) # == EXIT_ERROR assert EXIT_ERROR == 2, "EXIT_ERROR is not 2, as expected - fix assert AND exception handler right above this line." STATS_HEADER = " Original size Compressed size Deduplicated size" PURE_PYTHON_MSGPACK_WARNING = "Using a pure-python msgpack! This will result in lower performance." # Python 3.12+ gives a deprecation warning if TarFile.extraction_filter is None. # https://docs.python.org/3.12/library/tarfile.html#tarfile-extraction-filter if hasattr(tarfile, "fully_trusted_filter"): tarfile.TarFile.extraction_filter = staticmethod(tarfile.fully_trusted_filter) # type: ignore def argument(args, str_or_bool): """If bool is passed, return it. If str is passed, retrieve named attribute from args.""" if isinstance(str_or_bool, str): return getattr(args, str_or_bool) if isinstance(str_or_bool, (list, tuple)): return any(getattr(args, item) for item in str_or_bool) return str_or_bool def with_repository(fake=False, invert_fake=False, create=False, lock=True, exclusive=False, manifest=True, cache=False, secure=True, compatibility=None): """ Method decorator for subcommand-handling methods: do_XYZ(self, args, repository, …) If a parameter (where allowed) is a str the attribute named of args is used instead. :param fake: (str or bool) use None instead of repository, don't do anything else :param create: create repository :param lock: lock repository :param exclusive: (str or bool) lock repository exclusively (for writing) :param manifest: load manifest and key, pass them as keyword arguments :param cache: open cache, pass it as keyword argument (implies manifest) :param secure: do assert_secure after loading manifest :param compatibility: mandatory if not create and (manifest or cache), specifies mandatory feature categories to check """ if not create and (manifest or cache): if compatibility is None: raise AssertionError("with_repository decorator used without compatibility argument") if type(compatibility) is not tuple: raise AssertionError("with_repository decorator compatibility argument must be of type tuple") else: if compatibility is not None: raise AssertionError("with_repository called with compatibility argument but would not check" + repr(compatibility)) if create: compatibility = Manifest.NO_OPERATION_CHECK # To process the `--bypass-lock` option if specified, we need to # modify `lock` inside `wrapper`. Therefore we cannot use the # `nonlocal` statement to access `lock` as modifications would also # affect the scope outside of `wrapper`. Subsequent calls would # only see the overwritten value of `lock`, not the original one. # The solution is to define a place holder variable `_lock` to # propagate the value into `wrapper`. _lock = lock def decorator(method): @functools.wraps(method) def wrapper(self, args, **kwargs): lock = getattr(args, 'lock', _lock) location = args.location # note: 'location' must be always present in args append_only = getattr(args, 'append_only', False) storage_quota = getattr(args, 'storage_quota', None) make_parent_dirs = getattr(args, 'make_parent_dirs', False) if argument(args, fake) ^ invert_fake: return method(self, args, repository=None, **kwargs) elif location.proto == 'ssh': repository = RemoteRepository(location.omit_archive(), create=create, exclusive=argument(args, exclusive), lock_wait=self.lock_wait, lock=lock, append_only=append_only, make_parent_dirs=make_parent_dirs, args=args) else: repository = Repository(location.path, create=create, exclusive=argument(args, exclusive), lock_wait=self.lock_wait, lock=lock, append_only=append_only, storage_quota=storage_quota, make_parent_dirs=make_parent_dirs) with repository: if manifest or cache: kwargs['manifest'], kwargs['key'] = Manifest.load(repository, compatibility) if 'compression' in args: kwargs['key'].compressor = args.compression.compressor if secure: assert_secure(repository, kwargs['manifest'], self.lock_wait) if cache: with Cache(repository, kwargs['key'], kwargs['manifest'], progress=getattr(args, 'progress', False), lock_wait=self.lock_wait, cache_mode=getattr(args, 'files_cache_mode', FILES_CACHE_MODE_DISABLED), consider_part_files=getattr(args, 'consider_part_files', False), iec=getattr(args, 'iec', False)) as cache_: return method(self, args, repository=repository, cache=cache_, **kwargs) else: return method(self, args, repository=repository, **kwargs) return wrapper return decorator def with_archive(method): @functools.wraps(method) def wrapper(self, args, repository, key, manifest, **kwargs): archive = Archive(repository, key, manifest, args.location.archive, numeric_ids=getattr(args, 'numeric_ids', False), noflags=getattr(args, 'nobsdflags', False) or getattr(args, 'noflags', False), noacls=getattr(args, 'noacls', False), noxattrs=getattr(args, 'noxattrs', False), cache=kwargs.get('cache'), consider_part_files=args.consider_part_files, log_json=args.log_json, iec=args.iec) return method(self, args, repository=repository, manifest=manifest, key=key, archive=archive, **kwargs) return wrapper def parse_storage_quota(storage_quota): parsed = parse_file_size(storage_quota) if parsed < parse_file_size('10M'): raise argparse.ArgumentTypeError('quota is too small (%s). At least 10M are required.' % storage_quota) return parsed def get_func(args): # This works around https://bugs.python.org/issue9351 # func is used at the leaf parsers of the argparse parser tree, # fallback_func at next level towards the root, # fallback2_func at the 2nd next level (which is root in our case). for name in 'func', 'fallback_func', 'fallback2_func': func = getattr(args, name, None) if func is not None: return func raise Exception('expected func attributes not found') class Highlander(argparse.Action): """make sure some option is only given once""" def __call__(self, parser, namespace, values, option_string=None): if getattr(namespace, self.dest, None) != self.default: raise argparse.ArgumentError(self, 'There can be only one.') setattr(namespace, self.dest, values) class Archiver: def __init__(self, lock_wait=None, prog=None): self.lock_wait = lock_wait self.prog = prog self.last_checkpoint = time.monotonic() def print_warning(self, msg, *args, **kw): warning_code = kw.get("wc", EXIT_WARNING) # note: wc=None can be used to not influence exit code warning_type = kw.get("wt", "percent") assert warning_type in ("percent", "curly") warning_msgid = kw.get("msgid") if warning_code is not None: add_warning(msg, *args, wc=warning_code, wt=warning_type) if warning_type == "percent": output = args and msg % args or msg else: # == "curly" output = args and msg.format(*args) or msg logger.warning(output, msgid=warning_msgid) if warning_msgid else logger.warning(output) def print_warning_instance(self, warning): assert isinstance(warning, BorgWarning) # if it is a BackupWarning, use the wrapped BackupError exception instance: cls = type(warning.args[1]) if isinstance(warning, BackupWarning) else type(warning) msg, msgid, args, wc = cls.__doc__, cls.__qualname__, warning.args, warning.exit_code self.print_warning(msg, *args, wc=wc, wt="curly", msgid=msgid) def print_file_status(self, status, path): # if we get called with status == None, the final file status was already printed if self.output_list and status is not None and (self.output_filter is None or status in self.output_filter): if self.log_json: print(json.dumps({ 'type': 'file_status', 'status': status, 'path': remove_surrogates(path), }), file=sys.stderr) else: logging.getLogger('borg.output.list').info("%1s %s", status, remove_surrogates(path)) @staticmethod def build_matcher(inclexcl_patterns, include_paths): matcher = PatternMatcher() matcher.add_inclexcl(inclexcl_patterns) matcher.add_includepaths(include_paths) return matcher def do_serve(self, args): """Start in server mode. This command is usually not used manually.""" RepositoryServer( restrict_to_paths=args.restrict_to_paths, restrict_to_repositories=args.restrict_to_repositories, append_only=args.append_only, storage_quota=args.storage_quota, ).serve() def do_version(self, args): """Display the borg client / borg server version""" from borg.version import parse_version, format_version client_version = parse_version(__version__) if args.location.proto == 'ssh': with RemoteRepository(args.location.omit_archive(), lock=False, args=args) as repository: server_version = repository.server_version else: server_version = client_version print(f"{format_version(client_version)} / {format_version(server_version)}") @with_repository(create=True, exclusive=True, manifest=False) def do_init(self, args, repository): """Initialize an empty repository""" path = args.location.canonical_path() logger.info('Initializing repository at "%s"' % path) try: key = key_creator(repository, args) except (EOFError, KeyboardInterrupt): repository.destroy() raise CancelledByUser() manifest = Manifest(key, repository) manifest.key = key manifest.write() repository.commit(compact=False) with Cache(repository, key, manifest, warn_if_unencrypted=False): pass if key.tam_required: tam_file = tam_required_file(repository) open(tam_file, 'w').close() if key.NAME != 'plaintext': logger.warning( '\n' 'IMPORTANT: you will need both KEY AND PASSPHRASE to access this repo!\n' '\n' 'Key storage location depends on the mode:\n' '- repokey modes: key is stored in the repository directory.\n' '- keyfile modes: key is stored in the home directory of this user.\n' '\n' 'For any mode, you should:\n' '1. Export the borg key and store the result at a safe place:\n' ' borg key export REPOSITORY encrypted-key-backup\n' ' borg key export --paper REPOSITORY encrypted-key-backup.txt\n' ' borg key export --qr-html REPOSITORY encrypted-key-backup.html\n' '2. Write down the borg key passphrase and store it at safe place.\n' ) @with_repository(exclusive=True, manifest=False) def do_check(self, args, repository): """Check repository consistency""" if args.repair: msg = ("This is a potentially dangerous function.\n" "check --repair might lead to data loss (for kinds of corruption it is not\n" "capable of dealing with). BE VERY CAREFUL!\n" "\n" "Type 'YES' if you understand this and want to continue: ") if not yes(msg, false_msg="Aborting.", invalid_msg="Invalid answer, aborting.", truish=('YES', ), retry=False, env_var_override='BORG_CHECK_I_KNOW_WHAT_I_AM_DOING'): raise CancelledByUser() if args.repo_only and any( (args.verify_data, args.first, args.last, args.prefix is not None, args.glob_archives)): raise CommandError("--repository-only contradicts --first, --last, --glob-archives, --prefix and --verify-data arguments.") if args.repair and args.max_duration: raise CommandError("--repair does not allow --max-duration argument.") if args.max_duration and not args.repo_only: # when doing a partial repo check, we can only check crc32 checksums in segment files, # we can't build a fresh repo index in memory to verify the on-disk index against it. # thus, we should not do an archives check based on a unknown-quality on-disk repo index. # also, there is no max_duration support in the archives check code anyway. raise CommandError("--repository-only is required for --max-duration support.") if not args.archives_only: if not repository.check(repair=args.repair, save_space=args.save_space, max_duration=args.max_duration): set_ec(EXIT_WARNING) return if args.prefix is not None: args.glob_archives = args.prefix + '*' if not args.repo_only and not ArchiveChecker().check( repository, repair=args.repair, archive=args.location.archive, first=args.first, last=args.last, sort_by=args.sort_by or 'ts', glob=args.glob_archives, verify_data=args.verify_data, save_space=args.save_space): set_ec(EXIT_WARNING) return @with_repository(compatibility=(Manifest.Operation.CHECK,)) def do_change_passphrase(self, args, repository, manifest, key): """Change repository key file passphrase""" if not hasattr(key, 'change_passphrase'): raise CommandError('This repository is not encrypted, cannot change the passphrase.') key.change_passphrase() logger.info('Key updated') if hasattr(key, 'find_key'): # print key location to make backing it up easier logger.info('Key location: %s', key.find_key()) @with_repository(lock=False, exclusive=False, manifest=False, cache=False) def do_key_export(self, args, repository): """Export the repository key for backup""" manager = KeyManager(repository) manager.load_keyblob() if args.paper: manager.export_paperkey(args.path) else: try: if args.qr: manager.export_qr(args.path) else: manager.export(args.path) except IsADirectoryError: raise CommandError(f"'{args.path}' must be a file, not a directory") @with_repository(lock=False, exclusive=False, manifest=False, cache=False) def do_key_import(self, args, repository): """Import the repository key from backup""" manager = KeyManager(repository) if args.paper: if args.path: raise CommandError("with --paper import from file is not supported") manager.import_paperkey(args) else: if not args.path: raise CommandError("expected input file to import key from") if args.path != '-' and not os.path.exists(args.path): raise CommandError(f"input file does not exist: {args.path}") manager.import_keyfile(args) @with_repository(manifest=False) def do_migrate_to_repokey(self, args, repository): """Migrate passphrase -> repokey""" manifest_data = repository.get(Manifest.MANIFEST_ID) key_old = PassphraseKey.detect(repository, manifest_data) key_new = RepoKey(repository) key_new.target = repository key_new.repository_id = repository.id key_new.enc_key = key_old.enc_key key_new.enc_hmac_key = key_old.enc_hmac_key key_new.id_key = key_old.id_key key_new.chunk_seed = key_old.chunk_seed key_new.change_passphrase() # option to change key protection passphrase, save logger.info('Key updated') def do_benchmark_crud(self, args): """Benchmark Create, Read, Update, Delete for archives.""" def parse_args(args, cmd): # we need to inherit some essential options from the "borg benchmark crud" invocation if args.rsh is not None: cmd[1:1] = ["--rsh", args.rsh] if args.remote_path is not None: cmd[1:1] = ["--remote-path", args.remote_path] return self.parse_args(cmd) def measurement_run(args, path): repo = args.location.canonical_path() archive = repo + '::borg-benchmark-crud' compression = '--compression=none' # measure create perf (without files cache to always have it chunking) t_start = time.monotonic() rc = get_reset_ec(self.do_create(parse_args(args, ['create', compression, '--files-cache=disabled', archive + '1', path]))) t_end = time.monotonic() dt_create = t_end - t_start assert rc == 0 # now build files cache rc1 = get_reset_ec(self.do_create(parse_args(args, ['create', compression, archive + '2', path]))) rc2 = get_reset_ec(self.do_delete(parse_args(args, ['delete', archive + '2']))) assert rc1 == rc2 == 0 # measure a no-change update (archive1 is still present) t_start = time.monotonic() rc1 = get_reset_ec(self.do_create(parse_args(args, ['create', compression, archive + '3', path]))) t_end = time.monotonic() dt_update = t_end - t_start rc2 = get_reset_ec(self.do_delete(parse_args(args, ['delete', archive + '3']))) assert rc1 == rc2 == 0 # measure extraction (dry-run: without writing result to disk) t_start = time.monotonic() rc = get_reset_ec(self.do_extract(parse_args(args, ['extract', '--dry-run', archive + '1']))) t_end = time.monotonic() dt_extract = t_end - t_start assert rc == 0 # measure archive deletion (of LAST present archive with the data) t_start = time.monotonic() rc = get_reset_ec(self.do_delete(parse_args(args, ['delete', archive + '1']))) t_end = time.monotonic() dt_delete = t_end - t_start assert rc == 0 return dt_create, dt_update, dt_extract, dt_delete @contextmanager def test_files(path, count, size, random): try: path = os.path.join(path, 'borg-test-data') os.makedirs(path) z_buff = None if random else memoryview(zeros)[:size] if size <= len(zeros) else b'\0' * size for i in range(count): fname = os.path.join(path, 'file_%d' % i) data = z_buff if not random else os.urandom(size) with SyncFile(fname, binary=True) as fd: # used for posix_fadvise's sake fd.write(data) yield path finally: shutil.rmtree(path) if '_BORG_BENCHMARK_CRUD_TEST' in os.environ: tests = [ ('Z-TEST', 1, 1, False), ('R-TEST', 1, 1, True), ] else: tests = [ ('Z-BIG', 10, 100000000, False), ('R-BIG', 10, 100000000, True), ('Z-MEDIUM', 1000, 1000000, False), ('R-MEDIUM', 1000, 1000000, True), ('Z-SMALL', 10000, 10000, False), ('R-SMALL', 10000, 10000, True), ] for msg, count, size, random in tests: with test_files(args.path, count, size, random) as path: dt_create, dt_update, dt_extract, dt_delete = measurement_run(args, path) total_size_MB = count * size / 1e06 file_size_formatted = format_file_size(size) content = 'random' if random else 'all-zero' fmt = '%s-%-10s %9.2f MB/s (%d * %s %s files: %.2fs)' print(fmt % ('C', msg, total_size_MB / dt_create, count, file_size_formatted, content, dt_create)) print(fmt % ('R', msg, total_size_MB / dt_extract, count, file_size_formatted, content, dt_extract)) print(fmt % ('U', msg, total_size_MB / dt_update, count, file_size_formatted, content, dt_update)) print(fmt % ('D', msg, total_size_MB / dt_delete, count, file_size_formatted, content, dt_delete)) @with_repository(fake='dry_run', exclusive=True, compatibility=(Manifest.Operation.WRITE,)) def do_create(self, args, repository, manifest=None, key=None): """Create new archive""" matcher = PatternMatcher(fallback=True) matcher.add_inclexcl(args.patterns) def create_inner(archive, cache, fso): # Add cache dir to inode_skip list skip_inodes = set() try: st = os.stat(get_cache_dir()) skip_inodes.add((st.st_ino, st.st_dev)) except OSError: pass # Add local repository dir to inode_skip list if not args.location.host: try: st = os.stat(args.location.path) skip_inodes.add((st.st_ino, st.st_dev)) except OSError: pass logger.debug('Processing files ...') if args.content_from_command: path = args.stdin_name mode = args.stdin_mode user = args.stdin_user group = args.stdin_group if not dry_run: try: try: env = prepare_subprocess_env(system=True) proc = subprocess.Popen(args.paths, stdout=subprocess.PIPE, env=env, preexec_fn=ignore_sigint) except (FileNotFoundError, PermissionError) as e: raise CommandError(f'Failed to execute command: {e}') status = fso.process_pipe(path=path, cache=cache, fd=proc.stdout, mode=mode, user=user, group=group) rc = proc.wait() if rc != 0: raise CommandError(f'Command {args.paths[0]!r} exited with status {rc}') except BackupError as e: raise Error(f'{path!r}: {e}') else: status = '-' self.print_file_status(status, path) elif args.paths_from_command or args.paths_from_stdin: paths_sep = eval_escapes(args.paths_delimiter) if args.paths_delimiter is not None else '\n' if args.paths_from_command: try: env = prepare_subprocess_env(system=True) proc = subprocess.Popen(args.paths, stdout=subprocess.PIPE, env=env, preexec_fn=ignore_sigint) except (FileNotFoundError, PermissionError) as e: raise CommandError(f'Failed to execute command: {e}') pipe_bin = proc.stdout else: # args.paths_from_stdin == True pipe_bin = sys.stdin.buffer pipe = TextIOWrapper(pipe_bin, errors='surrogateescape') for path in iter_separated(pipe, paths_sep): strip_prefix = get_strip_prefix(path) path = os.path.normpath(path) try: with backup_io('stat'): st = os_stat(path=path, parent_fd=None, name=None, follow_symlinks=False) status = self._process_any(path=path, parent_fd=None, name=None, st=st, fso=fso, cache=cache, read_special=args.read_special, dry_run=dry_run, strip_prefix=strip_prefix) except BackupError as e: self.print_warning_instance(BackupWarning(path, e)) status = 'E' if status == 'C': self.print_warning_instance(FileChangedWarning(path)) self.print_file_status(status, path) if args.paths_from_command: rc = proc.wait() if rc != 0: raise CommandError(f'Command {args.paths[0]!r} exited with status {rc}') else: for path in args.paths: if path == '-': # stdin path = args.stdin_name mode = args.stdin_mode user = args.stdin_user group = args.stdin_group if not dry_run: try: status = fso.process_pipe(path=path, cache=cache, fd=sys.stdin.buffer, mode=mode, user=user, group=group) except BackupError as e: self.print_warning_instance(BackupWarning(path, e)) status = 'E' else: status = '-' self.print_file_status(status, path) continue strip_prefix = get_strip_prefix(path) path = os.path.normpath(path) try: with backup_io('stat'): st = os_stat(path=path, parent_fd=None, name=None, follow_symlinks=False) restrict_dev = st.st_dev if args.one_file_system else None self._rec_walk(path=path, parent_fd=None, name=None, fso=fso, cache=cache, matcher=matcher, exclude_caches=args.exclude_caches, exclude_if_present=args.exclude_if_present, keep_exclude_tags=args.keep_exclude_tags, skip_inodes=skip_inodes, restrict_dev=restrict_dev, read_special=args.read_special, dry_run=dry_run, strip_prefix=strip_prefix) # if we get back here, we've finished recursing into , # we do not ever want to get back in there (even if path is given twice as recursion root) skip_inodes.add((st.st_ino, st.st_dev)) except BackupError as e: # this comes from os.stat, self._rec_walk has own exception handler self.print_warning_instance(BackupWarning(path, e)) continue if not dry_run: if args.progress: archive.stats.show_progress(final=True) archive.stats += fso.stats if sig_int: # do not save the archive if the user ctrl-c-ed - it is valid, but incomplete. # we already have a checkpoint archive in this case. raise Error("Got Ctrl-C / SIGINT.") else: archive.save(comment=args.comment, timestamp=args.timestamp) args.stats |= args.json if args.stats: if args.json: json_print(basic_json_data(manifest, cache=cache, extra={ 'archive': archive, })) else: log_multi(DASHES, str(archive), DASHES, STATS_HEADER, str(archive.stats), str(cache), DASHES, logger=logging.getLogger('borg.output.stats')) self.output_filter = args.output_filter self.output_list = args.output_list self.noflags = args.nobsdflags or args.noflags self.noacls = args.noacls self.noxattrs = args.noxattrs self.exclude_nodump = args.exclude_nodump dry_run = args.dry_run t0 = utcnow() t0_monotonic = time.monotonic() logger.info('Creating archive at "%s"' % args.location.processed) if not dry_run: with Cache(repository, key, manifest, progress=args.progress, lock_wait=self.lock_wait, permit_adhoc_cache=args.no_cache_sync, cache_mode=args.files_cache_mode, iec=args.iec) as cache: archive = Archive(repository, key, manifest, args.location.archive, cache=cache, create=True, checkpoint_interval=args.checkpoint_interval, numeric_ids=args.numeric_ids, noatime=not args.atime, noctime=args.noctime, progress=args.progress, chunker_params=args.chunker_params, start=t0, start_monotonic=t0_monotonic, log_json=args.log_json, iec=args.iec) metadata_collector = MetadataCollector(noatime=not args.atime, noctime=args.noctime, noflags=args.nobsdflags or args.noflags, noacls=args.noacls, noxattrs=args.noxattrs, numeric_ids=args.numeric_ids, nobirthtime=args.nobirthtime) cp = ChunksProcessor(cache=cache, key=key, add_item=archive.add_item, write_checkpoint=archive.write_checkpoint, checkpoint_interval=args.checkpoint_interval, rechunkify=False) fso = FilesystemObjectProcessors(metadata_collector=metadata_collector, cache=cache, key=key, process_file_chunks=cp.process_file_chunks, add_item=archive.add_item, chunker_params=args.chunker_params, show_progress=args.progress, sparse=args.sparse, log_json=args.log_json, iec=args.iec, file_status_printer=self.print_file_status) create_inner(archive, cache, fso) else: create_inner(None, None, None) def _process_any(self, *, path, parent_fd, name, st, fso, cache, read_special, dry_run, strip_prefix): """ Call the right method on the given FilesystemObjectProcessor. """ if dry_run: return '-' elif stat.S_ISREG(st.st_mode): return fso.process_file(path=path, parent_fd=parent_fd, name=name, st=st, cache=cache, strip_prefix=strip_prefix) elif stat.S_ISDIR(st.st_mode): return fso.process_dir(path=path, parent_fd=parent_fd, name=name, st=st, strip_prefix=strip_prefix) elif stat.S_ISLNK(st.st_mode): if not read_special: return fso.process_symlink(path=path, parent_fd=parent_fd, name=name, st=st, strip_prefix=strip_prefix) else: try: st_target = os_stat(path=path, parent_fd=parent_fd, name=name, follow_symlinks=True) except OSError: special = False else: special = is_special(st_target.st_mode) if special: return fso.process_file(path=path, parent_fd=parent_fd, name=name, st=st_target, cache=cache, flags=flags_special_follow, strip_prefix=strip_prefix) else: return fso.process_symlink(path=path, parent_fd=parent_fd, name=name, st=st, strip_prefix=strip_prefix) elif stat.S_ISFIFO(st.st_mode): if not read_special: return fso.process_fifo(path=path, parent_fd=parent_fd, name=name, st=st, strip_prefix=strip_prefix) else: return fso.process_file(path=path, parent_fd=parent_fd, name=name, st=st, cache=cache, flags=flags_special, strip_prefix=strip_prefix) elif stat.S_ISCHR(st.st_mode): if not read_special: return fso.process_dev(path=path, parent_fd=parent_fd, name=name, st=st, dev_type='c', strip_prefix=strip_prefix) else: return fso.process_file(path=path, parent_fd=parent_fd, name=name, st=st, cache=cache, flags=flags_special, strip_prefix=strip_prefix) elif stat.S_ISBLK(st.st_mode): if not read_special: return fso.process_dev(path=path, parent_fd=parent_fd, name=name, st=st, dev_type='b', strip_prefix=strip_prefix) else: return fso.process_file(path=path, parent_fd=parent_fd, name=name, st=st, cache=cache, flags=flags_special, strip_prefix=strip_prefix) elif stat.S_ISSOCK(st.st_mode): # Ignore unix sockets return elif stat.S_ISDOOR(st.st_mode): # Ignore Solaris doors return elif stat.S_ISPORT(st.st_mode): # Ignore Solaris event ports return else: self.print_warning('Unknown file type: %s', path) return def _rec_walk(self, *, path, parent_fd, name, fso, cache, matcher, exclude_caches, exclude_if_present, keep_exclude_tags, skip_inodes, restrict_dev, read_special, dry_run, strip_prefix): """ Process *path* (or, preferably, parent_fd/name) recursively according to the various parameters. This should only raise on critical errors. Per-item errors must be handled within this method. """ if sig_int and sig_int.action_done(): # the user says "get out of here!" and we have already completed the desired action. return status = None try: recurse_excluded_dir = False if matcher.match(path): with backup_io('stat'): st = os_stat(path=path, parent_fd=parent_fd, name=name, follow_symlinks=False) else: self.print_file_status('x', path) # get out here as quickly as possible: # we only need to continue if we shall recurse into an excluded directory. # if we shall not recurse, then do not even touch (stat()) the item, it # could trigger an error, e.g. if access is forbidden, see #3209. if not matcher.recurse_dir: return recurse_excluded_dir = True with backup_io('stat'): st = os_stat(path=path, parent_fd=parent_fd, name=name, follow_symlinks=False) if not stat.S_ISDIR(st.st_mode): return if (st.st_ino, st.st_dev) in skip_inodes: return # if restrict_dev is given, we do not want to recurse into a new filesystem, # but we WILL save the mountpoint directory (or more precise: the root # directory of the mounted filesystem that shadows the mountpoint dir). recurse = restrict_dev is None or st.st_dev == restrict_dev if self.exclude_nodump: # Ignore if nodump flag is set with backup_io('flags'): if get_flags(path=path, st=st) & stat.UF_NODUMP: self.print_file_status('x', path) return if not stat.S_ISDIR(st.st_mode): # directories cannot go in this branch because they can be excluded based on tag # files they might contain status = self._process_any(path=path, parent_fd=parent_fd, name=name, st=st, fso=fso, cache=cache, read_special=read_special, dry_run=dry_run, strip_prefix=strip_prefix) else: with OsOpen(path=path, parent_fd=parent_fd, name=name, flags=flags_dir, noatime=True, op='dir_open') as child_fd: # child_fd is None for directories on windows, in that case a race condition check is not possible. if child_fd is not None: with backup_io('fstat'): st = stat_update_check(st, os.fstat(child_fd)) if recurse: tag_names = dir_is_tagged(path, exclude_caches, exclude_if_present) if tag_names: # if we are already recursing in an excluded dir, we do not need to do anything else than # returning (we do not need to archive or recurse into tagged directories), see #3991: if not recurse_excluded_dir: if keep_exclude_tags: if not dry_run: fso.process_dir_with_fd(path=path, fd=child_fd, st=st, strip_prefix=strip_prefix) for tag_name in tag_names: tag_path = os.path.join(path, tag_name) self._rec_walk( path=tag_path, parent_fd=child_fd, name=tag_name, fso=fso, cache=cache, matcher=matcher, exclude_caches=exclude_caches, exclude_if_present=exclude_if_present, keep_exclude_tags=keep_exclude_tags, skip_inodes=skip_inodes, restrict_dev=restrict_dev, read_special=read_special, dry_run=dry_run, strip_prefix=strip_prefix) self.print_file_status('x', path) return if not recurse_excluded_dir: if not dry_run: status = fso.process_dir_with_fd(path=path, fd=child_fd, st=st, strip_prefix=strip_prefix) else: status = '-' if recurse: with backup_io('scandir'): entries = helpers.scandir_inorder(path=path, fd=child_fd) for dirent in entries: normpath = os.path.normpath(os.path.join(path, dirent.name)) self._rec_walk( path=normpath, parent_fd=child_fd, name=dirent.name, fso=fso, cache=cache, matcher=matcher, exclude_caches=exclude_caches, exclude_if_present=exclude_if_present, keep_exclude_tags=keep_exclude_tags, skip_inodes=skip_inodes, restrict_dev=restrict_dev, read_special=read_special, dry_run=dry_run, strip_prefix=strip_prefix) except BackupError as e: self.print_warning_instance(BackupWarning(path, e)) status = 'E' if status == 'C': self.print_warning_instance(FileChangedWarning(path)) if not recurse_excluded_dir: self.print_file_status(status, path) @staticmethod def build_filter(matcher, peek_and_store_hardlink_masters, strip_components): if strip_components: def item_filter(item): matched = matcher.match(item.path) and os.sep.join(item.path.split(os.sep)[strip_components:]) peek_and_store_hardlink_masters(item, matched) return matched else: def item_filter(item): matched = matcher.match(item.path) peek_and_store_hardlink_masters(item, matched) return matched return item_filter @with_repository(compatibility=(Manifest.Operation.READ,)) @with_archive def do_extract(self, args, repository, manifest, key, archive): """Extract archive contents""" # be restrictive when restoring files, restore permissions later if sys.getfilesystemencoding() == 'ascii': logger.warning('Warning: File system encoding is "ascii", extracting non-ascii filenames will not be supported.') if sys.platform.startswith(('linux', 'freebsd', 'netbsd', 'openbsd', 'darwin', )): logger.warning('Hint: You likely need to fix your locale setup. E.g. install locales and use: LANG=en_US.UTF-8') matcher = self.build_matcher(args.patterns, args.paths) progress = args.progress output_list = args.output_list dry_run = args.dry_run stdout = args.stdout sparse = args.sparse strip_components = args.strip_components dirs = [] partial_extract = not matcher.empty() or strip_components hardlink_masters = {} if partial_extract or not has_link else None def peek_and_store_hardlink_masters(item, matched): # not has_link: # OS does not have hardlink capability thus we need to remember the chunks so that # we can extract all hardlinks as separate normal (not-hardlinked) files instead. # # partial_extract and not matched and hardlinkable: # we do not extract the very first hardlink, so we need to remember the chunks # in hardlinks_master, so we can use them when we extract some 2nd+ hardlink item # that has no chunks list. if ((not has_link or (partial_extract and not matched and hardlinkable(item.mode))) and (item.get('hardlink_master', True) and 'source' not in item)): hardlink_masters[item.get('path')] = (item.get('chunks'), None) filter = self.build_filter(matcher, peek_and_store_hardlink_masters, strip_components) if progress: pi = ProgressIndicatorPercent(msg='%5.1f%% Extracting: %s', step=0.1, msgid='extract') pi.output('Calculating total archive size for the progress indicator (might take long for large archives)') extracted_size = sum(item.get_size(hardlink_masters) for item in archive.iter_items(filter)) pi.total = extracted_size else: pi = None for item in archive.iter_items(filter, partial_extract=partial_extract, preload=True, hardlink_masters=hardlink_masters): orig_path = item.path if strip_components: item.path = os.sep.join(orig_path.split(os.sep)[strip_components:]) if not args.dry_run: while dirs and not item.path.startswith(dirs[-1].path): dir_item = dirs.pop(-1) try: archive.extract_item(dir_item, stdout=stdout) except BackupError as e: self.print_warning_instance(BackupWarning(remove_surrogates(dir_item.path), e)) if output_list: logging.getLogger('borg.output.list').info(remove_surrogates(item.path)) try: if dry_run: archive.extract_item(item, dry_run=True, pi=pi) else: if stat.S_ISDIR(item.mode): dirs.append(item) archive.extract_item(item, stdout=stdout, restore_attrs=False) else: archive.extract_item(item, stdout=stdout, sparse=sparse, hardlink_masters=hardlink_masters, stripped_components=strip_components, original_path=orig_path, pi=pi) except BackupError as e: self.print_warning_instance(BackupWarning(remove_surrogates(orig_path), e)) if pi: pi.finish() if not args.dry_run: pi = ProgressIndicatorPercent(total=len(dirs), msg='Setting directory permissions %3.0f%%', msgid='extract.permissions') while dirs: pi.show() dir_item = dirs.pop(-1) try: archive.extract_item(dir_item, stdout=stdout) except BackupError as e: self.print_warning_instance(BackupWarning(remove_surrogates(dir_item.path), e)) for pattern in matcher.get_unmatched_include_patterns(): self.print_warning_instance(IncludePatternNeverMatchedWarning(pattern)) if pi: # clear progress output pi.finish() @with_repository(compatibility=(Manifest.Operation.READ,)) @with_archive def do_export_tar(self, args, repository, manifest, key, archive): """Export archive contents as a tarball""" self.output_list = args.output_list # A quick note about the general design of tar_filter and tarfile; # The tarfile module of Python can provide some compression mechanisms # by itself, using the builtin gzip, bz2 and lzma modules (and "tarmodes" # such as "w:xz"). # # Doing so would have three major drawbacks: # For one the compressor runs on the same thread as the program using the # tarfile, stealing valuable CPU time from Borg and thus reducing throughput. # Then this limits the available options - what about lz4? Brotli? zstd? # The third issue is that systems can ship more optimized versions than those # built into Python, e.g. pigz or pxz, which can use more than one thread for # compression. # # Therefore we externalize compression by using a filter program, which has # none of these drawbacks. The only issue of using an external filter is # that it has to be installed -- hardly a problem, considering that # the decompressor must be installed as well to make use of the exported tarball! filter = get_tar_filter(args.tarfile, decompress=False) if args.tar_filter == 'auto' else args.tar_filter tarstream = dash_open(args.tarfile, 'wb') tarstream_close = args.tarfile != '-' with create_filter_process(filter, stream=tarstream, stream_close=tarstream_close, inbound=False) as _stream: self._export_tar(args, archive, _stream) def _export_tar(self, args, archive, tarstream): matcher = self.build_matcher(args.patterns, args.paths) progress = args.progress output_list = args.output_list strip_components = args.strip_components partial_extract = not matcher.empty() or strip_components hardlink_masters = {} if partial_extract else None def peek_and_store_hardlink_masters(item, matched): if ((partial_extract and not matched and hardlinkable(item.mode)) and (item.get('hardlink_master', True) and 'source' not in item)): hardlink_masters[item.get('path')] = (item.get('chunks'), None) filter = self.build_filter(matcher, peek_and_store_hardlink_masters, strip_components) # The | (pipe) symbol instructs tarfile to use a streaming mode of operation # where it never seeks on the passed fileobj. tar = tarfile.open(fileobj=tarstream, mode='w|', format=tarfile.GNU_FORMAT) if progress: pi = ProgressIndicatorPercent(msg='%5.1f%% Processing: %s', step=0.1, msgid='extract') pi.output('Calculating size') extracted_size = sum(item.get_size(hardlink_masters) for item in archive.iter_items(filter)) pi.total = extracted_size else: pi = None def item_content_stream(item): """ Return a file-like object that reads from the chunks of *item*. """ chunk_iterator = archive.pipeline.fetch_many([chunk_id for chunk_id, _, _ in item.chunks], is_preloaded=True) if pi: info = [remove_surrogates(item.path)] return ChunkIteratorFileWrapper(chunk_iterator, lambda read_bytes: pi.show(increase=len(read_bytes), info=info)) else: return ChunkIteratorFileWrapper(chunk_iterator) def item_to_tarinfo(item, original_path): """ Transform a Borg *item* into a tarfile.TarInfo object. Return a tuple (tarinfo, stream), where stream may be a file-like object that represents the file contents, if any, and is None otherwise. When *tarinfo* is None, the *item* cannot be represented as a TarInfo object and should be skipped. """ # If we would use the PAX (POSIX) format (which we currently don't), # we can support most things that aren't possible with classic tar # formats, including GNU tar, such as: # atime, ctime, possibly Linux capabilities (security.* xattrs) # and various additions supported by GNU tar in POSIX mode. stream = None tarinfo = tarfile.TarInfo() tarinfo.name = item.path tarinfo.mtime = item.mtime / 1e9 tarinfo.mode = stat.S_IMODE(item.mode) tarinfo.uid = item.uid tarinfo.gid = item.gid tarinfo.uname = item.user or '' tarinfo.gname = item.group or '' # The linkname in tar has the same dual use the 'source' attribute of Borg items, # i.e. for symlinks it means the destination, while for hardlinks it refers to the # file. # Since hardlinks in tar have a different type code (LNKTYPE) the format might # support hardlinking arbitrary objects (including symlinks and directories), but # whether implementations actually support that is a whole different question... tarinfo.linkname = "" modebits = stat.S_IFMT(item.mode) if modebits == stat.S_IFREG: tarinfo.type = tarfile.REGTYPE if 'source' in item: source = os.sep.join(item.source.split(os.sep)[strip_components:]) if hardlink_masters is None: linkname = source else: chunks, linkname = hardlink_masters.get(item.source, (None, source)) if linkname: # Master was already added to the archive, add a hardlink reference to it. tarinfo.type = tarfile.LNKTYPE tarinfo.linkname = linkname elif chunks is not None: # The item which has the chunks was not put into the tar, therefore # we do that now and update hardlink_masters to reflect that. item.chunks = chunks tarinfo.size = item.get_size() stream = item_content_stream(item) hardlink_masters[item.get('source') or original_path] = (None, item.path) else: tarinfo.size = item.get_size() stream = item_content_stream(item) elif modebits == stat.S_IFDIR: tarinfo.type = tarfile.DIRTYPE elif modebits == stat.S_IFLNK: tarinfo.type = tarfile.SYMTYPE tarinfo.linkname = item.source elif modebits == stat.S_IFBLK: tarinfo.type = tarfile.BLKTYPE tarinfo.devmajor = os.major(item.rdev) tarinfo.devminor = os.minor(item.rdev) elif modebits == stat.S_IFCHR: tarinfo.type = tarfile.CHRTYPE tarinfo.devmajor = os.major(item.rdev) tarinfo.devminor = os.minor(item.rdev) elif modebits == stat.S_IFIFO: tarinfo.type = tarfile.FIFOTYPE else: self.print_warning('%s: unsupported file type %o for tar export', remove_surrogates(item.path), modebits) return None, stream return tarinfo, stream for item in archive.iter_items(filter, partial_extract=partial_extract, preload=True, hardlink_masters=hardlink_masters): orig_path = item.path if strip_components: item.path = os.sep.join(orig_path.split(os.sep)[strip_components:]) tarinfo, stream = item_to_tarinfo(item, orig_path) if tarinfo: if output_list: logging.getLogger('borg.output.list').info(remove_surrogates(orig_path)) tar.addfile(tarinfo, stream) if pi: pi.finish() # This does not close the fileobj (tarstream) we passed to it -- a side effect of the | mode. tar.close() for pattern in matcher.get_unmatched_include_patterns(): self.print_warning_instance(IncludePatternNeverMatchedWarning(pattern)) @with_repository(compatibility=(Manifest.Operation.READ,)) @with_archive def do_diff(self, args, repository, manifest, key, archive): """Diff contents of two archives""" def print_json_output(diff, path): print(json.dumps({"path": path, "changes": [j for j, str in diff]}, sort_keys=True, cls=BorgJsonEncoder)) def print_text_output(diff, path): print("{:<19} {}".format(' '.join([str for j, str in diff]), path)) print_output = print_json_output if args.json_lines else print_text_output archive1 = archive archive2 = Archive(repository, key, manifest, args.archive2, consider_part_files=args.consider_part_files) cp1 = archive1.metadata.get('chunker_params') cp2 = archive2.metadata.get('chunker_params') if args.same_chunker_params: can_compare_chunk_ids = True # enforce it elif cp1 is not None and cp2 is not None: # we know chunker params of both archives can_compare_chunk_ids = normalize_chunker_params(cp1) == normalize_chunker_params(cp2) if not can_compare_chunk_ids: self.print_warning('--chunker-params are different between archives, diff will be slow.', wc=None) else: # we do not know chunker params of at least one of the archives can_compare_chunk_ids = False self.print_warning('--chunker-params might be different between archives, diff will be slow.\n' 'If you know for certain that they are the same, pass --same-chunker-params ' 'to override this check.', wc=None) matcher = self.build_matcher(args.patterns, args.paths) diffs = Archive.compare_archives_iter(archive1, archive2, matcher, can_compare_chunk_ids=can_compare_chunk_ids, content_only=args.content_only) # Conversion to string and filtering for diff.equal to save memory if sorting diffs = ((path, diff.changes()) for path, diff in diffs if not diff.equal) if args.sort: diffs = sorted(diffs) for path, diff in diffs: print_output(diff, remove_surrogates(path)) for pattern in matcher.get_unmatched_include_patterns(): self.print_warning_instance(IncludePatternNeverMatchedWarning(pattern)) @with_repository(exclusive=True, cache=True, compatibility=(Manifest.Operation.CHECK,)) @with_archive def do_rename(self, args, repository, manifest, key, cache, archive): """Rename an existing archive""" archive.rename(args.name) manifest.write() repository.commit(compact=False) cache.commit() def maybe_checkpoint(self, *, checkpoint_func, checkpoint_interval): checkpointed = False sig_int_triggered = sig_int and sig_int.action_triggered() if sig_int_triggered or checkpoint_interval and time.monotonic() - self.last_checkpoint > checkpoint_interval: if sig_int_triggered: logger.info('checkpoint requested: starting checkpoint creation...') checkpoint_func() checkpointed = True self.last_checkpoint = time.monotonic() if sig_int_triggered: sig_int.action_completed() logger.info('checkpoint requested: finished checkpoint creation!') return checkpointed @with_repository(exclusive=True, manifest=False) def do_delete(self, args, repository): """Delete an existing repository or archives""" archive_filter_specified = any((args.first, args.last, args.prefix is not None, args.glob_archives)) explicit_archives_specified = args.location.archive or args.archives self.output_list = args.output_list if archive_filter_specified and explicit_archives_specified: raise CommandError('Mixing archive filters and explicitly named archives is not supported.') if archive_filter_specified or explicit_archives_specified: self._delete_archives(args, repository) else: self._delete_repository(args, repository) def _delete_archives(self, args, repository): """Delete archives""" dry_run = args.dry_run manifest, key = Manifest.load(repository, (Manifest.Operation.DELETE,)) if args.location.archive or args.archives: archives = list(args.archives) if args.location.archive: archives.insert(0, args.location.archive) archive_names = tuple(archives) else: args.consider_checkpoints = True archive_names = tuple(x.name for x in manifest.archives.list_considering(args)) if not archive_names: return if args.forced == 2: deleted = False logger_list = logging.getLogger('borg.output.list') for i, archive_name in enumerate(archive_names, 1): try: current_archive = manifest.archives.pop(archive_name) except KeyError: self.print_warning('Archive %s not found (%d/%d).', archive_name, i, len(archive_names)) else: deleted = True if self.output_list: msg = 'Would delete: {} ({}/{})' if dry_run else 'Deleted archive: {} ({}/{})' logger_list.info(msg.format(format_archive(current_archive), i, len(archive_names))) if dry_run: logger.info('Finished dry-run.') elif deleted: manifest.write() # note: might crash in compact() after committing the repo repository.commit(compact=False) self.print_warning('Done. Run "borg check --repair" to clean up the mess.', wc=None) else: self.print_warning('Aborted.', wc=None) return stats = Statistics(iec=args.iec) with Cache(repository, key, manifest, progress=args.progress, lock_wait=self.lock_wait, iec=args.iec) as cache: def checkpoint_func(): manifest.write() repository.commit(compact=False, save_space=args.save_space) cache.commit() msg_delete = 'Would delete archive: {} ({}/{})' if dry_run else 'Deleting archive: {} ({}/{})' msg_not_found = 'Archive {} not found ({}/{}).' logger_list = logging.getLogger('borg.output.list') uncommitted_deletes = 0 for i, archive_name in enumerate(archive_names, 1): if sig_int and sig_int.action_done(): break try: archive_info = manifest.archives[archive_name] except KeyError: self.print_warning(msg_not_found, archive_name, i, len(archive_names), wt="curly") else: if self.output_list: logger_list.info(msg_delete.format(format_archive(archive_info), i, len(archive_names))) if not dry_run: archive = Archive(repository, key, manifest, archive_name, cache=cache, consider_part_files=args.consider_part_files) archive.delete(stats, progress=args.progress, forced=args.forced) checkpointed = self.maybe_checkpoint(checkpoint_func=checkpoint_func, checkpoint_interval=args.checkpoint_interval) uncommitted_deletes = 0 if checkpointed else (uncommitted_deletes + 1) if sig_int: # Ctrl-C / SIGINT: do not checkpoint (commit) again, we already have a checkpoint in this case. raise Error("Got Ctrl-C / SIGINT.") elif uncommitted_deletes > 0: checkpoint_func() if args.stats: log_multi(DASHES, STATS_HEADER, stats.summary.format(label='Deleted data:', stats=stats), str(cache), DASHES, logger=logging.getLogger('borg.output.stats')) def _delete_repository(self, args, repository): """Delete a repository""" dry_run = args.dry_run keep_security_info = args.keep_security_info if not args.cache_only: if args.forced == 0: # without --force, we let the user see the archives list and confirm. id = bin_to_hex(repository.id) location = repository._location.canonical_path() msg = [] try: manifest, key = Manifest.load(repository, Manifest.NO_OPERATION_CHECK) n_archives = len(manifest.archives) msg.append(f"You requested to completely DELETE the following repository " f"*including* {n_archives} archives it contains:") except NoManifestError: n_archives = None msg.append("You requested to completely DELETE the following repository " "*including* all archives it may contain:") msg.append(DASHES) msg.append(f"Repository ID: {id}") msg.append(f"Location: {location}") if self.output_list: msg.append("") msg.append("Archives:") if n_archives is not None: if n_archives > 0: for archive_info in manifest.archives.list(sort_by=['ts']): msg.append(format_archive(archive_info)) else: msg.append("This repository seems to not have any archives.") else: msg.append("This repository seems to have no manifest, so we can't " "tell anything about its contents.") msg.append(DASHES) msg.append("Type 'YES' if you understand this and want to continue: ") msg = '\n'.join(msg) if not yes(msg, false_msg="Aborting.", invalid_msg='Invalid answer, aborting.', truish=('YES',), retry=False, env_var_override='BORG_DELETE_I_KNOW_WHAT_I_AM_DOING'): raise CancelledByUser() if not dry_run: repository.destroy() logger.info("Repository deleted.") if not keep_security_info: SecurityManager.destroy(repository) else: logger.info("Would delete repository.") logger.info("Would %s security info." % ("keep" if keep_security_info else "delete")) if not dry_run: Cache.destroy(repository) logger.info("Cache deleted.") else: logger.info("Would delete cache.") def do_mount(self, args): """Mount archive or an entire repository as a FUSE filesystem""" # Perform these checks before opening the repository and asking for a passphrase. from .fuse_impl import llfuse, BORG_FUSE_IMPL if llfuse is None: raise RTError('borg mount not available: no FUSE support, BORG_FUSE_IMPL=%s.' % BORG_FUSE_IMPL) if not os.path.isdir(args.mountpoint) or not os.access(args.mountpoint, os.R_OK | os.W_OK | os.X_OK): raise RTError('%s: Mount point must be a writable directory' % args.mountpoint) self._do_mount(args) @with_repository(compatibility=(Manifest.Operation.READ,)) def _do_mount(self, args, repository, manifest, key): from .fuse import FuseOperations with cache_if_remote(repository, decrypted_cache=key) as cached_repo: operations = FuseOperations(key, repository, manifest, args, cached_repo) logger.info("Mounting filesystem") try: operations.mount(args.mountpoint, args.options, args.foreground) except RuntimeError: # Relevant error message already printed to stderr by FUSE raise RTError("FUSE mount failed") def do_umount(self, args): """un-mount the FUSE filesystem""" umount(args.mountpoint) @with_repository(compatibility=(Manifest.Operation.READ,)) def do_list(self, args, repository, manifest, key): """List archive or repository contents""" if args.location.archive: if args.json: raise CommandError('The --json option is only valid for listing archives, not archive contents.') self._list_archive(args, repository, manifest, key) else: if args.json_lines: raise CommandError('The --json-lines option is only valid for listing archive contents, not archives.') self._list_repository(args, repository, manifest, key) def _list_archive(self, args, repository, manifest, key): matcher = self.build_matcher(args.patterns, args.paths) if args.format is not None: format = args.format elif args.short: format = "{path}{NL}" else: format = "{mode} {user:6} {group:6} {size:8} {mtime} {path}{extra}{NL}" def _list_inner(cache): archive = Archive(repository, key, manifest, args.location.archive, cache=cache, consider_part_files=args.consider_part_files) formatter = ItemFormatter(archive, format, json_lines=args.json_lines) for item in archive.iter_items(lambda item: matcher.match(item.path)): sys.stdout.write(formatter.format_item(item)) # Only load the cache if it will be used if ItemFormatter.format_needs_cache(format): with Cache(repository, key, manifest, lock_wait=self.lock_wait) as cache: _list_inner(cache) else: _list_inner(cache=None) def _list_repository(self, args, repository, manifest, key): if args.format is not None: format = args.format elif args.short: format = "{archive}{NL}" else: format = "{archive:<36} {time} [{id}]{NL}" formatter = ArchiveFormatter(format, repository, manifest, key, json=args.json, iec=args.iec) output_data = [] for archive_info in manifest.archives.list_considering(args): if args.json: output_data.append(formatter.get_item_data(archive_info)) else: sys.stdout.write(formatter.format_item(archive_info)) if args.json: json_print(basic_json_data(manifest, extra={ 'archives': output_data })) @with_repository(cache=True, compatibility=(Manifest.Operation.READ,)) def do_info(self, args, repository, manifest, key, cache): """Show archive details such as disk space used""" if any((args.location.archive, args.first, args.last, args.prefix is not None, args.glob_archives)): self._info_archives(args, repository, manifest, key, cache) else: self._info_repository(args, repository, manifest, key, cache) def _info_archives(self, args, repository, manifest, key, cache): def format_cmdline(cmdline): return remove_surrogates(shlex.join(cmdline)) if args.location.archive: archive_names = (args.location.archive,) else: args.consider_checkpoints = True archive_names = tuple(x.name for x in manifest.archives.list_considering(args)) output_data = [] for i, archive_name in enumerate(archive_names, 1): archive = Archive(repository, key, manifest, archive_name, cache=cache, consider_part_files=args.consider_part_files, iec=args.iec) info = archive.info() if args.json: output_data.append(info) else: info['duration'] = format_timedelta(timedelta(seconds=info['duration'])) info['command_line'] = format_cmdline(info['command_line']) print(textwrap.dedent(""" Archive name: {name} Archive fingerprint: {id} Comment: {comment} Hostname: {hostname} Username: {username} Time (start): {start} Time (end): {end} Duration: {duration} Number of files: {stats[nfiles]} Command line: {command_line} Utilization of maximum supported archive size: {limits[max_archive_size]:.0%} ------------------------------------------------------------------------------ Original size Compressed size Deduplicated size This archive: {stats[original_size]:>20s} {stats[compressed_size]:>20s} {stats[deduplicated_size]:>20s} {cache} """).strip().format(cache=cache, **info)) if not args.json and len(archive_names) - i: print() if args.json: json_print(basic_json_data(manifest, cache=cache, extra={ 'archives': output_data, })) def _info_repository(self, args, repository, manifest, key, cache): info = basic_json_data(manifest, cache=cache, extra={ 'security_dir': cache.security_manager.dir, }) if args.json: json_print(info) else: encryption = 'Encrypted: ' if key.NAME in ('plaintext', 'authenticated'): encryption += 'No' else: encryption += 'Yes (%s)' % key.NAME if key.NAME.startswith('key file'): encryption += '\nKey file: %s' % key.find_key() info['encryption'] = encryption print(textwrap.dedent(""" Repository ID: {id} Location: {location} {encryption} Cache: {cache.path} Security dir: {security_dir} """).strip().format( id=bin_to_hex(repository.id), location=repository._location.canonical_path(), **info)) print(DASHES) print(STATS_HEADER) print(str(cache)) @with_repository(exclusive=True, compatibility=(Manifest.Operation.DELETE,)) def do_prune(self, args, repository, manifest, key): """Prune repository archives according to specified rules""" if not any((args.secondly, args.minutely, args.hourly, args.daily, args.weekly, args.monthly, args.yearly, args.within)): raise CommandError('At least one of the "keep-within", "keep-last", ' '"keep-secondly", "keep-minutely", "keep-hourly", "keep-daily", ' '"keep-weekly", "keep-monthly" or "keep-yearly" settings must be specified.') if args.prefix is not None: args.glob_archives = args.prefix + '*' checkpoint_re = r'\.checkpoint(\.\d+)?' archives_checkpoints = manifest.archives.list(glob=args.glob_archives, consider_checkpoints=True, match_end=r'(%s)?\Z' % checkpoint_re, sort_by=['ts'], reverse=True) is_checkpoint = re.compile(r'(%s)\Z' % checkpoint_re).search checkpoints = [arch for arch in archives_checkpoints if is_checkpoint(arch.name)] # keep the latest checkpoint, if there is no later non-checkpoint archive if archives_checkpoints and checkpoints and archives_checkpoints[0] is checkpoints[0]: keep_checkpoints = checkpoints[:1] else: keep_checkpoints = [] checkpoints = set(checkpoints) # ignore all checkpoint archives to avoid keeping one (which is an incomplete backup) # that is newer than a successfully completed backup - and killing the successful backup. archives = [arch for arch in archives_checkpoints if arch not in checkpoints] keep = [] # collect the rule responsible for the keeping of each archive in this dict # keys are archive ids, values are a tuple # (, ) kept_because = {} # find archives which need to be kept because of the keep-within rule if args.within: keep += prune_within(archives, args.within, kept_because) # find archives which need to be kept because of the various time period rules for rule in PRUNING_PATTERNS.keys(): num = getattr(args, rule, None) if num is not None: keep += prune_split(archives, rule, num, kept_because) to_delete = (set(archives) | checkpoints) - (set(keep) | set(keep_checkpoints)) stats = Statistics(iec=args.iec) with Cache(repository, key, manifest, lock_wait=self.lock_wait, iec=args.iec) as cache: def checkpoint_func(): manifest.write() repository.commit(compact=False, save_space=args.save_space) cache.commit() list_logger = logging.getLogger('borg.output.list') # set up counters for the progress display to_delete_len = len(to_delete) archives_deleted = 0 uncommitted_deletes = 0 pi = ProgressIndicatorPercent(total=len(to_delete), msg='Pruning archives %3.0f%%', msgid='prune') for archive in archives_checkpoints: if sig_int and sig_int.action_done(): break if archive in to_delete: pi.show() if args.dry_run: log_message = 'Would prune:' else: archives_deleted += 1 log_message = 'Pruning archive (%d/%d):' % (archives_deleted, to_delete_len) archive = Archive(repository, key, manifest, archive.name, cache, consider_part_files=args.consider_part_files) archive.delete(stats, forced=args.forced) checkpointed = self.maybe_checkpoint(checkpoint_func=checkpoint_func, checkpoint_interval=args.checkpoint_interval) uncommitted_deletes = 0 if checkpointed else (uncommitted_deletes + 1) else: if is_checkpoint(archive.name): log_message = 'Keeping checkpoint archive:' else: log_message = 'Keeping archive (rule: {rule} #{num}):'.format( rule=kept_because[archive.id][0], num=kept_because[archive.id][1] ) if args.output_list: list_logger.info("{message:<44} {archive}".format( message=log_message, archive=format_archive(archive) )) pi.finish() if sig_int: # Ctrl-C / SIGINT: do not checkpoint (commit) again, we already have a checkpoint in this case. raise Error("Got Ctrl-C / SIGINT.") elif uncommitted_deletes > 0: checkpoint_func() if args.stats: log_multi(DASHES, STATS_HEADER, stats.summary.format(label='Deleted data:', stats=stats), str(cache), DASHES, logger=logging.getLogger('borg.output.stats')) @with_repository(fake=('tam', 'check_tam', 'disable_tam', 'archives_tam', 'check_archives_tam'), invert_fake=True, manifest=False, exclusive=True) def do_upgrade(self, args, repository, manifest=None, key=None): """upgrade a repository from a previous version""" if args.archives_tam or args.check_archives_tam: with ignore_invalid_archive_tam(): archive_tam_issues = 0 read_only = args.check_archives_tam manifest, key = Manifest.load(repository, (Manifest.Operation.CHECK,), force_tam_not_required=args.force) with Cache(repository, key, manifest) as cache: stats = Statistics() for info in manifest.archives.list(sort_by=['ts']): archive_id = info.id archive_formatted = format_archive(info) cdata = repository.get(archive_id) data = key.decrypt(archive_id, cdata) archive, verified, _ = key.unpack_and_verify_archive(data, force_tam_not_required=True) if not verified: if not read_only: # we do not have an archive TAM yet -> add TAM now! archive = ArchiveItem(internal_dict=archive) archive.cmdline = [safe_decode(arg) for arg in archive.cmdline] data = key.pack_and_authenticate_metadata(archive.as_dict(), context=b'archive') new_archive_id = key.id_hash(data) cache.add_chunk(new_archive_id, data, stats) cache.chunk_decref(archive_id, stats) manifest.archives[info.name] = (new_archive_id, info.ts) print(f"Added archive TAM: {archive_formatted} -> [{bin_to_hex(new_archive_id)}]") else: print(f"Archive TAM missing: {archive_formatted}") archive_tam_issues += 1 else: print(f"Archive TAM present: {archive_formatted}") if not read_only: manifest.write() repository.commit(compact=False) cache.commit() if archive_tam_issues > 0: print(f"Fixed {archive_tam_issues} archives with TAM issues!") print("All archives are TAM authenticated now.") else: print("All archives are TAM authenticated.") else: if archive_tam_issues > 0: self.print_warning(f"Found {archive_tam_issues} archives with TAM issues!") else: print("All archives are TAM authenticated.") elif args.tam or args.check_tam: with ignore_invalid_archive_tam(): manifest_tam_issues = 0 read_only = args.check_tam manifest, key = Manifest.load(repository, (Manifest.Operation.CHECK,), force_tam_not_required=args.force) if not manifest.tam_verified or not manifest.config.get(b'tam_required', False): if not read_only: print('Manifest contents:') for archive_info in manifest.archives.list(sort_by=['ts']): print(format_archive(archive_info)) manifest.config[b'tam_required'] = True manifest.write() repository.commit(compact=False) else: manifest_tam_issues += 1 self.print_warning("Repository Manifest is not TAM verified or a TAM is not required!") if not key.tam_required and hasattr(key, 'change_passphrase'): if not read_only: key.tam_required = True key.change_passphrase(key._passphrase) print('Key updated') if hasattr(key, 'find_key'): print('Key location:', key.find_key()) else: manifest_tam_issues += 1 self.print_warning("Key does not require TAM authentication!") if not tam_required(repository): if not read_only: tam_file = tam_required_file(repository) open(tam_file, 'w').close() print('Updated security database') else: manifest_tam_issues += 1 self.print_warning("Client-side security database does not require a TAM!") if read_only and manifest_tam_issues == 0: print("Manifest authentication setup OK for this client and this repository.") elif args.disable_tam: manifest, key = Manifest.load(repository, Manifest.NO_OPERATION_CHECK, force_tam_not_required=True) if tam_required(repository): os.unlink(tam_required_file(repository)) if key.tam_required and hasattr(key, 'change_passphrase'): key.tam_required = False key.change_passphrase(key._passphrase) print('Key updated') if hasattr(key, 'find_key'): print('Key location:', key.find_key()) manifest.config[b'tam_required'] = False manifest.write() repository.commit(compact=False) else: # mainly for upgrades from Attic repositories, # but also supports borg 0.xx -> 1.0 upgrade. repo = AtticRepositoryUpgrader(args.location.path, create=False) try: repo.upgrade(args.dry_run, inplace=args.inplace, progress=args.progress) except NotImplementedError as e: print("warning: %s" % e) repo = BorgRepositoryUpgrader(args.location.path, create=False) try: repo.upgrade(args.dry_run, inplace=args.inplace, progress=args.progress) except NotImplementedError as e: print("warning: %s" % e) @with_repository(cache=True, exclusive=True, compatibility=(Manifest.Operation.CHECK,)) def do_recreate(self, args, repository, manifest, key, cache): """Re-create archives""" matcher = self.build_matcher(args.patterns, args.paths) self.output_list = args.output_list self.output_filter = args.output_filter recompress = args.recompress != 'never' always_recompress = args.recompress == 'always' recreater = ArchiveRecreater(repository, manifest, key, cache, matcher, exclude_caches=args.exclude_caches, exclude_if_present=args.exclude_if_present, keep_exclude_tags=args.keep_exclude_tags, chunker_params=args.chunker_params, compression=args.compression, recompress=recompress, always_recompress=always_recompress, progress=args.progress, stats=args.stats, file_status_printer=self.print_file_status, checkpoint_interval=args.checkpoint_interval, dry_run=args.dry_run, timestamp=args.timestamp) if args.location.archive: name = args.location.archive if recreater.is_temporary_archive(name): raise CommandError(f'Refusing to work on temporary archive of prior recreate: {name}') if not recreater.recreate(name, args.comment, args.target): raise CommandError('Nothing to do. Archive was not processed.\n' 'Specify at least one pattern, PATH, --comment, re-compression or re-chunking option.') else: if args.target is not None: raise CommandError('--target: Need to specify single archive') for archive in manifest.archives.list(sort_by=['ts']): name = archive.name if recreater.is_temporary_archive(name): continue print('Processing', name) if not recreater.recreate(name, args.comment): logger.info('Skipped archive %s: Nothing to do. Archive was not processed.', name) if not args.dry_run: manifest.write() repository.commit(compact=False) cache.commit() @with_repository(cache=True, exclusive=True, compatibility=(Manifest.Operation.WRITE,)) def do_import_tar(self, args, repository, manifest, key, cache): """Create a backup archive from a tarball""" self.output_filter = args.output_filter self.output_list = args.output_list filter = get_tar_filter(args.tarfile, decompress=True) if args.tar_filter == 'auto' else args.tar_filter tarstream = dash_open(args.tarfile, 'rb') tarstream_close = args.tarfile != '-' with create_filter_process(filter, stream=tarstream, stream_close=tarstream_close, inbound=True) as _stream: self._import_tar(args, repository, manifest, key, cache, _stream) def _import_tar(self, args, repository, manifest, key, cache, tarstream): t0 = utcnow() t0_monotonic = time.monotonic() archive = Archive(repository, key, manifest, args.location.archive, cache=cache, create=True, checkpoint_interval=args.checkpoint_interval, progress=args.progress, chunker_params=args.chunker_params, start=t0, start_monotonic=t0_monotonic, log_json=args.log_json) cp = ChunksProcessor(cache=cache, key=key, add_item=archive.add_item, write_checkpoint=archive.write_checkpoint, checkpoint_interval=args.checkpoint_interval, rechunkify=False) tfo = TarfileObjectProcessors(cache=cache, key=key, process_file_chunks=cp.process_file_chunks, add_item=archive.add_item, chunker_params=args.chunker_params, show_progress=args.progress, log_json=args.log_json, iec=args.iec, file_status_printer=self.print_file_status) tar = tarfile.open(fileobj=tarstream, mode='r|', ignore_zeros=args.ignore_zeros) while True: tarinfo = tar.next() if not tarinfo: break if tarinfo.isreg(): status = tfo.process_file(tarinfo=tarinfo, status='A', type=stat.S_IFREG, tar=tar) archive.stats.nfiles += 1 elif tarinfo.isdir(): status = tfo.process_dir(tarinfo=tarinfo, status='d', type=stat.S_IFDIR) elif tarinfo.issym(): status = tfo.process_link(tarinfo=tarinfo, status='s', type=stat.S_IFLNK) elif tarinfo.islnk(): # tar uses the same hardlink model as borg (rather vice versa); the first instance of a hardlink # is stored as a regular file, later instances are special entries referencing back to the # first instance. status = tfo.process_link(tarinfo=tarinfo, status='h', type=stat.S_IFREG) elif tarinfo.isblk(): status = tfo.process_dev(tarinfo=tarinfo, status='b', type=stat.S_IFBLK) elif tarinfo.ischr(): status = tfo.process_dev(tarinfo=tarinfo, status='c', type=stat.S_IFCHR) elif tarinfo.isfifo(): status = tfo.process_fifo(tarinfo=tarinfo, status='f', type=stat.S_IFIFO) else: status = 'E' self.print_warning('%s: Unsupported tarinfo type %s', tarinfo.name, tarinfo.type) self.print_file_status(status, tarinfo.name) # This does not close the fileobj (tarstream) we passed to it -- a side effect of the | mode. tar.close() if args.progress: archive.stats.show_progress(final=True) archive.stats += tfo.stats archive.save(comment=args.comment, timestamp=args.timestamp) args.stats |= args.json if args.stats: if args.json: json_print(basic_json_data(archive.manifest, cache=archive.cache, extra={ 'archive': archive, })) else: log_multi(DASHES, str(archive), DASHES, STATS_HEADER, str(archive.stats), str(archive.cache), DASHES, logger=logging.getLogger('borg.output.stats')) @with_repository(manifest=False, exclusive=True) def do_with_lock(self, args, repository): """run a user specified command with the repository lock held""" # for a new server, this will immediately take an exclusive lock. # to support old servers, that do not have "exclusive" arg in open() # RPC API, we also do it the old way: # re-write manifest to start a repository transaction - this causes a # lock upgrade to exclusive for remote (and also for local) repositories. # by using manifest=False in the decorator, we avoid having to require # the encryption key (and can operate just with encrypted data). data = repository.get(Manifest.MANIFEST_ID) repository.put(Manifest.MANIFEST_ID, data) # usually, a 0 byte (open for writing) segment file would be visible in the filesystem here. # we write and close this file, to rather have a valid segment file on disk, before invoking the subprocess. # we can only do this for local repositories (with .io), though: if hasattr(repository, 'io'): repository.io.close_segment() env = prepare_subprocess_env(system=True) try: # we exit with the return code we get from the subprocess rc = subprocess.call([args.command] + args.args, env=env) set_ec(rc) except (FileNotFoundError, OSError, ValueError) as e: raise CommandError(f"Error while trying to run '{args.command}': {e}") finally: # we need to commit the "no change" operation we did to the manifest # because it created a new segment file in the repository. if we would # roll back, the same file would be later used otherwise (for other content). # that would be bad if somebody uses rsync with ignore-existing (or # any other mechanism relying on existing segment data not changing). # see issue #1867. repository.commit(compact=False) @with_repository(manifest=False, exclusive=True) def do_compact(self, args, repository): """compact segment files in the repository""" # see the comment in do_with_lock about why we do it like this: data = repository.get(Manifest.MANIFEST_ID) repository.put(Manifest.MANIFEST_ID, data) threshold = args.threshold / 100 repository.commit(compact=True, threshold=threshold, cleanup_commits=args.cleanup_commits) @with_repository(exclusive=True, manifest=False) def do_config(self, args, repository): """get, set, and delete values in a repository or cache config file""" def repo_validate(section, name, value=None, check_value=True): if section not in ['repository', ]: raise ValueError('Invalid section') if name in ['segments_per_dir', 'last_segment_checked', ]: if check_value: try: int(value) except ValueError: raise ValueError('Invalid value') from None elif name in ['max_segment_size', 'additional_free_space', 'storage_quota', ]: if check_value: try: parse_file_size(value) except ValueError: raise ValueError('Invalid value') from None if name == 'storage_quota': if parse_file_size(value) < parse_file_size('10M'): raise ValueError('Invalid value: storage_quota < 10M') elif name == 'max_segment_size': if parse_file_size(value) >= MAX_SEGMENT_SIZE_LIMIT: raise ValueError('Invalid value: max_segment_size >= %d' % MAX_SEGMENT_SIZE_LIMIT) elif name in ['append_only', ]: if check_value and value not in ['0', '1']: raise ValueError('Invalid value') elif name in ['id', ]: if check_value: hex_to_bin(value, length=32) else: raise ValueError('Invalid name') def cache_validate(section, name, value=None, check_value=True): if section not in ['cache', ]: raise ValueError('Invalid section') if name in ['previous_location', ]: if check_value: Location(value) else: raise ValueError('Invalid name') def list_config(config): default_values = { 'version': '1', 'segments_per_dir': str(DEFAULT_SEGMENTS_PER_DIR), 'max_segment_size': str(MAX_SEGMENT_SIZE_LIMIT), 'additional_free_space': '0', 'storage_quota': repository.storage_quota, 'append_only': repository.append_only } print('[repository]') for key in ['version', 'segments_per_dir', 'max_segment_size', 'storage_quota', 'additional_free_space', 'append_only', 'id']: value = config.get('repository', key, fallback=False) if value is None: value = default_values.get(key) if value is None: raise Error('The repository config is missing the %s key which has no default value' % key) print(f'{key} = {value}') for key in ['last_segment_checked', ]: value = config.get('repository', key, fallback=None) if value is None: continue print(f'{key} = {value}') if not args.list: if args.name is None: raise CommandError('No config key name was provided.') try: section, name = args.name.split('.') except ValueError: section = args.cache and "cache" or "repository" name = args.name if args.cache: manifest, key = Manifest.load(repository, (Manifest.Operation.WRITE,)) assert_secure(repository, manifest, self.lock_wait) cache = Cache(repository, key, manifest, lock_wait=self.lock_wait) try: if args.cache: cache.cache_config.load() config = cache.cache_config._config save = cache.cache_config.save validate = cache_validate else: config = repository.config save = lambda: repository.save_config(repository.path, repository.config) # noqa validate = repo_validate if args.delete: validate(section, name, check_value=False) config.remove_option(section, name) if len(config.options(section)) == 0: config.remove_section(section) save() elif args.list: list_config(config) elif args.value: validate(section, name, args.value) if section not in config.sections(): config.add_section(section) config.set(section, name, args.value) save() else: try: print(config.get(section, name)) except (configparser.NoOptionError, configparser.NoSectionError) as e: raise Error(e) finally: if args.cache: cache.close() def do_debug_info(self, args): """display system information for debugging / bug reports""" print(sysinfo()) # Additional debug information print('CRC implementation:', crc32.__name__) print('Process ID:', get_process_id()) @with_repository(compatibility=Manifest.NO_OPERATION_CHECK) def do_debug_dump_archive_items(self, args, repository, manifest, key): """dump (decrypted, decompressed) archive items metadata (not: data)""" archive = Archive(repository, key, manifest, args.location.archive, consider_part_files=args.consider_part_files) for i, item_id in enumerate(archive.metadata.items): data = key.decrypt(item_id, repository.get(item_id)) filename = '%06d_%s.items' % (i, bin_to_hex(item_id)) print('Dumping', filename) with open(filename, 'wb') as fd: fd.write(data) print('Done.') @with_repository(compatibility=Manifest.NO_OPERATION_CHECK) def do_debug_dump_archive(self, args, repository, manifest, key): """dump decoded archive metadata (not: data)""" try: archive_meta_orig = manifest.archives.get_raw_dict()[safe_encode(args.location.archive)] except KeyError: raise Archive.DoesNotExist(args.location.archive) indent = 4 def do_indent(d): return textwrap.indent(json.dumps(d, indent=indent), prefix=' ' * indent) def output(fd): # this outputs megabytes of data for a modest sized archive, so some manual streaming json output fd.write('{\n') fd.write(' "_name": ' + json.dumps(args.location.archive) + ",\n") fd.write(' "_manifest_entry":\n') fd.write(do_indent(prepare_dump_dict(archive_meta_orig))) fd.write(',\n') data = key.decrypt(archive_meta_orig[b'id'], repository.get(archive_meta_orig[b'id'])) archive_org_dict = msgpack.unpackb(data, object_hook=StableDict) fd.write(' "_meta":\n') fd.write(do_indent(prepare_dump_dict(archive_org_dict))) fd.write(',\n') fd.write(' "_items": [\n') unpacker = msgpack.Unpacker(use_list=False, object_hook=StableDict) first = True for item_id in archive_org_dict[b'items']: data = key.decrypt(item_id, repository.get(item_id)) unpacker.feed(data) for item in unpacker: item = prepare_dump_dict(item) if first: first = False else: fd.write(',\n') fd.write(do_indent(item)) fd.write('\n') fd.write(' ]\n}\n') with dash_open(args.path, 'w') as fd: output(fd) @with_repository(compatibility=Manifest.NO_OPERATION_CHECK) def do_debug_dump_manifest(self, args, repository, manifest, key): """dump decoded repository manifest""" data = key.decrypt(None, repository.get(manifest.MANIFEST_ID)) meta = prepare_dump_dict(msgpack.unpackb(data, object_hook=StableDict)) with dash_open(args.path, 'w') as fd: json.dump(meta, fd, indent=4) @with_repository(manifest=False) def do_debug_dump_repo_objs(self, args, repository): """dump (decrypted, decompressed) repo objects, repo index MUST be current/correct""" from .crypto.key import key_factory def decrypt_dump(i, id, cdata, tag=None, segment=None, offset=None): if cdata is not None: give_id = id if id != Manifest.MANIFEST_ID else None data = key.decrypt(give_id, cdata) else: data = b'' tag_str = '' if tag is None else '_' + tag segment_str = '_' + str(segment) if segment is not None else '' offset_str = '_' + str(offset) if offset is not None else '' id_str = '_' + bin_to_hex(id) if id is not None else '' filename = '%08d%s%s%s%s.obj' % (i, segment_str, offset_str, tag_str, id_str) print('Dumping', filename) with open(filename, 'wb') as fd: fd.write(data) if args.ghost: # dump ghosty stuff from segment files: not yet committed objects, deleted / superseded objects, commit tags # set up the key without depending on a manifest obj for id, cdata, tag, segment, offset in repository.scan_low_level(): if tag == TAG_PUT: key = key_factory(repository, cdata) break i = 0 for id, cdata, tag, segment, offset in repository.scan_low_level(segment=args.segment, offset=args.offset): if tag == TAG_PUT: decrypt_dump(i, id, cdata, tag='put', segment=segment, offset=offset) elif tag == TAG_DELETE: decrypt_dump(i, id, None, tag='del', segment=segment, offset=offset) elif tag == TAG_COMMIT: decrypt_dump(i, None, None, tag='commit', segment=segment, offset=offset) i += 1 else: # set up the key without depending on a manifest obj ids = repository.list(limit=1, marker=None) cdata = repository.get(ids[0]) key = key_factory(repository, cdata) marker = None i = 0 while True: result = repository.scan(limit=LIST_SCAN_LIMIT, marker=marker) # must use on-disk order scanning here if not result: break marker = result[-1] for id in result: cdata = repository.get(id) decrypt_dump(i, id, cdata) i += 1 print('Done.') @with_repository(manifest=False) def do_debug_search_repo_objs(self, args, repository): """search for byte sequences in repo objects, repo index MUST be current/correct""" context = 32 def print_finding(info, wanted, data, offset): before = data[offset - context:offset] after = data[offset + len(wanted):offset + len(wanted) + context] print('{}: {} {} {} == {!r} {!r} {!r}'.format(info, before.hex(), wanted.hex(), after.hex(), before, wanted, after)) wanted = args.wanted try: if wanted.startswith('hex:'): wanted = hex_to_bin(wanted[4:]) elif wanted.startswith('str:'): wanted = wanted[4:].encode() else: raise ValueError('unsupported search term') except (ValueError, UnicodeEncodeError): wanted = None if not wanted: raise CommandError('search term needs to be hex:123abc or str:foobar style') from .crypto.key import key_factory # set up the key without depending on a manifest obj ids = repository.list(limit=1, marker=None) cdata = repository.get(ids[0]) key = key_factory(repository, cdata) marker = None last_data = b'' last_id = None i = 0 while True: result = repository.scan(limit=LIST_SCAN_LIMIT, marker=marker) # must use on-disk order scanning here if not result: break marker = result[-1] for id in result: cdata = repository.get(id) give_id = id if id != Manifest.MANIFEST_ID else None data = key.decrypt(give_id, cdata) # try to locate wanted sequence crossing the border of last_data and data boundary_data = last_data[-(len(wanted) - 1):] + data[:len(wanted) - 1] if wanted in boundary_data: boundary_data = last_data[-(len(wanted) - 1 + context):] + data[:len(wanted) - 1 + context] offset = boundary_data.find(wanted) info = '%d %s | %s' % (i, last_id.hex(), id.hex()) print_finding(info, wanted, boundary_data, offset) # try to locate wanted sequence in data count = data.count(wanted) if count: offset = data.find(wanted) # only determine first occurrence's offset info = "%d %s #%d" % (i, id.hex(), count) print_finding(info, wanted, data, offset) last_id, last_data = id, data i += 1 if i % 10000 == 0: print('%d objects processed.' % i) print('Done.') @with_repository(manifest=False) def do_debug_get_obj(self, args, repository): """get object contents from the repository and write it into file""" hex_id = args.id try: id = hex_to_bin(hex_id, length=32) except ValueError as err: raise CommandError(f"object id {hex_id} is invalid [{str(err)}].") try: data = repository.get(id) except Repository.ObjectNotFound: raise RTError("object %s not found." % hex_id) with open(args.path, "wb") as f: f.write(data) print("object %s fetched." % hex_id) @with_repository(compatibility=Manifest.NO_OPERATION_CHECK) def do_debug_id_hash(self, args, repository, manifest, key): """compute id-hash for file contents""" with open(args.path, "rb") as f: data = f.read() id = key.id_hash(data) print(id.hex()) @with_repository(manifest=False, exclusive=True) def do_debug_put_obj(self, args, repository): """put file contents into the repository""" with open(args.path, "rb") as f: data = f.read() hex_id = args.id try: id = hex_to_bin(hex_id, length=32) except ValueError as err: raise CommandError(f"object id {hex_id} is invalid [{str(err)}].") repository.put(id, data) print("object %s put." % hex_id) repository.commit(compact=False) @with_repository(manifest=False, exclusive=True) def do_debug_delete_obj(self, args, repository): """delete the objects with the given IDs from the repo""" modified = False for hex_id in args.ids: try: id = hex_to_bin(hex_id, length=32) except ValueError: print("object id %s is invalid." % hex_id) else: try: repository.delete(id) modified = True print("object %s deleted." % hex_id) except Repository.ObjectNotFound: print("object %s not found." % hex_id) if modified: repository.commit(compact=False) print('Done.') @with_repository(manifest=False, exclusive=True, cache=True, compatibility=Manifest.NO_OPERATION_CHECK) def do_debug_refcount_obj(self, args, repository, manifest, key, cache): """display refcounts for the objects with the given IDs""" for hex_id in args.ids: try: id = hex_to_bin(hex_id, length=32) except ValueError: print("object id %s is invalid." % hex_id) else: try: refcount = cache.chunks[id][0] print("object %s has %d referrers [info from chunks cache]." % (hex_id, refcount)) except KeyError: print("object %s not found [info from chunks cache]." % hex_id) @with_repository(manifest=False, exclusive=True) def do_debug_dump_hints(self, args, repository): """dump repository hints""" if not repository._active_txn: repository.prepare_txn(repository.get_transaction_id()) try: hints = dict( segments=repository.segments, compact=repository.compact, storage_quota_use=repository.storage_quota_use, shadow_index={bin_to_hex(k): v for k, v in repository.shadow_index.items()} ) with dash_open(args.path, 'w') as fd: json.dump(hints, fd, indent=4) finally: repository.rollback() def do_debug_convert_profile(self, args): """convert Borg profile to Python profile""" import marshal with args.output, args.input: marshal.dump(msgpack.unpack(args.input, use_list=False, raw=False), args.output) @with_repository(lock=False, manifest=False) def do_break_lock(self, args, repository): """Break the repository lock (e.g. in case it was left by a dead borg.""" repository.break_lock() Cache.break_lock(repository) helptext = collections.OrderedDict() helptext['patterns'] = textwrap.dedent(''' The path/filenames used as input for the pattern matching start from the currently active recursion root. You usually give the recursion root(s) when invoking borg and these can be either relative or absolute paths. Starting with Borg 1.2, paths that are matched against patterns always appear relative. If you give ``/absolute/`` as root, the paths going into the matcher will start with ``absolute/``. If you give ``../../relative`` as root, the paths will be normalized as ``relative/``. A directory exclusion pattern can end either with or without a slash ('/'). If it ends with a slash, such as `some/path/`, the directory will be included but not its content. If it does not end with a slash, such as `some/path`, both the directory and content will be excluded. Borg supports different pattern styles. To define a non-default style for a specific pattern, prefix it with two characters followed by a colon ':' (i.e. ``fm:path/*``, ``sh:path/**``). `Fnmatch `_, selector `fm:` This is the default style for ``--exclude`` and ``--exclude-from``. These patterns use a variant of shell pattern syntax, with '\\*' matching any number of characters, '?' matching any single character, '[...]' matching any single character specified, including ranges, and '[!...]' matching any character not specified. For the purpose of these patterns, the path separator (backslash for Windows and '/' on other systems) is not treated specially. Wrap meta-characters in brackets for a literal match (i.e. `[?]` to match the literal character `?`). For a path to match a pattern, the full path must match, or it must match from the start of the full path to just before a path separator. Except for the root path, paths will never end in the path separator when matching is attempted. Thus, if a given pattern ends in a path separator, a '\\*' is appended before matching is attempted. A leading path separator is always removed. Shell-style patterns, selector `sh:` This is the default style for ``--pattern`` and ``--patterns-from``. Like fnmatch patterns these are similar to shell patterns. The difference is that the pattern may include `**/` for matching zero or more directory levels, `*` for matching zero or more arbitrary characters with the exception of any path separator. A leading path separator is always removed. Regular expressions, selector `re:` Regular expressions similar to those found in Perl are supported. Unlike shell patterns regular expressions are not required to match the full path and any substring match is sufficient. It is strongly recommended to anchor patterns to the start ('^'), to the end ('$') or both. Path separators (backslash for Windows and '/' on other systems) in paths are always normalized to a forward slash ('/') before applying a pattern. The regular expression syntax is described in the `Python documentation for the re module `_. Path prefix, selector `pp:` This pattern style is useful to match whole sub-directories. The pattern `pp:root/somedir` matches `root/somedir` and everything therein. A leading path separator is always removed. Path full-match, selector `pf:` This pattern style is (only) useful to match full paths. This is kind of a pseudo pattern as it can not have any variable or unspecified parts - the full path must be given. `pf:root/file.ext` matches `root/file.ext` only. A leading path separator is always removed. Implementation note: this is implemented via very time-efficient O(1) hashtable lookups (this means you can have huge amounts of such patterns without impacting performance much). Due to that, this kind of pattern does not respect any context or order. If you use such a pattern to include a file, it will always be included (if the directory recursion encounters it). Other include/exclude patterns that would normally match will be ignored. Same logic applies for exclude. .. note:: `re:`, `sh:` and `fm:` patterns are all implemented on top of the Python SRE engine. It is very easy to formulate patterns for each of these types which requires an inordinate amount of time to match paths. If untrusted users are able to supply patterns, ensure they cannot supply `re:` patterns. Further, ensure that `sh:` and `fm:` patterns only contain a handful of wildcards at most. Exclusions can be passed via the command line option ``--exclude``. When used from within a shell, the patterns should be quoted to protect them from expansion. The ``--exclude-from`` option permits loading exclusion patterns from a text file with one pattern per line. Lines empty or starting with the number sign ('#') after removing whitespace on both ends are ignored. The optional style selector prefix is also supported for patterns loaded from a file. Due to whitespace removal, paths with whitespace at the beginning or end can only be excluded using regular expressions. To test your exclusion patterns without performing an actual backup you can run ``borg create --list --dry-run ...``. Examples:: # Exclude '/home/user/file.o' but not '/home/user/file.odt': $ borg create -e '*.o' backup / # Exclude '/home/user/junk' and '/home/user/subdir/junk' but # not '/home/user/importantjunk' or '/etc/junk': $ borg create -e 'home/*/junk' backup / # Exclude the contents of '/home/user/cache' but not the directory itself: $ borg create -e home/user/cache/ backup / # The file '/home/user/cache/important' is *not* backed up: $ borg create -e home/user/cache/ backup / /home/user/cache/important # The contents of directories in '/home' are not backed up when their name # ends in '.tmp' $ borg create --exclude 're:^home/[^/]+\\.tmp/' backup / # Load exclusions from file $ cat >exclude.txt <`_, e.g. {now:%Y-%m-%d_%H:%M:%S} {utcnow} The current UTC date and time, by default in ISO-8601 format. You can also supply your own `format string `_, e.g. {utcnow:%Y-%m-%d_%H:%M:%S} {user} The user name (or UID, if no name is available) of the user running borg. {pid} The current process ID. {borgversion} The version of borg, e.g.: 1.0.8rc1 {borgmajor} The version of borg, only the major version, e.g.: 1 {borgminor} The version of borg, only major and minor version, e.g.: 1.0 {borgpatch} The version of borg, only major, minor and patch version, e.g.: 1.0.8 If literal curly braces need to be used, double them for escaping:: borg create /path/to/repo::{{literal_text}} Examples:: borg create /path/to/repo::{hostname}-{user}-{utcnow} ... borg create /path/to/repo::{hostname}-{now:%Y-%m-%d_%H:%M:%S} ... borg prune --glob-archives '{hostname}-*' ... .. note:: systemd uses a difficult, non-standard syntax for command lines in unit files (refer to the `systemd.unit(5)` manual page). When invoking borg from unit files, pay particular attention to escaping, especially when using the now/utcnow placeholders, since systemd performs its own %-based variable replacement even in quoted text. To avoid interference from systemd, double all percent signs (``{hostname}-{now:%Y-%m-%d_%H:%M:%S}`` becomes ``{hostname}-{now:%%Y-%%m-%%d_%%H:%%M:%%S}``).\n\n''') helptext['compression'] = textwrap.dedent(''' It is no problem to mix different compression methods in one repo, deduplication is done on the source data chunks (not on the compressed or encrypted data). If some specific chunk was once compressed and stored into the repo, creating another backup that also uses this chunk will not change the stored chunk. So if you use different compression specs for the backups, whichever stores a chunk first determines its compression. See also borg recreate. Compression is lz4 by default. If you want something else, you have to specify what you want. Valid compression specifiers are: none Do not compress. lz4 Use lz4 compression. Very high speed, very low compression. (default) zstd[,L] Use zstd ("zstandard") compression, a modern wide-range algorithm. If you do not explicitly give the compression level L (ranging from 1 to 22), it will use level 3. Archives compressed with zstd are not compatible with borg < 1.1.4. zlib[,L] Use zlib ("gz") compression. Medium speed, medium compression. If you do not explicitly give the compression level L (ranging from 0 to 9), it will use level 6. Giving level 0 (means "no compression", but still has zlib protocol overhead) is usually pointless, you better use "none" compression. lzma[,L] Use lzma ("xz") compression. Low speed, high compression. If you do not explicitly give the compression level L (ranging from 0 to 9), it will use level 6. Giving levels above 6 is pointless and counterproductive because it does not compress better due to the buffer size used by borg - but it wastes lots of CPU cycles and RAM. auto,C[,L] Use a built-in heuristic to decide per chunk whether to compress or not. The heuristic tries with lz4 whether the data is compressible. For incompressible data, it will not use compression (uses "none"). For compressible data, it uses the given C[,L] compression - with C[,L] being any valid compression specifier. obfuscate,SPEC,C[,L] Use compressed-size obfuscation to make fingerprinting attacks based on the observable stored chunk size more difficult. Note: - You must combine this with encryption, or it won't make any sense. - Your repo size will be bigger, of course. - A chunk is limited by the constant ``MAX_DATA_SIZE`` (cur. ~20MiB). The SPEC value determines how the size obfuscation works: *Relative random reciprocal size variation* (multiplicative) Size will increase by a factor, relative to the compressed data size. Smaller factors are used often, larger factors rarely. Available factors:: 1: 0.01 .. 100 2: 0.1 .. 1,000 3: 1 .. 10,000 4: 10 .. 100,000 5: 100 .. 1,000,000 6: 1,000 .. 10,000,000 Example probabilities for SPEC ``1``:: 90 % 0.01 .. 0.1 9 % 0.1 .. 1 0.9 % 1 .. 10 0.09% 10 .. 100 *Randomly sized padding up to the given size* (additive) :: 110: 1kiB (2 ^ (SPEC - 100)) ... 120: 1MiB ... 123: 8MiB (max.) Examples:: borg create --compression lz4 REPO::ARCHIVE data borg create --compression zstd REPO::ARCHIVE data borg create --compression zstd,10 REPO::ARCHIVE data borg create --compression zlib REPO::ARCHIVE data borg create --compression zlib,1 REPO::ARCHIVE data borg create --compression auto,lzma,6 REPO::ARCHIVE data borg create --compression auto,lzma ... borg create --compression obfuscate,110,none ... borg create --compression obfuscate,3,auto,zstd,10 ... borg create --compression obfuscate,2,zstd,6 ...\n\n''') def do_help(self, parser, commands, args): if not args.topic: parser.print_help() elif args.topic in self.helptext: print(rst_to_terminal(self.helptext[args.topic])) elif args.topic in commands: if args.epilog_only: print(commands[args.topic].epilog) elif args.usage_only: commands[args.topic].epilog = None commands[args.topic].print_help() else: commands[args.topic].print_help() else: msg_lines = [] msg_lines += ['No help available on %s.' % args.topic] msg_lines += ['Try one of the following:'] msg_lines += [' Commands: %s' % ', '.join(sorted(commands.keys()))] msg_lines += [' Topics: %s' % ', '.join(sorted(self.helptext.keys()))] parser.error('\n'.join(msg_lines)) def do_subcommand_help(self, parser, args): """display infos about subcommand""" parser.print_help() do_maincommand_help = do_subcommand_help def preprocess_args(self, args): deprecations = [ # ('--old', '--new' or None, 'Warning: "--old" has been deprecated. Use "--new" instead.'), ('--noatime', None, 'Warning: "--noatime" has been deprecated because it is the default now.'), ('--nobsdflags', None, 'Warning: "--nobsdflags" has been deprecated. Use --noflags instead.'), ('--numeric-owner', None, 'Warning: "--numeric-owner" has been deprecated. Use --numeric-ids instead.'), ('--remote-ratelimit', None, 'Warning: "--remote-ratelimit" has been deprecated. Use --upload-ratelimit instead.'), ('--remote-buffer', None, 'Warning: "--remote-buffer" has been deprecated. Use --upload-buffer instead.'), ('--prefix', None, 'Warning: "--prefix" has been deprecated. Use "--glob-archives \'yourprefix*\'" (-a) instead.'), ] for i, arg in enumerate(args[:]): for old_name, new_name, warning in deprecations: if arg.startswith(old_name): if new_name is not None: args[i] = arg.replace(old_name, new_name) print(warning, file=sys.stderr) return args class CommonOptions: """ Support class to allow specifying common options directly after the top-level command. Normally options can only be specified on the parser defining them, which means that generally speaking *all* options go after all sub-commands. This is annoying for common options in scripts, e.g. --remote-path or logging options. This class allows adding the same set of options to both the top-level parser and the final sub-command parsers (but not intermediary sub-commands, at least for now). It does so by giving every option's target name ("dest") a suffix indicating its level -- no two options in the parser hierarchy can have the same target -- then, after parsing the command line, multiple definitions are resolved. Defaults are handled by only setting them on the top-level parser and setting a sentinel object in all sub-parsers, which then allows one to discern which parser supplied the option. """ def __init__(self, define_common_options, suffix_precedence): """ *define_common_options* should be a callable taking one argument, which will be a argparse.Parser.add_argument-like function. *define_common_options* will be called multiple times, and should call the passed function to define common options exactly the same way each time. *suffix_precedence* should be a tuple of the suffixes that will be used. It is ordered from lowest precedence to highest precedence: An option specified on the parser belonging to index 0 is overridden if the same option is specified on any parser with a higher index. """ self.define_common_options = define_common_options self.suffix_precedence = suffix_precedence # Maps suffixes to sets of target names. # E.g. common_options["_subcommand"] = {..., "log_level", ...} self.common_options = dict() # Set of options with the 'append' action. self.append_options = set() # This is the sentinel object that replaces all default values in parsers # below the top-level parser. self.default_sentinel = object() def add_common_group(self, parser, suffix, provide_defaults=False): """ Add common options to *parser*. *provide_defaults* must only be True exactly once in a parser hierarchy, at the top level, and False on all lower levels. The default is chosen accordingly. *suffix* indicates the suffix to use internally. It also indicates which precedence the *parser* has for common options. See *suffix_precedence* of __init__. """ assert suffix in self.suffix_precedence def add_argument(*args, **kwargs): if 'dest' in kwargs: kwargs.setdefault('action', 'store') assert kwargs['action'] in ('help', 'store_const', 'store_true', 'store_false', 'store', 'append') is_append = kwargs['action'] == 'append' if is_append: self.append_options.add(kwargs['dest']) assert kwargs['default'] == [], 'The default is explicitly constructed as an empty list in resolve()' else: self.common_options.setdefault(suffix, set()).add(kwargs['dest']) kwargs['dest'] += suffix if not provide_defaults: # Interpolate help now, in case the %(default)d (or so) is mentioned, # to avoid producing incorrect help output. # Assumption: Interpolated output can safely be interpolated again, # which should always be the case. # Note: We control all inputs. kwargs['help'] = kwargs['help'] % kwargs if not is_append: kwargs['default'] = self.default_sentinel common_group.add_argument(*args, **kwargs) common_group = parser.add_argument_group('Common options') self.define_common_options(add_argument) def resolve(self, args: argparse.Namespace): # Namespace has "in" but otherwise is not like a dict. """ Resolve the multiple definitions of each common option to the final value. """ for suffix in self.suffix_precedence: # From highest level to lowest level, so the "most-specific" option wins, e.g. # "borg --debug create --info" shall result in --info being effective. for dest in self.common_options.get(suffix, []): # map_from is this suffix' option name, e.g. log_level_subcommand # map_to is the target name, e.g. log_level map_from = dest + suffix map_to = dest # Retrieve value; depending on the action it may not exist, but usually does # (store_const/store_true/store_false), either because the action implied a default # or a default is explicitly supplied. # Note that defaults on lower levels are replaced with default_sentinel. # Only the top level has defaults. value = getattr(args, map_from, self.default_sentinel) if value is not self.default_sentinel: # value was indeed specified on this level. Transfer value to target, # and un-clobber the args (for tidiness - you *cannot* use the suffixed # names for other purposes, obviously). setattr(args, map_to, value) try: delattr(args, map_from) except AttributeError: pass # Options with an "append" action need some special treatment. Instead of # overriding values, all specified values are merged together. for dest in self.append_options: option_value = [] for suffix in self.suffix_precedence: # Find values of this suffix, if any, and add them to the final list extend_from = dest + suffix if extend_from in args: values = getattr(args, extend_from) delattr(args, extend_from) option_value.extend(values) setattr(args, dest, option_value) def build_parser(self): # You can use :ref:`xyz` in the following usage pages. However, for plain-text view, # e.g. through "borg ... --help", define a substitution for the reference here. # It will replace the entire :ref:`foo` verbatim. rst_plain_text_references = { 'a_status_oddity': '"I am seeing ‘A’ (added) status for a unchanged file!?"', 'separate_compaction': '"Separate compaction"', 'list_item_flags': '"Item flags"', 'borg_patterns': '"borg help patterns"', 'borg_placeholders': '"borg help placeholders"', 'key_files': 'Internals -> Data structures and file formats -> Key files', 'borg_key_export': 'borg key export --help', } def process_epilog(epilog): epilog = textwrap.dedent(epilog).splitlines() try: mode = borg.doc_mode except AttributeError: mode = 'command-line' if mode in ('command-line', 'build_usage'): epilog = [line for line in epilog if not line.startswith('.. man')] epilog = '\n'.join(epilog) if mode == 'command-line': epilog = rst_to_terminal(epilog, rst_plain_text_references) return epilog def define_common_options(add_common_option): add_common_option('-h', '--help', action='help', help='show this help message and exit') add_common_option('--critical', dest='log_level', action='store_const', const='critical', default='warning', help='work on log level CRITICAL') add_common_option('--error', dest='log_level', action='store_const', const='error', default='warning', help='work on log level ERROR') add_common_option('--warning', dest='log_level', action='store_const', const='warning', default='warning', help='work on log level WARNING (default)') add_common_option('--info', '-v', '--verbose', dest='log_level', action='store_const', const='info', default='warning', help='work on log level INFO') add_common_option('--debug', dest='log_level', action='store_const', const='debug', default='warning', help='enable debug output, work on log level DEBUG') add_common_option('--debug-topic', metavar='TOPIC', dest='debug_topics', action='append', default=[], help='enable TOPIC debugging (can be specified multiple times). ' 'The logger path is borg.debug. if TOPIC is not fully qualified.') add_common_option('-p', '--progress', dest='progress', action='store_true', help='show progress information') add_common_option('--iec', dest='iec', action='store_true', help='format using IEC units (1KiB = 1024B)') add_common_option('--log-json', dest='log_json', action='store_true', help='Output one JSON object per log line instead of formatted text.') add_common_option('--lock-wait', metavar='SECONDS', dest='lock_wait', type=int, default=1, help='wait at most SECONDS for acquiring a repository/cache lock (default: %(default)d).') add_common_option('--bypass-lock', dest='lock', action='store_false', default=argparse.SUPPRESS, # only create args attribute if option is specified help='Bypass locking mechanism') add_common_option('--show-version', dest='show_version', action='store_true', help='show/log the borg version') add_common_option('--show-rc', dest='show_rc', action='store_true', help='show/log the return code (rc)') add_common_option('--umask', metavar='M', dest='umask', type=lambda s: int(s, 8), default=UMASK_DEFAULT, help='set umask to M (local only, default: %(default)04o)') add_common_option('--remote-path', metavar='PATH', dest='remote_path', help='use PATH as borg executable on the remote (default: "borg")') add_common_option('--remote-ratelimit', metavar='RATE', dest='upload_ratelimit', type=int, help='deprecated, use ``--upload-ratelimit`` instead') add_common_option('--upload-ratelimit', metavar='RATE', dest='upload_ratelimit', type=int, help='set network upload rate limit in kiByte/s (default: 0=unlimited)') add_common_option('--remote-buffer', metavar='UPLOAD_BUFFER', dest='upload_buffer', type=int, help='deprecated, use ``--upload-buffer`` instead') add_common_option('--upload-buffer', metavar='UPLOAD_BUFFER', dest='upload_buffer', type=int, help='set network upload buffer size in MiB. (default: 0=no buffer)') add_common_option('--consider-part-files', dest='consider_part_files', action='store_true', help='treat part files like normal files (e.g. to list/extract them)') add_common_option('--debug-profile', metavar='FILE', dest='debug_profile', default=None, help='Write execution profile in Borg format into FILE. For local use a Python-' 'compatible file can be generated by suffixing FILE with ".pyprof".') add_common_option('--rsh', metavar='RSH', dest='rsh', help="Use this command to connect to the 'borg serve' process (default: 'ssh')") def define_exclude_and_patterns(add_option, *, tag_files=False, strip_components=False): add_option('-e', '--exclude', metavar='PATTERN', dest='patterns', type=parse_exclude_pattern, action='append', help='exclude paths matching PATTERN') add_option('--exclude-from', metavar='EXCLUDEFILE', action=ArgparseExcludeFileAction, help='read exclude patterns from EXCLUDEFILE, one per line') add_option('--pattern', metavar='PATTERN', action=ArgparsePatternAction, help='include/exclude paths matching PATTERN') add_option('--patterns-from', metavar='PATTERNFILE', action=ArgparsePatternFileAction, help='read include/exclude patterns from PATTERNFILE, one per line') if tag_files: add_option('--exclude-caches', dest='exclude_caches', action='store_true', help='exclude directories that contain a CACHEDIR.TAG file ' '(http://www.bford.info/cachedir/spec.html)') add_option('--exclude-if-present', metavar='NAME', dest='exclude_if_present', action='append', type=str, help='exclude directories that are tagged by containing a filesystem object with ' 'the given NAME') add_option('--keep-exclude-tags', dest='keep_exclude_tags', action='store_true', help='if tag objects are specified with ``--exclude-if-present``, ' 'don\'t omit the tag objects themselves from the backup archive') if strip_components: add_option('--strip-components', metavar='NUMBER', dest='strip_components', type=int, default=0, help='Remove the specified number of leading path elements. ' 'Paths with fewer elements will be silently skipped.') def define_exclusion_group(subparser, **kwargs): exclude_group = subparser.add_argument_group('Include/Exclude options') define_exclude_and_patterns(exclude_group.add_argument, **kwargs) return exclude_group def define_archive_filters_group(subparser, *, sort_by=True, first_last=True): filters_group = subparser.add_argument_group('Archive filters', 'Archive filters can be applied to repository targets.') group = filters_group.add_mutually_exclusive_group() group.add_argument('-P', '--prefix', metavar='PREFIX', dest='prefix', type=PrefixSpec, action=Highlander, help='only consider archive names starting with this prefix. (deprecated)') group.add_argument('-a', '--glob-archives', metavar='GLOB', dest='glob_archives', type=GlobSpec, action=Highlander, help='only consider archive names matching the glob. ' 'sh: rules apply (without actually using the sh: prefix), see "borg help patterns".') if sort_by: sort_by_default = 'timestamp' filters_group.add_argument('--sort-by', metavar='KEYS', dest='sort_by', type=SortBySpec, default=sort_by_default, help='Comma-separated list of sorting keys; valid keys are: {}; default is: {}' .format(', '.join(AI_HUMAN_SORT_KEYS), sort_by_default)) if first_last: group = filters_group.add_mutually_exclusive_group() group.add_argument('--first', metavar='N', dest='first', default=0, type=positive_int_validator, help='consider first N archives after other filters were applied') group.add_argument('--last', metavar='N', dest='last', default=0, type=positive_int_validator, help='consider last N archives after other filters were applied') def define_borg_mount(parser): parser.set_defaults(func=self.do_mount) parser.add_argument('location', metavar='REPOSITORY_OR_ARCHIVE', type=location_validator(), help='repository or archive to mount') parser.add_argument('--consider-checkpoints', action='store_true', dest='consider_checkpoints', help='Show checkpoint archives in the repository contents list (default: hidden).') parser.add_argument('mountpoint', metavar='MOUNTPOINT', type=str, help='where to mount filesystem') parser.add_argument('-f', '--foreground', dest='foreground', action='store_true', help='stay in foreground, do not daemonize') parser.add_argument('-o', dest='options', type=str, action=Highlander, help='Extra mount options') parser.add_argument('--numeric-owner', dest='numeric_ids', action='store_true', help='deprecated, use ``--numeric-ids`` instead') parser.add_argument('--numeric-ids', dest='numeric_ids', action='store_true', help='use numeric user and group identifiers from archive(s)') define_archive_filters_group(parser) parser.add_argument('paths', metavar='PATH', nargs='*', type=PathSpec, help='paths to extract; patterns are supported') define_exclusion_group(parser, strip_components=True) parser = argparse.ArgumentParser(prog=self.prog, description='Borg - Deduplicated Backups', add_help=False) # paths and patterns must have an empty list as default everywhere parser.set_defaults(fallback2_func=functools.partial(self.do_maincommand_help, parser), paths=[], patterns=[]) parser.common_options = self.CommonOptions(define_common_options, suffix_precedence=('_maincommand', '_midcommand', '_subcommand')) parser.add_argument('-V', '--version', action='version', version='%(prog)s ' + __version__, help='show version number and exit') parser.common_options.add_common_group(parser, '_maincommand', provide_defaults=True) common_parser = argparse.ArgumentParser(add_help=False, prog=self.prog) common_parser.set_defaults(paths=[], patterns=[]) parser.common_options.add_common_group(common_parser, '_subcommand') mid_common_parser = argparse.ArgumentParser(add_help=False, prog=self.prog) mid_common_parser.set_defaults(paths=[], patterns=[]) parser.common_options.add_common_group(mid_common_parser, '_midcommand') # borg mount mount_epilog = process_epilog(""" This command mounts an archive as a FUSE filesystem. This can be useful for browsing an archive or restoring individual files. Unless the ``--foreground`` option is given the command will run in the background until the filesystem is ``umounted``. The command ``borgfs`` provides a wrapper for ``borg mount``. This can also be used in fstab entries: ``/path/to/repo /mnt/point fuse.borgfs defaults,noauto 0 0`` To allow a regular user to use fstab entries, add the ``user`` option: ``/path/to/repo /mnt/point fuse.borgfs defaults,noauto,user 0 0`` For FUSE configuration and mount options, see the mount.fuse(8) manual page. Borg's default behavior is to use the archived user and group names of each file and map them to the system's respective user and group ids. Alternatively, using ``numeric-ids`` will instead use the archived user and group ids without any mapping. The ``uid`` and ``gid`` mount options (implemented by Borg) can be used to override the user and group ids of all files (i.e., ``borg mount -o uid=1000,gid=1000``). The man page references ``user_id`` and ``group_id`` mount options (implemented by fuse) which specify the user and group id of the mount owner (aka, the user who does the mounting). It is set automatically by libfuse (or the filesystem if libfuse is not used). However, you should not specify these manually. Unlike the ``uid`` and ``gid`` mount options which affect all files, ``user_id`` and ``group_id`` affect the user and group id of the mounted (base) directory. Additional mount options supported by borg: - ``versions``: when used with a repository mount, this gives a merged, versioned view of the files in the archives. EXPERIMENTAL, layout may change in future. - ``allow_damaged_files``: by default damaged files (where missing chunks were replaced with runs of zeros by ``borg check --repair``) are not readable and return EIO (I/O error). Set this option to read such files. - ``ignore_permissions``: for security reasons the ``default_permissions`` mount option is internally enforced by borg. ``ignore_permissions`` can be given to not enforce ``default_permissions``. The BORG_MOUNT_DATA_CACHE_ENTRIES environment variable is meant for advanced users to tweak the performance. It sets the number of cached data chunks; additional memory usage can be up to ~8 MiB times this number. The default is the number of CPU cores. When the daemonized process receives a signal or crashes, it does not unmount. Unmounting in these cases could cause an active rsync or similar process to unintentionally delete data. When running in the foreground ^C/SIGINT unmounts cleanly, but other signals or crashes do not. """) if parser.prog == 'borgfs': parser.description = self.do_mount.__doc__ parser.epilog = mount_epilog parser.formatter_class = argparse.RawDescriptionHelpFormatter parser.help = 'mount repository' define_borg_mount(parser) return parser subparsers = parser.add_subparsers(title='required arguments', metavar='') # borg benchmark benchmark_epilog = process_epilog("These commands do various benchmarks.") subparser = subparsers.add_parser('benchmark', parents=[mid_common_parser], add_help=False, description='benchmark command', epilog=benchmark_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, help='benchmark command') benchmark_parsers = subparser.add_subparsers(title='required arguments', metavar='') subparser.set_defaults(fallback_func=functools.partial(self.do_subcommand_help, subparser)) bench_crud_epilog = process_epilog(""" This command benchmarks borg CRUD (create, read, update, delete) operations. It creates input data below the given PATH and backups this data into the given REPO. The REPO must already exist (it could be a fresh empty repo or an existing repo, the command will create / read / update / delete some archives named borg-benchmark-crud\\* there. Make sure you have free space there, you'll need about 1GB each (+ overhead). If your repository is encrypted and borg needs a passphrase to unlock the key, use:: BORG_PASSPHRASE=mysecret borg benchmark crud REPO PATH Measurements are done with different input file sizes and counts. The file contents are very artificial (either all zero or all random), thus the measurement results do not necessarily reflect performance with real data. Also, due to the kind of content used, no compression is used in these benchmarks. C- == borg create (1st archive creation, no compression, do not use files cache) C-Z- == all-zero files. full dedup, this is primarily measuring reader/chunker/hasher. C-R- == random files. no dedup, measuring throughput through all processing stages. R- == borg extract (extract archive, dry-run, do everything, but do not write files to disk) R-Z- == all zero files. Measuring heavily duplicated files. R-R- == random files. No duplication here, measuring throughput through all processing stages, except writing to disk. U- == borg create (2nd archive creation of unchanged input files, measure files cache speed) The throughput value is kind of virtual here, it does not actually read the file. U-Z- == needs to check the 2 all-zero chunks' existence in the repo. U-R- == needs to check existence of a lot of different chunks in the repo. D- == borg delete archive (delete last remaining archive, measure deletion + compaction) D-Z- == few chunks to delete / few segments to compact/remove. D-R- == many chunks to delete / many segments to compact/remove. Please note that there might be quite some variance in these measurements. Try multiple measurements and having a otherwise idle machine (and network, if you use it). """) subparser = benchmark_parsers.add_parser('crud', parents=[common_parser], add_help=False, description=self.do_benchmark_crud.__doc__, epilog=bench_crud_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, help='benchmarks borg CRUD (create, extract, update, delete).') subparser.set_defaults(func=self.do_benchmark_crud) subparser.add_argument('location', metavar='REPOSITORY', type=location_validator(archive=False), help='repository to use for benchmark (must exist)') subparser.add_argument('path', metavar='PATH', help='path were to create benchmark input data') # borg break-lock break_lock_epilog = process_epilog(""" This command breaks the repository and cache locks. Please use carefully and only while no borg process (on any machine) is trying to access the Cache or the Repository. """) subparser = subparsers.add_parser('break-lock', parents=[common_parser], add_help=False, description=self.do_break_lock.__doc__, epilog=break_lock_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, help='break repository and cache locks') subparser.set_defaults(func=self.do_break_lock) subparser.add_argument('location', metavar='REPOSITORY', nargs='?', default='', type=location_validator(archive=False), help='repository for which to break the locks') # borg check check_epilog = process_epilog(""" The check command verifies the consistency of a repository and its archives. It consists of two major steps: 1. Checking the consistency of the repository itself. This includes checking the segment magic headers, and both the metadata and data of all objects in the segments. The read data is checked by size and CRC. Bit rot and other types of accidental damage can be detected this way. Running the repository check can be split into multiple partial checks using ``--max-duration``. When checking a remote repository, please note that the checks run on the server and do not cause significant network traffic. 2. Checking consistency and correctness of the archive metadata and optionally archive data (requires ``--verify-data``). This includes ensuring that the repository manifest exists, the archive metadata chunk is present, and that all chunks referencing files (items) in the archive exist. This requires reading archive and file metadata, but not data. To cryptographically verify the file (content) data integrity pass ``--verify-data``, but keep in mind that this requires reading all data and is hence very time consuming. When checking archives of a remote repository, archive checks run on the client machine because they require decrypting data and therefore the encryption key. Both steps can also be run independently. Pass ``--repository-only`` to run the repository checks only, or pass ``--archives-only`` to run the archive checks only. The ``--max-duration`` option can be used to split a long-running repository check into multiple partial checks. After the given number of seconds the check is interrupted. The next partial check will continue where the previous one stopped, until the full repository has been checked. Assuming a complete check would take 7 hours, then running a daily check with ``--max-duration=3600`` (1 hour) would result in one full repository check per week. Doing a full repository check aborts any previous partial check; the next partial check will restart from the beginning. With partial repository checks you can run neither archive checks, nor enable repair mode. Consequently, if you want to use ``--max-duration`` you must also pass ``--repository-only``, and must not pass ``--archives-only``, nor ``--repair``. **Warning:** Please note that partial repository checks (i.e. running it with ``--max-duration``) can only perform non-cryptographic checksum checks on the segment files. A full repository check (i.e. without ``--max-duration``) can also do a repository index check. Enabling partial repository checks excepts archive checks for the same reason. Therefore partial checks may be useful with very large repositories only where a full check would take too long. The ``--verify-data`` option will perform a full integrity verification (as opposed to checking the CRC32 of the segment) of data, which means reading the data from the repository, decrypting and decompressing it. It is a complete cryptographic verification and hence very time consuming, but will detect any accidental and malicious corruption. Tamper-resistance is only guaranteed for encrypted repositories against attackers without access to the keys. You can not use ``--verify-data`` with ``--repository-only``. About repair mode +++++++++++++++++ The check command is a readonly task by default. If any corruption is found, Borg will report the issue and proceed with checking. To actually repair the issues found, pass ``--repair``. .. note:: ``--repair`` is a **POTENTIALLY DANGEROUS FEATURE** and might lead to data loss! This does not just include data that was previously lost anyway, but might include more data for kinds of corruption it is not capable of dealing with. **BE VERY CAREFUL!** Pursuant to the previous warning it is also highly recommended to test the reliability of the hardware running Borg with stress testing software. This especially includes storage and memory testers. Unreliable hardware might lead to additional data loss. It is highly recommended to create a backup of your repository before running in repair mode (i.e. running it with ``--repair``). Repair mode will attempt to fix any corruptions found. Fixing corruptions does not mean recovering lost data: Borg can not magically restore data lost due to e.g. a hardware failure. Repairing a repository means sacrificing some data for the sake of the repository as a whole and the remaining data. Hence it is, by definition, a potentially lossy task. In practice, repair mode hooks into both the repository and archive checks: 1. When checking the repository's consistency, repair mode will try to recover as many objects from segments with integrity errors as possible, and ensure that the index is consistent with the data stored in the segments. 2. When checking the consistency and correctness of archives, repair mode might remove whole archives from the manifest if their archive metadata chunk is corrupt or lost. On a chunk level (i.e. the contents of files), repair mode will replace corrupt or lost chunks with a same-size replacement chunk of zeroes. If a previously zeroed chunk reappears, repair mode will restore this lost chunk using the new chunk. Lastly, repair mode will also delete orphaned chunks (e.g. caused by read errors while creating the archive). Most steps taken by repair mode have a one-time effect on the repository, like removing a lost archive from the repository. However, replacing a corrupt or lost chunk with an all-zero replacement will have an ongoing effect on the repository: When attempting to extract a file referencing an all-zero chunk, the ``extract`` command will distinctly warn about it. The FUSE filesystem created by the ``mount`` command will reject reading such a "zero-patched" file unless a special mount option is given. As mentioned earlier, Borg might be able to "heal" a "zero-patched" file in repair mode, if all its previously lost chunks reappear (e.g. via a later backup). This is achieved by Borg not only keeping track of the all-zero replacement chunks, but also by keeping metadata about the lost chunks. In repair mode Borg will check whether a previously lost chunk reappeared and will replace the all-zero replacement chunk by the reappeared chunk. If all lost chunks of a "zero-patched" file reappear, this effectively "heals" the file. Consequently, if lost chunks were repaired earlier, it is advised to run ``--repair`` a second time after creating some new backups. """) subparser = subparsers.add_parser('check', parents=[common_parser], add_help=False, description=self.do_check.__doc__, epilog=check_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, help='verify repository') subparser.set_defaults(func=self.do_check) subparser.add_argument('location', metavar='REPOSITORY_OR_ARCHIVE', nargs='?', default='', type=location_validator(), help='repository or archive to check consistency of') subparser.add_argument('--repository-only', dest='repo_only', action='store_true', help='only perform repository checks') subparser.add_argument('--archives-only', dest='archives_only', action='store_true', help='only perform archives checks') subparser.add_argument('--verify-data', dest='verify_data', action='store_true', help='perform cryptographic archive data integrity verification ' '(conflicts with ``--repository-only``)') subparser.add_argument('--repair', dest='repair', action='store_true', help='attempt to repair any inconsistencies found') subparser.add_argument('--save-space', dest='save_space', action='store_true', help='work slower, but using less space') subparser.add_argument('--max-duration', metavar='SECONDS', dest='max_duration', type=int, default=0, help='do only a partial repo check for max. SECONDS seconds (Default: unlimited)') define_archive_filters_group(subparser) # borg compact compact_epilog = process_epilog(""" This command frees repository space by compacting segments. Use this regularly to avoid running out of space - you do not need to use this after each borg command though. It is especially useful after deleting archives, because only compaction will really free repository space. borg compact does not need a key, so it is possible to invoke it from the client or also from the server. Depending on the amount of segments that need compaction, it may take a while, so consider using the ``--progress`` option. A segment is compacted if the amount of saved space is above the percentage value given by the ``--threshold`` option. If omitted, a threshold of 10% is used. When using ``--verbose``, borg will output an estimate of the freed space. After upgrading borg (server) to 1.2+, you can use ``borg compact --cleanup-commits`` to clean up the numerous 17byte commit-only segments that borg 1.1 did not clean up due to a bug. It is enough to do that once per repository. After cleaning up the commits, borg will also do a normal compaction. See :ref:`separate_compaction` in Additional Notes for more details. """) subparser = subparsers.add_parser('compact', parents=[common_parser], add_help=False, description=self.do_compact.__doc__, epilog=compact_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, help='compact segment files / free space in repo') subparser.set_defaults(func=self.do_compact) subparser.add_argument('location', metavar='REPOSITORY', nargs='?', default='', type=location_validator(archive=False), help='repository to compact') subparser.add_argument('--cleanup-commits', dest='cleanup_commits', action='store_true', help='cleanup commit-only 17-byte segment files') subparser.add_argument('--threshold', metavar='PERCENT', dest='threshold', type=int, default=10, help='set minimum threshold for saved space in PERCENT (Default: 10)') # borg config config_epilog = process_epilog(""" This command gets and sets options in a local repository or cache config file. For security reasons, this command only works on local repositories. To delete a config value entirely, use ``--delete``. To list the values of the configuration file or the default values, use ``--list``. To get and existing key, pass only the key name. To set a key, pass both the key name and the new value. Keys can be specified in the format "section.name" or simply "name"; the section will default to "repository" and "cache" for the repo and cache configs, respectively. By default, borg config manipulates the repository config file. Using ``--cache`` edits the repository cache's config file instead. """) subparser = subparsers.add_parser('config', parents=[common_parser], add_help=False, description=self.do_config.__doc__, epilog=config_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, help='get and set configuration values') subparser.set_defaults(func=self.do_config) subparser.add_argument('-c', '--cache', dest='cache', action='store_true', help='get and set values from the repo cache') group = subparser.add_mutually_exclusive_group() group.add_argument('-d', '--delete', dest='delete', action='store_true', help='delete the key from the config file') group.add_argument('-l', '--list', dest='list', action='store_true', help='list the configuration of the repo') subparser.add_argument('location', metavar='REPOSITORY', nargs='?', default='', type=location_validator(archive=False, proto='file'), help='repository to configure') subparser.add_argument('name', metavar='NAME', nargs='?', help='name of config key') subparser.add_argument('value', metavar='VALUE', nargs='?', help='new value for key') # borg create create_epilog = process_epilog(""" This command creates a backup archive containing all files found while recursively traversing all paths specified. Paths are added to the archive as they are given, that means if relative paths are desired, the command has to be run from the correct directory. The slashdot hack in paths (recursion roots) is triggered by using ``/./``: ``/this/gets/stripped/./this/gets/archived`` means to process that fs object, but strip the prefix on the left side of ``./`` from the archived items (in this case, ``this/gets/archived`` will be the path in the archived item). When giving '-' as path, borg will read data from standard input and create a file 'stdin' in the created archive from that data. In some cases it's more appropriate to use --content-from-command, however. See section *Reading from stdin* below for details. The archive will consume almost no disk space for files or parts of files that have already been stored in other archives. The archive name needs to be unique. It must not end in '.checkpoint' or '.checkpoint.N' (with N being a number), because these names are used for checkpoints and treated in special ways. In the archive name, you may use the following placeholders: {now}, {utcnow}, {fqdn}, {hostname}, {user} and some others. Backup speed is increased by not reprocessing files that are already part of existing archives and weren't modified. The detection of unmodified files is done by comparing multiple file metadata values with previous values kept in the files cache. This comparison can operate in different modes as given by ``--files-cache``: - ctime,size,inode (default) - mtime,size,inode (default behaviour of borg versions older than 1.1.0rc4) - ctime,size (ignore the inode number) - mtime,size (ignore the inode number) - rechunk,ctime (all files are considered modified - rechunk, cache ctime) - rechunk,mtime (all files are considered modified - rechunk, cache mtime) - disabled (disable the files cache, all files considered modified - rechunk) inode number: better safety, but often unstable on network filesystems Normally, detecting file modifications will take inode information into consideration to improve the reliability of file change detection. This is problematic for files located on sshfs and similar network file systems which do not provide stable inode numbers, such files will always be considered modified. You can use modes without `inode` in this case to improve performance, but reliability of change detection might be reduced. ctime vs. mtime: safety vs. speed - ctime is a rather safe way to detect changes to a file (metadata and contents) as it can not be set from userspace. But, a metadata-only change will already update the ctime, so there might be some unnecessary chunking/hashing even without content changes. Some filesystems do not support ctime (change time). E.g. doing a chown or chmod to a file will change its ctime. - mtime usually works and only updates if file contents were changed. But mtime can be arbitrarily set from userspace, e.g. to set mtime back to the same value it had before a content change happened. This can be used maliciously as well as well-meant, but in both cases mtime based cache modes can be problematic. The mount points of filesystems or filesystem snapshots should be the same for every creation of a new archive to ensure fast operation. This is because the file cache that is used to determine changed files quickly uses absolute filenames. If this is not possible, consider creating a bind mount to a stable location. The ``--progress`` option shows (from left to right) Original, Compressed and Deduplicated (O, C and D, respectively), then the Number of files (N) processed so far, followed by the currently processed path. When using ``--stats``, you will get some statistics about how much data was added - the "This Archive" deduplicated size there is most interesting as that is how much your repository will grow. Please note that the "All archives" stats refer to the state after creation. Also, the ``--stats`` and ``--dry-run`` options are mutually exclusive because the data is not actually compressed and deduplicated during a dry run. For more help on include/exclude patterns, see the :ref:`borg_patterns` command output. For more help on placeholders, see the :ref:`borg_placeholders` command output. .. man NOTES The ``--exclude`` patterns are not like tar. In tar ``--exclude`` .bundler/gems will exclude foo/.bundler/gems. In borg it will not, you need to use ``--exclude`` '\\*/.bundler/gems' to get the same effect. In addition to using ``--exclude`` patterns, it is possible to use ``--exclude-if-present`` to specify the name of a filesystem object (e.g. a file or folder name) which, when contained within another folder, will prevent the containing folder from being backed up. By default, the containing folder and all of its contents will be omitted from the backup. If, however, you wish to only include the objects specified by ``--exclude-if-present`` in your backup, and not include any other contents of the containing folder, this can be enabled through using the ``--keep-exclude-tags`` option. The ``-x`` or ``--one-file-system`` option excludes directories, that are mountpoints (and everything in them). It detects mountpoints by comparing the device number from the output of ``stat()`` of the directory and its parent directory. Specifically, it excludes directories for which ``stat()`` reports a device number different from the device number of their parent. In general: be aware that there are directories with device number different from their parent, which the kernel does not consider a mountpoint and also the other way around. Linux examples for this are bind mounts (possibly same device number, but always a mountpoint) and ALL subvolumes of a btrfs (different device number from parent but not necessarily a mountpoint). macOS examples are the apfs mounts of a typical macOS installation. Therefore, when using ``--one-file-system``, you should double-check that the backup works as intended. .. _list_item_flags: Item flags ++++++++++ ``--list`` outputs a list of all files, directories and other file system items it considered (no matter whether they had content changes or not). For each item, it prefixes a single-letter flag that indicates type and/or status of the item. If you are interested only in a subset of that output, you can give e.g. ``--filter=AME`` and it will only show regular files with A, M or E status (see below). A uppercase character represents the status of a regular file relative to the "files" cache (not relative to the repo -- this is an issue if the files cache is not used). Metadata is stored in any case and for 'A' and 'M' also new data chunks are stored. For 'U' all data chunks refer to already existing chunks. - 'A' = regular file, added (see also :ref:`a_status_oddity` in the FAQ) - 'M' = regular file, modified - 'U' = regular file, unchanged - 'C' = regular file, it changed while we backed it up - 'E' = regular file, an error happened while accessing/reading *this* file A lowercase character means a file type other than a regular file, borg usually just stores their metadata: - 'd' = directory - 'b' = block device - 'c' = char device - 'h' = regular file, hardlink (to already seen inodes) - 's' = symlink - 'f' = fifo Other flags used include: - 'i' = backup data was read from standard input (stdin) - '-' = dry run, item was *not* backed up - 'x' = excluded, item was *not* backed up - '?' = missing status code (if you see this, please file a bug report!) Reading backup data from stdin ++++++++++++++++++++++++++++++ There are two methods to read from stdin. Either specify ``-`` as path and pipe directly to borg:: backup-vm --id myvm --stdout | borg create REPO::ARCHIVE - Or use ``--content-from-command`` to have Borg manage the execution of the command and piping. If you do so, the first PATH argument is interpreted as command to execute and any further arguments are treated as arguments to the command:: borg create --content-from-command REPO::ARCHIVE -- backup-vm --id myvm --stdout ``--`` is used to ensure ``--id`` and ``--stdout`` are **not** considered arguments to ``borg`` but rather ``backup-vm``. The difference between the two approaches is that piping to borg creates an archive even if the command piping to borg exits with a failure. In this case, **one can end up with truncated output being backed up**. Using ``--content-from-command``, in contrast, borg is guaranteed to fail without creating an archive should the command fail. The command is considered failed when it returned a non-zero exit code. Reading from stdin yields just a stream of data without file metadata associated with it, and the files cache is not needed at all. So it is safe to disable it via ``--files-cache disabled`` and speed up backup creation a bit. By default, the content read from stdin is stored in a file called 'stdin'. Use ``--stdin-name`` to change the name. Feeding all file paths from externally ++++++++++++++++++++++++++++++++++++++ Usually, you give a starting path (recursion root) to borg and then borg automatically recurses, finds and backs up all fs objects contained in there (optionally considering include/exclude rules). If you need more control and you want to give every single fs object path to borg (maybe implementing your own recursion or your own rules), you can use ``--paths-from-stdin`` or ``--paths-from-command`` (with the latter, borg will fail to create an archive should the command fail). Borg supports paths with the slashdot hack to strip path prefixes here also. So, be careful not to unintentionally trigger that. """) subparser = subparsers.add_parser('create', parents=[common_parser], add_help=False, description=self.do_create.__doc__, epilog=create_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, help='create backup') subparser.set_defaults(func=self.do_create) # note: --dry-run and --stats are mutually exclusive, but we do not want to abort when # parsing, but rather proceed with the dry-run, but without stats (see run() method). subparser.add_argument('-n', '--dry-run', dest='dry_run', action='store_true', help='do not create a backup archive') subparser.add_argument('-s', '--stats', dest='stats', action='store_true', help='print statistics for the created archive') subparser.add_argument('--list', dest='output_list', action='store_true', help='output verbose list of items (files, dirs, ...)') subparser.add_argument('--filter', metavar='STATUSCHARS', dest='output_filter', action=Highlander, help='only display items with the given status characters (see description)') subparser.add_argument('--json', action='store_true', help='output stats as JSON. Implies ``--stats``.') subparser.add_argument('--no-cache-sync', dest='no_cache_sync', action='store_true', help='experimental: do not synchronize the cache. Implies not using the files cache.') subparser.add_argument('--stdin-name', metavar='NAME', dest='stdin_name', default='stdin', help='use NAME in archive for stdin data (default: %(default)r)') subparser.add_argument('--stdin-user', metavar='USER', dest='stdin_user', default=uid2user(0), help='set user USER in archive for stdin data (default: %(default)r)') subparser.add_argument('--stdin-group', metavar='GROUP', dest='stdin_group', default=gid2group(0), help='set group GROUP in archive for stdin data (default: %(default)r)') subparser.add_argument('--stdin-mode', metavar='M', dest='stdin_mode', type=lambda s: int(s, 8), default=STDIN_MODE_DEFAULT, help='set mode to M in archive for stdin data (default: %(default)04o)') subparser.add_argument('--content-from-command', action='store_true', help='interpret PATH as command and store its stdout. See also section Reading from' ' stdin below.') subparser.add_argument('--paths-from-stdin', action='store_true', help='read DELIM-separated list of paths to backup from stdin. All control is external:' ' it will back up all files given - no more, no less.') subparser.add_argument('--paths-from-command', action='store_true', help='interpret PATH as command and treat its output as ``--paths-from-stdin``') subparser.add_argument('--paths-delimiter', metavar='DELIM', help='set path delimiter for ``--paths-from-stdin`` and ``--paths-from-command`` (default: ``\\n``)') exclude_group = define_exclusion_group(subparser, tag_files=True) exclude_group.add_argument('--exclude-nodump', dest='exclude_nodump', action='store_true', help='exclude files flagged NODUMP') fs_group = subparser.add_argument_group('Filesystem options') fs_group.add_argument('-x', '--one-file-system', dest='one_file_system', action='store_true', help='stay in the same file system and do not store mount points of other file systems - ' 'this might behave different from your expectations, see the description below.') fs_group.add_argument('--numeric-owner', dest='numeric_ids', action='store_true', help='deprecated, use ``--numeric-ids`` instead') fs_group.add_argument('--numeric-ids', dest='numeric_ids', action='store_true', help='only store numeric user and group identifiers') # --noatime is the default now and the flag is deprecated. args.noatime is not used any more. # use --atime if you want to store the atime (default behaviour before borg 1.2.0a7).. fs_group.add_argument('--noatime', dest='noatime', action='store_true', help='do not store atime into archive') fs_group.add_argument('--atime', dest='atime', action='store_true', help='do store atime into archive') fs_group.add_argument('--noctime', dest='noctime', action='store_true', help='do not store ctime into archive') fs_group.add_argument('--nobirthtime', dest='nobirthtime', action='store_true', help='do not store birthtime (creation date) into archive') fs_group.add_argument('--nobsdflags', dest='nobsdflags', action='store_true', help='deprecated, use ``--noflags`` instead') fs_group.add_argument('--noflags', dest='noflags', action='store_true', help='do not read and store flags (e.g. NODUMP, IMMUTABLE) into archive') fs_group.add_argument('--noacls', dest='noacls', action='store_true', help='do not read and store ACLs into archive') fs_group.add_argument('--noxattrs', dest='noxattrs', action='store_true', help='do not read and store xattrs into archive') fs_group.add_argument('--sparse', dest='sparse', action='store_true', help='detect sparse holes in input (supported only by fixed chunker)') fs_group.add_argument('--files-cache', metavar='MODE', dest='files_cache_mode', action=Highlander, type=FilesCacheMode, default=FILES_CACHE_MODE_UI_DEFAULT, help='operate files cache in MODE. default: %s' % FILES_CACHE_MODE_UI_DEFAULT) fs_group.add_argument('--read-special', dest='read_special', action='store_true', help='open and read block and char device files as well as FIFOs as if they were ' 'regular files. Also follows symlinks pointing to these kinds of files.') archive_group = subparser.add_argument_group('Archive options') archive_group.add_argument('--comment', dest='comment', metavar='COMMENT', type=CommentSpec, default='', help='add a comment text to the archive') archive_group.add_argument('--timestamp', metavar='TIMESTAMP', dest='timestamp', type=timestamp, default=None, help='manually specify the archive creation date/time (UTC, yyyy-mm-ddThh:mm:ss format). ' 'Alternatively, give a reference file/directory.') archive_group.add_argument('-c', '--checkpoint-interval', metavar='SECONDS', dest='checkpoint_interval', type=int, default=1800, help='write checkpoint every SECONDS seconds (Default: 1800)') archive_group.add_argument('--chunker-params', metavar='PARAMS', dest='chunker_params', type=ChunkerParams, default=CHUNKER_PARAMS, action=Highlander, help='specify the chunker parameters (ALGO, CHUNK_MIN_EXP, CHUNK_MAX_EXP, ' 'HASH_MASK_BITS, HASH_WINDOW_SIZE). default: %s,%d,%d,%d,%d' % CHUNKER_PARAMS) archive_group.add_argument('-C', '--compression', metavar='COMPRESSION', dest='compression', type=CompressionSpec, default=CompressionSpec('lz4'), help='select compression algorithm, see the output of the ' '"borg help compression" command for details.') subparser.add_argument('location', metavar='ARCHIVE', type=location_validator(archive=True), help='name of archive to create (must be also a valid directory name)') subparser.add_argument('paths', metavar='PATH', nargs='*', type=PathSpec, action='extend', help='paths to archive') # borg debug debug_epilog = process_epilog(""" These commands are not intended for normal use and potentially very dangerous if used incorrectly. They exist to improve debugging capabilities without direct system access, e.g. in case you ever run into some severe malfunction. Use them only if you know what you are doing or if a trusted developer tells you what to do.""") subparser = subparsers.add_parser('debug', parents=[mid_common_parser], add_help=False, description='debugging command (not intended for normal use)', epilog=debug_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, help='debugging command (not intended for normal use)') debug_parsers = subparser.add_subparsers(title='required arguments', metavar='') subparser.set_defaults(fallback_func=functools.partial(self.do_subcommand_help, subparser)) debug_info_epilog = process_epilog(""" This command displays some system information that might be useful for bug reports and debugging problems. If a traceback happens, this information is already appended at the end of the traceback. """) subparser = debug_parsers.add_parser('info', parents=[common_parser], add_help=False, description=self.do_debug_info.__doc__, epilog=debug_info_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, help='show system infos for debugging / bug reports (debug)') subparser.set_defaults(func=self.do_debug_info) debug_dump_archive_items_epilog = process_epilog(""" This command dumps raw (but decrypted and decompressed) archive items (only metadata) to files. """) subparser = debug_parsers.add_parser('dump-archive-items', parents=[common_parser], add_help=False, description=self.do_debug_dump_archive_items.__doc__, epilog=debug_dump_archive_items_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, help='dump archive items (metadata) (debug)') subparser.set_defaults(func=self.do_debug_dump_archive_items) subparser.add_argument('location', metavar='ARCHIVE', type=location_validator(archive=True), help='archive to dump') debug_dump_archive_epilog = process_epilog(""" This command dumps all metadata of an archive in a decoded form to a file. """) subparser = debug_parsers.add_parser('dump-archive', parents=[common_parser], add_help=False, description=self.do_debug_dump_archive.__doc__, epilog=debug_dump_archive_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, help='dump decoded archive metadata (debug)') subparser.set_defaults(func=self.do_debug_dump_archive) subparser.add_argument('location', metavar='ARCHIVE', type=location_validator(archive=True), help='archive to dump') subparser.add_argument('path', metavar='PATH', type=str, help='file to dump data into') debug_dump_manifest_epilog = process_epilog(""" This command dumps manifest metadata of a repository in a decoded form to a file. """) subparser = debug_parsers.add_parser('dump-manifest', parents=[common_parser], add_help=False, description=self.do_debug_dump_manifest.__doc__, epilog=debug_dump_manifest_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, help='dump decoded repository metadata (debug)') subparser.set_defaults(func=self.do_debug_dump_manifest) subparser.add_argument('location', metavar='REPOSITORY', type=location_validator(archive=False), help='repository to dump') subparser.add_argument('path', metavar='PATH', type=str, help='file to dump data into') debug_dump_repo_objs_epilog = process_epilog(""" This command dumps raw (but decrypted and decompressed) repo objects to files. """) subparser = debug_parsers.add_parser('dump-repo-objs', parents=[common_parser], add_help=False, description=self.do_debug_dump_repo_objs.__doc__, epilog=debug_dump_repo_objs_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, help='dump repo objects (debug)') subparser.set_defaults(func=self.do_debug_dump_repo_objs) subparser.add_argument('location', metavar='REPOSITORY', type=location_validator(archive=False), help='repository to dump') subparser.add_argument('--ghost', dest='ghost', action='store_true', help='dump all segment file contents, including deleted/uncommitted objects and commits.') subparser.add_argument('--segment', metavar='SEG', dest='segment', default=None, type=positive_int_validator, help='used together with --ghost: limit processing to given segment.') subparser.add_argument('--offset', metavar='OFFS', dest='offset', default=None, type=positive_int_validator, help='used together with --ghost: limit processing to given offset.') debug_search_repo_objs_epilog = process_epilog(""" This command searches raw (but decrypted and decompressed) repo objects for a specific bytes sequence. """) subparser = debug_parsers.add_parser('search-repo-objs', parents=[common_parser], add_help=False, description=self.do_debug_search_repo_objs.__doc__, epilog=debug_search_repo_objs_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, help='search repo objects (debug)') subparser.set_defaults(func=self.do_debug_search_repo_objs) subparser.add_argument('location', metavar='REPOSITORY', type=location_validator(archive=False), help='repository to search') subparser.add_argument('wanted', metavar='WANTED', type=str, help='term to search the repo for, either 0x1234abcd hex term or a string') debug_id_hash_epilog = process_epilog(""" This command computes the id-hash for some file content. """) subparser = debug_parsers.add_parser('id-hash', parents=[common_parser], add_help=False, description=self.do_debug_id_hash.__doc__, epilog=debug_id_hash_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, help='compute id-hash for some file content (debug)') subparser.set_defaults(func=self.do_debug_id_hash) subparser.add_argument('location', metavar='REPOSITORY', type=location_validator(archive=False), help='repository to use') subparser.add_argument('path', metavar='PATH', type=str, help='content for which the id-hash shall get computed') debug_get_obj_epilog = process_epilog(""" This command gets an object from the repository. """) subparser = debug_parsers.add_parser('get-obj', parents=[common_parser], add_help=False, description=self.do_debug_get_obj.__doc__, epilog=debug_get_obj_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, help='get object from repository (debug)') subparser.set_defaults(func=self.do_debug_get_obj) subparser.add_argument('location', metavar='REPOSITORY', type=location_validator(archive=False), help='repository to use') subparser.add_argument('id', metavar='ID', type=str, help='hex object ID to get from the repo') subparser.add_argument('path', metavar='PATH', type=str, help='file to write object data into') debug_put_obj_epilog = process_epilog(""" This command puts an object into the repository. """) subparser = debug_parsers.add_parser('put-obj', parents=[common_parser], add_help=False, description=self.do_debug_put_obj.__doc__, epilog=debug_put_obj_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, help='put object to repository (debug)') subparser.set_defaults(func=self.do_debug_put_obj) subparser.add_argument('location', metavar='REPOSITORY', type=location_validator(archive=False), help='repository to use') subparser.add_argument("id", metavar="ID", type=str, help="hex object ID to put into the repo") subparser.add_argument("path", metavar="PATH", type=str, help="file to read and create object from") debug_delete_obj_epilog = process_epilog(""" This command deletes objects from the repository. """) subparser = debug_parsers.add_parser('delete-obj', parents=[common_parser], add_help=False, description=self.do_debug_delete_obj.__doc__, epilog=debug_delete_obj_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, help='delete object from repository (debug)') subparser.set_defaults(func=self.do_debug_delete_obj) subparser.add_argument('location', metavar='REPOSITORY', type=location_validator(archive=False), help='repository to use') subparser.add_argument('ids', metavar='IDs', nargs='+', type=str, help='hex object ID(s) to delete from the repo') debug_refcount_obj_epilog = process_epilog(""" This command displays the reference count for objects from the repository. """) subparser = debug_parsers.add_parser('refcount-obj', parents=[common_parser], add_help=False, description=self.do_debug_refcount_obj.__doc__, epilog=debug_refcount_obj_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, help='show refcount for object from repository (debug)') subparser.set_defaults(func=self.do_debug_refcount_obj) subparser.add_argument('location', metavar='REPOSITORY', type=location_validator(archive=False), help='repository to use') subparser.add_argument('ids', metavar='IDs', nargs='+', type=str, help='hex object ID(s) to show refcounts for') debug_dump_hints_epilog = process_epilog(""" This command dumps the repository hints data. """) subparser = debug_parsers.add_parser('dump-hints', parents=[common_parser], add_help=False, description=self.do_debug_dump_hints.__doc__, epilog=debug_dump_hints_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, help='dump repo hints (debug)') subparser.set_defaults(func=self.do_debug_dump_hints) subparser.add_argument('location', metavar='REPOSITORY', type=location_validator(archive=False), help='repository to dump') subparser.add_argument('path', metavar='PATH', type=str, help='file to dump data into') debug_convert_profile_epilog = process_epilog(""" Convert a Borg profile to a Python cProfile compatible profile. """) subparser = debug_parsers.add_parser('convert-profile', parents=[common_parser], add_help=False, description=self.do_debug_convert_profile.__doc__, epilog=debug_convert_profile_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, help='convert Borg profile to Python profile (debug)') subparser.set_defaults(func=self.do_debug_convert_profile) subparser.add_argument('input', metavar='INPUT', type=argparse.FileType('rb'), help='Borg profile') subparser.add_argument('output', metavar='OUTPUT', type=argparse.FileType('wb'), help='Output file') # borg delete delete_epilog = process_epilog(""" This command deletes an archive from the repository or the complete repository. Important: When deleting archives, repository disk space is **not** freed until you run ``borg compact``. When you delete a complete repository, the security info and local cache for it (if any) are also deleted. Alternatively, you can delete just the local cache with the ``--cache-only`` option, or keep the security info with the ``--keep-security-info`` option. When in doubt, use ``--dry-run --list`` to see what would be deleted. When using ``--stats``, you will get some statistics about how much data was deleted - the "Deleted data" deduplicated size there is most interesting as that is how much your repository will shrink. Please note that the "All archives" stats refer to the state after deletion. You can delete multiple archives by specifying a shell pattern to match multiple archives using the ``--glob-archives GLOB`` option (for more info on these patterns, see :ref:`borg_patterns`). To avoid accidentally deleting archives, especially when using glob patterns, it might be helpful to use the ``--dry-run`` to test out the command without actually making any changes to the repository. """) subparser = subparsers.add_parser('delete', parents=[common_parser], add_help=False, description=self.do_delete.__doc__, epilog=delete_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, help='delete archive') subparser.set_defaults(func=self.do_delete) subparser.add_argument('-n', '--dry-run', dest='dry_run', action='store_true', help='do not change repository') subparser.add_argument('--list', dest='output_list', action='store_true', help='output verbose list of archives') subparser.add_argument('-s', '--stats', dest='stats', action='store_true', help='print statistics for the deleted archive') subparser.add_argument('--cache-only', dest='cache_only', action='store_true', help='delete only the local cache for the given repository') subparser.add_argument('--force', dest='forced', action='count', default=0, help='force deletion of corrupted archives, ' 'use ``--force --force`` in case ``--force`` does not work.') subparser.add_argument('--keep-security-info', dest='keep_security_info', action='store_true', help='keep the local security info when deleting a repository') subparser.add_argument('--save-space', dest='save_space', action='store_true', help='work slower, but using less space') subparser.add_argument('-c', '--checkpoint-interval', metavar='SECONDS', dest='checkpoint_interval', type=int, default=1800, help='write checkpoint every SECONDS seconds (Default: 1800)') subparser.add_argument('location', metavar='REPOSITORY_OR_ARCHIVE', nargs='?', default='', type=location_validator(), help='repository or archive to delete') subparser.add_argument('archives', metavar='ARCHIVE', nargs='*', help='archives to delete') define_archive_filters_group(subparser) # borg diff diff_epilog = process_epilog(""" This command finds differences (file contents, user/group/mode) between archives. A repository location and an archive name must be specified for REPO::ARCHIVE1. ARCHIVE2 is just another archive name in same repository (no repository location allowed). For archives created with Borg 1.1 or newer diff automatically detects whether the archives are created with the same chunker params. If so, only chunk IDs are compared, which is very fast. For archives prior to Borg 1.1 chunk contents are compared by default. If you did not create the archives with different chunker params, pass ``--same-chunker-params``. Note that the chunker params changed from Borg 0.xx to 1.0. For more help on include/exclude patterns, see the :ref:`borg_patterns` command output. """) subparser = subparsers.add_parser('diff', parents=[common_parser], add_help=False, description=self.do_diff.__doc__, epilog=diff_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, help='find differences in archive contents') subparser.set_defaults(func=self.do_diff) subparser.add_argument('--numeric-owner', dest='numeric_ids', action='store_true', help='deprecated, use ``--numeric-ids`` instead') subparser.add_argument('--numeric-ids', dest='numeric_ids', action='store_true', help='only consider numeric user and group identifiers') subparser.add_argument('--same-chunker-params', dest='same_chunker_params', action='store_true', help='Override check of chunker parameters.') subparser.add_argument('--sort', dest='sort', action='store_true', help='Sort the output lines by file path.') subparser.add_argument( "--content-only", action="store_true", help="Only compare differences in content (exclude metadata differences)", ) subparser.add_argument('--json-lines', action='store_true', help='Format output as JSON Lines. ') subparser.add_argument('location', metavar='REPO::ARCHIVE1', type=location_validator(archive=True), help='repository location and ARCHIVE1 name') subparser.add_argument('archive2', metavar='ARCHIVE2', type=archivename_validator(), help='ARCHIVE2 name (no repository location allowed)') subparser.add_argument('paths', metavar='PATH', nargs='*', type=PathSpec, help='paths of items inside the archives to compare; patterns are supported') define_exclusion_group(subparser) # borg export-tar export_tar_epilog = process_epilog(""" This command creates a tarball from an archive. When giving '-' as the output FILE, Borg will write a tar stream to standard output. By default (``--tar-filter=auto``) Borg will detect whether the FILE should be compressed based on its file extension and pipe the tarball through an appropriate filter before writing it to FILE: - .tar.gz or .tgz: gzip - .tar.bz2 or .tbz: bzip2 - .tar.xz or .txz: xz - .tar.zstd or .tar.zst: zstd - .tar.lz4: lz4 Alternatively, a ``--tar-filter`` program may be explicitly specified. It should read the uncompressed tar stream from stdin and write a compressed/filtered tar stream to stdout. The generated tarball uses the GNU tar format. export-tar is a lossy conversion: BSD flags, ACLs, extended attributes (xattrs), atime and ctime are not exported. Timestamp resolution is limited to whole seconds, not the nanosecond resolution otherwise supported by Borg. A ``--sparse`` option (as found in borg extract) is not supported. By default the entire archive is extracted but a subset of files and directories can be selected by passing a list of ``PATHs`` as arguments. The file selection can further be restricted by using the ``--exclude`` option. For more help on include/exclude patterns, see the :ref:`borg_patterns` command output. ``--progress`` can be slower than no progress display, since it makes one additional pass over the archive metadata. """) subparser = subparsers.add_parser('export-tar', parents=[common_parser], add_help=False, description=self.do_export_tar.__doc__, epilog=export_tar_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, help='create tarball from archive') subparser.set_defaults(func=self.do_export_tar) subparser.add_argument('--tar-filter', dest='tar_filter', default='auto', help='filter program to pipe data through') subparser.add_argument('--list', dest='output_list', action='store_true', help='output verbose list of items (files, dirs, ...)') subparser.add_argument('location', metavar='ARCHIVE', type=location_validator(archive=True), help='archive to export') subparser.add_argument('tarfile', metavar='FILE', help='output tar file. "-" to write to stdout instead.') subparser.add_argument('paths', metavar='PATH', nargs='*', type=PathSpec, help='paths to extract; patterns are supported') define_exclusion_group(subparser, strip_components=True) # borg extract extract_epilog = process_epilog(""" This command extracts the contents of an archive. By default the entire archive is extracted but a subset of files and directories can be selected by passing a list of ``PATHs`` as arguments. The file selection can further be restricted by using the ``--exclude`` option. For more help on include/exclude patterns, see the :ref:`borg_patterns` command output. By using ``--dry-run``, you can do all extraction steps except actually writing the output data: reading metadata and data chunks from the repo, checking the hash/hmac, decrypting, decompressing. ``--progress`` can be slower than no progress display, since it makes one additional pass over the archive metadata. .. note:: Currently, extract always writes into the current working directory ("."), so make sure you ``cd`` to the right place before calling ``borg extract``. When parent directories are not extracted (because of using file/directory selection or any other reason), borg can not restore parent directories' metadata, e.g. owner, group, permission, etc. """) subparser = subparsers.add_parser('extract', parents=[common_parser], add_help=False, description=self.do_extract.__doc__, epilog=extract_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, help='extract archive contents') subparser.set_defaults(func=self.do_extract) subparser.add_argument('--list', dest='output_list', action='store_true', help='output verbose list of items (files, dirs, ...)') subparser.add_argument('-n', '--dry-run', dest='dry_run', action='store_true', help='do not actually change any files') subparser.add_argument('--numeric-owner', dest='numeric_ids', action='store_true', help='deprecated, use ``--numeric-ids`` instead') subparser.add_argument('--numeric-ids', dest='numeric_ids', action='store_true', help='only obey numeric user and group identifiers') subparser.add_argument('--nobsdflags', dest='nobsdflags', action='store_true', help='deprecated, use ``--noflags`` instead') subparser.add_argument('--noflags', dest='noflags', action='store_true', help='do not extract/set flags (e.g. NODUMP, IMMUTABLE)') subparser.add_argument('--noacls', dest='noacls', action='store_true', help='do not extract/set ACLs') subparser.add_argument('--noxattrs', dest='noxattrs', action='store_true', help='do not extract/set xattrs') subparser.add_argument('--stdout', dest='stdout', action='store_true', help='write all extracted data to stdout') subparser.add_argument('--sparse', dest='sparse', action='store_true', help='create holes in output sparse file from all-zero chunks') subparser.add_argument('location', metavar='ARCHIVE', type=location_validator(archive=True), help='archive to extract') subparser.add_argument('paths', metavar='PATH', nargs='*', type=PathSpec, help='paths to extract; patterns are supported') define_exclusion_group(subparser, strip_components=True) # borg help subparser = subparsers.add_parser('help', parents=[common_parser], add_help=False, description='Extra help') subparser.add_argument('--epilog-only', dest='epilog_only', action='store_true') subparser.add_argument('--usage-only', dest='usage_only', action='store_true') subparser.set_defaults(func=functools.partial(self.do_help, parser, subparsers.choices)) subparser.add_argument('topic', metavar='TOPIC', type=str, nargs='?', help='additional help on TOPIC') # borg info info_epilog = process_epilog(""" This command displays detailed information about the specified archive or repository. Please note that the deduplicated sizes of the individual archives do not add up to the deduplicated size of the repository ("all archives"), because the two are meaning different things: This archive / deduplicated size = amount of data stored ONLY for this archive = unique chunks of this archive. All archives / deduplicated size = amount of data stored in the repo = all chunks in the repository. Borg archives can only contain a limited amount of file metadata. The size of an archive relative to this limit depends on a number of factors, mainly the number of files, the lengths of paths and other metadata stored for files. This is shown as *utilization of maximum supported archive size*. """) subparser = subparsers.add_parser('info', parents=[common_parser], add_help=False, description=self.do_info.__doc__, epilog=info_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, help='show repository or archive information') subparser.set_defaults(func=self.do_info) subparser.add_argument('location', metavar='REPOSITORY_OR_ARCHIVE', nargs='?', default='', type=location_validator(), help='repository or archive to display information about') subparser.add_argument('--json', action='store_true', help='format output as JSON') define_archive_filters_group(subparser) # borg version version_epilog = process_epilog(""" This command displays the borg client version / borg server version. If a local repo is given, the client code directly accesses the repository, thus we show the client version also as the server version. If a remote repo is given (e.g. ssh:), the remote borg is queried and its version is displayed as the server version. Examples:: # local repo (client uses 1.4.0 alpha version) $ borg version /mnt/backup 1.4.0a / 1.4.0a # remote repo (client uses 1.4.0 alpha, server uses 1.2.7 release) $ borg version ssh://borg@borgbackup:repo 1.4.0a / 1.2.7 Due to the version tuple format used in borg client/server negotiation, only a simplified version is displayed (as provided by borg.version.format_version). There is also borg --version to display a potentially more precise client version. """) subparser = subparsers.add_parser('version', parents=[common_parser], add_help=False, description=self.do_version.__doc__, epilog=version_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, help='display borg client version / borg server version') subparser.set_defaults(func=self.do_version) subparser.add_argument('location', metavar='REPOSITORY', nargs='?', default='', type=location_validator(archive=False), help='repository (used to determine client/server situation)') # borg init init_epilog = process_epilog(""" This command initializes an empty repository. A repository is a filesystem directory containing the deduplicated data from zero or more archives. Encryption mode TLDR ++++++++++++++++++++ The encryption mode can only be configured when creating a new repository - you can neither configure it on a per-archive basis nor change the encryption mode of an existing repository. Use ``repokey``:: borg init --encryption repokey /path/to/repo Or ``repokey-blake2`` depending on which is faster on your client machines (see below):: borg init --encryption repokey-blake2 /path/to/repo Borg will: 1. Ask you to come up with a passphrase. 2. Create a borg key (which contains 3 random secrets. See :ref:`key_files`). 3. Encrypt the key with your passphrase. 4. Store the encrypted borg key inside the repository directory (in the repo config). This is why it is essential to use a secure passphrase. 5. Encrypt and sign your backups to prevent anyone from reading or forging them unless they have the key and know the passphrase. Make sure to keep a backup of your key **outside** the repository - do not lock yourself out by "leaving your keys inside your car" (see :ref:`borg_key_export`). For remote backups the encryption is done locally - the remote machine never sees your passphrase, your unencrypted key or your unencrypted files. Chunking and id generation are also based on your key to improve your privacy. 6. Use the key when extracting files to decrypt them and to verify that the contents of the backups have not been accidentally or maliciously altered. Picking a passphrase ++++++++++++++++++++ Make sure you use a good passphrase. Not too short, not too simple. The real encryption / decryption key is encrypted with / locked by your passphrase. If an attacker gets your key, he can't unlock and use it without knowing the passphrase. Be careful with special or non-ascii characters in your passphrase: - Borg processes the passphrase as unicode (and encodes it as utf-8), so it does not have problems dealing with even the strangest characters. - BUT: that does not necessarily apply to your OS / VM / keyboard configuration. So better use a long passphrase made from simple ascii chars than one that includes non-ascii stuff or characters that are hard/impossible to enter on a different keyboard layout. You can change your passphrase for existing repos at any time, it won't affect the encryption/decryption key or other secrets. More encryption modes +++++++++++++++++++++ Only use ``--encryption none`` if you are OK with anyone who has access to your repository being able to read your backups and tamper with their contents without you noticing. If you want "passphrase and having-the-key" security, use ``--encryption keyfile``. The key will be stored in your home directory (in ``~/.config/borg/keys``). If you do **not** want to encrypt the contents of your backups, but still want to detect malicious tampering use ``--encryption authenticated``. To normally work with ``authenticated`` repos, you will need the passphrase, but there is an emergency workaround, see ``BORG_WORKAROUNDS=authenticated_no_key`` docs. If ``BLAKE2b`` is faster than ``SHA-256`` on your hardware, use ``--encryption authenticated-blake2``, ``--encryption repokey-blake2`` or ``--encryption keyfile-blake2``. Note: for remote backups the hashing is done on your local machine. .. nanorst: inline-fill +----------+---------------+------------------------+--------------------------+ | Hash/MAC | Not encrypted | Not encrypted, | Encrypted (AEAD w/ AES) | | | no auth | but authenticated | and authenticated | +----------+---------------+------------------------+--------------------------+ | SHA-256 | none | `authenticated` | repokey | | | | | keyfile | +----------+---------------+------------------------+--------------------------+ | BLAKE2b | n/a | `authenticated-blake2` | `repokey-blake2` | | | | | `keyfile-blake2` | +----------+---------------+------------------------+--------------------------+ .. nanorst: inline-replace Modes `marked like this` in the above table are new in Borg 1.1 and are not backwards-compatible with Borg 1.0.x. On modern Intel/AMD CPUs (except very cheap ones), AES is usually hardware-accelerated. BLAKE2b is faster than SHA256 on Intel/AMD 64-bit CPUs (except AMD Ryzen and future CPUs with SHA extensions), which makes `authenticated-blake2` faster than `none` and `authenticated`. On modern ARM CPUs, NEON provides hardware acceleration for SHA256 making it faster than BLAKE2b-256 there. NEON accelerates AES as well. Hardware acceleration is always used automatically when available. `repokey` and `keyfile` use AES-CTR-256 for encryption and HMAC-SHA256 for authentication in an encrypt-then-MAC (EtM) construction. The chunk ID hash is HMAC-SHA256 as well (with a separate key). These modes are compatible with Borg 1.0.x. `repokey-blake2` and `keyfile-blake2` are also authenticated encryption modes, but use BLAKE2b-256 instead of HMAC-SHA256 for authentication. The chunk ID hash is a keyed BLAKE2b-256 hash. These modes are new and *not* compatible with Borg 1.0.x. `authenticated` mode uses no encryption, but authenticates repository contents through the same HMAC-SHA256 hash as the `repokey` and `keyfile` modes (it uses it as the chunk ID hash). The key is stored like `repokey`. This mode is new and *not* compatible with Borg 1.0.x. `authenticated-blake2` is like `authenticated`, but uses the keyed BLAKE2b-256 hash from the other blake2 modes. This mode is new and *not* compatible with Borg 1.0.x. `none` mode uses no encryption and no authentication. It uses SHA256 as chunk ID hash. This mode is not recommended, you should rather consider using an authenticated or authenticated/encrypted mode. This mode has possible denial-of-service issues when running ``borg create`` on contents controlled by an attacker. Use it only for new repositories where no encryption is wanted **and** when compatibility with 1.0.x is important. If compatibility with 1.0.x is not important, use `authenticated-blake2` or `authenticated` instead. This mode is compatible with Borg 1.0.x. """) subparser = subparsers.add_parser('init', parents=[common_parser], add_help=False, description=self.do_init.__doc__, epilog=init_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, help='initialize empty repository') subparser.set_defaults(func=self.do_init) subparser.add_argument('location', metavar='REPOSITORY', nargs='?', default='', type=location_validator(archive=False), help='repository to create') subparser.add_argument('-e', '--encryption', metavar='MODE', dest='encryption', required=True, choices=key_argument_names(), help='select encryption key mode **(required)**') subparser.add_argument('--append-only', dest='append_only', action='store_true', help='create an append-only mode repository. Note that this only affects ' 'the low level structure of the repository, and running `delete` ' 'or `prune` will still be allowed. See :ref:`append_only_mode` in ' 'Additional Notes for more details.') subparser.add_argument('--storage-quota', metavar='QUOTA', dest='storage_quota', default=None, type=parse_storage_quota, help='Set storage quota of the new repository (e.g. 5G, 1.5T). Default: no quota.') subparser.add_argument('--make-parent-dirs', dest='make_parent_dirs', action='store_true', help='create the parent directories of the repository directory, if they are missing.') # borg key subparser = subparsers.add_parser('key', parents=[mid_common_parser], add_help=False, description="Manage a keyfile or repokey of a repository", epilog="", formatter_class=argparse.RawDescriptionHelpFormatter, help='manage repository key') key_parsers = subparser.add_subparsers(title='required arguments', metavar='') subparser.set_defaults(fallback_func=functools.partial(self.do_subcommand_help, subparser)) key_export_epilog = process_epilog(""" If repository encryption is used, the repository is inaccessible without the key. This command allows one to backup this essential key. Note that the backup produced does not include the passphrase itself (i.e. the exported key stays encrypted). In order to regain access to a repository, one needs both the exported key and the original passphrase. There are three backup formats. The normal backup format is suitable for digital storage as a file. The ``--paper`` backup format is optimized for printing and typing in while importing, with per line checks to reduce problems with manual input. The ``--qr-html`` creates a printable HTML template with a QR code and a copy of the ``--paper``-formatted key. For repositories using keyfile encryption the key is saved locally on the system that is capable of doing backups. To guard against loss of this key, the key needs to be backed up independently of the main data backup. For repositories using the repokey encryption the key is saved in the repository in the config file. A backup is thus not strictly needed, but guards against the repository becoming inaccessible if the file is damaged for some reason. Examples:: borg key export /path/to/repo > encrypted-key-backup borg key export --paper /path/to/repo > encrypted-key-backup.txt borg key export --qr-html /path/to/repo > encrypted-key-backup.html # Or pass the output file as an argument instead of redirecting stdout: borg key export /path/to/repo encrypted-key-backup borg key export --paper /path/to/repo encrypted-key-backup.txt borg key export --qr-html /path/to/repo encrypted-key-backup.html """) subparser = key_parsers.add_parser('export', parents=[common_parser], add_help=False, description=self.do_key_export.__doc__, epilog=key_export_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, help='export repository key for backup') subparser.set_defaults(func=self.do_key_export) subparser.add_argument('location', metavar='REPOSITORY', nargs='?', default='', type=location_validator(archive=False)) subparser.add_argument('path', metavar='PATH', nargs='?', type=PathSpec, help='where to store the backup') subparser.add_argument('--paper', dest='paper', action='store_true', help='Create an export suitable for printing and later type-in') subparser.add_argument('--qr-html', dest='qr', action='store_true', help='Create an html file suitable for printing and later type-in or qr scan') key_import_epilog = process_epilog(""" This command restores a key previously backed up with the export command. If the ``--paper`` option is given, the import will be an interactive process in which each line is checked for plausibility before proceeding to the next line. For this format PATH must not be given. For repositories using keyfile encryption, the key file which ``borg key import`` writes to depends on several factors. If the ``BORG_KEY_FILE`` environment variable is set and non-empty, ``borg key import`` creates or overwrites that file named by ``$BORG_KEY_FILE``. Otherwise, ``borg key import`` searches in the ``$BORG_KEYS_DIR`` directory for a key file associated with the repository. If a key file is found in ``$BORG_KEYS_DIR``, ``borg key import`` overwrites it; otherwise, ``borg key import`` creates a new key file in ``$BORG_KEYS_DIR``. """) subparser = key_parsers.add_parser('import', parents=[common_parser], add_help=False, description=self.do_key_import.__doc__, epilog=key_import_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, help='import repository key from backup') subparser.set_defaults(func=self.do_key_import) subparser.add_argument('location', metavar='REPOSITORY', nargs='?', default='', type=location_validator(archive=False)) subparser.add_argument('path', metavar='PATH', nargs='?', type=PathSpec, help='path to the backup (\'-\' to read from stdin)') subparser.add_argument('--paper', dest='paper', action='store_true', help='interactively import from a backup done with ``--paper``') change_passphrase_epilog = process_epilog(""" The key files used for repository encryption are optionally passphrase protected. This command can be used to change this passphrase. Please note that this command only changes the passphrase, but not any secret protected by it (like e.g. encryption/MAC keys or chunker seed). Thus, changing the passphrase after passphrase and borg key got compromised does not protect future (nor past) backups to the same repository. """) subparser = key_parsers.add_parser('change-passphrase', parents=[common_parser], add_help=False, description=self.do_change_passphrase.__doc__, epilog=change_passphrase_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, help='change repository passphrase') subparser.set_defaults(func=self.do_change_passphrase) subparser.add_argument('location', metavar='REPOSITORY', nargs='?', default='', type=location_validator(archive=False)) migrate_to_repokey_epilog = process_epilog(""" This command migrates a repository from passphrase mode (removed in Borg 1.0) to repokey mode. You will be first asked for the repository passphrase (to open it in passphrase mode). This is the same passphrase as you used to use for this repo before 1.0. It will then derive the different secrets from this passphrase. Then you will be asked for a new passphrase (twice, for safety). This passphrase will be used to protect the repokey (which contains these same secrets in encrypted form). You may use the same passphrase as you used to use, but you may also use a different one. After migrating to repokey mode, you can change the passphrase at any time. But please note: the secrets will always stay the same and they could always be derived from your (old) passphrase-mode passphrase. """) subparser = key_parsers.add_parser('migrate-to-repokey', parents=[common_parser], add_help=False, description=self.do_migrate_to_repokey.__doc__, epilog=migrate_to_repokey_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, help='migrate passphrase-mode repository to repokey') subparser.set_defaults(func=self.do_migrate_to_repokey) subparser.add_argument('location', metavar='REPOSITORY', nargs='?', default='', type=location_validator(archive=False)) # borg list list_epilog = process_epilog(""" This command lists the contents of a repository or an archive. For more help on include/exclude patterns, see the :ref:`borg_patterns` command output. .. man NOTES The FORMAT specifier syntax +++++++++++++++++++++++++++ The ``--format`` option uses python's `format string syntax `_. Examples: :: $ borg list --format '{archive}{NL}' /path/to/repo ArchiveFoo ArchiveBar ... # {VAR:NUMBER} - pad to NUMBER columns. # Strings are left-aligned, numbers are right-aligned. # Note: time columns except ``isomtime``, ``isoctime`` and ``isoatime`` cannot be padded. $ borg list --format '{archive:36} {time} [{id}]{NL}' /path/to/repo ArchiveFoo Thu, 2021-12-09 10:22:28 [0b8e9a312bef3f2f6e2d0fc110c196827786c15eba0188738e81697a7fa3b274] $ borg list --format '{mode} {user:6} {group:6} {size:8} {mtime} {path}{extra}{NL}' /path/to/repo::ArchiveFoo -rw-rw-r-- user user 1024 Thu, 2021-12-09 10:22:17 file-foo ... # {VAR:NUMBER} - pad to NUMBER columns right-aligned. $ borg list --format '{mode} {user:>6} {group:>6} {size:<8} {mtime} {path}{extra}{NL}' /path/to/repo::ArchiveFoo -rw-rw-r-- user user 1024 Thu, 2021-12-09 10:22:17 file-foo ... The following keys are always available: """) + BaseFormatter.keys_help() + textwrap.dedent(""" Keys available only when listing archives in a repository: """) + ArchiveFormatter.keys_help() + textwrap.dedent(""" Keys available only when listing files in an archive: """) + ItemFormatter.keys_help() subparser = subparsers.add_parser('list', parents=[common_parser], add_help=False, description=self.do_list.__doc__, epilog=list_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, help='list archive or repository contents') subparser.set_defaults(func=self.do_list) subparser.add_argument('--consider-checkpoints', action='store_true', dest='consider_checkpoints', help='Show checkpoint archives in the repository contents list (default: hidden).') subparser.add_argument('--short', dest='short', action='store_true', help='only print file/directory names, nothing else') subparser.add_argument('--format', metavar='FORMAT', dest='format', help='specify format for file or archive listing ' '(default for files: "{mode} {user:6} {group:6} {size:8} {mtime} {path}{extra}{NL}"; ' 'for archives: "{archive:<36} {time} [{id}]{NL}")') subparser.add_argument('--json', action='store_true', help='Only valid for listing repository contents. Format output as JSON. ' 'The form of ``--format`` is ignored, ' 'but keys used in it are added to the JSON output. ' 'Some keys are always present. Note: JSON can only represent text. ' 'A "barchive" key is therefore not available.') subparser.add_argument('--json-lines', action='store_true', help='Only valid for listing archive contents. Format output as JSON Lines. ' 'The form of ``--format`` is ignored, ' 'but keys used in it are added to the JSON output. ' 'Some keys are always present. Note: JSON can only represent text. ' 'A "bpath" key is therefore not available.') subparser.add_argument('location', metavar='REPOSITORY_OR_ARCHIVE', nargs='?', default='', type=location_validator(), help='repository or archive to list contents of') subparser.add_argument('paths', metavar='PATH', nargs='*', type=PathSpec, help='paths to list; patterns are supported') define_archive_filters_group(subparser) define_exclusion_group(subparser) subparser = subparsers.add_parser('mount', parents=[common_parser], add_help=False, description=self.do_mount.__doc__, epilog=mount_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, help='mount repository') define_borg_mount(subparser) # borg prune prune_epilog = process_epilog(""" The prune command prunes a repository by deleting all archives not matching any of the specified retention options. Important: Repository disk space is **not** freed until you run ``borg compact``. This command is normally used by automated backup scripts wanting to keep a certain number of historic backups. This retention policy is commonly referred to as `GFS `_ (Grandfather-father-son) backup rotation scheme. Also, prune automatically removes checkpoint archives (incomplete archives left behind by interrupted backup runs) except if the checkpoint is the latest archive (and thus still needed). Checkpoint archives are not considered when comparing archive counts against the retention limits (``--keep-X``). If a prefix is set with -P, then only archives that start with the prefix are considered for deletion and only those archives count towards the totals specified by the rules. Otherwise, *all* archives in the repository are candidates for deletion! There is no automatic distinction between archives representing different contents. These need to be distinguished by specifying matching prefixes. If you have multiple sequences of archives with different data sets (e.g. from different machines) in one shared repository, use one prune call per data set that matches only the respective archives using the -P option. The ``--keep-within`` option takes an argument of the form "", where char is "H", "d", "w", "m", "y". For example, ``--keep-within 2d`` means to keep all archives that were created within the past 48 hours. "1m" is taken to mean "31d". The archives kept with this option do not count towards the totals specified by any other options. A good procedure is to thin out more and more the older your backups get. As an example, ``--keep-daily 7`` means to keep the latest backup on each day, up to 7 most recent days with backups (days without backups do not count). The rules are applied from secondly to yearly, and backups selected by previous rules do not count towards those of later rules. The time that each backup starts is used for pruning purposes. Dates and times are interpreted in the local timezone, and weeks go from Monday to Sunday. Specifying a negative number of archives to keep means that there is no limit. As of borg 1.2.0, borg will retain the oldest archive if any of the secondly, minutely, hourly, daily, weekly, monthly, or yearly rules was not otherwise able to meet its retention target. This enables the first chronological archive to continue aging until it is replaced by a newer archive that meets the retention criteria. The ``--keep-last N`` option is doing the same as ``--keep-secondly N`` (and it will keep the last N archives under the assumption that you do not create more than one backup archive in the same second). When using ``--stats``, you will get some statistics about how much data was deleted - the "Deleted data" deduplicated size there is most interesting as that is how much your repository will shrink. Please note that the "All archives" stats refer to the state after pruning. """) subparser = subparsers.add_parser('prune', parents=[common_parser], add_help=False, description=self.do_prune.__doc__, epilog=prune_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, help='prune archives') subparser.set_defaults(func=self.do_prune) subparser.add_argument('-n', '--dry-run', dest='dry_run', action='store_true', help='do not change repository') subparser.add_argument('--force', dest='forced', action='store_true', help='force pruning of corrupted archives, ' 'use ``--force --force`` in case ``--force`` does not work.') subparser.add_argument('-s', '--stats', dest='stats', action='store_true', help='print statistics for the deleted archive') subparser.add_argument('--list', dest='output_list', action='store_true', help='output verbose list of archives it keeps/prunes') subparser.add_argument('--keep-within', metavar='INTERVAL', dest='within', type=interval, help='keep all archives within this time interval') subparser.add_argument('--keep-last', '--keep-secondly', dest='secondly', type=int, default=0, help='number of secondly archives to keep') subparser.add_argument('--keep-minutely', dest='minutely', type=int, default=0, help='number of minutely archives to keep') subparser.add_argument('-H', '--keep-hourly', dest='hourly', type=int, default=0, help='number of hourly archives to keep') subparser.add_argument('-d', '--keep-daily', dest='daily', type=int, default=0, help='number of daily archives to keep') subparser.add_argument('-w', '--keep-weekly', dest='weekly', type=int, default=0, help='number of weekly archives to keep') subparser.add_argument('-m', '--keep-monthly', dest='monthly', type=int, default=0, help='number of monthly archives to keep') subparser.add_argument('-y', '--keep-yearly', dest='yearly', type=int, default=0, help='number of yearly archives to keep') define_archive_filters_group(subparser, sort_by=False, first_last=False) subparser.add_argument('--save-space', dest='save_space', action='store_true', help='work slower, but using less space') subparser.add_argument('-c', '--checkpoint-interval', metavar='SECONDS', dest='checkpoint_interval', type=int, default=1800, help='write checkpoint every SECONDS seconds (Default: 1800)') subparser.add_argument('location', metavar='REPOSITORY', nargs='?', default='', type=location_validator(archive=False), help='repository to prune') # borg recreate recreate_epilog = process_epilog(""" Recreate the contents of existing archives. recreate is a potentially dangerous function and might lead to data loss (if used wrongly). BE VERY CAREFUL! Important: Repository disk space is **not** freed until you run ``borg compact``. ``--exclude``, ``--exclude-from``, ``--exclude-if-present``, ``--keep-exclude-tags`` and PATH have the exact same semantics as in "borg create", but they only check for files in the archives and not in the local file system. If PATHs are specified, the resulting archives will only contain files from these PATHs. Note that all paths in an archive are relative, therefore absolute patterns/paths will *not* match (``--exclude``, ``--exclude-from``, PATHs). ``--recompress`` allows one to change the compression of existing data in archives. Due to how Borg stores compressed size information this might display incorrect information for archives that were not recreated at the same time. There is no risk of data loss by this. ``--chunker-params`` will re-chunk all files in the archive, this can be used to have upgraded Borg 0.xx or Attic archives deduplicate with Borg 1.x archives. **USE WITH CAUTION.** Depending on the PATHs and patterns given, recreate can be used to permanently delete files from archives. When in doubt, use ``--dry-run --verbose --list`` to see how patterns/PATHS are interpreted. See :ref:`list_item_flags` in ``borg create`` for details. The archive being recreated is only removed after the operation completes. The archive that is built during the operation exists at the same time at ".recreate". The new archive will have a different archive ID. With ``--target`` the original archive is not replaced, instead a new archive is created. When rechunking (or recompressing), space usage can be substantial - expect at least the entire deduplicated size of the archives using the previous chunker (or compression) params. If you recently ran borg check --repair and it had to fix lost chunks with all-zero replacement chunks, please first run another backup for the same data and re-run borg check --repair afterwards to heal any archives that had lost chunks which are still generated from the input data. Important: running borg recreate to re-chunk will remove the chunks_healthy metadata of all items with replacement chunks, so healing will not be possible any more after re-chunking (it is also unlikely it would ever work: due to the change of chunking parameters, the missing chunk likely will never be seen again even if you still have the data that produced it). """) subparser = subparsers.add_parser('recreate', parents=[common_parser], add_help=False, description=self.do_recreate.__doc__, epilog=recreate_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, help=self.do_recreate.__doc__) subparser.set_defaults(func=self.do_recreate) subparser.add_argument('--list', dest='output_list', action='store_true', help='output verbose list of items (files, dirs, ...)') subparser.add_argument('--filter', metavar='STATUSCHARS', dest='output_filter', action=Highlander, help='only display items with the given status characters (listed in borg create --help)') subparser.add_argument('-n', '--dry-run', dest='dry_run', action='store_true', help='do not change anything') subparser.add_argument('-s', '--stats', dest='stats', action='store_true', help='print statistics at end') define_exclusion_group(subparser, tag_files=True) archive_group = subparser.add_argument_group('Archive options') archive_group.add_argument('--target', dest='target', metavar='TARGET', default=None, type=archivename_validator(), help='create a new archive with the name ARCHIVE, do not replace existing archive ' '(only applies for a single archive)') archive_group.add_argument('-c', '--checkpoint-interval', dest='checkpoint_interval', type=int, default=1800, metavar='SECONDS', help='write checkpoint every SECONDS seconds (Default: 1800)') archive_group.add_argument('--comment', dest='comment', metavar='COMMENT', type=CommentSpec, default=None, help='add a comment text to the archive') archive_group.add_argument('--timestamp', metavar='TIMESTAMP', dest='timestamp', type=timestamp, default=None, help='manually specify the archive creation date/time (UTC, yyyy-mm-ddThh:mm:ss format). ' 'alternatively, give a reference file/directory.') archive_group.add_argument('-C', '--compression', metavar='COMPRESSION', dest='compression', type=CompressionSpec, default=CompressionSpec('lz4'), help='select compression algorithm, see the output of the ' '"borg help compression" command for details.') archive_group.add_argument('--recompress', metavar='MODE', dest='recompress', nargs='?', default='never', const='if-different', choices=('never', 'if-different', 'always'), help='recompress data chunks according to `MODE` and ``--compression``. ' 'Possible modes are ' '`if-different`: recompress if current compression is with a different ' 'compression algorithm (the level is not considered); ' '`always`: recompress even if current compression is with the same ' 'compression algorithm (use this to change the compression level); and ' '`never`: do not recompress (use this option to explicitly prevent ' 'recompression). ' 'If no MODE is given, `if-different` will be used. ' 'Not passing --recompress is equivalent to "--recompress never".') archive_group.add_argument('--chunker-params', metavar='PARAMS', dest='chunker_params', action=Highlander, type=ChunkerParams, default=None, help='rechunk using given chunker parameters (ALGO, CHUNK_MIN_EXP, CHUNK_MAX_EXP, ' 'HASH_MASK_BITS, HASH_WINDOW_SIZE) or `default` to use the chunker defaults. ' 'default: do not rechunk') subparser.add_argument('location', metavar='REPOSITORY_OR_ARCHIVE', nargs='?', default='', type=location_validator(), help='repository or archive to recreate') subparser.add_argument('paths', metavar='PATH', nargs='*', type=PathSpec, help='paths to recreate; patterns are supported') # borg rename rename_epilog = process_epilog(""" This command renames an archive in the repository. This results in a different archive ID. """) subparser = subparsers.add_parser('rename', parents=[common_parser], add_help=False, description=self.do_rename.__doc__, epilog=rename_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, help='rename archive') subparser.set_defaults(func=self.do_rename) subparser.add_argument('location', metavar='ARCHIVE', type=location_validator(archive=True), help='archive to rename') subparser.add_argument('name', metavar='NEWNAME', type=archivename_validator(), help='the new archive name to use') # borg serve serve_epilog = process_epilog(""" This command starts a repository server process. This command is usually not used manually. """) subparser = subparsers.add_parser('serve', parents=[common_parser], add_help=False, description=self.do_serve.__doc__, epilog=serve_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, help='start repository server process') subparser.set_defaults(func=self.do_serve) subparser.add_argument('--restrict-to-path', metavar='PATH', dest='restrict_to_paths', action='append', help='restrict repository access to PATH. ' 'Can be specified multiple times to allow the client access to several directories. ' 'Access to all sub-directories is granted implicitly; PATH doesn\'t need to directly point to a repository.') subparser.add_argument('--restrict-to-repository', metavar='PATH', dest='restrict_to_repositories', action='append', help='restrict repository access. Only the repository located at PATH ' '(no sub-directories are considered) is accessible. ' 'Can be specified multiple times to allow the client access to several repositories. ' 'Unlike ``--restrict-to-path`` sub-directories are not accessible; ' 'PATH needs to directly point at a repository location. ' 'PATH may be an empty directory or the last element of PATH may not exist, in which case ' 'the client may initialize a repository there.') subparser.add_argument('--append-only', dest='append_only', action='store_true', help='only allow appending to repository segment files. Note that this only ' 'affects the low level structure of the repository, and running `delete` ' 'or `prune` will still be allowed. See :ref:`append_only_mode` in Additional ' 'Notes for more details.') subparser.add_argument('--storage-quota', metavar='QUOTA', dest='storage_quota', type=parse_storage_quota, default=None, help='Override storage quota of the repository (e.g. 5G, 1.5T). ' 'When a new repository is initialized, sets the storage quota on the new ' 'repository as well. Default: no quota.') # borg umount umount_epilog = process_epilog(""" This command un-mounts a FUSE filesystem that was mounted with ``borg mount``. This is a convenience wrapper that just calls the platform-specific shell command - usually this is either umount or fusermount -u. """) subparser = subparsers.add_parser('umount', parents=[common_parser], add_help=False, description=self.do_umount.__doc__, epilog=umount_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, help='umount repository') subparser.set_defaults(func=self.do_umount) subparser.add_argument('mountpoint', metavar='MOUNTPOINT', type=str, help='mountpoint of the filesystem to umount') # borg upgrade upgrade_epilog = process_epilog(""" Upgrade an existing, local Borg repository. When you do not need borg upgrade +++++++++++++++++++++++++++++++++ Not every change requires that you run ``borg upgrade``. You do **not** need to run it when: - moving your repository to a different place - upgrading to another point release (like 1.0.x to 1.0.y), except when noted otherwise in the changelog - upgrading from 1.0.x to 1.1.x, except when noted otherwise in the changelog Borg 1.x.y upgrades +++++++++++++++++++ Archive TAM authentication: Use ``borg upgrade --archives-tam REPO`` to add archive TAMs to all archives that are not TAM authenticated yet. This is a convenient method to just trust all archives present - if an archive does not have TAM authentication yet, a TAM will be added. Archives created by old borg versions < 1.0.9 do not have TAMs. Archives created by newer borg version should have TAMs already. If you have a high risk environment, you should not just run this, but first verify that the archives are authentic and not malicious (== have good content, have a good timestamp). Borg 1.2.5+ needs all archives to be TAM authenticated for safety reasons. This upgrade needs to be done once per repository. Manifest TAM authentication: Use ``borg upgrade --tam REPO`` to require manifest authentication introduced with Borg 1.0.9 to address security issues. This means that modifying the repository after doing this with a version prior to 1.0.9 will raise a validation error, so only perform this upgrade after updating all clients using the repository to 1.0.9 or newer. This upgrade should be done on each client for safety reasons. If a repository is accidentally modified with a pre-1.0.9 client after this upgrade, use ``borg upgrade --tam --force REPO`` to remedy it. If you routinely do this you might not want to enable this upgrade (which will leave you exposed to the security issue). You can reverse the upgrade by issuing ``borg upgrade --disable-tam REPO``. See https://borgbackup.readthedocs.io/en/stable/changes.html#pre-1-0-9-manifest-spoofing-vulnerability for details. Attic and Borg 0.xx to Borg 1.x +++++++++++++++++++++++++++++++ This currently supports converting an Attic repository to Borg and also helps with converting Borg 0.xx to 1.0. Currently, only LOCAL repositories can be upgraded (issue #465). Please note that ``borg create`` (since 1.0.0) uses bigger chunks by default than old borg or attic did, so the new chunks won't deduplicate with the old chunks in the upgraded repository. See ``--chunker-params`` option of ``borg create`` and ``borg recreate``. ``borg upgrade`` will change the magic strings in the repository's segments to match the new Borg magic strings. The keyfiles found in $ATTIC_KEYS_DIR or ~/.attic/keys/ will also be converted and copied to $BORG_KEYS_DIR or ~/.config/borg/keys. The cache files are converted, from $ATTIC_CACHE_DIR or ~/.cache/attic to $BORG_CACHE_DIR or ~/.cache/borg, but the cache layout between Borg and Attic changed, so it is possible the first backup after the conversion takes longer than expected due to the cache resync. Upgrade should be able to resume if interrupted, although it will still iterate over all segments. If you want to start from scratch, use `borg delete` over the copied repository to make sure the cache files are also removed:: borg delete borg Unless ``--inplace`` is specified, the upgrade process first creates a backup copy of the repository, in REPOSITORY.before-upgrade-DATETIME, using hardlinks. This requires that the repository and its parent directory reside on same filesystem so the hardlink copy can work. This takes longer than in place upgrades, but is much safer and gives progress information (as opposed to ``cp -al``). Once you are satisfied with the conversion, you can safely destroy the backup copy. WARNING: Running the upgrade in place will make the current copy unusable with older version, with no way of going back to previous versions. This can PERMANENTLY DAMAGE YOUR REPOSITORY! Attic CAN NOT READ BORG REPOSITORIES, as the magic strings have changed. You have been warned.""") subparser = subparsers.add_parser('upgrade', parents=[common_parser], add_help=False, description=self.do_upgrade.__doc__, epilog=upgrade_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, help='upgrade repository format') subparser.set_defaults(func=self.do_upgrade) subparser.add_argument('-n', '--dry-run', dest='dry_run', action='store_true', help='do not change repository') subparser.add_argument('--inplace', dest='inplace', action='store_true', help='rewrite repository in place, with no chance of going back ' 'to older versions of the repository.') subparser.add_argument('--force', dest='force', action='store_true', help='Force upgrade') subparser.add_argument('--tam', dest='tam', action='store_true', help='Enable manifest authentication (in key and cache) (Borg 1.0.9 and later).') subparser.add_argument('--check-tam', dest='check_tam', action='store_true', help='check manifest authentication (in key and cache).') subparser.add_argument('--disable-tam', dest='disable_tam', action='store_true', help='Disable manifest authentication (in key and cache).') subparser.add_argument('--check-archives-tam', dest='check_archives_tam', action='store_true', help='check TAM authentication for all archives.') subparser.add_argument('--archives-tam', dest='archives_tam', action='store_true', help='add TAM authentication for all archives.') subparser.add_argument('location', metavar='REPOSITORY', nargs='?', default='', type=location_validator(archive=False), help='path to the repository to be upgraded') # borg with-lock with_lock_epilog = process_epilog(""" This command runs a user-specified command while locking the repository. For example: :: $ borg with-lock /mnt/borgrepo rsync -av /mnt/borgrepo /somewhere/else/borgrepo It will first try to acquire the lock (make sure that no other operation is running in the repo), then execute the given command as a subprocess and wait for its termination, release the lock and return the user command's return code as borg's return code. .. note:: If you copy a repository with the lock held, the lock will be present in the copy. Thus, before using borg on the copy from a different host, you need to use "borg break-lock" on the copied repository, because Borg is cautious and does not automatically remove stale locks made by a different host. """) subparser = subparsers.add_parser('with-lock', parents=[common_parser], add_help=False, description=self.do_with_lock.__doc__, epilog=with_lock_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, help='run user command with lock held') subparser.set_defaults(func=self.do_with_lock) subparser.add_argument('location', metavar='REPOSITORY', type=location_validator(archive=False), help='repository to lock') subparser.add_argument('command', metavar='COMMAND', help='command to run') subparser.add_argument('args', metavar='ARGS', nargs=argparse.REMAINDER, help='command arguments') # borg import-tar import_tar_epilog = process_epilog(""" This command creates a backup archive from a tarball. When giving '-' as path, Borg will read a tar stream from standard input. By default (--tar-filter=auto) Borg will detect whether the file is compressed based on its file extension and pipe the file through an appropriate filter: - .tar.gz or .tgz: gzip -d - .tar.bz2 or .tbz: bzip2 -d - .tar.xz or .txz: xz -d - .tar.zstd or .tar.zst: zstd -d - .tar.lz4: lz4 -d Alternatively, a --tar-filter program may be explicitly specified. It should read compressed data from stdin and output an uncompressed tar stream on stdout. Most documentation of borg create applies. Note that this command does not support excluding files. import-tar is a lossy conversion: BSD flags, ACLs, extended attributes (xattrs), atime and ctime are not exported. Timestamp resolution is limited to whole seconds, not the nanosecond resolution otherwise supported by Borg. A ``--sparse`` option (as found in borg create) is not supported. import-tar reads POSIX.1-1988 (ustar), POSIX.1-2001 (pax), GNU tar, UNIX V7 tar and SunOS tar with extended attributes. To import multiple tarballs into a single archive, they can be simply concatenated (e.g. using "cat") into a single file, and imported with an ``--ignore-zeros`` option to skip through the stop markers between them. """) subparser = subparsers.add_parser('import-tar', parents=[common_parser], add_help=False, description=self.do_import_tar.__doc__, epilog=import_tar_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, help=self.do_import_tar.__doc__) subparser.set_defaults(func=self.do_import_tar) subparser.add_argument('--tar-filter', dest='tar_filter', default='auto', action=Highlander, help='filter program to pipe data through') subparser.add_argument('-s', '--stats', dest='stats', action='store_true', default=False, help='print statistics for the created archive') subparser.add_argument('--list', dest='output_list', action='store_true', default=False, help='output verbose list of items (files, dirs, ...)') subparser.add_argument('--filter', dest='output_filter', metavar='STATUSCHARS', action=Highlander, help='only display items with the given status characters') subparser.add_argument('--json', action='store_true', help='output stats as JSON (implies --stats)') subparser.add_argument('--ignore-zeros', dest='ignore_zeros', action='store_true', default=False, help='ignore zero-filled blocks in the input tarball') archive_group = subparser.add_argument_group('Archive options') archive_group.add_argument('--comment', dest='comment', metavar='COMMENT', default='', help='add a comment text to the archive') archive_group.add_argument('--timestamp', dest='timestamp', type=timestamp, default=None, metavar='TIMESTAMP', help='manually specify the archive creation date/time (UTC, yyyy-mm-ddThh:mm:ss format). ' 'alternatively, give a reference file/directory.') archive_group.add_argument('-c', '--checkpoint-interval', dest='checkpoint_interval', type=int, default=1800, metavar='SECONDS', help='write checkpoint every SECONDS seconds (Default: 1800)') archive_group.add_argument('--chunker-params', dest='chunker_params', action=Highlander, type=ChunkerParams, default=CHUNKER_PARAMS, metavar='PARAMS', help='specify the chunker parameters (ALGO, CHUNK_MIN_EXP, CHUNK_MAX_EXP, ' 'HASH_MASK_BITS, HASH_WINDOW_SIZE). default: %s,%d,%d,%d,%d' % CHUNKER_PARAMS) archive_group.add_argument('-C', '--compression', metavar='COMPRESSION', dest='compression', type=CompressionSpec, default=CompressionSpec('lz4'), help='select compression algorithm, see the output of the ' '"borg help compression" command for details.') subparser.add_argument('location', metavar='ARCHIVE', type=location_validator(archive=True), help='name of archive to create (must be also a valid directory name)') subparser.add_argument('tarfile', metavar='TARFILE', help='input tar file. "-" to read from stdin instead.') return parser def get_args(self, argv, cmd): """usually, just returns argv, except if we deal with a ssh forced command for borg serve.""" result = self.parse_args(argv[1:]) if cmd is not None and result.func == self.do_serve: # borg serve case: # - "result" is how borg got invoked (e.g. via forced command from authorized_keys), # - "client_result" (from "cmd") refers to the command the client wanted to execute, # which might be different in the case of a forced command or same otherwise. client_argv = shlex.split(cmd) # Drop environment variables (do *not* interpret them) before trying to parse # the borg command line. client_argv = list(itertools.dropwhile(lambda arg: '=' in arg, client_argv)) client_result = self.parse_args(client_argv[1:]) if client_result.func == result.func: # make sure we only process like normal if the client is executing # the same command as specified in the forced command, otherwise # just skip this block and return the forced command (== result). # client is allowed to specify the allowlisted options, # everything else comes from the forced "borg serve" command (or the defaults). # stuff from denylist must never be used from the client. denylist = { 'restrict_to_paths', 'restrict_to_repositories', 'append_only', 'storage_quota', 'umask', } allowlist = { 'debug_topics', 'lock_wait', 'log_level', } not_present = object() for attr_name in allowlist: assert attr_name not in denylist, 'allowlist has denylisted attribute name %s' % attr_name value = getattr(client_result, attr_name, not_present) if value is not not_present: # note: it is not possible to specify a allowlisted option via a forced command, # it always gets overridden by the value specified (or defaulted to) by the client command. setattr(result, attr_name, value) return result def parse_args(self, args=None): # We can't use argparse for "serve" since we don't want it to show up in "Available commands" if args: args = self.preprocess_args(args) parser = self.build_parser() args = parser.parse_args(args or ['-h']) parser.common_options.resolve(args) func = get_func(args) if func == self.do_create and args.paths and args.paths_from_stdin: parser.error('Must not pass PATH with ``--paths-from-stdin``.') if func == self.do_create and not args.paths: if args.content_from_command or args.paths_from_command: parser.error('No command given.') elif not args.paths_from_stdin: # need at least 1 path but args.paths may also be populated from patterns parser.error('Need at least one PATH argument.') if not getattr(args, 'lock', True): # Option --bypass-lock sets args.lock = False bypass_allowed = {self.do_check, self.do_config, self.do_diff, self.do_export_tar, self.do_extract, self.do_info, self.do_list, self.do_mount, self.do_umount} if func not in bypass_allowed: raise Error('Not allowed to bypass locking mechanism for chosen command') if getattr(args, 'timestamp', None): args.location = args.location.with_timestamp(args.timestamp) return args def prerun_checks(self, logger, is_serve): if not is_serve: # this is the borg *client*, we need to check the python: check_python() check_extension_modules() selftest(logger) def _setup_implied_logging(self, args): """ turn on INFO level logging for args that imply that they will produce output """ # map of option name to name of logger for that option option_logger = { 'output_list': 'borg.output.list', 'show_version': 'borg.output.show-version', 'show_rc': 'borg.output.show-rc', 'stats': 'borg.output.stats', 'progress': 'borg.output.progress', } for option, logger_name in option_logger.items(): option_set = args.get(option, False) logging.getLogger(logger_name).setLevel('INFO' if option_set else 'WARN') def _setup_topic_debugging(self, args): """Turn on DEBUG level logging for specified --debug-topics.""" for topic in args.debug_topics: if '.' not in topic: topic = 'borg.debug.' + topic logger.debug('Enabling debug topic %s', topic) logging.getLogger(topic).setLevel('DEBUG') def run(self, args): os.umask(args.umask) # early, before opening files self.lock_wait = args.lock_wait func = get_func(args) # do not use loggers before this! is_serve = func == self.do_serve setup_logging(level=args.log_level, is_serve=is_serve, json=args.log_json) self.log_json = args.log_json args.progress |= is_serve self._setup_implied_logging(vars(args)) self._setup_topic_debugging(args) if getattr(args, 'stats', False) and getattr(args, 'dry_run', False): # the data needed for --stats is not computed when using --dry-run, so we can't do it. # for ease of scripting, we just ignore --stats when given with --dry-run. logger.warning("Ignoring --stats. It is not supported when using --dry-run.") args.stats = False if args.show_version: logging.getLogger('borg.output.show-version').info('borgbackup version %s' % __version__) self.prerun_checks(logger, is_serve) if not is_supported_msgpack(): logger.error("You do not have a supported version of the msgpack python package installed. Terminating.") logger.error("This should never happen as specific, supported versions are required by our pyproject.toml.") logger.error("Do not contact borgbackup support about this.") raise Error("unsupported msgpack version") if is_slow_msgpack(): logger.warning(PURE_PYTHON_MSGPACK_WARNING) if args.debug_profile: # Import only when needed - avoids a further increase in startup time import cProfile import marshal logger.debug('Writing execution profile to %s', args.debug_profile) # Open the file early, before running the main program, to avoid # a very late crash in case the specified path is invalid. with open(args.debug_profile, 'wb') as fd: profiler = cProfile.Profile() variables = dict(locals()) profiler.enable() try: return get_ec(func(args)) finally: profiler.disable() profiler.snapshot_stats() if args.debug_profile.endswith('.pyprof'): marshal.dump(profiler.stats, fd) else: # We use msgpack here instead of the marshal module used by cProfile itself, # because the latter is insecure. Since these files may be shared over the # internet we don't want a format that is impossible to interpret outside # an insecure implementation. # See scripts/msgpack2marshal.py for a small script that turns a msgpack file # into a marshal file that can be read by e.g. pyprof2calltree. # For local use it's unnecessary hassle, though, that's why .pyprof makes # it compatible (see above). msgpack.pack(profiler.stats, fd, use_bin_type=True) else: rc = func(args) assert rc is None return get_ec(rc) def sig_info_handler(sig_no, stack): # pragma: no cover """search the stack for infos about the currently processed file and print them""" with signal_handler(sig_no, signal.SIG_IGN): for frame in inspect.getouterframes(stack): func, loc = frame[3], frame[0].f_locals if func in ('process_file', '_rec_walk', ): # create op path = loc['path'] try: pos = loc['fd'].tell() total = loc['st'].st_size except Exception: pos, total = 0, 0 logger.info(f"{path} {format_file_size(pos)}/{format_file_size(total)}") break if func in ('extract_item', ): # extract op path = loc['item'].path try: pos = loc['fd'].tell() except Exception: pos = 0 logger.info(f"{path} {format_file_size(pos)}/???") break def sig_trace_handler(sig_no, stack): # pragma: no cover print('\nReceived SIGUSR2 at %s, dumping trace...' % datetime.now().replace(microsecond=0), file=sys.stderr) faulthandler.dump_traceback() def main(): # pragma: no cover # Make sure stdout and stderr have errors='replace' to avoid unicode # issues when print()-ing unicode file names sys.stdout = ErrorIgnoringTextIOWrapper(sys.stdout.buffer, sys.stdout.encoding, 'replace', line_buffering=True) sys.stderr = ErrorIgnoringTextIOWrapper(sys.stderr.buffer, sys.stderr.encoding, 'replace', line_buffering=True) # If we receive SIGINT (ctrl-c), SIGTERM (kill) or SIGHUP (kill -HUP), # catch them and raise a proper exception that can be handled for an # orderly exit. # SIGHUP is important especially for systemd systems, where logind # sends it when a session exits, in addition to any traditional use. # Output some info if we receive SIGUSR1 or SIGINFO (ctrl-t). # Register fault handler for SIGSEGV, SIGFPE, SIGABRT, SIGBUS and SIGILL. faulthandler.enable() with signal_handler('SIGINT', raising_signal_handler(KeyboardInterrupt)), \ signal_handler('SIGHUP', raising_signal_handler(SigHup)), \ signal_handler('SIGTERM', raising_signal_handler(SigTerm)), \ signal_handler('SIGUSR1', sig_info_handler), \ signal_handler('SIGUSR2', sig_trace_handler), \ signal_handler('SIGINFO', sig_info_handler): archiver = Archiver() msg = msgid = tb = None tb_log_level = logging.ERROR try: args = archiver.get_args(sys.argv, os.environ.get('SSH_ORIGINAL_COMMAND')) except Error as e: msg = e.get_message() tb_log_level = logging.ERROR if e.traceback else logging.DEBUG tb = f'{traceback.format_exc()}\n{sysinfo()}' # we might not have logging setup yet, so get out quickly print(msg, file=sys.stderr) if tb_log_level == logging.ERROR: print(tb, file=sys.stderr) sys.exit(e.exit_code) except argparse.ArgumentTypeError as e: # we might not have logging setup yet, so get out quickly print(str(e), file=sys.stderr) sys.exit(CommandError.exit_mcode if modern_ec else EXIT_ERROR) except Exception: msg = 'Local Exception' tb = f'{traceback.format_exc()}\n{sysinfo()}' # we might not have logging setup yet, so get out quickly print(msg, file=sys.stderr) print(tb, file=sys.stderr) sys.exit(EXIT_ERROR) try: with sig_int: exit_code = archiver.run(args) except Error as e: msg = e.get_message() msgid = type(e).__qualname__ tb_log_level = logging.ERROR if e.traceback else logging.DEBUG tb = f"{traceback.format_exc()}\n{sysinfo()}" exit_code = e.exit_code except RemoteRepository.RPCError as e: important = e.traceback msgid = e.exception_class tb_log_level = logging.ERROR if important else logging.DEBUG if important: msg = e.exception_full else: msg = e.get_message() tb = '\n'.join('Borg server: ' + l for l in e.sysinfo.splitlines()) tb += "\n" + sysinfo() exit_code = EXIT_ERROR except Exception: msg = 'Local Exception' msgid = 'Exception' tb_log_level = logging.ERROR tb = f'{traceback.format_exc()}\n{sysinfo()}' exit_code = EXIT_ERROR except KeyboardInterrupt: msg = 'Keyboard interrupt' tb_log_level = logging.DEBUG tb = f'{traceback.format_exc()}\n{sysinfo()}' exit_code = EXIT_SIGNAL_BASE + 2 except SigTerm: msg = 'Received SIGTERM' msgid = 'Signal.SIGTERM' tb_log_level = logging.DEBUG tb = f'{traceback.format_exc()}\n{sysinfo()}' exit_code = EXIT_SIGNAL_BASE + 15 except SigHup: msg = 'Received SIGHUP.' msgid = 'Signal.SIGHUP' exit_code = EXIT_SIGNAL_BASE + 1 if msg: logger.error(msg, msgid=msgid) if tb: logger.log(tb_log_level, tb) if args.show_rc: rc_logger = logging.getLogger('borg.output.show-rc') exit_msg = 'terminating with %s status, rc %d' try: ec_class = classify_ec(exit_code) except ValueError: rc_logger.error(exit_msg % ('abnormal', exit_code or 666)) else: if ec_class == "success": rc_logger.info(exit_msg % (ec_class, exit_code)) elif ec_class == "warning": rc_logger.warning(exit_msg % (ec_class, exit_code)) elif ec_class == "error": rc_logger.error(exit_msg % (ec_class, exit_code)) elif ec_class == "signal": rc_logger.error(exit_msg % (ec_class, exit_code)) sys.exit(exit_code) if __name__ == '__main__': main() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/cache.py0000644000076500000240000016033314641074756015371 0ustar00twstaffimport configparser import json import os import shutil import stat from collections import namedtuple from time import perf_counter from .logger import create_logger logger = create_logger() files_cache_logger = create_logger('borg.debug.files_cache') from .constants import CACHE_README, FILES_CACHE_MODE_DISABLED from .hashindex import ChunkIndex, ChunkIndexEntry, CacheSynchronizer from .helpers import Location from .helpers import Error from .helpers import Manifest from .helpers import get_cache_dir, get_security_dir from .helpers import int_to_bigint, bigint_to_int, bin_to_hex, hex_to_bin, parse_stringified_list from .helpers import format_file_size from .helpers import safe_ns from .helpers import yes from .helpers import remove_surrogates from .helpers import ProgressIndicatorPercent, ProgressIndicatorMessage from .helpers import set_ec, EXIT_WARNING from .helpers import safe_unlink from .helpers import msgpack from .item import ArchiveItem, ChunkListEntry from .crypto.key import PlaintextKey from .crypto.file_integrity import IntegrityCheckedFile, DetachedIntegrityCheckedFile, FileIntegrityError from .locking import Lock from .platform import SaveFile from .remote import cache_if_remote from .repository import LIST_SCAN_LIMIT # note: cmtime might me either a ctime or a mtime timestamp FileCacheEntry = namedtuple('FileCacheEntry', 'age inode size cmtime chunk_ids') class SecurityManager: """ Tracks repositories. Ensures that nothing bad happens (repository swaps, replay attacks, unknown repositories etc.). This is complicated by the Cache being initially used for this, while only some commands actually use the Cache, which meant that other commands did not perform these checks. Further complications were created by the Cache being a cache, so it could be legitimately deleted, which is annoying because Borg didn't recognize repositories after that. Therefore a second location, the security database (see get_security_dir), was introduced which stores this information. However, this means that the code has to deal with a cache existing but no security DB entry, or inconsistencies between the security DB and the cache which have to be reconciled, and also with no cache existing but a security DB entry. """ def __init__(self, repository): self.repository = repository self.dir = get_security_dir(repository.id_str) self.cache_dir = cache_dir(repository) self.key_type_file = os.path.join(self.dir, 'key-type') self.location_file = os.path.join(self.dir, 'location') self.manifest_ts_file = os.path.join(self.dir, 'manifest-timestamp') @staticmethod def destroy(repository, path=None): """destroy the security dir for ``repository`` or at ``path``""" path = path or get_security_dir(repository.id_str) if os.path.exists(path): shutil.rmtree(path) def known(self): return all(os.path.exists(f) for f in (self.key_type_file, self.location_file, self.manifest_ts_file)) def key_matches(self, key): if not self.known(): return False try: with open(self.key_type_file) as fd: type = fd.read() return type == str(key.TYPE) except OSError as exc: logger.warning('Could not read/parse key type file: %s', exc) def save(self, manifest, key): logger.debug('security: saving state for %s to %s', self.repository.id_str, self.dir) current_location = self.repository._location.canonical_path() logger.debug('security: current location %s', current_location) logger.debug('security: key type %s', str(key.TYPE)) logger.debug('security: manifest timestamp %s', manifest.timestamp) with SaveFile(self.location_file) as fd: fd.write(current_location) with SaveFile(self.key_type_file) as fd: fd.write(str(key.TYPE)) with SaveFile(self.manifest_ts_file) as fd: fd.write(manifest.timestamp) def assert_location_matches(self, cache_config=None): # Warn user before sending data to a relocated repository try: with open(self.location_file) as fd: previous_location = fd.read() logger.debug('security: read previous location %r', previous_location) except FileNotFoundError: logger.debug('security: previous location file %s not found', self.location_file) previous_location = None except OSError as exc: logger.warning('Could not read previous location file: %s', exc) previous_location = None if cache_config and cache_config.previous_location and previous_location != cache_config.previous_location: # Reconcile cache and security dir; we take the cache location. previous_location = cache_config.previous_location logger.debug('security: using previous_location of cache: %r', previous_location) repository_location = self.repository._location.canonical_path() if previous_location and previous_location != repository_location: msg = ("Warning: The repository at location {} was previously located at {}\n".format( repository_location, previous_location) + "Do you want to continue? [yN] ") if not yes(msg, false_msg="Aborting.", invalid_msg="Invalid answer, aborting.", retry=False, env_var_override='BORG_RELOCATED_REPO_ACCESS_IS_OK'): raise Cache.RepositoryAccessAborted() # adapt on-disk config immediately if the new location was accepted logger.debug('security: updating location stored in cache and security dir') with SaveFile(self.location_file) as fd: fd.write(repository_location) if cache_config: cache_config.save() def assert_no_manifest_replay(self, manifest, key, cache_config=None): try: with open(self.manifest_ts_file) as fd: timestamp = fd.read() logger.debug('security: read manifest timestamp %r', timestamp) except FileNotFoundError: logger.debug('security: manifest timestamp file %s not found', self.manifest_ts_file) timestamp = '' except OSError as exc: logger.warning('Could not read previous location file: %s', exc) timestamp = '' if cache_config: timestamp = max(timestamp, cache_config.timestamp or '') logger.debug('security: determined newest manifest timestamp as %s', timestamp) # If repository is older than the cache or security dir something fishy is going on if timestamp and timestamp > manifest.timestamp: if isinstance(key, PlaintextKey): raise Cache.RepositoryIDNotUnique() else: raise Cache.RepositoryReplay() def assert_key_type(self, key, cache_config=None): # Make sure an encrypted repository has not been swapped for an unencrypted repository if cache_config and cache_config.key_type is not None and cache_config.key_type != str(key.TYPE): raise Cache.EncryptionMethodMismatch() if self.known() and not self.key_matches(key): raise Cache.EncryptionMethodMismatch() def assert_secure(self, manifest, key, *, cache_config=None, warn_if_unencrypted=True, lock_wait=None): # warn_if_unencrypted=False is only used for initializing a new repository. # Thus, avoiding asking about a repository that's currently initializing. self.assert_access_unknown(warn_if_unencrypted, manifest, key) if cache_config: self._assert_secure(manifest, key, cache_config) else: cache_config = CacheConfig(self.repository, lock_wait=lock_wait) if cache_config.exists(): with cache_config: self._assert_secure(manifest, key, cache_config) else: self._assert_secure(manifest, key) logger.debug('security: repository checks ok, allowing access') def _assert_secure(self, manifest, key, cache_config=None): self.assert_location_matches(cache_config) self.assert_key_type(key, cache_config) self.assert_no_manifest_replay(manifest, key, cache_config) if not self.known(): logger.debug('security: remembering previously unknown repository') self.save(manifest, key) def assert_access_unknown(self, warn_if_unencrypted, manifest, key): # warn_if_unencrypted=False is only used for initializing a new repository. # Thus, avoiding asking about a repository that's currently initializing. if not key.logically_encrypted and not self.known(): msg = ("Warning: Attempting to access a previously unknown unencrypted repository!\n" + "Do you want to continue? [yN] ") allow_access = not warn_if_unencrypted or yes(msg, false_msg="Aborting.", invalid_msg="Invalid answer, aborting.", retry=False, env_var_override='BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK') if allow_access: if warn_if_unencrypted: logger.debug('security: remembering unknown unencrypted repository (explicitly allowed)') else: logger.debug('security: initializing unencrypted repository') self.save(manifest, key) else: raise Cache.CacheInitAbortedError() def assert_secure(repository, manifest, lock_wait): sm = SecurityManager(repository) sm.assert_secure(manifest, manifest.key, lock_wait=lock_wait) def recanonicalize_relative_location(cache_location, repository): # borg < 1.0.8rc1 had different canonicalization for the repo location (see #1655 and #1741). repo_location = repository._location.canonical_path() rl = Location(repo_location) cl = Location(cache_location) if cl.proto == rl.proto and cl.user == rl.user and cl.host == rl.host and cl.port == rl.port \ and \ cl.path and rl.path and \ cl.path.startswith('/~/') and rl.path.startswith('/./') and cl.path[3:] == rl.path[3:]: # everything is same except the expected change in relative path canonicalization, # update previous_location to avoid warning / user query about changed location: return repo_location else: return cache_location def cache_dir(repository, path=None): return path or os.path.join(get_cache_dir(), repository.id_str) def files_cache_name(): suffix = os.environ.get('BORG_FILES_CACHE_SUFFIX', '') return 'files.' + suffix if suffix else 'files' def discover_files_cache_name(path): return [fn for fn in os.listdir(path) if fn == 'files' or fn.startswith('files.')][0] class CacheConfig: def __init__(self, repository, path=None, lock_wait=None): self.repository = repository self.path = cache_dir(repository, path) self.config_path = os.path.join(self.path, 'config') self.lock = None self.lock_wait = lock_wait def __enter__(self): self.open() return self def __exit__(self, exc_type, exc_val, exc_tb): self.close() def exists(self): return os.path.exists(self.config_path) def create(self): assert not self.exists() config = configparser.ConfigParser(interpolation=None) config.add_section('cache') config.set('cache', 'version', '1') config.set('cache', 'repository', self.repository.id_str) config.set('cache', 'manifest', '') config.add_section('integrity') config.set('integrity', 'manifest', '') with SaveFile(self.config_path) as fd: config.write(fd) def open(self): self.lock = Lock(os.path.join(self.path, 'lock'), exclusive=True, timeout=self.lock_wait).acquire() self.load() def load(self): self._config = configparser.ConfigParser(interpolation=None) with open(self.config_path) as fd: self._config.read_file(fd) self._check_upgrade(self.config_path) self.id = self._config.get('cache', 'repository') self.manifest_id = hex_to_bin(self._config.get('cache', 'manifest')) self.timestamp = self._config.get('cache', 'timestamp', fallback=None) self.key_type = self._config.get('cache', 'key_type', fallback=None) self.ignored_features = set(parse_stringified_list(self._config.get('cache', 'ignored_features', fallback=''))) self.mandatory_features = set(parse_stringified_list(self._config.get('cache', 'mandatory_features', fallback=''))) try: self.integrity = dict(self._config.items('integrity')) if self._config.get('cache', 'manifest') != self.integrity.pop('manifest'): # The cache config file is updated (parsed with ConfigParser, the state of the ConfigParser # is modified and then written out.), not re-created. # Thus, older versions will leave our [integrity] section alone, making the section's data invalid. # Therefore, we also add the manifest ID to this section and # can discern whether an older version interfered by comparing the manifest IDs of this section # and the main [cache] section. self.integrity = {} logger.warning('Cache integrity data not available: old Borg version modified the cache.') except configparser.NoSectionError: logger.debug('Cache integrity: No integrity data found (files, chunks). Cache is from old version.') self.integrity = {} previous_location = self._config.get('cache', 'previous_location', fallback=None) if previous_location: self.previous_location = recanonicalize_relative_location(previous_location, self.repository) else: self.previous_location = None self._config.set('cache', 'previous_location', self.repository._location.canonical_path()) def save(self, manifest=None, key=None): if manifest: self._config.set('cache', 'manifest', manifest.id_str) self._config.set('cache', 'timestamp', manifest.timestamp) self._config.set('cache', 'ignored_features', ','.join(self.ignored_features)) self._config.set('cache', 'mandatory_features', ','.join(self.mandatory_features)) if not self._config.has_section('integrity'): self._config.add_section('integrity') for file, integrity_data in self.integrity.items(): self._config.set('integrity', file, integrity_data) self._config.set('integrity', 'manifest', manifest.id_str) if key: self._config.set('cache', 'key_type', str(key.TYPE)) with SaveFile(self.config_path) as fd: self._config.write(fd) def close(self): if self.lock is not None: self.lock.release() self.lock = None def _check_upgrade(self, config_path): try: cache_version = self._config.getint('cache', 'version') wanted_version = 1 if cache_version != wanted_version: self.close() raise Exception('%s has unexpected cache version %d (wanted: %d).' % (config_path, cache_version, wanted_version)) except configparser.NoSectionError: self.close() raise Exception('%s does not look like a Borg cache.' % config_path) from None class Cache: """Client Side cache """ class CacheInitAbortedError(Error): """Cache initialization aborted""" exit_mcode = 60 class EncryptionMethodMismatch(Error): """Repository encryption method changed since last access, refusing to continue""" exit_mcode = 61 class RepositoryAccessAborted(Error): """Repository access aborted""" exit_mcode = 62 class RepositoryIDNotUnique(Error): """Cache is newer than repository - do you have multiple, independently updated repos with same ID?""" exit_mcode = 63 class RepositoryReplay(Error): """Cache, or information obtained from the security directory is newer than repository - this is either an attack or unsafe (multiple repos with same ID)""" exit_mcode = 64 @staticmethod def break_lock(repository, path=None): path = cache_dir(repository, path) Lock(os.path.join(path, 'lock'), exclusive=True).break_lock() @staticmethod def destroy(repository, path=None): """destroy the cache for ``repository`` or at ``path``""" path = path or os.path.join(get_cache_dir(), repository.id_str) config = os.path.join(path, 'config') if os.path.exists(config): os.remove(config) # kill config first shutil.rmtree(path) def __new__(cls, repository, key, manifest, path=None, sync=True, warn_if_unencrypted=True, progress=False, lock_wait=None, permit_adhoc_cache=False, cache_mode=FILES_CACHE_MODE_DISABLED, consider_part_files=False, iec=False): def local(): return LocalCache(repository=repository, key=key, manifest=manifest, path=path, sync=sync, warn_if_unencrypted=warn_if_unencrypted, progress=progress, iec=iec, lock_wait=lock_wait, cache_mode=cache_mode, consider_part_files=consider_part_files) def adhoc(): return AdHocCache(repository=repository, key=key, manifest=manifest, lock_wait=lock_wait, iec=iec, consider_part_files=consider_part_files) if not permit_adhoc_cache: return local() # ad-hoc cache may be permitted, but if the local cache is in sync it'd be stupid to invalidate # it by needlessly using the ad-hoc cache. # Check if the local cache exists and is in sync. cache_config = CacheConfig(repository, path, lock_wait) if cache_config.exists(): with cache_config: cache_in_sync = cache_config.manifest_id == manifest.id # Don't nest cache locks if cache_in_sync: # Local cache is in sync, use it logger.debug('Cache: choosing local cache (in sync)') return local() logger.debug('Cache: choosing ad-hoc cache (local cache does not exist or is not in sync)') return adhoc() class CacheStatsMixin: str_format = """\ All archives: {0.total_size:>20s} {0.total_csize:>20s} {0.unique_csize:>20s} Unique chunks Total chunks Chunk index: {0.total_unique_chunks:20d} {0.total_chunks:20d}""" def __init__(self, iec=False): self.iec = iec self.pre12_meta = {} # here we cache archive metadata for borg < 1.2 def __str__(self): return self.str_format.format(self.format_tuple()) Summary = namedtuple('Summary', ['total_size', 'total_csize', 'unique_size', 'unique_csize', 'total_unique_chunks', 'total_chunks']) def stats(self): from .archive import Archive # XXX: this should really be moved down to `hashindex.pyx` total_size, total_csize, unique_size, unique_csize, total_unique_chunks, total_chunks = self.chunks.summarize() # the above values have the problem that they do not consider part files, # thus the total_size and total_csize might be too high (chunks referenced # by the part files AND by the complete file). # since borg 1.2 we have new archive metadata telling the total size and # csize per archive, so we can just sum up all archives to get the "all # archives" stats: total_size, total_csize = 0, 0 for archive_name in self.manifest.archives: archive = Archive(self.repository, self.key, self.manifest, archive_name, consider_part_files=self.consider_part_files) stats = archive.calc_stats(self, want_unique=False) total_size += stats.osize total_csize += stats.csize stats = self.Summary(total_size, total_csize, unique_size, unique_csize, total_unique_chunks, total_chunks)._asdict() return stats def format_tuple(self): stats = self.stats() for field in ['total_size', 'total_csize', 'unique_csize']: stats[field] = format_file_size(stats[field], iec=self.iec) return self.Summary(**stats) def chunks_stored_size(self): return self.stats()['unique_csize'] class LocalCache(CacheStatsMixin): """ Persistent, local (client-side) cache. """ def __init__(self, repository, key, manifest, path=None, sync=True, warn_if_unencrypted=True, progress=False, lock_wait=None, cache_mode=FILES_CACHE_MODE_DISABLED, consider_part_files=False, iec=False): """ :param warn_if_unencrypted: print warning if accessing unknown unencrypted repository :param lock_wait: timeout for lock acquisition (int [s] or None [wait forever]) :param sync: do :meth:`.sync` :param cache_mode: what shall be compared in the file stat infos vs. cached stat infos comparison """ CacheStatsMixin.__init__(self, iec=iec) self.repository = repository self.key = key self.manifest = manifest self.progress = progress self.cache_mode = cache_mode self.consider_part_files = consider_part_files self.timestamp = None self.txn_active = False self.path = cache_dir(repository, path) self.security_manager = SecurityManager(repository) self.cache_config = CacheConfig(self.repository, self.path, lock_wait) # Warn user before sending data to a never seen before unencrypted repository if not os.path.exists(self.path): self.security_manager.assert_access_unknown(warn_if_unencrypted, manifest, key) self.create() self.open() try: self.security_manager.assert_secure(manifest, key, cache_config=self.cache_config) if not self.check_cache_compatibility(): self.wipe_cache() self.update_compatibility() if sync and self.manifest.id != self.cache_config.manifest_id: self.sync() self.commit() except: self.close() raise def __enter__(self): return self def __exit__(self, exc_type, exc_val, exc_tb): self.close() def create(self): """Create a new empty cache at `self.path` """ os.makedirs(self.path) with open(os.path.join(self.path, 'README'), 'w') as fd: fd.write(CACHE_README) self.cache_config.create() ChunkIndex().write(os.path.join(self.path, 'chunks')) os.makedirs(os.path.join(self.path, 'chunks.archive.d')) with SaveFile(os.path.join(self.path, files_cache_name()), binary=True): pass # empty file with SaveFile(os.path.join(self.path, 'pre12-meta'), binary=False) as fd: json.dump(self.pre12_meta, fd, indent=4) def _do_open(self): self.cache_config.load() with IntegrityCheckedFile(path=os.path.join(self.path, 'chunks'), write=False, integrity_data=self.cache_config.integrity.get('chunks')) as fd: self.chunks = ChunkIndex.read(fd) if 'd' in self.cache_mode: # d(isabled) self.files = None else: self._read_files() try: with open(os.path.join(self.path, 'pre12-meta')) as fd: self.pre12_meta = json.load(fd) except (FileNotFoundError, json.JSONDecodeError): pass def open(self): if not os.path.isdir(self.path): raise Exception('%s Does not look like a Borg cache' % self.path) self.cache_config.open() self.rollback() def close(self): # save the pre12_meta cache in any case with open(os.path.join(self.path, 'pre12-meta'), 'w') as fd: json.dump(self.pre12_meta, fd, indent=4) if self.cache_config is not None: self.cache_config.close() self.cache_config = None def _read_files(self): self.files = {} self._newest_cmtime = None logger.debug('Reading files cache ...') files_cache_logger.debug("FILES-CACHE-LOAD: starting...") msg = None try: with IntegrityCheckedFile(path=os.path.join(self.path, files_cache_name()), write=False, integrity_data=self.cache_config.integrity.get(files_cache_name())) as fd: u = msgpack.Unpacker(use_list=True) while True: data = fd.read(64 * 1024) if not data: break u.feed(data) try: for path_hash, item in u: entry = FileCacheEntry(*item) # in the end, this takes about 240 Bytes per file self.files[path_hash] = msgpack.packb(entry._replace(age=entry.age + 1)) except (TypeError, ValueError) as exc: msg = "The files cache seems invalid. [%s]" % str(exc) break except OSError as exc: msg = "The files cache can't be read. [%s]" % str(exc) except FileIntegrityError as fie: msg = "The files cache is corrupted. [%s]" % str(fie) if msg is not None: logger.warning(msg) logger.warning('Continuing without files cache - expect lower performance.') self.files = {} files_cache_logger.debug("FILES-CACHE-LOAD: finished, %d entries loaded.", len(self.files)) def begin_txn(self): # Initialize transaction snapshot pi = ProgressIndicatorMessage(msgid='cache.begin_transaction') txn_dir = os.path.join(self.path, 'txn.tmp') os.mkdir(txn_dir) pi.output('Initializing cache transaction: Reading config') shutil.copy(os.path.join(self.path, 'config'), txn_dir) pi.output('Initializing cache transaction: Reading chunks') shutil.copy(os.path.join(self.path, 'chunks'), txn_dir) pi.output('Initializing cache transaction: Reading files') try: shutil.copy(os.path.join(self.path, files_cache_name()), txn_dir) except FileNotFoundError: with SaveFile(os.path.join(txn_dir, files_cache_name()), binary=True): pass # empty file os.rename(os.path.join(self.path, 'txn.tmp'), os.path.join(self.path, 'txn.active')) self.txn_active = True pi.finish() def commit(self): """Commit transaction """ if not self.txn_active: return self.security_manager.save(self.manifest, self.key) pi = ProgressIndicatorMessage(msgid='cache.commit') if self.files is not None: if self._newest_cmtime is None: # was never set because no files were modified/added self._newest_cmtime = 2 ** 63 - 1 # nanoseconds, good until y2262 ttl = int(os.environ.get('BORG_FILES_CACHE_TTL', 20)) pi.output('Saving files cache') files_cache_logger.debug("FILES-CACHE-SAVE: starting...") with IntegrityCheckedFile(path=os.path.join(self.path, files_cache_name()), write=True) as fd: entry_count = 0 for path_hash, item in self.files.items(): # Only keep files seen in this backup that are older than newest cmtime seen in this backup - # this is to avoid issues with filesystem snapshots and cmtime granularity. # Also keep files from older backups that have not reached BORG_FILES_CACHE_TTL yet. entry = FileCacheEntry(*msgpack.unpackb(item)) if entry.age == 0 and bigint_to_int(entry.cmtime) < self._newest_cmtime or \ entry.age > 0 and entry.age < ttl: msgpack.pack((path_hash, entry), fd) entry_count += 1 files_cache_logger.debug("FILES-CACHE-KILL: removed all old entries with age >= TTL [%d]", ttl) files_cache_logger.debug("FILES-CACHE-KILL: removed all current entries with newest cmtime %d", self._newest_cmtime) files_cache_logger.debug("FILES-CACHE-SAVE: finished, %d remaining entries saved.", entry_count) self.cache_config.integrity[files_cache_name()] = fd.integrity_data pi.output('Saving chunks cache') with IntegrityCheckedFile(path=os.path.join(self.path, 'chunks'), write=True) as fd: self.chunks.write(fd) self.cache_config.integrity['chunks'] = fd.integrity_data pi.output('Saving cache config') self.cache_config.save(self.manifest, self.key) os.rename(os.path.join(self.path, 'txn.active'), os.path.join(self.path, 'txn.tmp')) shutil.rmtree(os.path.join(self.path, 'txn.tmp')) self.txn_active = False pi.finish() def rollback(self): """Roll back partial and aborted transactions """ # Remove partial transaction if os.path.exists(os.path.join(self.path, 'txn.tmp')): shutil.rmtree(os.path.join(self.path, 'txn.tmp')) # Roll back active transaction txn_dir = os.path.join(self.path, 'txn.active') if os.path.exists(txn_dir): shutil.copy(os.path.join(txn_dir, 'config'), self.path) shutil.copy(os.path.join(txn_dir, 'chunks'), self.path) shutil.copy(os.path.join(txn_dir, discover_files_cache_name(txn_dir)), self.path) os.rename(txn_dir, os.path.join(self.path, 'txn.tmp')) if os.path.exists(os.path.join(self.path, 'txn.tmp')): shutil.rmtree(os.path.join(self.path, 'txn.tmp')) self.txn_active = False self._do_open() def sync(self): """Re-synchronize chunks cache with repository. Maintains a directory with known backup archive indexes, so it only needs to fetch infos from repo and build a chunk index once per backup archive. If out of sync, missing archive indexes get added, outdated indexes get removed and a new master chunks index is built by merging all archive indexes. """ archive_path = os.path.join(self.path, 'chunks.archive.d') # An index of chunks whose size had to be fetched chunks_fetched_size_index = ChunkIndex() # Instrumentation processed_item_metadata_bytes = 0 processed_item_metadata_chunks = 0 compact_chunks_archive_saved_space = 0 fetched_chunks_for_csize = 0 fetched_bytes_for_csize = 0 def mkpath(id, suffix=''): id_hex = bin_to_hex(id) path = os.path.join(archive_path, id_hex + suffix) return path def cached_archives(): if self.do_cache: fns = os.listdir(archive_path) # filenames with 64 hex digits == 256bit, # or compact indices which are 64 hex digits + ".compact" return {hex_to_bin(fn) for fn in fns if len(fn) == 64} | \ {hex_to_bin(fn[:64]) for fn in fns if len(fn) == 72 and fn.endswith('.compact')} else: return set() def repo_archives(): return {info.id for info in self.manifest.archives.list()} def cleanup_outdated(ids): for id in ids: cleanup_cached_archive(id) def cleanup_cached_archive(id, cleanup_compact=True): try: os.unlink(mkpath(id)) os.unlink(mkpath(id) + '.integrity') except FileNotFoundError: pass if not cleanup_compact: return try: os.unlink(mkpath(id, suffix='.compact')) os.unlink(mkpath(id, suffix='.compact') + '.integrity') except FileNotFoundError: pass def fetch_missing_csize(chunk_idx): """ Archives created with AdHocCache will have csize=0 in all chunk list entries whose chunks were already in the repository. Scan *chunk_idx* for entries where csize=0 and fill in the correct information. """ nonlocal fetched_chunks_for_csize nonlocal fetched_bytes_for_csize all_missing_ids = chunk_idx.zero_csize_ids() fetch_ids = [] if len(chunks_fetched_size_index): for id_ in all_missing_ids: already_fetched_entry = chunks_fetched_size_index.get(id_) if already_fetched_entry: entry = chunk_idx[id_]._replace(csize=already_fetched_entry.csize) assert entry.size == already_fetched_entry.size, 'Chunk size mismatch' chunk_idx[id_] = entry else: fetch_ids.append(id_) else: fetch_ids = all_missing_ids # This is potentially a rather expensive operation, but it's hard to tell at this point # if it's a problem in practice (hence the experimental status of --no-cache-sync). for id_, data in zip(fetch_ids, decrypted_repository.repository.get_many(fetch_ids)): entry = chunk_idx[id_]._replace(csize=len(data)) chunk_idx[id_] = entry chunks_fetched_size_index[id_] = entry fetched_chunks_for_csize += 1 fetched_bytes_for_csize += len(data) def fetch_and_build_idx(archive_id, decrypted_repository, chunk_idx): nonlocal processed_item_metadata_bytes nonlocal processed_item_metadata_chunks csize, data = decrypted_repository.get(archive_id) chunk_idx.add(archive_id, 1, len(data), csize) archive, verified, _ = self.key.unpack_and_verify_archive(data, force_tam_not_required=True) archive = ArchiveItem(internal_dict=archive) if archive.version != 1: raise Exception('Unknown archive metadata version') sync = CacheSynchronizer(chunk_idx) for item_id, (csize, data) in zip(archive.items, decrypted_repository.get_many(archive.items)): chunk_idx.add(item_id, 1, len(data), csize) processed_item_metadata_bytes += len(data) processed_item_metadata_chunks += 1 sync.feed(data) if self.do_cache: fetch_missing_csize(chunk_idx) write_archive_index(archive_id, chunk_idx) def write_archive_index(archive_id, chunk_idx): nonlocal compact_chunks_archive_saved_space compact_chunks_archive_saved_space += chunk_idx.compact() fn = mkpath(archive_id, suffix='.compact') fn_tmp = mkpath(archive_id, suffix='.tmp') try: with DetachedIntegrityCheckedFile(path=fn_tmp, write=True, filename=bin_to_hex(archive_id) + '.compact') as fd: chunk_idx.write(fd) except Exception: safe_unlink(fn_tmp) else: os.rename(fn_tmp, fn) def read_archive_index(archive_id, archive_name): archive_chunk_idx_path = mkpath(archive_id) logger.info("Reading cached archive chunk index for %s ...", archive_name) try: try: # Attempt to load compact index first with DetachedIntegrityCheckedFile(path=archive_chunk_idx_path + '.compact', write=False) as fd: archive_chunk_idx = ChunkIndex.read(fd, permit_compact=True) # In case a non-compact index exists, delete it. cleanup_cached_archive(archive_id, cleanup_compact=False) # Compact index read - return index, no conversion necessary (below). return archive_chunk_idx except FileNotFoundError: # No compact index found, load non-compact index, and convert below. with DetachedIntegrityCheckedFile(path=archive_chunk_idx_path, write=False) as fd: archive_chunk_idx = ChunkIndex.read(fd) except FileIntegrityError as fie: logger.error('Cached archive chunk index of %s is corrupted: %s', archive_name, fie) # Delete corrupted index, set warning. A new index must be build. cleanup_cached_archive(archive_id) set_ec(EXIT_WARNING) return None # Convert to compact index. Delete the existing index first. logger.debug('Found non-compact index for %s, converting to compact.', archive_name) cleanup_cached_archive(archive_id) write_archive_index(archive_id, archive_chunk_idx) return archive_chunk_idx def get_archive_ids_to_names(archive_ids): # Pass once over all archives and build a mapping from ids to names. # The easier approach, doing a similar loop for each archive, has # square complexity and does about a dozen million functions calls # with 1100 archives (which takes 30s CPU seconds _alone_). archive_names = {} for info in self.manifest.archives.list(): if info.id in archive_ids: archive_names[info.id] = info.name assert len(archive_names) == len(archive_ids) return archive_names def create_master_idx(chunk_idx): logger.info('Synchronizing chunks cache...') cached_ids = cached_archives() archive_ids = repo_archives() logger.info('Archives: %d, w/ cached Idx: %d, w/ outdated Idx: %d, w/o cached Idx: %d.', len(archive_ids), len(cached_ids), len(cached_ids - archive_ids), len(archive_ids - cached_ids)) # deallocates old hashindex, creates empty hashindex: chunk_idx.clear() cleanup_outdated(cached_ids - archive_ids) # Explicitly set the usable initial hash table capacity to avoid performance issues # due to hash table "resonance". master_index_capacity = len(self.repository) if archive_ids: chunk_idx = None if not self.do_cache else ChunkIndex(usable=master_index_capacity) pi = ProgressIndicatorPercent(total=len(archive_ids), step=0.1, msg='%3.0f%% Syncing chunks cache. Processing archive %s', msgid='cache.sync') archive_ids_to_names = get_archive_ids_to_names(archive_ids) for archive_id, archive_name in archive_ids_to_names.items(): pi.show(info=[remove_surrogates(archive_name)]) if self.do_cache: if archive_id in cached_ids: archive_chunk_idx = read_archive_index(archive_id, archive_name) if archive_chunk_idx is None: cached_ids.remove(archive_id) if archive_id not in cached_ids: # Do not make this an else branch; the FileIntegrityError exception handler # above can remove *archive_id* from *cached_ids*. logger.info('Fetching and building archive index for %s ...', archive_name) archive_chunk_idx = ChunkIndex() fetch_and_build_idx(archive_id, decrypted_repository, archive_chunk_idx) logger.info("Merging into master chunks index ...") chunk_idx.merge(archive_chunk_idx) else: chunk_idx = chunk_idx or ChunkIndex(usable=master_index_capacity) logger.info('Fetching archive index for %s ...', archive_name) fetch_and_build_idx(archive_id, decrypted_repository, chunk_idx) if not self.do_cache: fetch_missing_csize(chunk_idx) pi.finish() logger.debug('Cache sync: had to fetch %s (%d chunks) because no archive had a csize set for them ' '(due to --no-cache-sync)', format_file_size(fetched_bytes_for_csize), fetched_chunks_for_csize) logger.debug('Cache sync: processed %s (%d chunks) of metadata', format_file_size(processed_item_metadata_bytes), processed_item_metadata_chunks) logger.debug('Cache sync: compact chunks.archive.d storage saved %s bytes', format_file_size(compact_chunks_archive_saved_space)) logger.info('Done.') return chunk_idx def legacy_cleanup(): """bring old cache dirs into the desired state (cleanup and adapt)""" try: os.unlink(os.path.join(self.path, 'chunks.archive')) except: pass try: os.unlink(os.path.join(self.path, 'chunks.archive.tmp')) except: pass try: os.mkdir(archive_path) except: pass # The cache can be used by a command that e.g. only checks against Manifest.Operation.WRITE, # which does not have to include all flags from Manifest.Operation.READ. # Since the sync will attempt to read archives, check compatibility with Manifest.Operation.READ. self.manifest.check_repository_compatibility((Manifest.Operation.READ, )) self.begin_txn() with cache_if_remote(self.repository, decrypted_cache=self.key) as decrypted_repository: legacy_cleanup() # TEMPORARY HACK: to avoid archive index caching, create a FILE named ~/.cache/borg/REPOID/chunks.archive.d - # this is only recommended if you have a fast, low latency connection to your repo (e.g. if repo is local disk) self.do_cache = os.path.isdir(archive_path) self.chunks = create_master_idx(self.chunks) def check_cache_compatibility(self): my_features = Manifest.SUPPORTED_REPO_FEATURES if self.cache_config.ignored_features & my_features: # The cache might not contain references of chunks that need a feature that is mandatory for some operation # and which this version supports. To avoid corruption while executing that operation force rebuild. return False if not self.cache_config.mandatory_features <= my_features: # The cache was build with consideration to at least one feature that this version does not understand. # This client might misinterpret the cache. Thus force a rebuild. return False return True def wipe_cache(self): logger.warning("Discarding incompatible cache and forcing a cache rebuild") archive_path = os.path.join(self.path, 'chunks.archive.d') if os.path.isdir(archive_path): shutil.rmtree(os.path.join(self.path, 'chunks.archive.d')) os.makedirs(os.path.join(self.path, 'chunks.archive.d')) self.chunks = ChunkIndex() with SaveFile(os.path.join(self.path, files_cache_name()), binary=True): pass # empty file self.cache_config.manifest_id = '' self.cache_config._config.set('cache', 'manifest', '') self.cache_config.ignored_features = set() self.cache_config.mandatory_features = set() def update_compatibility(self): operation_to_features_map = self.manifest.get_all_mandatory_features() my_features = Manifest.SUPPORTED_REPO_FEATURES repo_features = set() for operation, features in operation_to_features_map.items(): repo_features.update(features) self.cache_config.ignored_features.update(repo_features - my_features) self.cache_config.mandatory_features.update(repo_features & my_features) def add_chunk(self, id, chunk, stats, overwrite=False, wait=True): if not self.txn_active: self.begin_txn() size = len(chunk) refcount = self.seen_chunk(id, size) if refcount and not overwrite: return self.chunk_incref(id, stats) data = self.key.encrypt(chunk) csize = len(data) self.repository.put(id, data, wait=wait) self.chunks.add(id, 1, size, csize) stats.update(size, csize, not refcount) return ChunkListEntry(id, size, csize) def seen_chunk(self, id, size=None): refcount, stored_size, _ = self.chunks.get(id, ChunkIndexEntry(0, None, None)) if size is not None and stored_size is not None and size != stored_size: # we already have a chunk with that id, but different size. # this is either a hash collision (unlikely) or corruption or a bug. raise Exception("chunk has same id [%r], but different size (stored: %d new: %d)!" % ( id, stored_size, size)) return refcount def chunk_incref(self, id, stats, size=None, part=False): if not self.txn_active: self.begin_txn() count, _size, csize = self.chunks.incref(id) stats.update(_size, csize, False, part=part) return ChunkListEntry(id, _size, csize) def chunk_decref(self, id, stats, wait=True, part=False): if not self.txn_active: self.begin_txn() count, size, csize = self.chunks.decref(id) if count == 0: del self.chunks[id] self.repository.delete(id, wait=wait) stats.update(-size, -csize, True, part=part) else: stats.update(-size, -csize, False, part=part) def file_known_and_unchanged(self, hashed_path, path_hash, st): """ Check if we know the file that has this path_hash (know == it is in our files cache) and whether it is unchanged (the size/inode number/cmtime is same for stuff we check in this cache_mode). :param hashed_path: the file's path as we gave it to hash(hashed_path) :param path_hash: hash(hashed_path), to save some memory in the files cache :param st: the file's stat() result :return: known, ids (known is True if we have infos about this file in the cache, ids is the list of chunk ids IF the file has not changed, otherwise None). """ if not stat.S_ISREG(st.st_mode): return False, None cache_mode = self.cache_mode if 'd' in cache_mode: # d(isabled) files_cache_logger.debug('UNKNOWN: files cache disabled') return False, None # note: r(echunk) does not need the files cache in this method, but the files cache will # be updated and saved to disk to memorize the files. To preserve previous generations in # the cache, this means that it also needs to get loaded from disk first. if 'r' in cache_mode: # r(echunk) files_cache_logger.debug('UNKNOWN: rechunking enforced') return False, None entry = self.files.get(path_hash) if not entry: files_cache_logger.debug('UNKNOWN: no file metadata in cache for: %r', hashed_path) return False, None # we know the file! entry = FileCacheEntry(*msgpack.unpackb(entry)) if 's' in cache_mode and entry.size != st.st_size: files_cache_logger.debug('KNOWN-CHANGED: file size has changed: %r', hashed_path) return True, None if 'i' in cache_mode and entry.inode != st.st_ino: files_cache_logger.debug('KNOWN-CHANGED: file inode number has changed: %r', hashed_path) return True, None if 'c' in cache_mode and bigint_to_int(entry.cmtime) != st.st_ctime_ns: files_cache_logger.debug('KNOWN-CHANGED: file ctime has changed: %r', hashed_path) return True, None elif 'm' in cache_mode and bigint_to_int(entry.cmtime) != st.st_mtime_ns: files_cache_logger.debug('KNOWN-CHANGED: file mtime has changed: %r', hashed_path) return True, None # we ignored the inode number in the comparison above or it is still same. # if it is still the same, replacing it in the tuple doesn't change it. # if we ignored it, a reason for doing that is that files were moved to a new # disk / new fs (so a one-time change of inode number is expected) and we wanted # to avoid everything getting chunked again. to be able to re-enable the inode # number comparison in a future backup run (and avoid chunking everything # again at that time), we need to update the inode number in the cache with what # we see in the filesystem. self.files[path_hash] = msgpack.packb(entry._replace(inode=st.st_ino, age=0)) return True, entry.chunk_ids def memorize_file(self, hashed_path, path_hash, st, ids): if not stat.S_ISREG(st.st_mode): return cache_mode = self.cache_mode # note: r(echunk) modes will update the files cache, d(isabled) mode won't if 'd' in cache_mode: files_cache_logger.debug('FILES-CACHE-NOUPDATE: files cache disabled') return if 'c' in cache_mode: cmtime_type = 'ctime' cmtime_ns = safe_ns(st.st_ctime_ns) elif 'm' in cache_mode: cmtime_type = 'mtime' cmtime_ns = safe_ns(st.st_mtime_ns) else: # neither 'c' nor 'm' in cache_mode, avoid UnboundLocalError cmtime_type = 'ctime' cmtime_ns = safe_ns(st.st_ctime_ns) entry = FileCacheEntry(age=0, inode=st.st_ino, size=st.st_size, cmtime=int_to_bigint(cmtime_ns), chunk_ids=ids) self.files[path_hash] = msgpack.packb(entry) self._newest_cmtime = max(self._newest_cmtime or 0, cmtime_ns) files_cache_logger.debug('FILES-CACHE-UPDATE: put %r [has %s] <- %r', entry._replace(chunk_ids='[%d entries]' % len(entry.chunk_ids)), cmtime_type, hashed_path) class AdHocCache(CacheStatsMixin): """ Ad-hoc, non-persistent cache. Compared to the standard LocalCache the AdHocCache does not maintain accurate reference count, nor does it provide a files cache (which would require persistence). Chunks that were not added during the current AdHocCache lifetime won't have correct size/csize set (0 bytes) and will have an infinite reference count (MAX_VALUE). """ str_format = """\ All archives: unknown unknown unknown Unique chunks Total chunks Chunk index: {0.total_unique_chunks:20d} unknown""" def __init__(self, repository, key, manifest, warn_if_unencrypted=True, lock_wait=None, consider_part_files=False, iec=False): CacheStatsMixin.__init__(self, iec=iec) self.repository = repository self.key = key self.manifest = manifest self.consider_part_files = consider_part_files self._txn_active = False self.security_manager = SecurityManager(repository) self.security_manager.assert_secure(manifest, key, lock_wait=lock_wait) self.pre12_meta = {} logger.warning('Note: --no-cache-sync is an experimental feature.') # Public API def __enter__(self): return self def __exit__(self, exc_type, exc_val, exc_tb): pass files = None cache_mode = 'd' def file_known_and_unchanged(self, hashed_path, path_hash, st): files_cache_logger.debug("UNKNOWN: files cache not implemented") return False, None def memorize_file(self, hashed_path, path_hash, st, ids): pass def add_chunk(self, id, chunk, stats, overwrite=False, wait=True): assert not overwrite, 'AdHocCache does not permit overwrites — trying to use it for recreate?' if not self._txn_active: self.begin_txn() size = len(chunk) refcount = self.seen_chunk(id, size) if refcount: return self.chunk_incref(id, stats, size=size) data = self.key.encrypt(chunk) csize = len(data) self.repository.put(id, data, wait=wait) self.chunks.add(id, 1, size, csize) stats.update(size, csize, not refcount) return ChunkListEntry(id, size, csize) def seen_chunk(self, id, size=None): if not self._txn_active: self.begin_txn() entry = self.chunks.get(id, ChunkIndexEntry(0, None, None)) if entry.refcount and size and not entry.size: # The LocalCache has existing size information and uses *size* to make an effort at detecting collisions. # This is of course not possible for the AdHocCache. # Here *size* is used to update the chunk's size information, which will be zero for existing chunks. self.chunks[id] = entry._replace(size=size) return entry.refcount def chunk_incref(self, id, stats, size=None, part=False): if not self._txn_active: self.begin_txn() count, _size, csize = self.chunks.incref(id) # When _size is 0 and size is not given, then this chunk has not been locally visited yet (seen_chunk with # size or add_chunk); we can't add references to those (size=0 is invalid) and generally don't try to. size = _size or size assert size stats.update(size, csize, False, part=part) return ChunkListEntry(id, size, csize) def chunk_decref(self, id, stats, wait=True, part=False): if not self._txn_active: self.begin_txn() count, size, csize = self.chunks.decref(id) if count == 0: del self.chunks[id] self.repository.delete(id, wait=wait) stats.update(-size, -csize, True, part=part) else: stats.update(-size, -csize, False, part=part) def commit(self): if not self._txn_active: return self.security_manager.save(self.manifest, self.key) self._txn_active = False def rollback(self): self._txn_active = False del self.chunks def begin_txn(self): self._txn_active = True # Explicitly set the initial usable hash table capacity to avoid performance issues # due to hash table "resonance". # Since we're creating an archive, add 10 % from the start. num_chunks = len(self.repository) self.chunks = ChunkIndex(usable=num_chunks * 1.1) pi = ProgressIndicatorPercent(total=num_chunks, msg='Downloading chunk list... %3.0f%%', msgid='cache.download_chunks') t0 = perf_counter() num_requests = 0 marker = None while True: result = self.repository.list(limit=LIST_SCAN_LIMIT, marker=marker) num_requests += 1 if not result: break pi.show(increase=len(result)) marker = result[-1] # All chunks from the repository have a refcount of MAX_VALUE, which is sticky, # therefore we can't/won't delete them. Chunks we added ourselves in this transaction # (e.g. checkpoint archives) are tracked correctly. init_entry = ChunkIndexEntry(refcount=ChunkIndex.MAX_VALUE, size=0, csize=0) for id_ in result: self.chunks[id_] = init_entry assert len(self.chunks) == num_chunks # LocalCache does not contain the manifest, either. del self.chunks[self.manifest.MANIFEST_ID] duration = perf_counter() - t0 or 0.01 pi.finish() logger.debug('AdHocCache: downloaded %d chunk IDs in %.2f s (%d requests), ~%s/s', num_chunks, duration, num_requests, format_file_size(num_chunks * 34 / duration)) # Chunk IDs in a list are encoded in 34 bytes: 1 byte msgpack header, 1 byte length, 32 ID bytes. # Protocol overhead is neglected in this calculation. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719958149.8254209 borgbackup-1.4.0/src/borg/cache_sync/0000755000076500000240000000000014641075206016034 5ustar00twstaff././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/cache_sync/cache_sync.c0000644000076500000240000000772414641074756020322 0ustar00twstaff/* * Borg cache synchronizer, * high level interface. * * These routines parse msgpacked item metadata and update a HashIndex * with all chunks that are referenced from the items. * * This file only contains some initialization and buffer management. * * The parser is split in two parts, somewhat similar to lexer/parser combinations: * * unpack_template.h munches msgpack and calls a specific callback for each object * encountered (e.g. beginning of a map, an integer, a string, a map item etc.). * * unpack.h implements these callbacks and uses another state machine to * extract chunk references from it. */ #include "unpack.h" typedef struct { unpack_context ctx; char *buf; size_t head; size_t tail; size_t size; } CacheSyncCtx; static CacheSyncCtx * cache_sync_init(HashIndex *chunks) { CacheSyncCtx *ctx; if (!(ctx = (CacheSyncCtx*)malloc(sizeof(CacheSyncCtx)))) { return NULL; } unpack_init(&ctx->ctx); /* needs to be set only once */ ctx->ctx.user.chunks = chunks; ctx->ctx.user.parts.size = 0; ctx->ctx.user.parts.csize = 0; ctx->ctx.user.parts.num_files = 0; ctx->ctx.user.totals.size = 0; ctx->ctx.user.totals.csize = 0; ctx->ctx.user.totals.num_files = 0; ctx->buf = NULL; ctx->head = 0; ctx->tail = 0; ctx->size = 0; return ctx; } static void cache_sync_free(CacheSyncCtx *ctx) { if(ctx->buf) { free(ctx->buf); } free(ctx); } static const char * cache_sync_error(const CacheSyncCtx *ctx) { return ctx->ctx.user.last_error; } static uint64_t cache_sync_num_files_totals(const CacheSyncCtx *ctx) { return ctx->ctx.user.totals.num_files; } static uint64_t cache_sync_num_files_parts(const CacheSyncCtx *ctx) { return ctx->ctx.user.parts.num_files; } static uint64_t cache_sync_size_totals(const CacheSyncCtx *ctx) { return ctx->ctx.user.totals.size; } static uint64_t cache_sync_size_parts(const CacheSyncCtx *ctx) { return ctx->ctx.user.parts.size; } static uint64_t cache_sync_csize_totals(const CacheSyncCtx *ctx) { return ctx->ctx.user.totals.csize; } static uint64_t cache_sync_csize_parts(const CacheSyncCtx *ctx) { return ctx->ctx.user.parts.csize; } /** * feed data to the cache synchronizer * 0 = abort, 1 = continue * abort is a regular condition, check cache_sync_error */ static int cache_sync_feed(CacheSyncCtx *ctx, void *data, uint32_t length) { size_t new_size; int ret; char *new_buf; if(ctx->tail + length > ctx->size) { if((ctx->tail - ctx->head) + length <= ctx->size) { /* | XXXXX| -> move data in buffer backwards -> |XXXXX | */ memmove(ctx->buf, ctx->buf + ctx->head, ctx->tail - ctx->head); ctx->tail -= ctx->head; ctx->head = 0; } else { /* must expand buffer to fit all data */ new_size = (ctx->tail - ctx->head) + length; new_buf = (char*) malloc(new_size); if(!new_buf) { ctx->ctx.user.last_error = "cache_sync_feed: unable to allocate buffer"; return 0; } if(ctx->buf) { memcpy(new_buf, ctx->buf + ctx->head, ctx->tail - ctx->head); free(ctx->buf); } ctx->buf = new_buf; ctx->tail -= ctx->head; ctx->head = 0; ctx->size = new_size; } } memcpy(ctx->buf + ctx->tail, data, length); ctx->tail += length; while(1) { if(ctx->head >= ctx->tail) { return 1; /* request more bytes */ } ret = unpack_execute(&ctx->ctx, ctx->buf, ctx->tail, &ctx->head); if(ret == 1) { unpack_init(&ctx->ctx); continue; } else if(ret == 0) { return 1; } else { if(!ctx->ctx.user.last_error) { ctx->ctx.user.last_error = "Unknown error"; } return 0; } } /* unreachable */ return 1; } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/cache_sync/sysdep.h0000644000076500000240000001450114641074756017526 0ustar00twstaff/* * MessagePack system dependencies * * Copyright (C) 2008-2010 FURUHASHI Sadayuki * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef MSGPACK_SYSDEP_H__ #define MSGPACK_SYSDEP_H__ #include #include #if defined(_MSC_VER) && _MSC_VER < 1600 typedef __int8 int8_t; typedef unsigned __int8 uint8_t; typedef __int16 int16_t; typedef unsigned __int16 uint16_t; typedef __int32 int32_t; typedef unsigned __int32 uint32_t; typedef __int64 int64_t; typedef unsigned __int64 uint64_t; #elif defined(_MSC_VER) // && _MSC_VER >= 1600 #include #else #include #include #endif #ifdef _WIN32 #define _msgpack_atomic_counter_header typedef long _msgpack_atomic_counter_t; #define _msgpack_sync_decr_and_fetch(ptr) InterlockedDecrement(ptr) #define _msgpack_sync_incr_and_fetch(ptr) InterlockedIncrement(ptr) #elif defined(__GNUC__) && ((__GNUC__*10 + __GNUC_MINOR__) < 41) #define _msgpack_atomic_counter_header "gcc_atomic.h" #else typedef unsigned int _msgpack_atomic_counter_t; #define _msgpack_sync_decr_and_fetch(ptr) __sync_sub_and_fetch(ptr, 1) #define _msgpack_sync_incr_and_fetch(ptr) __sync_add_and_fetch(ptr, 1) #endif #ifdef _WIN32 #ifdef __cplusplus /* numeric_limits::min,max */ #ifdef max #undef max #endif #ifdef min #undef min #endif #endif #else #include /* __BYTE_ORDER */ #endif #if !defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__) #if __BYTE_ORDER == __LITTLE_ENDIAN #define __LITTLE_ENDIAN__ #elif __BYTE_ORDER == __BIG_ENDIAN #define __BIG_ENDIAN__ #elif _WIN32 #define __LITTLE_ENDIAN__ #endif #endif #ifdef __LITTLE_ENDIAN__ #ifdef _WIN32 # if defined(ntohs) # define _msgpack_be16(x) ntohs(x) # elif defined(_byteswap_ushort) || (defined(_MSC_VER) && _MSC_VER >= 1400) # define _msgpack_be16(x) ((uint16_t)_byteswap_ushort((unsigned short)x)) # else # define _msgpack_be16(x) ( \ ((((uint16_t)x) << 8) ) | \ ((((uint16_t)x) >> 8) ) ) # endif #else # define _msgpack_be16(x) ntohs(x) #endif #ifdef _WIN32 # if defined(ntohl) # define _msgpack_be32(x) ntohl(x) # elif defined(_byteswap_ulong) || (defined(_MSC_VER) && _MSC_VER >= 1400) # define _msgpack_be32(x) ((uint32_t)_byteswap_ulong((unsigned long)x)) # else # define _msgpack_be32(x) \ ( ((((uint32_t)x) << 24) ) | \ ((((uint32_t)x) << 8) & 0x00ff0000U ) | \ ((((uint32_t)x) >> 8) & 0x0000ff00U ) | \ ((((uint32_t)x) >> 24) ) ) # endif #else # define _msgpack_be32(x) ntohl(x) #endif #if defined(_byteswap_uint64) || (defined(_MSC_VER) && _MSC_VER >= 1400) # define _msgpack_be64(x) (_byteswap_uint64(x)) #elif defined(bswap_64) # define _msgpack_be64(x) bswap_64(x) #elif defined(__DARWIN_OSSwapInt64) # define _msgpack_be64(x) __DARWIN_OSSwapInt64(x) #else #define _msgpack_be64(x) \ ( ((((uint64_t)x) << 56) ) | \ ((((uint64_t)x) << 40) & 0x00ff000000000000ULL ) | \ ((((uint64_t)x) << 24) & 0x0000ff0000000000ULL ) | \ ((((uint64_t)x) << 8) & 0x000000ff00000000ULL ) | \ ((((uint64_t)x) >> 8) & 0x00000000ff000000ULL ) | \ ((((uint64_t)x) >> 24) & 0x0000000000ff0000ULL ) | \ ((((uint64_t)x) >> 40) & 0x000000000000ff00ULL ) | \ ((((uint64_t)x) >> 56) ) ) #endif #define _msgpack_load16(cast, from) ((cast)( \ (((uint16_t)((uint8_t*)(from))[0]) << 8) | \ (((uint16_t)((uint8_t*)(from))[1]) ) )) #define _msgpack_load32(cast, from) ((cast)( \ (((uint32_t)((uint8_t*)(from))[0]) << 24) | \ (((uint32_t)((uint8_t*)(from))[1]) << 16) | \ (((uint32_t)((uint8_t*)(from))[2]) << 8) | \ (((uint32_t)((uint8_t*)(from))[3]) ) )) #define _msgpack_load64(cast, from) ((cast)( \ (((uint64_t)((uint8_t*)(from))[0]) << 56) | \ (((uint64_t)((uint8_t*)(from))[1]) << 48) | \ (((uint64_t)((uint8_t*)(from))[2]) << 40) | \ (((uint64_t)((uint8_t*)(from))[3]) << 32) | \ (((uint64_t)((uint8_t*)(from))[4]) << 24) | \ (((uint64_t)((uint8_t*)(from))[5]) << 16) | \ (((uint64_t)((uint8_t*)(from))[6]) << 8) | \ (((uint64_t)((uint8_t*)(from))[7]) ) )) #else #define _msgpack_be16(x) (x) #define _msgpack_be32(x) (x) #define _msgpack_be64(x) (x) #define _msgpack_load16(cast, from) ((cast)( \ (((uint16_t)((uint8_t*)from)[0]) << 8) | \ (((uint16_t)((uint8_t*)from)[1]) ) )) #define _msgpack_load32(cast, from) ((cast)( \ (((uint32_t)((uint8_t*)from)[0]) << 24) | \ (((uint32_t)((uint8_t*)from)[1]) << 16) | \ (((uint32_t)((uint8_t*)from)[2]) << 8) | \ (((uint32_t)((uint8_t*)from)[3]) ) )) #define _msgpack_load64(cast, from) ((cast)( \ (((uint64_t)((uint8_t*)from)[0]) << 56) | \ (((uint64_t)((uint8_t*)from)[1]) << 48) | \ (((uint64_t)((uint8_t*)from)[2]) << 40) | \ (((uint64_t)((uint8_t*)from)[3]) << 32) | \ (((uint64_t)((uint8_t*)from)[4]) << 24) | \ (((uint64_t)((uint8_t*)from)[5]) << 16) | \ (((uint64_t)((uint8_t*)from)[6]) << 8) | \ (((uint64_t)((uint8_t*)from)[7]) ) )) #endif #define _msgpack_store16(to, num) \ do { uint16_t val = _msgpack_be16(num); memcpy(to, &val, 2); } while(0) #define _msgpack_store32(to, num) \ do { uint32_t val = _msgpack_be32(num); memcpy(to, &val, 4); } while(0) #define _msgpack_store64(to, num) \ do { uint64_t val = _msgpack_be64(num); memcpy(to, &val, 8); } while(0) /* #define _msgpack_load16(cast, from) \ ({ cast val; memcpy(&val, (char*)from, 2); _msgpack_be16(val); }) #define _msgpack_load32(cast, from) \ ({ cast val; memcpy(&val, (char*)from, 4); _msgpack_be32(val); }) #define _msgpack_load64(cast, from) \ ({ cast val; memcpy(&val, (char*)from, 8); _msgpack_be64(val); }) */ #endif /* msgpack/sysdep.h */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/cache_sync/unpack.h0000644000076500000240000002724214641074756017506 0ustar00twstaff/* * Borg cache synchronizer, * based on a MessagePack for Python unpacking routine * * Copyright (C) 2009 Naoki INADA * Copyright (c) 2017 Marian Beermann * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * This limits the depth of the structures we can unpack, i.e. how many containers * are nestable. */ #define MSGPACK_EMBED_STACK_SIZE (16) #include "unpack_define.h" // 2**32 - 1025 #define _MAX_VALUE ( (uint32_t) 4294966271UL ) #define MIN(x, y) ((x) < (y) ? (x): (y)) #ifdef DEBUG #define SET_LAST_ERROR(msg) \ fprintf(stderr, "cache_sync parse error: %s\n", (msg)); \ u->last_error = (msg); #else #define SET_LAST_ERROR(msg) \ u->last_error = (msg); #endif typedef struct unpack_user { /* Item.chunks and Item.part are at the top level; we don't care about anything else, * only need to track the current level to navigate arbitrary and unknown structure. * To discern keys from everything else on the top level we use expect_map_item_end. */ int level; const char *last_error; HashIndex *chunks; /* * We don't care about most stuff. This flag tells us whether we're at the chunks structure, * meaning: * {'foo': 'bar', 'chunks': [...], 'stuff': ... } * ^-HERE-^ */ int inside_chunks; /* is this item a .part file (created for checkpointing inside files)? */ int part; /* does this item have a chunks list in it? */ int has_chunks; enum { /* the next thing is a map key at the Item root level, * and it might be the "chunks" or "part" key we're looking for */ expect_map_key, /* blocking state to expect_map_key * { 'stuff': , 'chunks': [ * emk -> emie -> -> -> -> emk ecb eeboce * (nested containers are tracked via level) * emk=expect_map_key, emie=expect_map_item_end, ecb=expect_chunks_begin, * eeboce=expect_entry_begin_or_chunks_end */ expect_map_item_end, /* next thing must be the chunks array (array) */ expect_chunks_begin, /* next thing must either be another CLE (array) or end of Item.chunks (array_end) */ expect_entry_begin_or_chunks_end, /* * processing ChunkListEntry tuple: * expect_key, expect_size, expect_csize, expect_entry_end */ /* next thing must be the key (raw, l=32) */ expect_key, /* next thing must be the size (int) */ expect_size, /* next thing must be the csize (int) */ expect_csize, /* next thing must be the end of the CLE (array_end) */ expect_entry_end, expect_item_begin } expect; /* collect values here for current chunklist entry */ struct { unsigned char key[32]; uint32_t csize; uint32_t size; } current; /* summing up chunks sizes here within a single item */ struct { uint64_t size, csize; } item; /* total sizes and files count coming from all files */ struct { uint64_t size, csize, num_files; } totals; /* total sizes and files count coming from part files */ struct { uint64_t size, csize, num_files; } parts; } unpack_user; struct unpack_context; typedef struct unpack_context unpack_context; typedef int (*execute_fn)(unpack_context *ctx, const char* data, size_t len, size_t* off); #define UNEXPECTED(what) \ if(u->inside_chunks || u->expect == expect_map_key) { \ SET_LAST_ERROR("Unexpected object: " what); \ return -1; \ } static inline void unpack_init_user_state(unpack_user *u) { u->last_error = NULL; u->level = 0; u->inside_chunks = 0; u->expect = expect_item_begin; } static inline int unpack_callback_uint64(unpack_user* u, int64_t d) { switch(u->expect) { case expect_size: u->current.size = d; u->expect = expect_csize; break; case expect_csize: u->current.csize = d; u->expect = expect_entry_end; break; default: UNEXPECTED("integer"); } return 0; } static inline int unpack_callback_uint32(unpack_user* u, uint32_t d) { return unpack_callback_uint64(u, d); } static inline int unpack_callback_uint16(unpack_user* u, uint16_t d) { return unpack_callback_uint64(u, d); } static inline int unpack_callback_uint8(unpack_user* u, uint8_t d) { return unpack_callback_uint64(u, d); } static inline int unpack_callback_int64(unpack_user* u, uint64_t d) { return unpack_callback_uint64(u, d); } static inline int unpack_callback_int32(unpack_user* u, int32_t d) { return unpack_callback_uint64(u, d); } static inline int unpack_callback_int16(unpack_user* u, int16_t d) { return unpack_callback_uint64(u, d); } static inline int unpack_callback_int8(unpack_user* u, int8_t d) { return unpack_callback_uint64(u, d); } /* Ain't got anything to do with those floats */ static inline int unpack_callback_double(unpack_user* u, double d) { (void)d; UNEXPECTED("double"); return 0; } static inline int unpack_callback_float(unpack_user* u, float d) { (void)d; UNEXPECTED("float"); return 0; } /* nil/true/false — I/don't/care */ static inline int unpack_callback_nil(unpack_user* u) { UNEXPECTED("nil"); return 0; } static inline int unpack_callback_true(unpack_user* u) { UNEXPECTED("true"); return 0; } static inline int unpack_callback_false(unpack_user* u) { UNEXPECTED("false"); return 0; } static inline int unpack_callback_array(unpack_user* u, unsigned int n) { switch(u->expect) { case expect_chunks_begin: /* b'chunks': [ * ^ */ u->expect = expect_entry_begin_or_chunks_end; break; case expect_entry_begin_or_chunks_end: /* b'chunks': [ ( * ^ */ if(n != 3) { SET_LAST_ERROR("Invalid chunk list entry length"); return -1; } u->expect = expect_key; break; default: if(u->inside_chunks) { SET_LAST_ERROR("Unexpected array start"); return -1; } else { u->level++; return 0; } } return 0; } static inline int unpack_callback_array_item(unpack_user* u, unsigned int current) { (void)u; (void)current; return 0; } static inline int unpack_callback_array_end(unpack_user* u) { uint32_t *cache_entry; uint32_t cache_values[3]; uint64_t refcount; switch(u->expect) { case expect_entry_end: /* b'chunks': [ ( b'1234...', 123, 345 ) * ^ */ cache_entry = (uint32_t*) hashindex_get(u->chunks, u->current.key); if(cache_entry) { refcount = _le32toh(cache_entry[0]); if(refcount > _MAX_VALUE) { SET_LAST_ERROR("invalid reference count"); return -1; } refcount += 1; cache_entry[0] = _htole32(MIN(refcount, _MAX_VALUE)); } else { /* refcount, size, csize */ cache_values[0] = _htole32(1); cache_values[1] = _htole32(u->current.size); cache_values[2] = _htole32(u->current.csize); if(!hashindex_set(u->chunks, u->current.key, cache_values)) { SET_LAST_ERROR("hashindex_set failed"); return -1; } } u->item.size += u->current.size; u->item.csize += u->current.csize; u->expect = expect_entry_begin_or_chunks_end; break; case expect_entry_begin_or_chunks_end: /* b'chunks': [ ] * ^ */ /* end of Item.chunks */ u->inside_chunks = 0; u->expect = expect_map_item_end; break; default: if(u->inside_chunks) { SET_LAST_ERROR("Invalid state transition (unexpected array end)"); return -1; } else { u->level--; return 0; } } return 0; } static inline int unpack_callback_map(unpack_user* u, unsigned int n) { (void)n; if(u->level == 0) { if(u->expect != expect_item_begin) { SET_LAST_ERROR("Invalid state transition"); /* unreachable */ return -1; } /* This begins a new Item */ u->expect = expect_map_key; u->part = 0; u->has_chunks = 0; u->item.size = 0; u->item.csize = 0; } if(u->inside_chunks) { UNEXPECTED("map"); } u->level++; return 0; } static inline int unpack_callback_map_item(unpack_user* u, unsigned int current) { (void)u; (void)current; if(u->level == 1) { switch(u->expect) { case expect_map_item_end: u->expect = expect_map_key; break; default: SET_LAST_ERROR("Unexpected map item"); return -1; } } return 0; } static inline int unpack_callback_map_end(unpack_user* u) { u->level--; if(u->inside_chunks) { SET_LAST_ERROR("Unexpected map end"); return -1; } if(u->level == 0) { /* This ends processing of an Item */ if(u->has_chunks) { if(u->part) { u->parts.num_files += 1; u->parts.size += u->item.size; u->parts.csize += u->item.csize; } u->totals.num_files += 1; u->totals.size += u->item.size; u->totals.csize += u->item.csize; } } return 0; } static inline int unpack_callback_raw(unpack_user* u, const char* b, const char* p, unsigned int length) { /* raw = what Borg uses for binary stuff and strings as well */ /* Note: p points to an internal buffer which contains l bytes. */ (void)b; switch(u->expect) { case expect_key: if(length != 32) { SET_LAST_ERROR("Incorrect key length"); return -1; } memcpy(u->current.key, p, 32); u->expect = expect_size; break; case expect_map_key: if(length == 6 && !memcmp("chunks", p, 6)) { u->expect = expect_chunks_begin; u->inside_chunks = 1; u->has_chunks = 1; } else if(length == 4 && !memcmp("part", p, 4)) { u->expect = expect_map_item_end; u->part = 1; } else { u->expect = expect_map_item_end; } break; default: if(u->inside_chunks) { SET_LAST_ERROR("Unexpected bytes in chunks structure"); return -1; } } return 0; } static inline int unpack_callback_bin(unpack_user* u, const char* b, const char* p, unsigned int length) { (void)u; (void)b; (void)p; (void)length; UNEXPECTED("bin"); return 0; } static inline int unpack_callback_ext(unpack_user* u, const char* base, const char* pos, unsigned int length) { (void)u; (void)base; (void)pos; (void)length; UNEXPECTED("ext"); return 0; } #include "unpack_template.h" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/cache_sync/unpack_define.h0000644000076500000240000000446714641074756021024 0ustar00twstaff/* * MessagePack unpacking routine template * * Copyright (C) 2008-2010 FURUHASHI Sadayuki * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef MSGPACK_UNPACK_DEFINE_H__ #define MSGPACK_UNPACK_DEFINE_H__ #include "sysdep.h" #include #include #include #include #ifdef __cplusplus extern "C" { #endif #ifndef MSGPACK_EMBED_STACK_SIZE #define MSGPACK_EMBED_STACK_SIZE 32 #endif // CS is first byte & 0x1f typedef enum { CS_HEADER = 0x00, // nil //CS_ = 0x01, //CS_ = 0x02, // false //CS_ = 0x03, // true CS_BIN_8 = 0x04, CS_BIN_16 = 0x05, CS_BIN_32 = 0x06, CS_EXT_8 = 0x07, CS_EXT_16 = 0x08, CS_EXT_32 = 0x09, CS_FLOAT = 0x0a, CS_DOUBLE = 0x0b, CS_UINT_8 = 0x0c, CS_UINT_16 = 0x0d, CS_UINT_32 = 0x0e, CS_UINT_64 = 0x0f, CS_INT_8 = 0x10, CS_INT_16 = 0x11, CS_INT_32 = 0x12, CS_INT_64 = 0x13, //CS_FIXEXT1 = 0x14, //CS_FIXEXT2 = 0x15, //CS_FIXEXT4 = 0x16, //CS_FIXEXT8 = 0x17, //CS_FIXEXT16 = 0x18, CS_RAW_8 = 0x19, CS_RAW_16 = 0x1a, CS_RAW_32 = 0x1b, CS_ARRAY_16 = 0x1c, CS_ARRAY_32 = 0x1d, CS_MAP_16 = 0x1e, CS_MAP_32 = 0x1f, ACS_RAW_VALUE, ACS_BIN_VALUE, ACS_EXT_VALUE, } msgpack_unpack_state; typedef enum { CT_ARRAY_ITEM, CT_MAP_KEY, CT_MAP_VALUE, } msgpack_container_type; #ifdef __cplusplus } #endif #endif /* msgpack/unpack_define.h */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/cache_sync/unpack_template.h0000644000076500000240000003010114641074756021365 0ustar00twstaff/* * MessagePack unpacking routine template * * Copyright (C) 2008-2010 FURUHASHI Sadayuki * Copyright (c) 2017 Marian Beermann * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * * This has been slightly adapted from the vanilla msgpack-{c, python} version. * Since cache_sync does not intend to build an output data structure, * msgpack_unpack_object and all of its uses was removed. */ #ifndef USE_CASE_RANGE #if !defined(_MSC_VER) #define USE_CASE_RANGE #endif #endif typedef struct unpack_stack { size_t size; size_t count; unsigned int ct; } unpack_stack; struct unpack_context { unpack_user user; unsigned int cs; unsigned int trail; unsigned int top; unpack_stack stack[MSGPACK_EMBED_STACK_SIZE]; }; static inline void unpack_init(unpack_context* ctx) { ctx->cs = CS_HEADER; ctx->trail = 0; ctx->top = 0; unpack_init_user_state(&ctx->user); } #define construct 1 static inline int unpack_execute(unpack_context* ctx, const char* data, size_t len, size_t* off) { const unsigned char* p = (unsigned char*)data + *off; const unsigned char* const pe = (unsigned char*)data + len; const void* n = NULL; unsigned int trail = ctx->trail; unsigned int cs = ctx->cs; unsigned int top = ctx->top; unpack_stack* stack = ctx->stack; unpack_user* user = &ctx->user; unpack_stack* c = NULL; int ret; assert(len >= *off); #define construct_cb(name) \ construct && unpack_callback ## name #define push_simple_value(func) \ if(construct_cb(func)(user) < 0) { goto _failed; } \ goto _push #define push_fixed_value(func, arg) \ if(construct_cb(func)(user, arg) < 0) { goto _failed; } \ goto _push #define push_variable_value(func, base, pos, len) \ if(construct_cb(func)(user, \ (const char*)base, (const char*)pos, len) < 0) { goto _failed; } \ goto _push #define again_fixed_trail(_cs, trail_len) \ trail = trail_len; \ cs = _cs; \ goto _fixed_trail_again #define again_fixed_trail_if_zero(_cs, trail_len, ifzero) \ trail = trail_len; \ if(trail == 0) { goto ifzero; } \ cs = _cs; \ goto _fixed_trail_again #define start_container(func, count_, ct_) \ if(top >= MSGPACK_EMBED_STACK_SIZE) { goto _failed; } /* FIXME */ \ if(construct_cb(func)(user, count_) < 0) { goto _failed; } \ if((count_) == 0) { \ if (construct_cb(func##_end)(user) < 0) { goto _failed; } \ goto _push; } \ stack[top].ct = ct_; \ stack[top].size = count_; \ stack[top].count = 0; \ ++top; \ goto _header_again #define NEXT_CS(p) ((unsigned int)*p & 0x1f) #ifdef USE_CASE_RANGE #define SWITCH_RANGE_BEGIN switch(*p) { #define SWITCH_RANGE(FROM, TO) case FROM ... TO: #define SWITCH_RANGE_DEFAULT default: #define SWITCH_RANGE_END } #else #define SWITCH_RANGE_BEGIN { if(0) { #define SWITCH_RANGE(FROM, TO) } else if(FROM <= *p && *p <= TO) { #define SWITCH_RANGE_DEFAULT } else { #define SWITCH_RANGE_END } } #endif if(p == pe) { goto _out; } do { switch(cs) { case CS_HEADER: SWITCH_RANGE_BEGIN SWITCH_RANGE(0x00, 0x7f) // Positive Fixnum push_fixed_value(_uint8, *(uint8_t*)p); SWITCH_RANGE(0xe0, 0xff) // Negative Fixnum push_fixed_value(_int8, *(int8_t*)p); SWITCH_RANGE(0xc0, 0xdf) // Variable switch(*p) { case 0xc0: // nil push_simple_value(_nil); //case 0xc1: // never used case 0xc2: // false push_simple_value(_false); case 0xc3: // true push_simple_value(_true); case 0xc4: // bin 8 again_fixed_trail(NEXT_CS(p), 1); case 0xc5: // bin 16 again_fixed_trail(NEXT_CS(p), 2); case 0xc6: // bin 32 again_fixed_trail(NEXT_CS(p), 4); case 0xc7: // ext 8 again_fixed_trail(NEXT_CS(p), 1); case 0xc8: // ext 16 again_fixed_trail(NEXT_CS(p), 2); case 0xc9: // ext 32 again_fixed_trail(NEXT_CS(p), 4); case 0xca: // float case 0xcb: // double case 0xcc: // unsigned int 8 case 0xcd: // unsigned int 16 case 0xce: // unsigned int 32 case 0xcf: // unsigned int 64 case 0xd0: // signed int 8 case 0xd1: // signed int 16 case 0xd2: // signed int 32 case 0xd3: // signed int 64 again_fixed_trail(NEXT_CS(p), 1 << (((unsigned int)*p) & 0x03)); case 0xd4: // fixext 1 case 0xd5: // fixext 2 case 0xd6: // fixext 4 case 0xd7: // fixext 8 again_fixed_trail_if_zero(ACS_EXT_VALUE, (1 << (((unsigned int)*p) & 0x03))+1, _ext_zero); case 0xd8: // fixext 16 again_fixed_trail_if_zero(ACS_EXT_VALUE, 16+1, _ext_zero); case 0xd9: // str 8 again_fixed_trail(NEXT_CS(p), 1); case 0xda: // raw 16 case 0xdb: // raw 32 case 0xdc: // array 16 case 0xdd: // array 32 case 0xde: // map 16 case 0xdf: // map 32 again_fixed_trail(NEXT_CS(p), 2 << (((unsigned int)*p) & 0x01)); default: goto _failed; } SWITCH_RANGE(0xa0, 0xbf) // FixRaw again_fixed_trail_if_zero(ACS_RAW_VALUE, ((unsigned int)*p & 0x1f), _raw_zero); SWITCH_RANGE(0x90, 0x9f) // FixArray start_container(_array, ((unsigned int)*p) & 0x0f, CT_ARRAY_ITEM); SWITCH_RANGE(0x80, 0x8f) // FixMap start_container(_map, ((unsigned int)*p) & 0x0f, CT_MAP_KEY); SWITCH_RANGE_DEFAULT goto _failed; SWITCH_RANGE_END // end CS_HEADER _fixed_trail_again: ++p; // fallthrough default: if((size_t)(pe - p) < trail) { goto _out; } n = p; p += trail - 1; switch(cs) { case CS_EXT_8: again_fixed_trail_if_zero(ACS_EXT_VALUE, *(uint8_t*)n+1, _ext_zero); case CS_EXT_16: again_fixed_trail_if_zero(ACS_EXT_VALUE, _msgpack_load16(uint16_t,n)+1, _ext_zero); case CS_EXT_32: again_fixed_trail_if_zero(ACS_EXT_VALUE, _msgpack_load32(uint32_t,n)+1, _ext_zero); case CS_FLOAT: { union { uint32_t i; float f; } mem; mem.i = _msgpack_load32(uint32_t,n); push_fixed_value(_float, mem.f); } case CS_DOUBLE: { union { uint64_t i; double f; } mem; mem.i = _msgpack_load64(uint64_t,n); #if defined(__arm__) && !(__ARM_EABI__) // arm-oabi // https://github.com/msgpack/msgpack-perl/pull/1 mem.i = (mem.i & 0xFFFFFFFFUL) << 32UL | (mem.i >> 32UL); #endif push_fixed_value(_double, mem.f); } case CS_UINT_8: push_fixed_value(_uint8, *(uint8_t*)n); case CS_UINT_16: push_fixed_value(_uint16, _msgpack_load16(uint16_t,n)); case CS_UINT_32: push_fixed_value(_uint32, _msgpack_load32(uint32_t,n)); case CS_UINT_64: push_fixed_value(_uint64, _msgpack_load64(uint64_t,n)); case CS_INT_8: push_fixed_value(_int8, *(int8_t*)n); case CS_INT_16: push_fixed_value(_int16, _msgpack_load16(int16_t,n)); case CS_INT_32: push_fixed_value(_int32, _msgpack_load32(int32_t,n)); case CS_INT_64: push_fixed_value(_int64, _msgpack_load64(int64_t,n)); case CS_BIN_8: again_fixed_trail_if_zero(ACS_BIN_VALUE, *(uint8_t*)n, _bin_zero); case CS_BIN_16: again_fixed_trail_if_zero(ACS_BIN_VALUE, _msgpack_load16(uint16_t,n), _bin_zero); case CS_BIN_32: again_fixed_trail_if_zero(ACS_BIN_VALUE, _msgpack_load32(uint32_t,n), _bin_zero); case ACS_BIN_VALUE: _bin_zero: push_variable_value(_bin, data, n, trail); case CS_RAW_8: again_fixed_trail_if_zero(ACS_RAW_VALUE, *(uint8_t*)n, _raw_zero); case CS_RAW_16: again_fixed_trail_if_zero(ACS_RAW_VALUE, _msgpack_load16(uint16_t,n), _raw_zero); case CS_RAW_32: again_fixed_trail_if_zero(ACS_RAW_VALUE, _msgpack_load32(uint32_t,n), _raw_zero); case ACS_RAW_VALUE: _raw_zero: push_variable_value(_raw, data, n, trail); case ACS_EXT_VALUE: _ext_zero: push_variable_value(_ext, data, n, trail); case CS_ARRAY_16: start_container(_array, _msgpack_load16(uint16_t,n), CT_ARRAY_ITEM); case CS_ARRAY_32: /* FIXME security guard */ start_container(_array, _msgpack_load32(uint32_t,n), CT_ARRAY_ITEM); case CS_MAP_16: start_container(_map, _msgpack_load16(uint16_t,n), CT_MAP_KEY); case CS_MAP_32: /* FIXME security guard */ start_container(_map, _msgpack_load32(uint32_t,n), CT_MAP_KEY); default: goto _failed; } } _push: if(top == 0) { goto _finish; } c = &stack[top-1]; switch(c->ct) { case CT_ARRAY_ITEM: if(construct_cb(_array_item)(user, c->count) < 0) { goto _failed; } if(++c->count == c->size) { if (construct_cb(_array_end)(user) < 0) { goto _failed; } --top; /*printf("stack pop %d\n", top);*/ goto _push; } goto _header_again; case CT_MAP_KEY: c->ct = CT_MAP_VALUE; goto _header_again; case CT_MAP_VALUE: if(construct_cb(_map_item)(user, c->count) < 0) { goto _failed; } if(++c->count == c->size) { if (construct_cb(_map_end)(user) < 0) { goto _failed; } --top; /*printf("stack pop %d\n", top);*/ goto _push; } c->ct = CT_MAP_KEY; goto _header_again; default: goto _failed; } _header_again: cs = CS_HEADER; ++p; } while(p != pe); goto _out; _finish: if (!construct) unpack_callback_nil(user); ++p; ret = 1; /* printf("-- finish --\n"); */ goto _end; _failed: /* printf("** FAILED **\n"); */ ret = -1; goto _end; _out: ret = 0; goto _end; _end: ctx->cs = cs; ctx->trail = trail; ctx->top = top; *off = p - (const unsigned char*)data; return ret; #undef construct_cb } #undef SWITCH_RANGE_BEGIN #undef SWITCH_RANGE #undef SWITCH_RANGE_DEFAULT #undef SWITCH_RANGE_END #undef push_simple_value #undef push_fixed_value #undef push_variable_value #undef again_fixed_trail #undef again_fixed_trail_if_zero #undef start_container #undef construct #undef NEXT_CS /* vim: set ts=4 sw=4 sts=4 expandtab */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719958149.0 borgbackup-1.4.0/src/borg/chunker.c0000644000076500000240000270721114641075205015551 0ustar00twstaff/* Generated by Cython 3.0.10 */ /* BEGIN: Cython Metadata { "distutils": { "depends": [ "src/borg/_chunker.c" ], "extra_compile_args": [ "-Wall", "-Wextra", "-Wpointer-arith" ], "include_dirs": [ "src/borg" ], "name": "borg.chunker", "sources": [ "src/borg/chunker.pyx" ], "undef_macros": [ "NDEBUG" ] }, "module_name": "borg.chunker" } END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_10" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x03000AF0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 1 #endif #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #if PY_VERSION_HEX >= 0x030d00A4 # define __Pyx_PyCFunctionFast PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords #else # define __Pyx_PyCFunctionFast _PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__borg__chunker #define __PYX_HAVE_API__borg__chunker /* Early includes */ #include #include #include "_chunker.c" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/borg/chunker.pyx", "", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_4borg_7chunker_Chunker; struct __pyx_obj_4borg_7chunker___pyx_scope_struct__sparsemap; struct __pyx_obj_4borg_7chunker___pyx_scope_struct_1_chunkify; /* "borg/chunker.pyx":228 * * * cdef class Chunker: # <<<<<<<<<<<<<< * """ * Content-Defined Chunker, variable chunk sizes. */ struct __pyx_obj_4borg_7chunker_Chunker { PyObject_HEAD Chunker *chunker; }; /* "borg/chunker.pyx":87 * * * def sparsemap(fd=None, fh=-1): # <<<<<<<<<<<<<< * """ * generator yielding a (start, length, is_data) tuple for each range. */ struct __pyx_obj_4borg_7chunker___pyx_scope_struct__sparsemap { PyObject_HEAD PyObject *__pyx_v_curr; PyObject *__pyx_v_e; PyObject *__pyx_v_end; PyObject *__pyx_v_fd; PyObject *__pyx_v_fh; PyObject *__pyx_v_file_len; PyObject *__pyx_v_is_data; PyObject *__pyx_v_start; PyObject *__pyx_v_whence; PyObject *__pyx_t_0; PyObject *__pyx_t_1; PyObject *__pyx_t_2; PyObject *__pyx_t_3; PyObject *__pyx_t_4; PyObject *__pyx_t_5; }; /* "borg/chunker.pyx":155 * assert block_size <= len(zeros) * * def chunkify(self, fd=None, fh=-1, fmap=None): # <<<<<<<<<<<<<< * """ * Cut a file into chunks. */ struct __pyx_obj_4borg_7chunker___pyx_scope_struct_1_chunkify { PyObject_HEAD PyObject *__pyx_v_allocation; PyObject *__pyx_v_body_map; PyObject *__pyx_v_data; PyObject *__pyx_v_err; PyObject *__pyx_v_fd; PyObject *__pyx_v_fh; PyObject *__pyx_v_fmap; PyObject *__pyx_v_got; PyObject *__pyx_v_header_map; PyObject *__pyx_v_is_data; PyObject *__pyx_v_offset; PyObject *__pyx_v_pos; PyObject *__pyx_v_range_size; PyObject *__pyx_v_range_start; PyObject *__pyx_v_self; PyObject *__pyx_v_wanted; PyObject *__pyx_t_0; Py_ssize_t __pyx_t_1; PyObject *(*__pyx_t_2)(PyObject *); }; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* GetAttr.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /* HasAttr.proto */ #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_HasAttr(o, n) PyObject_HasAttrWithError(o, n) #else static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); #endif /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* GetTopmostException.proto */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); #endif /* SaveResetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* SwapException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif /* pep479.proto */ static void __Pyx_Generator_Replace_StopIteration(int in_async_gen); /* PyObjectSetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); #else #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif /* AssertionsEnabled.proto */ #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define __Pyx_init_assertions_enabled() (0) #define __pyx_assertions_enabled() (1) #elif CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030C0000) static int __pyx_assertions_enabled_flag; #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag) static int __Pyx_init_assertions_enabled(void) { PyObject *builtins, *debug, *debug_str; int flag; builtins = PyEval_GetBuiltins(); if (!builtins) goto bad; debug_str = PyUnicode_FromStringAndSize("__debug__", 9); if (!debug_str) goto bad; debug = PyObject_GetItem(builtins, debug_str); Py_DECREF(debug_str); if (!debug) goto bad; flag = PyObject_IsTrue(debug); Py_DECREF(debug); if (flag == -1) goto bad; __pyx_assertions_enabled_flag = flag; return 0; bad: __pyx_assertions_enabled_flag = 1; return -1; } #else #define __Pyx_init_assertions_enabled() (0) #define __pyx_assertions_enabled() (!Py_OptimizeFlag) #endif /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) #endif /* KeywordStringCheck.proto */ static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed); /* StrEquals.proto */ #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals #else #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals #endif /* DictGetItem.proto */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); #define __Pyx_PyObject_Dict_GetItem(obj, name)\ (likely(PyDict_CheckExact(obj)) ?\ __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) #else #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) #endif /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* PyObjectCallNoArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* ValidateBasesTuple.proto */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); #endif /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* SetupReduce.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce(PyObject* type_obj); #endif /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* SetNameInClass.proto */ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) #elif CYTHON_COMPILING_IN_CPYTHON #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value)) #else #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) #endif /* CalculateMetaclass.proto */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); /* PyObjectCall2Args.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* PyObjectLookupSpecial.proto */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0) #define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1) static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error); #else #define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n) #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) #endif /* Py3ClassCreate.proto */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc); static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE unsigned long __Pyx_PyInt_As_unsigned_long(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE unsigned char __Pyx_PyInt_As_unsigned_char(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* PyObjectCallMethod1.proto */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); /* CoroutineBase.proto */ struct __pyx_CoroutineObject; typedef PyObject *(*__pyx_coroutine_body_t)(struct __pyx_CoroutineObject *, PyThreadState *, PyObject *); #if CYTHON_USE_EXC_INFO_STACK #define __Pyx_ExcInfoStruct _PyErr_StackItem #else typedef struct { PyObject *exc_type; PyObject *exc_value; PyObject *exc_traceback; } __Pyx_ExcInfoStruct; #endif typedef struct __pyx_CoroutineObject { PyObject_HEAD __pyx_coroutine_body_t body; PyObject *closure; __Pyx_ExcInfoStruct gi_exc_state; PyObject *gi_weakreflist; PyObject *classobj; PyObject *yieldfrom; PyObject *gi_name; PyObject *gi_qualname; PyObject *gi_modulename; PyObject *gi_code; PyObject *gi_frame; int resume_label; char is_running; } __pyx_CoroutineObject; static __pyx_CoroutineObject *__Pyx__Coroutine_New( PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, PyObject *name, PyObject *qualname, PyObject *module_name); static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, PyObject *name, PyObject *qualname, PyObject *module_name); static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self); static int __Pyx_Coroutine_clear(PyObject *self); static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value); static PyObject *__Pyx_Coroutine_Close(PyObject *self); static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args); #if CYTHON_USE_EXC_INFO_STACK #define __Pyx_Coroutine_SwapException(self) #define __Pyx_Coroutine_ResetAndClearException(self) __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state) #else #define __Pyx_Coroutine_SwapException(self) {\ __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\ __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\ } #define __Pyx_Coroutine_ResetAndClearException(self) {\ __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\ (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\ } #endif #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue) #else #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue) #endif static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue); static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state); /* PatchModuleWithCoroutine.proto */ static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code); /* PatchGeneratorABC.proto */ static int __Pyx_patch_abc(void); /* Generator.proto */ #define __Pyx_Generator_USED #define __Pyx_Generator_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_GeneratorType) #define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\ __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name) static PyObject *__Pyx_Generator_Next(PyObject *self); static int __pyx_Generator_init(PyObject *module); /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdlib" */ /* Module declarations from "borg.chunker" */ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "borg.chunker" extern int __pyx_module_is_main_borg__chunker; int __pyx_module_is_main_borg__chunker = 0; /* Implementation of "borg.chunker" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_OSError; static PyObject *__pyx_builtin_AssertionError; static PyObject *__pyx_builtin_TypeError; /* #### Code section: string_decls ### */ static const char __pyx_k_e[] = "e"; static const char __pyx_k__4[] = "*"; static const char __pyx_k__5[] = "."; static const char __pyx_k_fd[] = "fd"; static const char __pyx_k_fh[] = "fh"; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k_kw[] = "kw"; static const char __pyx_k_os[] = "os"; static const char __pyx_k__35[] = "?"; static const char __pyx_k_add[] = "add"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_end[] = "end"; static const char __pyx_k_err[] = "err"; static const char __pyx_k_got[] = "got"; static const char __pyx_k_len[] = "len"; static const char __pyx_k_pos[] = "pos"; static const char __pyx_k_sum[] = "sum"; static const char __pyx_k_algo[] = "algo"; static const char __pyx_k_args[] = "args"; static const char __pyx_k_curr[] = "curr"; static const char __pyx_k_data[] = "data"; static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_fmap[] = "fmap"; static const char __pyx_k_init[] = "__init__"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_meta[] = "meta"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_read[] = "read"; static const char __pyx_k_seed[] = "seed"; static const char __pyx_k_seek[] = "seek"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_send[] = "send"; static const char __pyx_k_size[] = "size"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_Chunk[] = "_Chunk"; static const char __pyx_k_ENXIO[] = "ENXIO"; static const char __pyx_k_close[] = "close"; static const char __pyx_k_dread[] = "dread"; static const char __pyx_k_dseek[] = "dseek"; static const char __pyx_k_errno[] = "errno"; static const char __pyx_k_fixed[] = "fixed"; static const char __pyx_k_lseek[] = "lseek"; static const char __pyx_k_start[] = "start"; static const char __pyx_k_super[] = "super"; static const char __pyx_k_table[] = "table"; static const char __pyx_k_throw[] = "throw"; static const char __pyx_k_zeros[] = "zeros"; static const char __pyx_k_1_4_01[] = "1.4_01"; static const char __pyx_k_amount[] = "amount"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_module[] = "__module__"; static const char __pyx_k_offset[] = "offset"; static const char __pyx_k_params[] = "params"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_remove[] = "remove"; static const char __pyx_k_sparse[] = "sparse"; static const char __pyx_k_use_fh[] = "use_fh"; static const char __pyx_k_wanted[] = "wanted"; static const char __pyx_k_whence[] = "whence"; static const char __pyx_k_CH_DATA[] = "CH_DATA"; static const char __pyx_k_CH_HOLE[] = "CH_HOLE"; static const char __pyx_k_Chunk_2[] = "Chunk"; static const char __pyx_k_Chunker[] = "Chunker"; static const char __pyx_k_OSError[] = "OSError"; static const char __pyx_k_buzhash[] = "buzhash"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_is_data[] = "is_data"; static const char __pyx_k_prepare[] = "__prepare__"; static const char __pyx_k_CH_ALLOC[] = "CH_ALLOC"; static const char __pyx_k_SEEK_CUR[] = "SEEK_CUR"; static const char __pyx_k_SEEK_END[] = "SEEK_END"; static const char __pyx_k_SEEK_SET[] = "SEEK_SET"; static const char __pyx_k_body_map[] = "body_map"; static const char __pyx_k_chunkify[] = "chunkify"; static const char __pyx_k_file_len[] = "file_len"; static const char __pyx_k_getstate[] = "__getstate__"; static const char __pyx_k_qualname[] = "__qualname__"; static const char __pyx_k_set_name[] = "__set_name__"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_SEEK_DATA[] = "SEEK_DATA"; static const char __pyx_k_SEEK_HOLE[] = "SEEK_HOLE"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_constants[] = "constants"; static const char __pyx_k_isenabled[] = "isenabled"; static const char __pyx_k_meta_data[] = "meta data"; static const char __pyx_k_metaclass[] = "__metaclass__"; static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_sparsemap[] = "sparsemap"; static const char __pyx_k_allocation[] = "allocation"; static const char __pyx_k_block_size[] = "block_size"; static const char __pyx_k_header_map[] = "header_map"; static const char __pyx_k_namedtuple[] = "namedtuple"; static const char __pyx_k_range_size[] = "range_size"; static const char __pyx_k_startswith[] = "startswith"; static const char __pyx_k_try_sparse[] = "try_sparse"; static const char __pyx_k_API_VERSION[] = "API_VERSION"; static const char __pyx_k_collections[] = "collections"; static const char __pyx_k_get_chunker[] = "get_chunker"; static const char __pyx_k_header_size[] = "header_size"; static const char __pyx_k_range_start[] = "range_start"; static const char __pyx_k_ChunkerFixed[] = "ChunkerFixed"; static const char __pyx_k_borg_chunker[] = "borg.chunker"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_stringsource[] = ""; static const char __pyx_k_MAX_DATA_SIZE[] = "MAX_DATA_SIZE"; static const char __pyx_k_chunk_max_exp[] = "chunk_max_exp"; static const char __pyx_k_chunk_min_exp[] = "chunk_min_exp"; static const char __pyx_k_dpos_curr_end[] = "dpos_curr_end"; static const char __pyx_k_has_seek_hole[] = "has_seek_hole"; static const char __pyx_k_init_subclass[] = "__init_subclass__"; static const char __pyx_k_posix_fadvise[] = "posix_fadvise"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_AssertionError[] = "AssertionError"; static const char __pyx_k_buzhash_update[] = "buzhash_update"; static const char __pyx_k_hash_mask_bits[] = "hash_mask_bits"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_Chunker_chunkify[] = "Chunker.chunkify"; static const char __pyx_k_hash_window_size[] = "hash_window_size"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_too_small_max_size[] = "too small max_size"; static const char __pyx_k_ChunkerFixed___init[] = "ChunkerFixed.__init__"; static const char __pyx_k_POSIX_FADV_DONTNEED[] = "POSIX_FADV_DONTNEED"; static const char __pyx_k_src_borg_chunker_pyx[] = "src/borg/chunker.pyx"; static const char __pyx_k_ChunkerFixed_chunkify[] = "ChunkerFixed.chunkify"; static const char __pyx_k_Chunker___reduce_cython[] = "Chunker.__reduce_cython__"; static const char __pyx_k_Chunker___setstate_cython[] = "Chunker.__setstate_cython__"; static const char __pyx_k_unsupported_chunker_algo_r[] = "unsupported chunker algo %r"; static const char __pyx_k_Chunk_namedtuple_meta_is_always[] = " Chunk namedtuple\n\n meta is always a dictionary, data depends on allocation.\n\n data chunk read from a DATA range of a file (not from a sparse hole):\n meta = {'allocation' = CH_DATA, 'size' = size_of_chunk }\n data = read_data [bytes or memoryview]\n\n all-zero chunk read from a DATA range of a file (not from a sparse hole, but detected to be all-zero):\n meta = {'allocation' = CH_ALLOC, 'size' = size_of_chunk }\n data = None\n\n all-zero chunk from a HOLE range of a file (from a sparse hole):\n meta = {'allocation' = CH_HOLE, 'size' = size_of_chunk }\n data = None\n"; static const char __pyx_k_This_is_a_simple_chunker_for_in[] = "\n This is a simple chunker for input data with data usually staying at same\n offset and / or with known block/record sizes:\n\n - raw disk images\n - block devices\n - database files with simple header + fixed-size records layout\n\n It optionally supports:\n\n - a header block of different size\n - using a sparsemap to only read data ranges and seek over hole ranges\n for sparse files.\n - using an externally given filemap to only read specific ranges from\n a file.\n\n Note: the last block of a data or hole range may be less than the block size,\n this is supported and not considered to be an error.\n "; static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_4borg_7chunker_Chunk(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_meta); /* proto */ static PyObject *__pyx_pf_4borg_7chunker_2dread(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_offset, PyObject *__pyx_v_size, PyObject *__pyx_v_fd, PyObject *__pyx_v_fh); /* proto */ static PyObject *__pyx_pf_4borg_7chunker_4dseek(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_amount, PyObject *__pyx_v_whence, PyObject *__pyx_v_fd, PyObject *__pyx_v_fh); /* proto */ static PyObject *__pyx_pf_4borg_7chunker_6dpos_curr_end(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fd, PyObject *__pyx_v_fh); /* proto */ static PyObject *__pyx_pf_4borg_7chunker_8sparsemap(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fd, PyObject *__pyx_v_fh); /* proto */ static PyObject *__pyx_pf_4borg_7chunker_12ChunkerFixed___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_block_size, PyObject *__pyx_v_header_size, PyObject *__pyx_v_sparse); /* proto */ static PyObject *__pyx_pf_4borg_7chunker_12ChunkerFixed_2chunkify(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_fd, PyObject *__pyx_v_fh, PyObject *__pyx_v_fmap); /* proto */ static int __pyx_pf_4borg_7chunker_7Chunker___cinit__(struct __pyx_obj_4borg_7chunker_Chunker *__pyx_v_self, int __pyx_v_seed, int __pyx_v_chunk_min_exp, int __pyx_v_chunk_max_exp, int __pyx_v_hash_mask_bits, int __pyx_v_hash_window_size); /* proto */ static PyObject *__pyx_pf_4borg_7chunker_7Chunker_2chunkify(struct __pyx_obj_4borg_7chunker_Chunker *__pyx_v_self, PyObject *__pyx_v_fd, PyObject *__pyx_v_fh); /* proto */ static void __pyx_pf_4borg_7chunker_7Chunker_4__dealloc__(struct __pyx_obj_4borg_7chunker_Chunker *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_7chunker_7Chunker_6__iter__(struct __pyx_obj_4borg_7chunker_Chunker *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_7chunker_7Chunker_8__next__(struct __pyx_obj_4borg_7chunker_Chunker *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_7chunker_7Chunker_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_7chunker_Chunker *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_7chunker_7Chunker_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_7chunker_Chunker *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_4borg_7chunker_11get_chunker(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_algo, PyObject *__pyx_v_params, PyObject *__pyx_v_kw); /* proto */ static PyObject *__pyx_pf_4borg_7chunker_13buzhash(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, unsigned long __pyx_v_seed); /* proto */ static PyObject *__pyx_pf_4borg_7chunker_15buzhash_update(CYTHON_UNUSED PyObject *__pyx_self, uint32_t __pyx_v_sum, unsigned char __pyx_v_remove, unsigned char __pyx_v_add, size_t __pyx_v_len, unsigned long __pyx_v_seed); /* proto */ static PyObject *__pyx_tp_new_4borg_7chunker_Chunker(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_4borg_7chunker___pyx_scope_struct__sparsemap(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_4borg_7chunker___pyx_scope_struct_1_chunkify(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE PyObject *__pyx_type_4borg_7chunker_Chunker; PyObject *__pyx_type_4borg_7chunker___pyx_scope_struct__sparsemap; PyObject *__pyx_type_4borg_7chunker___pyx_scope_struct_1_chunkify; #endif PyTypeObject *__pyx_ptype_4borg_7chunker_Chunker; PyTypeObject *__pyx_ptype_4borg_7chunker___pyx_scope_struct__sparsemap; PyTypeObject *__pyx_ptype_4borg_7chunker___pyx_scope_struct_1_chunkify; PyObject *__pyx_kp_s_1_4_01; PyObject *__pyx_n_s_API_VERSION; PyObject *__pyx_n_s_AssertionError; PyObject *__pyx_n_s_CH_ALLOC; PyObject *__pyx_n_s_CH_DATA; PyObject *__pyx_n_s_CH_HOLE; PyObject *__pyx_n_s_Chunk; PyObject *__pyx_n_s_Chunk_2; PyObject *__pyx_kp_s_Chunk_namedtuple_meta_is_always; PyObject *__pyx_n_s_Chunker; PyObject *__pyx_n_s_ChunkerFixed; PyObject *__pyx_n_s_ChunkerFixed___init; PyObject *__pyx_n_s_ChunkerFixed_chunkify; PyObject *__pyx_n_s_Chunker___reduce_cython; PyObject *__pyx_n_s_Chunker___setstate_cython; PyObject *__pyx_n_s_Chunker_chunkify; PyObject *__pyx_n_s_ENXIO; PyObject *__pyx_n_s_MAX_DATA_SIZE; PyObject *__pyx_n_s_OSError; PyObject *__pyx_n_s_POSIX_FADV_DONTNEED; PyObject *__pyx_n_s_SEEK_CUR; PyObject *__pyx_n_s_SEEK_DATA; PyObject *__pyx_n_s_SEEK_END; PyObject *__pyx_n_s_SEEK_HOLE; PyObject *__pyx_n_s_SEEK_SET; PyObject *__pyx_kp_s_This_is_a_simple_chunker_for_in; PyObject *__pyx_n_s_TypeError; PyObject *__pyx_n_s__35; PyObject *__pyx_n_s__4; PyObject *__pyx_kp_u__5; PyObject *__pyx_n_s_add; PyObject *__pyx_n_s_algo; PyObject *__pyx_n_s_allocation; PyObject *__pyx_n_s_amount; PyObject *__pyx_n_s_args; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_block_size; PyObject *__pyx_n_s_body_map; PyObject *__pyx_n_s_borg_chunker; PyObject *__pyx_n_s_buzhash; PyObject *__pyx_n_s_buzhash_update; PyObject *__pyx_n_s_chunk_max_exp; PyObject *__pyx_n_s_chunk_min_exp; PyObject *__pyx_n_s_chunkify; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_close; PyObject *__pyx_n_s_collections; PyObject *__pyx_n_s_constants; PyObject *__pyx_n_s_curr; PyObject *__pyx_n_s_data; PyObject *__pyx_n_s_dict; PyObject *__pyx_kp_u_disable; PyObject *__pyx_n_s_doc; PyObject *__pyx_n_s_dpos_curr_end; PyObject *__pyx_n_s_dread; PyObject *__pyx_n_s_dseek; PyObject *__pyx_n_s_e; PyObject *__pyx_kp_u_enable; PyObject *__pyx_n_s_end; PyObject *__pyx_n_s_err; PyObject *__pyx_n_s_errno; PyObject *__pyx_n_s_fd; PyObject *__pyx_n_s_fh; PyObject *__pyx_n_s_file_len; PyObject *__pyx_n_s_fixed; PyObject *__pyx_n_s_fmap; PyObject *__pyx_kp_u_gc; PyObject *__pyx_n_s_get_chunker; PyObject *__pyx_n_s_getstate; PyObject *__pyx_n_s_got; PyObject *__pyx_n_s_has_seek_hole; PyObject *__pyx_n_s_hash_mask_bits; PyObject *__pyx_n_s_hash_window_size; PyObject *__pyx_n_s_header_map; PyObject *__pyx_n_s_header_size; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_init; PyObject *__pyx_n_s_init_subclass; PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_n_s_is_data; PyObject *__pyx_kp_u_isenabled; PyObject *__pyx_n_s_kw; PyObject *__pyx_n_s_len; PyObject *__pyx_n_s_lseek; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_meta; PyObject *__pyx_kp_s_meta_data; PyObject *__pyx_n_s_metaclass; PyObject *__pyx_n_s_module; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_namedtuple; PyObject *__pyx_kp_s_no_default___reduce___due_to_non; PyObject *__pyx_n_s_offset; PyObject *__pyx_n_s_os; PyObject *__pyx_n_s_params; PyObject *__pyx_n_s_pos; PyObject *__pyx_n_s_posix_fadvise; PyObject *__pyx_n_s_prepare; PyObject *__pyx_n_s_pyx_state; PyObject *__pyx_n_s_qualname; PyObject *__pyx_n_s_range_size; PyObject *__pyx_n_s_range_start; PyObject *__pyx_n_s_read; PyObject *__pyx_n_s_reduce; PyObject *__pyx_n_s_reduce_cython; PyObject *__pyx_n_s_reduce_ex; PyObject *__pyx_n_s_remove; PyObject *__pyx_n_s_seed; PyObject *__pyx_n_s_seek; PyObject *__pyx_n_s_self; PyObject *__pyx_n_s_send; PyObject *__pyx_n_s_set_name; PyObject *__pyx_n_s_setstate; PyObject *__pyx_n_s_setstate_cython; PyObject *__pyx_n_s_size; PyObject *__pyx_n_s_sparse; PyObject *__pyx_n_s_sparsemap; PyObject *__pyx_n_s_spec; PyObject *__pyx_kp_s_src_borg_chunker_pyx; PyObject *__pyx_n_s_start; PyObject *__pyx_n_s_startswith; PyObject *__pyx_kp_s_stringsource; PyObject *__pyx_n_s_sum; PyObject *__pyx_n_s_super; PyObject *__pyx_n_s_table; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_throw; PyObject *__pyx_kp_s_too_small_max_size; PyObject *__pyx_n_s_try_sparse; PyObject *__pyx_kp_s_unsupported_chunker_algo_r; PyObject *__pyx_n_s_use_fh; PyObject *__pyx_n_s_wanted; PyObject *__pyx_n_s_whence; PyObject *__pyx_n_s_zeros; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_int_4294967295; PyObject *__pyx_int_0x4000000000000000; PyObject *__pyx_int_neg_1; PyObject *__pyx_codeobj_; PyObject *__pyx_tuple__3; PyObject *__pyx_tuple__6; PyObject *__pyx_tuple__7; PyObject *__pyx_tuple__9; PyObject *__pyx_tuple__11; PyObject *__pyx_tuple__12; PyObject *__pyx_tuple__14; PyObject *__pyx_tuple__16; PyObject *__pyx_tuple__17; PyObject *__pyx_tuple__19; PyObject *__pyx_tuple__20; PyObject *__pyx_tuple__21; PyObject *__pyx_tuple__22; PyObject *__pyx_tuple__24; PyObject *__pyx_tuple__25; PyObject *__pyx_tuple__27; PyObject *__pyx_tuple__29; PyObject *__pyx_tuple__31; PyObject *__pyx_tuple__33; PyObject *__pyx_codeobj__2; PyObject *__pyx_codeobj__8; PyObject *__pyx_codeobj__10; PyObject *__pyx_codeobj__13; PyObject *__pyx_codeobj__15; PyObject *__pyx_codeobj__18; PyObject *__pyx_codeobj__23; PyObject *__pyx_codeobj__26; PyObject *__pyx_codeobj__28; PyObject *__pyx_codeobj__30; PyObject *__pyx_codeobj__32; PyObject *__pyx_codeobj__34; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_4borg_7chunker_Chunker); Py_CLEAR(clear_module_state->__pyx_type_4borg_7chunker_Chunker); Py_CLEAR(clear_module_state->__pyx_ptype_4borg_7chunker___pyx_scope_struct__sparsemap); Py_CLEAR(clear_module_state->__pyx_type_4borg_7chunker___pyx_scope_struct__sparsemap); Py_CLEAR(clear_module_state->__pyx_ptype_4borg_7chunker___pyx_scope_struct_1_chunkify); Py_CLEAR(clear_module_state->__pyx_type_4borg_7chunker___pyx_scope_struct_1_chunkify); Py_CLEAR(clear_module_state->__pyx_kp_s_1_4_01); Py_CLEAR(clear_module_state->__pyx_n_s_API_VERSION); Py_CLEAR(clear_module_state->__pyx_n_s_AssertionError); Py_CLEAR(clear_module_state->__pyx_n_s_CH_ALLOC); Py_CLEAR(clear_module_state->__pyx_n_s_CH_DATA); Py_CLEAR(clear_module_state->__pyx_n_s_CH_HOLE); Py_CLEAR(clear_module_state->__pyx_n_s_Chunk); Py_CLEAR(clear_module_state->__pyx_n_s_Chunk_2); Py_CLEAR(clear_module_state->__pyx_kp_s_Chunk_namedtuple_meta_is_always); Py_CLEAR(clear_module_state->__pyx_n_s_Chunker); Py_CLEAR(clear_module_state->__pyx_n_s_ChunkerFixed); Py_CLEAR(clear_module_state->__pyx_n_s_ChunkerFixed___init); Py_CLEAR(clear_module_state->__pyx_n_s_ChunkerFixed_chunkify); Py_CLEAR(clear_module_state->__pyx_n_s_Chunker___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Chunker___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Chunker_chunkify); Py_CLEAR(clear_module_state->__pyx_n_s_ENXIO); Py_CLEAR(clear_module_state->__pyx_n_s_MAX_DATA_SIZE); Py_CLEAR(clear_module_state->__pyx_n_s_OSError); Py_CLEAR(clear_module_state->__pyx_n_s_POSIX_FADV_DONTNEED); Py_CLEAR(clear_module_state->__pyx_n_s_SEEK_CUR); Py_CLEAR(clear_module_state->__pyx_n_s_SEEK_DATA); Py_CLEAR(clear_module_state->__pyx_n_s_SEEK_END); Py_CLEAR(clear_module_state->__pyx_n_s_SEEK_HOLE); Py_CLEAR(clear_module_state->__pyx_n_s_SEEK_SET); Py_CLEAR(clear_module_state->__pyx_kp_s_This_is_a_simple_chunker_for_in); Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); Py_CLEAR(clear_module_state->__pyx_n_s__35); Py_CLEAR(clear_module_state->__pyx_n_s__4); Py_CLEAR(clear_module_state->__pyx_kp_u__5); Py_CLEAR(clear_module_state->__pyx_n_s_add); Py_CLEAR(clear_module_state->__pyx_n_s_algo); Py_CLEAR(clear_module_state->__pyx_n_s_allocation); Py_CLEAR(clear_module_state->__pyx_n_s_amount); Py_CLEAR(clear_module_state->__pyx_n_s_args); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_block_size); Py_CLEAR(clear_module_state->__pyx_n_s_body_map); Py_CLEAR(clear_module_state->__pyx_n_s_borg_chunker); Py_CLEAR(clear_module_state->__pyx_n_s_buzhash); Py_CLEAR(clear_module_state->__pyx_n_s_buzhash_update); Py_CLEAR(clear_module_state->__pyx_n_s_chunk_max_exp); Py_CLEAR(clear_module_state->__pyx_n_s_chunk_min_exp); Py_CLEAR(clear_module_state->__pyx_n_s_chunkify); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_close); Py_CLEAR(clear_module_state->__pyx_n_s_collections); Py_CLEAR(clear_module_state->__pyx_n_s_constants); Py_CLEAR(clear_module_state->__pyx_n_s_curr); Py_CLEAR(clear_module_state->__pyx_n_s_data); Py_CLEAR(clear_module_state->__pyx_n_s_dict); Py_CLEAR(clear_module_state->__pyx_kp_u_disable); Py_CLEAR(clear_module_state->__pyx_n_s_doc); Py_CLEAR(clear_module_state->__pyx_n_s_dpos_curr_end); Py_CLEAR(clear_module_state->__pyx_n_s_dread); Py_CLEAR(clear_module_state->__pyx_n_s_dseek); Py_CLEAR(clear_module_state->__pyx_n_s_e); Py_CLEAR(clear_module_state->__pyx_kp_u_enable); Py_CLEAR(clear_module_state->__pyx_n_s_end); Py_CLEAR(clear_module_state->__pyx_n_s_err); Py_CLEAR(clear_module_state->__pyx_n_s_errno); Py_CLEAR(clear_module_state->__pyx_n_s_fd); Py_CLEAR(clear_module_state->__pyx_n_s_fh); Py_CLEAR(clear_module_state->__pyx_n_s_file_len); Py_CLEAR(clear_module_state->__pyx_n_s_fixed); Py_CLEAR(clear_module_state->__pyx_n_s_fmap); Py_CLEAR(clear_module_state->__pyx_kp_u_gc); Py_CLEAR(clear_module_state->__pyx_n_s_get_chunker); Py_CLEAR(clear_module_state->__pyx_n_s_getstate); Py_CLEAR(clear_module_state->__pyx_n_s_got); Py_CLEAR(clear_module_state->__pyx_n_s_has_seek_hole); Py_CLEAR(clear_module_state->__pyx_n_s_hash_mask_bits); Py_CLEAR(clear_module_state->__pyx_n_s_hash_window_size); Py_CLEAR(clear_module_state->__pyx_n_s_header_map); Py_CLEAR(clear_module_state->__pyx_n_s_header_size); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_init); Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_n_s_is_data); Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); Py_CLEAR(clear_module_state->__pyx_n_s_kw); Py_CLEAR(clear_module_state->__pyx_n_s_len); Py_CLEAR(clear_module_state->__pyx_n_s_lseek); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_meta); Py_CLEAR(clear_module_state->__pyx_kp_s_meta_data); Py_CLEAR(clear_module_state->__pyx_n_s_metaclass); Py_CLEAR(clear_module_state->__pyx_n_s_module); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_namedtuple); Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_CLEAR(clear_module_state->__pyx_n_s_offset); Py_CLEAR(clear_module_state->__pyx_n_s_os); Py_CLEAR(clear_module_state->__pyx_n_s_params); Py_CLEAR(clear_module_state->__pyx_n_s_pos); Py_CLEAR(clear_module_state->__pyx_n_s_posix_fadvise); Py_CLEAR(clear_module_state->__pyx_n_s_prepare); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state); Py_CLEAR(clear_module_state->__pyx_n_s_qualname); Py_CLEAR(clear_module_state->__pyx_n_s_range_size); Py_CLEAR(clear_module_state->__pyx_n_s_range_start); Py_CLEAR(clear_module_state->__pyx_n_s_read); Py_CLEAR(clear_module_state->__pyx_n_s_reduce); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex); Py_CLEAR(clear_module_state->__pyx_n_s_remove); Py_CLEAR(clear_module_state->__pyx_n_s_seed); Py_CLEAR(clear_module_state->__pyx_n_s_seek); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_n_s_send); Py_CLEAR(clear_module_state->__pyx_n_s_set_name); Py_CLEAR(clear_module_state->__pyx_n_s_setstate); Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_size); Py_CLEAR(clear_module_state->__pyx_n_s_sparse); Py_CLEAR(clear_module_state->__pyx_n_s_sparsemap); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_kp_s_src_borg_chunker_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_start); Py_CLEAR(clear_module_state->__pyx_n_s_startswith); Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource); Py_CLEAR(clear_module_state->__pyx_n_s_sum); Py_CLEAR(clear_module_state->__pyx_n_s_super); Py_CLEAR(clear_module_state->__pyx_n_s_table); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_throw); Py_CLEAR(clear_module_state->__pyx_kp_s_too_small_max_size); Py_CLEAR(clear_module_state->__pyx_n_s_try_sparse); Py_CLEAR(clear_module_state->__pyx_kp_s_unsupported_chunker_algo_r); Py_CLEAR(clear_module_state->__pyx_n_s_use_fh); Py_CLEAR(clear_module_state->__pyx_n_s_wanted); Py_CLEAR(clear_module_state->__pyx_n_s_whence); Py_CLEAR(clear_module_state->__pyx_n_s_zeros); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_1); Py_CLEAR(clear_module_state->__pyx_int_4294967295); Py_CLEAR(clear_module_state->__pyx_int_0x4000000000000000); Py_CLEAR(clear_module_state->__pyx_int_neg_1); Py_CLEAR(clear_module_state->__pyx_codeobj_); Py_CLEAR(clear_module_state->__pyx_tuple__3); Py_CLEAR(clear_module_state->__pyx_tuple__6); Py_CLEAR(clear_module_state->__pyx_tuple__7); Py_CLEAR(clear_module_state->__pyx_tuple__9); Py_CLEAR(clear_module_state->__pyx_tuple__11); Py_CLEAR(clear_module_state->__pyx_tuple__12); Py_CLEAR(clear_module_state->__pyx_tuple__14); Py_CLEAR(clear_module_state->__pyx_tuple__16); Py_CLEAR(clear_module_state->__pyx_tuple__17); Py_CLEAR(clear_module_state->__pyx_tuple__19); Py_CLEAR(clear_module_state->__pyx_tuple__20); Py_CLEAR(clear_module_state->__pyx_tuple__21); Py_CLEAR(clear_module_state->__pyx_tuple__22); Py_CLEAR(clear_module_state->__pyx_tuple__24); Py_CLEAR(clear_module_state->__pyx_tuple__25); Py_CLEAR(clear_module_state->__pyx_tuple__27); Py_CLEAR(clear_module_state->__pyx_tuple__29); Py_CLEAR(clear_module_state->__pyx_tuple__31); Py_CLEAR(clear_module_state->__pyx_tuple__33); Py_CLEAR(clear_module_state->__pyx_codeobj__2); Py_CLEAR(clear_module_state->__pyx_codeobj__8); Py_CLEAR(clear_module_state->__pyx_codeobj__10); Py_CLEAR(clear_module_state->__pyx_codeobj__13); Py_CLEAR(clear_module_state->__pyx_codeobj__15); Py_CLEAR(clear_module_state->__pyx_codeobj__18); Py_CLEAR(clear_module_state->__pyx_codeobj__23); Py_CLEAR(clear_module_state->__pyx_codeobj__26); Py_CLEAR(clear_module_state->__pyx_codeobj__28); Py_CLEAR(clear_module_state->__pyx_codeobj__30); Py_CLEAR(clear_module_state->__pyx_codeobj__32); Py_CLEAR(clear_module_state->__pyx_codeobj__34); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_4borg_7chunker_Chunker); Py_VISIT(traverse_module_state->__pyx_type_4borg_7chunker_Chunker); Py_VISIT(traverse_module_state->__pyx_ptype_4borg_7chunker___pyx_scope_struct__sparsemap); Py_VISIT(traverse_module_state->__pyx_type_4borg_7chunker___pyx_scope_struct__sparsemap); Py_VISIT(traverse_module_state->__pyx_ptype_4borg_7chunker___pyx_scope_struct_1_chunkify); Py_VISIT(traverse_module_state->__pyx_type_4borg_7chunker___pyx_scope_struct_1_chunkify); Py_VISIT(traverse_module_state->__pyx_kp_s_1_4_01); Py_VISIT(traverse_module_state->__pyx_n_s_API_VERSION); Py_VISIT(traverse_module_state->__pyx_n_s_AssertionError); Py_VISIT(traverse_module_state->__pyx_n_s_CH_ALLOC); Py_VISIT(traverse_module_state->__pyx_n_s_CH_DATA); Py_VISIT(traverse_module_state->__pyx_n_s_CH_HOLE); Py_VISIT(traverse_module_state->__pyx_n_s_Chunk); Py_VISIT(traverse_module_state->__pyx_n_s_Chunk_2); Py_VISIT(traverse_module_state->__pyx_kp_s_Chunk_namedtuple_meta_is_always); Py_VISIT(traverse_module_state->__pyx_n_s_Chunker); Py_VISIT(traverse_module_state->__pyx_n_s_ChunkerFixed); Py_VISIT(traverse_module_state->__pyx_n_s_ChunkerFixed___init); Py_VISIT(traverse_module_state->__pyx_n_s_ChunkerFixed_chunkify); Py_VISIT(traverse_module_state->__pyx_n_s_Chunker___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Chunker___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Chunker_chunkify); Py_VISIT(traverse_module_state->__pyx_n_s_ENXIO); Py_VISIT(traverse_module_state->__pyx_n_s_MAX_DATA_SIZE); Py_VISIT(traverse_module_state->__pyx_n_s_OSError); Py_VISIT(traverse_module_state->__pyx_n_s_POSIX_FADV_DONTNEED); Py_VISIT(traverse_module_state->__pyx_n_s_SEEK_CUR); Py_VISIT(traverse_module_state->__pyx_n_s_SEEK_DATA); Py_VISIT(traverse_module_state->__pyx_n_s_SEEK_END); Py_VISIT(traverse_module_state->__pyx_n_s_SEEK_HOLE); Py_VISIT(traverse_module_state->__pyx_n_s_SEEK_SET); Py_VISIT(traverse_module_state->__pyx_kp_s_This_is_a_simple_chunker_for_in); Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); Py_VISIT(traverse_module_state->__pyx_n_s__35); Py_VISIT(traverse_module_state->__pyx_n_s__4); Py_VISIT(traverse_module_state->__pyx_kp_u__5); Py_VISIT(traverse_module_state->__pyx_n_s_add); Py_VISIT(traverse_module_state->__pyx_n_s_algo); Py_VISIT(traverse_module_state->__pyx_n_s_allocation); Py_VISIT(traverse_module_state->__pyx_n_s_amount); Py_VISIT(traverse_module_state->__pyx_n_s_args); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_block_size); Py_VISIT(traverse_module_state->__pyx_n_s_body_map); Py_VISIT(traverse_module_state->__pyx_n_s_borg_chunker); Py_VISIT(traverse_module_state->__pyx_n_s_buzhash); Py_VISIT(traverse_module_state->__pyx_n_s_buzhash_update); Py_VISIT(traverse_module_state->__pyx_n_s_chunk_max_exp); Py_VISIT(traverse_module_state->__pyx_n_s_chunk_min_exp); Py_VISIT(traverse_module_state->__pyx_n_s_chunkify); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_close); Py_VISIT(traverse_module_state->__pyx_n_s_collections); Py_VISIT(traverse_module_state->__pyx_n_s_constants); Py_VISIT(traverse_module_state->__pyx_n_s_curr); Py_VISIT(traverse_module_state->__pyx_n_s_data); Py_VISIT(traverse_module_state->__pyx_n_s_dict); Py_VISIT(traverse_module_state->__pyx_kp_u_disable); Py_VISIT(traverse_module_state->__pyx_n_s_doc); Py_VISIT(traverse_module_state->__pyx_n_s_dpos_curr_end); Py_VISIT(traverse_module_state->__pyx_n_s_dread); Py_VISIT(traverse_module_state->__pyx_n_s_dseek); Py_VISIT(traverse_module_state->__pyx_n_s_e); Py_VISIT(traverse_module_state->__pyx_kp_u_enable); Py_VISIT(traverse_module_state->__pyx_n_s_end); Py_VISIT(traverse_module_state->__pyx_n_s_err); Py_VISIT(traverse_module_state->__pyx_n_s_errno); Py_VISIT(traverse_module_state->__pyx_n_s_fd); Py_VISIT(traverse_module_state->__pyx_n_s_fh); Py_VISIT(traverse_module_state->__pyx_n_s_file_len); Py_VISIT(traverse_module_state->__pyx_n_s_fixed); Py_VISIT(traverse_module_state->__pyx_n_s_fmap); Py_VISIT(traverse_module_state->__pyx_kp_u_gc); Py_VISIT(traverse_module_state->__pyx_n_s_get_chunker); Py_VISIT(traverse_module_state->__pyx_n_s_getstate); Py_VISIT(traverse_module_state->__pyx_n_s_got); Py_VISIT(traverse_module_state->__pyx_n_s_has_seek_hole); Py_VISIT(traverse_module_state->__pyx_n_s_hash_mask_bits); Py_VISIT(traverse_module_state->__pyx_n_s_hash_window_size); Py_VISIT(traverse_module_state->__pyx_n_s_header_map); Py_VISIT(traverse_module_state->__pyx_n_s_header_size); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_init); Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_n_s_is_data); Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); Py_VISIT(traverse_module_state->__pyx_n_s_kw); Py_VISIT(traverse_module_state->__pyx_n_s_len); Py_VISIT(traverse_module_state->__pyx_n_s_lseek); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_meta); Py_VISIT(traverse_module_state->__pyx_kp_s_meta_data); Py_VISIT(traverse_module_state->__pyx_n_s_metaclass); Py_VISIT(traverse_module_state->__pyx_n_s_module); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_namedtuple); Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_VISIT(traverse_module_state->__pyx_n_s_offset); Py_VISIT(traverse_module_state->__pyx_n_s_os); Py_VISIT(traverse_module_state->__pyx_n_s_params); Py_VISIT(traverse_module_state->__pyx_n_s_pos); Py_VISIT(traverse_module_state->__pyx_n_s_posix_fadvise); Py_VISIT(traverse_module_state->__pyx_n_s_prepare); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state); Py_VISIT(traverse_module_state->__pyx_n_s_qualname); Py_VISIT(traverse_module_state->__pyx_n_s_range_size); Py_VISIT(traverse_module_state->__pyx_n_s_range_start); Py_VISIT(traverse_module_state->__pyx_n_s_read); Py_VISIT(traverse_module_state->__pyx_n_s_reduce); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex); Py_VISIT(traverse_module_state->__pyx_n_s_remove); Py_VISIT(traverse_module_state->__pyx_n_s_seed); Py_VISIT(traverse_module_state->__pyx_n_s_seek); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_n_s_send); Py_VISIT(traverse_module_state->__pyx_n_s_set_name); Py_VISIT(traverse_module_state->__pyx_n_s_setstate); Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_size); Py_VISIT(traverse_module_state->__pyx_n_s_sparse); Py_VISIT(traverse_module_state->__pyx_n_s_sparsemap); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_kp_s_src_borg_chunker_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_start); Py_VISIT(traverse_module_state->__pyx_n_s_startswith); Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource); Py_VISIT(traverse_module_state->__pyx_n_s_sum); Py_VISIT(traverse_module_state->__pyx_n_s_super); Py_VISIT(traverse_module_state->__pyx_n_s_table); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_throw); Py_VISIT(traverse_module_state->__pyx_kp_s_too_small_max_size); Py_VISIT(traverse_module_state->__pyx_n_s_try_sparse); Py_VISIT(traverse_module_state->__pyx_kp_s_unsupported_chunker_algo_r); Py_VISIT(traverse_module_state->__pyx_n_s_use_fh); Py_VISIT(traverse_module_state->__pyx_n_s_wanted); Py_VISIT(traverse_module_state->__pyx_n_s_whence); Py_VISIT(traverse_module_state->__pyx_n_s_zeros); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_int_1); Py_VISIT(traverse_module_state->__pyx_int_4294967295); Py_VISIT(traverse_module_state->__pyx_int_0x4000000000000000); Py_VISIT(traverse_module_state->__pyx_int_neg_1); Py_VISIT(traverse_module_state->__pyx_codeobj_); Py_VISIT(traverse_module_state->__pyx_tuple__3); Py_VISIT(traverse_module_state->__pyx_tuple__6); Py_VISIT(traverse_module_state->__pyx_tuple__7); Py_VISIT(traverse_module_state->__pyx_tuple__9); Py_VISIT(traverse_module_state->__pyx_tuple__11); Py_VISIT(traverse_module_state->__pyx_tuple__12); Py_VISIT(traverse_module_state->__pyx_tuple__14); Py_VISIT(traverse_module_state->__pyx_tuple__16); Py_VISIT(traverse_module_state->__pyx_tuple__17); Py_VISIT(traverse_module_state->__pyx_tuple__19); Py_VISIT(traverse_module_state->__pyx_tuple__20); Py_VISIT(traverse_module_state->__pyx_tuple__21); Py_VISIT(traverse_module_state->__pyx_tuple__22); Py_VISIT(traverse_module_state->__pyx_tuple__24); Py_VISIT(traverse_module_state->__pyx_tuple__25); Py_VISIT(traverse_module_state->__pyx_tuple__27); Py_VISIT(traverse_module_state->__pyx_tuple__29); Py_VISIT(traverse_module_state->__pyx_tuple__31); Py_VISIT(traverse_module_state->__pyx_tuple__33); Py_VISIT(traverse_module_state->__pyx_codeobj__2); Py_VISIT(traverse_module_state->__pyx_codeobj__8); Py_VISIT(traverse_module_state->__pyx_codeobj__10); Py_VISIT(traverse_module_state->__pyx_codeobj__13); Py_VISIT(traverse_module_state->__pyx_codeobj__15); Py_VISIT(traverse_module_state->__pyx_codeobj__18); Py_VISIT(traverse_module_state->__pyx_codeobj__23); Py_VISIT(traverse_module_state->__pyx_codeobj__26); Py_VISIT(traverse_module_state->__pyx_codeobj__28); Py_VISIT(traverse_module_state->__pyx_codeobj__30); Py_VISIT(traverse_module_state->__pyx_codeobj__32); Py_VISIT(traverse_module_state->__pyx_codeobj__34); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #define __pyx_type_4borg_7chunker_Chunker __pyx_mstate_global->__pyx_type_4borg_7chunker_Chunker #define __pyx_type_4borg_7chunker___pyx_scope_struct__sparsemap __pyx_mstate_global->__pyx_type_4borg_7chunker___pyx_scope_struct__sparsemap #define __pyx_type_4borg_7chunker___pyx_scope_struct_1_chunkify __pyx_mstate_global->__pyx_type_4borg_7chunker___pyx_scope_struct_1_chunkify #endif #define __pyx_ptype_4borg_7chunker_Chunker __pyx_mstate_global->__pyx_ptype_4borg_7chunker_Chunker #define __pyx_ptype_4borg_7chunker___pyx_scope_struct__sparsemap __pyx_mstate_global->__pyx_ptype_4borg_7chunker___pyx_scope_struct__sparsemap #define __pyx_ptype_4borg_7chunker___pyx_scope_struct_1_chunkify __pyx_mstate_global->__pyx_ptype_4borg_7chunker___pyx_scope_struct_1_chunkify #define __pyx_kp_s_1_4_01 __pyx_mstate_global->__pyx_kp_s_1_4_01 #define __pyx_n_s_API_VERSION __pyx_mstate_global->__pyx_n_s_API_VERSION #define __pyx_n_s_AssertionError __pyx_mstate_global->__pyx_n_s_AssertionError #define __pyx_n_s_CH_ALLOC __pyx_mstate_global->__pyx_n_s_CH_ALLOC #define __pyx_n_s_CH_DATA __pyx_mstate_global->__pyx_n_s_CH_DATA #define __pyx_n_s_CH_HOLE __pyx_mstate_global->__pyx_n_s_CH_HOLE #define __pyx_n_s_Chunk __pyx_mstate_global->__pyx_n_s_Chunk #define __pyx_n_s_Chunk_2 __pyx_mstate_global->__pyx_n_s_Chunk_2 #define __pyx_kp_s_Chunk_namedtuple_meta_is_always __pyx_mstate_global->__pyx_kp_s_Chunk_namedtuple_meta_is_always #define __pyx_n_s_Chunker __pyx_mstate_global->__pyx_n_s_Chunker #define __pyx_n_s_ChunkerFixed __pyx_mstate_global->__pyx_n_s_ChunkerFixed #define __pyx_n_s_ChunkerFixed___init __pyx_mstate_global->__pyx_n_s_ChunkerFixed___init #define __pyx_n_s_ChunkerFixed_chunkify __pyx_mstate_global->__pyx_n_s_ChunkerFixed_chunkify #define __pyx_n_s_Chunker___reduce_cython __pyx_mstate_global->__pyx_n_s_Chunker___reduce_cython #define __pyx_n_s_Chunker___setstate_cython __pyx_mstate_global->__pyx_n_s_Chunker___setstate_cython #define __pyx_n_s_Chunker_chunkify __pyx_mstate_global->__pyx_n_s_Chunker_chunkify #define __pyx_n_s_ENXIO __pyx_mstate_global->__pyx_n_s_ENXIO #define __pyx_n_s_MAX_DATA_SIZE __pyx_mstate_global->__pyx_n_s_MAX_DATA_SIZE #define __pyx_n_s_OSError __pyx_mstate_global->__pyx_n_s_OSError #define __pyx_n_s_POSIX_FADV_DONTNEED __pyx_mstate_global->__pyx_n_s_POSIX_FADV_DONTNEED #define __pyx_n_s_SEEK_CUR __pyx_mstate_global->__pyx_n_s_SEEK_CUR #define __pyx_n_s_SEEK_DATA __pyx_mstate_global->__pyx_n_s_SEEK_DATA #define __pyx_n_s_SEEK_END __pyx_mstate_global->__pyx_n_s_SEEK_END #define __pyx_n_s_SEEK_HOLE __pyx_mstate_global->__pyx_n_s_SEEK_HOLE #define __pyx_n_s_SEEK_SET __pyx_mstate_global->__pyx_n_s_SEEK_SET #define __pyx_kp_s_This_is_a_simple_chunker_for_in __pyx_mstate_global->__pyx_kp_s_This_is_a_simple_chunker_for_in #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError #define __pyx_n_s__35 __pyx_mstate_global->__pyx_n_s__35 #define __pyx_n_s__4 __pyx_mstate_global->__pyx_n_s__4 #define __pyx_kp_u__5 __pyx_mstate_global->__pyx_kp_u__5 #define __pyx_n_s_add __pyx_mstate_global->__pyx_n_s_add #define __pyx_n_s_algo __pyx_mstate_global->__pyx_n_s_algo #define __pyx_n_s_allocation __pyx_mstate_global->__pyx_n_s_allocation #define __pyx_n_s_amount __pyx_mstate_global->__pyx_n_s_amount #define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_block_size __pyx_mstate_global->__pyx_n_s_block_size #define __pyx_n_s_body_map __pyx_mstate_global->__pyx_n_s_body_map #define __pyx_n_s_borg_chunker __pyx_mstate_global->__pyx_n_s_borg_chunker #define __pyx_n_s_buzhash __pyx_mstate_global->__pyx_n_s_buzhash #define __pyx_n_s_buzhash_update __pyx_mstate_global->__pyx_n_s_buzhash_update #define __pyx_n_s_chunk_max_exp __pyx_mstate_global->__pyx_n_s_chunk_max_exp #define __pyx_n_s_chunk_min_exp __pyx_mstate_global->__pyx_n_s_chunk_min_exp #define __pyx_n_s_chunkify __pyx_mstate_global->__pyx_n_s_chunkify #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_close __pyx_mstate_global->__pyx_n_s_close #define __pyx_n_s_collections __pyx_mstate_global->__pyx_n_s_collections #define __pyx_n_s_constants __pyx_mstate_global->__pyx_n_s_constants #define __pyx_n_s_curr __pyx_mstate_global->__pyx_n_s_curr #define __pyx_n_s_data __pyx_mstate_global->__pyx_n_s_data #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable #define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc #define __pyx_n_s_dpos_curr_end __pyx_mstate_global->__pyx_n_s_dpos_curr_end #define __pyx_n_s_dread __pyx_mstate_global->__pyx_n_s_dread #define __pyx_n_s_dseek __pyx_mstate_global->__pyx_n_s_dseek #define __pyx_n_s_e __pyx_mstate_global->__pyx_n_s_e #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable #define __pyx_n_s_end __pyx_mstate_global->__pyx_n_s_end #define __pyx_n_s_err __pyx_mstate_global->__pyx_n_s_err #define __pyx_n_s_errno __pyx_mstate_global->__pyx_n_s_errno #define __pyx_n_s_fd __pyx_mstate_global->__pyx_n_s_fd #define __pyx_n_s_fh __pyx_mstate_global->__pyx_n_s_fh #define __pyx_n_s_file_len __pyx_mstate_global->__pyx_n_s_file_len #define __pyx_n_s_fixed __pyx_mstate_global->__pyx_n_s_fixed #define __pyx_n_s_fmap __pyx_mstate_global->__pyx_n_s_fmap #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc #define __pyx_n_s_get_chunker __pyx_mstate_global->__pyx_n_s_get_chunker #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate #define __pyx_n_s_got __pyx_mstate_global->__pyx_n_s_got #define __pyx_n_s_has_seek_hole __pyx_mstate_global->__pyx_n_s_has_seek_hole #define __pyx_n_s_hash_mask_bits __pyx_mstate_global->__pyx_n_s_hash_mask_bits #define __pyx_n_s_hash_window_size __pyx_mstate_global->__pyx_n_s_hash_window_size #define __pyx_n_s_header_map __pyx_mstate_global->__pyx_n_s_header_map #define __pyx_n_s_header_size __pyx_mstate_global->__pyx_n_s_header_size #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init #define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_n_s_is_data __pyx_mstate_global->__pyx_n_s_is_data #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled #define __pyx_n_s_kw __pyx_mstate_global->__pyx_n_s_kw #define __pyx_n_s_len __pyx_mstate_global->__pyx_n_s_len #define __pyx_n_s_lseek __pyx_mstate_global->__pyx_n_s_lseek #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_meta __pyx_mstate_global->__pyx_n_s_meta #define __pyx_kp_s_meta_data __pyx_mstate_global->__pyx_kp_s_meta_data #define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass #define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_namedtuple __pyx_mstate_global->__pyx_n_s_namedtuple #define __pyx_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non #define __pyx_n_s_offset __pyx_mstate_global->__pyx_n_s_offset #define __pyx_n_s_os __pyx_mstate_global->__pyx_n_s_os #define __pyx_n_s_params __pyx_mstate_global->__pyx_n_s_params #define __pyx_n_s_pos __pyx_mstate_global->__pyx_n_s_pos #define __pyx_n_s_posix_fadvise __pyx_mstate_global->__pyx_n_s_posix_fadvise #define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state #define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname #define __pyx_n_s_range_size __pyx_mstate_global->__pyx_n_s_range_size #define __pyx_n_s_range_start __pyx_mstate_global->__pyx_n_s_range_start #define __pyx_n_s_read __pyx_mstate_global->__pyx_n_s_read #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex #define __pyx_n_s_remove __pyx_mstate_global->__pyx_n_s_remove #define __pyx_n_s_seed __pyx_mstate_global->__pyx_n_s_seed #define __pyx_n_s_seek __pyx_mstate_global->__pyx_n_s_seek #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_n_s_send __pyx_mstate_global->__pyx_n_s_send #define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython #define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size #define __pyx_n_s_sparse __pyx_mstate_global->__pyx_n_s_sparse #define __pyx_n_s_sparsemap __pyx_mstate_global->__pyx_n_s_sparsemap #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_kp_s_src_borg_chunker_pyx __pyx_mstate_global->__pyx_kp_s_src_borg_chunker_pyx #define __pyx_n_s_start __pyx_mstate_global->__pyx_n_s_start #define __pyx_n_s_startswith __pyx_mstate_global->__pyx_n_s_startswith #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource #define __pyx_n_s_sum __pyx_mstate_global->__pyx_n_s_sum #define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super #define __pyx_n_s_table __pyx_mstate_global->__pyx_n_s_table #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_throw __pyx_mstate_global->__pyx_n_s_throw #define __pyx_kp_s_too_small_max_size __pyx_mstate_global->__pyx_kp_s_too_small_max_size #define __pyx_n_s_try_sparse __pyx_mstate_global->__pyx_n_s_try_sparse #define __pyx_kp_s_unsupported_chunker_algo_r __pyx_mstate_global->__pyx_kp_s_unsupported_chunker_algo_r #define __pyx_n_s_use_fh __pyx_mstate_global->__pyx_n_s_use_fh #define __pyx_n_s_wanted __pyx_mstate_global->__pyx_n_s_wanted #define __pyx_n_s_whence __pyx_mstate_global->__pyx_n_s_whence #define __pyx_n_s_zeros __pyx_mstate_global->__pyx_n_s_zeros #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 #define __pyx_int_4294967295 __pyx_mstate_global->__pyx_int_4294967295 #define __pyx_int_0x4000000000000000 __pyx_mstate_global->__pyx_int_0x4000000000000000 #define __pyx_int_neg_1 __pyx_mstate_global->__pyx_int_neg_1 #define __pyx_codeobj_ __pyx_mstate_global->__pyx_codeobj_ #define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 #define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6 #define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 #define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9 #define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11 #define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12 #define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 #define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16 #define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17 #define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19 #define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20 #define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21 #define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22 #define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24 #define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25 #define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27 #define __pyx_tuple__29 __pyx_mstate_global->__pyx_tuple__29 #define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31 #define __pyx_tuple__33 __pyx_mstate_global->__pyx_tuple__33 #define __pyx_codeobj__2 __pyx_mstate_global->__pyx_codeobj__2 #define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8 #define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10 #define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 #define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 #define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23 #define __pyx_codeobj__26 __pyx_mstate_global->__pyx_codeobj__26 #define __pyx_codeobj__28 __pyx_mstate_global->__pyx_codeobj__28 #define __pyx_codeobj__30 __pyx_mstate_global->__pyx_codeobj__30 #define __pyx_codeobj__32 __pyx_mstate_global->__pyx_codeobj__32 #define __pyx_codeobj__34 __pyx_mstate_global->__pyx_codeobj__34 /* #### Code section: module_code ### */ /* "borg/chunker.pyx":51 * """ * * def Chunk(data, **meta): # <<<<<<<<<<<<<< * return _Chunk(meta, data) * */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_7chunker_1Chunk(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_7chunker_1Chunk = {"Chunk", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_7chunker_1Chunk, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_7chunker_1Chunk(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_data = 0; PyObject *__pyx_v_meta = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("Chunk (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); __pyx_v_meta = PyDict_New(); if (unlikely(!__pyx_v_meta)) return NULL; __Pyx_GOTREF(__pyx_v_meta); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 51, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_meta, values + 0, kwd_pos_args, "Chunk") < 0)) __PYX_ERR(0, 51, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_data = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("Chunk", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 51, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_DECREF(__pyx_v_meta); __pyx_v_meta = 0; __Pyx_AddTraceback("borg.chunker.Chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_7chunker_Chunk(__pyx_self, __pyx_v_data, __pyx_v_meta); /* function exit code */ __Pyx_DECREF(__pyx_v_meta); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_7chunker_Chunk(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_meta) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("Chunk", 1); /* "borg/chunker.pyx":52 * * def Chunk(data, **meta): * return _Chunk(meta, data) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Chunk); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_meta, __pyx_v_data}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/chunker.pyx":51 * """ * * def Chunk(data, **meta): # <<<<<<<<<<<<<< * return _Chunk(meta, data) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("borg.chunker.Chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/chunker.pyx":55 * * * def dread(offset, size, fd=None, fh=-1): # <<<<<<<<<<<<<< * use_fh = fh >= 0 * if use_fh: */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_7chunker_3dread(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_7chunker_3dread = {"dread", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_7chunker_3dread, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_7chunker_3dread(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_offset = 0; PyObject *__pyx_v_size = 0; PyObject *__pyx_v_fd = 0; PyObject *__pyx_v_fh = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("dread (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_offset,&__pyx_n_s_size,&__pyx_n_s_fd,&__pyx_n_s_fh,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_neg_1))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_offset)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("dread", 0, 2, 4, 1); __PYX_ERR(0, 55, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fd); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fh); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "dread") < 0)) __PYX_ERR(0, 55, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_offset = values[0]; __pyx_v_size = values[1]; __pyx_v_fd = values[2]; __pyx_v_fh = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("dread", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 55, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.chunker.dread", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_7chunker_2dread(__pyx_self, __pyx_v_offset, __pyx_v_size, __pyx_v_fd, __pyx_v_fh); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_7chunker_2dread(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_offset, PyObject *__pyx_v_size, PyObject *__pyx_v_fd, PyObject *__pyx_v_fh) { PyObject *__pyx_v_use_fh = NULL; PyObject *__pyx_v_data = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; Py_ssize_t __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("dread", 1); /* "borg/chunker.pyx":56 * * def dread(offset, size, fd=None, fh=-1): * use_fh = fh >= 0 # <<<<<<<<<<<<<< * if use_fh: * data = os.read(fh, size) */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_fh, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) __pyx_v_use_fh = __pyx_t_1; __pyx_t_1 = 0; /* "borg/chunker.pyx":57 * def dread(offset, size, fd=None, fh=-1): * use_fh = fh >= 0 * if use_fh: # <<<<<<<<<<<<<< * data = os.read(fh, size) * if hasattr(os, 'posix_fadvise'): */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_use_fh); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 57, __pyx_L1_error) if (__pyx_t_2) { /* "borg/chunker.pyx":58 * use_fh = fh >= 0 * if use_fh: * data = os.read(fh, size) # <<<<<<<<<<<<<< * if hasattr(os, 'posix_fadvise'): * # UNIX only and, in case of block sizes that are not a multiple of the */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_read); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_fh, __pyx_v_size}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_data = __pyx_t_1; __pyx_t_1 = 0; /* "borg/chunker.pyx":59 * if use_fh: * data = os.read(fh, size) * if hasattr(os, 'posix_fadvise'): # <<<<<<<<<<<<<< * # UNIX only and, in case of block sizes that are not a multiple of the * # system's page size, better be used with a bug fixed linux kernel > 4.6.0, */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_HasAttr(__pyx_t_1, __pyx_n_s_posix_fadvise); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "borg/chunker.pyx":63 * # system's page size, better be used with a bug fixed linux kernel > 4.6.0, * # see comment/workaround in _chunker.c and borgbackup issue #907. * os.posix_fadvise(fh, offset, len(data), os.POSIX_FADV_DONTNEED) # <<<<<<<<<<<<<< * return data * else: */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_posix_fadvise); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 63, __pyx_L1_error) __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_os); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_POSIX_FADV_DONTNEED); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_7, __pyx_v_fh, __pyx_v_offset, __pyx_t_4, __pyx_t_8}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 4+__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/chunker.pyx":59 * if use_fh: * data = os.read(fh, size) * if hasattr(os, 'posix_fadvise'): # <<<<<<<<<<<<<< * # UNIX only and, in case of block sizes that are not a multiple of the * # system's page size, better be used with a bug fixed linux kernel > 4.6.0, */ } /* "borg/chunker.pyx":64 * # see comment/workaround in _chunker.c and borgbackup issue #907. * os.posix_fadvise(fh, offset, len(data), os.POSIX_FADV_DONTNEED) * return data # <<<<<<<<<<<<<< * else: * return fd.read(size) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_data); __pyx_r = __pyx_v_data; goto __pyx_L0; /* "borg/chunker.pyx":57 * def dread(offset, size, fd=None, fh=-1): * use_fh = fh >= 0 * if use_fh: # <<<<<<<<<<<<<< * data = os.read(fh, size) * if hasattr(os, 'posix_fadvise'): */ } /* "borg/chunker.pyx":66 * return data * else: * return fd.read(size) # <<<<<<<<<<<<<< * * */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_fd, __pyx_n_s_read); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_size}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; } /* "borg/chunker.pyx":55 * * * def dread(offset, size, fd=None, fh=-1): # <<<<<<<<<<<<<< * use_fh = fh >= 0 * if use_fh: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("borg.chunker.dread", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_use_fh); __Pyx_XDECREF(__pyx_v_data); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/chunker.pyx":69 * * * def dseek(amount, whence, fd=None, fh=-1): # <<<<<<<<<<<<<< * use_fh = fh >= 0 * if use_fh: */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_7chunker_5dseek(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_7chunker_5dseek = {"dseek", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_7chunker_5dseek, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_7chunker_5dseek(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_amount = 0; PyObject *__pyx_v_whence = 0; PyObject *__pyx_v_fd = 0; PyObject *__pyx_v_fh = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("dseek (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_amount,&__pyx_n_s_whence,&__pyx_n_s_fd,&__pyx_n_s_fh,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_neg_1))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_amount)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 69, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_whence)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 69, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("dseek", 0, 2, 4, 1); __PYX_ERR(0, 69, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fd); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 69, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fh); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 69, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "dseek") < 0)) __PYX_ERR(0, 69, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_amount = values[0]; __pyx_v_whence = values[1]; __pyx_v_fd = values[2]; __pyx_v_fh = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("dseek", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 69, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.chunker.dseek", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_7chunker_4dseek(__pyx_self, __pyx_v_amount, __pyx_v_whence, __pyx_v_fd, __pyx_v_fh); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_7chunker_4dseek(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_amount, PyObject *__pyx_v_whence, PyObject *__pyx_v_fd, PyObject *__pyx_v_fh) { PyObject *__pyx_v_use_fh = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("dseek", 1); /* "borg/chunker.pyx":70 * * def dseek(amount, whence, fd=None, fh=-1): * use_fh = fh >= 0 # <<<<<<<<<<<<<< * if use_fh: * return os.lseek(fh, amount, whence) */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_fh, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error) __pyx_v_use_fh = __pyx_t_1; __pyx_t_1 = 0; /* "borg/chunker.pyx":71 * def dseek(amount, whence, fd=None, fh=-1): * use_fh = fh >= 0 * if use_fh: # <<<<<<<<<<<<<< * return os.lseek(fh, amount, whence) * else: */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_use_fh); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 71, __pyx_L1_error) if (__pyx_t_2) { /* "borg/chunker.pyx":72 * use_fh = fh >= 0 * if use_fh: * return os.lseek(fh, amount, whence) # <<<<<<<<<<<<<< * else: * return fd.seek(amount, whence) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_lseek); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_fh, __pyx_v_amount, __pyx_v_whence}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/chunker.pyx":71 * def dseek(amount, whence, fd=None, fh=-1): * use_fh = fh >= 0 * if use_fh: # <<<<<<<<<<<<<< * return os.lseek(fh, amount, whence) * else: */ } /* "borg/chunker.pyx":74 * return os.lseek(fh, amount, whence) * else: * return fd.seek(amount, whence) # <<<<<<<<<<<<<< * * */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_fd, __pyx_n_s_seek); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_amount, __pyx_v_whence}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; } /* "borg/chunker.pyx":69 * * * def dseek(amount, whence, fd=None, fh=-1): # <<<<<<<<<<<<<< * use_fh = fh >= 0 * if use_fh: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("borg.chunker.dseek", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_use_fh); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/chunker.pyx":77 * * * def dpos_curr_end(fd=None, fh=-1): # <<<<<<<<<<<<<< * """ * determine current position, file end position (== file length) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_7chunker_7dpos_curr_end(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_7chunker_6dpos_curr_end, "\n determine current position, file end position (== file length)\n "); static PyMethodDef __pyx_mdef_4borg_7chunker_7dpos_curr_end = {"dpos_curr_end", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_7chunker_7dpos_curr_end, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_7chunker_6dpos_curr_end}; static PyObject *__pyx_pw_4borg_7chunker_7dpos_curr_end(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_fd = 0; PyObject *__pyx_v_fh = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("dpos_curr_end (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fd,&__pyx_n_s_fh,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_neg_1))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fd); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 77, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fh); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 77, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "dpos_curr_end") < 0)) __PYX_ERR(0, 77, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_fd = values[0]; __pyx_v_fh = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("dpos_curr_end", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 77, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.chunker.dpos_curr_end", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_7chunker_6dpos_curr_end(__pyx_self, __pyx_v_fd, __pyx_v_fh); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_7chunker_6dpos_curr_end(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fd, PyObject *__pyx_v_fh) { PyObject *__pyx_v_curr = NULL; PyObject *__pyx_v_end = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("dpos_curr_end", 1); /* "borg/chunker.pyx":81 * determine current position, file end position (== file length) * """ * curr = dseek(0, os.SEEK_CUR, fd, fh) # <<<<<<<<<<<<<< * end = dseek(0, os.SEEK_END, fd, fh) * dseek(curr, os.SEEK_SET, fd, fh) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_dseek); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_SEEK_CUR); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_int_0, __pyx_t_4, __pyx_v_fd, __pyx_v_fh}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 4+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_curr = __pyx_t_1; __pyx_t_1 = 0; /* "borg/chunker.pyx":82 * """ * curr = dseek(0, os.SEEK_CUR, fd, fh) * end = dseek(0, os.SEEK_END, fd, fh) # <<<<<<<<<<<<<< * dseek(curr, os.SEEK_SET, fd, fh) * return curr, end */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_dseek); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_SEEK_END); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_4, __pyx_int_0, __pyx_t_3, __pyx_v_fd, __pyx_v_fh}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 4+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_end = __pyx_t_1; __pyx_t_1 = 0; /* "borg/chunker.pyx":83 * curr = dseek(0, os.SEEK_CUR, fd, fh) * end = dseek(0, os.SEEK_END, fd, fh) * dseek(curr, os.SEEK_SET, fd, fh) # <<<<<<<<<<<<<< * return curr, end * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_dseek); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_SEEK_SET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_v_curr, __pyx_t_4, __pyx_v_fd, __pyx_v_fh}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 4+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/chunker.pyx":84 * end = dseek(0, os.SEEK_END, fd, fh) * dseek(curr, os.SEEK_SET, fd, fh) * return curr, end # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_curr); __Pyx_GIVEREF(__pyx_v_curr); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_curr)) __PYX_ERR(0, 84, __pyx_L1_error); __Pyx_INCREF(__pyx_v_end); __Pyx_GIVEREF(__pyx_v_end); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_end)) __PYX_ERR(0, 84, __pyx_L1_error); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/chunker.pyx":77 * * * def dpos_curr_end(fd=None, fh=-1): # <<<<<<<<<<<<<< * """ * determine current position, file end position (== file length) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("borg.chunker.dpos_curr_end", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_curr); __Pyx_XDECREF(__pyx_v_end); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_4borg_7chunker_10generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "borg/chunker.pyx":87 * * * def sparsemap(fd=None, fh=-1): # <<<<<<<<<<<<<< * """ * generator yielding a (start, length, is_data) tuple for each range. */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_7chunker_9sparsemap(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_7chunker_8sparsemap, "\n generator yielding a (start, length, is_data) tuple for each range.\n is_data is indicating data ranges (True) or hole ranges (False).\n\n note:\n the map is generated starting from the current seek position (it\n is not required to be 0 / to be at the start of the file) and\n work from there up to the end of the file.\n when the generator is finished, the file pointer position will be\n reset to where it was before calling this function.\n "); static PyMethodDef __pyx_mdef_4borg_7chunker_9sparsemap = {"sparsemap", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_7chunker_9sparsemap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_7chunker_8sparsemap}; static PyObject *__pyx_pw_4borg_7chunker_9sparsemap(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_fd = 0; PyObject *__pyx_v_fh = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sparsemap (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fd,&__pyx_n_s_fh,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_neg_1))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fd); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fh); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "sparsemap") < 0)) __PYX_ERR(0, 87, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_fd = values[0]; __pyx_v_fh = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("sparsemap", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 87, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.chunker.sparsemap", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_7chunker_8sparsemap(__pyx_self, __pyx_v_fd, __pyx_v_fh); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_7chunker_8sparsemap(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fd, PyObject *__pyx_v_fh) { struct __pyx_obj_4borg_7chunker___pyx_scope_struct__sparsemap *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sparsemap", 0); __pyx_cur_scope = (struct __pyx_obj_4borg_7chunker___pyx_scope_struct__sparsemap *)__pyx_tp_new_4borg_7chunker___pyx_scope_struct__sparsemap(__pyx_ptype_4borg_7chunker___pyx_scope_struct__sparsemap, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_4borg_7chunker___pyx_scope_struct__sparsemap *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 87, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_fd = __pyx_v_fd; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_fd); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_fd); __pyx_cur_scope->__pyx_v_fh = __pyx_v_fh; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_fh); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_fh); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4borg_7chunker_10generator, __pyx_codeobj_, (PyObject *) __pyx_cur_scope, __pyx_n_s_sparsemap, __pyx_n_s_sparsemap, __pyx_n_s_borg_chunker); if (unlikely(!gen)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.chunker.sparsemap", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_4borg_7chunker_10generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_4borg_7chunker___pyx_scope_struct__sparsemap *__pyx_cur_scope = ((struct __pyx_obj_4borg_7chunker___pyx_scope_struct__sparsemap *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; int __pyx_t_13; int __pyx_t_14; int __pyx_t_15; char const *__pyx_t_16; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; PyObject *__pyx_t_22 = NULL; char const *__pyx_t_23; int __pyx_t_24; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sparsemap", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L30_resume_from_yield; case 2: goto __pyx_L36_resume_from_yield; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 87, __pyx_L1_error) /* "borg/chunker.pyx":99 * reset to where it was before calling this function. * """ * curr, file_len = dpos_curr_end(fd, fh) # <<<<<<<<<<<<<< * start = curr * try: */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_dpos_curr_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_fd, __pyx_cur_scope->__pyx_v_fh}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 99, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 99, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 99, __pyx_L1_error) __pyx_L5_unpacking_done:; } __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_curr = __pyx_t_2; __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_file_len = __pyx_t_3; __pyx_t_3 = 0; /* "borg/chunker.pyx":100 * """ * curr, file_len = dpos_curr_end(fd, fh) * start = curr # <<<<<<<<<<<<<< * try: * whence = os.SEEK_HOLE */ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_curr); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_curr); __pyx_cur_scope->__pyx_v_start = __pyx_cur_scope->__pyx_v_curr; /* "borg/chunker.pyx":101 * curr, file_len = dpos_curr_end(fd, fh) * start = curr * try: # <<<<<<<<<<<<<< * whence = os.SEEK_HOLE * while True: */ /*try:*/ { /* "borg/chunker.pyx":102 * start = curr * try: * whence = os.SEEK_HOLE # <<<<<<<<<<<<<< * while True: * is_data = whence == os.SEEK_HOLE # True: range with data, False: range is a hole */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_SEEK_HOLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 102, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_whence = __pyx_t_3; __pyx_t_3 = 0; /* "borg/chunker.pyx":103 * try: * whence = os.SEEK_HOLE * while True: # <<<<<<<<<<<<<< * is_data = whence == os.SEEK_HOLE # True: range with data, False: range is a hole * try: */ while (1) { /* "borg/chunker.pyx":104 * whence = os.SEEK_HOLE * while True: * is_data = whence == os.SEEK_HOLE # True: range with data, False: range is a hole # <<<<<<<<<<<<<< * try: * end = dseek(start, whence, fd, fh) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_SEEK_HOLE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_whence, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L7_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_is_data); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_is_data, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/chunker.pyx":105 * while True: * is_data = whence == os.SEEK_HOLE # True: range with data, False: range is a hole * try: # <<<<<<<<<<<<<< * end = dseek(start, whence, fd, fh) * except OSError as e: */ { __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); /*try:*/ { /* "borg/chunker.pyx":106 * is_data = whence == os.SEEK_HOLE # True: range with data, False: range is a hole * try: * end = dseek(start, whence, fd, fh) # <<<<<<<<<<<<<< * except OSError as e: * if e.errno == errno.ENXIO: */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_dseek); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_2, __pyx_cur_scope->__pyx_v_start, __pyx_cur_scope->__pyx_v_whence, __pyx_cur_scope->__pyx_v_fd, __pyx_cur_scope->__pyx_v_fh}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 106, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_end); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_end, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/chunker.pyx":105 * while True: * is_data = whence == os.SEEK_HOLE # True: range with data, False: range is a hole * try: # <<<<<<<<<<<<<< * end = dseek(start, whence, fd, fh) * except OSError as e: */ } __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L18_try_end; __pyx_L11_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/chunker.pyx":107 * try: * end = dseek(start, whence, fd, fh) * except OSError as e: # <<<<<<<<<<<<<< * if e.errno == errno.ENXIO: * if not is_data and start < file_len: */ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_OSError); if (__pyx_t_4) { __Pyx_AddTraceback("borg.chunker.sparsemap", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_2) < 0) __PYX_ERR(0, 107, __pyx_L13_except_error) __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_e = __pyx_t_1; /*try:*/ { /* "borg/chunker.pyx":108 * end = dseek(start, whence, fd, fh) * except OSError as e: * if e.errno == errno.ENXIO: # <<<<<<<<<<<<<< * if not is_data and start < file_len: * # if there is a hole at the end of a file, we can not find the file end by SEEK_DATA */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_e, __pyx_n_s_errno); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 108, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_errno); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 108, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_ENXIO); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 108, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = PyObject_RichCompare(__pyx_t_5, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 108, __pyx_L24_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 108, __pyx_L24_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (likely(__pyx_t_12)) { /* "borg/chunker.pyx":109 * except OSError as e: * if e.errno == errno.ENXIO: * if not is_data and start < file_len: # <<<<<<<<<<<<<< * # if there is a hole at the end of a file, we can not find the file end by SEEK_DATA * # (because we run into ENXIO), thus we must manually deal with this case: */ __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_data); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 109, __pyx_L24_error) __pyx_t_14 = (!__pyx_t_13); if (__pyx_t_14) { } else { __pyx_t_12 = __pyx_t_14; goto __pyx_L28_bool_binop_done; } __pyx_t_10 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_start, __pyx_cur_scope->__pyx_v_file_len, Py_LT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 109, __pyx_L24_error) __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 109, __pyx_L24_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_12 = __pyx_t_14; __pyx_L28_bool_binop_done:; if (__pyx_t_12) { /* "borg/chunker.pyx":112 * # if there is a hole at the end of a file, we can not find the file end by SEEK_DATA * # (because we run into ENXIO), thus we must manually deal with this case: * end = file_len # <<<<<<<<<<<<<< * yield (start, end - start, is_data) * break */ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_file_len); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_end); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_end, __pyx_cur_scope->__pyx_v_file_len); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_file_len); /* "borg/chunker.pyx":113 * # (because we run into ENXIO), thus we must manually deal with this case: * end = file_len * yield (start, end - start, is_data) # <<<<<<<<<<<<<< * break * else: */ __pyx_t_10 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_end, __pyx_cur_scope->__pyx_v_start); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 113, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 113, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_start); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_start); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_cur_scope->__pyx_v_start)) __PYX_ERR(0, 113, __pyx_L24_error); __Pyx_GIVEREF(__pyx_t_10); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_10)) __PYX_ERR(0, 113, __pyx_L24_error); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_is_data); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_is_data); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_cur_scope->__pyx_v_is_data)) __PYX_ERR(0, 113, __pyx_L24_error); __pyx_t_10 = 0; __pyx_r = __pyx_t_11; __pyx_t_11 = 0; __Pyx_XGIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; __Pyx_XGIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; __Pyx_XGIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_t_2 = __pyx_t_3; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_3 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_4 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_9); __pyx_cur_scope->__pyx_t_5 = __pyx_t_9; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_SwapException(__pyx_generator); /* return from generator, yielding value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L30_resume_from_yield:; __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_2); __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_3); __pyx_t_7 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_9 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 113, __pyx_L24_error) /* "borg/chunker.pyx":109 * except OSError as e: * if e.errno == errno.ENXIO: * if not is_data and start < file_len: # <<<<<<<<<<<<<< * # if there is a hole at the end of a file, we can not find the file end by SEEK_DATA * # (because we run into ENXIO), thus we must manually deal with this case: */ } /* "borg/chunker.pyx":114 * end = file_len * yield (start, end - start, is_data) * break # <<<<<<<<<<<<<< * else: * raise */ goto __pyx_L22_break; /* "borg/chunker.pyx":108 * end = dseek(start, whence, fd, fh) * except OSError as e: * if e.errno == errno.ENXIO: # <<<<<<<<<<<<<< * if not is_data and start < file_len: * # if there is a hole at the end of a file, we can not find the file end by SEEK_DATA */ } /* "borg/chunker.pyx":116 * break * else: * raise # <<<<<<<<<<<<<< * # we do not want to yield zero-length ranges with start == end: * if end > start: */ /*else*/ { __Pyx_GIVEREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_1, __pyx_t_2); __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_t_2 = 0; __PYX_ERR(0, 116, __pyx_L24_error) } } /* "borg/chunker.pyx":107 * try: * end = dseek(start, whence, fd, fh) * except OSError as e: # <<<<<<<<<<<<<< * if e.errno == errno.ENXIO: * if not is_data and start < file_len: */ /*finally:*/ { __pyx_L24_error:; /*exception exit:*/{ __Pyx_PyThreadState_assign __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_22); __pyx_t_4 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename; { __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_e); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_e); __pyx_cur_scope->__pyx_v_e = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22); } __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19); __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16; goto __pyx_L13_except_error; } __pyx_L22_break: { __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_e); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_e); __pyx_cur_scope->__pyx_v_e = 0; goto __pyx_L20_except_break; } } __pyx_L20_except_break:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L16_try_break; } goto __pyx_L13_except_error; /* "borg/chunker.pyx":105 * while True: * is_data = whence == os.SEEK_HOLE # True: range with data, False: range is a hole * try: # <<<<<<<<<<<<<< * end = dseek(start, whence, fd, fh) * except OSError as e: */ __pyx_L13_except_error:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L7_error; __pyx_L16_try_break:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L10_break; __pyx_L18_try_end:; } /* "borg/chunker.pyx":118 * raise * # we do not want to yield zero-length ranges with start == end: * if end > start: # <<<<<<<<<<<<<< * yield (start, end - start, is_data) * start = end */ __pyx_t_2 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_end, __pyx_cur_scope->__pyx_v_start, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L7_error) __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 118, __pyx_L7_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_12) { /* "borg/chunker.pyx":119 * # we do not want to yield zero-length ranges with start == end: * if end > start: * yield (start, end - start, is_data) # <<<<<<<<<<<<<< * start = end * whence = os.SEEK_DATA if is_data else os.SEEK_HOLE */ __pyx_t_2 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_end, __pyx_cur_scope->__pyx_v_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_start); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_start); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_start)) __PYX_ERR(0, 119, __pyx_L7_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 119, __pyx_L7_error); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_is_data); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_is_data); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_cur_scope->__pyx_v_is_data)) __PYX_ERR(0, 119, __pyx_L7_error); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, yielding value */ __pyx_generator->resume_label = 2; return __pyx_r; __pyx_L36_resume_from_yield:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 119, __pyx_L7_error) /* "borg/chunker.pyx":118 * raise * # we do not want to yield zero-length ranges with start == end: * if end > start: # <<<<<<<<<<<<<< * yield (start, end - start, is_data) * start = end */ } /* "borg/chunker.pyx":120 * if end > start: * yield (start, end - start, is_data) * start = end # <<<<<<<<<<<<<< * whence = os.SEEK_DATA if is_data else os.SEEK_HOLE * finally: */ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_end); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_start); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_start, __pyx_cur_scope->__pyx_v_end); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_end); /* "borg/chunker.pyx":121 * yield (start, end - start, is_data) * start = end * whence = os.SEEK_DATA if is_data else os.SEEK_HOLE # <<<<<<<<<<<<<< * finally: * # seek to same position as before calling this function */ __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_data); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 121, __pyx_L7_error) if (__pyx_t_12) { __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_SEEK_DATA); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_SEEK_HOLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; } __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_whence); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_whence, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L10_break:; } /* "borg/chunker.pyx":124 * finally: * # seek to same position as before calling this function * dseek(curr, os.SEEK_SET, fd, fh) # <<<<<<<<<<<<<< * * */ /*finally:*/ { /*normal exit:*/{ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_dseek); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_SEEK_SET); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_15 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_15 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_curr, __pyx_t_11, __pyx_cur_scope->__pyx_v_fd, __pyx_cur_scope->__pyx_v_fh}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_15, 4+__pyx_t_15); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L8; } __pyx_L7_error:; /*exception exit:*/{ __Pyx_PyThreadState_assign __pyx_t_9 = 0; __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_20); __pyx_t_15 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_23 = __pyx_filename; { __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_dseek); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_os); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 124, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_SEEK_SET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 124, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; __pyx_t_24 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_24 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_11, __pyx_cur_scope->__pyx_v_curr, __pyx_t_3, __pyx_cur_scope->__pyx_v_fd, __pyx_cur_scope->__pyx_v_fh}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_24, 4+__pyx_t_24); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_21, __pyx_t_20); } __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ErrRestore(__pyx_t_9, __pyx_t_8, __pyx_t_7); __pyx_t_9 = 0; __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_lineno = __pyx_t_15; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_23; goto __pyx_L1_error; __pyx_L38_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_21, __pyx_t_20); } __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; goto __pyx_L1_error; } __pyx_L8:; } CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "borg/chunker.pyx":87 * * * def sparsemap(fd=None, fh=-1): # <<<<<<<<<<<<<< * """ * generator yielding a (start, length, is_data) tuple for each range. */ /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("sparsemap", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/chunker.pyx":147 * this is supported and not considered to be an error. * """ * def __init__(self, block_size, header_size=0, sparse=False): # <<<<<<<<<<<<<< * self.block_size = block_size * self.header_size = header_size */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_7chunker_12ChunkerFixed_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_7chunker_12ChunkerFixed_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_7chunker_12ChunkerFixed_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_7chunker_12ChunkerFixed_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_block_size = 0; PyObject *__pyx_v_header_size = 0; PyObject *__pyx_v_sparse = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_block_size,&__pyx_n_s_header_size,&__pyx_n_s_sparse,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_0))); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_block_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); __PYX_ERR(0, 147, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_header_size); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sparse); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 147, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_block_size = values[1]; __pyx_v_header_size = values[2]; __pyx_v_sparse = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 147, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.chunker.ChunkerFixed.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_7chunker_12ChunkerFixed___init__(__pyx_self, __pyx_v_self, __pyx_v_block_size, __pyx_v_header_size, __pyx_v_sparse); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_7chunker_12ChunkerFixed___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_block_size, PyObject *__pyx_v_header_size, PyObject *__pyx_v_sparse) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "borg/chunker.pyx":148 * """ * def __init__(self, block_size, header_size=0, sparse=False): * self.block_size = block_size # <<<<<<<<<<<<<< * self.header_size = header_size * # should borg try to do sparse input processing? */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_block_size, __pyx_v_block_size) < 0) __PYX_ERR(0, 148, __pyx_L1_error) /* "borg/chunker.pyx":149 * def __init__(self, block_size, header_size=0, sparse=False): * self.block_size = block_size * self.header_size = header_size # <<<<<<<<<<<<<< * # should borg try to do sparse input processing? * # whether it actually can be done depends on the input file being seekable. */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_header_size, __pyx_v_header_size) < 0) __PYX_ERR(0, 149, __pyx_L1_error) /* "borg/chunker.pyx":152 * # should borg try to do sparse input processing? * # whether it actually can be done depends on the input file being seekable. * self.try_sparse = sparse and has_seek_hole # <<<<<<<<<<<<<< * assert block_size <= len(zeros) * */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sparse); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 152, __pyx_L1_error) if (__pyx_t_2) { } else { __Pyx_INCREF(__pyx_v_sparse); __pyx_t_1 = __pyx_v_sparse; goto __pyx_L3_bool_binop_done; } __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_has_seek_hole); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_L3_bool_binop_done:; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_try_sparse, __pyx_t_1) < 0) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/chunker.pyx":153 * # whether it actually can be done depends on the input file being seekable. * self.try_sparse = sparse and has_seek_hole * assert block_size <= len(zeros) # <<<<<<<<<<<<<< * * def chunkify(self, fd=None, fh=-1, fmap=None): */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_RichCompare(__pyx_v_block_size, __pyx_t_1, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 153, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 153, __pyx_L1_error) #endif /* "borg/chunker.pyx":147 * this is supported and not considered to be an error. * """ * def __init__(self, block_size, header_size=0, sparse=False): # <<<<<<<<<<<<<< * self.block_size = block_size * self.header_size = header_size */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("borg.chunker.ChunkerFixed.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_4borg_7chunker_12ChunkerFixed_4generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "borg/chunker.pyx":155 * assert block_size <= len(zeros) * * def chunkify(self, fd=None, fh=-1, fmap=None): # <<<<<<<<<<<<<< * """ * Cut a file into chunks. */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_7chunker_12ChunkerFixed_3chunkify(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_7chunker_12ChunkerFixed_2chunkify, "\n Cut a file into chunks.\n\n :param fd: Python file object\n :param fh: OS-level file handle (if available),\n defaults to -1 which means not to use OS-level fd.\n :param fmap: a file map, same format as generated by sparsemap\n "); static PyMethodDef __pyx_mdef_4borg_7chunker_12ChunkerFixed_3chunkify = {"chunkify", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_7chunker_12ChunkerFixed_3chunkify, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_7chunker_12ChunkerFixed_2chunkify}; static PyObject *__pyx_pw_4borg_7chunker_12ChunkerFixed_3chunkify(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_fd = 0; PyObject *__pyx_v_fh = 0; PyObject *__pyx_v_fmap = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("chunkify (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_fd,&__pyx_n_s_fh,&__pyx_n_s_fmap,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_neg_1))); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 155, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fd); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 155, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fh); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 155, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fmap); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 155, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "chunkify") < 0)) __PYX_ERR(0, 155, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_fd = values[1]; __pyx_v_fh = values[2]; __pyx_v_fmap = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("chunkify", 0, 1, 4, __pyx_nargs); __PYX_ERR(0, 155, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.chunker.ChunkerFixed.chunkify", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_7chunker_12ChunkerFixed_2chunkify(__pyx_self, __pyx_v_self, __pyx_v_fd, __pyx_v_fh, __pyx_v_fmap); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_7chunker_12ChunkerFixed_2chunkify(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_fd, PyObject *__pyx_v_fh, PyObject *__pyx_v_fmap) { struct __pyx_obj_4borg_7chunker___pyx_scope_struct_1_chunkify *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("chunkify", 0); __pyx_cur_scope = (struct __pyx_obj_4borg_7chunker___pyx_scope_struct_1_chunkify *)__pyx_tp_new_4borg_7chunker___pyx_scope_struct_1_chunkify(__pyx_ptype_4borg_7chunker___pyx_scope_struct_1_chunkify, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_4borg_7chunker___pyx_scope_struct_1_chunkify *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 155, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); __pyx_cur_scope->__pyx_v_fd = __pyx_v_fd; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_fd); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_fd); __pyx_cur_scope->__pyx_v_fh = __pyx_v_fh; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_fh); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_fh); __pyx_cur_scope->__pyx_v_fmap = __pyx_v_fmap; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_fmap); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_fmap); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4borg_7chunker_12ChunkerFixed_4generator1, __pyx_codeobj__2, (PyObject *) __pyx_cur_scope, __pyx_n_s_chunkify, __pyx_n_s_ChunkerFixed_chunkify, __pyx_n_s_borg_chunker); if (unlikely(!gen)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.chunker.ChunkerFixed.chunkify", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_4borg_7chunker_12ChunkerFixed_4generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_4borg_7chunker___pyx_scope_struct_1_chunkify *__pyx_cur_scope = ((struct __pyx_obj_4borg_7chunker___pyx_scope_struct_1_chunkify *)__pyx_generator->closure); PyObject *__pyx_r = NULL; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; Py_ssize_t __pyx_t_11; PyObject *(*__pyx_t_12)(PyObject *); PyObject *__pyx_t_13 = NULL; PyObject *(*__pyx_t_14)(PyObject *); Py_ssize_t __pyx_t_15; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("chunkify", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L32_resume_from_yield; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 155, __pyx_L1_error) /* "borg/chunker.pyx":164 * :param fmap: a file map, same format as generated by sparsemap * """ * if fmap is None: # <<<<<<<<<<<<<< * if self.try_sparse: * try: */ __pyx_t_1 = (__pyx_cur_scope->__pyx_v_fmap == Py_None); if (__pyx_t_1) { /* "borg/chunker.pyx":165 * """ * if fmap is None: * if self.try_sparse: # <<<<<<<<<<<<<< * try: * if self.header_size > 0: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_try_sparse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* "borg/chunker.pyx":166 * if fmap is None: * if self.try_sparse: * try: # <<<<<<<<<<<<<< * if self.header_size > 0: * header_map = [(0, self.header_size, True), ] */ { __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); /*try:*/ { /* "borg/chunker.pyx":167 * if self.try_sparse: * try: * if self.header_size > 0: # <<<<<<<<<<<<<< * header_map = [(0, self.header_size, True), ] * dseek(self.header_size, os.SEEK_SET, fd, fh) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_header_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 167, __pyx_L6_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 167, __pyx_L6_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_1) { /* "borg/chunker.pyx":168 * try: * if self.header_size > 0: * header_map = [(0, self.header_size, True), ] # <<<<<<<<<<<<<< * dseek(self.header_size, os.SEEK_SET, fd, fh) * body_map = list(sparsemap(fd, fh)) */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_header_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 168, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_0)) __PYX_ERR(0, 168, __pyx_L6_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6)) __PYX_ERR(0, 168, __pyx_L6_error); __Pyx_INCREF(Py_True); __Pyx_GIVEREF(Py_True); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, Py_True)) __PYX_ERR(0, 168, __pyx_L6_error); __pyx_t_6 = 0; __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 168, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_2)) __PYX_ERR(0, 168, __pyx_L6_error); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_v_header_map = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; /* "borg/chunker.pyx":169 * if self.header_size > 0: * header_map = [(0, self.header_size, True), ] * dseek(self.header_size, os.SEEK_SET, fd, fh) # <<<<<<<<<<<<<< * body_map = list(sparsemap(fd, fh)) * dseek(0, os.SEEK_SET, fd, fh) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_dseek); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_header_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 169, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_os); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 169, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_SEEK_SET); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 169, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_8, __pyx_t_7, __pyx_t_9, __pyx_cur_scope->__pyx_v_fd, __pyx_cur_scope->__pyx_v_fh}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_10, 4+__pyx_t_10); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 169, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "borg/chunker.pyx":170 * header_map = [(0, self.header_size, True), ] * dseek(self.header_size, os.SEEK_SET, fd, fh) * body_map = list(sparsemap(fd, fh)) # <<<<<<<<<<<<<< * dseek(0, os.SEEK_SET, fd, fh) * else: */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sparsemap); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_cur_scope->__pyx_v_fd, __pyx_cur_scope->__pyx_v_fh}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_10, 2+__pyx_t_10); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 170, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_2 = __Pyx_PySequence_ListKeepNew(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_body_map = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "borg/chunker.pyx":171 * dseek(self.header_size, os.SEEK_SET, fd, fh) * body_map = list(sparsemap(fd, fh)) * dseek(0, os.SEEK_SET, fd, fh) # <<<<<<<<<<<<<< * else: * header_map = [] */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_dseek); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 171, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_os); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 171, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_SEEK_SET); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 171, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_9, __pyx_int_0, __pyx_t_7, __pyx_cur_scope->__pyx_v_fd, __pyx_cur_scope->__pyx_v_fh}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_10, 4+__pyx_t_10); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/chunker.pyx":167 * if self.try_sparse: * try: * if self.header_size > 0: # <<<<<<<<<<<<<< * header_map = [(0, self.header_size, True), ] * dseek(self.header_size, os.SEEK_SET, fd, fh) */ goto __pyx_L12; } /* "borg/chunker.pyx":173 * dseek(0, os.SEEK_SET, fd, fh) * else: * header_map = [] # <<<<<<<<<<<<<< * body_map = list(sparsemap(fd, fh)) * except OSError as err: */ /*else*/ { __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 173, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_header_map = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "borg/chunker.pyx":174 * else: * header_map = [] * body_map = list(sparsemap(fd, fh)) # <<<<<<<<<<<<<< * except OSError as err: * # seeking did not work */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_sparsemap); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 174, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_cur_scope->__pyx_v_fd, __pyx_cur_scope->__pyx_v_fh}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_10, 2+__pyx_t_10); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_6 = __Pyx_PySequence_ListKeepNew(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 174, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_v_body_map = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; } __pyx_L12:; /* "borg/chunker.pyx":166 * if fmap is None: * if self.try_sparse: * try: # <<<<<<<<<<<<<< * if self.header_size > 0: * header_map = [(0, self.header_size, True), ] */ } /* "borg/chunker.pyx":179 * pass * else: * fmap = header_map + body_map # <<<<<<<<<<<<<< * * if fmap is None: */ /*else:*/ { __pyx_t_6 = PyNumber_Add(__pyx_cur_scope->__pyx_v_header_map, __pyx_cur_scope->__pyx_v_body_map); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 179, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_fmap); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_fmap, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L11_try_end; __pyx_L6_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; /* "borg/chunker.pyx":175 * header_map = [] * body_map = list(sparsemap(fd, fh)) * except OSError as err: # <<<<<<<<<<<<<< * # seeking did not work * pass */ __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_OSError); if (__pyx_t_10) { __Pyx_AddTraceback("borg.chunker.ChunkerFixed.chunkify", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_2, &__pyx_t_7) < 0) __PYX_ERR(0, 175, __pyx_L8_except_error) __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_err = __pyx_t_2; /*try:*/ { } /*finally:*/ { /*normal exit:*/{ __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_err); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_err); __pyx_cur_scope->__pyx_v_err = 0; goto __pyx_L19; } __pyx_L19:; } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L7_exception_handled; } goto __pyx_L8_except_error; /* "borg/chunker.pyx":166 * if fmap is None: * if self.try_sparse: * try: # <<<<<<<<<<<<<< * if self.header_size > 0: * header_map = [(0, self.header_size, True), ] */ __pyx_L8_except_error:; __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L1_error; __pyx_L7_exception_handled:; __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); __pyx_L11_try_end:; } /* "borg/chunker.pyx":165 * """ * if fmap is None: * if self.try_sparse: # <<<<<<<<<<<<<< * try: * if self.header_size > 0: */ } /* "borg/chunker.pyx":181 * fmap = header_map + body_map * * if fmap is None: # <<<<<<<<<<<<<< * # either sparse processing (building the fmap) was not tried or it failed. * # in these cases, we just build a "fake fmap" that considers the whole file */ __pyx_t_1 = (__pyx_cur_scope->__pyx_v_fmap == Py_None); if (__pyx_t_1) { /* "borg/chunker.pyx":187 * # we build different fmaps here for the purpose of correct block alignment * # with or without a header block (of potentially different size). * if self.header_size > 0: # <<<<<<<<<<<<<< * header_map = [(0, self.header_size, True), ] * body_map = [(self.header_size, 2 ** 62, True), ] */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_header_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_2 = PyObject_RichCompare(__pyx_t_7, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* "borg/chunker.pyx":188 * # with or without a header block (of potentially different size). * if self.header_size > 0: * header_map = [(0, self.header_size, True), ] # <<<<<<<<<<<<<< * body_map = [(self.header_size, 2 ** 62, True), ] * else: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_header_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_int_0)) __PYX_ERR(0, 188, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error); __Pyx_INCREF(Py_True); __Pyx_GIVEREF(Py_True); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, Py_True)) __PYX_ERR(0, 188, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_7)) __PYX_ERR(0, 188, __pyx_L1_error); __pyx_t_7 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_header_map); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_header_map, ((PyObject*)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/chunker.pyx":189 * if self.header_size > 0: * header_map = [(0, self.header_size, True), ] * body_map = [(self.header_size, 2 ** 62, True), ] # <<<<<<<<<<<<<< * else: * header_map = [] */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_header_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error); __Pyx_INCREF(__pyx_int_0x4000000000000000); __Pyx_GIVEREF(__pyx_int_0x4000000000000000); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_0x4000000000000000)) __PYX_ERR(0, 189, __pyx_L1_error); __Pyx_INCREF(Py_True); __Pyx_GIVEREF(Py_True); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, Py_True)) __PYX_ERR(0, 189, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_7)) __PYX_ERR(0, 189, __pyx_L1_error); __pyx_t_7 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_body_map); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_body_map, ((PyObject*)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/chunker.pyx":187 * # we build different fmaps here for the purpose of correct block alignment * # with or without a header block (of potentially different size). * if self.header_size > 0: # <<<<<<<<<<<<<< * header_map = [(0, self.header_size, True), ] * body_map = [(self.header_size, 2 ** 62, True), ] */ goto __pyx_L21; } /* "borg/chunker.pyx":191 * body_map = [(self.header_size, 2 ** 62, True), ] * else: * header_map = [] # <<<<<<<<<<<<<< * body_map = [(0, 2 ** 62, True), ] * fmap = header_map + body_map */ /*else*/ { __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_header_map); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_header_map, ((PyObject*)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/chunker.pyx":192 * else: * header_map = [] * body_map = [(0, 2 ** 62, True), ] # <<<<<<<<<<<<<< * fmap = header_map + body_map * */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_tuple__3)) __PYX_ERR(0, 192, __pyx_L1_error); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_body_map); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_body_map, ((PyObject*)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L21:; /* "borg/chunker.pyx":193 * header_map = [] * body_map = [(0, 2 ** 62, True), ] * fmap = header_map + body_map # <<<<<<<<<<<<<< * * offset = 0 */ __pyx_t_2 = PyNumber_Add(__pyx_cur_scope->__pyx_v_header_map, __pyx_cur_scope->__pyx_v_body_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_fmap); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_fmap, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/chunker.pyx":181 * fmap = header_map + body_map * * if fmap is None: # <<<<<<<<<<<<<< * # either sparse processing (building the fmap) was not tried or it failed. * # in these cases, we just build a "fake fmap" that considers the whole file */ } /* "borg/chunker.pyx":164 * :param fmap: a file map, same format as generated by sparsemap * """ * if fmap is None: # <<<<<<<<<<<<<< * if self.try_sparse: * try: */ } /* "borg/chunker.pyx":195 * fmap = header_map + body_map * * offset = 0 # <<<<<<<<<<<<<< * for range_start, range_size, is_data in fmap: * if range_start != offset: */ __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); __pyx_cur_scope->__pyx_v_offset = __pyx_int_0; /* "borg/chunker.pyx":196 * * offset = 0 * for range_start, range_size, is_data in fmap: # <<<<<<<<<<<<<< * if range_start != offset: * # this is for the case when the fmap does not cover the file completely, */ if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_fmap)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_fmap)) { __pyx_t_2 = __pyx_cur_scope->__pyx_v_fmap; __Pyx_INCREF(__pyx_t_2); __pyx_t_11 = 0; __pyx_t_12 = NULL; } else { __pyx_t_11 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_fmap); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 196, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_12)) { if (likely(PyList_CheckExact(__pyx_t_2))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 196, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_11); __Pyx_INCREF(__pyx_t_7); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 196, __pyx_L1_error) #else __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 196, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_11); __Pyx_INCREF(__pyx_t_7); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 196, __pyx_L1_error) #else __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } } else { __pyx_t_7 = __pyx_t_12(__pyx_t_2); if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 196, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_7); } if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) { PyObject* sequence = __pyx_t_7; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 196, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_9 = PyList_GET_ITEM(sequence, 1); __pyx_t_8 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_8); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { Py_ssize_t index = -1; __pyx_t_13 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_13); index = 0; __pyx_t_6 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_6)) goto __pyx_L24_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_9 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_9)) goto __pyx_L24_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); index = 2; __pyx_t_8 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_8)) goto __pyx_L24_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 3) < 0) __PYX_ERR(0, 196, __pyx_L1_error) __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L25_unpacking_done; __pyx_L24_unpacking_failed:; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_14 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 196, __pyx_L1_error) __pyx_L25_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_range_start); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_range_start, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_range_size); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_range_size, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_is_data); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_is_data, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = 0; /* "borg/chunker.pyx":197 * offset = 0 * for range_start, range_size, is_data in fmap: * if range_start != offset: # <<<<<<<<<<<<<< * # this is for the case when the fmap does not cover the file completely, * # e.g. it could be without the ranges of holes or of unchanged data. */ __pyx_t_7 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_range_start, __pyx_cur_scope->__pyx_v_offset, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 197, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_1) { /* "borg/chunker.pyx":200 * # this is for the case when the fmap does not cover the file completely, * # e.g. it could be without the ranges of holes or of unchanged data. * offset = range_start # <<<<<<<<<<<<<< * dseek(offset, os.SEEK_SET, fd, fh) * while range_size: */ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_range_start); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_offset); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_offset, __pyx_cur_scope->__pyx_v_range_start); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_range_start); /* "borg/chunker.pyx":201 * # e.g. it could be without the ranges of holes or of unchanged data. * offset = range_start * dseek(offset, os.SEEK_SET, fd, fh) # <<<<<<<<<<<<<< * while range_size: * wanted = min(range_size, self.block_size) */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_dseek); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_os); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_SEEK_SET); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_9, __pyx_cur_scope->__pyx_v_offset, __pyx_t_6, __pyx_cur_scope->__pyx_v_fd, __pyx_cur_scope->__pyx_v_fh}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 4+__pyx_t_10); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/chunker.pyx":197 * offset = 0 * for range_start, range_size, is_data in fmap: * if range_start != offset: # <<<<<<<<<<<<<< * # this is for the case when the fmap does not cover the file completely, * # e.g. it could be without the ranges of holes or of unchanged data. */ } /* "borg/chunker.pyx":202 * offset = range_start * dseek(offset, os.SEEK_SET, fd, fh) * while range_size: # <<<<<<<<<<<<<< * wanted = min(range_size, self.block_size) * if is_data: */ while (1) { __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_range_size); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 202, __pyx_L1_error) if (!__pyx_t_1) break; /* "borg/chunker.pyx":203 * dseek(offset, os.SEEK_SET, fd, fh) * while range_size: * wanted = min(range_size, self.block_size) # <<<<<<<<<<<<<< * if is_data: * # read block from the range */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_block_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_range_size); __pyx_t_8 = __pyx_cur_scope->__pyx_v_range_size; __pyx_t_9 = PyObject_RichCompare(__pyx_t_7, __pyx_t_8, Py_LT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 203, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_1) { __Pyx_INCREF(__pyx_t_7); __pyx_t_6 = __pyx_t_7; } else { __Pyx_INCREF(__pyx_t_8); __pyx_t_6 = __pyx_t_8; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __pyx_t_6; __Pyx_INCREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_wanted); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_wanted, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/chunker.pyx":204 * while range_size: * wanted = min(range_size, self.block_size) * if is_data: # <<<<<<<<<<<<<< * # read block from the range * data = dread(offset, wanted, fd, fh) */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_data); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 204, __pyx_L1_error) if (__pyx_t_1) { /* "borg/chunker.pyx":206 * if is_data: * # read block from the range * data = dread(offset, wanted, fd, fh) # <<<<<<<<<<<<<< * got = len(data) * if zeros.startswith(data): */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_dread); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_8, __pyx_cur_scope->__pyx_v_offset, __pyx_cur_scope->__pyx_v_wanted, __pyx_cur_scope->__pyx_v_fd, __pyx_cur_scope->__pyx_v_fh}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_10, 4+__pyx_t_10); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_data); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_data, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/chunker.pyx":207 * # read block from the range * data = dread(offset, wanted, fd, fh) * got = len(data) # <<<<<<<<<<<<<< * if zeros.startswith(data): * data = None */ __pyx_t_15 = PyObject_Length(__pyx_cur_scope->__pyx_v_data); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 207, __pyx_L1_error) __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_15); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_got); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_got, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/chunker.pyx":208 * data = dread(offset, wanted, fd, fh) * got = len(data) * if zeros.startswith(data): # <<<<<<<<<<<<<< * data = None * allocation = CH_ALLOC */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_startswith); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_cur_scope->__pyx_v_data}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_1) { /* "borg/chunker.pyx":209 * got = len(data) * if zeros.startswith(data): * data = None # <<<<<<<<<<<<<< * allocation = CH_ALLOC * else: */ __Pyx_INCREF(Py_None); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_data); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_data, Py_None); __Pyx_GIVEREF(Py_None); /* "borg/chunker.pyx":210 * if zeros.startswith(data): * data = None * allocation = CH_ALLOC # <<<<<<<<<<<<<< * else: * allocation = CH_DATA */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_CH_ALLOC); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_allocation); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_allocation, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/chunker.pyx":208 * data = dread(offset, wanted, fd, fh) * got = len(data) * if zeros.startswith(data): # <<<<<<<<<<<<<< * data = None * allocation = CH_ALLOC */ goto __pyx_L30; } /* "borg/chunker.pyx":212 * allocation = CH_ALLOC * else: * allocation = CH_DATA # <<<<<<<<<<<<<< * else: # hole * # seek over block from the range */ /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_CH_DATA); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_allocation); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_allocation, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_L30:; /* "borg/chunker.pyx":204 * while range_size: * wanted = min(range_size, self.block_size) * if is_data: # <<<<<<<<<<<<<< * # read block from the range * data = dread(offset, wanted, fd, fh) */ goto __pyx_L29; } /* "borg/chunker.pyx":215 * else: # hole * # seek over block from the range * pos = dseek(wanted, os.SEEK_CUR, fd, fh) # <<<<<<<<<<<<<< * got = pos - offset * data = None */ /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_dseek); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_SEEK_CUR); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_6, __pyx_cur_scope->__pyx_v_wanted, __pyx_t_9, __pyx_cur_scope->__pyx_v_fd, __pyx_cur_scope->__pyx_v_fh}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 4+__pyx_t_10); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_pos); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_pos, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/chunker.pyx":216 * # seek over block from the range * pos = dseek(wanted, os.SEEK_CUR, fd, fh) * got = pos - offset # <<<<<<<<<<<<<< * data = None * allocation = CH_HOLE */ __pyx_t_7 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_pos, __pyx_cur_scope->__pyx_v_offset); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_got); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_got, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/chunker.pyx":217 * pos = dseek(wanted, os.SEEK_CUR, fd, fh) * got = pos - offset * data = None # <<<<<<<<<<<<<< * allocation = CH_HOLE * if got > 0: */ __Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_data); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_data, Py_None); __Pyx_GIVEREF(Py_None); /* "borg/chunker.pyx":218 * got = pos - offset * data = None * allocation = CH_HOLE # <<<<<<<<<<<<<< * if got > 0: * offset += got */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_CH_HOLE); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_allocation); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_allocation, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_L29:; /* "borg/chunker.pyx":219 * data = None * allocation = CH_HOLE * if got > 0: # <<<<<<<<<<<<<< * offset += got * range_size -= got */ __pyx_t_7 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_got, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 219, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_1) { /* "borg/chunker.pyx":220 * allocation = CH_HOLE * if got > 0: * offset += got # <<<<<<<<<<<<<< * range_size -= got * yield Chunk(data, size=got, allocation=allocation) */ __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_offset, __pyx_cur_scope->__pyx_v_got); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_offset); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_offset, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/chunker.pyx":221 * if got > 0: * offset += got * range_size -= got # <<<<<<<<<<<<<< * yield Chunk(data, size=got, allocation=allocation) * if got < wanted: */ __pyx_t_7 = PyNumber_InPlaceSubtract(__pyx_cur_scope->__pyx_v_range_size, __pyx_cur_scope->__pyx_v_got); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_range_size); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_range_size, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/chunker.pyx":222 * offset += got * range_size -= got * yield Chunk(data, size=got, allocation=allocation) # <<<<<<<<<<<<<< * if got < wanted: * # we did not get enough data, looks like EOF. */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Chunk_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_data); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_data); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_data)) __PYX_ERR(0, 222, __pyx_L1_error); __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_size, __pyx_cur_scope->__pyx_v_got) < 0) __PYX_ERR(0, 222, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_allocation, __pyx_cur_scope->__pyx_v_allocation) < 0) __PYX_ERR(0, 222, __pyx_L1_error) __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; __Pyx_XGIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_t_0 = __pyx_t_2; __pyx_cur_scope->__pyx_t_1 = __pyx_t_11; __pyx_cur_scope->__pyx_t_2 = __pyx_t_12; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, yielding value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L32_resume_from_yield:; __pyx_t_2 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_2); __pyx_t_11 = __pyx_cur_scope->__pyx_t_1; __pyx_t_12 = __pyx_cur_scope->__pyx_t_2; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 222, __pyx_L1_error) /* "borg/chunker.pyx":219 * data = None * allocation = CH_HOLE * if got > 0: # <<<<<<<<<<<<<< * offset += got * range_size -= got */ } /* "borg/chunker.pyx":223 * range_size -= got * yield Chunk(data, size=got, allocation=allocation) * if got < wanted: # <<<<<<<<<<<<<< * # we did not get enough data, looks like EOF. * return */ __pyx_t_6 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_got, __pyx_cur_scope->__pyx_v_wanted, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 223, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_1) { /* "borg/chunker.pyx":225 * if got < wanted: * # we did not get enough data, looks like EOF. * return # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_r = NULL; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; /* "borg/chunker.pyx":223 * range_size -= got * yield Chunk(data, size=got, allocation=allocation) * if got < wanted: # <<<<<<<<<<<<<< * # we did not get enough data, looks like EOF. * return */ } } /* "borg/chunker.pyx":196 * * offset = 0 * for range_start, range_size, is_data in fmap: # <<<<<<<<<<<<<< * if range_start != offset: * # this is for the case when the fmap does not cover the file completely, */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "borg/chunker.pyx":155 * assert block_size <= len(zeros) * * def chunkify(self, fd=None, fh=-1, fmap=None): # <<<<<<<<<<<<<< * """ * Cut a file into chunks. */ /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_13); __Pyx_AddTraceback("chunkify", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/chunker.pyx":242 * cdef _Chunker *chunker * * def __cinit__(self, int seed, int chunk_min_exp, int chunk_max_exp, int hash_mask_bits, int hash_window_size): # <<<<<<<<<<<<<< * min_size = 1 << chunk_min_exp * max_size = 1 << chunk_max_exp */ /* Python wrapper */ static int __pyx_pw_4borg_7chunker_7Chunker_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_4borg_7chunker_7Chunker_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_seed; int __pyx_v_chunk_min_exp; int __pyx_v_chunk_max_exp; int __pyx_v_hash_mask_bits; int __pyx_v_hash_window_size; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_seed,&__pyx_n_s_chunk_min_exp,&__pyx_n_s_chunk_max_exp,&__pyx_n_s_hash_mask_bits,&__pyx_n_s_hash_window_size,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_seed)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 242, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_chunk_min_exp)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 242, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 1); __PYX_ERR(0, 242, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_chunk_max_exp)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 242, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 2); __PYX_ERR(0, 242, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hash_mask_bits)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 242, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 3); __PYX_ERR(0, 242, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hash_window_size)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 242, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 4); __PYX_ERR(0, 242, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(0, 242, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4); } __pyx_v_seed = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_seed == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 242, __pyx_L3_error) __pyx_v_chunk_min_exp = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_chunk_min_exp == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 242, __pyx_L3_error) __pyx_v_chunk_max_exp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_chunk_max_exp == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 242, __pyx_L3_error) __pyx_v_hash_mask_bits = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_hash_mask_bits == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 242, __pyx_L3_error) __pyx_v_hash_window_size = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_hash_window_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 242, __pyx_L3_error) } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 242, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.chunker.Chunker.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_7chunker_7Chunker___cinit__(((struct __pyx_obj_4borg_7chunker_Chunker *)__pyx_v_self), __pyx_v_seed, __pyx_v_chunk_min_exp, __pyx_v_chunk_max_exp, __pyx_v_hash_mask_bits, __pyx_v_hash_window_size); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_4borg_7chunker_7Chunker___cinit__(struct __pyx_obj_4borg_7chunker_Chunker *__pyx_v_self, int __pyx_v_seed, int __pyx_v_chunk_min_exp, int __pyx_v_chunk_max_exp, int __pyx_v_hash_mask_bits, int __pyx_v_hash_window_size) { PyObject *__pyx_v_min_size = NULL; long __pyx_v_max_size; long __pyx_v_hash_mask; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; uint32_t __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 1); /* "borg/chunker.pyx":243 * * def __cinit__(self, int seed, int chunk_min_exp, int chunk_max_exp, int hash_mask_bits, int hash_window_size): * min_size = 1 << chunk_min_exp # <<<<<<<<<<<<<< * max_size = 1 << chunk_max_exp * assert max_size <= len(zeros) */ __pyx_t_1 = __Pyx_PyInt_From_long((1 << __pyx_v_chunk_min_exp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_min_size = __pyx_t_1; __pyx_t_1 = 0; /* "borg/chunker.pyx":244 * def __cinit__(self, int seed, int chunk_min_exp, int chunk_max_exp, int hash_mask_bits, int hash_window_size): * min_size = 1 << chunk_min_exp * max_size = 1 << chunk_max_exp # <<<<<<<<<<<<<< * assert max_size <= len(zeros) * # see chunker_process, first while loop condition, first term must be able to get True: */ __pyx_v_max_size = (1 << __pyx_v_chunk_max_exp); /* "borg/chunker.pyx":245 * min_size = 1 << chunk_min_exp * max_size = 1 << chunk_max_exp * assert max_size <= len(zeros) # <<<<<<<<<<<<<< * # see chunker_process, first while loop condition, first term must be able to get True: * assert hash_window_size + min_size + 1 <= max_size, "too small max_size" */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_v_max_size <= __pyx_t_2); if (unlikely(!__pyx_t_3)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 245, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 245, __pyx_L1_error) #endif /* "borg/chunker.pyx":247 * assert max_size <= len(zeros) * # see chunker_process, first while loop condition, first term must be able to get True: * assert hash_window_size + min_size + 1 <= max_size, "too small max_size" # <<<<<<<<<<<<<< * hash_mask = (1 << hash_mask_bits) - 1 * self.chunker = chunker_init(hash_window_size, hash_mask, min_size, max_size, seed & 0xffffffff) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_hash_window_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_v_min_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_v_max_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) { __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_kp_s_too_small_max_size, 0, 0); __PYX_ERR(0, 247, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 247, __pyx_L1_error) #endif /* "borg/chunker.pyx":248 * # see chunker_process, first while loop condition, first term must be able to get True: * assert hash_window_size + min_size + 1 <= max_size, "too small max_size" * hash_mask = (1 << hash_mask_bits) - 1 # <<<<<<<<<<<<<< * self.chunker = chunker_init(hash_window_size, hash_mask, min_size, max_size, seed & 0xffffffff) * */ __pyx_v_hash_mask = ((1 << __pyx_v_hash_mask_bits) - 1); /* "borg/chunker.pyx":249 * assert hash_window_size + min_size + 1 <= max_size, "too small max_size" * hash_mask = (1 << hash_mask_bits) - 1 * self.chunker = chunker_init(hash_window_size, hash_mask, min_size, max_size, seed & 0xffffffff) # <<<<<<<<<<<<<< * * def chunkify(self, fd, fh=-1): */ __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_min_size); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 249, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_seed); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyNumber_And(__pyx_t_5, __pyx_int_4294967295); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_7 = __Pyx_PyInt_As_uint32_t(__pyx_t_4); if (unlikely((__pyx_t_7 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_self->chunker = chunker_init(__pyx_v_hash_window_size, __pyx_v_hash_mask, __pyx_t_6, __pyx_v_max_size, __pyx_t_7); /* "borg/chunker.pyx":242 * cdef _Chunker *chunker * * def __cinit__(self, int seed, int chunk_min_exp, int chunk_max_exp, int hash_mask_bits, int hash_window_size): # <<<<<<<<<<<<<< * min_size = 1 << chunk_min_exp * max_size = 1 << chunk_max_exp */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("borg.chunker.Chunker.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_min_size); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/chunker.pyx":251 * self.chunker = chunker_init(hash_window_size, hash_mask, min_size, max_size, seed & 0xffffffff) * * def chunkify(self, fd, fh=-1): # <<<<<<<<<<<<<< * """ * Cut a file into chunks. */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_7chunker_7Chunker_3chunkify(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_7chunker_7Chunker_2chunkify, "\n Cut a file into chunks.\n\n :param fd: Python file object\n :param fh: OS-level file handle (if available),\n defaults to -1 which means not to use OS-level fd.\n "); static PyMethodDef __pyx_mdef_4borg_7chunker_7Chunker_3chunkify = {"chunkify", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_7chunker_7Chunker_3chunkify, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_7chunker_7Chunker_2chunkify}; static PyObject *__pyx_pw_4borg_7chunker_7Chunker_3chunkify(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_fd = 0; PyObject *__pyx_v_fh = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("chunkify (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fd,&__pyx_n_s_fh,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_neg_1)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fd)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 251, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fh); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 251, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "chunkify") < 0)) __PYX_ERR(0, 251, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_fd = values[0]; __pyx_v_fh = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("chunkify", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 251, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.chunker.Chunker.chunkify", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_7chunker_7Chunker_2chunkify(((struct __pyx_obj_4borg_7chunker_Chunker *)__pyx_v_self), __pyx_v_fd, __pyx_v_fh); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_7chunker_7Chunker_2chunkify(struct __pyx_obj_4borg_7chunker_Chunker *__pyx_v_self, PyObject *__pyx_v_fd, PyObject *__pyx_v_fh) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("chunkify", 1); /* "borg/chunker.pyx":259 * defaults to -1 which means not to use OS-level fd. * """ * chunker_set_fd(self.chunker, fd, fh) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_fh); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 259, __pyx_L1_error) chunker_set_fd(__pyx_v_self->chunker, __pyx_v_fd, __pyx_t_1); /* "borg/chunker.pyx":260 * """ * chunker_set_fd(self.chunker, fd, fh) * return self # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "borg/chunker.pyx":251 * self.chunker = chunker_init(hash_window_size, hash_mask, min_size, max_size, seed & 0xffffffff) * * def chunkify(self, fd, fh=-1): # <<<<<<<<<<<<<< * """ * Cut a file into chunks. */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.chunker.Chunker.chunkify", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/chunker.pyx":262 * return self * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.chunker: * chunker_free(self.chunker) */ /* Python wrapper */ static void __pyx_pw_4borg_7chunker_7Chunker_5__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_4borg_7chunker_7Chunker_5__dealloc__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_4borg_7chunker_7Chunker_4__dealloc__(((struct __pyx_obj_4borg_7chunker_Chunker *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_4borg_7chunker_7Chunker_4__dealloc__(struct __pyx_obj_4borg_7chunker_Chunker *__pyx_v_self) { int __pyx_t_1; /* "borg/chunker.pyx":263 * * def __dealloc__(self): * if self.chunker: # <<<<<<<<<<<<<< * chunker_free(self.chunker) * */ __pyx_t_1 = (__pyx_v_self->chunker != 0); if (__pyx_t_1) { /* "borg/chunker.pyx":264 * def __dealloc__(self): * if self.chunker: * chunker_free(self.chunker) # <<<<<<<<<<<<<< * * def __iter__(self): */ chunker_free(__pyx_v_self->chunker); /* "borg/chunker.pyx":263 * * def __dealloc__(self): * if self.chunker: # <<<<<<<<<<<<<< * chunker_free(self.chunker) * */ } /* "borg/chunker.pyx":262 * return self * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.chunker: * chunker_free(self.chunker) */ /* function exit code */ } /* "borg/chunker.pyx":266 * chunker_free(self.chunker) * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_7chunker_7Chunker_7__iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4borg_7chunker_7Chunker_7__iter__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_4borg_7chunker_7Chunker_6__iter__(((struct __pyx_obj_4borg_7chunker_Chunker *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_7chunker_7Chunker_6__iter__(struct __pyx_obj_4borg_7chunker_Chunker *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__", 1); /* "borg/chunker.pyx":267 * * def __iter__(self): * return self # <<<<<<<<<<<<<< * * def __next__(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "borg/chunker.pyx":266 * chunker_free(self.chunker) * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/chunker.pyx":269 * return self * * def __next__(self): # <<<<<<<<<<<<<< * data = chunker_process(self.chunker) * got = len(data) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_7chunker_7Chunker_9__next__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4borg_7chunker_7Chunker_9__next__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_4borg_7chunker_7Chunker_8__next__(((struct __pyx_obj_4borg_7chunker_Chunker *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_7chunker_7Chunker_8__next__(struct __pyx_obj_4borg_7chunker_Chunker *__pyx_v_self) { PyObject *__pyx_v_data = NULL; Py_ssize_t __pyx_v_got; PyObject *__pyx_v_allocation = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__next__", 1); /* "borg/chunker.pyx":270 * * def __next__(self): * data = chunker_process(self.chunker) # <<<<<<<<<<<<<< * got = len(data) * # we do not have SEEK_DATA/SEEK_HOLE support in chunker_process C code, */ __pyx_t_1 = chunker_process(__pyx_v_self->chunker); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_data = __pyx_t_1; __pyx_t_1 = 0; /* "borg/chunker.pyx":271 * def __next__(self): * data = chunker_process(self.chunker) * got = len(data) # <<<<<<<<<<<<<< * # we do not have SEEK_DATA/SEEK_HOLE support in chunker_process C code, * # but we can just check if data was all-zero (and either came from a hole */ __pyx_t_2 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 271, __pyx_L1_error) __pyx_v_got = __pyx_t_2; /* "borg/chunker.pyx":275 * # but we can just check if data was all-zero (and either came from a hole * # or from stored zeros - we can not detect that here). * if zeros.startswith(data): # <<<<<<<<<<<<<< * data = None * allocation = CH_ALLOC */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_startswith); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_data}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { /* "borg/chunker.pyx":276 * # or from stored zeros - we can not detect that here). * if zeros.startswith(data): * data = None # <<<<<<<<<<<<<< * allocation = CH_ALLOC * else: */ __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_data, Py_None); /* "borg/chunker.pyx":277 * if zeros.startswith(data): * data = None * allocation = CH_ALLOC # <<<<<<<<<<<<<< * else: * allocation = CH_DATA */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_CH_ALLOC); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_allocation = __pyx_t_1; __pyx_t_1 = 0; /* "borg/chunker.pyx":275 * # but we can just check if data was all-zero (and either came from a hole * # or from stored zeros - we can not detect that here). * if zeros.startswith(data): # <<<<<<<<<<<<<< * data = None * allocation = CH_ALLOC */ goto __pyx_L3; } /* "borg/chunker.pyx":279 * allocation = CH_ALLOC * else: * allocation = CH_DATA # <<<<<<<<<<<<<< * return Chunk(data, size=got, allocation=allocation) * */ /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_CH_DATA); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_allocation = __pyx_t_1; __pyx_t_1 = 0; } __pyx_L3:; /* "borg/chunker.pyx":280 * else: * allocation = CH_DATA * return Chunk(data, size=got, allocation=allocation) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Chunk_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_data); __Pyx_GIVEREF(__pyx_v_data); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_data)) __PYX_ERR(0, 280, __pyx_L1_error); __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_got); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_size, __pyx_t_7) < 0) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocation, __pyx_v_allocation) < 0) __PYX_ERR(0, 280, __pyx_L1_error) __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; /* "borg/chunker.pyx":269 * return self * * def __next__(self): # <<<<<<<<<<<<<< * data = chunker_process(self.chunker) * got = len(data) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("borg.chunker.Chunker.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_data); __Pyx_XDECREF(__pyx_v_allocation); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_7chunker_7Chunker_11__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_7chunker_7Chunker_11__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_7chunker_7Chunker_11__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_7chunker_7Chunker_11__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_4borg_7chunker_7Chunker_10__reduce_cython__(((struct __pyx_obj_4borg_7chunker_Chunker *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_7chunker_7Chunker_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_7chunker_Chunker *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.chunker.Chunker.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_7chunker_7Chunker_13__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_7chunker_7Chunker_13__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_7chunker_7Chunker_13__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_7chunker_7Chunker_13__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.chunker.Chunker.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_7chunker_7Chunker_12__setstate_cython__(((struct __pyx_obj_4borg_7chunker_Chunker *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_7chunker_7Chunker_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_7chunker_Chunker *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.chunker.Chunker.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/chunker.pyx":283 * * * def get_chunker(algo, *params, **kw): # <<<<<<<<<<<<<< * if algo == 'buzhash': * seed = kw['seed'] */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_7chunker_12get_chunker(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_7chunker_12get_chunker = {"get_chunker", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_7chunker_12get_chunker, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_7chunker_12get_chunker(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_algo = 0; PyObject *__pyx_v_params = 0; PyObject *__pyx_v_kw = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_chunker (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL; __Pyx_GOTREF(__pyx_v_kw); __pyx_v_params = __Pyx_ArgsSlice_FASTCALL(__pyx_args, 1, __pyx_nargs); if (unlikely(!__pyx_v_params)) { __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0; __Pyx_RefNannyFinishContext(); return NULL; } __Pyx_GOTREF(__pyx_v_params); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_algo,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { default: case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_algo)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 283, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; const Py_ssize_t used_pos_args = (kwd_pos_args < 1) ? kwd_pos_args : 1; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kw, values + 0, used_pos_args, "get_chunker") < 0)) __PYX_ERR(0, 283, __pyx_L3_error) } } else if (unlikely(__pyx_nargs < 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_algo = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_chunker", 0, 1, 1, __pyx_nargs); __PYX_ERR(0, 283, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_DECREF(__pyx_v_params); __pyx_v_params = 0; __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0; __Pyx_AddTraceback("borg.chunker.get_chunker", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_7chunker_11get_chunker(__pyx_self, __pyx_v_algo, __pyx_v_params, __pyx_v_kw); /* function exit code */ __Pyx_DECREF(__pyx_v_params); __Pyx_DECREF(__pyx_v_kw); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_7chunker_11get_chunker(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_algo, PyObject *__pyx_v_params, PyObject *__pyx_v_kw) { PyObject *__pyx_v_seed = NULL; PyObject *__pyx_v_sparse = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_chunker", 1); /* "borg/chunker.pyx":284 * * def get_chunker(algo, *params, **kw): * if algo == 'buzhash': # <<<<<<<<<<<<<< * seed = kw['seed'] * return Chunker(seed, *params) */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_algo, __pyx_n_s_buzhash, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 284, __pyx_L1_error) if (__pyx_t_1) { /* "borg/chunker.pyx":285 * def get_chunker(algo, *params, **kw): * if algo == 'buzhash': * seed = kw['seed'] # <<<<<<<<<<<<<< * return Chunker(seed, *params) * if algo == 'fixed': */ __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_kw, __pyx_n_s_seed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_seed = __pyx_t_2; __pyx_t_2 = 0; /* "borg/chunker.pyx":286 * if algo == 'buzhash': * seed = kw['seed'] * return Chunker(seed, *params) # <<<<<<<<<<<<<< * if algo == 'fixed': * sparse = kw['sparse'] */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_seed); __Pyx_GIVEREF(__pyx_v_seed); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_seed)) __PYX_ERR(0, 286, __pyx_L1_error); __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_params); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4borg_7chunker_Chunker), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "borg/chunker.pyx":284 * * def get_chunker(algo, *params, **kw): * if algo == 'buzhash': # <<<<<<<<<<<<<< * seed = kw['seed'] * return Chunker(seed, *params) */ } /* "borg/chunker.pyx":287 * seed = kw['seed'] * return Chunker(seed, *params) * if algo == 'fixed': # <<<<<<<<<<<<<< * sparse = kw['sparse'] * return ChunkerFixed(*params, sparse=sparse) */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_algo, __pyx_n_s_fixed, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 287, __pyx_L1_error) if (__pyx_t_1) { /* "borg/chunker.pyx":288 * return Chunker(seed, *params) * if algo == 'fixed': * sparse = kw['sparse'] # <<<<<<<<<<<<<< * return ChunkerFixed(*params, sparse=sparse) * raise TypeError('unsupported chunker algo %r' % algo) */ __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_kw, __pyx_n_s_sparse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_sparse = __pyx_t_2; __pyx_t_2 = 0; /* "borg/chunker.pyx":289 * if algo == 'fixed': * sparse = kw['sparse'] * return ChunkerFixed(*params, sparse=sparse) # <<<<<<<<<<<<<< * raise TypeError('unsupported chunker algo %r' % algo) * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ChunkerFixed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_sparse, __pyx_v_sparse) < 0) __PYX_ERR(0, 289, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_v_params, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "borg/chunker.pyx":287 * seed = kw['seed'] * return Chunker(seed, *params) * if algo == 'fixed': # <<<<<<<<<<<<<< * sparse = kw['sparse'] * return ChunkerFixed(*params, sparse=sparse) */ } /* "borg/chunker.pyx":290 * sparse = kw['sparse'] * return ChunkerFixed(*params, sparse=sparse) * raise TypeError('unsupported chunker algo %r' % algo) # <<<<<<<<<<<<<< * * */ __pyx_t_4 = __Pyx_PyString_FormatSafe(__pyx_kp_s_unsupported_chunker_algo_r, __pyx_v_algo); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 290, __pyx_L1_error) /* "borg/chunker.pyx":283 * * * def get_chunker(algo, *params, **kw): # <<<<<<<<<<<<<< * if algo == 'buzhash': * seed = kw['seed'] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("borg.chunker.get_chunker", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_seed); __Pyx_XDECREF(__pyx_v_sparse); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/chunker.pyx":293 * * * def buzhash(data, unsigned long seed): # <<<<<<<<<<<<<< * cdef uint32_t *table * cdef uint32_t sum */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_7chunker_14buzhash(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_7chunker_14buzhash = {"buzhash", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_7chunker_14buzhash, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_7chunker_14buzhash(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_data = 0; unsigned long __pyx_v_seed; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("buzhash (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_seed,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 293, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_seed)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 293, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("buzhash", 1, 2, 2, 1); __PYX_ERR(0, 293, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "buzhash") < 0)) __PYX_ERR(0, 293, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_data = values[0]; __pyx_v_seed = __Pyx_PyInt_As_unsigned_long(values[1]); if (unlikely((__pyx_v_seed == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 293, __pyx_L3_error) } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("buzhash", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 293, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.chunker.buzhash", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_7chunker_13buzhash(__pyx_self, __pyx_v_data, __pyx_v_seed); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_7chunker_13buzhash(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, unsigned long __pyx_v_seed) { uint32_t *__pyx_v_table; uint32_t __pyx_v_sum; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; uint32_t __pyx_t_3; unsigned char const *__pyx_t_4; Py_ssize_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("buzhash", 1); /* "borg/chunker.pyx":296 * cdef uint32_t *table * cdef uint32_t sum * table = buzhash_init_table(seed & 0xffffffff) # <<<<<<<<<<<<<< * sum = c_buzhash( data, len(data), table) * free(table) */ __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_seed); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_And(__pyx_t_1, __pyx_int_4294967295); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyInt_As_uint32_t(__pyx_t_2); if (unlikely((__pyx_t_3 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_table = buzhash_init_table(__pyx_t_3); /* "borg/chunker.pyx":297 * cdef uint32_t sum * table = buzhash_init_table(seed & 0xffffffff) * sum = c_buzhash( data, len(data), table) # <<<<<<<<<<<<<< * free(table) * return sum */ __pyx_t_4 = __Pyx_PyObject_AsUString(__pyx_v_data); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 297, __pyx_L1_error) __pyx_t_5 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 297, __pyx_L1_error) __pyx_v_sum = buzhash(((unsigned char const *)__pyx_t_4), __pyx_t_5, __pyx_v_table); /* "borg/chunker.pyx":298 * table = buzhash_init_table(seed & 0xffffffff) * sum = c_buzhash( data, len(data), table) * free(table) # <<<<<<<<<<<<<< * return sum * */ free(__pyx_v_table); /* "borg/chunker.pyx":299 * sum = c_buzhash( data, len(data), table) * free(table) * return sum # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_sum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "borg/chunker.pyx":293 * * * def buzhash(data, unsigned long seed): # <<<<<<<<<<<<<< * cdef uint32_t *table * cdef uint32_t sum */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("borg.chunker.buzhash", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/chunker.pyx":302 * * * def buzhash_update(uint32_t sum, unsigned char remove, unsigned char add, size_t len, unsigned long seed): # <<<<<<<<<<<<<< * cdef uint32_t *table * table = buzhash_init_table(seed & 0xffffffff) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_7chunker_16buzhash_update(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_7chunker_16buzhash_update = {"buzhash_update", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_7chunker_16buzhash_update, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_7chunker_16buzhash_update(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { uint32_t __pyx_v_sum; unsigned char __pyx_v_remove; unsigned char __pyx_v_add; size_t __pyx_v_len; unsigned long __pyx_v_seed; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("buzhash_update (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sum,&__pyx_n_s_remove,&__pyx_n_s_add,&__pyx_n_s_len,&__pyx_n_s_seed,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sum)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 302, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_remove)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 302, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("buzhash_update", 1, 5, 5, 1); __PYX_ERR(0, 302, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_add)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 302, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("buzhash_update", 1, 5, 5, 2); __PYX_ERR(0, 302, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_len)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 302, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("buzhash_update", 1, 5, 5, 3); __PYX_ERR(0, 302, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_seed)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 302, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("buzhash_update", 1, 5, 5, 4); __PYX_ERR(0, 302, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "buzhash_update") < 0)) __PYX_ERR(0, 302, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); } __pyx_v_sum = __Pyx_PyInt_As_uint32_t(values[0]); if (unlikely((__pyx_v_sum == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 302, __pyx_L3_error) __pyx_v_remove = __Pyx_PyInt_As_unsigned_char(values[1]); if (unlikely((__pyx_v_remove == (unsigned char)-1) && PyErr_Occurred())) __PYX_ERR(0, 302, __pyx_L3_error) __pyx_v_add = __Pyx_PyInt_As_unsigned_char(values[2]); if (unlikely((__pyx_v_add == (unsigned char)-1) && PyErr_Occurred())) __PYX_ERR(0, 302, __pyx_L3_error) __pyx_v_len = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_len == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 302, __pyx_L3_error) __pyx_v_seed = __Pyx_PyInt_As_unsigned_long(values[4]); if (unlikely((__pyx_v_seed == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 302, __pyx_L3_error) } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("buzhash_update", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 302, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.chunker.buzhash_update", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_7chunker_15buzhash_update(__pyx_self, __pyx_v_sum, __pyx_v_remove, __pyx_v_add, __pyx_v_len, __pyx_v_seed); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_7chunker_15buzhash_update(CYTHON_UNUSED PyObject *__pyx_self, uint32_t __pyx_v_sum, unsigned char __pyx_v_remove, unsigned char __pyx_v_add, size_t __pyx_v_len, unsigned long __pyx_v_seed) { uint32_t *__pyx_v_table; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; uint32_t __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("buzhash_update", 1); /* "borg/chunker.pyx":304 * def buzhash_update(uint32_t sum, unsigned char remove, unsigned char add, size_t len, unsigned long seed): * cdef uint32_t *table * table = buzhash_init_table(seed & 0xffffffff) # <<<<<<<<<<<<<< * sum = c_buzhash_update(sum, remove, add, len, table) * free(table) */ __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_seed); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_And(__pyx_t_1, __pyx_int_4294967295); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyInt_As_uint32_t(__pyx_t_2); if (unlikely((__pyx_t_3 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_table = buzhash_init_table(__pyx_t_3); /* "borg/chunker.pyx":305 * cdef uint32_t *table * table = buzhash_init_table(seed & 0xffffffff) * sum = c_buzhash_update(sum, remove, add, len, table) # <<<<<<<<<<<<<< * free(table) * return sum */ __pyx_v_sum = buzhash_update(__pyx_v_sum, __pyx_v_remove, __pyx_v_add, __pyx_v_len, __pyx_v_table); /* "borg/chunker.pyx":306 * table = buzhash_init_table(seed & 0xffffffff) * sum = c_buzhash_update(sum, remove, add, len, table) * free(table) # <<<<<<<<<<<<<< * return sum */ free(__pyx_v_table); /* "borg/chunker.pyx":307 * sum = c_buzhash_update(sum, remove, add, len, table) * free(table) * return sum # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_sum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "borg/chunker.pyx":302 * * * def buzhash_update(uint32_t sum, unsigned char remove, unsigned char add, size_t len, unsigned long seed): # <<<<<<<<<<<<<< * cdef uint32_t *table * table = buzhash_init_table(seed & 0xffffffff) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("borg.chunker.buzhash_update", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_4borg_7chunker_Chunker(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif if (unlikely(__pyx_pw_4borg_7chunker_7Chunker_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_4borg_7chunker_Chunker(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4borg_7chunker_Chunker) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_4borg_7chunker_7Chunker_5__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static PyObject *__pyx_specialmethod___pyx_pw_4borg_7chunker_7Chunker_9__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) { PyObject *res = __pyx_pw_4borg_7chunker_7Chunker_9__next__(self); if (!res && !PyErr_Occurred()) { PyErr_SetNone(PyExc_StopIteration); } return res; } static PyMethodDef __pyx_methods_4borg_7chunker_Chunker[] = { {"chunkify", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_7chunker_7Chunker_3chunkify, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_7chunker_7Chunker_2chunkify}, {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_4borg_7chunker_7Chunker_9__next__, METH_NOARGS|METH_COEXIST, 0}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_7chunker_7Chunker_11__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_7chunker_7Chunker_13__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_4borg_7chunker_Chunker_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4borg_7chunker_Chunker}, {Py_tp_doc, (void *)PyDoc_STR("\n Content-Defined Chunker, variable chunk sizes.\n\n This chunker does quite some effort to mostly cut the same-content chunks, even if\n the content moves to a different offset inside the file. It uses the buzhash\n rolling-hash algorithm to identify the chunk cutting places by looking at the\n content inside the moving window and computing the rolling hash value over the\n window contents. If the last n bits of the rolling hash are 0, a chunk is cut.\n Additionally it obeys some more criteria, like a minimum and maximum chunk size.\n It also uses a per-repo random seed to avoid some chunk length fingerprinting attacks.\n ")}, {Py_tp_iter, (void *)__pyx_pw_4borg_7chunker_7Chunker_7__iter__}, {Py_tp_iternext, (void *)__pyx_pw_4borg_7chunker_7Chunker_9__next__}, {Py_tp_methods, (void *)__pyx_methods_4borg_7chunker_Chunker}, {Py_tp_new, (void *)__pyx_tp_new_4borg_7chunker_Chunker}, {0, 0}, }; static PyType_Spec __pyx_type_4borg_7chunker_Chunker_spec = { "borg.chunker.Chunker", sizeof(struct __pyx_obj_4borg_7chunker_Chunker), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_4borg_7chunker_Chunker_slots, }; #else static PyTypeObject __pyx_type_4borg_7chunker_Chunker = { PyVarObject_HEAD_INIT(0, 0) "borg.chunker.""Chunker", /*tp_name*/ sizeof(struct __pyx_obj_4borg_7chunker_Chunker), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4borg_7chunker_Chunker, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ PyDoc_STR("\n Content-Defined Chunker, variable chunk sizes.\n\n This chunker does quite some effort to mostly cut the same-content chunks, even if\n the content moves to a different offset inside the file. It uses the buzhash\n rolling-hash algorithm to identify the chunk cutting places by looking at the\n content inside the moving window and computing the rolling hash value over the\n window contents. If the last n bits of the rolling hash are 0, a chunk is cut.\n Additionally it obeys some more criteria, like a minimum and maximum chunk size.\n It also uses a per-repo random seed to avoid some chunk length fingerprinting attacks.\n "), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_pw_4borg_7chunker_7Chunker_7__iter__, /*tp_iter*/ __pyx_pw_4borg_7chunker_7Chunker_9__next__, /*tp_iternext*/ __pyx_methods_4borg_7chunker_Chunker, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4borg_7chunker_Chunker, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif #if CYTHON_USE_FREELISTS static struct __pyx_obj_4borg_7chunker___pyx_scope_struct__sparsemap *__pyx_freelist_4borg_7chunker___pyx_scope_struct__sparsemap[8]; static int __pyx_freecount_4borg_7chunker___pyx_scope_struct__sparsemap = 0; #endif static PyObject *__pyx_tp_new_4borg_7chunker___pyx_scope_struct__sparsemap(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_freecount_4borg_7chunker___pyx_scope_struct__sparsemap > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4borg_7chunker___pyx_scope_struct__sparsemap)))) { o = (PyObject*)__pyx_freelist_4borg_7chunker___pyx_scope_struct__sparsemap[--__pyx_freecount_4borg_7chunker___pyx_scope_struct__sparsemap]; memset(o, 0, sizeof(struct __pyx_obj_4borg_7chunker___pyx_scope_struct__sparsemap)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif return o; } static void __pyx_tp_dealloc_4borg_7chunker___pyx_scope_struct__sparsemap(PyObject *o) { struct __pyx_obj_4borg_7chunker___pyx_scope_struct__sparsemap *p = (struct __pyx_obj_4borg_7chunker___pyx_scope_struct__sparsemap *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4borg_7chunker___pyx_scope_struct__sparsemap) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_curr); Py_CLEAR(p->__pyx_v_e); Py_CLEAR(p->__pyx_v_end); Py_CLEAR(p->__pyx_v_fd); Py_CLEAR(p->__pyx_v_fh); Py_CLEAR(p->__pyx_v_file_len); Py_CLEAR(p->__pyx_v_is_data); Py_CLEAR(p->__pyx_v_start); Py_CLEAR(p->__pyx_v_whence); Py_CLEAR(p->__pyx_t_0); Py_CLEAR(p->__pyx_t_1); Py_CLEAR(p->__pyx_t_2); Py_CLEAR(p->__pyx_t_3); Py_CLEAR(p->__pyx_t_4); Py_CLEAR(p->__pyx_t_5); #if CYTHON_USE_FREELISTS if (((int)(__pyx_freecount_4borg_7chunker___pyx_scope_struct__sparsemap < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4borg_7chunker___pyx_scope_struct__sparsemap)))) { __pyx_freelist_4borg_7chunker___pyx_scope_struct__sparsemap[__pyx_freecount_4borg_7chunker___pyx_scope_struct__sparsemap++] = ((struct __pyx_obj_4borg_7chunker___pyx_scope_struct__sparsemap *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static int __pyx_tp_traverse_4borg_7chunker___pyx_scope_struct__sparsemap(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4borg_7chunker___pyx_scope_struct__sparsemap *p = (struct __pyx_obj_4borg_7chunker___pyx_scope_struct__sparsemap *)o; if (p->__pyx_v_curr) { e = (*v)(p->__pyx_v_curr, a); if (e) return e; } if (p->__pyx_v_e) { e = (*v)(p->__pyx_v_e, a); if (e) return e; } if (p->__pyx_v_end) { e = (*v)(p->__pyx_v_end, a); if (e) return e; } if (p->__pyx_v_fd) { e = (*v)(p->__pyx_v_fd, a); if (e) return e; } if (p->__pyx_v_fh) { e = (*v)(p->__pyx_v_fh, a); if (e) return e; } if (p->__pyx_v_file_len) { e = (*v)(p->__pyx_v_file_len, a); if (e) return e; } if (p->__pyx_v_is_data) { e = (*v)(p->__pyx_v_is_data, a); if (e) return e; } if (p->__pyx_v_start) { e = (*v)(p->__pyx_v_start, a); if (e) return e; } if (p->__pyx_v_whence) { e = (*v)(p->__pyx_v_whence, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } if (p->__pyx_t_1) { e = (*v)(p->__pyx_t_1, a); if (e) return e; } if (p->__pyx_t_2) { e = (*v)(p->__pyx_t_2, a); if (e) return e; } if (p->__pyx_t_3) { e = (*v)(p->__pyx_t_3, a); if (e) return e; } if (p->__pyx_t_4) { e = (*v)(p->__pyx_t_4, a); if (e) return e; } if (p->__pyx_t_5) { e = (*v)(p->__pyx_t_5, a); if (e) return e; } return 0; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_4borg_7chunker___pyx_scope_struct__sparsemap_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4borg_7chunker___pyx_scope_struct__sparsemap}, {Py_tp_traverse, (void *)__pyx_tp_traverse_4borg_7chunker___pyx_scope_struct__sparsemap}, {Py_tp_new, (void *)__pyx_tp_new_4borg_7chunker___pyx_scope_struct__sparsemap}, {0, 0}, }; static PyType_Spec __pyx_type_4borg_7chunker___pyx_scope_struct__sparsemap_spec = { "borg.chunker.__pyx_scope_struct__sparsemap", sizeof(struct __pyx_obj_4borg_7chunker___pyx_scope_struct__sparsemap), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, __pyx_type_4borg_7chunker___pyx_scope_struct__sparsemap_slots, }; #else static PyTypeObject __pyx_type_4borg_7chunker___pyx_scope_struct__sparsemap = { PyVarObject_HEAD_INIT(0, 0) "borg.chunker.""__pyx_scope_struct__sparsemap", /*tp_name*/ sizeof(struct __pyx_obj_4borg_7chunker___pyx_scope_struct__sparsemap), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4borg_7chunker___pyx_scope_struct__sparsemap, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_4borg_7chunker___pyx_scope_struct__sparsemap, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4borg_7chunker___pyx_scope_struct__sparsemap, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif #if CYTHON_USE_FREELISTS static struct __pyx_obj_4borg_7chunker___pyx_scope_struct_1_chunkify *__pyx_freelist_4borg_7chunker___pyx_scope_struct_1_chunkify[8]; static int __pyx_freecount_4borg_7chunker___pyx_scope_struct_1_chunkify = 0; #endif static PyObject *__pyx_tp_new_4borg_7chunker___pyx_scope_struct_1_chunkify(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_freecount_4borg_7chunker___pyx_scope_struct_1_chunkify > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4borg_7chunker___pyx_scope_struct_1_chunkify)))) { o = (PyObject*)__pyx_freelist_4borg_7chunker___pyx_scope_struct_1_chunkify[--__pyx_freecount_4borg_7chunker___pyx_scope_struct_1_chunkify]; memset(o, 0, sizeof(struct __pyx_obj_4borg_7chunker___pyx_scope_struct_1_chunkify)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif return o; } static void __pyx_tp_dealloc_4borg_7chunker___pyx_scope_struct_1_chunkify(PyObject *o) { struct __pyx_obj_4borg_7chunker___pyx_scope_struct_1_chunkify *p = (struct __pyx_obj_4borg_7chunker___pyx_scope_struct_1_chunkify *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4borg_7chunker___pyx_scope_struct_1_chunkify) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_allocation); Py_CLEAR(p->__pyx_v_body_map); Py_CLEAR(p->__pyx_v_data); Py_CLEAR(p->__pyx_v_err); Py_CLEAR(p->__pyx_v_fd); Py_CLEAR(p->__pyx_v_fh); Py_CLEAR(p->__pyx_v_fmap); Py_CLEAR(p->__pyx_v_got); Py_CLEAR(p->__pyx_v_header_map); Py_CLEAR(p->__pyx_v_is_data); Py_CLEAR(p->__pyx_v_offset); Py_CLEAR(p->__pyx_v_pos); Py_CLEAR(p->__pyx_v_range_size); Py_CLEAR(p->__pyx_v_range_start); Py_CLEAR(p->__pyx_v_self); Py_CLEAR(p->__pyx_v_wanted); Py_CLEAR(p->__pyx_t_0); #if CYTHON_USE_FREELISTS if (((int)(__pyx_freecount_4borg_7chunker___pyx_scope_struct_1_chunkify < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4borg_7chunker___pyx_scope_struct_1_chunkify)))) { __pyx_freelist_4borg_7chunker___pyx_scope_struct_1_chunkify[__pyx_freecount_4borg_7chunker___pyx_scope_struct_1_chunkify++] = ((struct __pyx_obj_4borg_7chunker___pyx_scope_struct_1_chunkify *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static int __pyx_tp_traverse_4borg_7chunker___pyx_scope_struct_1_chunkify(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4borg_7chunker___pyx_scope_struct_1_chunkify *p = (struct __pyx_obj_4borg_7chunker___pyx_scope_struct_1_chunkify *)o; if (p->__pyx_v_allocation) { e = (*v)(p->__pyx_v_allocation, a); if (e) return e; } if (p->__pyx_v_body_map) { e = (*v)(p->__pyx_v_body_map, a); if (e) return e; } if (p->__pyx_v_data) { e = (*v)(p->__pyx_v_data, a); if (e) return e; } if (p->__pyx_v_err) { e = (*v)(p->__pyx_v_err, a); if (e) return e; } if (p->__pyx_v_fd) { e = (*v)(p->__pyx_v_fd, a); if (e) return e; } if (p->__pyx_v_fh) { e = (*v)(p->__pyx_v_fh, a); if (e) return e; } if (p->__pyx_v_fmap) { e = (*v)(p->__pyx_v_fmap, a); if (e) return e; } if (p->__pyx_v_got) { e = (*v)(p->__pyx_v_got, a); if (e) return e; } if (p->__pyx_v_header_map) { e = (*v)(p->__pyx_v_header_map, a); if (e) return e; } if (p->__pyx_v_is_data) { e = (*v)(p->__pyx_v_is_data, a); if (e) return e; } if (p->__pyx_v_offset) { e = (*v)(p->__pyx_v_offset, a); if (e) return e; } if (p->__pyx_v_pos) { e = (*v)(p->__pyx_v_pos, a); if (e) return e; } if (p->__pyx_v_range_size) { e = (*v)(p->__pyx_v_range_size, a); if (e) return e; } if (p->__pyx_v_range_start) { e = (*v)(p->__pyx_v_range_start, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(p->__pyx_v_self, a); if (e) return e; } if (p->__pyx_v_wanted) { e = (*v)(p->__pyx_v_wanted, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } return 0; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_4borg_7chunker___pyx_scope_struct_1_chunkify_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4borg_7chunker___pyx_scope_struct_1_chunkify}, {Py_tp_traverse, (void *)__pyx_tp_traverse_4borg_7chunker___pyx_scope_struct_1_chunkify}, {Py_tp_new, (void *)__pyx_tp_new_4borg_7chunker___pyx_scope_struct_1_chunkify}, {0, 0}, }; static PyType_Spec __pyx_type_4borg_7chunker___pyx_scope_struct_1_chunkify_spec = { "borg.chunker.__pyx_scope_struct_1_chunkify", sizeof(struct __pyx_obj_4borg_7chunker___pyx_scope_struct_1_chunkify), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, __pyx_type_4borg_7chunker___pyx_scope_struct_1_chunkify_slots, }; #else static PyTypeObject __pyx_type_4borg_7chunker___pyx_scope_struct_1_chunkify = { PyVarObject_HEAD_INIT(0, 0) "borg.chunker.""__pyx_scope_struct_1_chunkify", /*tp_name*/ sizeof(struct __pyx_obj_4borg_7chunker___pyx_scope_struct_1_chunkify), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4borg_7chunker___pyx_scope_struct_1_chunkify, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_4borg_7chunker___pyx_scope_struct_1_chunkify, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4borg_7chunker___pyx_scope_struct_1_chunkify, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_1_4_01, __pyx_k_1_4_01, sizeof(__pyx_k_1_4_01), 0, 0, 1, 0}, {&__pyx_n_s_API_VERSION, __pyx_k_API_VERSION, sizeof(__pyx_k_API_VERSION), 0, 0, 1, 1}, {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1}, {&__pyx_n_s_CH_ALLOC, __pyx_k_CH_ALLOC, sizeof(__pyx_k_CH_ALLOC), 0, 0, 1, 1}, {&__pyx_n_s_CH_DATA, __pyx_k_CH_DATA, sizeof(__pyx_k_CH_DATA), 0, 0, 1, 1}, {&__pyx_n_s_CH_HOLE, __pyx_k_CH_HOLE, sizeof(__pyx_k_CH_HOLE), 0, 0, 1, 1}, {&__pyx_n_s_Chunk, __pyx_k_Chunk, sizeof(__pyx_k_Chunk), 0, 0, 1, 1}, {&__pyx_n_s_Chunk_2, __pyx_k_Chunk_2, sizeof(__pyx_k_Chunk_2), 0, 0, 1, 1}, {&__pyx_kp_s_Chunk_namedtuple_meta_is_always, __pyx_k_Chunk_namedtuple_meta_is_always, sizeof(__pyx_k_Chunk_namedtuple_meta_is_always), 0, 0, 1, 0}, {&__pyx_n_s_Chunker, __pyx_k_Chunker, sizeof(__pyx_k_Chunker), 0, 0, 1, 1}, {&__pyx_n_s_ChunkerFixed, __pyx_k_ChunkerFixed, sizeof(__pyx_k_ChunkerFixed), 0, 0, 1, 1}, {&__pyx_n_s_ChunkerFixed___init, __pyx_k_ChunkerFixed___init, sizeof(__pyx_k_ChunkerFixed___init), 0, 0, 1, 1}, {&__pyx_n_s_ChunkerFixed_chunkify, __pyx_k_ChunkerFixed_chunkify, sizeof(__pyx_k_ChunkerFixed_chunkify), 0, 0, 1, 1}, {&__pyx_n_s_Chunker___reduce_cython, __pyx_k_Chunker___reduce_cython, sizeof(__pyx_k_Chunker___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_Chunker___setstate_cython, __pyx_k_Chunker___setstate_cython, sizeof(__pyx_k_Chunker___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_Chunker_chunkify, __pyx_k_Chunker_chunkify, sizeof(__pyx_k_Chunker_chunkify), 0, 0, 1, 1}, {&__pyx_n_s_ENXIO, __pyx_k_ENXIO, sizeof(__pyx_k_ENXIO), 0, 0, 1, 1}, {&__pyx_n_s_MAX_DATA_SIZE, __pyx_k_MAX_DATA_SIZE, sizeof(__pyx_k_MAX_DATA_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_OSError, __pyx_k_OSError, sizeof(__pyx_k_OSError), 0, 0, 1, 1}, {&__pyx_n_s_POSIX_FADV_DONTNEED, __pyx_k_POSIX_FADV_DONTNEED, sizeof(__pyx_k_POSIX_FADV_DONTNEED), 0, 0, 1, 1}, {&__pyx_n_s_SEEK_CUR, __pyx_k_SEEK_CUR, sizeof(__pyx_k_SEEK_CUR), 0, 0, 1, 1}, {&__pyx_n_s_SEEK_DATA, __pyx_k_SEEK_DATA, sizeof(__pyx_k_SEEK_DATA), 0, 0, 1, 1}, {&__pyx_n_s_SEEK_END, __pyx_k_SEEK_END, sizeof(__pyx_k_SEEK_END), 0, 0, 1, 1}, {&__pyx_n_s_SEEK_HOLE, __pyx_k_SEEK_HOLE, sizeof(__pyx_k_SEEK_HOLE), 0, 0, 1, 1}, {&__pyx_n_s_SEEK_SET, __pyx_k_SEEK_SET, sizeof(__pyx_k_SEEK_SET), 0, 0, 1, 1}, {&__pyx_kp_s_This_is_a_simple_chunker_for_in, __pyx_k_This_is_a_simple_chunker_for_in, sizeof(__pyx_k_This_is_a_simple_chunker_for_in), 0, 0, 1, 0}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s__35, __pyx_k__35, sizeof(__pyx_k__35), 0, 0, 1, 1}, {&__pyx_n_s__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 1, 1}, {&__pyx_kp_u__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0, 0}, {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1}, {&__pyx_n_s_algo, __pyx_k_algo, sizeof(__pyx_k_algo), 0, 0, 1, 1}, {&__pyx_n_s_allocation, __pyx_k_allocation, sizeof(__pyx_k_allocation), 0, 0, 1, 1}, {&__pyx_n_s_amount, __pyx_k_amount, sizeof(__pyx_k_amount), 0, 0, 1, 1}, {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_block_size, __pyx_k_block_size, sizeof(__pyx_k_block_size), 0, 0, 1, 1}, {&__pyx_n_s_body_map, __pyx_k_body_map, sizeof(__pyx_k_body_map), 0, 0, 1, 1}, {&__pyx_n_s_borg_chunker, __pyx_k_borg_chunker, sizeof(__pyx_k_borg_chunker), 0, 0, 1, 1}, {&__pyx_n_s_buzhash, __pyx_k_buzhash, sizeof(__pyx_k_buzhash), 0, 0, 1, 1}, {&__pyx_n_s_buzhash_update, __pyx_k_buzhash_update, sizeof(__pyx_k_buzhash_update), 0, 0, 1, 1}, {&__pyx_n_s_chunk_max_exp, __pyx_k_chunk_max_exp, sizeof(__pyx_k_chunk_max_exp), 0, 0, 1, 1}, {&__pyx_n_s_chunk_min_exp, __pyx_k_chunk_min_exp, sizeof(__pyx_k_chunk_min_exp), 0, 0, 1, 1}, {&__pyx_n_s_chunkify, __pyx_k_chunkify, sizeof(__pyx_k_chunkify), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1}, {&__pyx_n_s_constants, __pyx_k_constants, sizeof(__pyx_k_constants), 0, 0, 1, 1}, {&__pyx_n_s_curr, __pyx_k_curr, sizeof(__pyx_k_curr), 0, 0, 1, 1}, {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, {&__pyx_n_s_dpos_curr_end, __pyx_k_dpos_curr_end, sizeof(__pyx_k_dpos_curr_end), 0, 0, 1, 1}, {&__pyx_n_s_dread, __pyx_k_dread, sizeof(__pyx_k_dread), 0, 0, 1, 1}, {&__pyx_n_s_dseek, __pyx_k_dseek, sizeof(__pyx_k_dseek), 0, 0, 1, 1}, {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1}, {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, {&__pyx_n_s_err, __pyx_k_err, sizeof(__pyx_k_err), 0, 0, 1, 1}, {&__pyx_n_s_errno, __pyx_k_errno, sizeof(__pyx_k_errno), 0, 0, 1, 1}, {&__pyx_n_s_fd, __pyx_k_fd, sizeof(__pyx_k_fd), 0, 0, 1, 1}, {&__pyx_n_s_fh, __pyx_k_fh, sizeof(__pyx_k_fh), 0, 0, 1, 1}, {&__pyx_n_s_file_len, __pyx_k_file_len, sizeof(__pyx_k_file_len), 0, 0, 1, 1}, {&__pyx_n_s_fixed, __pyx_k_fixed, sizeof(__pyx_k_fixed), 0, 0, 1, 1}, {&__pyx_n_s_fmap, __pyx_k_fmap, sizeof(__pyx_k_fmap), 0, 0, 1, 1}, {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, {&__pyx_n_s_get_chunker, __pyx_k_get_chunker, sizeof(__pyx_k_get_chunker), 0, 0, 1, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_n_s_got, __pyx_k_got, sizeof(__pyx_k_got), 0, 0, 1, 1}, {&__pyx_n_s_has_seek_hole, __pyx_k_has_seek_hole, sizeof(__pyx_k_has_seek_hole), 0, 0, 1, 1}, {&__pyx_n_s_hash_mask_bits, __pyx_k_hash_mask_bits, sizeof(__pyx_k_hash_mask_bits), 0, 0, 1, 1}, {&__pyx_n_s_hash_window_size, __pyx_k_hash_window_size, sizeof(__pyx_k_hash_window_size), 0, 0, 1, 1}, {&__pyx_n_s_header_map, __pyx_k_header_map, sizeof(__pyx_k_header_map), 0, 0, 1, 1}, {&__pyx_n_s_header_size, __pyx_k_header_size, sizeof(__pyx_k_header_size), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_n_s_is_data, __pyx_k_is_data, sizeof(__pyx_k_is_data), 0, 0, 1, 1}, {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, {&__pyx_n_s_kw, __pyx_k_kw, sizeof(__pyx_k_kw), 0, 0, 1, 1}, {&__pyx_n_s_len, __pyx_k_len, sizeof(__pyx_k_len), 0, 0, 1, 1}, {&__pyx_n_s_lseek, __pyx_k_lseek, sizeof(__pyx_k_lseek), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_meta, __pyx_k_meta, sizeof(__pyx_k_meta), 0, 0, 1, 1}, {&__pyx_kp_s_meta_data, __pyx_k_meta_data, sizeof(__pyx_k_meta_data), 0, 0, 1, 0}, {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_namedtuple, __pyx_k_namedtuple, sizeof(__pyx_k_namedtuple), 0, 0, 1, 1}, {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1}, {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, {&__pyx_n_s_params, __pyx_k_params, sizeof(__pyx_k_params), 0, 0, 1, 1}, {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1}, {&__pyx_n_s_posix_fadvise, __pyx_k_posix_fadvise, sizeof(__pyx_k_posix_fadvise), 0, 0, 1, 1}, {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, {&__pyx_n_s_range_size, __pyx_k_range_size, sizeof(__pyx_k_range_size), 0, 0, 1, 1}, {&__pyx_n_s_range_start, __pyx_k_range_start, sizeof(__pyx_k_range_start), 0, 0, 1, 1}, {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, {&__pyx_n_s_remove, __pyx_k_remove, sizeof(__pyx_k_remove), 0, 0, 1, 1}, {&__pyx_n_s_seed, __pyx_k_seed, sizeof(__pyx_k_seed), 0, 0, 1, 1}, {&__pyx_n_s_seek, __pyx_k_seek, sizeof(__pyx_k_seek), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1}, {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1}, {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_sparse, __pyx_k_sparse, sizeof(__pyx_k_sparse), 0, 0, 1, 1}, {&__pyx_n_s_sparsemap, __pyx_k_sparsemap, sizeof(__pyx_k_sparsemap), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_kp_s_src_borg_chunker_pyx, __pyx_k_src_borg_chunker_pyx, sizeof(__pyx_k_src_borg_chunker_pyx), 0, 0, 1, 0}, {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, {&__pyx_n_s_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 0, 1, 1}, {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1}, {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, {&__pyx_n_s_table, __pyx_k_table, sizeof(__pyx_k_table), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, {&__pyx_kp_s_too_small_max_size, __pyx_k_too_small_max_size, sizeof(__pyx_k_too_small_max_size), 0, 0, 1, 0}, {&__pyx_n_s_try_sparse, __pyx_k_try_sparse, sizeof(__pyx_k_try_sparse), 0, 0, 1, 1}, {&__pyx_kp_s_unsupported_chunker_algo_r, __pyx_k_unsupported_chunker_algo_r, sizeof(__pyx_k_unsupported_chunker_algo_r), 0, 0, 1, 0}, {&__pyx_n_s_use_fh, __pyx_k_use_fh, sizeof(__pyx_k_use_fh), 0, 0, 1, 1}, {&__pyx_n_s_wanted, __pyx_k_wanted, sizeof(__pyx_k_wanted), 0, 0, 1, 1}, {&__pyx_n_s_whence, __pyx_k_whence, sizeof(__pyx_k_whence), 0, 0, 1, 1}, {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_OSError = __Pyx_GetBuiltinName(__pyx_n_s_OSError); if (!__pyx_builtin_OSError) __PYX_ERR(0, 107, __pyx_L1_error) __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 153, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "borg/chunker.pyx":192 * else: * header_map = [] * body_map = [(0, 2 ** 62, True), ] # <<<<<<<<<<<<<< * fmap = header_map + body_map * */ __pyx_tuple__3 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0x4000000000000000, Py_True); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "borg/chunker.pyx":32 * * * _Chunk = namedtuple('_Chunk', 'meta data') # <<<<<<<<<<<<<< * _Chunk.__doc__ = """\ * Chunk namedtuple */ __pyx_tuple__6 = PyTuple_Pack(2, __pyx_n_s_Chunk, __pyx_kp_s_meta_data); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); /* "borg/chunker.pyx":51 * """ * * def Chunk(data, **meta): # <<<<<<<<<<<<<< * return _Chunk(meta, data) * */ __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_data, __pyx_n_s_meta); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_chunker_pyx, __pyx_n_s_Chunk_2, 51, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 51, __pyx_L1_error) /* "borg/chunker.pyx":55 * * * def dread(offset, size, fd=None, fh=-1): # <<<<<<<<<<<<<< * use_fh = fh >= 0 * if use_fh: */ __pyx_tuple__9 = PyTuple_Pack(6, __pyx_n_s_offset, __pyx_n_s_size, __pyx_n_s_fd, __pyx_n_s_fh, __pyx_n_s_use_fh, __pyx_n_s_data); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_chunker_pyx, __pyx_n_s_dread, 55, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 55, __pyx_L1_error) __pyx_tuple__11 = PyTuple_Pack(2, Py_None, ((PyObject *)__pyx_int_neg_1)); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); /* "borg/chunker.pyx":69 * * * def dseek(amount, whence, fd=None, fh=-1): # <<<<<<<<<<<<<< * use_fh = fh >= 0 * if use_fh: */ __pyx_tuple__12 = PyTuple_Pack(5, __pyx_n_s_amount, __pyx_n_s_whence, __pyx_n_s_fd, __pyx_n_s_fh, __pyx_n_s_use_fh); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_chunker_pyx, __pyx_n_s_dseek, 69, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 69, __pyx_L1_error) /* "borg/chunker.pyx":77 * * * def dpos_curr_end(fd=None, fh=-1): # <<<<<<<<<<<<<< * """ * determine current position, file end position (== file length) */ __pyx_tuple__14 = PyTuple_Pack(4, __pyx_n_s_fd, __pyx_n_s_fh, __pyx_n_s_curr, __pyx_n_s_end); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_chunker_pyx, __pyx_n_s_dpos_curr_end, 77, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 77, __pyx_L1_error) /* "borg/chunker.pyx":87 * * * def sparsemap(fd=None, fh=-1): # <<<<<<<<<<<<<< * """ * generator yielding a (start, length, is_data) tuple for each range. */ __pyx_tuple__16 = PyTuple_Pack(9, __pyx_n_s_fd, __pyx_n_s_fh, __pyx_n_s_curr, __pyx_n_s_file_len, __pyx_n_s_start, __pyx_n_s_whence, __pyx_n_s_is_data, __pyx_n_s_end, __pyx_n_s_e); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); __pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_chunker_pyx, __pyx_n_s_sparsemap, 87, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj_)) __PYX_ERR(0, 87, __pyx_L1_error) /* "borg/chunker.pyx":147 * this is supported and not considered to be an error. * """ * def __init__(self, block_size, header_size=0, sparse=False): # <<<<<<<<<<<<<< * self.block_size = block_size * self.header_size = header_size */ __pyx_tuple__17 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_block_size, __pyx_n_s_header_size, __pyx_n_s_sparse); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_chunker_pyx, __pyx_n_s_init, 147, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 147, __pyx_L1_error) __pyx_tuple__19 = PyTuple_Pack(2, ((PyObject *)__pyx_int_0), ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); /* "borg/chunker.pyx":155 * assert block_size <= len(zeros) * * def chunkify(self, fd=None, fh=-1, fmap=None): # <<<<<<<<<<<<<< * """ * Cut a file into chunks. */ __pyx_tuple__20 = PyTuple_Pack(16, __pyx_n_s_self, __pyx_n_s_fd, __pyx_n_s_fh, __pyx_n_s_fmap, __pyx_n_s_header_map, __pyx_n_s_body_map, __pyx_n_s_err, __pyx_n_s_offset, __pyx_n_s_range_start, __pyx_n_s_range_size, __pyx_n_s_is_data, __pyx_n_s_wanted, __pyx_n_s_data, __pyx_n_s_got, __pyx_n_s_allocation, __pyx_n_s_pos); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 16, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_chunker_pyx, __pyx_n_s_chunkify, 155, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 155, __pyx_L1_error) __pyx_tuple__21 = PyTuple_Pack(3, Py_None, ((PyObject *)__pyx_int_neg_1), Py_None); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); /* "borg/chunker.pyx":251 * self.chunker = chunker_init(hash_window_size, hash_mask, min_size, max_size, seed & 0xffffffff) * * def chunkify(self, fd, fh=-1): # <<<<<<<<<<<<<< * """ * Cut a file into chunks. */ __pyx_tuple__22 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_fd, __pyx_n_s_fh); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_chunker_pyx, __pyx_n_s_chunkify, 251, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 251, __pyx_L1_error) __pyx_tuple__24 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__25 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_tuple__27 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__27); __Pyx_GIVEREF(__pyx_tuple__27); __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(1, 3, __pyx_L1_error) /* "borg/chunker.pyx":283 * * * def get_chunker(algo, *params, **kw): # <<<<<<<<<<<<<< * if algo == 'buzhash': * seed = kw['seed'] */ __pyx_tuple__29 = PyTuple_Pack(5, __pyx_n_s_algo, __pyx_n_s_params, __pyx_n_s_kw, __pyx_n_s_seed, __pyx_n_s_sparse); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__29); __Pyx_GIVEREF(__pyx_tuple__29); __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_chunker_pyx, __pyx_n_s_get_chunker, 283, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 283, __pyx_L1_error) /* "borg/chunker.pyx":293 * * * def buzhash(data, unsigned long seed): # <<<<<<<<<<<<<< * cdef uint32_t *table * cdef uint32_t sum */ __pyx_tuple__31 = PyTuple_Pack(4, __pyx_n_s_data, __pyx_n_s_seed, __pyx_n_s_table, __pyx_n_s_sum); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_chunker_pyx, __pyx_n_s_buzhash, 293, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 293, __pyx_L1_error) /* "borg/chunker.pyx":302 * * * def buzhash_update(uint32_t sum, unsigned char remove, unsigned char add, size_t len, unsigned long seed): # <<<<<<<<<<<<<< * cdef uint32_t *table * table = buzhash_init_table(seed & 0xffffffff) */ __pyx_tuple__33 = PyTuple_Pack(6, __pyx_n_s_sum, __pyx_n_s_remove, __pyx_n_s_add, __pyx_n_s_len, __pyx_n_s_seed, __pyx_n_s_table); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__33); __Pyx_GIVEREF(__pyx_tuple__33); __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_chunker_pyx, __pyx_n_s_buzhash_update, 302, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_4294967295 = PyInt_FromString((char *)"4294967295", 0, 0); if (unlikely(!__pyx_int_4294967295)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_0x4000000000000000 = PyInt_FromString((char *)"0x4000000000000000", 0, 0); if (unlikely(!__pyx_int_0x4000000000000000)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { /* AssertionsEnabled.init */ if (likely(__Pyx_init_assertions_enabled() == 0)); else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS __pyx_ptype_4borg_7chunker_Chunker = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4borg_7chunker_Chunker_spec, NULL); if (unlikely(!__pyx_ptype_4borg_7chunker_Chunker)) __PYX_ERR(0, 228, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4borg_7chunker_Chunker_spec, __pyx_ptype_4borg_7chunker_Chunker) < 0) __PYX_ERR(0, 228, __pyx_L1_error) #else __pyx_ptype_4borg_7chunker_Chunker = &__pyx_type_4borg_7chunker_Chunker; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_4borg_7chunker_Chunker) < 0) __PYX_ERR(0, 228, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_4borg_7chunker_Chunker->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4borg_7chunker_Chunker->tp_dictoffset && __pyx_ptype_4borg_7chunker_Chunker->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_4borg_7chunker_Chunker->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Chunker, (PyObject *) __pyx_ptype_4borg_7chunker_Chunker) < 0) __PYX_ERR(0, 228, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_4borg_7chunker_Chunker) < 0) __PYX_ERR(0, 228, __pyx_L1_error) #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_4borg_7chunker___pyx_scope_struct__sparsemap = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4borg_7chunker___pyx_scope_struct__sparsemap_spec, NULL); if (unlikely(!__pyx_ptype_4borg_7chunker___pyx_scope_struct__sparsemap)) __PYX_ERR(0, 87, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4borg_7chunker___pyx_scope_struct__sparsemap_spec, __pyx_ptype_4borg_7chunker___pyx_scope_struct__sparsemap) < 0) __PYX_ERR(0, 87, __pyx_L1_error) #else __pyx_ptype_4borg_7chunker___pyx_scope_struct__sparsemap = &__pyx_type_4borg_7chunker___pyx_scope_struct__sparsemap; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_4borg_7chunker___pyx_scope_struct__sparsemap) < 0) __PYX_ERR(0, 87, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_4borg_7chunker___pyx_scope_struct__sparsemap->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4borg_7chunker___pyx_scope_struct__sparsemap->tp_dictoffset && __pyx_ptype_4borg_7chunker___pyx_scope_struct__sparsemap->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_4borg_7chunker___pyx_scope_struct__sparsemap->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_4borg_7chunker___pyx_scope_struct_1_chunkify = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4borg_7chunker___pyx_scope_struct_1_chunkify_spec, NULL); if (unlikely(!__pyx_ptype_4borg_7chunker___pyx_scope_struct_1_chunkify)) __PYX_ERR(0, 155, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4borg_7chunker___pyx_scope_struct_1_chunkify_spec, __pyx_ptype_4borg_7chunker___pyx_scope_struct_1_chunkify) < 0) __PYX_ERR(0, 155, __pyx_L1_error) #else __pyx_ptype_4borg_7chunker___pyx_scope_struct_1_chunkify = &__pyx_type_4borg_7chunker___pyx_scope_struct_1_chunkify; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_4borg_7chunker___pyx_scope_struct_1_chunkify) < 0) __PYX_ERR(0, 155, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_4borg_7chunker___pyx_scope_struct_1_chunkify->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4borg_7chunker___pyx_scope_struct_1_chunkify->tp_dictoffset && __pyx_ptype_4borg_7chunker___pyx_scope_struct_1_chunkify->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_4borg_7chunker___pyx_scope_struct_1_chunkify->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_chunker(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_chunker}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "chunker", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initchunker(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initchunker(void) #else __Pyx_PyMODINIT_FUNC PyInit_chunker(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_chunker(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_chunker(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'chunker' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("chunker", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "chunker" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_chunker(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_borg__chunker) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "borg.chunker")) { if (unlikely((PyDict_SetItemString(modules, "borg.chunker", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) (void)__Pyx_modinit_type_import_code(); (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "borg/chunker.pyx":3 * # -*- coding: utf-8 -*- * * API_VERSION = '1.4_01' # <<<<<<<<<<<<<< * * import errno */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_API_VERSION, __pyx_kp_s_1_4_01) < 0) __PYX_ERR(0, 3, __pyx_L1_error) /* "borg/chunker.pyx":5 * API_VERSION = '1.4_01' * * import errno # <<<<<<<<<<<<<< * import os * from collections import namedtuple */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_errno, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_errno, __pyx_t_2) < 0) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/chunker.pyx":6 * * import errno * import os # <<<<<<<<<<<<<< * from collections import namedtuple * */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_os, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/chunker.pyx":7 * import errno * import os * from collections import namedtuple # <<<<<<<<<<<<<< * * from .constants import CH_DATA, CH_ALLOC, CH_HOLE, MAX_DATA_SIZE, zeros */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_namedtuple); __Pyx_GIVEREF(__pyx_n_s_namedtuple); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_namedtuple)) __PYX_ERR(0, 7, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_collections, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_namedtuple); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_namedtuple, __pyx_t_2) < 0) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/chunker.pyx":9 * from collections import namedtuple * * from .constants import CH_DATA, CH_ALLOC, CH_HOLE, MAX_DATA_SIZE, zeros # <<<<<<<<<<<<<< * * from libc.stdlib cimport free */ __pyx_t_3 = PyList_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_CH_DATA); __Pyx_GIVEREF(__pyx_n_s_CH_DATA); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_CH_DATA)) __PYX_ERR(0, 9, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_CH_ALLOC); __Pyx_GIVEREF(__pyx_n_s_CH_ALLOC); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_CH_ALLOC)) __PYX_ERR(0, 9, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_CH_HOLE); __Pyx_GIVEREF(__pyx_n_s_CH_HOLE); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_CH_HOLE)) __PYX_ERR(0, 9, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_MAX_DATA_SIZE); __Pyx_GIVEREF(__pyx_n_s_MAX_DATA_SIZE); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 3, __pyx_n_s_MAX_DATA_SIZE)) __PYX_ERR(0, 9, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_zeros); __Pyx_GIVEREF(__pyx_n_s_zeros); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 4, __pyx_n_s_zeros)) __PYX_ERR(0, 9, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_constants, __pyx_t_3, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_CH_DATA); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CH_DATA, __pyx_t_3) < 0) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_CH_ALLOC); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CH_ALLOC, __pyx_t_3) < 0) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_CH_HOLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CH_HOLE, __pyx_t_3) < 0) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_MAX_DATA_SIZE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAX_DATA_SIZE, __pyx_t_3) < 0) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_zeros, __pyx_t_3) < 0) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/chunker.pyx":29 * # this does not imply that it will actually work on the filesystem, * # because the FS also needs to support this. * has_seek_hole = hasattr(os, 'SEEK_DATA') and hasattr(os, 'SEEK_HOLE') # <<<<<<<<<<<<<< * * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_HasAttr(__pyx_t_3, __pyx_n_s_SEEK_DATA); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { } else { __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L2_bool_binop_done; } __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_HasAttr(__pyx_t_3, __pyx_n_s_SEEK_HOLE); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; __pyx_t_3 = 0; __pyx_L2_bool_binop_done:; if (PyDict_SetItem(__pyx_d, __pyx_n_s_has_seek_hole, __pyx_t_2) < 0) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/chunker.pyx":32 * * * _Chunk = namedtuple('_Chunk', 'meta data') # <<<<<<<<<<<<<< * _Chunk.__doc__ = """\ * Chunk namedtuple */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_namedtuple); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_Chunk, __pyx_t_3) < 0) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/chunker.pyx":33 * * _Chunk = namedtuple('_Chunk', 'meta data') * _Chunk.__doc__ = """\ # <<<<<<<<<<<<<< * Chunk namedtuple * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Chunk); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_PyObject_SetAttrStr(__pyx_t_3, __pyx_n_s_doc, __pyx_kp_s_Chunk_namedtuple_meta_is_always) < 0) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/chunker.pyx":51 * """ * * def Chunk(data, **meta): # <<<<<<<<<<<<<< * return _Chunk(meta, data) * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_7chunker_1Chunk, 0, __pyx_n_s_Chunk_2, NULL, __pyx_n_s_borg_chunker, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Chunk_2, __pyx_t_3) < 0) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/chunker.pyx":55 * * * def dread(offset, size, fd=None, fh=-1): # <<<<<<<<<<<<<< * use_fh = fh >= 0 * if use_fh: */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_7chunker_3dread, 0, __pyx_n_s_dread, NULL, __pyx_n_s_borg_chunker, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_dread, __pyx_t_3) < 0) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/chunker.pyx":69 * * * def dseek(amount, whence, fd=None, fh=-1): # <<<<<<<<<<<<<< * use_fh = fh >= 0 * if use_fh: */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_7chunker_5dseek, 0, __pyx_n_s_dseek, NULL, __pyx_n_s_borg_chunker, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_dseek, __pyx_t_3) < 0) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/chunker.pyx":77 * * * def dpos_curr_end(fd=None, fh=-1): # <<<<<<<<<<<<<< * """ * determine current position, file end position (== file length) */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_7chunker_7dpos_curr_end, 0, __pyx_n_s_dpos_curr_end, NULL, __pyx_n_s_borg_chunker, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_dpos_curr_end, __pyx_t_3) < 0) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/chunker.pyx":87 * * * def sparsemap(fd=None, fh=-1): # <<<<<<<<<<<<<< * """ * generator yielding a (start, length, is_data) tuple for each range. */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_7chunker_9sparsemap, 0, __pyx_n_s_sparsemap, NULL, __pyx_n_s_borg_chunker, __pyx_d, ((PyObject *)__pyx_codeobj_)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_sparsemap, __pyx_t_3) < 0) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/chunker.pyx":127 * * * class ChunkerFixed: # <<<<<<<<<<<<<< * """ * This is a simple chunker for input data with data usually staying at same */ __pyx_t_3 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_ChunkerFixed, __pyx_n_s_ChunkerFixed, (PyObject *) NULL, __pyx_n_s_borg_chunker, __pyx_kp_s_This_is_a_simple_chunker_for_in); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "borg/chunker.pyx":147 * this is supported and not considered to be an error. * """ * def __init__(self, block_size, header_size=0, sparse=False): # <<<<<<<<<<<<<< * self.block_size = block_size * self.header_size = header_size */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_7chunker_12ChunkerFixed_1__init__, 0, __pyx_n_s_ChunkerFixed___init, NULL, __pyx_n_s_borg_chunker, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__19); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/chunker.pyx":155 * assert block_size <= len(zeros) * * def chunkify(self, fd=None, fh=-1, fmap=None): # <<<<<<<<<<<<<< * """ * Cut a file into chunks. */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_7chunker_12ChunkerFixed_3chunkify, 0, __pyx_n_s_ChunkerFixed_chunkify, NULL, __pyx_n_s_borg_chunker, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__21); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_chunkify, __pyx_t_2) < 0) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/chunker.pyx":127 * * * class ChunkerFixed: # <<<<<<<<<<<<<< * """ * This is a simple chunker for input data with data usually staying at same */ __pyx_t_2 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_ChunkerFixed, __pyx_empty_tuple, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ChunkerFixed, __pyx_t_2) < 0) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/chunker.pyx":251 * self.chunker = chunker_init(hash_window_size, hash_mask, min_size, max_size, seed & 0xffffffff) * * def chunkify(self, fd, fh=-1): # <<<<<<<<<<<<<< * """ * Cut a file into chunks. */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_7chunker_7Chunker_3chunkify, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Chunker_chunkify, NULL, __pyx_n_s_borg_chunker, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__24); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_7chunker_Chunker, __pyx_n_s_chunkify, __pyx_t_3) < 0) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_4borg_7chunker_Chunker); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_7chunker_7Chunker_11__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Chunker___reduce_cython, NULL, __pyx_n_s_borg_chunker, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_7chunker_7Chunker_13__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Chunker___setstate_cython, NULL, __pyx_n_s_borg_chunker, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/chunker.pyx":283 * * * def get_chunker(algo, *params, **kw): # <<<<<<<<<<<<<< * if algo == 'buzhash': * seed = kw['seed'] */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_7chunker_12get_chunker, 0, __pyx_n_s_get_chunker, NULL, __pyx_n_s_borg_chunker, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_chunker, __pyx_t_3) < 0) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/chunker.pyx":293 * * * def buzhash(data, unsigned long seed): # <<<<<<<<<<<<<< * cdef uint32_t *table * cdef uint32_t sum */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_7chunker_14buzhash, 0, __pyx_n_s_buzhash, NULL, __pyx_n_s_borg_chunker, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_buzhash, __pyx_t_3) < 0) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/chunker.pyx":302 * * * def buzhash_update(uint32_t sum, unsigned char remove, unsigned char add, size_t len, unsigned long seed): # <<<<<<<<<<<<<< * cdef uint32_t *table * table = buzhash_init_table(seed & 0xffffffff) */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_7chunker_16buzhash_update, 0, __pyx_n_s_buzhash_update, NULL, __pyx_n_s_borg_chunker, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_buzhash_update, __pyx_t_3) < 0) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/chunker.pyx":1 * # -*- coding: utf-8 -*- # <<<<<<<<<<<<<< * * API_VERSION = '1.4_01' */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init borg.chunker", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init borg.chunker"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* GetAttr */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { #if CYTHON_USE_TYPE_SLOTS #if PY_MAJOR_VERSION >= 3 if (likely(PyUnicode_Check(n))) #else if (likely(PyString_Check(n))) #endif return __Pyx_PyObject_GetAttrStr(o, n); #endif return PyObject_GetAttr(o, n); } /* HasAttr */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { PyObject *r; if (unlikely(!__Pyx_PyBaseString_Check(n))) { PyErr_SetString(PyExc_TypeError, "hasattr(): attribute name must be string"); return -1; } r = __Pyx_GetAttr(o, n); if (!r) { PyErr_Clear(); return 0; } else { Py_DECREF(r); return 1; } } #endif /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return -1; __Pyx_PyErr_Clear(); return 0; } return 0; } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } return __Pyx_IterFinish(); } /* GetTopmostException */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) { _PyErr_StackItem *exc_info = tstate->exc_info; while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && exc_info->previous_item != NULL) { exc_info = exc_info->previous_item; } return exc_info; } #endif /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); PyObject *exc_value = exc_info->exc_value; if (exc_value == NULL || exc_value == Py_None) { *value = NULL; *type = NULL; *tb = NULL; } else { *value = exc_value; Py_INCREF(*value); *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); *tb = PyException_GetTraceback(exc_value); } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); *type = exc_info->exc_type; *value = exc_info->exc_value; *tb = exc_info->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #else *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #endif } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; PyObject *tmp_value = exc_info->exc_value; exc_info->exc_value = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = type; exc_info->exc_value = value; exc_info->exc_traceback = tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } #endif /* GetException */ #if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) #endif { PyObject *local_type = NULL, *local_value, *local_tb = NULL; #if CYTHON_FAST_THREAD_STATE PyObject *tmp_type, *tmp_value, *tmp_tb; #if PY_VERSION_HEX >= 0x030C00A6 local_value = tstate->current_exception; tstate->current_exception = 0; if (likely(local_value)) { local_type = (PyObject*) Py_TYPE(local_value); Py_INCREF(local_type); local_tb = PyException_GetTraceback(local_value); } #else local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 if (unlikely(tstate->current_exception)) #elif CYTHON_FAST_THREAD_STATE if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE #if CYTHON_USE_EXC_INFO_STACK { _PyErr_StackItem *exc_info = tstate->exc_info; #if PY_VERSION_HEX >= 0x030B00a4 tmp_value = exc_info->exc_value; exc_info->exc_value = local_value; tmp_type = NULL; tmp_tb = NULL; Py_XDECREF(local_type); Py_XDECREF(local_tb); #else tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = local_type; exc_info->exc_value = local_value; exc_info->exc_traceback = local_tb; #endif } #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } /* SwapException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; tmp_value = exc_info->exc_value; exc_info->exc_value = *value; if (tmp_value == NULL || tmp_value == Py_None) { Py_XDECREF(tmp_value); tmp_value = NULL; tmp_type = NULL; tmp_tb = NULL; } else { tmp_type = (PyObject*) Py_TYPE(tmp_value); Py_INCREF(tmp_type); #if CYTHON_COMPILING_IN_CPYTHON tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback; Py_XINCREF(tmp_tb); #else tmp_tb = PyException_GetTraceback(tmp_value); #endif } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = *type; exc_info->exc_value = *value; exc_info->exc_traceback = *tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = *type; tstate->exc_value = *value; tstate->exc_traceback = *tb; #endif *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); PyErr_SetExcInfo(*type, *value, *tb); *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #endif /* pep479 */ static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) { PyObject *exc, *val, *tb, *cur_exc; __Pyx_PyThreadState_declare #ifdef __Pyx_StopAsyncIteration_USED int is_async_stopiteration = 0; #endif CYTHON_MAYBE_UNUSED_VAR(in_async_gen); cur_exc = PyErr_Occurred(); if (likely(!__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopIteration))) { #ifdef __Pyx_StopAsyncIteration_USED if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, __Pyx_PyExc_StopAsyncIteration))) { is_async_stopiteration = 1; } else #endif return; } __Pyx_PyThreadState_assign __Pyx_GetException(&exc, &val, &tb); Py_XDECREF(exc); Py_XDECREF(val); Py_XDECREF(tb); PyErr_SetString(PyExc_RuntimeError, #ifdef __Pyx_StopAsyncIteration_USED is_async_stopiteration ? "async generator raised StopAsyncIteration" : in_async_gen ? "async generator raised StopIteration" : #endif "generator raised StopIteration"); } /* PyObjectSetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_setattr)) return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); #endif return PyObject_SetAttr(obj, attr_name, value); } #endif /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long x; long a = PyInt_AS_LONG(op1); x = (long)((unsigned long)a + (unsigned long)b); if (likely((x^a) >= 0 || (x^b) >= 0)) return PyInt_FromLong(x); return PyLong_Type.tp_as_number->nb_add(op1, op2); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; #endif if (unlikely(__Pyx_PyLong_IsZero(op1))) { return __Pyx_NewRef(op2); } if (likely(__Pyx_PyLong_IsCompact(op1))) { a = __Pyx_PyLong_CompactValue(op1); } else { const digit* digits = __Pyx_PyLong_Digits(op1); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_add(op1, op2); } } x = a + b; return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla + llb; return PyLong_FromLongLong(llx); #endif } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif double result; PyFPE_START_PROTECT("add", return NULL) result = ((double)a) + (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); } #endif /* KeywordStringCheck */ static int __Pyx_CheckKeywordStrings( PyObject *kw, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0)) goto invalid_keyword; return 1; #else if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) { Py_ssize_t kwsize; #if CYTHON_ASSUME_SAFE_MACROS kwsize = PyTuple_GET_SIZE(kw); #else kwsize = PyTuple_Size(kw); if (kwsize < 0) return 0; #endif if (unlikely(kwsize == 0)) return 1; if (!kw_allowed) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, 0); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif goto invalid_keyword; } #if PY_VERSION_HEX < 0x03090000 for (pos = 0; pos < kwsize; pos++) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, pos); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } #endif return 1; } while (PyDict_Next(kw, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if (!kw_allowed && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } /* DictGetItem */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { PyObject *value; value = PyDict_GetItemWithError(d, key); if (unlikely(!value)) { if (!PyErr_Occurred()) { if (unlikely(PyTuple_Check(key))) { PyObject* args = PyTuple_Pack(1, key); if (likely(args)) { PyErr_SetObject(PyExc_KeyError, args); Py_DECREF(args); } } else { PyErr_SetObject(PyExc_KeyError, key); } } return NULL; } Py_INCREF(value); return value; } #endif /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP __Pyx_TypeName type_name; PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) #elif PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (likely(descr != NULL)) { *method = descr; return 0; } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(name)); #endif __Pyx_DECREF_TypeName(type_name); return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_CallOneArg(method, obj); Py_DECREF(method); return result; } if (unlikely(!method)) goto bad; result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* ValidateBasesTuple */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; #if CYTHON_ASSUME_SAFE_MACROS n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); if (n < 0) return -1; #endif for (i = 1; i < n; i++) { #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; #elif CYTHON_ASSUME_SAFE_MACROS PyObject *b0 = PyTuple_GET_ITEM(bases, i); #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; #endif PyTypeObject *b; #if PY_MAJOR_VERSION < 3 if (PyClass_Check(b0)) { PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); __Pyx_DECREF_TypeName(b_name); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); if (!py_b_dictoffset) goto dictoffset_return; b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); Py_DECREF(py_b_dictoffset); if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; #endif if (b_dictoffset) { { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "extension type '%.200s' has no __dict__ slot, " "but base type '" __Pyx_FMT_TYPENAME "' has: " "either add 'cdef dict __dict__' to the extension type " "or add '__slots__ = [...]' to the base type", type_name, b_name); __Pyx_DECREF_TypeName(b_name); } #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif } return 0; } #endif /* PyType_Ready */ static int __Pyx_PyType_Ready(PyTypeObject *t) { #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS (void)__Pyx_validate_bases_tuple; #endif return PyType_Ready(t); #else int r; PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 gc_was_enabled = PyGC_Disable(); (void)__Pyx_PyObject_CallMethod0; #else PyObject *ret, *py_status; PyObject *gc = NULL; #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) gc = PyImport_GetModule(__pyx_kp_u_gc); #endif if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); if (unlikely(!gc)) return -1; py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; } gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; } Py_DECREF(ret); } else if (unlikely(gc_was_enabled == -1)) { Py_DECREF(gc); return -1; } #endif t->tp_flags |= Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A0000 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; #endif #else (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) PyGC_Enable(); #else if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); } else { Py_XDECREF(tp); Py_XDECREF(v); Py_XDECREF(tb); r = -1; } } Py_DECREF(gc); #endif } #endif return r; #endif } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, attr_name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(attr_name)); #endif __Pyx_DECREF_TypeName(type_name); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* PyObject_GenericGetAttr */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { return PyObject_GenericGetAttr(obj, attr_name); } return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); } #endif /* SetupReduce */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { int ret; PyObject *name_attr; name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name); if (likely(name_attr)) { ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); } else { ret = -1; } if (unlikely(ret < 0)) { PyErr_Clear(); ret = 0; } Py_XDECREF(name_attr); return ret; } static int __Pyx_setup_reduce(PyObject* type_obj) { int ret = 0; PyObject *object_reduce = NULL; PyObject *object_getstate = NULL; PyObject *object_reduce_ex = NULL; PyObject *reduce = NULL; PyObject *reduce_ex = NULL; PyObject *reduce_cython = NULL; PyObject *setstate = NULL; PyObject *setstate_cython = NULL; PyObject *getstate = NULL; #if CYTHON_USE_PYTYPE_LOOKUP getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate); #else getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate); if (!getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (getstate) { #if CYTHON_USE_PYTYPE_LOOKUP object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate); #else object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate); if (!object_getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (object_getstate != getstate) { goto __PYX_GOOD; } } #if CYTHON_USE_PYTYPE_LOOKUP object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #else object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #endif reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; if (reduce_ex == object_reduce_ex) { #if CYTHON_USE_PYTYPE_LOOKUP object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #else object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #endif reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); if (likely(reduce_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (reduce == object_reduce || PyErr_Occurred()) { goto __PYX_BAD; } setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate); if (!setstate) PyErr_Clear(); if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); if (likely(setstate_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (!setstate || PyErr_Occurred()) { goto __PYX_BAD; } } PyType_Modified((PyTypeObject*)type_obj); } } goto __PYX_GOOD; __PYX_BAD: if (!PyErr_Occurred()) { __Pyx_TypeName type_obj_name = __Pyx_PyType_GetName((PyTypeObject*)type_obj); PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name); __Pyx_DECREF_TypeName(type_obj_name); } ret = -1; __PYX_GOOD: #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); Py_XDECREF(object_getstate); Py_XDECREF(getstate); #endif Py_XDECREF(reduce); Py_XDECREF(reduce_ex); Py_XDECREF(reduce_cython); Py_XDECREF(setstate); Py_XDECREF(setstate_cython); return ret; } #endif /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s__4; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__5); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* CalculateMetaclass */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases; #if CYTHON_ASSUME_SAFE_MACROS nbases = PyTuple_GET_SIZE(bases); #else nbases = PyTuple_Size(bases); if (nbases < 0) return NULL; #endif for (i=0; i < nbases; i++) { PyTypeObject *tmptype; #if CYTHON_ASSUME_SAFE_MACROS PyObject *tmp = PyTuple_GET_ITEM(bases, i); #else PyObject *tmp = PyTuple_GetItem(bases, i); if (!tmp) return NULL; #endif tmptype = Py_TYPE(tmp); #if PY_MAJOR_VERSION < 3 if (tmptype == &PyClass_Type) continue; #endif if (!metaclass) { metaclass = tmptype; continue; } if (PyType_IsSubtype(metaclass, tmptype)) continue; if (PyType_IsSubtype(tmptype, metaclass)) { metaclass = tmptype; continue; } PyErr_SetString(PyExc_TypeError, "metaclass conflict: " "the metaclass of a derived class " "must be a (non-strict) subclass " "of the metaclasses of all its bases"); return NULL; } if (!metaclass) { #if PY_MAJOR_VERSION < 3 metaclass = &PyClass_Type; #else metaclass = &PyType_Type; #endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; } /* PyObjectCall2Args */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args[3] = {NULL, arg1, arg2}; return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectLookupSpecial */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) { PyObject *res; PyTypeObject *tp = Py_TYPE(obj); #if PY_MAJOR_VERSION < 3 if (unlikely(PyInstance_Check(obj))) return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name); #endif res = _PyType_Lookup(tp, attr_name); if (likely(res)) { descrgetfunc f = Py_TYPE(res)->tp_descr_get; if (!f) { Py_INCREF(res); } else { res = f(res, obj, (PyObject *)tp); } } else if (with_error) { PyErr_SetObject(PyExc_AttributeError, attr_name); } return res; } #endif /* Py3ClassCreate */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; if (metaclass) { PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare); if (prep) { PyObject *pargs[3] = {NULL, name, bases}; ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); Py_DECREF(prep); } else { if (unlikely(PyErr_Occurred())) return NULL; ns = PyDict_New(); } } else { ns = PyDict_New(); } if (unlikely(!ns)) return NULL; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; #if PY_VERSION_HEX >= 0x03030000 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; #else CYTHON_MAYBE_UNUSED_VAR(qualname); #endif if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; return ns; bad: Py_DECREF(ns); return NULL; } #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS static int __Pyx_SetNamesPEP487(PyObject *type_obj) { PyTypeObject *type = (PyTypeObject*) type_obj; PyObject *names_to_set, *key, *value, *set_name, *tmp; Py_ssize_t i = 0; #if CYTHON_USE_TYPE_SLOTS names_to_set = PyDict_Copy(type->tp_dict); #else { PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict); names_to_set = NULL; if (likely(d)) { PyObject *names_to_set = PyDict_New(); int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1; Py_DECREF(d); if (unlikely(ret < 0)) Py_CLEAR(names_to_set); } } #endif if (unlikely(names_to_set == NULL)) goto bad; while (PyDict_Next(names_to_set, &i, &key, &value)) { set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name); if (unlikely(set_name != NULL)) { tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key); Py_DECREF(set_name); if (unlikely(tmp == NULL)) { __Pyx_TypeName value_type_name = __Pyx_PyType_GetName(Py_TYPE(value)); __Pyx_TypeName type_name = __Pyx_PyType_GetName(type); PyErr_Format(PyExc_RuntimeError, #if PY_MAJOR_VERSION >= 3 "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'", value_type_name, key, type_name); #else "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'", value_type_name, PyString_Check(key) ? PyString_AS_STRING(key) : "?", type_name); #endif goto bad; } else { Py_DECREF(tmp); } } else if (unlikely(PyErr_Occurred())) { goto bad; } } Py_DECREF(names_to_set); return 0; bad: Py_XDECREF(names_to_set); return -1; } static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) { #if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS PyTypeObject *type = (PyTypeObject*) type_obj; PyObject *mro = type->tp_mro; Py_ssize_t i, nbases; if (unlikely(!mro)) goto done; (void) &__Pyx_GetBuiltinName; Py_INCREF(mro); nbases = PyTuple_GET_SIZE(mro); assert(PyTuple_GET_ITEM(mro, 0) == type_obj); for (i = 1; i < nbases-1; i++) { PyObject *base, *dict, *meth; base = PyTuple_GET_ITEM(mro, i); dict = ((PyTypeObject *)base)->tp_dict; meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass); if (unlikely(meth)) { descrgetfunc f = Py_TYPE(meth)->tp_descr_get; PyObject *res; Py_INCREF(meth); if (likely(f)) { res = f(meth, NULL, type_obj); Py_DECREF(meth); if (unlikely(!res)) goto bad; meth = res; } res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw); Py_DECREF(meth); if (unlikely(!res)) goto bad; Py_DECREF(res); goto done; } else if (unlikely(PyErr_Occurred())) { goto bad; } } done: Py_XDECREF(mro); return type_obj; bad: Py_XDECREF(mro); Py_DECREF(type_obj); return NULL; #else PyObject *super_type, *super, *func, *res; #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) super_type = __Pyx_GetBuiltinName(__pyx_n_s_super); #else super_type = (PyObject*) &PySuper_Type; (void) &__Pyx_GetBuiltinName; #endif super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL; #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) Py_XDECREF(super_type); #endif if (unlikely(!super)) { Py_CLEAR(type_obj); goto done; } func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass); Py_DECREF(super); if (likely(!func)) { if (unlikely(PyErr_Occurred())) Py_CLEAR(type_obj); goto done; } res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw); Py_DECREF(func); if (unlikely(!res)) Py_CLEAR(type_obj); Py_XDECREF(res); done: return type_obj; #endif } #endif static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass) { PyObject *result; PyObject *owned_metaclass = NULL; PyObject *margs[4] = {NULL, name, bases, dict}; if (allow_py2_metaclass) { owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { PyErr_Clear(); } else { return NULL; } } if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); Py_XDECREF(owned_metaclass); if (unlikely(!metaclass)) return NULL; owned_metaclass = metaclass; } result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, #if PY_VERSION_HEX < 0x030600A4 (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw #else mkw #endif ); Py_XDECREF(owned_metaclass); #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS if (likely(result) && likely(PyType_Check(result))) { if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) { Py_CLEAR(result); } else { result = __Pyx_InitSubclassPEP487(result, mkw); } } #else (void) &__Pyx_GetBuiltinName; #endif return result; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (int) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (int) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = __Pyx_NewRef(v); } val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntFromPy */ static CYTHON_INLINE unsigned long __Pyx_PyInt_As_unsigned_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const unsigned long neg_one = (unsigned long) -1, const_zero = (unsigned long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(unsigned long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(unsigned long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (unsigned long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(unsigned long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(unsigned long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned long) >= 2 * PyLong_SHIFT)) { return (unsigned long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); } } break; case 3: if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned long) >= 3 * PyLong_SHIFT)) { return (unsigned long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); } } break; case 4: if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned long) >= 4 * PyLong_SHIFT)) { return (unsigned long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (unsigned long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(unsigned long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(unsigned long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(unsigned long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(unsigned long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(unsigned long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(unsigned long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned long) - 1 > 2 * PyLong_SHIFT)) { return (unsigned long) (((unsigned long)-1)*(((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))); } } break; case 2: if ((8 * sizeof(unsigned long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned long) - 1 > 2 * PyLong_SHIFT)) { return (unsigned long) ((((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))); } } break; case -3: if ((8 * sizeof(unsigned long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned long) - 1 > 3 * PyLong_SHIFT)) { return (unsigned long) (((unsigned long)-1)*(((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))); } } break; case 3: if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned long) - 1 > 3 * PyLong_SHIFT)) { return (unsigned long) ((((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))); } } break; case -4: if ((8 * sizeof(unsigned long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned long) - 1 > 4 * PyLong_SHIFT)) { return (unsigned long) (((unsigned long)-1)*(((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))); } } break; case 4: if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned long) - 1 > 4 * PyLong_SHIFT)) { return (unsigned long) ((((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))); } } break; } } #endif if ((sizeof(unsigned long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(unsigned long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(unsigned long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(unsigned long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { unsigned long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (unsigned long) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (unsigned long) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (unsigned long) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (unsigned long) -1; } else { stepval = __Pyx_NewRef(v); } val = (unsigned long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(unsigned long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((unsigned long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(unsigned long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((unsigned long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((unsigned long) 1) << (sizeof(unsigned long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (unsigned long) -1; } } else { unsigned long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (unsigned long) -1; val = __Pyx_PyInt_As_unsigned_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to unsigned long"); return (unsigned long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to unsigned long"); return (unsigned long) -1; } /* CIntFromPy */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(uint32_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint32_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint32_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(uint32_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 2 * PyLong_SHIFT)) { return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 3: if ((8 * sizeof(uint32_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 3 * PyLong_SHIFT)) { return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 4: if ((8 * sizeof(uint32_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 4 * PyLong_SHIFT)) { return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint32_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(uint32_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint32_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(uint32_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 2: if ((8 * sizeof(uint32_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { return (uint32_t) ((((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -3: if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 3: if ((8 * sizeof(uint32_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { return (uint32_t) ((((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -4: if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 4: if ((8 * sizeof(uint32_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT)) { return (uint32_t) ((((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; } } #endif if ((sizeof(uint32_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint32_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { uint32_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (uint32_t) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (uint32_t) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint32_t) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (uint32_t) -1; } else { stepval = __Pyx_NewRef(v); } val = (uint32_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(uint32_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((uint32_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(uint32_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((uint32_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((uint32_t) 1) << (sizeof(uint32_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (uint32_t) -1; } } else { uint32_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint32_t) -1; val = __Pyx_PyInt_As_uint32_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint32_t"); return (uint32_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint32_t"); return (uint32_t) -1; } /* CIntFromPy */ static CYTHON_INLINE unsigned char __Pyx_PyInt_As_unsigned_char(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const unsigned char neg_one = (unsigned char) -1, const_zero = (unsigned char) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(unsigned char) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(unsigned char, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (unsigned char) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(unsigned char, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(unsigned char) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned char) >= 2 * PyLong_SHIFT)) { return (unsigned char) (((((unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])); } } break; case 3: if ((8 * sizeof(unsigned char) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned char) >= 3 * PyLong_SHIFT)) { return (unsigned char) (((((((unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])); } } break; case 4: if ((8 * sizeof(unsigned char) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned char) >= 4 * PyLong_SHIFT)) { return (unsigned char) (((((((((unsigned char)digits[3]) << PyLong_SHIFT) | (unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (unsigned char) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(unsigned char) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(unsigned char, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(unsigned char) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(unsigned char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(unsigned char, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(unsigned char) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned char) - 1 > 2 * PyLong_SHIFT)) { return (unsigned char) (((unsigned char)-1)*(((((unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]))); } } break; case 2: if ((8 * sizeof(unsigned char) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned char) - 1 > 2 * PyLong_SHIFT)) { return (unsigned char) ((((((unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]))); } } break; case -3: if ((8 * sizeof(unsigned char) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned char) - 1 > 3 * PyLong_SHIFT)) { return (unsigned char) (((unsigned char)-1)*(((((((unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]))); } } break; case 3: if ((8 * sizeof(unsigned char) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned char) - 1 > 3 * PyLong_SHIFT)) { return (unsigned char) ((((((((unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]))); } } break; case -4: if ((8 * sizeof(unsigned char) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned char) - 1 > 4 * PyLong_SHIFT)) { return (unsigned char) (((unsigned char)-1)*(((((((((unsigned char)digits[3]) << PyLong_SHIFT) | (unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]))); } } break; case 4: if ((8 * sizeof(unsigned char) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned char) - 1 > 4 * PyLong_SHIFT)) { return (unsigned char) ((((((((((unsigned char)digits[3]) << PyLong_SHIFT) | (unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]))); } } break; } } #endif if ((sizeof(unsigned char) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(unsigned char, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(unsigned char) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(unsigned char, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { unsigned char val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (unsigned char) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (unsigned char) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (unsigned char) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (unsigned char) -1; } else { stepval = __Pyx_NewRef(v); } val = (unsigned char) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(unsigned char) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((unsigned char) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(unsigned char) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((unsigned char) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((unsigned char) 1) << (sizeof(unsigned char) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (unsigned char) -1; } } else { unsigned char val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (unsigned char) -1; val = __Pyx_PyInt_As_unsigned_char(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to unsigned char"); return (unsigned char) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to unsigned char"); return (unsigned char) -1; } /* CIntFromPy */ static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const size_t neg_one = (size_t) -1, const_zero = (size_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(size_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (size_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(size_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(size_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) >= 2 * PyLong_SHIFT)) { return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } } break; case 3: if ((8 * sizeof(size_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) >= 3 * PyLong_SHIFT)) { return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } } break; case 4: if ((8 * sizeof(size_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) >= 4 * PyLong_SHIFT)) { return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (size_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(size_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(size_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) { return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); } } break; case 2: if ((8 * sizeof(size_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) { return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); } } break; case -3: if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) { return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); } } break; case 3: if ((8 * sizeof(size_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) { return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); } } break; case -4: if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT)) { return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); } } break; case 4: if ((8 * sizeof(size_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT)) { return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); } } break; } } #endif if ((sizeof(size_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(size_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { size_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (size_t) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (size_t) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (size_t) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (size_t) -1; } else { stepval = __Pyx_NewRef(v); } val = (size_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(size_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((size_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(size_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((size_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((size_t) 1) << (sizeof(size_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (size_t) -1; } } else { size_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (size_t) -1; val = __Pyx_PyInt_As_size_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to size_t"); return (size_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to size_t"); return (size_t) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const unsigned long neg_one = (unsigned long) -1, const_zero = (unsigned long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(unsigned long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(unsigned long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(unsigned long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(unsigned long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(unsigned long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(unsigned long), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(unsigned long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint32_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint32_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint32_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(uint32_t), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint32_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__35); } return name; } #endif /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (long) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (long) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = __Pyx_NewRef(v); } val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A2) static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); Py_DECREF(method); return result; } #endif static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { #if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2 PyObject *args[2] = {obj, arg}; (void) __Pyx_PyObject_GetMethod; (void) __Pyx_PyObject_CallOneArg; (void) __Pyx_PyObject_Call2Args; return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); #else PyObject *method = NULL, *result; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_Call2Args(method, obj, arg); Py_DECREF(method); return result; } if (unlikely(!method)) return NULL; return __Pyx__PyObject_CallMethod1(method, arg); #endif } /* CoroutineBase */ #include #if PY_VERSION_HEX >= 0x030b00a6 #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyObject **pvalue) { PyObject *et, *ev, *tb; PyObject *value = NULL; CYTHON_UNUSED_VAR(__pyx_tstate); __Pyx_ErrFetch(&et, &ev, &tb); if (!et) { Py_XDECREF(tb); Py_XDECREF(ev); Py_INCREF(Py_None); *pvalue = Py_None; return 0; } if (likely(et == PyExc_StopIteration)) { if (!ev) { Py_INCREF(Py_None); value = Py_None; } #if PY_VERSION_HEX >= 0x030300A0 else if (likely(__Pyx_IS_TYPE(ev, (PyTypeObject*)PyExc_StopIteration))) { value = ((PyStopIterationObject *)ev)->value; Py_INCREF(value); Py_DECREF(ev); } #endif else if (unlikely(PyTuple_Check(ev))) { if (PyTuple_GET_SIZE(ev) >= 1) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS value = PyTuple_GET_ITEM(ev, 0); Py_INCREF(value); #else value = PySequence_ITEM(ev, 0); #endif } else { Py_INCREF(Py_None); value = Py_None; } Py_DECREF(ev); } else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) { value = ev; } if (likely(value)) { Py_XDECREF(tb); Py_DECREF(et); *pvalue = value; return 0; } } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) { __Pyx_ErrRestore(et, ev, tb); return -1; } PyErr_NormalizeException(&et, &ev, &tb); if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) { __Pyx_ErrRestore(et, ev, tb); return -1; } Py_XDECREF(tb); Py_DECREF(et); #if PY_VERSION_HEX >= 0x030300A0 value = ((PyStopIterationObject *)ev)->value; Py_INCREF(value); Py_DECREF(ev); #else { PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args); Py_DECREF(ev); if (likely(args)) { value = PySequence_GetItem(args, 0); Py_DECREF(args); } if (unlikely(!value)) { __Pyx_ErrRestore(NULL, NULL, NULL); Py_INCREF(Py_None); value = Py_None; } } #endif *pvalue = value; return 0; } static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) { #if PY_VERSION_HEX >= 0x030B00a4 Py_CLEAR(exc_state->exc_value); #else PyObject *t, *v, *tb; t = exc_state->exc_type; v = exc_state->exc_value; tb = exc_state->exc_traceback; exc_state->exc_type = NULL; exc_state->exc_value = NULL; exc_state->exc_traceback = NULL; Py_XDECREF(t); Py_XDECREF(v); Py_XDECREF(tb); #endif } #define __Pyx_Coroutine_AlreadyRunningError(gen) (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL) static void __Pyx__Coroutine_AlreadyRunningError(__pyx_CoroutineObject *gen) { const char *msg; CYTHON_MAYBE_UNUSED_VAR(gen); if ((0)) { #ifdef __Pyx_Coroutine_USED } else if (__Pyx_Coroutine_Check((PyObject*)gen)) { msg = "coroutine already executing"; #endif #ifdef __Pyx_AsyncGen_USED } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) { msg = "async generator already executing"; #endif } else { msg = "generator already executing"; } PyErr_SetString(PyExc_ValueError, msg); } #define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL) static void __Pyx__Coroutine_NotStartedError(PyObject *gen) { const char *msg; CYTHON_MAYBE_UNUSED_VAR(gen); if ((0)) { #ifdef __Pyx_Coroutine_USED } else if (__Pyx_Coroutine_Check(gen)) { msg = "can't send non-None value to a just-started coroutine"; #endif #ifdef __Pyx_AsyncGen_USED } else if (__Pyx_AsyncGen_CheckExact(gen)) { msg = "can't send non-None value to a just-started async generator"; #endif } else { msg = "can't send non-None value to a just-started generator"; } PyErr_SetString(PyExc_TypeError, msg); } #define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL) static void __Pyx__Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *value, int closing) { CYTHON_MAYBE_UNUSED_VAR(gen); CYTHON_MAYBE_UNUSED_VAR(closing); #ifdef __Pyx_Coroutine_USED if (!closing && __Pyx_Coroutine_Check(gen)) { PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine"); } else #endif if (value) { #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(gen)) PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration); else #endif PyErr_SetNone(PyExc_StopIteration); } } static PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) { __Pyx_PyThreadState_declare PyThreadState *tstate; __Pyx_ExcInfoStruct *exc_state; PyObject *retval; assert(!self->is_running); if (unlikely(self->resume_label == 0)) { if (unlikely(value && value != Py_None)) { return __Pyx_Coroutine_NotStartedError((PyObject*)self); } } if (unlikely(self->resume_label == -1)) { return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing); } #if CYTHON_FAST_THREAD_STATE __Pyx_PyThreadState_assign tstate = __pyx_tstate; #else tstate = __Pyx_PyThreadState_Current; #endif exc_state = &self->gi_exc_state; if (exc_state->exc_value) { #if CYTHON_COMPILING_IN_PYPY #else PyObject *exc_tb; #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON exc_tb = PyException_GetTraceback(exc_state->exc_value); #elif PY_VERSION_HEX >= 0x030B00a4 exc_tb = ((PyBaseExceptionObject*) exc_state->exc_value)->traceback; #else exc_tb = exc_state->exc_traceback; #endif if (exc_tb) { PyTracebackObject *tb = (PyTracebackObject *) exc_tb; PyFrameObject *f = tb->tb_frame; assert(f->f_back == NULL); #if PY_VERSION_HEX >= 0x030B00A1 f->f_back = PyThreadState_GetFrame(tstate); #else Py_XINCREF(tstate->frame); f->f_back = tstate->frame; #endif #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON Py_DECREF(exc_tb); #endif } #endif } #if CYTHON_USE_EXC_INFO_STACK exc_state->previous_item = tstate->exc_info; tstate->exc_info = exc_state; #else if (exc_state->exc_type) { __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback); } else { __Pyx_Coroutine_ExceptionClear(exc_state); __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback); } #endif self->is_running = 1; retval = self->body(self, tstate, value); self->is_running = 0; #if CYTHON_USE_EXC_INFO_STACK exc_state = &self->gi_exc_state; tstate->exc_info = exc_state->previous_item; exc_state->previous_item = NULL; __Pyx_Coroutine_ResetFrameBackpointer(exc_state); #endif return retval; } static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) { #if CYTHON_COMPILING_IN_PYPY CYTHON_UNUSED_VAR(exc_state); #else PyObject *exc_tb; #if PY_VERSION_HEX >= 0x030B00a4 if (!exc_state->exc_value) return; exc_tb = PyException_GetTraceback(exc_state->exc_value); #else exc_tb = exc_state->exc_traceback; #endif if (likely(exc_tb)) { PyTracebackObject *tb = (PyTracebackObject *) exc_tb; PyFrameObject *f = tb->tb_frame; Py_CLEAR(f->f_back); #if PY_VERSION_HEX >= 0x030B00a4 Py_DECREF(exc_tb); #endif } #endif } static CYTHON_INLINE PyObject *__Pyx_Coroutine_MethodReturn(PyObject* gen, PyObject *retval) { CYTHON_MAYBE_UNUSED_VAR(gen); if (unlikely(!retval)) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (!__Pyx_PyErr_Occurred()) { PyObject *exc = PyExc_StopIteration; #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(gen)) exc = __Pyx_PyExc_StopAsyncIteration; #endif __Pyx_PyErr_SetNone(exc); } } return retval; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) static CYTHON_INLINE PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) { #if PY_VERSION_HEX <= 0x030A00A1 return _PyGen_Send(gen, arg); #else PyObject *result; if (PyIter_Send((PyObject*)gen, arg ? arg : Py_None, &result) == PYGEN_RETURN) { if (PyAsyncGen_CheckExact(gen)) { assert(result == Py_None); PyErr_SetNone(PyExc_StopAsyncIteration); } else if (result == Py_None) { PyErr_SetNone(PyExc_StopIteration); } else { #if PY_VERSION_HEX < 0x030d00A1 _PyGen_SetStopIterationValue(result); #else if (!PyTuple_Check(result) && !PyExceptionInstance_Check(result)) { PyErr_SetObject(PyExc_StopIteration, result); } else { PyObject *exc = __Pyx_PyObject_CallOneArg(PyExc_StopIteration, result); if (likely(exc != NULL)) { PyErr_SetObject(PyExc_StopIteration, exc); Py_DECREF(exc); } } #endif } Py_DECREF(result); result = NULL; } return result; #endif } #endif static CYTHON_INLINE PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) { PyObject *ret; PyObject *val = NULL; __Pyx_Coroutine_Undelegate(gen); __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val); ret = __Pyx_Coroutine_SendEx(gen, val, 0); Py_XDECREF(val); return ret; } static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) { PyObject *retval; __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; PyObject *yf = gen->yieldfrom; if (unlikely(gen->is_running)) return __Pyx_Coroutine_AlreadyRunningError(gen); if (yf) { PyObject *ret; gen->is_running = 1; #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { ret = __Pyx_Coroutine_Send(yf, value); } else #endif #ifdef __Pyx_Coroutine_USED if (__Pyx_Coroutine_Check(yf)) { ret = __Pyx_Coroutine_Send(yf, value); } else #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_PyAsyncGenASend_CheckExact(yf)) { ret = __Pyx_async_gen_asend_send(yf, value); } else #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) if (PyGen_CheckExact(yf)) { ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); } else #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) if (PyCoro_CheckExact(yf)) { ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); } else #endif { if (value == Py_None) ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf); else ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value); } gen->is_running = 0; if (likely(ret)) { return ret; } retval = __Pyx_Coroutine_FinishDelegation(gen); } else { retval = __Pyx_Coroutine_SendEx(gen, value, 0); } return __Pyx_Coroutine_MethodReturn(self, retval); } static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) { PyObject *retval = NULL; int err = 0; #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { retval = __Pyx_Coroutine_Close(yf); if (!retval) return -1; } else #endif #ifdef __Pyx_Coroutine_USED if (__Pyx_Coroutine_Check(yf)) { retval = __Pyx_Coroutine_Close(yf); if (!retval) return -1; } else if (__Pyx_CoroutineAwait_CheckExact(yf)) { retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL); if (!retval) return -1; } else #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_PyAsyncGenASend_CheckExact(yf)) { retval = __Pyx_async_gen_asend_close(yf, NULL); } else if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) { retval = __Pyx_async_gen_athrow_close(yf, NULL); } else #endif { PyObject *meth; gen->is_running = 1; meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_close); if (unlikely(!meth)) { if (unlikely(PyErr_Occurred())) { PyErr_WriteUnraisable(yf); } } else { retval = __Pyx_PyObject_CallNoArg(meth); Py_DECREF(meth); if (unlikely(!retval)) err = -1; } gen->is_running = 0; } Py_XDECREF(retval); return err; } static PyObject *__Pyx_Generator_Next(PyObject *self) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; PyObject *yf = gen->yieldfrom; if (unlikely(gen->is_running)) return __Pyx_Coroutine_AlreadyRunningError(gen); if (yf) { PyObject *ret; gen->is_running = 1; #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { ret = __Pyx_Generator_Next(yf); } else #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) if (PyGen_CheckExact(yf)) { ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL); } else #endif #ifdef __Pyx_Coroutine_USED if (__Pyx_Coroutine_Check(yf)) { ret = __Pyx_Coroutine_Send(yf, Py_None); } else #endif ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf); gen->is_running = 0; if (likely(ret)) { return ret; } return __Pyx_Coroutine_FinishDelegation(gen); } return __Pyx_Coroutine_SendEx(gen, Py_None, 0); } static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, PyObject *arg) { CYTHON_UNUSED_VAR(arg); return __Pyx_Coroutine_Close(self); } static PyObject *__Pyx_Coroutine_Close(PyObject *self) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; PyObject *retval, *raised_exception; PyObject *yf = gen->yieldfrom; int err = 0; if (unlikely(gen->is_running)) return __Pyx_Coroutine_AlreadyRunningError(gen); if (yf) { Py_INCREF(yf); err = __Pyx_Coroutine_CloseIter(gen, yf); __Pyx_Coroutine_Undelegate(gen); Py_DECREF(yf); } if (err == 0) PyErr_SetNone(PyExc_GeneratorExit); retval = __Pyx_Coroutine_SendEx(gen, NULL, 1); if (unlikely(retval)) { const char *msg; Py_DECREF(retval); if ((0)) { #ifdef __Pyx_Coroutine_USED } else if (__Pyx_Coroutine_Check(self)) { msg = "coroutine ignored GeneratorExit"; #endif #ifdef __Pyx_AsyncGen_USED } else if (__Pyx_AsyncGen_CheckExact(self)) { #if PY_VERSION_HEX < 0x03060000 msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)"; #else msg = "async generator ignored GeneratorExit"; #endif #endif } else { msg = "generator ignored GeneratorExit"; } PyErr_SetString(PyExc_RuntimeError, msg); return NULL; } raised_exception = PyErr_Occurred(); if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) { if (raised_exception) PyErr_Clear(); Py_INCREF(Py_None); return Py_None; } return NULL; } static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb, PyObject *args, int close_on_genexit) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; PyObject *yf = gen->yieldfrom; if (unlikely(gen->is_running)) return __Pyx_Coroutine_AlreadyRunningError(gen); if (yf) { PyObject *ret; Py_INCREF(yf); if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) { int err = __Pyx_Coroutine_CloseIter(gen, yf); Py_DECREF(yf); __Pyx_Coroutine_Undelegate(gen); if (err < 0) return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); goto throw_here; } gen->is_running = 1; if (0 #ifdef __Pyx_Generator_USED || __Pyx_Generator_CheckExact(yf) #endif #ifdef __Pyx_Coroutine_USED || __Pyx_Coroutine_Check(yf) #endif ) { ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit); #ifdef __Pyx_Coroutine_USED } else if (__Pyx_CoroutineAwait_CheckExact(yf)) { ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit); #endif } else { PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_throw); if (unlikely(!meth)) { Py_DECREF(yf); if (unlikely(PyErr_Occurred())) { gen->is_running = 0; return NULL; } __Pyx_Coroutine_Undelegate(gen); gen->is_running = 0; goto throw_here; } if (likely(args)) { ret = __Pyx_PyObject_Call(meth, args, NULL); } else { PyObject *cargs[4] = {NULL, typ, val, tb}; ret = __Pyx_PyObject_FastCall(meth, cargs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } Py_DECREF(meth); } gen->is_running = 0; Py_DECREF(yf); if (!ret) { ret = __Pyx_Coroutine_FinishDelegation(gen); } return __Pyx_Coroutine_MethodReturn(self, ret); } throw_here: __Pyx_Raise(typ, val, tb, NULL); return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); } static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) { PyObject *typ; PyObject *val = NULL; PyObject *tb = NULL; if (unlikely(!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))) return NULL; return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1); } static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) { #if PY_VERSION_HEX >= 0x030B00a4 Py_VISIT(exc_state->exc_value); #else Py_VISIT(exc_state->exc_type); Py_VISIT(exc_state->exc_value); Py_VISIT(exc_state->exc_traceback); #endif return 0; } static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) { Py_VISIT(gen->closure); Py_VISIT(gen->classobj); Py_VISIT(gen->yieldfrom); return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg); } static int __Pyx_Coroutine_clear(PyObject *self) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; Py_CLEAR(gen->closure); Py_CLEAR(gen->classobj); Py_CLEAR(gen->yieldfrom); __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state); #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(self)) { Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer); } #endif Py_CLEAR(gen->gi_code); Py_CLEAR(gen->gi_frame); Py_CLEAR(gen->gi_name); Py_CLEAR(gen->gi_qualname); Py_CLEAR(gen->gi_modulename); return 0; } static void __Pyx_Coroutine_dealloc(PyObject *self) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; PyObject_GC_UnTrack(gen); if (gen->gi_weakreflist != NULL) PyObject_ClearWeakRefs(self); if (gen->resume_label >= 0) { PyObject_GC_Track(self); #if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE if (unlikely(PyObject_CallFinalizerFromDealloc(self))) #else Py_TYPE(gen)->tp_del(self); if (unlikely(Py_REFCNT(self) > 0)) #endif { return; } PyObject_GC_UnTrack(self); } #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(self)) { /* We have to handle this case for asynchronous generators right here, because this code has to be between UNTRACK and GC_Del. */ Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer); } #endif __Pyx_Coroutine_clear(self); __Pyx_PyHeapTypeObject_GC_Del(gen); } static void __Pyx_Coroutine_del(PyObject *self) { PyObject *error_type, *error_value, *error_traceback; __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; __Pyx_PyThreadState_declare if (gen->resume_label < 0) { return; } #if !CYTHON_USE_TP_FINALIZE assert(self->ob_refcnt == 0); __Pyx_SET_REFCNT(self, 1); #endif __Pyx_PyThreadState_assign __Pyx_ErrFetch(&error_type, &error_value, &error_traceback); #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(self)) { __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self; PyObject *finalizer = agen->ag_finalizer; if (finalizer && !agen->ag_closed) { PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self); if (unlikely(!res)) { PyErr_WriteUnraisable(self); } else { Py_DECREF(res); } __Pyx_ErrRestore(error_type, error_value, error_traceback); return; } } #endif if (unlikely(gen->resume_label == 0 && !error_value)) { #ifdef __Pyx_Coroutine_USED #ifdef __Pyx_Generator_USED if (!__Pyx_Generator_CheckExact(self)) #endif { PyObject_GC_UnTrack(self); #if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat) if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0)) PyErr_WriteUnraisable(self); #else {PyObject *msg; char *cmsg; #if CYTHON_COMPILING_IN_PYPY msg = NULL; cmsg = (char*) "coroutine was never awaited"; #else char *cname; PyObject *qualname; qualname = gen->gi_qualname; cname = PyString_AS_STRING(qualname); msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname); if (unlikely(!msg)) { PyErr_Clear(); cmsg = (char*) "coroutine was never awaited"; } else { cmsg = PyString_AS_STRING(msg); } #endif if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0)) PyErr_WriteUnraisable(self); Py_XDECREF(msg);} #endif PyObject_GC_Track(self); } #endif } else { PyObject *res = __Pyx_Coroutine_Close(self); if (unlikely(!res)) { if (PyErr_Occurred()) PyErr_WriteUnraisable(self); } else { Py_DECREF(res); } } __Pyx_ErrRestore(error_type, error_value, error_traceback); #if !CYTHON_USE_TP_FINALIZE assert(Py_REFCNT(self) > 0); if (likely(--self->ob_refcnt == 0)) { return; } { Py_ssize_t refcnt = Py_REFCNT(self); _Py_NewReference(self); __Pyx_SET_REFCNT(self, refcnt); } #if CYTHON_COMPILING_IN_CPYTHON assert(PyType_IS_GC(Py_TYPE(self)) && _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED); _Py_DEC_REFTOTAL; #endif #ifdef COUNT_ALLOCS --Py_TYPE(self)->tp_frees; --Py_TYPE(self)->tp_allocs; #endif #endif } static PyObject * __Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, void *context) { PyObject *name = self->gi_name; CYTHON_UNUSED_VAR(context); if (unlikely(!name)) name = Py_None; Py_INCREF(name); return name; } static int __Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(self->gi_name, value); return 0; } static PyObject * __Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, void *context) { PyObject *name = self->gi_qualname; CYTHON_UNUSED_VAR(context); if (unlikely(!name)) name = Py_None; Py_INCREF(name); return name; } static int __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(self->gi_qualname, value); return 0; } static PyObject * __Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context) { PyObject *frame = self->gi_frame; CYTHON_UNUSED_VAR(context); if (!frame) { if (unlikely(!self->gi_code)) { Py_RETURN_NONE; } frame = (PyObject *) PyFrame_New( PyThreadState_Get(), /*PyThreadState *tstate,*/ (PyCodeObject*) self->gi_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (unlikely(!frame)) return NULL; self->gi_frame = frame; } Py_INCREF(frame); return frame; } static __pyx_CoroutineObject *__Pyx__Coroutine_New( PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, PyObject *name, PyObject *qualname, PyObject *module_name) { __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type); if (unlikely(!gen)) return NULL; return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name); } static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, PyObject *name, PyObject *qualname, PyObject *module_name) { gen->body = body; gen->closure = closure; Py_XINCREF(closure); gen->is_running = 0; gen->resume_label = 0; gen->classobj = NULL; gen->yieldfrom = NULL; #if PY_VERSION_HEX >= 0x030B00a4 gen->gi_exc_state.exc_value = NULL; #else gen->gi_exc_state.exc_type = NULL; gen->gi_exc_state.exc_value = NULL; gen->gi_exc_state.exc_traceback = NULL; #endif #if CYTHON_USE_EXC_INFO_STACK gen->gi_exc_state.previous_item = NULL; #endif gen->gi_weakreflist = NULL; Py_XINCREF(qualname); gen->gi_qualname = qualname; Py_XINCREF(name); gen->gi_name = name; Py_XINCREF(module_name); gen->gi_modulename = module_name; Py_XINCREF(code); gen->gi_code = code; gen->gi_frame = NULL; PyObject_GC_Track(gen); return gen; } /* PatchModuleWithCoroutine */ static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) { #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) int result; PyObject *globals, *result_obj; globals = PyDict_New(); if (unlikely(!globals)) goto ignore; result = PyDict_SetItemString(globals, "_cython_coroutine_type", #ifdef __Pyx_Coroutine_USED (PyObject*)__pyx_CoroutineType); #else Py_None); #endif if (unlikely(result < 0)) goto ignore; result = PyDict_SetItemString(globals, "_cython_generator_type", #ifdef __Pyx_Generator_USED (PyObject*)__pyx_GeneratorType); #else Py_None); #endif if (unlikely(result < 0)) goto ignore; if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore; if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore; result_obj = PyRun_String(py_code, Py_file_input, globals, globals); if (unlikely(!result_obj)) goto ignore; Py_DECREF(result_obj); Py_DECREF(globals); return module; ignore: Py_XDECREF(globals); PyErr_WriteUnraisable(module); if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) { Py_DECREF(module); module = NULL; } #else py_code++; #endif return module; } /* PatchGeneratorABC */ #ifndef CYTHON_REGISTER_ABCS #define CYTHON_REGISTER_ABCS 1 #endif #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) static PyObject* __Pyx_patch_abc_module(PyObject *module); static PyObject* __Pyx_patch_abc_module(PyObject *module) { module = __Pyx_Coroutine_patch_module( module, "" "if _cython_generator_type is not None:\n" " try: Generator = _module.Generator\n" " except AttributeError: pass\n" " else: Generator.register(_cython_generator_type)\n" "if _cython_coroutine_type is not None:\n" " try: Coroutine = _module.Coroutine\n" " except AttributeError: pass\n" " else: Coroutine.register(_cython_coroutine_type)\n" ); return module; } #endif static int __Pyx_patch_abc(void) { #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) static int abc_patched = 0; if (CYTHON_REGISTER_ABCS && !abc_patched) { PyObject *module; module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections"); if (unlikely(!module)) { PyErr_WriteUnraisable(NULL); if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, ((PY_MAJOR_VERSION >= 3) ? "Cython module failed to register with collections.abc module" : "Cython module failed to register with collections module"), 1) < 0)) { return -1; } } else { module = __Pyx_patch_abc_module(module); abc_patched = 1; if (unlikely(!module)) return -1; Py_DECREF(module); } module = PyImport_ImportModule("backports_abc"); if (module) { module = __Pyx_patch_abc_module(module); Py_XDECREF(module); } if (!module) { PyErr_Clear(); } } #else if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL); #endif return 0; } /* Generator */ static PyMethodDef __pyx_Generator_methods[] = { {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O, (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS, (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")}, {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS, (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")}, {0, 0, 0, 0} }; static PyMemberDef __pyx_Generator_memberlist[] = { {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL}, {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY, (char*) PyDoc_STR("object being iterated by 'yield from', or None")}, {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL}, {(char *) "__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0}, #if CYTHON_USE_TYPE_SPECS {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0}, #endif {0, 0, 0, 0, 0} }; static PyGetSetDef __pyx_Generator_getsets[] = { {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name, (char*) PyDoc_STR("name of the generator"), 0}, {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname, (char*) PyDoc_STR("qualified name of the generator"), 0}, {(char *) "gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL, (char*) PyDoc_STR("Frame of the generator"), 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_GeneratorType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_Coroutine_dealloc}, {Py_tp_traverse, (void *)__Pyx_Coroutine_traverse}, {Py_tp_iter, (void *)PyObject_SelfIter}, {Py_tp_iternext, (void *)__Pyx_Generator_Next}, {Py_tp_methods, (void *)__pyx_Generator_methods}, {Py_tp_members, (void *)__pyx_Generator_memberlist}, {Py_tp_getset, (void *)__pyx_Generator_getsets}, {Py_tp_getattro, (void *) __Pyx_PyObject_GenericGetAttrNoDict}, #if CYTHON_USE_TP_FINALIZE {Py_tp_finalize, (void *)__Pyx_Coroutine_del}, #endif {0, 0}, }; static PyType_Spec __pyx_GeneratorType_spec = { __PYX_TYPE_MODULE_PREFIX "generator", sizeof(__pyx_CoroutineObject), 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, __pyx_GeneratorType_slots }; #else static PyTypeObject __pyx_GeneratorType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "generator", sizeof(__pyx_CoroutineObject), 0, (destructor) __Pyx_Coroutine_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, 0, (traverseproc) __Pyx_Coroutine_traverse, 0, 0, offsetof(__pyx_CoroutineObject, gi_weakreflist), 0, (iternextfunc) __Pyx_Generator_Next, __pyx_Generator_methods, __pyx_Generator_memberlist, __pyx_Generator_getsets, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if CYTHON_USE_TP_FINALIZE 0, #else __Pyx_Coroutine_del, #endif 0, #if CYTHON_USE_TP_FINALIZE __Pyx_Coroutine_del, #elif PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_Generator_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_GeneratorType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter; __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type); #endif if (unlikely(!__pyx_GeneratorType)) { return -1; } return 0; } /* CheckBinaryVersion */ static unsigned long __Pyx_get_runtime_version(void) { #if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/chunker.pyx0000644000076500000240000002700014641074756016146 0ustar00twstaff# -*- coding: utf-8 -*- API_VERSION = '1.4_01' import errno import os from collections import namedtuple from .constants import CH_DATA, CH_ALLOC, CH_HOLE, MAX_DATA_SIZE, zeros from libc.stdlib cimport free cdef extern from "_chunker.c": ctypedef int uint32_t ctypedef struct _Chunker "Chunker": pass _Chunker *chunker_init(int window_size, int chunk_mask, int min_size, int max_size, uint32_t seed) void chunker_set_fd(_Chunker *chunker, object f, int fd) void chunker_free(_Chunker *chunker) object chunker_process(_Chunker *chunker) uint32_t *buzhash_init_table(uint32_t seed) uint32_t c_buzhash "buzhash"(unsigned char *data, size_t len, uint32_t *h) uint32_t c_buzhash_update "buzhash_update"(uint32_t sum, unsigned char remove, unsigned char add, size_t len, uint32_t *h) # this will be True if Python's seek implementation supports data/holes seeking. # this does not imply that it will actually work on the filesystem, # because the FS also needs to support this. has_seek_hole = hasattr(os, 'SEEK_DATA') and hasattr(os, 'SEEK_HOLE') _Chunk = namedtuple('_Chunk', 'meta data') _Chunk.__doc__ = """\ Chunk namedtuple meta is always a dictionary, data depends on allocation. data chunk read from a DATA range of a file (not from a sparse hole): meta = {'allocation' = CH_DATA, 'size' = size_of_chunk } data = read_data [bytes or memoryview] all-zero chunk read from a DATA range of a file (not from a sparse hole, but detected to be all-zero): meta = {'allocation' = CH_ALLOC, 'size' = size_of_chunk } data = None all-zero chunk from a HOLE range of a file (from a sparse hole): meta = {'allocation' = CH_HOLE, 'size' = size_of_chunk } data = None """ def Chunk(data, **meta): return _Chunk(meta, data) def dread(offset, size, fd=None, fh=-1): use_fh = fh >= 0 if use_fh: data = os.read(fh, size) if hasattr(os, 'posix_fadvise'): # UNIX only and, in case of block sizes that are not a multiple of the # system's page size, better be used with a bug fixed linux kernel > 4.6.0, # see comment/workaround in _chunker.c and borgbackup issue #907. os.posix_fadvise(fh, offset, len(data), os.POSIX_FADV_DONTNEED) return data else: return fd.read(size) def dseek(amount, whence, fd=None, fh=-1): use_fh = fh >= 0 if use_fh: return os.lseek(fh, amount, whence) else: return fd.seek(amount, whence) def dpos_curr_end(fd=None, fh=-1): """ determine current position, file end position (== file length) """ curr = dseek(0, os.SEEK_CUR, fd, fh) end = dseek(0, os.SEEK_END, fd, fh) dseek(curr, os.SEEK_SET, fd, fh) return curr, end def sparsemap(fd=None, fh=-1): """ generator yielding a (start, length, is_data) tuple for each range. is_data is indicating data ranges (True) or hole ranges (False). note: the map is generated starting from the current seek position (it is not required to be 0 / to be at the start of the file) and work from there up to the end of the file. when the generator is finished, the file pointer position will be reset to where it was before calling this function. """ curr, file_len = dpos_curr_end(fd, fh) start = curr try: whence = os.SEEK_HOLE while True: is_data = whence == os.SEEK_HOLE # True: range with data, False: range is a hole try: end = dseek(start, whence, fd, fh) except OSError as e: if e.errno == errno.ENXIO: if not is_data and start < file_len: # if there is a hole at the end of a file, we can not find the file end by SEEK_DATA # (because we run into ENXIO), thus we must manually deal with this case: end = file_len yield (start, end - start, is_data) break else: raise # we do not want to yield zero-length ranges with start == end: if end > start: yield (start, end - start, is_data) start = end whence = os.SEEK_DATA if is_data else os.SEEK_HOLE finally: # seek to same position as before calling this function dseek(curr, os.SEEK_SET, fd, fh) class ChunkerFixed: """ This is a simple chunker for input data with data usually staying at same offset and / or with known block/record sizes: - raw disk images - block devices - database files with simple header + fixed-size records layout It optionally supports: - a header block of different size - using a sparsemap to only read data ranges and seek over hole ranges for sparse files. - using an externally given filemap to only read specific ranges from a file. Note: the last block of a data or hole range may be less than the block size, this is supported and not considered to be an error. """ def __init__(self, block_size, header_size=0, sparse=False): self.block_size = block_size self.header_size = header_size # should borg try to do sparse input processing? # whether it actually can be done depends on the input file being seekable. self.try_sparse = sparse and has_seek_hole assert block_size <= len(zeros) def chunkify(self, fd=None, fh=-1, fmap=None): """ Cut a file into chunks. :param fd: Python file object :param fh: OS-level file handle (if available), defaults to -1 which means not to use OS-level fd. :param fmap: a file map, same format as generated by sparsemap """ if fmap is None: if self.try_sparse: try: if self.header_size > 0: header_map = [(0, self.header_size, True), ] dseek(self.header_size, os.SEEK_SET, fd, fh) body_map = list(sparsemap(fd, fh)) dseek(0, os.SEEK_SET, fd, fh) else: header_map = [] body_map = list(sparsemap(fd, fh)) except OSError as err: # seeking did not work pass else: fmap = header_map + body_map if fmap is None: # either sparse processing (building the fmap) was not tried or it failed. # in these cases, we just build a "fake fmap" that considers the whole file # as range(s) of data (no holes), so we can use the same code. # we build different fmaps here for the purpose of correct block alignment # with or without a header block (of potentially different size). if self.header_size > 0: header_map = [(0, self.header_size, True), ] body_map = [(self.header_size, 2 ** 62, True), ] else: header_map = [] body_map = [(0, 2 ** 62, True), ] fmap = header_map + body_map offset = 0 for range_start, range_size, is_data in fmap: if range_start != offset: # this is for the case when the fmap does not cover the file completely, # e.g. it could be without the ranges of holes or of unchanged data. offset = range_start dseek(offset, os.SEEK_SET, fd, fh) while range_size: wanted = min(range_size, self.block_size) if is_data: # read block from the range data = dread(offset, wanted, fd, fh) got = len(data) if zeros.startswith(data): data = None allocation = CH_ALLOC else: allocation = CH_DATA else: # hole # seek over block from the range pos = dseek(wanted, os.SEEK_CUR, fd, fh) got = pos - offset data = None allocation = CH_HOLE if got > 0: offset += got range_size -= got yield Chunk(data, size=got, allocation=allocation) if got < wanted: # we did not get enough data, looks like EOF. return cdef class Chunker: """ Content-Defined Chunker, variable chunk sizes. This chunker does quite some effort to mostly cut the same-content chunks, even if the content moves to a different offset inside the file. It uses the buzhash rolling-hash algorithm to identify the chunk cutting places by looking at the content inside the moving window and computing the rolling hash value over the window contents. If the last n bits of the rolling hash are 0, a chunk is cut. Additionally it obeys some more criteria, like a minimum and maximum chunk size. It also uses a per-repo random seed to avoid some chunk length fingerprinting attacks. """ cdef _Chunker *chunker def __cinit__(self, int seed, int chunk_min_exp, int chunk_max_exp, int hash_mask_bits, int hash_window_size): min_size = 1 << chunk_min_exp max_size = 1 << chunk_max_exp assert max_size <= len(zeros) # see chunker_process, first while loop condition, first term must be able to get True: assert hash_window_size + min_size + 1 <= max_size, "too small max_size" hash_mask = (1 << hash_mask_bits) - 1 self.chunker = chunker_init(hash_window_size, hash_mask, min_size, max_size, seed & 0xffffffff) def chunkify(self, fd, fh=-1): """ Cut a file into chunks. :param fd: Python file object :param fh: OS-level file handle (if available), defaults to -1 which means not to use OS-level fd. """ chunker_set_fd(self.chunker, fd, fh) return self def __dealloc__(self): if self.chunker: chunker_free(self.chunker) def __iter__(self): return self def __next__(self): data = chunker_process(self.chunker) got = len(data) # we do not have SEEK_DATA/SEEK_HOLE support in chunker_process C code, # but we can just check if data was all-zero (and either came from a hole # or from stored zeros - we can not detect that here). if zeros.startswith(data): data = None allocation = CH_ALLOC else: allocation = CH_DATA return Chunk(data, size=got, allocation=allocation) def get_chunker(algo, *params, **kw): if algo == 'buzhash': seed = kw['seed'] return Chunker(seed, *params) if algo == 'fixed': sparse = kw['sparse'] return ChunkerFixed(*params, sparse=sparse) raise TypeError('unsupported chunker algo %r' % algo) def buzhash(data, unsigned long seed): cdef uint32_t *table cdef uint32_t sum table = buzhash_init_table(seed & 0xffffffff) sum = c_buzhash( data, len(data), table) free(table) return sum def buzhash_update(uint32_t sum, unsigned char remove, unsigned char add, size_t len, unsigned long seed): cdef uint32_t *table table = buzhash_init_table(seed & 0xffffffff) sum = c_buzhash_update(sum, remove, add, len, table) free(table) return sum ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719958060.0 borgbackup-1.4.0/src/borg/compress.c0000644000076500000240000436631414641075054015756 0ustar00twstaff/* Generated by Cython 3.0.10 */ /* BEGIN: Cython Metadata { "distutils": { "depends": [ "/opt/homebrew/Cellar/lz4/1.9.4/include/lz4.h", "/opt/homebrew/opt/zstd/include/zstd.h" ], "extra_compile_args": [ "-Wall", "-Wextra", "-Wpointer-arith" ], "include_dirs": [ "/opt/homebrew/Cellar/lz4/1.9.4/include", "/opt/homebrew/opt/zstd/include" ], "libraries": [ "lz4", "zstd" ], "library_dirs": [ "/opt/homebrew/Cellar/lz4/1.9.4/lib", "/opt/homebrew/opt/zstd/lib" ], "name": "borg.compress", "sources": [ "src/borg/compress.pyx" ] }, "module_name": "borg.compress" } END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_10" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x03000AF0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 1 #endif #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #if PY_VERSION_HEX >= 0x030d00A4 # define __Pyx_PyCFunctionFast PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords #else # define __Pyx_PyCFunctionFast _PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__borg__compress #define __PYX_HAVE_API__borg__compress /* Early includes */ #include "lz4.h" #include "zstd.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/borg/compress.pyx", "", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* NoFastGil.proto */ #define __Pyx_PyGILState_Ensure PyGILState_Ensure #define __Pyx_PyGILState_Release PyGILState_Release #define __Pyx_FastGIL_Remember() #define __Pyx_FastGIL_Forget() #define __Pyx_FastGilFuncInit() /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_4borg_8compress_CompressorBase; struct __pyx_obj_4borg_8compress_DecidingCompressor; /* "borg/compress.pyx":54 * * * cdef class CompressorBase: # <<<<<<<<<<<<<< * """ * base class for all (de)compression classes, */ struct __pyx_obj_4borg_8compress_CompressorBase { PyObject_HEAD }; /* "borg/compress.pyx":103 * return data[2:] * * cdef class DecidingCompressor(CompressorBase): # <<<<<<<<<<<<<< * """ * base class for (de)compression classes that (based on an internal _decide */ struct __pyx_obj_4borg_8compress_DecidingCompressor { struct __pyx_obj_4borg_8compress_CompressorBase __pyx_base; }; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* KeywordStringCheck.proto */ static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed); /* SliceObject.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); /* GetAttr3.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* RaiseUnexpectedTypeError.proto */ static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj); /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* PyIntFromDouble.proto */ #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE PyObject* __Pyx_PyInt_FromDouble(double value); #else #define __Pyx_PyInt_FromDouble(value) PyLong_FromDouble(value) #endif /* GetTopmostException.proto */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); #endif /* SaveResetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* PyObjectSetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); #else #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* PyObject_Str.proto */ #define __Pyx_PyObject_Str(obj)\ (likely(PyString_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj)) /* SwapException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif /* PyIntCompare.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace); /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AndObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_AndObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceAnd(op1, op2) : PyNumber_And(op1, op2)) #endif /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_RemainderObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_RemainderObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceRemainder(op1, op2) : PyNumber_Remainder(op1, op2)) #endif /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_MultiplyObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2)) #endif /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2)) #endif /* PyNumberPow2.proto */ #define __Pyx_PyNumber_InPlacePowerOf2(a, b, c) __Pyx__PyNumber_PowerOf2(a, b, c, 1) #define __Pyx_PyNumber_PowerOf2(a, b, c) __Pyx__PyNumber_PowerOf2(a, b, c, 0) static PyObject* __Pyx__PyNumber_PowerOf2(PyObject *two, PyObject *exp, PyObject *none, int inplace); /* PyObjectCall2Args.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod1.proto */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); /* StringJoin.proto */ #if PY_MAJOR_VERSION < 3 #define __Pyx_PyString_Join __Pyx_PyBytes_Join #define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v)) #else #define __Pyx_PyString_Join PyUnicode_Join #define __Pyx_PyBaseString_Join PyUnicode_Join #endif static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); /* ObjectGetItem.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key); #else #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) #endif /* StrEquals.proto */ #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals #else #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals #endif /* PySequenceContains.proto */ static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { int result = PySequence_Contains(seq, item); return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* GetAttr.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /* HasAttr.proto */ #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_HasAttr(o, n) PyObject_HasAttrWithError(o, n) #else static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); #endif /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* PyObjectCallNoArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* ValidateBasesTuple.proto */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); #endif /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* SetupReduce.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce(PyObject* type_obj); #endif /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* ClassMethod.proto */ #include "descrobject.h" CYTHON_UNUSED static PyObject* __Pyx_Method_ClassMethod(PyObject *method); /* GetNameInClass.proto */ #define __Pyx_GetNameInClass(var, nmspace, name) (var) = __Pyx__GetNameInClass(nmspace, name) static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name); /* Py3UpdateBases.proto */ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases); /* CalculateMetaclass.proto */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); /* SetNameInClass.proto */ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) #elif CYTHON_COMPILING_IN_CPYTHON #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value)) #else #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) #endif /* PyObjectLookupSpecial.proto */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0) #define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1) static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error); #else #define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n) #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) #endif /* Py3ClassCreate.proto */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc); static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /* CyFunctionClassCell.proto */ static int __Pyx_CyFunction_InitClassCell(PyObject *cyfunctions, PyObject *classobj); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_PY_LONG_LONG(unsigned PY_LONG_LONG value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "borg.compress" */ static PyObject *__pyx_f_4borg_8compress___pyx_unpickle_CompressorBase__set_state(struct __pyx_obj_4borg_8compress_CompressorBase *, PyObject *); /*proto*/ static PyObject *__pyx_f_4borg_8compress___pyx_unpickle_DecidingCompressor__set_state(struct __pyx_obj_4borg_8compress_DecidingCompressor *, PyObject *); /*proto*/ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "borg.compress" extern int __pyx_module_is_main_borg__compress; int __pyx_module_is_main_borg__compress = 0; /* Implementation of "borg.compress" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_ImportError; static PyObject *__pyx_builtin_staticmethod; static PyObject *__pyx_builtin_property; static PyObject *__pyx_builtin_super; static PyObject *__pyx_builtin_NotImplementedError; static PyObject *__pyx_builtin_MemoryError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_NotImplemented; /* #### Code section: string_decls ### */ static const char __pyx_k_I[] = ">I"; static const char __pyx_k_e[] = "e"; static const char __pyx_k_f[] = "f"; static const char __pyx_k_r[] = "r"; static const char __pyx_k_s[] = "s"; static const char __pyx_k_ID[] = "ID"; static const char __pyx_k__5[] = ""; static const char __pyx_k__6[] = ","; static const char __pyx_k__9[] = "."; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k_LZ4[] = "LZ4"; static const char __pyx_k__10[] = "*"; static const char __pyx_k__11[] = "\377\377"; static const char __pyx_k__29[] = "\000\000"; static const char __pyx_k__32[] = "\001\000"; static const char __pyx_k__39[] = "\002\000"; static const char __pyx_k__47[] = "\003\000"; static const char __pyx_k__53[] = "\010\000"; static const char __pyx_k__68[] = "\004\000"; static const char __pyx_k_buf[] = "buf"; static const char __pyx_k_cls[] = "cls"; static const char __pyx_k_cmf[] = "cmf"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_flg[] = "flg"; static const char __pyx_k_get[] = "get"; static const char __pyx_k_hdr[] = "hdr"; static const char __pyx_k_lz4[] = "lz4"; static const char __pyx_k_new[] = "__new__"; static const char __pyx_k_Auto[] = "Auto"; static const char __pyx_k_LZMA[] = "LZMA"; static const char __pyx_k_ZLIB[] = "ZLIB"; static const char __pyx_k_ZSTD[] = "ZSTD"; static const char __pyx_k__100[] = "?"; static const char __pyx_k_auto[] = "auto"; static const char __pyx_k_data[] = "data"; static const char __pyx_k_dest[] = "dest"; static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_init[] = "__init__"; static const char __pyx_k_join[] = "join"; static const char __pyx_k_lzma[] = "lzma"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "name"; static const char __pyx_k_none[] = "none"; static const char __pyx_k_null[] = "null"; static const char __pyx_k_pack[] = "pack"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_size[] = "size"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_zlib[] = "zlib"; static const char __pyx_k_zstd[] = "zstd"; static const char __pyx_k_CNONE[] = "CNONE"; static const char __pyx_k_check[] = "check"; static const char __pyx_k_count[] = "count"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_idata[] = "idata"; static const char __pyx_k_inner[] = "inner"; static const char __pyx_k_isize[] = "isize"; static const char __pyx_k_level[] = "level"; static const char __pyx_k_min_r[] = "min_r"; static const char __pyx_k_osize[] = "osize"; static const char __pyx_k_ratio[] = "ratio"; static const char __pyx_k_rsize[] = "rsize"; static const char __pyx_k_split[] = "split"; static const char __pyx_k_state[] = "state"; static const char __pyx_k_super[] = "super"; static const char __pyx_k_1_4_01[] = "1.4_01"; static const char __pyx_k_Buffer[] = "Buffer"; static const char __pyx_k_Struct[] = "Struct"; static const char __pyx_k_buffer[] = "buffer"; static const char __pyx_k_decide[] = "_decide"; static const char __pyx_k_detect[] = "detect"; static const char __pyx_k_dict_2[] = "_dict"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_factor[] = "factor"; static const char __pyx_k_header[] = "header"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_kwargs[] = "kwargs"; static const char __pyx_k_module[] = "__module__"; static const char __pyx_k_name_2[] = "__name__"; static const char __pyx_k_params[] = "params"; static const char __pyx_k_pickle[] = "pickle"; static const char __pyx_k_preset[] = "preset"; static const char __pyx_k_random[] = "random"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_source[] = "source"; static const char __pyx_k_struct[] = "struct"; static const char __pyx_k_unpack[] = "unpack"; static const char __pyx_k_update[] = "update"; static const char __pyx_k_values[] = "values"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_helpers[] = "helpers"; static const char __pyx_k_prepare[] = "__prepare__"; static const char __pyx_k_trailer[] = "trailer"; static const char __pyx_k_argparse[] = "argparse"; static const char __pyx_k_check_ok[] = "check_ok"; static const char __pyx_k_compress[] = "compress"; static const char __pyx_k_decide_2[] = "decide"; static const char __pyx_k_getstate[] = "__getstate__"; static const char __pyx_k_property[] = "property"; static const char __pyx_k_pyx_type[] = "__pyx_type"; static const char __pyx_k_qualname[] = "__qualname__"; static const char __pyx_k_set_name[] = "__set_name__"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_LZMAError[] = "LZMAError"; static const char __pyx_k_baseclass[] = "baseclass"; static const char __pyx_k_constants[] = "constants"; static const char __pyx_k_isenabled[] = "isenabled"; static const char __pyx_k_lzma_data[] = "lzma_data"; static const char __pyx_k_metaclass[] = "__metaclass__"; static const char __pyx_k_obfuscate[] = "_obfuscate"; static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_CHECK_NONE[] = "CHECK_NONE"; static const char __pyx_k_Compressor[] = "Compressor"; static const char __pyx_k_LZ4___init[] = "LZ4.__init__"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_addtl_size[] = "addtl_size"; static const char __pyx_k_compr_size[] = "compr_size"; static const char __pyx_k_compressor[] = "compressor"; static const char __pyx_k_decompress[] = "decompress"; static const char __pyx_k_header_fmt[] = "header_fmt"; static const char __pyx_k_header_len[] = "header_len"; static const char __pyx_k_is_deflate[] = "is_deflate"; static const char __pyx_k_pyx_result[] = "__pyx_result"; static const char __pyx_k_startswith[] = "startswith"; static const char __pyx_k_API_VERSION[] = "API_VERSION"; static const char __pyx_k_Auto___init[] = "Auto.__init__"; static const char __pyx_k_Auto_decide[] = "Auto.decide"; static const char __pyx_k_Auto_detect[] = "Auto.detect"; static const char __pyx_k_ImportError[] = "ImportError"; static const char __pyx_k_LZ4__decide[] = "LZ4._decide"; static const char __pyx_k_LZMA___init[] = "LZMA.__init__"; static const char __pyx_k_MemoryError[] = "MemoryError"; static const char __pyx_k_PickleError[] = "PickleError"; static const char __pyx_k_ZLIB___init[] = "ZLIB.__init__"; static const char __pyx_k_ZLIB_detect[] = "ZLIB.detect"; static const char __pyx_k_ZSTD___init[] = "ZSTD.__init__"; static const char __pyx_k_compression[] = "compression"; static const char __pyx_k_mro_entries[] = "__mro_entries__"; static const char __pyx_k_obfuscate_2[] = "obfuscate"; static const char __pyx_k_Auto__decide[] = "Auto._decide"; static const char __pyx_k_LZMA__decide[] = "LZMA._decide"; static const char __pyx_k_ZSTD__decide[] = "ZSTD._decide"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; static const char __pyx_k_staticmethod[] = "staticmethod"; static const char __pyx_k_stringsource[] = ""; static const char __pyx_k_use_setstate[] = "use_setstate"; static const char __pyx_k_Auto_compress[] = "Auto.compress"; static const char __pyx_k_MAX_DATA_SIZE[] = "MAX_DATA_SIZE"; static const char __pyx_k_ObfuscateSize[] = "ObfuscateSize"; static const char __pyx_k_ZLIB_compress[] = "ZLIB.compress"; static const char __pyx_k_bad_arguments[] = "bad arguments"; static const char __pyx_k_borg_compress[] = "borg.compress"; static const char __pyx_k_class_getitem[] = "__class_getitem__"; static const char __pyx_k_init_subclass[] = "__init_subclass__"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_CNONE_compress[] = "CNONE.compress"; static const char __pyx_k_CompressorBase[] = "CompressorBase"; static const char __pyx_k_LZ4_COMPRESSOR[] = "LZ4_COMPRESSOR"; static const char __pyx_k_LZ4_decompress[] = "LZ4.decompress"; static const char __pyx_k_NotImplemented[] = "NotImplemented"; static const char __pyx_k_compressor_cls[] = "compressor_cls"; static const char __pyx_k_get_compressor[] = "get_compressor"; static const char __pyx_k_Auto_decompress[] = "Auto.decompress"; static const char __pyx_k_COMPRESSOR_LIST[] = "COMPRESSOR_LIST"; static const char __pyx_k_CompressionSpec[] = "CompressionSpec"; static const char __pyx_k_LZMA_decompress[] = "LZMA.decompress"; static const char __pyx_k_NONE_COMPRESSOR[] = "NONE_COMPRESSOR"; static const char __pyx_k_ZLIB_decompress[] = "ZLIB.decompress"; static const char __pyx_k_ZSTD_decompress[] = "ZSTD.decompress"; static const char __pyx_k_compressed_data[] = "compressed_data"; static const char __pyx_k_decide_compress[] = "decide_compress"; static const char __pyx_k_decidebaseclass[] = "decidebaseclass"; static const char __pyx_k_obfuscated_data[] = "obfuscated_data"; static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_CNONE_decompress[] = "CNONE.decompress"; static const char __pyx_k_COMPRESSOR_TABLE[] = "COMPRESSOR_TABLE"; static const char __pyx_k_max_padding_size[] = "max_padding_size"; static const char __pyx_k_ArgumentTypeError[] = "ArgumentTypeError"; static const char __pyx_k_Compressor___init[] = "Compressor.__init__"; static const char __pyx_k_Compressor_detect[] = "Compressor.detect"; static const char __pyx_k_DecidingCompressor[] = "DecidingCompressor"; static const char __pyx_k_DecompressionError[] = "DecompressionError"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_too_many_arguments[] = "too many arguments"; static const char __pyx_k_Compressor_compress[] = "Compressor.compress"; static const char __pyx_k_NotImplementedError[] = "NotImplementedError"; static const char __pyx_k_lz4_compress_failed[] = "lz4 compress failed"; static const char __pyx_k_ObfuscateSize___init[] = "ObfuscateSize.__init__"; static const char __pyx_k_not_enough_arguments[] = "not enough arguments"; static const char __pyx_k_CompressorBase_decide[] = "CompressorBase.decide"; static const char __pyx_k_CompressorBase_detect[] = "CompressorBase.detect"; static const char __pyx_k_Compressor_decompress[] = "Compressor.decompress"; static const char __pyx_k_No_lzma_support_found[] = "No lzma support found."; static const char __pyx_k_cheap_compressed_data[] = "cheap_compressed_data"; static const char __pyx_k_level_must_be_0_and_9[] = "level must be >= 0 and <= 9"; static const char __pyx_k_lz4_decompress_failed[] = "lz4 decompress failed"; static const char __pyx_k_src_borg_compress_pyx[] = "src/borg/compress.pyx"; static const char __pyx_k_CompressionSpec___init[] = "CompressionSpec.__init__"; static const char __pyx_k_ObfuscateSize_compress[] = "ObfuscateSize.compress"; static const char __pyx_k_level_must_be_1_and_22[] = "level must be >= 1 and <= 22"; static const char __pyx_k_zstd_compress_failed_s[] = "zstd compress failed: %s"; static const char __pyx_k_CompressorBase_compress[] = "CompressorBase.compress"; static const char __pyx_k_ObfuscateSize__obfuscate[] = "ObfuscateSize._obfuscate"; static const char __pyx_k_ObfuscateSize_decompress[] = "ObfuscateSize.decompress"; static const char __pyx_k_random_padding_obfuscate[] = "_random_padding_obfuscate"; static const char __pyx_k_zstd_decompress_failed_s[] = "zstd decompress failed: %s"; static const char __pyx_k_CompressorBase_decompress[] = "CompressorBase.decompress"; static const char __pyx_k_DecidingCompressor_decide[] = "DecidingCompressor.decide"; static const char __pyx_k_expensive_compressed_data[] = "expensive_compressed_data"; static const char __pyx_k_CompressionSpec_compressor[] = "CompressionSpec.compressor"; static const char __pyx_k_DecidingCompressor__decide[] = "DecidingCompressor._decide"; static const char __pyx_k_DecidingCompressor_compress[] = "DecidingCompressor.compress"; static const char __pyx_k_pyx_unpickle_CompressorBase[] = "__pyx_unpickle_CompressorBase"; static const char __pyx_k_unsupported_compression_type[] = "unsupported compression type"; static const char __pyx_k_CompressorBase___reduce_cython[] = "CompressorBase.__reduce_cython__"; static const char __pyx_k_lzma_compression_decompression[] = "\n lzma compression / decompression\n "; static const char __pyx_k_pyx_unpickle_DecidingCompresso[] = "__pyx_unpickle_DecidingCompressor"; static const char __pyx_k_zlib_compression_decompression[] = "\n zlib compression / decompression (python stdlib)\n "; static const char __pyx_k_Meta_Compressor_that_decides_wh[] = "\n Meta-Compressor that decides which compression to use based on LZ4's ratio.\n\n As a meta-Compressor the actual compression is deferred to other Compressors,\n therefore this Compressor has no ID, no detect() and no decompress().\n "; static const char __pyx_k_Meta_Compressor_that_obfuscates[] = "\n Meta-Compressor that obfuscates the compressed data size.\n "; static const char __pyx_k_borg_compress_Compression_is_ap[] = "\nborg.compress\n=============\n\nCompression is applied to chunks after ID hashing (so the ID is a direct function of the\nplain chunk, compression is irrelevant to it), and of course before encryption.\n\nThe \"auto\" mode (e.g. --compression auto,lzma,4) is implemented as a meta Compressor,\nmeaning that Auto acts like a Compressor, but defers actual work to others (namely\nLZ4 as a heuristic whether compression is worth it, and the specified Compressor\nfor the actual compression).\n\nDecompression is normally handled through Compressor.decompress which will detect\nwhich compressor has been used to compress the data and dispatch to the correct\ndecompressor.\n"; static const char __pyx_k_compresses_using_a_compressor_w[] = "\n compresses using a compressor with given name and parameters\n decompresses everything we can handle (autodetect)\n "; static const char __pyx_k_none_no_compression_just_pass_t[] = "\n none - no compression, just pass through data\n "; static const char __pyx_k_raw_LZ4_compression_decompressi[] = "\n raw LZ4 compression / decompression (liblz4).\n\n Features:\n - lz4 is super fast\n - wrapper releases CPython's GIL to support multithreaded code\n - uses safe lz4 methods that never go beyond the end of the output buffer\n "; static const char __pyx_k_relative_random_reciprocal_obfu[] = "_relative_random_reciprocal_obfuscate"; static const char __pyx_k_CompressorBase___setstate_cython[] = "CompressorBase.__setstate_cython__"; static const char __pyx_k_DecidingCompressor___reduce_cyth[] = "DecidingCompressor.__reduce_cython__"; static const char __pyx_k_DecidingCompressor___setstate_cy[] = "DecidingCompressor.__setstate_cython__"; static const char __pyx_k_DecidingCompressor_decide_compre[] = "DecidingCompressor.decide_compress"; static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())"; static const char __pyx_k_No_decompressor_for_this_data_fo[] = "No decompressor for this data found: %r."; static const char __pyx_k_ObfuscateSize__random_padding_ob[] = "ObfuscateSize._random_padding_obfuscate"; static const char __pyx_k_ObfuscateSize__relative_random_r[] = "ObfuscateSize._relative_random_reciprocal_obfuscate"; static const char __pyx_k_level_must_be_1_and_6_or_110_and[] = "level must be >= 1 and <= 6 or >= 110 and <= 123"; static const char __pyx_k_zstd_compression_decompression_p[] = "zstd compression / decompression (pypi: zstandard, gh: python-zstandard)"; static const char __pyx_k_zstd_decompress_failed_size_mism[] = "zstd decompress failed: size mismatch"; static const char __pyx_k_zstd_get_size_failed_data_was_no[] = "zstd get size failed: data was not compressed by zstd"; static const char __pyx_k_zstd_get_size_failed_original_si[] = "zstd get size failed: original size unknown"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_4borg_8compress_14CompressorBase_detect(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_data); /* proto */ static int __pyx_pf_4borg_8compress_14CompressorBase_2__init__(CYTHON_UNUSED struct __pyx_obj_4borg_8compress_CompressorBase *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_4borg_8compress_14CompressorBase_4decide(struct __pyx_obj_4borg_8compress_CompressorBase *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_4borg_8compress_14CompressorBase_6compress(struct __pyx_obj_4borg_8compress_CompressorBase *__pyx_v_self, PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_4borg_8compress_14CompressorBase_8decompress(CYTHON_UNUSED struct __pyx_obj_4borg_8compress_CompressorBase *__pyx_v_self, PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_4borg_8compress_14CompressorBase_10__reduce_cython__(struct __pyx_obj_4borg_8compress_CompressorBase *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_8compress_14CompressorBase_12__setstate_cython__(struct __pyx_obj_4borg_8compress_CompressorBase *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_4borg_8compress_18DecidingCompressor___init__(struct __pyx_obj_4borg_8compress_DecidingCompressor *__pyx_v_self, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_4borg_8compress_18DecidingCompressor_2_decide(CYTHON_UNUSED struct __pyx_obj_4borg_8compress_DecidingCompressor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_4borg_8compress_18DecidingCompressor_4decide(struct __pyx_obj_4borg_8compress_DecidingCompressor *__pyx_v_self, PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_4borg_8compress_18DecidingCompressor_6decide_compress(struct __pyx_obj_4borg_8compress_DecidingCompressor *__pyx_v_self, PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_4borg_8compress_18DecidingCompressor_8compress(struct __pyx_obj_4borg_8compress_DecidingCompressor *__pyx_v_self, PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_4borg_8compress_18DecidingCompressor_10__reduce_cython__(struct __pyx_obj_4borg_8compress_DecidingCompressor *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_8compress_18DecidingCompressor_12__setstate_cython__(struct __pyx_obj_4borg_8compress_DecidingCompressor *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_4borg_8compress_5CNONE_compress(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_4borg_8compress_5CNONE_2decompress(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_4borg_8compress_3LZ4___init__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_4borg_8compress_3LZ4_2_decide(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_idata); /* proto */ static PyObject *__pyx_pf_4borg_8compress_3LZ4_4decompress(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_idata); /* proto */ static PyObject *__pyx_pf_4borg_8compress_4LZMA___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_level, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_4borg_8compress_4LZMA_2_decide(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_4borg_8compress_4LZMA_4decompress(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_4borg_8compress_4ZSTD___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_level, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_4borg_8compress_4ZSTD_2_decide(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_idata); /* proto */ static PyObject *__pyx_pf_4borg_8compress_4ZSTD_4decompress(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_idata); /* proto */ static PyObject *__pyx_pf_4borg_8compress_4ZLIB_detect(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_4borg_8compress_4ZLIB_2__init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_level, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_4borg_8compress_4ZLIB_4compress(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_4borg_8compress_4ZLIB_6decompress(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_4borg_8compress_4Auto___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_compressor); /* proto */ static PyObject *__pyx_pf_4borg_8compress_4Auto_2_decide(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_4borg_8compress_4Auto_4decide(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_4borg_8compress_4Auto_6compress(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_4borg_8compress_4Auto_8decompress(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_4borg_8compress_4Auto_10detect(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, CYTHON_UNUSED PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_4borg_8compress_13ObfuscateSize___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_level, PyObject *__pyx_v_compressor); /* proto */ static PyObject *__pyx_pf_4borg_8compress_13ObfuscateSize_2_obfuscate(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_compr_size); /* proto */ static PyObject *__pyx_pf_4borg_8compress_13ObfuscateSize_4_relative_random_reciprocal_obfuscate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_compr_size); /* proto */ static PyObject *__pyx_pf_4borg_8compress_13ObfuscateSize_6_random_padding_obfuscate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_compr_size); /* proto */ static PyObject *__pyx_pf_4borg_8compress_13ObfuscateSize_8compress(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_4borg_8compress_13ObfuscateSize_10decompress(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_4borg_8compress_get_compressor(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_4borg_8compress_10Compressor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_4borg_8compress_10Compressor_2compress(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_4borg_8compress_10Compressor_4decompress(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_4borg_8compress_10Compressor_6detect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_4borg_8compress_15CompressionSpec___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_s); /* proto */ static PyObject *__pyx_pf_4borg_8compress_15CompressionSpec_2compressor(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_8compress_2__pyx_unpickle_CompressorBase(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_4borg_8compress_4__pyx_unpickle_DecidingCompressor(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_tp_new_4borg_8compress_CompressorBase(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE PyObject *__pyx_type_4borg_8compress_CompressorBase; PyObject *__pyx_type_4borg_8compress_DecidingCompressor; #endif PyTypeObject *__pyx_ptype_4borg_8compress_CompressorBase; PyTypeObject *__pyx_ptype_4borg_8compress_DecidingCompressor; PyObject *__pyx_kp_s_1_4_01; PyObject *__pyx_n_s_API_VERSION; PyObject *__pyx_n_s_ArgumentTypeError; PyObject *__pyx_n_s_Auto; PyObject *__pyx_n_s_Auto___init; PyObject *__pyx_n_s_Auto__decide; PyObject *__pyx_n_s_Auto_compress; PyObject *__pyx_n_s_Auto_decide; PyObject *__pyx_n_s_Auto_decompress; PyObject *__pyx_n_s_Auto_detect; PyObject *__pyx_n_s_Buffer; PyObject *__pyx_n_s_CHECK_NONE; PyObject *__pyx_n_s_CNONE; PyObject *__pyx_n_s_CNONE_compress; PyObject *__pyx_n_s_CNONE_decompress; PyObject *__pyx_n_s_COMPRESSOR_LIST; PyObject *__pyx_n_s_COMPRESSOR_TABLE; PyObject *__pyx_n_s_CompressionSpec; PyObject *__pyx_n_s_CompressionSpec___init; PyObject *__pyx_n_s_CompressionSpec_compressor; PyObject *__pyx_n_s_Compressor; PyObject *__pyx_n_s_CompressorBase; PyObject *__pyx_n_s_CompressorBase___reduce_cython; PyObject *__pyx_n_s_CompressorBase___setstate_cython; PyObject *__pyx_n_s_CompressorBase_compress; PyObject *__pyx_n_s_CompressorBase_decide; PyObject *__pyx_n_s_CompressorBase_decompress; PyObject *__pyx_n_s_CompressorBase_detect; PyObject *__pyx_n_s_Compressor___init; PyObject *__pyx_n_s_Compressor_compress; PyObject *__pyx_n_s_Compressor_decompress; PyObject *__pyx_n_s_Compressor_detect; PyObject *__pyx_n_s_DecidingCompressor; PyObject *__pyx_n_s_DecidingCompressor___reduce_cyth; PyObject *__pyx_n_s_DecidingCompressor___setstate_cy; PyObject *__pyx_n_s_DecidingCompressor__decide; PyObject *__pyx_n_s_DecidingCompressor_compress; PyObject *__pyx_n_s_DecidingCompressor_decide; PyObject *__pyx_n_s_DecidingCompressor_decide_compre; PyObject *__pyx_n_s_DecompressionError; PyObject *__pyx_kp_s_I; PyObject *__pyx_n_s_ID; PyObject *__pyx_n_s_ImportError; PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0; PyObject *__pyx_n_s_LZ4; PyObject *__pyx_n_s_LZ4_COMPRESSOR; PyObject *__pyx_n_s_LZ4___init; PyObject *__pyx_n_s_LZ4__decide; PyObject *__pyx_n_s_LZ4_decompress; PyObject *__pyx_n_s_LZMA; PyObject *__pyx_n_s_LZMAError; PyObject *__pyx_n_s_LZMA___init; PyObject *__pyx_n_s_LZMA__decide; PyObject *__pyx_n_s_LZMA_decompress; PyObject *__pyx_n_s_MAX_DATA_SIZE; PyObject *__pyx_n_s_MemoryError; PyObject *__pyx_kp_s_Meta_Compressor_that_decides_wh; PyObject *__pyx_kp_s_Meta_Compressor_that_obfuscates; PyObject *__pyx_n_s_NONE_COMPRESSOR; PyObject *__pyx_kp_s_No_decompressor_for_this_data_fo; PyObject *__pyx_kp_s_No_lzma_support_found; PyObject *__pyx_n_s_NotImplemented; PyObject *__pyx_n_s_NotImplementedError; PyObject *__pyx_n_s_ObfuscateSize; PyObject *__pyx_n_s_ObfuscateSize___init; PyObject *__pyx_n_s_ObfuscateSize__obfuscate; PyObject *__pyx_n_s_ObfuscateSize__random_padding_ob; PyObject *__pyx_n_s_ObfuscateSize__relative_random_r; PyObject *__pyx_n_s_ObfuscateSize_compress; PyObject *__pyx_n_s_ObfuscateSize_decompress; PyObject *__pyx_n_s_PickleError; PyObject *__pyx_n_s_Struct; PyObject *__pyx_n_s_ValueError; PyObject *__pyx_n_s_ZLIB; PyObject *__pyx_n_s_ZLIB___init; PyObject *__pyx_n_s_ZLIB_compress; PyObject *__pyx_n_s_ZLIB_decompress; PyObject *__pyx_n_s_ZLIB_detect; PyObject *__pyx_n_s_ZSTD; PyObject *__pyx_n_s_ZSTD___init; PyObject *__pyx_n_s_ZSTD__decide; PyObject *__pyx_n_s_ZSTD_decompress; PyObject *__pyx_n_s__10; PyObject *__pyx_n_s__100; PyObject *__pyx_kp_b__11; PyObject *__pyx_kp_b__29; PyObject *__pyx_kp_b__32; PyObject *__pyx_kp_b__39; PyObject *__pyx_kp_b__47; PyObject *__pyx_kp_b__5; PyObject *__pyx_kp_b__53; PyObject *__pyx_kp_s__6; PyObject *__pyx_kp_b__68; PyObject *__pyx_kp_u__9; PyObject *__pyx_n_s_addtl_size; PyObject *__pyx_n_s_argparse; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_auto; PyObject *__pyx_kp_s_bad_arguments; PyObject *__pyx_n_s_baseclass; PyObject *__pyx_n_s_borg_compress; PyObject *__pyx_n_s_buf; PyObject *__pyx_n_s_buffer; PyObject *__pyx_n_s_cheap_compressed_data; PyObject *__pyx_n_s_check; PyObject *__pyx_n_s_check_ok; PyObject *__pyx_n_s_class_getitem; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_cls; PyObject *__pyx_n_s_cmf; PyObject *__pyx_n_s_compr_size; PyObject *__pyx_n_s_compress; PyObject *__pyx_n_s_compressed_data; PyObject *__pyx_kp_s_compresses_using_a_compressor_w; PyObject *__pyx_n_s_compression; PyObject *__pyx_n_s_compressor; PyObject *__pyx_n_s_compressor_cls; PyObject *__pyx_n_s_constants; PyObject *__pyx_n_s_count; PyObject *__pyx_n_s_data; PyObject *__pyx_n_s_decide; PyObject *__pyx_n_s_decide_2; PyObject *__pyx_n_s_decide_compress; PyObject *__pyx_n_s_decidebaseclass; PyObject *__pyx_n_s_decompress; PyObject *__pyx_n_s_dest; PyObject *__pyx_n_s_detect; PyObject *__pyx_n_s_dict; PyObject *__pyx_n_s_dict_2; PyObject *__pyx_kp_u_disable; PyObject *__pyx_n_s_doc; PyObject *__pyx_n_s_e; PyObject *__pyx_kp_u_enable; PyObject *__pyx_n_s_error; PyObject *__pyx_n_s_expensive_compressed_data; PyObject *__pyx_n_s_f; PyObject *__pyx_n_s_factor; PyObject *__pyx_n_s_flg; PyObject *__pyx_kp_u_gc; PyObject *__pyx_n_s_get; PyObject *__pyx_n_s_get_compressor; PyObject *__pyx_n_s_getstate; PyObject *__pyx_n_s_hdr; PyObject *__pyx_n_s_header; PyObject *__pyx_n_s_header_fmt; PyObject *__pyx_n_s_header_len; PyObject *__pyx_n_s_helpers; PyObject *__pyx_n_s_idata; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_init; PyObject *__pyx_n_s_init_subclass; PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_inner; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_n_s_is_deflate; PyObject *__pyx_kp_u_isenabled; PyObject *__pyx_n_s_isize; PyObject *__pyx_n_s_join; PyObject *__pyx_n_s_kwargs; PyObject *__pyx_n_s_level; PyObject *__pyx_kp_s_level_must_be_0_and_9; PyObject *__pyx_kp_s_level_must_be_1_and_22; PyObject *__pyx_kp_s_level_must_be_1_and_6_or_110_and; PyObject *__pyx_n_s_lz4; PyObject *__pyx_kp_s_lz4_compress_failed; PyObject *__pyx_kp_s_lz4_decompress_failed; PyObject *__pyx_n_s_lzma; PyObject *__pyx_kp_s_lzma_compression_decompression; PyObject *__pyx_n_s_lzma_data; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_max_padding_size; PyObject *__pyx_n_s_metaclass; PyObject *__pyx_n_s_min_r; PyObject *__pyx_n_s_module; PyObject *__pyx_n_s_mro_entries; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_name_2; PyObject *__pyx_n_s_new; PyObject *__pyx_n_s_none; PyObject *__pyx_kp_s_none_no_compression_just_pass_t; PyObject *__pyx_kp_s_not_enough_arguments; PyObject *__pyx_n_s_null; PyObject *__pyx_n_s_obfuscate; PyObject *__pyx_n_s_obfuscate_2; PyObject *__pyx_n_s_obfuscated_data; PyObject *__pyx_n_s_osize; PyObject *__pyx_n_s_pack; PyObject *__pyx_n_s_params; PyObject *__pyx_n_s_pickle; PyObject *__pyx_n_s_prepare; PyObject *__pyx_n_s_preset; PyObject *__pyx_n_s_property; PyObject *__pyx_n_s_pyx_PickleError; PyObject *__pyx_n_s_pyx_checksum; PyObject *__pyx_n_s_pyx_result; PyObject *__pyx_n_s_pyx_state; PyObject *__pyx_n_s_pyx_type; PyObject *__pyx_n_s_pyx_unpickle_CompressorBase; PyObject *__pyx_n_s_pyx_unpickle_DecidingCompresso; PyObject *__pyx_n_s_qualname; PyObject *__pyx_n_s_r; PyObject *__pyx_n_s_random; PyObject *__pyx_n_s_random_padding_obfuscate; PyObject *__pyx_n_s_ratio; PyObject *__pyx_kp_s_raw_LZ4_compression_decompressi; PyObject *__pyx_n_s_reduce; PyObject *__pyx_n_s_reduce_cython; PyObject *__pyx_n_s_reduce_ex; PyObject *__pyx_n_s_relative_random_reciprocal_obfu; PyObject *__pyx_n_s_rsize; PyObject *__pyx_n_s_s; PyObject *__pyx_n_s_self; PyObject *__pyx_n_s_set_name; PyObject *__pyx_n_s_setstate; PyObject *__pyx_n_s_setstate_cython; PyObject *__pyx_n_s_size; PyObject *__pyx_n_s_source; PyObject *__pyx_n_s_spec; PyObject *__pyx_n_s_split; PyObject *__pyx_kp_s_src_borg_compress_pyx; PyObject *__pyx_n_s_startswith; PyObject *__pyx_n_s_state; PyObject *__pyx_n_s_staticmethod; PyObject *__pyx_kp_s_stringsource; PyObject *__pyx_n_s_struct; PyObject *__pyx_n_s_super; PyObject *__pyx_n_s_test; PyObject *__pyx_kp_s_too_many_arguments; PyObject *__pyx_n_s_trailer; PyObject *__pyx_n_s_unpack; PyObject *__pyx_kp_s_unsupported_compression_type; PyObject *__pyx_n_s_update; PyObject *__pyx_n_s_use_setstate; PyObject *__pyx_n_s_values; PyObject *__pyx_n_s_zlib; PyObject *__pyx_kp_s_zlib_compression_decompression; PyObject *__pyx_n_s_zstd; PyObject *__pyx_kp_s_zstd_compress_failed_s; PyObject *__pyx_kp_s_zstd_compression_decompression_p; PyObject *__pyx_kp_s_zstd_decompress_failed_s; PyObject *__pyx_kp_s_zstd_decompress_failed_size_mism; PyObject *__pyx_kp_s_zstd_get_size_failed_data_was_no; PyObject *__pyx_kp_s_zstd_get_size_failed_original_si; PyObject *__pyx_float_0_001; PyObject *__pyx_float_0_0001; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_int_2; PyObject *__pyx_int_3; PyObject *__pyx_int_6; PyObject *__pyx_int_8; PyObject *__pyx_int_9; PyObject *__pyx_int_10; PyObject *__pyx_int_15; PyObject *__pyx_int_22; PyObject *__pyx_int_31; PyObject *__pyx_int_100; PyObject *__pyx_int_110; PyObject *__pyx_int_123; PyObject *__pyx_int_256; PyObject *__pyx_int_1024; PyObject *__pyx_int_222419149; PyObject *__pyx_int_228825662; PyObject *__pyx_int_238750788; PyObject *__pyx_slice_; PyObject *__pyx_slice__4; PyObject *__pyx_slice__7; PyObject *__pyx_tuple__2; PyObject *__pyx_tuple__3; PyObject *__pyx_tuple__8; PyObject *__pyx_tuple__12; PyObject *__pyx_tuple__14; PyObject *__pyx_tuple__18; PyObject *__pyx_tuple__20; PyObject *__pyx_tuple__24; PyObject *__pyx_tuple__33; PyObject *__pyx_tuple__35; PyObject *__pyx_tuple__37; PyObject *__pyx_tuple__40; PyObject *__pyx_tuple__42; PyObject *__pyx_tuple__43; PyObject *__pyx_tuple__45; PyObject *__pyx_tuple__49; PyObject *__pyx_tuple__50; PyObject *__pyx_tuple__54; PyObject *__pyx_tuple__59; PyObject *__pyx_tuple__61; PyObject *__pyx_tuple__64; PyObject *__pyx_tuple__69; PyObject *__pyx_tuple__71; PyObject *__pyx_tuple__72; PyObject *__pyx_tuple__74; PyObject *__pyx_tuple__77; PyObject *__pyx_tuple__79; PyObject *__pyx_tuple__81; PyObject *__pyx_tuple__83; PyObject *__pyx_tuple__84; PyObject *__pyx_tuple__85; PyObject *__pyx_tuple__87; PyObject *__pyx_tuple__89; PyObject *__pyx_tuple__91; PyObject *__pyx_tuple__93; PyObject *__pyx_tuple__95; PyObject *__pyx_tuple__97; PyObject *__pyx_codeobj__13; PyObject *__pyx_codeobj__15; PyObject *__pyx_codeobj__16; PyObject *__pyx_codeobj__17; PyObject *__pyx_codeobj__19; PyObject *__pyx_codeobj__21; PyObject *__pyx_codeobj__22; PyObject *__pyx_codeobj__23; PyObject *__pyx_codeobj__25; PyObject *__pyx_codeobj__26; PyObject *__pyx_codeobj__27; PyObject *__pyx_codeobj__28; PyObject *__pyx_codeobj__30; PyObject *__pyx_codeobj__31; PyObject *__pyx_codeobj__34; PyObject *__pyx_codeobj__36; PyObject *__pyx_codeobj__38; PyObject *__pyx_codeobj__41; PyObject *__pyx_codeobj__44; PyObject *__pyx_codeobj__46; PyObject *__pyx_codeobj__48; PyObject *__pyx_codeobj__51; PyObject *__pyx_codeobj__52; PyObject *__pyx_codeobj__55; PyObject *__pyx_codeobj__56; PyObject *__pyx_codeobj__57; PyObject *__pyx_codeobj__58; PyObject *__pyx_codeobj__60; PyObject *__pyx_codeobj__62; PyObject *__pyx_codeobj__63; PyObject *__pyx_codeobj__65; PyObject *__pyx_codeobj__66; PyObject *__pyx_codeobj__67; PyObject *__pyx_codeobj__70; PyObject *__pyx_codeobj__73; PyObject *__pyx_codeobj__75; PyObject *__pyx_codeobj__76; PyObject *__pyx_codeobj__78; PyObject *__pyx_codeobj__80; PyObject *__pyx_codeobj__82; PyObject *__pyx_codeobj__86; PyObject *__pyx_codeobj__88; PyObject *__pyx_codeobj__90; PyObject *__pyx_codeobj__92; PyObject *__pyx_codeobj__94; PyObject *__pyx_codeobj__96; PyObject *__pyx_codeobj__98; PyObject *__pyx_codeobj__99; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_4borg_8compress_CompressorBase); Py_CLEAR(clear_module_state->__pyx_type_4borg_8compress_CompressorBase); Py_CLEAR(clear_module_state->__pyx_ptype_4borg_8compress_DecidingCompressor); Py_CLEAR(clear_module_state->__pyx_type_4borg_8compress_DecidingCompressor); Py_CLEAR(clear_module_state->__pyx_kp_s_1_4_01); Py_CLEAR(clear_module_state->__pyx_n_s_API_VERSION); Py_CLEAR(clear_module_state->__pyx_n_s_ArgumentTypeError); Py_CLEAR(clear_module_state->__pyx_n_s_Auto); Py_CLEAR(clear_module_state->__pyx_n_s_Auto___init); Py_CLEAR(clear_module_state->__pyx_n_s_Auto__decide); Py_CLEAR(clear_module_state->__pyx_n_s_Auto_compress); Py_CLEAR(clear_module_state->__pyx_n_s_Auto_decide); Py_CLEAR(clear_module_state->__pyx_n_s_Auto_decompress); Py_CLEAR(clear_module_state->__pyx_n_s_Auto_detect); Py_CLEAR(clear_module_state->__pyx_n_s_Buffer); Py_CLEAR(clear_module_state->__pyx_n_s_CHECK_NONE); Py_CLEAR(clear_module_state->__pyx_n_s_CNONE); Py_CLEAR(clear_module_state->__pyx_n_s_CNONE_compress); Py_CLEAR(clear_module_state->__pyx_n_s_CNONE_decompress); Py_CLEAR(clear_module_state->__pyx_n_s_COMPRESSOR_LIST); Py_CLEAR(clear_module_state->__pyx_n_s_COMPRESSOR_TABLE); Py_CLEAR(clear_module_state->__pyx_n_s_CompressionSpec); Py_CLEAR(clear_module_state->__pyx_n_s_CompressionSpec___init); Py_CLEAR(clear_module_state->__pyx_n_s_CompressionSpec_compressor); Py_CLEAR(clear_module_state->__pyx_n_s_Compressor); Py_CLEAR(clear_module_state->__pyx_n_s_CompressorBase); Py_CLEAR(clear_module_state->__pyx_n_s_CompressorBase___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_CompressorBase___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_CompressorBase_compress); Py_CLEAR(clear_module_state->__pyx_n_s_CompressorBase_decide); Py_CLEAR(clear_module_state->__pyx_n_s_CompressorBase_decompress); Py_CLEAR(clear_module_state->__pyx_n_s_CompressorBase_detect); Py_CLEAR(clear_module_state->__pyx_n_s_Compressor___init); Py_CLEAR(clear_module_state->__pyx_n_s_Compressor_compress); Py_CLEAR(clear_module_state->__pyx_n_s_Compressor_decompress); Py_CLEAR(clear_module_state->__pyx_n_s_Compressor_detect); Py_CLEAR(clear_module_state->__pyx_n_s_DecidingCompressor); Py_CLEAR(clear_module_state->__pyx_n_s_DecidingCompressor___reduce_cyth); Py_CLEAR(clear_module_state->__pyx_n_s_DecidingCompressor___setstate_cy); Py_CLEAR(clear_module_state->__pyx_n_s_DecidingCompressor__decide); Py_CLEAR(clear_module_state->__pyx_n_s_DecidingCompressor_compress); Py_CLEAR(clear_module_state->__pyx_n_s_DecidingCompressor_decide); Py_CLEAR(clear_module_state->__pyx_n_s_DecidingCompressor_decide_compre); Py_CLEAR(clear_module_state->__pyx_n_s_DecompressionError); Py_CLEAR(clear_module_state->__pyx_kp_s_I); Py_CLEAR(clear_module_state->__pyx_n_s_ID); Py_CLEAR(clear_module_state->__pyx_n_s_ImportError); Py_CLEAR(clear_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0); Py_CLEAR(clear_module_state->__pyx_n_s_LZ4); Py_CLEAR(clear_module_state->__pyx_n_s_LZ4_COMPRESSOR); Py_CLEAR(clear_module_state->__pyx_n_s_LZ4___init); Py_CLEAR(clear_module_state->__pyx_n_s_LZ4__decide); Py_CLEAR(clear_module_state->__pyx_n_s_LZ4_decompress); Py_CLEAR(clear_module_state->__pyx_n_s_LZMA); Py_CLEAR(clear_module_state->__pyx_n_s_LZMAError); Py_CLEAR(clear_module_state->__pyx_n_s_LZMA___init); Py_CLEAR(clear_module_state->__pyx_n_s_LZMA__decide); Py_CLEAR(clear_module_state->__pyx_n_s_LZMA_decompress); Py_CLEAR(clear_module_state->__pyx_n_s_MAX_DATA_SIZE); Py_CLEAR(clear_module_state->__pyx_n_s_MemoryError); Py_CLEAR(clear_module_state->__pyx_kp_s_Meta_Compressor_that_decides_wh); Py_CLEAR(clear_module_state->__pyx_kp_s_Meta_Compressor_that_obfuscates); Py_CLEAR(clear_module_state->__pyx_n_s_NONE_COMPRESSOR); Py_CLEAR(clear_module_state->__pyx_kp_s_No_decompressor_for_this_data_fo); Py_CLEAR(clear_module_state->__pyx_kp_s_No_lzma_support_found); Py_CLEAR(clear_module_state->__pyx_n_s_NotImplemented); Py_CLEAR(clear_module_state->__pyx_n_s_NotImplementedError); Py_CLEAR(clear_module_state->__pyx_n_s_ObfuscateSize); Py_CLEAR(clear_module_state->__pyx_n_s_ObfuscateSize___init); Py_CLEAR(clear_module_state->__pyx_n_s_ObfuscateSize__obfuscate); Py_CLEAR(clear_module_state->__pyx_n_s_ObfuscateSize__random_padding_ob); Py_CLEAR(clear_module_state->__pyx_n_s_ObfuscateSize__relative_random_r); Py_CLEAR(clear_module_state->__pyx_n_s_ObfuscateSize_compress); Py_CLEAR(clear_module_state->__pyx_n_s_ObfuscateSize_decompress); Py_CLEAR(clear_module_state->__pyx_n_s_PickleError); Py_CLEAR(clear_module_state->__pyx_n_s_Struct); Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); Py_CLEAR(clear_module_state->__pyx_n_s_ZLIB); Py_CLEAR(clear_module_state->__pyx_n_s_ZLIB___init); Py_CLEAR(clear_module_state->__pyx_n_s_ZLIB_compress); Py_CLEAR(clear_module_state->__pyx_n_s_ZLIB_decompress); Py_CLEAR(clear_module_state->__pyx_n_s_ZLIB_detect); Py_CLEAR(clear_module_state->__pyx_n_s_ZSTD); Py_CLEAR(clear_module_state->__pyx_n_s_ZSTD___init); Py_CLEAR(clear_module_state->__pyx_n_s_ZSTD__decide); Py_CLEAR(clear_module_state->__pyx_n_s_ZSTD_decompress); Py_CLEAR(clear_module_state->__pyx_n_s__10); Py_CLEAR(clear_module_state->__pyx_n_s__100); Py_CLEAR(clear_module_state->__pyx_kp_b__11); Py_CLEAR(clear_module_state->__pyx_kp_b__29); Py_CLEAR(clear_module_state->__pyx_kp_b__32); Py_CLEAR(clear_module_state->__pyx_kp_b__39); Py_CLEAR(clear_module_state->__pyx_kp_b__47); Py_CLEAR(clear_module_state->__pyx_kp_b__5); Py_CLEAR(clear_module_state->__pyx_kp_b__53); Py_CLEAR(clear_module_state->__pyx_kp_s__6); Py_CLEAR(clear_module_state->__pyx_kp_b__68); Py_CLEAR(clear_module_state->__pyx_kp_u__9); Py_CLEAR(clear_module_state->__pyx_n_s_addtl_size); Py_CLEAR(clear_module_state->__pyx_n_s_argparse); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_auto); Py_CLEAR(clear_module_state->__pyx_kp_s_bad_arguments); Py_CLEAR(clear_module_state->__pyx_n_s_baseclass); Py_CLEAR(clear_module_state->__pyx_n_s_borg_compress); Py_CLEAR(clear_module_state->__pyx_n_s_buf); Py_CLEAR(clear_module_state->__pyx_n_s_buffer); Py_CLEAR(clear_module_state->__pyx_n_s_cheap_compressed_data); Py_CLEAR(clear_module_state->__pyx_n_s_check); Py_CLEAR(clear_module_state->__pyx_n_s_check_ok); Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_cls); Py_CLEAR(clear_module_state->__pyx_n_s_cmf); Py_CLEAR(clear_module_state->__pyx_n_s_compr_size); Py_CLEAR(clear_module_state->__pyx_n_s_compress); Py_CLEAR(clear_module_state->__pyx_n_s_compressed_data); Py_CLEAR(clear_module_state->__pyx_kp_s_compresses_using_a_compressor_w); Py_CLEAR(clear_module_state->__pyx_n_s_compression); Py_CLEAR(clear_module_state->__pyx_n_s_compressor); Py_CLEAR(clear_module_state->__pyx_n_s_compressor_cls); Py_CLEAR(clear_module_state->__pyx_n_s_constants); Py_CLEAR(clear_module_state->__pyx_n_s_count); Py_CLEAR(clear_module_state->__pyx_n_s_data); Py_CLEAR(clear_module_state->__pyx_n_s_decide); Py_CLEAR(clear_module_state->__pyx_n_s_decide_2); Py_CLEAR(clear_module_state->__pyx_n_s_decide_compress); Py_CLEAR(clear_module_state->__pyx_n_s_decidebaseclass); Py_CLEAR(clear_module_state->__pyx_n_s_decompress); Py_CLEAR(clear_module_state->__pyx_n_s_dest); Py_CLEAR(clear_module_state->__pyx_n_s_detect); Py_CLEAR(clear_module_state->__pyx_n_s_dict); Py_CLEAR(clear_module_state->__pyx_n_s_dict_2); Py_CLEAR(clear_module_state->__pyx_kp_u_disable); Py_CLEAR(clear_module_state->__pyx_n_s_doc); Py_CLEAR(clear_module_state->__pyx_n_s_e); Py_CLEAR(clear_module_state->__pyx_kp_u_enable); Py_CLEAR(clear_module_state->__pyx_n_s_error); Py_CLEAR(clear_module_state->__pyx_n_s_expensive_compressed_data); Py_CLEAR(clear_module_state->__pyx_n_s_f); Py_CLEAR(clear_module_state->__pyx_n_s_factor); Py_CLEAR(clear_module_state->__pyx_n_s_flg); Py_CLEAR(clear_module_state->__pyx_kp_u_gc); Py_CLEAR(clear_module_state->__pyx_n_s_get); Py_CLEAR(clear_module_state->__pyx_n_s_get_compressor); Py_CLEAR(clear_module_state->__pyx_n_s_getstate); Py_CLEAR(clear_module_state->__pyx_n_s_hdr); Py_CLEAR(clear_module_state->__pyx_n_s_header); Py_CLEAR(clear_module_state->__pyx_n_s_header_fmt); Py_CLEAR(clear_module_state->__pyx_n_s_header_len); Py_CLEAR(clear_module_state->__pyx_n_s_helpers); Py_CLEAR(clear_module_state->__pyx_n_s_idata); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_init); Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_inner); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_n_s_is_deflate); Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); Py_CLEAR(clear_module_state->__pyx_n_s_isize); Py_CLEAR(clear_module_state->__pyx_n_s_join); Py_CLEAR(clear_module_state->__pyx_n_s_kwargs); Py_CLEAR(clear_module_state->__pyx_n_s_level); Py_CLEAR(clear_module_state->__pyx_kp_s_level_must_be_0_and_9); Py_CLEAR(clear_module_state->__pyx_kp_s_level_must_be_1_and_22); Py_CLEAR(clear_module_state->__pyx_kp_s_level_must_be_1_and_6_or_110_and); Py_CLEAR(clear_module_state->__pyx_n_s_lz4); Py_CLEAR(clear_module_state->__pyx_kp_s_lz4_compress_failed); Py_CLEAR(clear_module_state->__pyx_kp_s_lz4_decompress_failed); Py_CLEAR(clear_module_state->__pyx_n_s_lzma); Py_CLEAR(clear_module_state->__pyx_kp_s_lzma_compression_decompression); Py_CLEAR(clear_module_state->__pyx_n_s_lzma_data); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_max_padding_size); Py_CLEAR(clear_module_state->__pyx_n_s_metaclass); Py_CLEAR(clear_module_state->__pyx_n_s_min_r); Py_CLEAR(clear_module_state->__pyx_n_s_module); Py_CLEAR(clear_module_state->__pyx_n_s_mro_entries); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_name_2); Py_CLEAR(clear_module_state->__pyx_n_s_new); Py_CLEAR(clear_module_state->__pyx_n_s_none); Py_CLEAR(clear_module_state->__pyx_kp_s_none_no_compression_just_pass_t); Py_CLEAR(clear_module_state->__pyx_kp_s_not_enough_arguments); Py_CLEAR(clear_module_state->__pyx_n_s_null); Py_CLEAR(clear_module_state->__pyx_n_s_obfuscate); Py_CLEAR(clear_module_state->__pyx_n_s_obfuscate_2); Py_CLEAR(clear_module_state->__pyx_n_s_obfuscated_data); Py_CLEAR(clear_module_state->__pyx_n_s_osize); Py_CLEAR(clear_module_state->__pyx_n_s_pack); Py_CLEAR(clear_module_state->__pyx_n_s_params); Py_CLEAR(clear_module_state->__pyx_n_s_pickle); Py_CLEAR(clear_module_state->__pyx_n_s_prepare); Py_CLEAR(clear_module_state->__pyx_n_s_preset); Py_CLEAR(clear_module_state->__pyx_n_s_property); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_PickleError); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_checksum); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_result); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_type); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_CompressorBase); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_DecidingCompresso); Py_CLEAR(clear_module_state->__pyx_n_s_qualname); Py_CLEAR(clear_module_state->__pyx_n_s_r); Py_CLEAR(clear_module_state->__pyx_n_s_random); Py_CLEAR(clear_module_state->__pyx_n_s_random_padding_obfuscate); Py_CLEAR(clear_module_state->__pyx_n_s_ratio); Py_CLEAR(clear_module_state->__pyx_kp_s_raw_LZ4_compression_decompressi); Py_CLEAR(clear_module_state->__pyx_n_s_reduce); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex); Py_CLEAR(clear_module_state->__pyx_n_s_relative_random_reciprocal_obfu); Py_CLEAR(clear_module_state->__pyx_n_s_rsize); Py_CLEAR(clear_module_state->__pyx_n_s_s); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_n_s_set_name); Py_CLEAR(clear_module_state->__pyx_n_s_setstate); Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_size); Py_CLEAR(clear_module_state->__pyx_n_s_source); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_n_s_split); Py_CLEAR(clear_module_state->__pyx_kp_s_src_borg_compress_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_startswith); Py_CLEAR(clear_module_state->__pyx_n_s_state); Py_CLEAR(clear_module_state->__pyx_n_s_staticmethod); Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource); Py_CLEAR(clear_module_state->__pyx_n_s_struct); Py_CLEAR(clear_module_state->__pyx_n_s_super); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_kp_s_too_many_arguments); Py_CLEAR(clear_module_state->__pyx_n_s_trailer); Py_CLEAR(clear_module_state->__pyx_n_s_unpack); Py_CLEAR(clear_module_state->__pyx_kp_s_unsupported_compression_type); Py_CLEAR(clear_module_state->__pyx_n_s_update); Py_CLEAR(clear_module_state->__pyx_n_s_use_setstate); Py_CLEAR(clear_module_state->__pyx_n_s_values); Py_CLEAR(clear_module_state->__pyx_n_s_zlib); Py_CLEAR(clear_module_state->__pyx_kp_s_zlib_compression_decompression); Py_CLEAR(clear_module_state->__pyx_n_s_zstd); Py_CLEAR(clear_module_state->__pyx_kp_s_zstd_compress_failed_s); Py_CLEAR(clear_module_state->__pyx_kp_s_zstd_compression_decompression_p); Py_CLEAR(clear_module_state->__pyx_kp_s_zstd_decompress_failed_s); Py_CLEAR(clear_module_state->__pyx_kp_s_zstd_decompress_failed_size_mism); Py_CLEAR(clear_module_state->__pyx_kp_s_zstd_get_size_failed_data_was_no); Py_CLEAR(clear_module_state->__pyx_kp_s_zstd_get_size_failed_original_si); Py_CLEAR(clear_module_state->__pyx_float_0_001); Py_CLEAR(clear_module_state->__pyx_float_0_0001); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_1); Py_CLEAR(clear_module_state->__pyx_int_2); Py_CLEAR(clear_module_state->__pyx_int_3); Py_CLEAR(clear_module_state->__pyx_int_6); Py_CLEAR(clear_module_state->__pyx_int_8); Py_CLEAR(clear_module_state->__pyx_int_9); Py_CLEAR(clear_module_state->__pyx_int_10); Py_CLEAR(clear_module_state->__pyx_int_15); Py_CLEAR(clear_module_state->__pyx_int_22); Py_CLEAR(clear_module_state->__pyx_int_31); Py_CLEAR(clear_module_state->__pyx_int_100); Py_CLEAR(clear_module_state->__pyx_int_110); Py_CLEAR(clear_module_state->__pyx_int_123); Py_CLEAR(clear_module_state->__pyx_int_256); Py_CLEAR(clear_module_state->__pyx_int_1024); Py_CLEAR(clear_module_state->__pyx_int_222419149); Py_CLEAR(clear_module_state->__pyx_int_228825662); Py_CLEAR(clear_module_state->__pyx_int_238750788); Py_CLEAR(clear_module_state->__pyx_slice_); Py_CLEAR(clear_module_state->__pyx_slice__4); Py_CLEAR(clear_module_state->__pyx_slice__7); Py_CLEAR(clear_module_state->__pyx_tuple__2); Py_CLEAR(clear_module_state->__pyx_tuple__3); Py_CLEAR(clear_module_state->__pyx_tuple__8); Py_CLEAR(clear_module_state->__pyx_tuple__12); Py_CLEAR(clear_module_state->__pyx_tuple__14); Py_CLEAR(clear_module_state->__pyx_tuple__18); Py_CLEAR(clear_module_state->__pyx_tuple__20); Py_CLEAR(clear_module_state->__pyx_tuple__24); Py_CLEAR(clear_module_state->__pyx_tuple__33); Py_CLEAR(clear_module_state->__pyx_tuple__35); Py_CLEAR(clear_module_state->__pyx_tuple__37); Py_CLEAR(clear_module_state->__pyx_tuple__40); Py_CLEAR(clear_module_state->__pyx_tuple__42); Py_CLEAR(clear_module_state->__pyx_tuple__43); Py_CLEAR(clear_module_state->__pyx_tuple__45); Py_CLEAR(clear_module_state->__pyx_tuple__49); Py_CLEAR(clear_module_state->__pyx_tuple__50); Py_CLEAR(clear_module_state->__pyx_tuple__54); Py_CLEAR(clear_module_state->__pyx_tuple__59); Py_CLEAR(clear_module_state->__pyx_tuple__61); Py_CLEAR(clear_module_state->__pyx_tuple__64); Py_CLEAR(clear_module_state->__pyx_tuple__69); Py_CLEAR(clear_module_state->__pyx_tuple__71); Py_CLEAR(clear_module_state->__pyx_tuple__72); Py_CLEAR(clear_module_state->__pyx_tuple__74); Py_CLEAR(clear_module_state->__pyx_tuple__77); Py_CLEAR(clear_module_state->__pyx_tuple__79); Py_CLEAR(clear_module_state->__pyx_tuple__81); Py_CLEAR(clear_module_state->__pyx_tuple__83); Py_CLEAR(clear_module_state->__pyx_tuple__84); Py_CLEAR(clear_module_state->__pyx_tuple__85); Py_CLEAR(clear_module_state->__pyx_tuple__87); Py_CLEAR(clear_module_state->__pyx_tuple__89); Py_CLEAR(clear_module_state->__pyx_tuple__91); Py_CLEAR(clear_module_state->__pyx_tuple__93); Py_CLEAR(clear_module_state->__pyx_tuple__95); Py_CLEAR(clear_module_state->__pyx_tuple__97); Py_CLEAR(clear_module_state->__pyx_codeobj__13); Py_CLEAR(clear_module_state->__pyx_codeobj__15); Py_CLEAR(clear_module_state->__pyx_codeobj__16); Py_CLEAR(clear_module_state->__pyx_codeobj__17); Py_CLEAR(clear_module_state->__pyx_codeobj__19); Py_CLEAR(clear_module_state->__pyx_codeobj__21); Py_CLEAR(clear_module_state->__pyx_codeobj__22); Py_CLEAR(clear_module_state->__pyx_codeobj__23); Py_CLEAR(clear_module_state->__pyx_codeobj__25); Py_CLEAR(clear_module_state->__pyx_codeobj__26); Py_CLEAR(clear_module_state->__pyx_codeobj__27); Py_CLEAR(clear_module_state->__pyx_codeobj__28); Py_CLEAR(clear_module_state->__pyx_codeobj__30); Py_CLEAR(clear_module_state->__pyx_codeobj__31); Py_CLEAR(clear_module_state->__pyx_codeobj__34); Py_CLEAR(clear_module_state->__pyx_codeobj__36); Py_CLEAR(clear_module_state->__pyx_codeobj__38); Py_CLEAR(clear_module_state->__pyx_codeobj__41); Py_CLEAR(clear_module_state->__pyx_codeobj__44); Py_CLEAR(clear_module_state->__pyx_codeobj__46); Py_CLEAR(clear_module_state->__pyx_codeobj__48); Py_CLEAR(clear_module_state->__pyx_codeobj__51); Py_CLEAR(clear_module_state->__pyx_codeobj__52); Py_CLEAR(clear_module_state->__pyx_codeobj__55); Py_CLEAR(clear_module_state->__pyx_codeobj__56); Py_CLEAR(clear_module_state->__pyx_codeobj__57); Py_CLEAR(clear_module_state->__pyx_codeobj__58); Py_CLEAR(clear_module_state->__pyx_codeobj__60); Py_CLEAR(clear_module_state->__pyx_codeobj__62); Py_CLEAR(clear_module_state->__pyx_codeobj__63); Py_CLEAR(clear_module_state->__pyx_codeobj__65); Py_CLEAR(clear_module_state->__pyx_codeobj__66); Py_CLEAR(clear_module_state->__pyx_codeobj__67); Py_CLEAR(clear_module_state->__pyx_codeobj__70); Py_CLEAR(clear_module_state->__pyx_codeobj__73); Py_CLEAR(clear_module_state->__pyx_codeobj__75); Py_CLEAR(clear_module_state->__pyx_codeobj__76); Py_CLEAR(clear_module_state->__pyx_codeobj__78); Py_CLEAR(clear_module_state->__pyx_codeobj__80); Py_CLEAR(clear_module_state->__pyx_codeobj__82); Py_CLEAR(clear_module_state->__pyx_codeobj__86); Py_CLEAR(clear_module_state->__pyx_codeobj__88); Py_CLEAR(clear_module_state->__pyx_codeobj__90); Py_CLEAR(clear_module_state->__pyx_codeobj__92); Py_CLEAR(clear_module_state->__pyx_codeobj__94); Py_CLEAR(clear_module_state->__pyx_codeobj__96); Py_CLEAR(clear_module_state->__pyx_codeobj__98); Py_CLEAR(clear_module_state->__pyx_codeobj__99); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_4borg_8compress_CompressorBase); Py_VISIT(traverse_module_state->__pyx_type_4borg_8compress_CompressorBase); Py_VISIT(traverse_module_state->__pyx_ptype_4borg_8compress_DecidingCompressor); Py_VISIT(traverse_module_state->__pyx_type_4borg_8compress_DecidingCompressor); Py_VISIT(traverse_module_state->__pyx_kp_s_1_4_01); Py_VISIT(traverse_module_state->__pyx_n_s_API_VERSION); Py_VISIT(traverse_module_state->__pyx_n_s_ArgumentTypeError); Py_VISIT(traverse_module_state->__pyx_n_s_Auto); Py_VISIT(traverse_module_state->__pyx_n_s_Auto___init); Py_VISIT(traverse_module_state->__pyx_n_s_Auto__decide); Py_VISIT(traverse_module_state->__pyx_n_s_Auto_compress); Py_VISIT(traverse_module_state->__pyx_n_s_Auto_decide); Py_VISIT(traverse_module_state->__pyx_n_s_Auto_decompress); Py_VISIT(traverse_module_state->__pyx_n_s_Auto_detect); Py_VISIT(traverse_module_state->__pyx_n_s_Buffer); Py_VISIT(traverse_module_state->__pyx_n_s_CHECK_NONE); Py_VISIT(traverse_module_state->__pyx_n_s_CNONE); Py_VISIT(traverse_module_state->__pyx_n_s_CNONE_compress); Py_VISIT(traverse_module_state->__pyx_n_s_CNONE_decompress); Py_VISIT(traverse_module_state->__pyx_n_s_COMPRESSOR_LIST); Py_VISIT(traverse_module_state->__pyx_n_s_COMPRESSOR_TABLE); Py_VISIT(traverse_module_state->__pyx_n_s_CompressionSpec); Py_VISIT(traverse_module_state->__pyx_n_s_CompressionSpec___init); Py_VISIT(traverse_module_state->__pyx_n_s_CompressionSpec_compressor); Py_VISIT(traverse_module_state->__pyx_n_s_Compressor); Py_VISIT(traverse_module_state->__pyx_n_s_CompressorBase); Py_VISIT(traverse_module_state->__pyx_n_s_CompressorBase___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_CompressorBase___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_CompressorBase_compress); Py_VISIT(traverse_module_state->__pyx_n_s_CompressorBase_decide); Py_VISIT(traverse_module_state->__pyx_n_s_CompressorBase_decompress); Py_VISIT(traverse_module_state->__pyx_n_s_CompressorBase_detect); Py_VISIT(traverse_module_state->__pyx_n_s_Compressor___init); Py_VISIT(traverse_module_state->__pyx_n_s_Compressor_compress); Py_VISIT(traverse_module_state->__pyx_n_s_Compressor_decompress); Py_VISIT(traverse_module_state->__pyx_n_s_Compressor_detect); Py_VISIT(traverse_module_state->__pyx_n_s_DecidingCompressor); Py_VISIT(traverse_module_state->__pyx_n_s_DecidingCompressor___reduce_cyth); Py_VISIT(traverse_module_state->__pyx_n_s_DecidingCompressor___setstate_cy); Py_VISIT(traverse_module_state->__pyx_n_s_DecidingCompressor__decide); Py_VISIT(traverse_module_state->__pyx_n_s_DecidingCompressor_compress); Py_VISIT(traverse_module_state->__pyx_n_s_DecidingCompressor_decide); Py_VISIT(traverse_module_state->__pyx_n_s_DecidingCompressor_decide_compre); Py_VISIT(traverse_module_state->__pyx_n_s_DecompressionError); Py_VISIT(traverse_module_state->__pyx_kp_s_I); Py_VISIT(traverse_module_state->__pyx_n_s_ID); Py_VISIT(traverse_module_state->__pyx_n_s_ImportError); Py_VISIT(traverse_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0); Py_VISIT(traverse_module_state->__pyx_n_s_LZ4); Py_VISIT(traverse_module_state->__pyx_n_s_LZ4_COMPRESSOR); Py_VISIT(traverse_module_state->__pyx_n_s_LZ4___init); Py_VISIT(traverse_module_state->__pyx_n_s_LZ4__decide); Py_VISIT(traverse_module_state->__pyx_n_s_LZ4_decompress); Py_VISIT(traverse_module_state->__pyx_n_s_LZMA); Py_VISIT(traverse_module_state->__pyx_n_s_LZMAError); Py_VISIT(traverse_module_state->__pyx_n_s_LZMA___init); Py_VISIT(traverse_module_state->__pyx_n_s_LZMA__decide); Py_VISIT(traverse_module_state->__pyx_n_s_LZMA_decompress); Py_VISIT(traverse_module_state->__pyx_n_s_MAX_DATA_SIZE); Py_VISIT(traverse_module_state->__pyx_n_s_MemoryError); Py_VISIT(traverse_module_state->__pyx_kp_s_Meta_Compressor_that_decides_wh); Py_VISIT(traverse_module_state->__pyx_kp_s_Meta_Compressor_that_obfuscates); Py_VISIT(traverse_module_state->__pyx_n_s_NONE_COMPRESSOR); Py_VISIT(traverse_module_state->__pyx_kp_s_No_decompressor_for_this_data_fo); Py_VISIT(traverse_module_state->__pyx_kp_s_No_lzma_support_found); Py_VISIT(traverse_module_state->__pyx_n_s_NotImplemented); Py_VISIT(traverse_module_state->__pyx_n_s_NotImplementedError); Py_VISIT(traverse_module_state->__pyx_n_s_ObfuscateSize); Py_VISIT(traverse_module_state->__pyx_n_s_ObfuscateSize___init); Py_VISIT(traverse_module_state->__pyx_n_s_ObfuscateSize__obfuscate); Py_VISIT(traverse_module_state->__pyx_n_s_ObfuscateSize__random_padding_ob); Py_VISIT(traverse_module_state->__pyx_n_s_ObfuscateSize__relative_random_r); Py_VISIT(traverse_module_state->__pyx_n_s_ObfuscateSize_compress); Py_VISIT(traverse_module_state->__pyx_n_s_ObfuscateSize_decompress); Py_VISIT(traverse_module_state->__pyx_n_s_PickleError); Py_VISIT(traverse_module_state->__pyx_n_s_Struct); Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); Py_VISIT(traverse_module_state->__pyx_n_s_ZLIB); Py_VISIT(traverse_module_state->__pyx_n_s_ZLIB___init); Py_VISIT(traverse_module_state->__pyx_n_s_ZLIB_compress); Py_VISIT(traverse_module_state->__pyx_n_s_ZLIB_decompress); Py_VISIT(traverse_module_state->__pyx_n_s_ZLIB_detect); Py_VISIT(traverse_module_state->__pyx_n_s_ZSTD); Py_VISIT(traverse_module_state->__pyx_n_s_ZSTD___init); Py_VISIT(traverse_module_state->__pyx_n_s_ZSTD__decide); Py_VISIT(traverse_module_state->__pyx_n_s_ZSTD_decompress); Py_VISIT(traverse_module_state->__pyx_n_s__10); Py_VISIT(traverse_module_state->__pyx_n_s__100); Py_VISIT(traverse_module_state->__pyx_kp_b__11); Py_VISIT(traverse_module_state->__pyx_kp_b__29); Py_VISIT(traverse_module_state->__pyx_kp_b__32); Py_VISIT(traverse_module_state->__pyx_kp_b__39); Py_VISIT(traverse_module_state->__pyx_kp_b__47); Py_VISIT(traverse_module_state->__pyx_kp_b__5); Py_VISIT(traverse_module_state->__pyx_kp_b__53); Py_VISIT(traverse_module_state->__pyx_kp_s__6); Py_VISIT(traverse_module_state->__pyx_kp_b__68); Py_VISIT(traverse_module_state->__pyx_kp_u__9); Py_VISIT(traverse_module_state->__pyx_n_s_addtl_size); Py_VISIT(traverse_module_state->__pyx_n_s_argparse); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_auto); Py_VISIT(traverse_module_state->__pyx_kp_s_bad_arguments); Py_VISIT(traverse_module_state->__pyx_n_s_baseclass); Py_VISIT(traverse_module_state->__pyx_n_s_borg_compress); Py_VISIT(traverse_module_state->__pyx_n_s_buf); Py_VISIT(traverse_module_state->__pyx_n_s_buffer); Py_VISIT(traverse_module_state->__pyx_n_s_cheap_compressed_data); Py_VISIT(traverse_module_state->__pyx_n_s_check); Py_VISIT(traverse_module_state->__pyx_n_s_check_ok); Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_cls); Py_VISIT(traverse_module_state->__pyx_n_s_cmf); Py_VISIT(traverse_module_state->__pyx_n_s_compr_size); Py_VISIT(traverse_module_state->__pyx_n_s_compress); Py_VISIT(traverse_module_state->__pyx_n_s_compressed_data); Py_VISIT(traverse_module_state->__pyx_kp_s_compresses_using_a_compressor_w); Py_VISIT(traverse_module_state->__pyx_n_s_compression); Py_VISIT(traverse_module_state->__pyx_n_s_compressor); Py_VISIT(traverse_module_state->__pyx_n_s_compressor_cls); Py_VISIT(traverse_module_state->__pyx_n_s_constants); Py_VISIT(traverse_module_state->__pyx_n_s_count); Py_VISIT(traverse_module_state->__pyx_n_s_data); Py_VISIT(traverse_module_state->__pyx_n_s_decide); Py_VISIT(traverse_module_state->__pyx_n_s_decide_2); Py_VISIT(traverse_module_state->__pyx_n_s_decide_compress); Py_VISIT(traverse_module_state->__pyx_n_s_decidebaseclass); Py_VISIT(traverse_module_state->__pyx_n_s_decompress); Py_VISIT(traverse_module_state->__pyx_n_s_dest); Py_VISIT(traverse_module_state->__pyx_n_s_detect); Py_VISIT(traverse_module_state->__pyx_n_s_dict); Py_VISIT(traverse_module_state->__pyx_n_s_dict_2); Py_VISIT(traverse_module_state->__pyx_kp_u_disable); Py_VISIT(traverse_module_state->__pyx_n_s_doc); Py_VISIT(traverse_module_state->__pyx_n_s_e); Py_VISIT(traverse_module_state->__pyx_kp_u_enable); Py_VISIT(traverse_module_state->__pyx_n_s_error); Py_VISIT(traverse_module_state->__pyx_n_s_expensive_compressed_data); Py_VISIT(traverse_module_state->__pyx_n_s_f); Py_VISIT(traverse_module_state->__pyx_n_s_factor); Py_VISIT(traverse_module_state->__pyx_n_s_flg); Py_VISIT(traverse_module_state->__pyx_kp_u_gc); Py_VISIT(traverse_module_state->__pyx_n_s_get); Py_VISIT(traverse_module_state->__pyx_n_s_get_compressor); Py_VISIT(traverse_module_state->__pyx_n_s_getstate); Py_VISIT(traverse_module_state->__pyx_n_s_hdr); Py_VISIT(traverse_module_state->__pyx_n_s_header); Py_VISIT(traverse_module_state->__pyx_n_s_header_fmt); Py_VISIT(traverse_module_state->__pyx_n_s_header_len); Py_VISIT(traverse_module_state->__pyx_n_s_helpers); Py_VISIT(traverse_module_state->__pyx_n_s_idata); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_init); Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_inner); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_n_s_is_deflate); Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); Py_VISIT(traverse_module_state->__pyx_n_s_isize); Py_VISIT(traverse_module_state->__pyx_n_s_join); Py_VISIT(traverse_module_state->__pyx_n_s_kwargs); Py_VISIT(traverse_module_state->__pyx_n_s_level); Py_VISIT(traverse_module_state->__pyx_kp_s_level_must_be_0_and_9); Py_VISIT(traverse_module_state->__pyx_kp_s_level_must_be_1_and_22); Py_VISIT(traverse_module_state->__pyx_kp_s_level_must_be_1_and_6_or_110_and); Py_VISIT(traverse_module_state->__pyx_n_s_lz4); Py_VISIT(traverse_module_state->__pyx_kp_s_lz4_compress_failed); Py_VISIT(traverse_module_state->__pyx_kp_s_lz4_decompress_failed); Py_VISIT(traverse_module_state->__pyx_n_s_lzma); Py_VISIT(traverse_module_state->__pyx_kp_s_lzma_compression_decompression); Py_VISIT(traverse_module_state->__pyx_n_s_lzma_data); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_max_padding_size); Py_VISIT(traverse_module_state->__pyx_n_s_metaclass); Py_VISIT(traverse_module_state->__pyx_n_s_min_r); Py_VISIT(traverse_module_state->__pyx_n_s_module); Py_VISIT(traverse_module_state->__pyx_n_s_mro_entries); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_name_2); Py_VISIT(traverse_module_state->__pyx_n_s_new); Py_VISIT(traverse_module_state->__pyx_n_s_none); Py_VISIT(traverse_module_state->__pyx_kp_s_none_no_compression_just_pass_t); Py_VISIT(traverse_module_state->__pyx_kp_s_not_enough_arguments); Py_VISIT(traverse_module_state->__pyx_n_s_null); Py_VISIT(traverse_module_state->__pyx_n_s_obfuscate); Py_VISIT(traverse_module_state->__pyx_n_s_obfuscate_2); Py_VISIT(traverse_module_state->__pyx_n_s_obfuscated_data); Py_VISIT(traverse_module_state->__pyx_n_s_osize); Py_VISIT(traverse_module_state->__pyx_n_s_pack); Py_VISIT(traverse_module_state->__pyx_n_s_params); Py_VISIT(traverse_module_state->__pyx_n_s_pickle); Py_VISIT(traverse_module_state->__pyx_n_s_prepare); Py_VISIT(traverse_module_state->__pyx_n_s_preset); Py_VISIT(traverse_module_state->__pyx_n_s_property); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_PickleError); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_checksum); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_result); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_type); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_CompressorBase); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_DecidingCompresso); Py_VISIT(traverse_module_state->__pyx_n_s_qualname); Py_VISIT(traverse_module_state->__pyx_n_s_r); Py_VISIT(traverse_module_state->__pyx_n_s_random); Py_VISIT(traverse_module_state->__pyx_n_s_random_padding_obfuscate); Py_VISIT(traverse_module_state->__pyx_n_s_ratio); Py_VISIT(traverse_module_state->__pyx_kp_s_raw_LZ4_compression_decompressi); Py_VISIT(traverse_module_state->__pyx_n_s_reduce); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex); Py_VISIT(traverse_module_state->__pyx_n_s_relative_random_reciprocal_obfu); Py_VISIT(traverse_module_state->__pyx_n_s_rsize); Py_VISIT(traverse_module_state->__pyx_n_s_s); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_n_s_set_name); Py_VISIT(traverse_module_state->__pyx_n_s_setstate); Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_size); Py_VISIT(traverse_module_state->__pyx_n_s_source); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_n_s_split); Py_VISIT(traverse_module_state->__pyx_kp_s_src_borg_compress_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_startswith); Py_VISIT(traverse_module_state->__pyx_n_s_state); Py_VISIT(traverse_module_state->__pyx_n_s_staticmethod); Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource); Py_VISIT(traverse_module_state->__pyx_n_s_struct); Py_VISIT(traverse_module_state->__pyx_n_s_super); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_kp_s_too_many_arguments); Py_VISIT(traverse_module_state->__pyx_n_s_trailer); Py_VISIT(traverse_module_state->__pyx_n_s_unpack); Py_VISIT(traverse_module_state->__pyx_kp_s_unsupported_compression_type); Py_VISIT(traverse_module_state->__pyx_n_s_update); Py_VISIT(traverse_module_state->__pyx_n_s_use_setstate); Py_VISIT(traverse_module_state->__pyx_n_s_values); Py_VISIT(traverse_module_state->__pyx_n_s_zlib); Py_VISIT(traverse_module_state->__pyx_kp_s_zlib_compression_decompression); Py_VISIT(traverse_module_state->__pyx_n_s_zstd); Py_VISIT(traverse_module_state->__pyx_kp_s_zstd_compress_failed_s); Py_VISIT(traverse_module_state->__pyx_kp_s_zstd_compression_decompression_p); Py_VISIT(traverse_module_state->__pyx_kp_s_zstd_decompress_failed_s); Py_VISIT(traverse_module_state->__pyx_kp_s_zstd_decompress_failed_size_mism); Py_VISIT(traverse_module_state->__pyx_kp_s_zstd_get_size_failed_data_was_no); Py_VISIT(traverse_module_state->__pyx_kp_s_zstd_get_size_failed_original_si); Py_VISIT(traverse_module_state->__pyx_float_0_001); Py_VISIT(traverse_module_state->__pyx_float_0_0001); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_int_1); Py_VISIT(traverse_module_state->__pyx_int_2); Py_VISIT(traverse_module_state->__pyx_int_3); Py_VISIT(traverse_module_state->__pyx_int_6); Py_VISIT(traverse_module_state->__pyx_int_8); Py_VISIT(traverse_module_state->__pyx_int_9); Py_VISIT(traverse_module_state->__pyx_int_10); Py_VISIT(traverse_module_state->__pyx_int_15); Py_VISIT(traverse_module_state->__pyx_int_22); Py_VISIT(traverse_module_state->__pyx_int_31); Py_VISIT(traverse_module_state->__pyx_int_100); Py_VISIT(traverse_module_state->__pyx_int_110); Py_VISIT(traverse_module_state->__pyx_int_123); Py_VISIT(traverse_module_state->__pyx_int_256); Py_VISIT(traverse_module_state->__pyx_int_1024); Py_VISIT(traverse_module_state->__pyx_int_222419149); Py_VISIT(traverse_module_state->__pyx_int_228825662); Py_VISIT(traverse_module_state->__pyx_int_238750788); Py_VISIT(traverse_module_state->__pyx_slice_); Py_VISIT(traverse_module_state->__pyx_slice__4); Py_VISIT(traverse_module_state->__pyx_slice__7); Py_VISIT(traverse_module_state->__pyx_tuple__2); Py_VISIT(traverse_module_state->__pyx_tuple__3); Py_VISIT(traverse_module_state->__pyx_tuple__8); Py_VISIT(traverse_module_state->__pyx_tuple__12); Py_VISIT(traverse_module_state->__pyx_tuple__14); Py_VISIT(traverse_module_state->__pyx_tuple__18); Py_VISIT(traverse_module_state->__pyx_tuple__20); Py_VISIT(traverse_module_state->__pyx_tuple__24); Py_VISIT(traverse_module_state->__pyx_tuple__33); Py_VISIT(traverse_module_state->__pyx_tuple__35); Py_VISIT(traverse_module_state->__pyx_tuple__37); Py_VISIT(traverse_module_state->__pyx_tuple__40); Py_VISIT(traverse_module_state->__pyx_tuple__42); Py_VISIT(traverse_module_state->__pyx_tuple__43); Py_VISIT(traverse_module_state->__pyx_tuple__45); Py_VISIT(traverse_module_state->__pyx_tuple__49); Py_VISIT(traverse_module_state->__pyx_tuple__50); Py_VISIT(traverse_module_state->__pyx_tuple__54); Py_VISIT(traverse_module_state->__pyx_tuple__59); Py_VISIT(traverse_module_state->__pyx_tuple__61); Py_VISIT(traverse_module_state->__pyx_tuple__64); Py_VISIT(traverse_module_state->__pyx_tuple__69); Py_VISIT(traverse_module_state->__pyx_tuple__71); Py_VISIT(traverse_module_state->__pyx_tuple__72); Py_VISIT(traverse_module_state->__pyx_tuple__74); Py_VISIT(traverse_module_state->__pyx_tuple__77); Py_VISIT(traverse_module_state->__pyx_tuple__79); Py_VISIT(traverse_module_state->__pyx_tuple__81); Py_VISIT(traverse_module_state->__pyx_tuple__83); Py_VISIT(traverse_module_state->__pyx_tuple__84); Py_VISIT(traverse_module_state->__pyx_tuple__85); Py_VISIT(traverse_module_state->__pyx_tuple__87); Py_VISIT(traverse_module_state->__pyx_tuple__89); Py_VISIT(traverse_module_state->__pyx_tuple__91); Py_VISIT(traverse_module_state->__pyx_tuple__93); Py_VISIT(traverse_module_state->__pyx_tuple__95); Py_VISIT(traverse_module_state->__pyx_tuple__97); Py_VISIT(traverse_module_state->__pyx_codeobj__13); Py_VISIT(traverse_module_state->__pyx_codeobj__15); Py_VISIT(traverse_module_state->__pyx_codeobj__16); Py_VISIT(traverse_module_state->__pyx_codeobj__17); Py_VISIT(traverse_module_state->__pyx_codeobj__19); Py_VISIT(traverse_module_state->__pyx_codeobj__21); Py_VISIT(traverse_module_state->__pyx_codeobj__22); Py_VISIT(traverse_module_state->__pyx_codeobj__23); Py_VISIT(traverse_module_state->__pyx_codeobj__25); Py_VISIT(traverse_module_state->__pyx_codeobj__26); Py_VISIT(traverse_module_state->__pyx_codeobj__27); Py_VISIT(traverse_module_state->__pyx_codeobj__28); Py_VISIT(traverse_module_state->__pyx_codeobj__30); Py_VISIT(traverse_module_state->__pyx_codeobj__31); Py_VISIT(traverse_module_state->__pyx_codeobj__34); Py_VISIT(traverse_module_state->__pyx_codeobj__36); Py_VISIT(traverse_module_state->__pyx_codeobj__38); Py_VISIT(traverse_module_state->__pyx_codeobj__41); Py_VISIT(traverse_module_state->__pyx_codeobj__44); Py_VISIT(traverse_module_state->__pyx_codeobj__46); Py_VISIT(traverse_module_state->__pyx_codeobj__48); Py_VISIT(traverse_module_state->__pyx_codeobj__51); Py_VISIT(traverse_module_state->__pyx_codeobj__52); Py_VISIT(traverse_module_state->__pyx_codeobj__55); Py_VISIT(traverse_module_state->__pyx_codeobj__56); Py_VISIT(traverse_module_state->__pyx_codeobj__57); Py_VISIT(traverse_module_state->__pyx_codeobj__58); Py_VISIT(traverse_module_state->__pyx_codeobj__60); Py_VISIT(traverse_module_state->__pyx_codeobj__62); Py_VISIT(traverse_module_state->__pyx_codeobj__63); Py_VISIT(traverse_module_state->__pyx_codeobj__65); Py_VISIT(traverse_module_state->__pyx_codeobj__66); Py_VISIT(traverse_module_state->__pyx_codeobj__67); Py_VISIT(traverse_module_state->__pyx_codeobj__70); Py_VISIT(traverse_module_state->__pyx_codeobj__73); Py_VISIT(traverse_module_state->__pyx_codeobj__75); Py_VISIT(traverse_module_state->__pyx_codeobj__76); Py_VISIT(traverse_module_state->__pyx_codeobj__78); Py_VISIT(traverse_module_state->__pyx_codeobj__80); Py_VISIT(traverse_module_state->__pyx_codeobj__82); Py_VISIT(traverse_module_state->__pyx_codeobj__86); Py_VISIT(traverse_module_state->__pyx_codeobj__88); Py_VISIT(traverse_module_state->__pyx_codeobj__90); Py_VISIT(traverse_module_state->__pyx_codeobj__92); Py_VISIT(traverse_module_state->__pyx_codeobj__94); Py_VISIT(traverse_module_state->__pyx_codeobj__96); Py_VISIT(traverse_module_state->__pyx_codeobj__98); Py_VISIT(traverse_module_state->__pyx_codeobj__99); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #define __pyx_type_4borg_8compress_CompressorBase __pyx_mstate_global->__pyx_type_4borg_8compress_CompressorBase #define __pyx_type_4borg_8compress_DecidingCompressor __pyx_mstate_global->__pyx_type_4borg_8compress_DecidingCompressor #endif #define __pyx_ptype_4borg_8compress_CompressorBase __pyx_mstate_global->__pyx_ptype_4borg_8compress_CompressorBase #define __pyx_ptype_4borg_8compress_DecidingCompressor __pyx_mstate_global->__pyx_ptype_4borg_8compress_DecidingCompressor #define __pyx_kp_s_1_4_01 __pyx_mstate_global->__pyx_kp_s_1_4_01 #define __pyx_n_s_API_VERSION __pyx_mstate_global->__pyx_n_s_API_VERSION #define __pyx_n_s_ArgumentTypeError __pyx_mstate_global->__pyx_n_s_ArgumentTypeError #define __pyx_n_s_Auto __pyx_mstate_global->__pyx_n_s_Auto #define __pyx_n_s_Auto___init __pyx_mstate_global->__pyx_n_s_Auto___init #define __pyx_n_s_Auto__decide __pyx_mstate_global->__pyx_n_s_Auto__decide #define __pyx_n_s_Auto_compress __pyx_mstate_global->__pyx_n_s_Auto_compress #define __pyx_n_s_Auto_decide __pyx_mstate_global->__pyx_n_s_Auto_decide #define __pyx_n_s_Auto_decompress __pyx_mstate_global->__pyx_n_s_Auto_decompress #define __pyx_n_s_Auto_detect __pyx_mstate_global->__pyx_n_s_Auto_detect #define __pyx_n_s_Buffer __pyx_mstate_global->__pyx_n_s_Buffer #define __pyx_n_s_CHECK_NONE __pyx_mstate_global->__pyx_n_s_CHECK_NONE #define __pyx_n_s_CNONE __pyx_mstate_global->__pyx_n_s_CNONE #define __pyx_n_s_CNONE_compress __pyx_mstate_global->__pyx_n_s_CNONE_compress #define __pyx_n_s_CNONE_decompress __pyx_mstate_global->__pyx_n_s_CNONE_decompress #define __pyx_n_s_COMPRESSOR_LIST __pyx_mstate_global->__pyx_n_s_COMPRESSOR_LIST #define __pyx_n_s_COMPRESSOR_TABLE __pyx_mstate_global->__pyx_n_s_COMPRESSOR_TABLE #define __pyx_n_s_CompressionSpec __pyx_mstate_global->__pyx_n_s_CompressionSpec #define __pyx_n_s_CompressionSpec___init __pyx_mstate_global->__pyx_n_s_CompressionSpec___init #define __pyx_n_s_CompressionSpec_compressor __pyx_mstate_global->__pyx_n_s_CompressionSpec_compressor #define __pyx_n_s_Compressor __pyx_mstate_global->__pyx_n_s_Compressor #define __pyx_n_s_CompressorBase __pyx_mstate_global->__pyx_n_s_CompressorBase #define __pyx_n_s_CompressorBase___reduce_cython __pyx_mstate_global->__pyx_n_s_CompressorBase___reduce_cython #define __pyx_n_s_CompressorBase___setstate_cython __pyx_mstate_global->__pyx_n_s_CompressorBase___setstate_cython #define __pyx_n_s_CompressorBase_compress __pyx_mstate_global->__pyx_n_s_CompressorBase_compress #define __pyx_n_s_CompressorBase_decide __pyx_mstate_global->__pyx_n_s_CompressorBase_decide #define __pyx_n_s_CompressorBase_decompress __pyx_mstate_global->__pyx_n_s_CompressorBase_decompress #define __pyx_n_s_CompressorBase_detect __pyx_mstate_global->__pyx_n_s_CompressorBase_detect #define __pyx_n_s_Compressor___init __pyx_mstate_global->__pyx_n_s_Compressor___init #define __pyx_n_s_Compressor_compress __pyx_mstate_global->__pyx_n_s_Compressor_compress #define __pyx_n_s_Compressor_decompress __pyx_mstate_global->__pyx_n_s_Compressor_decompress #define __pyx_n_s_Compressor_detect __pyx_mstate_global->__pyx_n_s_Compressor_detect #define __pyx_n_s_DecidingCompressor __pyx_mstate_global->__pyx_n_s_DecidingCompressor #define __pyx_n_s_DecidingCompressor___reduce_cyth __pyx_mstate_global->__pyx_n_s_DecidingCompressor___reduce_cyth #define __pyx_n_s_DecidingCompressor___setstate_cy __pyx_mstate_global->__pyx_n_s_DecidingCompressor___setstate_cy #define __pyx_n_s_DecidingCompressor__decide __pyx_mstate_global->__pyx_n_s_DecidingCompressor__decide #define __pyx_n_s_DecidingCompressor_compress __pyx_mstate_global->__pyx_n_s_DecidingCompressor_compress #define __pyx_n_s_DecidingCompressor_decide __pyx_mstate_global->__pyx_n_s_DecidingCompressor_decide #define __pyx_n_s_DecidingCompressor_decide_compre __pyx_mstate_global->__pyx_n_s_DecidingCompressor_decide_compre #define __pyx_n_s_DecompressionError __pyx_mstate_global->__pyx_n_s_DecompressionError #define __pyx_kp_s_I __pyx_mstate_global->__pyx_kp_s_I #define __pyx_n_s_ID __pyx_mstate_global->__pyx_n_s_ID #define __pyx_n_s_ImportError __pyx_mstate_global->__pyx_n_s_ImportError #define __pyx_kp_s_Incompatible_checksums_0x_x_vs_0 __pyx_mstate_global->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0 #define __pyx_n_s_LZ4 __pyx_mstate_global->__pyx_n_s_LZ4 #define __pyx_n_s_LZ4_COMPRESSOR __pyx_mstate_global->__pyx_n_s_LZ4_COMPRESSOR #define __pyx_n_s_LZ4___init __pyx_mstate_global->__pyx_n_s_LZ4___init #define __pyx_n_s_LZ4__decide __pyx_mstate_global->__pyx_n_s_LZ4__decide #define __pyx_n_s_LZ4_decompress __pyx_mstate_global->__pyx_n_s_LZ4_decompress #define __pyx_n_s_LZMA __pyx_mstate_global->__pyx_n_s_LZMA #define __pyx_n_s_LZMAError __pyx_mstate_global->__pyx_n_s_LZMAError #define __pyx_n_s_LZMA___init __pyx_mstate_global->__pyx_n_s_LZMA___init #define __pyx_n_s_LZMA__decide __pyx_mstate_global->__pyx_n_s_LZMA__decide #define __pyx_n_s_LZMA_decompress __pyx_mstate_global->__pyx_n_s_LZMA_decompress #define __pyx_n_s_MAX_DATA_SIZE __pyx_mstate_global->__pyx_n_s_MAX_DATA_SIZE #define __pyx_n_s_MemoryError __pyx_mstate_global->__pyx_n_s_MemoryError #define __pyx_kp_s_Meta_Compressor_that_decides_wh __pyx_mstate_global->__pyx_kp_s_Meta_Compressor_that_decides_wh #define __pyx_kp_s_Meta_Compressor_that_obfuscates __pyx_mstate_global->__pyx_kp_s_Meta_Compressor_that_obfuscates #define __pyx_n_s_NONE_COMPRESSOR __pyx_mstate_global->__pyx_n_s_NONE_COMPRESSOR #define __pyx_kp_s_No_decompressor_for_this_data_fo __pyx_mstate_global->__pyx_kp_s_No_decompressor_for_this_data_fo #define __pyx_kp_s_No_lzma_support_found __pyx_mstate_global->__pyx_kp_s_No_lzma_support_found #define __pyx_n_s_NotImplemented __pyx_mstate_global->__pyx_n_s_NotImplemented #define __pyx_n_s_NotImplementedError __pyx_mstate_global->__pyx_n_s_NotImplementedError #define __pyx_n_s_ObfuscateSize __pyx_mstate_global->__pyx_n_s_ObfuscateSize #define __pyx_n_s_ObfuscateSize___init __pyx_mstate_global->__pyx_n_s_ObfuscateSize___init #define __pyx_n_s_ObfuscateSize__obfuscate __pyx_mstate_global->__pyx_n_s_ObfuscateSize__obfuscate #define __pyx_n_s_ObfuscateSize__random_padding_ob __pyx_mstate_global->__pyx_n_s_ObfuscateSize__random_padding_ob #define __pyx_n_s_ObfuscateSize__relative_random_r __pyx_mstate_global->__pyx_n_s_ObfuscateSize__relative_random_r #define __pyx_n_s_ObfuscateSize_compress __pyx_mstate_global->__pyx_n_s_ObfuscateSize_compress #define __pyx_n_s_ObfuscateSize_decompress __pyx_mstate_global->__pyx_n_s_ObfuscateSize_decompress #define __pyx_n_s_PickleError __pyx_mstate_global->__pyx_n_s_PickleError #define __pyx_n_s_Struct __pyx_mstate_global->__pyx_n_s_Struct #define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError #define __pyx_n_s_ZLIB __pyx_mstate_global->__pyx_n_s_ZLIB #define __pyx_n_s_ZLIB___init __pyx_mstate_global->__pyx_n_s_ZLIB___init #define __pyx_n_s_ZLIB_compress __pyx_mstate_global->__pyx_n_s_ZLIB_compress #define __pyx_n_s_ZLIB_decompress __pyx_mstate_global->__pyx_n_s_ZLIB_decompress #define __pyx_n_s_ZLIB_detect __pyx_mstate_global->__pyx_n_s_ZLIB_detect #define __pyx_n_s_ZSTD __pyx_mstate_global->__pyx_n_s_ZSTD #define __pyx_n_s_ZSTD___init __pyx_mstate_global->__pyx_n_s_ZSTD___init #define __pyx_n_s_ZSTD__decide __pyx_mstate_global->__pyx_n_s_ZSTD__decide #define __pyx_n_s_ZSTD_decompress __pyx_mstate_global->__pyx_n_s_ZSTD_decompress #define __pyx_n_s__10 __pyx_mstate_global->__pyx_n_s__10 #define __pyx_n_s__100 __pyx_mstate_global->__pyx_n_s__100 #define __pyx_kp_b__11 __pyx_mstate_global->__pyx_kp_b__11 #define __pyx_kp_b__29 __pyx_mstate_global->__pyx_kp_b__29 #define __pyx_kp_b__32 __pyx_mstate_global->__pyx_kp_b__32 #define __pyx_kp_b__39 __pyx_mstate_global->__pyx_kp_b__39 #define __pyx_kp_b__47 __pyx_mstate_global->__pyx_kp_b__47 #define __pyx_kp_b__5 __pyx_mstate_global->__pyx_kp_b__5 #define __pyx_kp_b__53 __pyx_mstate_global->__pyx_kp_b__53 #define __pyx_kp_s__6 __pyx_mstate_global->__pyx_kp_s__6 #define __pyx_kp_b__68 __pyx_mstate_global->__pyx_kp_b__68 #define __pyx_kp_u__9 __pyx_mstate_global->__pyx_kp_u__9 #define __pyx_n_s_addtl_size __pyx_mstate_global->__pyx_n_s_addtl_size #define __pyx_n_s_argparse __pyx_mstate_global->__pyx_n_s_argparse #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_auto __pyx_mstate_global->__pyx_n_s_auto #define __pyx_kp_s_bad_arguments __pyx_mstate_global->__pyx_kp_s_bad_arguments #define __pyx_n_s_baseclass __pyx_mstate_global->__pyx_n_s_baseclass #define __pyx_n_s_borg_compress __pyx_mstate_global->__pyx_n_s_borg_compress #define __pyx_n_s_buf __pyx_mstate_global->__pyx_n_s_buf #define __pyx_n_s_buffer __pyx_mstate_global->__pyx_n_s_buffer #define __pyx_n_s_cheap_compressed_data __pyx_mstate_global->__pyx_n_s_cheap_compressed_data #define __pyx_n_s_check __pyx_mstate_global->__pyx_n_s_check #define __pyx_n_s_check_ok __pyx_mstate_global->__pyx_n_s_check_ok #define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_cls __pyx_mstate_global->__pyx_n_s_cls #define __pyx_n_s_cmf __pyx_mstate_global->__pyx_n_s_cmf #define __pyx_n_s_compr_size __pyx_mstate_global->__pyx_n_s_compr_size #define __pyx_n_s_compress __pyx_mstate_global->__pyx_n_s_compress #define __pyx_n_s_compressed_data __pyx_mstate_global->__pyx_n_s_compressed_data #define __pyx_kp_s_compresses_using_a_compressor_w __pyx_mstate_global->__pyx_kp_s_compresses_using_a_compressor_w #define __pyx_n_s_compression __pyx_mstate_global->__pyx_n_s_compression #define __pyx_n_s_compressor __pyx_mstate_global->__pyx_n_s_compressor #define __pyx_n_s_compressor_cls __pyx_mstate_global->__pyx_n_s_compressor_cls #define __pyx_n_s_constants __pyx_mstate_global->__pyx_n_s_constants #define __pyx_n_s_count __pyx_mstate_global->__pyx_n_s_count #define __pyx_n_s_data __pyx_mstate_global->__pyx_n_s_data #define __pyx_n_s_decide __pyx_mstate_global->__pyx_n_s_decide #define __pyx_n_s_decide_2 __pyx_mstate_global->__pyx_n_s_decide_2 #define __pyx_n_s_decide_compress __pyx_mstate_global->__pyx_n_s_decide_compress #define __pyx_n_s_decidebaseclass __pyx_mstate_global->__pyx_n_s_decidebaseclass #define __pyx_n_s_decompress __pyx_mstate_global->__pyx_n_s_decompress #define __pyx_n_s_dest __pyx_mstate_global->__pyx_n_s_dest #define __pyx_n_s_detect __pyx_mstate_global->__pyx_n_s_detect #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict #define __pyx_n_s_dict_2 __pyx_mstate_global->__pyx_n_s_dict_2 #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable #define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc #define __pyx_n_s_e __pyx_mstate_global->__pyx_n_s_e #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error #define __pyx_n_s_expensive_compressed_data __pyx_mstate_global->__pyx_n_s_expensive_compressed_data #define __pyx_n_s_f __pyx_mstate_global->__pyx_n_s_f #define __pyx_n_s_factor __pyx_mstate_global->__pyx_n_s_factor #define __pyx_n_s_flg __pyx_mstate_global->__pyx_n_s_flg #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc #define __pyx_n_s_get __pyx_mstate_global->__pyx_n_s_get #define __pyx_n_s_get_compressor __pyx_mstate_global->__pyx_n_s_get_compressor #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate #define __pyx_n_s_hdr __pyx_mstate_global->__pyx_n_s_hdr #define __pyx_n_s_header __pyx_mstate_global->__pyx_n_s_header #define __pyx_n_s_header_fmt __pyx_mstate_global->__pyx_n_s_header_fmt #define __pyx_n_s_header_len __pyx_mstate_global->__pyx_n_s_header_len #define __pyx_n_s_helpers __pyx_mstate_global->__pyx_n_s_helpers #define __pyx_n_s_idata __pyx_mstate_global->__pyx_n_s_idata #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init #define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_inner __pyx_mstate_global->__pyx_n_s_inner #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_n_s_is_deflate __pyx_mstate_global->__pyx_n_s_is_deflate #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled #define __pyx_n_s_isize __pyx_mstate_global->__pyx_n_s_isize #define __pyx_n_s_join __pyx_mstate_global->__pyx_n_s_join #define __pyx_n_s_kwargs __pyx_mstate_global->__pyx_n_s_kwargs #define __pyx_n_s_level __pyx_mstate_global->__pyx_n_s_level #define __pyx_kp_s_level_must_be_0_and_9 __pyx_mstate_global->__pyx_kp_s_level_must_be_0_and_9 #define __pyx_kp_s_level_must_be_1_and_22 __pyx_mstate_global->__pyx_kp_s_level_must_be_1_and_22 #define __pyx_kp_s_level_must_be_1_and_6_or_110_and __pyx_mstate_global->__pyx_kp_s_level_must_be_1_and_6_or_110_and #define __pyx_n_s_lz4 __pyx_mstate_global->__pyx_n_s_lz4 #define __pyx_kp_s_lz4_compress_failed __pyx_mstate_global->__pyx_kp_s_lz4_compress_failed #define __pyx_kp_s_lz4_decompress_failed __pyx_mstate_global->__pyx_kp_s_lz4_decompress_failed #define __pyx_n_s_lzma __pyx_mstate_global->__pyx_n_s_lzma #define __pyx_kp_s_lzma_compression_decompression __pyx_mstate_global->__pyx_kp_s_lzma_compression_decompression #define __pyx_n_s_lzma_data __pyx_mstate_global->__pyx_n_s_lzma_data #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_max_padding_size __pyx_mstate_global->__pyx_n_s_max_padding_size #define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass #define __pyx_n_s_min_r __pyx_mstate_global->__pyx_n_s_min_r #define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module #define __pyx_n_s_mro_entries __pyx_mstate_global->__pyx_n_s_mro_entries #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_name_2 __pyx_mstate_global->__pyx_n_s_name_2 #define __pyx_n_s_new __pyx_mstate_global->__pyx_n_s_new #define __pyx_n_s_none __pyx_mstate_global->__pyx_n_s_none #define __pyx_kp_s_none_no_compression_just_pass_t __pyx_mstate_global->__pyx_kp_s_none_no_compression_just_pass_t #define __pyx_kp_s_not_enough_arguments __pyx_mstate_global->__pyx_kp_s_not_enough_arguments #define __pyx_n_s_null __pyx_mstate_global->__pyx_n_s_null #define __pyx_n_s_obfuscate __pyx_mstate_global->__pyx_n_s_obfuscate #define __pyx_n_s_obfuscate_2 __pyx_mstate_global->__pyx_n_s_obfuscate_2 #define __pyx_n_s_obfuscated_data __pyx_mstate_global->__pyx_n_s_obfuscated_data #define __pyx_n_s_osize __pyx_mstate_global->__pyx_n_s_osize #define __pyx_n_s_pack __pyx_mstate_global->__pyx_n_s_pack #define __pyx_n_s_params __pyx_mstate_global->__pyx_n_s_params #define __pyx_n_s_pickle __pyx_mstate_global->__pyx_n_s_pickle #define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare #define __pyx_n_s_preset __pyx_mstate_global->__pyx_n_s_preset #define __pyx_n_s_property __pyx_mstate_global->__pyx_n_s_property #define __pyx_n_s_pyx_PickleError __pyx_mstate_global->__pyx_n_s_pyx_PickleError #define __pyx_n_s_pyx_checksum __pyx_mstate_global->__pyx_n_s_pyx_checksum #define __pyx_n_s_pyx_result __pyx_mstate_global->__pyx_n_s_pyx_result #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state #define __pyx_n_s_pyx_type __pyx_mstate_global->__pyx_n_s_pyx_type #define __pyx_n_s_pyx_unpickle_CompressorBase __pyx_mstate_global->__pyx_n_s_pyx_unpickle_CompressorBase #define __pyx_n_s_pyx_unpickle_DecidingCompresso __pyx_mstate_global->__pyx_n_s_pyx_unpickle_DecidingCompresso #define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname #define __pyx_n_s_r __pyx_mstate_global->__pyx_n_s_r #define __pyx_n_s_random __pyx_mstate_global->__pyx_n_s_random #define __pyx_n_s_random_padding_obfuscate __pyx_mstate_global->__pyx_n_s_random_padding_obfuscate #define __pyx_n_s_ratio __pyx_mstate_global->__pyx_n_s_ratio #define __pyx_kp_s_raw_LZ4_compression_decompressi __pyx_mstate_global->__pyx_kp_s_raw_LZ4_compression_decompressi #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex #define __pyx_n_s_relative_random_reciprocal_obfu __pyx_mstate_global->__pyx_n_s_relative_random_reciprocal_obfu #define __pyx_n_s_rsize __pyx_mstate_global->__pyx_n_s_rsize #define __pyx_n_s_s __pyx_mstate_global->__pyx_n_s_s #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython #define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size #define __pyx_n_s_source __pyx_mstate_global->__pyx_n_s_source #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_n_s_split __pyx_mstate_global->__pyx_n_s_split #define __pyx_kp_s_src_borg_compress_pyx __pyx_mstate_global->__pyx_kp_s_src_borg_compress_pyx #define __pyx_n_s_startswith __pyx_mstate_global->__pyx_n_s_startswith #define __pyx_n_s_state __pyx_mstate_global->__pyx_n_s_state #define __pyx_n_s_staticmethod __pyx_mstate_global->__pyx_n_s_staticmethod #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource #define __pyx_n_s_struct __pyx_mstate_global->__pyx_n_s_struct #define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_kp_s_too_many_arguments __pyx_mstate_global->__pyx_kp_s_too_many_arguments #define __pyx_n_s_trailer __pyx_mstate_global->__pyx_n_s_trailer #define __pyx_n_s_unpack __pyx_mstate_global->__pyx_n_s_unpack #define __pyx_kp_s_unsupported_compression_type __pyx_mstate_global->__pyx_kp_s_unsupported_compression_type #define __pyx_n_s_update __pyx_mstate_global->__pyx_n_s_update #define __pyx_n_s_use_setstate __pyx_mstate_global->__pyx_n_s_use_setstate #define __pyx_n_s_values __pyx_mstate_global->__pyx_n_s_values #define __pyx_n_s_zlib __pyx_mstate_global->__pyx_n_s_zlib #define __pyx_kp_s_zlib_compression_decompression __pyx_mstate_global->__pyx_kp_s_zlib_compression_decompression #define __pyx_n_s_zstd __pyx_mstate_global->__pyx_n_s_zstd #define __pyx_kp_s_zstd_compress_failed_s __pyx_mstate_global->__pyx_kp_s_zstd_compress_failed_s #define __pyx_kp_s_zstd_compression_decompression_p __pyx_mstate_global->__pyx_kp_s_zstd_compression_decompression_p #define __pyx_kp_s_zstd_decompress_failed_s __pyx_mstate_global->__pyx_kp_s_zstd_decompress_failed_s #define __pyx_kp_s_zstd_decompress_failed_size_mism __pyx_mstate_global->__pyx_kp_s_zstd_decompress_failed_size_mism #define __pyx_kp_s_zstd_get_size_failed_data_was_no __pyx_mstate_global->__pyx_kp_s_zstd_get_size_failed_data_was_no #define __pyx_kp_s_zstd_get_size_failed_original_si __pyx_mstate_global->__pyx_kp_s_zstd_get_size_failed_original_si #define __pyx_float_0_001 __pyx_mstate_global->__pyx_float_0_001 #define __pyx_float_0_0001 __pyx_mstate_global->__pyx_float_0_0001 #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 #define __pyx_int_2 __pyx_mstate_global->__pyx_int_2 #define __pyx_int_3 __pyx_mstate_global->__pyx_int_3 #define __pyx_int_6 __pyx_mstate_global->__pyx_int_6 #define __pyx_int_8 __pyx_mstate_global->__pyx_int_8 #define __pyx_int_9 __pyx_mstate_global->__pyx_int_9 #define __pyx_int_10 __pyx_mstate_global->__pyx_int_10 #define __pyx_int_15 __pyx_mstate_global->__pyx_int_15 #define __pyx_int_22 __pyx_mstate_global->__pyx_int_22 #define __pyx_int_31 __pyx_mstate_global->__pyx_int_31 #define __pyx_int_100 __pyx_mstate_global->__pyx_int_100 #define __pyx_int_110 __pyx_mstate_global->__pyx_int_110 #define __pyx_int_123 __pyx_mstate_global->__pyx_int_123 #define __pyx_int_256 __pyx_mstate_global->__pyx_int_256 #define __pyx_int_1024 __pyx_mstate_global->__pyx_int_1024 #define __pyx_int_222419149 __pyx_mstate_global->__pyx_int_222419149 #define __pyx_int_228825662 __pyx_mstate_global->__pyx_int_228825662 #define __pyx_int_238750788 __pyx_mstate_global->__pyx_int_238750788 #define __pyx_slice_ __pyx_mstate_global->__pyx_slice_ #define __pyx_slice__4 __pyx_mstate_global->__pyx_slice__4 #define __pyx_slice__7 __pyx_mstate_global->__pyx_slice__7 #define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 #define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 #define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 #define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12 #define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 #define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18 #define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20 #define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24 #define __pyx_tuple__33 __pyx_mstate_global->__pyx_tuple__33 #define __pyx_tuple__35 __pyx_mstate_global->__pyx_tuple__35 #define __pyx_tuple__37 __pyx_mstate_global->__pyx_tuple__37 #define __pyx_tuple__40 __pyx_mstate_global->__pyx_tuple__40 #define __pyx_tuple__42 __pyx_mstate_global->__pyx_tuple__42 #define __pyx_tuple__43 __pyx_mstate_global->__pyx_tuple__43 #define __pyx_tuple__45 __pyx_mstate_global->__pyx_tuple__45 #define __pyx_tuple__49 __pyx_mstate_global->__pyx_tuple__49 #define __pyx_tuple__50 __pyx_mstate_global->__pyx_tuple__50 #define __pyx_tuple__54 __pyx_mstate_global->__pyx_tuple__54 #define __pyx_tuple__59 __pyx_mstate_global->__pyx_tuple__59 #define __pyx_tuple__61 __pyx_mstate_global->__pyx_tuple__61 #define __pyx_tuple__64 __pyx_mstate_global->__pyx_tuple__64 #define __pyx_tuple__69 __pyx_mstate_global->__pyx_tuple__69 #define __pyx_tuple__71 __pyx_mstate_global->__pyx_tuple__71 #define __pyx_tuple__72 __pyx_mstate_global->__pyx_tuple__72 #define __pyx_tuple__74 __pyx_mstate_global->__pyx_tuple__74 #define __pyx_tuple__77 __pyx_mstate_global->__pyx_tuple__77 #define __pyx_tuple__79 __pyx_mstate_global->__pyx_tuple__79 #define __pyx_tuple__81 __pyx_mstate_global->__pyx_tuple__81 #define __pyx_tuple__83 __pyx_mstate_global->__pyx_tuple__83 #define __pyx_tuple__84 __pyx_mstate_global->__pyx_tuple__84 #define __pyx_tuple__85 __pyx_mstate_global->__pyx_tuple__85 #define __pyx_tuple__87 __pyx_mstate_global->__pyx_tuple__87 #define __pyx_tuple__89 __pyx_mstate_global->__pyx_tuple__89 #define __pyx_tuple__91 __pyx_mstate_global->__pyx_tuple__91 #define __pyx_tuple__93 __pyx_mstate_global->__pyx_tuple__93 #define __pyx_tuple__95 __pyx_mstate_global->__pyx_tuple__95 #define __pyx_tuple__97 __pyx_mstate_global->__pyx_tuple__97 #define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 #define __pyx_codeobj__16 __pyx_mstate_global->__pyx_codeobj__16 #define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 #define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19 #define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21 #define __pyx_codeobj__22 __pyx_mstate_global->__pyx_codeobj__22 #define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23 #define __pyx_codeobj__25 __pyx_mstate_global->__pyx_codeobj__25 #define __pyx_codeobj__26 __pyx_mstate_global->__pyx_codeobj__26 #define __pyx_codeobj__27 __pyx_mstate_global->__pyx_codeobj__27 #define __pyx_codeobj__28 __pyx_mstate_global->__pyx_codeobj__28 #define __pyx_codeobj__30 __pyx_mstate_global->__pyx_codeobj__30 #define __pyx_codeobj__31 __pyx_mstate_global->__pyx_codeobj__31 #define __pyx_codeobj__34 __pyx_mstate_global->__pyx_codeobj__34 #define __pyx_codeobj__36 __pyx_mstate_global->__pyx_codeobj__36 #define __pyx_codeobj__38 __pyx_mstate_global->__pyx_codeobj__38 #define __pyx_codeobj__41 __pyx_mstate_global->__pyx_codeobj__41 #define __pyx_codeobj__44 __pyx_mstate_global->__pyx_codeobj__44 #define __pyx_codeobj__46 __pyx_mstate_global->__pyx_codeobj__46 #define __pyx_codeobj__48 __pyx_mstate_global->__pyx_codeobj__48 #define __pyx_codeobj__51 __pyx_mstate_global->__pyx_codeobj__51 #define __pyx_codeobj__52 __pyx_mstate_global->__pyx_codeobj__52 #define __pyx_codeobj__55 __pyx_mstate_global->__pyx_codeobj__55 #define __pyx_codeobj__56 __pyx_mstate_global->__pyx_codeobj__56 #define __pyx_codeobj__57 __pyx_mstate_global->__pyx_codeobj__57 #define __pyx_codeobj__58 __pyx_mstate_global->__pyx_codeobj__58 #define __pyx_codeobj__60 __pyx_mstate_global->__pyx_codeobj__60 #define __pyx_codeobj__62 __pyx_mstate_global->__pyx_codeobj__62 #define __pyx_codeobj__63 __pyx_mstate_global->__pyx_codeobj__63 #define __pyx_codeobj__65 __pyx_mstate_global->__pyx_codeobj__65 #define __pyx_codeobj__66 __pyx_mstate_global->__pyx_codeobj__66 #define __pyx_codeobj__67 __pyx_mstate_global->__pyx_codeobj__67 #define __pyx_codeobj__70 __pyx_mstate_global->__pyx_codeobj__70 #define __pyx_codeobj__73 __pyx_mstate_global->__pyx_codeobj__73 #define __pyx_codeobj__75 __pyx_mstate_global->__pyx_codeobj__75 #define __pyx_codeobj__76 __pyx_mstate_global->__pyx_codeobj__76 #define __pyx_codeobj__78 __pyx_mstate_global->__pyx_codeobj__78 #define __pyx_codeobj__80 __pyx_mstate_global->__pyx_codeobj__80 #define __pyx_codeobj__82 __pyx_mstate_global->__pyx_codeobj__82 #define __pyx_codeobj__86 __pyx_mstate_global->__pyx_codeobj__86 #define __pyx_codeobj__88 __pyx_mstate_global->__pyx_codeobj__88 #define __pyx_codeobj__90 __pyx_mstate_global->__pyx_codeobj__90 #define __pyx_codeobj__92 __pyx_mstate_global->__pyx_codeobj__92 #define __pyx_codeobj__94 __pyx_mstate_global->__pyx_codeobj__94 #define __pyx_codeobj__96 __pyx_mstate_global->__pyx_codeobj__96 #define __pyx_codeobj__98 __pyx_mstate_global->__pyx_codeobj__98 #define __pyx_codeobj__99 __pyx_mstate_global->__pyx_codeobj__99 /* #### Code section: module_code ### */ /* "borg/compress.pyx":64 * name = 'baseclass' * * @classmethod # <<<<<<<<<<<<<< * def detect(cls, data): * return data.startswith(cls.ID) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_14CompressorBase_1detect(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8compress_14CompressorBase_1detect = {"detect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_14CompressorBase_1detect, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8compress_14CompressorBase_1detect(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_data = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("detect (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 64, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "detect") < 0)) __PYX_ERR(0, 64, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_data = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("detect", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 64, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.compress.CompressorBase.detect", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_14CompressorBase_detect(((PyTypeObject*)__pyx_v_cls), __pyx_v_data); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_14CompressorBase_detect(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_data) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("detect", 1); /* "borg/compress.pyx":66 * @classmethod * def detect(cls, data): * return data.startswith(cls.ID) # <<<<<<<<<<<<<< * * def __init__(self, **kwargs): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_startswith); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_ID); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/compress.pyx":64 * name = 'baseclass' * * @classmethod # <<<<<<<<<<<<<< * def detect(cls, data): * return data.startswith(cls.ID) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("borg.compress.CompressorBase.detect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/compress.pyx":68 * return data.startswith(cls.ID) * * def __init__(self, **kwargs): # <<<<<<<<<<<<<< * pass * */ /* Python wrapper */ static int __pyx_pw_4borg_8compress_14CompressorBase_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_4borg_8compress_14CompressorBase_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_r = __pyx_pf_4borg_8compress_14CompressorBase_2__init__(((struct __pyx_obj_4borg_8compress_CompressorBase *)__pyx_v_self), __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_4borg_8compress_14CompressorBase_2__init__(CYTHON_UNUSED struct __pyx_obj_4borg_8compress_CompressorBase *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_kwargs) { int __pyx_r; /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "borg/compress.pyx":71 * pass * * def decide(self, data): # <<<<<<<<<<<<<< * """ * Return which compressor will perform the actual compression for *data*. */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_14CompressorBase_5decide(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_8compress_14CompressorBase_4decide, "\n Return which compressor will perform the actual compression for *data*.\n\n This exists for a very specific case: If borg recreate is instructed to recompress\n using Auto compression it needs to determine the _actual_ target compression of a chunk\n in order to detect whether it should be recompressed.\n\n Any compressor may return a compressor other than *self*, like e.g. the CNONE compressor,\n and should actually do so if *data* would become larger on compression.\n "); static PyMethodDef __pyx_mdef_4borg_8compress_14CompressorBase_5decide = {"decide", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_14CompressorBase_5decide, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_8compress_14CompressorBase_4decide}; static PyObject *__pyx_pw_4borg_8compress_14CompressorBase_5decide(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_data = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("decide (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "decide") < 0)) __PYX_ERR(0, 71, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_data = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("decide", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 71, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.compress.CompressorBase.decide", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_14CompressorBase_4decide(((struct __pyx_obj_4borg_8compress_CompressorBase *)__pyx_v_self), __pyx_v_data); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_14CompressorBase_4decide(struct __pyx_obj_4borg_8compress_CompressorBase *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_data) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("decide", 1); /* "borg/compress.pyx":82 * and should actually do so if *data* would become larger on compression. * """ * return self # <<<<<<<<<<<<<< * * def compress(self, data): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "borg/compress.pyx":71 * pass * * def decide(self, data): # <<<<<<<<<<<<<< * """ * Return which compressor will perform the actual compression for *data*. */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/compress.pyx":84 * return self * * def compress(self, data): # <<<<<<<<<<<<<< * """ * Compress *data* (bytes) and return bytes result. Prepend the ID bytes of this compressor, */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_14CompressorBase_7compress(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_8compress_14CompressorBase_6compress, "\n Compress *data* (bytes) and return bytes result. Prepend the ID bytes of this compressor,\n which is needed so that the correct decompressor can be used for decompression.\n "); static PyMethodDef __pyx_mdef_4borg_8compress_14CompressorBase_7compress = {"compress", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_14CompressorBase_7compress, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_8compress_14CompressorBase_6compress}; static PyObject *__pyx_pw_4borg_8compress_14CompressorBase_7compress(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_data = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("compress (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 84, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "compress") < 0)) __PYX_ERR(0, 84, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_data = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("compress", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 84, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.compress.CompressorBase.compress", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_14CompressorBase_6compress(((struct __pyx_obj_4borg_8compress_CompressorBase *)__pyx_v_self), __pyx_v_data); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_14CompressorBase_6compress(struct __pyx_obj_4borg_8compress_CompressorBase *__pyx_v_self, PyObject *__pyx_v_data) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("compress", 1); /* "borg/compress.pyx":90 * """ * # add ID bytes * return self.ID + data # <<<<<<<<<<<<<< * * def decompress(self, data): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ID); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "borg/compress.pyx":84 * return self * * def compress(self, data): # <<<<<<<<<<<<<< * """ * Compress *data* (bytes) and return bytes result. Prepend the ID bytes of this compressor, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("borg.compress.CompressorBase.compress", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/compress.pyx":92 * return self.ID + data * * def decompress(self, data): # <<<<<<<<<<<<<< * """ * Decompress *data* (bytes) and return bytes result. The leading Compressor ID */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_14CompressorBase_9decompress(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_8compress_14CompressorBase_8decompress, "\n Decompress *data* (bytes) and return bytes result. The leading Compressor ID\n bytes need to be present.\n\n Only handles input generated by _this_ Compressor - for a general purpose\n decompression method see *Compressor.decompress*.\n "); static PyMethodDef __pyx_mdef_4borg_8compress_14CompressorBase_9decompress = {"decompress", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_14CompressorBase_9decompress, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_8compress_14CompressorBase_8decompress}; static PyObject *__pyx_pw_4borg_8compress_14CompressorBase_9decompress(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_data = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("decompress (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "decompress") < 0)) __PYX_ERR(0, 92, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_data = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("decompress", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 92, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.compress.CompressorBase.decompress", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_14CompressorBase_8decompress(((struct __pyx_obj_4borg_8compress_CompressorBase *)__pyx_v_self), __pyx_v_data); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_14CompressorBase_8decompress(CYTHON_UNUSED struct __pyx_obj_4borg_8compress_CompressorBase *__pyx_v_self, PyObject *__pyx_v_data) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("decompress", 1); /* "borg/compress.pyx":101 * """ * # strip ID bytes * return data[2:] # <<<<<<<<<<<<<< * * cdef class DecidingCompressor(CompressorBase): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_data, 2, 0, NULL, NULL, &__pyx_slice_, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/compress.pyx":92 * return self.ID + data * * def decompress(self, data): # <<<<<<<<<<<<<< * """ * Decompress *data* (bytes) and return bytes result. The leading Compressor ID */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("borg.compress.CompressorBase.decompress", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_14CompressorBase_11__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8compress_14CompressorBase_11__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_14CompressorBase_11__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8compress_14CompressorBase_11__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_4borg_8compress_14CompressorBase_10__reduce_cython__(((struct __pyx_obj_4borg_8compress_CompressorBase *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_14CompressorBase_10__reduce_cython__(struct __pyx_obj_4borg_8compress_CompressorBase *__pyx_v_self) { PyObject *__pyx_v_state = 0; PyObject *__pyx_v__dict = 0; int __pyx_v_use_setstate; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":5 * cdef object _dict * cdef bint use_setstate * state = () # <<<<<<<<<<<<<< * _dict = getattr(self, '__dict__', None) * if _dict is not None: */ __Pyx_INCREF(__pyx_empty_tuple); __pyx_v_state = __pyx_empty_tuple; /* "(tree fragment)":6 * cdef bint use_setstate * state = () * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< * if _dict is not None: * state += (_dict,) */ __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v__dict = __pyx_t_1; __pyx_t_1 = 0; /* "(tree fragment)":7 * state = () * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ __pyx_t_2 = (__pyx_v__dict != Py_None); if (__pyx_t_2) { /* "(tree fragment)":8 * _dict = getattr(self, '__dict__', None) * if _dict is not None: * state += (_dict,) # <<<<<<<<<<<<<< * use_setstate = True * else: */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v__dict); __Pyx_GIVEREF(__pyx_v__dict); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict)) __PYX_ERR(1, 8, __pyx_L1_error); __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; /* "(tree fragment)":9 * if _dict is not None: * state += (_dict,) * use_setstate = True # <<<<<<<<<<<<<< * else: * use_setstate = False */ __pyx_v_use_setstate = 1; /* "(tree fragment)":7 * state = () * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ goto __pyx_L3; } /* "(tree fragment)":11 * use_setstate = True * else: * use_setstate = False # <<<<<<<<<<<<<< * if use_setstate: * return __pyx_unpickle_CompressorBase, (type(self), 0xe3b0c44, None), state */ /*else*/ { __pyx_v_use_setstate = 0; } __pyx_L3:; /* "(tree fragment)":12 * else: * use_setstate = False * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_CompressorBase, (type(self), 0xe3b0c44, None), state * else: */ if (__pyx_v_use_setstate) { /* "(tree fragment)":13 * use_setstate = False * if use_setstate: * return __pyx_unpickle_CompressorBase, (type(self), 0xe3b0c44, None), state # <<<<<<<<<<<<<< * else: * return __pyx_unpickle_CompressorBase, (type(self), 0xe3b0c44, state) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_CompressorBase); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(1, 13, __pyx_L1_error); __Pyx_INCREF(__pyx_int_238750788); __Pyx_GIVEREF(__pyx_int_238750788); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_238750788)) __PYX_ERR(1, 13, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None)) __PYX_ERR(1, 13, __pyx_L1_error); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state)) __PYX_ERR(1, 13, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "(tree fragment)":12 * else: * use_setstate = False * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_CompressorBase, (type(self), 0xe3b0c44, None), state * else: */ } /* "(tree fragment)":15 * return __pyx_unpickle_CompressorBase, (type(self), 0xe3b0c44, None), state * else: * return __pyx_unpickle_CompressorBase, (type(self), 0xe3b0c44, state) # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_CompressorBase__set_state(self, __pyx_state) */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_CompressorBase); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(1, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_int_238750788); __Pyx_GIVEREF(__pyx_int_238750788); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_238750788)) __PYX_ERR(1, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state)) __PYX_ERR(1, 15, __pyx_L1_error); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("borg.compress.CompressorBase.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_state); __Pyx_XDECREF(__pyx_v__dict); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":16 * else: * return __pyx_unpickle_CompressorBase, (type(self), 0xe3b0c44, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_CompressorBase__set_state(self, __pyx_state) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_14CompressorBase_13__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8compress_14CompressorBase_13__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_14CompressorBase_13__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8compress_14CompressorBase_13__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 16, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 16, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 16, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.compress.CompressorBase.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_14CompressorBase_12__setstate_cython__(((struct __pyx_obj_4borg_8compress_CompressorBase *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_14CompressorBase_12__setstate_cython__(struct __pyx_obj_4borg_8compress_CompressorBase *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":17 * return __pyx_unpickle_CompressorBase, (type(self), 0xe3b0c44, state) * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_CompressorBase__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 17, __pyx_L1_error) __pyx_t_1 = __pyx_f_4borg_8compress___pyx_unpickle_CompressorBase__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":16 * else: * return __pyx_unpickle_CompressorBase, (type(self), 0xe3b0c44, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_CompressorBase__set_state(self, __pyx_state) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("borg.compress.CompressorBase.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/compress.pyx":110 * name = 'decidebaseclass' * * def __init__(self, **kwargs): # <<<<<<<<<<<<<< * super().__init__(**kwargs) * */ /* Python wrapper */ static int __pyx_pw_4borg_8compress_18DecidingCompressor_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_4borg_8compress_18DecidingCompressor_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_kwargs = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, __pyx_nargs); return -1;} if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; if (__pyx_kwds) { __pyx_v_kwargs = __Pyx_KwargsAsDict_VARARGS(__pyx_kwds, __pyx_kwvalues); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); } else { __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); } __pyx_r = __pyx_pf_4borg_8compress_18DecidingCompressor___init__(((struct __pyx_obj_4borg_8compress_DecidingCompressor *)__pyx_v_self), __pyx_v_kwargs); /* function exit code */ __Pyx_DECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_4borg_8compress_18DecidingCompressor___init__(struct __pyx_obj_4borg_8compress_DecidingCompressor *__pyx_v_self, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "borg/compress.pyx":111 * * def __init__(self, **kwargs): * super().__init__(**kwargs) # <<<<<<<<<<<<<< * * def _decide(self, data): */ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)__pyx_ptype_4borg_8compress_DecidingCompressor); __Pyx_GIVEREF((PyObject *)__pyx_ptype_4borg_8compress_DecidingCompressor); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_4borg_8compress_DecidingCompressor))) __PYX_ERR(0, 111, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_v_self); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self))) __PYX_ERR(0, 111, __pyx_L1_error); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/compress.pyx":110 * name = 'decidebaseclass' * * def __init__(self, **kwargs): # <<<<<<<<<<<<<< * super().__init__(**kwargs) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("borg.compress.DecidingCompressor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/compress.pyx":113 * super().__init__(**kwargs) * * def _decide(self, data): # <<<<<<<<<<<<<< * """ * Decides what to do with *data*. Returns (compressor, compressed_data). */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_18DecidingCompressor_3_decide(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_8compress_18DecidingCompressor_2_decide, "\n Decides what to do with *data*. Returns (compressor, compressed_data).\n\n *compressed_data* can be the result of *data* being processed by *compressor*,\n if that is generated as a side-effect of the decision process, or None otherwise.\n\n This private method allows for more efficient implementation of compress()\n and decide_compress() making use of *compressed_data*, if already generated.\n "); static PyMethodDef __pyx_mdef_4borg_8compress_18DecidingCompressor_3_decide = {"_decide", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_18DecidingCompressor_3_decide, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_8compress_18DecidingCompressor_2_decide}; static PyObject *__pyx_pw_4borg_8compress_18DecidingCompressor_3_decide(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_data = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_decide (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 113, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_decide") < 0)) __PYX_ERR(0, 113, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_data = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_decide", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 113, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.compress.DecidingCompressor._decide", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_18DecidingCompressor_2_decide(((struct __pyx_obj_4borg_8compress_DecidingCompressor *)__pyx_v_self), __pyx_v_data); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_18DecidingCompressor_2_decide(CYTHON_UNUSED struct __pyx_obj_4borg_8compress_DecidingCompressor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_data) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_decide", 1); /* "borg/compress.pyx":123 * and decide_compress() making use of *compressed_data*, if already generated. * """ * raise NotImplementedError # <<<<<<<<<<<<<< * * def decide(self, data): */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(0, 123, __pyx_L1_error) /* "borg/compress.pyx":113 * super().__init__(**kwargs) * * def _decide(self, data): # <<<<<<<<<<<<<< * """ * Decides what to do with *data*. Returns (compressor, compressed_data). */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.compress.DecidingCompressor._decide", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/compress.pyx":125 * raise NotImplementedError * * def decide(self, data): # <<<<<<<<<<<<<< * return self._decide(data)[0] * */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_18DecidingCompressor_5decide(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8compress_18DecidingCompressor_5decide = {"decide", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_18DecidingCompressor_5decide, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8compress_18DecidingCompressor_5decide(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_data = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("decide (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 125, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "decide") < 0)) __PYX_ERR(0, 125, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_data = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("decide", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 125, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.compress.DecidingCompressor.decide", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_18DecidingCompressor_4decide(((struct __pyx_obj_4borg_8compress_DecidingCompressor *)__pyx_v_self), __pyx_v_data); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_18DecidingCompressor_4decide(struct __pyx_obj_4borg_8compress_DecidingCompressor *__pyx_v_self, PyObject *__pyx_v_data) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("decide", 1); /* "borg/compress.pyx":126 * * def decide(self, data): * return self._decide(data)[0] # <<<<<<<<<<<<<< * * def decide_compress(self, data): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_decide); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_data}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "borg/compress.pyx":125 * raise NotImplementedError * * def decide(self, data): # <<<<<<<<<<<<<< * return self._decide(data)[0] * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("borg.compress.DecidingCompressor.decide", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/compress.pyx":128 * return self._decide(data)[0] * * def decide_compress(self, data): # <<<<<<<<<<<<<< * """ * Decides what to do with *data* and handle accordingly. Returns (compressor, compressed_data). */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_18DecidingCompressor_7decide_compress(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_8compress_18DecidingCompressor_6decide_compress, "\n Decides what to do with *data* and handle accordingly. Returns (compressor, compressed_data).\n\n *compressed_data* is the result of *data* being processed by *compressor*.\n "); static PyMethodDef __pyx_mdef_4borg_8compress_18DecidingCompressor_7decide_compress = {"decide_compress", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_18DecidingCompressor_7decide_compress, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_8compress_18DecidingCompressor_6decide_compress}; static PyObject *__pyx_pw_4borg_8compress_18DecidingCompressor_7decide_compress(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_data = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("decide_compress (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "decide_compress") < 0)) __PYX_ERR(0, 128, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_data = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("decide_compress", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 128, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.compress.DecidingCompressor.decide_compress", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_18DecidingCompressor_6decide_compress(((struct __pyx_obj_4borg_8compress_DecidingCompressor *)__pyx_v_self), __pyx_v_data); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_18DecidingCompressor_6decide_compress(struct __pyx_obj_4borg_8compress_DecidingCompressor *__pyx_v_self, PyObject *__pyx_v_data) { PyObject *__pyx_v_compressor = NULL; PyObject *__pyx_v_compressed_data = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("decide_compress", 1); /* "borg/compress.pyx":134 * *compressed_data* is the result of *data* being processed by *compressor*. * """ * compressor, compressed_data = self._decide(data) # <<<<<<<<<<<<<< * * if compressed_data is None: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_decide); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_data}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 134, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 134, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 134, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_compressor = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_compressed_data = __pyx_t_3; __pyx_t_3 = 0; /* "borg/compress.pyx":136 * compressor, compressed_data = self._decide(data) * * if compressed_data is None: # <<<<<<<<<<<<<< * compressed_data = compressor.compress(data) * */ __pyx_t_7 = (__pyx_v_compressed_data == Py_None); if (__pyx_t_7) { /* "borg/compress.pyx":137 * * if compressed_data is None: * compressed_data = compressor.compress(data) # <<<<<<<<<<<<<< * * if compressor is self: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_compressor, __pyx_n_s_compress); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_data}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF_SET(__pyx_v_compressed_data, __pyx_t_1); __pyx_t_1 = 0; /* "borg/compress.pyx":136 * compressor, compressed_data = self._decide(data) * * if compressed_data is None: # <<<<<<<<<<<<<< * compressed_data = compressor.compress(data) * */ } /* "borg/compress.pyx":139 * compressed_data = compressor.compress(data) * * if compressor is self: # <<<<<<<<<<<<<< * # call super class to add ID bytes * return self, super().compress(compressed_data) */ __pyx_t_7 = (__pyx_v_compressor == ((PyObject *)__pyx_v_self)); if (__pyx_t_7) { /* "borg/compress.pyx":141 * if compressor is self: * # call super class to add ID bytes * return self, super().compress(compressed_data) # <<<<<<<<<<<<<< * * return compressor, compressed_data */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF((PyObject *)__pyx_ptype_4borg_8compress_DecidingCompressor); __Pyx_GIVEREF((PyObject *)__pyx_ptype_4borg_8compress_DecidingCompressor); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_ptype_4borg_8compress_DecidingCompressor))) __PYX_ERR(0, 141, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_v_self); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_self))) __PYX_ERR(0, 141, __pyx_L1_error); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_compress); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_compressed_data}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF((PyObject *)__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_v_self); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self))) __PYX_ERR(0, 141, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "borg/compress.pyx":139 * compressed_data = compressor.compress(data) * * if compressor is self: # <<<<<<<<<<<<<< * # call super class to add ID bytes * return self, super().compress(compressed_data) */ } /* "borg/compress.pyx":143 * return self, super().compress(compressed_data) * * return compressor, compressed_data # <<<<<<<<<<<<<< * * def compress(self, data): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_compressor); __Pyx_GIVEREF(__pyx_v_compressor); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_compressor)) __PYX_ERR(0, 143, __pyx_L1_error); __Pyx_INCREF(__pyx_v_compressed_data); __Pyx_GIVEREF(__pyx_v_compressed_data); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_compressed_data)) __PYX_ERR(0, 143, __pyx_L1_error); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "borg/compress.pyx":128 * return self._decide(data)[0] * * def decide_compress(self, data): # <<<<<<<<<<<<<< * """ * Decides what to do with *data* and handle accordingly. Returns (compressor, compressed_data). */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("borg.compress.DecidingCompressor.decide_compress", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_compressor); __Pyx_XDECREF(__pyx_v_compressed_data); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/compress.pyx":145 * return compressor, compressed_data * * def compress(self, data): # <<<<<<<<<<<<<< * return self.decide_compress(data)[1] * */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_18DecidingCompressor_9compress(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8compress_18DecidingCompressor_9compress = {"compress", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_18DecidingCompressor_9compress, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8compress_18DecidingCompressor_9compress(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_data = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("compress (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 145, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "compress") < 0)) __PYX_ERR(0, 145, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_data = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("compress", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 145, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.compress.DecidingCompressor.compress", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_18DecidingCompressor_8compress(((struct __pyx_obj_4borg_8compress_DecidingCompressor *)__pyx_v_self), __pyx_v_data); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_18DecidingCompressor_8compress(struct __pyx_obj_4borg_8compress_DecidingCompressor *__pyx_v_self, PyObject *__pyx_v_data) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("compress", 1); /* "borg/compress.pyx":146 * * def compress(self, data): * return self.decide_compress(data)[1] # <<<<<<<<<<<<<< * * class CNONE(CompressorBase): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_decide_compress); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_data}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "borg/compress.pyx":145 * return compressor, compressed_data * * def compress(self, data): # <<<<<<<<<<<<<< * return self.decide_compress(data)[1] * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("borg.compress.DecidingCompressor.compress", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_18DecidingCompressor_11__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8compress_18DecidingCompressor_11__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_18DecidingCompressor_11__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8compress_18DecidingCompressor_11__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_4borg_8compress_18DecidingCompressor_10__reduce_cython__(((struct __pyx_obj_4borg_8compress_DecidingCompressor *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_18DecidingCompressor_10__reduce_cython__(struct __pyx_obj_4borg_8compress_DecidingCompressor *__pyx_v_self) { PyObject *__pyx_v_state = 0; PyObject *__pyx_v__dict = 0; int __pyx_v_use_setstate; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":5 * cdef object _dict * cdef bint use_setstate * state = () # <<<<<<<<<<<<<< * _dict = getattr(self, '__dict__', None) * if _dict is not None: */ __Pyx_INCREF(__pyx_empty_tuple); __pyx_v_state = __pyx_empty_tuple; /* "(tree fragment)":6 * cdef bint use_setstate * state = () * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< * if _dict is not None: * state += (_dict,) */ __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v__dict = __pyx_t_1; __pyx_t_1 = 0; /* "(tree fragment)":7 * state = () * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ __pyx_t_2 = (__pyx_v__dict != Py_None); if (__pyx_t_2) { /* "(tree fragment)":8 * _dict = getattr(self, '__dict__', None) * if _dict is not None: * state += (_dict,) # <<<<<<<<<<<<<< * use_setstate = True * else: */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v__dict); __Pyx_GIVEREF(__pyx_v__dict); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict)) __PYX_ERR(1, 8, __pyx_L1_error); __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; /* "(tree fragment)":9 * if _dict is not None: * state += (_dict,) * use_setstate = True # <<<<<<<<<<<<<< * else: * use_setstate = False */ __pyx_v_use_setstate = 1; /* "(tree fragment)":7 * state = () * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ goto __pyx_L3; } /* "(tree fragment)":11 * use_setstate = True * else: * use_setstate = False # <<<<<<<<<<<<<< * if use_setstate: * return __pyx_unpickle_DecidingCompressor, (type(self), 0xe3b0c44, None), state */ /*else*/ { __pyx_v_use_setstate = 0; } __pyx_L3:; /* "(tree fragment)":12 * else: * use_setstate = False * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_DecidingCompressor, (type(self), 0xe3b0c44, None), state * else: */ if (__pyx_v_use_setstate) { /* "(tree fragment)":13 * use_setstate = False * if use_setstate: * return __pyx_unpickle_DecidingCompressor, (type(self), 0xe3b0c44, None), state # <<<<<<<<<<<<<< * else: * return __pyx_unpickle_DecidingCompressor, (type(self), 0xe3b0c44, state) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_DecidingCompresso); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(1, 13, __pyx_L1_error); __Pyx_INCREF(__pyx_int_238750788); __Pyx_GIVEREF(__pyx_int_238750788); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_238750788)) __PYX_ERR(1, 13, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None)) __PYX_ERR(1, 13, __pyx_L1_error); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state)) __PYX_ERR(1, 13, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "(tree fragment)":12 * else: * use_setstate = False * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_DecidingCompressor, (type(self), 0xe3b0c44, None), state * else: */ } /* "(tree fragment)":15 * return __pyx_unpickle_DecidingCompressor, (type(self), 0xe3b0c44, None), state * else: * return __pyx_unpickle_DecidingCompressor, (type(self), 0xe3b0c44, state) # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_DecidingCompressor__set_state(self, __pyx_state) */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_DecidingCompresso); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(1, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_int_238750788); __Pyx_GIVEREF(__pyx_int_238750788); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_238750788)) __PYX_ERR(1, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state)) __PYX_ERR(1, 15, __pyx_L1_error); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("borg.compress.DecidingCompressor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_state); __Pyx_XDECREF(__pyx_v__dict); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":16 * else: * return __pyx_unpickle_DecidingCompressor, (type(self), 0xe3b0c44, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_DecidingCompressor__set_state(self, __pyx_state) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_18DecidingCompressor_13__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8compress_18DecidingCompressor_13__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_18DecidingCompressor_13__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8compress_18DecidingCompressor_13__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 16, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 16, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 16, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.compress.DecidingCompressor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_18DecidingCompressor_12__setstate_cython__(((struct __pyx_obj_4borg_8compress_DecidingCompressor *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_18DecidingCompressor_12__setstate_cython__(struct __pyx_obj_4borg_8compress_DecidingCompressor *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":17 * return __pyx_unpickle_DecidingCompressor, (type(self), 0xe3b0c44, state) * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_DecidingCompressor__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 17, __pyx_L1_error) __pyx_t_1 = __pyx_f_4borg_8compress___pyx_unpickle_DecidingCompressor__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":16 * else: * return __pyx_unpickle_DecidingCompressor, (type(self), 0xe3b0c44, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_DecidingCompressor__set_state(self, __pyx_state) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("borg.compress.DecidingCompressor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/compress.pyx":155 * name = 'none' * * def compress(self, data): # <<<<<<<<<<<<<< * return super().compress(data) * */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_5CNONE_1compress(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8compress_5CNONE_1compress = {"compress", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_5CNONE_1compress, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8compress_5CNONE_1compress(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_data = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("compress (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_data,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 155, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 155, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("compress", 1, 2, 2, 1); __PYX_ERR(0, 155, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "compress") < 0)) __PYX_ERR(0, 155, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_data = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("compress", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 155, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.compress.CNONE.compress", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_5CNONE_compress(__pyx_self, __pyx_v_self, __pyx_v_data); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_5CNONE_compress(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("compress", 1); /* "borg/compress.pyx":156 * * def compress(self, data): * return super().compress(data) # <<<<<<<<<<<<<< * * def decompress(self, data): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_CyFunction_GetClassObj(__pyx_self); if (!__pyx_t_2) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 156, __pyx_L1_error) } __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self)) __PYX_ERR(0, 156, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_compress); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_data}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/compress.pyx":155 * name = 'none' * * def compress(self, data): # <<<<<<<<<<<<<< * return super().compress(data) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("borg.compress.CNONE.compress", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/compress.pyx":158 * return super().compress(data) * * def decompress(self, data): # <<<<<<<<<<<<<< * data = super().decompress(data) * if not isinstance(data, bytes): */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_5CNONE_3decompress(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8compress_5CNONE_3decompress = {"decompress", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_5CNONE_3decompress, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8compress_5CNONE_3decompress(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_data = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("decompress (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_data,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 158, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 158, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("decompress", 1, 2, 2, 1); __PYX_ERR(0, 158, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "decompress") < 0)) __PYX_ERR(0, 158, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_data = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("decompress", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 158, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.compress.CNONE.decompress", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_5CNONE_2decompress(__pyx_self, __pyx_v_self, __pyx_v_data); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_5CNONE_2decompress(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("decompress", 0); __Pyx_INCREF(__pyx_v_data); /* "borg/compress.pyx":159 * * def decompress(self, data): * data = super().decompress(data) # <<<<<<<<<<<<<< * if not isinstance(data, bytes): * data = bytes(data) */ __pyx_t_2 = __Pyx_CyFunction_GetClassObj(__pyx_self); if (!__pyx_t_2) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 159, __pyx_L1_error) } __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self)) __PYX_ERR(0, 159, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_decompress); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_data}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_1); __pyx_t_1 = 0; /* "borg/compress.pyx":160 * def decompress(self, data): * data = super().decompress(data) * if not isinstance(data, bytes): # <<<<<<<<<<<<<< * data = bytes(data) * return data */ __pyx_t_5 = PyBytes_Check(__pyx_v_data); __pyx_t_6 = (!__pyx_t_5); if (__pyx_t_6) { /* "borg/compress.pyx":161 * data = super().decompress(data) * if not isinstance(data, bytes): * data = bytes(data) # <<<<<<<<<<<<<< * return data * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), __pyx_v_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_1); __pyx_t_1 = 0; /* "borg/compress.pyx":160 * def decompress(self, data): * data = super().decompress(data) * if not isinstance(data, bytes): # <<<<<<<<<<<<<< * data = bytes(data) * return data */ } /* "borg/compress.pyx":162 * if not isinstance(data, bytes): * data = bytes(data) * return data # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_data); __pyx_r = __pyx_v_data; goto __pyx_L0; /* "borg/compress.pyx":158 * return super().compress(data) * * def decompress(self, data): # <<<<<<<<<<<<<< * data = super().decompress(data) * if not isinstance(data, bytes): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("borg.compress.CNONE.decompress", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_data); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/compress.pyx":177 * name = 'lz4' * * def __init__(self, **kwargs): # <<<<<<<<<<<<<< * pass * */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_3LZ4_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8compress_3LZ4_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_3LZ4_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8compress_3LZ4_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 177, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kwargs, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 177, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 177, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("borg.compress.LZ4.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_3LZ4___init__(__pyx_self, __pyx_v_self, __pyx_v_kwargs); /* function exit code */ __Pyx_DECREF(__pyx_v_kwargs); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_3LZ4___init__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_kwargs) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 1); /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/compress.pyx":180 * pass * * def _decide(self, idata): # <<<<<<<<<<<<<< * """ * Decides what to do with *data*. Returns (compressor, lz4_data). */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_3LZ4_3_decide(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_8compress_3LZ4_2_decide, "\n Decides what to do with *data*. Returns (compressor, lz4_data).\n\n *lz4_data* is the LZ4 result if *compressor* is LZ4 as well, otherwise it is None.\n "); static PyMethodDef __pyx_mdef_4borg_8compress_3LZ4_3_decide = {"_decide", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_3LZ4_3_decide, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_8compress_3LZ4_2_decide}; static PyObject *__pyx_pw_4borg_8compress_3LZ4_3_decide(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_idata = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_decide (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_idata,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 180, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_idata)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 180, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("_decide", 1, 2, 2, 1); __PYX_ERR(0, 180, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_decide") < 0)) __PYX_ERR(0, 180, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_idata = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_decide", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 180, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.compress.LZ4._decide", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_3LZ4_2_decide(__pyx_self, __pyx_v_self, __pyx_v_idata); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_3LZ4_2_decide(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_idata) { int __pyx_v_isize; int __pyx_v_osize; char *__pyx_v_source; char *__pyx_v_dest; PyObject *__pyx_v_buf = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; char *__pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_decide", 0); __Pyx_INCREF(__pyx_v_idata); /* "borg/compress.pyx":186 * *lz4_data* is the LZ4 result if *compressor* is LZ4 as well, otherwise it is None. * """ * if not isinstance(idata, bytes): # <<<<<<<<<<<<<< * idata = bytes(idata) # code below does not work with memoryview * cdef int isize = len(idata) */ __pyx_t_1 = PyBytes_Check(__pyx_v_idata); __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "borg/compress.pyx":187 * """ * if not isinstance(idata, bytes): * idata = bytes(idata) # code below does not work with memoryview # <<<<<<<<<<<<<< * cdef int isize = len(idata) * cdef int osize */ __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), __pyx_v_idata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_idata, __pyx_t_3); __pyx_t_3 = 0; /* "borg/compress.pyx":186 * *lz4_data* is the LZ4 result if *compressor* is LZ4 as well, otherwise it is None. * """ * if not isinstance(idata, bytes): # <<<<<<<<<<<<<< * idata = bytes(idata) # code below does not work with memoryview * cdef int isize = len(idata) */ } /* "borg/compress.pyx":188 * if not isinstance(idata, bytes): * idata = bytes(idata) # code below does not work with memoryview * cdef int isize = len(idata) # <<<<<<<<<<<<<< * cdef int osize * cdef char *source = idata */ __pyx_t_4 = PyObject_Length(__pyx_v_idata); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 188, __pyx_L1_error) __pyx_v_isize = __pyx_t_4; /* "borg/compress.pyx":190 * cdef int isize = len(idata) * cdef int osize * cdef char *source = idata # <<<<<<<<<<<<<< * cdef char *dest * osize = LZ4_compressBound(isize) */ __pyx_t_5 = __Pyx_PyObject_AsWritableString(__pyx_v_idata); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 190, __pyx_L1_error) __pyx_v_source = __pyx_t_5; /* "borg/compress.pyx":192 * cdef char *source = idata * cdef char *dest * osize = LZ4_compressBound(isize) # <<<<<<<<<<<<<< * buf = buffer.get(osize) * dest = buf */ __pyx_v_osize = LZ4_compressBound(__pyx_v_isize); /* "borg/compress.pyx":193 * cdef char *dest * osize = LZ4_compressBound(isize) * buf = buffer.get(osize) # <<<<<<<<<<<<<< * dest = buf * with nogil: */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_buffer); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_get); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_osize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_6}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_v_buf = __pyx_t_3; __pyx_t_3 = 0; /* "borg/compress.pyx":194 * osize = LZ4_compressBound(isize) * buf = buffer.get(osize) * dest = buf # <<<<<<<<<<<<<< * with nogil: * osize = LZ4_compress_default(source, dest, isize, osize) */ __pyx_t_5 = __Pyx_PyObject_AsWritableString(__pyx_v_buf); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 194, __pyx_L1_error) __pyx_v_dest = ((char *)__pyx_t_5); /* "borg/compress.pyx":195 * buf = buffer.get(osize) * dest = buf * with nogil: # <<<<<<<<<<<<<< * osize = LZ4_compress_default(source, dest, isize, osize) * if not osize: */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "borg/compress.pyx":196 * dest = buf * with nogil: * osize = LZ4_compress_default(source, dest, isize, osize) # <<<<<<<<<<<<<< * if not osize: * raise Exception('lz4 compress failed') */ __pyx_v_osize = LZ4_compress_default(__pyx_v_source, __pyx_v_dest, __pyx_v_isize, __pyx_v_osize); } /* "borg/compress.pyx":195 * buf = buffer.get(osize) * dest = buf * with nogil: # <<<<<<<<<<<<<< * osize = LZ4_compress_default(source, dest, isize, osize) * if not osize: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L6; } __pyx_L6:; } } /* "borg/compress.pyx":197 * with nogil: * osize = LZ4_compress_default(source, dest, isize, osize) * if not osize: # <<<<<<<<<<<<<< * raise Exception('lz4 compress failed') * # only compress if the result actually is smaller */ __pyx_t_2 = (!(__pyx_v_osize != 0)); if (unlikely(__pyx_t_2)) { /* "borg/compress.pyx":198 * osize = LZ4_compress_default(source, dest, isize, osize) * if not osize: * raise Exception('lz4 compress failed') # <<<<<<<<<<<<<< * # only compress if the result actually is smaller * if osize < isize: */ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 198, __pyx_L1_error) /* "borg/compress.pyx":197 * with nogil: * osize = LZ4_compress_default(source, dest, isize, osize) * if not osize: # <<<<<<<<<<<<<< * raise Exception('lz4 compress failed') * # only compress if the result actually is smaller */ } /* "borg/compress.pyx":200 * raise Exception('lz4 compress failed') * # only compress if the result actually is smaller * if osize < isize: # <<<<<<<<<<<<<< * return self, dest[:osize] * else: */ __pyx_t_2 = (__pyx_v_osize < __pyx_v_isize); if (__pyx_t_2) { /* "borg/compress.pyx":201 * # only compress if the result actually is smaller * if osize < isize: * return self, dest[:osize] # <<<<<<<<<<<<<< * else: * return NONE_COMPRESSOR, None */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_dest + 0, __pyx_v_osize - 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_self)) __PYX_ERR(0, 201, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error); __pyx_t_3 = 0; __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; /* "borg/compress.pyx":200 * raise Exception('lz4 compress failed') * # only compress if the result actually is smaller * if osize < isize: # <<<<<<<<<<<<<< * return self, dest[:osize] * else: */ } /* "borg/compress.pyx":203 * return self, dest[:osize] * else: * return NONE_COMPRESSOR, None # <<<<<<<<<<<<<< * * def decompress(self, idata): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_NONE_COMPRESSOR); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7)) __PYX_ERR(0, 203, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, Py_None)) __PYX_ERR(0, 203, __pyx_L1_error); __pyx_t_7 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "borg/compress.pyx":180 * pass * * def _decide(self, idata): # <<<<<<<<<<<<<< * """ * Decides what to do with *data*. Returns (compressor, lz4_data). */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("borg.compress.LZ4._decide", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_buf); __Pyx_XDECREF(__pyx_v_idata); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/compress.pyx":205 * return NONE_COMPRESSOR, None * * def decompress(self, idata): # <<<<<<<<<<<<<< * if not isinstance(idata, bytes): * idata = bytes(idata) # code below does not work with memoryview */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_3LZ4_5decompress(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8compress_3LZ4_5decompress = {"decompress", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_3LZ4_5decompress, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8compress_3LZ4_5decompress(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_idata = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("decompress (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_idata,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 205, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_idata)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 205, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("decompress", 1, 2, 2, 1); __PYX_ERR(0, 205, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "decompress") < 0)) __PYX_ERR(0, 205, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_idata = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("decompress", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 205, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.compress.LZ4.decompress", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_3LZ4_4decompress(__pyx_self, __pyx_v_self, __pyx_v_idata); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_3LZ4_4decompress(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_idata) { int __pyx_v_isize; int __pyx_v_osize; int __pyx_v_rsize; char *__pyx_v_source; char *__pyx_v_dest; PyObject *__pyx_v_buf = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; Py_ssize_t __pyx_t_7; char *__pyx_t_8; long __pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("decompress", 0); __Pyx_INCREF(__pyx_v_idata); /* "borg/compress.pyx":206 * * def decompress(self, idata): * if not isinstance(idata, bytes): # <<<<<<<<<<<<<< * idata = bytes(idata) # code below does not work with memoryview * idata = super().decompress(idata) */ __pyx_t_1 = PyBytes_Check(__pyx_v_idata); __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "borg/compress.pyx":207 * def decompress(self, idata): * if not isinstance(idata, bytes): * idata = bytes(idata) # code below does not work with memoryview # <<<<<<<<<<<<<< * idata = super().decompress(idata) * cdef int isize = len(idata) */ __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), __pyx_v_idata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_idata, __pyx_t_3); __pyx_t_3 = 0; /* "borg/compress.pyx":206 * * def decompress(self, idata): * if not isinstance(idata, bytes): # <<<<<<<<<<<<<< * idata = bytes(idata) # code below does not work with memoryview * idata = super().decompress(idata) */ } /* "borg/compress.pyx":208 * if not isinstance(idata, bytes): * idata = bytes(idata) # code below does not work with memoryview * idata = super().decompress(idata) # <<<<<<<<<<<<<< * cdef int isize = len(idata) * cdef int osize */ __pyx_t_4 = __Pyx_CyFunction_GetClassObj(__pyx_self); if (!__pyx_t_4) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 208, __pyx_L1_error) } __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(0, 208, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_self)) __PYX_ERR(0, 208, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_decompress); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_idata}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF_SET(__pyx_v_idata, __pyx_t_3); __pyx_t_3 = 0; /* "borg/compress.pyx":209 * idata = bytes(idata) # code below does not work with memoryview * idata = super().decompress(idata) * cdef int isize = len(idata) # <<<<<<<<<<<<<< * cdef int osize * cdef int rsize */ __pyx_t_7 = PyObject_Length(__pyx_v_idata); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 209, __pyx_L1_error) __pyx_v_isize = __pyx_t_7; /* "borg/compress.pyx":212 * cdef int osize * cdef int rsize * cdef char *source = idata # <<<<<<<<<<<<<< * cdef char *dest * # a bit more than 8MB is enough for the usual data sizes yielded by the chunker. */ __pyx_t_8 = __Pyx_PyObject_AsWritableString(__pyx_v_idata); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L1_error) __pyx_v_source = __pyx_t_8; /* "borg/compress.pyx":216 * # a bit more than 8MB is enough for the usual data sizes yielded by the chunker. * # allocate more if isize * 3 is already bigger, to avoid having to resize often. * osize = max(int(1.1 * 2**23), isize * 3) # <<<<<<<<<<<<<< * while True: * try: */ __pyx_t_9 = (__pyx_v_isize * 3); __pyx_t_3 = __Pyx_PyInt_FromDouble((1.1 * 8388608.0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_10 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_2) { __pyx_t_10 = __Pyx_PyInt_From_long(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_5 = __pyx_t_10; __pyx_t_10 = 0; } else { __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = __pyx_t_3; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_osize = __pyx_t_6; /* "borg/compress.pyx":217 * # allocate more if isize * 3 is already bigger, to avoid having to resize often. * osize = max(int(1.1 * 2**23), isize * 3) * while True: # <<<<<<<<<<<<<< * try: * buf = buffer.get(osize) */ while (1) { /* "borg/compress.pyx":218 * osize = max(int(1.1 * 2**23), isize * 3) * while True: * try: # <<<<<<<<<<<<<< * buf = buffer.get(osize) * except MemoryError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); /*try:*/ { /* "borg/compress.pyx":219 * while True: * try: * buf = buffer.get(osize) # <<<<<<<<<<<<<< * except MemoryError: * raise DecompressionError('MemoryError') */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 219, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 219, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_osize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 219, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 219, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_XDECREF_SET(__pyx_v_buf, __pyx_t_5); __pyx_t_5 = 0; /* "borg/compress.pyx":218 * osize = max(int(1.1 * 2**23), isize * 3) * while True: * try: # <<<<<<<<<<<<<< * buf = buffer.get(osize) * except MemoryError: */ } __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L13_try_end; __pyx_L6_error:; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/compress.pyx":220 * try: * buf = buffer.get(osize) * except MemoryError: # <<<<<<<<<<<<<< * raise DecompressionError('MemoryError') * dest = buf */ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_MemoryError); if (__pyx_t_6) { __Pyx_AddTraceback("borg.compress.LZ4.decompress", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_10, &__pyx_t_3) < 0) __PYX_ERR(0, 220, __pyx_L8_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_3); /* "borg/compress.pyx":221 * buf = buffer.get(osize) * except MemoryError: * raise DecompressionError('MemoryError') # <<<<<<<<<<<<<< * dest = buf * with nogil: */ __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_DecompressionError); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 221, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_15 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_14))) { __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14); if (likely(__pyx_t_15)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_14, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_n_s_MemoryError}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 221, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 221, __pyx_L8_except_error) } goto __pyx_L8_except_error; /* "borg/compress.pyx":218 * osize = max(int(1.1 * 2**23), isize * 3) * while True: * try: # <<<<<<<<<<<<<< * buf = buffer.get(osize) * except MemoryError: */ __pyx_L8_except_error:; __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); goto __pyx_L1_error; __pyx_L13_try_end:; } /* "borg/compress.pyx":222 * except MemoryError: * raise DecompressionError('MemoryError') * dest = buf # <<<<<<<<<<<<<< * with nogil: * rsize = LZ4_decompress_safe(source, dest, isize, osize) */ __pyx_t_8 = __Pyx_PyObject_AsWritableString(__pyx_v_buf); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 222, __pyx_L1_error) __pyx_v_dest = ((char *)__pyx_t_8); /* "borg/compress.pyx":223 * raise DecompressionError('MemoryError') * dest = buf * with nogil: # <<<<<<<<<<<<<< * rsize = LZ4_decompress_safe(source, dest, isize, osize) * if rsize >= 0: */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "borg/compress.pyx":224 * dest = buf * with nogil: * rsize = LZ4_decompress_safe(source, dest, isize, osize) # <<<<<<<<<<<<<< * if rsize >= 0: * break */ __pyx_v_rsize = LZ4_decompress_safe(__pyx_v_source, __pyx_v_dest, __pyx_v_isize, __pyx_v_osize); } /* "borg/compress.pyx":223 * raise DecompressionError('MemoryError') * dest = buf * with nogil: # <<<<<<<<<<<<<< * rsize = LZ4_decompress_safe(source, dest, isize, osize) * if rsize >= 0: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L20; } __pyx_L20:; } } /* "borg/compress.pyx":225 * with nogil: * rsize = LZ4_decompress_safe(source, dest, isize, osize) * if rsize >= 0: # <<<<<<<<<<<<<< * break * if osize > 2 ** 27: # 128MiB (should be enough, considering max. repo obj size and very good compression) */ __pyx_t_2 = (__pyx_v_rsize >= 0); if (__pyx_t_2) { /* "borg/compress.pyx":226 * rsize = LZ4_decompress_safe(source, dest, isize, osize) * if rsize >= 0: * break # <<<<<<<<<<<<<< * if osize > 2 ** 27: # 128MiB (should be enough, considering max. repo obj size and very good compression) * # this is insane, get out of here */ goto __pyx_L5_break; /* "borg/compress.pyx":225 * with nogil: * rsize = LZ4_decompress_safe(source, dest, isize, osize) * if rsize >= 0: # <<<<<<<<<<<<<< * break * if osize > 2 ** 27: # 128MiB (should be enough, considering max. repo obj size and very good compression) */ } /* "borg/compress.pyx":227 * if rsize >= 0: * break * if osize > 2 ** 27: # 128MiB (should be enough, considering max. repo obj size and very good compression) # <<<<<<<<<<<<<< * # this is insane, get out of here * raise DecompressionError('lz4 decompress failed') */ __pyx_t_2 = (__pyx_v_osize > 0x8000000); if (unlikely(__pyx_t_2)) { /* "borg/compress.pyx":229 * if osize > 2 ** 27: # 128MiB (should be enough, considering max. repo obj size and very good compression) * # this is insane, get out of here * raise DecompressionError('lz4 decompress failed') # <<<<<<<<<<<<<< * # likely the buffer was too small, get a bigger one: * osize = int(1.5 * osize) */ __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_DecompressionError); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_s_lz4_decompress_failed}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 229, __pyx_L1_error) /* "borg/compress.pyx":227 * if rsize >= 0: * break * if osize > 2 ** 27: # 128MiB (should be enough, considering max. repo obj size and very good compression) # <<<<<<<<<<<<<< * # this is insane, get out of here * raise DecompressionError('lz4 decompress failed') */ } /* "borg/compress.pyx":231 * raise DecompressionError('lz4 decompress failed') * # likely the buffer was too small, get a bigger one: * osize = int(1.5 * osize) # <<<<<<<<<<<<<< * return dest[:rsize] * */ __pyx_v_osize = ((int)(1.5 * __pyx_v_osize)); } __pyx_L5_break:; /* "borg/compress.pyx":232 * # likely the buffer was too small, get a bigger one: * osize = int(1.5 * osize) * return dest[:rsize] # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_dest + 0, __pyx_v_rsize - 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "borg/compress.pyx":205 * return NONE_COMPRESSOR, None * * def decompress(self, idata): # <<<<<<<<<<<<<< * if not isinstance(idata, bytes): * idata = bytes(idata) # code below does not work with memoryview */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_AddTraceback("borg.compress.LZ4.decompress", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_buf); __Pyx_XDECREF(__pyx_v_idata); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/compress.pyx":242 * name = 'lzma' * * def __init__(self, level=6, **kwargs): # <<<<<<<<<<<<<< * super().__init__(**kwargs) * self.level = level */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_4LZMA_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8compress_4LZMA_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_4LZMA_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8compress_4LZMA_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_level = 0; PyObject *__pyx_v_kwargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_level,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_6))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 242, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_level); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 242, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kwargs, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 242, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_level = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 242, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("borg.compress.LZMA.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_4LZMA___init__(__pyx_self, __pyx_v_self, __pyx_v_level, __pyx_v_kwargs); /* function exit code */ __Pyx_DECREF(__pyx_v_kwargs); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_4LZMA___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_level, PyObject *__pyx_v_kwargs) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "borg/compress.pyx":243 * * def __init__(self, level=6, **kwargs): * super().__init__(**kwargs) # <<<<<<<<<<<<<< * self.level = level * if lzma is None: */ __pyx_t_1 = __Pyx_CyFunction_GetClassObj(__pyx_self); if (!__pyx_t_1) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 243, __pyx_L1_error) } __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self)) __PYX_ERR(0, 243, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/compress.pyx":244 * def __init__(self, level=6, **kwargs): * super().__init__(**kwargs) * self.level = level # <<<<<<<<<<<<<< * if lzma is None: * raise ValueError('No lzma support found.') */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_level, __pyx_v_level) < 0) __PYX_ERR(0, 244, __pyx_L1_error) /* "borg/compress.pyx":245 * super().__init__(**kwargs) * self.level = level * if lzma is None: # <<<<<<<<<<<<<< * raise ValueError('No lzma support found.') * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_lzma); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = (__pyx_t_3 == Py_None); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_t_4)) { /* "borg/compress.pyx":246 * self.level = level * if lzma is None: * raise ValueError('No lzma support found.') # <<<<<<<<<<<<<< * * def _decide(self, data): */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 246, __pyx_L1_error) /* "borg/compress.pyx":245 * super().__init__(**kwargs) * self.level = level * if lzma is None: # <<<<<<<<<<<<<< * raise ValueError('No lzma support found.') * */ } /* "borg/compress.pyx":242 * name = 'lzma' * * def __init__(self, level=6, **kwargs): # <<<<<<<<<<<<<< * super().__init__(**kwargs) * self.level = level */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("borg.compress.LZMA.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/compress.pyx":248 * raise ValueError('No lzma support found.') * * def _decide(self, data): # <<<<<<<<<<<<<< * """ * Decides what to do with *data*. Returns (compressor, lzma_data). */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_4LZMA_3_decide(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_8compress_4LZMA_2_decide, "\n Decides what to do with *data*. Returns (compressor, lzma_data).\n\n *lzma_data* is the LZMA result if *compressor* is LZMA as well, otherwise it is None.\n "); static PyMethodDef __pyx_mdef_4borg_8compress_4LZMA_3_decide = {"_decide", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_4LZMA_3_decide, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_8compress_4LZMA_2_decide}; static PyObject *__pyx_pw_4borg_8compress_4LZMA_3_decide(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_data = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_decide (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_data,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 248, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 248, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("_decide", 1, 2, 2, 1); __PYX_ERR(0, 248, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_decide") < 0)) __PYX_ERR(0, 248, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_data = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_decide", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 248, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.compress.LZMA._decide", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_4LZMA_2_decide(__pyx_self, __pyx_v_self, __pyx_v_data); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_4LZMA_2_decide(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data) { PyObject *__pyx_v_lzma_data = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; Py_ssize_t __pyx_t_6; Py_ssize_t __pyx_t_7; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_decide", 1); /* "borg/compress.pyx":255 * """ * # we do not need integrity checks in lzma, we do that already * lzma_data = lzma.compress(data, preset=self.level, check=lzma.CHECK_NONE) # <<<<<<<<<<<<<< * if len(lzma_data) < len(data): * return self, lzma_data */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_lzma); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_compress); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_data); __Pyx_GIVEREF(__pyx_v_data); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_data)) __PYX_ERR(0, 255, __pyx_L1_error); __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_level); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_preset, __pyx_t_4) < 0) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_lzma); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_CHECK_NONE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check, __pyx_t_5) < 0) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_lzma_data = __pyx_t_5; __pyx_t_5 = 0; /* "borg/compress.pyx":256 * # we do not need integrity checks in lzma, we do that already * lzma_data = lzma.compress(data, preset=self.level, check=lzma.CHECK_NONE) * if len(lzma_data) < len(data): # <<<<<<<<<<<<<< * return self, lzma_data * else: */ __pyx_t_6 = PyObject_Length(__pyx_v_lzma_data); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 256, __pyx_L1_error) __pyx_t_7 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 256, __pyx_L1_error) __pyx_t_8 = (__pyx_t_6 < __pyx_t_7); if (__pyx_t_8) { /* "borg/compress.pyx":257 * lzma_data = lzma.compress(data, preset=self.level, check=lzma.CHECK_NONE) * if len(lzma_data) < len(data): * return self, lzma_data # <<<<<<<<<<<<<< * else: * return NONE_COMPRESSOR, None */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self)) __PYX_ERR(0, 257, __pyx_L1_error); __Pyx_INCREF(__pyx_v_lzma_data); __Pyx_GIVEREF(__pyx_v_lzma_data); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_lzma_data)) __PYX_ERR(0, 257, __pyx_L1_error); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "borg/compress.pyx":256 * # we do not need integrity checks in lzma, we do that already * lzma_data = lzma.compress(data, preset=self.level, check=lzma.CHECK_NONE) * if len(lzma_data) < len(data): # <<<<<<<<<<<<<< * return self, lzma_data * else: */ } /* "borg/compress.pyx":259 * return self, lzma_data * else: * return NONE_COMPRESSOR, None # <<<<<<<<<<<<<< * * def decompress(self, data): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_NONE_COMPRESSOR); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5)) __PYX_ERR(0, 259, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, Py_None)) __PYX_ERR(0, 259, __pyx_L1_error); __pyx_t_5 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "borg/compress.pyx":248 * raise ValueError('No lzma support found.') * * def _decide(self, data): # <<<<<<<<<<<<<< * """ * Decides what to do with *data*. Returns (compressor, lzma_data). */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("borg.compress.LZMA._decide", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_lzma_data); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/compress.pyx":261 * return NONE_COMPRESSOR, None * * def decompress(self, data): # <<<<<<<<<<<<<< * data = super().decompress(data) * try: */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_4LZMA_5decompress(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8compress_4LZMA_5decompress = {"decompress", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_4LZMA_5decompress, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8compress_4LZMA_5decompress(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_data = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("decompress (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_data,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 261, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 261, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("decompress", 1, 2, 2, 1); __PYX_ERR(0, 261, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "decompress") < 0)) __PYX_ERR(0, 261, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_data = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("decompress", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 261, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.compress.LZMA.decompress", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_4LZMA_4decompress(__pyx_self, __pyx_v_self, __pyx_v_data); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_4LZMA_4decompress(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data) { PyObject *__pyx_v_e = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; char const *__pyx_t_13; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("decompress", 0); __Pyx_INCREF(__pyx_v_data); /* "borg/compress.pyx":262 * * def decompress(self, data): * data = super().decompress(data) # <<<<<<<<<<<<<< * try: * return lzma.decompress(data) */ __pyx_t_2 = __Pyx_CyFunction_GetClassObj(__pyx_self); if (!__pyx_t_2) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 262, __pyx_L1_error) } __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self)) __PYX_ERR(0, 262, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_decompress); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_data}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_1); __pyx_t_1 = 0; /* "borg/compress.pyx":263 * def decompress(self, data): * data = super().decompress(data) * try: # <<<<<<<<<<<<<< * return lzma.decompress(data) * except lzma.LZMAError as e: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); /*try:*/ { /* "borg/compress.pyx":264 * data = super().decompress(data) * try: * return lzma.decompress(data) # <<<<<<<<<<<<<< * except lzma.LZMAError as e: * raise DecompressionError(str(e)) from None */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_lzma); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 264, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_decompress); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_data}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 264, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L7_try_return; /* "borg/compress.pyx":263 * def decompress(self, data): * data = super().decompress(data) * try: # <<<<<<<<<<<<<< * return lzma.decompress(data) * except lzma.LZMAError as e: */ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/compress.pyx":265 * try: * return lzma.decompress(data) * except lzma.LZMAError as e: # <<<<<<<<<<<<<< * raise DecompressionError(str(e)) from None * */ __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_lzma); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 265, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_LZMAError); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 265, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_4 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_ErrRestore(__pyx_t_1, __pyx_t_2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; if (__pyx_t_4) { __Pyx_AddTraceback("borg.compress.LZMA.decompress", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1) < 0) __PYX_ERR(0, 265, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __pyx_v_e = __pyx_t_2; /*try:*/ { /* "borg/compress.pyx":266 * return lzma.decompress(data) * except lzma.LZMAError as e: * raise DecompressionError(str(e)) from None # <<<<<<<<<<<<<< * * */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_DecompressionError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 266, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = __Pyx_PyObject_Str(__pyx_v_e); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 266, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_10}; __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 266, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_Raise(__pyx_t_9, 0, 0, Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(0, 266, __pyx_L14_error) } /* "borg/compress.pyx":265 * try: * return lzma.decompress(data) * except lzma.LZMAError as e: # <<<<<<<<<<<<<< * raise DecompressionError(str(e)) from None * */ /*finally:*/ { __pyx_L14_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __pyx_t_4 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19); } __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ErrRestore(__pyx_t_14, __pyx_t_15, __pyx_t_16); __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13; goto __pyx_L5_except_error; } } } goto __pyx_L5_except_error; /* "borg/compress.pyx":263 * def decompress(self, data): * data = super().decompress(data) * try: # <<<<<<<<<<<<<< * return lzma.decompress(data) * except lzma.LZMAError as e: */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); goto __pyx_L1_error; __pyx_L7_try_return:; __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); goto __pyx_L0; } /* "borg/compress.pyx":261 * return NONE_COMPRESSOR, None * * def decompress(self, data): # <<<<<<<<<<<<<< * data = super().decompress(data) * try: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("borg.compress.LZMA.decompress", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_e); __Pyx_XDECREF(__pyx_v_data); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/compress.pyx":277 * name = 'zstd' * * def __init__(self, level=3, **kwargs): # <<<<<<<<<<<<<< * super().__init__(**kwargs) * self.level = level */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_4ZSTD_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8compress_4ZSTD_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_4ZSTD_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8compress_4ZSTD_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_level = 0; PyObject *__pyx_v_kwargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_level,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_3))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 277, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_level); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 277, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kwargs, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 277, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_level = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 277, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("borg.compress.ZSTD.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_4ZSTD___init__(__pyx_self, __pyx_v_self, __pyx_v_level, __pyx_v_kwargs); /* function exit code */ __Pyx_DECREF(__pyx_v_kwargs); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_4ZSTD___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_level, PyObject *__pyx_v_kwargs) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "borg/compress.pyx":278 * * def __init__(self, level=3, **kwargs): * super().__init__(**kwargs) # <<<<<<<<<<<<<< * self.level = level * */ __pyx_t_1 = __Pyx_CyFunction_GetClassObj(__pyx_self); if (!__pyx_t_1) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 278, __pyx_L1_error) } __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self)) __PYX_ERR(0, 278, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/compress.pyx":279 * def __init__(self, level=3, **kwargs): * super().__init__(**kwargs) * self.level = level # <<<<<<<<<<<<<< * * def _decide(self, idata): */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_level, __pyx_v_level) < 0) __PYX_ERR(0, 279, __pyx_L1_error) /* "borg/compress.pyx":277 * name = 'zstd' * * def __init__(self, level=3, **kwargs): # <<<<<<<<<<<<<< * super().__init__(**kwargs) * self.level = level */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("borg.compress.ZSTD.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/compress.pyx":281 * self.level = level * * def _decide(self, idata): # <<<<<<<<<<<<<< * """ * Decides what to do with *data*. Returns (compressor, zstd_data). */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_4ZSTD_3_decide(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_8compress_4ZSTD_2_decide, "\n Decides what to do with *data*. Returns (compressor, zstd_data).\n\n *zstd_data* is the ZSTD result if *compressor* is ZSTD as well, otherwise it is None.\n "); static PyMethodDef __pyx_mdef_4borg_8compress_4ZSTD_3_decide = {"_decide", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_4ZSTD_3_decide, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_8compress_4ZSTD_2_decide}; static PyObject *__pyx_pw_4borg_8compress_4ZSTD_3_decide(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_idata = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_decide (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_idata,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 281, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_idata)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 281, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("_decide", 1, 2, 2, 1); __PYX_ERR(0, 281, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_decide") < 0)) __PYX_ERR(0, 281, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_idata = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_decide", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 281, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.compress.ZSTD._decide", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_4ZSTD_2_decide(__pyx_self, __pyx_v_self, __pyx_v_idata); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_4ZSTD_2_decide(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_idata) { int __pyx_v_isize; int __pyx_v_osize; char *__pyx_v_source; char *__pyx_v_dest; int __pyx_v_level; PyObject *__pyx_v_buf = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; char *__pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_decide", 0); __Pyx_INCREF(__pyx_v_idata); /* "borg/compress.pyx":287 * *zstd_data* is the ZSTD result if *compressor* is ZSTD as well, otherwise it is None. * """ * if not isinstance(idata, bytes): # <<<<<<<<<<<<<< * idata = bytes(idata) # code below does not work with memoryview * cdef int isize = len(idata) */ __pyx_t_1 = PyBytes_Check(__pyx_v_idata); __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "borg/compress.pyx":288 * """ * if not isinstance(idata, bytes): * idata = bytes(idata) # code below does not work with memoryview # <<<<<<<<<<<<<< * cdef int isize = len(idata) * cdef int osize */ __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), __pyx_v_idata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_idata, __pyx_t_3); __pyx_t_3 = 0; /* "borg/compress.pyx":287 * *zstd_data* is the ZSTD result if *compressor* is ZSTD as well, otherwise it is None. * """ * if not isinstance(idata, bytes): # <<<<<<<<<<<<<< * idata = bytes(idata) # code below does not work with memoryview * cdef int isize = len(idata) */ } /* "borg/compress.pyx":289 * if not isinstance(idata, bytes): * idata = bytes(idata) # code below does not work with memoryview * cdef int isize = len(idata) # <<<<<<<<<<<<<< * cdef int osize * cdef char *source = idata */ __pyx_t_4 = PyObject_Length(__pyx_v_idata); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 289, __pyx_L1_error) __pyx_v_isize = __pyx_t_4; /* "borg/compress.pyx":291 * cdef int isize = len(idata) * cdef int osize * cdef char *source = idata # <<<<<<<<<<<<<< * cdef char *dest * cdef int level = self.level */ __pyx_t_5 = __Pyx_PyObject_AsWritableString(__pyx_v_idata); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 291, __pyx_L1_error) __pyx_v_source = __pyx_t_5; /* "borg/compress.pyx":293 * cdef char *source = idata * cdef char *dest * cdef int level = self.level # <<<<<<<<<<<<<< * osize = ZSTD_compressBound(isize) * buf = buffer.get(osize) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_level); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_level = __pyx_t_6; /* "borg/compress.pyx":294 * cdef char *dest * cdef int level = self.level * osize = ZSTD_compressBound(isize) # <<<<<<<<<<<<<< * buf = buffer.get(osize) * dest = buf */ __pyx_v_osize = ZSTD_compressBound(__pyx_v_isize); /* "borg/compress.pyx":295 * cdef int level = self.level * osize = ZSTD_compressBound(isize) * buf = buffer.get(osize) # <<<<<<<<<<<<<< * dest = buf * with nogil: */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_buffer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_get); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_osize); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_7}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_v_buf = __pyx_t_3; __pyx_t_3 = 0; /* "borg/compress.pyx":296 * osize = ZSTD_compressBound(isize) * buf = buffer.get(osize) * dest = buf # <<<<<<<<<<<<<< * with nogil: * osize = ZSTD_compress(dest, osize, source, isize, level) */ __pyx_t_5 = __Pyx_PyObject_AsWritableString(__pyx_v_buf); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 296, __pyx_L1_error) __pyx_v_dest = ((char *)__pyx_t_5); /* "borg/compress.pyx":297 * buf = buffer.get(osize) * dest = buf * with nogil: # <<<<<<<<<<<<<< * osize = ZSTD_compress(dest, osize, source, isize, level) * if ZSTD_isError(osize): */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "borg/compress.pyx":298 * dest = buf * with nogil: * osize = ZSTD_compress(dest, osize, source, isize, level) # <<<<<<<<<<<<<< * if ZSTD_isError(osize): * raise Exception('zstd compress failed: %s' % ZSTD_getErrorName(osize)) */ __pyx_v_osize = ZSTD_compress(__pyx_v_dest, __pyx_v_osize, __pyx_v_source, __pyx_v_isize, __pyx_v_level); } /* "borg/compress.pyx":297 * buf = buffer.get(osize) * dest = buf * with nogil: # <<<<<<<<<<<<<< * osize = ZSTD_compress(dest, osize, source, isize, level) * if ZSTD_isError(osize): */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L6; } __pyx_L6:; } } /* "borg/compress.pyx":299 * with nogil: * osize = ZSTD_compress(dest, osize, source, isize, level) * if ZSTD_isError(osize): # <<<<<<<<<<<<<< * raise Exception('zstd compress failed: %s' % ZSTD_getErrorName(osize)) * # only compress if the result actually is smaller */ __pyx_t_2 = (ZSTD_isError(__pyx_v_osize) != 0); if (unlikely(__pyx_t_2)) { /* "borg/compress.pyx":300 * osize = ZSTD_compress(dest, osize, source, isize, level) * if ZSTD_isError(osize): * raise Exception('zstd compress failed: %s' % ZSTD_getErrorName(osize)) # <<<<<<<<<<<<<< * # only compress if the result actually is smaller * if osize < isize: */ __pyx_t_3 = __Pyx_PyBytes_FromString(ZSTD_getErrorName(__pyx_v_osize)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_zstd_compress_failed_s, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 300, __pyx_L1_error) /* "borg/compress.pyx":299 * with nogil: * osize = ZSTD_compress(dest, osize, source, isize, level) * if ZSTD_isError(osize): # <<<<<<<<<<<<<< * raise Exception('zstd compress failed: %s' % ZSTD_getErrorName(osize)) * # only compress if the result actually is smaller */ } /* "borg/compress.pyx":302 * raise Exception('zstd compress failed: %s' % ZSTD_getErrorName(osize)) * # only compress if the result actually is smaller * if osize < isize: # <<<<<<<<<<<<<< * return self, dest[:osize] * else: */ __pyx_t_2 = (__pyx_v_osize < __pyx_v_isize); if (__pyx_t_2) { /* "borg/compress.pyx":303 * # only compress if the result actually is smaller * if osize < isize: * return self, dest[:osize] # <<<<<<<<<<<<<< * else: * return NONE_COMPRESSOR, None */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_dest + 0, __pyx_v_osize - 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_self)) __PYX_ERR(0, 303, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3)) __PYX_ERR(0, 303, __pyx_L1_error); __pyx_t_3 = 0; __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L0; /* "borg/compress.pyx":302 * raise Exception('zstd compress failed: %s' % ZSTD_getErrorName(osize)) * # only compress if the result actually is smaller * if osize < isize: # <<<<<<<<<<<<<< * return self, dest[:osize] * else: */ } /* "borg/compress.pyx":305 * return self, dest[:osize] * else: * return NONE_COMPRESSOR, None # <<<<<<<<<<<<<< * * def decompress(self, idata): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_NONE_COMPRESSOR); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8)) __PYX_ERR(0, 305, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, Py_None)) __PYX_ERR(0, 305, __pyx_L1_error); __pyx_t_8 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "borg/compress.pyx":281 * self.level = level * * def _decide(self, idata): # <<<<<<<<<<<<<< * """ * Decides what to do with *data*. Returns (compressor, zstd_data). */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("borg.compress.ZSTD._decide", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_buf); __Pyx_XDECREF(__pyx_v_idata); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/compress.pyx":307 * return NONE_COMPRESSOR, None * * def decompress(self, idata): # <<<<<<<<<<<<<< * if not isinstance(idata, bytes): * idata = bytes(idata) # code below does not work with memoryview */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_4ZSTD_5decompress(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8compress_4ZSTD_5decompress = {"decompress", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_4ZSTD_5decompress, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8compress_4ZSTD_5decompress(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_idata = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("decompress (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_idata,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 307, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_idata)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 307, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("decompress", 1, 2, 2, 1); __PYX_ERR(0, 307, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "decompress") < 0)) __PYX_ERR(0, 307, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_idata = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("decompress", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 307, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.compress.ZSTD.decompress", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_4ZSTD_4decompress(__pyx_self, __pyx_v_self, __pyx_v_idata); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_4ZSTD_4decompress(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_idata) { int __pyx_v_isize; unsigned PY_LONG_LONG __pyx_v_osize; unsigned PY_LONG_LONG __pyx_v_rsize; char *__pyx_v_source; char *__pyx_v_dest; PyObject *__pyx_v_buf = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; Py_ssize_t __pyx_t_7; char *__pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("decompress", 0); __Pyx_INCREF(__pyx_v_idata); /* "borg/compress.pyx":308 * * def decompress(self, idata): * if not isinstance(idata, bytes): # <<<<<<<<<<<<<< * idata = bytes(idata) # code below does not work with memoryview * idata = super().decompress(idata) */ __pyx_t_1 = PyBytes_Check(__pyx_v_idata); __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "borg/compress.pyx":309 * def decompress(self, idata): * if not isinstance(idata, bytes): * idata = bytes(idata) # code below does not work with memoryview # <<<<<<<<<<<<<< * idata = super().decompress(idata) * cdef int isize = len(idata) */ __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), __pyx_v_idata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_idata, __pyx_t_3); __pyx_t_3 = 0; /* "borg/compress.pyx":308 * * def decompress(self, idata): * if not isinstance(idata, bytes): # <<<<<<<<<<<<<< * idata = bytes(idata) # code below does not work with memoryview * idata = super().decompress(idata) */ } /* "borg/compress.pyx":310 * if not isinstance(idata, bytes): * idata = bytes(idata) # code below does not work with memoryview * idata = super().decompress(idata) # <<<<<<<<<<<<<< * cdef int isize = len(idata) * cdef unsigned long long osize */ __pyx_t_4 = __Pyx_CyFunction_GetClassObj(__pyx_self); if (!__pyx_t_4) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 310, __pyx_L1_error) } __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(0, 310, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_self)) __PYX_ERR(0, 310, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_decompress); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_idata}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF_SET(__pyx_v_idata, __pyx_t_3); __pyx_t_3 = 0; /* "borg/compress.pyx":311 * idata = bytes(idata) # code below does not work with memoryview * idata = super().decompress(idata) * cdef int isize = len(idata) # <<<<<<<<<<<<<< * cdef unsigned long long osize * cdef unsigned long long rsize */ __pyx_t_7 = PyObject_Length(__pyx_v_idata); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 311, __pyx_L1_error) __pyx_v_isize = __pyx_t_7; /* "borg/compress.pyx":314 * cdef unsigned long long osize * cdef unsigned long long rsize * cdef char *source = idata # <<<<<<<<<<<<<< * cdef char *dest * osize = ZSTD_getFrameContentSize(source, isize) */ __pyx_t_8 = __Pyx_PyObject_AsWritableString(__pyx_v_idata); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 314, __pyx_L1_error) __pyx_v_source = __pyx_t_8; /* "borg/compress.pyx":316 * cdef char *source = idata * cdef char *dest * osize = ZSTD_getFrameContentSize(source, isize) # <<<<<<<<<<<<<< * if osize == ZSTD_CONTENTSIZE_ERROR: * raise DecompressionError('zstd get size failed: data was not compressed by zstd') */ __pyx_v_osize = ZSTD_getFrameContentSize(__pyx_v_source, __pyx_v_isize); /* "borg/compress.pyx":317 * cdef char *dest * osize = ZSTD_getFrameContentSize(source, isize) * if osize == ZSTD_CONTENTSIZE_ERROR: # <<<<<<<<<<<<<< * raise DecompressionError('zstd get size failed: data was not compressed by zstd') * if osize == ZSTD_CONTENTSIZE_UNKNOWN: */ __pyx_t_2 = (__pyx_v_osize == ZSTD_CONTENTSIZE_ERROR); if (unlikely(__pyx_t_2)) { /* "borg/compress.pyx":318 * osize = ZSTD_getFrameContentSize(source, isize) * if osize == ZSTD_CONTENTSIZE_ERROR: * raise DecompressionError('zstd get size failed: data was not compressed by zstd') # <<<<<<<<<<<<<< * if osize == ZSTD_CONTENTSIZE_UNKNOWN: * raise DecompressionError('zstd get size failed: original size unknown') */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_DecompressionError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_zstd_get_size_failed_data_was_no}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 318, __pyx_L1_error) /* "borg/compress.pyx":317 * cdef char *dest * osize = ZSTD_getFrameContentSize(source, isize) * if osize == ZSTD_CONTENTSIZE_ERROR: # <<<<<<<<<<<<<< * raise DecompressionError('zstd get size failed: data was not compressed by zstd') * if osize == ZSTD_CONTENTSIZE_UNKNOWN: */ } /* "borg/compress.pyx":319 * if osize == ZSTD_CONTENTSIZE_ERROR: * raise DecompressionError('zstd get size failed: data was not compressed by zstd') * if osize == ZSTD_CONTENTSIZE_UNKNOWN: # <<<<<<<<<<<<<< * raise DecompressionError('zstd get size failed: original size unknown') * try: */ __pyx_t_2 = (__pyx_v_osize == ZSTD_CONTENTSIZE_UNKNOWN); if (unlikely(__pyx_t_2)) { /* "borg/compress.pyx":320 * raise DecompressionError('zstd get size failed: data was not compressed by zstd') * if osize == ZSTD_CONTENTSIZE_UNKNOWN: * raise DecompressionError('zstd get size failed: original size unknown') # <<<<<<<<<<<<<< * try: * buf = buffer.get(osize) */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_DecompressionError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_zstd_get_size_failed_original_si}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 320, __pyx_L1_error) /* "borg/compress.pyx":319 * if osize == ZSTD_CONTENTSIZE_ERROR: * raise DecompressionError('zstd get size failed: data was not compressed by zstd') * if osize == ZSTD_CONTENTSIZE_UNKNOWN: # <<<<<<<<<<<<<< * raise DecompressionError('zstd get size failed: original size unknown') * try: */ } /* "borg/compress.pyx":321 * if osize == ZSTD_CONTENTSIZE_UNKNOWN: * raise DecompressionError('zstd get size failed: original size unknown') * try: # <<<<<<<<<<<<<< * buf = buffer.get(osize) * except MemoryError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); /*try:*/ { /* "borg/compress.pyx":322 * raise DecompressionError('zstd get size failed: original size unknown') * try: * buf = buffer.get(osize) # <<<<<<<<<<<<<< * except MemoryError: * raise DecompressionError('MemoryError') */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_buffer); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 322, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 322, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_v_osize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 322, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_12 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 322, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_buf = __pyx_t_3; __pyx_t_3 = 0; /* "borg/compress.pyx":321 * if osize == ZSTD_CONTENTSIZE_UNKNOWN: * raise DecompressionError('zstd get size failed: original size unknown') * try: # <<<<<<<<<<<<<< * buf = buffer.get(osize) * except MemoryError: */ } __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L11_try_end; __pyx_L6_error:; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/compress.pyx":323 * try: * buf = buffer.get(osize) * except MemoryError: # <<<<<<<<<<<<<< * raise DecompressionError('MemoryError') * dest = buf */ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_MemoryError); if (__pyx_t_6) { __Pyx_AddTraceback("borg.compress.ZSTD.decompress", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(0, 323, __pyx_L8_except_error) __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); /* "borg/compress.pyx":324 * buf = buffer.get(osize) * except MemoryError: * raise DecompressionError('MemoryError') # <<<<<<<<<<<<<< * dest = buf * with nogil: */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_DecompressionError); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 324, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_13))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_n_s_MemoryError}; __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 324, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } __Pyx_Raise(__pyx_t_12, 0, 0, 0); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __PYX_ERR(0, 324, __pyx_L8_except_error) } goto __pyx_L8_except_error; /* "borg/compress.pyx":321 * if osize == ZSTD_CONTENTSIZE_UNKNOWN: * raise DecompressionError('zstd get size failed: original size unknown') * try: # <<<<<<<<<<<<<< * buf = buffer.get(osize) * except MemoryError: */ __pyx_L8_except_error:; __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); goto __pyx_L1_error; __pyx_L11_try_end:; } /* "borg/compress.pyx":325 * except MemoryError: * raise DecompressionError('MemoryError') * dest = buf # <<<<<<<<<<<<<< * with nogil: * rsize = ZSTD_decompress(dest, osize, source, isize) */ __pyx_t_8 = __Pyx_PyObject_AsWritableString(__pyx_v_buf); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 325, __pyx_L1_error) __pyx_v_dest = ((char *)__pyx_t_8); /* "borg/compress.pyx":326 * raise DecompressionError('MemoryError') * dest = buf * with nogil: # <<<<<<<<<<<<<< * rsize = ZSTD_decompress(dest, osize, source, isize) * if ZSTD_isError(rsize): */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "borg/compress.pyx":327 * dest = buf * with nogil: * rsize = ZSTD_decompress(dest, osize, source, isize) # <<<<<<<<<<<<<< * if ZSTD_isError(rsize): * raise DecompressionError('zstd decompress failed: %s' % ZSTD_getErrorName(rsize)) */ __pyx_v_rsize = ZSTD_decompress(__pyx_v_dest, __pyx_v_osize, __pyx_v_source, __pyx_v_isize); } /* "borg/compress.pyx":326 * raise DecompressionError('MemoryError') * dest = buf * with nogil: # <<<<<<<<<<<<<< * rsize = ZSTD_decompress(dest, osize, source, isize) * if ZSTD_isError(rsize): */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L16; } __pyx_L16:; } } /* "borg/compress.pyx":328 * with nogil: * rsize = ZSTD_decompress(dest, osize, source, isize) * if ZSTD_isError(rsize): # <<<<<<<<<<<<<< * raise DecompressionError('zstd decompress failed: %s' % ZSTD_getErrorName(rsize)) * if rsize != osize: */ __pyx_t_2 = (ZSTD_isError(__pyx_v_rsize) != 0); if (unlikely(__pyx_t_2)) { /* "borg/compress.pyx":329 * rsize = ZSTD_decompress(dest, osize, source, isize) * if ZSTD_isError(rsize): * raise DecompressionError('zstd decompress failed: %s' % ZSTD_getErrorName(rsize)) # <<<<<<<<<<<<<< * if rsize != osize: * raise DecompressionError('zstd decompress failed: size mismatch') */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_DecompressionError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyBytes_FromString(ZSTD_getErrorName(__pyx_v_rsize)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_12 = __Pyx_PyString_Format(__pyx_kp_s_zstd_decompress_failed_s, __pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_12}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(0, 329, __pyx_L1_error) /* "borg/compress.pyx":328 * with nogil: * rsize = ZSTD_decompress(dest, osize, source, isize) * if ZSTD_isError(rsize): # <<<<<<<<<<<<<< * raise DecompressionError('zstd decompress failed: %s' % ZSTD_getErrorName(rsize)) * if rsize != osize: */ } /* "borg/compress.pyx":330 * if ZSTD_isError(rsize): * raise DecompressionError('zstd decompress failed: %s' % ZSTD_getErrorName(rsize)) * if rsize != osize: # <<<<<<<<<<<<<< * raise DecompressionError('zstd decompress failed: size mismatch') * return dest[:osize] */ __pyx_t_2 = (__pyx_v_rsize != __pyx_v_osize); if (unlikely(__pyx_t_2)) { /* "borg/compress.pyx":331 * raise DecompressionError('zstd decompress failed: %s' % ZSTD_getErrorName(rsize)) * if rsize != osize: * raise DecompressionError('zstd decompress failed: size mismatch') # <<<<<<<<<<<<<< * return dest[:osize] * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_DecompressionError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_12 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_kp_s_zstd_decompress_failed_size_mism}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(0, 331, __pyx_L1_error) /* "borg/compress.pyx":330 * if ZSTD_isError(rsize): * raise DecompressionError('zstd decompress failed: %s' % ZSTD_getErrorName(rsize)) * if rsize != osize: # <<<<<<<<<<<<<< * raise DecompressionError('zstd decompress failed: size mismatch') * return dest[:osize] */ } /* "borg/compress.pyx":332 * if rsize != osize: * raise DecompressionError('zstd decompress failed: size mismatch') * return dest[:osize] # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_dest + 0, __pyx_v_osize - 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "borg/compress.pyx":307 * return NONE_COMPRESSOR, None * * def decompress(self, idata): # <<<<<<<<<<<<<< * if not isinstance(idata, bytes): * idata = bytes(idata) # code below does not work with memoryview */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_AddTraceback("borg.compress.ZSTD.decompress", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_buf); __Pyx_XDECREF(__pyx_v_idata); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/compress.pyx":343 * name = 'zlib' * * @classmethod # <<<<<<<<<<<<<< * def detect(cls, data): * # matches misc. patterns 0x.8.. used by zlib */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_4ZLIB_1detect(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8compress_4ZLIB_1detect = {"detect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_4ZLIB_1detect, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8compress_4ZLIB_1detect(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_cls = 0; PyObject *__pyx_v_data = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("detect (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_data,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cls)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 343, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 343, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("detect", 1, 2, 2, 1); __PYX_ERR(0, 343, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "detect") < 0)) __PYX_ERR(0, 343, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_cls = values[0]; __pyx_v_data = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("detect", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 343, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.compress.ZLIB.detect", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_4ZLIB_detect(__pyx_self, __pyx_v_cls, __pyx_v_data); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_4ZLIB_detect(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_data) { PyObject *__pyx_v_cmf = NULL; PyObject *__pyx_v_flg = NULL; PyObject *__pyx_v_is_deflate = NULL; PyObject *__pyx_v_check_ok = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *(*__pyx_t_5)(PyObject *); int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("detect", 1); /* "borg/compress.pyx":346 * def detect(cls, data): * # matches misc. patterns 0x.8.. used by zlib * cmf, flg = data[:2] # <<<<<<<<<<<<<< * is_deflate = cmf & 0x0f == 8 * check_ok = (cmf * 256 + flg) % 31 == 0 */ __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_data, 0, 2, NULL, NULL, &__pyx_slice__4, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 346, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 346, __pyx_L1_error) __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 346, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_cmf = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_flg = __pyx_t_3; __pyx_t_3 = 0; /* "borg/compress.pyx":347 * # matches misc. patterns 0x.8.. used by zlib * cmf, flg = data[:2] * is_deflate = cmf & 0x0f == 8 # <<<<<<<<<<<<<< * check_ok = (cmf * 256 + flg) % 31 == 0 * return check_ok and is_deflate */ __pyx_t_1 = __Pyx_PyInt_AndObjC(__pyx_v_cmf, __pyx_int_15, 0x0f, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_8, 8, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_is_deflate = __pyx_t_3; __pyx_t_3 = 0; /* "borg/compress.pyx":348 * cmf, flg = data[:2] * is_deflate = cmf & 0x0f == 8 * check_ok = (cmf * 256 + flg) % 31 == 0 # <<<<<<<<<<<<<< * return check_ok and is_deflate * */ __pyx_t_3 = __Pyx_PyInt_MultiplyObjC(__pyx_v_cmf, __pyx_int_256, 0x100, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_v_flg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_RemainderObjC(__pyx_t_1, __pyx_int_31, 31, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_3, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_check_ok = __pyx_t_1; __pyx_t_1 = 0; /* "borg/compress.pyx":349 * is_deflate = cmf & 0x0f == 8 * check_ok = (cmf * 256 + flg) % 31 == 0 * return check_ok and is_deflate # <<<<<<<<<<<<<< * * def __init__(self, level=6, **kwargs): */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_check_ok); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 349, __pyx_L1_error) if (__pyx_t_6) { } else { __Pyx_INCREF(__pyx_v_check_ok); __pyx_t_1 = __pyx_v_check_ok; goto __pyx_L5_bool_binop_done; } __Pyx_INCREF(__pyx_v_is_deflate); __pyx_t_1 = __pyx_v_is_deflate; __pyx_L5_bool_binop_done:; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/compress.pyx":343 * name = 'zlib' * * @classmethod # <<<<<<<<<<<<<< * def detect(cls, data): * # matches misc. patterns 0x.8.. used by zlib */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("borg.compress.ZLIB.detect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_cmf); __Pyx_XDECREF(__pyx_v_flg); __Pyx_XDECREF(__pyx_v_is_deflate); __Pyx_XDECREF(__pyx_v_check_ok); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/compress.pyx":351 * return check_ok and is_deflate * * def __init__(self, level=6, **kwargs): # <<<<<<<<<<<<<< * super().__init__(**kwargs) * self.level = level */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_4ZLIB_3__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8compress_4ZLIB_3__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_4ZLIB_3__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8compress_4ZLIB_3__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_level = 0; PyObject *__pyx_v_kwargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_level,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_6))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 351, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_level); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 351, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kwargs, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 351, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_level = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 351, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("borg.compress.ZLIB.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_4ZLIB_2__init__(__pyx_self, __pyx_v_self, __pyx_v_level, __pyx_v_kwargs); /* function exit code */ __Pyx_DECREF(__pyx_v_kwargs); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_4ZLIB_2__init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_level, PyObject *__pyx_v_kwargs) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "borg/compress.pyx":352 * * def __init__(self, level=6, **kwargs): * super().__init__(**kwargs) # <<<<<<<<<<<<<< * self.level = level * */ __pyx_t_1 = __Pyx_CyFunction_GetClassObj(__pyx_self); if (!__pyx_t_1) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 352, __pyx_L1_error) } __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self)) __PYX_ERR(0, 352, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/compress.pyx":353 * def __init__(self, level=6, **kwargs): * super().__init__(**kwargs) * self.level = level # <<<<<<<<<<<<<< * * def compress(self, data): */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_level, __pyx_v_level) < 0) __PYX_ERR(0, 353, __pyx_L1_error) /* "borg/compress.pyx":351 * return check_ok and is_deflate * * def __init__(self, level=6, **kwargs): # <<<<<<<<<<<<<< * super().__init__(**kwargs) * self.level = level */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("borg.compress.ZLIB.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/compress.pyx":355 * self.level = level * * def compress(self, data): # <<<<<<<<<<<<<< * # note: for compatibility no super call, do not add ID bytes * return zlib.compress(data, self.level) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_4ZLIB_5compress(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8compress_4ZLIB_5compress = {"compress", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_4ZLIB_5compress, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8compress_4ZLIB_5compress(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_data = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("compress (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_data,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 355, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 355, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("compress", 1, 2, 2, 1); __PYX_ERR(0, 355, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "compress") < 0)) __PYX_ERR(0, 355, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_data = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("compress", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 355, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.compress.ZLIB.compress", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_4ZLIB_4compress(__pyx_self, __pyx_v_self, __pyx_v_data); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_4ZLIB_4compress(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("compress", 1); /* "borg/compress.pyx":357 * def compress(self, data): * # note: for compatibility no super call, do not add ID bytes * return zlib.compress(data, self.level) # <<<<<<<<<<<<<< * * def decompress(self, data): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_zlib); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_compress); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_level); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_data, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/compress.pyx":355 * self.level = level * * def compress(self, data): # <<<<<<<<<<<<<< * # note: for compatibility no super call, do not add ID bytes * return zlib.compress(data, self.level) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("borg.compress.ZLIB.compress", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/compress.pyx":359 * return zlib.compress(data, self.level) * * def decompress(self, data): # <<<<<<<<<<<<<< * # note: for compatibility no super call, do not strip ID bytes * try: */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_4ZLIB_7decompress(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8compress_4ZLIB_7decompress = {"decompress", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_4ZLIB_7decompress, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8compress_4ZLIB_7decompress(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_self = 0; PyObject *__pyx_v_data = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("decompress (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_data,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 359, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 359, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("decompress", 1, 2, 2, 1); __PYX_ERR(0, 359, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "decompress") < 0)) __PYX_ERR(0, 359, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_data = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("decompress", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 359, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.compress.ZLIB.decompress", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_4ZLIB_6decompress(__pyx_self, __pyx_v_self, __pyx_v_data); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_4ZLIB_6decompress(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_data) { PyObject *__pyx_v_e = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; char const *__pyx_t_13; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("decompress", 1); /* "borg/compress.pyx":361 * def decompress(self, data): * # note: for compatibility no super call, do not strip ID bytes * try: # <<<<<<<<<<<<<< * return zlib.decompress(data) * except zlib.error as e: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "borg/compress.pyx":362 * # note: for compatibility no super call, do not strip ID bytes * try: * return zlib.decompress(data) # <<<<<<<<<<<<<< * except zlib.error as e: * raise DecompressionError(str(e)) from None */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_zlib); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 362, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_decompress); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 362, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_data}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 362, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L7_try_return; /* "borg/compress.pyx":361 * def decompress(self, data): * # note: for compatibility no super call, do not strip ID bytes * try: # <<<<<<<<<<<<<< * return zlib.decompress(data) * except zlib.error as e: */ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "borg/compress.pyx":363 * try: * return zlib.decompress(data) * except zlib.error as e: # <<<<<<<<<<<<<< * raise DecompressionError(str(e)) from None * */ __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5); __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_zlib); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 363, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_error); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 363, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_7 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_4, __pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_ErrRestore(__pyx_t_4, __pyx_t_6, __pyx_t_5); __pyx_t_4 = 0; __pyx_t_6 = 0; __pyx_t_5 = 0; if (__pyx_t_7) { __Pyx_AddTraceback("borg.compress.ZLIB.decompress", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_4) < 0) __PYX_ERR(0, 363, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_v_e = __pyx_t_6; /*try:*/ { /* "borg/compress.pyx":364 * return zlib.decompress(data) * except zlib.error as e: * raise DecompressionError(str(e)) from None # <<<<<<<<<<<<<< * * */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_DecompressionError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 364, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = __Pyx_PyObject_Str(__pyx_v_e); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 364, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_10}; __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 364, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_Raise(__pyx_t_9, 0, 0, Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(0, 364, __pyx_L14_error) } /* "borg/compress.pyx":363 * try: * return zlib.decompress(data) * except zlib.error as e: # <<<<<<<<<<<<<< * raise DecompressionError(str(e)) from None * */ /*finally:*/ { __pyx_L14_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __pyx_t_7 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19); } __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ErrRestore(__pyx_t_14, __pyx_t_15, __pyx_t_16); __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13; goto __pyx_L5_except_error; } } } goto __pyx_L5_except_error; /* "borg/compress.pyx":361 * def decompress(self, data): * # note: for compatibility no super call, do not strip ID bytes * try: # <<<<<<<<<<<<<< * return zlib.decompress(data) * except zlib.error as e: */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L7_try_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; } /* "borg/compress.pyx":359 * return zlib.compress(data, self.level) * * def decompress(self, data): # <<<<<<<<<<<<<< * # note: for compatibility no super call, do not strip ID bytes * try: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("borg.compress.ZLIB.decompress", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_e); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/compress.pyx":378 * name = 'auto' * * def __init__(self, compressor): # <<<<<<<<<<<<<< * super().__init__() * self.compressor = compressor */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_4Auto_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8compress_4Auto_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_4Auto_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8compress_4Auto_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_compressor = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_compressor,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 378, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_compressor)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 378, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 378, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 378, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_compressor = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 378, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.compress.Auto.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_4Auto___init__(__pyx_self, __pyx_v_self, __pyx_v_compressor); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_4Auto___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_compressor) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "borg/compress.pyx":379 * * def __init__(self, compressor): * super().__init__() # <<<<<<<<<<<<<< * self.compressor = compressor * */ __pyx_t_2 = __Pyx_CyFunction_GetClassObj(__pyx_self); if (!__pyx_t_2) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 379, __pyx_L1_error) } __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 379, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self)) __PYX_ERR(0, 379, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/compress.pyx":380 * def __init__(self, compressor): * super().__init__() * self.compressor = compressor # <<<<<<<<<<<<<< * * def _decide(self, data): */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_compressor, __pyx_v_compressor) < 0) __PYX_ERR(0, 380, __pyx_L1_error) /* "borg/compress.pyx":378 * name = 'auto' * * def __init__(self, compressor): # <<<<<<<<<<<<<< * super().__init__() * self.compressor = compressor */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("borg.compress.Auto.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/compress.pyx":382 * self.compressor = compressor * * def _decide(self, data): # <<<<<<<<<<<<<< * """ * Decides what to do with *data*. Returns (compressor, compressed_data). */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_4Auto_3_decide(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_8compress_4Auto_2_decide, "\n Decides what to do with *data*. Returns (compressor, compressed_data).\n\n *compressor* is the compressor that is decided to be best suited to compress\n *data*, *compressed_data* is the result of *data* being compressed by a\n compressor, which may or may not be *compressor*!\n\n There are three possible outcomes of the decision process:\n * *data* compresses well enough for trying the more expensive compressor\n set on instantiation to make sense.\n In this case, (expensive_compressor_class, lz4_compressed_data) is\n returned.\n * *data* compresses only slightly using the LZ4 compressor, thus trying\n the more expensive compressor for potentially little gain does not\n make sense.\n In this case, (LZ4_COMPRESSOR, lz4_compressed_data) is returned.\n * *data* does not compress at all using LZ4, in this case\n (NONE_COMPRESSOR, none_compressed_data) is returned.\n\n Note: While it makes no sense, the expensive compressor may well be set\n to the LZ4 compressor.\n "); static PyMethodDef __pyx_mdef_4borg_8compress_4Auto_3_decide = {"_decide", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_4Auto_3_decide, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_8compress_4Auto_2_decide}; static PyObject *__pyx_pw_4borg_8compress_4Auto_3_decide(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_data = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_decide (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_data,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 382, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 382, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("_decide", 1, 2, 2, 1); __PYX_ERR(0, 382, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_decide") < 0)) __PYX_ERR(0, 382, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_data = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_decide", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 382, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.compress.Auto._decide", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_4Auto_2_decide(__pyx_self, __pyx_v_self, __pyx_v_data); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_4Auto_2_decide(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data) { PyObject *__pyx_v_compressor = NULL; PyObject *__pyx_v_compressed_data = NULL; double __pyx_v_ratio; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); Py_ssize_t __pyx_t_7; Py_ssize_t __pyx_t_8; Py_ssize_t __pyx_t_9; int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_decide", 1); /* "borg/compress.pyx":405 * to the LZ4 compressor. * """ * compressor, compressed_data = LZ4_COMPRESSOR.decide_compress(data) # <<<<<<<<<<<<<< * # compressed_data includes the compression type header, while data does not yet * ratio = len(compressed_data) / (len(data) + 2) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_LZ4_COMPRESSOR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_decide_compress); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_data}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 405, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 405, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 405, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_compressor = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_compressed_data = __pyx_t_2; __pyx_t_2 = 0; /* "borg/compress.pyx":407 * compressor, compressed_data = LZ4_COMPRESSOR.decide_compress(data) * # compressed_data includes the compression type header, while data does not yet * ratio = len(compressed_data) / (len(data) + 2) # <<<<<<<<<<<<<< * if ratio < 0.97: * return self.compressor, compressed_data */ __pyx_t_7 = PyObject_Length(__pyx_v_compressed_data); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 407, __pyx_L1_error) __pyx_t_8 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 407, __pyx_L1_error) __pyx_t_9 = (__pyx_t_8 + 2); if (unlikely(__pyx_t_9 == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); __PYX_ERR(0, 407, __pyx_L1_error) } __pyx_v_ratio = (((double)__pyx_t_7) / ((double)__pyx_t_9)); /* "borg/compress.pyx":408 * # compressed_data includes the compression type header, while data does not yet * ratio = len(compressed_data) / (len(data) + 2) * if ratio < 0.97: # <<<<<<<<<<<<<< * return self.compressor, compressed_data * else: */ __pyx_t_10 = (__pyx_v_ratio < 0.97); if (__pyx_t_10) { /* "borg/compress.pyx":409 * ratio = len(compressed_data) / (len(data) + 2) * if ratio < 0.97: * return self.compressor, compressed_data # <<<<<<<<<<<<<< * else: * return compressor, compressed_data */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_compressor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 409, __pyx_L1_error); __Pyx_INCREF(__pyx_v_compressed_data); __Pyx_GIVEREF(__pyx_v_compressed_data); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_compressed_data)) __PYX_ERR(0, 409, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "borg/compress.pyx":408 * # compressed_data includes the compression type header, while data does not yet * ratio = len(compressed_data) / (len(data) + 2) * if ratio < 0.97: # <<<<<<<<<<<<<< * return self.compressor, compressed_data * else: */ } /* "borg/compress.pyx":411 * return self.compressor, compressed_data * else: * return compressor, compressed_data # <<<<<<<<<<<<<< * * def decide(self, data): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_compressor); __Pyx_GIVEREF(__pyx_v_compressor); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_compressor)) __PYX_ERR(0, 411, __pyx_L1_error); __Pyx_INCREF(__pyx_v_compressed_data); __Pyx_GIVEREF(__pyx_v_compressed_data); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_compressed_data)) __PYX_ERR(0, 411, __pyx_L1_error); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } /* "borg/compress.pyx":382 * self.compressor = compressor * * def _decide(self, data): # <<<<<<<<<<<<<< * """ * Decides what to do with *data*. Returns (compressor, compressed_data). */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("borg.compress.Auto._decide", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_compressor); __Pyx_XDECREF(__pyx_v_compressed_data); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/compress.pyx":413 * return compressor, compressed_data * * def decide(self, data): # <<<<<<<<<<<<<< * return self._decide(data)[0] * */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_4Auto_5decide(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8compress_4Auto_5decide = {"decide", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_4Auto_5decide, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8compress_4Auto_5decide(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_data = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("decide (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_data,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 413, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 413, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("decide", 1, 2, 2, 1); __PYX_ERR(0, 413, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "decide") < 0)) __PYX_ERR(0, 413, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_data = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("decide", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 413, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.compress.Auto.decide", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_4Auto_4decide(__pyx_self, __pyx_v_self, __pyx_v_data); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_4Auto_4decide(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("decide", 1); /* "borg/compress.pyx":414 * * def decide(self, data): * return self._decide(data)[0] # <<<<<<<<<<<<<< * * def compress(self, data): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_decide); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_data}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "borg/compress.pyx":413 * return compressor, compressed_data * * def decide(self, data): # <<<<<<<<<<<<<< * return self._decide(data)[0] * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("borg.compress.Auto.decide", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/compress.pyx":416 * return self._decide(data)[0] * * def compress(self, data): # <<<<<<<<<<<<<< * compressor, cheap_compressed_data = self._decide(data) * if compressor in (LZ4_COMPRESSOR, NONE_COMPRESSOR): */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_4Auto_7compress(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8compress_4Auto_7compress = {"compress", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_4Auto_7compress, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8compress_4Auto_7compress(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_data = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("compress (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_data,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 416, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 416, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("compress", 1, 2, 2, 1); __PYX_ERR(0, 416, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "compress") < 0)) __PYX_ERR(0, 416, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_data = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("compress", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 416, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.compress.Auto.compress", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_4Auto_6compress(__pyx_self, __pyx_v_self, __pyx_v_data); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_4Auto_6compress(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data) { PyObject *__pyx_v_compressor = NULL; PyObject *__pyx_v_cheap_compressed_data = NULL; PyObject *__pyx_v_expensive_compressed_data = NULL; double __pyx_v_ratio; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); int __pyx_t_7; int __pyx_t_8; Py_ssize_t __pyx_t_9; Py_ssize_t __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("compress", 1); /* "borg/compress.pyx":417 * * def compress(self, data): * compressor, cheap_compressed_data = self._decide(data) # <<<<<<<<<<<<<< * if compressor in (LZ4_COMPRESSOR, NONE_COMPRESSOR): * # we know that trying to compress with expensive compressor is likely pointless, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_decide); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_data}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 417, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 417, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 417, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_compressor = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_cheap_compressed_data = __pyx_t_3; __pyx_t_3 = 0; /* "borg/compress.pyx":418 * def compress(self, data): * compressor, cheap_compressed_data = self._decide(data) * if compressor in (LZ4_COMPRESSOR, NONE_COMPRESSOR): # <<<<<<<<<<<<<< * # we know that trying to compress with expensive compressor is likely pointless, * # so we fallback to return the cheap compressed data. */ __Pyx_INCREF(__pyx_v_compressor); __pyx_t_1 = __pyx_v_compressor; __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_LZ4_COMPRESSOR); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 418, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 418, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_8) { } else { __pyx_t_7 = __pyx_t_8; goto __pyx_L6_bool_binop_done; } __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_NONE_COMPRESSOR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 418, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 418, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = __pyx_t_8; __pyx_L6_bool_binop_done:; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = __pyx_t_7; if (__pyx_t_8) { /* "borg/compress.pyx":421 * # we know that trying to compress with expensive compressor is likely pointless, * # so we fallback to return the cheap compressed data. * return cheap_compressed_data # <<<<<<<<<<<<<< * # if we get here, the decider decided to try the expensive compressor. * # we also know that the compressed data returned by the decider is lz4 compressed. */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_cheap_compressed_data); __pyx_r = __pyx_v_cheap_compressed_data; goto __pyx_L0; /* "borg/compress.pyx":418 * def compress(self, data): * compressor, cheap_compressed_data = self._decide(data) * if compressor in (LZ4_COMPRESSOR, NONE_COMPRESSOR): # <<<<<<<<<<<<<< * # we know that trying to compress with expensive compressor is likely pointless, * # so we fallback to return the cheap compressed data. */ } /* "borg/compress.pyx":424 * # if we get here, the decider decided to try the expensive compressor. * # we also know that the compressed data returned by the decider is lz4 compressed. * expensive_compressed_data = compressor.compress(data) # <<<<<<<<<<<<<< * ratio = len(expensive_compressed_data) / len(cheap_compressed_data) * if ratio < 0.99: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_compressor, __pyx_n_s_compress); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_data}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_expensive_compressed_data = __pyx_t_1; __pyx_t_1 = 0; /* "borg/compress.pyx":425 * # we also know that the compressed data returned by the decider is lz4 compressed. * expensive_compressed_data = compressor.compress(data) * ratio = len(expensive_compressed_data) / len(cheap_compressed_data) # <<<<<<<<<<<<<< * if ratio < 0.99: * # the expensive compressor managed to squeeze the data significantly better than lz4. */ __pyx_t_9 = PyObject_Length(__pyx_v_expensive_compressed_data); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 425, __pyx_L1_error) __pyx_t_10 = PyObject_Length(__pyx_v_cheap_compressed_data); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 425, __pyx_L1_error) if (unlikely(__pyx_t_10 == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); __PYX_ERR(0, 425, __pyx_L1_error) } __pyx_v_ratio = (((double)__pyx_t_9) / ((double)__pyx_t_10)); /* "borg/compress.pyx":426 * expensive_compressed_data = compressor.compress(data) * ratio = len(expensive_compressed_data) / len(cheap_compressed_data) * if ratio < 0.99: # <<<<<<<<<<<<<< * # the expensive compressor managed to squeeze the data significantly better than lz4. * return expensive_compressed_data */ __pyx_t_8 = (__pyx_v_ratio < 0.99); if (__pyx_t_8) { /* "borg/compress.pyx":428 * if ratio < 0.99: * # the expensive compressor managed to squeeze the data significantly better than lz4. * return expensive_compressed_data # <<<<<<<<<<<<<< * else: * # otherwise let's just store the lz4 data, which decompresses extremely fast. */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_expensive_compressed_data); __pyx_r = __pyx_v_expensive_compressed_data; goto __pyx_L0; /* "borg/compress.pyx":426 * expensive_compressed_data = compressor.compress(data) * ratio = len(expensive_compressed_data) / len(cheap_compressed_data) * if ratio < 0.99: # <<<<<<<<<<<<<< * # the expensive compressor managed to squeeze the data significantly better than lz4. * return expensive_compressed_data */ } /* "borg/compress.pyx":431 * else: * # otherwise let's just store the lz4 data, which decompresses extremely fast. * return cheap_compressed_data # <<<<<<<<<<<<<< * * def decompress(self, data): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_cheap_compressed_data); __pyx_r = __pyx_v_cheap_compressed_data; goto __pyx_L0; } /* "borg/compress.pyx":416 * return self._decide(data)[0] * * def compress(self, data): # <<<<<<<<<<<<<< * compressor, cheap_compressed_data = self._decide(data) * if compressor in (LZ4_COMPRESSOR, NONE_COMPRESSOR): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("borg.compress.Auto.compress", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_compressor); __Pyx_XDECREF(__pyx_v_cheap_compressed_data); __Pyx_XDECREF(__pyx_v_expensive_compressed_data); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/compress.pyx":433 * return cheap_compressed_data * * def decompress(self, data): # <<<<<<<<<<<<<< * raise NotImplementedError * */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_4Auto_9decompress(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8compress_4Auto_9decompress = {"decompress", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_4Auto_9decompress, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8compress_4Auto_9decompress(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_data = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("decompress (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_data,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 433, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 433, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("decompress", 1, 2, 2, 1); __PYX_ERR(0, 433, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "decompress") < 0)) __PYX_ERR(0, 433, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_data = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("decompress", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 433, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.compress.Auto.decompress", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_4Auto_8decompress(__pyx_self, __pyx_v_self, __pyx_v_data); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_4Auto_8decompress(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_data) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("decompress", 1); /* "borg/compress.pyx":434 * * def decompress(self, data): * raise NotImplementedError # <<<<<<<<<<<<<< * * def detect(cls, data): */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(0, 434, __pyx_L1_error) /* "borg/compress.pyx":433 * return cheap_compressed_data * * def decompress(self, data): # <<<<<<<<<<<<<< * raise NotImplementedError * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.compress.Auto.decompress", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/compress.pyx":436 * raise NotImplementedError * * def detect(cls, data): # <<<<<<<<<<<<<< * raise NotImplementedError * */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_4Auto_11detect(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8compress_4Auto_11detect = {"detect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_4Auto_11detect, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8compress_4Auto_11detect(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_cls = 0; CYTHON_UNUSED PyObject *__pyx_v_data = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("detect (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_data,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cls)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 436, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 436, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("detect", 1, 2, 2, 1); __PYX_ERR(0, 436, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "detect") < 0)) __PYX_ERR(0, 436, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_cls = values[0]; __pyx_v_data = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("detect", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 436, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.compress.Auto.detect", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_4Auto_10detect(__pyx_self, __pyx_v_cls, __pyx_v_data); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_4Auto_10detect(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, CYTHON_UNUSED PyObject *__pyx_v_data) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("detect", 1); /* "borg/compress.pyx":437 * * def detect(cls, data): * raise NotImplementedError # <<<<<<<<<<<<<< * * */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(0, 437, __pyx_L1_error) /* "borg/compress.pyx":436 * raise NotImplementedError * * def detect(cls, data): # <<<<<<<<<<<<<< * raise NotImplementedError * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.compress.Auto.detect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/compress.pyx":450 * header_len = len(header_fmt.pack(0)) * * def __init__(self, level=None, compressor=None): # <<<<<<<<<<<<<< * super().__init__() * self.compressor = compressor */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_13ObfuscateSize_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8compress_13ObfuscateSize_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_13ObfuscateSize_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8compress_13ObfuscateSize_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_level = 0; PyObject *__pyx_v_compressor = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_level,&__pyx_n_s_compressor,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 450, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_level); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 450, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_compressor); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 450, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 450, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_level = values[1]; __pyx_v_compressor = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 450, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.compress.ObfuscateSize.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_13ObfuscateSize___init__(__pyx_self, __pyx_v_self, __pyx_v_level, __pyx_v_compressor); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_13ObfuscateSize___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_level, PyObject *__pyx_v_compressor) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "borg/compress.pyx":451 * * def __init__(self, level=None, compressor=None): * super().__init__() # <<<<<<<<<<<<<< * self.compressor = compressor * if level is None: */ __pyx_t_2 = __Pyx_CyFunction_GetClassObj(__pyx_self); if (!__pyx_t_2) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 451, __pyx_L1_error) } __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 451, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self)) __PYX_ERR(0, 451, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/compress.pyx":452 * def __init__(self, level=None, compressor=None): * super().__init__() * self.compressor = compressor # <<<<<<<<<<<<<< * if level is None: * pass # decompression */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_compressor, __pyx_v_compressor) < 0) __PYX_ERR(0, 452, __pyx_L1_error) /* "borg/compress.pyx":453 * super().__init__() * self.compressor = compressor * if level is None: # <<<<<<<<<<<<<< * pass # decompression * elif 1 <= level <= 6: */ __pyx_t_5 = (__pyx_v_level == Py_None); if (__pyx_t_5) { goto __pyx_L3; } /* "borg/compress.pyx":455 * if level is None: * pass # decompression * elif 1 <= level <= 6: # <<<<<<<<<<<<<< * self._obfuscate = self._relative_random_reciprocal_obfuscate * self.factor = 0.001 * 10 ** level */ __pyx_t_1 = PyObject_RichCompare(__pyx_int_1, __pyx_v_level, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 455, __pyx_L1_error) if (__Pyx_PyObject_IsTrue(__pyx_t_1)) { __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = PyObject_RichCompare(__pyx_v_level, __pyx_int_6, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 455, __pyx_L1_error) } __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 455, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { /* "borg/compress.pyx":456 * pass # decompression * elif 1 <= level <= 6: * self._obfuscate = self._relative_random_reciprocal_obfuscate # <<<<<<<<<<<<<< * self.factor = 0.001 * 10 ** level * self.min_r = 0.0001 */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_relative_random_reciprocal_obfu); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_obfuscate, __pyx_t_1) < 0) __PYX_ERR(0, 456, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/compress.pyx":457 * elif 1 <= level <= 6: * self._obfuscate = self._relative_random_reciprocal_obfuscate * self.factor = 0.001 * 10 ** level # <<<<<<<<<<<<<< * self.min_r = 0.0001 * elif 110 <= level <= 123: */ __pyx_t_1 = PyNumber_Power(__pyx_int_10, __pyx_v_level, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyNumber_Multiply(__pyx_float_0_001, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_factor, __pyx_t_3) < 0) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/compress.pyx":458 * self._obfuscate = self._relative_random_reciprocal_obfuscate * self.factor = 0.001 * 10 ** level * self.min_r = 0.0001 # <<<<<<<<<<<<<< * elif 110 <= level <= 123: * self._obfuscate = self._random_padding_obfuscate */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_min_r, __pyx_float_0_0001) < 0) __PYX_ERR(0, 458, __pyx_L1_error) /* "borg/compress.pyx":455 * if level is None: * pass # decompression * elif 1 <= level <= 6: # <<<<<<<<<<<<<< * self._obfuscate = self._relative_random_reciprocal_obfuscate * self.factor = 0.001 * 10 ** level */ goto __pyx_L3; } /* "borg/compress.pyx":459 * self.factor = 0.001 * 10 ** level * self.min_r = 0.0001 * elif 110 <= level <= 123: # <<<<<<<<<<<<<< * self._obfuscate = self._random_padding_obfuscate * self.max_padding_size = 2 ** (level - 100) # 1kiB .. 8MiB */ __pyx_t_3 = PyObject_RichCompare(__pyx_int_110, __pyx_v_level, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 459, __pyx_L1_error) if (__Pyx_PyObject_IsTrue(__pyx_t_3)) { __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = PyObject_RichCompare(__pyx_v_level, __pyx_int_123, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 459, __pyx_L1_error) } __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 459, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_5) { /* "borg/compress.pyx":460 * self.min_r = 0.0001 * elif 110 <= level <= 123: * self._obfuscate = self._random_padding_obfuscate # <<<<<<<<<<<<<< * self.max_padding_size = 2 ** (level - 100) # 1kiB .. 8MiB * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_random_padding_obfuscate); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_obfuscate, __pyx_t_3) < 0) __PYX_ERR(0, 460, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/compress.pyx":461 * elif 110 <= level <= 123: * self._obfuscate = self._random_padding_obfuscate * self.max_padding_size = 2 ** (level - 100) # 1kiB .. 8MiB # <<<<<<<<<<<<<< * * def _obfuscate(self, compr_size): */ __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_level, __pyx_int_100, 0x64, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyNumber_PowerOf2(__pyx_int_2, __pyx_t_3, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_max_padding_size, __pyx_t_1) < 0) __PYX_ERR(0, 461, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/compress.pyx":459 * self.factor = 0.001 * 10 ** level * self.min_r = 0.0001 * elif 110 <= level <= 123: # <<<<<<<<<<<<<< * self._obfuscate = self._random_padding_obfuscate * self.max_padding_size = 2 ** (level - 100) # 1kiB .. 8MiB */ } __pyx_L3:; /* "borg/compress.pyx":450 * header_len = len(header_fmt.pack(0)) * * def __init__(self, level=None, compressor=None): # <<<<<<<<<<<<<< * super().__init__() * self.compressor = compressor */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("borg.compress.ObfuscateSize.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/compress.pyx":463 * self.max_padding_size = 2 ** (level - 100) # 1kiB .. 8MiB * * def _obfuscate(self, compr_size): # <<<<<<<<<<<<<< * # implementations need to return the size of obfuscation data, * # that the caller shall add. */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_13ObfuscateSize_3_obfuscate(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8compress_13ObfuscateSize_3_obfuscate = {"_obfuscate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_13ObfuscateSize_3_obfuscate, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8compress_13ObfuscateSize_3_obfuscate(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_compr_size = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_obfuscate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_compr_size,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 463, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_compr_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 463, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("_obfuscate", 1, 2, 2, 1); __PYX_ERR(0, 463, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_obfuscate") < 0)) __PYX_ERR(0, 463, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_compr_size = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_obfuscate", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 463, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.compress.ObfuscateSize._obfuscate", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_13ObfuscateSize_2_obfuscate(__pyx_self, __pyx_v_self, __pyx_v_compr_size); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_13ObfuscateSize_2_obfuscate(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_compr_size) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_obfuscate", 1); /* "borg/compress.pyx":466 * # implementations need to return the size of obfuscation data, * # that the caller shall add. * raise NotImplemented # <<<<<<<<<<<<<< * * def _relative_random_reciprocal_obfuscate(self, compr_size): */ __Pyx_Raise(__pyx_builtin_NotImplemented, 0, 0, 0); __PYX_ERR(0, 466, __pyx_L1_error) /* "borg/compress.pyx":463 * self.max_padding_size = 2 ** (level - 100) # 1kiB .. 8MiB * * def _obfuscate(self, compr_size): # <<<<<<<<<<<<<< * # implementations need to return the size of obfuscation data, * # that the caller shall add. */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.compress.ObfuscateSize._obfuscate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/compress.pyx":468 * raise NotImplemented * * def _relative_random_reciprocal_obfuscate(self, compr_size): # <<<<<<<<<<<<<< * # effect for SPEC 1: * # f = 0.01 .. 0.1 for r in 1.0 .. 0.1 == in 90% of cases */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_13ObfuscateSize_5_relative_random_reciprocal_obfuscate(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8compress_13ObfuscateSize_5_relative_random_reciprocal_obfuscate = {"_relative_random_reciprocal_obfuscate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_13ObfuscateSize_5_relative_random_reciprocal_obfuscate, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8compress_13ObfuscateSize_5_relative_random_reciprocal_obfuscate(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_compr_size = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_relative_random_reciprocal_obfuscate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_compr_size,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 468, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_compr_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 468, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("_relative_random_reciprocal_obfuscate", 1, 2, 2, 1); __PYX_ERR(0, 468, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_relative_random_reciprocal_obfuscate") < 0)) __PYX_ERR(0, 468, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_compr_size = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_relative_random_reciprocal_obfuscate", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 468, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.compress.ObfuscateSize._relative_random_reciprocal_obfuscate", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_13ObfuscateSize_4_relative_random_reciprocal_obfuscate(__pyx_self, __pyx_v_self, __pyx_v_compr_size); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_13ObfuscateSize_4_relative_random_reciprocal_obfuscate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_compr_size) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_f = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_relative_random_reciprocal_obfuscate", 1); /* "borg/compress.pyx":474 * # f = 1.0 .. 10.0 for r in 0.01 .. 0.001 = in 0.9% of cases * # f = 10.0 .. 100.0 for r in 0.001 .. 0.0001 == in 0.09% of cases * r = max(self.min_r, random.random()) # 0..1, but don't get too close to 0 # <<<<<<<<<<<<<< * f = self.factor / r * return int(compr_size * f) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_random); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_random); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_min_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; } else { __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_r = __pyx_t_1; __pyx_t_1 = 0; /* "borg/compress.pyx":475 * # f = 10.0 .. 100.0 for r in 0.001 .. 0.0001 == in 0.09% of cases * r = max(self.min_r, random.random()) # 0..1, but don't get too close to 0 * f = self.factor / r # <<<<<<<<<<<<<< * return int(compr_size * f) * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_factor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_v_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_f = __pyx_t_2; __pyx_t_2 = 0; /* "borg/compress.pyx":476 * r = max(self.min_r, random.random()) # 0..1, but don't get too close to 0 * f = self.factor / r * return int(compr_size * f) # <<<<<<<<<<<<<< * * def _random_padding_obfuscate(self, compr_size): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyNumber_Multiply(__pyx_v_compr_size, __pyx_v_f); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/compress.pyx":468 * raise NotImplemented * * def _relative_random_reciprocal_obfuscate(self, compr_size): # <<<<<<<<<<<<<< * # effect for SPEC 1: * # f = 0.01 .. 0.1 for r in 1.0 .. 0.1 == in 90% of cases */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("borg.compress.ObfuscateSize._relative_random_reciprocal_obfuscate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_f); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/compress.pyx":478 * return int(compr_size * f) * * def _random_padding_obfuscate(self, compr_size): # <<<<<<<<<<<<<< * return int(self.max_padding_size * random.random()) * */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_13ObfuscateSize_7_random_padding_obfuscate(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8compress_13ObfuscateSize_7_random_padding_obfuscate = {"_random_padding_obfuscate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_13ObfuscateSize_7_random_padding_obfuscate, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8compress_13ObfuscateSize_7_random_padding_obfuscate(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_compr_size = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_random_padding_obfuscate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_compr_size,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 478, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_compr_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 478, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("_random_padding_obfuscate", 1, 2, 2, 1); __PYX_ERR(0, 478, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_random_padding_obfuscate") < 0)) __PYX_ERR(0, 478, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_compr_size = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_random_padding_obfuscate", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 478, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.compress.ObfuscateSize._random_padding_obfuscate", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_13ObfuscateSize_6_random_padding_obfuscate(__pyx_self, __pyx_v_self, __pyx_v_compr_size); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_13ObfuscateSize_6_random_padding_obfuscate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_compr_size) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_random_padding_obfuscate", 1); /* "borg/compress.pyx":479 * * def _random_padding_obfuscate(self, compr_size): * return int(self.max_padding_size * random.random()) # <<<<<<<<<<<<<< * * def compress(self, data): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_max_padding_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_random); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_random); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "borg/compress.pyx":478 * return int(compr_size * f) * * def _random_padding_obfuscate(self, compr_size): # <<<<<<<<<<<<<< * return int(self.max_padding_size * random.random()) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("borg.compress.ObfuscateSize._random_padding_obfuscate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/compress.pyx":481 * return int(self.max_padding_size * random.random()) * * def compress(self, data): # <<<<<<<<<<<<<< * compressed_data = self.compressor.compress(data) # compress data * compr_size = len(compressed_data) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_13ObfuscateSize_9compress(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8compress_13ObfuscateSize_9compress = {"compress", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_13ObfuscateSize_9compress, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8compress_13ObfuscateSize_9compress(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_data = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("compress (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_data,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 481, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 481, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("compress", 1, 2, 2, 1); __PYX_ERR(0, 481, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "compress") < 0)) __PYX_ERR(0, 481, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_data = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("compress", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 481, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.compress.ObfuscateSize.compress", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_13ObfuscateSize_8compress(__pyx_self, __pyx_v_self, __pyx_v_data); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_13ObfuscateSize_8compress(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data) { PyObject *__pyx_v_compressed_data = NULL; PyObject *__pyx_v_compr_size = NULL; PyObject *__pyx_v_header = NULL; PyObject *__pyx_v_addtl_size = NULL; PyObject *__pyx_v_trailer = NULL; PyObject *__pyx_v_obfuscated_data = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; Py_ssize_t __pyx_t_5; long __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("compress", 1); /* "borg/compress.pyx":482 * * def compress(self, data): * compressed_data = self.compressor.compress(data) # compress data # <<<<<<<<<<<<<< * compr_size = len(compressed_data) * header = self.header_fmt.pack(compr_size) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_compressor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_compress); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_data}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_compressed_data = __pyx_t_1; __pyx_t_1 = 0; /* "borg/compress.pyx":483 * def compress(self, data): * compressed_data = self.compressor.compress(data) # compress data * compr_size = len(compressed_data) # <<<<<<<<<<<<<< * header = self.header_fmt.pack(compr_size) * addtl_size = self._obfuscate(compr_size) */ __pyx_t_5 = PyObject_Length(__pyx_v_compressed_data); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 483, __pyx_L1_error) __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_compr_size = __pyx_t_1; __pyx_t_1 = 0; /* "borg/compress.pyx":484 * compressed_data = self.compressor.compress(data) # compress data * compr_size = len(compressed_data) * header = self.header_fmt.pack(compr_size) # <<<<<<<<<<<<<< * addtl_size = self._obfuscate(compr_size) * addtl_size = max(0, addtl_size) # we can only make it longer, not shorter! */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_header_fmt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_pack); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_compr_size}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_header = __pyx_t_1; __pyx_t_1 = 0; /* "borg/compress.pyx":485 * compr_size = len(compressed_data) * header = self.header_fmt.pack(compr_size) * addtl_size = self._obfuscate(compr_size) # <<<<<<<<<<<<<< * addtl_size = max(0, addtl_size) # we can only make it longer, not shorter! * addtl_size = min(MAX_DATA_SIZE - 1024 - compr_size, addtl_size) # stay away from MAX_DATA_SIZE */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_obfuscate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_compr_size}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_addtl_size = __pyx_t_1; __pyx_t_1 = 0; /* "borg/compress.pyx":486 * header = self.header_fmt.pack(compr_size) * addtl_size = self._obfuscate(compr_size) * addtl_size = max(0, addtl_size) # we can only make it longer, not shorter! # <<<<<<<<<<<<<< * addtl_size = min(MAX_DATA_SIZE - 1024 - compr_size, addtl_size) # stay away from MAX_DATA_SIZE * trailer = bytes(addtl_size) */ __Pyx_INCREF(__pyx_v_addtl_size); __pyx_t_1 = __pyx_v_addtl_size; __pyx_t_6 = 0; __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_8) { __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; } else { __pyx_t_7 = __Pyx_PyInt_From_long(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_2 = __pyx_t_7; __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_addtl_size, __pyx_t_1); __pyx_t_1 = 0; /* "borg/compress.pyx":487 * addtl_size = self._obfuscate(compr_size) * addtl_size = max(0, addtl_size) # we can only make it longer, not shorter! * addtl_size = min(MAX_DATA_SIZE - 1024 - compr_size, addtl_size) # stay away from MAX_DATA_SIZE # <<<<<<<<<<<<<< * trailer = bytes(addtl_size) * obfuscated_data = b''.join([header, compressed_data, trailer]) */ __Pyx_INCREF(__pyx_v_addtl_size); __pyx_t_1 = __pyx_v_addtl_size; __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_MAX_DATA_SIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyInt_SubtractObjC(__pyx_t_2, __pyx_int_1024, 0x400, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_Subtract(__pyx_t_7, __pyx_v_compr_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 487, __pyx_L1_error) __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_8) { __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = __pyx_t_1; } else { __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = __pyx_t_2; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_t_7; __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_addtl_size, __pyx_t_1); __pyx_t_1 = 0; /* "borg/compress.pyx":488 * addtl_size = max(0, addtl_size) # we can only make it longer, not shorter! * addtl_size = min(MAX_DATA_SIZE - 1024 - compr_size, addtl_size) # stay away from MAX_DATA_SIZE * trailer = bytes(addtl_size) # <<<<<<<<<<<<<< * obfuscated_data = b''.join([header, compressed_data, trailer]) * return super().compress(obfuscated_data) # add ID header */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), __pyx_v_addtl_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_trailer = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "borg/compress.pyx":489 * addtl_size = min(MAX_DATA_SIZE - 1024 - compr_size, addtl_size) # stay away from MAX_DATA_SIZE * trailer = bytes(addtl_size) * obfuscated_data = b''.join([header, compressed_data, trailer]) # <<<<<<<<<<<<<< * return super().compress(obfuscated_data) # add ID header * */ __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 489, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_header); __Pyx_GIVEREF(__pyx_v_header); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_header)) __PYX_ERR(0, 489, __pyx_L1_error); __Pyx_INCREF(__pyx_v_compressed_data); __Pyx_GIVEREF(__pyx_v_compressed_data); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_v_compressed_data)) __PYX_ERR(0, 489, __pyx_L1_error); __Pyx_INCREF(__pyx_v_trailer); __Pyx_GIVEREF(__pyx_v_trailer); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_v_trailer)) __PYX_ERR(0, 489, __pyx_L1_error); __pyx_t_7 = __Pyx_PyBytes_Join(__pyx_kp_b__5, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 489, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_obfuscated_data = __pyx_t_7; __pyx_t_7 = 0; /* "borg/compress.pyx":490 * trailer = bytes(addtl_size) * obfuscated_data = b''.join([header, compressed_data, trailer]) * return super().compress(obfuscated_data) # add ID header # <<<<<<<<<<<<<< * * def decompress(self, data): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_CyFunction_GetClassObj(__pyx_self); if (!__pyx_t_1) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 490, __pyx_L1_error) } __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 490, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self)) __PYX_ERR(0, 490, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_compress); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_obfuscated_data}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; /* "borg/compress.pyx":481 * return int(self.max_padding_size * random.random()) * * def compress(self, data): # <<<<<<<<<<<<<< * compressed_data = self.compressor.compress(data) # compress data * compr_size = len(compressed_data) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("borg.compress.ObfuscateSize.compress", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_compressed_data); __Pyx_XDECREF(__pyx_v_compr_size); __Pyx_XDECREF(__pyx_v_header); __Pyx_XDECREF(__pyx_v_addtl_size); __Pyx_XDECREF(__pyx_v_trailer); __Pyx_XDECREF(__pyx_v_obfuscated_data); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/compress.pyx":492 * return super().compress(obfuscated_data) # add ID header * * def decompress(self, data): # <<<<<<<<<<<<<< * if not isinstance(data, memoryview): * data = memoryview(data) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_13ObfuscateSize_11decompress(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8compress_13ObfuscateSize_11decompress = {"decompress", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_13ObfuscateSize_11decompress, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8compress_13ObfuscateSize_11decompress(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_data = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("decompress (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_data,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 492, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 492, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("decompress", 1, 2, 2, 1); __PYX_ERR(0, 492, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "decompress") < 0)) __PYX_ERR(0, 492, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_data = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("decompress", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 492, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.compress.ObfuscateSize.decompress", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_13ObfuscateSize_10decompress(__pyx_self, __pyx_v_self, __pyx_v_data); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_13ObfuscateSize_10decompress(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data) { PyObject *__pyx_v_obfuscated_data = NULL; PyObject *__pyx_v_compr_size = NULL; PyObject *__pyx_v_compressed_data = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("decompress", 0); __Pyx_INCREF(__pyx_v_data); /* "borg/compress.pyx":493 * * def decompress(self, data): * if not isinstance(data, memoryview): # <<<<<<<<<<<<<< * data = memoryview(data) * obfuscated_data = super().decompress(data) # remove obfuscator ID header */ __pyx_t_1 = PyMemoryView_Check(__pyx_v_data); __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "borg/compress.pyx":494 * def decompress(self, data): * if not isinstance(data, memoryview): * data = memoryview(data) # <<<<<<<<<<<<<< * obfuscated_data = super().decompress(data) # remove obfuscator ID header * compr_size = self.header_fmt.unpack(obfuscated_data[0:self.header_len])[0] */ __pyx_t_3 = PyMemoryView_FromObject(__pyx_v_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_3); __pyx_t_3 = 0; /* "borg/compress.pyx":493 * * def decompress(self, data): * if not isinstance(data, memoryview): # <<<<<<<<<<<<<< * data = memoryview(data) * obfuscated_data = super().decompress(data) # remove obfuscator ID header */ } /* "borg/compress.pyx":495 * if not isinstance(data, memoryview): * data = memoryview(data) * obfuscated_data = super().decompress(data) # remove obfuscator ID header # <<<<<<<<<<<<<< * compr_size = self.header_fmt.unpack(obfuscated_data[0:self.header_len])[0] * compressed_data = obfuscated_data[self.header_len:self.header_len+compr_size] */ __pyx_t_4 = __Pyx_CyFunction_GetClassObj(__pyx_self); if (!__pyx_t_4) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 495, __pyx_L1_error) } __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(0, 495, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_self)) __PYX_ERR(0, 495, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_decompress); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_data}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_v_obfuscated_data = __pyx_t_3; __pyx_t_3 = 0; /* "borg/compress.pyx":496 * data = memoryview(data) * obfuscated_data = super().decompress(data) # remove obfuscator ID header * compr_size = self.header_fmt.unpack(obfuscated_data[0:self.header_len])[0] # <<<<<<<<<<<<<< * compressed_data = obfuscated_data[self.header_len:self.header_len+compr_size] * if self.compressor is None: */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_header_fmt); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_unpack); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_header_len); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_v_obfuscated_data, 0, 0, NULL, &__pyx_t_5, NULL, 1, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_7}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_compr_size = __pyx_t_4; __pyx_t_4 = 0; /* "borg/compress.pyx":497 * obfuscated_data = super().decompress(data) # remove obfuscator ID header * compr_size = self.header_fmt.unpack(obfuscated_data[0:self.header_len])[0] * compressed_data = obfuscated_data[self.header_len:self.header_len+compr_size] # <<<<<<<<<<<<<< * if self.compressor is None: * self.compressor = Compressor.detect(compressed_data)() */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_header_len); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_header_len); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = PyNumber_Add(__pyx_t_3, __pyx_v_compr_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_obfuscated_data, 0, 0, &__pyx_t_4, &__pyx_t_7, NULL, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_compressed_data = __pyx_t_3; __pyx_t_3 = 0; /* "borg/compress.pyx":498 * compr_size = self.header_fmt.unpack(obfuscated_data[0:self.header_len])[0] * compressed_data = obfuscated_data[self.header_len:self.header_len+compr_size] * if self.compressor is None: # <<<<<<<<<<<<<< * self.compressor = Compressor.detect(compressed_data)() * return self.compressor.decompress(compressed_data) # decompress data */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_compressor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = (__pyx_t_3 == Py_None); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { /* "borg/compress.pyx":499 * compressed_data = obfuscated_data[self.header_len:self.header_len+compr_size] * if self.compressor is None: * self.compressor = Compressor.detect(compressed_data)() # <<<<<<<<<<<<<< * return self.compressor.decompress(compressed_data) # decompress data * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Compressor); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_detect); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_compressed_data}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_compressor, __pyx_t_3) < 0) __PYX_ERR(0, 499, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/compress.pyx":498 * compr_size = self.header_fmt.unpack(obfuscated_data[0:self.header_len])[0] * compressed_data = obfuscated_data[self.header_len:self.header_len+compr_size] * if self.compressor is None: # <<<<<<<<<<<<<< * self.compressor = Compressor.detect(compressed_data)() * return self.compressor.decompress(compressed_data) # decompress data */ } /* "borg/compress.pyx":500 * if self.compressor is None: * self.compressor = Compressor.detect(compressed_data)() * return self.compressor.decompress(compressed_data) # decompress data # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_compressor); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_decompress); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_compressed_data}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "borg/compress.pyx":492 * return super().compress(obfuscated_data) # add ID header * * def decompress(self, data): # <<<<<<<<<<<<<< * if not isinstance(data, memoryview): * data = memoryview(data) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("borg.compress.ObfuscateSize.decompress", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_obfuscated_data); __Pyx_XDECREF(__pyx_v_compr_size); __Pyx_XDECREF(__pyx_v_compressed_data); __Pyx_XDECREF(__pyx_v_data); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/compress.pyx":516 * COMPRESSOR_LIST = [LZ4, ZSTD, CNONE, ZLIB, LZMA, ObfuscateSize, ] # check fast stuff first * * def get_compressor(name, **kwargs): # <<<<<<<<<<<<<< * cls = COMPRESSOR_TABLE[name] * return cls(**kwargs) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_1get_compressor(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8compress_1get_compressor = {"get_compressor", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_1get_compressor, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8compress_1get_compressor(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_kwargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_compressor (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kwargs, values + 0, kwd_pos_args, "get_compressor") < 0)) __PYX_ERR(0, 516, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_name = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_compressor", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 516, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("borg.compress.get_compressor", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_get_compressor(__pyx_self, __pyx_v_name, __pyx_v_kwargs); /* function exit code */ __Pyx_DECREF(__pyx_v_kwargs); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_get_compressor(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name, PyObject *__pyx_v_kwargs) { PyObject *__pyx_v_cls = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_compressor", 1); /* "borg/compress.pyx":517 * * def get_compressor(name, **kwargs): * cls = COMPRESSOR_TABLE[name] # <<<<<<<<<<<<<< * return cls(**kwargs) * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_COMPRESSOR_TABLE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_cls = __pyx_t_2; __pyx_t_2 = 0; /* "borg/compress.pyx":518 * def get_compressor(name, **kwargs): * cls = COMPRESSOR_TABLE[name] * return cls(**kwargs) # <<<<<<<<<<<<<< * * # compressor instances to be used by all other compressors */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_cls, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/compress.pyx":516 * COMPRESSOR_LIST = [LZ4, ZSTD, CNONE, ZLIB, LZMA, ObfuscateSize, ] # check fast stuff first * * def get_compressor(name, **kwargs): # <<<<<<<<<<<<<< * cls = COMPRESSOR_TABLE[name] * return cls(**kwargs) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("borg.compress.get_compressor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_cls); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/compress.pyx":529 * decompresses everything we can handle (autodetect) * """ * def __init__(self, name='null', **kwargs): # <<<<<<<<<<<<<< * self.params = kwargs * self.compressor = get_compressor(name, **self.params) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_10Compressor_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8compress_10Compressor_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_10Compressor_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8compress_10Compressor_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_name = 0; PyObject *__pyx_v_kwargs = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject*)__pyx_n_s_null))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 529, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 529, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kwargs, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 529, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_name = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 529, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("borg.compress.Compressor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_10Compressor___init__(__pyx_self, __pyx_v_self, __pyx_v_name, __pyx_v_kwargs); /* function exit code */ __Pyx_DECREF(__pyx_v_kwargs); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_10Compressor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_kwargs) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "borg/compress.pyx":530 * """ * def __init__(self, name='null', **kwargs): * self.params = kwargs # <<<<<<<<<<<<<< * self.compressor = get_compressor(name, **self.params) * */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_params, __pyx_v_kwargs) < 0) __PYX_ERR(0, 530, __pyx_L1_error) /* "borg/compress.pyx":531 * def __init__(self, name='null', **kwargs): * self.params = kwargs * self.compressor = get_compressor(name, **self.params) # <<<<<<<<<<<<<< * * def compress(self, data): */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_get_compressor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_name)) __PYX_ERR(0, 531, __pyx_L1_error); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_params); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(__pyx_t_4 == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(0, 531, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_t_4))) { __pyx_t_3 = PyDict_Copy(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_compressor, __pyx_t_4) < 0) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "borg/compress.pyx":529 * decompresses everything we can handle (autodetect) * """ * def __init__(self, name='null', **kwargs): # <<<<<<<<<<<<<< * self.params = kwargs * self.compressor = get_compressor(name, **self.params) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("borg.compress.Compressor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/compress.pyx":533 * self.compressor = get_compressor(name, **self.params) * * def compress(self, data): # <<<<<<<<<<<<<< * return self.compressor.compress(data) * */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_10Compressor_3compress(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8compress_10Compressor_3compress = {"compress", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_10Compressor_3compress, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8compress_10Compressor_3compress(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_data = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("compress (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_data,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 533, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 533, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("compress", 1, 2, 2, 1); __PYX_ERR(0, 533, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "compress") < 0)) __PYX_ERR(0, 533, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_data = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("compress", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 533, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.compress.Compressor.compress", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_10Compressor_2compress(__pyx_self, __pyx_v_self, __pyx_v_data); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_10Compressor_2compress(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("compress", 1); /* "borg/compress.pyx":534 * * def compress(self, data): * return self.compressor.compress(data) # <<<<<<<<<<<<<< * * def decompress(self, data): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_compressor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_compress); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_data}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/compress.pyx":533 * self.compressor = get_compressor(name, **self.params) * * def compress(self, data): # <<<<<<<<<<<<<< * return self.compressor.compress(data) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("borg.compress.Compressor.compress", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/compress.pyx":536 * return self.compressor.compress(data) * * def decompress(self, data): # <<<<<<<<<<<<<< * compressor_cls = self.detect(data) * return compressor_cls(**self.params).decompress(data) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_10Compressor_5decompress(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8compress_10Compressor_5decompress = {"decompress", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_10Compressor_5decompress, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8compress_10Compressor_5decompress(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_data = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("decompress (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_data,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 536, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 536, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("decompress", 1, 2, 2, 1); __PYX_ERR(0, 536, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "decompress") < 0)) __PYX_ERR(0, 536, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_data = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("decompress", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 536, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.compress.Compressor.decompress", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_10Compressor_4decompress(__pyx_self, __pyx_v_self, __pyx_v_data); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_10Compressor_4decompress(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data) { PyObject *__pyx_v_compressor_cls = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("decompress", 1); /* "borg/compress.pyx":537 * * def decompress(self, data): * compressor_cls = self.detect(data) # <<<<<<<<<<<<<< * return compressor_cls(**self.params).decompress(data) * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_detect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_data}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_compressor_cls = __pyx_t_1; __pyx_t_1 = 0; /* "borg/compress.pyx":538 * def decompress(self, data): * compressor_cls = self.detect(data) * return compressor_cls(**self.params).decompress(data) # <<<<<<<<<<<<<< * * @staticmethod */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_params); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely(__pyx_t_3 == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(0, 538, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_t_3))) { __pyx_t_2 = PyDict_Copy(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_compressor_cls, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_decompress); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_data}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/compress.pyx":536 * return self.compressor.compress(data) * * def decompress(self, data): # <<<<<<<<<<<<<< * compressor_cls = self.detect(data) * return compressor_cls(**self.params).decompress(data) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("borg.compress.Compressor.decompress", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_compressor_cls); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/compress.pyx":540 * return compressor_cls(**self.params).decompress(data) * * @staticmethod # <<<<<<<<<<<<<< * def detect(data): * hdr = bytes(data[:2]) # detect() does not work with memoryview */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_10Compressor_7detect(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8compress_10Compressor_7detect = {"detect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_10Compressor_7detect, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8compress_10Compressor_7detect(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_data = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("detect (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 540, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "detect") < 0)) __PYX_ERR(0, 540, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_data = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("detect", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 540, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.compress.Compressor.detect", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_10Compressor_6detect(__pyx_self, __pyx_v_data); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_10Compressor_6detect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data) { PyObject *__pyx_v_hdr = NULL; PyObject *__pyx_v_cls = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("detect", 1); /* "borg/compress.pyx":542 * @staticmethod * def detect(data): * hdr = bytes(data[:2]) # detect() does not work with memoryview # <<<<<<<<<<<<<< * for cls in COMPRESSOR_LIST: * if cls.detect(hdr): */ __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_data, 0, 2, NULL, NULL, &__pyx_slice__4, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_hdr = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "borg/compress.pyx":543 * def detect(data): * hdr = bytes(data[:2]) # detect() does not work with memoryview * for cls in COMPRESSOR_LIST: # <<<<<<<<<<<<<< * if cls.detect(hdr): * return cls */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_COMPRESSOR_LIST); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 543, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 543, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 543, __pyx_L1_error) #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 543, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 543, __pyx_L1_error) #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_4(__pyx_t_1); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 543, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_2); } __Pyx_XDECREF_SET(__pyx_v_cls, __pyx_t_2); __pyx_t_2 = 0; /* "borg/compress.pyx":544 * hdr = bytes(data[:2]) # detect() does not work with memoryview * for cls in COMPRESSOR_LIST: * if cls.detect(hdr): # <<<<<<<<<<<<<< * return cls * else: */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_detect); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_hdr}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_8) { /* "borg/compress.pyx":545 * for cls in COMPRESSOR_LIST: * if cls.detect(hdr): * return cls # <<<<<<<<<<<<<< * else: * raise ValueError('No decompressor for this data found: %r.', data[:2]) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_cls); __pyx_r = __pyx_v_cls; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "borg/compress.pyx":544 * hdr = bytes(data[:2]) # detect() does not work with memoryview * for cls in COMPRESSOR_LIST: * if cls.detect(hdr): # <<<<<<<<<<<<<< * return cls * else: */ } /* "borg/compress.pyx":543 * def detect(data): * hdr = bytes(data[:2]) # detect() does not work with memoryview * for cls in COMPRESSOR_LIST: # <<<<<<<<<<<<<< * if cls.detect(hdr): * return cls */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*else*/ { /* "borg/compress.pyx":547 * return cls * else: * raise ValueError('No decompressor for this data found: %r.', data[:2]) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_data, 0, 2, NULL, NULL, &__pyx_slice__4, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_kp_s_No_decompressor_for_this_data_fo); __Pyx_GIVEREF(__pyx_kp_s_No_decompressor_for_this_data_fo); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_s_No_decompressor_for_this_data_fo)) __PYX_ERR(0, 547, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 547, __pyx_L1_error) } /* "borg/compress.pyx":540 * return compressor_cls(**self.params).decompress(data) * * @staticmethod # <<<<<<<<<<<<<< * def detect(data): * hdr = bytes(data[:2]) # detect() does not work with memoryview */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("borg.compress.Compressor.detect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_hdr); __Pyx_XDECREF(__pyx_v_cls); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/compress.pyx":551 * * class CompressionSpec: * def __init__(self, s): # <<<<<<<<<<<<<< * values = s.split(',') * count = len(values) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_15CompressionSpec_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8compress_15CompressionSpec_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_15CompressionSpec_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8compress_15CompressionSpec_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_s = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_s,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 551, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_s)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 551, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 551, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 551, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_s = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 551, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.compress.CompressionSpec.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_15CompressionSpec___init__(__pyx_self, __pyx_v_self, __pyx_v_s); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_15CompressionSpec___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_s) { PyObject *__pyx_v_values = NULL; Py_ssize_t __pyx_v_count; PyObject *__pyx_v_level = NULL; PyObject *__pyx_v_compression = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; Py_ssize_t __pyx_t_5; int __pyx_t_6; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "borg/compress.pyx":552 * class CompressionSpec: * def __init__(self, s): * values = s.split(',') # <<<<<<<<<<<<<< * count = len(values) * if count < 1: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s__6}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_values = __pyx_t_1; __pyx_t_1 = 0; /* "borg/compress.pyx":553 * def __init__(self, s): * values = s.split(',') * count = len(values) # <<<<<<<<<<<<<< * if count < 1: * raise ArgumentTypeError("not enough arguments") */ __pyx_t_5 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 553, __pyx_L1_error) __pyx_v_count = __pyx_t_5; /* "borg/compress.pyx":554 * values = s.split(',') * count = len(values) * if count < 1: # <<<<<<<<<<<<<< * raise ArgumentTypeError("not enough arguments") * # --compression algo[,level] */ __pyx_t_6 = (__pyx_v_count < 1); if (unlikely(__pyx_t_6)) { /* "borg/compress.pyx":555 * count = len(values) * if count < 1: * raise ArgumentTypeError("not enough arguments") # <<<<<<<<<<<<<< * # --compression algo[,level] * self.name = values[0] */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ArgumentTypeError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_not_enough_arguments}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 555, __pyx_L1_error) /* "borg/compress.pyx":554 * values = s.split(',') * count = len(values) * if count < 1: # <<<<<<<<<<<<<< * raise ArgumentTypeError("not enough arguments") * # --compression algo[,level] */ } /* "borg/compress.pyx":557 * raise ArgumentTypeError("not enough arguments") * # --compression algo[,level] * self.name = values[0] # <<<<<<<<<<<<<< * if self.name in ('none', 'lz4', ): * return */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_values, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_name, __pyx_t_1) < 0) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/compress.pyx":558 * # --compression algo[,level] * self.name = values[0] * if self.name in ('none', 'lz4', ): # <<<<<<<<<<<<<< * return * elif self.name in ('zlib', 'lzma', ): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_none, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 558, __pyx_L1_error) if (!__pyx_t_7) { } else { __pyx_t_6 = __pyx_t_7; goto __pyx_L5_bool_binop_done; } __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_lz4, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 558, __pyx_L1_error) __pyx_t_6 = __pyx_t_7; __pyx_L5_bool_binop_done:; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = __pyx_t_6; if (__pyx_t_7) { /* "borg/compress.pyx":559 * self.name = values[0] * if self.name in ('none', 'lz4', ): * return # <<<<<<<<<<<<<< * elif self.name in ('zlib', 'lzma', ): * if count < 2: */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "borg/compress.pyx":558 * # --compression algo[,level] * self.name = values[0] * if self.name in ('none', 'lz4', ): # <<<<<<<<<<<<<< * return * elif self.name in ('zlib', 'lzma', ): */ } /* "borg/compress.pyx":560 * if self.name in ('none', 'lz4', ): * return * elif self.name in ('zlib', 'lzma', ): # <<<<<<<<<<<<<< * if count < 2: * level = 6 # default compression level in py stdlib */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_zlib, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 560, __pyx_L1_error) if (!__pyx_t_6) { } else { __pyx_t_7 = __pyx_t_6; goto __pyx_L7_bool_binop_done; } __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_lzma, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 560, __pyx_L1_error) __pyx_t_7 = __pyx_t_6; __pyx_L7_bool_binop_done:; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __pyx_t_7; if (__pyx_t_6) { /* "borg/compress.pyx":561 * return * elif self.name in ('zlib', 'lzma', ): * if count < 2: # <<<<<<<<<<<<<< * level = 6 # default compression level in py stdlib * elif count == 2: */ __pyx_t_6 = (__pyx_v_count < 2); if (__pyx_t_6) { /* "borg/compress.pyx":562 * elif self.name in ('zlib', 'lzma', ): * if count < 2: * level = 6 # default compression level in py stdlib # <<<<<<<<<<<<<< * elif count == 2: * level = int(values[1]) */ __Pyx_INCREF(__pyx_int_6); __pyx_v_level = __pyx_int_6; /* "borg/compress.pyx":561 * return * elif self.name in ('zlib', 'lzma', ): * if count < 2: # <<<<<<<<<<<<<< * level = 6 # default compression level in py stdlib * elif count == 2: */ goto __pyx_L9; } /* "borg/compress.pyx":563 * if count < 2: * level = 6 # default compression level in py stdlib * elif count == 2: # <<<<<<<<<<<<<< * level = int(values[1]) * if not 0 <= level <= 9: */ __pyx_t_6 = (__pyx_v_count == 2); if (likely(__pyx_t_6)) { /* "borg/compress.pyx":564 * level = 6 # default compression level in py stdlib * elif count == 2: * level = int(values[1]) # <<<<<<<<<<<<<< * if not 0 <= level <= 9: * raise ArgumentTypeError("level must be >= 0 and <= 9") */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_values, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_level = __pyx_t_2; __pyx_t_2 = 0; /* "borg/compress.pyx":565 * elif count == 2: * level = int(values[1]) * if not 0 <= level <= 9: # <<<<<<<<<<<<<< * raise ArgumentTypeError("level must be >= 0 and <= 9") * else: */ __pyx_t_2 = PyObject_RichCompare(__pyx_int_0, __pyx_v_level, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 565, __pyx_L1_error) if (__Pyx_PyObject_IsTrue(__pyx_t_2)) { __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = PyObject_RichCompare(__pyx_v_level, __pyx_int_9, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 565, __pyx_L1_error) } __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 565, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_7 = (!__pyx_t_6); if (unlikely(__pyx_t_7)) { /* "borg/compress.pyx":566 * level = int(values[1]) * if not 0 <= level <= 9: * raise ArgumentTypeError("level must be >= 0 and <= 9") # <<<<<<<<<<<<<< * else: * raise ArgumentTypeError("too many arguments") */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ArgumentTypeError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_level_must_be_0_and_9}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 566, __pyx_L1_error) /* "borg/compress.pyx":565 * elif count == 2: * level = int(values[1]) * if not 0 <= level <= 9: # <<<<<<<<<<<<<< * raise ArgumentTypeError("level must be >= 0 and <= 9") * else: */ } /* "borg/compress.pyx":563 * if count < 2: * level = 6 # default compression level in py stdlib * elif count == 2: # <<<<<<<<<<<<<< * level = int(values[1]) * if not 0 <= level <= 9: */ goto __pyx_L9; } /* "borg/compress.pyx":568 * raise ArgumentTypeError("level must be >= 0 and <= 9") * else: * raise ArgumentTypeError("too many arguments") # <<<<<<<<<<<<<< * self.level = level * elif self.name in ('zstd', ): */ /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ArgumentTypeError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_too_many_arguments}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 568, __pyx_L1_error) } __pyx_L9:; /* "borg/compress.pyx":569 * else: * raise ArgumentTypeError("too many arguments") * self.level = level # <<<<<<<<<<<<<< * elif self.name in ('zstd', ): * if count < 2: */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_level, __pyx_v_level) < 0) __PYX_ERR(0, 569, __pyx_L1_error) /* "borg/compress.pyx":560 * if self.name in ('none', 'lz4', ): * return * elif self.name in ('zlib', 'lzma', ): # <<<<<<<<<<<<<< * if count < 2: * level = 6 # default compression level in py stdlib */ goto __pyx_L4; } /* "borg/compress.pyx":570 * raise ArgumentTypeError("too many arguments") * self.level = level * elif self.name in ('zstd', ): # <<<<<<<<<<<<<< * if count < 2: * level = 3 # default compression level in zstd */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_zstd, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = __pyx_t_7; if (__pyx_t_6) { /* "borg/compress.pyx":571 * self.level = level * elif self.name in ('zstd', ): * if count < 2: # <<<<<<<<<<<<<< * level = 3 # default compression level in zstd * elif count == 2: */ __pyx_t_6 = (__pyx_v_count < 2); if (__pyx_t_6) { /* "borg/compress.pyx":572 * elif self.name in ('zstd', ): * if count < 2: * level = 3 # default compression level in zstd # <<<<<<<<<<<<<< * elif count == 2: * level = int(values[1]) */ __Pyx_INCREF(__pyx_int_3); __pyx_v_level = __pyx_int_3; /* "borg/compress.pyx":571 * self.level = level * elif self.name in ('zstd', ): * if count < 2: # <<<<<<<<<<<<<< * level = 3 # default compression level in zstd * elif count == 2: */ goto __pyx_L11; } /* "borg/compress.pyx":573 * if count < 2: * level = 3 # default compression level in zstd * elif count == 2: # <<<<<<<<<<<<<< * level = int(values[1]) * if not 1 <= level <= 22: */ __pyx_t_6 = (__pyx_v_count == 2); if (likely(__pyx_t_6)) { /* "borg/compress.pyx":574 * level = 3 # default compression level in zstd * elif count == 2: * level = int(values[1]) # <<<<<<<<<<<<<< * if not 1 <= level <= 22: * raise ArgumentTypeError("level must be >= 1 and <= 22") */ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_values, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_level = __pyx_t_1; __pyx_t_1 = 0; /* "borg/compress.pyx":575 * elif count == 2: * level = int(values[1]) * if not 1 <= level <= 22: # <<<<<<<<<<<<<< * raise ArgumentTypeError("level must be >= 1 and <= 22") * else: */ __pyx_t_1 = PyObject_RichCompare(__pyx_int_1, __pyx_v_level, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 575, __pyx_L1_error) if (__Pyx_PyObject_IsTrue(__pyx_t_1)) { __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = PyObject_RichCompare(__pyx_v_level, __pyx_int_22, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 575, __pyx_L1_error) } __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 575, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = (!__pyx_t_6); if (unlikely(__pyx_t_7)) { /* "borg/compress.pyx":576 * level = int(values[1]) * if not 1 <= level <= 22: * raise ArgumentTypeError("level must be >= 1 and <= 22") # <<<<<<<<<<<<<< * else: * raise ArgumentTypeError("too many arguments") */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ArgumentTypeError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_level_must_be_1_and_22}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 576, __pyx_L1_error) /* "borg/compress.pyx":575 * elif count == 2: * level = int(values[1]) * if not 1 <= level <= 22: # <<<<<<<<<<<<<< * raise ArgumentTypeError("level must be >= 1 and <= 22") * else: */ } /* "borg/compress.pyx":573 * if count < 2: * level = 3 # default compression level in zstd * elif count == 2: # <<<<<<<<<<<<<< * level = int(values[1]) * if not 1 <= level <= 22: */ goto __pyx_L11; } /* "borg/compress.pyx":578 * raise ArgumentTypeError("level must be >= 1 and <= 22") * else: * raise ArgumentTypeError("too many arguments") # <<<<<<<<<<<<<< * self.level = level * elif self.name == 'auto': */ /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ArgumentTypeError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_too_many_arguments}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 578, __pyx_L1_error) } __pyx_L11:; /* "borg/compress.pyx":579 * else: * raise ArgumentTypeError("too many arguments") * self.level = level # <<<<<<<<<<<<<< * elif self.name == 'auto': * if 2 <= count <= 3: */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_level, __pyx_v_level) < 0) __PYX_ERR(0, 579, __pyx_L1_error) /* "borg/compress.pyx":570 * raise ArgumentTypeError("too many arguments") * self.level = level * elif self.name in ('zstd', ): # <<<<<<<<<<<<<< * if count < 2: * level = 3 # default compression level in zstd */ goto __pyx_L4; } /* "borg/compress.pyx":580 * raise ArgumentTypeError("too many arguments") * self.level = level * elif self.name == 'auto': # <<<<<<<<<<<<<< * if 2 <= count <= 3: * compression = ','.join(values[1:]) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_auto, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_7) { /* "borg/compress.pyx":581 * self.level = level * elif self.name == 'auto': * if 2 <= count <= 3: # <<<<<<<<<<<<<< * compression = ','.join(values[1:]) * else: */ __pyx_t_7 = (2 <= __pyx_v_count); if (__pyx_t_7) { __pyx_t_7 = (__pyx_v_count <= 3); } if (likely(__pyx_t_7)) { /* "borg/compress.pyx":582 * elif self.name == 'auto': * if 2 <= count <= 3: * compression = ','.join(values[1:]) # <<<<<<<<<<<<<< * else: * raise ArgumentTypeError("bad arguments") */ __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_values, 1, 0, NULL, NULL, &__pyx_slice__7, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_compression = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "borg/compress.pyx":581 * self.level = level * elif self.name == 'auto': * if 2 <= count <= 3: # <<<<<<<<<<<<<< * compression = ','.join(values[1:]) * else: */ goto __pyx_L13; } /* "borg/compress.pyx":584 * compression = ','.join(values[1:]) * else: * raise ArgumentTypeError("bad arguments") # <<<<<<<<<<<<<< * self.inner = CompressionSpec(compression) * elif self.name == 'obfuscate': */ /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ArgumentTypeError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_bad_arguments}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 584, __pyx_L1_error) } __pyx_L13:; /* "borg/compress.pyx":585 * else: * raise ArgumentTypeError("bad arguments") * self.inner = CompressionSpec(compression) # <<<<<<<<<<<<<< * elif self.name == 'obfuscate': * if 3 <= count <= 5: */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_CompressionSpec); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_compression}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_inner, __pyx_t_2) < 0) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/compress.pyx":580 * raise ArgumentTypeError("too many arguments") * self.level = level * elif self.name == 'auto': # <<<<<<<<<<<<<< * if 2 <= count <= 3: * compression = ','.join(values[1:]) */ goto __pyx_L4; } /* "borg/compress.pyx":586 * raise ArgumentTypeError("bad arguments") * self.inner = CompressionSpec(compression) * elif self.name == 'obfuscate': # <<<<<<<<<<<<<< * if 3 <= count <= 5: * level = int(values[1]) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_obfuscate_2, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 586, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (likely(__pyx_t_7)) { /* "borg/compress.pyx":587 * self.inner = CompressionSpec(compression) * elif self.name == 'obfuscate': * if 3 <= count <= 5: # <<<<<<<<<<<<<< * level = int(values[1]) * if not ((1 <= level <= 6) or (110 <= level <= 123)): */ __pyx_t_7 = (3 <= __pyx_v_count); if (__pyx_t_7) { __pyx_t_7 = (__pyx_v_count <= 5); } if (likely(__pyx_t_7)) { /* "borg/compress.pyx":588 * elif self.name == 'obfuscate': * if 3 <= count <= 5: * level = int(values[1]) # <<<<<<<<<<<<<< * if not ((1 <= level <= 6) or (110 <= level <= 123)): * raise ArgumentTypeError("level must be >= 1 and <= 6 or >= 110 and <= 123") */ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_values, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_level = __pyx_t_1; __pyx_t_1 = 0; /* "borg/compress.pyx":589 * if 3 <= count <= 5: * level = int(values[1]) * if not ((1 <= level <= 6) or (110 <= level <= 123)): # <<<<<<<<<<<<<< * raise ArgumentTypeError("level must be >= 1 and <= 6 or >= 110 and <= 123") * self.level = level */ __pyx_t_1 = PyObject_RichCompare(__pyx_int_1, __pyx_v_level, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 589, __pyx_L1_error) if (__Pyx_PyObject_IsTrue(__pyx_t_1)) { __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = PyObject_RichCompare(__pyx_v_level, __pyx_int_6, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 589, __pyx_L1_error) } __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_6) { } else { __pyx_t_7 = __pyx_t_6; goto __pyx_L16_bool_binop_done; } __pyx_t_1 = PyObject_RichCompare(__pyx_int_110, __pyx_v_level, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 589, __pyx_L1_error) if (__Pyx_PyObject_IsTrue(__pyx_t_1)) { __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = PyObject_RichCompare(__pyx_v_level, __pyx_int_123, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 589, __pyx_L1_error) } __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = __pyx_t_6; __pyx_L16_bool_binop_done:; __pyx_t_6 = (!__pyx_t_7); if (unlikely(__pyx_t_6)) { /* "borg/compress.pyx":590 * level = int(values[1]) * if not ((1 <= level <= 6) or (110 <= level <= 123)): * raise ArgumentTypeError("level must be >= 1 and <= 6 or >= 110 and <= 123") # <<<<<<<<<<<<<< * self.level = level * compression = ','.join(values[2:]) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ArgumentTypeError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_level_must_be_1_and_6_or_110_and}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 590, __pyx_L1_error) /* "borg/compress.pyx":589 * if 3 <= count <= 5: * level = int(values[1]) * if not ((1 <= level <= 6) or (110 <= level <= 123)): # <<<<<<<<<<<<<< * raise ArgumentTypeError("level must be >= 1 and <= 6 or >= 110 and <= 123") * self.level = level */ } /* "borg/compress.pyx":591 * if not ((1 <= level <= 6) or (110 <= level <= 123)): * raise ArgumentTypeError("level must be >= 1 and <= 6 or >= 110 and <= 123") * self.level = level # <<<<<<<<<<<<<< * compression = ','.join(values[2:]) * else: */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_level, __pyx_v_level) < 0) __PYX_ERR(0, 591, __pyx_L1_error) /* "borg/compress.pyx":592 * raise ArgumentTypeError("level must be >= 1 and <= 6 or >= 110 and <= 123") * self.level = level * compression = ','.join(values[2:]) # <<<<<<<<<<<<<< * else: * raise ArgumentTypeError("bad arguments") */ __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_values, 2, 0, NULL, NULL, &__pyx_slice_, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_compression = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "borg/compress.pyx":587 * self.inner = CompressionSpec(compression) * elif self.name == 'obfuscate': * if 3 <= count <= 5: # <<<<<<<<<<<<<< * level = int(values[1]) * if not ((1 <= level <= 6) or (110 <= level <= 123)): */ goto __pyx_L14; } /* "borg/compress.pyx":594 * compression = ','.join(values[2:]) * else: * raise ArgumentTypeError("bad arguments") # <<<<<<<<<<<<<< * self.inner = CompressionSpec(compression) * else: */ /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ArgumentTypeError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 594, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_bad_arguments}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 594, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 594, __pyx_L1_error) } __pyx_L14:; /* "borg/compress.pyx":595 * else: * raise ArgumentTypeError("bad arguments") * self.inner = CompressionSpec(compression) # <<<<<<<<<<<<<< * else: * raise ArgumentTypeError("unsupported compression type") */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_CompressionSpec); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 595, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_compression}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 595, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_inner, __pyx_t_2) < 0) __PYX_ERR(0, 595, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/compress.pyx":586 * raise ArgumentTypeError("bad arguments") * self.inner = CompressionSpec(compression) * elif self.name == 'obfuscate': # <<<<<<<<<<<<<< * if 3 <= count <= 5: * level = int(values[1]) */ goto __pyx_L4; } /* "borg/compress.pyx":597 * self.inner = CompressionSpec(compression) * else: * raise ArgumentTypeError("unsupported compression type") # <<<<<<<<<<<<<< * * @property */ /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ArgumentTypeError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_unsupported_compression_type}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 597, __pyx_L1_error) } __pyx_L4:; /* "borg/compress.pyx":551 * * class CompressionSpec: * def __init__(self, s): # <<<<<<<<<<<<<< * values = s.split(',') * count = len(values) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("borg.compress.CompressionSpec.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_values); __Pyx_XDECREF(__pyx_v_level); __Pyx_XDECREF(__pyx_v_compression); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/compress.pyx":599 * raise ArgumentTypeError("unsupported compression type") * * @property # <<<<<<<<<<<<<< * def compressor(self): * if self.name in ('none', 'lz4', ): */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_15CompressionSpec_3compressor(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8compress_15CompressionSpec_3compressor = {"compressor", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_15CompressionSpec_3compressor, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8compress_15CompressionSpec_3compressor(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("compressor (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 599, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "compressor") < 0)) __PYX_ERR(0, 599, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("compressor", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 599, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.compress.CompressionSpec.compressor", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_15CompressionSpec_2compressor(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_15CompressionSpec_2compressor(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("compressor", 1); /* "borg/compress.pyx":601 * @property * def compressor(self): * if self.name in ('none', 'lz4', ): # <<<<<<<<<<<<<< * return get_compressor(self.name) * elif self.name in ('zlib', 'lzma', 'zstd', ): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_none, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 601, __pyx_L1_error) if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_lz4, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 601, __pyx_L1_error) __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __pyx_t_2; if (__pyx_t_3) { /* "borg/compress.pyx":602 * def compressor(self): * if self.name in ('none', 'lz4', ): * return get_compressor(self.name) # <<<<<<<<<<<<<< * elif self.name in ('zlib', 'lzma', 'zstd', ): * return get_compressor(self.name, level=self.level) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_get_compressor); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/compress.pyx":601 * @property * def compressor(self): * if self.name in ('none', 'lz4', ): # <<<<<<<<<<<<<< * return get_compressor(self.name) * elif self.name in ('zlib', 'lzma', 'zstd', ): */ } /* "borg/compress.pyx":603 * if self.name in ('none', 'lz4', ): * return get_compressor(self.name) * elif self.name in ('zlib', 'lzma', 'zstd', ): # <<<<<<<<<<<<<< * return get_compressor(self.name, level=self.level) * elif self.name == 'auto': */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 603, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_zlib, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 603, __pyx_L1_error) if (!__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_lzma, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 603, __pyx_L1_error) if (!__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_zstd, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 603, __pyx_L1_error) __pyx_t_3 = __pyx_t_2; __pyx_L6_bool_binop_done:; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __pyx_t_3; if (__pyx_t_2) { /* "borg/compress.pyx":604 * return get_compressor(self.name) * elif self.name in ('zlib', 'lzma', 'zstd', ): * return get_compressor(self.name, level=self.level) # <<<<<<<<<<<<<< * elif self.name == 'auto': * return get_compressor(self.name, compressor=self.inner.compressor) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_get_compressor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(0, 604, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_level); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_level, __pyx_t_6) < 0) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "borg/compress.pyx":603 * if self.name in ('none', 'lz4', ): * return get_compressor(self.name) * elif self.name in ('zlib', 'lzma', 'zstd', ): # <<<<<<<<<<<<<< * return get_compressor(self.name, level=self.level) * elif self.name == 'auto': */ } /* "borg/compress.pyx":605 * elif self.name in ('zlib', 'lzma', 'zstd', ): * return get_compressor(self.name, level=self.level) * elif self.name == 'auto': # <<<<<<<<<<<<<< * return get_compressor(self.name, compressor=self.inner.compressor) * elif self.name == 'obfuscate': */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_auto, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 605, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_2) { /* "borg/compress.pyx":606 * return get_compressor(self.name, level=self.level) * elif self.name == 'auto': * return get_compressor(self.name, compressor=self.inner.compressor) # <<<<<<<<<<<<<< * elif self.name == 'obfuscate': * return get_compressor(self.name, level=self.level, compressor=self.inner.compressor) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_get_compressor); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(0, 606, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_inner); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_compressor); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_compressor, __pyx_t_8) < 0) __PYX_ERR(0, 606, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L0; /* "borg/compress.pyx":605 * elif self.name in ('zlib', 'lzma', 'zstd', ): * return get_compressor(self.name, level=self.level) * elif self.name == 'auto': # <<<<<<<<<<<<<< * return get_compressor(self.name, compressor=self.inner.compressor) * elif self.name == 'obfuscate': */ } /* "borg/compress.pyx":607 * elif self.name == 'auto': * return get_compressor(self.name, compressor=self.inner.compressor) * elif self.name == 'obfuscate': # <<<<<<<<<<<<<< * return get_compressor(self.name, level=self.level, compressor=self.inner.compressor) */ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_8, __pyx_n_s_obfuscate_2, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_2) { /* "borg/compress.pyx":608 * return get_compressor(self.name, compressor=self.inner.compressor) * elif self.name == 'obfuscate': * return get_compressor(self.name, level=self.level, compressor=self.inner.compressor) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_get_compressor); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(0, 608, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_level); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_level, __pyx_t_6) < 0) __PYX_ERR(0, 608, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_inner); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_compressor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_compressor, __pyx_t_1) < 0) __PYX_ERR(0, 608, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/compress.pyx":607 * elif self.name == 'auto': * return get_compressor(self.name, compressor=self.inner.compressor) * elif self.name == 'obfuscate': # <<<<<<<<<<<<<< * return get_compressor(self.name, level=self.level, compressor=self.inner.compressor) */ } /* "borg/compress.pyx":599 * raise ArgumentTypeError("unsupported compression type") * * @property # <<<<<<<<<<<<<< * def compressor(self): * if self.name in ('none', 'lz4', ): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("borg.compress.CompressionSpec.compressor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __pyx_unpickle_CompressorBase(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_3__pyx_unpickle_CompressorBase(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8compress_3__pyx_unpickle_CompressorBase = {"__pyx_unpickle_CompressorBase", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_3__pyx_unpickle_CompressorBase, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8compress_3__pyx_unpickle_CompressorBase(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v___pyx_type = 0; long __pyx_v___pyx_checksum; PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_unpickle_CompressorBase (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CompressorBase", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CompressorBase", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_CompressorBase") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v___pyx_type = values[0]; __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) __pyx_v___pyx_state = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CompressorBase", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.compress.__pyx_unpickle_CompressorBase", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_2__pyx_unpickle_CompressorBase(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_2__pyx_unpickle_CompressorBase(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_v___pyx_PickleError = 0; PyObject *__pyx_v___pyx_result = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_CompressorBase", 1); /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum not in (0xe3b0c44, 0xda39a3e, 0xd41d8cd): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum */ __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__8, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "(tree fragment)":5 * cdef object __pyx_result * if __pyx_checksum not in (0xe3b0c44, 0xda39a3e, 0xd41d8cd): * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum * __pyx_result = CompressorBase.__new__(__pyx_type) */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_PickleError); __Pyx_GIVEREF(__pyx_n_s_PickleError); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError)) __PYX_ERR(1, 5, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_v___pyx_PickleError = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":6 * if __pyx_checksum not in (0xe3b0c44, 0xda39a3e, 0xd41d8cd): * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum # <<<<<<<<<<<<<< * __pyx_result = CompressorBase.__new__(__pyx_type) * if __pyx_state is not None: */ __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 6, __pyx_L1_error) /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum not in (0xe3b0c44, 0xda39a3e, 0xd41d8cd): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum */ } /* "(tree fragment)":7 * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum * __pyx_result = CompressorBase.__new__(__pyx_type) # <<<<<<<<<<<<<< * if __pyx_state is not None: * __pyx_unpickle_CompressorBase__set_state( __pyx_result, __pyx_state) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_4borg_8compress_CompressorBase), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v___pyx_result = __pyx_t_1; __pyx_t_1 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum * __pyx_result = CompressorBase.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_CompressorBase__set_state( __pyx_result, __pyx_state) * return __pyx_result */ __pyx_t_2 = (__pyx_v___pyx_state != Py_None); if (__pyx_t_2) { /* "(tree fragment)":9 * __pyx_result = CompressorBase.__new__(__pyx_type) * if __pyx_state is not None: * __pyx_unpickle_CompressorBase__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< * return __pyx_result * cdef __pyx_unpickle_CompressorBase__set_state(CompressorBase __pyx_result, tuple __pyx_state): */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 9, __pyx_L1_error) __pyx_t_1 = __pyx_f_4borg_8compress___pyx_unpickle_CompressorBase__set_state(((struct __pyx_obj_4borg_8compress_CompressorBase *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum * __pyx_result = CompressorBase.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_CompressorBase__set_state( __pyx_result, __pyx_state) * return __pyx_result */ } /* "(tree fragment)":10 * if __pyx_state is not None: * __pyx_unpickle_CompressorBase__set_state( __pyx_result, __pyx_state) * return __pyx_result # <<<<<<<<<<<<<< * cdef __pyx_unpickle_CompressorBase__set_state(CompressorBase __pyx_result, tuple __pyx_state): * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v___pyx_result); __pyx_r = __pyx_v___pyx_result; goto __pyx_L0; /* "(tree fragment)":1 * def __pyx_unpickle_CompressorBase(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("borg.compress.__pyx_unpickle_CompressorBase", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v___pyx_PickleError); __Pyx_XDECREF(__pyx_v___pyx_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":11 * __pyx_unpickle_CompressorBase__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_CompressorBase__set_state(CompressorBase __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[0]) */ static PyObject *__pyx_f_4borg_8compress___pyx_unpickle_CompressorBase__set_state(struct __pyx_obj_4borg_8compress_CompressorBase *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Py_ssize_t __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_CompressorBase__set_state", 1); /* "(tree fragment)":12 * return __pyx_result * cdef __pyx_unpickle_CompressorBase__set_state(CompressorBase __pyx_result, tuple __pyx_state): * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[0]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_2 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(1, 12, __pyx_L1_error) __pyx_t_3 = (__pyx_t_2 > 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 12, __pyx_L1_error) __pyx_t_1 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "(tree fragment)":13 * cdef __pyx_unpickle_CompressorBase__set_state(CompressorBase __pyx_result, tuple __pyx_state): * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[0]) # <<<<<<<<<<<<<< */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_update); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 13, __pyx_L1_error) } __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "(tree fragment)":12 * return __pyx_result * cdef __pyx_unpickle_CompressorBase__set_state(CompressorBase __pyx_result, tuple __pyx_state): * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[0]) */ } /* "(tree fragment)":11 * __pyx_unpickle_CompressorBase__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_CompressorBase__set_state(CompressorBase __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[0]) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("borg.compress.__pyx_unpickle_CompressorBase__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __pyx_unpickle_DecidingCompressor(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8compress_5__pyx_unpickle_DecidingCompressor(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8compress_5__pyx_unpickle_DecidingCompressor = {"__pyx_unpickle_DecidingCompressor", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_5__pyx_unpickle_DecidingCompressor, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8compress_5__pyx_unpickle_DecidingCompressor(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v___pyx_type = 0; long __pyx_v___pyx_checksum; PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_unpickle_DecidingCompressor (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_DecidingCompressor", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_DecidingCompressor", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_DecidingCompressor") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v___pyx_type = values[0]; __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) __pyx_v___pyx_state = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_DecidingCompressor", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.compress.__pyx_unpickle_DecidingCompressor", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8compress_4__pyx_unpickle_DecidingCompressor(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8compress_4__pyx_unpickle_DecidingCompressor(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_v___pyx_PickleError = 0; PyObject *__pyx_v___pyx_result = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_DecidingCompressor", 1); /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum not in (0xe3b0c44, 0xda39a3e, 0xd41d8cd): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum */ __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__8, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "(tree fragment)":5 * cdef object __pyx_result * if __pyx_checksum not in (0xe3b0c44, 0xda39a3e, 0xd41d8cd): * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum * __pyx_result = DecidingCompressor.__new__(__pyx_type) */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_PickleError); __Pyx_GIVEREF(__pyx_n_s_PickleError); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError)) __PYX_ERR(1, 5, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_v___pyx_PickleError = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":6 * if __pyx_checksum not in (0xe3b0c44, 0xda39a3e, 0xd41d8cd): * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum # <<<<<<<<<<<<<< * __pyx_result = DecidingCompressor.__new__(__pyx_type) * if __pyx_state is not None: */ __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 6, __pyx_L1_error) /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum not in (0xe3b0c44, 0xda39a3e, 0xd41d8cd): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum */ } /* "(tree fragment)":7 * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum * __pyx_result = DecidingCompressor.__new__(__pyx_type) # <<<<<<<<<<<<<< * if __pyx_state is not None: * __pyx_unpickle_DecidingCompressor__set_state( __pyx_result, __pyx_state) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_4borg_8compress_DecidingCompressor), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v___pyx_result = __pyx_t_1; __pyx_t_1 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum * __pyx_result = DecidingCompressor.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_DecidingCompressor__set_state( __pyx_result, __pyx_state) * return __pyx_result */ __pyx_t_2 = (__pyx_v___pyx_state != Py_None); if (__pyx_t_2) { /* "(tree fragment)":9 * __pyx_result = DecidingCompressor.__new__(__pyx_type) * if __pyx_state is not None: * __pyx_unpickle_DecidingCompressor__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< * return __pyx_result * cdef __pyx_unpickle_DecidingCompressor__set_state(DecidingCompressor __pyx_result, tuple __pyx_state): */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 9, __pyx_L1_error) __pyx_t_1 = __pyx_f_4borg_8compress___pyx_unpickle_DecidingCompressor__set_state(((struct __pyx_obj_4borg_8compress_DecidingCompressor *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum * __pyx_result = DecidingCompressor.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_DecidingCompressor__set_state( __pyx_result, __pyx_state) * return __pyx_result */ } /* "(tree fragment)":10 * if __pyx_state is not None: * __pyx_unpickle_DecidingCompressor__set_state( __pyx_result, __pyx_state) * return __pyx_result # <<<<<<<<<<<<<< * cdef __pyx_unpickle_DecidingCompressor__set_state(DecidingCompressor __pyx_result, tuple __pyx_state): * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v___pyx_result); __pyx_r = __pyx_v___pyx_result; goto __pyx_L0; /* "(tree fragment)":1 * def __pyx_unpickle_DecidingCompressor(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("borg.compress.__pyx_unpickle_DecidingCompressor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v___pyx_PickleError); __Pyx_XDECREF(__pyx_v___pyx_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":11 * __pyx_unpickle_DecidingCompressor__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_DecidingCompressor__set_state(DecidingCompressor __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[0]) */ static PyObject *__pyx_f_4borg_8compress___pyx_unpickle_DecidingCompressor__set_state(struct __pyx_obj_4borg_8compress_DecidingCompressor *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Py_ssize_t __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_DecidingCompressor__set_state", 1); /* "(tree fragment)":12 * return __pyx_result * cdef __pyx_unpickle_DecidingCompressor__set_state(DecidingCompressor __pyx_result, tuple __pyx_state): * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[0]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_2 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(1, 12, __pyx_L1_error) __pyx_t_3 = (__pyx_t_2 > 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 12, __pyx_L1_error) __pyx_t_1 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "(tree fragment)":13 * cdef __pyx_unpickle_DecidingCompressor__set_state(DecidingCompressor __pyx_result, tuple __pyx_state): * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[0]) # <<<<<<<<<<<<<< */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_update); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 13, __pyx_L1_error) } __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "(tree fragment)":12 * return __pyx_result * cdef __pyx_unpickle_DecidingCompressor__set_state(DecidingCompressor __pyx_result, tuple __pyx_state): * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[0]) */ } /* "(tree fragment)":11 * __pyx_unpickle_DecidingCompressor__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_DecidingCompressor__set_state(DecidingCompressor __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[0]) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("borg.compress.__pyx_unpickle_DecidingCompressor__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_4borg_8compress_CompressorBase(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif return o; } static void __pyx_tp_dealloc_4borg_8compress_CompressorBase(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4borg_8compress_CompressorBase) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static PyMethodDef __pyx_methods_4borg_8compress_CompressorBase[] = { {"detect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_14CompressorBase_1detect, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"decide", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_14CompressorBase_5decide, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_8compress_14CompressorBase_4decide}, {"compress", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_14CompressorBase_7compress, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_8compress_14CompressorBase_6compress}, {"decompress", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_14CompressorBase_9decompress, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_8compress_14CompressorBase_8decompress}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_14CompressorBase_11__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_14CompressorBase_13__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_4borg_8compress_CompressorBase_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4borg_8compress_CompressorBase}, {Py_tp_doc, (void *)PyDoc_STR("\n base class for all (de)compression classes,\n also handles compression format auto detection and\n adding/stripping the ID header (which enable auto detection).\n ")}, {Py_tp_methods, (void *)__pyx_methods_4borg_8compress_CompressorBase}, {Py_tp_init, (void *)__pyx_pw_4borg_8compress_14CompressorBase_3__init__}, {Py_tp_new, (void *)__pyx_tp_new_4borg_8compress_CompressorBase}, {0, 0}, }; static PyType_Spec __pyx_type_4borg_8compress_CompressorBase_spec = { "borg.compress.CompressorBase", sizeof(struct __pyx_obj_4borg_8compress_CompressorBase), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_4borg_8compress_CompressorBase_slots, }; #else static PyTypeObject __pyx_type_4borg_8compress_CompressorBase = { PyVarObject_HEAD_INIT(0, 0) "borg.compress.""CompressorBase", /*tp_name*/ sizeof(struct __pyx_obj_4borg_8compress_CompressorBase), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4borg_8compress_CompressorBase, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ PyDoc_STR("\n base class for all (de)compression classes,\n also handles compression format auto detection and\n adding/stripping the ID header (which enable auto detection).\n "), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_4borg_8compress_CompressorBase, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_4borg_8compress_14CompressorBase_3__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4borg_8compress_CompressorBase, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyMethodDef __pyx_methods_4borg_8compress_DecidingCompressor[] = { {"_decide", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_18DecidingCompressor_3_decide, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_8compress_18DecidingCompressor_2_decide}, {"decide", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_18DecidingCompressor_5decide, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"decide_compress", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_18DecidingCompressor_7decide_compress, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_8compress_18DecidingCompressor_6decide_compress}, {"compress", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_18DecidingCompressor_9compress, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_18DecidingCompressor_11__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8compress_18DecidingCompressor_13__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_4borg_8compress_DecidingCompressor_slots[] = { {Py_tp_doc, (void *)PyDoc_STR("\n base class for (de)compression classes that (based on an internal _decide\n method) decide whether and how to compress data.\n ")}, {Py_tp_methods, (void *)__pyx_methods_4borg_8compress_DecidingCompressor}, {Py_tp_init, (void *)__pyx_pw_4borg_8compress_18DecidingCompressor_1__init__}, {Py_tp_new, (void *)__pyx_tp_new_4borg_8compress_CompressorBase}, {0, 0}, }; static PyType_Spec __pyx_type_4borg_8compress_DecidingCompressor_spec = { "borg.compress.DecidingCompressor", sizeof(struct __pyx_obj_4borg_8compress_DecidingCompressor), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_4borg_8compress_DecidingCompressor_slots, }; #else static PyTypeObject __pyx_type_4borg_8compress_DecidingCompressor = { PyVarObject_HEAD_INIT(0, 0) "borg.compress.""DecidingCompressor", /*tp_name*/ sizeof(struct __pyx_obj_4borg_8compress_DecidingCompressor), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4borg_8compress_CompressorBase, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ PyDoc_STR("\n base class for (de)compression classes that (based on an internal _decide\n method) decide whether and how to compress data.\n "), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_4borg_8compress_DecidingCompressor, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_4borg_8compress_18DecidingCompressor_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4borg_8compress_CompressorBase, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_1_4_01, __pyx_k_1_4_01, sizeof(__pyx_k_1_4_01), 0, 0, 1, 0}, {&__pyx_n_s_API_VERSION, __pyx_k_API_VERSION, sizeof(__pyx_k_API_VERSION), 0, 0, 1, 1}, {&__pyx_n_s_ArgumentTypeError, __pyx_k_ArgumentTypeError, sizeof(__pyx_k_ArgumentTypeError), 0, 0, 1, 1}, {&__pyx_n_s_Auto, __pyx_k_Auto, sizeof(__pyx_k_Auto), 0, 0, 1, 1}, {&__pyx_n_s_Auto___init, __pyx_k_Auto___init, sizeof(__pyx_k_Auto___init), 0, 0, 1, 1}, {&__pyx_n_s_Auto__decide, __pyx_k_Auto__decide, sizeof(__pyx_k_Auto__decide), 0, 0, 1, 1}, {&__pyx_n_s_Auto_compress, __pyx_k_Auto_compress, sizeof(__pyx_k_Auto_compress), 0, 0, 1, 1}, {&__pyx_n_s_Auto_decide, __pyx_k_Auto_decide, sizeof(__pyx_k_Auto_decide), 0, 0, 1, 1}, {&__pyx_n_s_Auto_decompress, __pyx_k_Auto_decompress, sizeof(__pyx_k_Auto_decompress), 0, 0, 1, 1}, {&__pyx_n_s_Auto_detect, __pyx_k_Auto_detect, sizeof(__pyx_k_Auto_detect), 0, 0, 1, 1}, {&__pyx_n_s_Buffer, __pyx_k_Buffer, sizeof(__pyx_k_Buffer), 0, 0, 1, 1}, {&__pyx_n_s_CHECK_NONE, __pyx_k_CHECK_NONE, sizeof(__pyx_k_CHECK_NONE), 0, 0, 1, 1}, {&__pyx_n_s_CNONE, __pyx_k_CNONE, sizeof(__pyx_k_CNONE), 0, 0, 1, 1}, {&__pyx_n_s_CNONE_compress, __pyx_k_CNONE_compress, sizeof(__pyx_k_CNONE_compress), 0, 0, 1, 1}, {&__pyx_n_s_CNONE_decompress, __pyx_k_CNONE_decompress, sizeof(__pyx_k_CNONE_decompress), 0, 0, 1, 1}, {&__pyx_n_s_COMPRESSOR_LIST, __pyx_k_COMPRESSOR_LIST, sizeof(__pyx_k_COMPRESSOR_LIST), 0, 0, 1, 1}, {&__pyx_n_s_COMPRESSOR_TABLE, __pyx_k_COMPRESSOR_TABLE, sizeof(__pyx_k_COMPRESSOR_TABLE), 0, 0, 1, 1}, {&__pyx_n_s_CompressionSpec, __pyx_k_CompressionSpec, sizeof(__pyx_k_CompressionSpec), 0, 0, 1, 1}, {&__pyx_n_s_CompressionSpec___init, __pyx_k_CompressionSpec___init, sizeof(__pyx_k_CompressionSpec___init), 0, 0, 1, 1}, {&__pyx_n_s_CompressionSpec_compressor, __pyx_k_CompressionSpec_compressor, sizeof(__pyx_k_CompressionSpec_compressor), 0, 0, 1, 1}, {&__pyx_n_s_Compressor, __pyx_k_Compressor, sizeof(__pyx_k_Compressor), 0, 0, 1, 1}, {&__pyx_n_s_CompressorBase, __pyx_k_CompressorBase, sizeof(__pyx_k_CompressorBase), 0, 0, 1, 1}, {&__pyx_n_s_CompressorBase___reduce_cython, __pyx_k_CompressorBase___reduce_cython, sizeof(__pyx_k_CompressorBase___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_CompressorBase___setstate_cython, __pyx_k_CompressorBase___setstate_cython, sizeof(__pyx_k_CompressorBase___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_CompressorBase_compress, __pyx_k_CompressorBase_compress, sizeof(__pyx_k_CompressorBase_compress), 0, 0, 1, 1}, {&__pyx_n_s_CompressorBase_decide, __pyx_k_CompressorBase_decide, sizeof(__pyx_k_CompressorBase_decide), 0, 0, 1, 1}, {&__pyx_n_s_CompressorBase_decompress, __pyx_k_CompressorBase_decompress, sizeof(__pyx_k_CompressorBase_decompress), 0, 0, 1, 1}, {&__pyx_n_s_CompressorBase_detect, __pyx_k_CompressorBase_detect, sizeof(__pyx_k_CompressorBase_detect), 0, 0, 1, 1}, {&__pyx_n_s_Compressor___init, __pyx_k_Compressor___init, sizeof(__pyx_k_Compressor___init), 0, 0, 1, 1}, {&__pyx_n_s_Compressor_compress, __pyx_k_Compressor_compress, sizeof(__pyx_k_Compressor_compress), 0, 0, 1, 1}, {&__pyx_n_s_Compressor_decompress, __pyx_k_Compressor_decompress, sizeof(__pyx_k_Compressor_decompress), 0, 0, 1, 1}, {&__pyx_n_s_Compressor_detect, __pyx_k_Compressor_detect, sizeof(__pyx_k_Compressor_detect), 0, 0, 1, 1}, {&__pyx_n_s_DecidingCompressor, __pyx_k_DecidingCompressor, sizeof(__pyx_k_DecidingCompressor), 0, 0, 1, 1}, {&__pyx_n_s_DecidingCompressor___reduce_cyth, __pyx_k_DecidingCompressor___reduce_cyth, sizeof(__pyx_k_DecidingCompressor___reduce_cyth), 0, 0, 1, 1}, {&__pyx_n_s_DecidingCompressor___setstate_cy, __pyx_k_DecidingCompressor___setstate_cy, sizeof(__pyx_k_DecidingCompressor___setstate_cy), 0, 0, 1, 1}, {&__pyx_n_s_DecidingCompressor__decide, __pyx_k_DecidingCompressor__decide, sizeof(__pyx_k_DecidingCompressor__decide), 0, 0, 1, 1}, {&__pyx_n_s_DecidingCompressor_compress, __pyx_k_DecidingCompressor_compress, sizeof(__pyx_k_DecidingCompressor_compress), 0, 0, 1, 1}, {&__pyx_n_s_DecidingCompressor_decide, __pyx_k_DecidingCompressor_decide, sizeof(__pyx_k_DecidingCompressor_decide), 0, 0, 1, 1}, {&__pyx_n_s_DecidingCompressor_decide_compre, __pyx_k_DecidingCompressor_decide_compre, sizeof(__pyx_k_DecidingCompressor_decide_compre), 0, 0, 1, 1}, {&__pyx_n_s_DecompressionError, __pyx_k_DecompressionError, sizeof(__pyx_k_DecompressionError), 0, 0, 1, 1}, {&__pyx_kp_s_I, __pyx_k_I, sizeof(__pyx_k_I), 0, 0, 1, 0}, {&__pyx_n_s_ID, __pyx_k_ID, sizeof(__pyx_k_ID), 0, 0, 1, 1}, {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0}, {&__pyx_n_s_LZ4, __pyx_k_LZ4, sizeof(__pyx_k_LZ4), 0, 0, 1, 1}, {&__pyx_n_s_LZ4_COMPRESSOR, __pyx_k_LZ4_COMPRESSOR, sizeof(__pyx_k_LZ4_COMPRESSOR), 0, 0, 1, 1}, {&__pyx_n_s_LZ4___init, __pyx_k_LZ4___init, sizeof(__pyx_k_LZ4___init), 0, 0, 1, 1}, {&__pyx_n_s_LZ4__decide, __pyx_k_LZ4__decide, sizeof(__pyx_k_LZ4__decide), 0, 0, 1, 1}, {&__pyx_n_s_LZ4_decompress, __pyx_k_LZ4_decompress, sizeof(__pyx_k_LZ4_decompress), 0, 0, 1, 1}, {&__pyx_n_s_LZMA, __pyx_k_LZMA, sizeof(__pyx_k_LZMA), 0, 0, 1, 1}, {&__pyx_n_s_LZMAError, __pyx_k_LZMAError, sizeof(__pyx_k_LZMAError), 0, 0, 1, 1}, {&__pyx_n_s_LZMA___init, __pyx_k_LZMA___init, sizeof(__pyx_k_LZMA___init), 0, 0, 1, 1}, {&__pyx_n_s_LZMA__decide, __pyx_k_LZMA__decide, sizeof(__pyx_k_LZMA__decide), 0, 0, 1, 1}, {&__pyx_n_s_LZMA_decompress, __pyx_k_LZMA_decompress, sizeof(__pyx_k_LZMA_decompress), 0, 0, 1, 1}, {&__pyx_n_s_MAX_DATA_SIZE, __pyx_k_MAX_DATA_SIZE, sizeof(__pyx_k_MAX_DATA_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, {&__pyx_kp_s_Meta_Compressor_that_decides_wh, __pyx_k_Meta_Compressor_that_decides_wh, sizeof(__pyx_k_Meta_Compressor_that_decides_wh), 0, 0, 1, 0}, {&__pyx_kp_s_Meta_Compressor_that_obfuscates, __pyx_k_Meta_Compressor_that_obfuscates, sizeof(__pyx_k_Meta_Compressor_that_obfuscates), 0, 0, 1, 0}, {&__pyx_n_s_NONE_COMPRESSOR, __pyx_k_NONE_COMPRESSOR, sizeof(__pyx_k_NONE_COMPRESSOR), 0, 0, 1, 1}, {&__pyx_kp_s_No_decompressor_for_this_data_fo, __pyx_k_No_decompressor_for_this_data_fo, sizeof(__pyx_k_No_decompressor_for_this_data_fo), 0, 0, 1, 0}, {&__pyx_kp_s_No_lzma_support_found, __pyx_k_No_lzma_support_found, sizeof(__pyx_k_No_lzma_support_found), 0, 0, 1, 0}, {&__pyx_n_s_NotImplemented, __pyx_k_NotImplemented, sizeof(__pyx_k_NotImplemented), 0, 0, 1, 1}, {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1}, {&__pyx_n_s_ObfuscateSize, __pyx_k_ObfuscateSize, sizeof(__pyx_k_ObfuscateSize), 0, 0, 1, 1}, {&__pyx_n_s_ObfuscateSize___init, __pyx_k_ObfuscateSize___init, sizeof(__pyx_k_ObfuscateSize___init), 0, 0, 1, 1}, {&__pyx_n_s_ObfuscateSize__obfuscate, __pyx_k_ObfuscateSize__obfuscate, sizeof(__pyx_k_ObfuscateSize__obfuscate), 0, 0, 1, 1}, {&__pyx_n_s_ObfuscateSize__random_padding_ob, __pyx_k_ObfuscateSize__random_padding_ob, sizeof(__pyx_k_ObfuscateSize__random_padding_ob), 0, 0, 1, 1}, {&__pyx_n_s_ObfuscateSize__relative_random_r, __pyx_k_ObfuscateSize__relative_random_r, sizeof(__pyx_k_ObfuscateSize__relative_random_r), 0, 0, 1, 1}, {&__pyx_n_s_ObfuscateSize_compress, __pyx_k_ObfuscateSize_compress, sizeof(__pyx_k_ObfuscateSize_compress), 0, 0, 1, 1}, {&__pyx_n_s_ObfuscateSize_decompress, __pyx_k_ObfuscateSize_decompress, sizeof(__pyx_k_ObfuscateSize_decompress), 0, 0, 1, 1}, {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1}, {&__pyx_n_s_Struct, __pyx_k_Struct, sizeof(__pyx_k_Struct), 0, 0, 1, 1}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_n_s_ZLIB, __pyx_k_ZLIB, sizeof(__pyx_k_ZLIB), 0, 0, 1, 1}, {&__pyx_n_s_ZLIB___init, __pyx_k_ZLIB___init, sizeof(__pyx_k_ZLIB___init), 0, 0, 1, 1}, {&__pyx_n_s_ZLIB_compress, __pyx_k_ZLIB_compress, sizeof(__pyx_k_ZLIB_compress), 0, 0, 1, 1}, {&__pyx_n_s_ZLIB_decompress, __pyx_k_ZLIB_decompress, sizeof(__pyx_k_ZLIB_decompress), 0, 0, 1, 1}, {&__pyx_n_s_ZLIB_detect, __pyx_k_ZLIB_detect, sizeof(__pyx_k_ZLIB_detect), 0, 0, 1, 1}, {&__pyx_n_s_ZSTD, __pyx_k_ZSTD, sizeof(__pyx_k_ZSTD), 0, 0, 1, 1}, {&__pyx_n_s_ZSTD___init, __pyx_k_ZSTD___init, sizeof(__pyx_k_ZSTD___init), 0, 0, 1, 1}, {&__pyx_n_s_ZSTD__decide, __pyx_k_ZSTD__decide, sizeof(__pyx_k_ZSTD__decide), 0, 0, 1, 1}, {&__pyx_n_s_ZSTD_decompress, __pyx_k_ZSTD_decompress, sizeof(__pyx_k_ZSTD_decompress), 0, 0, 1, 1}, {&__pyx_n_s__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 0, 1, 1}, {&__pyx_n_s__100, __pyx_k__100, sizeof(__pyx_k__100), 0, 0, 1, 1}, {&__pyx_kp_b__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 0, 0, 0}, {&__pyx_kp_b__29, __pyx_k__29, sizeof(__pyx_k__29), 0, 0, 0, 0}, {&__pyx_kp_b__32, __pyx_k__32, sizeof(__pyx_k__32), 0, 0, 0, 0}, {&__pyx_kp_b__39, __pyx_k__39, sizeof(__pyx_k__39), 0, 0, 0, 0}, {&__pyx_kp_b__47, __pyx_k__47, sizeof(__pyx_k__47), 0, 0, 0, 0}, {&__pyx_kp_b__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 0, 0}, {&__pyx_kp_b__53, __pyx_k__53, sizeof(__pyx_k__53), 0, 0, 0, 0}, {&__pyx_kp_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 0}, {&__pyx_kp_b__68, __pyx_k__68, sizeof(__pyx_k__68), 0, 0, 0, 0}, {&__pyx_kp_u__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 1, 0, 0}, {&__pyx_n_s_addtl_size, __pyx_k_addtl_size, sizeof(__pyx_k_addtl_size), 0, 0, 1, 1}, {&__pyx_n_s_argparse, __pyx_k_argparse, sizeof(__pyx_k_argparse), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_auto, __pyx_k_auto, sizeof(__pyx_k_auto), 0, 0, 1, 1}, {&__pyx_kp_s_bad_arguments, __pyx_k_bad_arguments, sizeof(__pyx_k_bad_arguments), 0, 0, 1, 0}, {&__pyx_n_s_baseclass, __pyx_k_baseclass, sizeof(__pyx_k_baseclass), 0, 0, 1, 1}, {&__pyx_n_s_borg_compress, __pyx_k_borg_compress, sizeof(__pyx_k_borg_compress), 0, 0, 1, 1}, {&__pyx_n_s_buf, __pyx_k_buf, sizeof(__pyx_k_buf), 0, 0, 1, 1}, {&__pyx_n_s_buffer, __pyx_k_buffer, sizeof(__pyx_k_buffer), 0, 0, 1, 1}, {&__pyx_n_s_cheap_compressed_data, __pyx_k_cheap_compressed_data, sizeof(__pyx_k_cheap_compressed_data), 0, 0, 1, 1}, {&__pyx_n_s_check, __pyx_k_check, sizeof(__pyx_k_check), 0, 0, 1, 1}, {&__pyx_n_s_check_ok, __pyx_k_check_ok, sizeof(__pyx_k_check_ok), 0, 0, 1, 1}, {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_cls, __pyx_k_cls, sizeof(__pyx_k_cls), 0, 0, 1, 1}, {&__pyx_n_s_cmf, __pyx_k_cmf, sizeof(__pyx_k_cmf), 0, 0, 1, 1}, {&__pyx_n_s_compr_size, __pyx_k_compr_size, sizeof(__pyx_k_compr_size), 0, 0, 1, 1}, {&__pyx_n_s_compress, __pyx_k_compress, sizeof(__pyx_k_compress), 0, 0, 1, 1}, {&__pyx_n_s_compressed_data, __pyx_k_compressed_data, sizeof(__pyx_k_compressed_data), 0, 0, 1, 1}, {&__pyx_kp_s_compresses_using_a_compressor_w, __pyx_k_compresses_using_a_compressor_w, sizeof(__pyx_k_compresses_using_a_compressor_w), 0, 0, 1, 0}, {&__pyx_n_s_compression, __pyx_k_compression, sizeof(__pyx_k_compression), 0, 0, 1, 1}, {&__pyx_n_s_compressor, __pyx_k_compressor, sizeof(__pyx_k_compressor), 0, 0, 1, 1}, {&__pyx_n_s_compressor_cls, __pyx_k_compressor_cls, sizeof(__pyx_k_compressor_cls), 0, 0, 1, 1}, {&__pyx_n_s_constants, __pyx_k_constants, sizeof(__pyx_k_constants), 0, 0, 1, 1}, {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1}, {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, {&__pyx_n_s_decide, __pyx_k_decide, sizeof(__pyx_k_decide), 0, 0, 1, 1}, {&__pyx_n_s_decide_2, __pyx_k_decide_2, sizeof(__pyx_k_decide_2), 0, 0, 1, 1}, {&__pyx_n_s_decide_compress, __pyx_k_decide_compress, sizeof(__pyx_k_decide_compress), 0, 0, 1, 1}, {&__pyx_n_s_decidebaseclass, __pyx_k_decidebaseclass, sizeof(__pyx_k_decidebaseclass), 0, 0, 1, 1}, {&__pyx_n_s_decompress, __pyx_k_decompress, sizeof(__pyx_k_decompress), 0, 0, 1, 1}, {&__pyx_n_s_dest, __pyx_k_dest, sizeof(__pyx_k_dest), 0, 0, 1, 1}, {&__pyx_n_s_detect, __pyx_k_detect, sizeof(__pyx_k_detect), 0, 0, 1, 1}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1}, {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1}, {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_expensive_compressed_data, __pyx_k_expensive_compressed_data, sizeof(__pyx_k_expensive_compressed_data), 0, 0, 1, 1}, {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1}, {&__pyx_n_s_factor, __pyx_k_factor, sizeof(__pyx_k_factor), 0, 0, 1, 1}, {&__pyx_n_s_flg, __pyx_k_flg, sizeof(__pyx_k_flg), 0, 0, 1, 1}, {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, {&__pyx_n_s_get_compressor, __pyx_k_get_compressor, sizeof(__pyx_k_get_compressor), 0, 0, 1, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_n_s_hdr, __pyx_k_hdr, sizeof(__pyx_k_hdr), 0, 0, 1, 1}, {&__pyx_n_s_header, __pyx_k_header, sizeof(__pyx_k_header), 0, 0, 1, 1}, {&__pyx_n_s_header_fmt, __pyx_k_header_fmt, sizeof(__pyx_k_header_fmt), 0, 0, 1, 1}, {&__pyx_n_s_header_len, __pyx_k_header_len, sizeof(__pyx_k_header_len), 0, 0, 1, 1}, {&__pyx_n_s_helpers, __pyx_k_helpers, sizeof(__pyx_k_helpers), 0, 0, 1, 1}, {&__pyx_n_s_idata, __pyx_k_idata, sizeof(__pyx_k_idata), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_inner, __pyx_k_inner, sizeof(__pyx_k_inner), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_n_s_is_deflate, __pyx_k_is_deflate, sizeof(__pyx_k_is_deflate), 0, 0, 1, 1}, {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, {&__pyx_n_s_isize, __pyx_k_isize, sizeof(__pyx_k_isize), 0, 0, 1, 1}, {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1}, {&__pyx_n_s_level, __pyx_k_level, sizeof(__pyx_k_level), 0, 0, 1, 1}, {&__pyx_kp_s_level_must_be_0_and_9, __pyx_k_level_must_be_0_and_9, sizeof(__pyx_k_level_must_be_0_and_9), 0, 0, 1, 0}, {&__pyx_kp_s_level_must_be_1_and_22, __pyx_k_level_must_be_1_and_22, sizeof(__pyx_k_level_must_be_1_and_22), 0, 0, 1, 0}, {&__pyx_kp_s_level_must_be_1_and_6_or_110_and, __pyx_k_level_must_be_1_and_6_or_110_and, sizeof(__pyx_k_level_must_be_1_and_6_or_110_and), 0, 0, 1, 0}, {&__pyx_n_s_lz4, __pyx_k_lz4, sizeof(__pyx_k_lz4), 0, 0, 1, 1}, {&__pyx_kp_s_lz4_compress_failed, __pyx_k_lz4_compress_failed, sizeof(__pyx_k_lz4_compress_failed), 0, 0, 1, 0}, {&__pyx_kp_s_lz4_decompress_failed, __pyx_k_lz4_decompress_failed, sizeof(__pyx_k_lz4_decompress_failed), 0, 0, 1, 0}, {&__pyx_n_s_lzma, __pyx_k_lzma, sizeof(__pyx_k_lzma), 0, 0, 1, 1}, {&__pyx_kp_s_lzma_compression_decompression, __pyx_k_lzma_compression_decompression, sizeof(__pyx_k_lzma_compression_decompression), 0, 0, 1, 0}, {&__pyx_n_s_lzma_data, __pyx_k_lzma_data, sizeof(__pyx_k_lzma_data), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_max_padding_size, __pyx_k_max_padding_size, sizeof(__pyx_k_max_padding_size), 0, 0, 1, 1}, {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, {&__pyx_n_s_min_r, __pyx_k_min_r, sizeof(__pyx_k_min_r), 0, 0, 1, 1}, {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, {&__pyx_n_s_mro_entries, __pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, {&__pyx_n_s_none, __pyx_k_none, sizeof(__pyx_k_none), 0, 0, 1, 1}, {&__pyx_kp_s_none_no_compression_just_pass_t, __pyx_k_none_no_compression_just_pass_t, sizeof(__pyx_k_none_no_compression_just_pass_t), 0, 0, 1, 0}, {&__pyx_kp_s_not_enough_arguments, __pyx_k_not_enough_arguments, sizeof(__pyx_k_not_enough_arguments), 0, 0, 1, 0}, {&__pyx_n_s_null, __pyx_k_null, sizeof(__pyx_k_null), 0, 0, 1, 1}, {&__pyx_n_s_obfuscate, __pyx_k_obfuscate, sizeof(__pyx_k_obfuscate), 0, 0, 1, 1}, {&__pyx_n_s_obfuscate_2, __pyx_k_obfuscate_2, sizeof(__pyx_k_obfuscate_2), 0, 0, 1, 1}, {&__pyx_n_s_obfuscated_data, __pyx_k_obfuscated_data, sizeof(__pyx_k_obfuscated_data), 0, 0, 1, 1}, {&__pyx_n_s_osize, __pyx_k_osize, sizeof(__pyx_k_osize), 0, 0, 1, 1}, {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1}, {&__pyx_n_s_params, __pyx_k_params, sizeof(__pyx_k_params), 0, 0, 1, 1}, {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, {&__pyx_n_s_preset, __pyx_k_preset, sizeof(__pyx_k_preset), 0, 0, 1, 1}, {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1}, {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1}, {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1}, {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1}, {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1}, {&__pyx_n_s_pyx_unpickle_CompressorBase, __pyx_k_pyx_unpickle_CompressorBase, sizeof(__pyx_k_pyx_unpickle_CompressorBase), 0, 0, 1, 1}, {&__pyx_n_s_pyx_unpickle_DecidingCompresso, __pyx_k_pyx_unpickle_DecidingCompresso, sizeof(__pyx_k_pyx_unpickle_DecidingCompresso), 0, 0, 1, 1}, {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1}, {&__pyx_n_s_random, __pyx_k_random, sizeof(__pyx_k_random), 0, 0, 1, 1}, {&__pyx_n_s_random_padding_obfuscate, __pyx_k_random_padding_obfuscate, sizeof(__pyx_k_random_padding_obfuscate), 0, 0, 1, 1}, {&__pyx_n_s_ratio, __pyx_k_ratio, sizeof(__pyx_k_ratio), 0, 0, 1, 1}, {&__pyx_kp_s_raw_LZ4_compression_decompressi, __pyx_k_raw_LZ4_compression_decompressi, sizeof(__pyx_k_raw_LZ4_compression_decompressi), 0, 0, 1, 0}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, {&__pyx_n_s_relative_random_reciprocal_obfu, __pyx_k_relative_random_reciprocal_obfu, sizeof(__pyx_k_relative_random_reciprocal_obfu), 0, 0, 1, 1}, {&__pyx_n_s_rsize, __pyx_k_rsize, sizeof(__pyx_k_rsize), 0, 0, 1, 1}, {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1}, {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_source, __pyx_k_source, sizeof(__pyx_k_source), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1}, {&__pyx_kp_s_src_borg_compress_pyx, __pyx_k_src_borg_compress_pyx, sizeof(__pyx_k_src_borg_compress_pyx), 0, 0, 1, 0}, {&__pyx_n_s_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 0, 1, 1}, {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, {&__pyx_n_s_staticmethod, __pyx_k_staticmethod, sizeof(__pyx_k_staticmethod), 0, 0, 1, 1}, {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1}, {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_kp_s_too_many_arguments, __pyx_k_too_many_arguments, sizeof(__pyx_k_too_many_arguments), 0, 0, 1, 0}, {&__pyx_n_s_trailer, __pyx_k_trailer, sizeof(__pyx_k_trailer), 0, 0, 1, 1}, {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1}, {&__pyx_kp_s_unsupported_compression_type, __pyx_k_unsupported_compression_type, sizeof(__pyx_k_unsupported_compression_type), 0, 0, 1, 0}, {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, {&__pyx_n_s_use_setstate, __pyx_k_use_setstate, sizeof(__pyx_k_use_setstate), 0, 0, 1, 1}, {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, {&__pyx_n_s_zlib, __pyx_k_zlib, sizeof(__pyx_k_zlib), 0, 0, 1, 1}, {&__pyx_kp_s_zlib_compression_decompression, __pyx_k_zlib_compression_decompression, sizeof(__pyx_k_zlib_compression_decompression), 0, 0, 1, 0}, {&__pyx_n_s_zstd, __pyx_k_zstd, sizeof(__pyx_k_zstd), 0, 0, 1, 1}, {&__pyx_kp_s_zstd_compress_failed_s, __pyx_k_zstd_compress_failed_s, sizeof(__pyx_k_zstd_compress_failed_s), 0, 0, 1, 0}, {&__pyx_kp_s_zstd_compression_decompression_p, __pyx_k_zstd_compression_decompression_p, sizeof(__pyx_k_zstd_compression_decompression_p), 0, 0, 1, 0}, {&__pyx_kp_s_zstd_decompress_failed_s, __pyx_k_zstd_decompress_failed_s, sizeof(__pyx_k_zstd_decompress_failed_s), 0, 0, 1, 0}, {&__pyx_kp_s_zstd_decompress_failed_size_mism, __pyx_k_zstd_decompress_failed_size_mism, sizeof(__pyx_k_zstd_decompress_failed_size_mism), 0, 0, 1, 0}, {&__pyx_kp_s_zstd_get_size_failed_data_was_no, __pyx_k_zstd_get_size_failed_data_was_no, sizeof(__pyx_k_zstd_get_size_failed_data_was_no), 0, 0, 1, 0}, {&__pyx_kp_s_zstd_get_size_failed_original_si, __pyx_k_zstd_get_size_failed_original_si, sizeof(__pyx_k_zstd_get_size_failed_original_si), 0, 0, 1, 0}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 25, __pyx_L1_error) __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(0, 540, __pyx_L1_error) __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) __PYX_ERR(0, 599, __pyx_L1_error) __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 111, __pyx_L1_error) __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 123, __pyx_L1_error) __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 220, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 246, __pyx_L1_error) __pyx_builtin_NotImplemented = __Pyx_GetBuiltinName(__pyx_n_s_NotImplemented); if (!__pyx_builtin_NotImplemented) __PYX_ERR(0, 466, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "borg/compress.pyx":101 * """ * # strip ID bytes * return data[2:] # <<<<<<<<<<<<<< * * cdef class DecidingCompressor(CompressorBase): */ __pyx_slice_ = PySlice_New(__pyx_int_2, Py_None, Py_None); if (unlikely(!__pyx_slice_)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice_); __Pyx_GIVEREF(__pyx_slice_); /* "borg/compress.pyx":198 * osize = LZ4_compress_default(source, dest, isize, osize) * if not osize: * raise Exception('lz4 compress failed') # <<<<<<<<<<<<<< * # only compress if the result actually is smaller * if osize < isize: */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_lz4_compress_failed); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "borg/compress.pyx":246 * self.level = level * if lzma is None: * raise ValueError('No lzma support found.') # <<<<<<<<<<<<<< * * def _decide(self, data): */ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_No_lzma_support_found); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "borg/compress.pyx":346 * def detect(cls, data): * # matches misc. patterns 0x.8.. used by zlib * cmf, flg = data[:2] # <<<<<<<<<<<<<< * is_deflate = cmf & 0x0f == 8 * check_ok = (cmf * 256 + flg) % 31 == 0 */ __pyx_slice__4 = PySlice_New(Py_None, __pyx_int_2, Py_None); if (unlikely(!__pyx_slice__4)) __PYX_ERR(0, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__4); __Pyx_GIVEREF(__pyx_slice__4); /* "borg/compress.pyx":582 * elif self.name == 'auto': * if 2 <= count <= 3: * compression = ','.join(values[1:]) # <<<<<<<<<<<<<< * else: * raise ArgumentTypeError("bad arguments") */ __pyx_slice__7 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__7)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__7); __Pyx_GIVEREF(__pyx_slice__7); /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum not in (0xe3b0c44, 0xda39a3e, 0xd41d8cd): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum */ __pyx_tuple__8 = PyTuple_Pack(3, __pyx_int_238750788, __pyx_int_228825662, __pyx_int_222419149); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); /* "borg/compress.pyx":64 * name = 'baseclass' * * @classmethod # <<<<<<<<<<<<<< * def detect(cls, data): * return data.startswith(cls.ID) */ __pyx_tuple__12 = PyTuple_Pack(2, __pyx_n_s_cls, __pyx_n_s_data); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_compress_pyx, __pyx_n_s_detect, 64, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 64, __pyx_L1_error) /* "borg/compress.pyx":71 * pass * * def decide(self, data): # <<<<<<<<<<<<<< * """ * Return which compressor will perform the actual compression for *data*. */ __pyx_tuple__14 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_data); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_compress_pyx, __pyx_n_s_decide_2, 71, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 71, __pyx_L1_error) /* "borg/compress.pyx":84 * return self * * def compress(self, data): # <<<<<<<<<<<<<< * """ * Compress *data* (bytes) and return bytes result. Prepend the ID bytes of this compressor, */ __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_compress_pyx, __pyx_n_s_compress, 84, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 84, __pyx_L1_error) /* "borg/compress.pyx":92 * return self.ID + data * * def decompress(self, data): # <<<<<<<<<<<<<< * """ * Decompress *data* (bytes) and return bytes result. The leading Compressor ID */ __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_compress_pyx, __pyx_n_s_decompress, 92, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 92, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ __pyx_tuple__18 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":16 * else: * return __pyx_unpickle_CompressorBase, (type(self), 0xe3b0c44, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_CompressorBase__set_state(self, __pyx_state) */ __pyx_tuple__20 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(1, 16, __pyx_L1_error) /* "borg/compress.pyx":113 * super().__init__(**kwargs) * * def _decide(self, data): # <<<<<<<<<<<<<< * """ * Decides what to do with *data*. Returns (compressor, compressed_data). */ __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_compress_pyx, __pyx_n_s_decide, 113, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 113, __pyx_L1_error) /* "borg/compress.pyx":125 * raise NotImplementedError * * def decide(self, data): # <<<<<<<<<<<<<< * return self._decide(data)[0] * */ __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_compress_pyx, __pyx_n_s_decide_2, 125, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 125, __pyx_L1_error) /* "borg/compress.pyx":128 * return self._decide(data)[0] * * def decide_compress(self, data): # <<<<<<<<<<<<<< * """ * Decides what to do with *data* and handle accordingly. Returns (compressor, compressed_data). */ __pyx_tuple__24 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_data, __pyx_n_s_compressor, __pyx_n_s_compressed_data); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_compress_pyx, __pyx_n_s_decide_compress, 128, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 128, __pyx_L1_error) /* "borg/compress.pyx":145 * return compressor, compressed_data * * def compress(self, data): # <<<<<<<<<<<<<< * return self.decide_compress(data)[1] * */ __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_compress_pyx, __pyx_n_s_compress, 145, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 145, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":16 * else: * return __pyx_unpickle_DecidingCompressor, (type(self), 0xe3b0c44, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_DecidingCompressor__set_state(self, __pyx_state) */ __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(1, 16, __pyx_L1_error) /* "borg/compress.pyx":155 * name = 'none' * * def compress(self, data): # <<<<<<<<<<<<<< * return super().compress(data) * */ __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_compress_pyx, __pyx_n_s_compress, 155, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 155, __pyx_L1_error) /* "borg/compress.pyx":158 * return super().compress(data) * * def decompress(self, data): # <<<<<<<<<<<<<< * data = super().decompress(data) * if not isinstance(data, bytes): */ __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_compress_pyx, __pyx_n_s_decompress, 158, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 158, __pyx_L1_error) /* "borg/compress.pyx":177 * name = 'lz4' * * def __init__(self, **kwargs): # <<<<<<<<<<<<<< * pass * */ __pyx_tuple__33 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__33); __Pyx_GIVEREF(__pyx_tuple__33); __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_compress_pyx, __pyx_n_s_init, 177, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 177, __pyx_L1_error) /* "borg/compress.pyx":180 * pass * * def _decide(self, idata): # <<<<<<<<<<<<<< * """ * Decides what to do with *data*. Returns (compressor, lz4_data). */ __pyx_tuple__35 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_idata, __pyx_n_s_isize, __pyx_n_s_osize, __pyx_n_s_source, __pyx_n_s_dest, __pyx_n_s_buf); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__35); __Pyx_GIVEREF(__pyx_tuple__35); __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_compress_pyx, __pyx_n_s_decide, 180, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 180, __pyx_L1_error) /* "borg/compress.pyx":205 * return NONE_COMPRESSOR, None * * def decompress(self, idata): # <<<<<<<<<<<<<< * if not isinstance(idata, bytes): * idata = bytes(idata) # code below does not work with memoryview */ __pyx_tuple__37 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_idata, __pyx_n_s_isize, __pyx_n_s_osize, __pyx_n_s_rsize, __pyx_n_s_source, __pyx_n_s_dest, __pyx_n_s_buf); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__37); __Pyx_GIVEREF(__pyx_tuple__37); __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_compress_pyx, __pyx_n_s_decompress, 205, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 205, __pyx_L1_error) /* "borg/compress.pyx":242 * name = 'lzma' * * def __init__(self, level=6, **kwargs): # <<<<<<<<<<<<<< * super().__init__(**kwargs) * self.level = level */ __pyx_tuple__40 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_level, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__40); __Pyx_GIVEREF(__pyx_tuple__40); __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_compress_pyx, __pyx_n_s_init, 242, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 242, __pyx_L1_error) __pyx_tuple__42 = PyTuple_Pack(1, ((PyObject *)__pyx_int_6)); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__42); __Pyx_GIVEREF(__pyx_tuple__42); /* "borg/compress.pyx":248 * raise ValueError('No lzma support found.') * * def _decide(self, data): # <<<<<<<<<<<<<< * """ * Decides what to do with *data*. Returns (compressor, lzma_data). */ __pyx_tuple__43 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_data, __pyx_n_s_lzma_data); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__43); __Pyx_GIVEREF(__pyx_tuple__43); __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_compress_pyx, __pyx_n_s_decide, 248, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 248, __pyx_L1_error) /* "borg/compress.pyx":261 * return NONE_COMPRESSOR, None * * def decompress(self, data): # <<<<<<<<<<<<<< * data = super().decompress(data) * try: */ __pyx_tuple__45 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_data, __pyx_n_s_e); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__45); __Pyx_GIVEREF(__pyx_tuple__45); __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_compress_pyx, __pyx_n_s_decompress, 261, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 261, __pyx_L1_error) /* "borg/compress.pyx":277 * name = 'zstd' * * def __init__(self, level=3, **kwargs): # <<<<<<<<<<<<<< * super().__init__(**kwargs) * self.level = level */ __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_compress_pyx, __pyx_n_s_init, 277, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 277, __pyx_L1_error) __pyx_tuple__49 = PyTuple_Pack(1, ((PyObject *)__pyx_int_3)); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__49); __Pyx_GIVEREF(__pyx_tuple__49); /* "borg/compress.pyx":281 * self.level = level * * def _decide(self, idata): # <<<<<<<<<<<<<< * """ * Decides what to do with *data*. Returns (compressor, zstd_data). */ __pyx_tuple__50 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_idata, __pyx_n_s_isize, __pyx_n_s_osize, __pyx_n_s_source, __pyx_n_s_dest, __pyx_n_s_level, __pyx_n_s_buf); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__50); __Pyx_GIVEREF(__pyx_tuple__50); __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_compress_pyx, __pyx_n_s_decide, 281, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 281, __pyx_L1_error) /* "borg/compress.pyx":307 * return NONE_COMPRESSOR, None * * def decompress(self, idata): # <<<<<<<<<<<<<< * if not isinstance(idata, bytes): * idata = bytes(idata) # code below does not work with memoryview */ __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_compress_pyx, __pyx_n_s_decompress, 307, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 307, __pyx_L1_error) /* "borg/compress.pyx":343 * name = 'zlib' * * @classmethod # <<<<<<<<<<<<<< * def detect(cls, data): * # matches misc. patterns 0x.8.. used by zlib */ __pyx_tuple__54 = PyTuple_Pack(6, __pyx_n_s_cls, __pyx_n_s_data, __pyx_n_s_cmf, __pyx_n_s_flg, __pyx_n_s_is_deflate, __pyx_n_s_check_ok); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__54); __Pyx_GIVEREF(__pyx_tuple__54); __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_compress_pyx, __pyx_n_s_detect, 343, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 343, __pyx_L1_error) /* "borg/compress.pyx":351 * return check_ok and is_deflate * * def __init__(self, level=6, **kwargs): # <<<<<<<<<<<<<< * super().__init__(**kwargs) * self.level = level */ __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_compress_pyx, __pyx_n_s_init, 351, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 351, __pyx_L1_error) /* "borg/compress.pyx":355 * self.level = level * * def compress(self, data): # <<<<<<<<<<<<<< * # note: for compatibility no super call, do not add ID bytes * return zlib.compress(data, self.level) */ __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_compress_pyx, __pyx_n_s_compress, 355, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 355, __pyx_L1_error) /* "borg/compress.pyx":359 * return zlib.compress(data, self.level) * * def decompress(self, data): # <<<<<<<<<<<<<< * # note: for compatibility no super call, do not strip ID bytes * try: */ __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_compress_pyx, __pyx_n_s_decompress, 359, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 359, __pyx_L1_error) /* "borg/compress.pyx":378 * name = 'auto' * * def __init__(self, compressor): # <<<<<<<<<<<<<< * super().__init__() * self.compressor = compressor */ __pyx_tuple__59 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_compressor); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__59); __Pyx_GIVEREF(__pyx_tuple__59); __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_compress_pyx, __pyx_n_s_init, 378, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 378, __pyx_L1_error) /* "borg/compress.pyx":382 * self.compressor = compressor * * def _decide(self, data): # <<<<<<<<<<<<<< * """ * Decides what to do with *data*. Returns (compressor, compressed_data). */ __pyx_tuple__61 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_data, __pyx_n_s_compressor, __pyx_n_s_compressed_data, __pyx_n_s_ratio); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__61); __Pyx_GIVEREF(__pyx_tuple__61); __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_compress_pyx, __pyx_n_s_decide, 382, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 382, __pyx_L1_error) /* "borg/compress.pyx":413 * return compressor, compressed_data * * def decide(self, data): # <<<<<<<<<<<<<< * return self._decide(data)[0] * */ __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_compress_pyx, __pyx_n_s_decide_2, 413, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 413, __pyx_L1_error) /* "borg/compress.pyx":416 * return self._decide(data)[0] * * def compress(self, data): # <<<<<<<<<<<<<< * compressor, cheap_compressed_data = self._decide(data) * if compressor in (LZ4_COMPRESSOR, NONE_COMPRESSOR): */ __pyx_tuple__64 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_data, __pyx_n_s_compressor, __pyx_n_s_cheap_compressed_data, __pyx_n_s_expensive_compressed_data, __pyx_n_s_ratio); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__64); __Pyx_GIVEREF(__pyx_tuple__64); __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_compress_pyx, __pyx_n_s_compress, 416, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 416, __pyx_L1_error) /* "borg/compress.pyx":433 * return cheap_compressed_data * * def decompress(self, data): # <<<<<<<<<<<<<< * raise NotImplementedError * */ __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_compress_pyx, __pyx_n_s_decompress, 433, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 433, __pyx_L1_error) /* "borg/compress.pyx":436 * raise NotImplementedError * * def detect(cls, data): # <<<<<<<<<<<<<< * raise NotImplementedError * */ __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_compress_pyx, __pyx_n_s_detect, 436, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 436, __pyx_L1_error) /* "borg/compress.pyx":450 * header_len = len(header_fmt.pack(0)) * * def __init__(self, level=None, compressor=None): # <<<<<<<<<<<<<< * super().__init__() * self.compressor = compressor */ __pyx_tuple__69 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_level, __pyx_n_s_compressor); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__69); __Pyx_GIVEREF(__pyx_tuple__69); __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_compress_pyx, __pyx_n_s_init, 450, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 450, __pyx_L1_error) __pyx_tuple__71 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__71); __Pyx_GIVEREF(__pyx_tuple__71); /* "borg/compress.pyx":463 * self.max_padding_size = 2 ** (level - 100) # 1kiB .. 8MiB * * def _obfuscate(self, compr_size): # <<<<<<<<<<<<<< * # implementations need to return the size of obfuscation data, * # that the caller shall add. */ __pyx_tuple__72 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_compr_size); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__72); __Pyx_GIVEREF(__pyx_tuple__72); __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_compress_pyx, __pyx_n_s_obfuscate, 463, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(0, 463, __pyx_L1_error) /* "borg/compress.pyx":468 * raise NotImplemented * * def _relative_random_reciprocal_obfuscate(self, compr_size): # <<<<<<<<<<<<<< * # effect for SPEC 1: * # f = 0.01 .. 0.1 for r in 1.0 .. 0.1 == in 90% of cases */ __pyx_tuple__74 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_compr_size, __pyx_n_s_r, __pyx_n_s_f); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__74); __Pyx_GIVEREF(__pyx_tuple__74); __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__74, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_compress_pyx, __pyx_n_s_relative_random_reciprocal_obfu, 468, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) __PYX_ERR(0, 468, __pyx_L1_error) /* "borg/compress.pyx":478 * return int(compr_size * f) * * def _random_padding_obfuscate(self, compr_size): # <<<<<<<<<<<<<< * return int(self.max_padding_size * random.random()) * */ __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_compress_pyx, __pyx_n_s_random_padding_obfuscate, 478, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) __PYX_ERR(0, 478, __pyx_L1_error) /* "borg/compress.pyx":481 * return int(self.max_padding_size * random.random()) * * def compress(self, data): # <<<<<<<<<<<<<< * compressed_data = self.compressor.compress(data) # compress data * compr_size = len(compressed_data) */ __pyx_tuple__77 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_data, __pyx_n_s_compressed_data, __pyx_n_s_compr_size, __pyx_n_s_header, __pyx_n_s_addtl_size, __pyx_n_s_trailer, __pyx_n_s_obfuscated_data); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__77); __Pyx_GIVEREF(__pyx_tuple__77); __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_compress_pyx, __pyx_n_s_compress, 481, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) __PYX_ERR(0, 481, __pyx_L1_error) /* "borg/compress.pyx":492 * return super().compress(obfuscated_data) # add ID header * * def decompress(self, data): # <<<<<<<<<<<<<< * if not isinstance(data, memoryview): * data = memoryview(data) */ __pyx_tuple__79 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_data, __pyx_n_s_obfuscated_data, __pyx_n_s_compr_size, __pyx_n_s_compressed_data); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 492, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__79); __Pyx_GIVEREF(__pyx_tuple__79); __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_compress_pyx, __pyx_n_s_decompress, 492, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(0, 492, __pyx_L1_error) /* "borg/compress.pyx":516 * COMPRESSOR_LIST = [LZ4, ZSTD, CNONE, ZLIB, LZMA, ObfuscateSize, ] # check fast stuff first * * def get_compressor(name, **kwargs): # <<<<<<<<<<<<<< * cls = COMPRESSOR_TABLE[name] * return cls(**kwargs) */ __pyx_tuple__81 = PyTuple_Pack(3, __pyx_n_s_name, __pyx_n_s_kwargs, __pyx_n_s_cls); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__81); __Pyx_GIVEREF(__pyx_tuple__81); __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_compress_pyx, __pyx_n_s_get_compressor, 516, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(0, 516, __pyx_L1_error) /* "borg/compress.pyx":521 * * # compressor instances to be used by all other compressors * NONE_COMPRESSOR = get_compressor('none') # <<<<<<<<<<<<<< * LZ4_COMPRESSOR = get_compressor('lz4') * */ __pyx_tuple__83 = PyTuple_Pack(1, __pyx_n_s_none); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__83); __Pyx_GIVEREF(__pyx_tuple__83); /* "borg/compress.pyx":522 * # compressor instances to be used by all other compressors * NONE_COMPRESSOR = get_compressor('none') * LZ4_COMPRESSOR = get_compressor('lz4') # <<<<<<<<<<<<<< * * class Compressor: */ __pyx_tuple__84 = PyTuple_Pack(1, __pyx_n_s_lz4); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__84); __Pyx_GIVEREF(__pyx_tuple__84); /* "borg/compress.pyx":529 * decompresses everything we can handle (autodetect) * """ * def __init__(self, name='null', **kwargs): # <<<<<<<<<<<<<< * self.params = kwargs * self.compressor = get_compressor(name, **self.params) */ __pyx_tuple__85 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_name, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__85); __Pyx_GIVEREF(__pyx_tuple__85); __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_compress_pyx, __pyx_n_s_init, 529, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) __PYX_ERR(0, 529, __pyx_L1_error) __pyx_tuple__87 = PyTuple_Pack(1, ((PyObject*)__pyx_n_s_null)); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__87); __Pyx_GIVEREF(__pyx_tuple__87); /* "borg/compress.pyx":533 * self.compressor = get_compressor(name, **self.params) * * def compress(self, data): # <<<<<<<<<<<<<< * return self.compressor.compress(data) * */ __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_compress_pyx, __pyx_n_s_compress, 533, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) __PYX_ERR(0, 533, __pyx_L1_error) /* "borg/compress.pyx":536 * return self.compressor.compress(data) * * def decompress(self, data): # <<<<<<<<<<<<<< * compressor_cls = self.detect(data) * return compressor_cls(**self.params).decompress(data) */ __pyx_tuple__89 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_data, __pyx_n_s_compressor_cls); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(0, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__89); __Pyx_GIVEREF(__pyx_tuple__89); __pyx_codeobj__90 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__89, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_compress_pyx, __pyx_n_s_decompress, 536, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__90)) __PYX_ERR(0, 536, __pyx_L1_error) /* "borg/compress.pyx":540 * return compressor_cls(**self.params).decompress(data) * * @staticmethod # <<<<<<<<<<<<<< * def detect(data): * hdr = bytes(data[:2]) # detect() does not work with memoryview */ __pyx_tuple__91 = PyTuple_Pack(3, __pyx_n_s_data, __pyx_n_s_hdr, __pyx_n_s_cls); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__91); __Pyx_GIVEREF(__pyx_tuple__91); __pyx_codeobj__92 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__91, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_compress_pyx, __pyx_n_s_detect, 540, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__92)) __PYX_ERR(0, 540, __pyx_L1_error) /* "borg/compress.pyx":551 * * class CompressionSpec: * def __init__(self, s): # <<<<<<<<<<<<<< * values = s.split(',') * count = len(values) */ __pyx_tuple__93 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_s, __pyx_n_s_values, __pyx_n_s_count, __pyx_n_s_level, __pyx_n_s_compression); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__93); __Pyx_GIVEREF(__pyx_tuple__93); __pyx_codeobj__94 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__93, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_compress_pyx, __pyx_n_s_init, 551, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) __PYX_ERR(0, 551, __pyx_L1_error) /* "borg/compress.pyx":599 * raise ArgumentTypeError("unsupported compression type") * * @property # <<<<<<<<<<<<<< * def compressor(self): * if self.name in ('none', 'lz4', ): */ __pyx_tuple__95 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__95); __Pyx_GIVEREF(__pyx_tuple__95); __pyx_codeobj__96 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__95, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_compress_pyx, __pyx_n_s_compressor, 599, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__96)) __PYX_ERR(0, 599, __pyx_L1_error) /* "(tree fragment)":1 * def __pyx_unpickle_CompressorBase(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ __pyx_tuple__97 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__97); __Pyx_GIVEREF(__pyx_tuple__97); __pyx_codeobj__98 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__97, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_CompressorBase, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__97, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_DecidingCompresso, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_float_0_001 = PyFloat_FromDouble(0.001); if (unlikely(!__pyx_float_0_001)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_float_0_0001 = PyFloat_FromDouble(0.0001); if (unlikely(!__pyx_float_0_0001)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_9 = PyInt_FromLong(9); if (unlikely(!__pyx_int_9)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_22 = PyInt_FromLong(22); if (unlikely(!__pyx_int_22)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_31 = PyInt_FromLong(31); if (unlikely(!__pyx_int_31)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_100 = PyInt_FromLong(100); if (unlikely(!__pyx_int_100)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_110 = PyInt_FromLong(110); if (unlikely(!__pyx_int_110)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_123 = PyInt_FromLong(123); if (unlikely(!__pyx_int_123)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_256 = PyInt_FromLong(256); if (unlikely(!__pyx_int_256)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1024 = PyInt_FromLong(1024); if (unlikely(!__pyx_int_1024)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_222419149 = PyInt_FromLong(222419149L); if (unlikely(!__pyx_int_222419149)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_228825662 = PyInt_FromLong(228825662L); if (unlikely(!__pyx_int_228825662)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_238750788 = PyInt_FromLong(238750788L); if (unlikely(!__pyx_int_238750788)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS __pyx_ptype_4borg_8compress_CompressorBase = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4borg_8compress_CompressorBase_spec, NULL); if (unlikely(!__pyx_ptype_4borg_8compress_CompressorBase)) __PYX_ERR(0, 54, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4borg_8compress_CompressorBase_spec, __pyx_ptype_4borg_8compress_CompressorBase) < 0) __PYX_ERR(0, 54, __pyx_L1_error) #else __pyx_ptype_4borg_8compress_CompressorBase = &__pyx_type_4borg_8compress_CompressorBase; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_4borg_8compress_CompressorBase) < 0) __PYX_ERR(0, 54, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_4borg_8compress_CompressorBase->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4borg_8compress_CompressorBase->tp_dictoffset && __pyx_ptype_4borg_8compress_CompressorBase->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_4borg_8compress_CompressorBase->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_CompressorBase, (PyObject *) __pyx_ptype_4borg_8compress_CompressorBase) < 0) __PYX_ERR(0, 54, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_4borg_8compress_CompressorBase) < 0) __PYX_ERR(0, 54, __pyx_L1_error) #endif #if CYTHON_USE_TYPE_SPECS __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_4borg_8compress_CompressorBase); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_4borg_8compress_DecidingCompressor = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4borg_8compress_DecidingCompressor_spec, __pyx_t_1); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_ptype_4borg_8compress_DecidingCompressor)) __PYX_ERR(0, 103, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4borg_8compress_DecidingCompressor_spec, __pyx_ptype_4borg_8compress_DecidingCompressor) < 0) __PYX_ERR(0, 103, __pyx_L1_error) #else __pyx_ptype_4borg_8compress_DecidingCompressor = &__pyx_type_4borg_8compress_DecidingCompressor; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_4borg_8compress_DecidingCompressor->tp_base = __pyx_ptype_4borg_8compress_CompressorBase; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_4borg_8compress_DecidingCompressor) < 0) __PYX_ERR(0, 103, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_4borg_8compress_DecidingCompressor->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4borg_8compress_DecidingCompressor->tp_dictoffset && __pyx_ptype_4borg_8compress_DecidingCompressor->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_4borg_8compress_DecidingCompressor->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DecidingCompressor, (PyObject *) __pyx_ptype_4borg_8compress_DecidingCompressor) < 0) __PYX_ERR(0, 103, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_4borg_8compress_DecidingCompressor) < 0) __PYX_ERR(0, 103, __pyx_L1_error) #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_compress(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_compress}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "compress", __pyx_k_borg_compress_Compression_is_ap, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initcompress(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initcompress(void) #else __Pyx_PyMODINIT_FUNC PyInit_compress(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_compress(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_compress(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; Py_ssize_t __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'compress' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("compress", __pyx_methods, __pyx_k_borg_compress_Compression_is_ap, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "compress" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_compress(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_borg__compress) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "borg.compress")) { if (unlikely((PyDict_SetItemString(modules, "borg.compress", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) (void)__Pyx_modinit_type_import_code(); (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "borg/compress.pyx":18 * """ * * from argparse import ArgumentTypeError # <<<<<<<<<<<<<< * import random * from struct import Struct */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_ArgumentTypeError); __Pyx_GIVEREF(__pyx_n_s_ArgumentTypeError); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_ArgumentTypeError)) __PYX_ERR(0, 18, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_argparse, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_ArgumentTypeError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ArgumentTypeError, __pyx_t_2) < 0) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/compress.pyx":19 * * from argparse import ArgumentTypeError * import random # <<<<<<<<<<<<<< * from struct import Struct * import zlib */ __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_random, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_random, __pyx_t_3) < 0) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/compress.pyx":20 * from argparse import ArgumentTypeError * import random * from struct import Struct # <<<<<<<<<<<<<< * import zlib * */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_Struct); __Pyx_GIVEREF(__pyx_n_s_Struct); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Struct)) __PYX_ERR(0, 20, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_struct, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Struct); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Struct, __pyx_t_3) < 0) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/compress.pyx":21 * import random * from struct import Struct * import zlib # <<<<<<<<<<<<<< * * try: */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_zlib, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_zlib, __pyx_t_2) < 0) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/compress.pyx":23 * import zlib * * try: # <<<<<<<<<<<<<< * import lzma * except ImportError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_4, &__pyx_t_5); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); /*try:*/ { /* "borg/compress.pyx":24 * * try: * import lzma # <<<<<<<<<<<<<< * except ImportError: * lzma = None */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_lzma, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L2_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_lzma, __pyx_t_2) < 0) __PYX_ERR(0, 24, __pyx_L2_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/compress.pyx":23 * import zlib * * try: # <<<<<<<<<<<<<< * import lzma * except ImportError: */ } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L7_try_end; __pyx_L2_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/compress.pyx":25 * try: * import lzma * except ImportError: # <<<<<<<<<<<<<< * lzma = None * */ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError); if (__pyx_t_6) { __Pyx_AddTraceback("borg.compress", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_7) < 0) __PYX_ERR(0, 25, __pyx_L4_except_error) __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_7); /* "borg/compress.pyx":26 * import lzma * except ImportError: * lzma = None # <<<<<<<<<<<<<< * * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_lzma, Py_None) < 0) __PYX_ERR(0, 26, __pyx_L4_except_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L3_exception_handled; } goto __pyx_L4_except_error; /* "borg/compress.pyx":23 * import zlib * * try: # <<<<<<<<<<<<<< * import lzma * except ImportError: */ __pyx_L4_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_4, __pyx_t_5); goto __pyx_L1_error; __pyx_L3_exception_handled:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_4, __pyx_t_5); __pyx_L7_try_end:; } /* "borg/compress.pyx":29 * * * from .constants import MAX_DATA_SIZE # <<<<<<<<<<<<<< * from .helpers import Buffer, DecompressionError * */ __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_n_s_MAX_DATA_SIZE); __Pyx_GIVEREF(__pyx_n_s_MAX_DATA_SIZE); if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_MAX_DATA_SIZE)) __PYX_ERR(0, 29, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_constants, __pyx_t_7, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_MAX_DATA_SIZE); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAX_DATA_SIZE, __pyx_t_7) < 0) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/compress.pyx":30 * * from .constants import MAX_DATA_SIZE * from .helpers import Buffer, DecompressionError # <<<<<<<<<<<<<< * * API_VERSION = '1.4_01' */ __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_Buffer); __Pyx_GIVEREF(__pyx_n_s_Buffer); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Buffer)) __PYX_ERR(0, 30, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_DecompressionError); __Pyx_GIVEREF(__pyx_n_s_DecompressionError); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_DecompressionError)) __PYX_ERR(0, 30, __pyx_L1_error); __pyx_t_7 = __Pyx_Import(__pyx_n_s_helpers, __pyx_t_3, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_Buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Buffer, __pyx_t_3) < 0) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_DecompressionError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DecompressionError, __pyx_t_3) < 0) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/compress.pyx":32 * from .helpers import Buffer, DecompressionError * * API_VERSION = '1.4_01' # <<<<<<<<<<<<<< * * cdef extern from "lz4.h": */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_API_VERSION, __pyx_kp_s_1_4_01) < 0) __PYX_ERR(0, 32, __pyx_L1_error) /* "borg/compress.pyx":51 * * * buffer = Buffer(bytearray, size=0) # <<<<<<<<<<<<<< * * */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Buffer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF((PyObject *)(&PyByteArray_Type)); __Pyx_GIVEREF((PyObject *)(&PyByteArray_Type)); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)(&PyByteArray_Type)))) __PYX_ERR(0, 51, __pyx_L1_error); __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_size, __pyx_int_0) < 0) __PYX_ERR(0, 51, __pyx_L1_error) __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_buffer, __pyx_t_8) < 0) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "borg/compress.pyx":60 * adding/stripping the ID header (which enable auto detection). * """ * ID = b'\xFF\xFF' # reserved and not used # <<<<<<<<<<<<<< * # overwrite with a unique 2-bytes bytestring in child classes * name = 'baseclass' */ if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_8compress_CompressorBase, __pyx_n_s_ID, __pyx_kp_b__11) < 0) __PYX_ERR(0, 60, __pyx_L1_error) PyType_Modified(__pyx_ptype_4borg_8compress_CompressorBase); /* "borg/compress.pyx":62 * ID = b'\xFF\xFF' # reserved and not used * # overwrite with a unique 2-bytes bytestring in child classes * name = 'baseclass' # <<<<<<<<<<<<<< * * @classmethod */ if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_8compress_CompressorBase, __pyx_n_s_name, __pyx_n_s_baseclass) < 0) __PYX_ERR(0, 62, __pyx_L1_error) PyType_Modified(__pyx_ptype_4borg_8compress_CompressorBase); /* "borg/compress.pyx":64 * name = 'baseclass' * * @classmethod # <<<<<<<<<<<<<< * def detect(cls, data): * return data.startswith(cls.ID) */ __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_14CompressorBase_1detect, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_CompressorBase_detect, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_8compress_CompressorBase, __pyx_n_s_detect, __pyx_t_8) < 0) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; PyType_Modified(__pyx_ptype_4borg_8compress_CompressorBase); __Pyx_GetNameInClass(__pyx_t_8, (PyObject *)__pyx_ptype_4borg_8compress_CompressorBase, __pyx_n_s_detect); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_8compress_CompressorBase, __pyx_n_s_detect, __pyx_t_2) < 0) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_4borg_8compress_CompressorBase); /* "borg/compress.pyx":71 * pass * * def decide(self, data): # <<<<<<<<<<<<<< * """ * Return which compressor will perform the actual compression for *data*. */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_14CompressorBase_5decide, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_CompressorBase_decide, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_8compress_CompressorBase, __pyx_n_s_decide_2, __pyx_t_2) < 0) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_4borg_8compress_CompressorBase); /* "borg/compress.pyx":84 * return self * * def compress(self, data): # <<<<<<<<<<<<<< * """ * Compress *data* (bytes) and return bytes result. Prepend the ID bytes of this compressor, */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_14CompressorBase_7compress, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_CompressorBase_compress, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_8compress_CompressorBase, __pyx_n_s_compress, __pyx_t_2) < 0) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_4borg_8compress_CompressorBase); /* "borg/compress.pyx":92 * return self.ID + data * * def decompress(self, data): # <<<<<<<<<<<<<< * """ * Decompress *data* (bytes) and return bytes result. The leading Compressor ID */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_14CompressorBase_9decompress, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_CompressorBase_decompress, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_8compress_CompressorBase, __pyx_n_s_decompress, __pyx_t_2) < 0) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_4borg_8compress_CompressorBase); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_14CompressorBase_11__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_CompressorBase___reduce_cython, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_8compress_CompressorBase, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_4borg_8compress_CompressorBase); /* "(tree fragment)":16 * else: * return __pyx_unpickle_CompressorBase, (type(self), 0xe3b0c44, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_CompressorBase__set_state(self, __pyx_state) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_14CompressorBase_13__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_CompressorBase___setstate_cython, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_8compress_CompressorBase, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_4borg_8compress_CompressorBase); /* "borg/compress.pyx":108 * method) decide whether and how to compress data. * """ * name = 'decidebaseclass' # <<<<<<<<<<<<<< * * def __init__(self, **kwargs): */ if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_8compress_DecidingCompressor, __pyx_n_s_name, __pyx_n_s_decidebaseclass) < 0) __PYX_ERR(0, 108, __pyx_L1_error) PyType_Modified(__pyx_ptype_4borg_8compress_DecidingCompressor); /* "borg/compress.pyx":113 * super().__init__(**kwargs) * * def _decide(self, data): # <<<<<<<<<<<<<< * """ * Decides what to do with *data*. Returns (compressor, compressed_data). */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_18DecidingCompressor_3_decide, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DecidingCompressor__decide, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_8compress_DecidingCompressor, __pyx_n_s_decide, __pyx_t_2) < 0) __PYX_ERR(0, 113, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_4borg_8compress_DecidingCompressor); /* "borg/compress.pyx":125 * raise NotImplementedError * * def decide(self, data): # <<<<<<<<<<<<<< * return self._decide(data)[0] * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_18DecidingCompressor_5decide, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DecidingCompressor_decide, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_8compress_DecidingCompressor, __pyx_n_s_decide_2, __pyx_t_2) < 0) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_4borg_8compress_DecidingCompressor); /* "borg/compress.pyx":128 * return self._decide(data)[0] * * def decide_compress(self, data): # <<<<<<<<<<<<<< * """ * Decides what to do with *data* and handle accordingly. Returns (compressor, compressed_data). */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_18DecidingCompressor_7decide_compress, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DecidingCompressor_decide_compre, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_8compress_DecidingCompressor, __pyx_n_s_decide_compress, __pyx_t_2) < 0) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_4borg_8compress_DecidingCompressor); /* "borg/compress.pyx":145 * return compressor, compressed_data * * def compress(self, data): # <<<<<<<<<<<<<< * return self.decide_compress(data)[1] * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_18DecidingCompressor_9compress, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DecidingCompressor_compress, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_8compress_DecidingCompressor, __pyx_n_s_compress, __pyx_t_2) < 0) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_4borg_8compress_DecidingCompressor); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_18DecidingCompressor_11__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DecidingCompressor___reduce_cyth, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_8compress_DecidingCompressor, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_4borg_8compress_DecidingCompressor); /* "(tree fragment)":16 * else: * return __pyx_unpickle_DecidingCompressor, (type(self), 0xe3b0c44, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_DecidingCompressor__set_state(self, __pyx_state) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_18DecidingCompressor_13__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DecidingCompressor___setstate_cy, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_8compress_DecidingCompressor, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_4borg_8compress_DecidingCompressor); /* "borg/compress.pyx":148 * return self.decide_compress(data)[1] * * class CNONE(CompressorBase): # <<<<<<<<<<<<<< * """ * none - no compression, just pass through data */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF((PyObject *)__pyx_ptype_4borg_8compress_CompressorBase); __Pyx_GIVEREF((PyObject *)__pyx_ptype_4borg_8compress_CompressorBase); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_4borg_8compress_CompressorBase))) __PYX_ERR(0, 148, __pyx_L1_error); __pyx_t_8 = __Pyx_PEP560_update_bases(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_8, __pyx_n_s_CNONE, __pyx_n_s_CNONE, (PyObject *) NULL, __pyx_n_s_borg_compress, __pyx_kp_s_none_no_compression_just_pass_t); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_8 != __pyx_t_2) { if (unlikely((PyDict_SetItemString(__pyx_t_7, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(0, 148, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "borg/compress.pyx":152 * none - no compression, just pass through data * """ * ID = b'\x00\x00' # <<<<<<<<<<<<<< * name = 'none' * */ if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_ID, __pyx_kp_b__29) < 0) __PYX_ERR(0, 152, __pyx_L1_error) /* "borg/compress.pyx":153 * """ * ID = b'\x00\x00' * name = 'none' # <<<<<<<<<<<<<< * * def compress(self, data): */ if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_name, __pyx_n_s_none) < 0) __PYX_ERR(0, 153, __pyx_L1_error) /* "borg/compress.pyx":155 * name = 'none' * * def compress(self, data): # <<<<<<<<<<<<<< * return super().compress(data) * */ __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_5CNONE_1compress, 0, __pyx_n_s_CNONE_compress, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_9); PyList_Append(__pyx_t_2, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_compress, __pyx_t_9) < 0) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "borg/compress.pyx":158 * return super().compress(data) * * def decompress(self, data): # <<<<<<<<<<<<<< * data = super().decompress(data) * if not isinstance(data, bytes): */ __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_5CNONE_3decompress, 0, __pyx_n_s_CNONE_decompress, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_9); PyList_Append(__pyx_t_2, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_decompress, __pyx_t_9) < 0) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "borg/compress.pyx":148 * return self.decide_compress(data)[1] * * class CNONE(CompressorBase): # <<<<<<<<<<<<<< * """ * none - no compression, just pass through data */ __pyx_t_9 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_CNONE, __pyx_t_8, __pyx_t_7, NULL, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__Pyx_CyFunction_InitClassCell(__pyx_t_2, __pyx_t_9) < 0) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_CNONE, __pyx_t_9) < 0) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "borg/compress.pyx":165 * * * class LZ4(DecidingCompressor): # <<<<<<<<<<<<<< * """ * raw LZ4 compression / decompression (liblz4). */ __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF((PyObject *)__pyx_ptype_4borg_8compress_DecidingCompressor); __Pyx_GIVEREF((PyObject *)__pyx_ptype_4borg_8compress_DecidingCompressor); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_ptype_4borg_8compress_DecidingCompressor))) __PYX_ERR(0, 165, __pyx_L1_error); __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = __Pyx_Py3MetaclassPrepare(__pyx_t_7, __pyx_t_3, __pyx_n_s_LZ4, __pyx_n_s_LZ4, (PyObject *) NULL, __pyx_n_s_borg_compress, __pyx_kp_s_raw_LZ4_compression_decompressi); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_3 != __pyx_t_8) { if (unlikely((PyDict_SetItemString(__pyx_t_9, "__orig_bases__", __pyx_t_8) < 0))) __PYX_ERR(0, 165, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); /* "borg/compress.pyx":174 * - uses safe lz4 methods that never go beyond the end of the output buffer * """ * ID = b'\x01\x00' # <<<<<<<<<<<<<< * name = 'lz4' * */ if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_ID, __pyx_kp_b__32) < 0) __PYX_ERR(0, 174, __pyx_L1_error) /* "borg/compress.pyx":175 * """ * ID = b'\x01\x00' * name = 'lz4' # <<<<<<<<<<<<<< * * def __init__(self, **kwargs): */ if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_name, __pyx_n_s_lz4) < 0) __PYX_ERR(0, 175, __pyx_L1_error) /* "borg/compress.pyx":177 * name = 'lz4' * * def __init__(self, **kwargs): # <<<<<<<<<<<<<< * pass * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_3LZ4_1__init__, 0, __pyx_n_s_LZ4___init, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/compress.pyx":180 * pass * * def _decide(self, idata): # <<<<<<<<<<<<<< * """ * Decides what to do with *data*. Returns (compressor, lz4_data). */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_3LZ4_3_decide, 0, __pyx_n_s_LZ4__decide, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_decide, __pyx_t_2) < 0) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/compress.pyx":205 * return NONE_COMPRESSOR, None * * def decompress(self, idata): # <<<<<<<<<<<<<< * if not isinstance(idata, bytes): * idata = bytes(idata) # code below does not work with memoryview */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_3LZ4_5decompress, 0, __pyx_n_s_LZ4_decompress, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_2); PyList_Append(__pyx_t_8, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_decompress, __pyx_t_2) < 0) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/compress.pyx":165 * * * class LZ4(DecidingCompressor): # <<<<<<<<<<<<<< * """ * raw LZ4 compression / decompression (liblz4). */ __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_n_s_LZ4, __pyx_t_3, __pyx_t_9, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_CyFunction_InitClassCell(__pyx_t_8, __pyx_t_2) < 0) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_LZ4, __pyx_t_2) < 0) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/compress.pyx":235 * * * class LZMA(DecidingCompressor): # <<<<<<<<<<<<<< * """ * lzma compression / decompression */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF((PyObject *)__pyx_ptype_4borg_8compress_DecidingCompressor); __Pyx_GIVEREF((PyObject *)__pyx_ptype_4borg_8compress_DecidingCompressor); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_ptype_4borg_8compress_DecidingCompressor))) __PYX_ERR(0, 235, __pyx_L1_error); __pyx_t_7 = __Pyx_PEP560_update_bases(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = __Pyx_CalculateMetaclass(NULL, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_9, __pyx_t_7, __pyx_n_s_LZMA, __pyx_n_s_LZMA, (PyObject *) NULL, __pyx_n_s_borg_compress, __pyx_kp_s_lzma_compression_decompression); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__pyx_t_7 != __pyx_t_3) { if (unlikely((PyDict_SetItemString(__pyx_t_2, "__orig_bases__", __pyx_t_3) < 0))) __PYX_ERR(0, 235, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "borg/compress.pyx":239 * lzma compression / decompression * """ * ID = b'\x02\x00' # <<<<<<<<<<<<<< * name = 'lzma' * */ if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_ID, __pyx_kp_b__39) < 0) __PYX_ERR(0, 239, __pyx_L1_error) /* "borg/compress.pyx":240 * """ * ID = b'\x02\x00' * name = 'lzma' # <<<<<<<<<<<<<< * * def __init__(self, level=6, **kwargs): */ if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_name, __pyx_n_s_lzma) < 0) __PYX_ERR(0, 240, __pyx_L1_error) /* "borg/compress.pyx":242 * name = 'lzma' * * def __init__(self, level=6, **kwargs): # <<<<<<<<<<<<<< * super().__init__(**kwargs) * self.level = level */ __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_4LZMA_1__init__, 0, __pyx_n_s_LZMA___init, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_8); PyList_Append(__pyx_t_3, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__42); if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_8) < 0) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "borg/compress.pyx":248 * raise ValueError('No lzma support found.') * * def _decide(self, data): # <<<<<<<<<<<<<< * """ * Decides what to do with *data*. Returns (compressor, lzma_data). */ __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_4LZMA_3_decide, 0, __pyx_n_s_LZMA__decide, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_decide, __pyx_t_8) < 0) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "borg/compress.pyx":261 * return NONE_COMPRESSOR, None * * def decompress(self, data): # <<<<<<<<<<<<<< * data = super().decompress(data) * try: */ __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_4LZMA_5decompress, 0, __pyx_n_s_LZMA_decompress, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_8); PyList_Append(__pyx_t_3, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_decompress, __pyx_t_8) < 0) __PYX_ERR(0, 261, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "borg/compress.pyx":235 * * * class LZMA(DecidingCompressor): # <<<<<<<<<<<<<< * """ * lzma compression / decompression */ __pyx_t_8 = __Pyx_Py3ClassCreate(__pyx_t_9, __pyx_n_s_LZMA, __pyx_t_7, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__Pyx_CyFunction_InitClassCell(__pyx_t_3, __pyx_t_8) < 0) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_LZMA, __pyx_t_8) < 0) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/compress.pyx":269 * * * class ZSTD(DecidingCompressor): # <<<<<<<<<<<<<< * """zstd compression / decompression (pypi: zstandard, gh: python-zstandard)""" * # This is a NOT THREAD SAFE implementation. */ __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF((PyObject *)__pyx_ptype_4borg_8compress_DecidingCompressor); __Pyx_GIVEREF((PyObject *)__pyx_ptype_4borg_8compress_DecidingCompressor); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_ptype_4borg_8compress_DecidingCompressor))) __PYX_ERR(0, 269, __pyx_L1_error); __pyx_t_9 = __Pyx_PEP560_update_bases(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_9, __pyx_n_s_ZSTD, __pyx_n_s_ZSTD, (PyObject *) NULL, __pyx_n_s_borg_compress, __pyx_kp_s_zstd_compression_decompression_p); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_9 != __pyx_t_7) { if (unlikely((PyDict_SetItemString(__pyx_t_8, "__orig_bases__", __pyx_t_7) < 0))) __PYX_ERR(0, 269, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); /* "borg/compress.pyx":274 * # Only ONE python context must be created at a time. * # It should work flawlessly as long as borg will call ONLY ONE compression job at time. * ID = b'\x03\x00' # <<<<<<<<<<<<<< * name = 'zstd' * */ if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_ID, __pyx_kp_b__47) < 0) __PYX_ERR(0, 274, __pyx_L1_error) /* "borg/compress.pyx":275 * # It should work flawlessly as long as borg will call ONLY ONE compression job at time. * ID = b'\x03\x00' * name = 'zstd' # <<<<<<<<<<<<<< * * def __init__(self, level=3, **kwargs): */ if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_name, __pyx_n_s_zstd) < 0) __PYX_ERR(0, 275, __pyx_L1_error) /* "borg/compress.pyx":277 * name = 'zstd' * * def __init__(self, level=3, **kwargs): # <<<<<<<<<<<<<< * super().__init__(**kwargs) * self.level = level */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_4ZSTD_1__init__, 0, __pyx_n_s_ZSTD___init, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); PyList_Append(__pyx_t_7, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__49); if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/compress.pyx":281 * self.level = level * * def _decide(self, idata): # <<<<<<<<<<<<<< * """ * Decides what to do with *data*. Returns (compressor, zstd_data). */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_4ZSTD_3_decide, 0, __pyx_n_s_ZSTD__decide, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_decide, __pyx_t_3) < 0) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/compress.pyx":307 * return NONE_COMPRESSOR, None * * def decompress(self, idata): # <<<<<<<<<<<<<< * if not isinstance(idata, bytes): * idata = bytes(idata) # code below does not work with memoryview */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_4ZSTD_5decompress, 0, __pyx_n_s_ZSTD_decompress, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); PyList_Append(__pyx_t_7, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_decompress, __pyx_t_3) < 0) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/compress.pyx":269 * * * class ZSTD(DecidingCompressor): # <<<<<<<<<<<<<< * """zstd compression / decompression (pypi: zstandard, gh: python-zstandard)""" * # This is a NOT THREAD SAFE implementation. */ __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_ZSTD, __pyx_t_9, __pyx_t_8, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_CyFunction_InitClassCell(__pyx_t_7, __pyx_t_3) < 0) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_ZSTD, __pyx_t_3) < 0) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "borg/compress.pyx":335 * * * class ZLIB(CompressorBase): # <<<<<<<<<<<<<< * """ * zlib compression / decompression (python stdlib) */ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF((PyObject *)__pyx_ptype_4borg_8compress_CompressorBase); __Pyx_GIVEREF((PyObject *)__pyx_ptype_4borg_8compress_CompressorBase); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_ptype_4borg_8compress_CompressorBase))) __PYX_ERR(0, 335, __pyx_L1_error); __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_8, __pyx_t_2, __pyx_n_s_ZLIB, __pyx_n_s_ZLIB, (PyObject *) NULL, __pyx_n_s_borg_compress, __pyx_kp_s_zlib_compression_decompression); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_2 != __pyx_t_9) { if (unlikely((PyDict_SetItemString(__pyx_t_3, "__orig_bases__", __pyx_t_9) < 0))) __PYX_ERR(0, 335, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); /* "borg/compress.pyx":339 * zlib compression / decompression (python stdlib) * """ * ID = b'\x08\x00' # not used here, see detect() # <<<<<<<<<<<<<< * # avoid all 0x.8.. IDs elsewhere! * name = 'zlib' */ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ID, __pyx_kp_b__53) < 0) __PYX_ERR(0, 339, __pyx_L1_error) /* "borg/compress.pyx":341 * ID = b'\x08\x00' # not used here, see detect() * # avoid all 0x.8.. IDs elsewhere! * name = 'zlib' # <<<<<<<<<<<<<< * * @classmethod */ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_name, __pyx_n_s_zlib) < 0) __PYX_ERR(0, 341, __pyx_L1_error) /* "borg/compress.pyx":343 * name = 'zlib' * * @classmethod # <<<<<<<<<<<<<< * def detect(cls, data): * # matches misc. patterns 0x.8.. used by zlib */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_4ZLIB_1detect, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_ZLIB_detect, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_10 = __Pyx_Method_ClassMethod(__pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_detect, __pyx_t_10) < 0) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "borg/compress.pyx":351 * return check_ok and is_deflate * * def __init__(self, level=6, **kwargs): # <<<<<<<<<<<<<< * super().__init__(**kwargs) * self.level = level */ __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_4ZLIB_3__init__, 0, __pyx_n_s_ZLIB___init, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__56)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_10); PyList_Append(__pyx_t_9, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_tuple__42); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_10) < 0) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "borg/compress.pyx":355 * self.level = level * * def compress(self, data): # <<<<<<<<<<<<<< * # note: for compatibility no super call, do not add ID bytes * return zlib.compress(data, self.level) */ __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_4ZLIB_5compress, 0, __pyx_n_s_ZLIB_compress, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_compress, __pyx_t_10) < 0) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "borg/compress.pyx":359 * return zlib.compress(data, self.level) * * def decompress(self, data): # <<<<<<<<<<<<<< * # note: for compatibility no super call, do not strip ID bytes * try: */ __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_4ZLIB_7decompress, 0, __pyx_n_s_ZLIB_decompress, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_decompress, __pyx_t_10) < 0) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "borg/compress.pyx":335 * * * class ZLIB(CompressorBase): # <<<<<<<<<<<<<< * """ * zlib compression / decompression (python stdlib) */ __pyx_t_10 = __Pyx_Py3ClassCreate(__pyx_t_8, __pyx_n_s_ZLIB, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_CyFunction_InitClassCell(__pyx_t_9, __pyx_t_10) < 0) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_ZLIB, __pyx_t_10) < 0) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/compress.pyx":367 * * * class Auto(CompressorBase): # <<<<<<<<<<<<<< * """ * Meta-Compressor that decides which compression to use based on LZ4's ratio. */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF((PyObject *)__pyx_ptype_4borg_8compress_CompressorBase); __Pyx_GIVEREF((PyObject *)__pyx_ptype_4borg_8compress_CompressorBase); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_4borg_8compress_CompressorBase))) __PYX_ERR(0, 367, __pyx_L1_error); __pyx_t_8 = __Pyx_PEP560_update_bases(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_8, __pyx_n_s_Auto, __pyx_n_s_Auto, (PyObject *) NULL, __pyx_n_s_borg_compress, __pyx_kp_s_Meta_Compressor_that_decides_wh); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_8 != __pyx_t_2) { if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(0, 367, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "borg/compress.pyx":375 * """ * * ID = None # <<<<<<<<<<<<<< * name = 'auto' * */ if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_ID, Py_None) < 0) __PYX_ERR(0, 375, __pyx_L1_error) /* "borg/compress.pyx":376 * * ID = None * name = 'auto' # <<<<<<<<<<<<<< * * def __init__(self, compressor): */ if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_name, __pyx_n_s_auto) < 0) __PYX_ERR(0, 376, __pyx_L1_error) /* "borg/compress.pyx":378 * name = 'auto' * * def __init__(self, compressor): # <<<<<<<<<<<<<< * super().__init__() * self.compressor = compressor */ __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_4Auto_1__init__, 0, __pyx_n_s_Auto___init, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_9); PyList_Append(__pyx_t_2, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_init, __pyx_t_9) < 0) __PYX_ERR(0, 378, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "borg/compress.pyx":382 * self.compressor = compressor * * def _decide(self, data): # <<<<<<<<<<<<<< * """ * Decides what to do with *data*. Returns (compressor, compressed_data). */ __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_4Auto_3_decide, 0, __pyx_n_s_Auto__decide, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_decide, __pyx_t_9) < 0) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "borg/compress.pyx":413 * return compressor, compressed_data * * def decide(self, data): # <<<<<<<<<<<<<< * return self._decide(data)[0] * */ __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_4Auto_5decide, 0, __pyx_n_s_Auto_decide, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__63)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_decide_2, __pyx_t_9) < 0) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "borg/compress.pyx":416 * return self._decide(data)[0] * * def compress(self, data): # <<<<<<<<<<<<<< * compressor, cheap_compressed_data = self._decide(data) * if compressor in (LZ4_COMPRESSOR, NONE_COMPRESSOR): */ __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_4Auto_7compress, 0, __pyx_n_s_Auto_compress, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_compress, __pyx_t_9) < 0) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "borg/compress.pyx":433 * return cheap_compressed_data * * def decompress(self, data): # <<<<<<<<<<<<<< * raise NotImplementedError * */ __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_4Auto_9decompress, 0, __pyx_n_s_Auto_decompress, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_decompress, __pyx_t_9) < 0) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "borg/compress.pyx":436 * raise NotImplementedError * * def detect(cls, data): # <<<<<<<<<<<<<< * raise NotImplementedError * */ __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_4Auto_11detect, 0, __pyx_n_s_Auto_detect, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__67)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_detect, __pyx_t_9) < 0) __PYX_ERR(0, 436, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "borg/compress.pyx":367 * * * class Auto(CompressorBase): # <<<<<<<<<<<<<< * """ * Meta-Compressor that decides which compression to use based on LZ4's ratio. */ __pyx_t_9 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_Auto, __pyx_t_8, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__Pyx_CyFunction_InitClassCell(__pyx_t_2, __pyx_t_9) < 0) __PYX_ERR(0, 367, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_Auto, __pyx_t_9) < 0) __PYX_ERR(0, 367, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "borg/compress.pyx":440 * * * class ObfuscateSize(CompressorBase): # <<<<<<<<<<<<<< * """ * Meta-Compressor that obfuscates the compressed data size. */ __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF((PyObject *)__pyx_ptype_4borg_8compress_CompressorBase); __Pyx_GIVEREF((PyObject *)__pyx_ptype_4borg_8compress_CompressorBase); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_ptype_4borg_8compress_CompressorBase))) __PYX_ERR(0, 440, __pyx_L1_error); __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_9 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_3, __pyx_n_s_ObfuscateSize, __pyx_n_s_ObfuscateSize, (PyObject *) NULL, __pyx_n_s_borg_compress, __pyx_kp_s_Meta_Compressor_that_obfuscates); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_3 != __pyx_t_8) { if (unlikely((PyDict_SetItemString(__pyx_t_9, "__orig_bases__", __pyx_t_8) < 0))) __PYX_ERR(0, 440, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); /* "borg/compress.pyx":444 * Meta-Compressor that obfuscates the compressed data size. * """ * ID = b'\x04\x00' # <<<<<<<<<<<<<< * name = 'obfuscate' * */ if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_ID, __pyx_kp_b__68) < 0) __PYX_ERR(0, 444, __pyx_L1_error) /* "borg/compress.pyx":445 * """ * ID = b'\x04\x00' * name = 'obfuscate' # <<<<<<<<<<<<<< * * header_fmt = Struct('>I') */ if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_name, __pyx_n_s_obfuscate_2) < 0) __PYX_ERR(0, 445, __pyx_L1_error) /* "borg/compress.pyx":447 * name = 'obfuscate' * * header_fmt = Struct('>I') # <<<<<<<<<<<<<< * header_len = len(header_fmt.pack(0)) * */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Struct); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_11 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_kp_s_I}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_header_fmt, __pyx_t_2) < 0) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/compress.pyx":448 * * header_fmt = Struct('>I') * header_len = len(header_fmt.pack(0)) # <<<<<<<<<<<<<< * * def __init__(self, level=None, compressor=None): */ __pyx_t_7 = PyObject_GetItem(__pyx_t_9, __pyx_n_s_header_fmt); if (unlikely(!__pyx_t_7)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_header_fmt); } if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_pack); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_11))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_int_0}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __pyx_t_12 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 448, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_header_len, __pyx_t_2) < 0) __PYX_ERR(0, 448, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/compress.pyx":450 * header_len = len(header_fmt.pack(0)) * * def __init__(self, level=None, compressor=None): # <<<<<<<<<<<<<< * super().__init__() * self.compressor = compressor */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_13ObfuscateSize_1__init__, 0, __pyx_n_s_ObfuscateSize___init, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_2); PyList_Append(__pyx_t_8, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__71); if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/compress.pyx":463 * self.max_padding_size = 2 ** (level - 100) # 1kiB .. 8MiB * * def _obfuscate(self, compr_size): # <<<<<<<<<<<<<< * # implementations need to return the size of obfuscation data, * # that the caller shall add. */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_13ObfuscateSize_3_obfuscate, 0, __pyx_n_s_ObfuscateSize__obfuscate, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__73)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_obfuscate, __pyx_t_2) < 0) __PYX_ERR(0, 463, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/compress.pyx":468 * raise NotImplemented * * def _relative_random_reciprocal_obfuscate(self, compr_size): # <<<<<<<<<<<<<< * # effect for SPEC 1: * # f = 0.01 .. 0.1 for r in 1.0 .. 0.1 == in 90% of cases */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_13ObfuscateSize_5_relative_random_reciprocal_obfuscate, 0, __pyx_n_s_ObfuscateSize__relative_random_r, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_relative_random_reciprocal_obfu, __pyx_t_2) < 0) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/compress.pyx":478 * return int(compr_size * f) * * def _random_padding_obfuscate(self, compr_size): # <<<<<<<<<<<<<< * return int(self.max_padding_size * random.random()) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_13ObfuscateSize_7_random_padding_obfuscate, 0, __pyx_n_s_ObfuscateSize__random_padding_ob, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__76)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_random_padding_obfuscate, __pyx_t_2) < 0) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/compress.pyx":481 * return int(self.max_padding_size * random.random()) * * def compress(self, data): # <<<<<<<<<<<<<< * compressed_data = self.compressor.compress(data) # compress data * compr_size = len(compressed_data) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_13ObfuscateSize_9compress, 0, __pyx_n_s_ObfuscateSize_compress, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__78)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_2); PyList_Append(__pyx_t_8, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_compress, __pyx_t_2) < 0) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/compress.pyx":492 * return super().compress(obfuscated_data) # add ID header * * def decompress(self, data): # <<<<<<<<<<<<<< * if not isinstance(data, memoryview): * data = memoryview(data) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_13ObfuscateSize_11decompress, 0, __pyx_n_s_ObfuscateSize_decompress, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 492, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_2); PyList_Append(__pyx_t_8, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_decompress, __pyx_t_2) < 0) __PYX_ERR(0, 492, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/compress.pyx":440 * * * class ObfuscateSize(CompressorBase): # <<<<<<<<<<<<<< * """ * Meta-Compressor that obfuscates the compressed data size. */ __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_ObfuscateSize, __pyx_t_3, __pyx_t_9, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_CyFunction_InitClassCell(__pyx_t_8, __pyx_t_2) < 0) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_ObfuscateSize, __pyx_t_2) < 0) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/compress.pyx":505 * # Maps valid compressor names to their class * COMPRESSOR_TABLE = { * CNONE.name: CNONE, # <<<<<<<<<<<<<< * LZ4.name: LZ4, * ZLIB.name: ZLIB, */ __pyx_t_3 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_CNONE); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_name); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_CNONE); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (PyDict_SetItem(__pyx_t_3, __pyx_t_9, __pyx_t_10) < 0) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "borg/compress.pyx":506 * COMPRESSOR_TABLE = { * CNONE.name: CNONE, * LZ4.name: LZ4, # <<<<<<<<<<<<<< * ZLIB.name: ZLIB, * LZMA.name: LZMA, */ __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_LZ4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_name); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_LZ4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (PyDict_SetItem(__pyx_t_3, __pyx_t_9, __pyx_t_10) < 0) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "borg/compress.pyx":507 * CNONE.name: CNONE, * LZ4.name: LZ4, * ZLIB.name: ZLIB, # <<<<<<<<<<<<<< * LZMA.name: LZMA, * Auto.name: Auto, */ __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_ZLIB); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_name); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_ZLIB); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (PyDict_SetItem(__pyx_t_3, __pyx_t_9, __pyx_t_10) < 0) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "borg/compress.pyx":508 * LZ4.name: LZ4, * ZLIB.name: ZLIB, * LZMA.name: LZMA, # <<<<<<<<<<<<<< * Auto.name: Auto, * ZSTD.name: ZSTD, */ __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_LZMA); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_name); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_LZMA); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (PyDict_SetItem(__pyx_t_3, __pyx_t_9, __pyx_t_10) < 0) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "borg/compress.pyx":509 * ZLIB.name: ZLIB, * LZMA.name: LZMA, * Auto.name: Auto, # <<<<<<<<<<<<<< * ZSTD.name: ZSTD, * ObfuscateSize.name: ObfuscateSize, */ __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_Auto); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_name); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_Auto); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (PyDict_SetItem(__pyx_t_3, __pyx_t_9, __pyx_t_10) < 0) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "borg/compress.pyx":510 * LZMA.name: LZMA, * Auto.name: Auto, * ZSTD.name: ZSTD, # <<<<<<<<<<<<<< * ObfuscateSize.name: ObfuscateSize, * } */ __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_ZSTD); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_name); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_ZSTD); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (PyDict_SetItem(__pyx_t_3, __pyx_t_9, __pyx_t_10) < 0) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "borg/compress.pyx":511 * Auto.name: Auto, * ZSTD.name: ZSTD, * ObfuscateSize.name: ObfuscateSize, # <<<<<<<<<<<<<< * } * # List of possible compression types. Does not include Auto, since it is a meta-Compressor. */ __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_ObfuscateSize); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 511, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_name); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 511, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_ObfuscateSize); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 511, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (PyDict_SetItem(__pyx_t_3, __pyx_t_9, __pyx_t_10) < 0) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_COMPRESSOR_TABLE, __pyx_t_3) < 0) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/compress.pyx":514 * } * # List of possible compression types. Does not include Auto, since it is a meta-Compressor. * COMPRESSOR_LIST = [LZ4, ZSTD, CNONE, ZLIB, LZMA, ObfuscateSize, ] # check fast stuff first # <<<<<<<<<<<<<< * * def get_compressor(name, **kwargs): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_LZ4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_ZSTD); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_CNONE); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ZLIB); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_LZMA); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_ObfuscateSize); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_7 = PyList_New(6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_3)) __PYX_ERR(0, 514, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_10); if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_10)) __PYX_ERR(0, 514, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_9); if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 2, __pyx_t_9)) __PYX_ERR(0, 514, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 3, __pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 4, __pyx_t_8)) __PYX_ERR(0, 514, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_11); if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 5, __pyx_t_11)) __PYX_ERR(0, 514, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0; __pyx_t_2 = 0; __pyx_t_8 = 0; __pyx_t_11 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_COMPRESSOR_LIST, __pyx_t_7) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/compress.pyx":516 * COMPRESSOR_LIST = [LZ4, ZSTD, CNONE, ZLIB, LZMA, ObfuscateSize, ] # check fast stuff first * * def get_compressor(name, **kwargs): # <<<<<<<<<<<<<< * cls = COMPRESSOR_TABLE[name] * return cls(**kwargs) */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_1get_compressor, 0, __pyx_n_s_get_compressor, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__82)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_compressor, __pyx_t_7) < 0) __PYX_ERR(0, 516, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/compress.pyx":521 * * # compressor instances to be used by all other compressors * NONE_COMPRESSOR = get_compressor('none') # <<<<<<<<<<<<<< * LZ4_COMPRESSOR = get_compressor('lz4') * */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_get_compressor); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__83, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_NONE_COMPRESSOR, __pyx_t_11) < 0) __PYX_ERR(0, 521, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "borg/compress.pyx":522 * # compressor instances to be used by all other compressors * NONE_COMPRESSOR = get_compressor('none') * LZ4_COMPRESSOR = get_compressor('lz4') # <<<<<<<<<<<<<< * * class Compressor: */ __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_get_compressor); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__84, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_LZ4_COMPRESSOR, __pyx_t_7) < 0) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/compress.pyx":524 * LZ4_COMPRESSOR = get_compressor('lz4') * * class Compressor: # <<<<<<<<<<<<<< * """ * compresses using a compressor with given name and parameters */ __pyx_t_7 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Compressor, __pyx_n_s_Compressor, (PyObject *) NULL, __pyx_n_s_borg_compress, __pyx_kp_s_compresses_using_a_compressor_w); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); /* "borg/compress.pyx":529 * decompresses everything we can handle (autodetect) * """ * def __init__(self, name='null', **kwargs): # <<<<<<<<<<<<<< * self.params = kwargs * self.compressor = get_compressor(name, **self.params) */ __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_10Compressor_1__init__, 0, __pyx_n_s_Compressor___init, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__86)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_tuple__87); if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_init, __pyx_t_11) < 0) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "borg/compress.pyx":533 * self.compressor = get_compressor(name, **self.params) * * def compress(self, data): # <<<<<<<<<<<<<< * return self.compressor.compress(data) * */ __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_10Compressor_3compress, 0, __pyx_n_s_Compressor_compress, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__88)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_compress, __pyx_t_11) < 0) __PYX_ERR(0, 533, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "borg/compress.pyx":536 * return self.compressor.compress(data) * * def decompress(self, data): # <<<<<<<<<<<<<< * compressor_cls = self.detect(data) * return compressor_cls(**self.params).decompress(data) */ __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_10Compressor_5decompress, 0, __pyx_n_s_Compressor_decompress, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__90)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_decompress, __pyx_t_11) < 0) __PYX_ERR(0, 536, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "borg/compress.pyx":540 * return compressor_cls(**self.params).decompress(data) * * @staticmethod # <<<<<<<<<<<<<< * def detect(data): * hdr = bytes(data[:2]) # detect() does not work with memoryview */ __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_10Compressor_7detect, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_Compressor_detect, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__92)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_detect, __pyx_t_8) < 0) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "borg/compress.pyx":524 * LZ4_COMPRESSOR = get_compressor('lz4') * * class Compressor: # <<<<<<<<<<<<<< * """ * compresses using a compressor with given name and parameters */ __pyx_t_8 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_Compressor, __pyx_empty_tuple, __pyx_t_7, NULL, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Compressor, __pyx_t_8) < 0) __PYX_ERR(0, 524, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/compress.pyx":550 * * * class CompressionSpec: # <<<<<<<<<<<<<< * def __init__(self, s): * values = s.split(',') */ __pyx_t_7 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_CompressionSpec, __pyx_n_s_CompressionSpec, (PyObject *) NULL, __pyx_n_s_borg_compress, (PyObject *) NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); /* "borg/compress.pyx":551 * * class CompressionSpec: * def __init__(self, s): # <<<<<<<<<<<<<< * values = s.split(',') * count = len(values) */ __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_15CompressionSpec_1__init__, 0, __pyx_n_s_CompressionSpec___init, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__94)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_init, __pyx_t_8) < 0) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "borg/compress.pyx":599 * raise ArgumentTypeError("unsupported compression type") * * @property # <<<<<<<<<<<<<< * def compressor(self): * if self.name in ('none', 'lz4', ): */ __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_15CompressionSpec_3compressor, 0, __pyx_n_s_CompressionSpec_compressor, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__96)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_compressor, __pyx_t_11) < 0) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "borg/compress.pyx":550 * * * class CompressionSpec: # <<<<<<<<<<<<<< * def __init__(self, s): * values = s.split(',') */ __pyx_t_11 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_CompressionSpec, __pyx_empty_tuple, __pyx_t_7, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CompressionSpec, __pyx_t_11) < 0) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "(tree fragment)":1 * def __pyx_unpickle_CompressorBase(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_3__pyx_unpickle_CompressorBase, 0, __pyx_n_s_pyx_unpickle_CompressorBase, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__98)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_CompressorBase, __pyx_t_7) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "(tree fragment)":11 * __pyx_unpickle_CompressorBase__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_CompressorBase__set_state(CompressorBase __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[0]) */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8compress_5__pyx_unpickle_DecidingCompressor, 0, __pyx_n_s_pyx_unpickle_DecidingCompresso, NULL, __pyx_n_s_borg_compress, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_DecidingCompresso, __pyx_t_7) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/compress.pyx":1 * """ # <<<<<<<<<<<<<< * borg.compress * ============= */ __pyx_t_7 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_7) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init borg.compress", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init borg.compress"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* KeywordStringCheck */ static int __Pyx_CheckKeywordStrings( PyObject *kw, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0)) goto invalid_keyword; return 1; #else if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) { Py_ssize_t kwsize; #if CYTHON_ASSUME_SAFE_MACROS kwsize = PyTuple_GET_SIZE(kw); #else kwsize = PyTuple_Size(kw); if (kwsize < 0) return 0; #endif if (unlikely(kwsize == 0)) return 1; if (!kw_allowed) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, 0); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif goto invalid_keyword; } #if PY_VERSION_HEX < 0x03090000 for (pos = 0; pos < kwsize; pos++) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, pos); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } #endif return 1; } while (PyDict_Next(kw, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if (!kw_allowed && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } /* SliceObject */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, int has_cstart, int has_cstop, int wraparound) { __Pyx_TypeName obj_type_name; #if CYTHON_USE_TYPE_SLOTS PyMappingMethods* mp; #if PY_MAJOR_VERSION < 3 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; if (likely(ms && ms->sq_slice)) { if (!has_cstart) { if (_py_start && (*_py_start != Py_None)) { cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstart = 0; } if (!has_cstop) { if (_py_stop && (*_py_stop != Py_None)) { cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstop = PY_SSIZE_T_MAX; } if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { Py_ssize_t l = ms->sq_length(obj); if (likely(l >= 0)) { if (cstop < 0) { cstop += l; if (cstop < 0) cstop = 0; } if (cstart < 0) { cstart += l; if (cstart < 0) cstart = 0; } } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) goto bad; PyErr_Clear(); } } return ms->sq_slice(obj, cstart, cstop); } #else CYTHON_UNUSED_VAR(wraparound); #endif mp = Py_TYPE(obj)->tp_as_mapping; if (likely(mp && mp->mp_subscript)) #else CYTHON_UNUSED_VAR(wraparound); #endif { PyObject* result; PyObject *py_slice, *py_start, *py_stop; if (_py_slice) { py_slice = *_py_slice; } else { PyObject* owned_start = NULL; PyObject* owned_stop = NULL; if (_py_start) { py_start = *_py_start; } else { if (has_cstart) { owned_start = py_start = PyInt_FromSsize_t(cstart); if (unlikely(!py_start)) goto bad; } else py_start = Py_None; } if (_py_stop) { py_stop = *_py_stop; } else { if (has_cstop) { owned_stop = py_stop = PyInt_FromSsize_t(cstop); if (unlikely(!py_stop)) { Py_XDECREF(owned_start); goto bad; } } else py_stop = Py_None; } py_slice = PySlice_New(py_start, py_stop, Py_None); Py_XDECREF(owned_start); Py_XDECREF(owned_stop); if (unlikely(!py_slice)) goto bad; } #if CYTHON_USE_TYPE_SLOTS result = mp->mp_subscript(obj, py_slice); #else result = PyObject_GetItem(obj, py_slice); #endif if (!_py_slice) { Py_DECREF(py_slice); } return result; } obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' object is unsliceable", obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); bad: return NULL; } /* GetAttr3 */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static PyObject *__Pyx_GetAttr3Default(PyObject *d) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) return NULL; __Pyx_PyErr_Clear(); Py_INCREF(d); return d; } #endif static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { PyObject *r; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 int res = PyObject_GetOptionalAttr(o, n, &r); return (res != 0) ? r : __Pyx_NewRef(d); #else #if CYTHON_USE_TYPE_SLOTS if (likely(PyString_Check(n))) { r = __Pyx_PyObject_GetAttrStrNoError(o, n); if (unlikely(!r) && likely(!PyErr_Occurred())) { r = __Pyx_NewRef(d); } return r; } #endif r = PyObject_GetAttr(o, n); return (likely(r)) ? r : __Pyx_GetAttr3Default(d); #endif } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* RaiseUnexpectedTypeError */ static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) { __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME, expected, obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* GetItemInt */ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (unlikely(!j)) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_subscript) { PyObject *r, *key = PyInt_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); return r; } if (likely(sm && sm->sq_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return sm->sq_item(o, i); } } #else if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return -1; __Pyx_PyErr_Clear(); return 0; } return 0; } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } return __Pyx_IterFinish(); } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyIntFromDouble */ #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE PyObject* __Pyx_PyInt_FromDouble(double value) { if (value >= (double)LONG_MIN && value <= (double)LONG_MAX) { return PyInt_FromLong((long)value); } return PyLong_FromDouble(value); } #endif /* GetTopmostException */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) { _PyErr_StackItem *exc_info = tstate->exc_info; while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && exc_info->previous_item != NULL) { exc_info = exc_info->previous_item; } return exc_info; } #endif /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); PyObject *exc_value = exc_info->exc_value; if (exc_value == NULL || exc_value == Py_None) { *value = NULL; *type = NULL; *tb = NULL; } else { *value = exc_value; Py_INCREF(*value); *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); *tb = PyException_GetTraceback(exc_value); } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); *type = exc_info->exc_type; *value = exc_info->exc_value; *tb = exc_info->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #else *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #endif } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; PyObject *tmp_value = exc_info->exc_value; exc_info->exc_value = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = type; exc_info->exc_value = value; exc_info->exc_traceback = tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } #endif /* GetException */ #if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) #endif { PyObject *local_type = NULL, *local_value, *local_tb = NULL; #if CYTHON_FAST_THREAD_STATE PyObject *tmp_type, *tmp_value, *tmp_tb; #if PY_VERSION_HEX >= 0x030C00A6 local_value = tstate->current_exception; tstate->current_exception = 0; if (likely(local_value)) { local_type = (PyObject*) Py_TYPE(local_value); Py_INCREF(local_type); local_tb = PyException_GetTraceback(local_value); } #else local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 if (unlikely(tstate->current_exception)) #elif CYTHON_FAST_THREAD_STATE if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE #if CYTHON_USE_EXC_INFO_STACK { _PyErr_StackItem *exc_info = tstate->exc_info; #if PY_VERSION_HEX >= 0x030B00a4 tmp_value = exc_info->exc_value; exc_info->exc_value = local_value; tmp_type = NULL; tmp_tb = NULL; Py_XDECREF(local_type); Py_XDECREF(local_tb); #else tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = local_type; exc_info->exc_value = local_value; exc_info->exc_traceback = local_tb; #endif } #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } /* PyObjectSetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_setattr)) return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); #endif return PyObject_SetAttr(obj, attr_name, value); } #endif /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; tmp_value = exc_info->exc_value; exc_info->exc_value = *value; if (tmp_value == NULL || tmp_value == Py_None) { Py_XDECREF(tmp_value); tmp_value = NULL; tmp_type = NULL; tmp_tb = NULL; } else { tmp_type = (PyObject*) Py_TYPE(tmp_value); Py_INCREF(tmp_type); #if CYTHON_COMPILING_IN_CPYTHON tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback; Py_XINCREF(tmp_tb); #else tmp_tb = PyException_GetTraceback(tmp_value); #endif } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = *type; exc_info->exc_value = *value; exc_info->exc_traceback = *tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = *type; tstate->exc_value = *value; tstate->exc_traceback = *tb; #endif *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); PyErr_SetExcInfo(*type, *value, *tb); *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #endif /* PyIntCompare */ static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_UNUSED_VAR(inplace); if (op1 == op2) { Py_RETURN_TRUE; } #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); if (a == b) Py_RETURN_TRUE; else Py_RETURN_FALSE; } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { int unequal; unsigned long uintval; Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); const digit* digits = __Pyx_PyLong_Digits(op1); if (intval == 0) { if (__Pyx_PyLong_IsZero(op1) == 1) Py_RETURN_TRUE; else Py_RETURN_FALSE; } else if (intval < 0) { if (__Pyx_PyLong_IsNonNeg(op1)) Py_RETURN_FALSE; intval = -intval; } else { if (__Pyx_PyLong_IsNeg(op1)) Py_RETURN_FALSE; } uintval = (unsigned long) intval; #if PyLong_SHIFT * 4 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 4)) { unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif #if PyLong_SHIFT * 3 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 3)) { unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif #if PyLong_SHIFT * 2 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 2)) { unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif #if PyLong_SHIFT * 1 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 1)) { unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); if (unequal == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE; } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif if ((double)a == (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE; } return ( PyObject_RichCompare(op1, op2, Py_EQ)); } /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AndObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); return PyInt_FromLong(a & b); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; #endif if ((intval & PyLong_MASK) == intval) { long last_digit = (long) __Pyx_PyLong_Digits(op1)[0]; long result = intval & (likely(__Pyx_PyLong_IsPos(op1)) ? last_digit : (PyLong_MASK - last_digit + 1)); return PyLong_FromLong(result); } if (unlikely(__Pyx_PyLong_IsZero(op1))) { return __Pyx_NewRef(op1); } if (likely(__Pyx_PyLong_IsCompact(op1))) { a = __Pyx_PyLong_CompactValue(op1); } else { const digit* digits = __Pyx_PyLong_Digits(op1); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_and(op1, op2); } } x = a & b; return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla & llb; return PyLong_FromLongLong(llx); #endif } #endif return (inplace ? PyNumber_InPlaceAnd : PyNumber_And)(op1, op2); } #endif /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_RemainderObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long x; long a = PyInt_AS_LONG(op1); x = a % b; x += ((x != 0) & ((x ^ b) < 0)) * b; return PyInt_FromLong(x); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; #endif if (unlikely(__Pyx_PyLong_IsZero(op1))) { return __Pyx_NewRef(op1); } if (likely(__Pyx_PyLong_IsCompact(op1))) { a = __Pyx_PyLong_CompactValue(op1); } else { const digit* digits = __Pyx_PyLong_Digits(op1); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_remainder(op1, op2); } } x = a % b; x += ((x != 0) & ((x ^ b) < 0)) * b; return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla % llb; llx += ((llx != 0) & ((llx ^ llb) < 0)) * llb; return PyLong_FromLongLong(llx); #endif } #endif return (inplace ? PyNumber_InPlaceRemainder : PyNumber_Remainder)(op1, op2); } #endif /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); #ifdef HAVE_LONG_LONG if (sizeof(PY_LONG_LONG) > sizeof(long)) { PY_LONG_LONG result = (PY_LONG_LONG)a * (PY_LONG_LONG)b; return (result >= LONG_MIN && result <= LONG_MAX) ? PyInt_FromLong((long)result) : PyLong_FromLongLong(result); } #endif #if CYTHON_USE_TYPE_SLOTS return PyInt_Type.tp_as_number->nb_multiply(op1, op2); #else return PyNumber_Multiply(op1, op2); #endif } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; #endif if (unlikely(__Pyx_PyLong_IsZero(op1))) { return __Pyx_NewRef(op1); } if (likely(__Pyx_PyLong_IsCompact(op1))) { a = __Pyx_PyLong_CompactValue(op1); } else { const digit* digits = __Pyx_PyLong_Digits(op1); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_multiply(op1, op2); } } CYTHON_UNUSED_VAR(a); CYTHON_UNUSED_VAR(b); #ifdef HAVE_LONG_LONG lla = a; goto long_long; #else return PyLong_Type.tp_as_number->nb_multiply(op1, op2); #endif return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla * llb; return PyLong_FromLongLong(llx); #endif } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif double result; PyFPE_START_PROTECT("multiply", return NULL) result = ((double)a) * (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceMultiply : PyNumber_Multiply)(op1, op2); } #endif /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long x; long a = PyInt_AS_LONG(op1); x = (long)((unsigned long)a - (unsigned long)b); if (likely((x^a) >= 0 || (x^~b) >= 0)) return PyInt_FromLong(x); return PyLong_Type.tp_as_number->nb_subtract(op1, op2); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; #endif if (unlikely(__Pyx_PyLong_IsZero(op1))) { return PyLong_FromLong(-intval); } if (likely(__Pyx_PyLong_IsCompact(op1))) { a = __Pyx_PyLong_CompactValue(op1); } else { const digit* digits = __Pyx_PyLong_Digits(op1); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2); } } x = a - b; return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla - llb; return PyLong_FromLongLong(llx); #endif } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif double result; PyFPE_START_PROTECT("subtract", return NULL) result = ((double)a) - (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2); } #endif /* PyNumberPow2 */ static PyObject* __Pyx__PyNumber_PowerOf2(PyObject *two, PyObject *exp, PyObject *none, int inplace) { #if !CYTHON_COMPILING_IN_PYPY Py_ssize_t shiftby; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(exp))) { shiftby = PyInt_AS_LONG(exp); } else #endif if (likely(PyLong_CheckExact(exp))) { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsZero(exp)) { return PyInt_FromLong(1L); } else if (__Pyx_PyLong_IsNeg(exp)) { goto fallback; } else if (__Pyx_PyLong_IsCompact(exp)) { shiftby = __Pyx_PyLong_CompactValueUnsigned(exp); } else { shiftby = PyLong_AsSsize_t(exp); } #else shiftby = PyLong_AsSsize_t(exp); #endif } else { goto fallback; } if (likely(shiftby >= 0)) { if ((size_t)shiftby <= sizeof(long) * 8 - 2) { long value = 1L << shiftby; return PyInt_FromLong(value); #ifdef HAVE_LONG_LONG } else if ((size_t)shiftby <= sizeof(unsigned PY_LONG_LONG) * 8 - 1) { unsigned PY_LONG_LONG value = ((unsigned PY_LONG_LONG)1) << shiftby; return PyLong_FromUnsignedLongLong(value); #endif } else { PyObject *result, *one = PyInt_FromLong(1L); if (unlikely(!one)) return NULL; result = PyNumber_Lshift(one, exp); Py_DECREF(one); return result; } } else if (shiftby == -1 && PyErr_Occurred()) { PyErr_Clear(); } fallback: #endif return (inplace ? PyNumber_InPlacePower : PyNumber_Power)(two, exp, none); } /* PyObjectCall2Args */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args[3] = {NULL, arg1, arg2}; return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP __Pyx_TypeName type_name; PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) #elif PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (likely(descr != NULL)) { *method = descr; return 0; } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(name)); #endif __Pyx_DECREF_TypeName(type_name); return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod1 */ #if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2) static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); Py_DECREF(method); return result; } #endif static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { #if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2 PyObject *args[2] = {obj, arg}; (void) __Pyx_PyObject_GetMethod; (void) __Pyx_PyObject_CallOneArg; (void) __Pyx_PyObject_Call2Args; return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); #else PyObject *method = NULL, *result; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_Call2Args(method, obj, arg); Py_DECREF(method); return result; } if (unlikely(!method)) return NULL; return __Pyx__PyObject_CallMethod1(method, arg); #endif } /* StringJoin */ static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) { (void) __Pyx_PyObject_CallMethod1; #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION < 3 return _PyString_Join(sep, values); #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 return _PyBytes_Join(sep, values); #else return __Pyx_PyObject_CallMethod1(sep, __pyx_n_s_join, values); #endif } /* ObjectGetItem */ #if CYTHON_USE_TYPE_SLOTS static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { PyObject *runerr = NULL; Py_ssize_t key_value; key_value = __Pyx_PyIndex_AsSsize_t(index); if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); } if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index)); PyErr_Clear(); PyErr_Format(PyExc_IndexError, "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name); __Pyx_DECREF_TypeName(index_type_name); } return NULL; } static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { __Pyx_TypeName obj_type_name; if (likely(PyType_Check(obj))) { PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem); if (!meth) { PyErr_Clear(); } else { PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); Py_DECREF(meth); return result; } } obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); return NULL; } static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { PyTypeObject *tp = Py_TYPE(obj); PyMappingMethods *mm = tp->tp_as_mapping; PySequenceMethods *sm = tp->tp_as_sequence; if (likely(mm && mm->mp_subscript)) { return mm->mp_subscript(obj, key); } if (likely(sm && sm->sq_item)) { return __Pyx_PyObject_GetIndex(obj, key); } return __Pyx_PyObject_GetItem_Slow(obj, key); } #endif /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__9); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* GetAttr */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { #if CYTHON_USE_TYPE_SLOTS #if PY_MAJOR_VERSION >= 3 if (likely(PyUnicode_Check(n))) #else if (likely(PyString_Check(n))) #endif return __Pyx_PyObject_GetAttrStr(o, n); #endif return PyObject_GetAttr(o, n); } /* HasAttr */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { PyObject *r; if (unlikely(!__Pyx_PyBaseString_Check(n))) { PyErr_SetString(PyExc_TypeError, "hasattr(): attribute name must be string"); return -1; } r = __Pyx_GetAttr(o, n); if (!r) { PyErr_Clear(); return 0; } else { Py_DECREF(r); return 1; } } #endif /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_CallOneArg(method, obj); Py_DECREF(method); return result; } if (unlikely(!method)) goto bad; result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* ValidateBasesTuple */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; #if CYTHON_ASSUME_SAFE_MACROS n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); if (n < 0) return -1; #endif for (i = 1; i < n; i++) { #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; #elif CYTHON_ASSUME_SAFE_MACROS PyObject *b0 = PyTuple_GET_ITEM(bases, i); #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; #endif PyTypeObject *b; #if PY_MAJOR_VERSION < 3 if (PyClass_Check(b0)) { PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); __Pyx_DECREF_TypeName(b_name); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); if (!py_b_dictoffset) goto dictoffset_return; b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); Py_DECREF(py_b_dictoffset); if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; #endif if (b_dictoffset) { { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "extension type '%.200s' has no __dict__ slot, " "but base type '" __Pyx_FMT_TYPENAME "' has: " "either add 'cdef dict __dict__' to the extension type " "or add '__slots__ = [...]' to the base type", type_name, b_name); __Pyx_DECREF_TypeName(b_name); } #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif } return 0; } #endif /* PyType_Ready */ static int __Pyx_PyType_Ready(PyTypeObject *t) { #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS (void)__Pyx_validate_bases_tuple; #endif return PyType_Ready(t); #else int r; PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 gc_was_enabled = PyGC_Disable(); (void)__Pyx_PyObject_CallMethod0; #else PyObject *ret, *py_status; PyObject *gc = NULL; #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) gc = PyImport_GetModule(__pyx_kp_u_gc); #endif if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); if (unlikely(!gc)) return -1; py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; } gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; } Py_DECREF(ret); } else if (unlikely(gc_was_enabled == -1)) { Py_DECREF(gc); return -1; } #endif t->tp_flags |= Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A0000 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; #endif #else (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) PyGC_Enable(); #else if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); } else { Py_XDECREF(tp); Py_XDECREF(v); Py_XDECREF(tb); r = -1; } } Py_DECREF(gc); #endif } #endif return r; #endif } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, attr_name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(attr_name)); #endif __Pyx_DECREF_TypeName(type_name); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* PyObject_GenericGetAttr */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { return PyObject_GenericGetAttr(obj, attr_name); } return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); } #endif /* SetupReduce */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { int ret; PyObject *name_attr; name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name_2); if (likely(name_attr)) { ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); } else { ret = -1; } if (unlikely(ret < 0)) { PyErr_Clear(); ret = 0; } Py_XDECREF(name_attr); return ret; } static int __Pyx_setup_reduce(PyObject* type_obj) { int ret = 0; PyObject *object_reduce = NULL; PyObject *object_getstate = NULL; PyObject *object_reduce_ex = NULL; PyObject *reduce = NULL; PyObject *reduce_ex = NULL; PyObject *reduce_cython = NULL; PyObject *setstate = NULL; PyObject *setstate_cython = NULL; PyObject *getstate = NULL; #if CYTHON_USE_PYTYPE_LOOKUP getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate); #else getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate); if (!getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (getstate) { #if CYTHON_USE_PYTYPE_LOOKUP object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate); #else object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate); if (!object_getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (object_getstate != getstate) { goto __PYX_GOOD; } } #if CYTHON_USE_PYTYPE_LOOKUP object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #else object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #endif reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; if (reduce_ex == object_reduce_ex) { #if CYTHON_USE_PYTYPE_LOOKUP object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #else object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #endif reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); if (likely(reduce_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (reduce == object_reduce || PyErr_Occurred()) { goto __PYX_BAD; } setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate); if (!setstate) PyErr_Clear(); if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); if (likely(setstate_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (!setstate || PyErr_Occurred()) { goto __PYX_BAD; } } PyType_Modified((PyTypeObject*)type_obj); } } goto __PYX_GOOD; __PYX_BAD: if (!PyErr_Occurred()) { __Pyx_TypeName type_obj_name = __Pyx_PyType_GetName((PyTypeObject*)type_obj); PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name); __Pyx_DECREF_TypeName(type_obj_name); } ret = -1; __PYX_GOOD: #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); Py_XDECREF(object_getstate); Py_XDECREF(getstate); #endif Py_XDECREF(reduce); Py_XDECREF(reduce_ex); Py_XDECREF(reduce_cython); Py_XDECREF(setstate); Py_XDECREF(setstate_cython); return ret; } #endif /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s__10; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* ClassMethod */ static PyObject* __Pyx_Method_ClassMethod(PyObject *method) { #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM <= 0x05080000 if (PyObject_TypeCheck(method, &PyWrapperDescr_Type)) { return PyClassMethod_New(method); } #else #if CYTHON_COMPILING_IN_PYPY if (PyMethodDescr_Check(method)) #else #if PY_MAJOR_VERSION == 2 static PyTypeObject *methoddescr_type = NULL; if (unlikely(methoddescr_type == NULL)) { PyObject *meth = PyObject_GetAttrString((PyObject*)&PyList_Type, "append"); if (unlikely(!meth)) return NULL; methoddescr_type = Py_TYPE(meth); Py_DECREF(meth); } #else PyTypeObject *methoddescr_type = &PyMethodDescr_Type; #endif if (__Pyx_TypeCheck(method, methoddescr_type)) #endif { PyMethodDescrObject *descr = (PyMethodDescrObject *)method; #if PY_VERSION_HEX < 0x03020000 PyTypeObject *d_type = descr->d_type; #else PyTypeObject *d_type = descr->d_common.d_type; #endif return PyDescr_NewClassMethod(d_type, descr->d_method); } #endif else if (PyMethod_Check(method)) { return PyClassMethod_New(PyMethod_GET_FUNCTION(method)); } else { return PyClassMethod_New(method); } } /* GetNameInClass */ static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) { PyObject *result; PyObject *dict; assert(PyType_Check(nmspace)); #if CYTHON_USE_TYPE_SLOTS dict = ((PyTypeObject*)nmspace)->tp_dict; Py_XINCREF(dict); #else dict = PyObject_GetAttr(nmspace, __pyx_n_s_dict); #endif if (likely(dict)) { result = PyObject_GetItem(dict, name); Py_DECREF(dict); if (result) { return result; } } PyErr_Clear(); __Pyx_GetModuleGlobalNameUncached(result, name); return result; } /* Py3UpdateBases */ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases) { Py_ssize_t i, j, size_bases; PyObject *base, *meth, *new_base, *result, *new_bases = NULL; size_bases = PyTuple_GET_SIZE(bases); for (i = 0; i < size_bases; i++) { base = PyTuple_GET_ITEM(bases, i); if (PyType_Check(base)) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { goto error; } } continue; } meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_n_s_mro_entries); if (!meth && PyErr_Occurred()) { goto error; } if (!meth) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { goto error; } } continue; } new_base = __Pyx_PyObject_CallOneArg(meth, bases); Py_DECREF(meth); if (!new_base) { goto error; } if (!PyTuple_Check(new_base)) { PyErr_SetString(PyExc_TypeError, "__mro_entries__ must return a tuple"); Py_DECREF(new_base); goto error; } if (!new_bases) { if (!(new_bases = PyList_New(i))) { goto error; } for (j = 0; j < i; j++) { base = PyTuple_GET_ITEM(bases, j); PyList_SET_ITEM(new_bases, j, base); Py_INCREF(base); } } j = PyList_GET_SIZE(new_bases); if (PyList_SetSlice(new_bases, j, j, new_base) < 0) { goto error; } Py_DECREF(new_base); } if (!new_bases) { Py_INCREF(bases); return bases; } result = PyList_AsTuple(new_bases); Py_DECREF(new_bases); return result; error: Py_XDECREF(new_bases); return NULL; } /* CalculateMetaclass */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases; #if CYTHON_ASSUME_SAFE_MACROS nbases = PyTuple_GET_SIZE(bases); #else nbases = PyTuple_Size(bases); if (nbases < 0) return NULL; #endif for (i=0; i < nbases; i++) { PyTypeObject *tmptype; #if CYTHON_ASSUME_SAFE_MACROS PyObject *tmp = PyTuple_GET_ITEM(bases, i); #else PyObject *tmp = PyTuple_GetItem(bases, i); if (!tmp) return NULL; #endif tmptype = Py_TYPE(tmp); #if PY_MAJOR_VERSION < 3 if (tmptype == &PyClass_Type) continue; #endif if (!metaclass) { metaclass = tmptype; continue; } if (PyType_IsSubtype(metaclass, tmptype)) continue; if (PyType_IsSubtype(tmptype, metaclass)) { metaclass = tmptype; continue; } PyErr_SetString(PyExc_TypeError, "metaclass conflict: " "the metaclass of a derived class " "must be a (non-strict) subclass " "of the metaclasses of all its bases"); return NULL; } if (!metaclass) { #if PY_MAJOR_VERSION < 3 metaclass = &PyClass_Type; #else metaclass = &PyType_Type; #endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; } /* PyObjectLookupSpecial */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) { PyObject *res; PyTypeObject *tp = Py_TYPE(obj); #if PY_MAJOR_VERSION < 3 if (unlikely(PyInstance_Check(obj))) return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name); #endif res = _PyType_Lookup(tp, attr_name); if (likely(res)) { descrgetfunc f = Py_TYPE(res)->tp_descr_get; if (!f) { Py_INCREF(res); } else { res = f(res, obj, (PyObject *)tp); } } else if (with_error) { PyErr_SetObject(PyExc_AttributeError, attr_name); } return res; } #endif /* Py3ClassCreate */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; if (metaclass) { PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare); if (prep) { PyObject *pargs[3] = {NULL, name, bases}; ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); Py_DECREF(prep); } else { if (unlikely(PyErr_Occurred())) return NULL; ns = PyDict_New(); } } else { ns = PyDict_New(); } if (unlikely(!ns)) return NULL; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; #if PY_VERSION_HEX >= 0x03030000 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; #else CYTHON_MAYBE_UNUSED_VAR(qualname); #endif if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; return ns; bad: Py_DECREF(ns); return NULL; } #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS static int __Pyx_SetNamesPEP487(PyObject *type_obj) { PyTypeObject *type = (PyTypeObject*) type_obj; PyObject *names_to_set, *key, *value, *set_name, *tmp; Py_ssize_t i = 0; #if CYTHON_USE_TYPE_SLOTS names_to_set = PyDict_Copy(type->tp_dict); #else { PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict); names_to_set = NULL; if (likely(d)) { PyObject *names_to_set = PyDict_New(); int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1; Py_DECREF(d); if (unlikely(ret < 0)) Py_CLEAR(names_to_set); } } #endif if (unlikely(names_to_set == NULL)) goto bad; while (PyDict_Next(names_to_set, &i, &key, &value)) { set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name); if (unlikely(set_name != NULL)) { tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key); Py_DECREF(set_name); if (unlikely(tmp == NULL)) { __Pyx_TypeName value_type_name = __Pyx_PyType_GetName(Py_TYPE(value)); __Pyx_TypeName type_name = __Pyx_PyType_GetName(type); PyErr_Format(PyExc_RuntimeError, #if PY_MAJOR_VERSION >= 3 "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'", value_type_name, key, type_name); #else "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'", value_type_name, PyString_Check(key) ? PyString_AS_STRING(key) : "?", type_name); #endif goto bad; } else { Py_DECREF(tmp); } } else if (unlikely(PyErr_Occurred())) { goto bad; } } Py_DECREF(names_to_set); return 0; bad: Py_XDECREF(names_to_set); return -1; } static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) { #if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS PyTypeObject *type = (PyTypeObject*) type_obj; PyObject *mro = type->tp_mro; Py_ssize_t i, nbases; if (unlikely(!mro)) goto done; (void) &__Pyx_GetBuiltinName; Py_INCREF(mro); nbases = PyTuple_GET_SIZE(mro); assert(PyTuple_GET_ITEM(mro, 0) == type_obj); for (i = 1; i < nbases-1; i++) { PyObject *base, *dict, *meth; base = PyTuple_GET_ITEM(mro, i); dict = ((PyTypeObject *)base)->tp_dict; meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass); if (unlikely(meth)) { descrgetfunc f = Py_TYPE(meth)->tp_descr_get; PyObject *res; Py_INCREF(meth); if (likely(f)) { res = f(meth, NULL, type_obj); Py_DECREF(meth); if (unlikely(!res)) goto bad; meth = res; } res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw); Py_DECREF(meth); if (unlikely(!res)) goto bad; Py_DECREF(res); goto done; } else if (unlikely(PyErr_Occurred())) { goto bad; } } done: Py_XDECREF(mro); return type_obj; bad: Py_XDECREF(mro); Py_DECREF(type_obj); return NULL; #else PyObject *super_type, *super, *func, *res; #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) super_type = __Pyx_GetBuiltinName(__pyx_n_s_super); #else super_type = (PyObject*) &PySuper_Type; (void) &__Pyx_GetBuiltinName; #endif super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL; #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) Py_XDECREF(super_type); #endif if (unlikely(!super)) { Py_CLEAR(type_obj); goto done; } func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass); Py_DECREF(super); if (likely(!func)) { if (unlikely(PyErr_Occurred())) Py_CLEAR(type_obj); goto done; } res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw); Py_DECREF(func); if (unlikely(!res)) Py_CLEAR(type_obj); Py_XDECREF(res); done: return type_obj; #endif } #endif static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass) { PyObject *result; PyObject *owned_metaclass = NULL; PyObject *margs[4] = {NULL, name, bases, dict}; if (allow_py2_metaclass) { owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { PyErr_Clear(); } else { return NULL; } } if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); Py_XDECREF(owned_metaclass); if (unlikely(!metaclass)) return NULL; owned_metaclass = metaclass; } result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, #if PY_VERSION_HEX < 0x030600A4 (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw #else mkw #endif ); Py_XDECREF(owned_metaclass); #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS if (likely(result) && likely(PyType_Check(result))) { if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) { Py_CLEAR(result); } else { result = __Pyx_InitSubclassPEP487(result, mkw); } } #else (void) &__Pyx_GetBuiltinName; #endif return result; } /* CyFunctionClassCell */ static int __Pyx_CyFunction_InitClassCell(PyObject *cyfunctions, PyObject *classobj) { Py_ssize_t i, count = PyList_GET_SIZE(cyfunctions); for (i = 0; i < count; i++) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS PyList_GET_ITEM(cyfunctions, i); #else PySequence_ITEM(cyfunctions, i); if (unlikely(!m)) return -1; #endif __Pyx_CyFunction_SetClassObj(m, classobj); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF((PyObject*)m); #endif } return 0; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (long) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (long) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = __Pyx_NewRef(v); } val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (int) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (int) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = __Pyx_NewRef(v); } val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_PY_LONG_LONG(unsigned PY_LONG_LONG value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG) -1, const_zero = (unsigned PY_LONG_LONG) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(unsigned PY_LONG_LONG) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(unsigned PY_LONG_LONG) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(unsigned PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(unsigned PY_LONG_LONG) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(unsigned PY_LONG_LONG) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(unsigned PY_LONG_LONG), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(unsigned PY_LONG_LONG)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name_2); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__100); } return name; } #endif /* CheckBinaryVersion */ static unsigned long __Pyx_get_runtime_version(void) { #if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/compress.pyx0000644000076500000240000005356314641074756016357 0ustar00twstaff""" borg.compress ============= Compression is applied to chunks after ID hashing (so the ID is a direct function of the plain chunk, compression is irrelevant to it), and of course before encryption. The "auto" mode (e.g. --compression auto,lzma,4) is implemented as a meta Compressor, meaning that Auto acts like a Compressor, but defers actual work to others (namely LZ4 as a heuristic whether compression is worth it, and the specified Compressor for the actual compression). Decompression is normally handled through Compressor.decompress which will detect which compressor has been used to compress the data and dispatch to the correct decompressor. """ from argparse import ArgumentTypeError import random from struct import Struct import zlib try: import lzma except ImportError: lzma = None from .constants import MAX_DATA_SIZE from .helpers import Buffer, DecompressionError API_VERSION = '1.4_01' cdef extern from "lz4.h": int LZ4_compress_default(const char* source, char* dest, int inputSize, int maxOutputSize) nogil int LZ4_decompress_safe(const char* source, char* dest, int inputSize, int maxOutputSize) nogil int LZ4_compressBound(int inputSize) nogil cdef extern from "zstd.h": size_t ZSTD_compress(void* dst, size_t dstCapacity, const void* src, size_t srcSize, int compressionLevel) nogil size_t ZSTD_decompress(void* dst, size_t dstCapacity, const void* src, size_t compressedSize) nogil size_t ZSTD_compressBound(size_t srcSize) nogil unsigned long long ZSTD_CONTENTSIZE_UNKNOWN unsigned long long ZSTD_CONTENTSIZE_ERROR unsigned long long ZSTD_getFrameContentSize(const void *src, size_t srcSize) nogil unsigned ZSTD_isError(size_t code) nogil const char* ZSTD_getErrorName(size_t code) nogil buffer = Buffer(bytearray, size=0) cdef class CompressorBase: """ base class for all (de)compression classes, also handles compression format auto detection and adding/stripping the ID header (which enable auto detection). """ ID = b'\xFF\xFF' # reserved and not used # overwrite with a unique 2-bytes bytestring in child classes name = 'baseclass' @classmethod def detect(cls, data): return data.startswith(cls.ID) def __init__(self, **kwargs): pass def decide(self, data): """ Return which compressor will perform the actual compression for *data*. This exists for a very specific case: If borg recreate is instructed to recompress using Auto compression it needs to determine the _actual_ target compression of a chunk in order to detect whether it should be recompressed. Any compressor may return a compressor other than *self*, like e.g. the CNONE compressor, and should actually do so if *data* would become larger on compression. """ return self def compress(self, data): """ Compress *data* (bytes) and return bytes result. Prepend the ID bytes of this compressor, which is needed so that the correct decompressor can be used for decompression. """ # add ID bytes return self.ID + data def decompress(self, data): """ Decompress *data* (bytes) and return bytes result. The leading Compressor ID bytes need to be present. Only handles input generated by _this_ Compressor - for a general purpose decompression method see *Compressor.decompress*. """ # strip ID bytes return data[2:] cdef class DecidingCompressor(CompressorBase): """ base class for (de)compression classes that (based on an internal _decide method) decide whether and how to compress data. """ name = 'decidebaseclass' def __init__(self, **kwargs): super().__init__(**kwargs) def _decide(self, data): """ Decides what to do with *data*. Returns (compressor, compressed_data). *compressed_data* can be the result of *data* being processed by *compressor*, if that is generated as a side-effect of the decision process, or None otherwise. This private method allows for more efficient implementation of compress() and decide_compress() making use of *compressed_data*, if already generated. """ raise NotImplementedError def decide(self, data): return self._decide(data)[0] def decide_compress(self, data): """ Decides what to do with *data* and handle accordingly. Returns (compressor, compressed_data). *compressed_data* is the result of *data* being processed by *compressor*. """ compressor, compressed_data = self._decide(data) if compressed_data is None: compressed_data = compressor.compress(data) if compressor is self: # call super class to add ID bytes return self, super().compress(compressed_data) return compressor, compressed_data def compress(self, data): return self.decide_compress(data)[1] class CNONE(CompressorBase): """ none - no compression, just pass through data """ ID = b'\x00\x00' name = 'none' def compress(self, data): return super().compress(data) def decompress(self, data): data = super().decompress(data) if not isinstance(data, bytes): data = bytes(data) return data class LZ4(DecidingCompressor): """ raw LZ4 compression / decompression (liblz4). Features: - lz4 is super fast - wrapper releases CPython's GIL to support multithreaded code - uses safe lz4 methods that never go beyond the end of the output buffer """ ID = b'\x01\x00' name = 'lz4' def __init__(self, **kwargs): pass def _decide(self, idata): """ Decides what to do with *data*. Returns (compressor, lz4_data). *lz4_data* is the LZ4 result if *compressor* is LZ4 as well, otherwise it is None. """ if not isinstance(idata, bytes): idata = bytes(idata) # code below does not work with memoryview cdef int isize = len(idata) cdef int osize cdef char *source = idata cdef char *dest osize = LZ4_compressBound(isize) buf = buffer.get(osize) dest = buf with nogil: osize = LZ4_compress_default(source, dest, isize, osize) if not osize: raise Exception('lz4 compress failed') # only compress if the result actually is smaller if osize < isize: return self, dest[:osize] else: return NONE_COMPRESSOR, None def decompress(self, idata): if not isinstance(idata, bytes): idata = bytes(idata) # code below does not work with memoryview idata = super().decompress(idata) cdef int isize = len(idata) cdef int osize cdef int rsize cdef char *source = idata cdef char *dest # a bit more than 8MB is enough for the usual data sizes yielded by the chunker. # allocate more if isize * 3 is already bigger, to avoid having to resize often. osize = max(int(1.1 * 2**23), isize * 3) while True: try: buf = buffer.get(osize) except MemoryError: raise DecompressionError('MemoryError') dest = buf with nogil: rsize = LZ4_decompress_safe(source, dest, isize, osize) if rsize >= 0: break if osize > 2 ** 27: # 128MiB (should be enough, considering max. repo obj size and very good compression) # this is insane, get out of here raise DecompressionError('lz4 decompress failed') # likely the buffer was too small, get a bigger one: osize = int(1.5 * osize) return dest[:rsize] class LZMA(DecidingCompressor): """ lzma compression / decompression """ ID = b'\x02\x00' name = 'lzma' def __init__(self, level=6, **kwargs): super().__init__(**kwargs) self.level = level if lzma is None: raise ValueError('No lzma support found.') def _decide(self, data): """ Decides what to do with *data*. Returns (compressor, lzma_data). *lzma_data* is the LZMA result if *compressor* is LZMA as well, otherwise it is None. """ # we do not need integrity checks in lzma, we do that already lzma_data = lzma.compress(data, preset=self.level, check=lzma.CHECK_NONE) if len(lzma_data) < len(data): return self, lzma_data else: return NONE_COMPRESSOR, None def decompress(self, data): data = super().decompress(data) try: return lzma.decompress(data) except lzma.LZMAError as e: raise DecompressionError(str(e)) from None class ZSTD(DecidingCompressor): """zstd compression / decompression (pypi: zstandard, gh: python-zstandard)""" # This is a NOT THREAD SAFE implementation. # Only ONE python context must be created at a time. # It should work flawlessly as long as borg will call ONLY ONE compression job at time. ID = b'\x03\x00' name = 'zstd' def __init__(self, level=3, **kwargs): super().__init__(**kwargs) self.level = level def _decide(self, idata): """ Decides what to do with *data*. Returns (compressor, zstd_data). *zstd_data* is the ZSTD result if *compressor* is ZSTD as well, otherwise it is None. """ if not isinstance(idata, bytes): idata = bytes(idata) # code below does not work with memoryview cdef int isize = len(idata) cdef int osize cdef char *source = idata cdef char *dest cdef int level = self.level osize = ZSTD_compressBound(isize) buf = buffer.get(osize) dest = buf with nogil: osize = ZSTD_compress(dest, osize, source, isize, level) if ZSTD_isError(osize): raise Exception('zstd compress failed: %s' % ZSTD_getErrorName(osize)) # only compress if the result actually is smaller if osize < isize: return self, dest[:osize] else: return NONE_COMPRESSOR, None def decompress(self, idata): if not isinstance(idata, bytes): idata = bytes(idata) # code below does not work with memoryview idata = super().decompress(idata) cdef int isize = len(idata) cdef unsigned long long osize cdef unsigned long long rsize cdef char *source = idata cdef char *dest osize = ZSTD_getFrameContentSize(source, isize) if osize == ZSTD_CONTENTSIZE_ERROR: raise DecompressionError('zstd get size failed: data was not compressed by zstd') if osize == ZSTD_CONTENTSIZE_UNKNOWN: raise DecompressionError('zstd get size failed: original size unknown') try: buf = buffer.get(osize) except MemoryError: raise DecompressionError('MemoryError') dest = buf with nogil: rsize = ZSTD_decompress(dest, osize, source, isize) if ZSTD_isError(rsize): raise DecompressionError('zstd decompress failed: %s' % ZSTD_getErrorName(rsize)) if rsize != osize: raise DecompressionError('zstd decompress failed: size mismatch') return dest[:osize] class ZLIB(CompressorBase): """ zlib compression / decompression (python stdlib) """ ID = b'\x08\x00' # not used here, see detect() # avoid all 0x.8.. IDs elsewhere! name = 'zlib' @classmethod def detect(cls, data): # matches misc. patterns 0x.8.. used by zlib cmf, flg = data[:2] is_deflate = cmf & 0x0f == 8 check_ok = (cmf * 256 + flg) % 31 == 0 return check_ok and is_deflate def __init__(self, level=6, **kwargs): super().__init__(**kwargs) self.level = level def compress(self, data): # note: for compatibility no super call, do not add ID bytes return zlib.compress(data, self.level) def decompress(self, data): # note: for compatibility no super call, do not strip ID bytes try: return zlib.decompress(data) except zlib.error as e: raise DecompressionError(str(e)) from None class Auto(CompressorBase): """ Meta-Compressor that decides which compression to use based on LZ4's ratio. As a meta-Compressor the actual compression is deferred to other Compressors, therefore this Compressor has no ID, no detect() and no decompress(). """ ID = None name = 'auto' def __init__(self, compressor): super().__init__() self.compressor = compressor def _decide(self, data): """ Decides what to do with *data*. Returns (compressor, compressed_data). *compressor* is the compressor that is decided to be best suited to compress *data*, *compressed_data* is the result of *data* being compressed by a compressor, which may or may not be *compressor*! There are three possible outcomes of the decision process: * *data* compresses well enough for trying the more expensive compressor set on instantiation to make sense. In this case, (expensive_compressor_class, lz4_compressed_data) is returned. * *data* compresses only slightly using the LZ4 compressor, thus trying the more expensive compressor for potentially little gain does not make sense. In this case, (LZ4_COMPRESSOR, lz4_compressed_data) is returned. * *data* does not compress at all using LZ4, in this case (NONE_COMPRESSOR, none_compressed_data) is returned. Note: While it makes no sense, the expensive compressor may well be set to the LZ4 compressor. """ compressor, compressed_data = LZ4_COMPRESSOR.decide_compress(data) # compressed_data includes the compression type header, while data does not yet ratio = len(compressed_data) / (len(data) + 2) if ratio < 0.97: return self.compressor, compressed_data else: return compressor, compressed_data def decide(self, data): return self._decide(data)[0] def compress(self, data): compressor, cheap_compressed_data = self._decide(data) if compressor in (LZ4_COMPRESSOR, NONE_COMPRESSOR): # we know that trying to compress with expensive compressor is likely pointless, # so we fallback to return the cheap compressed data. return cheap_compressed_data # if we get here, the decider decided to try the expensive compressor. # we also know that the compressed data returned by the decider is lz4 compressed. expensive_compressed_data = compressor.compress(data) ratio = len(expensive_compressed_data) / len(cheap_compressed_data) if ratio < 0.99: # the expensive compressor managed to squeeze the data significantly better than lz4. return expensive_compressed_data else: # otherwise let's just store the lz4 data, which decompresses extremely fast. return cheap_compressed_data def decompress(self, data): raise NotImplementedError def detect(cls, data): raise NotImplementedError class ObfuscateSize(CompressorBase): """ Meta-Compressor that obfuscates the compressed data size. """ ID = b'\x04\x00' name = 'obfuscate' header_fmt = Struct('>I') header_len = len(header_fmt.pack(0)) def __init__(self, level=None, compressor=None): super().__init__() self.compressor = compressor if level is None: pass # decompression elif 1 <= level <= 6: self._obfuscate = self._relative_random_reciprocal_obfuscate self.factor = 0.001 * 10 ** level self.min_r = 0.0001 elif 110 <= level <= 123: self._obfuscate = self._random_padding_obfuscate self.max_padding_size = 2 ** (level - 100) # 1kiB .. 8MiB def _obfuscate(self, compr_size): # implementations need to return the size of obfuscation data, # that the caller shall add. raise NotImplemented def _relative_random_reciprocal_obfuscate(self, compr_size): # effect for SPEC 1: # f = 0.01 .. 0.1 for r in 1.0 .. 0.1 == in 90% of cases # f = 0.1 .. 1.0 for r in 0.1 .. 0.01 == in 9% of cases # f = 1.0 .. 10.0 for r in 0.01 .. 0.001 = in 0.9% of cases # f = 10.0 .. 100.0 for r in 0.001 .. 0.0001 == in 0.09% of cases r = max(self.min_r, random.random()) # 0..1, but don't get too close to 0 f = self.factor / r return int(compr_size * f) def _random_padding_obfuscate(self, compr_size): return int(self.max_padding_size * random.random()) def compress(self, data): compressed_data = self.compressor.compress(data) # compress data compr_size = len(compressed_data) header = self.header_fmt.pack(compr_size) addtl_size = self._obfuscate(compr_size) addtl_size = max(0, addtl_size) # we can only make it longer, not shorter! addtl_size = min(MAX_DATA_SIZE - 1024 - compr_size, addtl_size) # stay away from MAX_DATA_SIZE trailer = bytes(addtl_size) obfuscated_data = b''.join([header, compressed_data, trailer]) return super().compress(obfuscated_data) # add ID header def decompress(self, data): if not isinstance(data, memoryview): data = memoryview(data) obfuscated_data = super().decompress(data) # remove obfuscator ID header compr_size = self.header_fmt.unpack(obfuscated_data[0:self.header_len])[0] compressed_data = obfuscated_data[self.header_len:self.header_len+compr_size] if self.compressor is None: self.compressor = Compressor.detect(compressed_data)() return self.compressor.decompress(compressed_data) # decompress data # Maps valid compressor names to their class COMPRESSOR_TABLE = { CNONE.name: CNONE, LZ4.name: LZ4, ZLIB.name: ZLIB, LZMA.name: LZMA, Auto.name: Auto, ZSTD.name: ZSTD, ObfuscateSize.name: ObfuscateSize, } # List of possible compression types. Does not include Auto, since it is a meta-Compressor. COMPRESSOR_LIST = [LZ4, ZSTD, CNONE, ZLIB, LZMA, ObfuscateSize, ] # check fast stuff first def get_compressor(name, **kwargs): cls = COMPRESSOR_TABLE[name] return cls(**kwargs) # compressor instances to be used by all other compressors NONE_COMPRESSOR = get_compressor('none') LZ4_COMPRESSOR = get_compressor('lz4') class Compressor: """ compresses using a compressor with given name and parameters decompresses everything we can handle (autodetect) """ def __init__(self, name='null', **kwargs): self.params = kwargs self.compressor = get_compressor(name, **self.params) def compress(self, data): return self.compressor.compress(data) def decompress(self, data): compressor_cls = self.detect(data) return compressor_cls(**self.params).decompress(data) @staticmethod def detect(data): hdr = bytes(data[:2]) # detect() does not work with memoryview for cls in COMPRESSOR_LIST: if cls.detect(hdr): return cls else: raise ValueError('No decompressor for this data found: %r.', data[:2]) class CompressionSpec: def __init__(self, s): values = s.split(',') count = len(values) if count < 1: raise ArgumentTypeError("not enough arguments") # --compression algo[,level] self.name = values[0] if self.name in ('none', 'lz4', ): return elif self.name in ('zlib', 'lzma', ): if count < 2: level = 6 # default compression level in py stdlib elif count == 2: level = int(values[1]) if not 0 <= level <= 9: raise ArgumentTypeError("level must be >= 0 and <= 9") else: raise ArgumentTypeError("too many arguments") self.level = level elif self.name in ('zstd', ): if count < 2: level = 3 # default compression level in zstd elif count == 2: level = int(values[1]) if not 1 <= level <= 22: raise ArgumentTypeError("level must be >= 1 and <= 22") else: raise ArgumentTypeError("too many arguments") self.level = level elif self.name == 'auto': if 2 <= count <= 3: compression = ','.join(values[1:]) else: raise ArgumentTypeError("bad arguments") self.inner = CompressionSpec(compression) elif self.name == 'obfuscate': if 3 <= count <= 5: level = int(values[1]) if not ((1 <= level <= 6) or (110 <= level <= 123)): raise ArgumentTypeError("level must be >= 1 and <= 6 or >= 110 and <= 123") self.level = level compression = ','.join(values[2:]) else: raise ArgumentTypeError("bad arguments") self.inner = CompressionSpec(compression) else: raise ArgumentTypeError("unsupported compression type") @property def compressor(self): if self.name in ('none', 'lz4', ): return get_compressor(self.name) elif self.name in ('zlib', 'lzma', 'zstd', ): return get_compressor(self.name, level=self.level) elif self.name == 'auto': return get_compressor(self.name, compressor=self.inner.compressor) elif self.name == 'obfuscate': return get_compressor(self.name, level=self.level, compressor=self.inner.compressor) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/constants.py0000644000076500000240000001241214641074756016334 0ustar00twstaff# this set must be kept complete, otherwise the RobustUnpacker might malfunction: ITEM_KEYS = frozenset(['path', 'source', 'rdev', 'chunks', 'chunks_healthy', 'hardlink_master', 'mode', 'user', 'group', 'uid', 'gid', 'mtime', 'atime', 'ctime', 'birthtime', 'size', 'xattrs', 'bsdflags', 'acl_nfs4', 'acl_access', 'acl_default', 'acl_extended', 'part']) # this is the set of keys that are always present in items: REQUIRED_ITEM_KEYS = frozenset(['path', 'mtime', ]) # this set must be kept complete, otherwise rebuild_manifest might malfunction: ARCHIVE_KEYS = frozenset(['version', 'name', 'items', 'cmdline', 'hostname', 'username', 'time', 'time_end', 'comment', 'chunker_params', 'recreate_cmdline', 'recreate_source_id', 'recreate_args', 'recreate_partial_chunks', # used in 1.1.0b1 .. b2 'size', 'csize', 'nfiles', 'size_parts', 'csize_parts', 'nfiles_parts', ]) # this is the set of keys that are always present in archives: REQUIRED_ARCHIVE_KEYS = frozenset(['version', 'name', 'items', 'cmdline', 'time', ]) # default umask, overridden by --umask, defaults to read/write only for owner UMASK_DEFAULT = 0o077 # default file mode to store stdin data, defaults to read/write for owner and group # forcing to 0o100XXX later STDIN_MODE_DEFAULT = 0o660 CACHE_TAG_NAME = 'CACHEDIR.TAG' CACHE_TAG_CONTENTS = b'Signature: 8a477f597d28d172789f06886806bc55' # A large, but not unreasonably large segment size. Always less than 2 GiB (for legacy file systems). We choose # 500 MiB which means that no indirection from the inode is needed for typical Linux file systems. # Note that this is a soft-limit and can be exceeded (worst case) by a full maximum chunk size and some metadata # bytes. That's why it's 500 MiB instead of 512 MiB. DEFAULT_MAX_SEGMENT_SIZE = 500 * 1024 * 1024 # 20 MiB minus 41 bytes for a Repository header (because the "size" field in the Repository includes # the header, and the total size was set to 20 MiB). MAX_DATA_SIZE = 20971479 # MAX_OBJECT_SIZE = <20 MiB (MAX_DATA_SIZE) + 41 bytes for a Repository PUT header, which consists of # a 1 byte tag ID, 4 byte CRC, 4 byte size and 32 bytes for the ID. MAX_OBJECT_SIZE = MAX_DATA_SIZE + 41 # see LoggedIO.put_header_fmt.size assertion in repository module assert MAX_OBJECT_SIZE == 20 * 1024 * 1024 # repo config max_segment_size value must be below this limit to stay within uint32 offsets: MAX_SEGMENT_SIZE_LIMIT = 2 ** 32 - MAX_OBJECT_SIZE # have one all-zero bytes object # we use it at all places where we need to detect or create all-zero buffers zeros = bytes(MAX_DATA_SIZE) # borg.remote read() buffer size BUFSIZE = 10 * 1024 * 1024 # to use a safe, limited unpacker, we need to set a upper limit to the archive count in the manifest. # this does not mean that you can always really reach that number, because it also needs to be less than # MAX_DATA_SIZE or it will trigger the check for that. MAX_ARCHIVES = 400000 # repo.list() / .scan() result count limit the borg client uses LIST_SCAN_LIMIT = 100000 DEFAULT_SEGMENTS_PER_DIR = 1000 # Some bounds on segment / segment_dir indexes MIN_SEGMENT_INDEX = 0 MAX_SEGMENT_INDEX = 2**32 - 1 MIN_SEGMENT_DIR_INDEX = 0 MAX_SEGMENT_DIR_INDEX = 2**32 - 1 FD_MAX_AGE = 4 * 60 # 4 minutes CHUNK_MIN_EXP = 19 # 2**19 == 512kiB CHUNK_MAX_EXP = 23 # 2**23 == 8MiB HASH_WINDOW_SIZE = 0xfff # 4095B HASH_MASK_BITS = 21 # results in ~2MiB chunks statistically # chunker algorithms CH_BUZHASH = 'buzhash' CH_FIXED = 'fixed' # defaults, use --chunker-params to override CHUNKER_PARAMS = (CH_BUZHASH, CHUNK_MIN_EXP, CHUNK_MAX_EXP, HASH_MASK_BITS, HASH_WINDOW_SIZE) # chunker params for the items metadata stream, finer granularity ITEMS_CHUNKER_PARAMS = (CH_BUZHASH, 15, 19, 17, HASH_WINDOW_SIZE) # normal on-disk data, allocated (but not written, all zeros), not allocated hole (all zeros) CH_DATA, CH_ALLOC, CH_HOLE = 0, 1, 2 # operating mode of the files cache (for fast skipping of unchanged files) FILES_CACHE_MODE_UI_DEFAULT = 'ctime,size,inode' # default for "borg create" command (CLI UI) FILES_CACHE_MODE_DISABLED = 'd' # most borg commands do not use the files cache at all (disable) # return codes returned by borg command EXIT_SUCCESS = 0 # everything done, no problems EXIT_WARNING = 1 # reached normal end of operation, but there were issues (generic warning) EXIT_ERROR = 2 # terminated abruptly, did not reach end of operation (generic error) EXIT_ERROR_BASE = 3 # specific error codes are 3..99 (enabled by BORG_EXIT_CODES=modern) EXIT_WARNING_BASE = 100 # specific warning codes are 100..127 (enabled by BORG_EXIT_CODES=modern) EXIT_SIGNAL_BASE = 128 # terminated due to signal, rc = 128 + sig_no # never use datetime.isoformat(), it is evil. always use one of these: # datetime.strftime(ISO_FORMAT) # output always includes .microseconds # datetime.strftime(ISO_FORMAT_NO_USECS) # output never includes microseconds ISO_FORMAT_NO_USECS = '%Y-%m-%dT%H:%M:%S' ISO_FORMAT = ISO_FORMAT_NO_USECS + '.%f' DASHES = '-' * 78 PBKDF2_ITERATIONS = 100000 REPOSITORY_README = """This is a Borg Backup repository. See https://borgbackup.readthedocs.io/ """ CACHE_README = """This is a Borg Backup cache. See https://borgbackup.readthedocs.io/ """ ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719958149.8283134 borgbackup-1.4.0/src/borg/crypto/0000755000076500000240000000000014641075206015255 5ustar00twstaff././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/crypto/__init__.py0000644000076500000240000000000014641074756017365 0ustar00twstaff././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/crypto/_crypto_helpers.c0000644000076500000240000000107114641074756020632 0ustar00twstaff/* some helpers, so our code also works with OpenSSL 1.0.x */ #include #include #if OPENSSL_VERSION_NUMBER < 0x10100000L || (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2070000fL) HMAC_CTX *HMAC_CTX_new(void) { HMAC_CTX *ctx = OPENSSL_malloc(sizeof(*ctx)); if (ctx != NULL) { memset(ctx, 0, sizeof *ctx); HMAC_CTX_cleanup(ctx); } return ctx; } void HMAC_CTX_free(HMAC_CTX *ctx) { if (ctx != NULL) { HMAC_CTX_cleanup(ctx); OPENSSL_free(ctx); } } #endif ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/crypto/_crypto_helpers.h0000644000076500000240000000047014641074756020641 0ustar00twstaff/* some helpers, so our code also works with OpenSSL 1.0.x */ #include #include #if OPENSSL_VERSION_NUMBER < 0x10100000L || (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2070000fL) HMAC_CTX *HMAC_CTX_new(void); void HMAC_CTX_free(HMAC_CTX *ctx); #endif ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/crypto/file_integrity.py0000644000076500000240000002027214641074756020660 0ustar00twstaffimport hashlib import io import json import os from hmac import compare_digest from ..helpers import IntegrityError from ..logger import create_logger from ..algorithms.checksums import StreamingXXH64 logger = create_logger() class FileLikeWrapper: def __enter__(self): self.fd.__enter__() return self def __exit__(self, exc_type, exc_val, exc_tb): self.fd.__exit__(exc_type, exc_val, exc_tb) def tell(self): return self.fd.tell() def seek(self, offset, whence=io.SEEK_SET): return self.fd.seek(offset, whence) def write(self, data): return self.fd.write(data) def read(self, n=None): return self.fd.read(n) def flush(self): self.fd.flush() def fileno(self): return self.fd.fileno() class FileHashingWrapper(FileLikeWrapper): """ Wrapper for file-like objects that computes a hash on-the-fly while reading/writing. WARNING: Seeks should only be used to query the size of the file, not to skip data, because skipped data isn't read and not hashed into the digest. Similarly skipping while writing to create sparse files is also not supported. Data has to be read/written in a symmetric fashion, otherwise different digests will be generated. Note: When used as a context manager read/write operations outside the enclosed scope are illegal. """ ALGORITHM = None FACTORY = None def __init__(self, backing_fd, write): self.fd = backing_fd self.writing = write self.hash = self.FACTORY() def __exit__(self, exc_type, exc_val, exc_tb): if exc_type is None: self.hash_length() super().__exit__(exc_type, exc_val, exc_tb) def write(self, data): """ Write *data* to backing file and update internal state. """ n = super().write(data) self.hash.update(data) return n def read(self, n=None): """ Read *data* from backing file (*n* has the usual meaning) and update internal state. """ data = super().read(n) self.hash.update(data) return data def hexdigest(self): """ Return current digest bytes as hex-string. Note: this can be called multiple times. """ return self.hash.hexdigest() def update(self, data: bytes): self.hash.update(data) def hash_length(self, seek_to_end=False): if seek_to_end: # Add length of file to the hash to avoid problems if only a prefix is read. self.seek(0, io.SEEK_END) self.hash.update(str(self.tell()).encode()) class SHA512FileHashingWrapper(FileHashingWrapper): ALGORITHM = 'SHA512' FACTORY = hashlib.sha512 class XXH64FileHashingWrapper(FileHashingWrapper): ALGORITHM = 'XXH64' FACTORY = StreamingXXH64 SUPPORTED_ALGORITHMS = { SHA512FileHashingWrapper.ALGORITHM: SHA512FileHashingWrapper, XXH64FileHashingWrapper.ALGORITHM: XXH64FileHashingWrapper, } class FileIntegrityError(IntegrityError): """File failed integrity check: {}""" exit_mcode = 91 class IntegrityCheckedFile(FileLikeWrapper): def __init__(self, path, write, filename=None, override_fd=None, integrity_data=None): self.path = path self.writing = write mode = 'wb' if write else 'rb' self.file_fd = override_fd or open(path, mode) self.file_opened = override_fd is None self.digests = {} hash_cls = XXH64FileHashingWrapper if not write: algorithm_and_digests = self.load_integrity_data(path, integrity_data) if algorithm_and_digests: algorithm, self.digests = algorithm_and_digests hash_cls = SUPPORTED_ALGORITHMS[algorithm] # TODO: When we're reading but don't have any digests, i.e. no integrity file existed, # TODO: then we could just short-circuit. self.fd = self.hasher = hash_cls(backing_fd=self.file_fd, write=write) self.hash_filename(filename) def load_integrity_data(self, path, integrity_data): if integrity_data is not None: return self.parse_integrity_data(path, integrity_data) def hash_filename(self, filename=None): # Hash the name of the file, but only the basename, ie. not the path. # In Borg the name itself encodes the context (eg. index.N, cache, files), # while the path doesn't matter, and moving e.g. a repository or cache directory is supported. # Changing the name however imbues a change of context that is not permissible. # While Borg does not use anything except ASCII in these file names, it's important to use # the same encoding everywhere for portability. Using os.fsencode() would be wrong. filename = os.path.basename(filename or self.path) self.hasher.update(('%10d' % len(filename)).encode()) self.hasher.update(filename.encode()) @classmethod def parse_integrity_data(cls, path: str, data: str): try: integrity_data = json.loads(data) # Provisions for agility now, implementation later, but make sure the on-disk joint is oiled. algorithm = integrity_data['algorithm'] if algorithm not in SUPPORTED_ALGORITHMS: logger.warning('Cannot verify integrity of %s: Unknown algorithm %r', path, algorithm) return digests = integrity_data['digests'] # Require at least presence of the final digest digests['final'] return algorithm, digests except (ValueError, TypeError, KeyError) as e: logger.warning('Could not parse integrity data for %s: %s', path, e) raise FileIntegrityError(path) def hash_part(self, partname, is_final=False): if not self.writing and not self.digests: return self.hasher.update(('%10d' % len(partname)).encode()) self.hasher.update(partname.encode()) self.hasher.hash_length(seek_to_end=is_final) digest = self.hasher.hexdigest() if self.writing: self.digests[partname] = digest elif self.digests and not compare_digest(self.digests.get(partname, ''), digest): raise FileIntegrityError(self.path) def __exit__(self, exc_type, exc_val, exc_tb): exception = exc_type is not None try: if not exception: self.hash_part("final", is_final=True) self.hasher.__exit__(exc_type, exc_val, exc_tb) finally: if self.file_opened: self.file_fd.close() if exception: return if self.writing: self.store_integrity_data(json.dumps({ 'algorithm': self.hasher.ALGORITHM, 'digests': self.digests, })) elif self.digests: logger.debug('Verified integrity of %s', self.path) def store_integrity_data(self, data: str): self.integrity_data = data class DetachedIntegrityCheckedFile(IntegrityCheckedFile): def __init__(self, path, write, filename=None, override_fd=None): super().__init__(path, write, filename, override_fd) filename = filename or os.path.basename(path) output_dir = os.path.dirname(path) self.output_integrity_file = self.integrity_file_path(os.path.join(output_dir, filename)) def load_integrity_data(self, path, integrity_data): assert not integrity_data, 'Cannot pass explicit integrity_data to DetachedIntegrityCheckedFile' return self.read_integrity_file(self.path) @staticmethod def integrity_file_path(path): return path + '.integrity' @classmethod def read_integrity_file(cls, path): try: with open(cls.integrity_file_path(path)) as fd: return cls.parse_integrity_data(path, fd.read()) except FileNotFoundError: logger.info('No integrity file found for %s', path) except OSError as e: logger.warning('Could not read integrity file for %s: %s', path, e) raise FileIntegrityError(path) def store_integrity_data(self, data: str): with open(self.output_integrity_file, 'w') as fd: fd.write(data) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/crypto/key.py0000644000076500000240000011250114641074756016430 0ustar00twstaffimport binascii import configparser import getpass import hmac import os import shlex import sys import textwrap import subprocess from hashlib import sha256, sha512, pbkdf2_hmac from ..logger import create_logger logger = create_logger() from .. import helpers from ..constants import * # NOQA from ..compress import Compressor from ..helpers import StableDict from ..helpers import Error, IntegrityError from ..helpers import yes from ..helpers import get_keys_dir, get_security_dir from ..helpers import get_limited_unpacker from ..helpers import bin_to_hex from ..helpers import prepare_subprocess_env from ..helpers import msgpack from ..item import Key, EncryptedKey from ..platform import SaveFile from .nonces import NonceManager from .low_level import AES, bytes_to_long, long_to_bytes, bytes_to_int, num_cipher_blocks, hmac_sha256, blake2b_256, hkdf_hmac_sha512 from .low_level import AES256_CTR_HMAC_SHA256, AES256_CTR_BLAKE2b # workaround for lost passphrase or key in "authenticated" or "authenticated-blake2" mode AUTHENTICATED_NO_KEY = 'authenticated_no_key' in helpers.workarounds class NoPassphraseFailure(Error): """can not acquire a passphrase: {}""" exit_mcode = 50 class PasscommandFailure(Error): """passcommand supplied in BORG_PASSCOMMAND failed: {}""" exit_mcode = 51 class PassphraseWrong(Error): """passphrase supplied in BORG_PASSPHRASE, by BORG_PASSCOMMAND or via BORG_PASSPHRASE_FD is incorrect.""" exit_mcode = 52 class PasswordRetriesExceeded(Error): """exceeded the maximum password retries""" exit_mcode = 53 class UnsupportedPayloadError(Error): """Unsupported payload type {}. A newer version is required to access this repository.""" exit_mcode = 48 class UnsupportedManifestError(Error): """Unsupported manifest envelope. A newer version is required to access this repository.""" exit_mcode = 27 class KeyfileNotFoundError(Error): """No key file for repository {} found in {}.""" exit_mcode = 42 class KeyfileInvalidError(Error): """Invalid key data for repository {} found in {}.""" exit_mcode = 40 class KeyfileMismatchError(Error): """Mismatch between repository {} and key file {}.""" exit_mcode = 41 class RepoKeyNotFoundError(Error): """No key entry found in the config of repository {}.""" exit_mcode = 44 class TAMRequiredError(IntegrityError): __doc__ = textwrap.dedent(""" Manifest is unauthenticated, but it is required for this repository. """).strip() traceback = True exit_mcode = 98 class ArchiveTAMRequiredError(TAMRequiredError): __doc__ = textwrap.dedent(""" Archive '{}' is unauthenticated, but it is required for this repository. """).strip() traceback = True exit_mcode = 96 class TAMInvalid(IntegrityError): __doc__ = IntegrityError.__doc__ traceback = True exit_mcode = 97 def __init__(self): # Error message becomes: "Data integrity error: Manifest authentication did not verify" super().__init__('Manifest authentication did not verify') class ArchiveTAMInvalid(IntegrityError): __doc__ = IntegrityError.__doc__ traceback = True exit_mcode = 95 def __init__(self): # Error message becomes: "Data integrity error: Archive authentication did not verify" super().__init__('Archive authentication did not verify') class TAMUnsupportedSuiteError(IntegrityError): """Could not verify manifest: Unsupported suite {!r}; a newer version is needed.""" traceback = True exit_mcode = 99 class KeyBlobStorage: NO_STORAGE = 'no_storage' KEYFILE = 'keyfile' REPO = 'repository' def key_creator(repository, args): for key in AVAILABLE_KEY_TYPES: if key.ARG_NAME == args.encryption: assert key.ARG_NAME is not None return key.create(repository, args) else: raise ValueError('Invalid encryption mode "%s"' % args.encryption) def key_argument_names(): return [key.ARG_NAME for key in AVAILABLE_KEY_TYPES if key.ARG_NAME] def identify_key(manifest_data): key_type = manifest_data[0] if key_type == PassphraseKey.TYPE: # we just dispatch to repokey mode and assume the passphrase was migrated to a repokey. # see also comment in PassphraseKey class. return RepoKey for key in AVAILABLE_KEY_TYPES: if key.TYPE == key_type: return key else: raise UnsupportedPayloadError(key_type) def key_factory(repository, manifest_data): return identify_key(manifest_data).detect(repository, manifest_data) def tam_required_file(repository): security_dir = get_security_dir(bin_to_hex(repository.id)) return os.path.join(security_dir, 'tam_required') def tam_required(repository): file = tam_required_file(repository) return os.path.isfile(file) class KeyBase: # Numeric key type ID, must fit in one byte. TYPE = None # override in subclasses # Human-readable name NAME = 'UNDEFINED' # Name used in command line / API (e.g. borg init --encryption=...) ARG_NAME = 'UNDEFINED' # Storage type (no key blob storage / keyfile / repo) STORAGE = KeyBlobStorage.NO_STORAGE # Seed for the buzhash chunker (borg.algorithms.chunker.Chunker) # type: int chunk_seed = None # Whether this *particular instance* is encrypted from a practical point of view, # i.e. when it's using encryption with a empty passphrase, then # that may be *technically* called encryption, but for all intents and purposes # that's as good as not encrypting in the first place, and this member should be False. # # The empty passphrase is also special because Borg tries it first when no passphrase # was supplied, and if an empty passphrase works, then Borg won't ask for one. logically_encrypted = False def __init__(self, repository): self.TYPE_STR = bytes([self.TYPE]) self.repository = repository self.target = None # key location file path / repo obj # Some commands write new chunks (e.g. rename) but don't take a --compression argument. This duplicates # the default used by those commands who do take a --compression argument. self.compressor = Compressor('lz4') self.decompress = self.compressor.decompress self.tam_required = True def id_hash(self, data): """Return HMAC hash using the "id" HMAC key """ def encrypt(self, chunk): pass def decrypt(self, id, data, decompress=True): pass def assert_id(self, id, data): if id: id_computed = self.id_hash(data) if not hmac.compare_digest(id_computed, id): raise IntegrityError('Chunk %s: id verification failed' % bin_to_hex(id)) def _tam_key(self, salt, context): return hkdf_hmac_sha512( ikm=self.id_key + self.enc_key + self.enc_hmac_key, salt=salt, info=b'borg-metadata-authentication-' + context, output_length=64 ) def pack_and_authenticate_metadata(self, metadata_dict, context=b'manifest', salt=None): if salt is None: salt = os.urandom(64) metadata_dict = StableDict(metadata_dict) tam = metadata_dict['tam'] = StableDict({ 'type': 'HKDF_HMAC_SHA512', 'hmac': bytes(64), 'salt': salt, }) packed = msgpack.packb(metadata_dict) tam_key = self._tam_key(salt, context) tam['hmac'] = hmac.digest(tam_key, packed, 'sha512') return msgpack.packb(metadata_dict) def unpack_and_verify_manifest(self, data, force_tam_not_required=False): """Unpack msgpacked *data* and return (object, did_verify).""" if data.startswith(b'\xc1' * 4): # This is a manifest from the future, we can't read it. raise UnsupportedManifestError() tam_required = self.tam_required if force_tam_not_required and tam_required: logger.warning('Manifest authentication DISABLED.') tam_required = False data = bytearray(data) unpacker = get_limited_unpacker('manifest') unpacker.feed(data) unpacked = unpacker.unpack() if AUTHENTICATED_NO_KEY: return unpacked, True # True is a lie. if b'tam' not in unpacked: if tam_required: raise TAMRequiredError(self.repository._location.canonical_path()) else: logger.debug('Manifest TAM not found and not required') return unpacked, False tam = unpacked.pop(b'tam', None) if not isinstance(tam, dict): raise TAMInvalid() tam_type = tam.get(b'type', b'').decode('ascii', 'replace') if tam_type != 'HKDF_HMAC_SHA512': if tam_required: raise TAMUnsupportedSuiteError(repr(tam_type)) else: logger.debug('Ignoring manifest TAM made with unsupported suite, since TAM is not required: %r', tam_type) return unpacked, False tam_hmac = tam.get(b'hmac') tam_salt = tam.get(b'salt') if not isinstance(tam_salt, bytes) or not isinstance(tam_hmac, bytes): raise TAMInvalid() offset = data.index(tam_hmac) data[offset:offset + 64] = bytes(64) tam_key = self._tam_key(tam_salt, context=b'manifest') calculated_hmac = hmac.digest(tam_key, data, 'sha512') if not hmac.compare_digest(calculated_hmac, tam_hmac): raise TAMInvalid() logger.debug('TAM-verified manifest') return unpacked, True def unpack_and_verify_archive(self, data, force_tam_not_required=False): """Unpack msgpacked *data* and return (object, did_verify, salt).""" tam_required = self.tam_required if force_tam_not_required and tam_required: # for a long time, borg only checked manifest for "tam_required" and # people might have archives without TAM, so don't be too annoyingly loud here: logger.debug('Archive authentication DISABLED.') tam_required = False data = bytearray(data) unpacker = get_limited_unpacker('archive') unpacker.feed(data) unpacked = unpacker.unpack() if b'tam' not in unpacked: if tam_required: archive_name = unpacked.get(b'name', b'').decode('ascii', 'replace') raise ArchiveTAMRequiredError(archive_name) else: logger.debug('Archive TAM not found and not required') return unpacked, False, None tam = unpacked.pop(b'tam', None) if not isinstance(tam, dict): raise ArchiveTAMInvalid() tam_type = tam.get(b'type', b'').decode('ascii', 'replace') if tam_type != 'HKDF_HMAC_SHA512': if tam_required: raise TAMUnsupportedSuiteError(repr(tam_type)) else: logger.debug('Ignoring archive TAM made with unsupported suite, since TAM is not required: %r', tam_type) return unpacked, False, None tam_hmac = tam.get(b'hmac') tam_salt = tam.get(b'salt') if not isinstance(tam_salt, bytes) or not isinstance(tam_hmac, bytes): raise ArchiveTAMInvalid() offset = data.index(tam_hmac) data[offset:offset + 64] = bytes(64) tam_key = self._tam_key(tam_salt, context=b'archive') calculated_hmac = hmac.digest(tam_key, data, 'sha512') if not hmac.compare_digest(calculated_hmac, tam_hmac): if 'ignore_invalid_archive_tam' in helpers.workarounds: logger.debug('ignoring invalid archive TAM due to BORG_WORKAROUNDS') return unpacked, False, None # same as if no TAM is present else: raise ArchiveTAMInvalid() logger.debug('TAM-verified archive') return unpacked, True, tam_salt class PlaintextKey(KeyBase): TYPE = 0x02 NAME = 'plaintext' ARG_NAME = 'none' STORAGE = KeyBlobStorage.NO_STORAGE chunk_seed = 0 logically_encrypted = False def __init__(self, repository): super().__init__(repository) self.tam_required = False @classmethod def create(cls, repository, args): logger.info('Encryption NOT enabled.\nUse the "--encryption=repokey|keyfile" to enable encryption.') return cls(repository) @classmethod def detect(cls, repository, manifest_data): return cls(repository) def id_hash(self, data): return sha256(data).digest() def encrypt(self, chunk): data = self.compressor.compress(chunk) return b''.join([self.TYPE_STR, data]) def decrypt(self, id, data, decompress=True): if data[0] != self.TYPE: id_str = bin_to_hex(id) if id is not None else '(unknown)' raise IntegrityError('Chunk %s: Invalid encryption envelope' % id_str) payload = memoryview(data)[1:] if not decompress: return payload data = self.decompress(payload) self.assert_id(id, data) return data def _tam_key(self, salt, context): return salt + context def random_blake2b_256_key(): # This might look a bit curious, but is the same construction used in the keyed mode of BLAKE2b. # Why limit the key to 64 bytes and pad it with 64 nulls nonetheless? The answer is that BLAKE2b # has a 128 byte block size, but only 64 bytes of internal state (this is also referred to as a # "local wide pipe" design, because the compression function transforms (block, state) => state, # and len(block) >= len(state), hence wide.) # In other words, a key longer than 64 bytes would have simply no advantage, since the function # has no way of propagating more than 64 bytes of entropy internally. # It's padded to a full block so that the key is never buffered internally by blake2b_update, ie. # it remains in a single memory location that can be tracked and could be erased securely, if we # wanted to. return os.urandom(64) + bytes(64) class ID_BLAKE2b_256: """ Key mix-in class for using BLAKE2b-256 for the id key. The id_key length must be 32 bytes. """ def id_hash(self, data): return blake2b_256(self.id_key, data) def init_from_random_data(self, data=None): assert data is None # PassphraseKey is the only caller using *data* super().init_from_random_data() self.enc_hmac_key = random_blake2b_256_key() self.id_key = random_blake2b_256_key() class ID_HMAC_SHA_256: """ Key mix-in class for using HMAC-SHA-256 for the id key. The id_key length must be 32 bytes. """ def id_hash(self, data): return hmac_sha256(self.id_key, data) class AESKeyBase(KeyBase): """ Common base class shared by KeyfileKey and PassphraseKey Chunks are encrypted using 256bit AES in Counter Mode (CTR) Payload layout: TYPE(1) + HMAC(32) + NONCE(8) + CIPHERTEXT To reduce payload size only 8 bytes of the 16 bytes nonce is saved in the payload, the first 8 bytes are always zeros. This does not affect security but limits the maximum repository capacity to only 295 exabytes! """ PAYLOAD_OVERHEAD = 1 + 32 + 8 # TYPE + HMAC + NONCE CIPHERSUITE = AES256_CTR_HMAC_SHA256 logically_encrypted = True def encrypt(self, chunk): data = self.compressor.compress(chunk) next_iv = self.nonce_manager.ensure_reservation(self.cipher.next_iv(), self.cipher.block_count(len(data))) return self.cipher.encrypt(data, header=self.TYPE_STR, iv=next_iv) def decrypt(self, id, data, decompress=True): if not (data[0] == self.TYPE or data[0] == PassphraseKey.TYPE and isinstance(self, RepoKey)): id_str = bin_to_hex(id) if id is not None else '(unknown)' raise IntegrityError('Chunk %s: Invalid encryption envelope' % id_str) try: payload = self.cipher.decrypt(data) except IntegrityError as e: raise IntegrityError(f"Chunk {bin_to_hex(id)}: Could not decrypt [{str(e)}]") if not decompress: return payload data = self.decompress(payload) self.assert_id(id, data) return data def init_from_random_data(self, data=None): if data is None: data = os.urandom(100) self.enc_key = data[0:32] self.enc_hmac_key = data[32:64] self.id_key = data[64:96] self.chunk_seed = bytes_to_int(data[96:100]) # Convert to signed int32 if self.chunk_seed & 0x80000000: self.chunk_seed = self.chunk_seed - 0xffffffff - 1 def init_ciphers(self, manifest_data=None): self.cipher = self.CIPHERSUITE(mac_key=self.enc_hmac_key, enc_key=self.enc_key, header_len=1, aad_offset=1) if manifest_data is None: nonce = 0 else: if not (manifest_data[0] == self.TYPE or manifest_data[0] == PassphraseKey.TYPE and isinstance(self, RepoKey)): raise IntegrityError('Manifest: Invalid encryption envelope') # manifest_blocks is a safe upper bound on the amount of cipher blocks needed # to encrypt the manifest. depending on the ciphersuite and overhead, it might # be a bit too high, but that does not matter. manifest_blocks = num_cipher_blocks(len(manifest_data)) nonce = self.cipher.extract_iv(manifest_data) + manifest_blocks self.cipher.set_iv(nonce) self.nonce_manager = NonceManager(self.repository, nonce) class Passphrase(str): @classmethod def _env_passphrase(cls, env_var, default=None): passphrase = os.environ.get(env_var, default) if passphrase is not None: return cls(passphrase) @classmethod def env_passphrase(cls, default=None): passphrase = cls._env_passphrase('BORG_PASSPHRASE', default) if passphrase is not None: return passphrase passphrase = cls.env_passcommand() if passphrase is not None: return passphrase passphrase = cls.fd_passphrase() if passphrase is not None: return passphrase @classmethod def env_passcommand(cls, default=None): passcommand = os.environ.get('BORG_PASSCOMMAND', None) if passcommand is not None: # passcommand is a system command (not inside pyinstaller env) env = prepare_subprocess_env(system=True) try: passphrase = subprocess.check_output(shlex.split(passcommand), text=True, env=env) except (subprocess.CalledProcessError, FileNotFoundError) as e: raise PasscommandFailure(e) return cls(passphrase.rstrip('\n')) @classmethod def fd_passphrase(cls): try: fd = int(os.environ.get('BORG_PASSPHRASE_FD')) except (ValueError, TypeError): return None with os.fdopen(fd, mode='r') as f: passphrase = f.read() return cls(passphrase.rstrip('\n')) @classmethod def env_new_passphrase(cls, default=None): return cls._env_passphrase('BORG_NEW_PASSPHRASE', default) @classmethod def getpass(cls, prompt): try: pw = getpass.getpass(prompt) except EOFError: if prompt: print() # avoid err msg appearing right of prompt msg = [] for env_var in 'BORG_PASSPHRASE', 'BORG_PASSCOMMAND': env_var_set = os.environ.get(env_var) is not None msg.append('{} is {}.'.format(env_var, 'set' if env_var_set else 'not set')) msg.append('Interactive password query failed.') raise NoPassphraseFailure(' '.join(msg)) from None else: return cls(pw) @classmethod def verification(cls, passphrase): msg = 'Do you want your passphrase to be displayed for verification? [yN]: ' if yes(msg, retry_msg=msg, invalid_msg='Invalid answer, try again.', retry=True, env_var_override='BORG_DISPLAY_PASSPHRASE'): print('Your passphrase (between double-quotes): "%s"' % passphrase, file=sys.stderr) print('Make sure the passphrase displayed above is exactly what you wanted.', file=sys.stderr) try: passphrase.encode('ascii') except UnicodeEncodeError: print('Your passphrase (UTF-8 encoding in hex): %s' % bin_to_hex(passphrase.encode('utf-8')), file=sys.stderr) print('As you have a non-ASCII passphrase, it is recommended to keep the UTF-8 encoding in hex together with the passphrase at a safe place.', file=sys.stderr) @classmethod def new(cls, allow_empty=False): passphrase = cls.env_new_passphrase() if passphrase is not None: return passphrase passphrase = cls.env_passphrase() if passphrase is not None: return passphrase for retry in range(1, 11): passphrase = cls.getpass('Enter new passphrase: ') if allow_empty or passphrase: passphrase2 = cls.getpass('Enter same passphrase again: ') if passphrase == passphrase2: cls.verification(passphrase) logger.info('Remember your passphrase. Your data will be inaccessible without it.') return passphrase else: print('Passphrases do not match', file=sys.stderr) else: print('Passphrase must not be blank', file=sys.stderr) else: raise PasswordRetriesExceeded def __repr__(self): return '' def kdf(self, salt, iterations, length): return pbkdf2_hmac('sha256', self.encode('utf-8'), salt, iterations, length) class PassphraseKey(ID_HMAC_SHA_256, AESKeyBase): # This mode was killed in borg 1.0, see: https://github.com/borgbackup/borg/issues/97 # Reasons: # - you can never ever change your passphrase for existing repos. # - you can never ever use a different iterations count for existing repos. # "Killed" means: # - there is no automatic dispatch to this class via type byte # - --encryption=passphrase is an invalid argument now # This class is kept for a while to support migration from passphrase to repokey mode. TYPE = 0x01 NAME = 'passphrase' ARG_NAME = None STORAGE = KeyBlobStorage.NO_STORAGE iterations = 100000 # must not be changed ever! @classmethod def create(cls, repository, args): key = cls(repository) logger.warning('WARNING: "passphrase" mode is unsupported since borg 1.0.') passphrase = Passphrase.new(allow_empty=False) key.init(repository, passphrase) return key @classmethod def detect(cls, repository, manifest_data): prompt = 'Enter passphrase for %s: ' % repository._location.canonical_path() key = cls(repository) passphrase = Passphrase.env_passphrase() if passphrase is None: passphrase = Passphrase.getpass(prompt) for retry in range(1, 3): key.init(repository, passphrase) try: key.decrypt(None, manifest_data) key.init_ciphers(manifest_data) key._passphrase = passphrase return key except IntegrityError: passphrase = Passphrase.getpass(prompt) else: raise PasswordRetriesExceeded def change_passphrase(self): class ImmutablePassphraseError(Error): """The passphrase for this encryption key type can't be changed.""" raise ImmutablePassphraseError def init(self, repository, passphrase): self.init_from_random_data(passphrase.kdf(repository.id, self.iterations, 100)) self.init_ciphers() self.tam_required = False class KeyfileKeyBase(AESKeyBase): @classmethod def detect(cls, repository, manifest_data): key = cls(repository) target = key.find_key() prompt = 'Enter passphrase for key %s: ' % target passphrase = Passphrase.env_passphrase() if passphrase is None: passphrase = Passphrase() if not key.load(target, passphrase): for retry in range(0, 3): passphrase = Passphrase.getpass(prompt) if key.load(target, passphrase): break else: raise PasswordRetriesExceeded else: if not key.load(target, passphrase): raise PassphraseWrong key.init_ciphers(manifest_data) key._passphrase = passphrase return key def find_key(self): raise NotImplementedError def load(self, target, passphrase): raise NotImplementedError def _load(self, key_data, passphrase): try: key = binascii.a2b_base64(key_data) except (ValueError, binascii.Error): raise KeyfileInvalidError(self.repository._location.canonical_path(), "(repokey)") from None if len(key) < 20: # this is in no way a precise check, usually we have about 400b key data. raise KeyfileInvalidError(self.repository._location.canonical_path(), "(repokey)") data = self.decrypt_key_file(key, passphrase) if data: data = msgpack.unpackb(data) key = Key(internal_dict=data) if key.version != 1: raise Error("key version %d is not supported by this borg version.") self.repository_id = key.repository_id self.enc_key = key.enc_key self.enc_hmac_key = key.enc_hmac_key self.id_key = key.id_key self.chunk_seed = key.chunk_seed self.tam_required = key.get('tam_required', tam_required(self.repository)) return True return False def decrypt_key_file(self, data, passphrase): unpacker = get_limited_unpacker('key') unpacker.feed(data) data = unpacker.unpack() enc_key = EncryptedKey(internal_dict=data) if enc_key.version != 1: raise Error("encrypted key version %d is not supported by this borg version." % enc_key.version) if enc_key.algorithm != 'sha256': raise Error("encrypted key algorithm '%s' is not supported by this borg version." % enc_key.algorithm) key = passphrase.kdf(enc_key.salt, enc_key.iterations, 32) data = AES(key, b'\0'*16).decrypt(enc_key.data) if hmac.compare_digest(hmac_sha256(key, data), enc_key.hash): return data def encrypt_key_file(self, data, passphrase): salt = os.urandom(32) iterations = PBKDF2_ITERATIONS key = passphrase.kdf(salt, iterations, 32) hash = hmac_sha256(key, data) cdata = AES(key, b'\0'*16).encrypt(data) enc_key = EncryptedKey( version=1, salt=salt, iterations=iterations, algorithm='sha256', hash=hash, data=cdata, ) return msgpack.packb(enc_key.as_dict()) def _save(self, passphrase): key = Key( version=1, repository_id=self.repository_id, enc_key=self.enc_key, enc_hmac_key=self.enc_hmac_key, id_key=self.id_key, chunk_seed=self.chunk_seed, tam_required=self.tam_required, ) data = self.encrypt_key_file(msgpack.packb(key.as_dict()), passphrase) key_data = '\n'.join(textwrap.wrap(binascii.b2a_base64(data).decode('ascii'))) return key_data def change_passphrase(self, passphrase=None): if passphrase is None: passphrase = Passphrase.new(allow_empty=True) self.save(self.target, passphrase) @classmethod def create(cls, repository, args): passphrase = Passphrase.new(allow_empty=True) key = cls(repository) key.repository_id = repository.id key.init_from_random_data() key.init_ciphers() target = key.get_new_target(args) key.save(target, passphrase, create=True) logger.info('Key in "%s" created.' % target) logger.info('Keep this key safe. Your data will be inaccessible without it.') return key def save(self, target, passphrase, create=False): raise NotImplementedError def get_new_target(self, args): raise NotImplementedError class KeyfileKey(ID_HMAC_SHA_256, KeyfileKeyBase): TYPE = 0x00 NAME = 'key file' ARG_NAME = 'keyfile' STORAGE = KeyBlobStorage.KEYFILE FILE_ID = 'BORG_KEY' def sanity_check(self, filename, id): file_id = self.FILE_ID.encode() + b' ' repo_id = bin_to_hex(id).encode('ascii') with open(filename, 'rb') as fd: # we do the magic / id check in binary mode to avoid stumbling over # decoding errors if somebody has binary files in the keys dir for some reason. if fd.read(len(file_id)) != file_id: raise KeyfileInvalidError(self.repository._location.canonical_path(), filename) if fd.read(len(repo_id)) != repo_id: raise KeyfileMismatchError(self.repository._location.canonical_path(), filename) # we get here if it really looks like a borg key for this repo, # do some more checks that are close to how borg reads/parses the key. with open(filename) as fd: lines = fd.readlines() if len(lines) < 2: logger.warning(f"borg key sanity check: expected 2+ lines total. [{filename}]") raise KeyfileInvalidError(self.repository._location.canonical_path(), filename) if len(lines[0].rstrip()) > len(file_id) + len(repo_id): logger.warning(f"borg key sanity check: key line 1 seems too long. [{filename}]") raise KeyfileInvalidError(self.repository._location.canonical_path(), filename) key_b64 = ''.join(lines[1:]) try: key = binascii.a2b_base64(key_b64) except (ValueError, binascii.Error): logger.warning(f"borg key sanity check: key line 2+ does not look like base64. [{filename}]") raise KeyfileInvalidError(self.repository._location.canonical_path(), filename) from None if len(key) < 20: # this is in no way a precise check, usually we have about 400b key data. logger.warning(f"borg key sanity check: binary encrypted key data from key line 2+ suspiciously short." f" [{filename}]") raise KeyfileInvalidError(self.repository._location.canonical_path(), filename) # looks good! return filename def find_key(self): keyfile = self._find_key_file_from_environment() if keyfile is not None: return self.sanity_check(keyfile, self.repository.id) keyfile = self._find_key_in_keys_dir() if keyfile is not None: return keyfile raise KeyfileNotFoundError(self.repository._location.canonical_path(), get_keys_dir()) def get_existing_or_new_target(self, args): keyfile = self._find_key_file_from_environment() if keyfile is not None: return keyfile keyfile = self._find_key_in_keys_dir() if keyfile is not None: return keyfile return self._get_new_target_in_keys_dir(args) def _find_key_in_keys_dir(self): id = self.repository.id keys_dir = get_keys_dir() for name in os.listdir(keys_dir): filename = os.path.join(keys_dir, name) try: return self.sanity_check(filename, id) except (KeyfileInvalidError, KeyfileMismatchError): pass def get_new_target(self, args): keyfile = self._find_key_file_from_environment() if keyfile is not None: return keyfile return self._get_new_target_in_keys_dir(args) def _find_key_file_from_environment(self): keyfile = os.environ.get('BORG_KEY_FILE') if keyfile: return os.path.abspath(keyfile) def _get_new_target_in_keys_dir(self, args): filename = args.location.to_key_filename() path = filename i = 1 while os.path.exists(path): i += 1 path = filename + '.%d' % i return path def load(self, target, passphrase): with open(target) as fd: key_data = ''.join(fd.readlines()[1:]) success = self._load(key_data, passphrase) if success: self.target = target return success def save(self, target, passphrase, create=False): if create and os.path.isfile(target): # if a new keyfile key repository is created, ensure that an existing keyfile of another # keyfile key repo is not accidentally overwritten by careless use of the BORG_KEY_FILE env var. # see issue #6036 raise Error('Aborting because key in "%s" already exists.' % target) key_data = self._save(passphrase) with SaveFile(target) as fd: fd.write(f'{self.FILE_ID} {bin_to_hex(self.repository_id)}\n') fd.write(key_data) fd.write('\n') self.target = target class RepoKey(ID_HMAC_SHA_256, KeyfileKeyBase): TYPE = 0x03 NAME = 'repokey' ARG_NAME = 'repokey' STORAGE = KeyBlobStorage.REPO def find_key(self): loc = self.repository._location.canonical_path() key = self.repository.load_key() if not key: # if we got an empty key, it means there is no key. raise RepoKeyNotFoundError(loc) from None return loc def get_new_target(self, args): return self.repository def load(self, target, passphrase): # While the repository is encrypted, we consider a repokey repository with a blank # passphrase an unencrypted repository. self.logically_encrypted = passphrase != '' # what we get in target is just a repo location, but we already have the repo obj: target = self.repository key_data = target.load_key() if not key_data: # if we got an empty key, it means there is no key. loc = target._location.canonical_path() raise RepoKeyNotFoundError(loc) from None key_data = key_data.decode('utf-8') # remote repo: msgpack issue #99, getting bytes success = self._load(key_data, passphrase) if success: self.target = target return success def save(self, target, passphrase, create=False): self.logically_encrypted = passphrase != '' key_data = self._save(passphrase) key_data = key_data.encode('utf-8') # remote repo: msgpack issue #99, giving bytes target.save_key(key_data) self.target = target class Blake2KeyfileKey(ID_BLAKE2b_256, KeyfileKey): TYPE = 0x04 NAME = 'key file BLAKE2b' ARG_NAME = 'keyfile-blake2' STORAGE = KeyBlobStorage.KEYFILE FILE_ID = 'BORG_KEY' CIPHERSUITE = AES256_CTR_BLAKE2b class Blake2RepoKey(ID_BLAKE2b_256, RepoKey): TYPE = 0x05 NAME = 'repokey BLAKE2b' ARG_NAME = 'repokey-blake2' STORAGE = KeyBlobStorage.REPO CIPHERSUITE = AES256_CTR_BLAKE2b class AuthenticatedKeyBase(RepoKey): STORAGE = KeyBlobStorage.REPO # It's only authenticated, not encrypted. logically_encrypted = False def _load(self, key_data, passphrase): if AUTHENTICATED_NO_KEY: # fake _load if we have no key or passphrase NOPE = bytes(32) # 256 bit all-zero self.repository_id = NOPE self.enc_key = NOPE self.enc_hmac_key = NOPE self.id_key = NOPE self.chunk_seed = 0 self.tam_required = False return True return super()._load(key_data, passphrase) def load(self, target, passphrase): success = super().load(target, passphrase) self.logically_encrypted = False return success def save(self, target, passphrase, create=False): super().save(target, passphrase, create=create) self.logically_encrypted = False def init_ciphers(self, manifest_data=None): if manifest_data is not None and manifest_data[0] != self.TYPE: raise IntegrityError('Manifest: Invalid encryption envelope') def encrypt(self, chunk): data = self.compressor.compress(chunk) return b''.join([self.TYPE_STR, data]) def decrypt(self, id, data, decompress=True): if data[0] != self.TYPE: id_str = bin_to_hex(id) if id is not None else '(unknown)' raise IntegrityError('Chunk %s: Invalid envelope' % id_str) payload = memoryview(data)[1:] if not decompress: return payload data = self.decompress(payload) if AUTHENTICATED_NO_KEY: return data self.assert_id(id, data) return data class AuthenticatedKey(AuthenticatedKeyBase): TYPE = 0x07 NAME = 'authenticated' ARG_NAME = 'authenticated' class Blake2AuthenticatedKey(ID_BLAKE2b_256, AuthenticatedKeyBase): TYPE = 0x06 NAME = 'authenticated BLAKE2b' ARG_NAME = 'authenticated-blake2' AVAILABLE_KEY_TYPES = ( PlaintextKey, PassphraseKey, KeyfileKey, RepoKey, AuthenticatedKey, Blake2KeyfileKey, Blake2RepoKey, Blake2AuthenticatedKey, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/crypto/keymanager.py0000644000076500000240000002020414641074756017761 0ustar00twstaffimport binascii import pkgutil import textwrap from hashlib import sha256 from ..helpers import Manifest, NoManifestError, Error, yes, bin_to_hex, hex_to_bin, dash_open from ..repository import Repository from .key import KeyfileKey, KeyfileNotFoundError, RepoKeyNotFoundError, KeyBlobStorage, identify_key class NotABorgKeyFile(Error): """This file is not a borg key backup, aborting.""" exit_mcode = 43 class RepoIdMismatch(Error): """This key backup seems to be for a different backup repository, aborting.""" exit_mcode = 45 class UnencryptedRepo(Error): """Key management not available for unencrypted repositories.""" exit_mcode = 46 class UnknownKeyType(Error): """Key type {0} is unknown.""" exit_mcode = 47 def sha256_truncated(data, num): h = sha256() h.update(data) return h.hexdigest()[:num] class KeyManager: def __init__(self, repository): self.repository = repository self.keyblob = None self.keyblob_storage = None try: manifest_data = self.repository.get(Manifest.MANIFEST_ID) except Repository.ObjectNotFound: raise NoManifestError key = identify_key(manifest_data) self.keyblob_storage = key.STORAGE if self.keyblob_storage == KeyBlobStorage.NO_STORAGE: raise UnencryptedRepo() def load_keyblob(self): if self.keyblob_storage == KeyBlobStorage.KEYFILE: k = KeyfileKey(self.repository) target = k.find_key() with open(target) as fd: self.keyblob = ''.join(fd.readlines()[1:]) elif self.keyblob_storage == KeyBlobStorage.REPO: key_data = self.repository.load_key().decode() if not key_data: # if we got an empty key, it means there is no key. loc = self.repository._location.canonical_path() raise RepoKeyNotFoundError(loc) from None self.keyblob = key_data def store_keyblob(self, args): if self.keyblob_storage == KeyBlobStorage.KEYFILE: k = KeyfileKey(self.repository) target = k.get_existing_or_new_target(args) self.store_keyfile(target) elif self.keyblob_storage == KeyBlobStorage.REPO: self.repository.save_key(self.keyblob.encode('utf-8')) def get_keyfile_data(self): data = f'{KeyfileKey.FILE_ID} {bin_to_hex(self.repository.id)}\n' data += self.keyblob if not self.keyblob.endswith('\n'): data += '\n' return data def store_keyfile(self, target): with dash_open(target, 'w') as fd: fd.write(self.get_keyfile_data()) def export(self, path): if path is None: path = '-' self.store_keyfile(path) def export_qr(self, path): if path is None: path = '-' with dash_open(path, 'wb') as fd: key_data = self.get_keyfile_data() html = pkgutil.get_data('borg', 'paperkey.html') html = html.replace(b'', key_data.encode() + b'') fd.write(html) def export_paperkey(self, path): if path is None: path = '-' def grouped(s): ret = '' i = 0 for ch in s: if i and i % 6 == 0: ret += ' ' ret += ch i += 1 return ret export = 'To restore key use borg key import --paper /path/to/repo\n\n' binary = binascii.a2b_base64(self.keyblob) export += 'BORG PAPER KEY v1\n' lines = (len(binary) + 17) // 18 repoid = bin_to_hex(self.repository.id)[:18] complete_checksum = sha256_truncated(binary, 12) export += 'id: {:d} / {} / {} - {}\n'.format(lines, grouped(repoid), grouped(complete_checksum), sha256_truncated((str(lines) + '/' + repoid + '/' + complete_checksum).encode('ascii'), 2)) idx = 0 while len(binary): idx += 1 binline = binary[:18] checksum = sha256_truncated(idx.to_bytes(2, byteorder='big') + binline, 2) export += f'{idx:2d}: {grouped(bin_to_hex(binline))} - {checksum}\n' binary = binary[18:] with dash_open(path, 'w') as fd: fd.write(export) def import_keyfile(self, args): file_id = KeyfileKey.FILE_ID first_line = file_id + ' ' + bin_to_hex(self.repository.id) + '\n' with dash_open(args.path, 'r') as fd: file_first_line = fd.read(len(first_line)) if file_first_line != first_line: if not file_first_line.startswith(file_id): raise NotABorgKeyFile() else: raise RepoIdMismatch() self.keyblob = fd.read() self.store_keyblob(args) def import_paperkey(self, args): try: # imported here because it has global side effects import readline except ImportError: print('Note: No line editing available due to missing readline support') repoid = bin_to_hex(self.repository.id)[:18] try: while True: # used for repeating on overall checksum mismatch # id line input while True: idline = input('id: ').replace(' ', '') if idline == '': if yes('Abort import? [yN]:'): raise EOFError() try: (data, checksum) = idline.split('-') except ValueError: print("each line must contain exactly one '-', try again") continue try: (id_lines, id_repoid, id_complete_checksum) = data.split('/') except ValueError: print("the id line must contain exactly three '/', try again") continue if sha256_truncated(data.lower().encode('ascii'), 2) != checksum: print('line checksum did not match, try same line again') continue try: lines = int(id_lines) except ValueError: print('internal error while parsing length') break if repoid != id_repoid: raise RepoIdMismatch() result = b'' idx = 1 # body line input while True: inline = input(f'{idx:2d}: ') inline = inline.replace(' ', '') if inline == '': if yes('Abort import? [yN]:'): raise EOFError() try: (data, checksum) = inline.split('-') except ValueError: print("each line must contain exactly one '-', try again") continue try: part = hex_to_bin(data) except ValueError as e: print(f"only characters 0-9 and a-f and '-' are valid, try again [{e}]") continue if sha256_truncated(idx.to_bytes(2, byteorder='big') + part, 2) != checksum: print(f'line checksum did not match, try line {idx} again') continue result += part if idx == lines: break idx += 1 if sha256_truncated(result, 12) != id_complete_checksum: print('The overall checksum did not match, retry or enter a blank line to abort.') continue self.keyblob = '\n'.join(textwrap.wrap(binascii.b2a_base64(result).decode('ascii'))) + '\n' self.store_keyblob(args) break except EOFError: print('\n - aborted') return ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719958149.0 borgbackup-1.4.0/src/borg/crypto/low_level.c0000644000076500000240000376736514641075205017443 0ustar00twstaff/* Generated by Cython 3.0.10 */ /* BEGIN: Cython Metadata { "distutils": { "depends": [ "/opt/homebrew/Cellar/openssl@3/3.3.1/include/openssl/crypto.h", "/opt/homebrew/Cellar/openssl@3/3.3.1/include/openssl/evp.h", "src/borg/crypto/_crypto_helpers.h" ], "extra_compile_args": [ "-Wall", "-Wextra", "-Wpointer-arith" ], "include_dirs": [ "src/borg/crypto", "/opt/homebrew/Cellar/openssl@3/3.3.1/include" ], "libraries": [ "crypto" ], "library_dirs": [ "/opt/homebrew/Cellar/openssl@3/3.3.1/lib" ], "name": "borg.crypto.low_level", "sources": [ "src/borg/crypto/low_level.pyx" ] }, "module_name": "borg.crypto.low_level" } END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyFloat_FromString(obj) PyFloat_FromString(obj) #else #define __Pyx_PyFloat_FromString(obj) PyFloat_FromString(obj, NULL) #endif #if PY_MAJOR_VERSION <= 2 #define PyDict_GetItemWithError _PyDict_GetItemWithError #endif #if (PY_VERSION_HEX < 0x030700b1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030600)) && !defined(PyContextVar_Get) #define PyContextVar_Get(var, d, v) ((d) ? ((void)(var), Py_INCREF(d), (v)[0] = (d), 0) : ((v)[0] = NULL, 0) ) #endif #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_10" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x03000AF0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 1 #endif #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #if PY_VERSION_HEX >= 0x030d00A4 # define __Pyx_PyCFunctionFast PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords #else # define __Pyx_PyCFunctionFast _PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__borg__crypto__low_level #define __PYX_HAVE_API__borg__crypto__low_level /* Early includes */ #include #include #include #include "pythread.h" #include "openssl/crypto.h" #include "openssl/evp.h" #include "_crypto_helpers.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/borg/crypto/low_level.pyx", "", "contextvars.pxd", "type.pxd", "bool.pxd", "complex.pxd", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE; struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256; struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b; struct __pyx_obj_4borg_6crypto_9low_level_AES; struct __pyx_opt_args_7cpython_11contextvars_get_value; struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default; /* "cpython/contextvars.pxd":112 * * * cdef inline object get_value(var, default_value=None): # <<<<<<<<<<<<<< * """Return a new reference to the value of the context variable, * or the default value of the context variable, */ struct __pyx_opt_args_7cpython_11contextvars_get_value { int __pyx_n; PyObject *default_value; }; /* "cpython/contextvars.pxd":129 * * * cdef inline object get_value_no_default(var, default_value=None): # <<<<<<<<<<<<<< * """Return a new reference to the value of the context variable, * or the provided default value if no such value was found. */ struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default { int __pyx_n; PyObject *default_value; }; /* "borg/crypto/low_level.pyx":404 * * * ctypedef const EVP_CIPHER * (* CIPHER)() # <<<<<<<<<<<<<< * * */ typedef EVP_CIPHER const *(*__pyx_t_4borg_6crypto_9low_level_CIPHER)(void); /* "borg/crypto/low_level.pyx":168 * * * cdef class AES256_CTR_BASE: # <<<<<<<<<<<<<< * # Layout: HEADER + MAC 32 + IV 8 + CT (same as attic / borg < 1.2 IF HEADER = TYPE_BYTE, no AAD) * */ struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE { PyObject_HEAD struct __pyx_vtabstruct_4borg_6crypto_9low_level_AES256_CTR_BASE *__pyx_vtab; EVP_CIPHER_CTX *ctx; unsigned char enc_key[32]; int cipher_blk_len; int iv_len; int iv_len_short; int aad_offset; int header_len; int mac_len; unsigned char iv[16]; PY_LONG_LONG blocks; }; /* "borg/crypto/low_level.pyx":344 * * * cdef class AES256_CTR_HMAC_SHA256(AES256_CTR_BASE): # <<<<<<<<<<<<<< * cdef unsigned char mac_key[32] * */ struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256 { struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE __pyx_base; unsigned char mac_key[32]; }; /* "borg/crypto/low_level.pyx":374 * * * cdef class AES256_CTR_BLAKE2b(AES256_CTR_BASE): # <<<<<<<<<<<<<< * cdef unsigned char mac_key[128] * */ struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b { struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE __pyx_base; unsigned char mac_key[0x80]; }; /* "borg/crypto/low_level.pyx":407 * * * cdef class AES: # <<<<<<<<<<<<<< * """A thin wrapper around the OpenSSL EVP cipher API - for legacy code, like key file encryption""" * cdef CIPHER cipher */ struct __pyx_obj_4borg_6crypto_9low_level_AES { PyObject_HEAD __pyx_t_4borg_6crypto_9low_level_CIPHER cipher; EVP_CIPHER_CTX *ctx; unsigned char enc_key[32]; int cipher_blk_len; int iv_len; unsigned char iv[16]; PY_LONG_LONG blocks; }; /* "borg/crypto/low_level.pyx":168 * * * cdef class AES256_CTR_BASE: # <<<<<<<<<<<<<< * # Layout: HEADER + MAC 32 + IV 8 + CT (same as attic / borg < 1.2 IF HEADER = TYPE_BYTE, no AAD) * */ struct __pyx_vtabstruct_4borg_6crypto_9low_level_AES256_CTR_BASE { PyObject *(*mac_compute)(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *, unsigned char const *, int, unsigned char const *, int, unsigned char *); PyObject *(*mac_verify)(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *, unsigned char const *, int, unsigned char const *, int, unsigned char *, unsigned char const *); PyObject *(*fetch_iv)(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *, unsigned char *); PyObject *(*store_iv)(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *, unsigned char *, unsigned char *); }; static struct __pyx_vtabstruct_4borg_6crypto_9low_level_AES256_CTR_BASE *__pyx_vtabptr_4borg_6crypto_9low_level_AES256_CTR_BASE; /* "borg/crypto/low_level.pyx":344 * * * cdef class AES256_CTR_HMAC_SHA256(AES256_CTR_BASE): # <<<<<<<<<<<<<< * cdef unsigned char mac_key[32] * */ struct __pyx_vtabstruct_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256 { struct __pyx_vtabstruct_4borg_6crypto_9low_level_AES256_CTR_BASE __pyx_base; }; static struct __pyx_vtabstruct_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256 *__pyx_vtabptr_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256; /* "borg/crypto/low_level.pyx":374 * * * cdef class AES256_CTR_BLAKE2b(AES256_CTR_BASE): # <<<<<<<<<<<<<< * cdef unsigned char mac_key[128] * */ struct __pyx_vtabstruct_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b { struct __pyx_vtabstruct_4borg_6crypto_9low_level_AES256_CTR_BASE __pyx_base; }; static struct __pyx_vtabstruct_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b *__pyx_vtabptr_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* GetTopmostException.proto */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); #endif /* SaveResetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2)) #endif /* AssertionsEnabled.proto */ #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define __Pyx_init_assertions_enabled() (0) #define __pyx_assertions_enabled() (1) #elif CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030C0000) static int __pyx_assertions_enabled_flag; #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag) static int __Pyx_init_assertions_enabled(void) { PyObject *builtins, *debug, *debug_str; int flag; builtins = PyEval_GetBuiltins(); if (!builtins) goto bad; debug_str = PyUnicode_FromStringAndSize("__debug__", 9); if (!debug_str) goto bad; debug = PyObject_GetItem(builtins, debug_str); Py_DECREF(debug_str); if (!debug) goto bad; flag = PyObject_IsTrue(debug); Py_DECREF(debug); if (flag == -1) goto bad; __pyx_assertions_enabled_flag = flag; return 0; bad: __pyx_assertions_enabled_flag = 1; return -1; } #else #define __Pyx_init_assertions_enabled() (0) #define __pyx_assertions_enabled() (!Py_OptimizeFlag) #endif /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* PyObjectSetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); #else #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif /* KeywordStringCheck.proto */ static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* ObjectGetItem.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key); #else #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) #endif /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* SwapException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif /* PySequenceMultiply.proto */ #define __Pyx_PySequence_Multiply_Left(mul, seq) __Pyx_PySequence_Multiply(seq, mul) static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul); /* SliceObject.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_MultiplyCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_MultiplyCObj(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2)) #endif /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) #endif /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* PyObjectCallNoArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* ValidateBasesTuple.proto */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); #endif /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* SetVTable.proto */ static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable); /* GetVTable.proto */ static void* __Pyx_GetVtable(PyTypeObject *type); /* MergeVTables.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_MergeVtables(PyTypeObject *type); #endif /* SetupReduce.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce(PyObject* type_obj); #endif /* TypeImport.proto */ #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_10 #define __PYX_HAVE_RT_ImportType_proto_3_0_10 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L #define __PYX_GET_STRUCT_ALIGNMENT_3_0_10(s) alignof(s) #else #define __PYX_GET_STRUCT_ALIGNMENT_3_0_10(s) sizeof(void*) #endif enum __Pyx_ImportType_CheckSize_3_0_10 { __Pyx_ImportType_CheckSize_Error_3_0_10 = 0, __Pyx_ImportType_CheckSize_Warn_3_0_10 = 1, __Pyx_ImportType_CheckSize_Ignore_3_0_10 = 2 }; static PyTypeObject *__Pyx_ImportType_3_0_10(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_10 check_size); #endif /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* Py3UpdateBases.proto */ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases); /* CalculateMetaclass.proto */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); /* PyObjectCall2Args.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* PyObjectLookupSpecial.proto */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0) #define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1) static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error); #else #define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n) #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) #endif /* Py3ClassCreate.proto */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc); static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /* SetNameInClass.proto */ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) #elif CYTHON_COMPILING_IN_CPYTHON #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value)) #else #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) #endif /* ClassMethod.proto */ #include "descrobject.h" CYTHON_UNUSED static PyObject* __Pyx_Method_ClassMethod(PyObject *method); /* GetNameInClass.proto */ #define __Pyx_GetNameInClass(var, nmspace, name) (var) = __Pyx__GetNameInClass(nmspace, name) static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE unsigned char __Pyx_PyInt_As_unsigned_char(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PY_LONG_LONG(PY_LONG_LONG value); /* CIntFromPy.proto */ static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_As_PY_LONG_LONG(PyObject *); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self); /* proto*/ static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_4borg_6crypto_9low_level_15AES256_CTR_BASE_mac_compute(CYTHON_UNUSED struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *__pyx_v_self, CYTHON_UNUSED unsigned char const *__pyx_v_data1, CYTHON_UNUSED int __pyx_v_data1_len, CYTHON_UNUSED unsigned char const *__pyx_v_data2, CYTHON_UNUSED int __pyx_v_data2_len, CYTHON_UNUSED unsigned char *__pyx_v_mac_buf); /* proto*/ static PyObject *__pyx_f_4borg_6crypto_9low_level_15AES256_CTR_BASE_mac_verify(CYTHON_UNUSED struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *__pyx_v_self, CYTHON_UNUSED unsigned char const *__pyx_v_data1, CYTHON_UNUSED int __pyx_v_data1_len, CYTHON_UNUSED unsigned char const *__pyx_v_data2, CYTHON_UNUSED int __pyx_v_data2_len, CYTHON_UNUSED unsigned char *__pyx_v_mac_buf, CYTHON_UNUSED unsigned char const *__pyx_v_mac_wanted); /* proto*/ static PyObject *__pyx_f_4borg_6crypto_9low_level_15AES256_CTR_BASE_fetch_iv(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *__pyx_v_self, unsigned char *__pyx_v_iv_in); /* proto*/ static PyObject *__pyx_f_4borg_6crypto_9low_level_15AES256_CTR_BASE_store_iv(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *__pyx_v_self, unsigned char *__pyx_v_iv_out, unsigned char *__pyx_v_iv); /* proto*/ static PyObject *__pyx_f_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256_mac_compute(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256 *__pyx_v_self, unsigned char const *__pyx_v_data1, int __pyx_v_data1_len, unsigned char const *__pyx_v_data2, int __pyx_v_data2_len, unsigned char *__pyx_v_mac_buf); /* proto*/ static PyObject *__pyx_f_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256_mac_verify(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256 *__pyx_v_self, unsigned char const *__pyx_v_data1, int __pyx_v_data1_len, unsigned char const *__pyx_v_data2, int __pyx_v_data2_len, unsigned char *__pyx_v_mac_buf, unsigned char const *__pyx_v_mac_wanted); /* proto*/ static PyObject *__pyx_f_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b_mac_compute(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b *__pyx_v_self, unsigned char const *__pyx_v_data1, int __pyx_v_data1_len, unsigned char const *__pyx_v_data2, int __pyx_v_data2_len, unsigned char *__pyx_v_mac_buf); /* proto*/ static PyObject *__pyx_f_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b_mac_verify(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b *__pyx_v_self, unsigned char const *__pyx_v_data1, int __pyx_v_data1_len, unsigned char const *__pyx_v_data2, int __pyx_v_data2_len, unsigned char *__pyx_v_mac_buf, unsigned char const *__pyx_v_mac_wanted); /* proto*/ /* Module declarations from "cpython.version" */ /* Module declarations from "__builtin__" */ /* Module declarations from "cpython.type" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "cpython.object" */ /* Module declarations from "cpython.ref" */ /* Module declarations from "cpython.exc" */ /* Module declarations from "cpython.module" */ /* Module declarations from "cpython.mem" */ /* Module declarations from "cpython.tuple" */ /* Module declarations from "cpython.list" */ /* Module declarations from "cpython.sequence" */ /* Module declarations from "cpython.mapping" */ /* Module declarations from "cpython.iterator" */ /* Module declarations from "cpython.number" */ /* Module declarations from "cpython.int" */ /* Module declarations from "__builtin__" */ /* Module declarations from "cpython.bool" */ /* Module declarations from "cpython.long" */ /* Module declarations from "cpython.float" */ /* Module declarations from "__builtin__" */ /* Module declarations from "cpython.complex" */ /* Module declarations from "cpython.string" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "cpython.unicode" */ /* Module declarations from "cpython.pyport" */ /* Module declarations from "cpython.dict" */ /* Module declarations from "cpython.instance" */ /* Module declarations from "cpython.function" */ /* Module declarations from "cpython.method" */ /* Module declarations from "cpython.weakref" */ /* Module declarations from "cpython.getargs" */ /* Module declarations from "cpython.pythread" */ /* Module declarations from "cpython.pystate" */ /* Module declarations from "cpython.cobject" */ /* Module declarations from "cpython.oldbuffer" */ /* Module declarations from "cpython.set" */ /* Module declarations from "cpython.buffer" */ /* Module declarations from "cpython.bytes" */ /* Module declarations from "cpython.pycapsule" */ /* Module declarations from "cpython.contextvars" */ /* Module declarations from "cpython" */ /* Module declarations from "borg.crypto.low_level" */ static Py_buffer __pyx_f_4borg_6crypto_9low_level_ro_buffer(PyObject *); /*proto*/ static int __Pyx_carray_from_py_unsigned_char(PyObject *, unsigned char *, Py_ssize_t); /*proto*/ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "borg.crypto.low_level" extern int __pyx_module_is_main_borg__crypto__low_level; int __pyx_module_is_main_borg__crypto__low_level = 0; /* Implementation of "borg.crypto.low_level" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_AssertionError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_NotImplementedError; static PyObject *__pyx_builtin_MemoryError; static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_super; static PyObject *__pyx_builtin_OverflowError; static PyObject *__pyx_builtin_enumerate; static PyObject *__pyx_builtin_IndexError; /* #### Code section: string_decls ### */ static const char __pyx_k_[] = ""; static const char __pyx_k_I[] = ">I"; static const char __pyx_k_Q[] = ">Q"; static const char __pyx_k_i[] = "i"; static const char __pyx_k_n[] = "n"; static const char __pyx_k_x[] = "x"; static const char __pyx_k__2[] = "\000"; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k_iv[] = "iv"; static const char __pyx_k_rc[] = "rc"; static const char __pyx_k_AES[] = "AES"; static const char __pyx_k__11[] = "*"; static const char __pyx_k__12[] = "."; static const char __pyx_k__69[] = "?"; static const char __pyx_k_big[] = "big"; static const char __pyx_k_cls[] = "cls"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_ikm[] = "ikm"; static const char __pyx_k_int[] = "_int"; static const char __pyx_k_key[] = "key"; static const char __pyx_k_msg[] = "msg"; static const char __pyx_k_prk[] = "prk"; static const char __pyx_k_t_n[] = "t_n"; static const char __pyx_k_HMAC[] = "HMAC"; static const char __pyx_k_alen[] = "alen"; static const char __pyx_k_ceil[] = "ceil"; static const char __pyx_k_data[] = "data"; static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_hlen[] = "hlen"; static const char __pyx_k_hmac[] = "hmac"; static const char __pyx_k_ilen[] = "ilen"; static const char __pyx_k_info[] = "info"; static const char __pyx_k_init[] = "__init__"; static const char __pyx_k_long[] = "_long"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_math[] = "math"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_olen[] = "olen"; static const char __pyx_k_pack[] = "pack"; static const char __pyx_k_salt[] = "salt"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_hdata[] = "hdata"; static const char __pyx_k_idata[] = "idata"; static const char __pyx_k_odata[] = "odata"; static const char __pyx_k_range[] = "range"; static const char __pyx_k_super[] = "super"; static const char __pyx_k_1_4_01[] = "1.4_01"; static const char __pyx_k_Struct[] = "Struct"; static const char __pyx_k_digest[] = "digest"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_header[] = "header"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_lambda[] = ""; static const char __pyx_k_length[] = "length"; static const char __pyx_k_little[] = "little"; static const char __pyx_k_module[] = "__module__"; static const char __pyx_k_offset[] = "offset"; static const char __pyx_k_output[] = "output"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_set_iv[] = "set_iv"; static const char __pyx_k_sha256[] = "sha256"; static const char __pyx_k_sha512[] = "sha512"; static const char __pyx_k_struct[] = "struct"; static const char __pyx_k_aoffset[] = "aoffset"; static const char __pyx_k_blake2b[] = "blake2b"; static const char __pyx_k_decrypt[] = "decrypt"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_enc_key[] = "enc_key"; static const char __pyx_k_encrypt[] = "encrypt"; static const char __pyx_k_hashlib[] = "hashlib"; static const char __pyx_k_mac_buf[] = "mac_buf"; static const char __pyx_k_mac_key[] = "mac_key"; static const char __pyx_k_next_iv[] = "next_iv"; static const char __pyx_k_prepare[] = "__prepare__"; static const char __pyx_k_envelope[] = "envelope"; static const char __pyx_k_getstate[] = "__getstate__"; static const char __pyx_k_qualname[] = "__qualname__"; static const char __pyx_k_set_name[] = "__set_name__"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_to_bytes[] = "to_bytes"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_blocksize[] = "blocksize"; static const char __pyx_k_byteorder[] = "byteorder"; static const char __pyx_k_enumerate[] = "enumerate"; static const char __pyx_k_isenabled[] = "isenabled"; static const char __pyx_k_metaclass[] = "__metaclass__"; static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_AES_set_iv[] = "AES.set_iv"; static const char __pyx_k_IndexError[] = "IndexError"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_aad_offset[] = "aad_offset"; static const char __pyx_k_extract_iv[] = "extract_iv"; static const char __pyx_k_from_bytes[] = "from_bytes"; static const char __pyx_k_header_len[] = "header_len"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_AES_decrypt[] = "AES.decrypt"; static const char __pyx_k_AES_encrypt[] = "AES.encrypt"; static const char __pyx_k_AES_next_iv[] = "AES.next_iv"; static const char __pyx_k_API_VERSION[] = "API_VERSION"; static const char __pyx_k_CryptoError[] = "CryptoError"; static const char __pyx_k_MemoryError[] = "MemoryError"; static const char __pyx_k_UNENCRYPTED[] = "UNENCRYPTED"; static const char __pyx_k_blake2b_128[] = "blake2b_128"; static const char __pyx_k_blake2b_256[] = "blake2b_256"; static const char __pyx_k_block_count[] = "block_count"; static const char __pyx_k_digest_size[] = "digest_size"; static const char __pyx_k_hmac_sha256[] = "hmac_sha256"; static const char __pyx_k_mro_entries[] = "__mro_entries__"; static const char __pyx_k_unpack_from[] = "unpack_from"; static const char __pyx_k_bytes_to_int[] = "bytes_to_int"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_stringsource[] = ""; static const char __pyx_k_OverflowError[] = "OverflowError"; static const char __pyx_k_bytes_to_long[] = "bytes_to_long"; static const char __pyx_k_class_getitem[] = "__class_getitem__"; static const char __pyx_k_digest_length[] = "digest_length"; static const char __pyx_k_init_subclass[] = "__init_subclass__"; static const char __pyx_k_long_to_bytes[] = "long_to_bytes"; static const char __pyx_k_output_length[] = "output_length"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_AssertionError[] = "AssertionError"; static const char __pyx_k_IntegrityError[] = "IntegrityError"; static const char __pyx_k_AES256_CTR_BASE[] = "AES256_CTR_BASE"; static const char __pyx_k_AES_block_count[] = "AES.block_count"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_hkdf_hmac_sha512[] = "hkdf_hmac_sha512"; static const char __pyx_k_num_cipher_blocks[] = "num_cipher_blocks"; static const char __pyx_k_AES256_CTR_BLAKE2b[] = "AES256_CTR_BLAKE2b"; static const char __pyx_k_UNENCRYPTED___init[] = "UNENCRYPTED.__init__"; static const char __pyx_k_UNENCRYPTED_set_iv[] = "UNENCRYPTED.set_iv"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_requirements_check[] = "requirements_check"; static const char __pyx_k_AES___reduce_cython[] = "AES.__reduce_cython__"; static const char __pyx_k_NotImplementedError[] = "NotImplementedError"; static const char __pyx_k_UNENCRYPTED_decrypt[] = "UNENCRYPTED.decrypt"; static const char __pyx_k_UNENCRYPTED_encrypt[] = "UNENCRYPTED.encrypt"; static const char __pyx_k_UNENCRYPTED_next_iv[] = "UNENCRYPTED.next_iv"; static const char __pyx_k_AES___setstate_cython[] = "AES.__setstate_cython__"; static const char __pyx_k_borg_crypto_low_level[] = "borg.crypto.low_level"; static const char __pyx_k_AES256_CTR_BASE_set_iv[] = "AES256_CTR_BASE.set_iv"; static const char __pyx_k_AES256_CTR_HMAC_SHA256[] = "AES256_CTR_HMAC_SHA256"; static const char __pyx_k_UNENCRYPTED_extract_iv[] = "UNENCRYPTED.extract_iv"; static const char __pyx_k_AES256_CTR_BASE_decrypt[] = "AES256_CTR_BASE.decrypt"; static const char __pyx_k_AES256_CTR_BASE_encrypt[] = "AES256_CTR_BASE.encrypt"; static const char __pyx_k_AES256_CTR_BASE_next_iv[] = "AES256_CTR_BASE.next_iv"; static const char __pyx_k_EVP_DecryptFinal_failed[] = "EVP_DecryptFinal failed"; static const char __pyx_k_EVP_EncryptFinal_failed[] = "EVP_EncryptFinal failed"; static const char __pyx_k_UNENCRYPTED_block_count[] = "UNENCRYPTED.block_count"; static const char __pyx_k_EVP_DecryptUpdate_failed[] = "EVP_DecryptUpdate failed"; static const char __pyx_k_EVP_EncryptUpdate_failed[] = "EVP_EncryptUpdate failed"; static const char __pyx_k_EVP_DecryptInit_ex_failed[] = "EVP_DecryptInit_ex failed"; static const char __pyx_k_EVP_EncryptInit_ex_failed[] = "EVP_EncryptInit_ex failed"; static const char __pyx_k_MAC_Authentication_failed[] = "MAC Authentication failed"; static const char __pyx_k_AES256_CTR_BASE_extract_iv[] = "AES256_CTR_BASE.extract_iv"; static const char __pyx_k_EVP_DecryptFinal_ex_failed[] = "EVP_DecryptFinal_ex failed"; static const char __pyx_k_EVP_EncryptFinal_ex_failed[] = "EVP_EncryptFinal_ex failed"; static const char __pyx_k_AES256_CTR_BASE_block_count[] = "AES256_CTR_BASE.block_count"; static const char __pyx_k_src_borg_crypto_low_level_pyx[] = "src/borg/crypto/low_level.pyx"; static const char __pyx_k_AES256_CTR_BASE___reduce_cython[] = "AES256_CTR_BASE.__reduce_cython__"; static const char __pyx_k_AES256_CTR_HMAC_SHA256___reduce[] = "AES256_CTR_HMAC_SHA256.__reduce_cython__"; static const char __pyx_k_AES256_CTR_BASE___setstate_cytho[] = "AES256_CTR_BASE.__setstate_cython__"; static const char __pyx_k_AES256_CTR_BASE_requirements_che[] = "AES256_CTR_BASE.requirements_check"; static const char __pyx_k_AES256_CTR_BLAKE2b___reduce_cyth[] = "AES256_CTR_BLAKE2b.__reduce_cython__"; static const char __pyx_k_AES256_CTR_BLAKE2b___setstate_cy[] = "AES256_CTR_BLAKE2b.__setstate_cython__"; static const char __pyx_k_AES256_CTR_HMAC_SHA256___setstat[] = "AES256_CTR_HMAC_SHA256.__setstate_cython__"; static const char __pyx_k_AES_CTR_requires_OpenSSL_1_0_0_D[] = "AES CTR requires OpenSSL >= 1.0.0. Detected: OpenSSL %08x"; static const char __pyx_k_An_AEAD_style_OpenSSL_wrapper_AP[] = "An AEAD style OpenSSL wrapper\n\nAPI:\n\n encrypt(data, header=b'', aad_offset=0) -> envelope\n decrypt(envelope, header_len=0, aad_offset=0) -> data\n\nEnvelope layout:\n\n|<--------------------------- envelope ------------------------------------------>|\n|<------------ header ----------->|<---------- ciphersuite specific ------------->|\n|<-- not auth data -->|<-- aad -->|<-- e.g.: S(aad, iv, E(data)), iv, E(data) -->|\n\n|--- #aad_offset ---->|\n|------------- #header_len ------>|\n\nS means a cryptographic signature function (like HMAC or GMAC).\nE means a encryption function (like AES).\niv is the initialization vector / nonce, if needed.\n\nThe split of header into not authenticated data and aad (additional authenticated\ndata) is done to support the legacy envelope layout as used in attic and early borg\n(where the TYPE byte was not authenticated) and avoid unneeded memcpy and string\ngarbage.\n\nNewly designed envelope layouts can just authenticate the whole header.\n\nIV handling:\n\n iv = ... # just never repeat!\n cs = CS(hmac_key, enc_key, iv=iv)\n envelope = cs.encrypt(data, header, aad_offset)\n iv = cs.next_iv(len(data))\n (repeat)\n"; static const char __pyx_k_Integrity_checks_failed_Corrupte[] = "Integrity checks failed. Corrupted or tampered data."; static const char __pyx_k_Malfunction_in_the_crypto_module[] = "Malfunction in the crypto module."; static const char __pyx_k_iv_needs_to_be_set_before_encryp[] = "iv needs to be set before encrypt is called"; static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; static const char __pyx_k_output_length_must_be_255_64_byt[] = "output_length must be <= 255 * 64 bytes"; /* #### Code section: decls ### */ static PyObject *__pyx_lambda_funcdef_4borg_6crypto_9low_level_lambda(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_offset); /* proto */ static PyObject *__pyx_lambda_funcdef_4borg_6crypto_9low_level_lambda1(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_offset); /* proto */ static PyObject *__pyx_lambda_funcdef_4borg_6crypto_9low_level_lambda2(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_4borg_6crypto_9low_level_num_cipher_blocks(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_length, PyObject *__pyx_v_blocksize); /* proto */ static PyObject *__pyx_pf_4borg_6crypto_9low_level_11UNENCRYPTED___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_mac_key, PyObject *__pyx_v_enc_key, PyObject *__pyx_v_iv, PyObject *__pyx_v_header_len, CYTHON_UNUSED PyObject *__pyx_v_aad_offset); /* proto */ static PyObject *__pyx_pf_4borg_6crypto_9low_level_11UNENCRYPTED_2encrypt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data, PyObject *__pyx_v_header, PyObject *__pyx_v_iv); /* proto */ static PyObject *__pyx_pf_4borg_6crypto_9low_level_11UNENCRYPTED_4decrypt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_envelope); /* proto */ static PyObject *__pyx_pf_4borg_6crypto_9low_level_11UNENCRYPTED_6block_count(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_length); /* proto */ static PyObject *__pyx_pf_4borg_6crypto_9low_level_11UNENCRYPTED_8set_iv(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_iv); /* proto */ static PyObject *__pyx_pf_4borg_6crypto_9low_level_11UNENCRYPTED_10next_iv(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_6crypto_9low_level_11UNENCRYPTED_12extract_iv(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_envelope); /* proto */ static PyObject *__pyx_pf_4borg_6crypto_9low_level_15AES256_CTR_BASE_requirements_check(CYTHON_UNUSED PyTypeObject *__pyx_v_cls); /* proto */ static int __pyx_pf_4borg_6crypto_9low_level_15AES256_CTR_BASE_2__init__(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_mac_key, PyObject *__pyx_v_enc_key, PyObject *__pyx_v_iv, PyObject *__pyx_v_header_len, PyObject *__pyx_v_aad_offset); /* proto */ static int __pyx_pf_4borg_6crypto_9low_level_15AES256_CTR_BASE_4__cinit__(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_mac_key, CYTHON_UNUSED PyObject *__pyx_v_enc_key, CYTHON_UNUSED PyObject *__pyx_v_iv, CYTHON_UNUSED PyObject *__pyx_v_header_len, CYTHON_UNUSED PyObject *__pyx_v_aad_offset); /* proto */ static void __pyx_pf_4borg_6crypto_9low_level_15AES256_CTR_BASE_6__dealloc__(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_6crypto_9low_level_15AES256_CTR_BASE_8encrypt(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *__pyx_v_self, PyObject *__pyx_v_data, PyObject *__pyx_v_header, PyObject *__pyx_v_iv); /* proto */ static PyObject *__pyx_pf_4borg_6crypto_9low_level_15AES256_CTR_BASE_10decrypt(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *__pyx_v_self, PyObject *__pyx_v_envelope); /* proto */ static PyObject *__pyx_pf_4borg_6crypto_9low_level_15AES256_CTR_BASE_12block_count(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *__pyx_v_self, PyObject *__pyx_v_length); /* proto */ static PyObject *__pyx_pf_4borg_6crypto_9low_level_15AES256_CTR_BASE_14set_iv(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *__pyx_v_self, PyObject *__pyx_v_iv); /* proto */ static PyObject *__pyx_pf_4borg_6crypto_9low_level_15AES256_CTR_BASE_16next_iv(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_6crypto_9low_level_15AES256_CTR_BASE_18extract_iv(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *__pyx_v_self, PyObject *__pyx_v_envelope); /* proto */ static PyObject *__pyx_pf_4borg_6crypto_9low_level_15AES256_CTR_BASE_20__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_6crypto_9low_level_15AES256_CTR_BASE_22__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256___init__(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256 *__pyx_v_self, PyObject *__pyx_v_mac_key, PyObject *__pyx_v_enc_key, PyObject *__pyx_v_iv, PyObject *__pyx_v_header_len, PyObject *__pyx_v_aad_offset); /* proto */ static int __pyx_pf_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256_2__cinit__(CYTHON_UNUSED struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256 *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_mac_key, CYTHON_UNUSED PyObject *__pyx_v_enc_key, CYTHON_UNUSED PyObject *__pyx_v_iv, CYTHON_UNUSED PyObject *__pyx_v_header_len, CYTHON_UNUSED PyObject *__pyx_v_aad_offset); /* proto */ static void __pyx_pf_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256_4__dealloc__(CYTHON_UNUSED struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256 *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256 *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256 *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b___init__(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b *__pyx_v_self, PyObject *__pyx_v_mac_key, PyObject *__pyx_v_enc_key, PyObject *__pyx_v_iv, PyObject *__pyx_v_header_len, PyObject *__pyx_v_aad_offset); /* proto */ static int __pyx_pf_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b_2__cinit__(CYTHON_UNUSED struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_mac_key, CYTHON_UNUSED PyObject *__pyx_v_enc_key, CYTHON_UNUSED PyObject *__pyx_v_iv, CYTHON_UNUSED PyObject *__pyx_v_header_len, CYTHON_UNUSED PyObject *__pyx_v_aad_offset); /* proto */ static void __pyx_pf_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b_4__dealloc__(CYTHON_UNUSED struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_4borg_6crypto_9low_level_3AES___init__(struct __pyx_obj_4borg_6crypto_9low_level_AES *__pyx_v_self, PyObject *__pyx_v_enc_key, PyObject *__pyx_v_iv); /* proto */ static int __pyx_pf_4borg_6crypto_9low_level_3AES_2__cinit__(struct __pyx_obj_4borg_6crypto_9low_level_AES *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_enc_key, CYTHON_UNUSED PyObject *__pyx_v_iv); /* proto */ static void __pyx_pf_4borg_6crypto_9low_level_3AES_4__dealloc__(struct __pyx_obj_4borg_6crypto_9low_level_AES *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_6crypto_9low_level_3AES_6encrypt(struct __pyx_obj_4borg_6crypto_9low_level_AES *__pyx_v_self, PyObject *__pyx_v_data, PyObject *__pyx_v_iv); /* proto */ static PyObject *__pyx_pf_4borg_6crypto_9low_level_3AES_8decrypt(struct __pyx_obj_4borg_6crypto_9low_level_AES *__pyx_v_self, PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_4borg_6crypto_9low_level_3AES_10block_count(struct __pyx_obj_4borg_6crypto_9low_level_AES *__pyx_v_self, PyObject *__pyx_v_length); /* proto */ static PyObject *__pyx_pf_4borg_6crypto_9low_level_3AES_12set_iv(struct __pyx_obj_4borg_6crypto_9low_level_AES *__pyx_v_self, PyObject *__pyx_v_iv); /* proto */ static PyObject *__pyx_pf_4borg_6crypto_9low_level_3AES_14next_iv(struct __pyx_obj_4borg_6crypto_9low_level_AES *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_6crypto_9low_level_3AES_16__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_6crypto_9low_level_AES *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_6crypto_9low_level_3AES_18__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_6crypto_9low_level_AES *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_4borg_6crypto_9low_level_2hmac_sha256(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_key, PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_4borg_6crypto_9low_level_4blake2b_256(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_key, PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_4borg_6crypto_9low_level_6blake2b_128(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_4borg_6crypto_9low_level_8hkdf_hmac_sha512(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ikm, PyObject *__pyx_v_salt, PyObject *__pyx_v_info, PyObject *__pyx_v_output_length); /* proto */ static PyObject *__pyx_tp_new_4borg_6crypto_9low_level_AES256_CTR_BASE(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_4borg_6crypto_9low_level_AES(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_7cpython_4type_type; #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_7cpython_4bool_bool; #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_7cpython_7complex_complex; #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE PyObject *__pyx_type_4borg_6crypto_9low_level_AES256_CTR_BASE; PyObject *__pyx_type_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256; PyObject *__pyx_type_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b; PyObject *__pyx_type_4borg_6crypto_9low_level_AES; #endif PyTypeObject *__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BASE; PyTypeObject *__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256; PyTypeObject *__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b; PyTypeObject *__pyx_ptype_4borg_6crypto_9low_level_AES; PyObject *__pyx_kp_b_; PyObject *__pyx_kp_s_1_4_01; PyObject *__pyx_n_s_AES; PyObject *__pyx_n_s_AES256_CTR_BASE; PyObject *__pyx_n_s_AES256_CTR_BASE___reduce_cython; PyObject *__pyx_n_s_AES256_CTR_BASE___setstate_cytho; PyObject *__pyx_n_s_AES256_CTR_BASE_block_count; PyObject *__pyx_n_s_AES256_CTR_BASE_decrypt; PyObject *__pyx_n_s_AES256_CTR_BASE_encrypt; PyObject *__pyx_n_s_AES256_CTR_BASE_extract_iv; PyObject *__pyx_n_s_AES256_CTR_BASE_next_iv; PyObject *__pyx_n_s_AES256_CTR_BASE_requirements_che; PyObject *__pyx_n_s_AES256_CTR_BASE_set_iv; PyObject *__pyx_n_s_AES256_CTR_BLAKE2b; PyObject *__pyx_n_s_AES256_CTR_BLAKE2b___reduce_cyth; PyObject *__pyx_n_s_AES256_CTR_BLAKE2b___setstate_cy; PyObject *__pyx_n_s_AES256_CTR_HMAC_SHA256; PyObject *__pyx_n_s_AES256_CTR_HMAC_SHA256___reduce; PyObject *__pyx_n_s_AES256_CTR_HMAC_SHA256___setstat; PyObject *__pyx_kp_s_AES_CTR_requires_OpenSSL_1_0_0_D; PyObject *__pyx_n_s_AES___reduce_cython; PyObject *__pyx_n_s_AES___setstate_cython; PyObject *__pyx_n_s_AES_block_count; PyObject *__pyx_n_s_AES_decrypt; PyObject *__pyx_n_s_AES_encrypt; PyObject *__pyx_n_s_AES_next_iv; PyObject *__pyx_n_s_AES_set_iv; PyObject *__pyx_n_s_API_VERSION; PyObject *__pyx_n_s_AssertionError; PyObject *__pyx_n_s_CryptoError; PyObject *__pyx_kp_s_EVP_DecryptFinal_ex_failed; PyObject *__pyx_kp_s_EVP_DecryptFinal_failed; PyObject *__pyx_kp_s_EVP_DecryptInit_ex_failed; PyObject *__pyx_kp_s_EVP_DecryptUpdate_failed; PyObject *__pyx_kp_s_EVP_EncryptFinal_ex_failed; PyObject *__pyx_kp_s_EVP_EncryptFinal_failed; PyObject *__pyx_kp_s_EVP_EncryptInit_ex_failed; PyObject *__pyx_kp_s_EVP_EncryptUpdate_failed; PyObject *__pyx_n_s_HMAC; PyObject *__pyx_kp_s_I; PyObject *__pyx_n_s_IndexError; PyObject *__pyx_n_s_IntegrityError; PyObject *__pyx_kp_s_Integrity_checks_failed_Corrupte; PyObject *__pyx_kp_s_MAC_Authentication_failed; PyObject *__pyx_kp_s_Malfunction_in_the_crypto_module; PyObject *__pyx_n_s_MemoryError; PyObject *__pyx_n_s_NotImplementedError; PyObject *__pyx_n_s_OverflowError; PyObject *__pyx_kp_s_Q; PyObject *__pyx_n_s_Struct; PyObject *__pyx_n_s_TypeError; PyObject *__pyx_n_s_UNENCRYPTED; PyObject *__pyx_n_s_UNENCRYPTED___init; PyObject *__pyx_n_s_UNENCRYPTED_block_count; PyObject *__pyx_n_s_UNENCRYPTED_decrypt; PyObject *__pyx_n_s_UNENCRYPTED_encrypt; PyObject *__pyx_n_s_UNENCRYPTED_extract_iv; PyObject *__pyx_n_s_UNENCRYPTED_next_iv; PyObject *__pyx_n_s_UNENCRYPTED_set_iv; PyObject *__pyx_n_s_ValueError; PyObject *__pyx_n_s__11; PyObject *__pyx_kp_u__12; PyObject *__pyx_kp_b__2; PyObject *__pyx_n_s__69; PyObject *__pyx_n_s_aad_offset; PyObject *__pyx_n_s_alen; PyObject *__pyx_n_s_aoffset; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_big; PyObject *__pyx_n_s_blake2b; PyObject *__pyx_n_s_blake2b_128; PyObject *__pyx_n_s_blake2b_256; PyObject *__pyx_n_s_block_count; PyObject *__pyx_n_s_blocksize; PyObject *__pyx_n_s_borg_crypto_low_level; PyObject *__pyx_n_s_byteorder; PyObject *__pyx_n_s_bytes_to_int; PyObject *__pyx_n_s_bytes_to_long; PyObject *__pyx_n_s_ceil; PyObject *__pyx_n_s_class_getitem; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_cls; PyObject *__pyx_n_s_data; PyObject *__pyx_n_s_decrypt; PyObject *__pyx_n_s_dict; PyObject *__pyx_n_s_digest; PyObject *__pyx_n_s_digest_length; PyObject *__pyx_n_s_digest_size; PyObject *__pyx_kp_u_disable; PyObject *__pyx_n_s_doc; PyObject *__pyx_kp_u_enable; PyObject *__pyx_n_s_enc_key; PyObject *__pyx_n_s_encrypt; PyObject *__pyx_n_s_enumerate; PyObject *__pyx_n_s_envelope; PyObject *__pyx_n_s_extract_iv; PyObject *__pyx_n_s_from_bytes; PyObject *__pyx_kp_u_gc; PyObject *__pyx_n_s_getstate; PyObject *__pyx_n_s_hashlib; PyObject *__pyx_n_s_hdata; PyObject *__pyx_n_s_header; PyObject *__pyx_n_s_header_len; PyObject *__pyx_n_s_hkdf_hmac_sha512; PyObject *__pyx_n_s_hlen; PyObject *__pyx_n_s_hmac; PyObject *__pyx_n_s_hmac_sha256; PyObject *__pyx_n_s_i; PyObject *__pyx_n_s_idata; PyObject *__pyx_n_s_ikm; PyObject *__pyx_n_s_ilen; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_info; PyObject *__pyx_n_s_init; PyObject *__pyx_n_s_init_subclass; PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_int; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_kp_u_isenabled; PyObject *__pyx_n_s_iv; PyObject *__pyx_kp_s_iv_needs_to_be_set_before_encryp; PyObject *__pyx_n_s_key; PyObject *__pyx_n_s_lambda; PyObject *__pyx_n_s_length; PyObject *__pyx_n_s_little; PyObject *__pyx_n_s_long; PyObject *__pyx_n_s_long_to_bytes; PyObject *__pyx_n_s_mac_buf; PyObject *__pyx_n_s_mac_key; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_math; PyObject *__pyx_n_s_metaclass; PyObject *__pyx_n_s_module; PyObject *__pyx_n_s_mro_entries; PyObject *__pyx_n_s_msg; PyObject *__pyx_n_s_n; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_next_iv; PyObject *__pyx_kp_s_no_default___reduce___due_to_non; PyObject *__pyx_n_s_num_cipher_blocks; PyObject *__pyx_n_s_odata; PyObject *__pyx_n_s_offset; PyObject *__pyx_n_s_olen; PyObject *__pyx_n_s_output; PyObject *__pyx_n_s_output_length; PyObject *__pyx_kp_s_output_length_must_be_255_64_byt; PyObject *__pyx_n_s_pack; PyObject *__pyx_n_s_prepare; PyObject *__pyx_n_s_prk; PyObject *__pyx_n_s_pyx_state; PyObject *__pyx_n_s_pyx_vtable; PyObject *__pyx_n_s_qualname; PyObject *__pyx_n_s_range; PyObject *__pyx_n_s_rc; PyObject *__pyx_n_s_reduce; PyObject *__pyx_n_s_reduce_cython; PyObject *__pyx_n_s_reduce_ex; PyObject *__pyx_n_s_requirements_check; PyObject *__pyx_n_s_salt; PyObject *__pyx_n_s_self; PyObject *__pyx_n_s_set_iv; PyObject *__pyx_n_s_set_name; PyObject *__pyx_n_s_setstate; PyObject *__pyx_n_s_setstate_cython; PyObject *__pyx_n_s_sha256; PyObject *__pyx_n_s_sha512; PyObject *__pyx_n_s_spec; PyObject *__pyx_kp_s_src_borg_crypto_low_level_pyx; PyObject *__pyx_kp_s_stringsource; PyObject *__pyx_n_s_struct; PyObject *__pyx_n_s_super; PyObject *__pyx_n_s_t_n; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_to_bytes; PyObject *__pyx_n_s_unpack_from; PyObject *__pyx_n_s_x; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_int_16; PyObject *__pyx_int_32; PyObject *__pyx_int_64; PyObject *__pyx_int_255; PyObject *__pyx_tuple__3; PyObject *__pyx_tuple__4; PyObject *__pyx_tuple__5; PyObject *__pyx_tuple__6; PyObject *__pyx_tuple__7; PyObject *__pyx_tuple__8; PyObject *__pyx_tuple__9; PyObject *__pyx_tuple__10; PyObject *__pyx_tuple__13; PyObject *__pyx_tuple__14; PyObject *__pyx_tuple__15; PyObject *__pyx_tuple__16; PyObject *__pyx_tuple__18; PyObject *__pyx_tuple__19; PyObject *__pyx_tuple__21; PyObject *__pyx_tuple__22; PyObject *__pyx_tuple__24; PyObject *__pyx_tuple__25; PyObject *__pyx_tuple__27; PyObject *__pyx_tuple__29; PyObject *__pyx_tuple__31; PyObject *__pyx_tuple__34; PyObject *__pyx_tuple__36; PyObject *__pyx_tuple__38; PyObject *__pyx_tuple__43; PyObject *__pyx_tuple__46; PyObject *__pyx_tuple__52; PyObject *__pyx_tuple__54; PyObject *__pyx_tuple__55; PyObject *__pyx_tuple__62; PyObject *__pyx_tuple__65; PyObject *__pyx_tuple__67; PyObject *__pyx_codeobj__17; PyObject *__pyx_codeobj__20; PyObject *__pyx_codeobj__23; PyObject *__pyx_codeobj__26; PyObject *__pyx_codeobj__28; PyObject *__pyx_codeobj__30; PyObject *__pyx_codeobj__32; PyObject *__pyx_codeobj__33; PyObject *__pyx_codeobj__35; PyObject *__pyx_codeobj__37; PyObject *__pyx_codeobj__39; PyObject *__pyx_codeobj__40; PyObject *__pyx_codeobj__41; PyObject *__pyx_codeobj__42; PyObject *__pyx_codeobj__44; PyObject *__pyx_codeobj__45; PyObject *__pyx_codeobj__47; PyObject *__pyx_codeobj__48; PyObject *__pyx_codeobj__49; PyObject *__pyx_codeobj__50; PyObject *__pyx_codeobj__51; PyObject *__pyx_codeobj__53; PyObject *__pyx_codeobj__56; PyObject *__pyx_codeobj__57; PyObject *__pyx_codeobj__58; PyObject *__pyx_codeobj__59; PyObject *__pyx_codeobj__60; PyObject *__pyx_codeobj__61; PyObject *__pyx_codeobj__63; PyObject *__pyx_codeobj__64; PyObject *__pyx_codeobj__66; PyObject *__pyx_codeobj__68; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type); Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4bool_bool); Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_7complex_complex); Py_CLEAR(clear_module_state->__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BASE); Py_CLEAR(clear_module_state->__pyx_type_4borg_6crypto_9low_level_AES256_CTR_BASE); Py_CLEAR(clear_module_state->__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256); Py_CLEAR(clear_module_state->__pyx_type_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256); Py_CLEAR(clear_module_state->__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b); Py_CLEAR(clear_module_state->__pyx_type_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b); Py_CLEAR(clear_module_state->__pyx_ptype_4borg_6crypto_9low_level_AES); Py_CLEAR(clear_module_state->__pyx_type_4borg_6crypto_9low_level_AES); Py_CLEAR(clear_module_state->__pyx_kp_b_); Py_CLEAR(clear_module_state->__pyx_kp_s_1_4_01); Py_CLEAR(clear_module_state->__pyx_n_s_AES); Py_CLEAR(clear_module_state->__pyx_n_s_AES256_CTR_BASE); Py_CLEAR(clear_module_state->__pyx_n_s_AES256_CTR_BASE___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_AES256_CTR_BASE___setstate_cytho); Py_CLEAR(clear_module_state->__pyx_n_s_AES256_CTR_BASE_block_count); Py_CLEAR(clear_module_state->__pyx_n_s_AES256_CTR_BASE_decrypt); Py_CLEAR(clear_module_state->__pyx_n_s_AES256_CTR_BASE_encrypt); Py_CLEAR(clear_module_state->__pyx_n_s_AES256_CTR_BASE_extract_iv); Py_CLEAR(clear_module_state->__pyx_n_s_AES256_CTR_BASE_next_iv); Py_CLEAR(clear_module_state->__pyx_n_s_AES256_CTR_BASE_requirements_che); Py_CLEAR(clear_module_state->__pyx_n_s_AES256_CTR_BASE_set_iv); Py_CLEAR(clear_module_state->__pyx_n_s_AES256_CTR_BLAKE2b); Py_CLEAR(clear_module_state->__pyx_n_s_AES256_CTR_BLAKE2b___reduce_cyth); Py_CLEAR(clear_module_state->__pyx_n_s_AES256_CTR_BLAKE2b___setstate_cy); Py_CLEAR(clear_module_state->__pyx_n_s_AES256_CTR_HMAC_SHA256); Py_CLEAR(clear_module_state->__pyx_n_s_AES256_CTR_HMAC_SHA256___reduce); Py_CLEAR(clear_module_state->__pyx_n_s_AES256_CTR_HMAC_SHA256___setstat); Py_CLEAR(clear_module_state->__pyx_kp_s_AES_CTR_requires_OpenSSL_1_0_0_D); Py_CLEAR(clear_module_state->__pyx_n_s_AES___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_AES___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_AES_block_count); Py_CLEAR(clear_module_state->__pyx_n_s_AES_decrypt); Py_CLEAR(clear_module_state->__pyx_n_s_AES_encrypt); Py_CLEAR(clear_module_state->__pyx_n_s_AES_next_iv); Py_CLEAR(clear_module_state->__pyx_n_s_AES_set_iv); Py_CLEAR(clear_module_state->__pyx_n_s_API_VERSION); Py_CLEAR(clear_module_state->__pyx_n_s_AssertionError); Py_CLEAR(clear_module_state->__pyx_n_s_CryptoError); Py_CLEAR(clear_module_state->__pyx_kp_s_EVP_DecryptFinal_ex_failed); Py_CLEAR(clear_module_state->__pyx_kp_s_EVP_DecryptFinal_failed); Py_CLEAR(clear_module_state->__pyx_kp_s_EVP_DecryptInit_ex_failed); Py_CLEAR(clear_module_state->__pyx_kp_s_EVP_DecryptUpdate_failed); Py_CLEAR(clear_module_state->__pyx_kp_s_EVP_EncryptFinal_ex_failed); Py_CLEAR(clear_module_state->__pyx_kp_s_EVP_EncryptFinal_failed); Py_CLEAR(clear_module_state->__pyx_kp_s_EVP_EncryptInit_ex_failed); Py_CLEAR(clear_module_state->__pyx_kp_s_EVP_EncryptUpdate_failed); Py_CLEAR(clear_module_state->__pyx_n_s_HMAC); Py_CLEAR(clear_module_state->__pyx_kp_s_I); Py_CLEAR(clear_module_state->__pyx_n_s_IndexError); Py_CLEAR(clear_module_state->__pyx_n_s_IntegrityError); Py_CLEAR(clear_module_state->__pyx_kp_s_Integrity_checks_failed_Corrupte); Py_CLEAR(clear_module_state->__pyx_kp_s_MAC_Authentication_failed); Py_CLEAR(clear_module_state->__pyx_kp_s_Malfunction_in_the_crypto_module); Py_CLEAR(clear_module_state->__pyx_n_s_MemoryError); Py_CLEAR(clear_module_state->__pyx_n_s_NotImplementedError); Py_CLEAR(clear_module_state->__pyx_n_s_OverflowError); Py_CLEAR(clear_module_state->__pyx_kp_s_Q); Py_CLEAR(clear_module_state->__pyx_n_s_Struct); Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); Py_CLEAR(clear_module_state->__pyx_n_s_UNENCRYPTED); Py_CLEAR(clear_module_state->__pyx_n_s_UNENCRYPTED___init); Py_CLEAR(clear_module_state->__pyx_n_s_UNENCRYPTED_block_count); Py_CLEAR(clear_module_state->__pyx_n_s_UNENCRYPTED_decrypt); Py_CLEAR(clear_module_state->__pyx_n_s_UNENCRYPTED_encrypt); Py_CLEAR(clear_module_state->__pyx_n_s_UNENCRYPTED_extract_iv); Py_CLEAR(clear_module_state->__pyx_n_s_UNENCRYPTED_next_iv); Py_CLEAR(clear_module_state->__pyx_n_s_UNENCRYPTED_set_iv); Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); Py_CLEAR(clear_module_state->__pyx_n_s__11); Py_CLEAR(clear_module_state->__pyx_kp_u__12); Py_CLEAR(clear_module_state->__pyx_kp_b__2); Py_CLEAR(clear_module_state->__pyx_n_s__69); Py_CLEAR(clear_module_state->__pyx_n_s_aad_offset); Py_CLEAR(clear_module_state->__pyx_n_s_alen); Py_CLEAR(clear_module_state->__pyx_n_s_aoffset); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_big); Py_CLEAR(clear_module_state->__pyx_n_s_blake2b); Py_CLEAR(clear_module_state->__pyx_n_s_blake2b_128); Py_CLEAR(clear_module_state->__pyx_n_s_blake2b_256); Py_CLEAR(clear_module_state->__pyx_n_s_block_count); Py_CLEAR(clear_module_state->__pyx_n_s_blocksize); Py_CLEAR(clear_module_state->__pyx_n_s_borg_crypto_low_level); Py_CLEAR(clear_module_state->__pyx_n_s_byteorder); Py_CLEAR(clear_module_state->__pyx_n_s_bytes_to_int); Py_CLEAR(clear_module_state->__pyx_n_s_bytes_to_long); Py_CLEAR(clear_module_state->__pyx_n_s_ceil); Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_cls); Py_CLEAR(clear_module_state->__pyx_n_s_data); Py_CLEAR(clear_module_state->__pyx_n_s_decrypt); Py_CLEAR(clear_module_state->__pyx_n_s_dict); Py_CLEAR(clear_module_state->__pyx_n_s_digest); Py_CLEAR(clear_module_state->__pyx_n_s_digest_length); Py_CLEAR(clear_module_state->__pyx_n_s_digest_size); Py_CLEAR(clear_module_state->__pyx_kp_u_disable); Py_CLEAR(clear_module_state->__pyx_n_s_doc); Py_CLEAR(clear_module_state->__pyx_kp_u_enable); Py_CLEAR(clear_module_state->__pyx_n_s_enc_key); Py_CLEAR(clear_module_state->__pyx_n_s_encrypt); Py_CLEAR(clear_module_state->__pyx_n_s_enumerate); Py_CLEAR(clear_module_state->__pyx_n_s_envelope); Py_CLEAR(clear_module_state->__pyx_n_s_extract_iv); Py_CLEAR(clear_module_state->__pyx_n_s_from_bytes); Py_CLEAR(clear_module_state->__pyx_kp_u_gc); Py_CLEAR(clear_module_state->__pyx_n_s_getstate); Py_CLEAR(clear_module_state->__pyx_n_s_hashlib); Py_CLEAR(clear_module_state->__pyx_n_s_hdata); Py_CLEAR(clear_module_state->__pyx_n_s_header); Py_CLEAR(clear_module_state->__pyx_n_s_header_len); Py_CLEAR(clear_module_state->__pyx_n_s_hkdf_hmac_sha512); Py_CLEAR(clear_module_state->__pyx_n_s_hlen); Py_CLEAR(clear_module_state->__pyx_n_s_hmac); Py_CLEAR(clear_module_state->__pyx_n_s_hmac_sha256); Py_CLEAR(clear_module_state->__pyx_n_s_i); Py_CLEAR(clear_module_state->__pyx_n_s_idata); Py_CLEAR(clear_module_state->__pyx_n_s_ikm); Py_CLEAR(clear_module_state->__pyx_n_s_ilen); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_info); Py_CLEAR(clear_module_state->__pyx_n_s_init); Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_int); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); Py_CLEAR(clear_module_state->__pyx_n_s_iv); Py_CLEAR(clear_module_state->__pyx_kp_s_iv_needs_to_be_set_before_encryp); Py_CLEAR(clear_module_state->__pyx_n_s_key); Py_CLEAR(clear_module_state->__pyx_n_s_lambda); Py_CLEAR(clear_module_state->__pyx_n_s_length); Py_CLEAR(clear_module_state->__pyx_n_s_little); Py_CLEAR(clear_module_state->__pyx_n_s_long); Py_CLEAR(clear_module_state->__pyx_n_s_long_to_bytes); Py_CLEAR(clear_module_state->__pyx_n_s_mac_buf); Py_CLEAR(clear_module_state->__pyx_n_s_mac_key); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_math); Py_CLEAR(clear_module_state->__pyx_n_s_metaclass); Py_CLEAR(clear_module_state->__pyx_n_s_module); Py_CLEAR(clear_module_state->__pyx_n_s_mro_entries); Py_CLEAR(clear_module_state->__pyx_n_s_msg); Py_CLEAR(clear_module_state->__pyx_n_s_n); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_next_iv); Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_CLEAR(clear_module_state->__pyx_n_s_num_cipher_blocks); Py_CLEAR(clear_module_state->__pyx_n_s_odata); Py_CLEAR(clear_module_state->__pyx_n_s_offset); Py_CLEAR(clear_module_state->__pyx_n_s_olen); Py_CLEAR(clear_module_state->__pyx_n_s_output); Py_CLEAR(clear_module_state->__pyx_n_s_output_length); Py_CLEAR(clear_module_state->__pyx_kp_s_output_length_must_be_255_64_byt); Py_CLEAR(clear_module_state->__pyx_n_s_pack); Py_CLEAR(clear_module_state->__pyx_n_s_prepare); Py_CLEAR(clear_module_state->__pyx_n_s_prk); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable); Py_CLEAR(clear_module_state->__pyx_n_s_qualname); Py_CLEAR(clear_module_state->__pyx_n_s_range); Py_CLEAR(clear_module_state->__pyx_n_s_rc); Py_CLEAR(clear_module_state->__pyx_n_s_reduce); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex); Py_CLEAR(clear_module_state->__pyx_n_s_requirements_check); Py_CLEAR(clear_module_state->__pyx_n_s_salt); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_n_s_set_iv); Py_CLEAR(clear_module_state->__pyx_n_s_set_name); Py_CLEAR(clear_module_state->__pyx_n_s_setstate); Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_sha256); Py_CLEAR(clear_module_state->__pyx_n_s_sha512); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_kp_s_src_borg_crypto_low_level_pyx); Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource); Py_CLEAR(clear_module_state->__pyx_n_s_struct); Py_CLEAR(clear_module_state->__pyx_n_s_super); Py_CLEAR(clear_module_state->__pyx_n_s_t_n); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_to_bytes); Py_CLEAR(clear_module_state->__pyx_n_s_unpack_from); Py_CLEAR(clear_module_state->__pyx_n_s_x); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_1); Py_CLEAR(clear_module_state->__pyx_int_16); Py_CLEAR(clear_module_state->__pyx_int_32); Py_CLEAR(clear_module_state->__pyx_int_64); Py_CLEAR(clear_module_state->__pyx_int_255); Py_CLEAR(clear_module_state->__pyx_tuple__3); Py_CLEAR(clear_module_state->__pyx_tuple__4); Py_CLEAR(clear_module_state->__pyx_tuple__5); Py_CLEAR(clear_module_state->__pyx_tuple__6); Py_CLEAR(clear_module_state->__pyx_tuple__7); Py_CLEAR(clear_module_state->__pyx_tuple__8); Py_CLEAR(clear_module_state->__pyx_tuple__9); Py_CLEAR(clear_module_state->__pyx_tuple__10); Py_CLEAR(clear_module_state->__pyx_tuple__13); Py_CLEAR(clear_module_state->__pyx_tuple__14); Py_CLEAR(clear_module_state->__pyx_tuple__15); Py_CLEAR(clear_module_state->__pyx_tuple__16); Py_CLEAR(clear_module_state->__pyx_tuple__18); Py_CLEAR(clear_module_state->__pyx_tuple__19); Py_CLEAR(clear_module_state->__pyx_tuple__21); Py_CLEAR(clear_module_state->__pyx_tuple__22); Py_CLEAR(clear_module_state->__pyx_tuple__24); Py_CLEAR(clear_module_state->__pyx_tuple__25); Py_CLEAR(clear_module_state->__pyx_tuple__27); Py_CLEAR(clear_module_state->__pyx_tuple__29); Py_CLEAR(clear_module_state->__pyx_tuple__31); Py_CLEAR(clear_module_state->__pyx_tuple__34); Py_CLEAR(clear_module_state->__pyx_tuple__36); Py_CLEAR(clear_module_state->__pyx_tuple__38); Py_CLEAR(clear_module_state->__pyx_tuple__43); Py_CLEAR(clear_module_state->__pyx_tuple__46); Py_CLEAR(clear_module_state->__pyx_tuple__52); Py_CLEAR(clear_module_state->__pyx_tuple__54); Py_CLEAR(clear_module_state->__pyx_tuple__55); Py_CLEAR(clear_module_state->__pyx_tuple__62); Py_CLEAR(clear_module_state->__pyx_tuple__65); Py_CLEAR(clear_module_state->__pyx_tuple__67); Py_CLEAR(clear_module_state->__pyx_codeobj__17); Py_CLEAR(clear_module_state->__pyx_codeobj__20); Py_CLEAR(clear_module_state->__pyx_codeobj__23); Py_CLEAR(clear_module_state->__pyx_codeobj__26); Py_CLEAR(clear_module_state->__pyx_codeobj__28); Py_CLEAR(clear_module_state->__pyx_codeobj__30); Py_CLEAR(clear_module_state->__pyx_codeobj__32); Py_CLEAR(clear_module_state->__pyx_codeobj__33); Py_CLEAR(clear_module_state->__pyx_codeobj__35); Py_CLEAR(clear_module_state->__pyx_codeobj__37); Py_CLEAR(clear_module_state->__pyx_codeobj__39); Py_CLEAR(clear_module_state->__pyx_codeobj__40); Py_CLEAR(clear_module_state->__pyx_codeobj__41); Py_CLEAR(clear_module_state->__pyx_codeobj__42); Py_CLEAR(clear_module_state->__pyx_codeobj__44); Py_CLEAR(clear_module_state->__pyx_codeobj__45); Py_CLEAR(clear_module_state->__pyx_codeobj__47); Py_CLEAR(clear_module_state->__pyx_codeobj__48); Py_CLEAR(clear_module_state->__pyx_codeobj__49); Py_CLEAR(clear_module_state->__pyx_codeobj__50); Py_CLEAR(clear_module_state->__pyx_codeobj__51); Py_CLEAR(clear_module_state->__pyx_codeobj__53); Py_CLEAR(clear_module_state->__pyx_codeobj__56); Py_CLEAR(clear_module_state->__pyx_codeobj__57); Py_CLEAR(clear_module_state->__pyx_codeobj__58); Py_CLEAR(clear_module_state->__pyx_codeobj__59); Py_CLEAR(clear_module_state->__pyx_codeobj__60); Py_CLEAR(clear_module_state->__pyx_codeobj__61); Py_CLEAR(clear_module_state->__pyx_codeobj__63); Py_CLEAR(clear_module_state->__pyx_codeobj__64); Py_CLEAR(clear_module_state->__pyx_codeobj__66); Py_CLEAR(clear_module_state->__pyx_codeobj__68); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type); Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4bool_bool); Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_7complex_complex); Py_VISIT(traverse_module_state->__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BASE); Py_VISIT(traverse_module_state->__pyx_type_4borg_6crypto_9low_level_AES256_CTR_BASE); Py_VISIT(traverse_module_state->__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256); Py_VISIT(traverse_module_state->__pyx_type_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256); Py_VISIT(traverse_module_state->__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b); Py_VISIT(traverse_module_state->__pyx_type_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b); Py_VISIT(traverse_module_state->__pyx_ptype_4borg_6crypto_9low_level_AES); Py_VISIT(traverse_module_state->__pyx_type_4borg_6crypto_9low_level_AES); Py_VISIT(traverse_module_state->__pyx_kp_b_); Py_VISIT(traverse_module_state->__pyx_kp_s_1_4_01); Py_VISIT(traverse_module_state->__pyx_n_s_AES); Py_VISIT(traverse_module_state->__pyx_n_s_AES256_CTR_BASE); Py_VISIT(traverse_module_state->__pyx_n_s_AES256_CTR_BASE___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_AES256_CTR_BASE___setstate_cytho); Py_VISIT(traverse_module_state->__pyx_n_s_AES256_CTR_BASE_block_count); Py_VISIT(traverse_module_state->__pyx_n_s_AES256_CTR_BASE_decrypt); Py_VISIT(traverse_module_state->__pyx_n_s_AES256_CTR_BASE_encrypt); Py_VISIT(traverse_module_state->__pyx_n_s_AES256_CTR_BASE_extract_iv); Py_VISIT(traverse_module_state->__pyx_n_s_AES256_CTR_BASE_next_iv); Py_VISIT(traverse_module_state->__pyx_n_s_AES256_CTR_BASE_requirements_che); Py_VISIT(traverse_module_state->__pyx_n_s_AES256_CTR_BASE_set_iv); Py_VISIT(traverse_module_state->__pyx_n_s_AES256_CTR_BLAKE2b); Py_VISIT(traverse_module_state->__pyx_n_s_AES256_CTR_BLAKE2b___reduce_cyth); Py_VISIT(traverse_module_state->__pyx_n_s_AES256_CTR_BLAKE2b___setstate_cy); Py_VISIT(traverse_module_state->__pyx_n_s_AES256_CTR_HMAC_SHA256); Py_VISIT(traverse_module_state->__pyx_n_s_AES256_CTR_HMAC_SHA256___reduce); Py_VISIT(traverse_module_state->__pyx_n_s_AES256_CTR_HMAC_SHA256___setstat); Py_VISIT(traverse_module_state->__pyx_kp_s_AES_CTR_requires_OpenSSL_1_0_0_D); Py_VISIT(traverse_module_state->__pyx_n_s_AES___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_AES___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_AES_block_count); Py_VISIT(traverse_module_state->__pyx_n_s_AES_decrypt); Py_VISIT(traverse_module_state->__pyx_n_s_AES_encrypt); Py_VISIT(traverse_module_state->__pyx_n_s_AES_next_iv); Py_VISIT(traverse_module_state->__pyx_n_s_AES_set_iv); Py_VISIT(traverse_module_state->__pyx_n_s_API_VERSION); Py_VISIT(traverse_module_state->__pyx_n_s_AssertionError); Py_VISIT(traverse_module_state->__pyx_n_s_CryptoError); Py_VISIT(traverse_module_state->__pyx_kp_s_EVP_DecryptFinal_ex_failed); Py_VISIT(traverse_module_state->__pyx_kp_s_EVP_DecryptFinal_failed); Py_VISIT(traverse_module_state->__pyx_kp_s_EVP_DecryptInit_ex_failed); Py_VISIT(traverse_module_state->__pyx_kp_s_EVP_DecryptUpdate_failed); Py_VISIT(traverse_module_state->__pyx_kp_s_EVP_EncryptFinal_ex_failed); Py_VISIT(traverse_module_state->__pyx_kp_s_EVP_EncryptFinal_failed); Py_VISIT(traverse_module_state->__pyx_kp_s_EVP_EncryptInit_ex_failed); Py_VISIT(traverse_module_state->__pyx_kp_s_EVP_EncryptUpdate_failed); Py_VISIT(traverse_module_state->__pyx_n_s_HMAC); Py_VISIT(traverse_module_state->__pyx_kp_s_I); Py_VISIT(traverse_module_state->__pyx_n_s_IndexError); Py_VISIT(traverse_module_state->__pyx_n_s_IntegrityError); Py_VISIT(traverse_module_state->__pyx_kp_s_Integrity_checks_failed_Corrupte); Py_VISIT(traverse_module_state->__pyx_kp_s_MAC_Authentication_failed); Py_VISIT(traverse_module_state->__pyx_kp_s_Malfunction_in_the_crypto_module); Py_VISIT(traverse_module_state->__pyx_n_s_MemoryError); Py_VISIT(traverse_module_state->__pyx_n_s_NotImplementedError); Py_VISIT(traverse_module_state->__pyx_n_s_OverflowError); Py_VISIT(traverse_module_state->__pyx_kp_s_Q); Py_VISIT(traverse_module_state->__pyx_n_s_Struct); Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); Py_VISIT(traverse_module_state->__pyx_n_s_UNENCRYPTED); Py_VISIT(traverse_module_state->__pyx_n_s_UNENCRYPTED___init); Py_VISIT(traverse_module_state->__pyx_n_s_UNENCRYPTED_block_count); Py_VISIT(traverse_module_state->__pyx_n_s_UNENCRYPTED_decrypt); Py_VISIT(traverse_module_state->__pyx_n_s_UNENCRYPTED_encrypt); Py_VISIT(traverse_module_state->__pyx_n_s_UNENCRYPTED_extract_iv); Py_VISIT(traverse_module_state->__pyx_n_s_UNENCRYPTED_next_iv); Py_VISIT(traverse_module_state->__pyx_n_s_UNENCRYPTED_set_iv); Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); Py_VISIT(traverse_module_state->__pyx_n_s__11); Py_VISIT(traverse_module_state->__pyx_kp_u__12); Py_VISIT(traverse_module_state->__pyx_kp_b__2); Py_VISIT(traverse_module_state->__pyx_n_s__69); Py_VISIT(traverse_module_state->__pyx_n_s_aad_offset); Py_VISIT(traverse_module_state->__pyx_n_s_alen); Py_VISIT(traverse_module_state->__pyx_n_s_aoffset); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_big); Py_VISIT(traverse_module_state->__pyx_n_s_blake2b); Py_VISIT(traverse_module_state->__pyx_n_s_blake2b_128); Py_VISIT(traverse_module_state->__pyx_n_s_blake2b_256); Py_VISIT(traverse_module_state->__pyx_n_s_block_count); Py_VISIT(traverse_module_state->__pyx_n_s_blocksize); Py_VISIT(traverse_module_state->__pyx_n_s_borg_crypto_low_level); Py_VISIT(traverse_module_state->__pyx_n_s_byteorder); Py_VISIT(traverse_module_state->__pyx_n_s_bytes_to_int); Py_VISIT(traverse_module_state->__pyx_n_s_bytes_to_long); Py_VISIT(traverse_module_state->__pyx_n_s_ceil); Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_cls); Py_VISIT(traverse_module_state->__pyx_n_s_data); Py_VISIT(traverse_module_state->__pyx_n_s_decrypt); Py_VISIT(traverse_module_state->__pyx_n_s_dict); Py_VISIT(traverse_module_state->__pyx_n_s_digest); Py_VISIT(traverse_module_state->__pyx_n_s_digest_length); Py_VISIT(traverse_module_state->__pyx_n_s_digest_size); Py_VISIT(traverse_module_state->__pyx_kp_u_disable); Py_VISIT(traverse_module_state->__pyx_n_s_doc); Py_VISIT(traverse_module_state->__pyx_kp_u_enable); Py_VISIT(traverse_module_state->__pyx_n_s_enc_key); Py_VISIT(traverse_module_state->__pyx_n_s_encrypt); Py_VISIT(traverse_module_state->__pyx_n_s_enumerate); Py_VISIT(traverse_module_state->__pyx_n_s_envelope); Py_VISIT(traverse_module_state->__pyx_n_s_extract_iv); Py_VISIT(traverse_module_state->__pyx_n_s_from_bytes); Py_VISIT(traverse_module_state->__pyx_kp_u_gc); Py_VISIT(traverse_module_state->__pyx_n_s_getstate); Py_VISIT(traverse_module_state->__pyx_n_s_hashlib); Py_VISIT(traverse_module_state->__pyx_n_s_hdata); Py_VISIT(traverse_module_state->__pyx_n_s_header); Py_VISIT(traverse_module_state->__pyx_n_s_header_len); Py_VISIT(traverse_module_state->__pyx_n_s_hkdf_hmac_sha512); Py_VISIT(traverse_module_state->__pyx_n_s_hlen); Py_VISIT(traverse_module_state->__pyx_n_s_hmac); Py_VISIT(traverse_module_state->__pyx_n_s_hmac_sha256); Py_VISIT(traverse_module_state->__pyx_n_s_i); Py_VISIT(traverse_module_state->__pyx_n_s_idata); Py_VISIT(traverse_module_state->__pyx_n_s_ikm); Py_VISIT(traverse_module_state->__pyx_n_s_ilen); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_info); Py_VISIT(traverse_module_state->__pyx_n_s_init); Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_int); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); Py_VISIT(traverse_module_state->__pyx_n_s_iv); Py_VISIT(traverse_module_state->__pyx_kp_s_iv_needs_to_be_set_before_encryp); Py_VISIT(traverse_module_state->__pyx_n_s_key); Py_VISIT(traverse_module_state->__pyx_n_s_lambda); Py_VISIT(traverse_module_state->__pyx_n_s_length); Py_VISIT(traverse_module_state->__pyx_n_s_little); Py_VISIT(traverse_module_state->__pyx_n_s_long); Py_VISIT(traverse_module_state->__pyx_n_s_long_to_bytes); Py_VISIT(traverse_module_state->__pyx_n_s_mac_buf); Py_VISIT(traverse_module_state->__pyx_n_s_mac_key); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_math); Py_VISIT(traverse_module_state->__pyx_n_s_metaclass); Py_VISIT(traverse_module_state->__pyx_n_s_module); Py_VISIT(traverse_module_state->__pyx_n_s_mro_entries); Py_VISIT(traverse_module_state->__pyx_n_s_msg); Py_VISIT(traverse_module_state->__pyx_n_s_n); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_next_iv); Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_VISIT(traverse_module_state->__pyx_n_s_num_cipher_blocks); Py_VISIT(traverse_module_state->__pyx_n_s_odata); Py_VISIT(traverse_module_state->__pyx_n_s_offset); Py_VISIT(traverse_module_state->__pyx_n_s_olen); Py_VISIT(traverse_module_state->__pyx_n_s_output); Py_VISIT(traverse_module_state->__pyx_n_s_output_length); Py_VISIT(traverse_module_state->__pyx_kp_s_output_length_must_be_255_64_byt); Py_VISIT(traverse_module_state->__pyx_n_s_pack); Py_VISIT(traverse_module_state->__pyx_n_s_prepare); Py_VISIT(traverse_module_state->__pyx_n_s_prk); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable); Py_VISIT(traverse_module_state->__pyx_n_s_qualname); Py_VISIT(traverse_module_state->__pyx_n_s_range); Py_VISIT(traverse_module_state->__pyx_n_s_rc); Py_VISIT(traverse_module_state->__pyx_n_s_reduce); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex); Py_VISIT(traverse_module_state->__pyx_n_s_requirements_check); Py_VISIT(traverse_module_state->__pyx_n_s_salt); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_n_s_set_iv); Py_VISIT(traverse_module_state->__pyx_n_s_set_name); Py_VISIT(traverse_module_state->__pyx_n_s_setstate); Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_sha256); Py_VISIT(traverse_module_state->__pyx_n_s_sha512); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_kp_s_src_borg_crypto_low_level_pyx); Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource); Py_VISIT(traverse_module_state->__pyx_n_s_struct); Py_VISIT(traverse_module_state->__pyx_n_s_super); Py_VISIT(traverse_module_state->__pyx_n_s_t_n); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_to_bytes); Py_VISIT(traverse_module_state->__pyx_n_s_unpack_from); Py_VISIT(traverse_module_state->__pyx_n_s_x); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_int_1); Py_VISIT(traverse_module_state->__pyx_int_16); Py_VISIT(traverse_module_state->__pyx_int_32); Py_VISIT(traverse_module_state->__pyx_int_64); Py_VISIT(traverse_module_state->__pyx_int_255); Py_VISIT(traverse_module_state->__pyx_tuple__3); Py_VISIT(traverse_module_state->__pyx_tuple__4); Py_VISIT(traverse_module_state->__pyx_tuple__5); Py_VISIT(traverse_module_state->__pyx_tuple__6); Py_VISIT(traverse_module_state->__pyx_tuple__7); Py_VISIT(traverse_module_state->__pyx_tuple__8); Py_VISIT(traverse_module_state->__pyx_tuple__9); Py_VISIT(traverse_module_state->__pyx_tuple__10); Py_VISIT(traverse_module_state->__pyx_tuple__13); Py_VISIT(traverse_module_state->__pyx_tuple__14); Py_VISIT(traverse_module_state->__pyx_tuple__15); Py_VISIT(traverse_module_state->__pyx_tuple__16); Py_VISIT(traverse_module_state->__pyx_tuple__18); Py_VISIT(traverse_module_state->__pyx_tuple__19); Py_VISIT(traverse_module_state->__pyx_tuple__21); Py_VISIT(traverse_module_state->__pyx_tuple__22); Py_VISIT(traverse_module_state->__pyx_tuple__24); Py_VISIT(traverse_module_state->__pyx_tuple__25); Py_VISIT(traverse_module_state->__pyx_tuple__27); Py_VISIT(traverse_module_state->__pyx_tuple__29); Py_VISIT(traverse_module_state->__pyx_tuple__31); Py_VISIT(traverse_module_state->__pyx_tuple__34); Py_VISIT(traverse_module_state->__pyx_tuple__36); Py_VISIT(traverse_module_state->__pyx_tuple__38); Py_VISIT(traverse_module_state->__pyx_tuple__43); Py_VISIT(traverse_module_state->__pyx_tuple__46); Py_VISIT(traverse_module_state->__pyx_tuple__52); Py_VISIT(traverse_module_state->__pyx_tuple__54); Py_VISIT(traverse_module_state->__pyx_tuple__55); Py_VISIT(traverse_module_state->__pyx_tuple__62); Py_VISIT(traverse_module_state->__pyx_tuple__65); Py_VISIT(traverse_module_state->__pyx_tuple__67); Py_VISIT(traverse_module_state->__pyx_codeobj__17); Py_VISIT(traverse_module_state->__pyx_codeobj__20); Py_VISIT(traverse_module_state->__pyx_codeobj__23); Py_VISIT(traverse_module_state->__pyx_codeobj__26); Py_VISIT(traverse_module_state->__pyx_codeobj__28); Py_VISIT(traverse_module_state->__pyx_codeobj__30); Py_VISIT(traverse_module_state->__pyx_codeobj__32); Py_VISIT(traverse_module_state->__pyx_codeobj__33); Py_VISIT(traverse_module_state->__pyx_codeobj__35); Py_VISIT(traverse_module_state->__pyx_codeobj__37); Py_VISIT(traverse_module_state->__pyx_codeobj__39); Py_VISIT(traverse_module_state->__pyx_codeobj__40); Py_VISIT(traverse_module_state->__pyx_codeobj__41); Py_VISIT(traverse_module_state->__pyx_codeobj__42); Py_VISIT(traverse_module_state->__pyx_codeobj__44); Py_VISIT(traverse_module_state->__pyx_codeobj__45); Py_VISIT(traverse_module_state->__pyx_codeobj__47); Py_VISIT(traverse_module_state->__pyx_codeobj__48); Py_VISIT(traverse_module_state->__pyx_codeobj__49); Py_VISIT(traverse_module_state->__pyx_codeobj__50); Py_VISIT(traverse_module_state->__pyx_codeobj__51); Py_VISIT(traverse_module_state->__pyx_codeobj__53); Py_VISIT(traverse_module_state->__pyx_codeobj__56); Py_VISIT(traverse_module_state->__pyx_codeobj__57); Py_VISIT(traverse_module_state->__pyx_codeobj__58); Py_VISIT(traverse_module_state->__pyx_codeobj__59); Py_VISIT(traverse_module_state->__pyx_codeobj__60); Py_VISIT(traverse_module_state->__pyx_codeobj__61); Py_VISIT(traverse_module_state->__pyx_codeobj__63); Py_VISIT(traverse_module_state->__pyx_codeobj__64); Py_VISIT(traverse_module_state->__pyx_codeobj__66); Py_VISIT(traverse_module_state->__pyx_codeobj__68); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_7cpython_4bool_bool __pyx_mstate_global->__pyx_ptype_7cpython_4bool_bool #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_7cpython_7complex_complex __pyx_mstate_global->__pyx_ptype_7cpython_7complex_complex #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #define __pyx_type_4borg_6crypto_9low_level_AES256_CTR_BASE __pyx_mstate_global->__pyx_type_4borg_6crypto_9low_level_AES256_CTR_BASE #define __pyx_type_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256 __pyx_mstate_global->__pyx_type_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256 #define __pyx_type_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b __pyx_mstate_global->__pyx_type_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b #define __pyx_type_4borg_6crypto_9low_level_AES __pyx_mstate_global->__pyx_type_4borg_6crypto_9low_level_AES #endif #define __pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BASE __pyx_mstate_global->__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BASE #define __pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256 __pyx_mstate_global->__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256 #define __pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b __pyx_mstate_global->__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b #define __pyx_ptype_4borg_6crypto_9low_level_AES __pyx_mstate_global->__pyx_ptype_4borg_6crypto_9low_level_AES #define __pyx_kp_b_ __pyx_mstate_global->__pyx_kp_b_ #define __pyx_kp_s_1_4_01 __pyx_mstate_global->__pyx_kp_s_1_4_01 #define __pyx_n_s_AES __pyx_mstate_global->__pyx_n_s_AES #define __pyx_n_s_AES256_CTR_BASE __pyx_mstate_global->__pyx_n_s_AES256_CTR_BASE #define __pyx_n_s_AES256_CTR_BASE___reduce_cython __pyx_mstate_global->__pyx_n_s_AES256_CTR_BASE___reduce_cython #define __pyx_n_s_AES256_CTR_BASE___setstate_cytho __pyx_mstate_global->__pyx_n_s_AES256_CTR_BASE___setstate_cytho #define __pyx_n_s_AES256_CTR_BASE_block_count __pyx_mstate_global->__pyx_n_s_AES256_CTR_BASE_block_count #define __pyx_n_s_AES256_CTR_BASE_decrypt __pyx_mstate_global->__pyx_n_s_AES256_CTR_BASE_decrypt #define __pyx_n_s_AES256_CTR_BASE_encrypt __pyx_mstate_global->__pyx_n_s_AES256_CTR_BASE_encrypt #define __pyx_n_s_AES256_CTR_BASE_extract_iv __pyx_mstate_global->__pyx_n_s_AES256_CTR_BASE_extract_iv #define __pyx_n_s_AES256_CTR_BASE_next_iv __pyx_mstate_global->__pyx_n_s_AES256_CTR_BASE_next_iv #define __pyx_n_s_AES256_CTR_BASE_requirements_che __pyx_mstate_global->__pyx_n_s_AES256_CTR_BASE_requirements_che #define __pyx_n_s_AES256_CTR_BASE_set_iv __pyx_mstate_global->__pyx_n_s_AES256_CTR_BASE_set_iv #define __pyx_n_s_AES256_CTR_BLAKE2b __pyx_mstate_global->__pyx_n_s_AES256_CTR_BLAKE2b #define __pyx_n_s_AES256_CTR_BLAKE2b___reduce_cyth __pyx_mstate_global->__pyx_n_s_AES256_CTR_BLAKE2b___reduce_cyth #define __pyx_n_s_AES256_CTR_BLAKE2b___setstate_cy __pyx_mstate_global->__pyx_n_s_AES256_CTR_BLAKE2b___setstate_cy #define __pyx_n_s_AES256_CTR_HMAC_SHA256 __pyx_mstate_global->__pyx_n_s_AES256_CTR_HMAC_SHA256 #define __pyx_n_s_AES256_CTR_HMAC_SHA256___reduce __pyx_mstate_global->__pyx_n_s_AES256_CTR_HMAC_SHA256___reduce #define __pyx_n_s_AES256_CTR_HMAC_SHA256___setstat __pyx_mstate_global->__pyx_n_s_AES256_CTR_HMAC_SHA256___setstat #define __pyx_kp_s_AES_CTR_requires_OpenSSL_1_0_0_D __pyx_mstate_global->__pyx_kp_s_AES_CTR_requires_OpenSSL_1_0_0_D #define __pyx_n_s_AES___reduce_cython __pyx_mstate_global->__pyx_n_s_AES___reduce_cython #define __pyx_n_s_AES___setstate_cython __pyx_mstate_global->__pyx_n_s_AES___setstate_cython #define __pyx_n_s_AES_block_count __pyx_mstate_global->__pyx_n_s_AES_block_count #define __pyx_n_s_AES_decrypt __pyx_mstate_global->__pyx_n_s_AES_decrypt #define __pyx_n_s_AES_encrypt __pyx_mstate_global->__pyx_n_s_AES_encrypt #define __pyx_n_s_AES_next_iv __pyx_mstate_global->__pyx_n_s_AES_next_iv #define __pyx_n_s_AES_set_iv __pyx_mstate_global->__pyx_n_s_AES_set_iv #define __pyx_n_s_API_VERSION __pyx_mstate_global->__pyx_n_s_API_VERSION #define __pyx_n_s_AssertionError __pyx_mstate_global->__pyx_n_s_AssertionError #define __pyx_n_s_CryptoError __pyx_mstate_global->__pyx_n_s_CryptoError #define __pyx_kp_s_EVP_DecryptFinal_ex_failed __pyx_mstate_global->__pyx_kp_s_EVP_DecryptFinal_ex_failed #define __pyx_kp_s_EVP_DecryptFinal_failed __pyx_mstate_global->__pyx_kp_s_EVP_DecryptFinal_failed #define __pyx_kp_s_EVP_DecryptInit_ex_failed __pyx_mstate_global->__pyx_kp_s_EVP_DecryptInit_ex_failed #define __pyx_kp_s_EVP_DecryptUpdate_failed __pyx_mstate_global->__pyx_kp_s_EVP_DecryptUpdate_failed #define __pyx_kp_s_EVP_EncryptFinal_ex_failed __pyx_mstate_global->__pyx_kp_s_EVP_EncryptFinal_ex_failed #define __pyx_kp_s_EVP_EncryptFinal_failed __pyx_mstate_global->__pyx_kp_s_EVP_EncryptFinal_failed #define __pyx_kp_s_EVP_EncryptInit_ex_failed __pyx_mstate_global->__pyx_kp_s_EVP_EncryptInit_ex_failed #define __pyx_kp_s_EVP_EncryptUpdate_failed __pyx_mstate_global->__pyx_kp_s_EVP_EncryptUpdate_failed #define __pyx_n_s_HMAC __pyx_mstate_global->__pyx_n_s_HMAC #define __pyx_kp_s_I __pyx_mstate_global->__pyx_kp_s_I #define __pyx_n_s_IndexError __pyx_mstate_global->__pyx_n_s_IndexError #define __pyx_n_s_IntegrityError __pyx_mstate_global->__pyx_n_s_IntegrityError #define __pyx_kp_s_Integrity_checks_failed_Corrupte __pyx_mstate_global->__pyx_kp_s_Integrity_checks_failed_Corrupte #define __pyx_kp_s_MAC_Authentication_failed __pyx_mstate_global->__pyx_kp_s_MAC_Authentication_failed #define __pyx_kp_s_Malfunction_in_the_crypto_module __pyx_mstate_global->__pyx_kp_s_Malfunction_in_the_crypto_module #define __pyx_n_s_MemoryError __pyx_mstate_global->__pyx_n_s_MemoryError #define __pyx_n_s_NotImplementedError __pyx_mstate_global->__pyx_n_s_NotImplementedError #define __pyx_n_s_OverflowError __pyx_mstate_global->__pyx_n_s_OverflowError #define __pyx_kp_s_Q __pyx_mstate_global->__pyx_kp_s_Q #define __pyx_n_s_Struct __pyx_mstate_global->__pyx_n_s_Struct #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError #define __pyx_n_s_UNENCRYPTED __pyx_mstate_global->__pyx_n_s_UNENCRYPTED #define __pyx_n_s_UNENCRYPTED___init __pyx_mstate_global->__pyx_n_s_UNENCRYPTED___init #define __pyx_n_s_UNENCRYPTED_block_count __pyx_mstate_global->__pyx_n_s_UNENCRYPTED_block_count #define __pyx_n_s_UNENCRYPTED_decrypt __pyx_mstate_global->__pyx_n_s_UNENCRYPTED_decrypt #define __pyx_n_s_UNENCRYPTED_encrypt __pyx_mstate_global->__pyx_n_s_UNENCRYPTED_encrypt #define __pyx_n_s_UNENCRYPTED_extract_iv __pyx_mstate_global->__pyx_n_s_UNENCRYPTED_extract_iv #define __pyx_n_s_UNENCRYPTED_next_iv __pyx_mstate_global->__pyx_n_s_UNENCRYPTED_next_iv #define __pyx_n_s_UNENCRYPTED_set_iv __pyx_mstate_global->__pyx_n_s_UNENCRYPTED_set_iv #define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError #define __pyx_n_s__11 __pyx_mstate_global->__pyx_n_s__11 #define __pyx_kp_u__12 __pyx_mstate_global->__pyx_kp_u__12 #define __pyx_kp_b__2 __pyx_mstate_global->__pyx_kp_b__2 #define __pyx_n_s__69 __pyx_mstate_global->__pyx_n_s__69 #define __pyx_n_s_aad_offset __pyx_mstate_global->__pyx_n_s_aad_offset #define __pyx_n_s_alen __pyx_mstate_global->__pyx_n_s_alen #define __pyx_n_s_aoffset __pyx_mstate_global->__pyx_n_s_aoffset #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_big __pyx_mstate_global->__pyx_n_s_big #define __pyx_n_s_blake2b __pyx_mstate_global->__pyx_n_s_blake2b #define __pyx_n_s_blake2b_128 __pyx_mstate_global->__pyx_n_s_blake2b_128 #define __pyx_n_s_blake2b_256 __pyx_mstate_global->__pyx_n_s_blake2b_256 #define __pyx_n_s_block_count __pyx_mstate_global->__pyx_n_s_block_count #define __pyx_n_s_blocksize __pyx_mstate_global->__pyx_n_s_blocksize #define __pyx_n_s_borg_crypto_low_level __pyx_mstate_global->__pyx_n_s_borg_crypto_low_level #define __pyx_n_s_byteorder __pyx_mstate_global->__pyx_n_s_byteorder #define __pyx_n_s_bytes_to_int __pyx_mstate_global->__pyx_n_s_bytes_to_int #define __pyx_n_s_bytes_to_long __pyx_mstate_global->__pyx_n_s_bytes_to_long #define __pyx_n_s_ceil __pyx_mstate_global->__pyx_n_s_ceil #define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_cls __pyx_mstate_global->__pyx_n_s_cls #define __pyx_n_s_data __pyx_mstate_global->__pyx_n_s_data #define __pyx_n_s_decrypt __pyx_mstate_global->__pyx_n_s_decrypt #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict #define __pyx_n_s_digest __pyx_mstate_global->__pyx_n_s_digest #define __pyx_n_s_digest_length __pyx_mstate_global->__pyx_n_s_digest_length #define __pyx_n_s_digest_size __pyx_mstate_global->__pyx_n_s_digest_size #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable #define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable #define __pyx_n_s_enc_key __pyx_mstate_global->__pyx_n_s_enc_key #define __pyx_n_s_encrypt __pyx_mstate_global->__pyx_n_s_encrypt #define __pyx_n_s_enumerate __pyx_mstate_global->__pyx_n_s_enumerate #define __pyx_n_s_envelope __pyx_mstate_global->__pyx_n_s_envelope #define __pyx_n_s_extract_iv __pyx_mstate_global->__pyx_n_s_extract_iv #define __pyx_n_s_from_bytes __pyx_mstate_global->__pyx_n_s_from_bytes #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate #define __pyx_n_s_hashlib __pyx_mstate_global->__pyx_n_s_hashlib #define __pyx_n_s_hdata __pyx_mstate_global->__pyx_n_s_hdata #define __pyx_n_s_header __pyx_mstate_global->__pyx_n_s_header #define __pyx_n_s_header_len __pyx_mstate_global->__pyx_n_s_header_len #define __pyx_n_s_hkdf_hmac_sha512 __pyx_mstate_global->__pyx_n_s_hkdf_hmac_sha512 #define __pyx_n_s_hlen __pyx_mstate_global->__pyx_n_s_hlen #define __pyx_n_s_hmac __pyx_mstate_global->__pyx_n_s_hmac #define __pyx_n_s_hmac_sha256 __pyx_mstate_global->__pyx_n_s_hmac_sha256 #define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i #define __pyx_n_s_idata __pyx_mstate_global->__pyx_n_s_idata #define __pyx_n_s_ikm __pyx_mstate_global->__pyx_n_s_ikm #define __pyx_n_s_ilen __pyx_mstate_global->__pyx_n_s_ilen #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_info __pyx_mstate_global->__pyx_n_s_info #define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init #define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_int __pyx_mstate_global->__pyx_n_s_int #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled #define __pyx_n_s_iv __pyx_mstate_global->__pyx_n_s_iv #define __pyx_kp_s_iv_needs_to_be_set_before_encryp __pyx_mstate_global->__pyx_kp_s_iv_needs_to_be_set_before_encryp #define __pyx_n_s_key __pyx_mstate_global->__pyx_n_s_key #define __pyx_n_s_lambda __pyx_mstate_global->__pyx_n_s_lambda #define __pyx_n_s_length __pyx_mstate_global->__pyx_n_s_length #define __pyx_n_s_little __pyx_mstate_global->__pyx_n_s_little #define __pyx_n_s_long __pyx_mstate_global->__pyx_n_s_long #define __pyx_n_s_long_to_bytes __pyx_mstate_global->__pyx_n_s_long_to_bytes #define __pyx_n_s_mac_buf __pyx_mstate_global->__pyx_n_s_mac_buf #define __pyx_n_s_mac_key __pyx_mstate_global->__pyx_n_s_mac_key #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_math __pyx_mstate_global->__pyx_n_s_math #define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass #define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module #define __pyx_n_s_mro_entries __pyx_mstate_global->__pyx_n_s_mro_entries #define __pyx_n_s_msg __pyx_mstate_global->__pyx_n_s_msg #define __pyx_n_s_n __pyx_mstate_global->__pyx_n_s_n #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_next_iv __pyx_mstate_global->__pyx_n_s_next_iv #define __pyx_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non #define __pyx_n_s_num_cipher_blocks __pyx_mstate_global->__pyx_n_s_num_cipher_blocks #define __pyx_n_s_odata __pyx_mstate_global->__pyx_n_s_odata #define __pyx_n_s_offset __pyx_mstate_global->__pyx_n_s_offset #define __pyx_n_s_olen __pyx_mstate_global->__pyx_n_s_olen #define __pyx_n_s_output __pyx_mstate_global->__pyx_n_s_output #define __pyx_n_s_output_length __pyx_mstate_global->__pyx_n_s_output_length #define __pyx_kp_s_output_length_must_be_255_64_byt __pyx_mstate_global->__pyx_kp_s_output_length_must_be_255_64_byt #define __pyx_n_s_pack __pyx_mstate_global->__pyx_n_s_pack #define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare #define __pyx_n_s_prk __pyx_mstate_global->__pyx_n_s_prk #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable #define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname #define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range #define __pyx_n_s_rc __pyx_mstate_global->__pyx_n_s_rc #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex #define __pyx_n_s_requirements_check __pyx_mstate_global->__pyx_n_s_requirements_check #define __pyx_n_s_salt __pyx_mstate_global->__pyx_n_s_salt #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_n_s_set_iv __pyx_mstate_global->__pyx_n_s_set_iv #define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython #define __pyx_n_s_sha256 __pyx_mstate_global->__pyx_n_s_sha256 #define __pyx_n_s_sha512 __pyx_mstate_global->__pyx_n_s_sha512 #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_kp_s_src_borg_crypto_low_level_pyx __pyx_mstate_global->__pyx_kp_s_src_borg_crypto_low_level_pyx #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource #define __pyx_n_s_struct __pyx_mstate_global->__pyx_n_s_struct #define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super #define __pyx_n_s_t_n __pyx_mstate_global->__pyx_n_s_t_n #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_to_bytes __pyx_mstate_global->__pyx_n_s_to_bytes #define __pyx_n_s_unpack_from __pyx_mstate_global->__pyx_n_s_unpack_from #define __pyx_n_s_x __pyx_mstate_global->__pyx_n_s_x #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 #define __pyx_int_16 __pyx_mstate_global->__pyx_int_16 #define __pyx_int_32 __pyx_mstate_global->__pyx_int_32 #define __pyx_int_64 __pyx_mstate_global->__pyx_int_64 #define __pyx_int_255 __pyx_mstate_global->__pyx_int_255 #define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 #define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 #define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5 #define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6 #define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 #define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 #define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9 #define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10 #define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13 #define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 #define __pyx_tuple__15 __pyx_mstate_global->__pyx_tuple__15 #define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16 #define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18 #define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19 #define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21 #define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22 #define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24 #define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25 #define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27 #define __pyx_tuple__29 __pyx_mstate_global->__pyx_tuple__29 #define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31 #define __pyx_tuple__34 __pyx_mstate_global->__pyx_tuple__34 #define __pyx_tuple__36 __pyx_mstate_global->__pyx_tuple__36 #define __pyx_tuple__38 __pyx_mstate_global->__pyx_tuple__38 #define __pyx_tuple__43 __pyx_mstate_global->__pyx_tuple__43 #define __pyx_tuple__46 __pyx_mstate_global->__pyx_tuple__46 #define __pyx_tuple__52 __pyx_mstate_global->__pyx_tuple__52 #define __pyx_tuple__54 __pyx_mstate_global->__pyx_tuple__54 #define __pyx_tuple__55 __pyx_mstate_global->__pyx_tuple__55 #define __pyx_tuple__62 __pyx_mstate_global->__pyx_tuple__62 #define __pyx_tuple__65 __pyx_mstate_global->__pyx_tuple__65 #define __pyx_tuple__67 __pyx_mstate_global->__pyx_tuple__67 #define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 #define __pyx_codeobj__20 __pyx_mstate_global->__pyx_codeobj__20 #define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23 #define __pyx_codeobj__26 __pyx_mstate_global->__pyx_codeobj__26 #define __pyx_codeobj__28 __pyx_mstate_global->__pyx_codeobj__28 #define __pyx_codeobj__30 __pyx_mstate_global->__pyx_codeobj__30 #define __pyx_codeobj__32 __pyx_mstate_global->__pyx_codeobj__32 #define __pyx_codeobj__33 __pyx_mstate_global->__pyx_codeobj__33 #define __pyx_codeobj__35 __pyx_mstate_global->__pyx_codeobj__35 #define __pyx_codeobj__37 __pyx_mstate_global->__pyx_codeobj__37 #define __pyx_codeobj__39 __pyx_mstate_global->__pyx_codeobj__39 #define __pyx_codeobj__40 __pyx_mstate_global->__pyx_codeobj__40 #define __pyx_codeobj__41 __pyx_mstate_global->__pyx_codeobj__41 #define __pyx_codeobj__42 __pyx_mstate_global->__pyx_codeobj__42 #define __pyx_codeobj__44 __pyx_mstate_global->__pyx_codeobj__44 #define __pyx_codeobj__45 __pyx_mstate_global->__pyx_codeobj__45 #define __pyx_codeobj__47 __pyx_mstate_global->__pyx_codeobj__47 #define __pyx_codeobj__48 __pyx_mstate_global->__pyx_codeobj__48 #define __pyx_codeobj__49 __pyx_mstate_global->__pyx_codeobj__49 #define __pyx_codeobj__50 __pyx_mstate_global->__pyx_codeobj__50 #define __pyx_codeobj__51 __pyx_mstate_global->__pyx_codeobj__51 #define __pyx_codeobj__53 __pyx_mstate_global->__pyx_codeobj__53 #define __pyx_codeobj__56 __pyx_mstate_global->__pyx_codeobj__56 #define __pyx_codeobj__57 __pyx_mstate_global->__pyx_codeobj__57 #define __pyx_codeobj__58 __pyx_mstate_global->__pyx_codeobj__58 #define __pyx_codeobj__59 __pyx_mstate_global->__pyx_codeobj__59 #define __pyx_codeobj__60 __pyx_mstate_global->__pyx_codeobj__60 #define __pyx_codeobj__61 __pyx_mstate_global->__pyx_codeobj__61 #define __pyx_codeobj__63 __pyx_mstate_global->__pyx_codeobj__63 #define __pyx_codeobj__64 __pyx_mstate_global->__pyx_codeobj__64 #define __pyx_codeobj__66 __pyx_mstate_global->__pyx_codeobj__66 #define __pyx_codeobj__68 __pyx_mstate_global->__pyx_codeobj__68 /* #### Code section: module_code ### */ /* "borg/crypto/low_level.pyx":93 * _long = struct.Struct('>Q') * * bytes_to_int = lambda x, offset=0: _int.unpack_from(x, offset)[0] # <<<<<<<<<<<<<< * bytes_to_long = lambda x, offset=0: _long.unpack_from(x, offset)[0] * long_to_bytes = lambda x: _long.pack(x) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_6crypto_9low_level_10lambda(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_6crypto_9low_level_10lambda = {"lambda", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_10lambda, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_6crypto_9low_level_10lambda(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_x = 0; PyObject *__pyx_v_offset = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_offset,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_0))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 93, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_offset); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 93, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda") < 0)) __PYX_ERR(0, 93, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_x = values[0]; __pyx_v_offset = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("lambda", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 93, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.crypto.low_level.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_lambda_funcdef_4borg_6crypto_9low_level_lambda(__pyx_self, __pyx_v_x, __pyx_v_offset); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_lambda_funcdef_4borg_6crypto_9low_level_lambda(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_offset) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda", 1); __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_int); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_unpack_from); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_x, __pyx_v_offset}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("borg.crypto.low_level.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/crypto/low_level.pyx":94 * * bytes_to_int = lambda x, offset=0: _int.unpack_from(x, offset)[0] * bytes_to_long = lambda x, offset=0: _long.unpack_from(x, offset)[0] # <<<<<<<<<<<<<< * long_to_bytes = lambda x: _long.pack(x) * */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_6crypto_9low_level_11lambda1(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_6crypto_9low_level_11lambda1 = {"lambda1", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_11lambda1, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_6crypto_9low_level_11lambda1(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_x = 0; PyObject *__pyx_v_offset = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda1 (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_offset,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_0))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_offset); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda1") < 0)) __PYX_ERR(0, 94, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_x = values[0]; __pyx_v_offset = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("lambda1", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 94, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.crypto.low_level.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_lambda_funcdef_4borg_6crypto_9low_level_lambda1(__pyx_self, __pyx_v_x, __pyx_v_offset); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_lambda_funcdef_4borg_6crypto_9low_level_lambda1(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_offset) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda1", 1); __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_long); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_unpack_from); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_x, __pyx_v_offset}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("borg.crypto.low_level.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/crypto/low_level.pyx":95 * bytes_to_int = lambda x, offset=0: _int.unpack_from(x, offset)[0] * bytes_to_long = lambda x, offset=0: _long.unpack_from(x, offset)[0] * long_to_bytes = lambda x: _long.pack(x) # <<<<<<<<<<<<<< * * */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_6crypto_9low_level_12lambda2(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_6crypto_9low_level_12lambda2 = {"lambda2", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_12lambda2, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_6crypto_9low_level_12lambda2(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_x = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda2 (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 95, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda2") < 0)) __PYX_ERR(0, 95, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_x = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("lambda2", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 95, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.crypto.low_level.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_lambda_funcdef_4borg_6crypto_9low_level_lambda2(__pyx_self, __pyx_v_x); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_lambda_funcdef_4borg_6crypto_9low_level_lambda2(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda2", 1); __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_long); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pack); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_x}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("borg.crypto.low_level.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "carray.from_py":79 * * @cname("__Pyx_carray_from_py_unsigned_char") * cdef int __Pyx_carray_from_py_unsigned_char(object o, base_type *v, Py_ssize_t length) except -1: # <<<<<<<<<<<<<< * cdef Py_ssize_t i = length * try: */ static int __Pyx_carray_from_py_unsigned_char(PyObject *__pyx_v_o, unsigned char *__pyx_v_v, Py_ssize_t __pyx_v_length) { Py_ssize_t __pyx_v_i; PyObject *__pyx_v_item = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; int __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; Py_ssize_t __pyx_t_8; PyObject *(*__pyx_t_9)(PyObject *); PyObject *__pyx_t_10 = NULL; unsigned char __pyx_t_11; char const *__pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_carray_from_py_unsigned_char", 1); /* "carray.from_py":80 * @cname("__Pyx_carray_from_py_unsigned_char") * cdef int __Pyx_carray_from_py_unsigned_char(object o, base_type *v, Py_ssize_t length) except -1: * cdef Py_ssize_t i = length # <<<<<<<<<<<<<< * try: * i = len(o) */ __pyx_v_i = __pyx_v_length; /* "carray.from_py":81 * cdef int __Pyx_carray_from_py_unsigned_char(object o, base_type *v, Py_ssize_t length) except -1: * cdef Py_ssize_t i = length * try: # <<<<<<<<<<<<<< * i = len(o) * except (TypeError, OverflowError): */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "carray.from_py":82 * cdef Py_ssize_t i = length * try: * i = len(o) # <<<<<<<<<<<<<< * except (TypeError, OverflowError): * pass */ __pyx_t_4 = PyObject_Length(__pyx_v_o); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 82, __pyx_L3_error) __pyx_v_i = __pyx_t_4; /* "carray.from_py":81 * cdef int __Pyx_carray_from_py_unsigned_char(object o, base_type *v, Py_ssize_t length) except -1: * cdef Py_ssize_t i = length * try: # <<<<<<<<<<<<<< * i = len(o) * except (TypeError, OverflowError): */ } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; /* "carray.from_py":83 * try: * i = len(o) * except (TypeError, OverflowError): # <<<<<<<<<<<<<< * pass * if i == length: */ __pyx_t_5 = __Pyx_PyErr_ExceptionMatches2(__pyx_builtin_TypeError, __pyx_builtin_OverflowError); if (__pyx_t_5) { __Pyx_ErrRestore(0,0,0); goto __pyx_L4_exception_handled; } goto __pyx_L5_except_error; /* "carray.from_py":81 * cdef int __Pyx_carray_from_py_unsigned_char(object o, base_type *v, Py_ssize_t length) except -1: * cdef Py_ssize_t i = length * try: # <<<<<<<<<<<<<< * i = len(o) * except (TypeError, OverflowError): */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L4_exception_handled:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); __pyx_L8_try_end:; } /* "carray.from_py":85 * except (TypeError, OverflowError): * pass * if i == length: # <<<<<<<<<<<<<< * for i, item in enumerate(o): * if i >= length: */ __pyx_t_6 = (__pyx_v_i == __pyx_v_length); if (__pyx_t_6) { /* "carray.from_py":86 * pass * if i == length: * for i, item in enumerate(o): # <<<<<<<<<<<<<< * if i >= length: * break */ __pyx_t_4 = 0; if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) { __pyx_t_7 = __pyx_v_o; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 86, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_9)) { if (likely(PyList_CheckExact(__pyx_t_7))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 86, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_10 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(1, 86, __pyx_L1_error) #else __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 86, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(1, 86, __pyx_L1_error) #else __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); #endif } } else { __pyx_t_10 = __pyx_t_9(__pyx_t_7); if (unlikely(!__pyx_t_10)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(1, 86, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_10); } __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_10); __pyx_t_10 = 0; __pyx_v_i = __pyx_t_4; __pyx_t_4 = (__pyx_t_4 + 1); /* "carray.from_py":87 * if i == length: * for i, item in enumerate(o): * if i >= length: # <<<<<<<<<<<<<< * break * v[i] = item */ __pyx_t_6 = (__pyx_v_i >= __pyx_v_length); if (__pyx_t_6) { /* "carray.from_py":88 * for i, item in enumerate(o): * if i >= length: * break # <<<<<<<<<<<<<< * v[i] = item * else: */ goto __pyx_L11_break; /* "carray.from_py":87 * if i == length: * for i, item in enumerate(o): * if i >= length: # <<<<<<<<<<<<<< * break * v[i] = item */ } /* "carray.from_py":89 * if i >= length: * break * v[i] = item # <<<<<<<<<<<<<< * else: * i += 1 # convert index to length */ __pyx_t_11 = __Pyx_PyInt_As_unsigned_char(__pyx_v_item); if (unlikely((__pyx_t_11 == (unsigned char)-1) && PyErr_Occurred())) __PYX_ERR(1, 89, __pyx_L1_error) (__pyx_v_v[__pyx_v_i]) = __pyx_t_11; /* "carray.from_py":86 * pass * if i == length: * for i, item in enumerate(o): # <<<<<<<<<<<<<< * if i >= length: * break */ } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L13_for_else; __pyx_L11_break:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L14_for_end; /*else*/ { __pyx_L13_for_else:; /* "carray.from_py":91 * v[i] = item * else: * i += 1 # convert index to length # <<<<<<<<<<<<<< * if i == length: * return 0 */ __pyx_v_i = (__pyx_v_i + 1); /* "carray.from_py":92 * else: * i += 1 # convert index to length * if i == length: # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_6 = (__pyx_v_i == __pyx_v_length); if (__pyx_t_6) { /* "carray.from_py":93 * i += 1 # convert index to length * if i == length: * return 0 # <<<<<<<<<<<<<< * * PyErr_Format( */ __pyx_r = 0; goto __pyx_L0; /* "carray.from_py":92 * else: * i += 1 # convert index to length * if i == length: # <<<<<<<<<<<<<< * return 0 * */ } } __pyx_L14_for_end:; /* "carray.from_py":85 * except (TypeError, OverflowError): * pass * if i == length: # <<<<<<<<<<<<<< * for i, item in enumerate(o): * if i >= length: */ } /* "carray.from_py":98 * IndexError, * ("too many values found during array assignment, expected %zd" * if i >= length else # <<<<<<<<<<<<<< * "not enough values found during array assignment, expected %zd, got %zd"), * length, i) */ __pyx_t_6 = (__pyx_v_i >= __pyx_v_length); if (__pyx_t_6) { __pyx_t_12 = ((char const *)"too many values found during array assignment, expected %zd"); } else { __pyx_t_12 = ((char const *)"not enough values found during array assignment, expected %zd, got %zd"); } /* "carray.from_py":95 * return 0 * * PyErr_Format( # <<<<<<<<<<<<<< * IndexError, * ("too many values found during array assignment, expected %zd" */ __pyx_t_7 = PyErr_Format(__pyx_builtin_IndexError, __pyx_t_12, __pyx_v_length, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "carray.from_py":79 * * @cname("__Pyx_carray_from_py_unsigned_char") * cdef int __Pyx_carray_from_py_unsigned_char(object o, base_type *v, Py_ssize_t length) except -1: # <<<<<<<<<<<<<< * cdef Py_ssize_t i = length * try: */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("carray.from_py.__Pyx_carray_from_py_unsigned_char", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_item); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cpython/complex.pxd":19 * * @property * cdef inline double real(self) noexcept: # <<<<<<<<<<<<<< * return self.cval.real * */ static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self) { double __pyx_r; /* "cpython/complex.pxd":20 * @property * cdef inline double real(self) noexcept: * return self.cval.real # <<<<<<<<<<<<<< * * @property */ __pyx_r = __pyx_v_self->cval.real; goto __pyx_L0; /* "cpython/complex.pxd":19 * * @property * cdef inline double real(self) noexcept: # <<<<<<<<<<<<<< * return self.cval.real * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/complex.pxd":23 * * @property * cdef inline double imag(self) noexcept: # <<<<<<<<<<<<<< * return self.cval.imag * */ static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self) { double __pyx_r; /* "cpython/complex.pxd":24 * @property * cdef inline double imag(self) noexcept: * return self.cval.imag # <<<<<<<<<<<<<< * * # PyTypeObject PyComplex_Type */ __pyx_r = __pyx_v_self->cval.imag; goto __pyx_L0; /* "cpython/complex.pxd":23 * * @property * cdef inline double imag(self) noexcept: # <<<<<<<<<<<<<< * return self.cval.imag * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/contextvars.pxd":112 * * * cdef inline object get_value(var, default_value=None): # <<<<<<<<<<<<<< * """Return a new reference to the value of the context variable, * or the default value of the context variable, */ static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value(PyObject *__pyx_v_var, struct __pyx_opt_args_7cpython_11contextvars_get_value *__pyx_optional_args) { PyObject *__pyx_v_default_value = ((PyObject *)Py_None); PyObject *__pyx_v_value; PyObject *__pyx_v_pyvalue = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_value", 1); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_default_value = __pyx_optional_args->default_value; } } /* "cpython/contextvars.pxd":117 * or None if no such value or default was found. * """ * cdef PyObject *value = NULL # <<<<<<<<<<<<<< * PyContextVar_Get(var, NULL, &value) * if value is NULL: */ __pyx_v_value = NULL; /* "cpython/contextvars.pxd":118 * """ * cdef PyObject *value = NULL * PyContextVar_Get(var, NULL, &value) # <<<<<<<<<<<<<< * if value is NULL: * # context variable does not have a default */ __pyx_t_1 = PyContextVar_Get(__pyx_v_var, NULL, (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 118, __pyx_L1_error) /* "cpython/contextvars.pxd":119 * cdef PyObject *value = NULL * PyContextVar_Get(var, NULL, &value) * if value is NULL: # <<<<<<<<<<<<<< * # context variable does not have a default * pyvalue = default_value */ __pyx_t_2 = (__pyx_v_value == NULL); if (__pyx_t_2) { /* "cpython/contextvars.pxd":121 * if value is NULL: * # context variable does not have a default * pyvalue = default_value # <<<<<<<<<<<<<< * else: * # value or default value of context variable */ __Pyx_INCREF(__pyx_v_default_value); __pyx_v_pyvalue = __pyx_v_default_value; /* "cpython/contextvars.pxd":119 * cdef PyObject *value = NULL * PyContextVar_Get(var, NULL, &value) * if value is NULL: # <<<<<<<<<<<<<< * # context variable does not have a default * pyvalue = default_value */ goto __pyx_L3; } /* "cpython/contextvars.pxd":124 * else: * # value or default value of context variable * pyvalue = value # <<<<<<<<<<<<<< * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' * return pyvalue */ /*else*/ { __pyx_t_3 = ((PyObject *)__pyx_v_value); __Pyx_INCREF(__pyx_t_3); __pyx_v_pyvalue = __pyx_t_3; __pyx_t_3 = 0; /* "cpython/contextvars.pxd":125 * # value or default value of context variable * pyvalue = value * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' # <<<<<<<<<<<<<< * return pyvalue * */ Py_XDECREF(__pyx_v_value); } __pyx_L3:; /* "cpython/contextvars.pxd":126 * pyvalue = value * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' * return pyvalue # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_pyvalue); __pyx_r = __pyx_v_pyvalue; goto __pyx_L0; /* "cpython/contextvars.pxd":112 * * * cdef inline object get_value(var, default_value=None): # <<<<<<<<<<<<<< * """Return a new reference to the value of the context variable, * or the default value of the context variable, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("cpython.contextvars.get_value", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_pyvalue); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cpython/contextvars.pxd":129 * * * cdef inline object get_value_no_default(var, default_value=None): # <<<<<<<<<<<<<< * """Return a new reference to the value of the context variable, * or the provided default value if no such value was found. */ static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value_no_default(PyObject *__pyx_v_var, struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default *__pyx_optional_args) { PyObject *__pyx_v_default_value = ((PyObject *)Py_None); PyObject *__pyx_v_value; PyObject *__pyx_v_pyvalue = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_value_no_default", 1); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_default_value = __pyx_optional_args->default_value; } } /* "cpython/contextvars.pxd":135 * Ignores the default value of the context variable, if any. * """ * cdef PyObject *value = NULL # <<<<<<<<<<<<<< * PyContextVar_Get(var, default_value, &value) * # value of context variable or 'default_value' */ __pyx_v_value = NULL; /* "cpython/contextvars.pxd":136 * """ * cdef PyObject *value = NULL * PyContextVar_Get(var, default_value, &value) # <<<<<<<<<<<<<< * # value of context variable or 'default_value' * pyvalue = value */ __pyx_t_1 = PyContextVar_Get(__pyx_v_var, ((PyObject *)__pyx_v_default_value), (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 136, __pyx_L1_error) /* "cpython/contextvars.pxd":138 * PyContextVar_Get(var, default_value, &value) * # value of context variable or 'default_value' * pyvalue = value # <<<<<<<<<<<<<< * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' * return pyvalue */ __pyx_t_2 = ((PyObject *)__pyx_v_value); __Pyx_INCREF(__pyx_t_2); __pyx_v_pyvalue = __pyx_t_2; __pyx_t_2 = 0; /* "cpython/contextvars.pxd":139 * # value of context variable or 'default_value' * pyvalue = value * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' # <<<<<<<<<<<<<< * return pyvalue */ Py_XDECREF(__pyx_v_value); /* "cpython/contextvars.pxd":140 * pyvalue = value * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' * return pyvalue # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_pyvalue); __pyx_r = __pyx_v_pyvalue; goto __pyx_L0; /* "cpython/contextvars.pxd":129 * * * cdef inline object get_value_no_default(var, default_value=None): # <<<<<<<<<<<<<< * """Return a new reference to the value of the context variable, * or the provided default value if no such value was found. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cpython.contextvars.get_value_no_default", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_pyvalue); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/crypto/low_level.pyx":98 * * * def num_cipher_blocks(length, blocksize=16): # <<<<<<<<<<<<<< * """Return the number of cipher blocks required to encrypt/decrypt bytes of data. * */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_6crypto_9low_level_1num_cipher_blocks(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_6crypto_9low_level_num_cipher_blocks, "Return the number of cipher blocks required to encrypt/decrypt bytes of data.\n\n For a precise computation, must be the used cipher's block size (AES: 16).\n\n For a safe-upper-boundary computation, must be the MINIMUM of the block sizes (in\n bytes) of ALL supported ciphers. This can be used to adjust a counter if the used cipher is not\n known (yet).\n The default value of blocksize must be adjusted so it reflects this minimum, so a call of this\n function without a blocksize is \"safe-upper-boundary by default\".\n\n Padding cipher modes are not supported.\n "); static PyMethodDef __pyx_mdef_4borg_6crypto_9low_level_1num_cipher_blocks = {"num_cipher_blocks", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_1num_cipher_blocks, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_6crypto_9low_level_num_cipher_blocks}; static PyObject *__pyx_pw_4borg_6crypto_9low_level_1num_cipher_blocks(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_length = 0; PyObject *__pyx_v_blocksize = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("num_cipher_blocks (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_length,&__pyx_n_s_blocksize,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_16))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_length)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_blocksize); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "num_cipher_blocks") < 0)) __PYX_ERR(0, 98, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_length = values[0]; __pyx_v_blocksize = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("num_cipher_blocks", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 98, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.crypto.low_level.num_cipher_blocks", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_6crypto_9low_level_num_cipher_blocks(__pyx_self, __pyx_v_length, __pyx_v_blocksize); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_6crypto_9low_level_num_cipher_blocks(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_length, PyObject *__pyx_v_blocksize) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("num_cipher_blocks", 1); /* "borg/crypto/low_level.pyx":111 * Padding cipher modes are not supported. * """ * return (length + blocksize - 1) // blocksize # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyNumber_Add(__pyx_v_length, __pyx_v_blocksize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyNumber_FloorDivide(__pyx_t_2, __pyx_v_blocksize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/crypto/low_level.pyx":98 * * * def num_cipher_blocks(length, blocksize=16): # <<<<<<<<<<<<<< * """Return the number of cipher blocks required to encrypt/decrypt bytes of data. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("borg.crypto.low_level.num_cipher_blocks", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/crypto/low_level.pyx":122 * * * cdef Py_buffer ro_buffer(object data) except *: # <<<<<<<<<<<<<< * cdef Py_buffer view * PyObject_GetBuffer(data, &view, PyBUF_SIMPLE) */ static Py_buffer __pyx_f_4borg_6crypto_9low_level_ro_buffer(PyObject *__pyx_v_data) { Py_buffer __pyx_v_view; Py_buffer __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "borg/crypto/low_level.pyx":124 * cdef Py_buffer ro_buffer(object data) except *: * cdef Py_buffer view * PyObject_GetBuffer(data, &view, PyBUF_SIMPLE) # <<<<<<<<<<<<<< * return view * */ __pyx_t_1 = PyObject_GetBuffer(__pyx_v_data, (&__pyx_v_view), PyBUF_SIMPLE); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 124, __pyx_L1_error) /* "borg/crypto/low_level.pyx":125 * cdef Py_buffer view * PyObject_GetBuffer(data, &view, PyBUF_SIMPLE) * return view # <<<<<<<<<<<<<< * * */ __pyx_r = __pyx_v_view; goto __pyx_L0; /* "borg/crypto/low_level.pyx":122 * * * cdef Py_buffer ro_buffer(object data) except *: # <<<<<<<<<<<<<< * cdef Py_buffer view * PyObject_GetBuffer(data, &view, PyBUF_SIMPLE) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.crypto.low_level.ro_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_pretend_to_initialize(&__pyx_r); __pyx_L0:; return __pyx_r; } /* "borg/crypto/low_level.pyx":131 * # Layout: HEADER + PlainText * * def __init__(self, mac_key, enc_key, iv=None, header_len=1, aad_offset=1): # <<<<<<<<<<<<<< * assert mac_key is None * assert enc_key is None */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_6crypto_9low_level_11UNENCRYPTED_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_6crypto_9low_level_11UNENCRYPTED_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_11UNENCRYPTED_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_6crypto_9low_level_11UNENCRYPTED_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_mac_key = 0; PyObject *__pyx_v_enc_key = 0; PyObject *__pyx_v_iv = 0; PyObject *__pyx_v_header_len = 0; CYTHON_UNUSED PyObject *__pyx_v_aad_offset = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[6] = {0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_mac_key,&__pyx_n_s_enc_key,&__pyx_n_s_iv,&__pyx_n_s_header_len,&__pyx_n_s_aad_offset,0}; values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_1))); values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_1))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mac_key)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 6, 1); __PYX_ERR(0, 131, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_enc_key)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 6, 2); __PYX_ERR(0, 131, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iv); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_header_len); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_aad_offset); if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 131, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_mac_key = values[1]; __pyx_v_enc_key = values[2]; __pyx_v_iv = values[3]; __pyx_v_header_len = values[4]; __pyx_v_aad_offset = values[5]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 6, __pyx_nargs); __PYX_ERR(0, 131, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.crypto.low_level.UNENCRYPTED.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_6crypto_9low_level_11UNENCRYPTED___init__(__pyx_self, __pyx_v_self, __pyx_v_mac_key, __pyx_v_enc_key, __pyx_v_iv, __pyx_v_header_len, __pyx_v_aad_offset); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_6crypto_9low_level_11UNENCRYPTED___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_mac_key, PyObject *__pyx_v_enc_key, PyObject *__pyx_v_iv, PyObject *__pyx_v_header_len, CYTHON_UNUSED PyObject *__pyx_v_aad_offset) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "borg/crypto/low_level.pyx":132 * * def __init__(self, mac_key, enc_key, iv=None, header_len=1, aad_offset=1): * assert mac_key is None # <<<<<<<<<<<<<< * assert enc_key is None * self.header_len = header_len */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = (__pyx_v_mac_key == Py_None); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 132, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 132, __pyx_L1_error) #endif /* "borg/crypto/low_level.pyx":133 * def __init__(self, mac_key, enc_key, iv=None, header_len=1, aad_offset=1): * assert mac_key is None * assert enc_key is None # <<<<<<<<<<<<<< * self.header_len = header_len * self.set_iv(iv) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = (__pyx_v_enc_key == Py_None); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 133, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 133, __pyx_L1_error) #endif /* "borg/crypto/low_level.pyx":134 * assert mac_key is None * assert enc_key is None * self.header_len = header_len # <<<<<<<<<<<<<< * self.set_iv(iv) * */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_header_len, __pyx_v_header_len) < 0) __PYX_ERR(0, 134, __pyx_L1_error) /* "borg/crypto/low_level.pyx":135 * assert enc_key is None * self.header_len = header_len * self.set_iv(iv) # <<<<<<<<<<<<<< * * def encrypt(self, data, header=b'', iv=None): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_set_iv); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_iv}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/crypto/low_level.pyx":131 * # Layout: HEADER + PlainText * * def __init__(self, mac_key, enc_key, iv=None, header_len=1, aad_offset=1): # <<<<<<<<<<<<<< * assert mac_key is None * assert enc_key is None */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("borg.crypto.low_level.UNENCRYPTED.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/crypto/low_level.pyx":137 * self.set_iv(iv) * * def encrypt(self, data, header=b'', iv=None): # <<<<<<<<<<<<<< * """ * IMPORTANT: it is called encrypt to satisfy the crypto api naming convention, */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_6crypto_9low_level_11UNENCRYPTED_3encrypt(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_6crypto_9low_level_11UNENCRYPTED_2encrypt, "\n IMPORTANT: it is called encrypt to satisfy the crypto api naming convention,\n but this does NOT encrypt and it does NOT compute and store a MAC either.\n "); static PyMethodDef __pyx_mdef_4borg_6crypto_9low_level_11UNENCRYPTED_3encrypt = {"encrypt", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_11UNENCRYPTED_3encrypt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_6crypto_9low_level_11UNENCRYPTED_2encrypt}; static PyObject *__pyx_pw_4borg_6crypto_9low_level_11UNENCRYPTED_3encrypt(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_data = 0; PyObject *__pyx_v_header = 0; PyObject *__pyx_v_iv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("encrypt (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_data,&__pyx_n_s_header,&__pyx_n_s_iv,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject*)__pyx_kp_b_))); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 137, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 137, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("encrypt", 0, 2, 4, 1); __PYX_ERR(0, 137, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_header); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 137, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iv); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 137, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "encrypt") < 0)) __PYX_ERR(0, 137, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_data = values[1]; __pyx_v_header = values[2]; __pyx_v_iv = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("encrypt", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 137, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.crypto.low_level.UNENCRYPTED.encrypt", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_6crypto_9low_level_11UNENCRYPTED_2encrypt(__pyx_self, __pyx_v_self, __pyx_v_data, __pyx_v_header, __pyx_v_iv); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_6crypto_9low_level_11UNENCRYPTED_2encrypt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data, PyObject *__pyx_v_header, PyObject *__pyx_v_iv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("encrypt", 1); /* "borg/crypto/low_level.pyx":142 * but this does NOT encrypt and it does NOT compute and store a MAC either. * """ * if iv is not None: # <<<<<<<<<<<<<< * self.set_iv(iv) * assert self.iv is not None, 'iv needs to be set before encrypt is called' */ __pyx_t_1 = (__pyx_v_iv != Py_None); if (__pyx_t_1) { /* "borg/crypto/low_level.pyx":143 * """ * if iv is not None: * self.set_iv(iv) # <<<<<<<<<<<<<< * assert self.iv is not None, 'iv needs to be set before encrypt is called' * return header + data */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_set_iv); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_iv}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/crypto/low_level.pyx":142 * but this does NOT encrypt and it does NOT compute and store a MAC either. * """ * if iv is not None: # <<<<<<<<<<<<<< * self.set_iv(iv) * assert self.iv is not None, 'iv needs to be set before encrypt is called' */ } /* "borg/crypto/low_level.pyx":144 * if iv is not None: * self.set_iv(iv) * assert self.iv is not None, 'iv needs to be set before encrypt is called' # <<<<<<<<<<<<<< * return header + data * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_iv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = (__pyx_t_2 != Py_None); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_kp_s_iv_needs_to_be_set_before_encryp, 0, 0); __PYX_ERR(0, 144, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 144, __pyx_L1_error) #endif /* "borg/crypto/low_level.pyx":145 * self.set_iv(iv) * assert self.iv is not None, 'iv needs to be set before encrypt is called' * return header + data # <<<<<<<<<<<<<< * * def decrypt(self, envelope): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyNumber_Add(__pyx_v_header, __pyx_v_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "borg/crypto/low_level.pyx":137 * self.set_iv(iv) * * def encrypt(self, data, header=b'', iv=None): # <<<<<<<<<<<<<< * """ * IMPORTANT: it is called encrypt to satisfy the crypto api naming convention, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("borg.crypto.low_level.UNENCRYPTED.encrypt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/crypto/low_level.pyx":147 * return header + data * * def decrypt(self, envelope): # <<<<<<<<<<<<<< * """ * IMPORTANT: it is called decrypt to satisfy the crypto api naming convention, */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_6crypto_9low_level_11UNENCRYPTED_5decrypt(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_6crypto_9low_level_11UNENCRYPTED_4decrypt, "\n IMPORTANT: it is called decrypt to satisfy the crypto api naming convention,\n but this does NOT decrypt and it does NOT verify a MAC either, because data\n is not encrypted and there is no MAC.\n "); static PyMethodDef __pyx_mdef_4borg_6crypto_9low_level_11UNENCRYPTED_5decrypt = {"decrypt", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_11UNENCRYPTED_5decrypt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_6crypto_9low_level_11UNENCRYPTED_4decrypt}; static PyObject *__pyx_pw_4borg_6crypto_9low_level_11UNENCRYPTED_5decrypt(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_envelope = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("decrypt (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_envelope,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_envelope)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("decrypt", 1, 2, 2, 1); __PYX_ERR(0, 147, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "decrypt") < 0)) __PYX_ERR(0, 147, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_envelope = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("decrypt", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 147, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.crypto.low_level.UNENCRYPTED.decrypt", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_6crypto_9low_level_11UNENCRYPTED_4decrypt(__pyx_self, __pyx_v_self, __pyx_v_envelope); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_6crypto_9low_level_11UNENCRYPTED_4decrypt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_envelope) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; int __pyx_t_4; Py_ssize_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("decrypt", 1); /* "borg/crypto/low_level.pyx":153 * is not encrypted and there is no MAC. * """ * return memoryview(envelope)[self.header_len:] # <<<<<<<<<<<<<< * * def block_count(self, length): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyMemoryView_FromObject(__pyx_v_envelope); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_header_len); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = (__pyx_t_2 == Py_None); if (__pyx_t_4) { __pyx_t_3 = 0; } else { __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 153, __pyx_L1_error) __pyx_t_3 = __pyx_t_5; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PySequence_GetSlice(__pyx_t_1, __pyx_t_3, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "borg/crypto/low_level.pyx":147 * return header + data * * def decrypt(self, envelope): # <<<<<<<<<<<<<< * """ * IMPORTANT: it is called decrypt to satisfy the crypto api naming convention, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("borg.crypto.low_level.UNENCRYPTED.decrypt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/crypto/low_level.pyx":155 * return memoryview(envelope)[self.header_len:] * * def block_count(self, length): # <<<<<<<<<<<<<< * return 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_6crypto_9low_level_11UNENCRYPTED_7block_count(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_6crypto_9low_level_11UNENCRYPTED_7block_count = {"block_count", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_11UNENCRYPTED_7block_count, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_6crypto_9low_level_11UNENCRYPTED_7block_count(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_length = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("block_count (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_length,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 155, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_length)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 155, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("block_count", 1, 2, 2, 1); __PYX_ERR(0, 155, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "block_count") < 0)) __PYX_ERR(0, 155, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_length = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("block_count", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 155, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.crypto.low_level.UNENCRYPTED.block_count", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_6crypto_9low_level_11UNENCRYPTED_6block_count(__pyx_self, __pyx_v_self, __pyx_v_length); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_6crypto_9low_level_11UNENCRYPTED_6block_count(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_length) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("block_count", 1); /* "borg/crypto/low_level.pyx":156 * * def block_count(self, length): * return 0 # <<<<<<<<<<<<<< * * def set_iv(self, iv): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_int_0); __pyx_r = __pyx_int_0; goto __pyx_L0; /* "borg/crypto/low_level.pyx":155 * return memoryview(envelope)[self.header_len:] * * def block_count(self, length): # <<<<<<<<<<<<<< * return 0 * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/crypto/low_level.pyx":158 * return 0 * * def set_iv(self, iv): # <<<<<<<<<<<<<< * self.iv = iv * */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_6crypto_9low_level_11UNENCRYPTED_9set_iv(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_6crypto_9low_level_11UNENCRYPTED_9set_iv = {"set_iv", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_11UNENCRYPTED_9set_iv, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_6crypto_9low_level_11UNENCRYPTED_9set_iv(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_iv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_iv (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_iv,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 158, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iv)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 158, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("set_iv", 1, 2, 2, 1); __PYX_ERR(0, 158, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_iv") < 0)) __PYX_ERR(0, 158, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_iv = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_iv", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 158, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.crypto.low_level.UNENCRYPTED.set_iv", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_6crypto_9low_level_11UNENCRYPTED_8set_iv(__pyx_self, __pyx_v_self, __pyx_v_iv); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_6crypto_9low_level_11UNENCRYPTED_8set_iv(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_iv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_iv", 1); /* "borg/crypto/low_level.pyx":159 * * def set_iv(self, iv): * self.iv = iv # <<<<<<<<<<<<<< * * def next_iv(self): */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_iv, __pyx_v_iv) < 0) __PYX_ERR(0, 159, __pyx_L1_error) /* "borg/crypto/low_level.pyx":158 * return 0 * * def set_iv(self, iv): # <<<<<<<<<<<<<< * self.iv = iv * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("borg.crypto.low_level.UNENCRYPTED.set_iv", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/crypto/low_level.pyx":161 * self.iv = iv * * def next_iv(self): # <<<<<<<<<<<<<< * return self.iv * */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_6crypto_9low_level_11UNENCRYPTED_11next_iv(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_6crypto_9low_level_11UNENCRYPTED_11next_iv = {"next_iv", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_11UNENCRYPTED_11next_iv, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_6crypto_9low_level_11UNENCRYPTED_11next_iv(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("next_iv (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 161, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "next_iv") < 0)) __PYX_ERR(0, 161, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("next_iv", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 161, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.crypto.low_level.UNENCRYPTED.next_iv", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_6crypto_9low_level_11UNENCRYPTED_10next_iv(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_6crypto_9low_level_11UNENCRYPTED_10next_iv(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("next_iv", 1); /* "borg/crypto/low_level.pyx":162 * * def next_iv(self): * return self.iv # <<<<<<<<<<<<<< * * def extract_iv(self, envelope): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_iv); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/crypto/low_level.pyx":161 * self.iv = iv * * def next_iv(self): # <<<<<<<<<<<<<< * return self.iv * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("borg.crypto.low_level.UNENCRYPTED.next_iv", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/crypto/low_level.pyx":164 * return self.iv * * def extract_iv(self, envelope): # <<<<<<<<<<<<<< * return 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_6crypto_9low_level_11UNENCRYPTED_13extract_iv(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_6crypto_9low_level_11UNENCRYPTED_13extract_iv = {"extract_iv", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_11UNENCRYPTED_13extract_iv, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_6crypto_9low_level_11UNENCRYPTED_13extract_iv(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_envelope = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("extract_iv (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_envelope,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 164, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_envelope)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 164, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("extract_iv", 1, 2, 2, 1); __PYX_ERR(0, 164, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "extract_iv") < 0)) __PYX_ERR(0, 164, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_envelope = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("extract_iv", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 164, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.crypto.low_level.UNENCRYPTED.extract_iv", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_6crypto_9low_level_11UNENCRYPTED_12extract_iv(__pyx_self, __pyx_v_self, __pyx_v_envelope); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_6crypto_9low_level_11UNENCRYPTED_12extract_iv(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_envelope) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("extract_iv", 1); /* "borg/crypto/low_level.pyx":165 * * def extract_iv(self, envelope): * return 0 # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_int_0); __pyx_r = __pyx_int_0; goto __pyx_L0; /* "borg/crypto/low_level.pyx":164 * return self.iv * * def extract_iv(self, envelope): # <<<<<<<<<<<<<< * return 0 * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/crypto/low_level.pyx":181 * cdef long long blocks * * @classmethod # <<<<<<<<<<<<<< * def requirements_check(cls): * if OPENSSL_VERSION_NUMBER < 0x10000000: */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_1requirements_check(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_6crypto_9low_level_15AES256_CTR_BASE_1requirements_check = {"requirements_check", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_1requirements_check, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_1requirements_check(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("requirements_check (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("requirements_check", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "requirements_check", 0))) return NULL; __pyx_r = __pyx_pf_4borg_6crypto_9low_level_15AES256_CTR_BASE_requirements_check(((PyTypeObject*)__pyx_v_cls)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_6crypto_9low_level_15AES256_CTR_BASE_requirements_check(CYTHON_UNUSED PyTypeObject *__pyx_v_cls) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("requirements_check", 1); /* "borg/crypto/low_level.pyx":183 * @classmethod * def requirements_check(cls): * if OPENSSL_VERSION_NUMBER < 0x10000000: # <<<<<<<<<<<<<< * raise ValueError('AES CTR requires OpenSSL >= 1.0.0. Detected: OpenSSL %08x' % OPENSSL_VERSION_NUMBER) * */ __pyx_t_1 = (OPENSSL_VERSION_NUMBER < 0x10000000); if (unlikely(__pyx_t_1)) { /* "borg/crypto/low_level.pyx":184 * def requirements_check(cls): * if OPENSSL_VERSION_NUMBER < 0x10000000: * raise ValueError('AES CTR requires OpenSSL >= 1.0.0. Detected: OpenSSL %08x' % OPENSSL_VERSION_NUMBER) # <<<<<<<<<<<<<< * * def __init__(self, mac_key, enc_key, iv=None, header_len=1, aad_offset=1): */ __pyx_t_2 = __Pyx_PyInt_From_long(OPENSSL_VERSION_NUMBER); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_AES_CTR_requires_OpenSSL_1_0_0_D, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 184, __pyx_L1_error) /* "borg/crypto/low_level.pyx":183 * @classmethod * def requirements_check(cls): * if OPENSSL_VERSION_NUMBER < 0x10000000: # <<<<<<<<<<<<<< * raise ValueError('AES CTR requires OpenSSL >= 1.0.0. Detected: OpenSSL %08x' % OPENSSL_VERSION_NUMBER) * */ } /* "borg/crypto/low_level.pyx":181 * cdef long long blocks * * @classmethod # <<<<<<<<<<<<<< * def requirements_check(cls): * if OPENSSL_VERSION_NUMBER < 0x10000000: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("borg.crypto.low_level.AES256_CTR_BASE.requirements_check", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/crypto/low_level.pyx":186 * raise ValueError('AES CTR requires OpenSSL >= 1.0.0. Detected: OpenSSL %08x' % OPENSSL_VERSION_NUMBER) * * def __init__(self, mac_key, enc_key, iv=None, header_len=1, aad_offset=1): # <<<<<<<<<<<<<< * self.requirements_check() * assert isinstance(enc_key, bytes) and len(enc_key) == 32 */ /* Python wrapper */ static int __pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_mac_key = 0; PyObject *__pyx_v_enc_key = 0; PyObject *__pyx_v_iv = 0; PyObject *__pyx_v_header_len = 0; PyObject *__pyx_v_aad_offset = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mac_key,&__pyx_n_s_enc_key,&__pyx_n_s_iv,&__pyx_n_s_header_len,&__pyx_n_s_aad_offset,0}; values[2] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None)); values[3] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_int_1)); values[4] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_int_1)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mac_key)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_enc_key)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, 1); __PYX_ERR(0, 186, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iv); if (value) { values[2] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_header_len); if (value) { values[3] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_aad_offset); if (value) { values[4] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 186, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_mac_key = values[0]; __pyx_v_enc_key = values[1]; __pyx_v_iv = values[2]; __pyx_v_header_len = values[3]; __pyx_v_aad_offset = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, __pyx_nargs); __PYX_ERR(0, 186, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.crypto.low_level.AES256_CTR_BASE.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_6crypto_9low_level_15AES256_CTR_BASE_2__init__(((struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *)__pyx_v_self), __pyx_v_mac_key, __pyx_v_enc_key, __pyx_v_iv, __pyx_v_header_len, __pyx_v_aad_offset); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_4borg_6crypto_9low_level_15AES256_CTR_BASE_2__init__(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_mac_key, PyObject *__pyx_v_enc_key, PyObject *__pyx_v_iv, PyObject *__pyx_v_header_len, PyObject *__pyx_v_aad_offset) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; int __pyx_t_6; Py_ssize_t __pyx_t_7; unsigned char __pyx_t_8[32]; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "borg/crypto/low_level.pyx":187 * * def __init__(self, mac_key, enc_key, iv=None, header_len=1, aad_offset=1): * self.requirements_check() # <<<<<<<<<<<<<< * assert isinstance(enc_key, bytes) and len(enc_key) == 32 * self.cipher_blk_len = 16 */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_requirements_check); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/crypto/low_level.pyx":188 * def __init__(self, mac_key, enc_key, iv=None, header_len=1, aad_offset=1): * self.requirements_check() * assert isinstance(enc_key, bytes) and len(enc_key) == 32 # <<<<<<<<<<<<<< * self.cipher_blk_len = 16 * self.iv_len = sizeof(self.iv) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_6 = PyBytes_Check(__pyx_v_enc_key); if (__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L3_bool_binop_done; } __pyx_t_7 = PyObject_Length(__pyx_v_enc_key); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 188, __pyx_L1_error) __pyx_t_6 = (__pyx_t_7 == 32); __pyx_t_5 = __pyx_t_6; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_5)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 188, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 188, __pyx_L1_error) #endif /* "borg/crypto/low_level.pyx":189 * self.requirements_check() * assert isinstance(enc_key, bytes) and len(enc_key) == 32 * self.cipher_blk_len = 16 # <<<<<<<<<<<<<< * self.iv_len = sizeof(self.iv) * self.iv_len_short = 8 */ __pyx_v_self->cipher_blk_len = 16; /* "borg/crypto/low_level.pyx":190 * assert isinstance(enc_key, bytes) and len(enc_key) == 32 * self.cipher_blk_len = 16 * self.iv_len = sizeof(self.iv) # <<<<<<<<<<<<<< * self.iv_len_short = 8 * assert aad_offset <= header_len */ __pyx_v_self->iv_len = (sizeof(__pyx_v_self->iv)); /* "borg/crypto/low_level.pyx":191 * self.cipher_blk_len = 16 * self.iv_len = sizeof(self.iv) * self.iv_len_short = 8 # <<<<<<<<<<<<<< * assert aad_offset <= header_len * self.aad_offset = aad_offset */ __pyx_v_self->iv_len_short = 8; /* "borg/crypto/low_level.pyx":192 * self.iv_len = sizeof(self.iv) * self.iv_len_short = 8 * assert aad_offset <= header_len # <<<<<<<<<<<<<< * self.aad_offset = aad_offset * self.header_len = header_len */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = PyObject_RichCompare(__pyx_v_aad_offset, __pyx_v_header_len, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 192, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_5)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 192, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 192, __pyx_L1_error) #endif /* "borg/crypto/low_level.pyx":193 * self.iv_len_short = 8 * assert aad_offset <= header_len * self.aad_offset = aad_offset # <<<<<<<<<<<<<< * self.header_len = header_len * self.mac_len = 32 */ __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_aad_offset); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 193, __pyx_L1_error) __pyx_v_self->aad_offset = __pyx_t_4; /* "borg/crypto/low_level.pyx":194 * assert aad_offset <= header_len * self.aad_offset = aad_offset * self.header_len = header_len # <<<<<<<<<<<<<< * self.mac_len = 32 * self.enc_key = enc_key */ __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_header_len); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 194, __pyx_L1_error) __pyx_v_self->header_len = __pyx_t_4; /* "borg/crypto/low_level.pyx":195 * self.aad_offset = aad_offset * self.header_len = header_len * self.mac_len = 32 # <<<<<<<<<<<<<< * self.enc_key = enc_key * if iv is not None: */ __pyx_v_self->mac_len = 32; /* "borg/crypto/low_level.pyx":196 * self.header_len = header_len * self.mac_len = 32 * self.enc_key = enc_key # <<<<<<<<<<<<<< * if iv is not None: * self.set_iv(iv) */ if (unlikely((__Pyx_carray_from_py_unsigned_char(__pyx_v_enc_key, __pyx_t_8, 32) < 0))) __PYX_ERR(0, 196, __pyx_L1_error) memcpy(&(__pyx_v_self->enc_key[0]), __pyx_t_8, sizeof(__pyx_v_self->enc_key[0]) * (32)); /* "borg/crypto/low_level.pyx":197 * self.mac_len = 32 * self.enc_key = enc_key * if iv is not None: # <<<<<<<<<<<<<< * self.set_iv(iv) * else: */ __pyx_t_5 = (__pyx_v_iv != Py_None); if (__pyx_t_5) { /* "borg/crypto/low_level.pyx":198 * self.enc_key = enc_key * if iv is not None: * self.set_iv(iv) # <<<<<<<<<<<<<< * else: * self.blocks = -1 # make sure set_iv is called before encrypt */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_iv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_iv}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/crypto/low_level.pyx":197 * self.mac_len = 32 * self.enc_key = enc_key * if iv is not None: # <<<<<<<<<<<<<< * self.set_iv(iv) * else: */ goto __pyx_L5; } /* "borg/crypto/low_level.pyx":200 * self.set_iv(iv) * else: * self.blocks = -1 # make sure set_iv is called before encrypt # <<<<<<<<<<<<<< * * def __cinit__(self, mac_key, enc_key, iv=None, header_len=1, aad_offset=1): */ /*else*/ { __pyx_v_self->blocks = -1LL; } __pyx_L5:; /* "borg/crypto/low_level.pyx":186 * raise ValueError('AES CTR requires OpenSSL >= 1.0.0. Detected: OpenSSL %08x' % OPENSSL_VERSION_NUMBER) * * def __init__(self, mac_key, enc_key, iv=None, header_len=1, aad_offset=1): # <<<<<<<<<<<<<< * self.requirements_check() * assert isinstance(enc_key, bytes) and len(enc_key) == 32 */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("borg.crypto.low_level.AES256_CTR_BASE.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/crypto/low_level.pyx":202 * self.blocks = -1 # make sure set_iv is called before encrypt * * def __cinit__(self, mac_key, enc_key, iv=None, header_len=1, aad_offset=1): # <<<<<<<<<<<<<< * self.ctx = EVP_CIPHER_CTX_new() * */ /* Python wrapper */ static int __pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_5__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_5__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_mac_key = 0; CYTHON_UNUSED PyObject *__pyx_v_enc_key = 0; CYTHON_UNUSED PyObject *__pyx_v_iv = 0; CYTHON_UNUSED PyObject *__pyx_v_header_len = 0; CYTHON_UNUSED PyObject *__pyx_v_aad_offset = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mac_key,&__pyx_n_s_enc_key,&__pyx_n_s_iv,&__pyx_n_s_header_len,&__pyx_n_s_aad_offset,0}; values[2] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None)); values[3] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_int_1)); values[4] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_int_1)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mac_key)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 202, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_enc_key)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 202, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 5, 1); __PYX_ERR(0, 202, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iv); if (value) { values[2] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 202, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_header_len); if (value) { values[3] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 202, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_aad_offset); if (value) { values[4] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 202, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(0, 202, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_mac_key = values[0]; __pyx_v_enc_key = values[1]; __pyx_v_iv = values[2]; __pyx_v_header_len = values[3]; __pyx_v_aad_offset = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 5, __pyx_nargs); __PYX_ERR(0, 202, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.crypto.low_level.AES256_CTR_BASE.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_6crypto_9low_level_15AES256_CTR_BASE_4__cinit__(((struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *)__pyx_v_self), __pyx_v_mac_key, __pyx_v_enc_key, __pyx_v_iv, __pyx_v_header_len, __pyx_v_aad_offset); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_4borg_6crypto_9low_level_15AES256_CTR_BASE_4__cinit__(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_mac_key, CYTHON_UNUSED PyObject *__pyx_v_enc_key, CYTHON_UNUSED PyObject *__pyx_v_iv, CYTHON_UNUSED PyObject *__pyx_v_header_len, CYTHON_UNUSED PyObject *__pyx_v_aad_offset) { int __pyx_r; /* "borg/crypto/low_level.pyx":203 * * def __cinit__(self, mac_key, enc_key, iv=None, header_len=1, aad_offset=1): * self.ctx = EVP_CIPHER_CTX_new() # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_v_self->ctx = EVP_CIPHER_CTX_new(); /* "borg/crypto/low_level.pyx":202 * self.blocks = -1 # make sure set_iv is called before encrypt * * def __cinit__(self, mac_key, enc_key, iv=None, header_len=1, aad_offset=1): # <<<<<<<<<<<<<< * self.ctx = EVP_CIPHER_CTX_new() * */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "borg/crypto/low_level.pyx":205 * self.ctx = EVP_CIPHER_CTX_new() * * def __dealloc__(self): # <<<<<<<<<<<<<< * EVP_CIPHER_CTX_free(self.ctx) * */ /* Python wrapper */ static void __pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_7__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_7__dealloc__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_4borg_6crypto_9low_level_15AES256_CTR_BASE_6__dealloc__(((struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_4borg_6crypto_9low_level_15AES256_CTR_BASE_6__dealloc__(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *__pyx_v_self) { /* "borg/crypto/low_level.pyx":206 * * def __dealloc__(self): * EVP_CIPHER_CTX_free(self.ctx) # <<<<<<<<<<<<<< * * cdef mac_compute(self, const unsigned char *data1, int data1_len, */ EVP_CIPHER_CTX_free(__pyx_v_self->ctx); /* "borg/crypto/low_level.pyx":205 * self.ctx = EVP_CIPHER_CTX_new() * * def __dealloc__(self): # <<<<<<<<<<<<<< * EVP_CIPHER_CTX_free(self.ctx) * */ /* function exit code */ } /* "borg/crypto/low_level.pyx":208 * EVP_CIPHER_CTX_free(self.ctx) * * cdef mac_compute(self, const unsigned char *data1, int data1_len, # <<<<<<<<<<<<<< * const unsigned char *data2, int data2_len, * unsigned char *mac_buf): */ static PyObject *__pyx_f_4borg_6crypto_9low_level_15AES256_CTR_BASE_mac_compute(CYTHON_UNUSED struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *__pyx_v_self, CYTHON_UNUSED unsigned char const *__pyx_v_data1, CYTHON_UNUSED int __pyx_v_data1_len, CYTHON_UNUSED unsigned char const *__pyx_v_data2, CYTHON_UNUSED int __pyx_v_data2_len, CYTHON_UNUSED unsigned char *__pyx_v_mac_buf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mac_compute", 1); /* "borg/crypto/low_level.pyx":211 * const unsigned char *data2, int data2_len, * unsigned char *mac_buf): * raise NotImplementedError # <<<<<<<<<<<<<< * * cdef mac_verify(self, const unsigned char *data1, int data1_len, */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(0, 211, __pyx_L1_error) /* "borg/crypto/low_level.pyx":208 * EVP_CIPHER_CTX_free(self.ctx) * * cdef mac_compute(self, const unsigned char *data1, int data1_len, # <<<<<<<<<<<<<< * const unsigned char *data2, int data2_len, * unsigned char *mac_buf): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.crypto.low_level.AES256_CTR_BASE.mac_compute", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/crypto/low_level.pyx":213 * raise NotImplementedError * * cdef mac_verify(self, const unsigned char *data1, int data1_len, # <<<<<<<<<<<<<< * const unsigned char *data2, int data2_len, * unsigned char *mac_buf, const unsigned char *mac_wanted): */ static PyObject *__pyx_f_4borg_6crypto_9low_level_15AES256_CTR_BASE_mac_verify(CYTHON_UNUSED struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *__pyx_v_self, CYTHON_UNUSED unsigned char const *__pyx_v_data1, CYTHON_UNUSED int __pyx_v_data1_len, CYTHON_UNUSED unsigned char const *__pyx_v_data2, CYTHON_UNUSED int __pyx_v_data2_len, CYTHON_UNUSED unsigned char *__pyx_v_mac_buf, CYTHON_UNUSED unsigned char const *__pyx_v_mac_wanted) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mac_verify", 1); /* "borg/crypto/low_level.pyx":219 * Calculate MAC of *data1*, *data2*, write result to *mac_buf*, and verify against *mac_wanted.* * """ * raise NotImplementedError # <<<<<<<<<<<<<< * * def encrypt(self, data, header=b'', iv=None): */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(0, 219, __pyx_L1_error) /* "borg/crypto/low_level.pyx":213 * raise NotImplementedError * * cdef mac_verify(self, const unsigned char *data1, int data1_len, # <<<<<<<<<<<<<< * const unsigned char *data2, int data2_len, * unsigned char *mac_buf, const unsigned char *mac_wanted): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.crypto.low_level.AES256_CTR_BASE.mac_verify", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/crypto/low_level.pyx":221 * raise NotImplementedError * * def encrypt(self, data, header=b'', iv=None): # <<<<<<<<<<<<<< * """ * encrypt data, compute mac over aad + iv + cdata, prepend header. */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_9encrypt(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_6crypto_9low_level_15AES256_CTR_BASE_8encrypt, "\n encrypt data, compute mac over aad + iv + cdata, prepend header.\n aad_offset is the offset into the header where aad starts.\n "); static PyMethodDef __pyx_mdef_4borg_6crypto_9low_level_15AES256_CTR_BASE_9encrypt = {"encrypt", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_9encrypt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_6crypto_9low_level_15AES256_CTR_BASE_8encrypt}; static PyObject *__pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_9encrypt(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_data = 0; PyObject *__pyx_v_header = 0; PyObject *__pyx_v_iv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("encrypt (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_header,&__pyx_n_s_iv,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_kp_b_)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 221, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_header); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 221, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iv); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 221, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "encrypt") < 0)) __PYX_ERR(0, 221, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_data = values[0]; __pyx_v_header = values[1]; __pyx_v_iv = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("encrypt", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 221, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.crypto.low_level.AES256_CTR_BASE.encrypt", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_6crypto_9low_level_15AES256_CTR_BASE_8encrypt(((struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *)__pyx_v_self), __pyx_v_data, __pyx_v_header, __pyx_v_iv); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_6crypto_9low_level_15AES256_CTR_BASE_8encrypt(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *__pyx_v_self, PyObject *__pyx_v_data, PyObject *__pyx_v_header, PyObject *__pyx_v_iv) { int __pyx_v_ilen; int __pyx_v_hlen; int __pyx_v_aoffset; int __pyx_v_alen; unsigned char *__pyx_v_odata; int __pyx_v_olen; int __pyx_v_offset; Py_buffer __pyx_v_idata; Py_buffer __pyx_v_hdata; PyObject *__pyx_v_i = NULL; int __pyx_v_rc; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; Py_ssize_t __pyx_t_6; Py_buffer __pyx_t_7; PyObject *(*__pyx_t_8)(PyObject *); unsigned char __pyx_t_9; Py_ssize_t __pyx_t_10; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PY_LONG_LONG __pyx_t_13; int __pyx_t_14; char const *__pyx_t_15; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("encrypt", 1); /* "borg/crypto/low_level.pyx":226 * aad_offset is the offset into the header where aad starts. * """ * if iv is not None: # <<<<<<<<<<<<<< * self.set_iv(iv) * assert self.blocks == 0, 'iv needs to be set before encrypt is called' */ __pyx_t_1 = (__pyx_v_iv != Py_None); if (__pyx_t_1) { /* "borg/crypto/low_level.pyx":227 * """ * if iv is not None: * self.set_iv(iv) # <<<<<<<<<<<<<< * assert self.blocks == 0, 'iv needs to be set before encrypt is called' * cdef int ilen = len(data) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_iv); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_iv}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/crypto/low_level.pyx":226 * aad_offset is the offset into the header where aad starts. * """ * if iv is not None: # <<<<<<<<<<<<<< * self.set_iv(iv) * assert self.blocks == 0, 'iv needs to be set before encrypt is called' */ } /* "borg/crypto/low_level.pyx":228 * if iv is not None: * self.set_iv(iv) * assert self.blocks == 0, 'iv needs to be set before encrypt is called' # <<<<<<<<<<<<<< * cdef int ilen = len(data) * cdef int hlen = len(header) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = (__pyx_v_self->blocks == 0); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_kp_s_iv_needs_to_be_set_before_encryp, 0, 0); __PYX_ERR(0, 228, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 228, __pyx_L1_error) #endif /* "borg/crypto/low_level.pyx":229 * self.set_iv(iv) * assert self.blocks == 0, 'iv needs to be set before encrypt is called' * cdef int ilen = len(data) # <<<<<<<<<<<<<< * cdef int hlen = len(header) * assert hlen == self.header_len */ __pyx_t_6 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 229, __pyx_L1_error) __pyx_v_ilen = __pyx_t_6; /* "borg/crypto/low_level.pyx":230 * assert self.blocks == 0, 'iv needs to be set before encrypt is called' * cdef int ilen = len(data) * cdef int hlen = len(header) # <<<<<<<<<<<<<< * assert hlen == self.header_len * cdef int aoffset = self.aad_offset */ __pyx_t_6 = PyObject_Length(__pyx_v_header); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 230, __pyx_L1_error) __pyx_v_hlen = __pyx_t_6; /* "borg/crypto/low_level.pyx":231 * cdef int ilen = len(data) * cdef int hlen = len(header) * assert hlen == self.header_len # <<<<<<<<<<<<<< * cdef int aoffset = self.aad_offset * cdef int alen = hlen - aoffset */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = (__pyx_v_hlen == __pyx_v_self->header_len); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 231, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 231, __pyx_L1_error) #endif /* "borg/crypto/low_level.pyx":232 * cdef int hlen = len(header) * assert hlen == self.header_len * cdef int aoffset = self.aad_offset # <<<<<<<<<<<<<< * cdef int alen = hlen - aoffset * cdef unsigned char *odata = PyMem_Malloc(hlen + self.mac_len + self.iv_len_short + */ __pyx_t_5 = __pyx_v_self->aad_offset; __pyx_v_aoffset = __pyx_t_5; /* "borg/crypto/low_level.pyx":233 * assert hlen == self.header_len * cdef int aoffset = self.aad_offset * cdef int alen = hlen - aoffset # <<<<<<<<<<<<<< * cdef unsigned char *odata = PyMem_Malloc(hlen + self.mac_len + self.iv_len_short + * ilen + self.cipher_blk_len) # play safe, 1 extra blk */ __pyx_v_alen = (__pyx_v_hlen - __pyx_v_aoffset); /* "borg/crypto/low_level.pyx":234 * cdef int aoffset = self.aad_offset * cdef int alen = hlen - aoffset * cdef unsigned char *odata = PyMem_Malloc(hlen + self.mac_len + self.iv_len_short + # <<<<<<<<<<<<<< * ilen + self.cipher_blk_len) # play safe, 1 extra blk * if not odata: */ __pyx_v_odata = ((unsigned char *)PyMem_Malloc(((((__pyx_v_hlen + __pyx_v_self->mac_len) + __pyx_v_self->iv_len_short) + __pyx_v_ilen) + __pyx_v_self->cipher_blk_len))); /* "borg/crypto/low_level.pyx":236 * cdef unsigned char *odata = PyMem_Malloc(hlen + self.mac_len + self.iv_len_short + * ilen + self.cipher_blk_len) # play safe, 1 extra blk * if not odata: # <<<<<<<<<<<<<< * raise MemoryError * cdef int olen */ __pyx_t_1 = (!(__pyx_v_odata != 0)); if (unlikely(__pyx_t_1)) { /* "borg/crypto/low_level.pyx":237 * ilen + self.cipher_blk_len) # play safe, 1 extra blk * if not odata: * raise MemoryError # <<<<<<<<<<<<<< * cdef int olen * cdef int offset */ PyErr_NoMemory(); __PYX_ERR(0, 237, __pyx_L1_error) /* "borg/crypto/low_level.pyx":236 * cdef unsigned char *odata = PyMem_Malloc(hlen + self.mac_len + self.iv_len_short + * ilen + self.cipher_blk_len) # play safe, 1 extra blk * if not odata: # <<<<<<<<<<<<<< * raise MemoryError * cdef int olen */ } /* "borg/crypto/low_level.pyx":240 * cdef int olen * cdef int offset * cdef Py_buffer idata = ro_buffer(data) # <<<<<<<<<<<<<< * cdef Py_buffer hdata = ro_buffer(header) * try: */ __pyx_t_7 = __pyx_f_4borg_6crypto_9low_level_ro_buffer(__pyx_v_data); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 240, __pyx_L1_error) __pyx_v_idata = __pyx_t_7; /* "borg/crypto/low_level.pyx":241 * cdef int offset * cdef Py_buffer idata = ro_buffer(data) * cdef Py_buffer hdata = ro_buffer(header) # <<<<<<<<<<<<<< * try: * offset = 0 */ __pyx_t_7 = __pyx_f_4borg_6crypto_9low_level_ro_buffer(__pyx_v_header); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 241, __pyx_L1_error) __pyx_v_hdata = __pyx_t_7; /* "borg/crypto/low_level.pyx":242 * cdef Py_buffer idata = ro_buffer(data) * cdef Py_buffer hdata = ro_buffer(header) * try: # <<<<<<<<<<<<<< * offset = 0 * for i in range(hlen): */ /*try:*/ { /* "borg/crypto/low_level.pyx":243 * cdef Py_buffer hdata = ro_buffer(header) * try: * offset = 0 # <<<<<<<<<<<<<< * for i in range(hlen): * odata[offset+i] = header[i] */ __pyx_v_offset = 0; /* "borg/crypto/low_level.pyx":244 * try: * offset = 0 * for i in range(hlen): # <<<<<<<<<<<<<< * odata[offset+i] = header[i] * offset += hlen */ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_hlen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 244, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 244, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; __pyx_t_8 = NULL; } else { __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 244, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 244, __pyx_L6_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_8)) { if (likely(PyList_CheckExact(__pyx_t_2))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 244, __pyx_L6_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 244, __pyx_L6_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 244, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 244, __pyx_L6_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 244, __pyx_L6_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 244, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_8(__pyx_t_2); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 244, __pyx_L6_error) } break; } __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3); __pyx_t_3 = 0; /* "borg/crypto/low_level.pyx":245 * offset = 0 * for i in range(hlen): * odata[offset+i] = header[i] # <<<<<<<<<<<<<< * offset += hlen * offset += self.mac_len */ __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_header, __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyInt_As_unsigned_char(__pyx_t_3); if (unlikely((__pyx_t_9 == (unsigned char)-1) && PyErr_Occurred())) __PYX_ERR(0, 245, __pyx_L6_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_offset); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 245, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 245, __pyx_L6_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; (__pyx_v_odata[__pyx_t_10]) = __pyx_t_9; /* "borg/crypto/low_level.pyx":244 * try: * offset = 0 * for i in range(hlen): # <<<<<<<<<<<<<< * odata[offset+i] = header[i] * offset += hlen */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/crypto/low_level.pyx":246 * for i in range(hlen): * odata[offset+i] = header[i] * offset += hlen # <<<<<<<<<<<<<< * offset += self.mac_len * self.store_iv(odata+offset, self.iv) */ __pyx_v_offset = (__pyx_v_offset + __pyx_v_hlen); /* "borg/crypto/low_level.pyx":247 * odata[offset+i] = header[i] * offset += hlen * offset += self.mac_len # <<<<<<<<<<<<<< * self.store_iv(odata+offset, self.iv) * offset += self.iv_len_short */ __pyx_v_offset = (__pyx_v_offset + __pyx_v_self->mac_len); /* "borg/crypto/low_level.pyx":248 * offset += hlen * offset += self.mac_len * self.store_iv(odata+offset, self.iv) # <<<<<<<<<<<<<< * offset += self.iv_len_short * rc = EVP_EncryptInit_ex(self.ctx, EVP_aes_256_ctr(), NULL, self.enc_key, self.iv) */ __pyx_t_2 = ((struct __pyx_vtabstruct_4borg_6crypto_9low_level_AES256_CTR_BASE *)__pyx_v_self->__pyx_vtab)->store_iv(__pyx_v_self, (__pyx_v_odata + __pyx_v_offset), __pyx_v_self->iv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/crypto/low_level.pyx":249 * offset += self.mac_len * self.store_iv(odata+offset, self.iv) * offset += self.iv_len_short # <<<<<<<<<<<<<< * rc = EVP_EncryptInit_ex(self.ctx, EVP_aes_256_ctr(), NULL, self.enc_key, self.iv) * if not rc: */ __pyx_v_offset = (__pyx_v_offset + __pyx_v_self->iv_len_short); /* "borg/crypto/low_level.pyx":250 * self.store_iv(odata+offset, self.iv) * offset += self.iv_len_short * rc = EVP_EncryptInit_ex(self.ctx, EVP_aes_256_ctr(), NULL, self.enc_key, self.iv) # <<<<<<<<<<<<<< * if not rc: * raise CryptoError('EVP_EncryptInit_ex failed') */ __pyx_v_rc = EVP_EncryptInit_ex(__pyx_v_self->ctx, EVP_aes_256_ctr(), NULL, __pyx_v_self->enc_key, __pyx_v_self->iv); /* "borg/crypto/low_level.pyx":251 * offset += self.iv_len_short * rc = EVP_EncryptInit_ex(self.ctx, EVP_aes_256_ctr(), NULL, self.enc_key, self.iv) * if not rc: # <<<<<<<<<<<<<< * raise CryptoError('EVP_EncryptInit_ex failed') * rc = EVP_EncryptUpdate(self.ctx, odata+offset, &olen, idata.buf, ilen) */ __pyx_t_1 = (!(__pyx_v_rc != 0)); if (unlikely(__pyx_t_1)) { /* "borg/crypto/low_level.pyx":252 * rc = EVP_EncryptInit_ex(self.ctx, EVP_aes_256_ctr(), NULL, self.enc_key, self.iv) * if not rc: * raise CryptoError('EVP_EncryptInit_ex failed') # <<<<<<<<<<<<<< * rc = EVP_EncryptUpdate(self.ctx, odata+offset, &olen, idata.buf, ilen) * if not rc: */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_CryptoError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_EVP_EncryptInit_ex_failed}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 252, __pyx_L6_error) /* "borg/crypto/low_level.pyx":251 * offset += self.iv_len_short * rc = EVP_EncryptInit_ex(self.ctx, EVP_aes_256_ctr(), NULL, self.enc_key, self.iv) * if not rc: # <<<<<<<<<<<<<< * raise CryptoError('EVP_EncryptInit_ex failed') * rc = EVP_EncryptUpdate(self.ctx, odata+offset, &olen, idata.buf, ilen) */ } /* "borg/crypto/low_level.pyx":253 * if not rc: * raise CryptoError('EVP_EncryptInit_ex failed') * rc = EVP_EncryptUpdate(self.ctx, odata+offset, &olen, idata.buf, ilen) # <<<<<<<<<<<<<< * if not rc: * raise CryptoError('EVP_EncryptUpdate failed') */ __pyx_v_rc = EVP_EncryptUpdate(__pyx_v_self->ctx, (__pyx_v_odata + __pyx_v_offset), (&__pyx_v_olen), ((unsigned char const *)__pyx_v_idata.buf), __pyx_v_ilen); /* "borg/crypto/low_level.pyx":254 * raise CryptoError('EVP_EncryptInit_ex failed') * rc = EVP_EncryptUpdate(self.ctx, odata+offset, &olen, idata.buf, ilen) * if not rc: # <<<<<<<<<<<<<< * raise CryptoError('EVP_EncryptUpdate failed') * offset += olen */ __pyx_t_1 = (!(__pyx_v_rc != 0)); if (unlikely(__pyx_t_1)) { /* "borg/crypto/low_level.pyx":255 * rc = EVP_EncryptUpdate(self.ctx, odata+offset, &olen, idata.buf, ilen) * if not rc: * raise CryptoError('EVP_EncryptUpdate failed') # <<<<<<<<<<<<<< * offset += olen * rc = EVP_EncryptFinal_ex(self.ctx, odata+offset, &olen) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_CryptoError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 255, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_EVP_EncryptUpdate_failed}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 255, __pyx_L6_error) /* "borg/crypto/low_level.pyx":254 * raise CryptoError('EVP_EncryptInit_ex failed') * rc = EVP_EncryptUpdate(self.ctx, odata+offset, &olen, idata.buf, ilen) * if not rc: # <<<<<<<<<<<<<< * raise CryptoError('EVP_EncryptUpdate failed') * offset += olen */ } /* "borg/crypto/low_level.pyx":256 * if not rc: * raise CryptoError('EVP_EncryptUpdate failed') * offset += olen # <<<<<<<<<<<<<< * rc = EVP_EncryptFinal_ex(self.ctx, odata+offset, &olen) * if not rc: */ __pyx_v_offset = (__pyx_v_offset + __pyx_v_olen); /* "borg/crypto/low_level.pyx":257 * raise CryptoError('EVP_EncryptUpdate failed') * offset += olen * rc = EVP_EncryptFinal_ex(self.ctx, odata+offset, &olen) # <<<<<<<<<<<<<< * if not rc: * raise CryptoError('EVP_EncryptFinal_ex failed') */ __pyx_v_rc = EVP_EncryptFinal_ex(__pyx_v_self->ctx, (__pyx_v_odata + __pyx_v_offset), (&__pyx_v_olen)); /* "borg/crypto/low_level.pyx":258 * offset += olen * rc = EVP_EncryptFinal_ex(self.ctx, odata+offset, &olen) * if not rc: # <<<<<<<<<<<<<< * raise CryptoError('EVP_EncryptFinal_ex failed') * offset += olen */ __pyx_t_1 = (!(__pyx_v_rc != 0)); if (unlikely(__pyx_t_1)) { /* "borg/crypto/low_level.pyx":259 * rc = EVP_EncryptFinal_ex(self.ctx, odata+offset, &olen) * if not rc: * raise CryptoError('EVP_EncryptFinal_ex failed') # <<<<<<<<<<<<<< * offset += olen * self.mac_compute( hdata.buf+aoffset, alen, */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_CryptoError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 259, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_EVP_EncryptFinal_ex_failed}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 259, __pyx_L6_error) /* "borg/crypto/low_level.pyx":258 * offset += olen * rc = EVP_EncryptFinal_ex(self.ctx, odata+offset, &olen) * if not rc: # <<<<<<<<<<<<<< * raise CryptoError('EVP_EncryptFinal_ex failed') * offset += olen */ } /* "borg/crypto/low_level.pyx":260 * if not rc: * raise CryptoError('EVP_EncryptFinal_ex failed') * offset += olen # <<<<<<<<<<<<<< * self.mac_compute( hdata.buf+aoffset, alen, * odata+hlen+self.mac_len, offset-hlen-self.mac_len, */ __pyx_v_offset = (__pyx_v_offset + __pyx_v_olen); /* "borg/crypto/low_level.pyx":261 * raise CryptoError('EVP_EncryptFinal_ex failed') * offset += olen * self.mac_compute( hdata.buf+aoffset, alen, # <<<<<<<<<<<<<< * odata+hlen+self.mac_len, offset-hlen-self.mac_len, * odata+hlen) */ __pyx_t_2 = ((struct __pyx_vtabstruct_4borg_6crypto_9low_level_AES256_CTR_BASE *)__pyx_v_self->__pyx_vtab)->mac_compute(__pyx_v_self, (((unsigned char const *)__pyx_v_hdata.buf) + __pyx_v_aoffset), __pyx_v_alen, ((__pyx_v_odata + __pyx_v_hlen) + __pyx_v_self->mac_len), ((__pyx_v_offset - __pyx_v_hlen) - __pyx_v_self->mac_len), (__pyx_v_odata + __pyx_v_hlen)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 261, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/crypto/low_level.pyx":264 * odata+hlen+self.mac_len, offset-hlen-self.mac_len, * odata+hlen) * self.blocks += self.block_count(ilen) # <<<<<<<<<<<<<< * return odata[:offset] * finally: */ __pyx_t_2 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_self->blocks); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_block_count); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 264, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_ilen); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 264, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_11}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 264, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 264, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_13 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_3); if (unlikely((__pyx_t_13 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 264, __pyx_L6_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_self->blocks = __pyx_t_13; /* "borg/crypto/low_level.pyx":265 * odata+hlen) * self.blocks += self.block_count(ilen) * return odata[:offset] # <<<<<<<<<<<<<< * finally: * PyMem_Free(odata) */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v_odata) + 0, __pyx_v_offset - 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 265, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L5_return; } /* "borg/crypto/low_level.pyx":267 * return odata[:offset] * finally: * PyMem_Free(odata) # <<<<<<<<<<<<<< * PyBuffer_Release(&hdata) * PyBuffer_Release(&idata) */ /*finally:*/ { __pyx_L6_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __pyx_t_5 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename; { PyMem_Free(__pyx_v_odata); /* "borg/crypto/low_level.pyx":268 * finally: * PyMem_Free(odata) * PyBuffer_Release(&hdata) # <<<<<<<<<<<<<< * PyBuffer_Release(&idata) * */ PyBuffer_Release((&__pyx_v_hdata)); /* "borg/crypto/low_level.pyx":269 * PyMem_Free(odata) * PyBuffer_Release(&hdata) * PyBuffer_Release(&idata) # <<<<<<<<<<<<<< * * def decrypt(self, envelope): */ PyBuffer_Release((&__pyx_v_idata)); } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21); } __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18); __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15; goto __pyx_L1_error; } __pyx_L5_return: { __pyx_t_21 = __pyx_r; __pyx_r = 0; /* "borg/crypto/low_level.pyx":267 * return odata[:offset] * finally: * PyMem_Free(odata) # <<<<<<<<<<<<<< * PyBuffer_Release(&hdata) * PyBuffer_Release(&idata) */ PyMem_Free(__pyx_v_odata); /* "borg/crypto/low_level.pyx":268 * finally: * PyMem_Free(odata) * PyBuffer_Release(&hdata) # <<<<<<<<<<<<<< * PyBuffer_Release(&idata) * */ PyBuffer_Release((&__pyx_v_hdata)); /* "borg/crypto/low_level.pyx":269 * PyMem_Free(odata) * PyBuffer_Release(&hdata) * PyBuffer_Release(&idata) # <<<<<<<<<<<<<< * * def decrypt(self, envelope): */ PyBuffer_Release((&__pyx_v_idata)); __pyx_r = __pyx_t_21; __pyx_t_21 = 0; goto __pyx_L0; } } /* "borg/crypto/low_level.pyx":221 * raise NotImplementedError * * def encrypt(self, data, header=b'', iv=None): # <<<<<<<<<<<<<< * """ * encrypt data, compute mac over aad + iv + cdata, prepend header. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("borg.crypto.low_level.AES256_CTR_BASE.encrypt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_i); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/crypto/low_level.pyx":271 * PyBuffer_Release(&idata) * * def decrypt(self, envelope): # <<<<<<<<<<<<<< * """ * authenticate aad + iv + cdata, decrypt cdata, ignore header bytes up to aad_offset. */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_11decrypt(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_6crypto_9low_level_15AES256_CTR_BASE_10decrypt, "\n authenticate aad + iv + cdata, decrypt cdata, ignore header bytes up to aad_offset.\n "); static PyMethodDef __pyx_mdef_4borg_6crypto_9low_level_15AES256_CTR_BASE_11decrypt = {"decrypt", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_11decrypt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_6crypto_9low_level_15AES256_CTR_BASE_10decrypt}; static PyObject *__pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_11decrypt(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_envelope = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("decrypt (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_envelope,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_envelope)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 271, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "decrypt") < 0)) __PYX_ERR(0, 271, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_envelope = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("decrypt", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 271, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.crypto.low_level.AES256_CTR_BASE.decrypt", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_6crypto_9low_level_15AES256_CTR_BASE_10decrypt(((struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *)__pyx_v_self), __pyx_v_envelope); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_6crypto_9low_level_15AES256_CTR_BASE_10decrypt(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *__pyx_v_self, PyObject *__pyx_v_envelope) { int __pyx_v_ilen; int __pyx_v_hlen; int __pyx_v_aoffset; int __pyx_v_alen; unsigned char *__pyx_v_odata; int __pyx_v_olen; int __pyx_v_offset; unsigned char __pyx_v_mac_buf[32]; Py_buffer __pyx_v_idata; PyObject *__pyx_v_iv = NULL; int __pyx_v_rc; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; int __pyx_t_3; Py_buffer __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned char const *__pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PY_LONG_LONG __pyx_t_11; int __pyx_t_12; char const *__pyx_t_13; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("decrypt", 1); /* "borg/crypto/low_level.pyx":275 * authenticate aad + iv + cdata, decrypt cdata, ignore header bytes up to aad_offset. * """ * cdef int ilen = len(envelope) # <<<<<<<<<<<<<< * cdef int hlen = self.header_len * assert hlen == self.header_len */ __pyx_t_1 = PyObject_Length(__pyx_v_envelope); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 275, __pyx_L1_error) __pyx_v_ilen = __pyx_t_1; /* "borg/crypto/low_level.pyx":276 * """ * cdef int ilen = len(envelope) * cdef int hlen = self.header_len # <<<<<<<<<<<<<< * assert hlen == self.header_len * cdef int aoffset = self.aad_offset */ __pyx_t_2 = __pyx_v_self->header_len; __pyx_v_hlen = __pyx_t_2; /* "borg/crypto/low_level.pyx":277 * cdef int ilen = len(envelope) * cdef int hlen = self.header_len * assert hlen == self.header_len # <<<<<<<<<<<<<< * cdef int aoffset = self.aad_offset * cdef int alen = hlen - aoffset */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = (__pyx_v_hlen == __pyx_v_self->header_len); if (unlikely(!__pyx_t_3)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 277, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 277, __pyx_L1_error) #endif /* "borg/crypto/low_level.pyx":278 * cdef int hlen = self.header_len * assert hlen == self.header_len * cdef int aoffset = self.aad_offset # <<<<<<<<<<<<<< * cdef int alen = hlen - aoffset * cdef unsigned char *odata = PyMem_Malloc(ilen + self.cipher_blk_len) # play safe, 1 extra blk */ __pyx_t_2 = __pyx_v_self->aad_offset; __pyx_v_aoffset = __pyx_t_2; /* "borg/crypto/low_level.pyx":279 * assert hlen == self.header_len * cdef int aoffset = self.aad_offset * cdef int alen = hlen - aoffset # <<<<<<<<<<<<<< * cdef unsigned char *odata = PyMem_Malloc(ilen + self.cipher_blk_len) # play safe, 1 extra blk * if not odata: */ __pyx_v_alen = (__pyx_v_hlen - __pyx_v_aoffset); /* "borg/crypto/low_level.pyx":280 * cdef int aoffset = self.aad_offset * cdef int alen = hlen - aoffset * cdef unsigned char *odata = PyMem_Malloc(ilen + self.cipher_blk_len) # play safe, 1 extra blk # <<<<<<<<<<<<<< * if not odata: * raise MemoryError */ __pyx_v_odata = ((unsigned char *)PyMem_Malloc((__pyx_v_ilen + __pyx_v_self->cipher_blk_len))); /* "borg/crypto/low_level.pyx":281 * cdef int alen = hlen - aoffset * cdef unsigned char *odata = PyMem_Malloc(ilen + self.cipher_blk_len) # play safe, 1 extra blk * if not odata: # <<<<<<<<<<<<<< * raise MemoryError * cdef int olen */ __pyx_t_3 = (!(__pyx_v_odata != 0)); if (unlikely(__pyx_t_3)) { /* "borg/crypto/low_level.pyx":282 * cdef unsigned char *odata = PyMem_Malloc(ilen + self.cipher_blk_len) # play safe, 1 extra blk * if not odata: * raise MemoryError # <<<<<<<<<<<<<< * cdef int olen * cdef int offset */ PyErr_NoMemory(); __PYX_ERR(0, 282, __pyx_L1_error) /* "borg/crypto/low_level.pyx":281 * cdef int alen = hlen - aoffset * cdef unsigned char *odata = PyMem_Malloc(ilen + self.cipher_blk_len) # play safe, 1 extra blk * if not odata: # <<<<<<<<<<<<<< * raise MemoryError * cdef int olen */ } /* "borg/crypto/low_level.pyx":286 * cdef int offset * cdef unsigned char mac_buf[32] * assert sizeof(mac_buf) == self.mac_len # <<<<<<<<<<<<<< * cdef Py_buffer idata = ro_buffer(envelope) * try: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = ((sizeof(__pyx_v_mac_buf)) == __pyx_v_self->mac_len); if (unlikely(!__pyx_t_3)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 286, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 286, __pyx_L1_error) #endif /* "borg/crypto/low_level.pyx":287 * cdef unsigned char mac_buf[32] * assert sizeof(mac_buf) == self.mac_len * cdef Py_buffer idata = ro_buffer(envelope) # <<<<<<<<<<<<<< * try: * self.mac_verify( idata.buf+aoffset, alen, */ __pyx_t_4 = __pyx_f_4borg_6crypto_9low_level_ro_buffer(__pyx_v_envelope); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 287, __pyx_L1_error) __pyx_v_idata = __pyx_t_4; /* "borg/crypto/low_level.pyx":288 * assert sizeof(mac_buf) == self.mac_len * cdef Py_buffer idata = ro_buffer(envelope) * try: # <<<<<<<<<<<<<< * self.mac_verify( idata.buf+aoffset, alen, * idata.buf+hlen+self.mac_len, ilen-hlen-self.mac_len, */ /*try:*/ { /* "borg/crypto/low_level.pyx":289 * cdef Py_buffer idata = ro_buffer(envelope) * try: * self.mac_verify( idata.buf+aoffset, alen, # <<<<<<<<<<<<<< * idata.buf+hlen+self.mac_len, ilen-hlen-self.mac_len, * mac_buf, idata.buf+hlen) */ __pyx_t_5 = ((struct __pyx_vtabstruct_4borg_6crypto_9low_level_AES256_CTR_BASE *)__pyx_v_self->__pyx_vtab)->mac_verify(__pyx_v_self, (((unsigned char const *)__pyx_v_idata.buf) + __pyx_v_aoffset), __pyx_v_alen, ((((unsigned char const *)__pyx_v_idata.buf) + __pyx_v_hlen) + __pyx_v_self->mac_len), ((__pyx_v_ilen - __pyx_v_hlen) - __pyx_v_self->mac_len), __pyx_v_mac_buf, (((unsigned char const *)__pyx_v_idata.buf) + __pyx_v_hlen)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 289, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/crypto/low_level.pyx":292 * idata.buf+hlen+self.mac_len, ilen-hlen-self.mac_len, * mac_buf, idata.buf+hlen) * iv = self.fetch_iv( idata.buf+hlen+self.mac_len) # <<<<<<<<<<<<<< * self.set_iv(iv) * if not EVP_DecryptInit_ex(self.ctx, EVP_aes_256_ctr(), NULL, self.enc_key, iv): */ __pyx_t_5 = ((struct __pyx_vtabstruct_4borg_6crypto_9low_level_AES256_CTR_BASE *)__pyx_v_self->__pyx_vtab)->fetch_iv(__pyx_v_self, ((((unsigned char *)__pyx_v_idata.buf) + __pyx_v_hlen) + __pyx_v_self->mac_len)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 292, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_iv = __pyx_t_5; __pyx_t_5 = 0; /* "borg/crypto/low_level.pyx":293 * mac_buf, idata.buf+hlen) * iv = self.fetch_iv( idata.buf+hlen+self.mac_len) * self.set_iv(iv) # <<<<<<<<<<<<<< * if not EVP_DecryptInit_ex(self.ctx, EVP_aes_256_ctr(), NULL, self.enc_key, iv): * raise CryptoError('EVP_DecryptInit_ex failed') */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_iv); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 293, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_2 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_2 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_iv}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_2, 1+__pyx_t_2); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 293, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/crypto/low_level.pyx":294 * iv = self.fetch_iv( idata.buf+hlen+self.mac_len) * self.set_iv(iv) * if not EVP_DecryptInit_ex(self.ctx, EVP_aes_256_ctr(), NULL, self.enc_key, iv): # <<<<<<<<<<<<<< * raise CryptoError('EVP_DecryptInit_ex failed') * offset = 0 */ __pyx_t_8 = __Pyx_PyObject_AsUString(__pyx_v_iv); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 294, __pyx_L5_error) __pyx_t_3 = (!(EVP_DecryptInit_ex(__pyx_v_self->ctx, EVP_aes_256_ctr(), NULL, __pyx_v_self->enc_key, __pyx_t_8) != 0)); if (unlikely(__pyx_t_3)) { /* "borg/crypto/low_level.pyx":295 * self.set_iv(iv) * if not EVP_DecryptInit_ex(self.ctx, EVP_aes_256_ctr(), NULL, self.enc_key, iv): * raise CryptoError('EVP_DecryptInit_ex failed') # <<<<<<<<<<<<<< * offset = 0 * rc = EVP_DecryptUpdate(self.ctx, odata+offset, &olen, */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_CryptoError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 295, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_2 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_2 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_kp_s_EVP_DecryptInit_ex_failed}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_2, 1+__pyx_t_2); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 295, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(0, 295, __pyx_L5_error) /* "borg/crypto/low_level.pyx":294 * iv = self.fetch_iv( idata.buf+hlen+self.mac_len) * self.set_iv(iv) * if not EVP_DecryptInit_ex(self.ctx, EVP_aes_256_ctr(), NULL, self.enc_key, iv): # <<<<<<<<<<<<<< * raise CryptoError('EVP_DecryptInit_ex failed') * offset = 0 */ } /* "borg/crypto/low_level.pyx":296 * if not EVP_DecryptInit_ex(self.ctx, EVP_aes_256_ctr(), NULL, self.enc_key, iv): * raise CryptoError('EVP_DecryptInit_ex failed') * offset = 0 # <<<<<<<<<<<<<< * rc = EVP_DecryptUpdate(self.ctx, odata+offset, &olen, * idata.buf+hlen+self.mac_len+self.iv_len_short, */ __pyx_v_offset = 0; /* "borg/crypto/low_level.pyx":297 * raise CryptoError('EVP_DecryptInit_ex failed') * offset = 0 * rc = EVP_DecryptUpdate(self.ctx, odata+offset, &olen, # <<<<<<<<<<<<<< * idata.buf+hlen+self.mac_len+self.iv_len_short, * ilen-hlen-self.mac_len-self.iv_len_short) */ __pyx_v_rc = EVP_DecryptUpdate(__pyx_v_self->ctx, (__pyx_v_odata + __pyx_v_offset), (&__pyx_v_olen), (((((unsigned char const *)__pyx_v_idata.buf) + __pyx_v_hlen) + __pyx_v_self->mac_len) + __pyx_v_self->iv_len_short), (((__pyx_v_ilen - __pyx_v_hlen) - __pyx_v_self->mac_len) - __pyx_v_self->iv_len_short)); /* "borg/crypto/low_level.pyx":300 * idata.buf+hlen+self.mac_len+self.iv_len_short, * ilen-hlen-self.mac_len-self.iv_len_short) * if not rc: # <<<<<<<<<<<<<< * raise CryptoError('EVP_DecryptUpdate failed') * offset += olen */ __pyx_t_3 = (!(__pyx_v_rc != 0)); if (unlikely(__pyx_t_3)) { /* "borg/crypto/low_level.pyx":301 * ilen-hlen-self.mac_len-self.iv_len_short) * if not rc: * raise CryptoError('EVP_DecryptUpdate failed') # <<<<<<<<<<<<<< * offset += olen * rc = EVP_DecryptFinal_ex(self.ctx, odata+offset, &olen) */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_CryptoError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 301, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_2 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_2 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_kp_s_EVP_DecryptUpdate_failed}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_2, 1+__pyx_t_2); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 301, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(0, 301, __pyx_L5_error) /* "borg/crypto/low_level.pyx":300 * idata.buf+hlen+self.mac_len+self.iv_len_short, * ilen-hlen-self.mac_len-self.iv_len_short) * if not rc: # <<<<<<<<<<<<<< * raise CryptoError('EVP_DecryptUpdate failed') * offset += olen */ } /* "borg/crypto/low_level.pyx":302 * if not rc: * raise CryptoError('EVP_DecryptUpdate failed') * offset += olen # <<<<<<<<<<<<<< * rc = EVP_DecryptFinal_ex(self.ctx, odata+offset, &olen) * if rc <= 0: */ __pyx_v_offset = (__pyx_v_offset + __pyx_v_olen); /* "borg/crypto/low_level.pyx":303 * raise CryptoError('EVP_DecryptUpdate failed') * offset += olen * rc = EVP_DecryptFinal_ex(self.ctx, odata+offset, &olen) # <<<<<<<<<<<<<< * if rc <= 0: * raise CryptoError('EVP_DecryptFinal_ex failed') */ __pyx_v_rc = EVP_DecryptFinal_ex(__pyx_v_self->ctx, (__pyx_v_odata + __pyx_v_offset), (&__pyx_v_olen)); /* "borg/crypto/low_level.pyx":304 * offset += olen * rc = EVP_DecryptFinal_ex(self.ctx, odata+offset, &olen) * if rc <= 0: # <<<<<<<<<<<<<< * raise CryptoError('EVP_DecryptFinal_ex failed') * offset += olen */ __pyx_t_3 = (__pyx_v_rc <= 0); if (unlikely(__pyx_t_3)) { /* "borg/crypto/low_level.pyx":305 * rc = EVP_DecryptFinal_ex(self.ctx, odata+offset, &olen) * if rc <= 0: * raise CryptoError('EVP_DecryptFinal_ex failed') # <<<<<<<<<<<<<< * offset += olen * self.blocks += self.block_count(offset) */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_CryptoError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 305, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_2 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_2 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_kp_s_EVP_DecryptFinal_ex_failed}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_2, 1+__pyx_t_2); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 305, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(0, 305, __pyx_L5_error) /* "borg/crypto/low_level.pyx":304 * offset += olen * rc = EVP_DecryptFinal_ex(self.ctx, odata+offset, &olen) * if rc <= 0: # <<<<<<<<<<<<<< * raise CryptoError('EVP_DecryptFinal_ex failed') * offset += olen */ } /* "borg/crypto/low_level.pyx":306 * if rc <= 0: * raise CryptoError('EVP_DecryptFinal_ex failed') * offset += olen # <<<<<<<<<<<<<< * self.blocks += self.block_count(offset) * return odata[:offset] */ __pyx_v_offset = (__pyx_v_offset + __pyx_v_olen); /* "borg/crypto/low_level.pyx":307 * raise CryptoError('EVP_DecryptFinal_ex failed') * offset += olen * self.blocks += self.block_count(offset) # <<<<<<<<<<<<<< * return odata[:offset] * finally: */ __pyx_t_5 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_self->blocks); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 307, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_block_count); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 307, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_offset); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 307, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = NULL; __pyx_t_2 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_2 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_9}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_2, 1+__pyx_t_2); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 307, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 307, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_11 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_7); if (unlikely((__pyx_t_11 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 307, __pyx_L5_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_self->blocks = __pyx_t_11; /* "borg/crypto/low_level.pyx":308 * offset += olen * self.blocks += self.block_count(offset) * return odata[:offset] # <<<<<<<<<<<<<< * finally: * PyMem_Free(odata) */ __Pyx_XDECREF(__pyx_r); __pyx_t_7 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v_odata) + 0, __pyx_v_offset - 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 308, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L4_return; } /* "borg/crypto/low_level.pyx":310 * return odata[:offset] * finally: * PyMem_Free(odata) # <<<<<<<<<<<<<< * PyBuffer_Release(&idata) * */ /*finally:*/ { __pyx_L5_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __pyx_t_2 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename; { PyMem_Free(__pyx_v_odata); /* "borg/crypto/low_level.pyx":311 * finally: * PyMem_Free(odata) * PyBuffer_Release(&idata) # <<<<<<<<<<<<<< * * def block_count(self, length): */ PyBuffer_Release((&__pyx_v_idata)); } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19); } __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ErrRestore(__pyx_t_14, __pyx_t_15, __pyx_t_16); __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_lineno = __pyx_t_2; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13; goto __pyx_L1_error; } __pyx_L4_return: { __pyx_t_19 = __pyx_r; __pyx_r = 0; /* "borg/crypto/low_level.pyx":310 * return odata[:offset] * finally: * PyMem_Free(odata) # <<<<<<<<<<<<<< * PyBuffer_Release(&idata) * */ PyMem_Free(__pyx_v_odata); /* "borg/crypto/low_level.pyx":311 * finally: * PyMem_Free(odata) * PyBuffer_Release(&idata) # <<<<<<<<<<<<<< * * def block_count(self, length): */ PyBuffer_Release((&__pyx_v_idata)); __pyx_r = __pyx_t_19; __pyx_t_19 = 0; goto __pyx_L0; } } /* "borg/crypto/low_level.pyx":271 * PyBuffer_Release(&idata) * * def decrypt(self, envelope): # <<<<<<<<<<<<<< * """ * authenticate aad + iv + cdata, decrypt cdata, ignore header bytes up to aad_offset. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("borg.crypto.low_level.AES256_CTR_BASE.decrypt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_iv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/crypto/low_level.pyx":313 * PyBuffer_Release(&idata) * * def block_count(self, length): # <<<<<<<<<<<<<< * return num_cipher_blocks(length, self.cipher_blk_len) * */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_13block_count(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_6crypto_9low_level_15AES256_CTR_BASE_13block_count = {"block_count", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_13block_count, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_13block_count(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_length = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("block_count (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_length,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_length)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 313, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "block_count") < 0)) __PYX_ERR(0, 313, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_length = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("block_count", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 313, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.crypto.low_level.AES256_CTR_BASE.block_count", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_6crypto_9low_level_15AES256_CTR_BASE_12block_count(((struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *)__pyx_v_self), __pyx_v_length); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_6crypto_9low_level_15AES256_CTR_BASE_12block_count(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *__pyx_v_self, PyObject *__pyx_v_length) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("block_count", 1); /* "borg/crypto/low_level.pyx":314 * * def block_count(self, length): * return num_cipher_blocks(length, self.cipher_blk_len) # <<<<<<<<<<<<<< * * def set_iv(self, iv): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_num_cipher_blocks); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->cipher_blk_len); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_length, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/crypto/low_level.pyx":313 * PyBuffer_Release(&idata) * * def block_count(self, length): # <<<<<<<<<<<<<< * return num_cipher_blocks(length, self.cipher_blk_len) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("borg.crypto.low_level.AES256_CTR_BASE.block_count", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/crypto/low_level.pyx":316 * return num_cipher_blocks(length, self.cipher_blk_len) * * def set_iv(self, iv): # <<<<<<<<<<<<<< * # set_iv needs to be called before each encrypt() call * if isinstance(iv, int): */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_15set_iv(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_6crypto_9low_level_15AES256_CTR_BASE_15set_iv = {"set_iv", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_15set_iv, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_15set_iv(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_iv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_iv (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iv,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iv)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 316, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_iv") < 0)) __PYX_ERR(0, 316, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_iv = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_iv", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 316, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.crypto.low_level.AES256_CTR_BASE.set_iv", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_6crypto_9low_level_15AES256_CTR_BASE_14set_iv(((struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *)__pyx_v_self), __pyx_v_iv); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_6crypto_9low_level_15AES256_CTR_BASE_14set_iv(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *__pyx_v_self, PyObject *__pyx_v_iv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; Py_ssize_t __pyx_t_7; unsigned char __pyx_t_8[16]; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_iv", 0); __Pyx_INCREF(__pyx_v_iv); /* "borg/crypto/low_level.pyx":318 * def set_iv(self, iv): * # set_iv needs to be called before each encrypt() call * if isinstance(iv, int): # <<<<<<<<<<<<<< * iv = iv.to_bytes(self.iv_len, byteorder='big') * assert isinstance(iv, bytes) and len(iv) == self.iv_len */ __pyx_t_1 = PyInt_Check(__pyx_v_iv); if (__pyx_t_1) { /* "borg/crypto/low_level.pyx":319 * # set_iv needs to be called before each encrypt() call * if isinstance(iv, int): * iv = iv.to_bytes(self.iv_len, byteorder='big') # <<<<<<<<<<<<<< * assert isinstance(iv, bytes) and len(iv) == self.iv_len * self.iv = iv */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_iv, __pyx_n_s_to_bytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->iv_len); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_byteorder, __pyx_n_s_big) < 0) __PYX_ERR(0, 319, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_iv, __pyx_t_5); __pyx_t_5 = 0; /* "borg/crypto/low_level.pyx":318 * def set_iv(self, iv): * # set_iv needs to be called before each encrypt() call * if isinstance(iv, int): # <<<<<<<<<<<<<< * iv = iv.to_bytes(self.iv_len, byteorder='big') * assert isinstance(iv, bytes) and len(iv) == self.iv_len */ } /* "borg/crypto/low_level.pyx":320 * if isinstance(iv, int): * iv = iv.to_bytes(self.iv_len, byteorder='big') * assert isinstance(iv, bytes) and len(iv) == self.iv_len # <<<<<<<<<<<<<< * self.iv = iv * self.blocks = 0 # how many AES blocks got encrypted with this IV? */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_6 = PyBytes_Check(__pyx_v_iv); if (__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; goto __pyx_L4_bool_binop_done; } __pyx_t_7 = PyObject_Length(__pyx_v_iv); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 320, __pyx_L1_error) __pyx_t_6 = (__pyx_t_7 == __pyx_v_self->iv_len); __pyx_t_1 = __pyx_t_6; __pyx_L4_bool_binop_done:; if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 320, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 320, __pyx_L1_error) #endif /* "borg/crypto/low_level.pyx":321 * iv = iv.to_bytes(self.iv_len, byteorder='big') * assert isinstance(iv, bytes) and len(iv) == self.iv_len * self.iv = iv # <<<<<<<<<<<<<< * self.blocks = 0 # how many AES blocks got encrypted with this IV? * */ if (unlikely((__Pyx_carray_from_py_unsigned_char(__pyx_v_iv, __pyx_t_8, 16) < 0))) __PYX_ERR(0, 321, __pyx_L1_error) memcpy(&(__pyx_v_self->iv[0]), __pyx_t_8, sizeof(__pyx_v_self->iv[0]) * (16)); /* "borg/crypto/low_level.pyx":322 * assert isinstance(iv, bytes) and len(iv) == self.iv_len * self.iv = iv * self.blocks = 0 # how many AES blocks got encrypted with this IV? # <<<<<<<<<<<<<< * * def next_iv(self): */ __pyx_v_self->blocks = 0; /* "borg/crypto/low_level.pyx":316 * return num_cipher_blocks(length, self.cipher_blk_len) * * def set_iv(self, iv): # <<<<<<<<<<<<<< * # set_iv needs to be called before each encrypt() call * if isinstance(iv, int): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("borg.crypto.low_level.AES256_CTR_BASE.set_iv", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_iv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/crypto/low_level.pyx":324 * self.blocks = 0 # how many AES blocks got encrypted with this IV? * * def next_iv(self): # <<<<<<<<<<<<<< * # call this after encrypt() to get the next iv (int) for the next encrypt() call * iv = int.from_bytes(self.iv[:self.iv_len], byteorder='big') */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_17next_iv(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_6crypto_9low_level_15AES256_CTR_BASE_17next_iv = {"next_iv", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_17next_iv, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_17next_iv(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("next_iv (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("next_iv", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "next_iv", 0))) return NULL; __pyx_r = __pyx_pf_4borg_6crypto_9low_level_15AES256_CTR_BASE_16next_iv(((struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_6crypto_9low_level_15AES256_CTR_BASE_16next_iv(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *__pyx_v_self) { PyObject *__pyx_v_iv = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("next_iv", 1); /* "borg/crypto/low_level.pyx":326 * def next_iv(self): * # call this after encrypt() to get the next iv (int) for the next encrypt() call * iv = int.from_bytes(self.iv[:self.iv_len], byteorder='big') # <<<<<<<<<<<<<< * return iv + self.blocks * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyInt_Type)), __pyx_n_s_from_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v_self->iv) + 0, __pyx_v_self->iv_len - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 326, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_byteorder, __pyx_n_s_big) < 0) __PYX_ERR(0, 326, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_iv = __pyx_t_4; __pyx_t_4 = 0; /* "borg/crypto/low_level.pyx":327 * # call this after encrypt() to get the next iv (int) for the next encrypt() call * iv = int.from_bytes(self.iv[:self.iv_len], byteorder='big') * return iv + self.blocks # <<<<<<<<<<<<<< * * cdef fetch_iv(self, unsigned char * iv_in): */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_self->blocks); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = PyNumber_Add(__pyx_v_iv, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "borg/crypto/low_level.pyx":324 * self.blocks = 0 # how many AES blocks got encrypted with this IV? * * def next_iv(self): # <<<<<<<<<<<<<< * # call this after encrypt() to get the next iv (int) for the next encrypt() call * iv = int.from_bytes(self.iv[:self.iv_len], byteorder='big') */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("borg.crypto.low_level.AES256_CTR_BASE.next_iv", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_iv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/crypto/low_level.pyx":329 * return iv + self.blocks * * cdef fetch_iv(self, unsigned char * iv_in): # <<<<<<<<<<<<<< * # fetch lower self.iv_len_short bytes of iv and add upper zero bytes * return b'\0' * (self.iv_len - self.iv_len_short) + iv_in[0:self.iv_len_short] */ static PyObject *__pyx_f_4borg_6crypto_9low_level_15AES256_CTR_BASE_fetch_iv(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *__pyx_v_self, unsigned char *__pyx_v_iv_in) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fetch_iv", 1); /* "borg/crypto/low_level.pyx":331 * cdef fetch_iv(self, unsigned char * iv_in): * # fetch lower self.iv_len_short bytes of iv and add upper zero bytes * return b'\0' * (self.iv_len - self.iv_len_short) + iv_in[0:self.iv_len_short] # <<<<<<<<<<<<<< * * cdef store_iv(self, unsigned char * iv_out, unsigned char * iv): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PySequence_Multiply(__pyx_kp_b__2, (__pyx_v_self->iv_len - __pyx_v_self->iv_len_short)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v_iv_in) + 0, __pyx_v_self->iv_len_short - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "borg/crypto/low_level.pyx":329 * return iv + self.blocks * * cdef fetch_iv(self, unsigned char * iv_in): # <<<<<<<<<<<<<< * # fetch lower self.iv_len_short bytes of iv and add upper zero bytes * return b'\0' * (self.iv_len - self.iv_len_short) + iv_in[0:self.iv_len_short] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("borg.crypto.low_level.AES256_CTR_BASE.fetch_iv", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/crypto/low_level.pyx":333 * return b'\0' * (self.iv_len - self.iv_len_short) + iv_in[0:self.iv_len_short] * * cdef store_iv(self, unsigned char * iv_out, unsigned char * iv): # <<<<<<<<<<<<<< * # store only lower self.iv_len_short bytes, upper bytes are assumed to be 0 * cdef int i */ static PyObject *__pyx_f_4borg_6crypto_9low_level_15AES256_CTR_BASE_store_iv(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *__pyx_v_self, unsigned char *__pyx_v_iv_out, unsigned char *__pyx_v_iv) { int __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; __Pyx_RefNannySetupContext("store_iv", 1); /* "borg/crypto/low_level.pyx":336 * # store only lower self.iv_len_short bytes, upper bytes are assumed to be 0 * cdef int i * for i in range(self.iv_len_short): # <<<<<<<<<<<<<< * iv_out[i] = iv[(self.iv_len-self.iv_len_short)+i] * */ __pyx_t_1 = __pyx_v_self->iv_len_short; __pyx_t_2 = __pyx_t_1; for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; /* "borg/crypto/low_level.pyx":337 * cdef int i * for i in range(self.iv_len_short): * iv_out[i] = iv[(self.iv_len-self.iv_len_short)+i] # <<<<<<<<<<<<<< * * def extract_iv(self, envelope): */ (__pyx_v_iv_out[__pyx_v_i]) = (__pyx_v_iv[((__pyx_v_self->iv_len - __pyx_v_self->iv_len_short) + __pyx_v_i)]); } /* "borg/crypto/low_level.pyx":333 * return b'\0' * (self.iv_len - self.iv_len_short) + iv_in[0:self.iv_len_short] * * cdef store_iv(self, unsigned char * iv_out, unsigned char * iv): # <<<<<<<<<<<<<< * # store only lower self.iv_len_short bytes, upper bytes are assumed to be 0 * cdef int i */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/crypto/low_level.pyx":339 * iv_out[i] = iv[(self.iv_len-self.iv_len_short)+i] * * def extract_iv(self, envelope): # <<<<<<<<<<<<<< * offset = self.header_len + self.mac_len * return bytes_to_long(envelope[offset:offset+self.iv_len_short]) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_19extract_iv(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_6crypto_9low_level_15AES256_CTR_BASE_19extract_iv = {"extract_iv", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_19extract_iv, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_19extract_iv(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_envelope = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("extract_iv (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_envelope,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_envelope)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "extract_iv") < 0)) __PYX_ERR(0, 339, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_envelope = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("extract_iv", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 339, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.crypto.low_level.AES256_CTR_BASE.extract_iv", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_6crypto_9low_level_15AES256_CTR_BASE_18extract_iv(((struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *)__pyx_v_self), __pyx_v_envelope); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_6crypto_9low_level_15AES256_CTR_BASE_18extract_iv(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *__pyx_v_self, PyObject *__pyx_v_envelope) { PyObject *__pyx_v_offset = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("extract_iv", 1); /* "borg/crypto/low_level.pyx":340 * * def extract_iv(self, envelope): * offset = self.header_len + self.mac_len # <<<<<<<<<<<<<< * return bytes_to_long(envelope[offset:offset+self.iv_len_short]) * */ __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_self->header_len + __pyx_v_self->mac_len)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_offset = __pyx_t_1; __pyx_t_1 = 0; /* "borg/crypto/low_level.pyx":341 * def extract_iv(self, envelope): * offset = self.header_len + self.mac_len * return bytes_to_long(envelope[offset:offset+self.iv_len_short]) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_bytes_to_long); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->iv_len_short); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyNumber_Add(__pyx_v_offset, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_envelope, 0, 0, &__pyx_v_offset, &__pyx_t_4, NULL, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/crypto/low_level.pyx":339 * iv_out[i] = iv[(self.iv_len-self.iv_len_short)+i] * * def extract_iv(self, envelope): # <<<<<<<<<<<<<< * offset = self.header_len + self.mac_len * return bytes_to_long(envelope[offset:offset+self.iv_len_short]) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("borg.crypto.low_level.AES256_CTR_BASE.extract_iv", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_offset); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_21__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_6crypto_9low_level_15AES256_CTR_BASE_21__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_21__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_21__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_4borg_6crypto_9low_level_15AES256_CTR_BASE_20__reduce_cython__(((struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_6crypto_9low_level_15AES256_CTR_BASE_20__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.crypto.low_level.AES256_CTR_BASE.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_23__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_6crypto_9low_level_15AES256_CTR_BASE_23__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_23__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_23__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.crypto.low_level.AES256_CTR_BASE.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_6crypto_9low_level_15AES256_CTR_BASE_22__setstate_cython__(((struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_6crypto_9low_level_15AES256_CTR_BASE_22__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.crypto.low_level.AES256_CTR_BASE.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/crypto/low_level.pyx":347 * cdef unsigned char mac_key[32] * * def __init__(self, mac_key, enc_key, iv=None, header_len=1, aad_offset=1): # <<<<<<<<<<<<<< * assert isinstance(mac_key, bytes) and len(mac_key) == 32 * self.mac_key = mac_key */ /* Python wrapper */ static int __pyx_pw_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_mac_key = 0; PyObject *__pyx_v_enc_key = 0; PyObject *__pyx_v_iv = 0; PyObject *__pyx_v_header_len = 0; PyObject *__pyx_v_aad_offset = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mac_key,&__pyx_n_s_enc_key,&__pyx_n_s_iv,&__pyx_n_s_header_len,&__pyx_n_s_aad_offset,0}; values[2] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None)); values[3] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_int_1)); values[4] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_int_1)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mac_key)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 347, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_enc_key)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 347, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, 1); __PYX_ERR(0, 347, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iv); if (value) { values[2] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 347, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_header_len); if (value) { values[3] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 347, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_aad_offset); if (value) { values[4] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 347, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 347, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_mac_key = values[0]; __pyx_v_enc_key = values[1]; __pyx_v_iv = values[2]; __pyx_v_header_len = values[3]; __pyx_v_aad_offset = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, __pyx_nargs); __PYX_ERR(0, 347, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.crypto.low_level.AES256_CTR_HMAC_SHA256.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256___init__(((struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256 *)__pyx_v_self), __pyx_v_mac_key, __pyx_v_enc_key, __pyx_v_iv, __pyx_v_header_len, __pyx_v_aad_offset); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256___init__(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256 *__pyx_v_self, PyObject *__pyx_v_mac_key, PyObject *__pyx_v_enc_key, PyObject *__pyx_v_iv, PyObject *__pyx_v_header_len, PyObject *__pyx_v_aad_offset) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; Py_ssize_t __pyx_t_3; unsigned char __pyx_t_4[32]; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "borg/crypto/low_level.pyx":348 * * def __init__(self, mac_key, enc_key, iv=None, header_len=1, aad_offset=1): * assert isinstance(mac_key, bytes) and len(mac_key) == 32 # <<<<<<<<<<<<<< * self.mac_key = mac_key * super().__init__(mac_key, enc_key, iv=iv, header_len=header_len, aad_offset=aad_offset) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_2 = PyBytes_Check(__pyx_v_mac_key); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L3_bool_binop_done; } __pyx_t_3 = PyObject_Length(__pyx_v_mac_key); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 348, __pyx_L1_error) __pyx_t_2 = (__pyx_t_3 == 32); __pyx_t_1 = __pyx_t_2; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 348, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 348, __pyx_L1_error) #endif /* "borg/crypto/low_level.pyx":349 * def __init__(self, mac_key, enc_key, iv=None, header_len=1, aad_offset=1): * assert isinstance(mac_key, bytes) and len(mac_key) == 32 * self.mac_key = mac_key # <<<<<<<<<<<<<< * super().__init__(mac_key, enc_key, iv=iv, header_len=header_len, aad_offset=aad_offset) * */ if (unlikely((__Pyx_carray_from_py_unsigned_char(__pyx_v_mac_key, __pyx_t_4, 32) < 0))) __PYX_ERR(0, 349, __pyx_L1_error) memcpy(&(__pyx_v_self->mac_key[0]), __pyx_t_4, sizeof(__pyx_v_self->mac_key[0]) * (32)); /* "borg/crypto/low_level.pyx":350 * assert isinstance(mac_key, bytes) and len(mac_key) == 32 * self.mac_key = mac_key * super().__init__(mac_key, enc_key, iv=iv, header_len=header_len, aad_offset=aad_offset) # <<<<<<<<<<<<<< * * def __cinit__(self, mac_key, enc_key, iv=None, header_len=1, aad_offset=1): */ __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF((PyObject *)__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256); __Pyx_GIVEREF((PyObject *)__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256))) __PYX_ERR(0, 350, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_v_self); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_self))) __PYX_ERR(0, 350, __pyx_L1_error); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_init); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_mac_key); __Pyx_GIVEREF(__pyx_v_mac_key); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_mac_key)) __PYX_ERR(0, 350, __pyx_L1_error); __Pyx_INCREF(__pyx_v_enc_key); __Pyx_GIVEREF(__pyx_v_enc_key); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_enc_key)) __PYX_ERR(0, 350, __pyx_L1_error); __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_iv, __pyx_v_iv) < 0) __PYX_ERR(0, 350, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_header_len, __pyx_v_header_len) < 0) __PYX_ERR(0, 350, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_aad_offset, __pyx_v_aad_offset) < 0) __PYX_ERR(0, 350, __pyx_L1_error) __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "borg/crypto/low_level.pyx":347 * cdef unsigned char mac_key[32] * * def __init__(self, mac_key, enc_key, iv=None, header_len=1, aad_offset=1): # <<<<<<<<<<<<<< * assert isinstance(mac_key, bytes) and len(mac_key) == 32 * self.mac_key = mac_key */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("borg.crypto.low_level.AES256_CTR_HMAC_SHA256.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/crypto/low_level.pyx":352 * super().__init__(mac_key, enc_key, iv=iv, header_len=header_len, aad_offset=aad_offset) * * def __cinit__(self, mac_key, enc_key, iv=None, header_len=1, aad_offset=1): # <<<<<<<<<<<<<< * pass * */ /* Python wrapper */ static int __pyx_pw_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_mac_key = 0; CYTHON_UNUSED PyObject *__pyx_v_enc_key = 0; CYTHON_UNUSED PyObject *__pyx_v_iv = 0; CYTHON_UNUSED PyObject *__pyx_v_header_len = 0; CYTHON_UNUSED PyObject *__pyx_v_aad_offset = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mac_key,&__pyx_n_s_enc_key,&__pyx_n_s_iv,&__pyx_n_s_header_len,&__pyx_n_s_aad_offset,0}; values[2] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None)); values[3] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_int_1)); values[4] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_int_1)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mac_key)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 352, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_enc_key)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 352, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 5, 1); __PYX_ERR(0, 352, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iv); if (value) { values[2] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 352, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_header_len); if (value) { values[3] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 352, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_aad_offset); if (value) { values[4] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 352, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(0, 352, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_mac_key = values[0]; __pyx_v_enc_key = values[1]; __pyx_v_iv = values[2]; __pyx_v_header_len = values[3]; __pyx_v_aad_offset = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 5, __pyx_nargs); __PYX_ERR(0, 352, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.crypto.low_level.AES256_CTR_HMAC_SHA256.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256_2__cinit__(((struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256 *)__pyx_v_self), __pyx_v_mac_key, __pyx_v_enc_key, __pyx_v_iv, __pyx_v_header_len, __pyx_v_aad_offset); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256_2__cinit__(CYTHON_UNUSED struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256 *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_mac_key, CYTHON_UNUSED PyObject *__pyx_v_enc_key, CYTHON_UNUSED PyObject *__pyx_v_iv, CYTHON_UNUSED PyObject *__pyx_v_header_len, CYTHON_UNUSED PyObject *__pyx_v_aad_offset) { int __pyx_r; /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "borg/crypto/low_level.pyx":355 * pass * * def __dealloc__(self): # <<<<<<<<<<<<<< * pass * */ /* Python wrapper */ static void __pyx_pw_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256_5__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256_5__dealloc__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256_4__dealloc__(((struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256 *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256_4__dealloc__(CYTHON_UNUSED struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256 *__pyx_v_self) { /* function exit code */ } /* "borg/crypto/low_level.pyx":358 * pass * * cdef mac_compute(self, const unsigned char *data1, int data1_len, # <<<<<<<<<<<<<< * const unsigned char *data2, int data2_len, * unsigned char *mac_buf): */ static PyObject *__pyx_f_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256_mac_compute(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256 *__pyx_v_self, unsigned char const *__pyx_v_data1, int __pyx_v_data1_len, unsigned char const *__pyx_v_data2, int __pyx_v_data2_len, unsigned char *__pyx_v_mac_buf) { PyObject *__pyx_v_data = NULL; PyObject *__pyx_v_mac = NULL; int __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; unsigned char __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mac_compute", 1); /* "borg/crypto/low_level.pyx":361 * const unsigned char *data2, int data2_len, * unsigned char *mac_buf): * data = data1[:data1_len] + data2[:data2_len] # <<<<<<<<<<<<<< * mac = hmac.digest(self.mac_key[:self.mac_len], data, 'sha256') * for i in range(self.mac_len): */ __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v_data1) + 0, __pyx_v_data1_len - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v_data2) + 0, __pyx_v_data2_len - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_data = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "borg/crypto/low_level.pyx":362 * unsigned char *mac_buf): * data = data1[:data1_len] + data2[:data2_len] * mac = hmac.digest(self.mac_key[:self.mac_len], data, 'sha256') # <<<<<<<<<<<<<< * for i in range(self.mac_len): * mac_buf[i] = mac[i] */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_hmac); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_digest); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v_self->mac_key) + 0, __pyx_v_self->__pyx_base.mac_len - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_t_2, __pyx_v_data, __pyx_n_s_sha256}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_v_mac = __pyx_t_3; __pyx_t_3 = 0; /* "borg/crypto/low_level.pyx":363 * data = data1[:data1_len] + data2[:data2_len] * mac = hmac.digest(self.mac_key[:self.mac_len], data, 'sha256') * for i in range(self.mac_len): # <<<<<<<<<<<<<< * mac_buf[i] = mac[i] * */ __pyx_t_5 = __pyx_v_self->__pyx_base.mac_len; __pyx_t_6 = __pyx_t_5; for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; /* "borg/crypto/low_level.pyx":364 * mac = hmac.digest(self.mac_key[:self.mac_len], data, 'sha256') * for i in range(self.mac_len): * mac_buf[i] = mac[i] # <<<<<<<<<<<<<< * * cdef mac_verify(self, const unsigned char *data1, int data1_len, */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_mac, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyInt_As_unsigned_char(__pyx_t_3); if (unlikely((__pyx_t_8 == (unsigned char)-1) && PyErr_Occurred())) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_mac_buf[__pyx_v_i]) = __pyx_t_8; } /* "borg/crypto/low_level.pyx":358 * pass * * cdef mac_compute(self, const unsigned char *data1, int data1_len, # <<<<<<<<<<<<<< * const unsigned char *data2, int data2_len, * unsigned char *mac_buf): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("borg.crypto.low_level.AES256_CTR_HMAC_SHA256.mac_compute", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_data); __Pyx_XDECREF(__pyx_v_mac); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/crypto/low_level.pyx":366 * mac_buf[i] = mac[i] * * cdef mac_verify(self, const unsigned char *data1, int data1_len, # <<<<<<<<<<<<<< * const unsigned char *data2, int data2_len, * unsigned char *mac_buf, const unsigned char *mac_wanted): */ static PyObject *__pyx_f_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256_mac_verify(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256 *__pyx_v_self, unsigned char const *__pyx_v_data1, int __pyx_v_data1_len, unsigned char const *__pyx_v_data2, int __pyx_v_data2_len, unsigned char *__pyx_v_mac_buf, unsigned char const *__pyx_v_mac_wanted) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mac_verify", 1); /* "borg/crypto/low_level.pyx":369 * const unsigned char *data2, int data2_len, * unsigned char *mac_buf, const unsigned char *mac_wanted): * self.mac_compute(data1, data1_len, data2, data2_len, mac_buf) # <<<<<<<<<<<<<< * if CRYPTO_memcmp(mac_buf, mac_wanted, self.mac_len): * raise IntegrityError('MAC Authentication failed') */ __pyx_t_1 = ((struct __pyx_vtabstruct_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256 *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.mac_compute(((struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *)__pyx_v_self), __pyx_v_data1, __pyx_v_data1_len, __pyx_v_data2, __pyx_v_data2_len, __pyx_v_mac_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/crypto/low_level.pyx":370 * unsigned char *mac_buf, const unsigned char *mac_wanted): * self.mac_compute(data1, data1_len, data2, data2_len, mac_buf) * if CRYPTO_memcmp(mac_buf, mac_wanted, self.mac_len): # <<<<<<<<<<<<<< * raise IntegrityError('MAC Authentication failed') * */ __pyx_t_2 = (CRYPTO_memcmp(__pyx_v_mac_buf, __pyx_v_mac_wanted, __pyx_v_self->__pyx_base.mac_len) != 0); if (unlikely(__pyx_t_2)) { /* "borg/crypto/low_level.pyx":371 * self.mac_compute(data1, data1_len, data2, data2_len, mac_buf) * if CRYPTO_memcmp(mac_buf, mac_wanted, self.mac_len): * raise IntegrityError('MAC Authentication failed') # <<<<<<<<<<<<<< * * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_IntegrityError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_MAC_Authentication_failed}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 371, __pyx_L1_error) /* "borg/crypto/low_level.pyx":370 * unsigned char *mac_buf, const unsigned char *mac_wanted): * self.mac_compute(data1, data1_len, data2, data2_len, mac_buf) * if CRYPTO_memcmp(mac_buf, mac_wanted, self.mac_len): # <<<<<<<<<<<<<< * raise IntegrityError('MAC Authentication failed') * */ } /* "borg/crypto/low_level.pyx":366 * mac_buf[i] = mac[i] * * cdef mac_verify(self, const unsigned char *data1, int data1_len, # <<<<<<<<<<<<<< * const unsigned char *data2, int data2_len, * unsigned char *mac_buf, const unsigned char *mac_wanted): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("borg.crypto.low_level.AES256_CTR_HMAC_SHA256.mac_verify", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256_7__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256_7__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256_6__reduce_cython__(((struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256 *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256 *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.crypto.low_level.AES256_CTR_HMAC_SHA256.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256_9__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256_9__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.crypto.low_level.AES256_CTR_HMAC_SHA256.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256_8__setstate_cython__(((struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256 *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256 *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.crypto.low_level.AES256_CTR_HMAC_SHA256.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/crypto/low_level.pyx":377 * cdef unsigned char mac_key[128] * * def __init__(self, mac_key, enc_key, iv=None, header_len=1, aad_offset=1): # <<<<<<<<<<<<<< * assert isinstance(mac_key, bytes) and len(mac_key) == 128 * self.mac_key = mac_key */ /* Python wrapper */ static int __pyx_pw_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_mac_key = 0; PyObject *__pyx_v_enc_key = 0; PyObject *__pyx_v_iv = 0; PyObject *__pyx_v_header_len = 0; PyObject *__pyx_v_aad_offset = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mac_key,&__pyx_n_s_enc_key,&__pyx_n_s_iv,&__pyx_n_s_header_len,&__pyx_n_s_aad_offset,0}; values[2] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None)); values[3] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_int_1)); values[4] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_int_1)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mac_key)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 377, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_enc_key)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 377, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, 1); __PYX_ERR(0, 377, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iv); if (value) { values[2] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 377, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_header_len); if (value) { values[3] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 377, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_aad_offset); if (value) { values[4] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 377, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 377, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_mac_key = values[0]; __pyx_v_enc_key = values[1]; __pyx_v_iv = values[2]; __pyx_v_header_len = values[3]; __pyx_v_aad_offset = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, __pyx_nargs); __PYX_ERR(0, 377, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.crypto.low_level.AES256_CTR_BLAKE2b.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b___init__(((struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b *)__pyx_v_self), __pyx_v_mac_key, __pyx_v_enc_key, __pyx_v_iv, __pyx_v_header_len, __pyx_v_aad_offset); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b___init__(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b *__pyx_v_self, PyObject *__pyx_v_mac_key, PyObject *__pyx_v_enc_key, PyObject *__pyx_v_iv, PyObject *__pyx_v_header_len, PyObject *__pyx_v_aad_offset) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; Py_ssize_t __pyx_t_3; unsigned char __pyx_t_4[0x80]; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "borg/crypto/low_level.pyx":378 * * def __init__(self, mac_key, enc_key, iv=None, header_len=1, aad_offset=1): * assert isinstance(mac_key, bytes) and len(mac_key) == 128 # <<<<<<<<<<<<<< * self.mac_key = mac_key * super().__init__(mac_key, enc_key, iv=iv, header_len=header_len, aad_offset=aad_offset) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_2 = PyBytes_Check(__pyx_v_mac_key); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L3_bool_binop_done; } __pyx_t_3 = PyObject_Length(__pyx_v_mac_key); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 378, __pyx_L1_error) __pyx_t_2 = (__pyx_t_3 == 0x80); __pyx_t_1 = __pyx_t_2; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 378, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 378, __pyx_L1_error) #endif /* "borg/crypto/low_level.pyx":379 * def __init__(self, mac_key, enc_key, iv=None, header_len=1, aad_offset=1): * assert isinstance(mac_key, bytes) and len(mac_key) == 128 * self.mac_key = mac_key # <<<<<<<<<<<<<< * super().__init__(mac_key, enc_key, iv=iv, header_len=header_len, aad_offset=aad_offset) * */ if (unlikely((__Pyx_carray_from_py_unsigned_char(__pyx_v_mac_key, __pyx_t_4, 0x80) < 0))) __PYX_ERR(0, 379, __pyx_L1_error) if (unlikely((0x80) != (0x80))) { PyErr_Format(PyExc_ValueError, "Assignment to slice of wrong length, expected %" CYTHON_FORMAT_SSIZE_T "d, got %" CYTHON_FORMAT_SSIZE_T "d", (Py_ssize_t)(0x80), (Py_ssize_t)(0x80)); __PYX_ERR(0, 379, __pyx_L1_error) } memcpy(&(__pyx_v_self->mac_key[0]), __pyx_t_4, sizeof(__pyx_v_self->mac_key[0]) * (0x80)); /* "borg/crypto/low_level.pyx":380 * assert isinstance(mac_key, bytes) and len(mac_key) == 128 * self.mac_key = mac_key * super().__init__(mac_key, enc_key, iv=iv, header_len=header_len, aad_offset=aad_offset) # <<<<<<<<<<<<<< * * def __cinit__(self, mac_key, enc_key, iv=None, header_len=1, aad_offset=1): */ __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF((PyObject *)__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b); __Pyx_GIVEREF((PyObject *)__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b))) __PYX_ERR(0, 380, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_v_self); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_self))) __PYX_ERR(0, 380, __pyx_L1_error); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_init); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_mac_key); __Pyx_GIVEREF(__pyx_v_mac_key); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_mac_key)) __PYX_ERR(0, 380, __pyx_L1_error); __Pyx_INCREF(__pyx_v_enc_key); __Pyx_GIVEREF(__pyx_v_enc_key); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_enc_key)) __PYX_ERR(0, 380, __pyx_L1_error); __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_iv, __pyx_v_iv) < 0) __PYX_ERR(0, 380, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_header_len, __pyx_v_header_len) < 0) __PYX_ERR(0, 380, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_aad_offset, __pyx_v_aad_offset) < 0) __PYX_ERR(0, 380, __pyx_L1_error) __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "borg/crypto/low_level.pyx":377 * cdef unsigned char mac_key[128] * * def __init__(self, mac_key, enc_key, iv=None, header_len=1, aad_offset=1): # <<<<<<<<<<<<<< * assert isinstance(mac_key, bytes) and len(mac_key) == 128 * self.mac_key = mac_key */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("borg.crypto.low_level.AES256_CTR_BLAKE2b.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/crypto/low_level.pyx":382 * super().__init__(mac_key, enc_key, iv=iv, header_len=header_len, aad_offset=aad_offset) * * def __cinit__(self, mac_key, enc_key, iv=None, header_len=1, aad_offset=1): # <<<<<<<<<<<<<< * pass * */ /* Python wrapper */ static int __pyx_pw_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_mac_key = 0; CYTHON_UNUSED PyObject *__pyx_v_enc_key = 0; CYTHON_UNUSED PyObject *__pyx_v_iv = 0; CYTHON_UNUSED PyObject *__pyx_v_header_len = 0; CYTHON_UNUSED PyObject *__pyx_v_aad_offset = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mac_key,&__pyx_n_s_enc_key,&__pyx_n_s_iv,&__pyx_n_s_header_len,&__pyx_n_s_aad_offset,0}; values[2] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None)); values[3] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_int_1)); values[4] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_int_1)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mac_key)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 382, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_enc_key)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 382, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 5, 1); __PYX_ERR(0, 382, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iv); if (value) { values[2] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 382, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_header_len); if (value) { values[3] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 382, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_aad_offset); if (value) { values[4] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 382, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(0, 382, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_mac_key = values[0]; __pyx_v_enc_key = values[1]; __pyx_v_iv = values[2]; __pyx_v_header_len = values[3]; __pyx_v_aad_offset = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 5, __pyx_nargs); __PYX_ERR(0, 382, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.crypto.low_level.AES256_CTR_BLAKE2b.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b_2__cinit__(((struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b *)__pyx_v_self), __pyx_v_mac_key, __pyx_v_enc_key, __pyx_v_iv, __pyx_v_header_len, __pyx_v_aad_offset); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b_2__cinit__(CYTHON_UNUSED struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_mac_key, CYTHON_UNUSED PyObject *__pyx_v_enc_key, CYTHON_UNUSED PyObject *__pyx_v_iv, CYTHON_UNUSED PyObject *__pyx_v_header_len, CYTHON_UNUSED PyObject *__pyx_v_aad_offset) { int __pyx_r; /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "borg/crypto/low_level.pyx":385 * pass * * def __dealloc__(self): # <<<<<<<<<<<<<< * pass * */ /* Python wrapper */ static void __pyx_pw_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b_5__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b_5__dealloc__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b_4__dealloc__(((struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b_4__dealloc__(CYTHON_UNUSED struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b *__pyx_v_self) { /* function exit code */ } /* "borg/crypto/low_level.pyx":388 * pass * * cdef mac_compute(self, const unsigned char *data1, int data1_len, # <<<<<<<<<<<<<< * const unsigned char *data2, int data2_len, * unsigned char *mac_buf): */ static PyObject *__pyx_f_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b_mac_compute(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b *__pyx_v_self, unsigned char const *__pyx_v_data1, int __pyx_v_data1_len, unsigned char const *__pyx_v_data2, int __pyx_v_data2_len, unsigned char *__pyx_v_mac_buf) { PyObject *__pyx_v_data = NULL; PyObject *__pyx_v_mac = NULL; int __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; unsigned char __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mac_compute", 1); /* "borg/crypto/low_level.pyx":391 * const unsigned char *data2, int data2_len, * unsigned char *mac_buf): * data = self.mac_key[:128] + data1[:data1_len] + data2[:data2_len] # <<<<<<<<<<<<<< * mac = hashlib.blake2b(data, digest_size=self.mac_len).digest() * for i in range(self.mac_len): */ __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v_self->mac_key) + 0, 0x80 - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v_data1) + 0, __pyx_v_data1_len - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v_data2) + 0, __pyx_v_data2_len - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_data = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "borg/crypto/low_level.pyx":392 * unsigned char *mac_buf): * data = self.mac_key[:128] + data1[:data1_len] + data2[:data2_len] * mac = hashlib.blake2b(data, digest_size=self.mac_len).digest() # <<<<<<<<<<<<<< * for i in range(self.mac_len): * mac_buf[i] = mac[i] */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_hashlib); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_blake2b); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_data); __Pyx_GIVEREF(__pyx_v_data); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_data)) __PYX_ERR(0, 392, __pyx_L1_error); __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.mac_len); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_digest_size, __pyx_t_5) < 0) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_digest); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_mac = __pyx_t_1; __pyx_t_1 = 0; /* "borg/crypto/low_level.pyx":393 * data = self.mac_key[:128] + data1[:data1_len] + data2[:data2_len] * mac = hashlib.blake2b(data, digest_size=self.mac_len).digest() * for i in range(self.mac_len): # <<<<<<<<<<<<<< * mac_buf[i] = mac[i] * */ __pyx_t_6 = __pyx_v_self->__pyx_base.mac_len; __pyx_t_7 = __pyx_t_6; for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; /* "borg/crypto/low_level.pyx":394 * mac = hashlib.blake2b(data, digest_size=self.mac_len).digest() * for i in range(self.mac_len): * mac_buf[i] = mac[i] # <<<<<<<<<<<<<< * * cdef mac_verify(self, const unsigned char *data1, int data1_len, */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_mac, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = __Pyx_PyInt_As_unsigned_char(__pyx_t_1); if (unlikely((__pyx_t_9 == (unsigned char)-1) && PyErr_Occurred())) __PYX_ERR(0, 394, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (__pyx_v_mac_buf[__pyx_v_i]) = __pyx_t_9; } /* "borg/crypto/low_level.pyx":388 * pass * * cdef mac_compute(self, const unsigned char *data1, int data1_len, # <<<<<<<<<<<<<< * const unsigned char *data2, int data2_len, * unsigned char *mac_buf): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("borg.crypto.low_level.AES256_CTR_BLAKE2b.mac_compute", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_data); __Pyx_XDECREF(__pyx_v_mac); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/crypto/low_level.pyx":396 * mac_buf[i] = mac[i] * * cdef mac_verify(self, const unsigned char *data1, int data1_len, # <<<<<<<<<<<<<< * const unsigned char *data2, int data2_len, * unsigned char *mac_buf, const unsigned char *mac_wanted): */ static PyObject *__pyx_f_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b_mac_verify(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b *__pyx_v_self, unsigned char const *__pyx_v_data1, int __pyx_v_data1_len, unsigned char const *__pyx_v_data2, int __pyx_v_data2_len, unsigned char *__pyx_v_mac_buf, unsigned char const *__pyx_v_mac_wanted) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mac_verify", 1); /* "borg/crypto/low_level.pyx":399 * const unsigned char *data2, int data2_len, * unsigned char *mac_buf, const unsigned char *mac_wanted): * self.mac_compute(data1, data1_len, data2, data2_len, mac_buf) # <<<<<<<<<<<<<< * if CRYPTO_memcmp(mac_buf, mac_wanted, self.mac_len): * raise IntegrityError('MAC Authentication failed') */ __pyx_t_1 = ((struct __pyx_vtabstruct_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.mac_compute(((struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *)__pyx_v_self), __pyx_v_data1, __pyx_v_data1_len, __pyx_v_data2, __pyx_v_data2_len, __pyx_v_mac_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/crypto/low_level.pyx":400 * unsigned char *mac_buf, const unsigned char *mac_wanted): * self.mac_compute(data1, data1_len, data2, data2_len, mac_buf) * if CRYPTO_memcmp(mac_buf, mac_wanted, self.mac_len): # <<<<<<<<<<<<<< * raise IntegrityError('MAC Authentication failed') * */ __pyx_t_2 = (CRYPTO_memcmp(__pyx_v_mac_buf, __pyx_v_mac_wanted, __pyx_v_self->__pyx_base.mac_len) != 0); if (unlikely(__pyx_t_2)) { /* "borg/crypto/low_level.pyx":401 * self.mac_compute(data1, data1_len, data2, data2_len, mac_buf) * if CRYPTO_memcmp(mac_buf, mac_wanted, self.mac_len): * raise IntegrityError('MAC Authentication failed') # <<<<<<<<<<<<<< * * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_IntegrityError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_MAC_Authentication_failed}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 401, __pyx_L1_error) /* "borg/crypto/low_level.pyx":400 * unsigned char *mac_buf, const unsigned char *mac_wanted): * self.mac_compute(data1, data1_len, data2, data2_len, mac_buf) * if CRYPTO_memcmp(mac_buf, mac_wanted, self.mac_len): # <<<<<<<<<<<<<< * raise IntegrityError('MAC Authentication failed') * */ } /* "borg/crypto/low_level.pyx":396 * mac_buf[i] = mac[i] * * cdef mac_verify(self, const unsigned char *data1, int data1_len, # <<<<<<<<<<<<<< * const unsigned char *data2, int data2_len, * unsigned char *mac_buf, const unsigned char *mac_wanted): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("borg.crypto.low_level.AES256_CTR_BLAKE2b.mac_verify", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b_7__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b_7__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b_6__reduce_cython__(((struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.crypto.low_level.AES256_CTR_BLAKE2b.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b_9__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b_9__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.crypto.low_level.AES256_CTR_BLAKE2b.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b_8__setstate_cython__(((struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.crypto.low_level.AES256_CTR_BLAKE2b.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/crypto/low_level.pyx":417 * cdef long long blocks * * def __init__(self, enc_key, iv=None): # <<<<<<<<<<<<<< * assert isinstance(enc_key, bytes) and len(enc_key) == 32 * self.enc_key = enc_key */ /* Python wrapper */ static int __pyx_pw_4borg_6crypto_9low_level_3AES_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_4borg_6crypto_9low_level_3AES_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_enc_key = 0; PyObject *__pyx_v_iv = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_enc_key,&__pyx_n_s_iv,0}; values[1] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_enc_key)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 417, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iv); if (value) { values[1] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 417, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 417, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_enc_key = values[0]; __pyx_v_iv = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 417, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.crypto.low_level.AES.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_6crypto_9low_level_3AES___init__(((struct __pyx_obj_4borg_6crypto_9low_level_AES *)__pyx_v_self), __pyx_v_enc_key, __pyx_v_iv); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_4borg_6crypto_9low_level_3AES___init__(struct __pyx_obj_4borg_6crypto_9low_level_AES *__pyx_v_self, PyObject *__pyx_v_enc_key, PyObject *__pyx_v_iv) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; Py_ssize_t __pyx_t_3; unsigned char __pyx_t_4[32]; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "borg/crypto/low_level.pyx":418 * * def __init__(self, enc_key, iv=None): * assert isinstance(enc_key, bytes) and len(enc_key) == 32 # <<<<<<<<<<<<<< * self.enc_key = enc_key * self.iv_len = 16 */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_2 = PyBytes_Check(__pyx_v_enc_key); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L3_bool_binop_done; } __pyx_t_3 = PyObject_Length(__pyx_v_enc_key); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 418, __pyx_L1_error) __pyx_t_2 = (__pyx_t_3 == 32); __pyx_t_1 = __pyx_t_2; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 418, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 418, __pyx_L1_error) #endif /* "borg/crypto/low_level.pyx":419 * def __init__(self, enc_key, iv=None): * assert isinstance(enc_key, bytes) and len(enc_key) == 32 * self.enc_key = enc_key # <<<<<<<<<<<<<< * self.iv_len = 16 * assert sizeof(self.iv) == self.iv_len */ if (unlikely((__Pyx_carray_from_py_unsigned_char(__pyx_v_enc_key, __pyx_t_4, 32) < 0))) __PYX_ERR(0, 419, __pyx_L1_error) memcpy(&(__pyx_v_self->enc_key[0]), __pyx_t_4, sizeof(__pyx_v_self->enc_key[0]) * (32)); /* "borg/crypto/low_level.pyx":420 * assert isinstance(enc_key, bytes) and len(enc_key) == 32 * self.enc_key = enc_key * self.iv_len = 16 # <<<<<<<<<<<<<< * assert sizeof(self.iv) == self.iv_len * self.cipher = EVP_aes_256_ctr */ __pyx_v_self->iv_len = 16; /* "borg/crypto/low_level.pyx":421 * self.enc_key = enc_key * self.iv_len = 16 * assert sizeof(self.iv) == self.iv_len # <<<<<<<<<<<<<< * self.cipher = EVP_aes_256_ctr * self.cipher_blk_len = 16 */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = ((sizeof(__pyx_v_self->iv)) == __pyx_v_self->iv_len); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 421, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 421, __pyx_L1_error) #endif /* "borg/crypto/low_level.pyx":422 * self.iv_len = 16 * assert sizeof(self.iv) == self.iv_len * self.cipher = EVP_aes_256_ctr # <<<<<<<<<<<<<< * self.cipher_blk_len = 16 * if iv is not None: */ __pyx_v_self->cipher = EVP_aes_256_ctr; /* "borg/crypto/low_level.pyx":423 * assert sizeof(self.iv) == self.iv_len * self.cipher = EVP_aes_256_ctr * self.cipher_blk_len = 16 # <<<<<<<<<<<<<< * if iv is not None: * self.set_iv(iv) */ __pyx_v_self->cipher_blk_len = 16; /* "borg/crypto/low_level.pyx":424 * self.cipher = EVP_aes_256_ctr * self.cipher_blk_len = 16 * if iv is not None: # <<<<<<<<<<<<<< * self.set_iv(iv) * else: */ __pyx_t_1 = (__pyx_v_iv != Py_None); if (__pyx_t_1) { /* "borg/crypto/low_level.pyx":425 * self.cipher_blk_len = 16 * if iv is not None: * self.set_iv(iv) # <<<<<<<<<<<<<< * else: * self.blocks = -1 # make sure set_iv is called before encrypt */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_iv); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_iv}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/crypto/low_level.pyx":424 * self.cipher = EVP_aes_256_ctr * self.cipher_blk_len = 16 * if iv is not None: # <<<<<<<<<<<<<< * self.set_iv(iv) * else: */ goto __pyx_L5; } /* "borg/crypto/low_level.pyx":427 * self.set_iv(iv) * else: * self.blocks = -1 # make sure set_iv is called before encrypt # <<<<<<<<<<<<<< * * def __cinit__(self, enc_key, iv=None): */ /*else*/ { __pyx_v_self->blocks = -1LL; } __pyx_L5:; /* "borg/crypto/low_level.pyx":417 * cdef long long blocks * * def __init__(self, enc_key, iv=None): # <<<<<<<<<<<<<< * assert isinstance(enc_key, bytes) and len(enc_key) == 32 * self.enc_key = enc_key */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("borg.crypto.low_level.AES.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/crypto/low_level.pyx":429 * self.blocks = -1 # make sure set_iv is called before encrypt * * def __cinit__(self, enc_key, iv=None): # <<<<<<<<<<<<<< * self.ctx = EVP_CIPHER_CTX_new() * */ /* Python wrapper */ static int __pyx_pw_4borg_6crypto_9low_level_3AES_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_4borg_6crypto_9low_level_3AES_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_enc_key = 0; CYTHON_UNUSED PyObject *__pyx_v_iv = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_enc_key,&__pyx_n_s_iv,0}; values[1] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_enc_key)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iv); if (value) { values[1] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(0, 429, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_enc_key = values[0]; __pyx_v_iv = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 429, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.crypto.low_level.AES.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_6crypto_9low_level_3AES_2__cinit__(((struct __pyx_obj_4borg_6crypto_9low_level_AES *)__pyx_v_self), __pyx_v_enc_key, __pyx_v_iv); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_4borg_6crypto_9low_level_3AES_2__cinit__(struct __pyx_obj_4borg_6crypto_9low_level_AES *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_enc_key, CYTHON_UNUSED PyObject *__pyx_v_iv) { int __pyx_r; /* "borg/crypto/low_level.pyx":430 * * def __cinit__(self, enc_key, iv=None): * self.ctx = EVP_CIPHER_CTX_new() # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_v_self->ctx = EVP_CIPHER_CTX_new(); /* "borg/crypto/low_level.pyx":429 * self.blocks = -1 # make sure set_iv is called before encrypt * * def __cinit__(self, enc_key, iv=None): # <<<<<<<<<<<<<< * self.ctx = EVP_CIPHER_CTX_new() * */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "borg/crypto/low_level.pyx":432 * self.ctx = EVP_CIPHER_CTX_new() * * def __dealloc__(self): # <<<<<<<<<<<<<< * EVP_CIPHER_CTX_free(self.ctx) * */ /* Python wrapper */ static void __pyx_pw_4borg_6crypto_9low_level_3AES_5__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_4borg_6crypto_9low_level_3AES_5__dealloc__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_4borg_6crypto_9low_level_3AES_4__dealloc__(((struct __pyx_obj_4borg_6crypto_9low_level_AES *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_4borg_6crypto_9low_level_3AES_4__dealloc__(struct __pyx_obj_4borg_6crypto_9low_level_AES *__pyx_v_self) { /* "borg/crypto/low_level.pyx":433 * * def __dealloc__(self): * EVP_CIPHER_CTX_free(self.ctx) # <<<<<<<<<<<<<< * * def encrypt(self, data, iv=None): */ EVP_CIPHER_CTX_free(__pyx_v_self->ctx); /* "borg/crypto/low_level.pyx":432 * self.ctx = EVP_CIPHER_CTX_new() * * def __dealloc__(self): # <<<<<<<<<<<<<< * EVP_CIPHER_CTX_free(self.ctx) * */ /* function exit code */ } /* "borg/crypto/low_level.pyx":435 * EVP_CIPHER_CTX_free(self.ctx) * * def encrypt(self, data, iv=None): # <<<<<<<<<<<<<< * if iv is not None: * self.set_iv(iv) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_6crypto_9low_level_3AES_7encrypt(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_6crypto_9low_level_3AES_7encrypt = {"encrypt", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_3AES_7encrypt, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_6crypto_9low_level_3AES_7encrypt(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_data = 0; PyObject *__pyx_v_iv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("encrypt (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_iv,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 435, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iv); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 435, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "encrypt") < 0)) __PYX_ERR(0, 435, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_data = values[0]; __pyx_v_iv = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("encrypt", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 435, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.crypto.low_level.AES.encrypt", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_6crypto_9low_level_3AES_6encrypt(((struct __pyx_obj_4borg_6crypto_9low_level_AES *)__pyx_v_self), __pyx_v_data, __pyx_v_iv); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_6crypto_9low_level_3AES_6encrypt(struct __pyx_obj_4borg_6crypto_9low_level_AES *__pyx_v_self, PyObject *__pyx_v_data, PyObject *__pyx_v_iv) { Py_buffer __pyx_v_idata; int __pyx_v_ilen; int __pyx_v_offset; int __pyx_v_olen; unsigned char *__pyx_v_odata; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; Py_buffer __pyx_t_6; Py_ssize_t __pyx_t_7; EVP_CIPHER const *__pyx_t_8; PyObject *__pyx_t_9 = NULL; PY_LONG_LONG __pyx_t_10; int __pyx_t_11; char const *__pyx_t_12; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("encrypt", 1); /* "borg/crypto/low_level.pyx":436 * * def encrypt(self, data, iv=None): * if iv is not None: # <<<<<<<<<<<<<< * self.set_iv(iv) * assert self.blocks == 0, 'iv needs to be set before encrypt is called' */ __pyx_t_1 = (__pyx_v_iv != Py_None); if (__pyx_t_1) { /* "borg/crypto/low_level.pyx":437 * def encrypt(self, data, iv=None): * if iv is not None: * self.set_iv(iv) # <<<<<<<<<<<<<< * assert self.blocks == 0, 'iv needs to be set before encrypt is called' * cdef Py_buffer idata = ro_buffer(data) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_iv); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_iv}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/crypto/low_level.pyx":436 * * def encrypt(self, data, iv=None): * if iv is not None: # <<<<<<<<<<<<<< * self.set_iv(iv) * assert self.blocks == 0, 'iv needs to be set before encrypt is called' */ } /* "borg/crypto/low_level.pyx":438 * if iv is not None: * self.set_iv(iv) * assert self.blocks == 0, 'iv needs to be set before encrypt is called' # <<<<<<<<<<<<<< * cdef Py_buffer idata = ro_buffer(data) * cdef int ilen = len(data) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = (__pyx_v_self->blocks == 0); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_kp_s_iv_needs_to_be_set_before_encryp, 0, 0); __PYX_ERR(0, 438, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 438, __pyx_L1_error) #endif /* "borg/crypto/low_level.pyx":439 * self.set_iv(iv) * assert self.blocks == 0, 'iv needs to be set before encrypt is called' * cdef Py_buffer idata = ro_buffer(data) # <<<<<<<<<<<<<< * cdef int ilen = len(data) * cdef int offset */ __pyx_t_6 = __pyx_f_4borg_6crypto_9low_level_ro_buffer(__pyx_v_data); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 439, __pyx_L1_error) __pyx_v_idata = __pyx_t_6; /* "borg/crypto/low_level.pyx":440 * assert self.blocks == 0, 'iv needs to be set before encrypt is called' * cdef Py_buffer idata = ro_buffer(data) * cdef int ilen = len(data) # <<<<<<<<<<<<<< * cdef int offset * cdef int olen = 0 */ __pyx_t_7 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 440, __pyx_L1_error) __pyx_v_ilen = __pyx_t_7; /* "borg/crypto/low_level.pyx":442 * cdef int ilen = len(data) * cdef int offset * cdef int olen = 0 # <<<<<<<<<<<<<< * cdef unsigned char *odata = PyMem_Malloc(ilen + self.cipher_blk_len) * if not odata: */ __pyx_v_olen = 0; /* "borg/crypto/low_level.pyx":443 * cdef int offset * cdef int olen = 0 * cdef unsigned char *odata = PyMem_Malloc(ilen + self.cipher_blk_len) # <<<<<<<<<<<<<< * if not odata: * raise MemoryError */ __pyx_v_odata = ((unsigned char *)PyMem_Malloc((__pyx_v_ilen + __pyx_v_self->cipher_blk_len))); /* "borg/crypto/low_level.pyx":444 * cdef int olen = 0 * cdef unsigned char *odata = PyMem_Malloc(ilen + self.cipher_blk_len) * if not odata: # <<<<<<<<<<<<<< * raise MemoryError * try: */ __pyx_t_1 = (!(__pyx_v_odata != 0)); if (unlikely(__pyx_t_1)) { /* "borg/crypto/low_level.pyx":445 * cdef unsigned char *odata = PyMem_Malloc(ilen + self.cipher_blk_len) * if not odata: * raise MemoryError # <<<<<<<<<<<<<< * try: * if not EVP_EncryptInit_ex(self.ctx, self.cipher(), NULL, self.enc_key, self.iv): */ PyErr_NoMemory(); __PYX_ERR(0, 445, __pyx_L1_error) /* "borg/crypto/low_level.pyx":444 * cdef int olen = 0 * cdef unsigned char *odata = PyMem_Malloc(ilen + self.cipher_blk_len) * if not odata: # <<<<<<<<<<<<<< * raise MemoryError * try: */ } /* "borg/crypto/low_level.pyx":446 * if not odata: * raise MemoryError * try: # <<<<<<<<<<<<<< * if not EVP_EncryptInit_ex(self.ctx, self.cipher(), NULL, self.enc_key, self.iv): * raise Exception('EVP_EncryptInit_ex failed') */ /*try:*/ { /* "borg/crypto/low_level.pyx":447 * raise MemoryError * try: * if not EVP_EncryptInit_ex(self.ctx, self.cipher(), NULL, self.enc_key, self.iv): # <<<<<<<<<<<<<< * raise Exception('EVP_EncryptInit_ex failed') * offset = 0 */ __pyx_t_8 = __pyx_v_self->cipher(); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 447, __pyx_L6_error) __pyx_t_1 = (!(EVP_EncryptInit_ex(__pyx_v_self->ctx, __pyx_t_8, NULL, __pyx_v_self->enc_key, __pyx_v_self->iv) != 0)); if (unlikely(__pyx_t_1)) { /* "borg/crypto/low_level.pyx":448 * try: * if not EVP_EncryptInit_ex(self.ctx, self.cipher(), NULL, self.enc_key, self.iv): * raise Exception('EVP_EncryptInit_ex failed') # <<<<<<<<<<<<<< * offset = 0 * if not EVP_EncryptUpdate(self.ctx, odata, &olen, idata.buf, ilen): */ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 448, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 448, __pyx_L6_error) /* "borg/crypto/low_level.pyx":447 * raise MemoryError * try: * if not EVP_EncryptInit_ex(self.ctx, self.cipher(), NULL, self.enc_key, self.iv): # <<<<<<<<<<<<<< * raise Exception('EVP_EncryptInit_ex failed') * offset = 0 */ } /* "borg/crypto/low_level.pyx":449 * if not EVP_EncryptInit_ex(self.ctx, self.cipher(), NULL, self.enc_key, self.iv): * raise Exception('EVP_EncryptInit_ex failed') * offset = 0 # <<<<<<<<<<<<<< * if not EVP_EncryptUpdate(self.ctx, odata, &olen, idata.buf, ilen): * raise Exception('EVP_EncryptUpdate failed') */ __pyx_v_offset = 0; /* "borg/crypto/low_level.pyx":450 * raise Exception('EVP_EncryptInit_ex failed') * offset = 0 * if not EVP_EncryptUpdate(self.ctx, odata, &olen, idata.buf, ilen): # <<<<<<<<<<<<<< * raise Exception('EVP_EncryptUpdate failed') * offset += olen */ __pyx_t_1 = (!(EVP_EncryptUpdate(__pyx_v_self->ctx, __pyx_v_odata, (&__pyx_v_olen), ((unsigned char const *)__pyx_v_idata.buf), __pyx_v_ilen) != 0)); if (unlikely(__pyx_t_1)) { /* "borg/crypto/low_level.pyx":451 * offset = 0 * if not EVP_EncryptUpdate(self.ctx, odata, &olen, idata.buf, ilen): * raise Exception('EVP_EncryptUpdate failed') # <<<<<<<<<<<<<< * offset += olen * if not EVP_EncryptFinal_ex(self.ctx, odata+offset, &olen): */ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 451, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 451, __pyx_L6_error) /* "borg/crypto/low_level.pyx":450 * raise Exception('EVP_EncryptInit_ex failed') * offset = 0 * if not EVP_EncryptUpdate(self.ctx, odata, &olen, idata.buf, ilen): # <<<<<<<<<<<<<< * raise Exception('EVP_EncryptUpdate failed') * offset += olen */ } /* "borg/crypto/low_level.pyx":452 * if not EVP_EncryptUpdate(self.ctx, odata, &olen, idata.buf, ilen): * raise Exception('EVP_EncryptUpdate failed') * offset += olen # <<<<<<<<<<<<<< * if not EVP_EncryptFinal_ex(self.ctx, odata+offset, &olen): * raise Exception('EVP_EncryptFinal failed') */ __pyx_v_offset = (__pyx_v_offset + __pyx_v_olen); /* "borg/crypto/low_level.pyx":453 * raise Exception('EVP_EncryptUpdate failed') * offset += olen * if not EVP_EncryptFinal_ex(self.ctx, odata+offset, &olen): # <<<<<<<<<<<<<< * raise Exception('EVP_EncryptFinal failed') * offset += olen */ __pyx_t_1 = (!(EVP_EncryptFinal_ex(__pyx_v_self->ctx, (__pyx_v_odata + __pyx_v_offset), (&__pyx_v_olen)) != 0)); if (unlikely(__pyx_t_1)) { /* "borg/crypto/low_level.pyx":454 * offset += olen * if not EVP_EncryptFinal_ex(self.ctx, odata+offset, &olen): * raise Exception('EVP_EncryptFinal failed') # <<<<<<<<<<<<<< * offset += olen * self.blocks = self.block_count(offset) */ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 454, __pyx_L6_error) /* "borg/crypto/low_level.pyx":453 * raise Exception('EVP_EncryptUpdate failed') * offset += olen * if not EVP_EncryptFinal_ex(self.ctx, odata+offset, &olen): # <<<<<<<<<<<<<< * raise Exception('EVP_EncryptFinal failed') * offset += olen */ } /* "borg/crypto/low_level.pyx":455 * if not EVP_EncryptFinal_ex(self.ctx, odata+offset, &olen): * raise Exception('EVP_EncryptFinal failed') * offset += olen # <<<<<<<<<<<<<< * self.blocks = self.block_count(offset) * return odata[:offset] */ __pyx_v_offset = (__pyx_v_offset + __pyx_v_olen); /* "borg/crypto/low_level.pyx":456 * raise Exception('EVP_EncryptFinal failed') * offset += olen * self.blocks = self.block_count(offset) # <<<<<<<<<<<<<< * return odata[:offset] * finally: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_block_count); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_offset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 456, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 456, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_10 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_2); if (unlikely((__pyx_t_10 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 456, __pyx_L6_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->blocks = __pyx_t_10; /* "borg/crypto/low_level.pyx":457 * offset += olen * self.blocks = self.block_count(offset) * return odata[:offset] # <<<<<<<<<<<<<< * finally: * PyMem_Free(odata) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v_odata) + 0, __pyx_v_offset - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L5_return; } /* "borg/crypto/low_level.pyx":459 * return odata[:offset] * finally: * PyMem_Free(odata) # <<<<<<<<<<<<<< * PyBuffer_Release(&idata) * */ /*finally:*/ { __pyx_L6_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __pyx_t_5 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename; { PyMem_Free(__pyx_v_odata); /* "borg/crypto/low_level.pyx":460 * finally: * PyMem_Free(odata) * PyBuffer_Release(&idata) # <<<<<<<<<<<<<< * * def decrypt(self, data): */ PyBuffer_Release((&__pyx_v_idata)); } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18); } __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ErrRestore(__pyx_t_13, __pyx_t_14, __pyx_t_15); __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12; goto __pyx_L1_error; } __pyx_L5_return: { __pyx_t_18 = __pyx_r; __pyx_r = 0; /* "borg/crypto/low_level.pyx":459 * return odata[:offset] * finally: * PyMem_Free(odata) # <<<<<<<<<<<<<< * PyBuffer_Release(&idata) * */ PyMem_Free(__pyx_v_odata); /* "borg/crypto/low_level.pyx":460 * finally: * PyMem_Free(odata) * PyBuffer_Release(&idata) # <<<<<<<<<<<<<< * * def decrypt(self, data): */ PyBuffer_Release((&__pyx_v_idata)); __pyx_r = __pyx_t_18; __pyx_t_18 = 0; goto __pyx_L0; } } /* "borg/crypto/low_level.pyx":435 * EVP_CIPHER_CTX_free(self.ctx) * * def encrypt(self, data, iv=None): # <<<<<<<<<<<<<< * if iv is not None: * self.set_iv(iv) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("borg.crypto.low_level.AES.encrypt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/crypto/low_level.pyx":462 * PyBuffer_Release(&idata) * * def decrypt(self, data): # <<<<<<<<<<<<<< * cdef Py_buffer idata = ro_buffer(data) * cdef int ilen = len(data) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_6crypto_9low_level_3AES_9decrypt(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_6crypto_9low_level_3AES_9decrypt = {"decrypt", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_3AES_9decrypt, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_6crypto_9low_level_3AES_9decrypt(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_data = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("decrypt (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "decrypt") < 0)) __PYX_ERR(0, 462, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_data = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("decrypt", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 462, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.crypto.low_level.AES.decrypt", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_6crypto_9low_level_3AES_8decrypt(((struct __pyx_obj_4borg_6crypto_9low_level_AES *)__pyx_v_self), __pyx_v_data); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_6crypto_9low_level_3AES_8decrypt(struct __pyx_obj_4borg_6crypto_9low_level_AES *__pyx_v_self, PyObject *__pyx_v_data) { Py_buffer __pyx_v_idata; int __pyx_v_ilen; int __pyx_v_offset; int __pyx_v_olen; unsigned char *__pyx_v_odata; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_buffer __pyx_t_1; Py_ssize_t __pyx_t_2; int __pyx_t_3; EVP_CIPHER const *__pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; PY_LONG_LONG __pyx_t_10; int __pyx_t_11; char const *__pyx_t_12; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("decrypt", 1); /* "borg/crypto/low_level.pyx":463 * * def decrypt(self, data): * cdef Py_buffer idata = ro_buffer(data) # <<<<<<<<<<<<<< * cdef int ilen = len(data) * cdef int offset */ __pyx_t_1 = __pyx_f_4borg_6crypto_9low_level_ro_buffer(__pyx_v_data); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 463, __pyx_L1_error) __pyx_v_idata = __pyx_t_1; /* "borg/crypto/low_level.pyx":464 * def decrypt(self, data): * cdef Py_buffer idata = ro_buffer(data) * cdef int ilen = len(data) # <<<<<<<<<<<<<< * cdef int offset * cdef int olen = 0 */ __pyx_t_2 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 464, __pyx_L1_error) __pyx_v_ilen = __pyx_t_2; /* "borg/crypto/low_level.pyx":466 * cdef int ilen = len(data) * cdef int offset * cdef int olen = 0 # <<<<<<<<<<<<<< * cdef unsigned char *odata = PyMem_Malloc(ilen + self.cipher_blk_len) * if not odata: */ __pyx_v_olen = 0; /* "borg/crypto/low_level.pyx":467 * cdef int offset * cdef int olen = 0 * cdef unsigned char *odata = PyMem_Malloc(ilen + self.cipher_blk_len) # <<<<<<<<<<<<<< * if not odata: * raise MemoryError */ __pyx_v_odata = ((unsigned char *)PyMem_Malloc((__pyx_v_ilen + __pyx_v_self->cipher_blk_len))); /* "borg/crypto/low_level.pyx":468 * cdef int olen = 0 * cdef unsigned char *odata = PyMem_Malloc(ilen + self.cipher_blk_len) * if not odata: # <<<<<<<<<<<<<< * raise MemoryError * try: */ __pyx_t_3 = (!(__pyx_v_odata != 0)); if (unlikely(__pyx_t_3)) { /* "borg/crypto/low_level.pyx":469 * cdef unsigned char *odata = PyMem_Malloc(ilen + self.cipher_blk_len) * if not odata: * raise MemoryError # <<<<<<<<<<<<<< * try: * # Set cipher type and mode */ PyErr_NoMemory(); __PYX_ERR(0, 469, __pyx_L1_error) /* "borg/crypto/low_level.pyx":468 * cdef int olen = 0 * cdef unsigned char *odata = PyMem_Malloc(ilen + self.cipher_blk_len) * if not odata: # <<<<<<<<<<<<<< * raise MemoryError * try: */ } /* "borg/crypto/low_level.pyx":470 * if not odata: * raise MemoryError * try: # <<<<<<<<<<<<<< * # Set cipher type and mode * if not EVP_DecryptInit_ex(self.ctx, self.cipher(), NULL, self.enc_key, self.iv): */ /*try:*/ { /* "borg/crypto/low_level.pyx":472 * try: * # Set cipher type and mode * if not EVP_DecryptInit_ex(self.ctx, self.cipher(), NULL, self.enc_key, self.iv): # <<<<<<<<<<<<<< * raise Exception('EVP_DecryptInit_ex failed') * offset = 0 */ __pyx_t_4 = __pyx_v_self->cipher(); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 472, __pyx_L5_error) __pyx_t_3 = (!(EVP_DecryptInit_ex(__pyx_v_self->ctx, __pyx_t_4, NULL, __pyx_v_self->enc_key, __pyx_v_self->iv) != 0)); if (unlikely(__pyx_t_3)) { /* "borg/crypto/low_level.pyx":473 * # Set cipher type and mode * if not EVP_DecryptInit_ex(self.ctx, self.cipher(), NULL, self.enc_key, self.iv): * raise Exception('EVP_DecryptInit_ex failed') # <<<<<<<<<<<<<< * offset = 0 * if not EVP_DecryptUpdate(self.ctx, odata, &olen, idata.buf, ilen): */ __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 473, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(0, 473, __pyx_L5_error) /* "borg/crypto/low_level.pyx":472 * try: * # Set cipher type and mode * if not EVP_DecryptInit_ex(self.ctx, self.cipher(), NULL, self.enc_key, self.iv): # <<<<<<<<<<<<<< * raise Exception('EVP_DecryptInit_ex failed') * offset = 0 */ } /* "borg/crypto/low_level.pyx":474 * if not EVP_DecryptInit_ex(self.ctx, self.cipher(), NULL, self.enc_key, self.iv): * raise Exception('EVP_DecryptInit_ex failed') * offset = 0 # <<<<<<<<<<<<<< * if not EVP_DecryptUpdate(self.ctx, odata, &olen, idata.buf, ilen): * raise Exception('EVP_DecryptUpdate failed') */ __pyx_v_offset = 0; /* "borg/crypto/low_level.pyx":475 * raise Exception('EVP_DecryptInit_ex failed') * offset = 0 * if not EVP_DecryptUpdate(self.ctx, odata, &olen, idata.buf, ilen): # <<<<<<<<<<<<<< * raise Exception('EVP_DecryptUpdate failed') * offset += olen */ __pyx_t_3 = (!(EVP_DecryptUpdate(__pyx_v_self->ctx, __pyx_v_odata, (&__pyx_v_olen), ((unsigned char const *)__pyx_v_idata.buf), __pyx_v_ilen) != 0)); if (unlikely(__pyx_t_3)) { /* "borg/crypto/low_level.pyx":476 * offset = 0 * if not EVP_DecryptUpdate(self.ctx, odata, &olen, idata.buf, ilen): * raise Exception('EVP_DecryptUpdate failed') # <<<<<<<<<<<<<< * offset += olen * if EVP_DecryptFinal_ex(self.ctx, odata+offset, &olen) <= 0: */ __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 476, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(0, 476, __pyx_L5_error) /* "borg/crypto/low_level.pyx":475 * raise Exception('EVP_DecryptInit_ex failed') * offset = 0 * if not EVP_DecryptUpdate(self.ctx, odata, &olen, idata.buf, ilen): # <<<<<<<<<<<<<< * raise Exception('EVP_DecryptUpdate failed') * offset += olen */ } /* "borg/crypto/low_level.pyx":477 * if not EVP_DecryptUpdate(self.ctx, odata, &olen, idata.buf, ilen): * raise Exception('EVP_DecryptUpdate failed') * offset += olen # <<<<<<<<<<<<<< * if EVP_DecryptFinal_ex(self.ctx, odata+offset, &olen) <= 0: * # this error check is very important for modes with padding or */ __pyx_v_offset = (__pyx_v_offset + __pyx_v_olen); /* "borg/crypto/low_level.pyx":478 * raise Exception('EVP_DecryptUpdate failed') * offset += olen * if EVP_DecryptFinal_ex(self.ctx, odata+offset, &olen) <= 0: # <<<<<<<<<<<<<< * # this error check is very important for modes with padding or * # authentication. for them, a failure here means corrupted data. */ __pyx_t_3 = (EVP_DecryptFinal_ex(__pyx_v_self->ctx, (__pyx_v_odata + __pyx_v_offset), (&__pyx_v_olen)) <= 0); if (unlikely(__pyx_t_3)) { /* "borg/crypto/low_level.pyx":482 * # authentication. for them, a failure here means corrupted data. * # CTR mode does not use padding nor authentication. * raise Exception('EVP_DecryptFinal failed') # <<<<<<<<<<<<<< * offset += olen * self.blocks = self.block_count(ilen) */ __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 482, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(0, 482, __pyx_L5_error) /* "borg/crypto/low_level.pyx":478 * raise Exception('EVP_DecryptUpdate failed') * offset += olen * if EVP_DecryptFinal_ex(self.ctx, odata+offset, &olen) <= 0: # <<<<<<<<<<<<<< * # this error check is very important for modes with padding or * # authentication. for them, a failure here means corrupted data. */ } /* "borg/crypto/low_level.pyx":483 * # CTR mode does not use padding nor authentication. * raise Exception('EVP_DecryptFinal failed') * offset += olen # <<<<<<<<<<<<<< * self.blocks = self.block_count(ilen) * return odata[:offset] */ __pyx_v_offset = (__pyx_v_offset + __pyx_v_olen); /* "borg/crypto/low_level.pyx":484 * raise Exception('EVP_DecryptFinal failed') * offset += olen * self.blocks = self.block_count(ilen) # <<<<<<<<<<<<<< * return odata[:offset] * finally: */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_block_count); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 484, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_ilen); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 484, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_7}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 484, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_10 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_5); if (unlikely((__pyx_t_10 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 484, __pyx_L5_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_self->blocks = __pyx_t_10; /* "borg/crypto/low_level.pyx":485 * offset += olen * self.blocks = self.block_count(ilen) * return odata[:offset] # <<<<<<<<<<<<<< * finally: * PyMem_Free(odata) */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v_odata) + 0, __pyx_v_offset - 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 485, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L4_return; } /* "borg/crypto/low_level.pyx":487 * return odata[:offset] * finally: * PyMem_Free(odata) # <<<<<<<<<<<<<< * PyBuffer_Release(&idata) * */ /*finally:*/ { __pyx_L5_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __pyx_t_9 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename; { PyMem_Free(__pyx_v_odata); /* "borg/crypto/low_level.pyx":488 * finally: * PyMem_Free(odata) * PyBuffer_Release(&idata) # <<<<<<<<<<<<<< * * def block_count(self, length): */ PyBuffer_Release((&__pyx_v_idata)); } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18); } __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ErrRestore(__pyx_t_13, __pyx_t_14, __pyx_t_15); __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12; goto __pyx_L1_error; } __pyx_L4_return: { __pyx_t_18 = __pyx_r; __pyx_r = 0; /* "borg/crypto/low_level.pyx":487 * return odata[:offset] * finally: * PyMem_Free(odata) # <<<<<<<<<<<<<< * PyBuffer_Release(&idata) * */ PyMem_Free(__pyx_v_odata); /* "borg/crypto/low_level.pyx":488 * finally: * PyMem_Free(odata) * PyBuffer_Release(&idata) # <<<<<<<<<<<<<< * * def block_count(self, length): */ PyBuffer_Release((&__pyx_v_idata)); __pyx_r = __pyx_t_18; __pyx_t_18 = 0; goto __pyx_L0; } } /* "borg/crypto/low_level.pyx":462 * PyBuffer_Release(&idata) * * def decrypt(self, data): # <<<<<<<<<<<<<< * cdef Py_buffer idata = ro_buffer(data) * cdef int ilen = len(data) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("borg.crypto.low_level.AES.decrypt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/crypto/low_level.pyx":490 * PyBuffer_Release(&idata) * * def block_count(self, length): # <<<<<<<<<<<<<< * return num_cipher_blocks(length, self.cipher_blk_len) * */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_6crypto_9low_level_3AES_11block_count(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_6crypto_9low_level_3AES_11block_count = {"block_count", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_3AES_11block_count, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_6crypto_9low_level_3AES_11block_count(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_length = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("block_count (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_length,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_length)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 490, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "block_count") < 0)) __PYX_ERR(0, 490, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_length = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("block_count", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 490, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.crypto.low_level.AES.block_count", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_6crypto_9low_level_3AES_10block_count(((struct __pyx_obj_4borg_6crypto_9low_level_AES *)__pyx_v_self), __pyx_v_length); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_6crypto_9low_level_3AES_10block_count(struct __pyx_obj_4borg_6crypto_9low_level_AES *__pyx_v_self, PyObject *__pyx_v_length) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("block_count", 1); /* "borg/crypto/low_level.pyx":491 * * def block_count(self, length): * return num_cipher_blocks(length, self.cipher_blk_len) # <<<<<<<<<<<<<< * * def set_iv(self, iv): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_num_cipher_blocks); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->cipher_blk_len); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_length, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/crypto/low_level.pyx":490 * PyBuffer_Release(&idata) * * def block_count(self, length): # <<<<<<<<<<<<<< * return num_cipher_blocks(length, self.cipher_blk_len) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("borg.crypto.low_level.AES.block_count", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/crypto/low_level.pyx":493 * return num_cipher_blocks(length, self.cipher_blk_len) * * def set_iv(self, iv): # <<<<<<<<<<<<<< * # set_iv needs to be called before each encrypt() call, * # because encrypt does a full initialisation of the cipher context. */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_6crypto_9low_level_3AES_13set_iv(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_6crypto_9low_level_3AES_13set_iv = {"set_iv", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_3AES_13set_iv, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_6crypto_9low_level_3AES_13set_iv(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_iv = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_iv (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iv,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iv)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 493, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_iv") < 0)) __PYX_ERR(0, 493, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_iv = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_iv", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 493, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.crypto.low_level.AES.set_iv", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_6crypto_9low_level_3AES_12set_iv(((struct __pyx_obj_4borg_6crypto_9low_level_AES *)__pyx_v_self), __pyx_v_iv); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_6crypto_9low_level_3AES_12set_iv(struct __pyx_obj_4borg_6crypto_9low_level_AES *__pyx_v_self, PyObject *__pyx_v_iv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; Py_ssize_t __pyx_t_7; unsigned char __pyx_t_8[16]; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_iv", 0); __Pyx_INCREF(__pyx_v_iv); /* "borg/crypto/low_level.pyx":496 * # set_iv needs to be called before each encrypt() call, * # because encrypt does a full initialisation of the cipher context. * if isinstance(iv, int): # <<<<<<<<<<<<<< * iv = iv.to_bytes(self.iv_len, byteorder='big') * assert isinstance(iv, bytes) and len(iv) == self.iv_len */ __pyx_t_1 = PyInt_Check(__pyx_v_iv); if (__pyx_t_1) { /* "borg/crypto/low_level.pyx":497 * # because encrypt does a full initialisation of the cipher context. * if isinstance(iv, int): * iv = iv.to_bytes(self.iv_len, byteorder='big') # <<<<<<<<<<<<<< * assert isinstance(iv, bytes) and len(iv) == self.iv_len * self.iv = iv */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_iv, __pyx_n_s_to_bytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->iv_len); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 497, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_byteorder, __pyx_n_s_big) < 0) __PYX_ERR(0, 497, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_iv, __pyx_t_5); __pyx_t_5 = 0; /* "borg/crypto/low_level.pyx":496 * # set_iv needs to be called before each encrypt() call, * # because encrypt does a full initialisation of the cipher context. * if isinstance(iv, int): # <<<<<<<<<<<<<< * iv = iv.to_bytes(self.iv_len, byteorder='big') * assert isinstance(iv, bytes) and len(iv) == self.iv_len */ } /* "borg/crypto/low_level.pyx":498 * if isinstance(iv, int): * iv = iv.to_bytes(self.iv_len, byteorder='big') * assert isinstance(iv, bytes) and len(iv) == self.iv_len # <<<<<<<<<<<<<< * self.iv = iv * self.blocks = 0 # number of cipher blocks encrypted with this IV */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_6 = PyBytes_Check(__pyx_v_iv); if (__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; goto __pyx_L4_bool_binop_done; } __pyx_t_7 = PyObject_Length(__pyx_v_iv); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 498, __pyx_L1_error) __pyx_t_6 = (__pyx_t_7 == __pyx_v_self->iv_len); __pyx_t_1 = __pyx_t_6; __pyx_L4_bool_binop_done:; if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 498, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 498, __pyx_L1_error) #endif /* "borg/crypto/low_level.pyx":499 * iv = iv.to_bytes(self.iv_len, byteorder='big') * assert isinstance(iv, bytes) and len(iv) == self.iv_len * self.iv = iv # <<<<<<<<<<<<<< * self.blocks = 0 # number of cipher blocks encrypted with this IV * */ if (unlikely((__Pyx_carray_from_py_unsigned_char(__pyx_v_iv, __pyx_t_8, 16) < 0))) __PYX_ERR(0, 499, __pyx_L1_error) memcpy(&(__pyx_v_self->iv[0]), __pyx_t_8, sizeof(__pyx_v_self->iv[0]) * (16)); /* "borg/crypto/low_level.pyx":500 * assert isinstance(iv, bytes) and len(iv) == self.iv_len * self.iv = iv * self.blocks = 0 # number of cipher blocks encrypted with this IV # <<<<<<<<<<<<<< * * def next_iv(self): */ __pyx_v_self->blocks = 0; /* "borg/crypto/low_level.pyx":493 * return num_cipher_blocks(length, self.cipher_blk_len) * * def set_iv(self, iv): # <<<<<<<<<<<<<< * # set_iv needs to be called before each encrypt() call, * # because encrypt does a full initialisation of the cipher context. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("borg.crypto.low_level.AES.set_iv", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_iv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/crypto/low_level.pyx":502 * self.blocks = 0 # number of cipher blocks encrypted with this IV * * def next_iv(self): # <<<<<<<<<<<<<< * # call this after encrypt() to get the next iv (int) for the next encrypt() call * iv = int.from_bytes(self.iv[:self.iv_len], byteorder='big') */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_6crypto_9low_level_3AES_15next_iv(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_6crypto_9low_level_3AES_15next_iv = {"next_iv", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_3AES_15next_iv, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_6crypto_9low_level_3AES_15next_iv(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("next_iv (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("next_iv", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "next_iv", 0))) return NULL; __pyx_r = __pyx_pf_4borg_6crypto_9low_level_3AES_14next_iv(((struct __pyx_obj_4borg_6crypto_9low_level_AES *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_6crypto_9low_level_3AES_14next_iv(struct __pyx_obj_4borg_6crypto_9low_level_AES *__pyx_v_self) { PyObject *__pyx_v_iv = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("next_iv", 1); /* "borg/crypto/low_level.pyx":504 * def next_iv(self): * # call this after encrypt() to get the next iv (int) for the next encrypt() call * iv = int.from_bytes(self.iv[:self.iv_len], byteorder='big') # <<<<<<<<<<<<<< * return iv + self.blocks * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyInt_Type)), __pyx_n_s_from_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v_self->iv) + 0, __pyx_v_self->iv_len - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 504, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_byteorder, __pyx_n_s_big) < 0) __PYX_ERR(0, 504, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_iv = __pyx_t_4; __pyx_t_4 = 0; /* "borg/crypto/low_level.pyx":505 * # call this after encrypt() to get the next iv (int) for the next encrypt() call * iv = int.from_bytes(self.iv[:self.iv_len], byteorder='big') * return iv + self.blocks # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_self->blocks); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = PyNumber_Add(__pyx_v_iv, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "borg/crypto/low_level.pyx":502 * self.blocks = 0 # number of cipher blocks encrypted with this IV * * def next_iv(self): # <<<<<<<<<<<<<< * # call this after encrypt() to get the next iv (int) for the next encrypt() call * iv = int.from_bytes(self.iv[:self.iv_len], byteorder='big') */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("borg.crypto.low_level.AES.next_iv", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_iv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_6crypto_9low_level_3AES_17__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_6crypto_9low_level_3AES_17__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_3AES_17__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_6crypto_9low_level_3AES_17__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_4borg_6crypto_9low_level_3AES_16__reduce_cython__(((struct __pyx_obj_4borg_6crypto_9low_level_AES *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_6crypto_9low_level_3AES_16__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_6crypto_9low_level_AES *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.crypto.low_level.AES.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_6crypto_9low_level_3AES_19__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_6crypto_9low_level_3AES_19__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_3AES_19__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_6crypto_9low_level_3AES_19__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.crypto.low_level.AES.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_6crypto_9low_level_3AES_18__setstate_cython__(((struct __pyx_obj_4borg_6crypto_9low_level_AES *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_6crypto_9low_level_3AES_18__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_6crypto_9low_level_AES *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.crypto.low_level.AES.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/crypto/low_level.pyx":509 * * * def hmac_sha256(key, data): # <<<<<<<<<<<<<< * return hmac.digest(key, data, 'sha256') * */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_6crypto_9low_level_3hmac_sha256(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_6crypto_9low_level_3hmac_sha256 = {"hmac_sha256", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_3hmac_sha256, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_6crypto_9low_level_3hmac_sha256(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_key = 0; PyObject *__pyx_v_data = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("hmac_sha256 (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_data,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_key)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 509, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 509, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("hmac_sha256", 1, 2, 2, 1); __PYX_ERR(0, 509, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "hmac_sha256") < 0)) __PYX_ERR(0, 509, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_key = values[0]; __pyx_v_data = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("hmac_sha256", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 509, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.crypto.low_level.hmac_sha256", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_6crypto_9low_level_2hmac_sha256(__pyx_self, __pyx_v_key, __pyx_v_data); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_6crypto_9low_level_2hmac_sha256(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_key, PyObject *__pyx_v_data) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("hmac_sha256", 1); /* "borg/crypto/low_level.pyx":510 * * def hmac_sha256(key, data): * return hmac.digest(key, data, 'sha256') # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_hmac); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_digest); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_key, __pyx_v_data, __pyx_n_s_sha256}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 3+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/crypto/low_level.pyx":509 * * * def hmac_sha256(key, data): # <<<<<<<<<<<<<< * return hmac.digest(key, data, 'sha256') * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("borg.crypto.low_level.hmac_sha256", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/crypto/low_level.pyx":513 * * * def blake2b_256(key, data): # <<<<<<<<<<<<<< * return hashlib.blake2b(key+data, digest_size=32).digest() * */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_6crypto_9low_level_5blake2b_256(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_6crypto_9low_level_5blake2b_256 = {"blake2b_256", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_5blake2b_256, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_6crypto_9low_level_5blake2b_256(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_key = 0; PyObject *__pyx_v_data = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("blake2b_256 (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_data,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_key)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 513, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 513, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("blake2b_256", 1, 2, 2, 1); __PYX_ERR(0, 513, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "blake2b_256") < 0)) __PYX_ERR(0, 513, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_key = values[0]; __pyx_v_data = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("blake2b_256", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 513, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.crypto.low_level.blake2b_256", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_6crypto_9low_level_4blake2b_256(__pyx_self, __pyx_v_key, __pyx_v_data); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_6crypto_9low_level_4blake2b_256(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_key, PyObject *__pyx_v_data) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("blake2b_256", 1); /* "borg/crypto/low_level.pyx":514 * * def blake2b_256(key, data): * return hashlib.blake2b(key+data, digest_size=32).digest() # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_hashlib); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_blake2b); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_Add(__pyx_v_key, __pyx_v_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_digest_size, __pyx_int_32) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_digest); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/crypto/low_level.pyx":513 * * * def blake2b_256(key, data): # <<<<<<<<<<<<<< * return hashlib.blake2b(key+data, digest_size=32).digest() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("borg.crypto.low_level.blake2b_256", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/crypto/low_level.pyx":517 * * * def blake2b_128(data): # <<<<<<<<<<<<<< * return hashlib.blake2b(data, digest_size=16).digest() * */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_6crypto_9low_level_7blake2b_128(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_6crypto_9low_level_7blake2b_128 = {"blake2b_128", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_7blake2b_128, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_6crypto_9low_level_7blake2b_128(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_data = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("blake2b_128 (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 517, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "blake2b_128") < 0)) __PYX_ERR(0, 517, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_data = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("blake2b_128", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 517, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.crypto.low_level.blake2b_128", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_6crypto_9low_level_6blake2b_128(__pyx_self, __pyx_v_data); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_6crypto_9low_level_6blake2b_128(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("blake2b_128", 1); /* "borg/crypto/low_level.pyx":518 * * def blake2b_128(data): * return hashlib.blake2b(data, digest_size=16).digest() # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_hashlib); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_blake2b); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_data); __Pyx_GIVEREF(__pyx_v_data); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_data)) __PYX_ERR(0, 518, __pyx_L1_error); __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_digest_size, __pyx_int_16) < 0) __PYX_ERR(0, 518, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_digest); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/crypto/low_level.pyx":517 * * * def blake2b_128(data): # <<<<<<<<<<<<<< * return hashlib.blake2b(data, digest_size=16).digest() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("borg.crypto.low_level.blake2b_128", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/crypto/low_level.pyx":521 * * * def hkdf_hmac_sha512(ikm, salt, info, output_length): # <<<<<<<<<<<<<< * """ * Compute HKDF-HMAC-SHA512 with input key material *ikm*, *salt* and *info* to produce *output_length* bytes. */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_6crypto_9low_level_9hkdf_hmac_sha512(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_6crypto_9low_level_8hkdf_hmac_sha512, "\n Compute HKDF-HMAC-SHA512 with input key material *ikm*, *salt* and *info* to produce *output_length* bytes.\n\n This is the \"HMAC-based Extract-and-Expand Key Derivation Function (HKDF)\" (RFC 5869)\n instantiated with HMAC-SHA512.\n\n *output_length* must not be greater than 64 * 255 bytes.\n "); static PyMethodDef __pyx_mdef_4borg_6crypto_9low_level_9hkdf_hmac_sha512 = {"hkdf_hmac_sha512", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_9hkdf_hmac_sha512, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_6crypto_9low_level_8hkdf_hmac_sha512}; static PyObject *__pyx_pw_4borg_6crypto_9low_level_9hkdf_hmac_sha512(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_ikm = 0; PyObject *__pyx_v_salt = 0; PyObject *__pyx_v_info = 0; PyObject *__pyx_v_output_length = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("hkdf_hmac_sha512 (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ikm,&__pyx_n_s_salt,&__pyx_n_s_info,&__pyx_n_s_output_length,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ikm)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 521, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_salt)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 521, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("hkdf_hmac_sha512", 1, 4, 4, 1); __PYX_ERR(0, 521, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_info)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 521, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("hkdf_hmac_sha512", 1, 4, 4, 2); __PYX_ERR(0, 521, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_output_length)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 521, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("hkdf_hmac_sha512", 1, 4, 4, 3); __PYX_ERR(0, 521, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "hkdf_hmac_sha512") < 0)) __PYX_ERR(0, 521, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); } __pyx_v_ikm = values[0]; __pyx_v_salt = values[1]; __pyx_v_info = values[2]; __pyx_v_output_length = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("hkdf_hmac_sha512", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 521, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.crypto.low_level.hkdf_hmac_sha512", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_6crypto_9low_level_8hkdf_hmac_sha512(__pyx_self, __pyx_v_ikm, __pyx_v_salt, __pyx_v_info, __pyx_v_output_length); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_6crypto_9low_level_8hkdf_hmac_sha512(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ikm, PyObject *__pyx_v_salt, PyObject *__pyx_v_info, PyObject *__pyx_v_output_length) { PyObject *__pyx_v_digest_length = NULL; PyObject *__pyx_v_prk = NULL; PyObject *__pyx_v_n = NULL; PyObject *__pyx_v_t_n = NULL; PyObject *__pyx_v_output = NULL; PyObject *__pyx_v_i = NULL; PyObject *__pyx_v_msg = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; Py_ssize_t __pyx_t_8; PyObject *(*__pyx_t_9)(PyObject *); PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("hkdf_hmac_sha512", 0); __Pyx_INCREF(__pyx_v_salt); /* "borg/crypto/low_level.pyx":530 * *output_length* must not be greater than 64 * 255 bytes. * """ * digest_length = 64 # <<<<<<<<<<<<<< * assert output_length <= (255 * digest_length), 'output_length must be <= 255 * 64 bytes' * # Step 1. HKDF-Extract (ikm, salt) -> prk */ __Pyx_INCREF(__pyx_int_64); __pyx_v_digest_length = __pyx_int_64; /* "borg/crypto/low_level.pyx":531 * """ * digest_length = 64 * assert output_length <= (255 * digest_length), 'output_length must be <= 255 * 64 bytes' # <<<<<<<<<<<<<< * # Step 1. HKDF-Extract (ikm, salt) -> prk * if salt is None: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = __Pyx_PyInt_MultiplyCObj(__pyx_int_255, __pyx_v_digest_length, 0xFF, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_v_output_length, __pyx_t_1, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_3)) { __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_kp_s_output_length_must_be_255_64_byt, 0, 0); __PYX_ERR(0, 531, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 531, __pyx_L1_error) #endif /* "borg/crypto/low_level.pyx":533 * assert output_length <= (255 * digest_length), 'output_length must be <= 255 * 64 bytes' * # Step 1. HKDF-Extract (ikm, salt) -> prk * if salt is None: # <<<<<<<<<<<<<< * salt = bytes(64) * prk = hmac.HMAC(salt, ikm, hashlib.sha512).digest() */ __pyx_t_3 = (__pyx_v_salt == Py_None); if (__pyx_t_3) { /* "borg/crypto/low_level.pyx":534 * # Step 1. HKDF-Extract (ikm, salt) -> prk * if salt is None: * salt = bytes(64) # <<<<<<<<<<<<<< * prk = hmac.HMAC(salt, ikm, hashlib.sha512).digest() * */ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyBytes_Type)), __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_salt, __pyx_t_2); __pyx_t_2 = 0; /* "borg/crypto/low_level.pyx":533 * assert output_length <= (255 * digest_length), 'output_length must be <= 255 * 64 bytes' * # Step 1. HKDF-Extract (ikm, salt) -> prk * if salt is None: # <<<<<<<<<<<<<< * salt = bytes(64) * prk = hmac.HMAC(salt, ikm, hashlib.sha512).digest() */ } /* "borg/crypto/low_level.pyx":535 * if salt is None: * salt = bytes(64) * prk = hmac.HMAC(salt, ikm, hashlib.sha512).digest() # <<<<<<<<<<<<<< * * # Step 2. HKDF-Expand (prk, info, output_length) -> output key */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_hmac); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_HMAC); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_hashlib); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sha512); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_salt, __pyx_v_ikm, __pyx_t_6}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_digest); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_v_prk = __pyx_t_2; __pyx_t_2 = 0; /* "borg/crypto/low_level.pyx":538 * * # Step 2. HKDF-Expand (prk, info, output_length) -> output key * n = ceil(output_length / digest_length) # <<<<<<<<<<<<<< * t_n = b'' * output = b'' */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ceil); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_output_length, __pyx_v_digest_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_1}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_v_n = __pyx_t_2; __pyx_t_2 = 0; /* "borg/crypto/low_level.pyx":539 * # Step 2. HKDF-Expand (prk, info, output_length) -> output key * n = ceil(output_length / digest_length) * t_n = b'' # <<<<<<<<<<<<<< * output = b'' * for i in range(n): */ __Pyx_INCREF(__pyx_kp_b_); __pyx_v_t_n = __pyx_kp_b_; /* "borg/crypto/low_level.pyx":540 * n = ceil(output_length / digest_length) * t_n = b'' * output = b'' # <<<<<<<<<<<<<< * for i in range(n): * msg = t_n + info + (i + 1).to_bytes(1, 'little') */ __Pyx_INCREF(__pyx_kp_b_); __pyx_v_output = __pyx_kp_b_; /* "borg/crypto/low_level.pyx":541 * t_n = b'' * output = b'' * for i in range(n): # <<<<<<<<<<<<<< * msg = t_n + info + (i + 1).to_bytes(1, 'little') * t_n = hmac.HMAC(prk, msg, hashlib.sha512).digest() */ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 541, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_9)) { if (likely(PyList_CheckExact(__pyx_t_5))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 541, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 541, __pyx_L1_error) #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 541, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 541, __pyx_L1_error) #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_9(__pyx_t_5); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 541, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_2); } __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; /* "borg/crypto/low_level.pyx":542 * output = b'' * for i in range(n): * msg = t_n + info + (i + 1).to_bytes(1, 'little') # <<<<<<<<<<<<<< * t_n = hmac.HMAC(prk, msg, hashlib.sha512).digest() * output += t_n */ __pyx_t_2 = PyNumber_Add(__pyx_v_t_n, __pyx_v_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_to_bytes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_msg, __pyx_t_6); __pyx_t_6 = 0; /* "borg/crypto/low_level.pyx":543 * for i in range(n): * msg = t_n + info + (i + 1).to_bytes(1, 'little') * t_n = hmac.HMAC(prk, msg, hashlib.sha512).digest() # <<<<<<<<<<<<<< * output += t_n * return output[:output_length] */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_hmac); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_HMAC); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_hashlib); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sha512); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_prk, __pyx_v_msg, __pyx_t_10}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_digest); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_t_n, __pyx_t_6); __pyx_t_6 = 0; /* "borg/crypto/low_level.pyx":544 * msg = t_n + info + (i + 1).to_bytes(1, 'little') * t_n = hmac.HMAC(prk, msg, hashlib.sha512).digest() * output += t_n # <<<<<<<<<<<<<< * return output[:output_length] */ __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_v_t_n); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_6); __pyx_t_6 = 0; /* "borg/crypto/low_level.pyx":541 * t_n = b'' * output = b'' * for i in range(n): # <<<<<<<<<<<<<< * msg = t_n + info + (i + 1).to_bytes(1, 'little') * t_n = hmac.HMAC(prk, msg, hashlib.sha512).digest() */ } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/crypto/low_level.pyx":545 * t_n = hmac.HMAC(prk, msg, hashlib.sha512).digest() * output += t_n * return output[:output_length] # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_output, 0, 0, NULL, &__pyx_v_output_length, NULL, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "borg/crypto/low_level.pyx":521 * * * def hkdf_hmac_sha512(ikm, salt, info, output_length): # <<<<<<<<<<<<<< * """ * Compute HKDF-HMAC-SHA512 with input key material *ikm*, *salt* and *info* to produce *output_length* bytes. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("borg.crypto.low_level.hkdf_hmac_sha512", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_digest_length); __Pyx_XDECREF(__pyx_v_prk); __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_t_n); __Pyx_XDECREF(__pyx_v_output); __Pyx_XDECREF(__pyx_v_i); __Pyx_XDECREF(__pyx_v_msg); __Pyx_XDECREF(__pyx_v_salt); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static struct __pyx_vtabstruct_4borg_6crypto_9low_level_AES256_CTR_BASE __pyx_vtable_4borg_6crypto_9low_level_AES256_CTR_BASE; static PyObject *__pyx_tp_new_4borg_6crypto_9low_level_AES256_CTR_BASE(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif p = ((struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *)o); p->__pyx_vtab = __pyx_vtabptr_4borg_6crypto_9low_level_AES256_CTR_BASE; if (unlikely(__pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_5__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_4borg_6crypto_9low_level_AES256_CTR_BASE(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4borg_6crypto_9low_level_AES256_CTR_BASE) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_7__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static PyMethodDef __pyx_methods_4borg_6crypto_9low_level_AES256_CTR_BASE[] = { {"requirements_check", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_1requirements_check, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"encrypt", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_9encrypt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_6crypto_9low_level_15AES256_CTR_BASE_8encrypt}, {"decrypt", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_11decrypt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_6crypto_9low_level_15AES256_CTR_BASE_10decrypt}, {"block_count", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_13block_count, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"set_iv", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_15set_iv, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"next_iv", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_17next_iv, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"extract_iv", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_19extract_iv, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_21__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_23__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_4borg_6crypto_9low_level_AES256_CTR_BASE_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4borg_6crypto_9low_level_AES256_CTR_BASE}, {Py_tp_methods, (void *)__pyx_methods_4borg_6crypto_9low_level_AES256_CTR_BASE}, {Py_tp_init, (void *)__pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_3__init__}, {Py_tp_new, (void *)__pyx_tp_new_4borg_6crypto_9low_level_AES256_CTR_BASE}, {0, 0}, }; static PyType_Spec __pyx_type_4borg_6crypto_9low_level_AES256_CTR_BASE_spec = { "borg.crypto.low_level.AES256_CTR_BASE", sizeof(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_4borg_6crypto_9low_level_AES256_CTR_BASE_slots, }; #else static PyTypeObject __pyx_type_4borg_6crypto_9low_level_AES256_CTR_BASE = { PyVarObject_HEAD_INIT(0, 0) "borg.crypto.low_level.""AES256_CTR_BASE", /*tp_name*/ sizeof(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4borg_6crypto_9low_level_AES256_CTR_BASE, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_4borg_6crypto_9low_level_AES256_CTR_BASE, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_4borg_6crypto_9low_level_15AES256_CTR_BASE_3__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4borg_6crypto_9low_level_AES256_CTR_BASE, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256 __pyx_vtable_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256; static PyObject *__pyx_tp_new_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256 *p; PyObject *o = __pyx_tp_new_4borg_6crypto_9low_level_AES256_CTR_BASE(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256 *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4borg_6crypto_9low_level_AES256_CTR_BASE*)__pyx_vtabptr_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256; if (unlikely(__pyx_pw_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256_3__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256_5__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } __pyx_tp_dealloc_4borg_6crypto_9low_level_AES256_CTR_BASE(o); } static PyMethodDef __pyx_methods_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256[] = { {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256}, {Py_tp_methods, (void *)__pyx_methods_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256}, {Py_tp_init, (void *)__pyx_pw_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256_1__init__}, {Py_tp_new, (void *)__pyx_tp_new_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256}, {0, 0}, }; static PyType_Spec __pyx_type_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256_spec = { "borg.crypto.low_level.AES256_CTR_HMAC_SHA256", sizeof(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256_slots, }; #else static PyTypeObject __pyx_type_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256 = { PyVarObject_HEAD_INIT(0, 0) "borg.crypto.low_level.""AES256_CTR_HMAC_SHA256", /*tp_name*/ sizeof(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b __pyx_vtable_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b; static PyObject *__pyx_tp_new_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b *p; PyObject *o = __pyx_tp_new_4borg_6crypto_9low_level_AES256_CTR_BASE(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4borg_6crypto_9low_level_AES256_CTR_BASE*)__pyx_vtabptr_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b; if (unlikely(__pyx_pw_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b_3__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b_5__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } __pyx_tp_dealloc_4borg_6crypto_9low_level_AES256_CTR_BASE(o); } static PyMethodDef __pyx_methods_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b[] = { {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b}, {Py_tp_methods, (void *)__pyx_methods_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b}, {Py_tp_init, (void *)__pyx_pw_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b_1__init__}, {Py_tp_new, (void *)__pyx_tp_new_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b}, {0, 0}, }; static PyType_Spec __pyx_type_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b_spec = { "borg.crypto.low_level.AES256_CTR_BLAKE2b", sizeof(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b_slots, }; #else static PyTypeObject __pyx_type_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b = { PyVarObject_HEAD_INIT(0, 0) "borg.crypto.low_level.""AES256_CTR_BLAKE2b", /*tp_name*/ sizeof(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyObject *__pyx_tp_new_4borg_6crypto_9low_level_AES(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif if (unlikely(__pyx_pw_4borg_6crypto_9low_level_3AES_3__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_4borg_6crypto_9low_level_AES(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4borg_6crypto_9low_level_AES) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_4borg_6crypto_9low_level_3AES_5__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static PyMethodDef __pyx_methods_4borg_6crypto_9low_level_AES[] = { {"encrypt", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_3AES_7encrypt, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"decrypt", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_3AES_9decrypt, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"block_count", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_3AES_11block_count, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"set_iv", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_3AES_13set_iv, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"next_iv", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_3AES_15next_iv, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_3AES_17__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_6crypto_9low_level_3AES_19__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_4borg_6crypto_9low_level_AES_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4borg_6crypto_9low_level_AES}, {Py_tp_doc, (void *)PyDoc_STR("A thin wrapper around the OpenSSL EVP cipher API - for legacy code, like key file encryption")}, {Py_tp_methods, (void *)__pyx_methods_4borg_6crypto_9low_level_AES}, {Py_tp_init, (void *)__pyx_pw_4borg_6crypto_9low_level_3AES_1__init__}, {Py_tp_new, (void *)__pyx_tp_new_4borg_6crypto_9low_level_AES}, {0, 0}, }; static PyType_Spec __pyx_type_4borg_6crypto_9low_level_AES_spec = { "borg.crypto.low_level.AES", sizeof(struct __pyx_obj_4borg_6crypto_9low_level_AES), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_4borg_6crypto_9low_level_AES_slots, }; #else static PyTypeObject __pyx_type_4borg_6crypto_9low_level_AES = { PyVarObject_HEAD_INIT(0, 0) "borg.crypto.low_level.""AES", /*tp_name*/ sizeof(struct __pyx_obj_4borg_6crypto_9low_level_AES), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4borg_6crypto_9low_level_AES, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ PyDoc_STR("A thin wrapper around the OpenSSL EVP cipher API - for legacy code, like key file encryption"), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_4borg_6crypto_9low_level_AES, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_4borg_6crypto_9low_level_3AES_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4borg_6crypto_9low_level_AES, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_b_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 0, 0}, {&__pyx_kp_s_1_4_01, __pyx_k_1_4_01, sizeof(__pyx_k_1_4_01), 0, 0, 1, 0}, {&__pyx_n_s_AES, __pyx_k_AES, sizeof(__pyx_k_AES), 0, 0, 1, 1}, {&__pyx_n_s_AES256_CTR_BASE, __pyx_k_AES256_CTR_BASE, sizeof(__pyx_k_AES256_CTR_BASE), 0, 0, 1, 1}, {&__pyx_n_s_AES256_CTR_BASE___reduce_cython, __pyx_k_AES256_CTR_BASE___reduce_cython, sizeof(__pyx_k_AES256_CTR_BASE___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_AES256_CTR_BASE___setstate_cytho, __pyx_k_AES256_CTR_BASE___setstate_cytho, sizeof(__pyx_k_AES256_CTR_BASE___setstate_cytho), 0, 0, 1, 1}, {&__pyx_n_s_AES256_CTR_BASE_block_count, __pyx_k_AES256_CTR_BASE_block_count, sizeof(__pyx_k_AES256_CTR_BASE_block_count), 0, 0, 1, 1}, {&__pyx_n_s_AES256_CTR_BASE_decrypt, __pyx_k_AES256_CTR_BASE_decrypt, sizeof(__pyx_k_AES256_CTR_BASE_decrypt), 0, 0, 1, 1}, {&__pyx_n_s_AES256_CTR_BASE_encrypt, __pyx_k_AES256_CTR_BASE_encrypt, sizeof(__pyx_k_AES256_CTR_BASE_encrypt), 0, 0, 1, 1}, {&__pyx_n_s_AES256_CTR_BASE_extract_iv, __pyx_k_AES256_CTR_BASE_extract_iv, sizeof(__pyx_k_AES256_CTR_BASE_extract_iv), 0, 0, 1, 1}, {&__pyx_n_s_AES256_CTR_BASE_next_iv, __pyx_k_AES256_CTR_BASE_next_iv, sizeof(__pyx_k_AES256_CTR_BASE_next_iv), 0, 0, 1, 1}, {&__pyx_n_s_AES256_CTR_BASE_requirements_che, __pyx_k_AES256_CTR_BASE_requirements_che, sizeof(__pyx_k_AES256_CTR_BASE_requirements_che), 0, 0, 1, 1}, {&__pyx_n_s_AES256_CTR_BASE_set_iv, __pyx_k_AES256_CTR_BASE_set_iv, sizeof(__pyx_k_AES256_CTR_BASE_set_iv), 0, 0, 1, 1}, {&__pyx_n_s_AES256_CTR_BLAKE2b, __pyx_k_AES256_CTR_BLAKE2b, sizeof(__pyx_k_AES256_CTR_BLAKE2b), 0, 0, 1, 1}, {&__pyx_n_s_AES256_CTR_BLAKE2b___reduce_cyth, __pyx_k_AES256_CTR_BLAKE2b___reduce_cyth, sizeof(__pyx_k_AES256_CTR_BLAKE2b___reduce_cyth), 0, 0, 1, 1}, {&__pyx_n_s_AES256_CTR_BLAKE2b___setstate_cy, __pyx_k_AES256_CTR_BLAKE2b___setstate_cy, sizeof(__pyx_k_AES256_CTR_BLAKE2b___setstate_cy), 0, 0, 1, 1}, {&__pyx_n_s_AES256_CTR_HMAC_SHA256, __pyx_k_AES256_CTR_HMAC_SHA256, sizeof(__pyx_k_AES256_CTR_HMAC_SHA256), 0, 0, 1, 1}, {&__pyx_n_s_AES256_CTR_HMAC_SHA256___reduce, __pyx_k_AES256_CTR_HMAC_SHA256___reduce, sizeof(__pyx_k_AES256_CTR_HMAC_SHA256___reduce), 0, 0, 1, 1}, {&__pyx_n_s_AES256_CTR_HMAC_SHA256___setstat, __pyx_k_AES256_CTR_HMAC_SHA256___setstat, sizeof(__pyx_k_AES256_CTR_HMAC_SHA256___setstat), 0, 0, 1, 1}, {&__pyx_kp_s_AES_CTR_requires_OpenSSL_1_0_0_D, __pyx_k_AES_CTR_requires_OpenSSL_1_0_0_D, sizeof(__pyx_k_AES_CTR_requires_OpenSSL_1_0_0_D), 0, 0, 1, 0}, {&__pyx_n_s_AES___reduce_cython, __pyx_k_AES___reduce_cython, sizeof(__pyx_k_AES___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_AES___setstate_cython, __pyx_k_AES___setstate_cython, sizeof(__pyx_k_AES___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_AES_block_count, __pyx_k_AES_block_count, sizeof(__pyx_k_AES_block_count), 0, 0, 1, 1}, {&__pyx_n_s_AES_decrypt, __pyx_k_AES_decrypt, sizeof(__pyx_k_AES_decrypt), 0, 0, 1, 1}, {&__pyx_n_s_AES_encrypt, __pyx_k_AES_encrypt, sizeof(__pyx_k_AES_encrypt), 0, 0, 1, 1}, {&__pyx_n_s_AES_next_iv, __pyx_k_AES_next_iv, sizeof(__pyx_k_AES_next_iv), 0, 0, 1, 1}, {&__pyx_n_s_AES_set_iv, __pyx_k_AES_set_iv, sizeof(__pyx_k_AES_set_iv), 0, 0, 1, 1}, {&__pyx_n_s_API_VERSION, __pyx_k_API_VERSION, sizeof(__pyx_k_API_VERSION), 0, 0, 1, 1}, {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1}, {&__pyx_n_s_CryptoError, __pyx_k_CryptoError, sizeof(__pyx_k_CryptoError), 0, 0, 1, 1}, {&__pyx_kp_s_EVP_DecryptFinal_ex_failed, __pyx_k_EVP_DecryptFinal_ex_failed, sizeof(__pyx_k_EVP_DecryptFinal_ex_failed), 0, 0, 1, 0}, {&__pyx_kp_s_EVP_DecryptFinal_failed, __pyx_k_EVP_DecryptFinal_failed, sizeof(__pyx_k_EVP_DecryptFinal_failed), 0, 0, 1, 0}, {&__pyx_kp_s_EVP_DecryptInit_ex_failed, __pyx_k_EVP_DecryptInit_ex_failed, sizeof(__pyx_k_EVP_DecryptInit_ex_failed), 0, 0, 1, 0}, {&__pyx_kp_s_EVP_DecryptUpdate_failed, __pyx_k_EVP_DecryptUpdate_failed, sizeof(__pyx_k_EVP_DecryptUpdate_failed), 0, 0, 1, 0}, {&__pyx_kp_s_EVP_EncryptFinal_ex_failed, __pyx_k_EVP_EncryptFinal_ex_failed, sizeof(__pyx_k_EVP_EncryptFinal_ex_failed), 0, 0, 1, 0}, {&__pyx_kp_s_EVP_EncryptFinal_failed, __pyx_k_EVP_EncryptFinal_failed, sizeof(__pyx_k_EVP_EncryptFinal_failed), 0, 0, 1, 0}, {&__pyx_kp_s_EVP_EncryptInit_ex_failed, __pyx_k_EVP_EncryptInit_ex_failed, sizeof(__pyx_k_EVP_EncryptInit_ex_failed), 0, 0, 1, 0}, {&__pyx_kp_s_EVP_EncryptUpdate_failed, __pyx_k_EVP_EncryptUpdate_failed, sizeof(__pyx_k_EVP_EncryptUpdate_failed), 0, 0, 1, 0}, {&__pyx_n_s_HMAC, __pyx_k_HMAC, sizeof(__pyx_k_HMAC), 0, 0, 1, 1}, {&__pyx_kp_s_I, __pyx_k_I, sizeof(__pyx_k_I), 0, 0, 1, 0}, {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, {&__pyx_n_s_IntegrityError, __pyx_k_IntegrityError, sizeof(__pyx_k_IntegrityError), 0, 0, 1, 1}, {&__pyx_kp_s_Integrity_checks_failed_Corrupte, __pyx_k_Integrity_checks_failed_Corrupte, sizeof(__pyx_k_Integrity_checks_failed_Corrupte), 0, 0, 1, 0}, {&__pyx_kp_s_MAC_Authentication_failed, __pyx_k_MAC_Authentication_failed, sizeof(__pyx_k_MAC_Authentication_failed), 0, 0, 1, 0}, {&__pyx_kp_s_Malfunction_in_the_crypto_module, __pyx_k_Malfunction_in_the_crypto_module, sizeof(__pyx_k_Malfunction_in_the_crypto_module), 0, 0, 1, 0}, {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1}, {&__pyx_n_s_OverflowError, __pyx_k_OverflowError, sizeof(__pyx_k_OverflowError), 0, 0, 1, 1}, {&__pyx_kp_s_Q, __pyx_k_Q, sizeof(__pyx_k_Q), 0, 0, 1, 0}, {&__pyx_n_s_Struct, __pyx_k_Struct, sizeof(__pyx_k_Struct), 0, 0, 1, 1}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s_UNENCRYPTED, __pyx_k_UNENCRYPTED, sizeof(__pyx_k_UNENCRYPTED), 0, 0, 1, 1}, {&__pyx_n_s_UNENCRYPTED___init, __pyx_k_UNENCRYPTED___init, sizeof(__pyx_k_UNENCRYPTED___init), 0, 0, 1, 1}, {&__pyx_n_s_UNENCRYPTED_block_count, __pyx_k_UNENCRYPTED_block_count, sizeof(__pyx_k_UNENCRYPTED_block_count), 0, 0, 1, 1}, {&__pyx_n_s_UNENCRYPTED_decrypt, __pyx_k_UNENCRYPTED_decrypt, sizeof(__pyx_k_UNENCRYPTED_decrypt), 0, 0, 1, 1}, {&__pyx_n_s_UNENCRYPTED_encrypt, __pyx_k_UNENCRYPTED_encrypt, sizeof(__pyx_k_UNENCRYPTED_encrypt), 0, 0, 1, 1}, {&__pyx_n_s_UNENCRYPTED_extract_iv, __pyx_k_UNENCRYPTED_extract_iv, sizeof(__pyx_k_UNENCRYPTED_extract_iv), 0, 0, 1, 1}, {&__pyx_n_s_UNENCRYPTED_next_iv, __pyx_k_UNENCRYPTED_next_iv, sizeof(__pyx_k_UNENCRYPTED_next_iv), 0, 0, 1, 1}, {&__pyx_n_s_UNENCRYPTED_set_iv, __pyx_k_UNENCRYPTED_set_iv, sizeof(__pyx_k_UNENCRYPTED_set_iv), 0, 0, 1, 1}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_n_s__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 0, 1, 1}, {&__pyx_kp_u__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 1, 0, 0}, {&__pyx_kp_b__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 0, 0}, {&__pyx_n_s__69, __pyx_k__69, sizeof(__pyx_k__69), 0, 0, 1, 1}, {&__pyx_n_s_aad_offset, __pyx_k_aad_offset, sizeof(__pyx_k_aad_offset), 0, 0, 1, 1}, {&__pyx_n_s_alen, __pyx_k_alen, sizeof(__pyx_k_alen), 0, 0, 1, 1}, {&__pyx_n_s_aoffset, __pyx_k_aoffset, sizeof(__pyx_k_aoffset), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_big, __pyx_k_big, sizeof(__pyx_k_big), 0, 0, 1, 1}, {&__pyx_n_s_blake2b, __pyx_k_blake2b, sizeof(__pyx_k_blake2b), 0, 0, 1, 1}, {&__pyx_n_s_blake2b_128, __pyx_k_blake2b_128, sizeof(__pyx_k_blake2b_128), 0, 0, 1, 1}, {&__pyx_n_s_blake2b_256, __pyx_k_blake2b_256, sizeof(__pyx_k_blake2b_256), 0, 0, 1, 1}, {&__pyx_n_s_block_count, __pyx_k_block_count, sizeof(__pyx_k_block_count), 0, 0, 1, 1}, {&__pyx_n_s_blocksize, __pyx_k_blocksize, sizeof(__pyx_k_blocksize), 0, 0, 1, 1}, {&__pyx_n_s_borg_crypto_low_level, __pyx_k_borg_crypto_low_level, sizeof(__pyx_k_borg_crypto_low_level), 0, 0, 1, 1}, {&__pyx_n_s_byteorder, __pyx_k_byteorder, sizeof(__pyx_k_byteorder), 0, 0, 1, 1}, {&__pyx_n_s_bytes_to_int, __pyx_k_bytes_to_int, sizeof(__pyx_k_bytes_to_int), 0, 0, 1, 1}, {&__pyx_n_s_bytes_to_long, __pyx_k_bytes_to_long, sizeof(__pyx_k_bytes_to_long), 0, 0, 1, 1}, {&__pyx_n_s_ceil, __pyx_k_ceil, sizeof(__pyx_k_ceil), 0, 0, 1, 1}, {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_cls, __pyx_k_cls, sizeof(__pyx_k_cls), 0, 0, 1, 1}, {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, {&__pyx_n_s_decrypt, __pyx_k_decrypt, sizeof(__pyx_k_decrypt), 0, 0, 1, 1}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_digest, __pyx_k_digest, sizeof(__pyx_k_digest), 0, 0, 1, 1}, {&__pyx_n_s_digest_length, __pyx_k_digest_length, sizeof(__pyx_k_digest_length), 0, 0, 1, 1}, {&__pyx_n_s_digest_size, __pyx_k_digest_size, sizeof(__pyx_k_digest_size), 0, 0, 1, 1}, {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, {&__pyx_n_s_enc_key, __pyx_k_enc_key, sizeof(__pyx_k_enc_key), 0, 0, 1, 1}, {&__pyx_n_s_encrypt, __pyx_k_encrypt, sizeof(__pyx_k_encrypt), 0, 0, 1, 1}, {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, {&__pyx_n_s_envelope, __pyx_k_envelope, sizeof(__pyx_k_envelope), 0, 0, 1, 1}, {&__pyx_n_s_extract_iv, __pyx_k_extract_iv, sizeof(__pyx_k_extract_iv), 0, 0, 1, 1}, {&__pyx_n_s_from_bytes, __pyx_k_from_bytes, sizeof(__pyx_k_from_bytes), 0, 0, 1, 1}, {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_n_s_hashlib, __pyx_k_hashlib, sizeof(__pyx_k_hashlib), 0, 0, 1, 1}, {&__pyx_n_s_hdata, __pyx_k_hdata, sizeof(__pyx_k_hdata), 0, 0, 1, 1}, {&__pyx_n_s_header, __pyx_k_header, sizeof(__pyx_k_header), 0, 0, 1, 1}, {&__pyx_n_s_header_len, __pyx_k_header_len, sizeof(__pyx_k_header_len), 0, 0, 1, 1}, {&__pyx_n_s_hkdf_hmac_sha512, __pyx_k_hkdf_hmac_sha512, sizeof(__pyx_k_hkdf_hmac_sha512), 0, 0, 1, 1}, {&__pyx_n_s_hlen, __pyx_k_hlen, sizeof(__pyx_k_hlen), 0, 0, 1, 1}, {&__pyx_n_s_hmac, __pyx_k_hmac, sizeof(__pyx_k_hmac), 0, 0, 1, 1}, {&__pyx_n_s_hmac_sha256, __pyx_k_hmac_sha256, sizeof(__pyx_k_hmac_sha256), 0, 0, 1, 1}, {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, {&__pyx_n_s_idata, __pyx_k_idata, sizeof(__pyx_k_idata), 0, 0, 1, 1}, {&__pyx_n_s_ikm, __pyx_k_ikm, sizeof(__pyx_k_ikm), 0, 0, 1, 1}, {&__pyx_n_s_ilen, __pyx_k_ilen, sizeof(__pyx_k_ilen), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_info, __pyx_k_info, sizeof(__pyx_k_info), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, {&__pyx_n_s_iv, __pyx_k_iv, sizeof(__pyx_k_iv), 0, 0, 1, 1}, {&__pyx_kp_s_iv_needs_to_be_set_before_encryp, __pyx_k_iv_needs_to_be_set_before_encryp, sizeof(__pyx_k_iv_needs_to_be_set_before_encryp), 0, 0, 1, 0}, {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, {&__pyx_n_s_lambda, __pyx_k_lambda, sizeof(__pyx_k_lambda), 0, 0, 1, 1}, {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1}, {&__pyx_n_s_little, __pyx_k_little, sizeof(__pyx_k_little), 0, 0, 1, 1}, {&__pyx_n_s_long, __pyx_k_long, sizeof(__pyx_k_long), 0, 0, 1, 1}, {&__pyx_n_s_long_to_bytes, __pyx_k_long_to_bytes, sizeof(__pyx_k_long_to_bytes), 0, 0, 1, 1}, {&__pyx_n_s_mac_buf, __pyx_k_mac_buf, sizeof(__pyx_k_mac_buf), 0, 0, 1, 1}, {&__pyx_n_s_mac_key, __pyx_k_mac_key, sizeof(__pyx_k_mac_key), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_math, __pyx_k_math, sizeof(__pyx_k_math), 0, 0, 1, 1}, {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, {&__pyx_n_s_mro_entries, __pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 0, 1, 1}, {&__pyx_n_s_msg, __pyx_k_msg, sizeof(__pyx_k_msg), 0, 0, 1, 1}, {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_next_iv, __pyx_k_next_iv, sizeof(__pyx_k_next_iv), 0, 0, 1, 1}, {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, {&__pyx_n_s_num_cipher_blocks, __pyx_k_num_cipher_blocks, sizeof(__pyx_k_num_cipher_blocks), 0, 0, 1, 1}, {&__pyx_n_s_odata, __pyx_k_odata, sizeof(__pyx_k_odata), 0, 0, 1, 1}, {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1}, {&__pyx_n_s_olen, __pyx_k_olen, sizeof(__pyx_k_olen), 0, 0, 1, 1}, {&__pyx_n_s_output, __pyx_k_output, sizeof(__pyx_k_output), 0, 0, 1, 1}, {&__pyx_n_s_output_length, __pyx_k_output_length, sizeof(__pyx_k_output_length), 0, 0, 1, 1}, {&__pyx_kp_s_output_length_must_be_255_64_byt, __pyx_k_output_length_must_be_255_64_byt, sizeof(__pyx_k_output_length_must_be_255_64_byt), 0, 0, 1, 0}, {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1}, {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, {&__pyx_n_s_prk, __pyx_k_prk, sizeof(__pyx_k_prk), 0, 0, 1, 1}, {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, {&__pyx_n_s_rc, __pyx_k_rc, sizeof(__pyx_k_rc), 0, 0, 1, 1}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, {&__pyx_n_s_requirements_check, __pyx_k_requirements_check, sizeof(__pyx_k_requirements_check), 0, 0, 1, 1}, {&__pyx_n_s_salt, __pyx_k_salt, sizeof(__pyx_k_salt), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_set_iv, __pyx_k_set_iv, sizeof(__pyx_k_set_iv), 0, 0, 1, 1}, {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1}, {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_sha256, __pyx_k_sha256, sizeof(__pyx_k_sha256), 0, 0, 1, 1}, {&__pyx_n_s_sha512, __pyx_k_sha512, sizeof(__pyx_k_sha512), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_kp_s_src_borg_crypto_low_level_pyx, __pyx_k_src_borg_crypto_low_level_pyx, sizeof(__pyx_k_src_borg_crypto_low_level_pyx), 0, 0, 1, 0}, {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1}, {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, {&__pyx_n_s_t_n, __pyx_k_t_n, sizeof(__pyx_k_t_n), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_to_bytes, __pyx_k_to_bytes, sizeof(__pyx_k_to_bytes), 0, 0, 1, 1}, {&__pyx_n_s_unpack_from, __pyx_k_unpack_from, sizeof(__pyx_k_unpack_from), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 132, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 184, __pyx_L1_error) __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 211, __pyx_L1_error) __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 237, __pyx_L1_error) __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 244, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 350, __pyx_L1_error) __pyx_builtin_OverflowError = __Pyx_GetBuiltinName(__pyx_n_s_OverflowError); if (!__pyx_builtin_OverflowError) __PYX_ERR(1, 83, __pyx_L1_error) __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 86, __pyx_L1_error) __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 96, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "borg/crypto/low_level.pyx":448 * try: * if not EVP_EncryptInit_ex(self.ctx, self.cipher(), NULL, self.enc_key, self.iv): * raise Exception('EVP_EncryptInit_ex failed') # <<<<<<<<<<<<<< * offset = 0 * if not EVP_EncryptUpdate(self.ctx, odata, &olen, idata.buf, ilen): */ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_EVP_EncryptInit_ex_failed); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "borg/crypto/low_level.pyx":451 * offset = 0 * if not EVP_EncryptUpdate(self.ctx, odata, &olen, idata.buf, ilen): * raise Exception('EVP_EncryptUpdate failed') # <<<<<<<<<<<<<< * offset += olen * if not EVP_EncryptFinal_ex(self.ctx, odata+offset, &olen): */ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_EVP_EncryptUpdate_failed); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); /* "borg/crypto/low_level.pyx":454 * offset += olen * if not EVP_EncryptFinal_ex(self.ctx, odata+offset, &olen): * raise Exception('EVP_EncryptFinal failed') # <<<<<<<<<<<<<< * offset += olen * self.blocks = self.block_count(offset) */ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_EVP_EncryptFinal_failed); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); /* "borg/crypto/low_level.pyx":473 * # Set cipher type and mode * if not EVP_DecryptInit_ex(self.ctx, self.cipher(), NULL, self.enc_key, self.iv): * raise Exception('EVP_DecryptInit_ex failed') # <<<<<<<<<<<<<< * offset = 0 * if not EVP_DecryptUpdate(self.ctx, odata, &olen, idata.buf, ilen): */ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_EVP_DecryptInit_ex_failed); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); /* "borg/crypto/low_level.pyx":476 * offset = 0 * if not EVP_DecryptUpdate(self.ctx, odata, &olen, idata.buf, ilen): * raise Exception('EVP_DecryptUpdate failed') # <<<<<<<<<<<<<< * offset += olen * if EVP_DecryptFinal_ex(self.ctx, odata+offset, &olen) <= 0: */ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_EVP_DecryptUpdate_failed); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); /* "borg/crypto/low_level.pyx":482 * # authentication. for them, a failure here means corrupted data. * # CTR mode does not use padding nor authentication. * raise Exception('EVP_DecryptFinal failed') # <<<<<<<<<<<<<< * offset += olen * self.blocks = self.block_count(ilen) */ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_EVP_DecryptFinal_failed); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); /* "borg/crypto/low_level.pyx":534 * # Step 1. HKDF-Extract (ikm, salt) -> prk * if salt is None: * salt = bytes(64) # <<<<<<<<<<<<<< * prk = hmac.HMAC(salt, ikm, hashlib.sha512).digest() * */ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_int_64); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); /* "borg/crypto/low_level.pyx":542 * output = b'' * for i in range(n): * msg = t_n + info + (i + 1).to_bytes(1, 'little') # <<<<<<<<<<<<<< * t_n = hmac.HMAC(prk, msg, hashlib.sha512).digest() * output += t_n */ __pyx_tuple__10 = PyTuple_Pack(2, __pyx_int_1, __pyx_n_s_little); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); /* "borg/crypto/low_level.pyx":90 * import struct * * _int = struct.Struct('>I') # <<<<<<<<<<<<<< * _long = struct.Struct('>Q') * */ __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_I); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); /* "borg/crypto/low_level.pyx":91 * * _int = struct.Struct('>I') * _long = struct.Struct('>Q') # <<<<<<<<<<<<<< * * bytes_to_int = lambda x, offset=0: _int.unpack_from(x, offset)[0] */ __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Q); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); /* "borg/crypto/low_level.pyx":93 * _long = struct.Struct('>Q') * * bytes_to_int = lambda x, offset=0: _int.unpack_from(x, offset)[0] # <<<<<<<<<<<<<< * bytes_to_long = lambda x, offset=0: _long.unpack_from(x, offset)[0] * long_to_bytes = lambda x: _long.pack(x) */ __pyx_tuple__15 = PyTuple_Pack(1, ((PyObject *)__pyx_int_0)); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); /* "borg/crypto/low_level.pyx":98 * * * def num_cipher_blocks(length, blocksize=16): # <<<<<<<<<<<<<< * """Return the number of cipher blocks required to encrypt/decrypt bytes of data. * */ __pyx_tuple__16 = PyTuple_Pack(2, __pyx_n_s_length, __pyx_n_s_blocksize); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_crypto_low_level_pyx, __pyx_n_s_num_cipher_blocks, 98, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 98, __pyx_L1_error) __pyx_tuple__18 = PyTuple_Pack(1, ((PyObject *)__pyx_int_16)); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); /* "borg/crypto/low_level.pyx":131 * # Layout: HEADER + PlainText * * def __init__(self, mac_key, enc_key, iv=None, header_len=1, aad_offset=1): # <<<<<<<<<<<<<< * assert mac_key is None * assert enc_key is None */ __pyx_tuple__19 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_mac_key, __pyx_n_s_enc_key, __pyx_n_s_iv, __pyx_n_s_header_len, __pyx_n_s_aad_offset); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_crypto_low_level_pyx, __pyx_n_s_init, 131, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 131, __pyx_L1_error) __pyx_tuple__21 = PyTuple_Pack(3, Py_None, ((PyObject *)__pyx_int_1), ((PyObject *)__pyx_int_1)); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); /* "borg/crypto/low_level.pyx":137 * self.set_iv(iv) * * def encrypt(self, data, header=b'', iv=None): # <<<<<<<<<<<<<< * """ * IMPORTANT: it is called encrypt to satisfy the crypto api naming convention, */ __pyx_tuple__22 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_data, __pyx_n_s_header, __pyx_n_s_iv); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_crypto_low_level_pyx, __pyx_n_s_encrypt, 137, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 137, __pyx_L1_error) __pyx_tuple__24 = PyTuple_Pack(2, ((PyObject*)__pyx_kp_b_), Py_None); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); /* "borg/crypto/low_level.pyx":147 * return header + data * * def decrypt(self, envelope): # <<<<<<<<<<<<<< * """ * IMPORTANT: it is called decrypt to satisfy the crypto api naming convention, */ __pyx_tuple__25 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_envelope); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_crypto_low_level_pyx, __pyx_n_s_decrypt, 147, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 147, __pyx_L1_error) /* "borg/crypto/low_level.pyx":155 * return memoryview(envelope)[self.header_len:] * * def block_count(self, length): # <<<<<<<<<<<<<< * return 0 * */ __pyx_tuple__27 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_length); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__27); __Pyx_GIVEREF(__pyx_tuple__27); __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_crypto_low_level_pyx, __pyx_n_s_block_count, 155, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 155, __pyx_L1_error) /* "borg/crypto/low_level.pyx":158 * return 0 * * def set_iv(self, iv): # <<<<<<<<<<<<<< * self.iv = iv * */ __pyx_tuple__29 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_iv); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__29); __Pyx_GIVEREF(__pyx_tuple__29); __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_crypto_low_level_pyx, __pyx_n_s_set_iv, 158, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 158, __pyx_L1_error) /* "borg/crypto/low_level.pyx":161 * self.iv = iv * * def next_iv(self): # <<<<<<<<<<<<<< * return self.iv * */ __pyx_tuple__31 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_crypto_low_level_pyx, __pyx_n_s_next_iv, 161, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 161, __pyx_L1_error) /* "borg/crypto/low_level.pyx":164 * return self.iv * * def extract_iv(self, envelope): # <<<<<<<<<<<<<< * return 0 * */ __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_crypto_low_level_pyx, __pyx_n_s_extract_iv, 164, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 164, __pyx_L1_error) /* "borg/crypto/low_level.pyx":181 * cdef long long blocks * * @classmethod # <<<<<<<<<<<<<< * def requirements_check(cls): * if OPENSSL_VERSION_NUMBER < 0x10000000: */ __pyx_tuple__34 = PyTuple_Pack(1, __pyx_n_s_cls); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__34); __Pyx_GIVEREF(__pyx_tuple__34); __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_crypto_low_level_pyx, __pyx_n_s_requirements_check, 181, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 181, __pyx_L1_error) /* "borg/crypto/low_level.pyx":221 * raise NotImplementedError * * def encrypt(self, data, header=b'', iv=None): # <<<<<<<<<<<<<< * """ * encrypt data, compute mac over aad + iv + cdata, prepend header. */ __pyx_tuple__36 = PyTuple_Pack(15, __pyx_n_s_self, __pyx_n_s_data, __pyx_n_s_header, __pyx_n_s_iv, __pyx_n_s_ilen, __pyx_n_s_hlen, __pyx_n_s_aoffset, __pyx_n_s_alen, __pyx_n_s_odata, __pyx_n_s_olen, __pyx_n_s_offset, __pyx_n_s_idata, __pyx_n_s_hdata, __pyx_n_s_i, __pyx_n_s_rc); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__36); __Pyx_GIVEREF(__pyx_tuple__36); __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_crypto_low_level_pyx, __pyx_n_s_encrypt, 221, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 221, __pyx_L1_error) /* "borg/crypto/low_level.pyx":271 * PyBuffer_Release(&idata) * * def decrypt(self, envelope): # <<<<<<<<<<<<<< * """ * authenticate aad + iv + cdata, decrypt cdata, ignore header bytes up to aad_offset. */ __pyx_tuple__38 = PyTuple_Pack(13, __pyx_n_s_self, __pyx_n_s_envelope, __pyx_n_s_ilen, __pyx_n_s_hlen, __pyx_n_s_aoffset, __pyx_n_s_alen, __pyx_n_s_odata, __pyx_n_s_olen, __pyx_n_s_offset, __pyx_n_s_mac_buf, __pyx_n_s_idata, __pyx_n_s_iv, __pyx_n_s_rc); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__38); __Pyx_GIVEREF(__pyx_tuple__38); __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_crypto_low_level_pyx, __pyx_n_s_decrypt, 271, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 271, __pyx_L1_error) /* "borg/crypto/low_level.pyx":313 * PyBuffer_Release(&idata) * * def block_count(self, length): # <<<<<<<<<<<<<< * return num_cipher_blocks(length, self.cipher_blk_len) * */ __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_crypto_low_level_pyx, __pyx_n_s_block_count, 313, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 313, __pyx_L1_error) /* "borg/crypto/low_level.pyx":316 * return num_cipher_blocks(length, self.cipher_blk_len) * * def set_iv(self, iv): # <<<<<<<<<<<<<< * # set_iv needs to be called before each encrypt() call * if isinstance(iv, int): */ __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_crypto_low_level_pyx, __pyx_n_s_set_iv, 316, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 316, __pyx_L1_error) /* "borg/crypto/low_level.pyx":324 * self.blocks = 0 # how many AES blocks got encrypted with this IV? * * def next_iv(self): # <<<<<<<<<<<<<< * # call this after encrypt() to get the next iv (int) for the next encrypt() call * iv = int.from_bytes(self.iv[:self.iv_len], byteorder='big') */ __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_crypto_low_level_pyx, __pyx_n_s_next_iv, 324, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 324, __pyx_L1_error) /* "borg/crypto/low_level.pyx":339 * iv_out[i] = iv[(self.iv_len-self.iv_len_short)+i] * * def extract_iv(self, envelope): # <<<<<<<<<<<<<< * offset = self.header_len + self.mac_len * return bytes_to_long(envelope[offset:offset+self.iv_len_short]) */ __pyx_tuple__43 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_envelope, __pyx_n_s_offset); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__43); __Pyx_GIVEREF(__pyx_tuple__43); __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_crypto_low_level_pyx, __pyx_n_s_extract_iv, 339, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 339, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_tuple__46 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__46); __Pyx_GIVEREF(__pyx_tuple__46); __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(1, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(1, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(1, 3, __pyx_L1_error) /* "borg/crypto/low_level.pyx":435 * EVP_CIPHER_CTX_free(self.ctx) * * def encrypt(self, data, iv=None): # <<<<<<<<<<<<<< * if iv is not None: * self.set_iv(iv) */ __pyx_tuple__52 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_data, __pyx_n_s_iv, __pyx_n_s_idata, __pyx_n_s_ilen, __pyx_n_s_offset, __pyx_n_s_olen, __pyx_n_s_odata); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__52); __Pyx_GIVEREF(__pyx_tuple__52); __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_crypto_low_level_pyx, __pyx_n_s_encrypt, 435, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 435, __pyx_L1_error) __pyx_tuple__54 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__54); __Pyx_GIVEREF(__pyx_tuple__54); /* "borg/crypto/low_level.pyx":462 * PyBuffer_Release(&idata) * * def decrypt(self, data): # <<<<<<<<<<<<<< * cdef Py_buffer idata = ro_buffer(data) * cdef int ilen = len(data) */ __pyx_tuple__55 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_data, __pyx_n_s_idata, __pyx_n_s_ilen, __pyx_n_s_offset, __pyx_n_s_olen, __pyx_n_s_odata); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__55); __Pyx_GIVEREF(__pyx_tuple__55); __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_crypto_low_level_pyx, __pyx_n_s_decrypt, 462, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 462, __pyx_L1_error) /* "borg/crypto/low_level.pyx":490 * PyBuffer_Release(&idata) * * def block_count(self, length): # <<<<<<<<<<<<<< * return num_cipher_blocks(length, self.cipher_blk_len) * */ __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_crypto_low_level_pyx, __pyx_n_s_block_count, 490, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 490, __pyx_L1_error) /* "borg/crypto/low_level.pyx":493 * return num_cipher_blocks(length, self.cipher_blk_len) * * def set_iv(self, iv): # <<<<<<<<<<<<<< * # set_iv needs to be called before each encrypt() call, * # because encrypt does a full initialisation of the cipher context. */ __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_crypto_low_level_pyx, __pyx_n_s_set_iv, 493, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 493, __pyx_L1_error) /* "borg/crypto/low_level.pyx":502 * self.blocks = 0 # number of cipher blocks encrypted with this IV * * def next_iv(self): # <<<<<<<<<<<<<< * # call this after encrypt() to get the next iv (int) for the next encrypt() call * iv = int.from_bytes(self.iv[:self.iv_len], byteorder='big') */ __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_crypto_low_level_pyx, __pyx_n_s_next_iv, 502, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 502, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(1, 3, __pyx_L1_error) /* "borg/crypto/low_level.pyx":509 * * * def hmac_sha256(key, data): # <<<<<<<<<<<<<< * return hmac.digest(key, data, 'sha256') * */ __pyx_tuple__62 = PyTuple_Pack(2, __pyx_n_s_key, __pyx_n_s_data); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__62); __Pyx_GIVEREF(__pyx_tuple__62); __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_crypto_low_level_pyx, __pyx_n_s_hmac_sha256, 509, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 509, __pyx_L1_error) /* "borg/crypto/low_level.pyx":513 * * * def blake2b_256(key, data): # <<<<<<<<<<<<<< * return hashlib.blake2b(key+data, digest_size=32).digest() * */ __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_crypto_low_level_pyx, __pyx_n_s_blake2b_256, 513, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 513, __pyx_L1_error) /* "borg/crypto/low_level.pyx":517 * * * def blake2b_128(data): # <<<<<<<<<<<<<< * return hashlib.blake2b(data, digest_size=16).digest() * */ __pyx_tuple__65 = PyTuple_Pack(1, __pyx_n_s_data); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__65); __Pyx_GIVEREF(__pyx_tuple__65); __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_crypto_low_level_pyx, __pyx_n_s_blake2b_128, 517, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 517, __pyx_L1_error) /* "borg/crypto/low_level.pyx":521 * * * def hkdf_hmac_sha512(ikm, salt, info, output_length): # <<<<<<<<<<<<<< * """ * Compute HKDF-HMAC-SHA512 with input key material *ikm*, *salt* and *info* to produce *output_length* bytes. */ __pyx_tuple__67 = PyTuple_Pack(11, __pyx_n_s_ikm, __pyx_n_s_salt, __pyx_n_s_info, __pyx_n_s_output_length, __pyx_n_s_digest_length, __pyx_n_s_prk, __pyx_n_s_n, __pyx_n_s_t_n, __pyx_n_s_output, __pyx_n_s_i, __pyx_n_s_msg); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__67); __Pyx_GIVEREF(__pyx_tuple__67); __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_crypto_low_level_pyx, __pyx_n_s_hkdf_hmac_sha512, 521, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 521, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_32 = PyInt_FromLong(32); if (unlikely(!__pyx_int_32)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_64 = PyInt_FromLong(64); if (unlikely(!__pyx_int_64)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_255 = PyInt_FromLong(255); if (unlikely(!__pyx_int_255)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { /* AssertionsEnabled.init */ if (likely(__Pyx_init_assertions_enabled() == 0)); else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ __pyx_vtabptr_4borg_6crypto_9low_level_AES256_CTR_BASE = &__pyx_vtable_4borg_6crypto_9low_level_AES256_CTR_BASE; __pyx_vtable_4borg_6crypto_9low_level_AES256_CTR_BASE.mac_compute = (PyObject *(*)(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *, unsigned char const *, int, unsigned char const *, int, unsigned char *))__pyx_f_4borg_6crypto_9low_level_15AES256_CTR_BASE_mac_compute; __pyx_vtable_4borg_6crypto_9low_level_AES256_CTR_BASE.mac_verify = (PyObject *(*)(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *, unsigned char const *, int, unsigned char const *, int, unsigned char *, unsigned char const *))__pyx_f_4borg_6crypto_9low_level_15AES256_CTR_BASE_mac_verify; __pyx_vtable_4borg_6crypto_9low_level_AES256_CTR_BASE.fetch_iv = (PyObject *(*)(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *, unsigned char *))__pyx_f_4borg_6crypto_9low_level_15AES256_CTR_BASE_fetch_iv; __pyx_vtable_4borg_6crypto_9low_level_AES256_CTR_BASE.store_iv = (PyObject *(*)(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *, unsigned char *, unsigned char *))__pyx_f_4borg_6crypto_9low_level_15AES256_CTR_BASE_store_iv; #if CYTHON_USE_TYPE_SPECS __pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BASE = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4borg_6crypto_9low_level_AES256_CTR_BASE_spec, NULL); if (unlikely(!__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BASE)) __PYX_ERR(0, 168, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4borg_6crypto_9low_level_AES256_CTR_BASE_spec, __pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BASE) < 0) __PYX_ERR(0, 168, __pyx_L1_error) #else __pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BASE = &__pyx_type_4borg_6crypto_9low_level_AES256_CTR_BASE; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BASE) < 0) __PYX_ERR(0, 168, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BASE->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BASE->tp_dictoffset && __pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BASE->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BASE->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BASE, __pyx_vtabptr_4borg_6crypto_9low_level_AES256_CTR_BASE) < 0) __PYX_ERR(0, 168, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BASE) < 0) __PYX_ERR(0, 168, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_AES256_CTR_BASE, (PyObject *) __pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BASE) < 0) __PYX_ERR(0, 168, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BASE) < 0) __PYX_ERR(0, 168, __pyx_L1_error) #endif __pyx_vtabptr_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256 = &__pyx_vtable_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256; __pyx_vtable_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256.__pyx_base = *__pyx_vtabptr_4borg_6crypto_9low_level_AES256_CTR_BASE; __pyx_vtable_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256.__pyx_base.mac_compute = (PyObject *(*)(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *, unsigned char const *, int, unsigned char const *, int, unsigned char *))__pyx_f_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256_mac_compute; __pyx_vtable_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256.__pyx_base.mac_verify = (PyObject *(*)(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *, unsigned char const *, int, unsigned char const *, int, unsigned char *, unsigned char const *))__pyx_f_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256_mac_verify; #if CYTHON_USE_TYPE_SPECS __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BASE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256 = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256_spec, __pyx_t_1); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256)) __PYX_ERR(0, 344, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256_spec, __pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256) < 0) __PYX_ERR(0, 344, __pyx_L1_error) #else __pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256 = &__pyx_type_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256->tp_base = __pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BASE; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256) < 0) __PYX_ERR(0, 344, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256->tp_dictoffset && __pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256, __pyx_vtabptr_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256) < 0) __PYX_ERR(0, 344, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256) < 0) __PYX_ERR(0, 344, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_AES256_CTR_HMAC_SHA256, (PyObject *) __pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256) < 0) __PYX_ERR(0, 344, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_HMAC_SHA256) < 0) __PYX_ERR(0, 344, __pyx_L1_error) #endif __pyx_vtabptr_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b = &__pyx_vtable_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b; __pyx_vtable_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b.__pyx_base = *__pyx_vtabptr_4borg_6crypto_9low_level_AES256_CTR_BASE; __pyx_vtable_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b.__pyx_base.mac_compute = (PyObject *(*)(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *, unsigned char const *, int, unsigned char const *, int, unsigned char *))__pyx_f_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b_mac_compute; __pyx_vtable_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b.__pyx_base.mac_verify = (PyObject *(*)(struct __pyx_obj_4borg_6crypto_9low_level_AES256_CTR_BASE *, unsigned char const *, int, unsigned char const *, int, unsigned char *, unsigned char const *))__pyx_f_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b_mac_verify; #if CYTHON_USE_TYPE_SPECS __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BASE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b_spec, __pyx_t_1); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b)) __PYX_ERR(0, 374, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b_spec, __pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b) < 0) __PYX_ERR(0, 374, __pyx_L1_error) #else __pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b = &__pyx_type_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b->tp_base = __pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BASE; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b) < 0) __PYX_ERR(0, 374, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b->tp_dictoffset && __pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b, __pyx_vtabptr_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b) < 0) __PYX_ERR(0, 374, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b) < 0) __PYX_ERR(0, 374, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_AES256_CTR_BLAKE2b, (PyObject *) __pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b) < 0) __PYX_ERR(0, 374, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BLAKE2b) < 0) __PYX_ERR(0, 374, __pyx_L1_error) #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_4borg_6crypto_9low_level_AES = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4borg_6crypto_9low_level_AES_spec, NULL); if (unlikely(!__pyx_ptype_4borg_6crypto_9low_level_AES)) __PYX_ERR(0, 407, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4borg_6crypto_9low_level_AES_spec, __pyx_ptype_4borg_6crypto_9low_level_AES) < 0) __PYX_ERR(0, 407, __pyx_L1_error) #else __pyx_ptype_4borg_6crypto_9low_level_AES = &__pyx_type_4borg_6crypto_9low_level_AES; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_4borg_6crypto_9low_level_AES) < 0) __PYX_ERR(0, 407, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_4borg_6crypto_9low_level_AES->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4borg_6crypto_9low_level_AES->tp_dictoffset && __pyx_ptype_4borg_6crypto_9low_level_AES->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_4borg_6crypto_9low_level_AES->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_AES, (PyObject *) __pyx_ptype_4borg_6crypto_9low_level_AES) < 0) __PYX_ERR(0, 407, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_4borg_6crypto_9low_level_AES) < 0) __PYX_ERR(0, 407, __pyx_L1_error) #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_10(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_10(PyTypeObject), #elif CYTHON_COMPILING_IN_LIMITED_API sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_10(PyTypeObject), #else sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_10(PyHeapTypeObject), #endif __Pyx_ImportType_CheckSize_Warn_3_0_10); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType_3_0_10(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_10(PyBoolObject),__Pyx_ImportType_CheckSize_Warn_3_0_10); if (!__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(4, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType_3_0_10(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_10(PyComplexObject),__Pyx_ImportType_CheckSize_Warn_3_0_10); if (!__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(5, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_low_level(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_low_level}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "low_level", __pyx_k_An_AEAD_style_OpenSSL_wrapper_AP, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initlow_level(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initlow_level(void) #else __Pyx_PyMODINIT_FUNC PyInit_low_level(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_low_level(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_low_level(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'low_level' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("low_level", __pyx_methods, __pyx_k_An_AEAD_style_OpenSSL_wrapper_AP, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "low_level" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_low_level(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_borg__crypto__low_level) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "borg.crypto.low_level")) { if (unlikely((PyDict_SetItemString(modules, "borg.crypto.low_level", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "borg/crypto/low_level.pyx":37 * """ * * import hashlib # <<<<<<<<<<<<<< * import hmac * from math import ceil */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_hashlib, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_hashlib, __pyx_t_2) < 0) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/crypto/low_level.pyx":38 * * import hashlib * import hmac # <<<<<<<<<<<<<< * from math import ceil * */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_hmac, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_hmac, __pyx_t_2) < 0) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/crypto/low_level.pyx":39 * import hashlib * import hmac * from math import ceil # <<<<<<<<<<<<<< * * from cpython cimport PyMem_Malloc, PyMem_Free */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_ceil); __Pyx_GIVEREF(__pyx_n_s_ceil); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_ceil)) __PYX_ERR(0, 39, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_math, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_ceil); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ceil, __pyx_t_2) < 0) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/crypto/low_level.pyx":45 * from cpython.bytes cimport PyBytes_FromStringAndSize * * API_VERSION = '1.4_01' # <<<<<<<<<<<<<< * * cdef extern from "openssl/crypto.h": */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_API_VERSION, __pyx_kp_s_1_4_01) < 0) __PYX_ERR(0, 45, __pyx_L1_error) /* "borg/crypto/low_level.pyx":88 * * * import struct # <<<<<<<<<<<<<< * * _int = struct.Struct('>I') */ __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_struct, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_struct, __pyx_t_3) < 0) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/crypto/low_level.pyx":90 * import struct * * _int = struct.Struct('>I') # <<<<<<<<<<<<<< * _long = struct.Struct('>Q') * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_struct); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Struct); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_int, __pyx_t_3) < 0) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/crypto/low_level.pyx":91 * * _int = struct.Struct('>I') * _long = struct.Struct('>Q') # <<<<<<<<<<<<<< * * bytes_to_int = lambda x, offset=0: _int.unpack_from(x, offset)[0] */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_struct); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Struct); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_long, __pyx_t_3) < 0) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/crypto/low_level.pyx":93 * _long = struct.Struct('>Q') * * bytes_to_int = lambda x, offset=0: _int.unpack_from(x, offset)[0] # <<<<<<<<<<<<<< * bytes_to_long = lambda x, offset=0: _long.unpack_from(x, offset)[0] * long_to_bytes = lambda x: _long.pack(x) */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_6crypto_9low_level_10lambda, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_borg_crypto_low_level, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__15); if (PyDict_SetItem(__pyx_d, __pyx_n_s_bytes_to_int, __pyx_t_3) < 0) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/crypto/low_level.pyx":94 * * bytes_to_int = lambda x, offset=0: _int.unpack_from(x, offset)[0] * bytes_to_long = lambda x, offset=0: _long.unpack_from(x, offset)[0] # <<<<<<<<<<<<<< * long_to_bytes = lambda x: _long.pack(x) * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_6crypto_9low_level_11lambda1, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_borg_crypto_low_level, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__15); if (PyDict_SetItem(__pyx_d, __pyx_n_s_bytes_to_long, __pyx_t_3) < 0) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/crypto/low_level.pyx":95 * bytes_to_int = lambda x, offset=0: _int.unpack_from(x, offset)[0] * bytes_to_long = lambda x, offset=0: _long.unpack_from(x, offset)[0] * long_to_bytes = lambda x: _long.pack(x) # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_6crypto_9low_level_12lambda2, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_borg_crypto_low_level, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_long_to_bytes, __pyx_t_3) < 0) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/crypto/low_level.pyx":98 * * * def num_cipher_blocks(length, blocksize=16): # <<<<<<<<<<<<<< * """Return the number of cipher blocks required to encrypt/decrypt bytes of data. * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_6crypto_9low_level_1num_cipher_blocks, 0, __pyx_n_s_num_cipher_blocks, NULL, __pyx_n_s_borg_crypto_low_level, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__18); if (PyDict_SetItem(__pyx_d, __pyx_n_s_num_cipher_blocks, __pyx_t_3) < 0) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/crypto/low_level.pyx":114 * * * class CryptoError(Exception): # <<<<<<<<<<<<<< * """Malfunction in the crypto module.""" * */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])); __Pyx_GIVEREF((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])))) __PYX_ERR(0, 114, __pyx_L1_error); __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_2, __pyx_n_s_CryptoError, __pyx_n_s_CryptoError, (PyObject *) NULL, __pyx_n_s_borg_crypto_low_level, __pyx_kp_s_Malfunction_in_the_crypto_module); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_2 != __pyx_t_3) { if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_3) < 0))) __PYX_ERR(0, 114, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_n_s_CryptoError, __pyx_t_2, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CryptoError, __pyx_t_3) < 0) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/crypto/low_level.pyx":118 * * * class IntegrityError(CryptoError): # <<<<<<<<<<<<<< * """Integrity checks failed. Corrupted or tampered data.""" * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CryptoError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_2, __pyx_n_s_IntegrityError, __pyx_n_s_IntegrityError, (PyObject *) NULL, __pyx_n_s_borg_crypto_low_level, __pyx_kp_s_Integrity_checks_failed_Corrupte); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_2 != __pyx_t_4) { if (unlikely((PyDict_SetItemString(__pyx_t_3, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 118, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_n_s_IntegrityError, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_IntegrityError, __pyx_t_4) < 0) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/crypto/low_level.pyx":128 * * * class UNENCRYPTED: # <<<<<<<<<<<<<< * # Layout: HEADER + PlainText * */ __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_UNENCRYPTED, __pyx_n_s_UNENCRYPTED, (PyObject *) NULL, __pyx_n_s_borg_crypto_low_level, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "borg/crypto/low_level.pyx":131 * # Layout: HEADER + PlainText * * def __init__(self, mac_key, enc_key, iv=None, header_len=1, aad_offset=1): # <<<<<<<<<<<<<< * assert mac_key is None * assert enc_key is None */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_6crypto_9low_level_11UNENCRYPTED_1__init__, 0, __pyx_n_s_UNENCRYPTED___init, NULL, __pyx_n_s_borg_crypto_low_level, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__21); if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_5) < 0) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/crypto/low_level.pyx":137 * self.set_iv(iv) * * def encrypt(self, data, header=b'', iv=None): # <<<<<<<<<<<<<< * """ * IMPORTANT: it is called encrypt to satisfy the crypto api naming convention, */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_6crypto_9low_level_11UNENCRYPTED_3encrypt, 0, __pyx_n_s_UNENCRYPTED_encrypt, NULL, __pyx_n_s_borg_crypto_low_level, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__24); if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_encrypt, __pyx_t_5) < 0) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/crypto/low_level.pyx":147 * return header + data * * def decrypt(self, envelope): # <<<<<<<<<<<<<< * """ * IMPORTANT: it is called decrypt to satisfy the crypto api naming convention, */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_6crypto_9low_level_11UNENCRYPTED_5decrypt, 0, __pyx_n_s_UNENCRYPTED_decrypt, NULL, __pyx_n_s_borg_crypto_low_level, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_decrypt, __pyx_t_5) < 0) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/crypto/low_level.pyx":155 * return memoryview(envelope)[self.header_len:] * * def block_count(self, length): # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_6crypto_9low_level_11UNENCRYPTED_7block_count, 0, __pyx_n_s_UNENCRYPTED_block_count, NULL, __pyx_n_s_borg_crypto_low_level, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_block_count, __pyx_t_5) < 0) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/crypto/low_level.pyx":158 * return 0 * * def set_iv(self, iv): # <<<<<<<<<<<<<< * self.iv = iv * */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_6crypto_9low_level_11UNENCRYPTED_9set_iv, 0, __pyx_n_s_UNENCRYPTED_set_iv, NULL, __pyx_n_s_borg_crypto_low_level, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_set_iv, __pyx_t_5) < 0) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/crypto/low_level.pyx":161 * self.iv = iv * * def next_iv(self): # <<<<<<<<<<<<<< * return self.iv * */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_6crypto_9low_level_11UNENCRYPTED_11next_iv, 0, __pyx_n_s_UNENCRYPTED_next_iv, NULL, __pyx_n_s_borg_crypto_low_level, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_next_iv, __pyx_t_5) < 0) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/crypto/low_level.pyx":164 * return self.iv * * def extract_iv(self, envelope): # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_6crypto_9low_level_11UNENCRYPTED_13extract_iv, 0, __pyx_n_s_UNENCRYPTED_extract_iv, NULL, __pyx_n_s_borg_crypto_low_level, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_extract_iv, __pyx_t_5) < 0) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/crypto/low_level.pyx":128 * * * class UNENCRYPTED: # <<<<<<<<<<<<<< * # Layout: HEADER + PlainText * */ __pyx_t_5 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_UNENCRYPTED, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_UNENCRYPTED, __pyx_t_5) < 0) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/crypto/low_level.pyx":181 * cdef long long blocks * * @classmethod # <<<<<<<<<<<<<< * def requirements_check(cls): * if OPENSSL_VERSION_NUMBER < 0x10000000: */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_6crypto_9low_level_15AES256_CTR_BASE_1requirements_check, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AES256_CTR_BASE_requirements_che, NULL, __pyx_n_s_borg_crypto_low_level, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BASE, __pyx_n_s_requirements_check, __pyx_t_2) < 0) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BASE); __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BASE, __pyx_n_s_requirements_check); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BASE, __pyx_n_s_requirements_check, __pyx_t_5) < 0) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; PyType_Modified(__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BASE); /* "borg/crypto/low_level.pyx":221 * raise NotImplementedError * * def encrypt(self, data, header=b'', iv=None): # <<<<<<<<<<<<<< * """ * encrypt data, compute mac over aad + iv + cdata, prepend header. */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_6crypto_9low_level_15AES256_CTR_BASE_9encrypt, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AES256_CTR_BASE_encrypt, NULL, __pyx_n_s_borg_crypto_low_level, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__24); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BASE, __pyx_n_s_encrypt, __pyx_t_5) < 0) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; PyType_Modified(__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BASE); /* "borg/crypto/low_level.pyx":271 * PyBuffer_Release(&idata) * * def decrypt(self, envelope): # <<<<<<<<<<<<<< * """ * authenticate aad + iv + cdata, decrypt cdata, ignore header bytes up to aad_offset. */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_6crypto_9low_level_15AES256_CTR_BASE_11decrypt, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AES256_CTR_BASE_decrypt, NULL, __pyx_n_s_borg_crypto_low_level, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BASE, __pyx_n_s_decrypt, __pyx_t_5) < 0) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; PyType_Modified(__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BASE); /* "borg/crypto/low_level.pyx":313 * PyBuffer_Release(&idata) * * def block_count(self, length): # <<<<<<<<<<<<<< * return num_cipher_blocks(length, self.cipher_blk_len) * */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_6crypto_9low_level_15AES256_CTR_BASE_13block_count, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AES256_CTR_BASE_block_count, NULL, __pyx_n_s_borg_crypto_low_level, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BASE, __pyx_n_s_block_count, __pyx_t_5) < 0) __PYX_ERR(0, 313, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; PyType_Modified(__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BASE); /* "borg/crypto/low_level.pyx":316 * return num_cipher_blocks(length, self.cipher_blk_len) * * def set_iv(self, iv): # <<<<<<<<<<<<<< * # set_iv needs to be called before each encrypt() call * if isinstance(iv, int): */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_6crypto_9low_level_15AES256_CTR_BASE_15set_iv, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AES256_CTR_BASE_set_iv, NULL, __pyx_n_s_borg_crypto_low_level, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BASE, __pyx_n_s_set_iv, __pyx_t_5) < 0) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; PyType_Modified(__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BASE); /* "borg/crypto/low_level.pyx":324 * self.blocks = 0 # how many AES blocks got encrypted with this IV? * * def next_iv(self): # <<<<<<<<<<<<<< * # call this after encrypt() to get the next iv (int) for the next encrypt() call * iv = int.from_bytes(self.iv[:self.iv_len], byteorder='big') */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_6crypto_9low_level_15AES256_CTR_BASE_17next_iv, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AES256_CTR_BASE_next_iv, NULL, __pyx_n_s_borg_crypto_low_level, __pyx_d, ((PyObject *)__pyx_codeobj__42)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BASE, __pyx_n_s_next_iv, __pyx_t_5) < 0) __PYX_ERR(0, 324, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; PyType_Modified(__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BASE); /* "borg/crypto/low_level.pyx":339 * iv_out[i] = iv[(self.iv_len-self.iv_len_short)+i] * * def extract_iv(self, envelope): # <<<<<<<<<<<<<< * offset = self.header_len + self.mac_len * return bytes_to_long(envelope[offset:offset+self.iv_len_short]) */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_6crypto_9low_level_15AES256_CTR_BASE_19extract_iv, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AES256_CTR_BASE_extract_iv, NULL, __pyx_n_s_borg_crypto_low_level, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BASE, __pyx_n_s_extract_iv, __pyx_t_5) < 0) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; PyType_Modified(__pyx_ptype_4borg_6crypto_9low_level_AES256_CTR_BASE); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_6crypto_9low_level_15AES256_CTR_BASE_21__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AES256_CTR_BASE___reduce_cython, NULL, __pyx_n_s_borg_crypto_low_level, __pyx_d, ((PyObject *)__pyx_codeobj__45)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_5) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_6crypto_9low_level_15AES256_CTR_BASE_23__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AES256_CTR_BASE___setstate_cytho, NULL, __pyx_n_s_borg_crypto_low_level, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_5) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AES256_CTR_HMAC_SHA256___reduce, NULL, __pyx_n_s_borg_crypto_low_level, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_5) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_6crypto_9low_level_22AES256_CTR_HMAC_SHA256_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AES256_CTR_HMAC_SHA256___setstat, NULL, __pyx_n_s_borg_crypto_low_level, __pyx_d, ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_5) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AES256_CTR_BLAKE2b___reduce_cyth, NULL, __pyx_n_s_borg_crypto_low_level, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_5) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_6crypto_9low_level_18AES256_CTR_BLAKE2b_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AES256_CTR_BLAKE2b___setstate_cy, NULL, __pyx_n_s_borg_crypto_low_level, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_5) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/crypto/low_level.pyx":435 * EVP_CIPHER_CTX_free(self.ctx) * * def encrypt(self, data, iv=None): # <<<<<<<<<<<<<< * if iv is not None: * self.set_iv(iv) */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_6crypto_9low_level_3AES_7encrypt, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AES_encrypt, NULL, __pyx_n_s_borg_crypto_low_level, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__54); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_6crypto_9low_level_AES, __pyx_n_s_encrypt, __pyx_t_5) < 0) __PYX_ERR(0, 435, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; PyType_Modified(__pyx_ptype_4borg_6crypto_9low_level_AES); /* "borg/crypto/low_level.pyx":462 * PyBuffer_Release(&idata) * * def decrypt(self, data): # <<<<<<<<<<<<<< * cdef Py_buffer idata = ro_buffer(data) * cdef int ilen = len(data) */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_6crypto_9low_level_3AES_9decrypt, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AES_decrypt, NULL, __pyx_n_s_borg_crypto_low_level, __pyx_d, ((PyObject *)__pyx_codeobj__56)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_6crypto_9low_level_AES, __pyx_n_s_decrypt, __pyx_t_5) < 0) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; PyType_Modified(__pyx_ptype_4borg_6crypto_9low_level_AES); /* "borg/crypto/low_level.pyx":490 * PyBuffer_Release(&idata) * * def block_count(self, length): # <<<<<<<<<<<<<< * return num_cipher_blocks(length, self.cipher_blk_len) * */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_6crypto_9low_level_3AES_11block_count, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AES_block_count, NULL, __pyx_n_s_borg_crypto_low_level, __pyx_d, ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_6crypto_9low_level_AES, __pyx_n_s_block_count, __pyx_t_5) < 0) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; PyType_Modified(__pyx_ptype_4borg_6crypto_9low_level_AES); /* "borg/crypto/low_level.pyx":493 * return num_cipher_blocks(length, self.cipher_blk_len) * * def set_iv(self, iv): # <<<<<<<<<<<<<< * # set_iv needs to be called before each encrypt() call, * # because encrypt does a full initialisation of the cipher context. */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_6crypto_9low_level_3AES_13set_iv, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AES_set_iv, NULL, __pyx_n_s_borg_crypto_low_level, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_6crypto_9low_level_AES, __pyx_n_s_set_iv, __pyx_t_5) < 0) __PYX_ERR(0, 493, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; PyType_Modified(__pyx_ptype_4borg_6crypto_9low_level_AES); /* "borg/crypto/low_level.pyx":502 * self.blocks = 0 # number of cipher blocks encrypted with this IV * * def next_iv(self): # <<<<<<<<<<<<<< * # call this after encrypt() to get the next iv (int) for the next encrypt() call * iv = int.from_bytes(self.iv[:self.iv_len], byteorder='big') */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_6crypto_9low_level_3AES_15next_iv, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AES_next_iv, NULL, __pyx_n_s_borg_crypto_low_level, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_6crypto_9low_level_AES, __pyx_n_s_next_iv, __pyx_t_5) < 0) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; PyType_Modified(__pyx_ptype_4borg_6crypto_9low_level_AES); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_6crypto_9low_level_3AES_17__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AES___reduce_cython, NULL, __pyx_n_s_borg_crypto_low_level, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_5) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_6crypto_9low_level_3AES_19__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AES___setstate_cython, NULL, __pyx_n_s_borg_crypto_low_level, __pyx_d, ((PyObject *)__pyx_codeobj__61)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_5) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/crypto/low_level.pyx":509 * * * def hmac_sha256(key, data): # <<<<<<<<<<<<<< * return hmac.digest(key, data, 'sha256') * */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_6crypto_9low_level_3hmac_sha256, 0, __pyx_n_s_hmac_sha256, NULL, __pyx_n_s_borg_crypto_low_level, __pyx_d, ((PyObject *)__pyx_codeobj__63)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_hmac_sha256, __pyx_t_5) < 0) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/crypto/low_level.pyx":513 * * * def blake2b_256(key, data): # <<<<<<<<<<<<<< * return hashlib.blake2b(key+data, digest_size=32).digest() * */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_6crypto_9low_level_5blake2b_256, 0, __pyx_n_s_blake2b_256, NULL, __pyx_n_s_borg_crypto_low_level, __pyx_d, ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_blake2b_256, __pyx_t_5) < 0) __PYX_ERR(0, 513, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/crypto/low_level.pyx":517 * * * def blake2b_128(data): # <<<<<<<<<<<<<< * return hashlib.blake2b(data, digest_size=16).digest() * */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_6crypto_9low_level_7blake2b_128, 0, __pyx_n_s_blake2b_128, NULL, __pyx_n_s_borg_crypto_low_level, __pyx_d, ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_blake2b_128, __pyx_t_5) < 0) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/crypto/low_level.pyx":521 * * * def hkdf_hmac_sha512(ikm, salt, info, output_length): # <<<<<<<<<<<<<< * """ * Compute HKDF-HMAC-SHA512 with input key material *ikm*, *salt* and *info* to produce *output_length* bytes. */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_6crypto_9low_level_9hkdf_hmac_sha512, 0, __pyx_n_s_hkdf_hmac_sha512, NULL, __pyx_n_s_borg_crypto_low_level, __pyx_d, ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_hkdf_hmac_sha512, __pyx_t_5) < 0) __PYX_ERR(0, 521, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/crypto/low_level.pyx":1 * """An AEAD style OpenSSL wrapper # <<<<<<<<<<<<<< * * API: */ __pyx_t_5 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_5) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init borg.crypto.low_level", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init borg.crypto.low_level"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* GetItemInt */ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (unlikely(!j)) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_subscript) { PyObject *r, *key = PyInt_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); return r; } if (likely(sm && sm->sq_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return sm->sq_item(o, i); } } #else if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* GetTopmostException */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) { _PyErr_StackItem *exc_info = tstate->exc_info; while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && exc_info->previous_item != NULL) { exc_info = exc_info->previous_item; } return exc_info; } #endif /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); PyObject *exc_value = exc_info->exc_value; if (exc_value == NULL || exc_value == Py_None) { *value = NULL; *type = NULL; *tb = NULL; } else { *value = exc_value; Py_INCREF(*value); *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); *tb = PyException_GetTraceback(exc_value); } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); *type = exc_info->exc_type; *value = exc_info->exc_value; *tb = exc_info->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #else *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #endif } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; PyObject *tmp_value = exc_info->exc_value; exc_info->exc_value = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = type; exc_info->exc_value = value; exc_info->exc_traceback = tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } #endif /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0 || (x^~b) >= 0)) return PyInt_FromLong(x); return PyLong_Type.tp_as_number->nb_subtract(op1, op2); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; #endif if (unlikely(__Pyx_PyLong_IsZero(op1))) { return PyLong_FromLong(-intval); } if (likely(__Pyx_PyLong_IsCompact(op1))) { a = __Pyx_PyLong_CompactValue(op1); } else { const digit* digits = __Pyx_PyLong_Digits(op1); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2); } } x = a - b; return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla - llb; return PyLong_FromLongLong(llx); #endif } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif double result; PyFPE_START_PROTECT("subtract", return NULL) result = ((double)a) - (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2); } #endif /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* PyObjectSetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_setattr)) return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); #endif return PyObject_SetAttr(obj, attr_name, value); } #endif /* KeywordStringCheck */ static int __Pyx_CheckKeywordStrings( PyObject *kw, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0)) goto invalid_keyword; return 1; #else if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) { Py_ssize_t kwsize; #if CYTHON_ASSUME_SAFE_MACROS kwsize = PyTuple_GET_SIZE(kw); #else kwsize = PyTuple_Size(kw); if (kwsize < 0) return 0; #endif if (unlikely(kwsize == 0)) return 1; if (!kw_allowed) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, 0); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif goto invalid_keyword; } #if PY_VERSION_HEX < 0x03090000 for (pos = 0; pos < kwsize; pos++) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, pos); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } #endif return 1; } while (PyDict_Next(kw, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if (!kw_allowed && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* ObjectGetItem */ #if CYTHON_USE_TYPE_SLOTS static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { PyObject *runerr = NULL; Py_ssize_t key_value; key_value = __Pyx_PyIndex_AsSsize_t(index); if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); } if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index)); PyErr_Clear(); PyErr_Format(PyExc_IndexError, "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name); __Pyx_DECREF_TypeName(index_type_name); } return NULL; } static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { __Pyx_TypeName obj_type_name; if (likely(PyType_Check(obj))) { PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem); if (!meth) { PyErr_Clear(); } else { PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); Py_DECREF(meth); return result; } } obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); return NULL; } static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { PyTypeObject *tp = Py_TYPE(obj); PyMappingMethods *mm = tp->tp_as_mapping; PySequenceMethods *sm = tp->tp_as_sequence; if (likely(mm && mm->mp_subscript)) { return mm->mp_subscript(obj, key); } if (likely(sm && sm->sq_item)) { return __Pyx_PyObject_GetIndex(obj, key); } return __Pyx_PyObject_GetItem_Slow(obj, key); } #endif /* GetException */ #if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) #endif { PyObject *local_type = NULL, *local_value, *local_tb = NULL; #if CYTHON_FAST_THREAD_STATE PyObject *tmp_type, *tmp_value, *tmp_tb; #if PY_VERSION_HEX >= 0x030C00A6 local_value = tstate->current_exception; tstate->current_exception = 0; if (likely(local_value)) { local_type = (PyObject*) Py_TYPE(local_value); Py_INCREF(local_type); local_tb = PyException_GetTraceback(local_value); } #else local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 if (unlikely(tstate->current_exception)) #elif CYTHON_FAST_THREAD_STATE if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE #if CYTHON_USE_EXC_INFO_STACK { _PyErr_StackItem *exc_info = tstate->exc_info; #if PY_VERSION_HEX >= 0x030B00a4 tmp_value = exc_info->exc_value; exc_info->exc_value = local_value; tmp_type = NULL; tmp_tb = NULL; Py_XDECREF(local_type); Py_XDECREF(local_tb); #else tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = local_type; exc_info->exc_value = local_value; exc_info->exc_traceback = local_tb; #endif } #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } /* SwapException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; tmp_value = exc_info->exc_value; exc_info->exc_value = *value; if (tmp_value == NULL || tmp_value == Py_None) { Py_XDECREF(tmp_value); tmp_value = NULL; tmp_type = NULL; tmp_tb = NULL; } else { tmp_type = (PyObject*) Py_TYPE(tmp_value); Py_INCREF(tmp_type); #if CYTHON_COMPILING_IN_CPYTHON tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback; Py_XINCREF(tmp_tb); #else tmp_tb = PyException_GetTraceback(tmp_value); #endif } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = *type; exc_info->exc_value = *value; exc_info->exc_traceback = *tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = *type; tstate->exc_value = *value; tstate->exc_traceback = *tb; #endif *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); PyErr_SetExcInfo(*type, *value, *tb); *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #endif /* PySequenceMultiply */ static PyObject* __Pyx_PySequence_Multiply_Generic(PyObject *seq, Py_ssize_t mul) { PyObject *result, *pymul = PyInt_FromSsize_t(mul); if (unlikely(!pymul)) return NULL; result = PyNumber_Multiply(seq, pymul); Py_DECREF(pymul); return result; } static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul) { #if CYTHON_USE_TYPE_SLOTS PyTypeObject *type = Py_TYPE(seq); if (likely(type->tp_as_sequence && type->tp_as_sequence->sq_repeat)) { return type->tp_as_sequence->sq_repeat(seq, mul); } else #endif { return __Pyx_PySequence_Multiply_Generic(seq, mul); } } /* SliceObject */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, int has_cstart, int has_cstop, int wraparound) { __Pyx_TypeName obj_type_name; #if CYTHON_USE_TYPE_SLOTS PyMappingMethods* mp; #if PY_MAJOR_VERSION < 3 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; if (likely(ms && ms->sq_slice)) { if (!has_cstart) { if (_py_start && (*_py_start != Py_None)) { cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstart = 0; } if (!has_cstop) { if (_py_stop && (*_py_stop != Py_None)) { cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstop = PY_SSIZE_T_MAX; } if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { Py_ssize_t l = ms->sq_length(obj); if (likely(l >= 0)) { if (cstop < 0) { cstop += l; if (cstop < 0) cstop = 0; } if (cstart < 0) { cstart += l; if (cstart < 0) cstart = 0; } } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) goto bad; PyErr_Clear(); } } return ms->sq_slice(obj, cstart, cstop); } #else CYTHON_UNUSED_VAR(wraparound); #endif mp = Py_TYPE(obj)->tp_as_mapping; if (likely(mp && mp->mp_subscript)) #else CYTHON_UNUSED_VAR(wraparound); #endif { PyObject* result; PyObject *py_slice, *py_start, *py_stop; if (_py_slice) { py_slice = *_py_slice; } else { PyObject* owned_start = NULL; PyObject* owned_stop = NULL; if (_py_start) { py_start = *_py_start; } else { if (has_cstart) { owned_start = py_start = PyInt_FromSsize_t(cstart); if (unlikely(!py_start)) goto bad; } else py_start = Py_None; } if (_py_stop) { py_stop = *_py_stop; } else { if (has_cstop) { owned_stop = py_stop = PyInt_FromSsize_t(cstop); if (unlikely(!py_stop)) { Py_XDECREF(owned_start); goto bad; } } else py_stop = Py_None; } py_slice = PySlice_New(py_start, py_stop, Py_None); Py_XDECREF(owned_start); Py_XDECREF(owned_stop); if (unlikely(!py_slice)) goto bad; } #if CYTHON_USE_TYPE_SLOTS result = mp->mp_subscript(obj, py_slice); #else result = PyObject_GetItem(obj, py_slice); #endif if (!_py_slice) { Py_DECREF(py_slice); } return result; } obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' object is unsliceable", obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); bad: return NULL; } /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_MultiplyCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op2))) { const long a = intval; long b = PyInt_AS_LONG(op2); #ifdef HAVE_LONG_LONG if (sizeof(PY_LONG_LONG) > sizeof(long)) { PY_LONG_LONG result = (PY_LONG_LONG)a * (PY_LONG_LONG)b; return (result >= LONG_MIN && result <= LONG_MAX) ? PyInt_FromLong((long)result) : PyLong_FromLongLong(result); } #endif #if CYTHON_USE_TYPE_SLOTS return PyInt_Type.tp_as_number->nb_multiply(op1, op2); #else return PyNumber_Multiply(op1, op2); #endif } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op2))) { const long a = intval; long b, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG lla = intval; PY_LONG_LONG llb, llx; #endif if (unlikely(__Pyx_PyLong_IsZero(op2))) { return __Pyx_NewRef(op2); } if (likely(__Pyx_PyLong_IsCompact(op2))) { b = __Pyx_PyLong_CompactValue(op2); } else { const digit* digits = __Pyx_PyLong_Digits(op2); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op2); switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) { b = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) { llb = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) { b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) { llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) { b = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) { llb = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) { b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) { llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) { b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) { llb = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) { b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) { llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_multiply(op1, op2); } } CYTHON_UNUSED_VAR(a); CYTHON_UNUSED_VAR(b); #ifdef HAVE_LONG_LONG llb = b; goto long_long; #else return PyLong_Type.tp_as_number->nb_multiply(op1, op2); #endif return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla * llb; return PyLong_FromLongLong(llx); #endif } #endif if (PyFloat_CheckExact(op2)) { const long a = intval; #if CYTHON_COMPILING_IN_LIMITED_API double b = __pyx_PyFloat_AsDouble(op2); #else double b = PyFloat_AS_DOUBLE(op2); #endif double result; PyFPE_START_PROTECT("multiply", return NULL) result = ((double)a) * (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceMultiply : PyNumber_Multiply)(op1, op2); } #endif /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long x; long a = PyInt_AS_LONG(op1); x = (long)((unsigned long)a + (unsigned long)b); if (likely((x^a) >= 0 || (x^b) >= 0)) return PyInt_FromLong(x); return PyLong_Type.tp_as_number->nb_add(op1, op2); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; #endif if (unlikely(__Pyx_PyLong_IsZero(op1))) { return __Pyx_NewRef(op2); } if (likely(__Pyx_PyLong_IsCompact(op1))) { a = __Pyx_PyLong_CompactValue(op1); } else { const digit* digits = __Pyx_PyLong_Digits(op1); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_add(op1, op2); } } x = a + b; return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla + llb; return PyLong_FromLongLong(llx); #endif } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif double result; PyFPE_START_PROTECT("add", return NULL) result = ((double)a) + (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); } #endif /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP __Pyx_TypeName type_name; PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) #elif PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (likely(descr != NULL)) { *method = descr; return 0; } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(name)); #endif __Pyx_DECREF_TypeName(type_name); return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_CallOneArg(method, obj); Py_DECREF(method); return result; } if (unlikely(!method)) goto bad; result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* ValidateBasesTuple */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; #if CYTHON_ASSUME_SAFE_MACROS n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); if (n < 0) return -1; #endif for (i = 1; i < n; i++) { #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; #elif CYTHON_ASSUME_SAFE_MACROS PyObject *b0 = PyTuple_GET_ITEM(bases, i); #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; #endif PyTypeObject *b; #if PY_MAJOR_VERSION < 3 if (PyClass_Check(b0)) { PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); __Pyx_DECREF_TypeName(b_name); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); if (!py_b_dictoffset) goto dictoffset_return; b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); Py_DECREF(py_b_dictoffset); if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; #endif if (b_dictoffset) { { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "extension type '%.200s' has no __dict__ slot, " "but base type '" __Pyx_FMT_TYPENAME "' has: " "either add 'cdef dict __dict__' to the extension type " "or add '__slots__ = [...]' to the base type", type_name, b_name); __Pyx_DECREF_TypeName(b_name); } #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif } return 0; } #endif /* PyType_Ready */ static int __Pyx_PyType_Ready(PyTypeObject *t) { #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS (void)__Pyx_validate_bases_tuple; #endif return PyType_Ready(t); #else int r; PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 gc_was_enabled = PyGC_Disable(); (void)__Pyx_PyObject_CallMethod0; #else PyObject *ret, *py_status; PyObject *gc = NULL; #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) gc = PyImport_GetModule(__pyx_kp_u_gc); #endif if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); if (unlikely(!gc)) return -1; py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; } gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; } Py_DECREF(ret); } else if (unlikely(gc_was_enabled == -1)) { Py_DECREF(gc); return -1; } #endif t->tp_flags |= Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A0000 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; #endif #else (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) PyGC_Enable(); #else if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); } else { Py_XDECREF(tp); Py_XDECREF(v); Py_XDECREF(tb); r = -1; } } Py_DECREF(gc); #endif } #endif return r; #endif } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, attr_name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(attr_name)); #endif __Pyx_DECREF_TypeName(type_name); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* PyObject_GenericGetAttr */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { return PyObject_GenericGetAttr(obj, attr_name); } return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); } #endif /* SetVTable */ static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) { PyObject *ob = PyCapsule_New(vtable, 0, 0); if (unlikely(!ob)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_n_s_pyx_vtable, ob) < 0)) #else if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_n_s_pyx_vtable, ob) < 0)) #endif goto bad; Py_DECREF(ob); return 0; bad: Py_XDECREF(ob); return -1; } /* GetVTable */ static void* __Pyx_GetVtable(PyTypeObject *type) { void* ptr; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable); #else PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable); #endif if (!ob) goto bad; ptr = PyCapsule_GetPointer(ob, 0); if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } /* MergeVTables */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_MergeVtables(PyTypeObject *type) { int i; void** base_vtables; __Pyx_TypeName tp_base_name; __Pyx_TypeName base_name; void* unknown = (void*)-1; PyObject* bases = type->tp_bases; int base_depth = 0; { PyTypeObject* base = type->tp_base; while (base) { base_depth += 1; base = base->tp_base; } } base_vtables = (void**) malloc(sizeof(void*) * (size_t)(base_depth + 1)); base_vtables[0] = unknown; for (i = 1; i < PyTuple_GET_SIZE(bases); i++) { void* base_vtable = __Pyx_GetVtable(((PyTypeObject*)PyTuple_GET_ITEM(bases, i))); if (base_vtable != NULL) { int j; PyTypeObject* base = type->tp_base; for (j = 0; j < base_depth; j++) { if (base_vtables[j] == unknown) { base_vtables[j] = __Pyx_GetVtable(base); base_vtables[j + 1] = unknown; } if (base_vtables[j] == base_vtable) { break; } else if (base_vtables[j] == NULL) { goto bad; } base = base->tp_base; } } } PyErr_Clear(); free(base_vtables); return 0; bad: tp_base_name = __Pyx_PyType_GetName(type->tp_base); base_name = __Pyx_PyType_GetName((PyTypeObject*)PyTuple_GET_ITEM(bases, i)); PyErr_Format(PyExc_TypeError, "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name); __Pyx_DECREF_TypeName(tp_base_name); __Pyx_DECREF_TypeName(base_name); free(base_vtables); return -1; } #endif /* SetupReduce */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { int ret; PyObject *name_attr; name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name); if (likely(name_attr)) { ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); } else { ret = -1; } if (unlikely(ret < 0)) { PyErr_Clear(); ret = 0; } Py_XDECREF(name_attr); return ret; } static int __Pyx_setup_reduce(PyObject* type_obj) { int ret = 0; PyObject *object_reduce = NULL; PyObject *object_getstate = NULL; PyObject *object_reduce_ex = NULL; PyObject *reduce = NULL; PyObject *reduce_ex = NULL; PyObject *reduce_cython = NULL; PyObject *setstate = NULL; PyObject *setstate_cython = NULL; PyObject *getstate = NULL; #if CYTHON_USE_PYTYPE_LOOKUP getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate); #else getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate); if (!getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (getstate) { #if CYTHON_USE_PYTYPE_LOOKUP object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate); #else object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate); if (!object_getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (object_getstate != getstate) { goto __PYX_GOOD; } } #if CYTHON_USE_PYTYPE_LOOKUP object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #else object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #endif reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; if (reduce_ex == object_reduce_ex) { #if CYTHON_USE_PYTYPE_LOOKUP object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #else object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #endif reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); if (likely(reduce_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (reduce == object_reduce || PyErr_Occurred()) { goto __PYX_BAD; } setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate); if (!setstate) PyErr_Clear(); if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); if (likely(setstate_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (!setstate || PyErr_Occurred()) { goto __PYX_BAD; } } PyType_Modified((PyTypeObject*)type_obj); } } goto __PYX_GOOD; __PYX_BAD: if (!PyErr_Occurred()) { __Pyx_TypeName type_obj_name = __Pyx_PyType_GetName((PyTypeObject*)type_obj); PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name); __Pyx_DECREF_TypeName(type_obj_name); } ret = -1; __PYX_GOOD: #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); Py_XDECREF(object_getstate); Py_XDECREF(getstate); #endif Py_XDECREF(reduce); Py_XDECREF(reduce_ex); Py_XDECREF(reduce_cython); Py_XDECREF(setstate); Py_XDECREF(setstate_cython); return ret; } #endif /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType_3_0_10 #define __PYX_HAVE_RT_ImportType_3_0_10 static PyTypeObject *__Pyx_ImportType_3_0_10(PyObject *module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_10 check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; Py_ssize_t itemsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; PyObject *py_itemsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #if !CYTHON_COMPILING_IN_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; itemsize = ((PyTypeObject *)result)->tp_itemsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); if (!py_itemsize) goto bad; itemsize = PyLong_AsSsize_t(py_itemsize); Py_DECREF(py_itemsize); py_itemsize = 0; if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (itemsize) { if (size % alignment) { alignment = size % alignment; } if (itemsize < (Py_ssize_t)alignment) itemsize = (Py_ssize_t)alignment; } if ((size_t)(basicsize + itemsize) < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize+itemsize); goto bad; } if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_10 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd-%zd from PyObject", module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_10 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(result); return NULL; } #endif /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s__11; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__12); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* Py3UpdateBases */ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases) { Py_ssize_t i, j, size_bases; PyObject *base, *meth, *new_base, *result, *new_bases = NULL; size_bases = PyTuple_GET_SIZE(bases); for (i = 0; i < size_bases; i++) { base = PyTuple_GET_ITEM(bases, i); if (PyType_Check(base)) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { goto error; } } continue; } meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_n_s_mro_entries); if (!meth && PyErr_Occurred()) { goto error; } if (!meth) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { goto error; } } continue; } new_base = __Pyx_PyObject_CallOneArg(meth, bases); Py_DECREF(meth); if (!new_base) { goto error; } if (!PyTuple_Check(new_base)) { PyErr_SetString(PyExc_TypeError, "__mro_entries__ must return a tuple"); Py_DECREF(new_base); goto error; } if (!new_bases) { if (!(new_bases = PyList_New(i))) { goto error; } for (j = 0; j < i; j++) { base = PyTuple_GET_ITEM(bases, j); PyList_SET_ITEM(new_bases, j, base); Py_INCREF(base); } } j = PyList_GET_SIZE(new_bases); if (PyList_SetSlice(new_bases, j, j, new_base) < 0) { goto error; } Py_DECREF(new_base); } if (!new_bases) { Py_INCREF(bases); return bases; } result = PyList_AsTuple(new_bases); Py_DECREF(new_bases); return result; error: Py_XDECREF(new_bases); return NULL; } /* CalculateMetaclass */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases; #if CYTHON_ASSUME_SAFE_MACROS nbases = PyTuple_GET_SIZE(bases); #else nbases = PyTuple_Size(bases); if (nbases < 0) return NULL; #endif for (i=0; i < nbases; i++) { PyTypeObject *tmptype; #if CYTHON_ASSUME_SAFE_MACROS PyObject *tmp = PyTuple_GET_ITEM(bases, i); #else PyObject *tmp = PyTuple_GetItem(bases, i); if (!tmp) return NULL; #endif tmptype = Py_TYPE(tmp); #if PY_MAJOR_VERSION < 3 if (tmptype == &PyClass_Type) continue; #endif if (!metaclass) { metaclass = tmptype; continue; } if (PyType_IsSubtype(metaclass, tmptype)) continue; if (PyType_IsSubtype(tmptype, metaclass)) { metaclass = tmptype; continue; } PyErr_SetString(PyExc_TypeError, "metaclass conflict: " "the metaclass of a derived class " "must be a (non-strict) subclass " "of the metaclasses of all its bases"); return NULL; } if (!metaclass) { #if PY_MAJOR_VERSION < 3 metaclass = &PyClass_Type; #else metaclass = &PyType_Type; #endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; } /* PyObjectCall2Args */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args[3] = {NULL, arg1, arg2}; return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectLookupSpecial */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) { PyObject *res; PyTypeObject *tp = Py_TYPE(obj); #if PY_MAJOR_VERSION < 3 if (unlikely(PyInstance_Check(obj))) return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name); #endif res = _PyType_Lookup(tp, attr_name); if (likely(res)) { descrgetfunc f = Py_TYPE(res)->tp_descr_get; if (!f) { Py_INCREF(res); } else { res = f(res, obj, (PyObject *)tp); } } else if (with_error) { PyErr_SetObject(PyExc_AttributeError, attr_name); } return res; } #endif /* Py3ClassCreate */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; if (metaclass) { PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare); if (prep) { PyObject *pargs[3] = {NULL, name, bases}; ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); Py_DECREF(prep); } else { if (unlikely(PyErr_Occurred())) return NULL; ns = PyDict_New(); } } else { ns = PyDict_New(); } if (unlikely(!ns)) return NULL; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; #if PY_VERSION_HEX >= 0x03030000 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; #else CYTHON_MAYBE_UNUSED_VAR(qualname); #endif if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; return ns; bad: Py_DECREF(ns); return NULL; } #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS static int __Pyx_SetNamesPEP487(PyObject *type_obj) { PyTypeObject *type = (PyTypeObject*) type_obj; PyObject *names_to_set, *key, *value, *set_name, *tmp; Py_ssize_t i = 0; #if CYTHON_USE_TYPE_SLOTS names_to_set = PyDict_Copy(type->tp_dict); #else { PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict); names_to_set = NULL; if (likely(d)) { PyObject *names_to_set = PyDict_New(); int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1; Py_DECREF(d); if (unlikely(ret < 0)) Py_CLEAR(names_to_set); } } #endif if (unlikely(names_to_set == NULL)) goto bad; while (PyDict_Next(names_to_set, &i, &key, &value)) { set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name); if (unlikely(set_name != NULL)) { tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key); Py_DECREF(set_name); if (unlikely(tmp == NULL)) { __Pyx_TypeName value_type_name = __Pyx_PyType_GetName(Py_TYPE(value)); __Pyx_TypeName type_name = __Pyx_PyType_GetName(type); PyErr_Format(PyExc_RuntimeError, #if PY_MAJOR_VERSION >= 3 "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'", value_type_name, key, type_name); #else "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'", value_type_name, PyString_Check(key) ? PyString_AS_STRING(key) : "?", type_name); #endif goto bad; } else { Py_DECREF(tmp); } } else if (unlikely(PyErr_Occurred())) { goto bad; } } Py_DECREF(names_to_set); return 0; bad: Py_XDECREF(names_to_set); return -1; } static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) { #if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS PyTypeObject *type = (PyTypeObject*) type_obj; PyObject *mro = type->tp_mro; Py_ssize_t i, nbases; if (unlikely(!mro)) goto done; (void) &__Pyx_GetBuiltinName; Py_INCREF(mro); nbases = PyTuple_GET_SIZE(mro); assert(PyTuple_GET_ITEM(mro, 0) == type_obj); for (i = 1; i < nbases-1; i++) { PyObject *base, *dict, *meth; base = PyTuple_GET_ITEM(mro, i); dict = ((PyTypeObject *)base)->tp_dict; meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass); if (unlikely(meth)) { descrgetfunc f = Py_TYPE(meth)->tp_descr_get; PyObject *res; Py_INCREF(meth); if (likely(f)) { res = f(meth, NULL, type_obj); Py_DECREF(meth); if (unlikely(!res)) goto bad; meth = res; } res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw); Py_DECREF(meth); if (unlikely(!res)) goto bad; Py_DECREF(res); goto done; } else if (unlikely(PyErr_Occurred())) { goto bad; } } done: Py_XDECREF(mro); return type_obj; bad: Py_XDECREF(mro); Py_DECREF(type_obj); return NULL; #else PyObject *super_type, *super, *func, *res; #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) super_type = __Pyx_GetBuiltinName(__pyx_n_s_super); #else super_type = (PyObject*) &PySuper_Type; (void) &__Pyx_GetBuiltinName; #endif super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL; #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) Py_XDECREF(super_type); #endif if (unlikely(!super)) { Py_CLEAR(type_obj); goto done; } func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass); Py_DECREF(super); if (likely(!func)) { if (unlikely(PyErr_Occurred())) Py_CLEAR(type_obj); goto done; } res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw); Py_DECREF(func); if (unlikely(!res)) Py_CLEAR(type_obj); Py_XDECREF(res); done: return type_obj; #endif } #endif static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass) { PyObject *result; PyObject *owned_metaclass = NULL; PyObject *margs[4] = {NULL, name, bases, dict}; if (allow_py2_metaclass) { owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { PyErr_Clear(); } else { return NULL; } } if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); Py_XDECREF(owned_metaclass); if (unlikely(!metaclass)) return NULL; owned_metaclass = metaclass; } result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, #if PY_VERSION_HEX < 0x030600A4 (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw #else mkw #endif ); Py_XDECREF(owned_metaclass); #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS if (likely(result) && likely(PyType_Check(result))) { if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) { Py_CLEAR(result); } else { result = __Pyx_InitSubclassPEP487(result, mkw); } } #else (void) &__Pyx_GetBuiltinName; #endif return result; } /* ClassMethod */ static PyObject* __Pyx_Method_ClassMethod(PyObject *method) { #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM <= 0x05080000 if (PyObject_TypeCheck(method, &PyWrapperDescr_Type)) { return PyClassMethod_New(method); } #else #if CYTHON_COMPILING_IN_PYPY if (PyMethodDescr_Check(method)) #else #if PY_MAJOR_VERSION == 2 static PyTypeObject *methoddescr_type = NULL; if (unlikely(methoddescr_type == NULL)) { PyObject *meth = PyObject_GetAttrString((PyObject*)&PyList_Type, "append"); if (unlikely(!meth)) return NULL; methoddescr_type = Py_TYPE(meth); Py_DECREF(meth); } #else PyTypeObject *methoddescr_type = &PyMethodDescr_Type; #endif if (__Pyx_TypeCheck(method, methoddescr_type)) #endif { PyMethodDescrObject *descr = (PyMethodDescrObject *)method; #if PY_VERSION_HEX < 0x03020000 PyTypeObject *d_type = descr->d_type; #else PyTypeObject *d_type = descr->d_common.d_type; #endif return PyDescr_NewClassMethod(d_type, descr->d_method); } #endif else if (PyMethod_Check(method)) { return PyClassMethod_New(PyMethod_GET_FUNCTION(method)); } else { return PyClassMethod_New(method); } } /* GetNameInClass */ static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) { PyObject *result; PyObject *dict; assert(PyType_Check(nmspace)); #if CYTHON_USE_TYPE_SLOTS dict = ((PyTypeObject*)nmspace)->tp_dict; Py_XINCREF(dict); #else dict = PyObject_GetAttr(nmspace, __pyx_n_s_dict); #endif if (likely(dict)) { result = PyObject_GetItem(dict, name); Py_DECREF(dict); if (result) { return result; } } PyErr_Clear(); __Pyx_GetModuleGlobalNameUncached(result, name); return result; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (int) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (int) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = __Pyx_NewRef(v); } val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntFromPy */ static CYTHON_INLINE unsigned char __Pyx_PyInt_As_unsigned_char(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const unsigned char neg_one = (unsigned char) -1, const_zero = (unsigned char) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(unsigned char) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(unsigned char, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (unsigned char) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(unsigned char, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(unsigned char) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned char) >= 2 * PyLong_SHIFT)) { return (unsigned char) (((((unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])); } } break; case 3: if ((8 * sizeof(unsigned char) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned char) >= 3 * PyLong_SHIFT)) { return (unsigned char) (((((((unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])); } } break; case 4: if ((8 * sizeof(unsigned char) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned char) >= 4 * PyLong_SHIFT)) { return (unsigned char) (((((((((unsigned char)digits[3]) << PyLong_SHIFT) | (unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (unsigned char) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(unsigned char) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(unsigned char, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(unsigned char) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(unsigned char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(unsigned char, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(unsigned char) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned char) - 1 > 2 * PyLong_SHIFT)) { return (unsigned char) (((unsigned char)-1)*(((((unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]))); } } break; case 2: if ((8 * sizeof(unsigned char) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned char) - 1 > 2 * PyLong_SHIFT)) { return (unsigned char) ((((((unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]))); } } break; case -3: if ((8 * sizeof(unsigned char) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned char) - 1 > 3 * PyLong_SHIFT)) { return (unsigned char) (((unsigned char)-1)*(((((((unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]))); } } break; case 3: if ((8 * sizeof(unsigned char) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned char) - 1 > 3 * PyLong_SHIFT)) { return (unsigned char) ((((((((unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]))); } } break; case -4: if ((8 * sizeof(unsigned char) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned char) - 1 > 4 * PyLong_SHIFT)) { return (unsigned char) (((unsigned char)-1)*(((((((((unsigned char)digits[3]) << PyLong_SHIFT) | (unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]))); } } break; case 4: if ((8 * sizeof(unsigned char) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned char) - 1 > 4 * PyLong_SHIFT)) { return (unsigned char) ((((((((((unsigned char)digits[3]) << PyLong_SHIFT) | (unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]))); } } break; } } #endif if ((sizeof(unsigned char) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(unsigned char, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(unsigned char) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(unsigned char, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { unsigned char val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (unsigned char) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (unsigned char) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (unsigned char) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (unsigned char) -1; } else { stepval = __Pyx_NewRef(v); } val = (unsigned char) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(unsigned char) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((unsigned char) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(unsigned char) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((unsigned char) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((unsigned char) 1) << (sizeof(unsigned char) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (unsigned char) -1; } } else { unsigned char val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (unsigned char) -1; val = __Pyx_PyInt_As_unsigned_char(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to unsigned char"); return (unsigned char) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to unsigned char"); return (unsigned char) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PY_LONG_LONG(PY_LONG_LONG value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PY_LONG_LONG neg_one = (PY_LONG_LONG) -1, const_zero = (PY_LONG_LONG) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PY_LONG_LONG) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PY_LONG_LONG) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PY_LONG_LONG) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(PY_LONG_LONG), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PY_LONG_LONG)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_As_PY_LONG_LONG(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PY_LONG_LONG neg_one = (PY_LONG_LONG) -1, const_zero = (PY_LONG_LONG) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(PY_LONG_LONG) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (PY_LONG_LONG) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(PY_LONG_LONG) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PY_LONG_LONG) >= 2 * PyLong_SHIFT)) { return (PY_LONG_LONG) (((((PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])); } } break; case 3: if ((8 * sizeof(PY_LONG_LONG) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PY_LONG_LONG) >= 3 * PyLong_SHIFT)) { return (PY_LONG_LONG) (((((((PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])); } } break; case 4: if ((8 * sizeof(PY_LONG_LONG) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PY_LONG_LONG) >= 4 * PyLong_SHIFT)) { return (PY_LONG_LONG) (((((((((PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PY_LONG_LONG) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(PY_LONG_LONG) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(PY_LONG_LONG) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT)) { return (PY_LONG_LONG) (((PY_LONG_LONG)-1)*(((((PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]))); } } break; case 2: if ((8 * sizeof(PY_LONG_LONG) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT)) { return (PY_LONG_LONG) ((((((PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]))); } } break; case -3: if ((8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT)) { return (PY_LONG_LONG) (((PY_LONG_LONG)-1)*(((((((PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]))); } } break; case 3: if ((8 * sizeof(PY_LONG_LONG) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT)) { return (PY_LONG_LONG) ((((((((PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]))); } } break; case -4: if ((8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT)) { return (PY_LONG_LONG) (((PY_LONG_LONG)-1)*(((((((((PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]))); } } break; case 4: if ((8 * sizeof(PY_LONG_LONG) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT)) { return (PY_LONG_LONG) ((((((((((PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]))); } } break; } } #endif if ((sizeof(PY_LONG_LONG) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(PY_LONG_LONG) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { PY_LONG_LONG val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (PY_LONG_LONG) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (PY_LONG_LONG) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PY_LONG_LONG) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (PY_LONG_LONG) -1; } else { stepval = __Pyx_NewRef(v); } val = (PY_LONG_LONG) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(PY_LONG_LONG) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((PY_LONG_LONG) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(PY_LONG_LONG) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((PY_LONG_LONG) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((PY_LONG_LONG) 1) << (sizeof(PY_LONG_LONG) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (PY_LONG_LONG) -1; } } else { PY_LONG_LONG val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (PY_LONG_LONG) -1; val = __Pyx_PyInt_As_PY_LONG_LONG(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to PY_LONG_LONG"); return (PY_LONG_LONG) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PY_LONG_LONG"); return (PY_LONG_LONG) -1; } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__69); } return name; } #endif /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (long) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (long) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = __Pyx_NewRef(v); } val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CheckBinaryVersion */ static unsigned long __Pyx_get_runtime_version(void) { #if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/crypto/low_level.pyx0000644000076500000240000005037514641074756020032 0ustar00twstaff"""An AEAD style OpenSSL wrapper API: encrypt(data, header=b'', aad_offset=0) -> envelope decrypt(envelope, header_len=0, aad_offset=0) -> data Envelope layout: |<--------------------------- envelope ------------------------------------------>| |<------------ header ----------->|<---------- ciphersuite specific ------------->| |<-- not auth data -->|<-- aad -->|<-- e.g.: S(aad, iv, E(data)), iv, E(data) -->| |--- #aad_offset ---->| |------------- #header_len ------>| S means a cryptographic signature function (like HMAC or GMAC). E means a encryption function (like AES). iv is the initialization vector / nonce, if needed. The split of header into not authenticated data and aad (additional authenticated data) is done to support the legacy envelope layout as used in attic and early borg (where the TYPE byte was not authenticated) and avoid unneeded memcpy and string garbage. Newly designed envelope layouts can just authenticate the whole header. IV handling: iv = ... # just never repeat! cs = CS(hmac_key, enc_key, iv=iv) envelope = cs.encrypt(data, header, aad_offset) iv = cs.next_iv(len(data)) (repeat) """ import hashlib import hmac from math import ceil from cpython cimport PyMem_Malloc, PyMem_Free from cpython.buffer cimport PyBUF_SIMPLE, PyObject_GetBuffer, PyBuffer_Release from cpython.bytes cimport PyBytes_FromStringAndSize API_VERSION = '1.4_01' cdef extern from "openssl/crypto.h": int CRYPTO_memcmp(const void *a, const void *b, size_t len) cdef extern from "openssl/evp.h": ctypedef struct EVP_MD: pass ctypedef struct EVP_CIPHER: pass ctypedef struct EVP_CIPHER_CTX: pass ctypedef struct ENGINE: pass const EVP_CIPHER *EVP_aes_256_ctr() EVP_CIPHER_CTX *EVP_CIPHER_CTX_new() void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *a) void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *a) void EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *a) int EVP_EncryptInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, ENGINE *impl, const unsigned char *key, const unsigned char *iv) int EVP_DecryptInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, ENGINE *impl, const unsigned char *key, const unsigned char *iv) int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, const unsigned char *in_, int inl) int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, const unsigned char *in_, int inl) int EVP_EncryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr) const EVP_MD *EVP_sha256() nogil cdef extern from "_crypto_helpers.h": long OPENSSL_VERSION_NUMBER import struct _int = struct.Struct('>I') _long = struct.Struct('>Q') bytes_to_int = lambda x, offset=0: _int.unpack_from(x, offset)[0] bytes_to_long = lambda x, offset=0: _long.unpack_from(x, offset)[0] long_to_bytes = lambda x: _long.pack(x) def num_cipher_blocks(length, blocksize=16): """Return the number of cipher blocks required to encrypt/decrypt bytes of data. For a precise computation, must be the used cipher's block size (AES: 16). For a safe-upper-boundary computation, must be the MINIMUM of the block sizes (in bytes) of ALL supported ciphers. This can be used to adjust a counter if the used cipher is not known (yet). The default value of blocksize must be adjusted so it reflects this minimum, so a call of this function without a blocksize is "safe-upper-boundary by default". Padding cipher modes are not supported. """ return (length + blocksize - 1) // blocksize class CryptoError(Exception): """Malfunction in the crypto module.""" class IntegrityError(CryptoError): """Integrity checks failed. Corrupted or tampered data.""" cdef Py_buffer ro_buffer(object data) except *: cdef Py_buffer view PyObject_GetBuffer(data, &view, PyBUF_SIMPLE) return view class UNENCRYPTED: # Layout: HEADER + PlainText def __init__(self, mac_key, enc_key, iv=None, header_len=1, aad_offset=1): assert mac_key is None assert enc_key is None self.header_len = header_len self.set_iv(iv) def encrypt(self, data, header=b'', iv=None): """ IMPORTANT: it is called encrypt to satisfy the crypto api naming convention, but this does NOT encrypt and it does NOT compute and store a MAC either. """ if iv is not None: self.set_iv(iv) assert self.iv is not None, 'iv needs to be set before encrypt is called' return header + data def decrypt(self, envelope): """ IMPORTANT: it is called decrypt to satisfy the crypto api naming convention, but this does NOT decrypt and it does NOT verify a MAC either, because data is not encrypted and there is no MAC. """ return memoryview(envelope)[self.header_len:] def block_count(self, length): return 0 def set_iv(self, iv): self.iv = iv def next_iv(self): return self.iv def extract_iv(self, envelope): return 0 cdef class AES256_CTR_BASE: # Layout: HEADER + MAC 32 + IV 8 + CT (same as attic / borg < 1.2 IF HEADER = TYPE_BYTE, no AAD) cdef EVP_CIPHER_CTX *ctx cdef unsigned char enc_key[32] cdef int cipher_blk_len cdef int iv_len, iv_len_short cdef int aad_offset cdef int header_len cdef int mac_len cdef unsigned char iv[16] cdef long long blocks @classmethod def requirements_check(cls): if OPENSSL_VERSION_NUMBER < 0x10000000: raise ValueError('AES CTR requires OpenSSL >= 1.0.0. Detected: OpenSSL %08x' % OPENSSL_VERSION_NUMBER) def __init__(self, mac_key, enc_key, iv=None, header_len=1, aad_offset=1): self.requirements_check() assert isinstance(enc_key, bytes) and len(enc_key) == 32 self.cipher_blk_len = 16 self.iv_len = sizeof(self.iv) self.iv_len_short = 8 assert aad_offset <= header_len self.aad_offset = aad_offset self.header_len = header_len self.mac_len = 32 self.enc_key = enc_key if iv is not None: self.set_iv(iv) else: self.blocks = -1 # make sure set_iv is called before encrypt def __cinit__(self, mac_key, enc_key, iv=None, header_len=1, aad_offset=1): self.ctx = EVP_CIPHER_CTX_new() def __dealloc__(self): EVP_CIPHER_CTX_free(self.ctx) cdef mac_compute(self, const unsigned char *data1, int data1_len, const unsigned char *data2, int data2_len, unsigned char *mac_buf): raise NotImplementedError cdef mac_verify(self, const unsigned char *data1, int data1_len, const unsigned char *data2, int data2_len, unsigned char *mac_buf, const unsigned char *mac_wanted): """ Calculate MAC of *data1*, *data2*, write result to *mac_buf*, and verify against *mac_wanted.* """ raise NotImplementedError def encrypt(self, data, header=b'', iv=None): """ encrypt data, compute mac over aad + iv + cdata, prepend header. aad_offset is the offset into the header where aad starts. """ if iv is not None: self.set_iv(iv) assert self.blocks == 0, 'iv needs to be set before encrypt is called' cdef int ilen = len(data) cdef int hlen = len(header) assert hlen == self.header_len cdef int aoffset = self.aad_offset cdef int alen = hlen - aoffset cdef unsigned char *odata = PyMem_Malloc(hlen + self.mac_len + self.iv_len_short + ilen + self.cipher_blk_len) # play safe, 1 extra blk if not odata: raise MemoryError cdef int olen cdef int offset cdef Py_buffer idata = ro_buffer(data) cdef Py_buffer hdata = ro_buffer(header) try: offset = 0 for i in range(hlen): odata[offset+i] = header[i] offset += hlen offset += self.mac_len self.store_iv(odata+offset, self.iv) offset += self.iv_len_short rc = EVP_EncryptInit_ex(self.ctx, EVP_aes_256_ctr(), NULL, self.enc_key, self.iv) if not rc: raise CryptoError('EVP_EncryptInit_ex failed') rc = EVP_EncryptUpdate(self.ctx, odata+offset, &olen, idata.buf, ilen) if not rc: raise CryptoError('EVP_EncryptUpdate failed') offset += olen rc = EVP_EncryptFinal_ex(self.ctx, odata+offset, &olen) if not rc: raise CryptoError('EVP_EncryptFinal_ex failed') offset += olen self.mac_compute( hdata.buf+aoffset, alen, odata+hlen+self.mac_len, offset-hlen-self.mac_len, odata+hlen) self.blocks += self.block_count(ilen) return odata[:offset] finally: PyMem_Free(odata) PyBuffer_Release(&hdata) PyBuffer_Release(&idata) def decrypt(self, envelope): """ authenticate aad + iv + cdata, decrypt cdata, ignore header bytes up to aad_offset. """ cdef int ilen = len(envelope) cdef int hlen = self.header_len assert hlen == self.header_len cdef int aoffset = self.aad_offset cdef int alen = hlen - aoffset cdef unsigned char *odata = PyMem_Malloc(ilen + self.cipher_blk_len) # play safe, 1 extra blk if not odata: raise MemoryError cdef int olen cdef int offset cdef unsigned char mac_buf[32] assert sizeof(mac_buf) == self.mac_len cdef Py_buffer idata = ro_buffer(envelope) try: self.mac_verify( idata.buf+aoffset, alen, idata.buf+hlen+self.mac_len, ilen-hlen-self.mac_len, mac_buf, idata.buf+hlen) iv = self.fetch_iv( idata.buf+hlen+self.mac_len) self.set_iv(iv) if not EVP_DecryptInit_ex(self.ctx, EVP_aes_256_ctr(), NULL, self.enc_key, iv): raise CryptoError('EVP_DecryptInit_ex failed') offset = 0 rc = EVP_DecryptUpdate(self.ctx, odata+offset, &olen, idata.buf+hlen+self.mac_len+self.iv_len_short, ilen-hlen-self.mac_len-self.iv_len_short) if not rc: raise CryptoError('EVP_DecryptUpdate failed') offset += olen rc = EVP_DecryptFinal_ex(self.ctx, odata+offset, &olen) if rc <= 0: raise CryptoError('EVP_DecryptFinal_ex failed') offset += olen self.blocks += self.block_count(offset) return odata[:offset] finally: PyMem_Free(odata) PyBuffer_Release(&idata) def block_count(self, length): return num_cipher_blocks(length, self.cipher_blk_len) def set_iv(self, iv): # set_iv needs to be called before each encrypt() call if isinstance(iv, int): iv = iv.to_bytes(self.iv_len, byteorder='big') assert isinstance(iv, bytes) and len(iv) == self.iv_len self.iv = iv self.blocks = 0 # how many AES blocks got encrypted with this IV? def next_iv(self): # call this after encrypt() to get the next iv (int) for the next encrypt() call iv = int.from_bytes(self.iv[:self.iv_len], byteorder='big') return iv + self.blocks cdef fetch_iv(self, unsigned char * iv_in): # fetch lower self.iv_len_short bytes of iv and add upper zero bytes return b'\0' * (self.iv_len - self.iv_len_short) + iv_in[0:self.iv_len_short] cdef store_iv(self, unsigned char * iv_out, unsigned char * iv): # store only lower self.iv_len_short bytes, upper bytes are assumed to be 0 cdef int i for i in range(self.iv_len_short): iv_out[i] = iv[(self.iv_len-self.iv_len_short)+i] def extract_iv(self, envelope): offset = self.header_len + self.mac_len return bytes_to_long(envelope[offset:offset+self.iv_len_short]) cdef class AES256_CTR_HMAC_SHA256(AES256_CTR_BASE): cdef unsigned char mac_key[32] def __init__(self, mac_key, enc_key, iv=None, header_len=1, aad_offset=1): assert isinstance(mac_key, bytes) and len(mac_key) == 32 self.mac_key = mac_key super().__init__(mac_key, enc_key, iv=iv, header_len=header_len, aad_offset=aad_offset) def __cinit__(self, mac_key, enc_key, iv=None, header_len=1, aad_offset=1): pass def __dealloc__(self): pass cdef mac_compute(self, const unsigned char *data1, int data1_len, const unsigned char *data2, int data2_len, unsigned char *mac_buf): data = data1[:data1_len] + data2[:data2_len] mac = hmac.digest(self.mac_key[:self.mac_len], data, 'sha256') for i in range(self.mac_len): mac_buf[i] = mac[i] cdef mac_verify(self, const unsigned char *data1, int data1_len, const unsigned char *data2, int data2_len, unsigned char *mac_buf, const unsigned char *mac_wanted): self.mac_compute(data1, data1_len, data2, data2_len, mac_buf) if CRYPTO_memcmp(mac_buf, mac_wanted, self.mac_len): raise IntegrityError('MAC Authentication failed') cdef class AES256_CTR_BLAKE2b(AES256_CTR_BASE): cdef unsigned char mac_key[128] def __init__(self, mac_key, enc_key, iv=None, header_len=1, aad_offset=1): assert isinstance(mac_key, bytes) and len(mac_key) == 128 self.mac_key = mac_key super().__init__(mac_key, enc_key, iv=iv, header_len=header_len, aad_offset=aad_offset) def __cinit__(self, mac_key, enc_key, iv=None, header_len=1, aad_offset=1): pass def __dealloc__(self): pass cdef mac_compute(self, const unsigned char *data1, int data1_len, const unsigned char *data2, int data2_len, unsigned char *mac_buf): data = self.mac_key[:128] + data1[:data1_len] + data2[:data2_len] mac = hashlib.blake2b(data, digest_size=self.mac_len).digest() for i in range(self.mac_len): mac_buf[i] = mac[i] cdef mac_verify(self, const unsigned char *data1, int data1_len, const unsigned char *data2, int data2_len, unsigned char *mac_buf, const unsigned char *mac_wanted): self.mac_compute(data1, data1_len, data2, data2_len, mac_buf) if CRYPTO_memcmp(mac_buf, mac_wanted, self.mac_len): raise IntegrityError('MAC Authentication failed') ctypedef const EVP_CIPHER * (* CIPHER)() cdef class AES: """A thin wrapper around the OpenSSL EVP cipher API - for legacy code, like key file encryption""" cdef CIPHER cipher cdef EVP_CIPHER_CTX *ctx cdef unsigned char enc_key[32] cdef int cipher_blk_len cdef int iv_len cdef unsigned char iv[16] cdef long long blocks def __init__(self, enc_key, iv=None): assert isinstance(enc_key, bytes) and len(enc_key) == 32 self.enc_key = enc_key self.iv_len = 16 assert sizeof(self.iv) == self.iv_len self.cipher = EVP_aes_256_ctr self.cipher_blk_len = 16 if iv is not None: self.set_iv(iv) else: self.blocks = -1 # make sure set_iv is called before encrypt def __cinit__(self, enc_key, iv=None): self.ctx = EVP_CIPHER_CTX_new() def __dealloc__(self): EVP_CIPHER_CTX_free(self.ctx) def encrypt(self, data, iv=None): if iv is not None: self.set_iv(iv) assert self.blocks == 0, 'iv needs to be set before encrypt is called' cdef Py_buffer idata = ro_buffer(data) cdef int ilen = len(data) cdef int offset cdef int olen = 0 cdef unsigned char *odata = PyMem_Malloc(ilen + self.cipher_blk_len) if not odata: raise MemoryError try: if not EVP_EncryptInit_ex(self.ctx, self.cipher(), NULL, self.enc_key, self.iv): raise Exception('EVP_EncryptInit_ex failed') offset = 0 if not EVP_EncryptUpdate(self.ctx, odata, &olen, idata.buf, ilen): raise Exception('EVP_EncryptUpdate failed') offset += olen if not EVP_EncryptFinal_ex(self.ctx, odata+offset, &olen): raise Exception('EVP_EncryptFinal failed') offset += olen self.blocks = self.block_count(offset) return odata[:offset] finally: PyMem_Free(odata) PyBuffer_Release(&idata) def decrypt(self, data): cdef Py_buffer idata = ro_buffer(data) cdef int ilen = len(data) cdef int offset cdef int olen = 0 cdef unsigned char *odata = PyMem_Malloc(ilen + self.cipher_blk_len) if not odata: raise MemoryError try: # Set cipher type and mode if not EVP_DecryptInit_ex(self.ctx, self.cipher(), NULL, self.enc_key, self.iv): raise Exception('EVP_DecryptInit_ex failed') offset = 0 if not EVP_DecryptUpdate(self.ctx, odata, &olen, idata.buf, ilen): raise Exception('EVP_DecryptUpdate failed') offset += olen if EVP_DecryptFinal_ex(self.ctx, odata+offset, &olen) <= 0: # this error check is very important for modes with padding or # authentication. for them, a failure here means corrupted data. # CTR mode does not use padding nor authentication. raise Exception('EVP_DecryptFinal failed') offset += olen self.blocks = self.block_count(ilen) return odata[:offset] finally: PyMem_Free(odata) PyBuffer_Release(&idata) def block_count(self, length): return num_cipher_blocks(length, self.cipher_blk_len) def set_iv(self, iv): # set_iv needs to be called before each encrypt() call, # because encrypt does a full initialisation of the cipher context. if isinstance(iv, int): iv = iv.to_bytes(self.iv_len, byteorder='big') assert isinstance(iv, bytes) and len(iv) == self.iv_len self.iv = iv self.blocks = 0 # number of cipher blocks encrypted with this IV def next_iv(self): # call this after encrypt() to get the next iv (int) for the next encrypt() call iv = int.from_bytes(self.iv[:self.iv_len], byteorder='big') return iv + self.blocks def hmac_sha256(key, data): return hmac.digest(key, data, 'sha256') def blake2b_256(key, data): return hashlib.blake2b(key+data, digest_size=32).digest() def blake2b_128(data): return hashlib.blake2b(data, digest_size=16).digest() def hkdf_hmac_sha512(ikm, salt, info, output_length): """ Compute HKDF-HMAC-SHA512 with input key material *ikm*, *salt* and *info* to produce *output_length* bytes. This is the "HMAC-based Extract-and-Expand Key Derivation Function (HKDF)" (RFC 5869) instantiated with HMAC-SHA512. *output_length* must not be greater than 64 * 255 bytes. """ digest_length = 64 assert output_length <= (255 * digest_length), 'output_length must be <= 255 * 64 bytes' # Step 1. HKDF-Extract (ikm, salt) -> prk if salt is None: salt = bytes(64) prk = hmac.HMAC(salt, ikm, hashlib.sha512).digest() # Step 2. HKDF-Expand (prk, info, output_length) -> output key n = ceil(output_length / digest_length) t_n = b'' output = b'' for i in range(n): msg = t_n + info + (i + 1).to_bytes(1, 'little') t_n = hmac.HMAC(prk, msg, hashlib.sha512).digest() output += t_n return output[:output_length] ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/crypto/nonces.py0000644000076500000240000001103514641074756017125 0ustar00twstaffimport os import sys from ..helpers import Error from ..helpers import get_security_dir from ..helpers import bin_to_hex, hex_to_bin from ..platform import SaveFile from ..remote import InvalidRPCMethod from .low_level import bytes_to_long, long_to_bytes MAX_REPRESENTABLE_NONCE = 2**64 - 1 NONCE_SPACE_RESERVATION = 2**28 # This in units of AES blocksize (16 bytes) class NonceManager: def __init__(self, repository, manifest_nonce): self.repository = repository self.end_of_nonce_reservation = None self.manifest_nonce = manifest_nonce self.nonce_file = os.path.join(get_security_dir(self.repository.id_str), 'nonce') def get_local_free_nonce(self): try: with open(self.nonce_file) as fd: nonce_hex = fd.read().strip() except FileNotFoundError: return None else: try: nonce_bytes = hex_to_bin(nonce_hex, length=8) except ValueError as e: raise Error(f"Local security dir has an invalid nonce file: {e}") from None return bytes_to_long(nonce_bytes) def commit_local_nonce_reservation(self, next_unreserved, start_nonce): if self.get_local_free_nonce() != start_nonce: raise Exception("nonce space reservation with mismatched previous state") with SaveFile(self.nonce_file, binary=False) as fd: fd.write(bin_to_hex(long_to_bytes(next_unreserved))) def get_repo_free_nonce(self): try: return self.repository.get_free_nonce() except InvalidRPCMethod: # old server version, suppress further calls sys.stderr.write("Please upgrade to borg version 1.1+ on the server for safer AES-CTR nonce handling.\n") self.get_repo_free_nonce = lambda: None self.commit_repo_nonce_reservation = lambda next_unreserved, start_nonce: None return None def commit_repo_nonce_reservation(self, next_unreserved, start_nonce): self.repository.commit_nonce_reservation(next_unreserved, start_nonce) def ensure_reservation(self, nonce, nonce_space_needed): """ Call this before doing encryption, give current, yet unused, integer IV as and the amount of subsequent (counter-like) IVs needed as . Return value is the IV (counter) integer you shall use for encryption. Note: this method may return the you gave, if a reservation for it exists or can be established, so make sure you give a unused nonce. """ # Nonces may never repeat, even if a transaction aborts or the system crashes. # Therefore a part of the nonce space is reserved before any nonce is used for encryption. # As these reservations are committed to permanent storage before any nonce is used, this protects # against nonce reuse in crashes and transaction aborts. In that case the reservation still # persists and the whole reserved space is never reused. # # Local storage on the client is used to protect against an attacker that is able to rollback the # state of the server or can do arbitrary modifications to the repository. # Storage on the server is used for the multi client use case where a transaction on client A is # aborted and later client B writes to the repository. # # This scheme does not protect against attacker who is able to rollback the state of the server # or can do arbitrary modifications to the repository in the multi client usecase. if self.end_of_nonce_reservation: # we already got a reservation, if nonce_space_needed still fits everything is ok next_nonce = nonce assert next_nonce <= self.end_of_nonce_reservation if next_nonce + nonce_space_needed <= self.end_of_nonce_reservation: return next_nonce repo_free_nonce = self.get_repo_free_nonce() local_free_nonce = self.get_local_free_nonce() free_nonce_space = max(x for x in (repo_free_nonce, local_free_nonce, self.manifest_nonce, self.end_of_nonce_reservation) if x is not None) reservation_end = free_nonce_space + nonce_space_needed + NONCE_SPACE_RESERVATION assert reservation_end < MAX_REPRESENTABLE_NONCE self.commit_repo_nonce_reservation(reservation_end, repo_free_nonce) self.commit_local_nonce_reservation(reservation_end, local_free_nonce) self.end_of_nonce_reservation = reservation_end return free_nonce_space ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/fuse.py0000644000076500000240000010113714641074756015265 0ustar00twstaffimport errno import functools import io import os import stat import struct import sys import tempfile import time from collections import defaultdict from signal import SIGINT from .fuse_impl import llfuse, has_pyfuse3 if has_pyfuse3: import trio def async_wrapper(fn): @functools.wraps(fn) async def wrapper(*args, **kwargs): return fn(*args, **kwargs) return wrapper else: trio = None def async_wrapper(fn): return fn from .logger import create_logger logger = create_logger() from .crypto.low_level import blake2b_128 from .archiver import Archiver from .archive import Archive, get_item_uid_gid from .hashindex import FuseVersionsIndex from .helpers import daemonize, daemonizing, hardlinkable, signal_handler, format_file_size, Error from .helpers import msgpack from .item import Item from .lrucache import LRUCache from .platform import uid2user, gid2group from .platformflags import is_darwin from .remote import RemoteRepository def fuse_main(): if has_pyfuse3: try: trio.run(llfuse.main) except: return 1 # TODO return signal number if it was killed by signal else: return None else: return llfuse.main(workers=1) # size of some LRUCaches (1 element per simultaneously open file) # note: _inode_cache might have rather large elements - Item.chunks can be large! # also, simultaneously reading too many files should be avoided anyway. # thus, do not set FILES to high values. FILES = 4 class ItemCache: """ This is the "meat" of the file system's metadata storage. This class generates inode numbers that efficiently index items in archives, and retrieves items from these inode numbers. """ # 2 MiB are approximately ~230000 items (depends on the average number of items per metadata chunk). # # Since growing a bytearray has to copy it, growing it will converge to O(n^2), however, # this is not yet relevant due to the swiftness of copying memory. If it becomes an issue, # use an anonymous mmap and just resize that (or, if on 64 bit, make it so big you never need # to resize it in the first place; that's free). GROW_META_BY = 2 * 1024 * 1024 indirect_entry_struct = struct.Struct('=cII') assert indirect_entry_struct.size == 9 def __init__(self, decrypted_repository): self.decrypted_repository = decrypted_repository # self.meta, the "meta-array" is a densely packed array of metadata about where items can be found. # It is indexed by the inode number minus self.offset. (This is in a way eerily similar to how the first # unices did this). # The meta-array contains chunk IDs and item entries (described in iter_archive_items). # The chunk IDs are referenced by item entries through relative offsets, # which are bounded by the metadata chunk size. self.meta = bytearray() # The current write offset in self.meta self.write_offset = 0 # Offset added to meta-indices, resulting in inodes, # or subtracted from inodes, resulting in meta-indices. # XXX: Merge FuseOperations.items and ItemCache to avoid # this implicit limitation / hack (on the number of synthetic inodes, degenerate # cases can inflate their number far beyond the number of archives). self.offset = 1000000 # A temporary file that contains direct items, i.e. items directly cached in this layer. # These are items that span more than one chunk and thus cannot be efficiently cached # by the object cache (self.decrypted_repository), which would require variable-length structures; # possible but not worth the effort, see iter_archive_items. self.fd = tempfile.TemporaryFile(prefix='borg-tmp') # A small LRU cache for chunks requested by ItemCache.get() from the object cache, # this significantly speeds up directory traversal and similar operations which # tend to re-read the same chunks over and over. # The capacity is kept low because increasing it does not provide any significant advantage, # but makes LRUCache's square behaviour noticeable and consumes more memory. self.chunks = LRUCache(capacity=10, dispose=lambda _: None) # Instrumentation # Count of indirect items, i.e. data is cached in the object cache, not directly in this cache self.indirect_items = 0 # Count of direct items, i.e. data is in self.fd self.direct_items = 0 def get(self, inode): offset = inode - self.offset if offset < 0: raise ValueError('ItemCache.get() called with an invalid inode number') if self.meta[offset] == ord(b'I'): _, chunk_id_relative_offset, chunk_offset = self.indirect_entry_struct.unpack_from(self.meta, offset) chunk_id_offset = offset - chunk_id_relative_offset # bytearray slices are bytearrays as well, explicitly convert to bytes() chunk_id = bytes(self.meta[chunk_id_offset:chunk_id_offset + 32]) chunk = self.chunks.get(chunk_id) if not chunk: csize, chunk = next(self.decrypted_repository.get_many([chunk_id])) self.chunks[chunk_id] = chunk data = memoryview(chunk)[chunk_offset:] unpacker = msgpack.Unpacker() unpacker.feed(data) return Item(internal_dict=next(unpacker)) elif self.meta[offset] == ord(b'S'): fd_offset = int.from_bytes(self.meta[offset + 1:offset + 9], 'little') self.fd.seek(fd_offset, io.SEEK_SET) return Item(internal_dict=next(msgpack.Unpacker(self.fd, read_size=1024))) else: raise ValueError('Invalid entry type in self.meta') def iter_archive_items(self, archive_item_ids, filter=None, consider_part_files=False): unpacker = msgpack.Unpacker() # Current offset in the metadata stream, which consists of all metadata chunks glued together stream_offset = 0 # Offset of the current chunk in the metadata stream chunk_begin = 0 # Length of the chunk preceding the current chunk last_chunk_length = 0 msgpacked_bytes = b'' write_offset = self.write_offset meta = self.meta pack_indirect_into = self.indirect_entry_struct.pack_into for key, (csize, data) in zip(archive_item_ids, self.decrypted_repository.get_many(archive_item_ids)): # Store the chunk ID in the meta-array if write_offset + 32 >= len(meta): self.meta = meta = meta + bytes(self.GROW_META_BY) meta[write_offset:write_offset + 32] = key current_id_offset = write_offset write_offset += 32 chunk_begin += last_chunk_length last_chunk_length = len(data) unpacker.feed(data) while True: try: item = unpacker.unpack() need_more_data = False except msgpack.OutOfData: need_more_data = True start = stream_offset - chunk_begin # tell() is not helpful for the need_more_data case, but we know it is the remainder # of the data in that case. in the other case, tell() works as expected. length = (len(data) - start) if need_more_data else (unpacker.tell() - stream_offset) msgpacked_bytes += data[start:start+length] stream_offset += length if need_more_data: # Need more data, feed the next chunk break item = Item(internal_dict=item) if filter and not filter(item) or not consider_part_files and 'part' in item: msgpacked_bytes = b'' continue current_item = msgpacked_bytes current_item_length = len(current_item) current_spans_chunks = stream_offset - current_item_length < chunk_begin msgpacked_bytes = b'' if write_offset + 9 >= len(meta): self.meta = meta = meta + bytes(self.GROW_META_BY) # item entries in the meta-array come in two different flavours, both nine bytes long. # (1) for items that span chunks: # # 'S' + 8 byte offset into the self.fd file, where the msgpacked item starts. # # (2) for items that are completely contained in one chunk, which usually is the great majority # (about 700:1 for system backups) # # 'I' + 4 byte offset where the chunk ID is + 4 byte offset in the chunk # where the msgpacked items starts # # The chunk ID offset is the number of bytes _back_ from the start of the entry, i.e.: # # |Chunk ID| .... |S1234abcd| # ^------ offset ----------^ if current_spans_chunks: pos = self.fd.seek(0, io.SEEK_END) self.fd.write(current_item) meta[write_offset:write_offset + 9] = b'S' + pos.to_bytes(8, 'little') self.direct_items += 1 else: item_offset = stream_offset - current_item_length - chunk_begin pack_indirect_into(meta, write_offset, b'I', write_offset - current_id_offset, item_offset) self.indirect_items += 1 inode = write_offset + self.offset write_offset += 9 yield inode, item self.write_offset = write_offset class FuseBackend: """Virtual filesystem based on archive(s) to provide information to fuse """ def __init__(self, key, manifest, repository, args, decrypted_repository): self.repository_uncached = repository self._args = args self.numeric_ids = args.numeric_ids self._manifest = manifest self.key = key # Maps inode numbers to Item instances. This is used for synthetic inodes, i.e. file-system objects that are # made up and are not contained in the archives. For example archive directories or intermediate directories # not contained in archives. self._items = {} # cache up to Items self._inode_cache = LRUCache(capacity=FILES, dispose=lambda _: None) # _inode_count is the current count of synthetic inodes, i.e. those in self._items self.inode_count = 0 # Maps inode numbers to the inode number of the parent self.parent = {} # Maps inode numbers to a dictionary mapping byte directory entry names to their inode numbers, # i.e. this contains all dirents of everything that is mounted. (It becomes really big). self.contents = defaultdict(dict) self.default_uid = os.getuid() self.default_gid = os.getgid() self.default_dir = None # Archives to be loaded when first accessed, mapped by their placeholder inode self.pending_archives = {} self.cache = ItemCache(decrypted_repository) self.allow_damaged_files = False self.versions = False self.uid_forced = None self.gid_forced = None self.umask = 0 def _create_filesystem(self): self._create_dir(parent=1) # first call, create root dir (inode == 1) if self._args.location.archive: if self.versions: raise Error("for versions view, do not specify a single archive, " "but always give the repository as location.") self._process_archive(self._args.location.archive) else: self.versions_index = FuseVersionsIndex() for archive in self._manifest.archives.list_considering(self._args): if self.versions: # process archives immediately self._process_archive(archive.name) else: # lazily load archives, create archive placeholder inode archive_inode = self._create_dir(parent=1, mtime=int(archive.ts.timestamp() * 1e9)) self.contents[1][os.fsencode(archive.name)] = archive_inode self.pending_archives[archive_inode] = archive.name def get_item(self, inode): item = self._inode_cache.get(inode) if item is not None: return item try: # this is a cheap get-from-dictionary operation, no need to cache the result. return self._items[inode] except KeyError: # while self.cache does some internal caching, it has still quite some overhead, so we cache the result. item = self.cache.get(inode) self._inode_cache[inode] = item return item def check_pending_archive(self, inode): # Check if this is an archive we need to load archive_name = self.pending_archives.pop(inode, None) if archive_name is not None: self._process_archive(archive_name, [os.fsencode(archive_name)]) def _allocate_inode(self): self.inode_count += 1 return self.inode_count def _create_dir(self, parent, mtime=None): """Create directory """ ino = self._allocate_inode() if mtime is not None: self._items[ino] = Item(internal_dict=self.default_dir.as_dict()) self._items[ino].mtime = mtime else: self._items[ino] = self.default_dir self.parent[ino] = parent return ino def find_inode(self, path, prefix=[]): segments = prefix + path.split(b'/') inode = 1 for segment in segments: inode = self.contents[inode][segment] return inode def _process_archive(self, archive_name, prefix=[]): """Build FUSE inode hierarchy from archive metadata """ self.file_versions = {} # for versions mode: original path -> version t0 = time.perf_counter() archive = Archive(self.repository_uncached, self.key, self._manifest, archive_name, consider_part_files=self._args.consider_part_files) strip_components = self._args.strip_components matcher = Archiver.build_matcher(self._args.patterns, self._args.paths) partial_extract = not matcher.empty() or strip_components hardlink_masters = {} if partial_extract else None def peek_and_store_hardlink_masters(item, matched): if (partial_extract and not matched and hardlinkable(item.mode) and item.get('hardlink_master', True) and 'source' not in item): hardlink_masters[item.get('path')] = (item.get('chunks'), None) filter = Archiver.build_filter(matcher, peek_and_store_hardlink_masters, strip_components) for item_inode, item in self.cache.iter_archive_items(archive.metadata.items, filter=filter, consider_part_files=self._args.consider_part_files): if strip_components: item.path = os.sep.join(item.path.split(os.sep)[strip_components:]) path = os.fsencode(item.path) is_dir = stat.S_ISDIR(item.mode) if is_dir: try: # This can happen if an archive was created with a command line like # $ borg create ... dir1/file dir1 # In this case the code below will have created a default_dir inode for dir1 already. inode = self.find_inode(path, prefix) except KeyError: pass else: self._items[inode] = item continue segments = prefix + path.split(b'/') parent = 1 for segment in segments[:-1]: parent = self._process_inner(segment, parent) self._process_leaf(segments[-1], item, parent, prefix, is_dir, item_inode, hardlink_masters, strip_components) duration = time.perf_counter() - t0 logger.debug('fuse: _process_archive completed in %.1f s for archive %s', duration, archive.name) def _process_leaf(self, name, item, parent, prefix, is_dir, item_inode, hardlink_masters, stripped_components): path = item.path del item.path # save some space hardlink_masters = hardlink_masters or {} def file_version(item, path): if 'chunks' in item: file_id = blake2b_128(path) current_version, previous_id = self.versions_index.get(file_id, (0, None)) contents_id = blake2b_128(b''.join(chunk_id for chunk_id, _, _ in item.chunks)) if contents_id != previous_id: current_version += 1 self.versions_index[file_id] = current_version, contents_id return current_version def make_versioned_name(name, version, add_dir=False): if add_dir: # add intermediate directory with same name as filename path_fname = name.rsplit(b'/', 1) name += b'/' + path_fname[-1] # keep original extension at end to avoid confusing tools name, ext = os.path.splitext(name) version_enc = os.fsencode('.%05d' % version) return name + version_enc + ext if 'source' in item and hardlinkable(item.mode): source = os.sep.join(item.source.split(os.sep)[stripped_components:]) chunks, link_target = hardlink_masters.get(item.source, (None, source)) if link_target: # Hard link was extracted previously, just link link_target = os.fsencode(link_target) if self.versions: # adjust link target name with version version = self.file_versions[link_target] link_target = make_versioned_name(link_target, version, add_dir=True) try: inode = self.find_inode(link_target, prefix) except KeyError: logger.warning('Skipping broken hard link: %s -> %s', path, source) return item = self.get_item(inode) item.nlink = item.get('nlink', 1) + 1 self._items[inode] = item elif chunks is not None: # assign chunks to this item, since the item which had the chunks was not extracted item.chunks = chunks inode = item_inode self._items[inode] = item if hardlink_masters: # Update master entry with extracted item path, so that following hardlinks don't extract twice. hardlink_masters[item.source] = (None, path) else: inode = item_inode if self.versions and not is_dir: parent = self._process_inner(name, parent) enc_path = os.fsencode(path) version = file_version(item, enc_path) if version is not None: # regular file, with contents - maybe a hardlink master name = make_versioned_name(name, version) self.file_versions[enc_path] = version self.parent[inode] = parent if name: self.contents[parent][name] = inode def _process_inner(self, name, parent_inode): dir = self.contents[parent_inode] if name in dir: inode = dir[name] else: inode = self._create_dir(parent_inode) if name: dir[name] = inode return inode class FuseOperations(llfuse.Operations, FuseBackend): """Export archive as a FUSE filesystem """ def __init__(self, key, repository, manifest, args, decrypted_repository): llfuse.Operations.__init__(self) FuseBackend.__init__(self, key, manifest, repository, args, decrypted_repository) self.decrypted_repository = decrypted_repository data_cache_capacity = int(os.environ.get('BORG_MOUNT_DATA_CACHE_ENTRIES', os.cpu_count() or 1)) logger.debug('mount data cache capacity: %d chunks', data_cache_capacity) self.data_cache = LRUCache(capacity=data_cache_capacity, dispose=lambda _: None) self._last_pos = LRUCache(capacity=FILES, dispose=lambda _: None) def sig_info_handler(self, sig_no, stack): logger.debug('fuse: %d synth inodes, %d edges (%s)', self.inode_count, len(self.parent), # getsizeof is the size of the dict itself; key and value are two small-ish integers, # which are shared due to code structure (this has been verified). format_file_size(sys.getsizeof(self.parent) + len(self.parent) * sys.getsizeof(self.inode_count))) logger.debug('fuse: %d pending archives', len(self.pending_archives)) logger.debug('fuse: ItemCache %d entries (%d direct, %d indirect), meta-array size %s, direct items size %s', self.cache.direct_items + self.cache.indirect_items, self.cache.direct_items, self.cache.indirect_items, format_file_size(sys.getsizeof(self.cache.meta)), format_file_size(os.stat(self.cache.fd.fileno()).st_size)) logger.debug('fuse: data cache: %d/%d entries, %s', len(self.data_cache.items()), self.data_cache._capacity, format_file_size(sum(len(chunk) for key, chunk in self.data_cache.items()))) self.decrypted_repository.log_instrumentation() def mount(self, mountpoint, mount_options, foreground=False): """Mount filesystem on *mountpoint* with *mount_options*.""" def pop_option(options, key, present, not_present, wanted_type, int_base=0): assert isinstance(options, list) # we mutate this for idx, option in enumerate(options): if option == key: options.pop(idx) return present if option.startswith(key + '='): options.pop(idx) value = option.split('=', 1)[1] if wanted_type is bool: v = value.lower() if v in ('y', 'yes', 'true', '1'): return True if v in ('n', 'no', 'false', '0'): return False raise ValueError('unsupported value in option: %s' % option) if wanted_type is int: try: return int(value, base=int_base) except ValueError: raise ValueError('unsupported value in option: %s' % option) from None try: return wanted_type(value) except ValueError: raise ValueError('unsupported value in option: %s' % option) from None else: return not_present # default_permissions enables permission checking by the kernel. Without # this, any umask (or uid/gid) would not have an effect and this could # cause security issues if used with allow_other mount option. # When not using allow_other or allow_root, access is limited to the # mounting user anyway. options = ['fsname=borgfs', 'ro', 'default_permissions'] if mount_options: options.extend(mount_options.split(',')) if is_darwin: # macFUSE supports a volname mount option to give what finder displays on desktop / in directory list. volname = pop_option(options, 'volname', '', '', str) # if the user did not specify it, we make something up, # because otherwise it would be "macFUSE Volume 0 (Python)", #7690. volname = volname or f"{os.path.basename(mountpoint)} (borgfs)" options.append(f"volname={volname}") ignore_permissions = pop_option(options, 'ignore_permissions', True, False, bool) if ignore_permissions: # in case users have a use-case that requires NOT giving "default_permissions", # this is enabled by the custom "ignore_permissions" mount option which just # removes "default_permissions" again: pop_option(options, 'default_permissions', True, False, bool) self.allow_damaged_files = pop_option(options, 'allow_damaged_files', True, False, bool) self.versions = pop_option(options, 'versions', True, False, bool) self.uid_forced = pop_option(options, 'uid', None, None, int) self.gid_forced = pop_option(options, 'gid', None, None, int) self.umask = pop_option(options, 'umask', 0, 0, int, int_base=8) # umask is octal, e.g. 222 or 0222 dir_uid = self.uid_forced if self.uid_forced is not None else self.default_uid dir_gid = self.gid_forced if self.gid_forced is not None else self.default_gid dir_user = uid2user(dir_uid) dir_group = gid2group(dir_gid) assert isinstance(dir_user, str) assert isinstance(dir_group, str) dir_mode = 0o40755 & ~self.umask self.default_dir = Item(mode=dir_mode, mtime=int(time.time() * 1e9), user=dir_user, group=dir_group, uid=dir_uid, gid=dir_gid) self._create_filesystem() llfuse.init(self, mountpoint, options) if not foreground: if isinstance(self.repository_uncached, RemoteRepository): daemonize() else: with daemonizing() as (old_id, new_id): # local repo: the locking process' PID is changing, migrate it: logger.debug('fuse: mount local repo, going to background: migrating lock.') self.repository_uncached.migrate_lock(old_id, new_id) # If the file system crashes, we do not want to umount because in that # case the mountpoint suddenly appears to become empty. This can have # nasty consequences, imagine the user has e.g. an active rsync mirror # job - seeing the mountpoint empty, rsync would delete everything in the # mirror. umount = False try: with signal_handler('SIGUSR1', self.sig_info_handler), \ signal_handler('SIGINFO', self.sig_info_handler): signal = fuse_main() # no crash and no signal (or it's ^C and we're in the foreground) -> umount request umount = (signal is None or (signal == SIGINT and foreground)) finally: llfuse.close(umount) @async_wrapper def statfs(self, ctx=None): stat_ = llfuse.StatvfsData() stat_.f_bsize = 512 stat_.f_frsize = 512 stat_.f_blocks = 0 stat_.f_bfree = 0 stat_.f_bavail = 0 stat_.f_files = 0 stat_.f_ffree = 0 stat_.f_favail = 0 stat_.f_namemax = 255 # == NAME_MAX (depends on archive source OS / FS) return stat_ def _getattr(self, inode, ctx=None): item = self.get_item(inode) entry = llfuse.EntryAttributes() entry.st_ino = inode entry.generation = 0 entry.entry_timeout = 300 entry.attr_timeout = 300 entry.st_mode = item.mode & ~self.umask entry.st_nlink = item.get('nlink', 1) entry.st_uid, entry.st_gid = get_item_uid_gid(item, numeric=self.numeric_ids, uid_default=self.default_uid, gid_default=self.default_gid, uid_forced=self.uid_forced, gid_forced=self.gid_forced) entry.st_rdev = item.get('rdev', 0) entry.st_size = item.get_size() entry.st_blksize = 512 entry.st_blocks = (entry.st_size + entry.st_blksize - 1) // entry.st_blksize # note: older archives only have mtime (not atime nor ctime) entry.st_mtime_ns = mtime_ns = item.mtime entry.st_atime_ns = item.get('atime', mtime_ns) entry.st_ctime_ns = item.get('ctime', mtime_ns) entry.st_birthtime_ns = item.get('birthtime', mtime_ns) return entry @async_wrapper def getattr(self, inode, ctx=None): return self._getattr(inode, ctx=ctx) @async_wrapper def listxattr(self, inode, ctx=None): item = self.get_item(inode) return item.get('xattrs', {}).keys() @async_wrapper def getxattr(self, inode, name, ctx=None): item = self.get_item(inode) try: return item.get('xattrs', {})[name] or b'' except KeyError: raise llfuse.FUSEError(llfuse.ENOATTR) from None @async_wrapper def lookup(self, parent_inode, name, ctx=None): self.check_pending_archive(parent_inode) if name == b'.': inode = parent_inode elif name == b'..': inode = self.parent[parent_inode] else: inode = self.contents[parent_inode].get(name) if not inode: raise llfuse.FUSEError(errno.ENOENT) return self._getattr(inode) @async_wrapper def open(self, inode, flags, ctx=None): if not self.allow_damaged_files: item = self.get_item(inode) if 'chunks_healthy' in item: # Processed archive items don't carry the path anymore; for converting the inode # to the path we'd either have to store the inverse of the current structure, # or search the entire archive. So we just don't print it. It's easy to correlate anyway. logger.warning('File has damaged (all-zero) chunks. Try running borg check --repair. ' 'Mount with allow_damaged_files to read damaged files.') raise llfuse.FUSEError(errno.EIO) return llfuse.FileInfo(fh=inode) if has_pyfuse3 else inode @async_wrapper def opendir(self, inode, ctx=None): self.check_pending_archive(inode) return inode @async_wrapper def read(self, fh, offset, size): parts = [] item = self.get_item(fh) # optimize for linear reads: # we cache the chunk number and the in-file offset of the chunk in _last_pos[fh] chunk_no, chunk_offset = self._last_pos.get(fh, (0, 0)) if chunk_offset > offset: # this is not a linear read, so we lost track and need to start from beginning again... chunk_no, chunk_offset = (0, 0) offset -= chunk_offset chunks = item.chunks # note: using index iteration to avoid frequently copying big (sub)lists by slicing for idx in range(chunk_no, len(chunks)): id, s, csize = chunks[idx] if s < offset: offset -= s chunk_offset += s chunk_no += 1 continue n = min(size, s - offset) if id in self.data_cache: data = self.data_cache[id] if offset + n == len(data): # evict fully read chunk from cache del self.data_cache[id] else: data = self.key.decrypt(id, self.repository_uncached.get(id)) if offset + n < len(data): # chunk was only partially read, cache it self.data_cache[id] = data parts.append(data[offset:offset + n]) offset = 0 size -= n if not size: if fh in self._last_pos: self._last_pos.upd(fh, (chunk_no, chunk_offset)) else: self._last_pos[fh] = (chunk_no, chunk_offset) break return b''.join(parts) # note: we can't have a generator (with yield) and not a generator (async) in the same method if has_pyfuse3: async def readdir(self, fh, off, token): entries = [(b'.', fh), (b'..', self.parent[fh])] entries.extend(self.contents[fh].items()) for i, (name, inode) in enumerate(entries[off:], off): attrs = self._getattr(inode) if not llfuse.readdir_reply(token, name, attrs, i + 1): break else: def readdir(self, fh, off): entries = [(b'.', fh), (b'..', self.parent[fh])] entries.extend(self.contents[fh].items()) for i, (name, inode) in enumerate(entries[off:], off): attrs = self._getattr(inode) yield name, attrs, i + 1 @async_wrapper def readlink(self, inode, ctx=None): item = self.get_item(inode) return os.fsencode(item.source) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/fuse_impl.py0000644000076500000240000000154214641074756016305 0ustar00twstaff""" load library for lowlevel FUSE implementation """ import os BORG_FUSE_IMPL = os.environ.get('BORG_FUSE_IMPL', 'pyfuse3,llfuse') for FUSE_IMPL in BORG_FUSE_IMPL.split(','): FUSE_IMPL = FUSE_IMPL.strip() if FUSE_IMPL == 'pyfuse3': try: import pyfuse3 as llfuse except ImportError: pass else: has_llfuse = False has_pyfuse3 = True break elif FUSE_IMPL == 'llfuse': try: import llfuse except ImportError: pass else: has_llfuse = True has_pyfuse3 = False break elif FUSE_IMPL == 'none': pass else: raise RuntimeError("unknown fuse implementation in BORG_FUSE_IMPL: '%s'" % BORG_FUSE_IMPL) else: llfuse = None has_llfuse = False has_pyfuse3 = False ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719958149.0 borgbackup-1.4.0/src/borg/hashindex.c0000644000076500000240000337472214641075205016075 0ustar00twstaff/* Generated by Cython 3.0.10 */ /* BEGIN: Cython Metadata { "distutils": { "depends": [ "src/borg/_hashindex.c", "src/borg/cache_sync/cache_sync.c" ], "extra_compile_args": [ "-Wall", "-Wextra", "-Wpointer-arith" ], "include_dirs": [ "src/borg" ], "name": "borg.hashindex", "sources": [ "src/borg/hashindex.pyx" ], "undef_macros": [ "NDEBUG" ] }, "module_name": "borg.hashindex" } END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_10" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x03000AF0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 1 #endif #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #if PY_VERSION_HEX >= 0x030d00A4 # define __Pyx_PyCFunctionFast PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords #else # define __Pyx_PyCFunctionFast _PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__borg__hashindex #define __PYX_HAVE_API__borg__hashindex /* Early includes */ #include #include #include #include #include "_hashindex.c" #include "cache_sync/cache_sync.c" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/borg/hashindex.pyx", "", "type.pxd", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_4borg_9hashindex_IndexBase; struct __pyx_obj_4borg_9hashindex_FuseVersionsIndex; struct __pyx_obj_4borg_9hashindex_NSIndex; struct __pyx_obj_4borg_9hashindex_NSKeyIterator; struct __pyx_obj_4borg_9hashindex_ChunkIndex; struct __pyx_obj_4borg_9hashindex_ChunkKeyIterator; struct __pyx_obj_4borg_9hashindex_CacheSynchronizer; /* "borg/hashindex.pyx":83 * * @cython.internal * cdef class IndexBase: # <<<<<<<<<<<<<< * cdef HashIndex *index * cdef int key_size */ struct __pyx_obj_4borg_9hashindex_IndexBase { PyObject_HEAD HashIndex *index; int key_size; }; /* "borg/hashindex.pyx":171 * * * cdef class FuseVersionsIndex(IndexBase): # <<<<<<<<<<<<<< * # 4 byte version + 16 byte file contents hash * value_size = 20 */ struct __pyx_obj_4borg_9hashindex_FuseVersionsIndex { struct __pyx_obj_4borg_9hashindex_IndexBase __pyx_base; }; /* "borg/hashindex.pyx":201 * * * cdef class NSIndex(IndexBase): # <<<<<<<<<<<<<< * * value_size = 8 */ struct __pyx_obj_4borg_9hashindex_NSIndex { struct __pyx_obj_4borg_9hashindex_IndexBase __pyx_base; }; /* "borg/hashindex.pyx":246 * * * cdef class NSKeyIterator: # <<<<<<<<<<<<<< * cdef NSIndex idx * cdef HashIndex *index */ struct __pyx_obj_4borg_9hashindex_NSKeyIterator { PyObject_HEAD struct __pyx_obj_4borg_9hashindex_NSIndex *idx; HashIndex *index; unsigned char const *key; int key_size; int exhausted; }; /* "borg/hashindex.pyx":277 * * * cdef class ChunkIndex(IndexBase): # <<<<<<<<<<<<<< * """ * Mapping of 32 byte keys to (refcount, size, csize), which are all 32-bit unsigned. */ struct __pyx_obj_4borg_9hashindex_ChunkIndex { struct __pyx_obj_4borg_9hashindex_IndexBase __pyx_base; struct __pyx_vtabstruct_4borg_9hashindex_ChunkIndex *__pyx_vtab; }; /* "borg/hashindex.pyx":476 * * * cdef class ChunkKeyIterator: # <<<<<<<<<<<<<< * cdef ChunkIndex idx * cdef HashIndex *index */ struct __pyx_obj_4borg_9hashindex_ChunkKeyIterator { PyObject_HEAD struct __pyx_obj_4borg_9hashindex_ChunkIndex *idx; HashIndex *index; unsigned char const *key; int key_size; int exhausted; }; /* "borg/hashindex.pyx":510 * * * cdef class CacheSynchronizer: # <<<<<<<<<<<<<< * cdef ChunkIndex chunks * cdef CacheSyncCtx *sync */ struct __pyx_obj_4borg_9hashindex_CacheSynchronizer { PyObject_HEAD struct __pyx_obj_4borg_9hashindex_ChunkIndex *chunks; CacheSyncCtx *sync; }; /* "borg/hashindex.pyx":277 * * * cdef class ChunkIndex(IndexBase): # <<<<<<<<<<<<<< * """ * Mapping of 32 byte keys to (refcount, size, csize), which are all 32-bit unsigned. */ struct __pyx_vtabstruct_4borg_9hashindex_ChunkIndex { PyObject *(*_add)(struct __pyx_obj_4borg_9hashindex_ChunkIndex *, unsigned char *, uint32_t *); }; static struct __pyx_vtabstruct_4borg_9hashindex_ChunkIndex *__pyx_vtabptr_4borg_9hashindex_ChunkIndex; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectLookupSpecial.proto */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0) #define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1) static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error); #else #define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n) #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* GetTopmostException.proto */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); #endif /* SaveResetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* AssertionsEnabled.proto */ #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define __Pyx_init_assertions_enabled() (0) #define __pyx_assertions_enabled() (1) #elif CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030C0000) static int __pyx_assertions_enabled_flag; #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag) static int __Pyx_init_assertions_enabled(void) { PyObject *builtins, *debug, *debug_str; int flag; builtins = PyEval_GetBuiltins(); if (!builtins) goto bad; debug_str = PyUnicode_FromStringAndSize("__debug__", 9); if (!debug_str) goto bad; debug = PyObject_GetItem(builtins, debug_str); Py_DECREF(debug_str); if (!debug) goto bad; flag = PyObject_IsTrue(debug); Py_DECREF(debug); if (flag == -1) goto bad; __pyx_assertions_enabled_flag = flag; return 0; bad: __pyx_assertions_enabled_flag = 1; return -1; } #else #define __Pyx_init_assertions_enabled() (0) #define __pyx_assertions_enabled() (!Py_OptimizeFlag) #endif /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* KeywordStringCheck.proto */ static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed); /* PySequenceContains.proto */ static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { int result = PySequence_Contains(seq, item); return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* ObjectGetItem.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key); #else #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) #endif /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* ArgTypeTest.proto */ #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* ListAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 L->ob_item[len] = x; #else PyList_SET_ITEM(list, len, x); #endif __Pyx_SET_SIZE(list, len + 1); return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif /* ExtTypeTest.proto */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /* decode_c_string_utf16.proto */ static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) { int byteorder = 0; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) { int byteorder = -1; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) { int byteorder = 1; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } /* decode_c_string.proto */ static CYTHON_INLINE PyObject* __Pyx_decode_c_string( const char* cstring, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* PyObjectCallNoArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* ValidateBasesTuple.proto */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); #endif /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* SetupReduce.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce(PyObject* type_obj); #endif /* SetVTable.proto */ static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable); /* GetVTable.proto */ static void* __Pyx_GetVtable(PyTypeObject *type); /* MergeVTables.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_MergeVtables(PyTypeObject *type); #endif /* TypeImport.proto */ #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_10 #define __PYX_HAVE_RT_ImportType_proto_3_0_10 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L #define __PYX_GET_STRUCT_ALIGNMENT_3_0_10(s) alignof(s) #else #define __PYX_GET_STRUCT_ALIGNMENT_3_0_10(s) sizeof(void*) #endif enum __Pyx_ImportType_CheckSize_3_0_10 { __Pyx_ImportType_CheckSize_Error_3_0_10 = 0, __Pyx_ImportType_CheckSize_Warn_3_0_10 = 1, __Pyx_ImportType_CheckSize_Ignore_3_0_10 = 2 }; static PyTypeObject *__Pyx_ImportType_3_0_10(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_10 check_size); #endif /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* ModInt[long].proto */ static CYTHON_INLINE long __Pyx_mod_long(long, long); /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* ClassMethod.proto */ #include "descrobject.h" CYTHON_UNUSED static PyObject* __Pyx_Method_ClassMethod(PyObject *method); /* GetNameInClass.proto */ #define __Pyx_GetNameInClass(var, nmspace, name) (var) = __Pyx__GetNameInClass(nmspace, name) static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ static PyObject *__pyx_f_4borg_9hashindex_10ChunkIndex__add(struct __pyx_obj_4borg_9hashindex_ChunkIndex *__pyx_v_self, unsigned char *__pyx_v_key, uint32_t *__pyx_v_data); /* proto*/ /* Module declarations from "cython" */ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc.errno" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "__builtin__" */ /* Module declarations from "cpython.type" */ /* Module declarations from "cpython" */ /* Module declarations from "cpython.object" */ /* Module declarations from "cpython.exc" */ /* Module declarations from "cpython.buffer" */ /* Module declarations from "cpython.bytes" */ /* Module declarations from "borg.hashindex" */ static PyObject *__pyx_v_4borg_9hashindex__NoDefault = 0; static Py_buffer __pyx_f_4borg_9hashindex_ro_buffer(PyObject *); /*proto*/ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "borg.hashindex" extern int __pyx_module_is_main_borg__hashindex; int __pyx_module_is_main_borg__hashindex = 0; /* Implementation of "borg.hashindex" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_object; static PyObject *__pyx_builtin_AssertionError; static PyObject *__pyx_builtin_open; static PyObject *__pyx_builtin_KeyError; static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_IndexError; static PyObject *__pyx_builtin_StopIteration; static PyObject *__pyx_builtin_ValueError; /* #### Code section: string_decls ### */ static const char __pyx_k__9[] = "."; static const char __pyx_k_fd[] = "fd"; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k_os[] = "os"; static const char __pyx_k_rb[] = "rb"; static const char __pyx_k_rc[] = "rc"; static const char __pyx_k_wb[] = "wb"; static const char __pyx_k__10[] = "*"; static const char __pyx_k__61[] = "?"; static const char __pyx_k_add[] = "add"; static const char __pyx_k_cls[] = "cls"; static const char __pyx_k_get[] = "get"; static const char __pyx_k_key[] = "key"; static const char __pyx_k_pop[] = "pop"; static const char __pyx_k_data[] = "data"; static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_exit[] = "__exit__"; static const char __pyx_k_feed[] = "feed"; static const char __pyx_k_iter[] = "iter"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_open[] = "open"; static const char __pyx_k_path[] = "path"; static const char __pyx_k_read[] = "read"; static const char __pyx_k_refs[] = "refs"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_size[] = "size"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_chunk[] = "chunk"; static const char __pyx_k_clear[] = "clear"; static const char __pyx_k_csize[] = "csize"; static const char __pyx_k_enter[] = "__enter__"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_merge[] = "merge"; static const char __pyx_k_other[] = "other"; static const char __pyx_k_value[] = "value"; static const char __pyx_k_write[] = "write"; static const char __pyx_k_1_4_01[] = "1.4_01"; static const char __pyx_k_chunks[] = "chunks"; static const char __pyx_k_decref[] = "decref"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_incref[] = "incref"; static const char __pyx_k_locale[] = "locale"; static const char __pyx_k_marker[] = "marker"; static const char __pyx_k_master[] = "master"; static const char __pyx_k_object[] = "object"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_usable[] = "usable"; static const char __pyx_k_values[] = "values"; static const char __pyx_k_NSIndex[] = "NSIndex"; static const char __pyx_k_compact[] = "compact"; static const char __pyx_k_default[] = "default"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_entries[] = "entries"; static const char __pyx_k_KeyError[] = "KeyError"; static const char __pyx_k_capacity[] = "capacity"; static const char __pyx_k_getstate[] = "__getstate__"; static const char __pyx_k_key_size[] = "_key_size"; static const char __pyx_k_refcount[] = "refcount"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_MAX_VALUE[] = "MAX_VALUE"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_chunk_buf[] = "chunk_buf"; static const char __pyx_k_isenabled[] = "isenabled"; static const char __pyx_k_iteritems[] = "iteritems"; static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_summarize[] = "summarize"; static const char __pyx_k_ChunkIndex[] = "ChunkIndex"; static const char __pyx_k_IndexError[] = "IndexError"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_chunk_size[] = "chunk_size"; static const char __pyx_k_key_size_2[] = "key_size"; static const char __pyx_k_namedtuple[] = "namedtuple"; static const char __pyx_k_our_values[] = "our_values"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_setdefault[] = "setdefault"; static const char __pyx_k_value_size[] = "value_size"; static const char __pyx_k_API_VERSION[] = "API_VERSION"; static const char __pyx_k_chunk_csize[] = "chunk_csize"; static const char __pyx_k_collections[] = "collections"; static const char __pyx_k_unique_size[] = "unique_size"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_master_index[] = "master_index"; static const char __pyx_k_our_refcount[] = "our_refcount"; static const char __pyx_k_stringsource[] = ""; static const char __pyx_k_unique_csize[] = "unique_csize"; static const char __pyx_k_IndexBase_get[] = "IndexBase.get"; static const char __pyx_k_IndexBase_pop[] = "IndexBase.pop"; static const char __pyx_k_NSKeyIterator[] = "NSKeyIterator"; static const char __pyx_k_StopIteration[] = "StopIteration"; static const char __pyx_k_class_getitem[] = "__class_getitem__"; static const char __pyx_k_master_values[] = "master_values"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_stats_against[] = "stats_against"; static const char __pyx_k_unique_chunks[] = "unique_chunks"; static const char __pyx_k_AssertionError[] = "AssertionError"; static const char __pyx_k_ChunkIndex_add[] = "ChunkIndex.add"; static const char __pyx_k_IndexBase_read[] = "IndexBase.read"; static const char __pyx_k_IndexBase_size[] = "IndexBase.size"; static const char __pyx_k_borg_hashindex[] = "borg.hashindex"; static const char __pyx_k_permit_compact[] = "permit_compact"; static const char __pyx_k_zero_csize_ids[] = "zero_csize_ids"; static const char __pyx_k_ChunkIndexEntry[] = "ChunkIndexEntry"; static const char __pyx_k_IndexBase_clear[] = "IndexBase.clear"; static const char __pyx_k_IndexBase_write[] = "IndexBase.write"; static const char __pyx_k_MAX_LOAD_FACTOR[] = "MAX_LOAD_FACTOR"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_ChunkIndex_merge[] = "ChunkIndex.merge"; static const char __pyx_k_ChunkKeyIterator[] = "ChunkKeyIterator"; static const char __pyx_k_CacheSynchronizer[] = "CacheSynchronizer"; static const char __pyx_k_ChunkIndex_decref[] = "ChunkIndex.decref"; static const char __pyx_k_ChunkIndex_incref[] = "ChunkIndex.incref"; static const char __pyx_k_FuseVersionsIndex[] = "FuseVersionsIndex"; static const char __pyx_k_IndexBase_compact[] = "IndexBase.compact"; static const char __pyx_k_NSIndex_iteritems[] = "NSIndex.iteritems"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_refcount_size_csize[] = "refcount size csize"; static const char __pyx_k_ChunkIndex_iteritems[] = "ChunkIndex.iteritems"; static const char __pyx_k_ChunkIndex_summarize[] = "ChunkIndex.summarize"; static const char __pyx_k_IndexBase_setdefault[] = "IndexBase.setdefault"; static const char __pyx_k_hashindex_set_failed[] = "hashindex_set failed"; static const char __pyx_k_hashindex_init_failed[] = "hashindex_init failed"; static const char __pyx_k_CacheSynchronizer_feed[] = "CacheSynchronizer.feed"; static const char __pyx_k_cache_sync_feed_failed[] = "cache_sync_feed failed: "; static const char __pyx_k_cache_sync_init_failed[] = "cache_sync_init failed"; static const char __pyx_k_src_borg_hashindex_pyx[] = "src/borg/hashindex.pyx"; static const char __pyx_k_NSIndex___reduce_cython[] = "NSIndex.__reduce_cython__"; static const char __pyx_k_hashindex_delete_failed[] = "hashindex_delete failed"; static const char __pyx_k_invalid_reference_count[] = "invalid reference count"; static const char __pyx_k_ChunkIndex_stats_against[] = "ChunkIndex.stats_against"; static const char __pyx_k_ChunkIndex_zero_csize_ids[] = "ChunkIndex.zero_csize_ids"; static const char __pyx_k_IndexBase___reduce_cython[] = "IndexBase.__reduce_cython__"; static const char __pyx_k_NSIndex___setstate_cython[] = "NSIndex.__setstate_cython__"; static const char __pyx_k_ChunkIndex___reduce_cython[] = "ChunkIndex.__reduce_cython__"; static const char __pyx_k_IndexBase___setstate_cython[] = "IndexBase.__setstate_cython__"; static const char __pyx_k_ChunkIndex___setstate_cython[] = "ChunkIndex.__setstate_cython__"; static const char __pyx_k_NSKeyIterator___reduce_cython[] = "NSKeyIterator.__reduce_cython__"; static const char __pyx_k_Expected_bytes_of_length_16_for[] = "Expected bytes of length 16 for second value"; static const char __pyx_k_NSKeyIterator___setstate_cython[] = "NSKeyIterator.__setstate_cython__"; static const char __pyx_k_CacheSynchronizer___reduce_cytho[] = "CacheSynchronizer.__reduce_cython__"; static const char __pyx_k_CacheSynchronizer___setstate_cyt[] = "CacheSynchronizer.__setstate_cython__"; static const char __pyx_k_ChunkKeyIterator___reduce_cython[] = "ChunkKeyIterator.__reduce_cython__"; static const char __pyx_k_ChunkKeyIterator___setstate_cyth[] = "ChunkKeyIterator.__setstate_cython__"; static const char __pyx_k_FuseVersionsIndex___reduce_cytho[] = "FuseVersionsIndex.__reduce_cython__"; static const char __pyx_k_FuseVersionsIndex___setstate_cyt[] = "FuseVersionsIndex.__setstate_cython__"; static const char __pyx_k_hashindex_read_returned_NULL_wit[] = "hashindex_read() returned NULL with no exception set"; static const char __pyx_k_maximum_number_of_segments_reach[] = "maximum number of segments reached"; static const char __pyx_k_maximum_number_of_versions_reach[] = "maximum number of versions reached"; static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; static const char __pyx_k_stats_against_key_contained_in_s[] = "stats_against: key contained in self but not in master_index."; /* #### Code section: decls ### */ static int __pyx_pf_4borg_9hashindex_9IndexBase___cinit__(struct __pyx_obj_4borg_9hashindex_IndexBase *__pyx_v_self, PyObject *__pyx_v_capacity, PyObject *__pyx_v_path, PyObject *__pyx_v_permit_compact, PyObject *__pyx_v_usable); /* proto */ static void __pyx_pf_4borg_9hashindex_9IndexBase_2__dealloc__(struct __pyx_obj_4borg_9hashindex_IndexBase *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_9IndexBase_4read(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_path, PyObject *__pyx_v_permit_compact); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_9IndexBase_6write(struct __pyx_obj_4borg_9hashindex_IndexBase *__pyx_v_self, PyObject *__pyx_v_path); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_9IndexBase_8clear(struct __pyx_obj_4borg_9hashindex_IndexBase *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_9IndexBase_10setdefault(struct __pyx_obj_4borg_9hashindex_IndexBase *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_4borg_9hashindex_9IndexBase_12__delitem__(struct __pyx_obj_4borg_9hashindex_IndexBase *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_9IndexBase_14get(struct __pyx_obj_4borg_9hashindex_IndexBase *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_default); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_9IndexBase_16pop(struct __pyx_obj_4borg_9hashindex_IndexBase *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_default); /* proto */ static Py_ssize_t __pyx_pf_4borg_9hashindex_9IndexBase_18__len__(struct __pyx_obj_4borg_9hashindex_IndexBase *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_9IndexBase_20size(struct __pyx_obj_4borg_9hashindex_IndexBase *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_9IndexBase_22compact(struct __pyx_obj_4borg_9hashindex_IndexBase *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_9IndexBase_24__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_9hashindex_IndexBase *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_9IndexBase_26__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_9hashindex_IndexBase *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_17FuseVersionsIndex___getitem__(struct __pyx_obj_4borg_9hashindex_FuseVersionsIndex *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static int __pyx_pf_4borg_9hashindex_17FuseVersionsIndex_2__setitem__(struct __pyx_obj_4borg_9hashindex_FuseVersionsIndex *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_4borg_9hashindex_17FuseVersionsIndex_4__contains__(struct __pyx_obj_4borg_9hashindex_FuseVersionsIndex *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_17FuseVersionsIndex_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_9hashindex_FuseVersionsIndex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_17FuseVersionsIndex_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_9hashindex_FuseVersionsIndex *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_7NSIndex___getitem__(struct __pyx_obj_4borg_9hashindex_NSIndex *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static int __pyx_pf_4borg_9hashindex_7NSIndex_2__setitem__(struct __pyx_obj_4borg_9hashindex_NSIndex *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_4borg_9hashindex_7NSIndex_4__contains__(struct __pyx_obj_4borg_9hashindex_NSIndex *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_7NSIndex_6iteritems(struct __pyx_obj_4borg_9hashindex_NSIndex *__pyx_v_self, PyObject *__pyx_v_marker); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_7NSIndex_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_9hashindex_NSIndex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_7NSIndex_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_9hashindex_NSIndex *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_4borg_9hashindex_13NSKeyIterator___cinit__(struct __pyx_obj_4borg_9hashindex_NSKeyIterator *__pyx_v_self, PyObject *__pyx_v_key_size); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_13NSKeyIterator_2__iter__(struct __pyx_obj_4borg_9hashindex_NSKeyIterator *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_13NSKeyIterator_4__next__(struct __pyx_obj_4borg_9hashindex_NSKeyIterator *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_13NSKeyIterator_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_9hashindex_NSKeyIterator *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_13NSKeyIterator_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_9hashindex_NSKeyIterator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_10ChunkIndex___getitem__(struct __pyx_obj_4borg_9hashindex_ChunkIndex *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static int __pyx_pf_4borg_9hashindex_10ChunkIndex_2__setitem__(struct __pyx_obj_4borg_9hashindex_ChunkIndex *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_4borg_9hashindex_10ChunkIndex_4__contains__(struct __pyx_obj_4borg_9hashindex_ChunkIndex *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_10ChunkIndex_6incref(struct __pyx_obj_4borg_9hashindex_ChunkIndex *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_10ChunkIndex_8decref(struct __pyx_obj_4borg_9hashindex_ChunkIndex *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_10ChunkIndex_10iteritems(struct __pyx_obj_4borg_9hashindex_ChunkIndex *__pyx_v_self, PyObject *__pyx_v_marker); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_10ChunkIndex_12summarize(struct __pyx_obj_4borg_9hashindex_ChunkIndex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_10ChunkIndex_14stats_against(struct __pyx_obj_4borg_9hashindex_ChunkIndex *__pyx_v_self, struct __pyx_obj_4borg_9hashindex_ChunkIndex *__pyx_v_master_index); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_10ChunkIndex_16add(struct __pyx_obj_4borg_9hashindex_ChunkIndex *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_refs, PyObject *__pyx_v_size, PyObject *__pyx_v_csize); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_10ChunkIndex_18merge(struct __pyx_obj_4borg_9hashindex_ChunkIndex *__pyx_v_self, struct __pyx_obj_4borg_9hashindex_ChunkIndex *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_10ChunkIndex_20zero_csize_ids(struct __pyx_obj_4borg_9hashindex_ChunkIndex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_10ChunkIndex_22__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_9hashindex_ChunkIndex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_10ChunkIndex_24__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_9hashindex_ChunkIndex *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_4borg_9hashindex_16ChunkKeyIterator___cinit__(struct __pyx_obj_4borg_9hashindex_ChunkKeyIterator *__pyx_v_self, PyObject *__pyx_v_key_size); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_16ChunkKeyIterator_2__iter__(struct __pyx_obj_4borg_9hashindex_ChunkKeyIterator *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_16ChunkKeyIterator_4__next__(struct __pyx_obj_4borg_9hashindex_ChunkKeyIterator *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_16ChunkKeyIterator_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_9hashindex_ChunkKeyIterator *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_16ChunkKeyIterator_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_9hashindex_ChunkKeyIterator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_4borg_9hashindex_17CacheSynchronizer___cinit__(struct __pyx_obj_4borg_9hashindex_CacheSynchronizer *__pyx_v_self, PyObject *__pyx_v_chunks); /* proto */ static void __pyx_pf_4borg_9hashindex_17CacheSynchronizer_2__dealloc__(struct __pyx_obj_4borg_9hashindex_CacheSynchronizer *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_17CacheSynchronizer_4feed(struct __pyx_obj_4borg_9hashindex_CacheSynchronizer *__pyx_v_self, PyObject *__pyx_v_chunk); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_17CacheSynchronizer_16num_files_totals___get__(struct __pyx_obj_4borg_9hashindex_CacheSynchronizer *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_17CacheSynchronizer_15num_files_parts___get__(struct __pyx_obj_4borg_9hashindex_CacheSynchronizer *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_17CacheSynchronizer_11size_totals___get__(struct __pyx_obj_4borg_9hashindex_CacheSynchronizer *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_17CacheSynchronizer_10size_parts___get__(struct __pyx_obj_4borg_9hashindex_CacheSynchronizer *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_17CacheSynchronizer_12csize_totals___get__(struct __pyx_obj_4borg_9hashindex_CacheSynchronizer *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_17CacheSynchronizer_11csize_parts___get__(struct __pyx_obj_4borg_9hashindex_CacheSynchronizer *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_17CacheSynchronizer_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_9hashindex_CacheSynchronizer *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_9hashindex_17CacheSynchronizer_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_9hashindex_CacheSynchronizer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_tp_new_4borg_9hashindex_IndexBase(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_4borg_9hashindex_NSKeyIterator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_4borg_9hashindex_ChunkIndex(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_4borg_9hashindex_ChunkKeyIterator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_4borg_9hashindex_CacheSynchronizer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_7cpython_4type_type; #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE PyObject *__pyx_type_4borg_9hashindex_IndexBase; PyObject *__pyx_type_4borg_9hashindex_FuseVersionsIndex; PyObject *__pyx_type_4borg_9hashindex_NSIndex; PyObject *__pyx_type_4borg_9hashindex_NSKeyIterator; PyObject *__pyx_type_4borg_9hashindex_ChunkIndex; PyObject *__pyx_type_4borg_9hashindex_ChunkKeyIterator; PyObject *__pyx_type_4borg_9hashindex_CacheSynchronizer; #endif PyTypeObject *__pyx_ptype_4borg_9hashindex_IndexBase; PyTypeObject *__pyx_ptype_4borg_9hashindex_FuseVersionsIndex; PyTypeObject *__pyx_ptype_4borg_9hashindex_NSIndex; PyTypeObject *__pyx_ptype_4borg_9hashindex_NSKeyIterator; PyTypeObject *__pyx_ptype_4borg_9hashindex_ChunkIndex; PyTypeObject *__pyx_ptype_4borg_9hashindex_ChunkKeyIterator; PyTypeObject *__pyx_ptype_4borg_9hashindex_CacheSynchronizer; PyObject *__pyx_kp_s_1_4_01; PyObject *__pyx_n_s_API_VERSION; PyObject *__pyx_n_s_AssertionError; PyObject *__pyx_n_s_CacheSynchronizer; PyObject *__pyx_n_s_CacheSynchronizer___reduce_cytho; PyObject *__pyx_n_s_CacheSynchronizer___setstate_cyt; PyObject *__pyx_n_s_CacheSynchronizer_feed; PyObject *__pyx_n_s_ChunkIndex; PyObject *__pyx_n_s_ChunkIndexEntry; PyObject *__pyx_n_s_ChunkIndex___reduce_cython; PyObject *__pyx_n_s_ChunkIndex___setstate_cython; PyObject *__pyx_n_s_ChunkIndex_add; PyObject *__pyx_n_s_ChunkIndex_decref; PyObject *__pyx_n_s_ChunkIndex_incref; PyObject *__pyx_n_s_ChunkIndex_iteritems; PyObject *__pyx_n_s_ChunkIndex_merge; PyObject *__pyx_n_s_ChunkIndex_stats_against; PyObject *__pyx_n_s_ChunkIndex_summarize; PyObject *__pyx_n_s_ChunkIndex_zero_csize_ids; PyObject *__pyx_n_s_ChunkKeyIterator; PyObject *__pyx_n_s_ChunkKeyIterator___reduce_cython; PyObject *__pyx_n_s_ChunkKeyIterator___setstate_cyth; PyObject *__pyx_kp_s_Expected_bytes_of_length_16_for; PyObject *__pyx_n_s_FuseVersionsIndex; PyObject *__pyx_n_s_FuseVersionsIndex___reduce_cytho; PyObject *__pyx_n_s_FuseVersionsIndex___setstate_cyt; PyObject *__pyx_n_s_IndexBase___reduce_cython; PyObject *__pyx_n_s_IndexBase___setstate_cython; PyObject *__pyx_n_s_IndexBase_clear; PyObject *__pyx_n_s_IndexBase_compact; PyObject *__pyx_n_s_IndexBase_get; PyObject *__pyx_n_s_IndexBase_pop; PyObject *__pyx_n_s_IndexBase_read; PyObject *__pyx_n_s_IndexBase_setdefault; PyObject *__pyx_n_s_IndexBase_size; PyObject *__pyx_n_s_IndexBase_write; PyObject *__pyx_n_s_IndexError; PyObject *__pyx_n_s_KeyError; PyObject *__pyx_n_s_MAX_LOAD_FACTOR; PyObject *__pyx_n_s_MAX_VALUE; PyObject *__pyx_n_s_NSIndex; PyObject *__pyx_n_s_NSIndex___reduce_cython; PyObject *__pyx_n_s_NSIndex___setstate_cython; PyObject *__pyx_n_s_NSIndex_iteritems; PyObject *__pyx_n_s_NSKeyIterator; PyObject *__pyx_n_s_NSKeyIterator___reduce_cython; PyObject *__pyx_n_s_NSKeyIterator___setstate_cython; PyObject *__pyx_n_s_StopIteration; PyObject *__pyx_n_s_TypeError; PyObject *__pyx_n_s_ValueError; PyObject *__pyx_n_s__10; PyObject *__pyx_n_s__61; PyObject *__pyx_kp_u__9; PyObject *__pyx_n_s_add; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_borg_hashindex; PyObject *__pyx_kp_s_cache_sync_feed_failed; PyObject *__pyx_kp_s_cache_sync_init_failed; PyObject *__pyx_n_s_capacity; PyObject *__pyx_n_s_chunk; PyObject *__pyx_n_s_chunk_buf; PyObject *__pyx_n_s_chunk_csize; PyObject *__pyx_n_s_chunk_size; PyObject *__pyx_n_s_chunks; PyObject *__pyx_n_s_class_getitem; PyObject *__pyx_n_s_clear; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_cls; PyObject *__pyx_n_s_collections; PyObject *__pyx_n_s_compact; PyObject *__pyx_n_s_csize; PyObject *__pyx_n_s_data; PyObject *__pyx_n_s_decref; PyObject *__pyx_n_s_default; PyObject *__pyx_n_s_dict; PyObject *__pyx_kp_u_disable; PyObject *__pyx_kp_u_enable; PyObject *__pyx_n_s_enter; PyObject *__pyx_n_s_entries; PyObject *__pyx_n_s_error; PyObject *__pyx_n_s_exit; PyObject *__pyx_n_s_fd; PyObject *__pyx_n_s_feed; PyObject *__pyx_kp_u_gc; PyObject *__pyx_n_s_get; PyObject *__pyx_n_s_getstate; PyObject *__pyx_kp_s_hashindex_delete_failed; PyObject *__pyx_kp_s_hashindex_init_failed; PyObject *__pyx_kp_s_hashindex_read_returned_NULL_wit; PyObject *__pyx_kp_s_hashindex_set_failed; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_incref; PyObject *__pyx_n_s_initializing; PyObject *__pyx_kp_s_invalid_reference_count; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_kp_u_isenabled; PyObject *__pyx_n_s_iter; PyObject *__pyx_n_s_iteritems; PyObject *__pyx_n_s_key; PyObject *__pyx_n_s_key_size; PyObject *__pyx_n_s_key_size_2; PyObject *__pyx_n_s_locale; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_marker; PyObject *__pyx_n_s_master; PyObject *__pyx_n_s_master_index; PyObject *__pyx_n_s_master_values; PyObject *__pyx_kp_s_maximum_number_of_segments_reach; PyObject *__pyx_kp_s_maximum_number_of_versions_reach; PyObject *__pyx_n_s_merge; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_namedtuple; PyObject *__pyx_kp_s_no_default___reduce___due_to_non; PyObject *__pyx_n_s_object; PyObject *__pyx_n_s_open; PyObject *__pyx_n_s_os; PyObject *__pyx_n_s_other; PyObject *__pyx_n_s_our_refcount; PyObject *__pyx_n_s_our_values; PyObject *__pyx_n_s_path; PyObject *__pyx_n_s_permit_compact; PyObject *__pyx_n_s_pop; PyObject *__pyx_n_s_pyx_state; PyObject *__pyx_n_s_pyx_vtable; PyObject *__pyx_n_s_rb; PyObject *__pyx_n_s_rc; PyObject *__pyx_n_s_read; PyObject *__pyx_n_s_reduce; PyObject *__pyx_n_s_reduce_cython; PyObject *__pyx_n_s_reduce_ex; PyObject *__pyx_n_s_refcount; PyObject *__pyx_kp_s_refcount_size_csize; PyObject *__pyx_n_s_refs; PyObject *__pyx_n_s_self; PyObject *__pyx_n_s_setdefault; PyObject *__pyx_n_s_setstate; PyObject *__pyx_n_s_setstate_cython; PyObject *__pyx_n_s_size; PyObject *__pyx_n_s_spec; PyObject *__pyx_kp_s_src_borg_hashindex_pyx; PyObject *__pyx_n_s_stats_against; PyObject *__pyx_kp_s_stats_against_key_contained_in_s; PyObject *__pyx_kp_s_stringsource; PyObject *__pyx_n_s_summarize; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_unique_chunks; PyObject *__pyx_n_s_unique_csize; PyObject *__pyx_n_s_unique_size; PyObject *__pyx_n_s_usable; PyObject *__pyx_n_s_value; PyObject *__pyx_n_s_value_size; PyObject *__pyx_n_s_values; PyObject *__pyx_n_s_wb; PyObject *__pyx_n_s_write; PyObject *__pyx_n_s_zero_csize_ids; PyObject *__pyx_int_0; PyObject *__pyx_int_8; PyObject *__pyx_int_12; PyObject *__pyx_int_16; PyObject *__pyx_int_20; PyObject *__pyx_int_32; PyObject *__pyx_int_4294967295; PyObject *__pyx_k__4; PyObject *__pyx_tuple_; PyObject *__pyx_tuple__2; PyObject *__pyx_tuple__3; PyObject *__pyx_tuple__5; PyObject *__pyx_tuple__6; PyObject *__pyx_tuple__7; PyObject *__pyx_tuple__8; PyObject *__pyx_tuple__11; PyObject *__pyx_tuple__13; PyObject *__pyx_tuple__14; PyObject *__pyx_tuple__16; PyObject *__pyx_tuple__18; PyObject *__pyx_tuple__20; PyObject *__pyx_tuple__22; PyObject *__pyx_tuple__23; PyObject *__pyx_tuple__28; PyObject *__pyx_tuple__32; PyObject *__pyx_tuple__38; PyObject *__pyx_tuple__39; PyObject *__pyx_tuple__43; PyObject *__pyx_tuple__45; PyObject *__pyx_tuple__47; PyObject *__pyx_tuple__49; PyObject *__pyx_tuple__51; PyObject *__pyx_tuple__57; PyObject *__pyx_codeobj__12; PyObject *__pyx_codeobj__15; PyObject *__pyx_codeobj__17; PyObject *__pyx_codeobj__19; PyObject *__pyx_codeobj__21; PyObject *__pyx_codeobj__24; PyObject *__pyx_codeobj__25; PyObject *__pyx_codeobj__26; PyObject *__pyx_codeobj__27; PyObject *__pyx_codeobj__29; PyObject *__pyx_codeobj__30; PyObject *__pyx_codeobj__31; PyObject *__pyx_codeobj__33; PyObject *__pyx_codeobj__34; PyObject *__pyx_codeobj__35; PyObject *__pyx_codeobj__36; PyObject *__pyx_codeobj__37; PyObject *__pyx_codeobj__40; PyObject *__pyx_codeobj__41; PyObject *__pyx_codeobj__42; PyObject *__pyx_codeobj__44; PyObject *__pyx_codeobj__46; PyObject *__pyx_codeobj__48; PyObject *__pyx_codeobj__50; PyObject *__pyx_codeobj__52; PyObject *__pyx_codeobj__53; PyObject *__pyx_codeobj__54; PyObject *__pyx_codeobj__55; PyObject *__pyx_codeobj__56; PyObject *__pyx_codeobj__58; PyObject *__pyx_codeobj__59; PyObject *__pyx_codeobj__60; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type); Py_CLEAR(clear_module_state->__pyx_ptype_4borg_9hashindex_IndexBase); Py_CLEAR(clear_module_state->__pyx_type_4borg_9hashindex_IndexBase); Py_CLEAR(clear_module_state->__pyx_ptype_4borg_9hashindex_FuseVersionsIndex); Py_CLEAR(clear_module_state->__pyx_type_4borg_9hashindex_FuseVersionsIndex); Py_CLEAR(clear_module_state->__pyx_ptype_4borg_9hashindex_NSIndex); Py_CLEAR(clear_module_state->__pyx_type_4borg_9hashindex_NSIndex); Py_CLEAR(clear_module_state->__pyx_ptype_4borg_9hashindex_NSKeyIterator); Py_CLEAR(clear_module_state->__pyx_type_4borg_9hashindex_NSKeyIterator); Py_CLEAR(clear_module_state->__pyx_ptype_4borg_9hashindex_ChunkIndex); Py_CLEAR(clear_module_state->__pyx_type_4borg_9hashindex_ChunkIndex); Py_CLEAR(clear_module_state->__pyx_ptype_4borg_9hashindex_ChunkKeyIterator); Py_CLEAR(clear_module_state->__pyx_type_4borg_9hashindex_ChunkKeyIterator); Py_CLEAR(clear_module_state->__pyx_ptype_4borg_9hashindex_CacheSynchronizer); Py_CLEAR(clear_module_state->__pyx_type_4borg_9hashindex_CacheSynchronizer); Py_CLEAR(clear_module_state->__pyx_kp_s_1_4_01); Py_CLEAR(clear_module_state->__pyx_n_s_API_VERSION); Py_CLEAR(clear_module_state->__pyx_n_s_AssertionError); Py_CLEAR(clear_module_state->__pyx_n_s_CacheSynchronizer); Py_CLEAR(clear_module_state->__pyx_n_s_CacheSynchronizer___reduce_cytho); Py_CLEAR(clear_module_state->__pyx_n_s_CacheSynchronizer___setstate_cyt); Py_CLEAR(clear_module_state->__pyx_n_s_CacheSynchronizer_feed); Py_CLEAR(clear_module_state->__pyx_n_s_ChunkIndex); Py_CLEAR(clear_module_state->__pyx_n_s_ChunkIndexEntry); Py_CLEAR(clear_module_state->__pyx_n_s_ChunkIndex___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_ChunkIndex___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_ChunkIndex_add); Py_CLEAR(clear_module_state->__pyx_n_s_ChunkIndex_decref); Py_CLEAR(clear_module_state->__pyx_n_s_ChunkIndex_incref); Py_CLEAR(clear_module_state->__pyx_n_s_ChunkIndex_iteritems); Py_CLEAR(clear_module_state->__pyx_n_s_ChunkIndex_merge); Py_CLEAR(clear_module_state->__pyx_n_s_ChunkIndex_stats_against); Py_CLEAR(clear_module_state->__pyx_n_s_ChunkIndex_summarize); Py_CLEAR(clear_module_state->__pyx_n_s_ChunkIndex_zero_csize_ids); Py_CLEAR(clear_module_state->__pyx_n_s_ChunkKeyIterator); Py_CLEAR(clear_module_state->__pyx_n_s_ChunkKeyIterator___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_ChunkKeyIterator___setstate_cyth); Py_CLEAR(clear_module_state->__pyx_kp_s_Expected_bytes_of_length_16_for); Py_CLEAR(clear_module_state->__pyx_n_s_FuseVersionsIndex); Py_CLEAR(clear_module_state->__pyx_n_s_FuseVersionsIndex___reduce_cytho); Py_CLEAR(clear_module_state->__pyx_n_s_FuseVersionsIndex___setstate_cyt); Py_CLEAR(clear_module_state->__pyx_n_s_IndexBase___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_IndexBase___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_IndexBase_clear); Py_CLEAR(clear_module_state->__pyx_n_s_IndexBase_compact); Py_CLEAR(clear_module_state->__pyx_n_s_IndexBase_get); Py_CLEAR(clear_module_state->__pyx_n_s_IndexBase_pop); Py_CLEAR(clear_module_state->__pyx_n_s_IndexBase_read); Py_CLEAR(clear_module_state->__pyx_n_s_IndexBase_setdefault); Py_CLEAR(clear_module_state->__pyx_n_s_IndexBase_size); Py_CLEAR(clear_module_state->__pyx_n_s_IndexBase_write); Py_CLEAR(clear_module_state->__pyx_n_s_IndexError); Py_CLEAR(clear_module_state->__pyx_n_s_KeyError); Py_CLEAR(clear_module_state->__pyx_n_s_MAX_LOAD_FACTOR); Py_CLEAR(clear_module_state->__pyx_n_s_MAX_VALUE); Py_CLEAR(clear_module_state->__pyx_n_s_NSIndex); Py_CLEAR(clear_module_state->__pyx_n_s_NSIndex___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_NSIndex___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_NSIndex_iteritems); Py_CLEAR(clear_module_state->__pyx_n_s_NSKeyIterator); Py_CLEAR(clear_module_state->__pyx_n_s_NSKeyIterator___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_NSKeyIterator___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_StopIteration); Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); Py_CLEAR(clear_module_state->__pyx_n_s__10); Py_CLEAR(clear_module_state->__pyx_n_s__61); Py_CLEAR(clear_module_state->__pyx_kp_u__9); Py_CLEAR(clear_module_state->__pyx_n_s_add); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_borg_hashindex); Py_CLEAR(clear_module_state->__pyx_kp_s_cache_sync_feed_failed); Py_CLEAR(clear_module_state->__pyx_kp_s_cache_sync_init_failed); Py_CLEAR(clear_module_state->__pyx_n_s_capacity); Py_CLEAR(clear_module_state->__pyx_n_s_chunk); Py_CLEAR(clear_module_state->__pyx_n_s_chunk_buf); Py_CLEAR(clear_module_state->__pyx_n_s_chunk_csize); Py_CLEAR(clear_module_state->__pyx_n_s_chunk_size); Py_CLEAR(clear_module_state->__pyx_n_s_chunks); Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem); Py_CLEAR(clear_module_state->__pyx_n_s_clear); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_cls); Py_CLEAR(clear_module_state->__pyx_n_s_collections); Py_CLEAR(clear_module_state->__pyx_n_s_compact); Py_CLEAR(clear_module_state->__pyx_n_s_csize); Py_CLEAR(clear_module_state->__pyx_n_s_data); Py_CLEAR(clear_module_state->__pyx_n_s_decref); Py_CLEAR(clear_module_state->__pyx_n_s_default); Py_CLEAR(clear_module_state->__pyx_n_s_dict); Py_CLEAR(clear_module_state->__pyx_kp_u_disable); Py_CLEAR(clear_module_state->__pyx_kp_u_enable); Py_CLEAR(clear_module_state->__pyx_n_s_enter); Py_CLEAR(clear_module_state->__pyx_n_s_entries); Py_CLEAR(clear_module_state->__pyx_n_s_error); Py_CLEAR(clear_module_state->__pyx_n_s_exit); Py_CLEAR(clear_module_state->__pyx_n_s_fd); Py_CLEAR(clear_module_state->__pyx_n_s_feed); Py_CLEAR(clear_module_state->__pyx_kp_u_gc); Py_CLEAR(clear_module_state->__pyx_n_s_get); Py_CLEAR(clear_module_state->__pyx_n_s_getstate); Py_CLEAR(clear_module_state->__pyx_kp_s_hashindex_delete_failed); Py_CLEAR(clear_module_state->__pyx_kp_s_hashindex_init_failed); Py_CLEAR(clear_module_state->__pyx_kp_s_hashindex_read_returned_NULL_wit); Py_CLEAR(clear_module_state->__pyx_kp_s_hashindex_set_failed); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_incref); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_kp_s_invalid_reference_count); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); Py_CLEAR(clear_module_state->__pyx_n_s_iter); Py_CLEAR(clear_module_state->__pyx_n_s_iteritems); Py_CLEAR(clear_module_state->__pyx_n_s_key); Py_CLEAR(clear_module_state->__pyx_n_s_key_size); Py_CLEAR(clear_module_state->__pyx_n_s_key_size_2); Py_CLEAR(clear_module_state->__pyx_n_s_locale); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_marker); Py_CLEAR(clear_module_state->__pyx_n_s_master); Py_CLEAR(clear_module_state->__pyx_n_s_master_index); Py_CLEAR(clear_module_state->__pyx_n_s_master_values); Py_CLEAR(clear_module_state->__pyx_kp_s_maximum_number_of_segments_reach); Py_CLEAR(clear_module_state->__pyx_kp_s_maximum_number_of_versions_reach); Py_CLEAR(clear_module_state->__pyx_n_s_merge); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_namedtuple); Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_CLEAR(clear_module_state->__pyx_n_s_object); Py_CLEAR(clear_module_state->__pyx_n_s_open); Py_CLEAR(clear_module_state->__pyx_n_s_os); Py_CLEAR(clear_module_state->__pyx_n_s_other); Py_CLEAR(clear_module_state->__pyx_n_s_our_refcount); Py_CLEAR(clear_module_state->__pyx_n_s_our_values); Py_CLEAR(clear_module_state->__pyx_n_s_path); Py_CLEAR(clear_module_state->__pyx_n_s_permit_compact); Py_CLEAR(clear_module_state->__pyx_n_s_pop); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable); Py_CLEAR(clear_module_state->__pyx_n_s_rb); Py_CLEAR(clear_module_state->__pyx_n_s_rc); Py_CLEAR(clear_module_state->__pyx_n_s_read); Py_CLEAR(clear_module_state->__pyx_n_s_reduce); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex); Py_CLEAR(clear_module_state->__pyx_n_s_refcount); Py_CLEAR(clear_module_state->__pyx_kp_s_refcount_size_csize); Py_CLEAR(clear_module_state->__pyx_n_s_refs); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_n_s_setdefault); Py_CLEAR(clear_module_state->__pyx_n_s_setstate); Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_size); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_kp_s_src_borg_hashindex_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_stats_against); Py_CLEAR(clear_module_state->__pyx_kp_s_stats_against_key_contained_in_s); Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource); Py_CLEAR(clear_module_state->__pyx_n_s_summarize); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_unique_chunks); Py_CLEAR(clear_module_state->__pyx_n_s_unique_csize); Py_CLEAR(clear_module_state->__pyx_n_s_unique_size); Py_CLEAR(clear_module_state->__pyx_n_s_usable); Py_CLEAR(clear_module_state->__pyx_n_s_value); Py_CLEAR(clear_module_state->__pyx_n_s_value_size); Py_CLEAR(clear_module_state->__pyx_n_s_values); Py_CLEAR(clear_module_state->__pyx_n_s_wb); Py_CLEAR(clear_module_state->__pyx_n_s_write); Py_CLEAR(clear_module_state->__pyx_n_s_zero_csize_ids); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_8); Py_CLEAR(clear_module_state->__pyx_int_12); Py_CLEAR(clear_module_state->__pyx_int_16); Py_CLEAR(clear_module_state->__pyx_int_20); Py_CLEAR(clear_module_state->__pyx_int_32); Py_CLEAR(clear_module_state->__pyx_int_4294967295); Py_CLEAR(clear_module_state->__pyx_k__4); Py_CLEAR(clear_module_state->__pyx_tuple_); Py_CLEAR(clear_module_state->__pyx_tuple__2); Py_CLEAR(clear_module_state->__pyx_tuple__3); Py_CLEAR(clear_module_state->__pyx_tuple__5); Py_CLEAR(clear_module_state->__pyx_tuple__6); Py_CLEAR(clear_module_state->__pyx_tuple__7); Py_CLEAR(clear_module_state->__pyx_tuple__8); Py_CLEAR(clear_module_state->__pyx_tuple__11); Py_CLEAR(clear_module_state->__pyx_tuple__13); Py_CLEAR(clear_module_state->__pyx_tuple__14); Py_CLEAR(clear_module_state->__pyx_tuple__16); Py_CLEAR(clear_module_state->__pyx_tuple__18); Py_CLEAR(clear_module_state->__pyx_tuple__20); Py_CLEAR(clear_module_state->__pyx_tuple__22); Py_CLEAR(clear_module_state->__pyx_tuple__23); Py_CLEAR(clear_module_state->__pyx_tuple__28); Py_CLEAR(clear_module_state->__pyx_tuple__32); Py_CLEAR(clear_module_state->__pyx_tuple__38); Py_CLEAR(clear_module_state->__pyx_tuple__39); Py_CLEAR(clear_module_state->__pyx_tuple__43); Py_CLEAR(clear_module_state->__pyx_tuple__45); Py_CLEAR(clear_module_state->__pyx_tuple__47); Py_CLEAR(clear_module_state->__pyx_tuple__49); Py_CLEAR(clear_module_state->__pyx_tuple__51); Py_CLEAR(clear_module_state->__pyx_tuple__57); Py_CLEAR(clear_module_state->__pyx_codeobj__12); Py_CLEAR(clear_module_state->__pyx_codeobj__15); Py_CLEAR(clear_module_state->__pyx_codeobj__17); Py_CLEAR(clear_module_state->__pyx_codeobj__19); Py_CLEAR(clear_module_state->__pyx_codeobj__21); Py_CLEAR(clear_module_state->__pyx_codeobj__24); Py_CLEAR(clear_module_state->__pyx_codeobj__25); Py_CLEAR(clear_module_state->__pyx_codeobj__26); Py_CLEAR(clear_module_state->__pyx_codeobj__27); Py_CLEAR(clear_module_state->__pyx_codeobj__29); Py_CLEAR(clear_module_state->__pyx_codeobj__30); Py_CLEAR(clear_module_state->__pyx_codeobj__31); Py_CLEAR(clear_module_state->__pyx_codeobj__33); Py_CLEAR(clear_module_state->__pyx_codeobj__34); Py_CLEAR(clear_module_state->__pyx_codeobj__35); Py_CLEAR(clear_module_state->__pyx_codeobj__36); Py_CLEAR(clear_module_state->__pyx_codeobj__37); Py_CLEAR(clear_module_state->__pyx_codeobj__40); Py_CLEAR(clear_module_state->__pyx_codeobj__41); Py_CLEAR(clear_module_state->__pyx_codeobj__42); Py_CLEAR(clear_module_state->__pyx_codeobj__44); Py_CLEAR(clear_module_state->__pyx_codeobj__46); Py_CLEAR(clear_module_state->__pyx_codeobj__48); Py_CLEAR(clear_module_state->__pyx_codeobj__50); Py_CLEAR(clear_module_state->__pyx_codeobj__52); Py_CLEAR(clear_module_state->__pyx_codeobj__53); Py_CLEAR(clear_module_state->__pyx_codeobj__54); Py_CLEAR(clear_module_state->__pyx_codeobj__55); Py_CLEAR(clear_module_state->__pyx_codeobj__56); Py_CLEAR(clear_module_state->__pyx_codeobj__58); Py_CLEAR(clear_module_state->__pyx_codeobj__59); Py_CLEAR(clear_module_state->__pyx_codeobj__60); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type); Py_VISIT(traverse_module_state->__pyx_ptype_4borg_9hashindex_IndexBase); Py_VISIT(traverse_module_state->__pyx_type_4borg_9hashindex_IndexBase); Py_VISIT(traverse_module_state->__pyx_ptype_4borg_9hashindex_FuseVersionsIndex); Py_VISIT(traverse_module_state->__pyx_type_4borg_9hashindex_FuseVersionsIndex); Py_VISIT(traverse_module_state->__pyx_ptype_4borg_9hashindex_NSIndex); Py_VISIT(traverse_module_state->__pyx_type_4borg_9hashindex_NSIndex); Py_VISIT(traverse_module_state->__pyx_ptype_4borg_9hashindex_NSKeyIterator); Py_VISIT(traverse_module_state->__pyx_type_4borg_9hashindex_NSKeyIterator); Py_VISIT(traverse_module_state->__pyx_ptype_4borg_9hashindex_ChunkIndex); Py_VISIT(traverse_module_state->__pyx_type_4borg_9hashindex_ChunkIndex); Py_VISIT(traverse_module_state->__pyx_ptype_4borg_9hashindex_ChunkKeyIterator); Py_VISIT(traverse_module_state->__pyx_type_4borg_9hashindex_ChunkKeyIterator); Py_VISIT(traverse_module_state->__pyx_ptype_4borg_9hashindex_CacheSynchronizer); Py_VISIT(traverse_module_state->__pyx_type_4borg_9hashindex_CacheSynchronizer); Py_VISIT(traverse_module_state->__pyx_kp_s_1_4_01); Py_VISIT(traverse_module_state->__pyx_n_s_API_VERSION); Py_VISIT(traverse_module_state->__pyx_n_s_AssertionError); Py_VISIT(traverse_module_state->__pyx_n_s_CacheSynchronizer); Py_VISIT(traverse_module_state->__pyx_n_s_CacheSynchronizer___reduce_cytho); Py_VISIT(traverse_module_state->__pyx_n_s_CacheSynchronizer___setstate_cyt); Py_VISIT(traverse_module_state->__pyx_n_s_CacheSynchronizer_feed); Py_VISIT(traverse_module_state->__pyx_n_s_ChunkIndex); Py_VISIT(traverse_module_state->__pyx_n_s_ChunkIndexEntry); Py_VISIT(traverse_module_state->__pyx_n_s_ChunkIndex___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_ChunkIndex___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_ChunkIndex_add); Py_VISIT(traverse_module_state->__pyx_n_s_ChunkIndex_decref); Py_VISIT(traverse_module_state->__pyx_n_s_ChunkIndex_incref); Py_VISIT(traverse_module_state->__pyx_n_s_ChunkIndex_iteritems); Py_VISIT(traverse_module_state->__pyx_n_s_ChunkIndex_merge); Py_VISIT(traverse_module_state->__pyx_n_s_ChunkIndex_stats_against); Py_VISIT(traverse_module_state->__pyx_n_s_ChunkIndex_summarize); Py_VISIT(traverse_module_state->__pyx_n_s_ChunkIndex_zero_csize_ids); Py_VISIT(traverse_module_state->__pyx_n_s_ChunkKeyIterator); Py_VISIT(traverse_module_state->__pyx_n_s_ChunkKeyIterator___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_ChunkKeyIterator___setstate_cyth); Py_VISIT(traverse_module_state->__pyx_kp_s_Expected_bytes_of_length_16_for); Py_VISIT(traverse_module_state->__pyx_n_s_FuseVersionsIndex); Py_VISIT(traverse_module_state->__pyx_n_s_FuseVersionsIndex___reduce_cytho); Py_VISIT(traverse_module_state->__pyx_n_s_FuseVersionsIndex___setstate_cyt); Py_VISIT(traverse_module_state->__pyx_n_s_IndexBase___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_IndexBase___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_IndexBase_clear); Py_VISIT(traverse_module_state->__pyx_n_s_IndexBase_compact); Py_VISIT(traverse_module_state->__pyx_n_s_IndexBase_get); Py_VISIT(traverse_module_state->__pyx_n_s_IndexBase_pop); Py_VISIT(traverse_module_state->__pyx_n_s_IndexBase_read); Py_VISIT(traverse_module_state->__pyx_n_s_IndexBase_setdefault); Py_VISIT(traverse_module_state->__pyx_n_s_IndexBase_size); Py_VISIT(traverse_module_state->__pyx_n_s_IndexBase_write); Py_VISIT(traverse_module_state->__pyx_n_s_IndexError); Py_VISIT(traverse_module_state->__pyx_n_s_KeyError); Py_VISIT(traverse_module_state->__pyx_n_s_MAX_LOAD_FACTOR); Py_VISIT(traverse_module_state->__pyx_n_s_MAX_VALUE); Py_VISIT(traverse_module_state->__pyx_n_s_NSIndex); Py_VISIT(traverse_module_state->__pyx_n_s_NSIndex___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_NSIndex___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_NSIndex_iteritems); Py_VISIT(traverse_module_state->__pyx_n_s_NSKeyIterator); Py_VISIT(traverse_module_state->__pyx_n_s_NSKeyIterator___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_NSKeyIterator___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_StopIteration); Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); Py_VISIT(traverse_module_state->__pyx_n_s__10); Py_VISIT(traverse_module_state->__pyx_n_s__61); Py_VISIT(traverse_module_state->__pyx_kp_u__9); Py_VISIT(traverse_module_state->__pyx_n_s_add); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_borg_hashindex); Py_VISIT(traverse_module_state->__pyx_kp_s_cache_sync_feed_failed); Py_VISIT(traverse_module_state->__pyx_kp_s_cache_sync_init_failed); Py_VISIT(traverse_module_state->__pyx_n_s_capacity); Py_VISIT(traverse_module_state->__pyx_n_s_chunk); Py_VISIT(traverse_module_state->__pyx_n_s_chunk_buf); Py_VISIT(traverse_module_state->__pyx_n_s_chunk_csize); Py_VISIT(traverse_module_state->__pyx_n_s_chunk_size); Py_VISIT(traverse_module_state->__pyx_n_s_chunks); Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem); Py_VISIT(traverse_module_state->__pyx_n_s_clear); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_cls); Py_VISIT(traverse_module_state->__pyx_n_s_collections); Py_VISIT(traverse_module_state->__pyx_n_s_compact); Py_VISIT(traverse_module_state->__pyx_n_s_csize); Py_VISIT(traverse_module_state->__pyx_n_s_data); Py_VISIT(traverse_module_state->__pyx_n_s_decref); Py_VISIT(traverse_module_state->__pyx_n_s_default); Py_VISIT(traverse_module_state->__pyx_n_s_dict); Py_VISIT(traverse_module_state->__pyx_kp_u_disable); Py_VISIT(traverse_module_state->__pyx_kp_u_enable); Py_VISIT(traverse_module_state->__pyx_n_s_enter); Py_VISIT(traverse_module_state->__pyx_n_s_entries); Py_VISIT(traverse_module_state->__pyx_n_s_error); Py_VISIT(traverse_module_state->__pyx_n_s_exit); Py_VISIT(traverse_module_state->__pyx_n_s_fd); Py_VISIT(traverse_module_state->__pyx_n_s_feed); Py_VISIT(traverse_module_state->__pyx_kp_u_gc); Py_VISIT(traverse_module_state->__pyx_n_s_get); Py_VISIT(traverse_module_state->__pyx_n_s_getstate); Py_VISIT(traverse_module_state->__pyx_kp_s_hashindex_delete_failed); Py_VISIT(traverse_module_state->__pyx_kp_s_hashindex_init_failed); Py_VISIT(traverse_module_state->__pyx_kp_s_hashindex_read_returned_NULL_wit); Py_VISIT(traverse_module_state->__pyx_kp_s_hashindex_set_failed); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_incref); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_kp_s_invalid_reference_count); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); Py_VISIT(traverse_module_state->__pyx_n_s_iter); Py_VISIT(traverse_module_state->__pyx_n_s_iteritems); Py_VISIT(traverse_module_state->__pyx_n_s_key); Py_VISIT(traverse_module_state->__pyx_n_s_key_size); Py_VISIT(traverse_module_state->__pyx_n_s_key_size_2); Py_VISIT(traverse_module_state->__pyx_n_s_locale); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_marker); Py_VISIT(traverse_module_state->__pyx_n_s_master); Py_VISIT(traverse_module_state->__pyx_n_s_master_index); Py_VISIT(traverse_module_state->__pyx_n_s_master_values); Py_VISIT(traverse_module_state->__pyx_kp_s_maximum_number_of_segments_reach); Py_VISIT(traverse_module_state->__pyx_kp_s_maximum_number_of_versions_reach); Py_VISIT(traverse_module_state->__pyx_n_s_merge); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_namedtuple); Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_VISIT(traverse_module_state->__pyx_n_s_object); Py_VISIT(traverse_module_state->__pyx_n_s_open); Py_VISIT(traverse_module_state->__pyx_n_s_os); Py_VISIT(traverse_module_state->__pyx_n_s_other); Py_VISIT(traverse_module_state->__pyx_n_s_our_refcount); Py_VISIT(traverse_module_state->__pyx_n_s_our_values); Py_VISIT(traverse_module_state->__pyx_n_s_path); Py_VISIT(traverse_module_state->__pyx_n_s_permit_compact); Py_VISIT(traverse_module_state->__pyx_n_s_pop); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable); Py_VISIT(traverse_module_state->__pyx_n_s_rb); Py_VISIT(traverse_module_state->__pyx_n_s_rc); Py_VISIT(traverse_module_state->__pyx_n_s_read); Py_VISIT(traverse_module_state->__pyx_n_s_reduce); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex); Py_VISIT(traverse_module_state->__pyx_n_s_refcount); Py_VISIT(traverse_module_state->__pyx_kp_s_refcount_size_csize); Py_VISIT(traverse_module_state->__pyx_n_s_refs); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_n_s_setdefault); Py_VISIT(traverse_module_state->__pyx_n_s_setstate); Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_size); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_kp_s_src_borg_hashindex_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_stats_against); Py_VISIT(traverse_module_state->__pyx_kp_s_stats_against_key_contained_in_s); Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource); Py_VISIT(traverse_module_state->__pyx_n_s_summarize); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_unique_chunks); Py_VISIT(traverse_module_state->__pyx_n_s_unique_csize); Py_VISIT(traverse_module_state->__pyx_n_s_unique_size); Py_VISIT(traverse_module_state->__pyx_n_s_usable); Py_VISIT(traverse_module_state->__pyx_n_s_value); Py_VISIT(traverse_module_state->__pyx_n_s_value_size); Py_VISIT(traverse_module_state->__pyx_n_s_values); Py_VISIT(traverse_module_state->__pyx_n_s_wb); Py_VISIT(traverse_module_state->__pyx_n_s_write); Py_VISIT(traverse_module_state->__pyx_n_s_zero_csize_ids); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_int_8); Py_VISIT(traverse_module_state->__pyx_int_12); Py_VISIT(traverse_module_state->__pyx_int_16); Py_VISIT(traverse_module_state->__pyx_int_20); Py_VISIT(traverse_module_state->__pyx_int_32); Py_VISIT(traverse_module_state->__pyx_int_4294967295); Py_VISIT(traverse_module_state->__pyx_k__4); Py_VISIT(traverse_module_state->__pyx_tuple_); Py_VISIT(traverse_module_state->__pyx_tuple__2); Py_VISIT(traverse_module_state->__pyx_tuple__3); Py_VISIT(traverse_module_state->__pyx_tuple__5); Py_VISIT(traverse_module_state->__pyx_tuple__6); Py_VISIT(traverse_module_state->__pyx_tuple__7); Py_VISIT(traverse_module_state->__pyx_tuple__8); Py_VISIT(traverse_module_state->__pyx_tuple__11); Py_VISIT(traverse_module_state->__pyx_tuple__13); Py_VISIT(traverse_module_state->__pyx_tuple__14); Py_VISIT(traverse_module_state->__pyx_tuple__16); Py_VISIT(traverse_module_state->__pyx_tuple__18); Py_VISIT(traverse_module_state->__pyx_tuple__20); Py_VISIT(traverse_module_state->__pyx_tuple__22); Py_VISIT(traverse_module_state->__pyx_tuple__23); Py_VISIT(traverse_module_state->__pyx_tuple__28); Py_VISIT(traverse_module_state->__pyx_tuple__32); Py_VISIT(traverse_module_state->__pyx_tuple__38); Py_VISIT(traverse_module_state->__pyx_tuple__39); Py_VISIT(traverse_module_state->__pyx_tuple__43); Py_VISIT(traverse_module_state->__pyx_tuple__45); Py_VISIT(traverse_module_state->__pyx_tuple__47); Py_VISIT(traverse_module_state->__pyx_tuple__49); Py_VISIT(traverse_module_state->__pyx_tuple__51); Py_VISIT(traverse_module_state->__pyx_tuple__57); Py_VISIT(traverse_module_state->__pyx_codeobj__12); Py_VISIT(traverse_module_state->__pyx_codeobj__15); Py_VISIT(traverse_module_state->__pyx_codeobj__17); Py_VISIT(traverse_module_state->__pyx_codeobj__19); Py_VISIT(traverse_module_state->__pyx_codeobj__21); Py_VISIT(traverse_module_state->__pyx_codeobj__24); Py_VISIT(traverse_module_state->__pyx_codeobj__25); Py_VISIT(traverse_module_state->__pyx_codeobj__26); Py_VISIT(traverse_module_state->__pyx_codeobj__27); Py_VISIT(traverse_module_state->__pyx_codeobj__29); Py_VISIT(traverse_module_state->__pyx_codeobj__30); Py_VISIT(traverse_module_state->__pyx_codeobj__31); Py_VISIT(traverse_module_state->__pyx_codeobj__33); Py_VISIT(traverse_module_state->__pyx_codeobj__34); Py_VISIT(traverse_module_state->__pyx_codeobj__35); Py_VISIT(traverse_module_state->__pyx_codeobj__36); Py_VISIT(traverse_module_state->__pyx_codeobj__37); Py_VISIT(traverse_module_state->__pyx_codeobj__40); Py_VISIT(traverse_module_state->__pyx_codeobj__41); Py_VISIT(traverse_module_state->__pyx_codeobj__42); Py_VISIT(traverse_module_state->__pyx_codeobj__44); Py_VISIT(traverse_module_state->__pyx_codeobj__46); Py_VISIT(traverse_module_state->__pyx_codeobj__48); Py_VISIT(traverse_module_state->__pyx_codeobj__50); Py_VISIT(traverse_module_state->__pyx_codeobj__52); Py_VISIT(traverse_module_state->__pyx_codeobj__53); Py_VISIT(traverse_module_state->__pyx_codeobj__54); Py_VISIT(traverse_module_state->__pyx_codeobj__55); Py_VISIT(traverse_module_state->__pyx_codeobj__56); Py_VISIT(traverse_module_state->__pyx_codeobj__58); Py_VISIT(traverse_module_state->__pyx_codeobj__59); Py_VISIT(traverse_module_state->__pyx_codeobj__60); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #define __pyx_type_4borg_9hashindex_IndexBase __pyx_mstate_global->__pyx_type_4borg_9hashindex_IndexBase #define __pyx_type_4borg_9hashindex_FuseVersionsIndex __pyx_mstate_global->__pyx_type_4borg_9hashindex_FuseVersionsIndex #define __pyx_type_4borg_9hashindex_NSIndex __pyx_mstate_global->__pyx_type_4borg_9hashindex_NSIndex #define __pyx_type_4borg_9hashindex_NSKeyIterator __pyx_mstate_global->__pyx_type_4borg_9hashindex_NSKeyIterator #define __pyx_type_4borg_9hashindex_ChunkIndex __pyx_mstate_global->__pyx_type_4borg_9hashindex_ChunkIndex #define __pyx_type_4borg_9hashindex_ChunkKeyIterator __pyx_mstate_global->__pyx_type_4borg_9hashindex_ChunkKeyIterator #define __pyx_type_4borg_9hashindex_CacheSynchronizer __pyx_mstate_global->__pyx_type_4borg_9hashindex_CacheSynchronizer #endif #define __pyx_ptype_4borg_9hashindex_IndexBase __pyx_mstate_global->__pyx_ptype_4borg_9hashindex_IndexBase #define __pyx_ptype_4borg_9hashindex_FuseVersionsIndex __pyx_mstate_global->__pyx_ptype_4borg_9hashindex_FuseVersionsIndex #define __pyx_ptype_4borg_9hashindex_NSIndex __pyx_mstate_global->__pyx_ptype_4borg_9hashindex_NSIndex #define __pyx_ptype_4borg_9hashindex_NSKeyIterator __pyx_mstate_global->__pyx_ptype_4borg_9hashindex_NSKeyIterator #define __pyx_ptype_4borg_9hashindex_ChunkIndex __pyx_mstate_global->__pyx_ptype_4borg_9hashindex_ChunkIndex #define __pyx_ptype_4borg_9hashindex_ChunkKeyIterator __pyx_mstate_global->__pyx_ptype_4borg_9hashindex_ChunkKeyIterator #define __pyx_ptype_4borg_9hashindex_CacheSynchronizer __pyx_mstate_global->__pyx_ptype_4borg_9hashindex_CacheSynchronizer #define __pyx_kp_s_1_4_01 __pyx_mstate_global->__pyx_kp_s_1_4_01 #define __pyx_n_s_API_VERSION __pyx_mstate_global->__pyx_n_s_API_VERSION #define __pyx_n_s_AssertionError __pyx_mstate_global->__pyx_n_s_AssertionError #define __pyx_n_s_CacheSynchronizer __pyx_mstate_global->__pyx_n_s_CacheSynchronizer #define __pyx_n_s_CacheSynchronizer___reduce_cytho __pyx_mstate_global->__pyx_n_s_CacheSynchronizer___reduce_cytho #define __pyx_n_s_CacheSynchronizer___setstate_cyt __pyx_mstate_global->__pyx_n_s_CacheSynchronizer___setstate_cyt #define __pyx_n_s_CacheSynchronizer_feed __pyx_mstate_global->__pyx_n_s_CacheSynchronizer_feed #define __pyx_n_s_ChunkIndex __pyx_mstate_global->__pyx_n_s_ChunkIndex #define __pyx_n_s_ChunkIndexEntry __pyx_mstate_global->__pyx_n_s_ChunkIndexEntry #define __pyx_n_s_ChunkIndex___reduce_cython __pyx_mstate_global->__pyx_n_s_ChunkIndex___reduce_cython #define __pyx_n_s_ChunkIndex___setstate_cython __pyx_mstate_global->__pyx_n_s_ChunkIndex___setstate_cython #define __pyx_n_s_ChunkIndex_add __pyx_mstate_global->__pyx_n_s_ChunkIndex_add #define __pyx_n_s_ChunkIndex_decref __pyx_mstate_global->__pyx_n_s_ChunkIndex_decref #define __pyx_n_s_ChunkIndex_incref __pyx_mstate_global->__pyx_n_s_ChunkIndex_incref #define __pyx_n_s_ChunkIndex_iteritems __pyx_mstate_global->__pyx_n_s_ChunkIndex_iteritems #define __pyx_n_s_ChunkIndex_merge __pyx_mstate_global->__pyx_n_s_ChunkIndex_merge #define __pyx_n_s_ChunkIndex_stats_against __pyx_mstate_global->__pyx_n_s_ChunkIndex_stats_against #define __pyx_n_s_ChunkIndex_summarize __pyx_mstate_global->__pyx_n_s_ChunkIndex_summarize #define __pyx_n_s_ChunkIndex_zero_csize_ids __pyx_mstate_global->__pyx_n_s_ChunkIndex_zero_csize_ids #define __pyx_n_s_ChunkKeyIterator __pyx_mstate_global->__pyx_n_s_ChunkKeyIterator #define __pyx_n_s_ChunkKeyIterator___reduce_cython __pyx_mstate_global->__pyx_n_s_ChunkKeyIterator___reduce_cython #define __pyx_n_s_ChunkKeyIterator___setstate_cyth __pyx_mstate_global->__pyx_n_s_ChunkKeyIterator___setstate_cyth #define __pyx_kp_s_Expected_bytes_of_length_16_for __pyx_mstate_global->__pyx_kp_s_Expected_bytes_of_length_16_for #define __pyx_n_s_FuseVersionsIndex __pyx_mstate_global->__pyx_n_s_FuseVersionsIndex #define __pyx_n_s_FuseVersionsIndex___reduce_cytho __pyx_mstate_global->__pyx_n_s_FuseVersionsIndex___reduce_cytho #define __pyx_n_s_FuseVersionsIndex___setstate_cyt __pyx_mstate_global->__pyx_n_s_FuseVersionsIndex___setstate_cyt #define __pyx_n_s_IndexBase___reduce_cython __pyx_mstate_global->__pyx_n_s_IndexBase___reduce_cython #define __pyx_n_s_IndexBase___setstate_cython __pyx_mstate_global->__pyx_n_s_IndexBase___setstate_cython #define __pyx_n_s_IndexBase_clear __pyx_mstate_global->__pyx_n_s_IndexBase_clear #define __pyx_n_s_IndexBase_compact __pyx_mstate_global->__pyx_n_s_IndexBase_compact #define __pyx_n_s_IndexBase_get __pyx_mstate_global->__pyx_n_s_IndexBase_get #define __pyx_n_s_IndexBase_pop __pyx_mstate_global->__pyx_n_s_IndexBase_pop #define __pyx_n_s_IndexBase_read __pyx_mstate_global->__pyx_n_s_IndexBase_read #define __pyx_n_s_IndexBase_setdefault __pyx_mstate_global->__pyx_n_s_IndexBase_setdefault #define __pyx_n_s_IndexBase_size __pyx_mstate_global->__pyx_n_s_IndexBase_size #define __pyx_n_s_IndexBase_write __pyx_mstate_global->__pyx_n_s_IndexBase_write #define __pyx_n_s_IndexError __pyx_mstate_global->__pyx_n_s_IndexError #define __pyx_n_s_KeyError __pyx_mstate_global->__pyx_n_s_KeyError #define __pyx_n_s_MAX_LOAD_FACTOR __pyx_mstate_global->__pyx_n_s_MAX_LOAD_FACTOR #define __pyx_n_s_MAX_VALUE __pyx_mstate_global->__pyx_n_s_MAX_VALUE #define __pyx_n_s_NSIndex __pyx_mstate_global->__pyx_n_s_NSIndex #define __pyx_n_s_NSIndex___reduce_cython __pyx_mstate_global->__pyx_n_s_NSIndex___reduce_cython #define __pyx_n_s_NSIndex___setstate_cython __pyx_mstate_global->__pyx_n_s_NSIndex___setstate_cython #define __pyx_n_s_NSIndex_iteritems __pyx_mstate_global->__pyx_n_s_NSIndex_iteritems #define __pyx_n_s_NSKeyIterator __pyx_mstate_global->__pyx_n_s_NSKeyIterator #define __pyx_n_s_NSKeyIterator___reduce_cython __pyx_mstate_global->__pyx_n_s_NSKeyIterator___reduce_cython #define __pyx_n_s_NSKeyIterator___setstate_cython __pyx_mstate_global->__pyx_n_s_NSKeyIterator___setstate_cython #define __pyx_n_s_StopIteration __pyx_mstate_global->__pyx_n_s_StopIteration #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError #define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError #define __pyx_n_s__10 __pyx_mstate_global->__pyx_n_s__10 #define __pyx_n_s__61 __pyx_mstate_global->__pyx_n_s__61 #define __pyx_kp_u__9 __pyx_mstate_global->__pyx_kp_u__9 #define __pyx_n_s_add __pyx_mstate_global->__pyx_n_s_add #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_borg_hashindex __pyx_mstate_global->__pyx_n_s_borg_hashindex #define __pyx_kp_s_cache_sync_feed_failed __pyx_mstate_global->__pyx_kp_s_cache_sync_feed_failed #define __pyx_kp_s_cache_sync_init_failed __pyx_mstate_global->__pyx_kp_s_cache_sync_init_failed #define __pyx_n_s_capacity __pyx_mstate_global->__pyx_n_s_capacity #define __pyx_n_s_chunk __pyx_mstate_global->__pyx_n_s_chunk #define __pyx_n_s_chunk_buf __pyx_mstate_global->__pyx_n_s_chunk_buf #define __pyx_n_s_chunk_csize __pyx_mstate_global->__pyx_n_s_chunk_csize #define __pyx_n_s_chunk_size __pyx_mstate_global->__pyx_n_s_chunk_size #define __pyx_n_s_chunks __pyx_mstate_global->__pyx_n_s_chunks #define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem #define __pyx_n_s_clear __pyx_mstate_global->__pyx_n_s_clear #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_cls __pyx_mstate_global->__pyx_n_s_cls #define __pyx_n_s_collections __pyx_mstate_global->__pyx_n_s_collections #define __pyx_n_s_compact __pyx_mstate_global->__pyx_n_s_compact #define __pyx_n_s_csize __pyx_mstate_global->__pyx_n_s_csize #define __pyx_n_s_data __pyx_mstate_global->__pyx_n_s_data #define __pyx_n_s_decref __pyx_mstate_global->__pyx_n_s_decref #define __pyx_n_s_default __pyx_mstate_global->__pyx_n_s_default #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable #define __pyx_n_s_enter __pyx_mstate_global->__pyx_n_s_enter #define __pyx_n_s_entries __pyx_mstate_global->__pyx_n_s_entries #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error #define __pyx_n_s_exit __pyx_mstate_global->__pyx_n_s_exit #define __pyx_n_s_fd __pyx_mstate_global->__pyx_n_s_fd #define __pyx_n_s_feed __pyx_mstate_global->__pyx_n_s_feed #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc #define __pyx_n_s_get __pyx_mstate_global->__pyx_n_s_get #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate #define __pyx_kp_s_hashindex_delete_failed __pyx_mstate_global->__pyx_kp_s_hashindex_delete_failed #define __pyx_kp_s_hashindex_init_failed __pyx_mstate_global->__pyx_kp_s_hashindex_init_failed #define __pyx_kp_s_hashindex_read_returned_NULL_wit __pyx_mstate_global->__pyx_kp_s_hashindex_read_returned_NULL_wit #define __pyx_kp_s_hashindex_set_failed __pyx_mstate_global->__pyx_kp_s_hashindex_set_failed #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_incref __pyx_mstate_global->__pyx_n_s_incref #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_kp_s_invalid_reference_count __pyx_mstate_global->__pyx_kp_s_invalid_reference_count #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled #define __pyx_n_s_iter __pyx_mstate_global->__pyx_n_s_iter #define __pyx_n_s_iteritems __pyx_mstate_global->__pyx_n_s_iteritems #define __pyx_n_s_key __pyx_mstate_global->__pyx_n_s_key #define __pyx_n_s_key_size __pyx_mstate_global->__pyx_n_s_key_size #define __pyx_n_s_key_size_2 __pyx_mstate_global->__pyx_n_s_key_size_2 #define __pyx_n_s_locale __pyx_mstate_global->__pyx_n_s_locale #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_marker __pyx_mstate_global->__pyx_n_s_marker #define __pyx_n_s_master __pyx_mstate_global->__pyx_n_s_master #define __pyx_n_s_master_index __pyx_mstate_global->__pyx_n_s_master_index #define __pyx_n_s_master_values __pyx_mstate_global->__pyx_n_s_master_values #define __pyx_kp_s_maximum_number_of_segments_reach __pyx_mstate_global->__pyx_kp_s_maximum_number_of_segments_reach #define __pyx_kp_s_maximum_number_of_versions_reach __pyx_mstate_global->__pyx_kp_s_maximum_number_of_versions_reach #define __pyx_n_s_merge __pyx_mstate_global->__pyx_n_s_merge #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_namedtuple __pyx_mstate_global->__pyx_n_s_namedtuple #define __pyx_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non #define __pyx_n_s_object __pyx_mstate_global->__pyx_n_s_object #define __pyx_n_s_open __pyx_mstate_global->__pyx_n_s_open #define __pyx_n_s_os __pyx_mstate_global->__pyx_n_s_os #define __pyx_n_s_other __pyx_mstate_global->__pyx_n_s_other #define __pyx_n_s_our_refcount __pyx_mstate_global->__pyx_n_s_our_refcount #define __pyx_n_s_our_values __pyx_mstate_global->__pyx_n_s_our_values #define __pyx_n_s_path __pyx_mstate_global->__pyx_n_s_path #define __pyx_n_s_permit_compact __pyx_mstate_global->__pyx_n_s_permit_compact #define __pyx_n_s_pop __pyx_mstate_global->__pyx_n_s_pop #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable #define __pyx_n_s_rb __pyx_mstate_global->__pyx_n_s_rb #define __pyx_n_s_rc __pyx_mstate_global->__pyx_n_s_rc #define __pyx_n_s_read __pyx_mstate_global->__pyx_n_s_read #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex #define __pyx_n_s_refcount __pyx_mstate_global->__pyx_n_s_refcount #define __pyx_kp_s_refcount_size_csize __pyx_mstate_global->__pyx_kp_s_refcount_size_csize #define __pyx_n_s_refs __pyx_mstate_global->__pyx_n_s_refs #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_n_s_setdefault __pyx_mstate_global->__pyx_n_s_setdefault #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython #define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_kp_s_src_borg_hashindex_pyx __pyx_mstate_global->__pyx_kp_s_src_borg_hashindex_pyx #define __pyx_n_s_stats_against __pyx_mstate_global->__pyx_n_s_stats_against #define __pyx_kp_s_stats_against_key_contained_in_s __pyx_mstate_global->__pyx_kp_s_stats_against_key_contained_in_s #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource #define __pyx_n_s_summarize __pyx_mstate_global->__pyx_n_s_summarize #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_unique_chunks __pyx_mstate_global->__pyx_n_s_unique_chunks #define __pyx_n_s_unique_csize __pyx_mstate_global->__pyx_n_s_unique_csize #define __pyx_n_s_unique_size __pyx_mstate_global->__pyx_n_s_unique_size #define __pyx_n_s_usable __pyx_mstate_global->__pyx_n_s_usable #define __pyx_n_s_value __pyx_mstate_global->__pyx_n_s_value #define __pyx_n_s_value_size __pyx_mstate_global->__pyx_n_s_value_size #define __pyx_n_s_values __pyx_mstate_global->__pyx_n_s_values #define __pyx_n_s_wb __pyx_mstate_global->__pyx_n_s_wb #define __pyx_n_s_write __pyx_mstate_global->__pyx_n_s_write #define __pyx_n_s_zero_csize_ids __pyx_mstate_global->__pyx_n_s_zero_csize_ids #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_int_8 __pyx_mstate_global->__pyx_int_8 #define __pyx_int_12 __pyx_mstate_global->__pyx_int_12 #define __pyx_int_16 __pyx_mstate_global->__pyx_int_16 #define __pyx_int_20 __pyx_mstate_global->__pyx_int_20 #define __pyx_int_32 __pyx_mstate_global->__pyx_int_32 #define __pyx_int_4294967295 __pyx_mstate_global->__pyx_int_4294967295 #define __pyx_k__4 __pyx_mstate_global->__pyx_k__4 #define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_ #define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 #define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 #define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5 #define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6 #define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 #define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 #define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11 #define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13 #define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 #define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16 #define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18 #define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20 #define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22 #define __pyx_tuple__23 __pyx_mstate_global->__pyx_tuple__23 #define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28 #define __pyx_tuple__32 __pyx_mstate_global->__pyx_tuple__32 #define __pyx_tuple__38 __pyx_mstate_global->__pyx_tuple__38 #define __pyx_tuple__39 __pyx_mstate_global->__pyx_tuple__39 #define __pyx_tuple__43 __pyx_mstate_global->__pyx_tuple__43 #define __pyx_tuple__45 __pyx_mstate_global->__pyx_tuple__45 #define __pyx_tuple__47 __pyx_mstate_global->__pyx_tuple__47 #define __pyx_tuple__49 __pyx_mstate_global->__pyx_tuple__49 #define __pyx_tuple__51 __pyx_mstate_global->__pyx_tuple__51 #define __pyx_tuple__57 __pyx_mstate_global->__pyx_tuple__57 #define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 #define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 #define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19 #define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21 #define __pyx_codeobj__24 __pyx_mstate_global->__pyx_codeobj__24 #define __pyx_codeobj__25 __pyx_mstate_global->__pyx_codeobj__25 #define __pyx_codeobj__26 __pyx_mstate_global->__pyx_codeobj__26 #define __pyx_codeobj__27 __pyx_mstate_global->__pyx_codeobj__27 #define __pyx_codeobj__29 __pyx_mstate_global->__pyx_codeobj__29 #define __pyx_codeobj__30 __pyx_mstate_global->__pyx_codeobj__30 #define __pyx_codeobj__31 __pyx_mstate_global->__pyx_codeobj__31 #define __pyx_codeobj__33 __pyx_mstate_global->__pyx_codeobj__33 #define __pyx_codeobj__34 __pyx_mstate_global->__pyx_codeobj__34 #define __pyx_codeobj__35 __pyx_mstate_global->__pyx_codeobj__35 #define __pyx_codeobj__36 __pyx_mstate_global->__pyx_codeobj__36 #define __pyx_codeobj__37 __pyx_mstate_global->__pyx_codeobj__37 #define __pyx_codeobj__40 __pyx_mstate_global->__pyx_codeobj__40 #define __pyx_codeobj__41 __pyx_mstate_global->__pyx_codeobj__41 #define __pyx_codeobj__42 __pyx_mstate_global->__pyx_codeobj__42 #define __pyx_codeobj__44 __pyx_mstate_global->__pyx_codeobj__44 #define __pyx_codeobj__46 __pyx_mstate_global->__pyx_codeobj__46 #define __pyx_codeobj__48 __pyx_mstate_global->__pyx_codeobj__48 #define __pyx_codeobj__50 __pyx_mstate_global->__pyx_codeobj__50 #define __pyx_codeobj__52 __pyx_mstate_global->__pyx_codeobj__52 #define __pyx_codeobj__53 __pyx_mstate_global->__pyx_codeobj__53 #define __pyx_codeobj__54 __pyx_mstate_global->__pyx_codeobj__54 #define __pyx_codeobj__55 __pyx_mstate_global->__pyx_codeobj__55 #define __pyx_codeobj__56 __pyx_mstate_global->__pyx_codeobj__56 #define __pyx_codeobj__58 __pyx_mstate_global->__pyx_codeobj__58 #define __pyx_codeobj__59 __pyx_mstate_global->__pyx_codeobj__59 #define __pyx_codeobj__60 __pyx_mstate_global->__pyx_codeobj__60 /* #### Code section: module_code ### */ /* "borg/hashindex.pyx":92 * MAX_VALUE = _MAX_VALUE * * def __cinit__(self, capacity=0, path=None, permit_compact=False, usable=None): # <<<<<<<<<<<<<< * self.key_size = self._key_size * if path: */ /* Python wrapper */ static int __pyx_pw_4borg_9hashindex_9IndexBase_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_4borg_9hashindex_9IndexBase_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_capacity = 0; PyObject *__pyx_v_path = 0; PyObject *__pyx_v_permit_compact = 0; PyObject *__pyx_v_usable = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_capacity,&__pyx_n_s_path,&__pyx_n_s_permit_compact,&__pyx_n_s_usable,0}; values[0] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_int_0)); values[1] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_False)); values[3] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_capacity); if (value) { values[0] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_path); if (value) { values[1] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_permit_compact); if (value) { values[2] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_usable); if (value) { values[3] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(0, 92, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_capacity = values[0]; __pyx_v_path = values[1]; __pyx_v_permit_compact = values[2]; __pyx_v_usable = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 4, __pyx_nargs); __PYX_ERR(0, 92, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.hashindex.IndexBase.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_9hashindex_9IndexBase___cinit__(((struct __pyx_obj_4borg_9hashindex_IndexBase *)__pyx_v_self), __pyx_v_capacity, __pyx_v_path, __pyx_v_permit_compact, __pyx_v_usable); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_4borg_9hashindex_9IndexBase___cinit__(struct __pyx_obj_4borg_9hashindex_IndexBase *__pyx_v_self, PyObject *__pyx_v_capacity, PyObject *__pyx_v_path, PyObject *__pyx_v_permit_compact, PyObject *__pyx_v_usable) { PyObject *__pyx_v_fd = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; HashIndex *__pyx_t_12; PyObject *__pyx_t_13 = NULL; int __pyx_t_14; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); __Pyx_INCREF(__pyx_v_capacity); /* "borg/hashindex.pyx":93 * * def __cinit__(self, capacity=0, path=None, permit_compact=False, usable=None): * self.key_size = self._key_size # <<<<<<<<<<<<<< * if path: * if isinstance(path, (str, bytes)): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_key_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->key_size = __pyx_t_2; /* "borg/hashindex.pyx":94 * def __cinit__(self, capacity=0, path=None, permit_compact=False, usable=None): * self.key_size = self._key_size * if path: # <<<<<<<<<<<<<< * if isinstance(path, (str, bytes)): * with open(path, 'rb') as fd: */ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_path); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 94, __pyx_L1_error) if (__pyx_t_3) { /* "borg/hashindex.pyx":95 * self.key_size = self._key_size * if path: * if isinstance(path, (str, bytes)): # <<<<<<<<<<<<<< * with open(path, 'rb') as fd: * self.index = hashindex_read(fd, permit_compact) */ __pyx_t_4 = PyString_Check(__pyx_v_path); if (!__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L5_bool_binop_done; } __pyx_t_4 = PyBytes_Check(__pyx_v_path); __pyx_t_3 = __pyx_t_4; __pyx_L5_bool_binop_done:; if (__pyx_t_3) { /* "borg/hashindex.pyx":96 * if path: * if isinstance(path, (str, bytes)): * with open(path, 'rb') as fd: # <<<<<<<<<<<<<< * self.index = hashindex_read(fd, permit_compact) * else: */ /*with:*/ { __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_path); __Pyx_GIVEREF(__pyx_v_path); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_path)) __PYX_ERR(0, 96, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_rb); __Pyx_GIVEREF(__pyx_n_s_rb); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_rb)) __PYX_ERR(0, 96, __pyx_L1_error); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_5, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_t_5, __pyx_n_s_enter); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 96, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_2 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_2 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_2, 0+__pyx_t_2); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_t_7 = __pyx_t_1; __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); /*try:*/ { __pyx_v_fd = __pyx_t_7; __pyx_t_7 = 0; /* "borg/hashindex.pyx":97 * if isinstance(path, (str, bytes)): * with open(path, 'rb') as fd: * self.index = hashindex_read(fd, permit_compact) # <<<<<<<<<<<<<< * else: * self.index = hashindex_read(path, permit_compact) */ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_permit_compact); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 97, __pyx_L11_error) __pyx_t_12 = hashindex_read(__pyx_v_fd, __pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 97, __pyx_L11_error) __pyx_v_self->index = __pyx_t_12; /* "borg/hashindex.pyx":96 * if path: * if isinstance(path, (str, bytes)): * with open(path, 'rb') as fd: # <<<<<<<<<<<<<< * self.index = hashindex_read(fd, permit_compact) * else: */ } __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L16_try_end; __pyx_L11_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; /*except:*/ { __Pyx_AddTraceback("borg.hashindex.IndexBase.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(0, 96, __pyx_L13_except_error) __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_1); __pyx_t_8 = PyTuple_Pack(3, __pyx_t_7, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 96, __pyx_L13_except_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 96, __pyx_L13_except_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_13); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_3 < 0) __PYX_ERR(0, 96, __pyx_L13_except_error) __pyx_t_4 = (!__pyx_t_3); if (unlikely(__pyx_t_4)) { __Pyx_GIVEREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_1); __Pyx_ErrRestoreWithState(__pyx_t_7, __pyx_t_5, __pyx_t_1); __pyx_t_7 = 0; __pyx_t_5 = 0; __pyx_t_1 = 0; __PYX_ERR(0, 96, __pyx_L13_except_error) } __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L12_exception_handled; } __pyx_L13_except_error:; __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); goto __pyx_L1_error; __pyx_L12_exception_handled:; __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); __pyx_L16_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_6) { __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple_, NULL); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } goto __pyx_L10; } __pyx_L10:; } goto __pyx_L20; __pyx_L7_error:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L1_error; __pyx_L20:; } /* "borg/hashindex.pyx":95 * self.key_size = self._key_size * if path: * if isinstance(path, (str, bytes)): # <<<<<<<<<<<<<< * with open(path, 'rb') as fd: * self.index = hashindex_read(fd, permit_compact) */ goto __pyx_L4; } /* "borg/hashindex.pyx":99 * self.index = hashindex_read(fd, permit_compact) * else: * self.index = hashindex_read(path, permit_compact) # <<<<<<<<<<<<<< * assert self.index, 'hashindex_read() returned NULL with no exception set' * else: */ /*else*/ { __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_permit_compact); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 99, __pyx_L1_error) __pyx_t_12 = hashindex_read(__pyx_v_path, __pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 99, __pyx_L1_error) __pyx_v_self->index = __pyx_t_12; } __pyx_L4:; /* "borg/hashindex.pyx":100 * else: * self.index = hashindex_read(path, permit_compact) * assert self.index, 'hashindex_read() returned NULL with no exception set' # <<<<<<<<<<<<<< * else: * if usable is not None: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_4 = (__pyx_v_self->index != 0); if (unlikely(!__pyx_t_4)) { __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_kp_s_hashindex_read_returned_NULL_wit, 0, 0); __PYX_ERR(0, 100, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 100, __pyx_L1_error) #endif /* "borg/hashindex.pyx":94 * def __cinit__(self, capacity=0, path=None, permit_compact=False, usable=None): * self.key_size = self._key_size * if path: # <<<<<<<<<<<<<< * if isinstance(path, (str, bytes)): * with open(path, 'rb') as fd: */ goto __pyx_L3; } /* "borg/hashindex.pyx":102 * assert self.index, 'hashindex_read() returned NULL with no exception set' * else: * if usable is not None: # <<<<<<<<<<<<<< * capacity = int(usable / self.MAX_LOAD_FACTOR) * self.index = hashindex_init(capacity, self.key_size, self.value_size) */ /*else*/ { __pyx_t_4 = (__pyx_v_usable != Py_None); if (__pyx_t_4) { /* "borg/hashindex.pyx":103 * else: * if usable is not None: * capacity = int(usable / self.MAX_LOAD_FACTOR) # <<<<<<<<<<<<<< * self.index = hashindex_init(capacity, self.key_size, self.value_size) * if not self.index: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_MAX_LOAD_FACTOR); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_v_usable, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_capacity, __pyx_t_1); __pyx_t_1 = 0; /* "borg/hashindex.pyx":102 * assert self.index, 'hashindex_read() returned NULL with no exception set' * else: * if usable is not None: # <<<<<<<<<<<<<< * capacity = int(usable / self.MAX_LOAD_FACTOR) * self.index = hashindex_init(capacity, self.key_size, self.value_size) */ } /* "borg/hashindex.pyx":104 * if usable is not None: * capacity = int(usable / self.MAX_LOAD_FACTOR) * self.index = hashindex_init(capacity, self.key_size, self.value_size) # <<<<<<<<<<<<<< * if not self.index: * raise Exception('hashindex_init failed') */ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_capacity); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->index = hashindex_init(__pyx_t_2, __pyx_v_self->key_size, __pyx_t_14); /* "borg/hashindex.pyx":105 * capacity = int(usable / self.MAX_LOAD_FACTOR) * self.index = hashindex_init(capacity, self.key_size, self.value_size) * if not self.index: # <<<<<<<<<<<<<< * raise Exception('hashindex_init failed') * */ __pyx_t_4 = (!(__pyx_v_self->index != 0)); if (unlikely(__pyx_t_4)) { /* "borg/hashindex.pyx":106 * self.index = hashindex_init(capacity, self.key_size, self.value_size) * if not self.index: * raise Exception('hashindex_init failed') # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 106, __pyx_L1_error) /* "borg/hashindex.pyx":105 * capacity = int(usable / self.MAX_LOAD_FACTOR) * self.index = hashindex_init(capacity, self.key_size, self.value_size) * if not self.index: # <<<<<<<<<<<<<< * raise Exception('hashindex_init failed') * */ } } __pyx_L3:; /* "borg/hashindex.pyx":92 * MAX_VALUE = _MAX_VALUE * * def __cinit__(self, capacity=0, path=None, permit_compact=False, usable=None): # <<<<<<<<<<<<<< * self.key_size = self._key_size * if path: */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("borg.hashindex.IndexBase.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_fd); __Pyx_XDECREF(__pyx_v_capacity); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/hashindex.pyx":108 * raise Exception('hashindex_init failed') * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.index: * hashindex_free(self.index) */ /* Python wrapper */ static void __pyx_pw_4borg_9hashindex_9IndexBase_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_4borg_9hashindex_9IndexBase_3__dealloc__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_4borg_9hashindex_9IndexBase_2__dealloc__(((struct __pyx_obj_4borg_9hashindex_IndexBase *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_4borg_9hashindex_9IndexBase_2__dealloc__(struct __pyx_obj_4borg_9hashindex_IndexBase *__pyx_v_self) { int __pyx_t_1; /* "borg/hashindex.pyx":109 * * def __dealloc__(self): * if self.index: # <<<<<<<<<<<<<< * hashindex_free(self.index) * */ __pyx_t_1 = (__pyx_v_self->index != 0); if (__pyx_t_1) { /* "borg/hashindex.pyx":110 * def __dealloc__(self): * if self.index: * hashindex_free(self.index) # <<<<<<<<<<<<<< * * @classmethod */ hashindex_free(__pyx_v_self->index); /* "borg/hashindex.pyx":109 * * def __dealloc__(self): * if self.index: # <<<<<<<<<<<<<< * hashindex_free(self.index) * */ } /* "borg/hashindex.pyx":108 * raise Exception('hashindex_init failed') * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.index: * hashindex_free(self.index) */ /* function exit code */ } /* "borg/hashindex.pyx":112 * hashindex_free(self.index) * * @classmethod # <<<<<<<<<<<<<< * def read(cls, path, permit_compact=False): * return cls(path=path, permit_compact=permit_compact) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_9IndexBase_5read(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_9hashindex_9IndexBase_5read = {"read", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_9IndexBase_5read, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_9hashindex_9IndexBase_5read(PyObject *__pyx_v_cls, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_path = 0; PyObject *__pyx_v_permit_compact = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("read (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_permit_compact,0}; /* "borg/hashindex.pyx":113 * * @classmethod * def read(cls, path, permit_compact=False): # <<<<<<<<<<<<<< * return cls(path=path, permit_compact=permit_compact) * */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_path)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_permit_compact); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "read") < 0)) __PYX_ERR(0, 112, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_path = values[0]; __pyx_v_permit_compact = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("read", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 112, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.hashindex.IndexBase.read", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_9hashindex_9IndexBase_4read(((PyTypeObject*)__pyx_v_cls), __pyx_v_path, __pyx_v_permit_compact); /* "borg/hashindex.pyx":112 * hashindex_free(self.index) * * @classmethod # <<<<<<<<<<<<<< * def read(cls, path, permit_compact=False): * return cls(path=path, permit_compact=permit_compact) */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_9IndexBase_4read(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_path, PyObject *__pyx_v_permit_compact) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read", 1); /* "borg/hashindex.pyx":114 * @classmethod * def read(cls, path, permit_compact=False): * return cls(path=path, permit_compact=permit_compact) # <<<<<<<<<<<<<< * * def write(self, path): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_path, __pyx_v_path) < 0) __PYX_ERR(0, 114, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_permit_compact, __pyx_v_permit_compact) < 0) __PYX_ERR(0, 114, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_cls), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "borg/hashindex.pyx":112 * hashindex_free(self.index) * * @classmethod # <<<<<<<<<<<<<< * def read(cls, path, permit_compact=False): * return cls(path=path, permit_compact=permit_compact) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("borg.hashindex.IndexBase.read", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/hashindex.pyx":116 * return cls(path=path, permit_compact=permit_compact) * * def write(self, path): # <<<<<<<<<<<<<< * if isinstance(path, (str, bytes)): * with open(path, 'wb') as fd: */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_9IndexBase_7write(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_9hashindex_9IndexBase_7write = {"write", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_9IndexBase_7write, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_9hashindex_9IndexBase_7write(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_path = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("write (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_path)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "write") < 0)) __PYX_ERR(0, 116, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_path = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("write", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 116, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.hashindex.IndexBase.write", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_9hashindex_9IndexBase_6write(((struct __pyx_obj_4borg_9hashindex_IndexBase *)__pyx_v_self), __pyx_v_path); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_9IndexBase_6write(struct __pyx_obj_4borg_9hashindex_IndexBase *__pyx_v_self, PyObject *__pyx_v_path) { PyObject *__pyx_v_fd = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write", 1); /* "borg/hashindex.pyx":117 * * def write(self, path): * if isinstance(path, (str, bytes)): # <<<<<<<<<<<<<< * with open(path, 'wb') as fd: * hashindex_write(self.index, fd) */ __pyx_t_2 = PyString_Check(__pyx_v_path); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = PyBytes_Check(__pyx_v_path); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "borg/hashindex.pyx":118 * def write(self, path): * if isinstance(path, (str, bytes)): * with open(path, 'wb') as fd: # <<<<<<<<<<<<<< * hashindex_write(self.index, fd) * else: */ /*with:*/ { __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_path); __Pyx_GIVEREF(__pyx_v_path); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_path)) __PYX_ERR(0, 118, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_wb); __Pyx_GIVEREF(__pyx_n_s_wb); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_wb)) __PYX_ERR(0, 118, __pyx_L1_error); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_exit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_enter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 118, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 118, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_6 = __pyx_t_3; __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); /*try:*/ { __pyx_v_fd = __pyx_t_6; __pyx_t_6 = 0; /* "borg/hashindex.pyx":119 * if isinstance(path, (str, bytes)): * with open(path, 'wb') as fd: * hashindex_write(self.index, fd) # <<<<<<<<<<<<<< * else: * hashindex_write(self.index, path) */ hashindex_write(__pyx_v_self->index, __pyx_v_fd); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 119, __pyx_L10_error) /* "borg/hashindex.pyx":118 * def write(self, path): * if isinstance(path, (str, bytes)): * with open(path, 'wb') as fd: # <<<<<<<<<<<<<< * hashindex_write(self.index, fd) * else: */ } __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L15_try_end; __pyx_L10_error:; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /*except:*/ { __Pyx_AddTraceback("borg.hashindex.IndexBase.write", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_4, &__pyx_t_3) < 0) __PYX_ERR(0, 118, __pyx_L12_except_error) __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_3); __pyx_t_7 = PyTuple_Pack(3, __pyx_t_6, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 118, __pyx_L12_except_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 118, __pyx_L12_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__pyx_t_1 < 0) __PYX_ERR(0, 118, __pyx_L12_except_error) __pyx_t_2 = (!__pyx_t_1); if (unlikely(__pyx_t_2)) { __Pyx_GIVEREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ErrRestoreWithState(__pyx_t_6, __pyx_t_4, __pyx_t_3); __pyx_t_6 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0; __PYX_ERR(0, 118, __pyx_L12_except_error) } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L11_exception_handled; } __pyx_L12_except_error:; __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); goto __pyx_L1_error; __pyx_L11_exception_handled:; __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); __pyx_L15_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_5) { __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple_, NULL); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } goto __pyx_L9; } __pyx_L9:; } goto __pyx_L19; __pyx_L6_error:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L1_error; __pyx_L19:; } /* "borg/hashindex.pyx":117 * * def write(self, path): * if isinstance(path, (str, bytes)): # <<<<<<<<<<<<<< * with open(path, 'wb') as fd: * hashindex_write(self.index, fd) */ goto __pyx_L3; } /* "borg/hashindex.pyx":121 * hashindex_write(self.index, fd) * else: * hashindex_write(self.index, path) # <<<<<<<<<<<<<< * * def clear(self): */ /*else*/ { hashindex_write(__pyx_v_self->index, __pyx_v_path); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 121, __pyx_L1_error) } __pyx_L3:; /* "borg/hashindex.pyx":116 * return cls(path=path, permit_compact=permit_compact) * * def write(self, path): # <<<<<<<<<<<<<< * if isinstance(path, (str, bytes)): * with open(path, 'wb') as fd: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("borg.hashindex.IndexBase.write", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_fd); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/hashindex.pyx":123 * hashindex_write(self.index, path) * * def clear(self): # <<<<<<<<<<<<<< * hashindex_free(self.index) * self.index = hashindex_init(0, self.key_size, self.value_size) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_9IndexBase_9clear(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_9hashindex_9IndexBase_9clear = {"clear", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_9IndexBase_9clear, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_9hashindex_9IndexBase_9clear(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clear (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("clear", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "clear", 0))) return NULL; __pyx_r = __pyx_pf_4borg_9hashindex_9IndexBase_8clear(((struct __pyx_obj_4borg_9hashindex_IndexBase *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_9IndexBase_8clear(struct __pyx_obj_4borg_9hashindex_IndexBase *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clear", 1); /* "borg/hashindex.pyx":124 * * def clear(self): * hashindex_free(self.index) # <<<<<<<<<<<<<< * self.index = hashindex_init(0, self.key_size, self.value_size) * if not self.index: */ hashindex_free(__pyx_v_self->index); /* "borg/hashindex.pyx":125 * def clear(self): * hashindex_free(self.index) * self.index = hashindex_init(0, self.key_size, self.value_size) # <<<<<<<<<<<<<< * if not self.index: * raise Exception('hashindex_init failed') */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->index = hashindex_init(0, __pyx_v_self->key_size, __pyx_t_2); /* "borg/hashindex.pyx":126 * hashindex_free(self.index) * self.index = hashindex_init(0, self.key_size, self.value_size) * if not self.index: # <<<<<<<<<<<<<< * raise Exception('hashindex_init failed') * */ __pyx_t_3 = (!(__pyx_v_self->index != 0)); if (unlikely(__pyx_t_3)) { /* "borg/hashindex.pyx":127 * self.index = hashindex_init(0, self.key_size, self.value_size) * if not self.index: * raise Exception('hashindex_init failed') # <<<<<<<<<<<<<< * * def setdefault(self, key, value): */ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 127, __pyx_L1_error) /* "borg/hashindex.pyx":126 * hashindex_free(self.index) * self.index = hashindex_init(0, self.key_size, self.value_size) * if not self.index: # <<<<<<<<<<<<<< * raise Exception('hashindex_init failed') * */ } /* "borg/hashindex.pyx":123 * hashindex_write(self.index, path) * * def clear(self): # <<<<<<<<<<<<<< * hashindex_free(self.index) * self.index = hashindex_init(0, self.key_size, self.value_size) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("borg.hashindex.IndexBase.clear", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/hashindex.pyx":129 * raise Exception('hashindex_init failed') * * def setdefault(self, key, value): # <<<<<<<<<<<<<< * if not key in self: * self[key] = value */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_9IndexBase_11setdefault(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_9hashindex_9IndexBase_11setdefault = {"setdefault", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_9IndexBase_11setdefault, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_9hashindex_9IndexBase_11setdefault(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_key = 0; PyObject *__pyx_v_value = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setdefault (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_value,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_key)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 129, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 129, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setdefault", 1, 2, 2, 1); __PYX_ERR(0, 129, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setdefault") < 0)) __PYX_ERR(0, 129, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_key = values[0]; __pyx_v_value = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setdefault", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 129, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.hashindex.IndexBase.setdefault", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_9hashindex_9IndexBase_10setdefault(((struct __pyx_obj_4borg_9hashindex_IndexBase *)__pyx_v_self), __pyx_v_key, __pyx_v_value); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_9IndexBase_10setdefault(struct __pyx_obj_4borg_9hashindex_IndexBase *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setdefault", 1); /* "borg/hashindex.pyx":130 * * def setdefault(self, key, value): * if not key in self: # <<<<<<<<<<<<<< * self[key] = value * return self[key] */ __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_key, ((PyObject *)__pyx_v_self), Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 130, __pyx_L1_error) if (__pyx_t_1) { /* "borg/hashindex.pyx":131 * def setdefault(self, key, value): * if not key in self: * self[key] = value # <<<<<<<<<<<<<< * return self[key] * */ if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_self), __pyx_v_key, __pyx_v_value) < 0))) __PYX_ERR(0, 131, __pyx_L1_error) /* "borg/hashindex.pyx":130 * * def setdefault(self, key, value): * if not key in self: # <<<<<<<<<<<<<< * self[key] = value * return self[key] */ } /* "borg/hashindex.pyx":132 * if not key in self: * self[key] = value * return self[key] # <<<<<<<<<<<<<< * * def __delitem__(self, key): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "borg/hashindex.pyx":129 * raise Exception('hashindex_init failed') * * def setdefault(self, key, value): # <<<<<<<<<<<<<< * if not key in self: * self[key] = value */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("borg.hashindex.IndexBase.setdefault", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/hashindex.pyx":134 * return self[key] * * def __delitem__(self, key): # <<<<<<<<<<<<<< * assert len(key) == self.key_size * rc = hashindex_delete(self.index, key) */ /* Python wrapper */ static int __pyx_pw_4borg_9hashindex_9IndexBase_13__delitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ static int __pyx_pw_4borg_9hashindex_9IndexBase_13__delitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__delitem__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_4borg_9hashindex_9IndexBase_12__delitem__(((struct __pyx_obj_4borg_9hashindex_IndexBase *)__pyx_v_self), ((PyObject *)__pyx_v_key)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_4borg_9hashindex_9IndexBase_12__delitem__(struct __pyx_obj_4borg_9hashindex_IndexBase *__pyx_v_self, PyObject *__pyx_v_key) { int __pyx_v_rc; int __pyx_r; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; unsigned char *__pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__delitem__", 1); /* "borg/hashindex.pyx":135 * * def __delitem__(self, key): * assert len(key) == self.key_size # <<<<<<<<<<<<<< * rc = hashindex_delete(self.index, key) * if rc == 1: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = PyObject_Length(__pyx_v_key); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 135, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 == __pyx_v_self->key_size); if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 135, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 135, __pyx_L1_error) #endif /* "borg/hashindex.pyx":136 * def __delitem__(self, key): * assert len(key) == self.key_size * rc = hashindex_delete(self.index, key) # <<<<<<<<<<<<<< * if rc == 1: * return # success */ __pyx_t_3 = __Pyx_PyObject_AsWritableUString(__pyx_v_key); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error) __pyx_v_rc = hashindex_delete(__pyx_v_self->index, ((unsigned char *)__pyx_t_3)); /* "borg/hashindex.pyx":137 * assert len(key) == self.key_size * rc = hashindex_delete(self.index, key) * if rc == 1: # <<<<<<<<<<<<<< * return # success * if rc == -1: */ __pyx_t_2 = (__pyx_v_rc == 1); if (__pyx_t_2) { /* "borg/hashindex.pyx":138 * rc = hashindex_delete(self.index, key) * if rc == 1: * return # success # <<<<<<<<<<<<<< * if rc == -1: * raise KeyError(key) */ __pyx_r = 0; goto __pyx_L0; /* "borg/hashindex.pyx":137 * assert len(key) == self.key_size * rc = hashindex_delete(self.index, key) * if rc == 1: # <<<<<<<<<<<<<< * return # success * if rc == -1: */ } /* "borg/hashindex.pyx":139 * if rc == 1: * return # success * if rc == -1: # <<<<<<<<<<<<<< * raise KeyError(key) * if rc == 0: */ __pyx_t_2 = (__pyx_v_rc == -1L); if (unlikely(__pyx_t_2)) { /* "borg/hashindex.pyx":140 * return # success * if rc == -1: * raise KeyError(key) # <<<<<<<<<<<<<< * if rc == 0: * raise Exception('hashindex_delete failed') */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 140, __pyx_L1_error) /* "borg/hashindex.pyx":139 * if rc == 1: * return # success * if rc == -1: # <<<<<<<<<<<<<< * raise KeyError(key) * if rc == 0: */ } /* "borg/hashindex.pyx":141 * if rc == -1: * raise KeyError(key) * if rc == 0: # <<<<<<<<<<<<<< * raise Exception('hashindex_delete failed') * */ __pyx_t_2 = (__pyx_v_rc == 0); if (unlikely(__pyx_t_2)) { /* "borg/hashindex.pyx":142 * raise KeyError(key) * if rc == 0: * raise Exception('hashindex_delete failed') # <<<<<<<<<<<<<< * * def get(self, key, default=None): */ __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 142, __pyx_L1_error) /* "borg/hashindex.pyx":141 * if rc == -1: * raise KeyError(key) * if rc == 0: # <<<<<<<<<<<<<< * raise Exception('hashindex_delete failed') * */ } /* "borg/hashindex.pyx":134 * return self[key] * * def __delitem__(self, key): # <<<<<<<<<<<<<< * assert len(key) == self.key_size * rc = hashindex_delete(self.index, key) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("borg.hashindex.IndexBase.__delitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/hashindex.pyx":144 * raise Exception('hashindex_delete failed') * * def get(self, key, default=None): # <<<<<<<<<<<<<< * try: * return self[key] */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_9IndexBase_15get(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_9hashindex_9IndexBase_15get = {"get", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_9IndexBase_15get, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_9hashindex_9IndexBase_15get(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_key = 0; PyObject *__pyx_v_default = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_default,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_key)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 144, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_default); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 144, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get") < 0)) __PYX_ERR(0, 144, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_key = values[0]; __pyx_v_default = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 144, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.hashindex.IndexBase.get", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_9hashindex_9IndexBase_14get(((struct __pyx_obj_4borg_9hashindex_IndexBase *)__pyx_v_self), __pyx_v_key, __pyx_v_default); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_9IndexBase_14get(struct __pyx_obj_4borg_9hashindex_IndexBase *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_default) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get", 1); /* "borg/hashindex.pyx":145 * * def get(self, key, default=None): * try: # <<<<<<<<<<<<<< * return self[key] * except KeyError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "borg/hashindex.pyx":146 * def get(self, key, default=None): * try: * return self[key] # <<<<<<<<<<<<<< * except KeyError: * return default */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L7_try_return; /* "borg/hashindex.pyx":145 * * def get(self, key, default=None): * try: # <<<<<<<<<<<<<< * return self[key] * except KeyError: */ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /* "borg/hashindex.pyx":147 * try: * return self[key] * except KeyError: # <<<<<<<<<<<<<< * return default * */ __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_5) { __Pyx_AddTraceback("borg.hashindex.IndexBase.get", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 147, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); /* "borg/hashindex.pyx":148 * return self[key] * except KeyError: * return default # <<<<<<<<<<<<<< * * def pop(self, key, default=_NoDefault): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_default); __pyx_r = __pyx_v_default; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_except_return; } goto __pyx_L5_except_error; /* "borg/hashindex.pyx":145 * * def get(self, key, default=None): * try: # <<<<<<<<<<<<<< * return self[key] * except KeyError: */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L7_try_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; __pyx_L6_except_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; } /* "borg/hashindex.pyx":144 * raise Exception('hashindex_delete failed') * * def get(self, key, default=None): # <<<<<<<<<<<<<< * try: * return self[key] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("borg.hashindex.IndexBase.get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/hashindex.pyx":150 * return default * * def pop(self, key, default=_NoDefault): # <<<<<<<<<<<<<< * try: * value = self[key] */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_9IndexBase_17pop(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_9hashindex_9IndexBase_17pop = {"pop", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_9IndexBase_17pop, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_9hashindex_9IndexBase_17pop(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_key = 0; PyObject *__pyx_v_default = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pop (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_default,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(__pyx_k__4); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_key)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_default); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "pop") < 0)) __PYX_ERR(0, 150, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_key = values[0]; __pyx_v_default = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("pop", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 150, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.hashindex.IndexBase.pop", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_9hashindex_9IndexBase_16pop(((struct __pyx_obj_4borg_9hashindex_IndexBase *)__pyx_v_self), __pyx_v_key, __pyx_v_default); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_9IndexBase_16pop(struct __pyx_obj_4borg_9hashindex_IndexBase *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_default) { PyObject *__pyx_v_value = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pop", 1); /* "borg/hashindex.pyx":151 * * def pop(self, key, default=_NoDefault): * try: # <<<<<<<<<<<<<< * value = self[key] * del self[key] */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "borg/hashindex.pyx":152 * def pop(self, key, default=_NoDefault): * try: * value = self[key] # <<<<<<<<<<<<<< * del self[key] * return value */ __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 152, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_value = __pyx_t_4; __pyx_t_4 = 0; /* "borg/hashindex.pyx":153 * try: * value = self[key] * del self[key] # <<<<<<<<<<<<<< * return value * except KeyError: */ if (unlikely((PyObject_DelItem(((PyObject *)__pyx_v_self), __pyx_v_key) < 0))) __PYX_ERR(0, 153, __pyx_L3_error) /* "borg/hashindex.pyx":154 * value = self[key] * del self[key] * return value # <<<<<<<<<<<<<< * except KeyError: * if default != _NoDefault: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_value); __pyx_r = __pyx_v_value; goto __pyx_L7_try_return; /* "borg/hashindex.pyx":151 * * def pop(self, key, default=_NoDefault): * try: # <<<<<<<<<<<<<< * value = self[key] * del self[key] */ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /* "borg/hashindex.pyx":155 * del self[key] * return value * except KeyError: # <<<<<<<<<<<<<< * if default != _NoDefault: * return default */ __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_5) { __Pyx_AddTraceback("borg.hashindex.IndexBase.pop", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 155, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); /* "borg/hashindex.pyx":156 * return value * except KeyError: * if default != _NoDefault: # <<<<<<<<<<<<<< * return default * raise */ __pyx_t_8 = PyObject_RichCompare(__pyx_v_default, __pyx_v_4borg_9hashindex__NoDefault, Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 156, __pyx_L5_except_error) __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 156, __pyx_L5_except_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_9) { /* "borg/hashindex.pyx":157 * except KeyError: * if default != _NoDefault: * return default # <<<<<<<<<<<<<< * raise * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_default); __pyx_r = __pyx_v_default; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_except_return; /* "borg/hashindex.pyx":156 * return value * except KeyError: * if default != _NoDefault: # <<<<<<<<<<<<<< * return default * raise */ } /* "borg/hashindex.pyx":158 * if default != _NoDefault: * return default * raise # <<<<<<<<<<<<<< * * def __len__(self): */ __Pyx_GIVEREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_6, __pyx_t_7); __pyx_t_4 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __PYX_ERR(0, 158, __pyx_L5_except_error) } goto __pyx_L5_except_error; /* "borg/hashindex.pyx":151 * * def pop(self, key, default=_NoDefault): * try: # <<<<<<<<<<<<<< * value = self[key] * del self[key] */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L7_try_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; __pyx_L6_except_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; } /* "borg/hashindex.pyx":150 * return default * * def pop(self, key, default=_NoDefault): # <<<<<<<<<<<<<< * try: * value = self[key] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("borg.hashindex.IndexBase.pop", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_value); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/hashindex.pyx":160 * raise * * def __len__(self): # <<<<<<<<<<<<<< * return hashindex_len(self.index) * */ /* Python wrapper */ static Py_ssize_t __pyx_pw_4borg_9hashindex_9IndexBase_19__len__(PyObject *__pyx_v_self); /*proto*/ static Py_ssize_t __pyx_pw_4borg_9hashindex_9IndexBase_19__len__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_4borg_9hashindex_9IndexBase_18__len__(((struct __pyx_obj_4borg_9hashindex_IndexBase *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static Py_ssize_t __pyx_pf_4borg_9hashindex_9IndexBase_18__len__(struct __pyx_obj_4borg_9hashindex_IndexBase *__pyx_v_self) { Py_ssize_t __pyx_r; /* "borg/hashindex.pyx":161 * * def __len__(self): * return hashindex_len(self.index) # <<<<<<<<<<<<<< * * def size(self): */ __pyx_r = hashindex_len(__pyx_v_self->index); goto __pyx_L0; /* "borg/hashindex.pyx":160 * raise * * def __len__(self): # <<<<<<<<<<<<<< * return hashindex_len(self.index) * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "borg/hashindex.pyx":163 * return hashindex_len(self.index) * * def size(self): # <<<<<<<<<<<<<< * """Return size (bytes) of hash table.""" * return hashindex_size(self.index) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_9IndexBase_21size(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_9hashindex_9IndexBase_20size, "Return size (bytes) of hash table."); static PyMethodDef __pyx_mdef_4borg_9hashindex_9IndexBase_21size = {"size", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_9IndexBase_21size, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_9hashindex_9IndexBase_20size}; static PyObject *__pyx_pw_4borg_9hashindex_9IndexBase_21size(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("size (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("size", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "size", 0))) return NULL; __pyx_r = __pyx_pf_4borg_9hashindex_9IndexBase_20size(((struct __pyx_obj_4borg_9hashindex_IndexBase *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_9IndexBase_20size(struct __pyx_obj_4borg_9hashindex_IndexBase *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("size", 1); /* "borg/hashindex.pyx":165 * def size(self): * """Return size (bytes) of hash table.""" * return hashindex_size(self.index) # <<<<<<<<<<<<<< * * def compact(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(hashindex_size(__pyx_v_self->index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/hashindex.pyx":163 * return hashindex_len(self.index) * * def size(self): # <<<<<<<<<<<<<< * """Return size (bytes) of hash table.""" * return hashindex_size(self.index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("borg.hashindex.IndexBase.size", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/hashindex.pyx":167 * return hashindex_size(self.index) * * def compact(self): # <<<<<<<<<<<<<< * return hashindex_compact(self.index) * */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_9IndexBase_23compact(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_9hashindex_9IndexBase_23compact = {"compact", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_9IndexBase_23compact, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_9hashindex_9IndexBase_23compact(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("compact (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("compact", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "compact", 0))) return NULL; __pyx_r = __pyx_pf_4borg_9hashindex_9IndexBase_22compact(((struct __pyx_obj_4borg_9hashindex_IndexBase *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_9IndexBase_22compact(struct __pyx_obj_4borg_9hashindex_IndexBase *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("compact", 1); /* "borg/hashindex.pyx":168 * * def compact(self): * return hashindex_compact(self.index) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint64_t(hashindex_compact(__pyx_v_self->index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/hashindex.pyx":167 * return hashindex_size(self.index) * * def compact(self): # <<<<<<<<<<<<<< * return hashindex_compact(self.index) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("borg.hashindex.IndexBase.compact", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_9IndexBase_25__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_9hashindex_9IndexBase_25__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_9IndexBase_25__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_9hashindex_9IndexBase_25__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_4borg_9hashindex_9IndexBase_24__reduce_cython__(((struct __pyx_obj_4borg_9hashindex_IndexBase *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_9IndexBase_24__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_9hashindex_IndexBase *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.hashindex.IndexBase.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_9IndexBase_27__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_9hashindex_9IndexBase_27__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_9IndexBase_27__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_9hashindex_9IndexBase_27__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.hashindex.IndexBase.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_9hashindex_9IndexBase_26__setstate_cython__(((struct __pyx_obj_4borg_9hashindex_IndexBase *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_9IndexBase_26__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_9hashindex_IndexBase *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.hashindex.IndexBase.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/hashindex.pyx":176 * _key_size = 16 * * def __getitem__(self, key): # <<<<<<<<<<<<<< * cdef FuseVersionsElement *data * assert len(key) == self.key_size */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_17FuseVersionsIndex_1__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ static PyObject *__pyx_pw_4borg_9hashindex_17FuseVersionsIndex_1__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_4borg_9hashindex_17FuseVersionsIndex___getitem__(((struct __pyx_obj_4borg_9hashindex_FuseVersionsIndex *)__pyx_v_self), ((PyObject *)__pyx_v_key)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_17FuseVersionsIndex___getitem__(struct __pyx_obj_4borg_9hashindex_FuseVersionsIndex *__pyx_v_self, PyObject *__pyx_v_key) { FuseVersionsElement *__pyx_v_data; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; unsigned char *__pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 1); /* "borg/hashindex.pyx":178 * def __getitem__(self, key): * cdef FuseVersionsElement *data * assert len(key) == self.key_size # <<<<<<<<<<<<<< * data = hashindex_get(self.index, key) * if data == NULL: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = PyObject_Length(__pyx_v_key); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 178, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 == __pyx_v_self->__pyx_base.key_size); if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 178, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 178, __pyx_L1_error) #endif /* "borg/hashindex.pyx":179 * cdef FuseVersionsElement *data * assert len(key) == self.key_size * data = hashindex_get(self.index, key) # <<<<<<<<<<<<<< * if data == NULL: * raise KeyError(key) */ __pyx_t_3 = __Pyx_PyObject_AsWritableUString(__pyx_v_key); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 179, __pyx_L1_error) __pyx_v_data = ((FuseVersionsElement *)hashindex_get(__pyx_v_self->__pyx_base.index, ((unsigned char *)__pyx_t_3))); /* "borg/hashindex.pyx":180 * assert len(key) == self.key_size * data = hashindex_get(self.index, key) * if data == NULL: # <<<<<<<<<<<<<< * raise KeyError(key) * return _le32toh(data.version), PyBytes_FromStringAndSize(data.hash, 16) */ __pyx_t_2 = (__pyx_v_data == NULL); if (unlikely(__pyx_t_2)) { /* "borg/hashindex.pyx":181 * data = hashindex_get(self.index, key) * if data == NULL: * raise KeyError(key) # <<<<<<<<<<<<<< * return _le32toh(data.version), PyBytes_FromStringAndSize(data.hash, 16) * */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 181, __pyx_L1_error) /* "borg/hashindex.pyx":180 * assert len(key) == self.key_size * data = hashindex_get(self.index, key) * if data == NULL: # <<<<<<<<<<<<<< * raise KeyError(key) * return _le32toh(data.version), PyBytes_FromStringAndSize(data.hash, 16) */ } /* "borg/hashindex.pyx":182 * if data == NULL: * raise KeyError(key) * return _le32toh(data.version), PyBytes_FromStringAndSize(data.hash, 16) # <<<<<<<<<<<<<< * * def __setitem__(self, key, value): */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(_le32toh(__pyx_v_data->version)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyBytes_FromStringAndSize(__pyx_v_data->hash, 16); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(0, 182, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(0, 182, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "borg/hashindex.pyx":176 * _key_size = 16 * * def __getitem__(self, key): # <<<<<<<<<<<<<< * cdef FuseVersionsElement *data * assert len(key) == self.key_size */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("borg.hashindex.FuseVersionsIndex.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/hashindex.pyx":184 * return _le32toh(data.version), PyBytes_FromStringAndSize(data.hash, 16) * * def __setitem__(self, key, value): # <<<<<<<<<<<<<< * cdef FuseVersionsElement data * assert len(key) == self.key_size */ /* Python wrapper */ static int __pyx_pw_4borg_9hashindex_17FuseVersionsIndex_3__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_4borg_9hashindex_17FuseVersionsIndex_3__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_4borg_9hashindex_17FuseVersionsIndex_2__setitem__(((struct __pyx_obj_4borg_9hashindex_FuseVersionsIndex *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_4borg_9hashindex_17FuseVersionsIndex_2__setitem__(struct __pyx_obj_4borg_9hashindex_FuseVersionsIndex *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { FuseVersionsElement __pyx_v_data; int __pyx_r; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; uint32_t __pyx_t_4; int __pyx_t_5; unsigned char *__pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 1); /* "borg/hashindex.pyx":186 * def __setitem__(self, key, value): * cdef FuseVersionsElement data * assert len(key) == self.key_size # <<<<<<<<<<<<<< * data.version = value[0] * assert data.version <= _MAX_VALUE, "maximum number of versions reached" */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = PyObject_Length(__pyx_v_key); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 186, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 == __pyx_v_self->__pyx_base.key_size); if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 186, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 186, __pyx_L1_error) #endif /* "borg/hashindex.pyx":187 * cdef FuseVersionsElement data * assert len(key) == self.key_size * data.version = value[0] # <<<<<<<<<<<<<< * assert data.version <= _MAX_VALUE, "maximum number of versions reached" * if not PyBytes_CheckExact(value[1]) or PyBytes_GET_SIZE(value[1]) != 16: */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_value, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_As_uint32_t(__pyx_t_3); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_data.version = __pyx_t_4; /* "borg/hashindex.pyx":188 * assert len(key) == self.key_size * data.version = value[0] * assert data.version <= _MAX_VALUE, "maximum number of versions reached" # <<<<<<<<<<<<<< * if not PyBytes_CheckExact(value[1]) or PyBytes_GET_SIZE(value[1]) != 16: * raise TypeError("Expected bytes of length 16 for second value") */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_2 = (__pyx_v_data.version <= _MAX_VALUE); if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_kp_s_maximum_number_of_versions_reach, 0, 0); __PYX_ERR(0, 188, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 188, __pyx_L1_error) #endif /* "borg/hashindex.pyx":189 * data.version = value[0] * assert data.version <= _MAX_VALUE, "maximum number of versions reached" * if not PyBytes_CheckExact(value[1]) or PyBytes_GET_SIZE(value[1]) != 16: # <<<<<<<<<<<<<< * raise TypeError("Expected bytes of length 16 for second value") * memcpy(data.hash, PyBytes_AS_STRING(value[1]), 16) */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_value, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = (!PyBytes_CheckExact(__pyx_t_3)); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_5) { } else { __pyx_t_2 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_value, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = (PyBytes_GET_SIZE(__pyx_t_3) != 16); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __pyx_t_5; __pyx_L4_bool_binop_done:; if (unlikely(__pyx_t_2)) { /* "borg/hashindex.pyx":190 * assert data.version <= _MAX_VALUE, "maximum number of versions reached" * if not PyBytes_CheckExact(value[1]) or PyBytes_GET_SIZE(value[1]) != 16: * raise TypeError("Expected bytes of length 16 for second value") # <<<<<<<<<<<<<< * memcpy(data.hash, PyBytes_AS_STRING(value[1]), 16) * data.version = _htole32(data.version) */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 190, __pyx_L1_error) /* "borg/hashindex.pyx":189 * data.version = value[0] * assert data.version <= _MAX_VALUE, "maximum number of versions reached" * if not PyBytes_CheckExact(value[1]) or PyBytes_GET_SIZE(value[1]) != 16: # <<<<<<<<<<<<<< * raise TypeError("Expected bytes of length 16 for second value") * memcpy(data.hash, PyBytes_AS_STRING(value[1]), 16) */ } /* "borg/hashindex.pyx":191 * if not PyBytes_CheckExact(value[1]) or PyBytes_GET_SIZE(value[1]) != 16: * raise TypeError("Expected bytes of length 16 for second value") * memcpy(data.hash, PyBytes_AS_STRING(value[1]), 16) # <<<<<<<<<<<<<< * data.version = _htole32(data.version) * if not hashindex_set(self.index, key, &data): */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_value, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); (void)(memcpy(__pyx_v_data.hash, PyBytes_AS_STRING(__pyx_t_3), 16)); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/hashindex.pyx":192 * raise TypeError("Expected bytes of length 16 for second value") * memcpy(data.hash, PyBytes_AS_STRING(value[1]), 16) * data.version = _htole32(data.version) # <<<<<<<<<<<<<< * if not hashindex_set(self.index, key, &data): * raise Exception('hashindex_set failed') */ __pyx_v_data.version = _htole32(__pyx_v_data.version); /* "borg/hashindex.pyx":193 * memcpy(data.hash, PyBytes_AS_STRING(value[1]), 16) * data.version = _htole32(data.version) * if not hashindex_set(self.index, key, &data): # <<<<<<<<<<<<<< * raise Exception('hashindex_set failed') * */ __pyx_t_6 = __Pyx_PyObject_AsWritableUString(__pyx_v_key); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 193, __pyx_L1_error) __pyx_t_2 = (!(hashindex_set(__pyx_v_self->__pyx_base.index, ((unsigned char *)__pyx_t_6), ((void *)(&__pyx_v_data))) != 0)); if (unlikely(__pyx_t_2)) { /* "borg/hashindex.pyx":194 * data.version = _htole32(data.version) * if not hashindex_set(self.index, key, &data): * raise Exception('hashindex_set failed') # <<<<<<<<<<<<<< * * def __contains__(self, key): */ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 194, __pyx_L1_error) /* "borg/hashindex.pyx":193 * memcpy(data.hash, PyBytes_AS_STRING(value[1]), 16) * data.version = _htole32(data.version) * if not hashindex_set(self.index, key, &data): # <<<<<<<<<<<<<< * raise Exception('hashindex_set failed') * */ } /* "borg/hashindex.pyx":184 * return _le32toh(data.version), PyBytes_FromStringAndSize(data.hash, 16) * * def __setitem__(self, key, value): # <<<<<<<<<<<<<< * cdef FuseVersionsElement data * assert len(key) == self.key_size */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("borg.hashindex.FuseVersionsIndex.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/hashindex.pyx":196 * raise Exception('hashindex_set failed') * * def __contains__(self, key): # <<<<<<<<<<<<<< * assert len(key) == self.key_size * return hashindex_get(self.index, key) != NULL */ /* Python wrapper */ static int __pyx_pw_4borg_9hashindex_17FuseVersionsIndex_5__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ static int __pyx_pw_4borg_9hashindex_17FuseVersionsIndex_5__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__contains__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_4borg_9hashindex_17FuseVersionsIndex_4__contains__(((struct __pyx_obj_4borg_9hashindex_FuseVersionsIndex *)__pyx_v_self), ((PyObject *)__pyx_v_key)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_4borg_9hashindex_17FuseVersionsIndex_4__contains__(struct __pyx_obj_4borg_9hashindex_FuseVersionsIndex *__pyx_v_self, PyObject *__pyx_v_key) { int __pyx_r; Py_ssize_t __pyx_t_1; int __pyx_t_2; unsigned char *__pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "borg/hashindex.pyx":197 * * def __contains__(self, key): * assert len(key) == self.key_size # <<<<<<<<<<<<<< * return hashindex_get(self.index, key) != NULL * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = PyObject_Length(__pyx_v_key); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 197, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 == __pyx_v_self->__pyx_base.key_size); if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 197, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 197, __pyx_L1_error) #endif /* "borg/hashindex.pyx":198 * def __contains__(self, key): * assert len(key) == self.key_size * return hashindex_get(self.index, key) != NULL # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __Pyx_PyObject_AsWritableUString(__pyx_v_key); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 198, __pyx_L1_error) __pyx_r = (hashindex_get(__pyx_v_self->__pyx_base.index, ((unsigned char *)__pyx_t_3)) != NULL); goto __pyx_L0; /* "borg/hashindex.pyx":196 * raise Exception('hashindex_set failed') * * def __contains__(self, key): # <<<<<<<<<<<<<< * assert len(key) == self.key_size * return hashindex_get(self.index, key) != NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.hashindex.FuseVersionsIndex.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_17FuseVersionsIndex_7__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_9hashindex_17FuseVersionsIndex_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_17FuseVersionsIndex_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_9hashindex_17FuseVersionsIndex_7__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_4borg_9hashindex_17FuseVersionsIndex_6__reduce_cython__(((struct __pyx_obj_4borg_9hashindex_FuseVersionsIndex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_17FuseVersionsIndex_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_9hashindex_FuseVersionsIndex *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.hashindex.FuseVersionsIndex.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_17FuseVersionsIndex_9__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_9hashindex_17FuseVersionsIndex_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_17FuseVersionsIndex_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_9hashindex_17FuseVersionsIndex_9__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.hashindex.FuseVersionsIndex.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_9hashindex_17FuseVersionsIndex_8__setstate_cython__(((struct __pyx_obj_4borg_9hashindex_FuseVersionsIndex *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_17FuseVersionsIndex_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_9hashindex_FuseVersionsIndex *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.hashindex.FuseVersionsIndex.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/hashindex.pyx":205 * value_size = 8 * * def __getitem__(self, key): # <<<<<<<<<<<<<< * assert len(key) == self.key_size * data = hashindex_get(self.index, key) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_7NSIndex_1__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ static PyObject *__pyx_pw_4borg_9hashindex_7NSIndex_1__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_4borg_9hashindex_7NSIndex___getitem__(((struct __pyx_obj_4borg_9hashindex_NSIndex *)__pyx_v_self), ((PyObject *)__pyx_v_key)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_7NSIndex___getitem__(struct __pyx_obj_4borg_9hashindex_NSIndex *__pyx_v_self, PyObject *__pyx_v_key) { uint32_t *__pyx_v_data; uint32_t __pyx_v_segment; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; unsigned char *__pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 1); /* "borg/hashindex.pyx":206 * * def __getitem__(self, key): * assert len(key) == self.key_size # <<<<<<<<<<<<<< * data = hashindex_get(self.index, key) * if not data: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = PyObject_Length(__pyx_v_key); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 206, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 == __pyx_v_self->__pyx_base.key_size); if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 206, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 206, __pyx_L1_error) #endif /* "borg/hashindex.pyx":207 * def __getitem__(self, key): * assert len(key) == self.key_size * data = hashindex_get(self.index, key) # <<<<<<<<<<<<<< * if not data: * raise KeyError(key) */ __pyx_t_3 = __Pyx_PyObject_AsWritableUString(__pyx_v_key); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 207, __pyx_L1_error) __pyx_v_data = ((uint32_t *)hashindex_get(__pyx_v_self->__pyx_base.index, ((unsigned char *)__pyx_t_3))); /* "borg/hashindex.pyx":208 * assert len(key) == self.key_size * data = hashindex_get(self.index, key) * if not data: # <<<<<<<<<<<<<< * raise KeyError(key) * cdef uint32_t segment = _le32toh(data[0]) */ __pyx_t_2 = (!(__pyx_v_data != 0)); if (unlikely(__pyx_t_2)) { /* "borg/hashindex.pyx":209 * data = hashindex_get(self.index, key) * if not data: * raise KeyError(key) # <<<<<<<<<<<<<< * cdef uint32_t segment = _le32toh(data[0]) * assert segment <= _MAX_VALUE, "maximum number of segments reached" */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 209, __pyx_L1_error) /* "borg/hashindex.pyx":208 * assert len(key) == self.key_size * data = hashindex_get(self.index, key) * if not data: # <<<<<<<<<<<<<< * raise KeyError(key) * cdef uint32_t segment = _le32toh(data[0]) */ } /* "borg/hashindex.pyx":210 * if not data: * raise KeyError(key) * cdef uint32_t segment = _le32toh(data[0]) # <<<<<<<<<<<<<< * assert segment <= _MAX_VALUE, "maximum number of segments reached" * return segment, _le32toh(data[1]) */ __pyx_v_segment = _le32toh((__pyx_v_data[0])); /* "borg/hashindex.pyx":211 * raise KeyError(key) * cdef uint32_t segment = _le32toh(data[0]) * assert segment <= _MAX_VALUE, "maximum number of segments reached" # <<<<<<<<<<<<<< * return segment, _le32toh(data[1]) * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_2 = (__pyx_v_segment <= _MAX_VALUE); if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_kp_s_maximum_number_of_segments_reach, 0, 0); __PYX_ERR(0, 211, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 211, __pyx_L1_error) #endif /* "borg/hashindex.pyx":212 * cdef uint32_t segment = _le32toh(data[0]) * assert segment <= _MAX_VALUE, "maximum number of segments reached" * return segment, _le32toh(data[1]) # <<<<<<<<<<<<<< * * def __setitem__(self, key, value): */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_segment); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint32_t(_le32toh((__pyx_v_data[1]))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(0, 212, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(0, 212, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "borg/hashindex.pyx":205 * value_size = 8 * * def __getitem__(self, key): # <<<<<<<<<<<<<< * assert len(key) == self.key_size * data = hashindex_get(self.index, key) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("borg.hashindex.NSIndex.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/hashindex.pyx":214 * return segment, _le32toh(data[1]) * * def __setitem__(self, key, value): # <<<<<<<<<<<<<< * assert len(key) == self.key_size * cdef uint32_t[2] data */ /* Python wrapper */ static int __pyx_pw_4borg_9hashindex_7NSIndex_3__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_4borg_9hashindex_7NSIndex_3__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_4borg_9hashindex_7NSIndex_2__setitem__(((struct __pyx_obj_4borg_9hashindex_NSIndex *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_4borg_9hashindex_7NSIndex_2__setitem__(struct __pyx_obj_4borg_9hashindex_NSIndex *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { uint32_t __pyx_v_data[2]; uint32_t __pyx_v_segment; int __pyx_r; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; uint32_t __pyx_t_4; unsigned char *__pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 1); /* "borg/hashindex.pyx":215 * * def __setitem__(self, key, value): * assert len(key) == self.key_size # <<<<<<<<<<<<<< * cdef uint32_t[2] data * cdef uint32_t segment = value[0] */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = PyObject_Length(__pyx_v_key); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 215, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 == __pyx_v_self->__pyx_base.key_size); if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 215, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 215, __pyx_L1_error) #endif /* "borg/hashindex.pyx":217 * assert len(key) == self.key_size * cdef uint32_t[2] data * cdef uint32_t segment = value[0] # <<<<<<<<<<<<<< * assert segment <= _MAX_VALUE, "maximum number of segments reached" * data[0] = _htole32(segment) */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_value, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_As_uint32_t(__pyx_t_3); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_segment = __pyx_t_4; /* "borg/hashindex.pyx":218 * cdef uint32_t[2] data * cdef uint32_t segment = value[0] * assert segment <= _MAX_VALUE, "maximum number of segments reached" # <<<<<<<<<<<<<< * data[0] = _htole32(segment) * data[1] = _htole32(value[1]) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_2 = (__pyx_v_segment <= _MAX_VALUE); if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_kp_s_maximum_number_of_segments_reach, 0, 0); __PYX_ERR(0, 218, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 218, __pyx_L1_error) #endif /* "borg/hashindex.pyx":219 * cdef uint32_t segment = value[0] * assert segment <= _MAX_VALUE, "maximum number of segments reached" * data[0] = _htole32(segment) # <<<<<<<<<<<<<< * data[1] = _htole32(value[1]) * if not hashindex_set(self.index, key, data): */ (__pyx_v_data[0]) = _htole32(__pyx_v_segment); /* "borg/hashindex.pyx":220 * assert segment <= _MAX_VALUE, "maximum number of segments reached" * data[0] = _htole32(segment) * data[1] = _htole32(value[1]) # <<<<<<<<<<<<<< * if not hashindex_set(self.index, key, data): * raise Exception('hashindex_set failed') */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_value, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_As_uint32_t(__pyx_t_3); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_data[1]) = _htole32(__pyx_t_4); /* "borg/hashindex.pyx":221 * data[0] = _htole32(segment) * data[1] = _htole32(value[1]) * if not hashindex_set(self.index, key, data): # <<<<<<<<<<<<<< * raise Exception('hashindex_set failed') * */ __pyx_t_5 = __Pyx_PyObject_AsWritableUString(__pyx_v_key); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 221, __pyx_L1_error) __pyx_t_2 = (!(hashindex_set(__pyx_v_self->__pyx_base.index, ((unsigned char *)__pyx_t_5), __pyx_v_data) != 0)); if (unlikely(__pyx_t_2)) { /* "borg/hashindex.pyx":222 * data[1] = _htole32(value[1]) * if not hashindex_set(self.index, key, data): * raise Exception('hashindex_set failed') # <<<<<<<<<<<<<< * * def __contains__(self, key): */ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 222, __pyx_L1_error) /* "borg/hashindex.pyx":221 * data[0] = _htole32(segment) * data[1] = _htole32(value[1]) * if not hashindex_set(self.index, key, data): # <<<<<<<<<<<<<< * raise Exception('hashindex_set failed') * */ } /* "borg/hashindex.pyx":214 * return segment, _le32toh(data[1]) * * def __setitem__(self, key, value): # <<<<<<<<<<<<<< * assert len(key) == self.key_size * cdef uint32_t[2] data */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("borg.hashindex.NSIndex.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/hashindex.pyx":224 * raise Exception('hashindex_set failed') * * def __contains__(self, key): # <<<<<<<<<<<<<< * cdef uint32_t segment * assert len(key) == self.key_size */ /* Python wrapper */ static int __pyx_pw_4borg_9hashindex_7NSIndex_5__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ static int __pyx_pw_4borg_9hashindex_7NSIndex_5__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__contains__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_4borg_9hashindex_7NSIndex_4__contains__(((struct __pyx_obj_4borg_9hashindex_NSIndex *)__pyx_v_self), ((PyObject *)__pyx_v_key)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_4borg_9hashindex_7NSIndex_4__contains__(struct __pyx_obj_4borg_9hashindex_NSIndex *__pyx_v_self, PyObject *__pyx_v_key) { uint32_t __pyx_v_segment; uint32_t *__pyx_v_data; int __pyx_r; Py_ssize_t __pyx_t_1; int __pyx_t_2; unsigned char *__pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "borg/hashindex.pyx":226 * def __contains__(self, key): * cdef uint32_t segment * assert len(key) == self.key_size # <<<<<<<<<<<<<< * data = hashindex_get(self.index, key) * if data != NULL: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = PyObject_Length(__pyx_v_key); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 226, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 == __pyx_v_self->__pyx_base.key_size); if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 226, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 226, __pyx_L1_error) #endif /* "borg/hashindex.pyx":227 * cdef uint32_t segment * assert len(key) == self.key_size * data = hashindex_get(self.index, key) # <<<<<<<<<<<<<< * if data != NULL: * segment = _le32toh(data[0]) */ __pyx_t_3 = __Pyx_PyObject_AsWritableUString(__pyx_v_key); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 227, __pyx_L1_error) __pyx_v_data = ((uint32_t *)hashindex_get(__pyx_v_self->__pyx_base.index, ((unsigned char *)__pyx_t_3))); /* "borg/hashindex.pyx":228 * assert len(key) == self.key_size * data = hashindex_get(self.index, key) * if data != NULL: # <<<<<<<<<<<<<< * segment = _le32toh(data[0]) * assert segment <= _MAX_VALUE, "maximum number of segments reached" */ __pyx_t_2 = (__pyx_v_data != NULL); if (__pyx_t_2) { /* "borg/hashindex.pyx":229 * data = hashindex_get(self.index, key) * if data != NULL: * segment = _le32toh(data[0]) # <<<<<<<<<<<<<< * assert segment <= _MAX_VALUE, "maximum number of segments reached" * return data != NULL */ __pyx_v_segment = _le32toh((__pyx_v_data[0])); /* "borg/hashindex.pyx":230 * if data != NULL: * segment = _le32toh(data[0]) * assert segment <= _MAX_VALUE, "maximum number of segments reached" # <<<<<<<<<<<<<< * return data != NULL * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_2 = (__pyx_v_segment <= _MAX_VALUE); if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_kp_s_maximum_number_of_segments_reach, 0, 0); __PYX_ERR(0, 230, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 230, __pyx_L1_error) #endif /* "borg/hashindex.pyx":228 * assert len(key) == self.key_size * data = hashindex_get(self.index, key) * if data != NULL: # <<<<<<<<<<<<<< * segment = _le32toh(data[0]) * assert segment <= _MAX_VALUE, "maximum number of segments reached" */ } /* "borg/hashindex.pyx":231 * segment = _le32toh(data[0]) * assert segment <= _MAX_VALUE, "maximum number of segments reached" * return data != NULL # <<<<<<<<<<<<<< * * def iteritems(self, marker=None): */ __pyx_r = (__pyx_v_data != NULL); goto __pyx_L0; /* "borg/hashindex.pyx":224 * raise Exception('hashindex_set failed') * * def __contains__(self, key): # <<<<<<<<<<<<<< * cdef uint32_t segment * assert len(key) == self.key_size */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.hashindex.NSIndex.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "borg/hashindex.pyx":233 * return data != NULL * * def iteritems(self, marker=None): # <<<<<<<<<<<<<< * cdef const unsigned char *key * iter = NSKeyIterator(self.key_size) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_7NSIndex_7iteritems(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_9hashindex_7NSIndex_7iteritems = {"iteritems", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_7NSIndex_7iteritems, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_9hashindex_7NSIndex_7iteritems(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_marker = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("iteritems (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_marker,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_marker); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 233, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "iteritems") < 0)) __PYX_ERR(0, 233, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_marker = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("iteritems", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 233, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.hashindex.NSIndex.iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_9hashindex_7NSIndex_6iteritems(((struct __pyx_obj_4borg_9hashindex_NSIndex *)__pyx_v_self), __pyx_v_marker); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_7NSIndex_6iteritems(struct __pyx_obj_4borg_9hashindex_NSIndex *__pyx_v_self, PyObject *__pyx_v_marker) { unsigned char const *__pyx_v_key; struct __pyx_obj_4borg_9hashindex_NSKeyIterator *__pyx_v_iter = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; HashIndex *__pyx_t_3; int __pyx_t_4; unsigned char *__pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("iteritems", 1); /* "borg/hashindex.pyx":235 * def iteritems(self, marker=None): * cdef const unsigned char *key * iter = NSKeyIterator(self.key_size) # <<<<<<<<<<<<<< * iter.idx = self * iter.index = self.index */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.key_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4borg_9hashindex_NSKeyIterator), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_iter = ((struct __pyx_obj_4borg_9hashindex_NSKeyIterator *)__pyx_t_2); __pyx_t_2 = 0; /* "borg/hashindex.pyx":236 * cdef const unsigned char *key * iter = NSKeyIterator(self.key_size) * iter.idx = self # <<<<<<<<<<<<<< * iter.index = self.index * if marker: */ __Pyx_INCREF((PyObject *)__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_v_self); __Pyx_GOTREF((PyObject *)__pyx_v_iter->idx); __Pyx_DECREF((PyObject *)__pyx_v_iter->idx); __pyx_v_iter->idx = __pyx_v_self; /* "borg/hashindex.pyx":237 * iter = NSKeyIterator(self.key_size) * iter.idx = self * iter.index = self.index # <<<<<<<<<<<<<< * if marker: * key = hashindex_get(self.index, marker) */ __pyx_t_3 = __pyx_v_self->__pyx_base.index; __pyx_v_iter->index = __pyx_t_3; /* "borg/hashindex.pyx":238 * iter.idx = self * iter.index = self.index * if marker: # <<<<<<<<<<<<<< * key = hashindex_get(self.index, marker) * if marker is None: */ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_marker); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 238, __pyx_L1_error) if (__pyx_t_4) { /* "borg/hashindex.pyx":239 * iter.index = self.index * if marker: * key = hashindex_get(self.index, marker) # <<<<<<<<<<<<<< * if marker is None: * raise IndexError */ __pyx_t_5 = __Pyx_PyObject_AsWritableUString(__pyx_v_marker); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 239, __pyx_L1_error) __pyx_v_key = hashindex_get(__pyx_v_self->__pyx_base.index, ((unsigned char *)__pyx_t_5)); /* "borg/hashindex.pyx":240 * if marker: * key = hashindex_get(self.index, marker) * if marker is None: # <<<<<<<<<<<<<< * raise IndexError * iter.key = key - self.key_size */ __pyx_t_4 = (__pyx_v_marker == Py_None); if (unlikely(__pyx_t_4)) { /* "borg/hashindex.pyx":241 * key = hashindex_get(self.index, marker) * if marker is None: * raise IndexError # <<<<<<<<<<<<<< * iter.key = key - self.key_size * return iter */ __Pyx_Raise(__pyx_builtin_IndexError, 0, 0, 0); __PYX_ERR(0, 241, __pyx_L1_error) /* "borg/hashindex.pyx":240 * if marker: * key = hashindex_get(self.index, marker) * if marker is None: # <<<<<<<<<<<<<< * raise IndexError * iter.key = key - self.key_size */ } /* "borg/hashindex.pyx":242 * if marker is None: * raise IndexError * iter.key = key - self.key_size # <<<<<<<<<<<<<< * return iter * */ __pyx_v_iter->key = (__pyx_v_key - __pyx_v_self->__pyx_base.key_size); /* "borg/hashindex.pyx":238 * iter.idx = self * iter.index = self.index * if marker: # <<<<<<<<<<<<<< * key = hashindex_get(self.index, marker) * if marker is None: */ } /* "borg/hashindex.pyx":243 * raise IndexError * iter.key = key - self.key_size * return iter # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_iter); __pyx_r = ((PyObject *)__pyx_v_iter); goto __pyx_L0; /* "borg/hashindex.pyx":233 * return data != NULL * * def iteritems(self, marker=None): # <<<<<<<<<<<<<< * cdef const unsigned char *key * iter = NSKeyIterator(self.key_size) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("borg.hashindex.NSIndex.iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_iter); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_7NSIndex_9__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_9hashindex_7NSIndex_9__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_7NSIndex_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_9hashindex_7NSIndex_9__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_4borg_9hashindex_7NSIndex_8__reduce_cython__(((struct __pyx_obj_4borg_9hashindex_NSIndex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_7NSIndex_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_9hashindex_NSIndex *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.hashindex.NSIndex.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_7NSIndex_11__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_9hashindex_7NSIndex_11__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_7NSIndex_11__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_9hashindex_7NSIndex_11__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.hashindex.NSIndex.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_9hashindex_7NSIndex_10__setstate_cython__(((struct __pyx_obj_4borg_9hashindex_NSIndex *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_7NSIndex_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_9hashindex_NSIndex *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.hashindex.NSIndex.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/hashindex.pyx":253 * cdef int exhausted * * def __cinit__(self, key_size): # <<<<<<<<<<<<<< * self.key = NULL * self.key_size = key_size */ /* Python wrapper */ static int __pyx_pw_4borg_9hashindex_13NSKeyIterator_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_4borg_9hashindex_13NSKeyIterator_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_key_size = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key_size_2,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_key_size_2)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 253, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(0, 253, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); } __pyx_v_key_size = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 253, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.hashindex.NSKeyIterator.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_9hashindex_13NSKeyIterator___cinit__(((struct __pyx_obj_4borg_9hashindex_NSKeyIterator *)__pyx_v_self), __pyx_v_key_size); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_4borg_9hashindex_13NSKeyIterator___cinit__(struct __pyx_obj_4borg_9hashindex_NSKeyIterator *__pyx_v_self, PyObject *__pyx_v_key_size) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "borg/hashindex.pyx":254 * * def __cinit__(self, key_size): * self.key = NULL # <<<<<<<<<<<<<< * self.key_size = key_size * self.exhausted = 0 */ __pyx_v_self->key = NULL; /* "borg/hashindex.pyx":255 * def __cinit__(self, key_size): * self.key = NULL * self.key_size = key_size # <<<<<<<<<<<<<< * self.exhausted = 0 * */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_key_size); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 255, __pyx_L1_error) __pyx_v_self->key_size = __pyx_t_1; /* "borg/hashindex.pyx":256 * self.key = NULL * self.key_size = key_size * self.exhausted = 0 # <<<<<<<<<<<<<< * * def __iter__(self): */ __pyx_v_self->exhausted = 0; /* "borg/hashindex.pyx":253 * cdef int exhausted * * def __cinit__(self, key_size): # <<<<<<<<<<<<<< * self.key = NULL * self.key_size = key_size */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("borg.hashindex.NSKeyIterator.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "borg/hashindex.pyx":258 * self.exhausted = 0 * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_13NSKeyIterator_3__iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4borg_9hashindex_13NSKeyIterator_3__iter__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_4borg_9hashindex_13NSKeyIterator_2__iter__(((struct __pyx_obj_4borg_9hashindex_NSKeyIterator *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_13NSKeyIterator_2__iter__(struct __pyx_obj_4borg_9hashindex_NSKeyIterator *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__", 1); /* "borg/hashindex.pyx":259 * * def __iter__(self): * return self # <<<<<<<<<<<<<< * * def __next__(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "borg/hashindex.pyx":258 * self.exhausted = 0 * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/hashindex.pyx":261 * return self * * def __next__(self): # <<<<<<<<<<<<<< * if self.exhausted: * raise StopIteration */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_13NSKeyIterator_5__next__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4borg_9hashindex_13NSKeyIterator_5__next__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_4borg_9hashindex_13NSKeyIterator_4__next__(((struct __pyx_obj_4borg_9hashindex_NSKeyIterator *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_13NSKeyIterator_4__next__(struct __pyx_obj_4borg_9hashindex_NSKeyIterator *__pyx_v_self) { uint32_t *__pyx_v_value; uint32_t __pyx_v_segment; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_error_without_exception = 0; /* StopIteration */ int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__next__", 1); /* "borg/hashindex.pyx":262 * * def __next__(self): * if self.exhausted: # <<<<<<<<<<<<<< * raise StopIteration * self.key = hashindex_next_key(self.index, self.key) */ __pyx_t_1 = (__pyx_v_self->exhausted != 0); if (unlikely(__pyx_t_1)) { /* "borg/hashindex.pyx":263 * def __next__(self): * if self.exhausted: * raise StopIteration # <<<<<<<<<<<<<< * self.key = hashindex_next_key(self.index, self.key) * if not self.key: */ __pyx_error_without_exception = 1; goto __pyx_L1_error;; /* "borg/hashindex.pyx":262 * * def __next__(self): * if self.exhausted: # <<<<<<<<<<<<<< * raise StopIteration * self.key = hashindex_next_key(self.index, self.key) */ } /* "borg/hashindex.pyx":264 * if self.exhausted: * raise StopIteration * self.key = hashindex_next_key(self.index, self.key) # <<<<<<<<<<<<<< * if not self.key: * self.exhausted = 1 */ __pyx_v_self->key = hashindex_next_key(__pyx_v_self->index, ((unsigned char *)__pyx_v_self->key)); /* "borg/hashindex.pyx":265 * raise StopIteration * self.key = hashindex_next_key(self.index, self.key) * if not self.key: # <<<<<<<<<<<<<< * self.exhausted = 1 * raise StopIteration */ __pyx_t_1 = (!(__pyx_v_self->key != 0)); if (unlikely(__pyx_t_1)) { /* "borg/hashindex.pyx":266 * self.key = hashindex_next_key(self.index, self.key) * if not self.key: * self.exhausted = 1 # <<<<<<<<<<<<<< * raise StopIteration * cdef uint32_t *value = (self.key + self.key_size) */ __pyx_v_self->exhausted = 1; /* "borg/hashindex.pyx":267 * if not self.key: * self.exhausted = 1 * raise StopIteration # <<<<<<<<<<<<<< * cdef uint32_t *value = (self.key + self.key_size) * cdef uint32_t segment = _le32toh(value[0]) */ __pyx_error_without_exception = 1; goto __pyx_L1_error;; /* "borg/hashindex.pyx":265 * raise StopIteration * self.key = hashindex_next_key(self.index, self.key) * if not self.key: # <<<<<<<<<<<<<< * self.exhausted = 1 * raise StopIteration */ } /* "borg/hashindex.pyx":268 * self.exhausted = 1 * raise StopIteration * cdef uint32_t *value = (self.key + self.key_size) # <<<<<<<<<<<<<< * cdef uint32_t segment = _le32toh(value[0]) * assert segment <= _MAX_VALUE, "maximum number of segments reached" */ __pyx_v_value = ((uint32_t *)(__pyx_v_self->key + __pyx_v_self->key_size)); /* "borg/hashindex.pyx":269 * raise StopIteration * cdef uint32_t *value = (self.key + self.key_size) * cdef uint32_t segment = _le32toh(value[0]) # <<<<<<<<<<<<<< * assert segment <= _MAX_VALUE, "maximum number of segments reached" * return (self.key)[:self.key_size], (segment, _le32toh(value[1])) */ __pyx_v_segment = _le32toh((__pyx_v_value[0])); /* "borg/hashindex.pyx":270 * cdef uint32_t *value = (self.key + self.key_size) * cdef uint32_t segment = _le32toh(value[0]) * assert segment <= _MAX_VALUE, "maximum number of segments reached" # <<<<<<<<<<<<<< * return (self.key)[:self.key_size], (segment, _le32toh(value[1])) * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = (__pyx_v_segment <= _MAX_VALUE); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_kp_s_maximum_number_of_segments_reach, 0, 0); __PYX_ERR(0, 270, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 270, __pyx_L1_error) #endif /* "borg/hashindex.pyx":271 * cdef uint32_t segment = _le32toh(value[0]) * assert segment <= _MAX_VALUE, "maximum number of segments reached" * return (self.key)[:self.key_size], (segment, _le32toh(value[1])) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(((char *)__pyx_v_self->key) + 0, __pyx_v_self->key_size - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_segment); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(_le32toh((__pyx_v_value[1]))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(0, 271, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(0, 271, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 271, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5)) __PYX_ERR(0, 271, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "borg/hashindex.pyx":261 * return self * * def __next__(self): # <<<<<<<<<<<<<< * if self.exhausted: * raise StopIteration */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); if (!__pyx_error_without_exception) { __Pyx_AddTraceback("borg.hashindex.NSKeyIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); } __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_13NSKeyIterator_7__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_9hashindex_13NSKeyIterator_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_13NSKeyIterator_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_9hashindex_13NSKeyIterator_7__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_4borg_9hashindex_13NSKeyIterator_6__reduce_cython__(((struct __pyx_obj_4borg_9hashindex_NSKeyIterator *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_13NSKeyIterator_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_9hashindex_NSKeyIterator *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.hashindex.NSKeyIterator.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_13NSKeyIterator_9__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_9hashindex_13NSKeyIterator_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_13NSKeyIterator_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_9hashindex_13NSKeyIterator_9__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.hashindex.NSKeyIterator.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_9hashindex_13NSKeyIterator_8__setstate_cython__(((struct __pyx_obj_4borg_9hashindex_NSKeyIterator *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_13NSKeyIterator_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_9hashindex_NSKeyIterator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.hashindex.NSKeyIterator.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/hashindex.pyx":296 * value_size = 12 * * def __getitem__(self, key): # <<<<<<<<<<<<<< * assert len(key) == self.key_size * data = hashindex_get(self.index, key) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_10ChunkIndex_1__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ static PyObject *__pyx_pw_4borg_9hashindex_10ChunkIndex_1__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_4borg_9hashindex_10ChunkIndex___getitem__(((struct __pyx_obj_4borg_9hashindex_ChunkIndex *)__pyx_v_self), ((PyObject *)__pyx_v_key)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_10ChunkIndex___getitem__(struct __pyx_obj_4borg_9hashindex_ChunkIndex *__pyx_v_self, PyObject *__pyx_v_key) { uint32_t *__pyx_v_data; uint32_t __pyx_v_refcount; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; unsigned char *__pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 1); /* "borg/hashindex.pyx":297 * * def __getitem__(self, key): * assert len(key) == self.key_size # <<<<<<<<<<<<<< * data = hashindex_get(self.index, key) * if not data: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = PyObject_Length(__pyx_v_key); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 297, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 == __pyx_v_self->__pyx_base.key_size); if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 297, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 297, __pyx_L1_error) #endif /* "borg/hashindex.pyx":298 * def __getitem__(self, key): * assert len(key) == self.key_size * data = hashindex_get(self.index, key) # <<<<<<<<<<<<<< * if not data: * raise KeyError(key) */ __pyx_t_3 = __Pyx_PyObject_AsWritableUString(__pyx_v_key); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 298, __pyx_L1_error) __pyx_v_data = ((uint32_t *)hashindex_get(__pyx_v_self->__pyx_base.index, ((unsigned char *)__pyx_t_3))); /* "borg/hashindex.pyx":299 * assert len(key) == self.key_size * data = hashindex_get(self.index, key) * if not data: # <<<<<<<<<<<<<< * raise KeyError(key) * cdef uint32_t refcount = _le32toh(data[0]) */ __pyx_t_2 = (!(__pyx_v_data != 0)); if (unlikely(__pyx_t_2)) { /* "borg/hashindex.pyx":300 * data = hashindex_get(self.index, key) * if not data: * raise KeyError(key) # <<<<<<<<<<<<<< * cdef uint32_t refcount = _le32toh(data[0]) * assert refcount <= _MAX_VALUE, "invalid reference count" */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 300, __pyx_L1_error) /* "borg/hashindex.pyx":299 * assert len(key) == self.key_size * data = hashindex_get(self.index, key) * if not data: # <<<<<<<<<<<<<< * raise KeyError(key) * cdef uint32_t refcount = _le32toh(data[0]) */ } /* "borg/hashindex.pyx":301 * if not data: * raise KeyError(key) * cdef uint32_t refcount = _le32toh(data[0]) # <<<<<<<<<<<<<< * assert refcount <= _MAX_VALUE, "invalid reference count" * return ChunkIndexEntry(refcount, _le32toh(data[1]), _le32toh(data[2])) */ __pyx_v_refcount = _le32toh((__pyx_v_data[0])); /* "borg/hashindex.pyx":302 * raise KeyError(key) * cdef uint32_t refcount = _le32toh(data[0]) * assert refcount <= _MAX_VALUE, "invalid reference count" # <<<<<<<<<<<<<< * return ChunkIndexEntry(refcount, _le32toh(data[1]), _le32toh(data[2])) * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_2 = (__pyx_v_refcount <= _MAX_VALUE); if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_kp_s_invalid_reference_count, 0, 0); __PYX_ERR(0, 302, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 302, __pyx_L1_error) #endif /* "borg/hashindex.pyx":303 * cdef uint32_t refcount = _le32toh(data[0]) * assert refcount <= _MAX_VALUE, "invalid reference count" * return ChunkIndexEntry(refcount, _le32toh(data[1]), _le32toh(data[2])) # <<<<<<<<<<<<<< * * def __setitem__(self, key, value): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ChunkIndexEntry); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyInt_From_uint32_t(__pyx_v_refcount); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyInt_From_uint32_t(_le32toh((__pyx_v_data[1]))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyInt_From_uint32_t(_le32toh((__pyx_v_data[2]))); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_9, __pyx_t_6, __pyx_t_7, __pyx_t_8}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_10, 3+__pyx_t_10); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "borg/hashindex.pyx":296 * value_size = 12 * * def __getitem__(self, key): # <<<<<<<<<<<<<< * assert len(key) == self.key_size * data = hashindex_get(self.index, key) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("borg.hashindex.ChunkIndex.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/hashindex.pyx":305 * return ChunkIndexEntry(refcount, _le32toh(data[1]), _le32toh(data[2])) * * def __setitem__(self, key, value): # <<<<<<<<<<<<<< * assert len(key) == self.key_size * cdef uint32_t[3] data */ /* Python wrapper */ static int __pyx_pw_4borg_9hashindex_10ChunkIndex_3__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_4borg_9hashindex_10ChunkIndex_3__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_4borg_9hashindex_10ChunkIndex_2__setitem__(((struct __pyx_obj_4borg_9hashindex_ChunkIndex *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_4borg_9hashindex_10ChunkIndex_2__setitem__(struct __pyx_obj_4borg_9hashindex_ChunkIndex *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { uint32_t __pyx_v_data[3]; uint32_t __pyx_v_refcount; int __pyx_r; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; uint32_t __pyx_t_4; unsigned char *__pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 1); /* "borg/hashindex.pyx":306 * * def __setitem__(self, key, value): * assert len(key) == self.key_size # <<<<<<<<<<<<<< * cdef uint32_t[3] data * cdef uint32_t refcount = value[0] */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = PyObject_Length(__pyx_v_key); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 306, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 == __pyx_v_self->__pyx_base.key_size); if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 306, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 306, __pyx_L1_error) #endif /* "borg/hashindex.pyx":308 * assert len(key) == self.key_size * cdef uint32_t[3] data * cdef uint32_t refcount = value[0] # <<<<<<<<<<<<<< * assert refcount <= _MAX_VALUE, "invalid reference count" * data[0] = _htole32(refcount) */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_value, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_As_uint32_t(__pyx_t_3); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_refcount = __pyx_t_4; /* "borg/hashindex.pyx":309 * cdef uint32_t[3] data * cdef uint32_t refcount = value[0] * assert refcount <= _MAX_VALUE, "invalid reference count" # <<<<<<<<<<<<<< * data[0] = _htole32(refcount) * data[1] = _htole32(value[1]) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_2 = (__pyx_v_refcount <= _MAX_VALUE); if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_kp_s_invalid_reference_count, 0, 0); __PYX_ERR(0, 309, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 309, __pyx_L1_error) #endif /* "borg/hashindex.pyx":310 * cdef uint32_t refcount = value[0] * assert refcount <= _MAX_VALUE, "invalid reference count" * data[0] = _htole32(refcount) # <<<<<<<<<<<<<< * data[1] = _htole32(value[1]) * data[2] = _htole32(value[2]) */ (__pyx_v_data[0]) = _htole32(__pyx_v_refcount); /* "borg/hashindex.pyx":311 * assert refcount <= _MAX_VALUE, "invalid reference count" * data[0] = _htole32(refcount) * data[1] = _htole32(value[1]) # <<<<<<<<<<<<<< * data[2] = _htole32(value[2]) * if not hashindex_set(self.index, key, data): */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_value, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_As_uint32_t(__pyx_t_3); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_data[1]) = _htole32(__pyx_t_4); /* "borg/hashindex.pyx":312 * data[0] = _htole32(refcount) * data[1] = _htole32(value[1]) * data[2] = _htole32(value[2]) # <<<<<<<<<<<<<< * if not hashindex_set(self.index, key, data): * raise Exception('hashindex_set failed') */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_value, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_As_uint32_t(__pyx_t_3); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_data[2]) = _htole32(__pyx_t_4); /* "borg/hashindex.pyx":313 * data[1] = _htole32(value[1]) * data[2] = _htole32(value[2]) * if not hashindex_set(self.index, key, data): # <<<<<<<<<<<<<< * raise Exception('hashindex_set failed') * */ __pyx_t_5 = __Pyx_PyObject_AsWritableUString(__pyx_v_key); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 313, __pyx_L1_error) __pyx_t_2 = (!(hashindex_set(__pyx_v_self->__pyx_base.index, ((unsigned char *)__pyx_t_5), __pyx_v_data) != 0)); if (unlikely(__pyx_t_2)) { /* "borg/hashindex.pyx":314 * data[2] = _htole32(value[2]) * if not hashindex_set(self.index, key, data): * raise Exception('hashindex_set failed') # <<<<<<<<<<<<<< * * def __contains__(self, key): */ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 314, __pyx_L1_error) /* "borg/hashindex.pyx":313 * data[1] = _htole32(value[1]) * data[2] = _htole32(value[2]) * if not hashindex_set(self.index, key, data): # <<<<<<<<<<<<<< * raise Exception('hashindex_set failed') * */ } /* "borg/hashindex.pyx":305 * return ChunkIndexEntry(refcount, _le32toh(data[1]), _le32toh(data[2])) * * def __setitem__(self, key, value): # <<<<<<<<<<<<<< * assert len(key) == self.key_size * cdef uint32_t[3] data */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("borg.hashindex.ChunkIndex.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/hashindex.pyx":316 * raise Exception('hashindex_set failed') * * def __contains__(self, key): # <<<<<<<<<<<<<< * assert len(key) == self.key_size * data = hashindex_get(self.index, key) */ /* Python wrapper */ static int __pyx_pw_4borg_9hashindex_10ChunkIndex_5__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ static int __pyx_pw_4borg_9hashindex_10ChunkIndex_5__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__contains__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_4borg_9hashindex_10ChunkIndex_4__contains__(((struct __pyx_obj_4borg_9hashindex_ChunkIndex *)__pyx_v_self), ((PyObject *)__pyx_v_key)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_4borg_9hashindex_10ChunkIndex_4__contains__(struct __pyx_obj_4borg_9hashindex_ChunkIndex *__pyx_v_self, PyObject *__pyx_v_key) { uint32_t *__pyx_v_data; int __pyx_r; Py_ssize_t __pyx_t_1; int __pyx_t_2; unsigned char *__pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "borg/hashindex.pyx":317 * * def __contains__(self, key): * assert len(key) == self.key_size # <<<<<<<<<<<<<< * data = hashindex_get(self.index, key) * if data != NULL: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = PyObject_Length(__pyx_v_key); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 317, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 == __pyx_v_self->__pyx_base.key_size); if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 317, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 317, __pyx_L1_error) #endif /* "borg/hashindex.pyx":318 * def __contains__(self, key): * assert len(key) == self.key_size * data = hashindex_get(self.index, key) # <<<<<<<<<<<<<< * if data != NULL: * assert _le32toh(data[0]) <= _MAX_VALUE, "invalid reference count" */ __pyx_t_3 = __Pyx_PyObject_AsWritableUString(__pyx_v_key); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 318, __pyx_L1_error) __pyx_v_data = ((uint32_t *)hashindex_get(__pyx_v_self->__pyx_base.index, ((unsigned char *)__pyx_t_3))); /* "borg/hashindex.pyx":319 * assert len(key) == self.key_size * data = hashindex_get(self.index, key) * if data != NULL: # <<<<<<<<<<<<<< * assert _le32toh(data[0]) <= _MAX_VALUE, "invalid reference count" * return data != NULL */ __pyx_t_2 = (__pyx_v_data != NULL); if (__pyx_t_2) { /* "borg/hashindex.pyx":320 * data = hashindex_get(self.index, key) * if data != NULL: * assert _le32toh(data[0]) <= _MAX_VALUE, "invalid reference count" # <<<<<<<<<<<<<< * return data != NULL * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_2 = (_le32toh((__pyx_v_data[0])) <= _MAX_VALUE); if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_kp_s_invalid_reference_count, 0, 0); __PYX_ERR(0, 320, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 320, __pyx_L1_error) #endif /* "borg/hashindex.pyx":319 * assert len(key) == self.key_size * data = hashindex_get(self.index, key) * if data != NULL: # <<<<<<<<<<<<<< * assert _le32toh(data[0]) <= _MAX_VALUE, "invalid reference count" * return data != NULL */ } /* "borg/hashindex.pyx":321 * if data != NULL: * assert _le32toh(data[0]) <= _MAX_VALUE, "invalid reference count" * return data != NULL # <<<<<<<<<<<<<< * * def incref(self, key): */ __pyx_r = (__pyx_v_data != NULL); goto __pyx_L0; /* "borg/hashindex.pyx":316 * raise Exception('hashindex_set failed') * * def __contains__(self, key): # <<<<<<<<<<<<<< * assert len(key) == self.key_size * data = hashindex_get(self.index, key) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.hashindex.ChunkIndex.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "borg/hashindex.pyx":323 * return data != NULL * * def incref(self, key): # <<<<<<<<<<<<<< * """Increase refcount for 'key', return (refcount, size, csize)""" * assert len(key) == self.key_size */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_10ChunkIndex_7incref(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_9hashindex_10ChunkIndex_6incref, "Increase refcount for 'key', return (refcount, size, csize)"); static PyMethodDef __pyx_mdef_4borg_9hashindex_10ChunkIndex_7incref = {"incref", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_10ChunkIndex_7incref, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_9hashindex_10ChunkIndex_6incref}; static PyObject *__pyx_pw_4borg_9hashindex_10ChunkIndex_7incref(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_key = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("incref (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_key)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 323, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "incref") < 0)) __PYX_ERR(0, 323, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_key = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("incref", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 323, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.hashindex.ChunkIndex.incref", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_9hashindex_10ChunkIndex_6incref(((struct __pyx_obj_4borg_9hashindex_ChunkIndex *)__pyx_v_self), __pyx_v_key); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_10ChunkIndex_6incref(struct __pyx_obj_4borg_9hashindex_ChunkIndex *__pyx_v_self, PyObject *__pyx_v_key) { uint32_t *__pyx_v_data; uint32_t __pyx_v_refcount; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; unsigned char *__pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("incref", 1); /* "borg/hashindex.pyx":325 * def incref(self, key): * """Increase refcount for 'key', return (refcount, size, csize)""" * assert len(key) == self.key_size # <<<<<<<<<<<<<< * data = hashindex_get(self.index, key) * if not data: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = PyObject_Length(__pyx_v_key); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 325, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 == __pyx_v_self->__pyx_base.key_size); if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 325, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 325, __pyx_L1_error) #endif /* "borg/hashindex.pyx":326 * """Increase refcount for 'key', return (refcount, size, csize)""" * assert len(key) == self.key_size * data = hashindex_get(self.index, key) # <<<<<<<<<<<<<< * if not data: * raise KeyError(key) */ __pyx_t_3 = __Pyx_PyObject_AsWritableUString(__pyx_v_key); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 326, __pyx_L1_error) __pyx_v_data = ((uint32_t *)hashindex_get(__pyx_v_self->__pyx_base.index, ((unsigned char *)__pyx_t_3))); /* "borg/hashindex.pyx":327 * assert len(key) == self.key_size * data = hashindex_get(self.index, key) * if not data: # <<<<<<<<<<<<<< * raise KeyError(key) * cdef uint32_t refcount = _le32toh(data[0]) */ __pyx_t_2 = (!(__pyx_v_data != 0)); if (unlikely(__pyx_t_2)) { /* "borg/hashindex.pyx":328 * data = hashindex_get(self.index, key) * if not data: * raise KeyError(key) # <<<<<<<<<<<<<< * cdef uint32_t refcount = _le32toh(data[0]) * assert refcount <= _MAX_VALUE, "invalid reference count" */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 328, __pyx_L1_error) /* "borg/hashindex.pyx":327 * assert len(key) == self.key_size * data = hashindex_get(self.index, key) * if not data: # <<<<<<<<<<<<<< * raise KeyError(key) * cdef uint32_t refcount = _le32toh(data[0]) */ } /* "borg/hashindex.pyx":329 * if not data: * raise KeyError(key) * cdef uint32_t refcount = _le32toh(data[0]) # <<<<<<<<<<<<<< * assert refcount <= _MAX_VALUE, "invalid reference count" * if refcount != _MAX_VALUE: */ __pyx_v_refcount = _le32toh((__pyx_v_data[0])); /* "borg/hashindex.pyx":330 * raise KeyError(key) * cdef uint32_t refcount = _le32toh(data[0]) * assert refcount <= _MAX_VALUE, "invalid reference count" # <<<<<<<<<<<<<< * if refcount != _MAX_VALUE: * refcount += 1 */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_2 = (__pyx_v_refcount <= _MAX_VALUE); if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_kp_s_invalid_reference_count, 0, 0); __PYX_ERR(0, 330, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 330, __pyx_L1_error) #endif /* "borg/hashindex.pyx":331 * cdef uint32_t refcount = _le32toh(data[0]) * assert refcount <= _MAX_VALUE, "invalid reference count" * if refcount != _MAX_VALUE: # <<<<<<<<<<<<<< * refcount += 1 * data[0] = _htole32(refcount) */ __pyx_t_2 = (__pyx_v_refcount != _MAX_VALUE); if (__pyx_t_2) { /* "borg/hashindex.pyx":332 * assert refcount <= _MAX_VALUE, "invalid reference count" * if refcount != _MAX_VALUE: * refcount += 1 # <<<<<<<<<<<<<< * data[0] = _htole32(refcount) * return refcount, _le32toh(data[1]), _le32toh(data[2]) */ __pyx_v_refcount = (__pyx_v_refcount + 1); /* "borg/hashindex.pyx":331 * cdef uint32_t refcount = _le32toh(data[0]) * assert refcount <= _MAX_VALUE, "invalid reference count" * if refcount != _MAX_VALUE: # <<<<<<<<<<<<<< * refcount += 1 * data[0] = _htole32(refcount) */ } /* "borg/hashindex.pyx":333 * if refcount != _MAX_VALUE: * refcount += 1 * data[0] = _htole32(refcount) # <<<<<<<<<<<<<< * return refcount, _le32toh(data[1]), _le32toh(data[2]) * */ (__pyx_v_data[0]) = _htole32(__pyx_v_refcount); /* "borg/hashindex.pyx":334 * refcount += 1 * data[0] = _htole32(refcount) * return refcount, _le32toh(data[1]), _le32toh(data[2]) # <<<<<<<<<<<<<< * * def decref(self, key): */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_refcount); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint32_t(_le32toh((__pyx_v_data[1]))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyInt_From_uint32_t(_le32toh((__pyx_v_data[2]))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4)) __PYX_ERR(0, 334, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5)) __PYX_ERR(0, 334, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_6)) __PYX_ERR(0, 334, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; /* "borg/hashindex.pyx":323 * return data != NULL * * def incref(self, key): # <<<<<<<<<<<<<< * """Increase refcount for 'key', return (refcount, size, csize)""" * assert len(key) == self.key_size */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("borg.hashindex.ChunkIndex.incref", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/hashindex.pyx":336 * return refcount, _le32toh(data[1]), _le32toh(data[2]) * * def decref(self, key): # <<<<<<<<<<<<<< * """Decrease refcount for 'key', return (refcount, size, csize)""" * assert len(key) == self.key_size */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_10ChunkIndex_9decref(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_9hashindex_10ChunkIndex_8decref, "Decrease refcount for 'key', return (refcount, size, csize)"); static PyMethodDef __pyx_mdef_4borg_9hashindex_10ChunkIndex_9decref = {"decref", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_10ChunkIndex_9decref, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_9hashindex_10ChunkIndex_8decref}; static PyObject *__pyx_pw_4borg_9hashindex_10ChunkIndex_9decref(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_key = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("decref (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_key)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "decref") < 0)) __PYX_ERR(0, 336, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_key = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("decref", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 336, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.hashindex.ChunkIndex.decref", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_9hashindex_10ChunkIndex_8decref(((struct __pyx_obj_4borg_9hashindex_ChunkIndex *)__pyx_v_self), __pyx_v_key); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_10ChunkIndex_8decref(struct __pyx_obj_4borg_9hashindex_ChunkIndex *__pyx_v_self, PyObject *__pyx_v_key) { uint32_t *__pyx_v_data; uint32_t __pyx_v_refcount; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; unsigned char *__pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("decref", 1); /* "borg/hashindex.pyx":338 * def decref(self, key): * """Decrease refcount for 'key', return (refcount, size, csize)""" * assert len(key) == self.key_size # <<<<<<<<<<<<<< * data = hashindex_get(self.index, key) * if not data: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = PyObject_Length(__pyx_v_key); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 338, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 == __pyx_v_self->__pyx_base.key_size); if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 338, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 338, __pyx_L1_error) #endif /* "borg/hashindex.pyx":339 * """Decrease refcount for 'key', return (refcount, size, csize)""" * assert len(key) == self.key_size * data = hashindex_get(self.index, key) # <<<<<<<<<<<<<< * if not data: * raise KeyError(key) */ __pyx_t_3 = __Pyx_PyObject_AsWritableUString(__pyx_v_key); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L1_error) __pyx_v_data = ((uint32_t *)hashindex_get(__pyx_v_self->__pyx_base.index, ((unsigned char *)__pyx_t_3))); /* "borg/hashindex.pyx":340 * assert len(key) == self.key_size * data = hashindex_get(self.index, key) * if not data: # <<<<<<<<<<<<<< * raise KeyError(key) * cdef uint32_t refcount = _le32toh(data[0]) */ __pyx_t_2 = (!(__pyx_v_data != 0)); if (unlikely(__pyx_t_2)) { /* "borg/hashindex.pyx":341 * data = hashindex_get(self.index, key) * if not data: * raise KeyError(key) # <<<<<<<<<<<<<< * cdef uint32_t refcount = _le32toh(data[0]) * # Never decrease a reference count of zero */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 341, __pyx_L1_error) /* "borg/hashindex.pyx":340 * assert len(key) == self.key_size * data = hashindex_get(self.index, key) * if not data: # <<<<<<<<<<<<<< * raise KeyError(key) * cdef uint32_t refcount = _le32toh(data[0]) */ } /* "borg/hashindex.pyx":342 * if not data: * raise KeyError(key) * cdef uint32_t refcount = _le32toh(data[0]) # <<<<<<<<<<<<<< * # Never decrease a reference count of zero * assert 0 < refcount <= _MAX_VALUE, "invalid reference count" */ __pyx_v_refcount = _le32toh((__pyx_v_data[0])); /* "borg/hashindex.pyx":344 * cdef uint32_t refcount = _le32toh(data[0]) * # Never decrease a reference count of zero * assert 0 < refcount <= _MAX_VALUE, "invalid reference count" # <<<<<<<<<<<<<< * if refcount != _MAX_VALUE: * refcount -= 1 */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_2 = (0 < __pyx_v_refcount); if (__pyx_t_2) { __pyx_t_2 = (__pyx_v_refcount <= _MAX_VALUE); } if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_kp_s_invalid_reference_count, 0, 0); __PYX_ERR(0, 344, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 344, __pyx_L1_error) #endif /* "borg/hashindex.pyx":345 * # Never decrease a reference count of zero * assert 0 < refcount <= _MAX_VALUE, "invalid reference count" * if refcount != _MAX_VALUE: # <<<<<<<<<<<<<< * refcount -= 1 * data[0] = _htole32(refcount) */ __pyx_t_2 = (__pyx_v_refcount != _MAX_VALUE); if (__pyx_t_2) { /* "borg/hashindex.pyx":346 * assert 0 < refcount <= _MAX_VALUE, "invalid reference count" * if refcount != _MAX_VALUE: * refcount -= 1 # <<<<<<<<<<<<<< * data[0] = _htole32(refcount) * return refcount, _le32toh(data[1]), _le32toh(data[2]) */ __pyx_v_refcount = (__pyx_v_refcount - 1); /* "borg/hashindex.pyx":345 * # Never decrease a reference count of zero * assert 0 < refcount <= _MAX_VALUE, "invalid reference count" * if refcount != _MAX_VALUE: # <<<<<<<<<<<<<< * refcount -= 1 * data[0] = _htole32(refcount) */ } /* "borg/hashindex.pyx":347 * if refcount != _MAX_VALUE: * refcount -= 1 * data[0] = _htole32(refcount) # <<<<<<<<<<<<<< * return refcount, _le32toh(data[1]), _le32toh(data[2]) * */ (__pyx_v_data[0]) = _htole32(__pyx_v_refcount); /* "borg/hashindex.pyx":348 * refcount -= 1 * data[0] = _htole32(refcount) * return refcount, _le32toh(data[1]), _le32toh(data[2]) # <<<<<<<<<<<<<< * * def iteritems(self, marker=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_refcount); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint32_t(_le32toh((__pyx_v_data[1]))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyInt_From_uint32_t(_le32toh((__pyx_v_data[2]))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4)) __PYX_ERR(0, 348, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5)) __PYX_ERR(0, 348, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_6)) __PYX_ERR(0, 348, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; /* "borg/hashindex.pyx":336 * return refcount, _le32toh(data[1]), _le32toh(data[2]) * * def decref(self, key): # <<<<<<<<<<<<<< * """Decrease refcount for 'key', return (refcount, size, csize)""" * assert len(key) == self.key_size */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("borg.hashindex.ChunkIndex.decref", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/hashindex.pyx":350 * return refcount, _le32toh(data[1]), _le32toh(data[2]) * * def iteritems(self, marker=None): # <<<<<<<<<<<<<< * cdef const unsigned char *key * iter = ChunkKeyIterator(self.key_size) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_10ChunkIndex_11iteritems(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_9hashindex_10ChunkIndex_11iteritems = {"iteritems", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_10ChunkIndex_11iteritems, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_9hashindex_10ChunkIndex_11iteritems(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_marker = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("iteritems (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_marker,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_marker); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 350, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "iteritems") < 0)) __PYX_ERR(0, 350, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_marker = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("iteritems", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 350, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.hashindex.ChunkIndex.iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_9hashindex_10ChunkIndex_10iteritems(((struct __pyx_obj_4borg_9hashindex_ChunkIndex *)__pyx_v_self), __pyx_v_marker); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_10ChunkIndex_10iteritems(struct __pyx_obj_4borg_9hashindex_ChunkIndex *__pyx_v_self, PyObject *__pyx_v_marker) { unsigned char const *__pyx_v_key; struct __pyx_obj_4borg_9hashindex_ChunkKeyIterator *__pyx_v_iter = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; HashIndex *__pyx_t_3; int __pyx_t_4; unsigned char *__pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("iteritems", 1); /* "borg/hashindex.pyx":352 * def iteritems(self, marker=None): * cdef const unsigned char *key * iter = ChunkKeyIterator(self.key_size) # <<<<<<<<<<<<<< * iter.idx = self * iter.index = self.index */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.key_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4borg_9hashindex_ChunkKeyIterator), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_iter = ((struct __pyx_obj_4borg_9hashindex_ChunkKeyIterator *)__pyx_t_2); __pyx_t_2 = 0; /* "borg/hashindex.pyx":353 * cdef const unsigned char *key * iter = ChunkKeyIterator(self.key_size) * iter.idx = self # <<<<<<<<<<<<<< * iter.index = self.index * if marker: */ __Pyx_INCREF((PyObject *)__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_v_self); __Pyx_GOTREF((PyObject *)__pyx_v_iter->idx); __Pyx_DECREF((PyObject *)__pyx_v_iter->idx); __pyx_v_iter->idx = __pyx_v_self; /* "borg/hashindex.pyx":354 * iter = ChunkKeyIterator(self.key_size) * iter.idx = self * iter.index = self.index # <<<<<<<<<<<<<< * if marker: * key = hashindex_get(self.index, marker) */ __pyx_t_3 = __pyx_v_self->__pyx_base.index; __pyx_v_iter->index = __pyx_t_3; /* "borg/hashindex.pyx":355 * iter.idx = self * iter.index = self.index * if marker: # <<<<<<<<<<<<<< * key = hashindex_get(self.index, marker) * if marker is None: */ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_marker); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 355, __pyx_L1_error) if (__pyx_t_4) { /* "borg/hashindex.pyx":356 * iter.index = self.index * if marker: * key = hashindex_get(self.index, marker) # <<<<<<<<<<<<<< * if marker is None: * raise IndexError */ __pyx_t_5 = __Pyx_PyObject_AsWritableUString(__pyx_v_marker); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 356, __pyx_L1_error) __pyx_v_key = hashindex_get(__pyx_v_self->__pyx_base.index, ((unsigned char *)__pyx_t_5)); /* "borg/hashindex.pyx":357 * if marker: * key = hashindex_get(self.index, marker) * if marker is None: # <<<<<<<<<<<<<< * raise IndexError * iter.key = key - self.key_size */ __pyx_t_4 = (__pyx_v_marker == Py_None); if (unlikely(__pyx_t_4)) { /* "borg/hashindex.pyx":358 * key = hashindex_get(self.index, marker) * if marker is None: * raise IndexError # <<<<<<<<<<<<<< * iter.key = key - self.key_size * return iter */ __Pyx_Raise(__pyx_builtin_IndexError, 0, 0, 0); __PYX_ERR(0, 358, __pyx_L1_error) /* "borg/hashindex.pyx":357 * if marker: * key = hashindex_get(self.index, marker) * if marker is None: # <<<<<<<<<<<<<< * raise IndexError * iter.key = key - self.key_size */ } /* "borg/hashindex.pyx":359 * if marker is None: * raise IndexError * iter.key = key - self.key_size # <<<<<<<<<<<<<< * return iter * */ __pyx_v_iter->key = (__pyx_v_key - __pyx_v_self->__pyx_base.key_size); /* "borg/hashindex.pyx":355 * iter.idx = self * iter.index = self.index * if marker: # <<<<<<<<<<<<<< * key = hashindex_get(self.index, marker) * if marker is None: */ } /* "borg/hashindex.pyx":360 * raise IndexError * iter.key = key - self.key_size * return iter # <<<<<<<<<<<<<< * * def summarize(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_iter); __pyx_r = ((PyObject *)__pyx_v_iter); goto __pyx_L0; /* "borg/hashindex.pyx":350 * return refcount, _le32toh(data[1]), _le32toh(data[2]) * * def iteritems(self, marker=None): # <<<<<<<<<<<<<< * cdef const unsigned char *key * iter = ChunkKeyIterator(self.key_size) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("borg.hashindex.ChunkIndex.iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_iter); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/hashindex.pyx":362 * return iter * * def summarize(self): # <<<<<<<<<<<<<< * cdef uint64_t size = 0, csize = 0, unique_size = 0, unique_csize = 0, chunks = 0, unique_chunks = 0 * cdef uint32_t *values */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_10ChunkIndex_13summarize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_9hashindex_10ChunkIndex_13summarize = {"summarize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_10ChunkIndex_13summarize, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_9hashindex_10ChunkIndex_13summarize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("summarize (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("summarize", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "summarize", 0))) return NULL; __pyx_r = __pyx_pf_4borg_9hashindex_10ChunkIndex_12summarize(((struct __pyx_obj_4borg_9hashindex_ChunkIndex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_10ChunkIndex_12summarize(struct __pyx_obj_4borg_9hashindex_ChunkIndex *__pyx_v_self) { uint64_t __pyx_v_size; uint64_t __pyx_v_csize; uint64_t __pyx_v_unique_size; uint64_t __pyx_v_unique_csize; uint64_t __pyx_v_chunks; uint64_t __pyx_v_unique_chunks; uint32_t *__pyx_v_values; uint32_t __pyx_v_refcount; unsigned char *__pyx_v_key; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("summarize", 1); /* "borg/hashindex.pyx":363 * * def summarize(self): * cdef uint64_t size = 0, csize = 0, unique_size = 0, unique_csize = 0, chunks = 0, unique_chunks = 0 # <<<<<<<<<<<<<< * cdef uint32_t *values * cdef uint32_t refcount */ __pyx_v_size = 0; __pyx_v_csize = 0; __pyx_v_unique_size = 0; __pyx_v_unique_csize = 0; __pyx_v_chunks = 0; __pyx_v_unique_chunks = 0; /* "borg/hashindex.pyx":366 * cdef uint32_t *values * cdef uint32_t refcount * cdef unsigned char *key = NULL # <<<<<<<<<<<<<< * * while True: */ __pyx_v_key = NULL; /* "borg/hashindex.pyx":368 * cdef unsigned char *key = NULL * * while True: # <<<<<<<<<<<<<< * key = hashindex_next_key(self.index, key) * if not key: */ while (1) { /* "borg/hashindex.pyx":369 * * while True: * key = hashindex_next_key(self.index, key) # <<<<<<<<<<<<<< * if not key: * break */ __pyx_v_key = hashindex_next_key(__pyx_v_self->__pyx_base.index, __pyx_v_key); /* "borg/hashindex.pyx":370 * while True: * key = hashindex_next_key(self.index, key) * if not key: # <<<<<<<<<<<<<< * break * unique_chunks += 1 */ __pyx_t_1 = (!(__pyx_v_key != 0)); if (__pyx_t_1) { /* "borg/hashindex.pyx":371 * key = hashindex_next_key(self.index, key) * if not key: * break # <<<<<<<<<<<<<< * unique_chunks += 1 * values = (key + self.key_size) */ goto __pyx_L4_break; /* "borg/hashindex.pyx":370 * while True: * key = hashindex_next_key(self.index, key) * if not key: # <<<<<<<<<<<<<< * break * unique_chunks += 1 */ } /* "borg/hashindex.pyx":372 * if not key: * break * unique_chunks += 1 # <<<<<<<<<<<<<< * values = (key + self.key_size) * refcount = _le32toh(values[0]) */ __pyx_v_unique_chunks = (__pyx_v_unique_chunks + 1); /* "borg/hashindex.pyx":373 * break * unique_chunks += 1 * values = (key + self.key_size) # <<<<<<<<<<<<<< * refcount = _le32toh(values[0]) * assert refcount <= _MAX_VALUE, "invalid reference count" */ __pyx_v_values = ((uint32_t *)(__pyx_v_key + __pyx_v_self->__pyx_base.key_size)); /* "borg/hashindex.pyx":374 * unique_chunks += 1 * values = (key + self.key_size) * refcount = _le32toh(values[0]) # <<<<<<<<<<<<<< * assert refcount <= _MAX_VALUE, "invalid reference count" * chunks += refcount */ __pyx_v_refcount = _le32toh((__pyx_v_values[0])); /* "borg/hashindex.pyx":375 * values = (key + self.key_size) * refcount = _le32toh(values[0]) * assert refcount <= _MAX_VALUE, "invalid reference count" # <<<<<<<<<<<<<< * chunks += refcount * unique_size += _le32toh(values[1]) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = (__pyx_v_refcount <= _MAX_VALUE); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_kp_s_invalid_reference_count, 0, 0); __PYX_ERR(0, 375, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 375, __pyx_L1_error) #endif /* "borg/hashindex.pyx":376 * refcount = _le32toh(values[0]) * assert refcount <= _MAX_VALUE, "invalid reference count" * chunks += refcount # <<<<<<<<<<<<<< * unique_size += _le32toh(values[1]) * unique_csize += _le32toh(values[2]) */ __pyx_v_chunks = (__pyx_v_chunks + __pyx_v_refcount); /* "borg/hashindex.pyx":377 * assert refcount <= _MAX_VALUE, "invalid reference count" * chunks += refcount * unique_size += _le32toh(values[1]) # <<<<<<<<<<<<<< * unique_csize += _le32toh(values[2]) * size += _le32toh(values[1]) * _le32toh(values[0]) */ __pyx_v_unique_size = (__pyx_v_unique_size + _le32toh((__pyx_v_values[1]))); /* "borg/hashindex.pyx":378 * chunks += refcount * unique_size += _le32toh(values[1]) * unique_csize += _le32toh(values[2]) # <<<<<<<<<<<<<< * size += _le32toh(values[1]) * _le32toh(values[0]) * csize += _le32toh(values[2]) * _le32toh(values[0]) */ __pyx_v_unique_csize = (__pyx_v_unique_csize + _le32toh((__pyx_v_values[2]))); /* "borg/hashindex.pyx":379 * unique_size += _le32toh(values[1]) * unique_csize += _le32toh(values[2]) * size += _le32toh(values[1]) * _le32toh(values[0]) # <<<<<<<<<<<<<< * csize += _le32toh(values[2]) * _le32toh(values[0]) * */ __pyx_v_size = (__pyx_v_size + (((uint64_t)_le32toh((__pyx_v_values[1]))) * _le32toh((__pyx_v_values[0])))); /* "borg/hashindex.pyx":380 * unique_csize += _le32toh(values[2]) * size += _le32toh(values[1]) * _le32toh(values[0]) * csize += _le32toh(values[2]) * _le32toh(values[0]) # <<<<<<<<<<<<<< * * return size, csize, unique_size, unique_csize, unique_chunks, chunks */ __pyx_v_csize = (__pyx_v_csize + (((uint64_t)_le32toh((__pyx_v_values[2]))) * _le32toh((__pyx_v_values[0])))); } __pyx_L4_break:; /* "borg/hashindex.pyx":382 * csize += _le32toh(values[2]) * _le32toh(values[0]) * * return size, csize, unique_size, unique_csize, unique_chunks, chunks # <<<<<<<<<<<<<< * * def stats_against(self, ChunkIndex master_index): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_uint64_t(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint64_t(__pyx_v_csize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_uint64_t(__pyx_v_unique_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint64_t(__pyx_v_unique_csize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyInt_From_uint64_t(__pyx_v_unique_chunks); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyInt_From_uint64_t(__pyx_v_chunks); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyTuple_New(6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2)) __PYX_ERR(0, 382, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_4)) __PYX_ERR(0, 382, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_5)) __PYX_ERR(0, 382, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_t_6)) __PYX_ERR(0, 382, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 5, __pyx_t_7)) __PYX_ERR(0, 382, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L0; /* "borg/hashindex.pyx":362 * return iter * * def summarize(self): # <<<<<<<<<<<<<< * cdef uint64_t size = 0, csize = 0, unique_size = 0, unique_csize = 0, chunks = 0, unique_chunks = 0 * cdef uint32_t *values */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("borg.hashindex.ChunkIndex.summarize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/hashindex.pyx":384 * return size, csize, unique_size, unique_csize, unique_chunks, chunks * * def stats_against(self, ChunkIndex master_index): # <<<<<<<<<<<<<< * """ * Calculate chunk statistics of this index against *master_index*. */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_10ChunkIndex_15stats_against(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_9hashindex_10ChunkIndex_14stats_against, "\n Calculate chunk statistics of this index against *master_index*.\n\n A chunk is counted as unique if the number of references\n in this index matches the number of references in *master_index*.\n\n This index must be a subset of *master_index*.\n\n Return the same statistics tuple as summarize:\n size, csize, unique_size, unique_csize, unique_chunks, chunks.\n "); static PyMethodDef __pyx_mdef_4borg_9hashindex_10ChunkIndex_15stats_against = {"stats_against", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_10ChunkIndex_15stats_against, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_9hashindex_10ChunkIndex_14stats_against}; static PyObject *__pyx_pw_4borg_9hashindex_10ChunkIndex_15stats_against(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_4borg_9hashindex_ChunkIndex *__pyx_v_master_index = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stats_against (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_master_index,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_master_index)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 384, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "stats_against") < 0)) __PYX_ERR(0, 384, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_master_index = ((struct __pyx_obj_4borg_9hashindex_ChunkIndex *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("stats_against", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 384, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.hashindex.ChunkIndex.stats_against", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_master_index), __pyx_ptype_4borg_9hashindex_ChunkIndex, 1, "master_index", 0))) __PYX_ERR(0, 384, __pyx_L1_error) __pyx_r = __pyx_pf_4borg_9hashindex_10ChunkIndex_14stats_against(((struct __pyx_obj_4borg_9hashindex_ChunkIndex *)__pyx_v_self), __pyx_v_master_index); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_10ChunkIndex_14stats_against(struct __pyx_obj_4borg_9hashindex_ChunkIndex *__pyx_v_self, struct __pyx_obj_4borg_9hashindex_ChunkIndex *__pyx_v_master_index) { uint64_t __pyx_v_size; uint64_t __pyx_v_csize; uint64_t __pyx_v_unique_size; uint64_t __pyx_v_unique_csize; uint64_t __pyx_v_chunks; uint64_t __pyx_v_unique_chunks; uint32_t __pyx_v_our_refcount; uint32_t __pyx_v_chunk_size; uint32_t __pyx_v_chunk_csize; uint32_t const *__pyx_v_our_values; uint32_t const *__pyx_v_master_values; unsigned char const *__pyx_v_key; HashIndex *__pyx_v_master; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations HashIndex *__pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("stats_against", 1); /* "borg/hashindex.pyx":396 * size, csize, unique_size, unique_csize, unique_chunks, chunks. * """ * cdef uint64_t size = 0, csize = 0, unique_size = 0, unique_csize = 0, chunks = 0, unique_chunks = 0 # <<<<<<<<<<<<<< * cdef uint32_t our_refcount, chunk_size, chunk_csize * cdef const uint32_t *our_values */ __pyx_v_size = 0; __pyx_v_csize = 0; __pyx_v_unique_size = 0; __pyx_v_unique_csize = 0; __pyx_v_chunks = 0; __pyx_v_unique_chunks = 0; /* "borg/hashindex.pyx":400 * cdef const uint32_t *our_values * cdef const uint32_t *master_values * cdef const unsigned char *key = NULL # <<<<<<<<<<<<<< * cdef HashIndex *master = master_index.index * */ __pyx_v_key = NULL; /* "borg/hashindex.pyx":401 * cdef const uint32_t *master_values * cdef const unsigned char *key = NULL * cdef HashIndex *master = master_index.index # <<<<<<<<<<<<<< * * while True: */ __pyx_t_1 = __pyx_v_master_index->__pyx_base.index; __pyx_v_master = __pyx_t_1; /* "borg/hashindex.pyx":403 * cdef HashIndex *master = master_index.index * * while True: # <<<<<<<<<<<<<< * key = hashindex_next_key(self.index, key) * if not key: */ while (1) { /* "borg/hashindex.pyx":404 * * while True: * key = hashindex_next_key(self.index, key) # <<<<<<<<<<<<<< * if not key: * break */ __pyx_v_key = hashindex_next_key(__pyx_v_self->__pyx_base.index, __pyx_v_key); /* "borg/hashindex.pyx":405 * while True: * key = hashindex_next_key(self.index, key) * if not key: # <<<<<<<<<<<<<< * break * our_values = (key + self.key_size) */ __pyx_t_2 = (!(__pyx_v_key != 0)); if (__pyx_t_2) { /* "borg/hashindex.pyx":406 * key = hashindex_next_key(self.index, key) * if not key: * break # <<<<<<<<<<<<<< * our_values = (key + self.key_size) * master_values = hashindex_get(master, key) */ goto __pyx_L4_break; /* "borg/hashindex.pyx":405 * while True: * key = hashindex_next_key(self.index, key) * if not key: # <<<<<<<<<<<<<< * break * our_values = (key + self.key_size) */ } /* "borg/hashindex.pyx":407 * if not key: * break * our_values = (key + self.key_size) # <<<<<<<<<<<<<< * master_values = hashindex_get(master, key) * if not master_values: */ __pyx_v_our_values = ((uint32_t const *)(__pyx_v_key + __pyx_v_self->__pyx_base.key_size)); /* "borg/hashindex.pyx":408 * break * our_values = (key + self.key_size) * master_values = hashindex_get(master, key) # <<<<<<<<<<<<<< * if not master_values: * raise ValueError('stats_against: key contained in self but not in master_index.') */ __pyx_v_master_values = ((uint32_t const *)hashindex_get(__pyx_v_master, __pyx_v_key)); /* "borg/hashindex.pyx":409 * our_values = (key + self.key_size) * master_values = hashindex_get(master, key) * if not master_values: # <<<<<<<<<<<<<< * raise ValueError('stats_against: key contained in self but not in master_index.') * our_refcount = _le32toh(our_values[0]) */ __pyx_t_2 = (!(__pyx_v_master_values != 0)); if (unlikely(__pyx_t_2)) { /* "borg/hashindex.pyx":410 * master_values = hashindex_get(master, key) * if not master_values: * raise ValueError('stats_against: key contained in self but not in master_index.') # <<<<<<<<<<<<<< * our_refcount = _le32toh(our_values[0]) * chunk_size = _le32toh(master_values[1]) */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 410, __pyx_L1_error) /* "borg/hashindex.pyx":409 * our_values = (key + self.key_size) * master_values = hashindex_get(master, key) * if not master_values: # <<<<<<<<<<<<<< * raise ValueError('stats_against: key contained in self but not in master_index.') * our_refcount = _le32toh(our_values[0]) */ } /* "borg/hashindex.pyx":411 * if not master_values: * raise ValueError('stats_against: key contained in self but not in master_index.') * our_refcount = _le32toh(our_values[0]) # <<<<<<<<<<<<<< * chunk_size = _le32toh(master_values[1]) * chunk_csize = _le32toh(master_values[2]) */ __pyx_v_our_refcount = _le32toh((__pyx_v_our_values[0])); /* "borg/hashindex.pyx":412 * raise ValueError('stats_against: key contained in self but not in master_index.') * our_refcount = _le32toh(our_values[0]) * chunk_size = _le32toh(master_values[1]) # <<<<<<<<<<<<<< * chunk_csize = _le32toh(master_values[2]) * */ __pyx_v_chunk_size = _le32toh((__pyx_v_master_values[1])); /* "borg/hashindex.pyx":413 * our_refcount = _le32toh(our_values[0]) * chunk_size = _le32toh(master_values[1]) * chunk_csize = _le32toh(master_values[2]) # <<<<<<<<<<<<<< * * chunks += our_refcount */ __pyx_v_chunk_csize = _le32toh((__pyx_v_master_values[2])); /* "borg/hashindex.pyx":415 * chunk_csize = _le32toh(master_values[2]) * * chunks += our_refcount # <<<<<<<<<<<<<< * size += chunk_size * our_refcount * csize += chunk_csize * our_refcount */ __pyx_v_chunks = (__pyx_v_chunks + __pyx_v_our_refcount); /* "borg/hashindex.pyx":416 * * chunks += our_refcount * size += chunk_size * our_refcount # <<<<<<<<<<<<<< * csize += chunk_csize * our_refcount * if our_values[0] == master_values[0]: */ __pyx_v_size = (__pyx_v_size + (((uint64_t)__pyx_v_chunk_size) * __pyx_v_our_refcount)); /* "borg/hashindex.pyx":417 * chunks += our_refcount * size += chunk_size * our_refcount * csize += chunk_csize * our_refcount # <<<<<<<<<<<<<< * if our_values[0] == master_values[0]: * # our refcount equals the master's refcount, so this chunk is unique to us */ __pyx_v_csize = (__pyx_v_csize + (((uint64_t)__pyx_v_chunk_csize) * __pyx_v_our_refcount)); /* "borg/hashindex.pyx":418 * size += chunk_size * our_refcount * csize += chunk_csize * our_refcount * if our_values[0] == master_values[0]: # <<<<<<<<<<<<<< * # our refcount equals the master's refcount, so this chunk is unique to us * unique_chunks += 1 */ __pyx_t_2 = ((__pyx_v_our_values[0]) == (__pyx_v_master_values[0])); if (__pyx_t_2) { /* "borg/hashindex.pyx":420 * if our_values[0] == master_values[0]: * # our refcount equals the master's refcount, so this chunk is unique to us * unique_chunks += 1 # <<<<<<<<<<<<<< * unique_size += chunk_size * unique_csize += chunk_csize */ __pyx_v_unique_chunks = (__pyx_v_unique_chunks + 1); /* "borg/hashindex.pyx":421 * # our refcount equals the master's refcount, so this chunk is unique to us * unique_chunks += 1 * unique_size += chunk_size # <<<<<<<<<<<<<< * unique_csize += chunk_csize * */ __pyx_v_unique_size = (__pyx_v_unique_size + __pyx_v_chunk_size); /* "borg/hashindex.pyx":422 * unique_chunks += 1 * unique_size += chunk_size * unique_csize += chunk_csize # <<<<<<<<<<<<<< * * return size, csize, unique_size, unique_csize, unique_chunks, chunks */ __pyx_v_unique_csize = (__pyx_v_unique_csize + __pyx_v_chunk_csize); /* "borg/hashindex.pyx":418 * size += chunk_size * our_refcount * csize += chunk_csize * our_refcount * if our_values[0] == master_values[0]: # <<<<<<<<<<<<<< * # our refcount equals the master's refcount, so this chunk is unique to us * unique_chunks += 1 */ } } __pyx_L4_break:; /* "borg/hashindex.pyx":424 * unique_csize += chunk_csize * * return size, csize, unique_size, unique_csize, unique_chunks, chunks # <<<<<<<<<<<<<< * * def add(self, key, refs, size, csize): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_uint64_t(__pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_uint64_t(__pyx_v_csize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint64_t(__pyx_v_unique_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyInt_From_uint64_t(__pyx_v_unique_csize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyInt_From_uint64_t(__pyx_v_unique_chunks); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyInt_From_uint64_t(__pyx_v_chunks); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PyTuple_New(6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3)) __PYX_ERR(0, 424, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_4)) __PYX_ERR(0, 424, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_5)) __PYX_ERR(0, 424, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_6)) __PYX_ERR(0, 424, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_t_7)) __PYX_ERR(0, 424, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_t_8)) __PYX_ERR(0, 424, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_r = __pyx_t_9; __pyx_t_9 = 0; goto __pyx_L0; /* "borg/hashindex.pyx":384 * return size, csize, unique_size, unique_csize, unique_chunks, chunks * * def stats_against(self, ChunkIndex master_index): # <<<<<<<<<<<<<< * """ * Calculate chunk statistics of this index against *master_index*. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("borg.hashindex.ChunkIndex.stats_against", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/hashindex.pyx":426 * return size, csize, unique_size, unique_csize, unique_chunks, chunks * * def add(self, key, refs, size, csize): # <<<<<<<<<<<<<< * assert len(key) == self.key_size * cdef uint32_t[3] data */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_10ChunkIndex_17add(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_9hashindex_10ChunkIndex_17add = {"add", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_10ChunkIndex_17add, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_9hashindex_10ChunkIndex_17add(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_key = 0; PyObject *__pyx_v_refs = 0; PyObject *__pyx_v_size = 0; PyObject *__pyx_v_csize = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("add (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_refs,&__pyx_n_s_size,&__pyx_n_s_csize,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_key)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 426, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_refs)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 426, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("add", 1, 4, 4, 1); __PYX_ERR(0, 426, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 426, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("add", 1, 4, 4, 2); __PYX_ERR(0, 426, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_csize)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 426, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("add", 1, 4, 4, 3); __PYX_ERR(0, 426, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "add") < 0)) __PYX_ERR(0, 426, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); } __pyx_v_key = values[0]; __pyx_v_refs = values[1]; __pyx_v_size = values[2]; __pyx_v_csize = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("add", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 426, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.hashindex.ChunkIndex.add", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_9hashindex_10ChunkIndex_16add(((struct __pyx_obj_4borg_9hashindex_ChunkIndex *)__pyx_v_self), __pyx_v_key, __pyx_v_refs, __pyx_v_size, __pyx_v_csize); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_10ChunkIndex_16add(struct __pyx_obj_4borg_9hashindex_ChunkIndex *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_refs, PyObject *__pyx_v_size, PyObject *__pyx_v_csize) { uint32_t __pyx_v_data[3]; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; uint32_t __pyx_t_3; unsigned char *__pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add", 1); /* "borg/hashindex.pyx":427 * * def add(self, key, refs, size, csize): * assert len(key) == self.key_size # <<<<<<<<<<<<<< * cdef uint32_t[3] data * data[0] = _htole32(refs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = PyObject_Length(__pyx_v_key); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 427, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 == __pyx_v_self->__pyx_base.key_size); if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 427, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 427, __pyx_L1_error) #endif /* "borg/hashindex.pyx":429 * assert len(key) == self.key_size * cdef uint32_t[3] data * data[0] = _htole32(refs) # <<<<<<<<<<<<<< * data[1] = _htole32(size) * data[2] = _htole32(csize) */ __pyx_t_3 = __Pyx_PyInt_As_uint32_t(__pyx_v_refs); if (unlikely((__pyx_t_3 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L1_error) (__pyx_v_data[0]) = _htole32(__pyx_t_3); /* "borg/hashindex.pyx":430 * cdef uint32_t[3] data * data[0] = _htole32(refs) * data[1] = _htole32(size) # <<<<<<<<<<<<<< * data[2] = _htole32(csize) * self._add( key, data) */ __pyx_t_3 = __Pyx_PyInt_As_uint32_t(__pyx_v_size); if (unlikely((__pyx_t_3 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 430, __pyx_L1_error) (__pyx_v_data[1]) = _htole32(__pyx_t_3); /* "borg/hashindex.pyx":431 * data[0] = _htole32(refs) * data[1] = _htole32(size) * data[2] = _htole32(csize) # <<<<<<<<<<<<<< * self._add( key, data) * */ __pyx_t_3 = __Pyx_PyInt_As_uint32_t(__pyx_v_csize); if (unlikely((__pyx_t_3 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 431, __pyx_L1_error) (__pyx_v_data[2]) = _htole32(__pyx_t_3); /* "borg/hashindex.pyx":432 * data[1] = _htole32(size) * data[2] = _htole32(csize) * self._add( key, data) # <<<<<<<<<<<<<< * * cdef _add(self, unsigned char *key, uint32_t *data): */ __pyx_t_4 = __Pyx_PyObject_AsWritableUString(__pyx_v_key); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 432, __pyx_L1_error) __pyx_t_5 = ((struct __pyx_vtabstruct_4borg_9hashindex_ChunkIndex *)__pyx_v_self->__pyx_vtab)->_add(__pyx_v_self, ((unsigned char *)__pyx_t_4), __pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/hashindex.pyx":426 * return size, csize, unique_size, unique_csize, unique_chunks, chunks * * def add(self, key, refs, size, csize): # <<<<<<<<<<<<<< * assert len(key) == self.key_size * cdef uint32_t[3] data */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("borg.hashindex.ChunkIndex.add", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/hashindex.pyx":434 * self._add( key, data) * * cdef _add(self, unsigned char *key, uint32_t *data): # <<<<<<<<<<<<<< * cdef uint64_t refcount1, refcount2, result64 * values = hashindex_get(self.index, key) */ static PyObject *__pyx_f_4borg_9hashindex_10ChunkIndex__add(struct __pyx_obj_4borg_9hashindex_ChunkIndex *__pyx_v_self, unsigned char *__pyx_v_key, uint32_t *__pyx_v_data) { uint64_t __pyx_v_refcount1; uint64_t __pyx_v_refcount2; uint64_t __pyx_v_result64; uint32_t *__pyx_v_values; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; uint32_t __pyx_t_2; uint64_t __pyx_t_3; uint64_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_add", 1); /* "borg/hashindex.pyx":436 * cdef _add(self, unsigned char *key, uint32_t *data): * cdef uint64_t refcount1, refcount2, result64 * values = hashindex_get(self.index, key) # <<<<<<<<<<<<<< * if values: * refcount1 = _le32toh(values[0]) */ __pyx_v_values = ((uint32_t *)hashindex_get(__pyx_v_self->__pyx_base.index, __pyx_v_key)); /* "borg/hashindex.pyx":437 * cdef uint64_t refcount1, refcount2, result64 * values = hashindex_get(self.index, key) * if values: # <<<<<<<<<<<<<< * refcount1 = _le32toh(values[0]) * refcount2 = _le32toh(data[0]) */ __pyx_t_1 = (__pyx_v_values != 0); if (__pyx_t_1) { /* "borg/hashindex.pyx":438 * values = hashindex_get(self.index, key) * if values: * refcount1 = _le32toh(values[0]) # <<<<<<<<<<<<<< * refcount2 = _le32toh(data[0]) * assert refcount1 <= _MAX_VALUE, "invalid reference count" */ __pyx_v_refcount1 = _le32toh((__pyx_v_values[0])); /* "borg/hashindex.pyx":439 * if values: * refcount1 = _le32toh(values[0]) * refcount2 = _le32toh(data[0]) # <<<<<<<<<<<<<< * assert refcount1 <= _MAX_VALUE, "invalid reference count" * assert refcount2 <= _MAX_VALUE, "invalid reference count" */ __pyx_v_refcount2 = _le32toh((__pyx_v_data[0])); /* "borg/hashindex.pyx":440 * refcount1 = _le32toh(values[0]) * refcount2 = _le32toh(data[0]) * assert refcount1 <= _MAX_VALUE, "invalid reference count" # <<<<<<<<<<<<<< * assert refcount2 <= _MAX_VALUE, "invalid reference count" * result64 = refcount1 + refcount2 */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = (__pyx_v_refcount1 <= _MAX_VALUE); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_kp_s_invalid_reference_count, 0, 0); __PYX_ERR(0, 440, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 440, __pyx_L1_error) #endif /* "borg/hashindex.pyx":441 * refcount2 = _le32toh(data[0]) * assert refcount1 <= _MAX_VALUE, "invalid reference count" * assert refcount2 <= _MAX_VALUE, "invalid reference count" # <<<<<<<<<<<<<< * result64 = refcount1 + refcount2 * values[0] = _htole32(min(result64, _MAX_VALUE)) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = (__pyx_v_refcount2 <= _MAX_VALUE); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_kp_s_invalid_reference_count, 0, 0); __PYX_ERR(0, 441, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 441, __pyx_L1_error) #endif /* "borg/hashindex.pyx":442 * assert refcount1 <= _MAX_VALUE, "invalid reference count" * assert refcount2 <= _MAX_VALUE, "invalid reference count" * result64 = refcount1 + refcount2 # <<<<<<<<<<<<<< * values[0] = _htole32(min(result64, _MAX_VALUE)) * values[1] = data[1] */ __pyx_v_result64 = (__pyx_v_refcount1 + __pyx_v_refcount2); /* "borg/hashindex.pyx":443 * assert refcount2 <= _MAX_VALUE, "invalid reference count" * result64 = refcount1 + refcount2 * values[0] = _htole32(min(result64, _MAX_VALUE)) # <<<<<<<<<<<<<< * values[1] = data[1] * values[2] = data[2] */ __pyx_t_2 = _MAX_VALUE; __pyx_t_3 = __pyx_v_result64; __pyx_t_1 = (__pyx_t_2 < __pyx_t_3); if (__pyx_t_1) { __pyx_t_4 = __pyx_t_2; } else { __pyx_t_4 = __pyx_t_3; } (__pyx_v_values[0]) = _htole32(__pyx_t_4); /* "borg/hashindex.pyx":444 * result64 = refcount1 + refcount2 * values[0] = _htole32(min(result64, _MAX_VALUE)) * values[1] = data[1] # <<<<<<<<<<<<<< * values[2] = data[2] * else: */ (__pyx_v_values[1]) = (__pyx_v_data[1]); /* "borg/hashindex.pyx":445 * values[0] = _htole32(min(result64, _MAX_VALUE)) * values[1] = data[1] * values[2] = data[2] # <<<<<<<<<<<<<< * else: * if not hashindex_set(self.index, key, data): */ (__pyx_v_values[2]) = (__pyx_v_data[2]); /* "borg/hashindex.pyx":437 * cdef uint64_t refcount1, refcount2, result64 * values = hashindex_get(self.index, key) * if values: # <<<<<<<<<<<<<< * refcount1 = _le32toh(values[0]) * refcount2 = _le32toh(data[0]) */ goto __pyx_L3; } /* "borg/hashindex.pyx":447 * values[2] = data[2] * else: * if not hashindex_set(self.index, key, data): # <<<<<<<<<<<<<< * raise Exception('hashindex_set failed') * */ /*else*/ { __pyx_t_1 = (!(hashindex_set(__pyx_v_self->__pyx_base.index, __pyx_v_key, __pyx_v_data) != 0)); if (unlikely(__pyx_t_1)) { /* "borg/hashindex.pyx":448 * else: * if not hashindex_set(self.index, key, data): * raise Exception('hashindex_set failed') # <<<<<<<<<<<<<< * * def merge(self, ChunkIndex other): */ __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(0, 448, __pyx_L1_error) /* "borg/hashindex.pyx":447 * values[2] = data[2] * else: * if not hashindex_set(self.index, key, data): # <<<<<<<<<<<<<< * raise Exception('hashindex_set failed') * */ } } __pyx_L3:; /* "borg/hashindex.pyx":434 * self._add( key, data) * * cdef _add(self, unsigned char *key, uint32_t *data): # <<<<<<<<<<<<<< * cdef uint64_t refcount1, refcount2, result64 * values = hashindex_get(self.index, key) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("borg.hashindex.ChunkIndex._add", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/hashindex.pyx":450 * raise Exception('hashindex_set failed') * * def merge(self, ChunkIndex other): # <<<<<<<<<<<<<< * cdef unsigned char *key = NULL * */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_10ChunkIndex_19merge(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_9hashindex_10ChunkIndex_19merge = {"merge", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_10ChunkIndex_19merge, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_9hashindex_10ChunkIndex_19merge(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_4borg_9hashindex_ChunkIndex *__pyx_v_other = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("merge (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_other)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 450, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "merge") < 0)) __PYX_ERR(0, 450, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_other = ((struct __pyx_obj_4borg_9hashindex_ChunkIndex *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("merge", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 450, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.hashindex.ChunkIndex.merge", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_4borg_9hashindex_ChunkIndex, 1, "other", 0))) __PYX_ERR(0, 450, __pyx_L1_error) __pyx_r = __pyx_pf_4borg_9hashindex_10ChunkIndex_18merge(((struct __pyx_obj_4borg_9hashindex_ChunkIndex *)__pyx_v_self), __pyx_v_other); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_10ChunkIndex_18merge(struct __pyx_obj_4borg_9hashindex_ChunkIndex *__pyx_v_self, struct __pyx_obj_4borg_9hashindex_ChunkIndex *__pyx_v_other) { unsigned char *__pyx_v_key; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("merge", 1); /* "borg/hashindex.pyx":451 * * def merge(self, ChunkIndex other): * cdef unsigned char *key = NULL # <<<<<<<<<<<<<< * * while True: */ __pyx_v_key = NULL; /* "borg/hashindex.pyx":453 * cdef unsigned char *key = NULL * * while True: # <<<<<<<<<<<<<< * key = hashindex_next_key(other.index, key) * if not key: */ while (1) { /* "borg/hashindex.pyx":454 * * while True: * key = hashindex_next_key(other.index, key) # <<<<<<<<<<<<<< * if not key: * break */ __pyx_v_key = hashindex_next_key(__pyx_v_other->__pyx_base.index, __pyx_v_key); /* "borg/hashindex.pyx":455 * while True: * key = hashindex_next_key(other.index, key) * if not key: # <<<<<<<<<<<<<< * break * self._add(key, (key + self.key_size)) */ __pyx_t_1 = (!(__pyx_v_key != 0)); if (__pyx_t_1) { /* "borg/hashindex.pyx":456 * key = hashindex_next_key(other.index, key) * if not key: * break # <<<<<<<<<<<<<< * self._add(key, (key + self.key_size)) * */ goto __pyx_L4_break; /* "borg/hashindex.pyx":455 * while True: * key = hashindex_next_key(other.index, key) * if not key: # <<<<<<<<<<<<<< * break * self._add(key, (key + self.key_size)) */ } /* "borg/hashindex.pyx":457 * if not key: * break * self._add(key, (key + self.key_size)) # <<<<<<<<<<<<<< * * def zero_csize_ids(self): */ __pyx_t_2 = ((struct __pyx_vtabstruct_4borg_9hashindex_ChunkIndex *)__pyx_v_self->__pyx_vtab)->_add(__pyx_v_self, __pyx_v_key, ((uint32_t *)(__pyx_v_key + __pyx_v_self->__pyx_base.key_size))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L4_break:; /* "borg/hashindex.pyx":450 * raise Exception('hashindex_set failed') * * def merge(self, ChunkIndex other): # <<<<<<<<<<<<<< * cdef unsigned char *key = NULL * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("borg.hashindex.ChunkIndex.merge", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/hashindex.pyx":459 * self._add(key, (key + self.key_size)) * * def zero_csize_ids(self): # <<<<<<<<<<<<<< * cdef unsigned char *key = NULL * cdef uint32_t *values */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_10ChunkIndex_21zero_csize_ids(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_9hashindex_10ChunkIndex_21zero_csize_ids = {"zero_csize_ids", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_10ChunkIndex_21zero_csize_ids, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_9hashindex_10ChunkIndex_21zero_csize_ids(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("zero_csize_ids (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("zero_csize_ids", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "zero_csize_ids", 0))) return NULL; __pyx_r = __pyx_pf_4borg_9hashindex_10ChunkIndex_20zero_csize_ids(((struct __pyx_obj_4borg_9hashindex_ChunkIndex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_10ChunkIndex_20zero_csize_ids(struct __pyx_obj_4borg_9hashindex_ChunkIndex *__pyx_v_self) { unsigned char *__pyx_v_key; uint32_t *__pyx_v_values; PyObject *__pyx_v_entries = NULL; uint32_t __pyx_v_refcount; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("zero_csize_ids", 1); /* "borg/hashindex.pyx":460 * * def zero_csize_ids(self): * cdef unsigned char *key = NULL # <<<<<<<<<<<<<< * cdef uint32_t *values * entries = [] */ __pyx_v_key = NULL; /* "borg/hashindex.pyx":462 * cdef unsigned char *key = NULL * cdef uint32_t *values * entries = [] # <<<<<<<<<<<<<< * while True: * key = hashindex_next_key(self.index, key) */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_entries = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "borg/hashindex.pyx":463 * cdef uint32_t *values * entries = [] * while True: # <<<<<<<<<<<<<< * key = hashindex_next_key(self.index, key) * if not key: */ while (1) { /* "borg/hashindex.pyx":464 * entries = [] * while True: * key = hashindex_next_key(self.index, key) # <<<<<<<<<<<<<< * if not key: * break */ __pyx_v_key = hashindex_next_key(__pyx_v_self->__pyx_base.index, __pyx_v_key); /* "borg/hashindex.pyx":465 * while True: * key = hashindex_next_key(self.index, key) * if not key: # <<<<<<<<<<<<<< * break * values = (key + self.key_size) */ __pyx_t_2 = (!(__pyx_v_key != 0)); if (__pyx_t_2) { /* "borg/hashindex.pyx":466 * key = hashindex_next_key(self.index, key) * if not key: * break # <<<<<<<<<<<<<< * values = (key + self.key_size) * refcount = _le32toh(values[0]) */ goto __pyx_L4_break; /* "borg/hashindex.pyx":465 * while True: * key = hashindex_next_key(self.index, key) * if not key: # <<<<<<<<<<<<<< * break * values = (key + self.key_size) */ } /* "borg/hashindex.pyx":467 * if not key: * break * values = (key + self.key_size) # <<<<<<<<<<<<<< * refcount = _le32toh(values[0]) * assert refcount <= _MAX_VALUE, "invalid reference count" */ __pyx_v_values = ((uint32_t *)(__pyx_v_key + __pyx_v_self->__pyx_base.key_size)); /* "borg/hashindex.pyx":468 * break * values = (key + self.key_size) * refcount = _le32toh(values[0]) # <<<<<<<<<<<<<< * assert refcount <= _MAX_VALUE, "invalid reference count" * if _le32toh(values[2]) == 0: */ __pyx_v_refcount = _le32toh((__pyx_v_values[0])); /* "borg/hashindex.pyx":469 * values = (key + self.key_size) * refcount = _le32toh(values[0]) * assert refcount <= _MAX_VALUE, "invalid reference count" # <<<<<<<<<<<<<< * if _le32toh(values[2]) == 0: * # csize == 0 */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_2 = (__pyx_v_refcount <= _MAX_VALUE); if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_kp_s_invalid_reference_count, 0, 0); __PYX_ERR(0, 469, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 469, __pyx_L1_error) #endif /* "borg/hashindex.pyx":470 * refcount = _le32toh(values[0]) * assert refcount <= _MAX_VALUE, "invalid reference count" * if _le32toh(values[2]) == 0: # <<<<<<<<<<<<<< * # csize == 0 * entries.append(PyBytes_FromStringAndSize( key, self.key_size)) */ __pyx_t_2 = (_le32toh((__pyx_v_values[2])) == 0); if (__pyx_t_2) { /* "borg/hashindex.pyx":472 * if _le32toh(values[2]) == 0: * # csize == 0 * entries.append(PyBytes_FromStringAndSize( key, self.key_size)) # <<<<<<<<<<<<<< * return entries * */ __pyx_t_1 = PyBytes_FromStringAndSize(((char *)__pyx_v_key), __pyx_v_self->__pyx_base.key_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_entries, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 472, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/hashindex.pyx":470 * refcount = _le32toh(values[0]) * assert refcount <= _MAX_VALUE, "invalid reference count" * if _le32toh(values[2]) == 0: # <<<<<<<<<<<<<< * # csize == 0 * entries.append(PyBytes_FromStringAndSize( key, self.key_size)) */ } } __pyx_L4_break:; /* "borg/hashindex.pyx":473 * # csize == 0 * entries.append(PyBytes_FromStringAndSize( key, self.key_size)) * return entries # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_entries); __pyx_r = __pyx_v_entries; goto __pyx_L0; /* "borg/hashindex.pyx":459 * self._add(key, (key + self.key_size)) * * def zero_csize_ids(self): # <<<<<<<<<<<<<< * cdef unsigned char *key = NULL * cdef uint32_t *values */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("borg.hashindex.ChunkIndex.zero_csize_ids", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_entries); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_10ChunkIndex_23__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_9hashindex_10ChunkIndex_23__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_10ChunkIndex_23__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_9hashindex_10ChunkIndex_23__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_4borg_9hashindex_10ChunkIndex_22__reduce_cython__(((struct __pyx_obj_4borg_9hashindex_ChunkIndex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_10ChunkIndex_22__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_9hashindex_ChunkIndex *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.hashindex.ChunkIndex.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_10ChunkIndex_25__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_9hashindex_10ChunkIndex_25__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_10ChunkIndex_25__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_9hashindex_10ChunkIndex_25__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.hashindex.ChunkIndex.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_9hashindex_10ChunkIndex_24__setstate_cython__(((struct __pyx_obj_4borg_9hashindex_ChunkIndex *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_10ChunkIndex_24__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_9hashindex_ChunkIndex *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.hashindex.ChunkIndex.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/hashindex.pyx":483 * cdef int exhausted * * def __cinit__(self, key_size): # <<<<<<<<<<<<<< * self.key = NULL * self.key_size = key_size */ /* Python wrapper */ static int __pyx_pw_4borg_9hashindex_16ChunkKeyIterator_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_4borg_9hashindex_16ChunkKeyIterator_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_key_size = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key_size_2,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_key_size_2)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 483, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(0, 483, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); } __pyx_v_key_size = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 483, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.hashindex.ChunkKeyIterator.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_9hashindex_16ChunkKeyIterator___cinit__(((struct __pyx_obj_4borg_9hashindex_ChunkKeyIterator *)__pyx_v_self), __pyx_v_key_size); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_4borg_9hashindex_16ChunkKeyIterator___cinit__(struct __pyx_obj_4borg_9hashindex_ChunkKeyIterator *__pyx_v_self, PyObject *__pyx_v_key_size) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "borg/hashindex.pyx":484 * * def __cinit__(self, key_size): * self.key = NULL # <<<<<<<<<<<<<< * self.key_size = key_size * self.exhausted = 0 */ __pyx_v_self->key = NULL; /* "borg/hashindex.pyx":485 * def __cinit__(self, key_size): * self.key = NULL * self.key_size = key_size # <<<<<<<<<<<<<< * self.exhausted = 0 * */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_key_size); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 485, __pyx_L1_error) __pyx_v_self->key_size = __pyx_t_1; /* "borg/hashindex.pyx":486 * self.key = NULL * self.key_size = key_size * self.exhausted = 0 # <<<<<<<<<<<<<< * * def __iter__(self): */ __pyx_v_self->exhausted = 0; /* "borg/hashindex.pyx":483 * cdef int exhausted * * def __cinit__(self, key_size): # <<<<<<<<<<<<<< * self.key = NULL * self.key_size = key_size */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("borg.hashindex.ChunkKeyIterator.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "borg/hashindex.pyx":488 * self.exhausted = 0 * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_16ChunkKeyIterator_3__iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4borg_9hashindex_16ChunkKeyIterator_3__iter__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_4borg_9hashindex_16ChunkKeyIterator_2__iter__(((struct __pyx_obj_4borg_9hashindex_ChunkKeyIterator *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_16ChunkKeyIterator_2__iter__(struct __pyx_obj_4borg_9hashindex_ChunkKeyIterator *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__", 1); /* "borg/hashindex.pyx":489 * * def __iter__(self): * return self # <<<<<<<<<<<<<< * * def __next__(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "borg/hashindex.pyx":488 * self.exhausted = 0 * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/hashindex.pyx":491 * return self * * def __next__(self): # <<<<<<<<<<<<<< * if self.exhausted: * raise StopIteration */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_16ChunkKeyIterator_5__next__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4borg_9hashindex_16ChunkKeyIterator_5__next__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_4borg_9hashindex_16ChunkKeyIterator_4__next__(((struct __pyx_obj_4borg_9hashindex_ChunkKeyIterator *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_16ChunkKeyIterator_4__next__(struct __pyx_obj_4borg_9hashindex_ChunkKeyIterator *__pyx_v_self) { uint32_t *__pyx_v_value; uint32_t __pyx_v_refcount; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_error_without_exception = 0; /* StopIteration */ int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__next__", 1); /* "borg/hashindex.pyx":492 * * def __next__(self): * if self.exhausted: # <<<<<<<<<<<<<< * raise StopIteration * self.key = hashindex_next_key(self.index, self.key) */ __pyx_t_1 = (__pyx_v_self->exhausted != 0); if (unlikely(__pyx_t_1)) { /* "borg/hashindex.pyx":493 * def __next__(self): * if self.exhausted: * raise StopIteration # <<<<<<<<<<<<<< * self.key = hashindex_next_key(self.index, self.key) * if not self.key: */ __pyx_error_without_exception = 1; goto __pyx_L1_error;; /* "borg/hashindex.pyx":492 * * def __next__(self): * if self.exhausted: # <<<<<<<<<<<<<< * raise StopIteration * self.key = hashindex_next_key(self.index, self.key) */ } /* "borg/hashindex.pyx":494 * if self.exhausted: * raise StopIteration * self.key = hashindex_next_key(self.index, self.key) # <<<<<<<<<<<<<< * if not self.key: * self.exhausted = 1 */ __pyx_v_self->key = hashindex_next_key(__pyx_v_self->index, ((unsigned char *)__pyx_v_self->key)); /* "borg/hashindex.pyx":495 * raise StopIteration * self.key = hashindex_next_key(self.index, self.key) * if not self.key: # <<<<<<<<<<<<<< * self.exhausted = 1 * raise StopIteration */ __pyx_t_1 = (!(__pyx_v_self->key != 0)); if (unlikely(__pyx_t_1)) { /* "borg/hashindex.pyx":496 * self.key = hashindex_next_key(self.index, self.key) * if not self.key: * self.exhausted = 1 # <<<<<<<<<<<<<< * raise StopIteration * cdef uint32_t *value = (self.key + self.key_size) */ __pyx_v_self->exhausted = 1; /* "borg/hashindex.pyx":497 * if not self.key: * self.exhausted = 1 * raise StopIteration # <<<<<<<<<<<<<< * cdef uint32_t *value = (self.key + self.key_size) * cdef uint32_t refcount = _le32toh(value[0]) */ __pyx_error_without_exception = 1; goto __pyx_L1_error;; /* "borg/hashindex.pyx":495 * raise StopIteration * self.key = hashindex_next_key(self.index, self.key) * if not self.key: # <<<<<<<<<<<<<< * self.exhausted = 1 * raise StopIteration */ } /* "borg/hashindex.pyx":498 * self.exhausted = 1 * raise StopIteration * cdef uint32_t *value = (self.key + self.key_size) # <<<<<<<<<<<<<< * cdef uint32_t refcount = _le32toh(value[0]) * assert refcount <= _MAX_VALUE, "invalid reference count" */ __pyx_v_value = ((uint32_t *)(__pyx_v_self->key + __pyx_v_self->key_size)); /* "borg/hashindex.pyx":499 * raise StopIteration * cdef uint32_t *value = (self.key + self.key_size) * cdef uint32_t refcount = _le32toh(value[0]) # <<<<<<<<<<<<<< * assert refcount <= _MAX_VALUE, "invalid reference count" * return (self.key)[:self.key_size], ChunkIndexEntry(refcount, _le32toh(value[1]), _le32toh(value[2])) */ __pyx_v_refcount = _le32toh((__pyx_v_value[0])); /* "borg/hashindex.pyx":500 * cdef uint32_t *value = (self.key + self.key_size) * cdef uint32_t refcount = _le32toh(value[0]) * assert refcount <= _MAX_VALUE, "invalid reference count" # <<<<<<<<<<<<<< * return (self.key)[:self.key_size], ChunkIndexEntry(refcount, _le32toh(value[1]), _le32toh(value[2])) * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = (__pyx_v_refcount <= _MAX_VALUE); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_kp_s_invalid_reference_count, 0, 0); __PYX_ERR(0, 500, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 500, __pyx_L1_error) #endif /* "borg/hashindex.pyx":501 * cdef uint32_t refcount = _le32toh(value[0]) * assert refcount <= _MAX_VALUE, "invalid reference count" * return (self.key)[:self.key_size], ChunkIndexEntry(refcount, _le32toh(value[1]), _le32toh(value[2])) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(((char *)__pyx_v_self->key) + 0, __pyx_v_self->key_size - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ChunkIndexEntry); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_refcount); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyInt_From_uint32_t(_le32toh((__pyx_v_value[1]))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyInt_From_uint32_t(_le32toh((__pyx_v_value[2]))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_8, __pyx_t_5, __pyx_t_6, __pyx_t_7}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 3+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 501, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 501, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "borg/hashindex.pyx":491 * return self * * def __next__(self): # <<<<<<<<<<<<<< * if self.exhausted: * raise StopIteration */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); if (!__pyx_error_without_exception) { __Pyx_AddTraceback("borg.hashindex.ChunkKeyIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); } __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_16ChunkKeyIterator_7__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_9hashindex_16ChunkKeyIterator_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_16ChunkKeyIterator_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_9hashindex_16ChunkKeyIterator_7__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_4borg_9hashindex_16ChunkKeyIterator_6__reduce_cython__(((struct __pyx_obj_4borg_9hashindex_ChunkKeyIterator *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_16ChunkKeyIterator_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_9hashindex_ChunkKeyIterator *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.hashindex.ChunkKeyIterator.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_16ChunkKeyIterator_9__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_9hashindex_16ChunkKeyIterator_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_16ChunkKeyIterator_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_9hashindex_16ChunkKeyIterator_9__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.hashindex.ChunkKeyIterator.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_9hashindex_16ChunkKeyIterator_8__setstate_cython__(((struct __pyx_obj_4borg_9hashindex_ChunkKeyIterator *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_16ChunkKeyIterator_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_9hashindex_ChunkKeyIterator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.hashindex.ChunkKeyIterator.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/hashindex.pyx":504 * * * cdef Py_buffer ro_buffer(object data) except *: # <<<<<<<<<<<<<< * cdef Py_buffer view * PyObject_GetBuffer(data, &view, PyBUF_SIMPLE) */ static Py_buffer __pyx_f_4borg_9hashindex_ro_buffer(PyObject *__pyx_v_data) { Py_buffer __pyx_v_view; Py_buffer __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "borg/hashindex.pyx":506 * cdef Py_buffer ro_buffer(object data) except *: * cdef Py_buffer view * PyObject_GetBuffer(data, &view, PyBUF_SIMPLE) # <<<<<<<<<<<<<< * return view * */ __pyx_t_1 = PyObject_GetBuffer(__pyx_v_data, (&__pyx_v_view), PyBUF_SIMPLE); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 506, __pyx_L1_error) /* "borg/hashindex.pyx":507 * cdef Py_buffer view * PyObject_GetBuffer(data, &view, PyBUF_SIMPLE) * return view # <<<<<<<<<<<<<< * * */ __pyx_r = __pyx_v_view; goto __pyx_L0; /* "borg/hashindex.pyx":504 * * * cdef Py_buffer ro_buffer(object data) except *: # <<<<<<<<<<<<<< * cdef Py_buffer view * PyObject_GetBuffer(data, &view, PyBUF_SIMPLE) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.hashindex.ro_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_pretend_to_initialize(&__pyx_r); __pyx_L0:; return __pyx_r; } /* "borg/hashindex.pyx":514 * cdef CacheSyncCtx *sync * * def __cinit__(self, chunks): # <<<<<<<<<<<<<< * self.chunks = chunks * self.sync = cache_sync_init(self.chunks.index) */ /* Python wrapper */ static int __pyx_pw_4borg_9hashindex_17CacheSynchronizer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_4borg_9hashindex_17CacheSynchronizer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_chunks = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_chunks,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_chunks)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 514, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); } __pyx_v_chunks = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.hashindex.CacheSynchronizer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_9hashindex_17CacheSynchronizer___cinit__(((struct __pyx_obj_4borg_9hashindex_CacheSynchronizer *)__pyx_v_self), __pyx_v_chunks); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_4borg_9hashindex_17CacheSynchronizer___cinit__(struct __pyx_obj_4borg_9hashindex_CacheSynchronizer *__pyx_v_self, PyObject *__pyx_v_chunks) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 1); /* "borg/hashindex.pyx":515 * * def __cinit__(self, chunks): * self.chunks = chunks # <<<<<<<<<<<<<< * self.sync = cache_sync_init(self.chunks.index) * if not self.sync: */ if (!(likely(((__pyx_v_chunks) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_chunks, __pyx_ptype_4borg_9hashindex_ChunkIndex))))) __PYX_ERR(0, 515, __pyx_L1_error) __pyx_t_1 = __pyx_v_chunks; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF((PyObject *)__pyx_v_self->chunks); __Pyx_DECREF((PyObject *)__pyx_v_self->chunks); __pyx_v_self->chunks = ((struct __pyx_obj_4borg_9hashindex_ChunkIndex *)__pyx_t_1); __pyx_t_1 = 0; /* "borg/hashindex.pyx":516 * def __cinit__(self, chunks): * self.chunks = chunks * self.sync = cache_sync_init(self.chunks.index) # <<<<<<<<<<<<<< * if not self.sync: * raise Exception('cache_sync_init failed') */ __pyx_v_self->sync = cache_sync_init(__pyx_v_self->chunks->__pyx_base.index); /* "borg/hashindex.pyx":517 * self.chunks = chunks * self.sync = cache_sync_init(self.chunks.index) * if not self.sync: # <<<<<<<<<<<<<< * raise Exception('cache_sync_init failed') * */ __pyx_t_2 = (!(__pyx_v_self->sync != 0)); if (unlikely(__pyx_t_2)) { /* "borg/hashindex.pyx":518 * self.sync = cache_sync_init(self.chunks.index) * if not self.sync: * raise Exception('cache_sync_init failed') # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 518, __pyx_L1_error) /* "borg/hashindex.pyx":517 * self.chunks = chunks * self.sync = cache_sync_init(self.chunks.index) * if not self.sync: # <<<<<<<<<<<<<< * raise Exception('cache_sync_init failed') * */ } /* "borg/hashindex.pyx":514 * cdef CacheSyncCtx *sync * * def __cinit__(self, chunks): # <<<<<<<<<<<<<< * self.chunks = chunks * self.sync = cache_sync_init(self.chunks.index) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("borg.hashindex.CacheSynchronizer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/hashindex.pyx":520 * raise Exception('cache_sync_init failed') * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.sync: * cache_sync_free(self.sync) */ /* Python wrapper */ static void __pyx_pw_4borg_9hashindex_17CacheSynchronizer_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_4borg_9hashindex_17CacheSynchronizer_3__dealloc__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_4borg_9hashindex_17CacheSynchronizer_2__dealloc__(((struct __pyx_obj_4borg_9hashindex_CacheSynchronizer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_4borg_9hashindex_17CacheSynchronizer_2__dealloc__(struct __pyx_obj_4borg_9hashindex_CacheSynchronizer *__pyx_v_self) { int __pyx_t_1; /* "borg/hashindex.pyx":521 * * def __dealloc__(self): * if self.sync: # <<<<<<<<<<<<<< * cache_sync_free(self.sync) * */ __pyx_t_1 = (__pyx_v_self->sync != 0); if (__pyx_t_1) { /* "borg/hashindex.pyx":522 * def __dealloc__(self): * if self.sync: * cache_sync_free(self.sync) # <<<<<<<<<<<<<< * * def feed(self, chunk): */ cache_sync_free(__pyx_v_self->sync); /* "borg/hashindex.pyx":521 * * def __dealloc__(self): * if self.sync: # <<<<<<<<<<<<<< * cache_sync_free(self.sync) * */ } /* "borg/hashindex.pyx":520 * raise Exception('cache_sync_init failed') * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.sync: * cache_sync_free(self.sync) */ /* function exit code */ } /* "borg/hashindex.pyx":524 * cache_sync_free(self.sync) * * def feed(self, chunk): # <<<<<<<<<<<<<< * cdef Py_buffer chunk_buf = ro_buffer(chunk) * cdef int rc */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_17CacheSynchronizer_5feed(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_9hashindex_17CacheSynchronizer_5feed = {"feed", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_17CacheSynchronizer_5feed, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_9hashindex_17CacheSynchronizer_5feed(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_chunk = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("feed (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_chunk,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_chunk)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 524, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "feed") < 0)) __PYX_ERR(0, 524, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_chunk = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("feed", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 524, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.hashindex.CacheSynchronizer.feed", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_9hashindex_17CacheSynchronizer_4feed(((struct __pyx_obj_4borg_9hashindex_CacheSynchronizer *)__pyx_v_self), __pyx_v_chunk); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_17CacheSynchronizer_4feed(struct __pyx_obj_4borg_9hashindex_CacheSynchronizer *__pyx_v_self, PyObject *__pyx_v_chunk) { Py_buffer __pyx_v_chunk_buf; int __pyx_v_rc; char const *__pyx_v_error; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_buffer __pyx_t_1; int __pyx_t_2; Py_ssize_t __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("feed", 1); /* "borg/hashindex.pyx":525 * * def feed(self, chunk): * cdef Py_buffer chunk_buf = ro_buffer(chunk) # <<<<<<<<<<<<<< * cdef int rc * rc = cache_sync_feed(self.sync, chunk_buf.buf, chunk_buf.len) */ __pyx_t_1 = __pyx_f_4borg_9hashindex_ro_buffer(__pyx_v_chunk); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 525, __pyx_L1_error) __pyx_v_chunk_buf = __pyx_t_1; /* "borg/hashindex.pyx":527 * cdef Py_buffer chunk_buf = ro_buffer(chunk) * cdef int rc * rc = cache_sync_feed(self.sync, chunk_buf.buf, chunk_buf.len) # <<<<<<<<<<<<<< * PyBuffer_Release(&chunk_buf) * if not rc: */ __pyx_v_rc = cache_sync_feed(__pyx_v_self->sync, __pyx_v_chunk_buf.buf, __pyx_v_chunk_buf.len); /* "borg/hashindex.pyx":528 * cdef int rc * rc = cache_sync_feed(self.sync, chunk_buf.buf, chunk_buf.len) * PyBuffer_Release(&chunk_buf) # <<<<<<<<<<<<<< * if not rc: * error = cache_sync_error(self.sync) */ PyBuffer_Release((&__pyx_v_chunk_buf)); /* "borg/hashindex.pyx":529 * rc = cache_sync_feed(self.sync, chunk_buf.buf, chunk_buf.len) * PyBuffer_Release(&chunk_buf) * if not rc: # <<<<<<<<<<<<<< * error = cache_sync_error(self.sync) * if error != NULL: */ __pyx_t_2 = (!(__pyx_v_rc != 0)); if (__pyx_t_2) { /* "borg/hashindex.pyx":530 * PyBuffer_Release(&chunk_buf) * if not rc: * error = cache_sync_error(self.sync) # <<<<<<<<<<<<<< * if error != NULL: * raise ValueError('cache_sync_feed failed: ' + error.decode('ascii')) */ __pyx_v_error = cache_sync_error(__pyx_v_self->sync); /* "borg/hashindex.pyx":531 * if not rc: * error = cache_sync_error(self.sync) * if error != NULL: # <<<<<<<<<<<<<< * raise ValueError('cache_sync_feed failed: ' + error.decode('ascii')) * */ __pyx_t_2 = (__pyx_v_error != NULL); if (unlikely(__pyx_t_2)) { /* "borg/hashindex.pyx":532 * error = cache_sync_error(self.sync) * if error != NULL: * raise ValueError('cache_sync_feed failed: ' + error.decode('ascii')) # <<<<<<<<<<<<<< * * @property */ __pyx_t_3 = __Pyx_ssize_strlen(__pyx_v_error); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 532, __pyx_L1_error) __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_error, 0, __pyx_t_3, NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 532, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_s_cache_sync_feed_failed, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 532, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 532, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 532, __pyx_L1_error) /* "borg/hashindex.pyx":531 * if not rc: * error = cache_sync_error(self.sync) * if error != NULL: # <<<<<<<<<<<<<< * raise ValueError('cache_sync_feed failed: ' + error.decode('ascii')) * */ } /* "borg/hashindex.pyx":529 * rc = cache_sync_feed(self.sync, chunk_buf.buf, chunk_buf.len) * PyBuffer_Release(&chunk_buf) * if not rc: # <<<<<<<<<<<<<< * error = cache_sync_error(self.sync) * if error != NULL: */ } /* "borg/hashindex.pyx":524 * cache_sync_free(self.sync) * * def feed(self, chunk): # <<<<<<<<<<<<<< * cdef Py_buffer chunk_buf = ro_buffer(chunk) * cdef int rc */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("borg.hashindex.CacheSynchronizer.feed", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/hashindex.pyx":534 * raise ValueError('cache_sync_feed failed: ' + error.decode('ascii')) * * @property # <<<<<<<<<<<<<< * def num_files_totals(self): * return cache_sync_num_files_totals(self.sync) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_17CacheSynchronizer_16num_files_totals_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4borg_9hashindex_17CacheSynchronizer_16num_files_totals_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_4borg_9hashindex_17CacheSynchronizer_16num_files_totals___get__(((struct __pyx_obj_4borg_9hashindex_CacheSynchronizer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_17CacheSynchronizer_16num_files_totals___get__(struct __pyx_obj_4borg_9hashindex_CacheSynchronizer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "borg/hashindex.pyx":536 * @property * def num_files_totals(self): * return cache_sync_num_files_totals(self.sync) # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint64_t(cache_sync_num_files_totals(__pyx_v_self->sync)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/hashindex.pyx":534 * raise ValueError('cache_sync_feed failed: ' + error.decode('ascii')) * * @property # <<<<<<<<<<<<<< * def num_files_totals(self): * return cache_sync_num_files_totals(self.sync) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("borg.hashindex.CacheSynchronizer.num_files_totals.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/hashindex.pyx":538 * return cache_sync_num_files_totals(self.sync) * * @property # <<<<<<<<<<<<<< * def num_files_parts(self): * return cache_sync_num_files_parts(self.sync) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_17CacheSynchronizer_15num_files_parts_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4borg_9hashindex_17CacheSynchronizer_15num_files_parts_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_4borg_9hashindex_17CacheSynchronizer_15num_files_parts___get__(((struct __pyx_obj_4borg_9hashindex_CacheSynchronizer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_17CacheSynchronizer_15num_files_parts___get__(struct __pyx_obj_4borg_9hashindex_CacheSynchronizer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "borg/hashindex.pyx":540 * @property * def num_files_parts(self): * return cache_sync_num_files_parts(self.sync) # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint64_t(cache_sync_num_files_parts(__pyx_v_self->sync)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/hashindex.pyx":538 * return cache_sync_num_files_totals(self.sync) * * @property # <<<<<<<<<<<<<< * def num_files_parts(self): * return cache_sync_num_files_parts(self.sync) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("borg.hashindex.CacheSynchronizer.num_files_parts.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/hashindex.pyx":542 * return cache_sync_num_files_parts(self.sync) * * @property # <<<<<<<<<<<<<< * def size_totals(self): * return cache_sync_size_totals(self.sync) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_17CacheSynchronizer_11size_totals_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4borg_9hashindex_17CacheSynchronizer_11size_totals_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_4borg_9hashindex_17CacheSynchronizer_11size_totals___get__(((struct __pyx_obj_4borg_9hashindex_CacheSynchronizer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_17CacheSynchronizer_11size_totals___get__(struct __pyx_obj_4borg_9hashindex_CacheSynchronizer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "borg/hashindex.pyx":544 * @property * def size_totals(self): * return cache_sync_size_totals(self.sync) # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint64_t(cache_sync_size_totals(__pyx_v_self->sync)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/hashindex.pyx":542 * return cache_sync_num_files_parts(self.sync) * * @property # <<<<<<<<<<<<<< * def size_totals(self): * return cache_sync_size_totals(self.sync) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("borg.hashindex.CacheSynchronizer.size_totals.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/hashindex.pyx":546 * return cache_sync_size_totals(self.sync) * * @property # <<<<<<<<<<<<<< * def size_parts(self): * return cache_sync_size_parts(self.sync) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_17CacheSynchronizer_10size_parts_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4borg_9hashindex_17CacheSynchronizer_10size_parts_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_4borg_9hashindex_17CacheSynchronizer_10size_parts___get__(((struct __pyx_obj_4borg_9hashindex_CacheSynchronizer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_17CacheSynchronizer_10size_parts___get__(struct __pyx_obj_4borg_9hashindex_CacheSynchronizer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "borg/hashindex.pyx":548 * @property * def size_parts(self): * return cache_sync_size_parts(self.sync) # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint64_t(cache_sync_size_parts(__pyx_v_self->sync)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 548, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/hashindex.pyx":546 * return cache_sync_size_totals(self.sync) * * @property # <<<<<<<<<<<<<< * def size_parts(self): * return cache_sync_size_parts(self.sync) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("borg.hashindex.CacheSynchronizer.size_parts.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/hashindex.pyx":550 * return cache_sync_size_parts(self.sync) * * @property # <<<<<<<<<<<<<< * def csize_totals(self): * return cache_sync_csize_totals(self.sync) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_17CacheSynchronizer_12csize_totals_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4borg_9hashindex_17CacheSynchronizer_12csize_totals_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_4borg_9hashindex_17CacheSynchronizer_12csize_totals___get__(((struct __pyx_obj_4borg_9hashindex_CacheSynchronizer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_17CacheSynchronizer_12csize_totals___get__(struct __pyx_obj_4borg_9hashindex_CacheSynchronizer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "borg/hashindex.pyx":552 * @property * def csize_totals(self): * return cache_sync_csize_totals(self.sync) # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint64_t(cache_sync_csize_totals(__pyx_v_self->sync)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/hashindex.pyx":550 * return cache_sync_size_parts(self.sync) * * @property # <<<<<<<<<<<<<< * def csize_totals(self): * return cache_sync_csize_totals(self.sync) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("borg.hashindex.CacheSynchronizer.csize_totals.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/hashindex.pyx":554 * return cache_sync_csize_totals(self.sync) * * @property # <<<<<<<<<<<<<< * def csize_parts(self): * return cache_sync_csize_parts(self.sync) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_17CacheSynchronizer_11csize_parts_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4borg_9hashindex_17CacheSynchronizer_11csize_parts_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_4borg_9hashindex_17CacheSynchronizer_11csize_parts___get__(((struct __pyx_obj_4borg_9hashindex_CacheSynchronizer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_17CacheSynchronizer_11csize_parts___get__(struct __pyx_obj_4borg_9hashindex_CacheSynchronizer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "borg/hashindex.pyx":556 * @property * def csize_parts(self): * return cache_sync_csize_parts(self.sync) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint64_t(cache_sync_csize_parts(__pyx_v_self->sync)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/hashindex.pyx":554 * return cache_sync_csize_totals(self.sync) * * @property # <<<<<<<<<<<<<< * def csize_parts(self): * return cache_sync_csize_parts(self.sync) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("borg.hashindex.CacheSynchronizer.csize_parts.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_17CacheSynchronizer_7__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_9hashindex_17CacheSynchronizer_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_17CacheSynchronizer_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_9hashindex_17CacheSynchronizer_7__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_4borg_9hashindex_17CacheSynchronizer_6__reduce_cython__(((struct __pyx_obj_4borg_9hashindex_CacheSynchronizer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_17CacheSynchronizer_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_9hashindex_CacheSynchronizer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.hashindex.CacheSynchronizer.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_9hashindex_17CacheSynchronizer_9__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_9hashindex_17CacheSynchronizer_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_17CacheSynchronizer_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_9hashindex_17CacheSynchronizer_9__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.hashindex.CacheSynchronizer.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_9hashindex_17CacheSynchronizer_8__setstate_cython__(((struct __pyx_obj_4borg_9hashindex_CacheSynchronizer *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_9hashindex_17CacheSynchronizer_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4borg_9hashindex_CacheSynchronizer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.hashindex.CacheSynchronizer.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_4borg_9hashindex_IndexBase(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif if (unlikely(__pyx_pw_4borg_9hashindex_9IndexBase_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_4borg_9hashindex_IndexBase(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4borg_9hashindex_IndexBase) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_4borg_9hashindex_9IndexBase_3__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static int __pyx_mp_ass_subscript_4borg_9hashindex_IndexBase(PyObject *o, PyObject *i, PyObject *v) { if (v) { __Pyx_TypeName o_type_name; o_type_name = __Pyx_PyType_GetName(Py_TYPE(o)); PyErr_Format(PyExc_NotImplementedError, "Subscript assignment not supported by " __Pyx_FMT_TYPENAME, o_type_name); __Pyx_DECREF_TypeName(o_type_name); return -1; } else { return __pyx_pw_4borg_9hashindex_9IndexBase_13__delitem__(o, i); } } static PyMethodDef __pyx_methods_4borg_9hashindex_IndexBase[] = { {"read", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_9IndexBase_5read, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"write", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_9IndexBase_7write, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"clear", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_9IndexBase_9clear, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"setdefault", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_9IndexBase_11setdefault, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"get", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_9IndexBase_15get, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"pop", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_9IndexBase_17pop, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"size", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_9IndexBase_21size, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_9hashindex_9IndexBase_20size}, {"compact", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_9IndexBase_23compact, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_9IndexBase_25__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_9IndexBase_27__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_4borg_9hashindex_IndexBase_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4borg_9hashindex_IndexBase}, {Py_sq_length, (void *)__pyx_pw_4borg_9hashindex_9IndexBase_19__len__}, {Py_mp_length, (void *)__pyx_pw_4borg_9hashindex_9IndexBase_19__len__}, {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_4borg_9hashindex_IndexBase}, {Py_tp_methods, (void *)__pyx_methods_4borg_9hashindex_IndexBase}, {Py_tp_new, (void *)__pyx_tp_new_4borg_9hashindex_IndexBase}, {0, 0}, }; static PyType_Spec __pyx_type_4borg_9hashindex_IndexBase_spec = { "borg.hashindex.IndexBase", sizeof(struct __pyx_obj_4borg_9hashindex_IndexBase), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_4borg_9hashindex_IndexBase_slots, }; #else static PySequenceMethods __pyx_tp_as_sequence_IndexBase = { __pyx_pw_4borg_9hashindex_9IndexBase_19__len__, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ 0, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_IndexBase = { __pyx_pw_4borg_9hashindex_9IndexBase_19__len__, /*mp_length*/ 0, /*mp_subscript*/ __pyx_mp_ass_subscript_4borg_9hashindex_IndexBase, /*mp_ass_subscript*/ }; static PyTypeObject __pyx_type_4borg_9hashindex_IndexBase = { PyVarObject_HEAD_INIT(0, 0) "borg.hashindex.""IndexBase", /*tp_name*/ sizeof(struct __pyx_obj_4borg_9hashindex_IndexBase), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4borg_9hashindex_IndexBase, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ &__pyx_tp_as_sequence_IndexBase, /*tp_as_sequence*/ &__pyx_tp_as_mapping_IndexBase, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_4borg_9hashindex_IndexBase, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4borg_9hashindex_IndexBase, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyObject *__pyx_sq_item_4borg_9hashindex_FuseVersionsIndex(PyObject *o, Py_ssize_t i) { PyObject *r; PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); Py_DECREF(x); return r; } static int __pyx_mp_ass_subscript_4borg_9hashindex_FuseVersionsIndex(PyObject *o, PyObject *i, PyObject *v) { if (v) { return __pyx_pw_4borg_9hashindex_17FuseVersionsIndex_3__setitem__(o, i, v); } else { __Pyx_TypeName o_type_name; if (__pyx_ptype_4borg_9hashindex_IndexBase->tp_as_mapping && __pyx_ptype_4borg_9hashindex_IndexBase->tp_as_mapping->mp_ass_subscript) return __pyx_ptype_4borg_9hashindex_IndexBase->tp_as_mapping->mp_ass_subscript(o, i, v); o_type_name = __Pyx_PyType_GetName(Py_TYPE(o)); PyErr_Format(PyExc_NotImplementedError, "Subscript deletion not supported by " __Pyx_FMT_TYPENAME, o_type_name); __Pyx_DECREF_TypeName(o_type_name); return -1; } } static PyMethodDef __pyx_methods_4borg_9hashindex_FuseVersionsIndex[] = { {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_17FuseVersionsIndex_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_17FuseVersionsIndex_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_4borg_9hashindex_FuseVersionsIndex_slots[] = { {Py_sq_item, (void *)__pyx_sq_item_4borg_9hashindex_FuseVersionsIndex}, {Py_sq_contains, (void *)__pyx_pw_4borg_9hashindex_17FuseVersionsIndex_5__contains__}, {Py_mp_subscript, (void *)__pyx_pw_4borg_9hashindex_17FuseVersionsIndex_1__getitem__}, {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_4borg_9hashindex_FuseVersionsIndex}, {Py_tp_methods, (void *)__pyx_methods_4borg_9hashindex_FuseVersionsIndex}, {Py_tp_new, (void *)__pyx_tp_new_4borg_9hashindex_IndexBase}, {0, 0}, }; static PyType_Spec __pyx_type_4borg_9hashindex_FuseVersionsIndex_spec = { "borg.hashindex.FuseVersionsIndex", sizeof(struct __pyx_obj_4borg_9hashindex_FuseVersionsIndex), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_4borg_9hashindex_FuseVersionsIndex_slots, }; #else static PySequenceMethods __pyx_tp_as_sequence_FuseVersionsIndex = { #if CYTHON_COMPILING_IN_PYPY || 0 __pyx_pw_4borg_9hashindex_9IndexBase_19__len__, /*sq_length*/ #else 0, /*sq_length*/ #endif 0, /*sq_concat*/ 0, /*sq_repeat*/ __pyx_sq_item_4borg_9hashindex_FuseVersionsIndex, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ __pyx_pw_4borg_9hashindex_17FuseVersionsIndex_5__contains__, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_FuseVersionsIndex = { #if CYTHON_COMPILING_IN_PYPY || 0 __pyx_pw_4borg_9hashindex_9IndexBase_19__len__, /*mp_length*/ #else 0, /*mp_length*/ #endif __pyx_pw_4borg_9hashindex_17FuseVersionsIndex_1__getitem__, /*mp_subscript*/ __pyx_mp_ass_subscript_4borg_9hashindex_FuseVersionsIndex, /*mp_ass_subscript*/ }; static PyTypeObject __pyx_type_4borg_9hashindex_FuseVersionsIndex = { PyVarObject_HEAD_INIT(0, 0) "borg.hashindex.""FuseVersionsIndex", /*tp_name*/ sizeof(struct __pyx_obj_4borg_9hashindex_FuseVersionsIndex), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4borg_9hashindex_IndexBase, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ &__pyx_tp_as_sequence_FuseVersionsIndex, /*tp_as_sequence*/ &__pyx_tp_as_mapping_FuseVersionsIndex, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_4borg_9hashindex_FuseVersionsIndex, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4borg_9hashindex_IndexBase, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyObject *__pyx_sq_item_4borg_9hashindex_NSIndex(PyObject *o, Py_ssize_t i) { PyObject *r; PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); Py_DECREF(x); return r; } static int __pyx_mp_ass_subscript_4borg_9hashindex_NSIndex(PyObject *o, PyObject *i, PyObject *v) { if (v) { return __pyx_pw_4borg_9hashindex_7NSIndex_3__setitem__(o, i, v); } else { __Pyx_TypeName o_type_name; if (__pyx_ptype_4borg_9hashindex_IndexBase->tp_as_mapping && __pyx_ptype_4borg_9hashindex_IndexBase->tp_as_mapping->mp_ass_subscript) return __pyx_ptype_4borg_9hashindex_IndexBase->tp_as_mapping->mp_ass_subscript(o, i, v); o_type_name = __Pyx_PyType_GetName(Py_TYPE(o)); PyErr_Format(PyExc_NotImplementedError, "Subscript deletion not supported by " __Pyx_FMT_TYPENAME, o_type_name); __Pyx_DECREF_TypeName(o_type_name); return -1; } } static PyMethodDef __pyx_methods_4borg_9hashindex_NSIndex[] = { {"iteritems", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_7NSIndex_7iteritems, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_7NSIndex_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_7NSIndex_11__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_4borg_9hashindex_NSIndex_slots[] = { {Py_sq_item, (void *)__pyx_sq_item_4borg_9hashindex_NSIndex}, {Py_sq_contains, (void *)__pyx_pw_4borg_9hashindex_7NSIndex_5__contains__}, {Py_mp_subscript, (void *)__pyx_pw_4borg_9hashindex_7NSIndex_1__getitem__}, {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_4borg_9hashindex_NSIndex}, {Py_tp_methods, (void *)__pyx_methods_4borg_9hashindex_NSIndex}, {Py_tp_new, (void *)__pyx_tp_new_4borg_9hashindex_IndexBase}, {0, 0}, }; static PyType_Spec __pyx_type_4borg_9hashindex_NSIndex_spec = { "borg.hashindex.NSIndex", sizeof(struct __pyx_obj_4borg_9hashindex_NSIndex), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_4borg_9hashindex_NSIndex_slots, }; #else static PySequenceMethods __pyx_tp_as_sequence_NSIndex = { #if CYTHON_COMPILING_IN_PYPY || 0 __pyx_pw_4borg_9hashindex_9IndexBase_19__len__, /*sq_length*/ #else 0, /*sq_length*/ #endif 0, /*sq_concat*/ 0, /*sq_repeat*/ __pyx_sq_item_4borg_9hashindex_NSIndex, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ __pyx_pw_4borg_9hashindex_7NSIndex_5__contains__, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_NSIndex = { #if CYTHON_COMPILING_IN_PYPY || 0 __pyx_pw_4borg_9hashindex_9IndexBase_19__len__, /*mp_length*/ #else 0, /*mp_length*/ #endif __pyx_pw_4borg_9hashindex_7NSIndex_1__getitem__, /*mp_subscript*/ __pyx_mp_ass_subscript_4borg_9hashindex_NSIndex, /*mp_ass_subscript*/ }; static PyTypeObject __pyx_type_4borg_9hashindex_NSIndex = { PyVarObject_HEAD_INIT(0, 0) "borg.hashindex.""NSIndex", /*tp_name*/ sizeof(struct __pyx_obj_4borg_9hashindex_NSIndex), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4borg_9hashindex_IndexBase, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ &__pyx_tp_as_sequence_NSIndex, /*tp_as_sequence*/ &__pyx_tp_as_mapping_NSIndex, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_4borg_9hashindex_NSIndex, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4borg_9hashindex_IndexBase, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyObject *__pyx_tp_new_4borg_9hashindex_NSKeyIterator(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_4borg_9hashindex_NSKeyIterator *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif p = ((struct __pyx_obj_4borg_9hashindex_NSKeyIterator *)o); p->idx = ((struct __pyx_obj_4borg_9hashindex_NSIndex *)Py_None); Py_INCREF(Py_None); if (unlikely(__pyx_pw_4borg_9hashindex_13NSKeyIterator_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_4borg_9hashindex_NSKeyIterator(PyObject *o) { struct __pyx_obj_4borg_9hashindex_NSKeyIterator *p = (struct __pyx_obj_4borg_9hashindex_NSKeyIterator *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4borg_9hashindex_NSKeyIterator) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->idx); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static int __pyx_tp_traverse_4borg_9hashindex_NSKeyIterator(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4borg_9hashindex_NSKeyIterator *p = (struct __pyx_obj_4borg_9hashindex_NSKeyIterator *)o; if (p->idx) { e = (*v)(((PyObject *)p->idx), a); if (e) return e; } return 0; } static int __pyx_tp_clear_4borg_9hashindex_NSKeyIterator(PyObject *o) { PyObject* tmp; struct __pyx_obj_4borg_9hashindex_NSKeyIterator *p = (struct __pyx_obj_4borg_9hashindex_NSKeyIterator *)o; tmp = ((PyObject*)p->idx); p->idx = ((struct __pyx_obj_4borg_9hashindex_NSIndex *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_specialmethod___pyx_pw_4borg_9hashindex_13NSKeyIterator_5__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) { PyObject *res = __pyx_pw_4borg_9hashindex_13NSKeyIterator_5__next__(self); if (!res && !PyErr_Occurred()) { PyErr_SetNone(PyExc_StopIteration); } return res; } static PyMethodDef __pyx_methods_4borg_9hashindex_NSKeyIterator[] = { {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_4borg_9hashindex_13NSKeyIterator_5__next__, METH_NOARGS|METH_COEXIST, 0}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_13NSKeyIterator_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_13NSKeyIterator_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_4borg_9hashindex_NSKeyIterator_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4borg_9hashindex_NSKeyIterator}, {Py_tp_traverse, (void *)__pyx_tp_traverse_4borg_9hashindex_NSKeyIterator}, {Py_tp_clear, (void *)__pyx_tp_clear_4borg_9hashindex_NSKeyIterator}, {Py_tp_iter, (void *)__pyx_pw_4borg_9hashindex_13NSKeyIterator_3__iter__}, {Py_tp_iternext, (void *)__pyx_pw_4borg_9hashindex_13NSKeyIterator_5__next__}, {Py_tp_methods, (void *)__pyx_methods_4borg_9hashindex_NSKeyIterator}, {Py_tp_new, (void *)__pyx_tp_new_4borg_9hashindex_NSKeyIterator}, {0, 0}, }; static PyType_Spec __pyx_type_4borg_9hashindex_NSKeyIterator_spec = { "borg.hashindex.NSKeyIterator", sizeof(struct __pyx_obj_4borg_9hashindex_NSKeyIterator), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type_4borg_9hashindex_NSKeyIterator_slots, }; #else static PyTypeObject __pyx_type_4borg_9hashindex_NSKeyIterator = { PyVarObject_HEAD_INIT(0, 0) "borg.hashindex.""NSKeyIterator", /*tp_name*/ sizeof(struct __pyx_obj_4borg_9hashindex_NSKeyIterator), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4borg_9hashindex_NSKeyIterator, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_4borg_9hashindex_NSKeyIterator, /*tp_traverse*/ __pyx_tp_clear_4borg_9hashindex_NSKeyIterator, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_pw_4borg_9hashindex_13NSKeyIterator_3__iter__, /*tp_iter*/ __pyx_pw_4borg_9hashindex_13NSKeyIterator_5__next__, /*tp_iternext*/ __pyx_methods_4borg_9hashindex_NSKeyIterator, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4borg_9hashindex_NSKeyIterator, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_4borg_9hashindex_ChunkIndex __pyx_vtable_4borg_9hashindex_ChunkIndex; static PyObject *__pyx_tp_new_4borg_9hashindex_ChunkIndex(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_4borg_9hashindex_ChunkIndex *p; PyObject *o = __pyx_tp_new_4borg_9hashindex_IndexBase(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_4borg_9hashindex_ChunkIndex *)o); p->__pyx_vtab = __pyx_vtabptr_4borg_9hashindex_ChunkIndex; return o; } static PyObject *__pyx_sq_item_4borg_9hashindex_ChunkIndex(PyObject *o, Py_ssize_t i) { PyObject *r; PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); Py_DECREF(x); return r; } static int __pyx_mp_ass_subscript_4borg_9hashindex_ChunkIndex(PyObject *o, PyObject *i, PyObject *v) { if (v) { return __pyx_pw_4borg_9hashindex_10ChunkIndex_3__setitem__(o, i, v); } else { __Pyx_TypeName o_type_name; if (__pyx_ptype_4borg_9hashindex_IndexBase->tp_as_mapping && __pyx_ptype_4borg_9hashindex_IndexBase->tp_as_mapping->mp_ass_subscript) return __pyx_ptype_4borg_9hashindex_IndexBase->tp_as_mapping->mp_ass_subscript(o, i, v); o_type_name = __Pyx_PyType_GetName(Py_TYPE(o)); PyErr_Format(PyExc_NotImplementedError, "Subscript deletion not supported by " __Pyx_FMT_TYPENAME, o_type_name); __Pyx_DECREF_TypeName(o_type_name); return -1; } } static PyMethodDef __pyx_methods_4borg_9hashindex_ChunkIndex[] = { {"incref", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_10ChunkIndex_7incref, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_9hashindex_10ChunkIndex_6incref}, {"decref", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_10ChunkIndex_9decref, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_9hashindex_10ChunkIndex_8decref}, {"iteritems", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_10ChunkIndex_11iteritems, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"summarize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_10ChunkIndex_13summarize, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"stats_against", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_10ChunkIndex_15stats_against, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_9hashindex_10ChunkIndex_14stats_against}, {"add", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_10ChunkIndex_17add, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"merge", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_10ChunkIndex_19merge, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"zero_csize_ids", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_10ChunkIndex_21zero_csize_ids, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_10ChunkIndex_23__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_10ChunkIndex_25__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_4borg_9hashindex_ChunkIndex_slots[] = { {Py_sq_item, (void *)__pyx_sq_item_4borg_9hashindex_ChunkIndex}, {Py_sq_contains, (void *)__pyx_pw_4borg_9hashindex_10ChunkIndex_5__contains__}, {Py_mp_subscript, (void *)__pyx_pw_4borg_9hashindex_10ChunkIndex_1__getitem__}, {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_4borg_9hashindex_ChunkIndex}, {Py_tp_doc, (void *)PyDoc_STR("\n Mapping of 32 byte keys to (refcount, size, csize), which are all 32-bit unsigned.\n\n The reference count cannot overflow. If an overflow would occur, the refcount\n is fixed to MAX_VALUE and will neither increase nor decrease by incref(), decref()\n or add().\n\n Prior signed 32-bit overflow is handled correctly for most cases: All values\n from UINT32_MAX (2**32-1, inclusive) to MAX_VALUE (exclusive) are reserved and either\n cause silent data loss (-1, -2) or will raise an AssertionError when accessed.\n Other values are handled correctly. Note that previously the refcount could also reach\n 0 by *increasing* it.\n\n Assigning refcounts in this reserved range is an invalid operation and raises AssertionError.\n ")}, {Py_tp_methods, (void *)__pyx_methods_4borg_9hashindex_ChunkIndex}, {Py_tp_new, (void *)__pyx_tp_new_4borg_9hashindex_ChunkIndex}, {0, 0}, }; static PyType_Spec __pyx_type_4borg_9hashindex_ChunkIndex_spec = { "borg.hashindex.ChunkIndex", sizeof(struct __pyx_obj_4borg_9hashindex_ChunkIndex), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_4borg_9hashindex_ChunkIndex_slots, }; #else static PySequenceMethods __pyx_tp_as_sequence_ChunkIndex = { #if CYTHON_COMPILING_IN_PYPY || 0 __pyx_pw_4borg_9hashindex_9IndexBase_19__len__, /*sq_length*/ #else 0, /*sq_length*/ #endif 0, /*sq_concat*/ 0, /*sq_repeat*/ __pyx_sq_item_4borg_9hashindex_ChunkIndex, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ __pyx_pw_4borg_9hashindex_10ChunkIndex_5__contains__, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_ChunkIndex = { #if CYTHON_COMPILING_IN_PYPY || 0 __pyx_pw_4borg_9hashindex_9IndexBase_19__len__, /*mp_length*/ #else 0, /*mp_length*/ #endif __pyx_pw_4borg_9hashindex_10ChunkIndex_1__getitem__, /*mp_subscript*/ __pyx_mp_ass_subscript_4borg_9hashindex_ChunkIndex, /*mp_ass_subscript*/ }; static PyTypeObject __pyx_type_4borg_9hashindex_ChunkIndex = { PyVarObject_HEAD_INIT(0, 0) "borg.hashindex.""ChunkIndex", /*tp_name*/ sizeof(struct __pyx_obj_4borg_9hashindex_ChunkIndex), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4borg_9hashindex_IndexBase, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ &__pyx_tp_as_sequence_ChunkIndex, /*tp_as_sequence*/ &__pyx_tp_as_mapping_ChunkIndex, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ PyDoc_STR("\n Mapping of 32 byte keys to (refcount, size, csize), which are all 32-bit unsigned.\n\n The reference count cannot overflow. If an overflow would occur, the refcount\n is fixed to MAX_VALUE and will neither increase nor decrease by incref(), decref()\n or add().\n\n Prior signed 32-bit overflow is handled correctly for most cases: All values\n from UINT32_MAX (2**32-1, inclusive) to MAX_VALUE (exclusive) are reserved and either\n cause silent data loss (-1, -2) or will raise an AssertionError when accessed.\n Other values are handled correctly. Note that previously the refcount could also reach\n 0 by *increasing* it.\n\n Assigning refcounts in this reserved range is an invalid operation and raises AssertionError.\n "), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_4borg_9hashindex_ChunkIndex, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4borg_9hashindex_ChunkIndex, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyObject *__pyx_tp_new_4borg_9hashindex_ChunkKeyIterator(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_4borg_9hashindex_ChunkKeyIterator *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif p = ((struct __pyx_obj_4borg_9hashindex_ChunkKeyIterator *)o); p->idx = ((struct __pyx_obj_4borg_9hashindex_ChunkIndex *)Py_None); Py_INCREF(Py_None); if (unlikely(__pyx_pw_4borg_9hashindex_16ChunkKeyIterator_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_4borg_9hashindex_ChunkKeyIterator(PyObject *o) { struct __pyx_obj_4borg_9hashindex_ChunkKeyIterator *p = (struct __pyx_obj_4borg_9hashindex_ChunkKeyIterator *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4borg_9hashindex_ChunkKeyIterator) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->idx); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static int __pyx_tp_traverse_4borg_9hashindex_ChunkKeyIterator(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4borg_9hashindex_ChunkKeyIterator *p = (struct __pyx_obj_4borg_9hashindex_ChunkKeyIterator *)o; if (p->idx) { e = (*v)(((PyObject *)p->idx), a); if (e) return e; } return 0; } static int __pyx_tp_clear_4borg_9hashindex_ChunkKeyIterator(PyObject *o) { PyObject* tmp; struct __pyx_obj_4borg_9hashindex_ChunkKeyIterator *p = (struct __pyx_obj_4borg_9hashindex_ChunkKeyIterator *)o; tmp = ((PyObject*)p->idx); p->idx = ((struct __pyx_obj_4borg_9hashindex_ChunkIndex *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_specialmethod___pyx_pw_4borg_9hashindex_16ChunkKeyIterator_5__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) { PyObject *res = __pyx_pw_4borg_9hashindex_16ChunkKeyIterator_5__next__(self); if (!res && !PyErr_Occurred()) { PyErr_SetNone(PyExc_StopIteration); } return res; } static PyMethodDef __pyx_methods_4borg_9hashindex_ChunkKeyIterator[] = { {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_4borg_9hashindex_16ChunkKeyIterator_5__next__, METH_NOARGS|METH_COEXIST, 0}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_16ChunkKeyIterator_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_16ChunkKeyIterator_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_4borg_9hashindex_ChunkKeyIterator_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4borg_9hashindex_ChunkKeyIterator}, {Py_tp_traverse, (void *)__pyx_tp_traverse_4borg_9hashindex_ChunkKeyIterator}, {Py_tp_clear, (void *)__pyx_tp_clear_4borg_9hashindex_ChunkKeyIterator}, {Py_tp_iter, (void *)__pyx_pw_4borg_9hashindex_16ChunkKeyIterator_3__iter__}, {Py_tp_iternext, (void *)__pyx_pw_4borg_9hashindex_16ChunkKeyIterator_5__next__}, {Py_tp_methods, (void *)__pyx_methods_4borg_9hashindex_ChunkKeyIterator}, {Py_tp_new, (void *)__pyx_tp_new_4borg_9hashindex_ChunkKeyIterator}, {0, 0}, }; static PyType_Spec __pyx_type_4borg_9hashindex_ChunkKeyIterator_spec = { "borg.hashindex.ChunkKeyIterator", sizeof(struct __pyx_obj_4borg_9hashindex_ChunkKeyIterator), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type_4borg_9hashindex_ChunkKeyIterator_slots, }; #else static PyTypeObject __pyx_type_4borg_9hashindex_ChunkKeyIterator = { PyVarObject_HEAD_INIT(0, 0) "borg.hashindex.""ChunkKeyIterator", /*tp_name*/ sizeof(struct __pyx_obj_4borg_9hashindex_ChunkKeyIterator), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4borg_9hashindex_ChunkKeyIterator, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_4borg_9hashindex_ChunkKeyIterator, /*tp_traverse*/ __pyx_tp_clear_4borg_9hashindex_ChunkKeyIterator, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_pw_4borg_9hashindex_16ChunkKeyIterator_3__iter__, /*tp_iter*/ __pyx_pw_4borg_9hashindex_16ChunkKeyIterator_5__next__, /*tp_iternext*/ __pyx_methods_4borg_9hashindex_ChunkKeyIterator, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4borg_9hashindex_ChunkKeyIterator, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyObject *__pyx_tp_new_4borg_9hashindex_CacheSynchronizer(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_4borg_9hashindex_CacheSynchronizer *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif p = ((struct __pyx_obj_4borg_9hashindex_CacheSynchronizer *)o); p->chunks = ((struct __pyx_obj_4borg_9hashindex_ChunkIndex *)Py_None); Py_INCREF(Py_None); if (unlikely(__pyx_pw_4borg_9hashindex_17CacheSynchronizer_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_4borg_9hashindex_CacheSynchronizer(PyObject *o) { struct __pyx_obj_4borg_9hashindex_CacheSynchronizer *p = (struct __pyx_obj_4borg_9hashindex_CacheSynchronizer *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4borg_9hashindex_CacheSynchronizer) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_4borg_9hashindex_17CacheSynchronizer_3__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } Py_CLEAR(p->chunks); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static int __pyx_tp_traverse_4borg_9hashindex_CacheSynchronizer(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4borg_9hashindex_CacheSynchronizer *p = (struct __pyx_obj_4borg_9hashindex_CacheSynchronizer *)o; if (p->chunks) { e = (*v)(((PyObject *)p->chunks), a); if (e) return e; } return 0; } static int __pyx_tp_clear_4borg_9hashindex_CacheSynchronizer(PyObject *o) { PyObject* tmp; struct __pyx_obj_4borg_9hashindex_CacheSynchronizer *p = (struct __pyx_obj_4borg_9hashindex_CacheSynchronizer *)o; tmp = ((PyObject*)p->chunks); p->chunks = ((struct __pyx_obj_4borg_9hashindex_ChunkIndex *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_getprop_4borg_9hashindex_17CacheSynchronizer_num_files_totals(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_4borg_9hashindex_17CacheSynchronizer_16num_files_totals_1__get__(o); } static PyObject *__pyx_getprop_4borg_9hashindex_17CacheSynchronizer_num_files_parts(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_4borg_9hashindex_17CacheSynchronizer_15num_files_parts_1__get__(o); } static PyObject *__pyx_getprop_4borg_9hashindex_17CacheSynchronizer_size_totals(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_4borg_9hashindex_17CacheSynchronizer_11size_totals_1__get__(o); } static PyObject *__pyx_getprop_4borg_9hashindex_17CacheSynchronizer_size_parts(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_4borg_9hashindex_17CacheSynchronizer_10size_parts_1__get__(o); } static PyObject *__pyx_getprop_4borg_9hashindex_17CacheSynchronizer_csize_totals(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_4borg_9hashindex_17CacheSynchronizer_12csize_totals_1__get__(o); } static PyObject *__pyx_getprop_4borg_9hashindex_17CacheSynchronizer_csize_parts(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_4borg_9hashindex_17CacheSynchronizer_11csize_parts_1__get__(o); } static PyMethodDef __pyx_methods_4borg_9hashindex_CacheSynchronizer[] = { {"feed", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_17CacheSynchronizer_5feed, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_17CacheSynchronizer_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_9hashindex_17CacheSynchronizer_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_4borg_9hashindex_CacheSynchronizer[] = { {(char *)"num_files_totals", __pyx_getprop_4borg_9hashindex_17CacheSynchronizer_num_files_totals, 0, (char *)0, 0}, {(char *)"num_files_parts", __pyx_getprop_4borg_9hashindex_17CacheSynchronizer_num_files_parts, 0, (char *)0, 0}, {(char *)"size_totals", __pyx_getprop_4borg_9hashindex_17CacheSynchronizer_size_totals, 0, (char *)0, 0}, {(char *)"size_parts", __pyx_getprop_4borg_9hashindex_17CacheSynchronizer_size_parts, 0, (char *)0, 0}, {(char *)"csize_totals", __pyx_getprop_4borg_9hashindex_17CacheSynchronizer_csize_totals, 0, (char *)0, 0}, {(char *)"csize_parts", __pyx_getprop_4borg_9hashindex_17CacheSynchronizer_csize_parts, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_4borg_9hashindex_CacheSynchronizer_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4borg_9hashindex_CacheSynchronizer}, {Py_tp_traverse, (void *)__pyx_tp_traverse_4borg_9hashindex_CacheSynchronizer}, {Py_tp_clear, (void *)__pyx_tp_clear_4borg_9hashindex_CacheSynchronizer}, {Py_tp_methods, (void *)__pyx_methods_4borg_9hashindex_CacheSynchronizer}, {Py_tp_getset, (void *)__pyx_getsets_4borg_9hashindex_CacheSynchronizer}, {Py_tp_new, (void *)__pyx_tp_new_4borg_9hashindex_CacheSynchronizer}, {0, 0}, }; static PyType_Spec __pyx_type_4borg_9hashindex_CacheSynchronizer_spec = { "borg.hashindex.CacheSynchronizer", sizeof(struct __pyx_obj_4borg_9hashindex_CacheSynchronizer), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type_4borg_9hashindex_CacheSynchronizer_slots, }; #else static PyTypeObject __pyx_type_4borg_9hashindex_CacheSynchronizer = { PyVarObject_HEAD_INIT(0, 0) "borg.hashindex.""CacheSynchronizer", /*tp_name*/ sizeof(struct __pyx_obj_4borg_9hashindex_CacheSynchronizer), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4borg_9hashindex_CacheSynchronizer, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_4borg_9hashindex_CacheSynchronizer, /*tp_traverse*/ __pyx_tp_clear_4borg_9hashindex_CacheSynchronizer, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_4borg_9hashindex_CacheSynchronizer, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_4borg_9hashindex_CacheSynchronizer, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4borg_9hashindex_CacheSynchronizer, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_1_4_01, __pyx_k_1_4_01, sizeof(__pyx_k_1_4_01), 0, 0, 1, 0}, {&__pyx_n_s_API_VERSION, __pyx_k_API_VERSION, sizeof(__pyx_k_API_VERSION), 0, 0, 1, 1}, {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1}, {&__pyx_n_s_CacheSynchronizer, __pyx_k_CacheSynchronizer, sizeof(__pyx_k_CacheSynchronizer), 0, 0, 1, 1}, {&__pyx_n_s_CacheSynchronizer___reduce_cytho, __pyx_k_CacheSynchronizer___reduce_cytho, sizeof(__pyx_k_CacheSynchronizer___reduce_cytho), 0, 0, 1, 1}, {&__pyx_n_s_CacheSynchronizer___setstate_cyt, __pyx_k_CacheSynchronizer___setstate_cyt, sizeof(__pyx_k_CacheSynchronizer___setstate_cyt), 0, 0, 1, 1}, {&__pyx_n_s_CacheSynchronizer_feed, __pyx_k_CacheSynchronizer_feed, sizeof(__pyx_k_CacheSynchronizer_feed), 0, 0, 1, 1}, {&__pyx_n_s_ChunkIndex, __pyx_k_ChunkIndex, sizeof(__pyx_k_ChunkIndex), 0, 0, 1, 1}, {&__pyx_n_s_ChunkIndexEntry, __pyx_k_ChunkIndexEntry, sizeof(__pyx_k_ChunkIndexEntry), 0, 0, 1, 1}, {&__pyx_n_s_ChunkIndex___reduce_cython, __pyx_k_ChunkIndex___reduce_cython, sizeof(__pyx_k_ChunkIndex___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_ChunkIndex___setstate_cython, __pyx_k_ChunkIndex___setstate_cython, sizeof(__pyx_k_ChunkIndex___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_ChunkIndex_add, __pyx_k_ChunkIndex_add, sizeof(__pyx_k_ChunkIndex_add), 0, 0, 1, 1}, {&__pyx_n_s_ChunkIndex_decref, __pyx_k_ChunkIndex_decref, sizeof(__pyx_k_ChunkIndex_decref), 0, 0, 1, 1}, {&__pyx_n_s_ChunkIndex_incref, __pyx_k_ChunkIndex_incref, sizeof(__pyx_k_ChunkIndex_incref), 0, 0, 1, 1}, {&__pyx_n_s_ChunkIndex_iteritems, __pyx_k_ChunkIndex_iteritems, sizeof(__pyx_k_ChunkIndex_iteritems), 0, 0, 1, 1}, {&__pyx_n_s_ChunkIndex_merge, __pyx_k_ChunkIndex_merge, sizeof(__pyx_k_ChunkIndex_merge), 0, 0, 1, 1}, {&__pyx_n_s_ChunkIndex_stats_against, __pyx_k_ChunkIndex_stats_against, sizeof(__pyx_k_ChunkIndex_stats_against), 0, 0, 1, 1}, {&__pyx_n_s_ChunkIndex_summarize, __pyx_k_ChunkIndex_summarize, sizeof(__pyx_k_ChunkIndex_summarize), 0, 0, 1, 1}, {&__pyx_n_s_ChunkIndex_zero_csize_ids, __pyx_k_ChunkIndex_zero_csize_ids, sizeof(__pyx_k_ChunkIndex_zero_csize_ids), 0, 0, 1, 1}, {&__pyx_n_s_ChunkKeyIterator, __pyx_k_ChunkKeyIterator, sizeof(__pyx_k_ChunkKeyIterator), 0, 0, 1, 1}, {&__pyx_n_s_ChunkKeyIterator___reduce_cython, __pyx_k_ChunkKeyIterator___reduce_cython, sizeof(__pyx_k_ChunkKeyIterator___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_ChunkKeyIterator___setstate_cyth, __pyx_k_ChunkKeyIterator___setstate_cyth, sizeof(__pyx_k_ChunkKeyIterator___setstate_cyth), 0, 0, 1, 1}, {&__pyx_kp_s_Expected_bytes_of_length_16_for, __pyx_k_Expected_bytes_of_length_16_for, sizeof(__pyx_k_Expected_bytes_of_length_16_for), 0, 0, 1, 0}, {&__pyx_n_s_FuseVersionsIndex, __pyx_k_FuseVersionsIndex, sizeof(__pyx_k_FuseVersionsIndex), 0, 0, 1, 1}, {&__pyx_n_s_FuseVersionsIndex___reduce_cytho, __pyx_k_FuseVersionsIndex___reduce_cytho, sizeof(__pyx_k_FuseVersionsIndex___reduce_cytho), 0, 0, 1, 1}, {&__pyx_n_s_FuseVersionsIndex___setstate_cyt, __pyx_k_FuseVersionsIndex___setstate_cyt, sizeof(__pyx_k_FuseVersionsIndex___setstate_cyt), 0, 0, 1, 1}, {&__pyx_n_s_IndexBase___reduce_cython, __pyx_k_IndexBase___reduce_cython, sizeof(__pyx_k_IndexBase___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_IndexBase___setstate_cython, __pyx_k_IndexBase___setstate_cython, sizeof(__pyx_k_IndexBase___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_IndexBase_clear, __pyx_k_IndexBase_clear, sizeof(__pyx_k_IndexBase_clear), 0, 0, 1, 1}, {&__pyx_n_s_IndexBase_compact, __pyx_k_IndexBase_compact, sizeof(__pyx_k_IndexBase_compact), 0, 0, 1, 1}, {&__pyx_n_s_IndexBase_get, __pyx_k_IndexBase_get, sizeof(__pyx_k_IndexBase_get), 0, 0, 1, 1}, {&__pyx_n_s_IndexBase_pop, __pyx_k_IndexBase_pop, sizeof(__pyx_k_IndexBase_pop), 0, 0, 1, 1}, {&__pyx_n_s_IndexBase_read, __pyx_k_IndexBase_read, sizeof(__pyx_k_IndexBase_read), 0, 0, 1, 1}, {&__pyx_n_s_IndexBase_setdefault, __pyx_k_IndexBase_setdefault, sizeof(__pyx_k_IndexBase_setdefault), 0, 0, 1, 1}, {&__pyx_n_s_IndexBase_size, __pyx_k_IndexBase_size, sizeof(__pyx_k_IndexBase_size), 0, 0, 1, 1}, {&__pyx_n_s_IndexBase_write, __pyx_k_IndexBase_write, sizeof(__pyx_k_IndexBase_write), 0, 0, 1, 1}, {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, {&__pyx_n_s_MAX_LOAD_FACTOR, __pyx_k_MAX_LOAD_FACTOR, sizeof(__pyx_k_MAX_LOAD_FACTOR), 0, 0, 1, 1}, {&__pyx_n_s_MAX_VALUE, __pyx_k_MAX_VALUE, sizeof(__pyx_k_MAX_VALUE), 0, 0, 1, 1}, {&__pyx_n_s_NSIndex, __pyx_k_NSIndex, sizeof(__pyx_k_NSIndex), 0, 0, 1, 1}, {&__pyx_n_s_NSIndex___reduce_cython, __pyx_k_NSIndex___reduce_cython, sizeof(__pyx_k_NSIndex___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_NSIndex___setstate_cython, __pyx_k_NSIndex___setstate_cython, sizeof(__pyx_k_NSIndex___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_NSIndex_iteritems, __pyx_k_NSIndex_iteritems, sizeof(__pyx_k_NSIndex_iteritems), 0, 0, 1, 1}, {&__pyx_n_s_NSKeyIterator, __pyx_k_NSKeyIterator, sizeof(__pyx_k_NSKeyIterator), 0, 0, 1, 1}, {&__pyx_n_s_NSKeyIterator___reduce_cython, __pyx_k_NSKeyIterator___reduce_cython, sizeof(__pyx_k_NSKeyIterator___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_NSKeyIterator___setstate_cython, __pyx_k_NSKeyIterator___setstate_cython, sizeof(__pyx_k_NSKeyIterator___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_n_s__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 0, 1, 1}, {&__pyx_n_s__61, __pyx_k__61, sizeof(__pyx_k__61), 0, 0, 1, 1}, {&__pyx_kp_u__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 1, 0, 0}, {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_borg_hashindex, __pyx_k_borg_hashindex, sizeof(__pyx_k_borg_hashindex), 0, 0, 1, 1}, {&__pyx_kp_s_cache_sync_feed_failed, __pyx_k_cache_sync_feed_failed, sizeof(__pyx_k_cache_sync_feed_failed), 0, 0, 1, 0}, {&__pyx_kp_s_cache_sync_init_failed, __pyx_k_cache_sync_init_failed, sizeof(__pyx_k_cache_sync_init_failed), 0, 0, 1, 0}, {&__pyx_n_s_capacity, __pyx_k_capacity, sizeof(__pyx_k_capacity), 0, 0, 1, 1}, {&__pyx_n_s_chunk, __pyx_k_chunk, sizeof(__pyx_k_chunk), 0, 0, 1, 1}, {&__pyx_n_s_chunk_buf, __pyx_k_chunk_buf, sizeof(__pyx_k_chunk_buf), 0, 0, 1, 1}, {&__pyx_n_s_chunk_csize, __pyx_k_chunk_csize, sizeof(__pyx_k_chunk_csize), 0, 0, 1, 1}, {&__pyx_n_s_chunk_size, __pyx_k_chunk_size, sizeof(__pyx_k_chunk_size), 0, 0, 1, 1}, {&__pyx_n_s_chunks, __pyx_k_chunks, sizeof(__pyx_k_chunks), 0, 0, 1, 1}, {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1}, {&__pyx_n_s_clear, __pyx_k_clear, sizeof(__pyx_k_clear), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_cls, __pyx_k_cls, sizeof(__pyx_k_cls), 0, 0, 1, 1}, {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1}, {&__pyx_n_s_compact, __pyx_k_compact, sizeof(__pyx_k_compact), 0, 0, 1, 1}, {&__pyx_n_s_csize, __pyx_k_csize, sizeof(__pyx_k_csize), 0, 0, 1, 1}, {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, {&__pyx_n_s_decref, __pyx_k_decref, sizeof(__pyx_k_decref), 0, 0, 1, 1}, {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1}, {&__pyx_n_s_entries, __pyx_k_entries, sizeof(__pyx_k_entries), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1}, {&__pyx_n_s_fd, __pyx_k_fd, sizeof(__pyx_k_fd), 0, 0, 1, 1}, {&__pyx_n_s_feed, __pyx_k_feed, sizeof(__pyx_k_feed), 0, 0, 1, 1}, {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_kp_s_hashindex_delete_failed, __pyx_k_hashindex_delete_failed, sizeof(__pyx_k_hashindex_delete_failed), 0, 0, 1, 0}, {&__pyx_kp_s_hashindex_init_failed, __pyx_k_hashindex_init_failed, sizeof(__pyx_k_hashindex_init_failed), 0, 0, 1, 0}, {&__pyx_kp_s_hashindex_read_returned_NULL_wit, __pyx_k_hashindex_read_returned_NULL_wit, sizeof(__pyx_k_hashindex_read_returned_NULL_wit), 0, 0, 1, 0}, {&__pyx_kp_s_hashindex_set_failed, __pyx_k_hashindex_set_failed, sizeof(__pyx_k_hashindex_set_failed), 0, 0, 1, 0}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_incref, __pyx_k_incref, sizeof(__pyx_k_incref), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_kp_s_invalid_reference_count, __pyx_k_invalid_reference_count, sizeof(__pyx_k_invalid_reference_count), 0, 0, 1, 0}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, {&__pyx_n_s_iter, __pyx_k_iter, sizeof(__pyx_k_iter), 0, 0, 1, 1}, {&__pyx_n_s_iteritems, __pyx_k_iteritems, sizeof(__pyx_k_iteritems), 0, 0, 1, 1}, {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, {&__pyx_n_s_key_size, __pyx_k_key_size, sizeof(__pyx_k_key_size), 0, 0, 1, 1}, {&__pyx_n_s_key_size_2, __pyx_k_key_size_2, sizeof(__pyx_k_key_size_2), 0, 0, 1, 1}, {&__pyx_n_s_locale, __pyx_k_locale, sizeof(__pyx_k_locale), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_marker, __pyx_k_marker, sizeof(__pyx_k_marker), 0, 0, 1, 1}, {&__pyx_n_s_master, __pyx_k_master, sizeof(__pyx_k_master), 0, 0, 1, 1}, {&__pyx_n_s_master_index, __pyx_k_master_index, sizeof(__pyx_k_master_index), 0, 0, 1, 1}, {&__pyx_n_s_master_values, __pyx_k_master_values, sizeof(__pyx_k_master_values), 0, 0, 1, 1}, {&__pyx_kp_s_maximum_number_of_segments_reach, __pyx_k_maximum_number_of_segments_reach, sizeof(__pyx_k_maximum_number_of_segments_reach), 0, 0, 1, 0}, {&__pyx_kp_s_maximum_number_of_versions_reach, __pyx_k_maximum_number_of_versions_reach, sizeof(__pyx_k_maximum_number_of_versions_reach), 0, 0, 1, 0}, {&__pyx_n_s_merge, __pyx_k_merge, sizeof(__pyx_k_merge), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_namedtuple, __pyx_k_namedtuple, sizeof(__pyx_k_namedtuple), 0, 0, 1, 1}, {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1}, {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, {&__pyx_n_s_other, __pyx_k_other, sizeof(__pyx_k_other), 0, 0, 1, 1}, {&__pyx_n_s_our_refcount, __pyx_k_our_refcount, sizeof(__pyx_k_our_refcount), 0, 0, 1, 1}, {&__pyx_n_s_our_values, __pyx_k_our_values, sizeof(__pyx_k_our_values), 0, 0, 1, 1}, {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, {&__pyx_n_s_permit_compact, __pyx_k_permit_compact, sizeof(__pyx_k_permit_compact), 0, 0, 1, 1}, {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1}, {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_rb, __pyx_k_rb, sizeof(__pyx_k_rb), 0, 0, 1, 1}, {&__pyx_n_s_rc, __pyx_k_rc, sizeof(__pyx_k_rc), 0, 0, 1, 1}, {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, {&__pyx_n_s_refcount, __pyx_k_refcount, sizeof(__pyx_k_refcount), 0, 0, 1, 1}, {&__pyx_kp_s_refcount_size_csize, __pyx_k_refcount_size_csize, sizeof(__pyx_k_refcount_size_csize), 0, 0, 1, 0}, {&__pyx_n_s_refs, __pyx_k_refs, sizeof(__pyx_k_refs), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_setdefault, __pyx_k_setdefault, sizeof(__pyx_k_setdefault), 0, 0, 1, 1}, {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_kp_s_src_borg_hashindex_pyx, __pyx_k_src_borg_hashindex_pyx, sizeof(__pyx_k_src_borg_hashindex_pyx), 0, 0, 1, 0}, {&__pyx_n_s_stats_against, __pyx_k_stats_against, sizeof(__pyx_k_stats_against), 0, 0, 1, 1}, {&__pyx_kp_s_stats_against_key_contained_in_s, __pyx_k_stats_against_key_contained_in_s, sizeof(__pyx_k_stats_against_key_contained_in_s), 0, 0, 1, 0}, {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, {&__pyx_n_s_summarize, __pyx_k_summarize, sizeof(__pyx_k_summarize), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_unique_chunks, __pyx_k_unique_chunks, sizeof(__pyx_k_unique_chunks), 0, 0, 1, 1}, {&__pyx_n_s_unique_csize, __pyx_k_unique_csize, sizeof(__pyx_k_unique_csize), 0, 0, 1, 1}, {&__pyx_n_s_unique_size, __pyx_k_unique_size, sizeof(__pyx_k_unique_size), 0, 0, 1, 1}, {&__pyx_n_s_usable, __pyx_k_usable, sizeof(__pyx_k_usable), 0, 0, 1, 1}, {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, {&__pyx_n_s_value_size, __pyx_k_value_size, sizeof(__pyx_k_value_size), 0, 0, 1, 1}, {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, {&__pyx_n_s_wb, __pyx_k_wb, sizeof(__pyx_k_wb), 0, 0, 1, 1}, {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1}, {&__pyx_n_s_zero_csize_ids, __pyx_k_zero_csize_ids, sizeof(__pyx_k_zero_csize_ids), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 60, __pyx_L1_error) __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 77, __pyx_L1_error) __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) __PYX_ERR(0, 96, __pyx_L1_error) __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 140, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 241, __pyx_L1_error) __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 263, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 410, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "borg/hashindex.pyx":96 * if path: * if isinstance(path, (str, bytes)): * with open(path, 'rb') as fd: # <<<<<<<<<<<<<< * self.index = hashindex_read(fd, permit_compact) * else: */ __pyx_tuple_ = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "borg/hashindex.pyx":106 * self.index = hashindex_init(capacity, self.key_size, self.value_size) * if not self.index: * raise Exception('hashindex_init failed') # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_hashindex_init_failed); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "borg/hashindex.pyx":142 * raise KeyError(key) * if rc == 0: * raise Exception('hashindex_delete failed') # <<<<<<<<<<<<<< * * def get(self, key, default=None): */ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_hashindex_delete_failed); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "borg/hashindex.pyx":190 * assert data.version <= _MAX_VALUE, "maximum number of versions reached" * if not PyBytes_CheckExact(value[1]) or PyBytes_GET_SIZE(value[1]) != 16: * raise TypeError("Expected bytes of length 16 for second value") # <<<<<<<<<<<<<< * memcpy(data.hash, PyBytes_AS_STRING(value[1]), 16) * data.version = _htole32(data.version) */ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_Expected_bytes_of_length_16_for); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); /* "borg/hashindex.pyx":194 * data.version = _htole32(data.version) * if not hashindex_set(self.index, key, &data): * raise Exception('hashindex_set failed') # <<<<<<<<<<<<<< * * def __contains__(self, key): */ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_hashindex_set_failed); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); /* "borg/hashindex.pyx":410 * master_values = hashindex_get(master, key) * if not master_values: * raise ValueError('stats_against: key contained in self but not in master_index.') # <<<<<<<<<<<<<< * our_refcount = _le32toh(our_values[0]) * chunk_size = _le32toh(master_values[1]) */ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_stats_against_key_contained_in_s); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); /* "borg/hashindex.pyx":518 * self.sync = cache_sync_init(self.chunks.index) * if not self.sync: * raise Exception('cache_sync_init failed') # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_cache_sync_init_failed); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); /* "borg/hashindex.pyx":112 * hashindex_free(self.index) * * @classmethod # <<<<<<<<<<<<<< * def read(cls, path, permit_compact=False): * return cls(path=path, permit_compact=permit_compact) */ __pyx_tuple__11 = PyTuple_Pack(3, __pyx_n_s_cls, __pyx_n_s_path, __pyx_n_s_permit_compact); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_hashindex_pyx, __pyx_n_s_read, 112, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 112, __pyx_L1_error) __pyx_tuple__13 = PyTuple_Pack(1, Py_False); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); /* "borg/hashindex.pyx":116 * return cls(path=path, permit_compact=permit_compact) * * def write(self, path): # <<<<<<<<<<<<<< * if isinstance(path, (str, bytes)): * with open(path, 'wb') as fd: */ __pyx_tuple__14 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_path, __pyx_n_s_fd); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_hashindex_pyx, __pyx_n_s_write, 116, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 116, __pyx_L1_error) /* "borg/hashindex.pyx":123 * hashindex_write(self.index, path) * * def clear(self): # <<<<<<<<<<<<<< * hashindex_free(self.index) * self.index = hashindex_init(0, self.key_size, self.value_size) */ __pyx_tuple__16 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_hashindex_pyx, __pyx_n_s_clear, 123, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 123, __pyx_L1_error) /* "borg/hashindex.pyx":129 * raise Exception('hashindex_init failed') * * def setdefault(self, key, value): # <<<<<<<<<<<<<< * if not key in self: * self[key] = value */ __pyx_tuple__18 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_value); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_hashindex_pyx, __pyx_n_s_setdefault, 129, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 129, __pyx_L1_error) /* "borg/hashindex.pyx":144 * raise Exception('hashindex_delete failed') * * def get(self, key, default=None): # <<<<<<<<<<<<<< * try: * return self[key] */ __pyx_tuple__20 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_default); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_hashindex_pyx, __pyx_n_s_get, 144, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 144, __pyx_L1_error) __pyx_tuple__22 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); /* "borg/hashindex.pyx":150 * return default * * def pop(self, key, default=_NoDefault): # <<<<<<<<<<<<<< * try: * value = self[key] */ __pyx_tuple__23 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_default, __pyx_n_s_value); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23); __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_hashindex_pyx, __pyx_n_s_pop, 150, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 150, __pyx_L1_error) /* "borg/hashindex.pyx":163 * return hashindex_len(self.index) * * def size(self): # <<<<<<<<<<<<<< * """Return size (bytes) of hash table.""" * return hashindex_size(self.index) */ __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_hashindex_pyx, __pyx_n_s_size, 163, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 163, __pyx_L1_error) /* "borg/hashindex.pyx":167 * return hashindex_size(self.index) * * def compact(self): # <<<<<<<<<<<<<< * return hashindex_compact(self.index) * */ __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_hashindex_pyx, __pyx_n_s_compact, 167, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 167, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_tuple__28 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__28); __Pyx_GIVEREF(__pyx_tuple__28); __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(1, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(1, 3, __pyx_L1_error) /* "borg/hashindex.pyx":233 * return data != NULL * * def iteritems(self, marker=None): # <<<<<<<<<<<<<< * cdef const unsigned char *key * iter = NSKeyIterator(self.key_size) */ __pyx_tuple__32 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_marker, __pyx_n_s_key, __pyx_n_s_iter); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__32); __Pyx_GIVEREF(__pyx_tuple__32); __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_hashindex_pyx, __pyx_n_s_iteritems, 233, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 233, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(1, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(1, 3, __pyx_L1_error) /* "borg/hashindex.pyx":274 * * * ChunkIndexEntry = namedtuple('ChunkIndexEntry', 'refcount size csize') # <<<<<<<<<<<<<< * * */ __pyx_tuple__38 = PyTuple_Pack(2, __pyx_n_s_ChunkIndexEntry, __pyx_kp_s_refcount_size_csize); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__38); __Pyx_GIVEREF(__pyx_tuple__38); /* "borg/hashindex.pyx":323 * return data != NULL * * def incref(self, key): # <<<<<<<<<<<<<< * """Increase refcount for 'key', return (refcount, size, csize)""" * assert len(key) == self.key_size */ __pyx_tuple__39 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_data, __pyx_n_s_refcount); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__39); __Pyx_GIVEREF(__pyx_tuple__39); __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_hashindex_pyx, __pyx_n_s_incref, 323, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 323, __pyx_L1_error) /* "borg/hashindex.pyx":336 * return refcount, _le32toh(data[1]), _le32toh(data[2]) * * def decref(self, key): # <<<<<<<<<<<<<< * """Decrease refcount for 'key', return (refcount, size, csize)""" * assert len(key) == self.key_size */ __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_hashindex_pyx, __pyx_n_s_decref, 336, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 336, __pyx_L1_error) /* "borg/hashindex.pyx":350 * return refcount, _le32toh(data[1]), _le32toh(data[2]) * * def iteritems(self, marker=None): # <<<<<<<<<<<<<< * cdef const unsigned char *key * iter = ChunkKeyIterator(self.key_size) */ __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_hashindex_pyx, __pyx_n_s_iteritems, 350, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 350, __pyx_L1_error) /* "borg/hashindex.pyx":362 * return iter * * def summarize(self): # <<<<<<<<<<<<<< * cdef uint64_t size = 0, csize = 0, unique_size = 0, unique_csize = 0, chunks = 0, unique_chunks = 0 * cdef uint32_t *values */ __pyx_tuple__43 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_size, __pyx_n_s_csize, __pyx_n_s_unique_size, __pyx_n_s_unique_csize, __pyx_n_s_chunks, __pyx_n_s_unique_chunks, __pyx_n_s_values, __pyx_n_s_refcount, __pyx_n_s_key); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__43); __Pyx_GIVEREF(__pyx_tuple__43); __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_hashindex_pyx, __pyx_n_s_summarize, 362, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 362, __pyx_L1_error) /* "borg/hashindex.pyx":384 * return size, csize, unique_size, unique_csize, unique_chunks, chunks * * def stats_against(self, ChunkIndex master_index): # <<<<<<<<<<<<<< * """ * Calculate chunk statistics of this index against *master_index*. */ __pyx_tuple__45 = PyTuple_Pack(15, __pyx_n_s_self, __pyx_n_s_master_index, __pyx_n_s_size, __pyx_n_s_csize, __pyx_n_s_unique_size, __pyx_n_s_unique_csize, __pyx_n_s_chunks, __pyx_n_s_unique_chunks, __pyx_n_s_our_refcount, __pyx_n_s_chunk_size, __pyx_n_s_chunk_csize, __pyx_n_s_our_values, __pyx_n_s_master_values, __pyx_n_s_key, __pyx_n_s_master); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__45); __Pyx_GIVEREF(__pyx_tuple__45); __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_hashindex_pyx, __pyx_n_s_stats_against, 384, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 384, __pyx_L1_error) /* "borg/hashindex.pyx":426 * return size, csize, unique_size, unique_csize, unique_chunks, chunks * * def add(self, key, refs, size, csize): # <<<<<<<<<<<<<< * assert len(key) == self.key_size * cdef uint32_t[3] data */ __pyx_tuple__47 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_refs, __pyx_n_s_size, __pyx_n_s_csize, __pyx_n_s_data); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__47); __Pyx_GIVEREF(__pyx_tuple__47); __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_hashindex_pyx, __pyx_n_s_add, 426, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 426, __pyx_L1_error) /* "borg/hashindex.pyx":450 * raise Exception('hashindex_set failed') * * def merge(self, ChunkIndex other): # <<<<<<<<<<<<<< * cdef unsigned char *key = NULL * */ __pyx_tuple__49 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_other, __pyx_n_s_key); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__49); __Pyx_GIVEREF(__pyx_tuple__49); __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_hashindex_pyx, __pyx_n_s_merge, 450, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 450, __pyx_L1_error) /* "borg/hashindex.pyx":459 * self._add(key, (key + self.key_size)) * * def zero_csize_ids(self): # <<<<<<<<<<<<<< * cdef unsigned char *key = NULL * cdef uint32_t *values */ __pyx_tuple__51 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_values, __pyx_n_s_entries, __pyx_n_s_refcount); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 459, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__51); __Pyx_GIVEREF(__pyx_tuple__51); __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_hashindex_pyx, __pyx_n_s_zero_csize_ids, 459, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 459, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(1, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(1, 3, __pyx_L1_error) /* "borg/hashindex.pyx":524 * cache_sync_free(self.sync) * * def feed(self, chunk): # <<<<<<<<<<<<<< * cdef Py_buffer chunk_buf = ro_buffer(chunk) * cdef int rc */ __pyx_tuple__57 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_chunk, __pyx_n_s_chunk_buf, __pyx_n_s_rc, __pyx_n_s_error); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__57); __Pyx_GIVEREF(__pyx_tuple__57); __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_hashindex_pyx, __pyx_n_s_feed, 524, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 524, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_12 = PyInt_FromLong(12); if (unlikely(!__pyx_int_12)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_20 = PyInt_FromLong(20); if (unlikely(!__pyx_int_20)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_32 = PyInt_FromLong(32); if (unlikely(!__pyx_int_32)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_4294967295 = PyInt_FromString((char *)"4294967295", 0, 0); if (unlikely(!__pyx_int_4294967295)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { /* AssertionsEnabled.init */ if (likely(__Pyx_init_assertions_enabled() == 0)); else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __pyx_v_4borg_9hashindex__NoDefault = Py_None; Py_INCREF(Py_None); __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS __pyx_ptype_4borg_9hashindex_IndexBase = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4borg_9hashindex_IndexBase_spec, NULL); if (unlikely(!__pyx_ptype_4borg_9hashindex_IndexBase)) __PYX_ERR(0, 83, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4borg_9hashindex_IndexBase_spec, __pyx_ptype_4borg_9hashindex_IndexBase) < 0) __PYX_ERR(0, 83, __pyx_L1_error) #else __pyx_ptype_4borg_9hashindex_IndexBase = &__pyx_type_4borg_9hashindex_IndexBase; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_4borg_9hashindex_IndexBase) < 0) __PYX_ERR(0, 83, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_4borg_9hashindex_IndexBase->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4borg_9hashindex_IndexBase->tp_dictoffset && __pyx_ptype_4borg_9hashindex_IndexBase->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_4borg_9hashindex_IndexBase->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_4borg_9hashindex_IndexBase) < 0) __PYX_ERR(0, 83, __pyx_L1_error) #endif #if CYTHON_USE_TYPE_SPECS __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_4borg_9hashindex_IndexBase); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_4borg_9hashindex_FuseVersionsIndex = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4borg_9hashindex_FuseVersionsIndex_spec, __pyx_t_1); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_ptype_4borg_9hashindex_FuseVersionsIndex)) __PYX_ERR(0, 171, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4borg_9hashindex_FuseVersionsIndex_spec, __pyx_ptype_4borg_9hashindex_FuseVersionsIndex) < 0) __PYX_ERR(0, 171, __pyx_L1_error) #else __pyx_ptype_4borg_9hashindex_FuseVersionsIndex = &__pyx_type_4borg_9hashindex_FuseVersionsIndex; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_4borg_9hashindex_FuseVersionsIndex->tp_base = __pyx_ptype_4borg_9hashindex_IndexBase; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_4borg_9hashindex_FuseVersionsIndex) < 0) __PYX_ERR(0, 171, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_4borg_9hashindex_FuseVersionsIndex->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4borg_9hashindex_FuseVersionsIndex->tp_dictoffset && __pyx_ptype_4borg_9hashindex_FuseVersionsIndex->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_4borg_9hashindex_FuseVersionsIndex->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FuseVersionsIndex, (PyObject *) __pyx_ptype_4borg_9hashindex_FuseVersionsIndex) < 0) __PYX_ERR(0, 171, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_4borg_9hashindex_FuseVersionsIndex) < 0) __PYX_ERR(0, 171, __pyx_L1_error) #endif #if CYTHON_USE_TYPE_SPECS __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_4borg_9hashindex_IndexBase); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_4borg_9hashindex_NSIndex = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4borg_9hashindex_NSIndex_spec, __pyx_t_1); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_ptype_4borg_9hashindex_NSIndex)) __PYX_ERR(0, 201, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4borg_9hashindex_NSIndex_spec, __pyx_ptype_4borg_9hashindex_NSIndex) < 0) __PYX_ERR(0, 201, __pyx_L1_error) #else __pyx_ptype_4borg_9hashindex_NSIndex = &__pyx_type_4borg_9hashindex_NSIndex; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_4borg_9hashindex_NSIndex->tp_base = __pyx_ptype_4borg_9hashindex_IndexBase; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_4borg_9hashindex_NSIndex) < 0) __PYX_ERR(0, 201, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_4borg_9hashindex_NSIndex->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4borg_9hashindex_NSIndex->tp_dictoffset && __pyx_ptype_4borg_9hashindex_NSIndex->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_4borg_9hashindex_NSIndex->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_NSIndex, (PyObject *) __pyx_ptype_4borg_9hashindex_NSIndex) < 0) __PYX_ERR(0, 201, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_4borg_9hashindex_NSIndex) < 0) __PYX_ERR(0, 201, __pyx_L1_error) #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_4borg_9hashindex_NSKeyIterator = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4borg_9hashindex_NSKeyIterator_spec, NULL); if (unlikely(!__pyx_ptype_4borg_9hashindex_NSKeyIterator)) __PYX_ERR(0, 246, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4borg_9hashindex_NSKeyIterator_spec, __pyx_ptype_4borg_9hashindex_NSKeyIterator) < 0) __PYX_ERR(0, 246, __pyx_L1_error) #else __pyx_ptype_4borg_9hashindex_NSKeyIterator = &__pyx_type_4borg_9hashindex_NSKeyIterator; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_4borg_9hashindex_NSKeyIterator) < 0) __PYX_ERR(0, 246, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_4borg_9hashindex_NSKeyIterator->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4borg_9hashindex_NSKeyIterator->tp_dictoffset && __pyx_ptype_4borg_9hashindex_NSKeyIterator->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_4borg_9hashindex_NSKeyIterator->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_NSKeyIterator, (PyObject *) __pyx_ptype_4borg_9hashindex_NSKeyIterator) < 0) __PYX_ERR(0, 246, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_4borg_9hashindex_NSKeyIterator) < 0) __PYX_ERR(0, 246, __pyx_L1_error) #endif __pyx_vtabptr_4borg_9hashindex_ChunkIndex = &__pyx_vtable_4borg_9hashindex_ChunkIndex; __pyx_vtable_4borg_9hashindex_ChunkIndex._add = (PyObject *(*)(struct __pyx_obj_4borg_9hashindex_ChunkIndex *, unsigned char *, uint32_t *))__pyx_f_4borg_9hashindex_10ChunkIndex__add; #if CYTHON_USE_TYPE_SPECS __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_4borg_9hashindex_IndexBase); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_4borg_9hashindex_ChunkIndex = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4borg_9hashindex_ChunkIndex_spec, __pyx_t_1); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_ptype_4borg_9hashindex_ChunkIndex)) __PYX_ERR(0, 277, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4borg_9hashindex_ChunkIndex_spec, __pyx_ptype_4borg_9hashindex_ChunkIndex) < 0) __PYX_ERR(0, 277, __pyx_L1_error) #else __pyx_ptype_4borg_9hashindex_ChunkIndex = &__pyx_type_4borg_9hashindex_ChunkIndex; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_4borg_9hashindex_ChunkIndex->tp_base = __pyx_ptype_4borg_9hashindex_IndexBase; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_4borg_9hashindex_ChunkIndex) < 0) __PYX_ERR(0, 277, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_4borg_9hashindex_ChunkIndex->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4borg_9hashindex_ChunkIndex->tp_dictoffset && __pyx_ptype_4borg_9hashindex_ChunkIndex->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_4borg_9hashindex_ChunkIndex->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_4borg_9hashindex_ChunkIndex, __pyx_vtabptr_4borg_9hashindex_ChunkIndex) < 0) __PYX_ERR(0, 277, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_4borg_9hashindex_ChunkIndex) < 0) __PYX_ERR(0, 277, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ChunkIndex, (PyObject *) __pyx_ptype_4borg_9hashindex_ChunkIndex) < 0) __PYX_ERR(0, 277, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_4borg_9hashindex_ChunkIndex) < 0) __PYX_ERR(0, 277, __pyx_L1_error) #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_4borg_9hashindex_ChunkKeyIterator = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4borg_9hashindex_ChunkKeyIterator_spec, NULL); if (unlikely(!__pyx_ptype_4borg_9hashindex_ChunkKeyIterator)) __PYX_ERR(0, 476, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4borg_9hashindex_ChunkKeyIterator_spec, __pyx_ptype_4borg_9hashindex_ChunkKeyIterator) < 0) __PYX_ERR(0, 476, __pyx_L1_error) #else __pyx_ptype_4borg_9hashindex_ChunkKeyIterator = &__pyx_type_4borg_9hashindex_ChunkKeyIterator; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_4borg_9hashindex_ChunkKeyIterator) < 0) __PYX_ERR(0, 476, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_4borg_9hashindex_ChunkKeyIterator->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4borg_9hashindex_ChunkKeyIterator->tp_dictoffset && __pyx_ptype_4borg_9hashindex_ChunkKeyIterator->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_4borg_9hashindex_ChunkKeyIterator->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ChunkKeyIterator, (PyObject *) __pyx_ptype_4borg_9hashindex_ChunkKeyIterator) < 0) __PYX_ERR(0, 476, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_4borg_9hashindex_ChunkKeyIterator) < 0) __PYX_ERR(0, 476, __pyx_L1_error) #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_4borg_9hashindex_CacheSynchronizer = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4borg_9hashindex_CacheSynchronizer_spec, NULL); if (unlikely(!__pyx_ptype_4borg_9hashindex_CacheSynchronizer)) __PYX_ERR(0, 510, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4borg_9hashindex_CacheSynchronizer_spec, __pyx_ptype_4borg_9hashindex_CacheSynchronizer) < 0) __PYX_ERR(0, 510, __pyx_L1_error) #else __pyx_ptype_4borg_9hashindex_CacheSynchronizer = &__pyx_type_4borg_9hashindex_CacheSynchronizer; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_4borg_9hashindex_CacheSynchronizer) < 0) __PYX_ERR(0, 510, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_4borg_9hashindex_CacheSynchronizer->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4borg_9hashindex_CacheSynchronizer->tp_dictoffset && __pyx_ptype_4borg_9hashindex_CacheSynchronizer->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_4borg_9hashindex_CacheSynchronizer->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_CacheSynchronizer, (PyObject *) __pyx_ptype_4borg_9hashindex_CacheSynchronizer) < 0) __PYX_ERR(0, 510, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_4borg_9hashindex_CacheSynchronizer) < 0) __PYX_ERR(0, 510, __pyx_L1_error) #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_10(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_10(PyTypeObject), #elif CYTHON_COMPILING_IN_LIMITED_API sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_10(PyTypeObject), #else sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_10(PyHeapTypeObject), #endif __Pyx_ImportType_CheckSize_Warn_3_0_10); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_hashindex(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_hashindex}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "hashindex", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC inithashindex(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC inithashindex(void) #else __Pyx_PyMODINIT_FUNC PyInit_hashindex(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_hashindex(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_hashindex(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'hashindex' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("hashindex", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "hashindex" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_hashindex(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_borg__hashindex) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "borg.hashindex")) { if (unlikely((PyDict_SetItemString(modules, "borg.hashindex", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "borg/hashindex.pyx":2 * # -*- coding: utf-8 -*- * from collections import namedtuple # <<<<<<<<<<<<<< * import locale * import os */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_namedtuple); __Pyx_GIVEREF(__pyx_n_s_namedtuple); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_namedtuple)) __PYX_ERR(0, 2, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_collections, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_namedtuple); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_namedtuple, __pyx_t_2) < 0) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/hashindex.pyx":3 * # -*- coding: utf-8 -*- * from collections import namedtuple * import locale # <<<<<<<<<<<<<< * import os * */ __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_locale, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_locale, __pyx_t_3) < 0) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/hashindex.pyx":4 * from collections import namedtuple * import locale * import os # <<<<<<<<<<<<<< * * cimport cython */ __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_os, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_3) < 0) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/hashindex.pyx":14 * from cpython.bytes cimport PyBytes_FromStringAndSize, PyBytes_CheckExact, PyBytes_GET_SIZE, PyBytes_AS_STRING * * API_VERSION = '1.4_01' # <<<<<<<<<<<<<< * * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_API_VERSION, __pyx_kp_s_1_4_01) < 0) __PYX_ERR(0, 14, __pyx_L1_error) /* "borg/hashindex.pyx":60 * * * cdef _NoDefault = object() # <<<<<<<<<<<<<< * * """ */ __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_builtin_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_v_4borg_9hashindex__NoDefault); __Pyx_DECREF_SET(__pyx_v_4borg_9hashindex__NoDefault, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/hashindex.pyx":77 * """ * * assert UINT32_MAX == 2**32-1 # <<<<<<<<<<<<<< * * assert _MAX_VALUE % 2 == 1 */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = __Pyx_PyInt_From_uint32_t(UINT32_MAX); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_int_4294967295, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_4)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 77, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 77, __pyx_L1_error) #endif /* "borg/hashindex.pyx":79 * assert UINT32_MAX == 2**32-1 * * assert _MAX_VALUE % 2 == 1 # <<<<<<<<<<<<<< * * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_4 = (__Pyx_mod_long(_MAX_VALUE, 2) == 1); if (unlikely(!__pyx_t_4)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 79, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 79, __pyx_L1_error) #endif /* "borg/hashindex.pyx":87 * cdef int key_size * * _key_size = 32 # <<<<<<<<<<<<<< * * MAX_LOAD_FACTOR = HASH_MAX_LOAD */ if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_9hashindex_IndexBase, __pyx_n_s_key_size, __pyx_int_32) < 0) __PYX_ERR(0, 87, __pyx_L1_error) PyType_Modified(__pyx_ptype_4borg_9hashindex_IndexBase); /* "borg/hashindex.pyx":89 * _key_size = 32 * * MAX_LOAD_FACTOR = HASH_MAX_LOAD # <<<<<<<<<<<<<< * MAX_VALUE = _MAX_VALUE * */ __pyx_t_2 = PyFloat_FromDouble(HASH_MAX_LOAD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_9hashindex_IndexBase, __pyx_n_s_MAX_LOAD_FACTOR, __pyx_t_2) < 0) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_4borg_9hashindex_IndexBase); /* "borg/hashindex.pyx":90 * * MAX_LOAD_FACTOR = HASH_MAX_LOAD * MAX_VALUE = _MAX_VALUE # <<<<<<<<<<<<<< * * def __cinit__(self, capacity=0, path=None, permit_compact=False, usable=None): */ __pyx_t_2 = __Pyx_PyInt_From_uint32_t(_MAX_VALUE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_9hashindex_IndexBase, __pyx_n_s_MAX_VALUE, __pyx_t_2) < 0) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_4borg_9hashindex_IndexBase); /* "borg/hashindex.pyx":112 * hashindex_free(self.index) * * @classmethod # <<<<<<<<<<<<<< * def read(cls, path, permit_compact=False): * return cls(path=path, permit_compact=permit_compact) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_9hashindex_9IndexBase_5read, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IndexBase_read, NULL, __pyx_n_s_borg_hashindex, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__13); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_9hashindex_IndexBase, __pyx_n_s_read, __pyx_t_2) < 0) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_4borg_9hashindex_IndexBase); __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_4borg_9hashindex_IndexBase, __pyx_n_s_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_9hashindex_IndexBase, __pyx_n_s_read, __pyx_t_3) < 0) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_4borg_9hashindex_IndexBase); /* "borg/hashindex.pyx":116 * return cls(path=path, permit_compact=permit_compact) * * def write(self, path): # <<<<<<<<<<<<<< * if isinstance(path, (str, bytes)): * with open(path, 'wb') as fd: */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_9hashindex_9IndexBase_7write, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IndexBase_write, NULL, __pyx_n_s_borg_hashindex, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_9hashindex_IndexBase, __pyx_n_s_write, __pyx_t_3) < 0) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_4borg_9hashindex_IndexBase); /* "borg/hashindex.pyx":123 * hashindex_write(self.index, path) * * def clear(self): # <<<<<<<<<<<<<< * hashindex_free(self.index) * self.index = hashindex_init(0, self.key_size, self.value_size) */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_9hashindex_9IndexBase_9clear, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IndexBase_clear, NULL, __pyx_n_s_borg_hashindex, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_9hashindex_IndexBase, __pyx_n_s_clear, __pyx_t_3) < 0) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_4borg_9hashindex_IndexBase); /* "borg/hashindex.pyx":129 * raise Exception('hashindex_init failed') * * def setdefault(self, key, value): # <<<<<<<<<<<<<< * if not key in self: * self[key] = value */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_9hashindex_9IndexBase_11setdefault, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IndexBase_setdefault, NULL, __pyx_n_s_borg_hashindex, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_9hashindex_IndexBase, __pyx_n_s_setdefault, __pyx_t_3) < 0) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_4borg_9hashindex_IndexBase); /* "borg/hashindex.pyx":144 * raise Exception('hashindex_delete failed') * * def get(self, key, default=None): # <<<<<<<<<<<<<< * try: * return self[key] */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_9hashindex_9IndexBase_15get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IndexBase_get, NULL, __pyx_n_s_borg_hashindex, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__22); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_9hashindex_IndexBase, __pyx_n_s_get, __pyx_t_3) < 0) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_4borg_9hashindex_IndexBase); /* "borg/hashindex.pyx":150 * return default * * def pop(self, key, default=_NoDefault): # <<<<<<<<<<<<<< * try: * value = self[key] */ __Pyx_INCREF(__pyx_v_4borg_9hashindex__NoDefault); __pyx_k__4 = __pyx_v_4borg_9hashindex__NoDefault; __Pyx_GIVEREF(__pyx_v_4borg_9hashindex__NoDefault); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_4borg_9hashindex__NoDefault); __Pyx_GIVEREF(__pyx_v_4borg_9hashindex__NoDefault); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_4borg_9hashindex__NoDefault)) __PYX_ERR(0, 150, __pyx_L1_error); __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_9hashindex_9IndexBase_17pop, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IndexBase_pop, NULL, __pyx_n_s_borg_hashindex, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_9hashindex_IndexBase, __pyx_n_s_pop, __pyx_t_2) < 0) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_4borg_9hashindex_IndexBase); /* "borg/hashindex.pyx":163 * return hashindex_len(self.index) * * def size(self): # <<<<<<<<<<<<<< * """Return size (bytes) of hash table.""" * return hashindex_size(self.index) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_9hashindex_9IndexBase_21size, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IndexBase_size, NULL, __pyx_n_s_borg_hashindex, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_9hashindex_IndexBase, __pyx_n_s_size, __pyx_t_2) < 0) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_4borg_9hashindex_IndexBase); /* "borg/hashindex.pyx":167 * return hashindex_size(self.index) * * def compact(self): # <<<<<<<<<<<<<< * return hashindex_compact(self.index) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_9hashindex_9IndexBase_23compact, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IndexBase_compact, NULL, __pyx_n_s_borg_hashindex, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_9hashindex_IndexBase, __pyx_n_s_compact, __pyx_t_2) < 0) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_4borg_9hashindex_IndexBase); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_9hashindex_9IndexBase_25__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IndexBase___reduce_cython, NULL, __pyx_n_s_borg_hashindex, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_9hashindex_9IndexBase_27__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IndexBase___setstate_cython, NULL, __pyx_n_s_borg_hashindex, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/hashindex.pyx":173 * cdef class FuseVersionsIndex(IndexBase): * # 4 byte version + 16 byte file contents hash * value_size = 20 # <<<<<<<<<<<<<< * _key_size = 16 * */ if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_9hashindex_FuseVersionsIndex, __pyx_n_s_value_size, __pyx_int_20) < 0) __PYX_ERR(0, 173, __pyx_L1_error) PyType_Modified(__pyx_ptype_4borg_9hashindex_FuseVersionsIndex); /* "borg/hashindex.pyx":174 * # 4 byte version + 16 byte file contents hash * value_size = 20 * _key_size = 16 # <<<<<<<<<<<<<< * * def __getitem__(self, key): */ if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_9hashindex_FuseVersionsIndex, __pyx_n_s_key_size, __pyx_int_16) < 0) __PYX_ERR(0, 174, __pyx_L1_error) PyType_Modified(__pyx_ptype_4borg_9hashindex_FuseVersionsIndex); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_9hashindex_17FuseVersionsIndex_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FuseVersionsIndex___reduce_cytho, NULL, __pyx_n_s_borg_hashindex, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_9hashindex_17FuseVersionsIndex_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FuseVersionsIndex___setstate_cyt, NULL, __pyx_n_s_borg_hashindex, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/hashindex.pyx":203 * cdef class NSIndex(IndexBase): * * value_size = 8 # <<<<<<<<<<<<<< * * def __getitem__(self, key): */ if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_9hashindex_NSIndex, __pyx_n_s_value_size, __pyx_int_8) < 0) __PYX_ERR(0, 203, __pyx_L1_error) PyType_Modified(__pyx_ptype_4borg_9hashindex_NSIndex); /* "borg/hashindex.pyx":233 * return data != NULL * * def iteritems(self, marker=None): # <<<<<<<<<<<<<< * cdef const unsigned char *key * iter = NSKeyIterator(self.key_size) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_9hashindex_7NSIndex_7iteritems, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_NSIndex_iteritems, NULL, __pyx_n_s_borg_hashindex, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__22); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_9hashindex_NSIndex, __pyx_n_s_iteritems, __pyx_t_2) < 0) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_4borg_9hashindex_NSIndex); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_9hashindex_7NSIndex_9__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_NSIndex___reduce_cython, NULL, __pyx_n_s_borg_hashindex, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_9hashindex_7NSIndex_11__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_NSIndex___setstate_cython, NULL, __pyx_n_s_borg_hashindex, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_9hashindex_13NSKeyIterator_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_NSKeyIterator___reduce_cython, NULL, __pyx_n_s_borg_hashindex, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_9hashindex_13NSKeyIterator_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_NSKeyIterator___setstate_cython, NULL, __pyx_n_s_borg_hashindex, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/hashindex.pyx":274 * * * ChunkIndexEntry = namedtuple('ChunkIndexEntry', 'refcount size csize') # <<<<<<<<<<<<<< * * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_namedtuple); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_ChunkIndexEntry, __pyx_t_3) < 0) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/hashindex.pyx":294 * """ * * value_size = 12 # <<<<<<<<<<<<<< * * def __getitem__(self, key): */ if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_9hashindex_ChunkIndex, __pyx_n_s_value_size, __pyx_int_12) < 0) __PYX_ERR(0, 294, __pyx_L1_error) PyType_Modified(__pyx_ptype_4borg_9hashindex_ChunkIndex); /* "borg/hashindex.pyx":323 * return data != NULL * * def incref(self, key): # <<<<<<<<<<<<<< * """Increase refcount for 'key', return (refcount, size, csize)""" * assert len(key) == self.key_size */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_9hashindex_10ChunkIndex_7incref, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ChunkIndex_incref, NULL, __pyx_n_s_borg_hashindex, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_9hashindex_ChunkIndex, __pyx_n_s_incref, __pyx_t_3) < 0) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_4borg_9hashindex_ChunkIndex); /* "borg/hashindex.pyx":336 * return refcount, _le32toh(data[1]), _le32toh(data[2]) * * def decref(self, key): # <<<<<<<<<<<<<< * """Decrease refcount for 'key', return (refcount, size, csize)""" * assert len(key) == self.key_size */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_9hashindex_10ChunkIndex_9decref, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ChunkIndex_decref, NULL, __pyx_n_s_borg_hashindex, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_9hashindex_ChunkIndex, __pyx_n_s_decref, __pyx_t_3) < 0) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_4borg_9hashindex_ChunkIndex); /* "borg/hashindex.pyx":350 * return refcount, _le32toh(data[1]), _le32toh(data[2]) * * def iteritems(self, marker=None): # <<<<<<<<<<<<<< * cdef const unsigned char *key * iter = ChunkKeyIterator(self.key_size) */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_9hashindex_10ChunkIndex_11iteritems, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ChunkIndex_iteritems, NULL, __pyx_n_s_borg_hashindex, __pyx_d, ((PyObject *)__pyx_codeobj__42)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__22); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_9hashindex_ChunkIndex, __pyx_n_s_iteritems, __pyx_t_3) < 0) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_4borg_9hashindex_ChunkIndex); /* "borg/hashindex.pyx":362 * return iter * * def summarize(self): # <<<<<<<<<<<<<< * cdef uint64_t size = 0, csize = 0, unique_size = 0, unique_csize = 0, chunks = 0, unique_chunks = 0 * cdef uint32_t *values */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_9hashindex_10ChunkIndex_13summarize, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ChunkIndex_summarize, NULL, __pyx_n_s_borg_hashindex, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_9hashindex_ChunkIndex, __pyx_n_s_summarize, __pyx_t_3) < 0) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_4borg_9hashindex_ChunkIndex); /* "borg/hashindex.pyx":384 * return size, csize, unique_size, unique_csize, unique_chunks, chunks * * def stats_against(self, ChunkIndex master_index): # <<<<<<<<<<<<<< * """ * Calculate chunk statistics of this index against *master_index*. */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_9hashindex_10ChunkIndex_15stats_against, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ChunkIndex_stats_against, NULL, __pyx_n_s_borg_hashindex, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_9hashindex_ChunkIndex, __pyx_n_s_stats_against, __pyx_t_3) < 0) __PYX_ERR(0, 384, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_4borg_9hashindex_ChunkIndex); /* "borg/hashindex.pyx":426 * return size, csize, unique_size, unique_csize, unique_chunks, chunks * * def add(self, key, refs, size, csize): # <<<<<<<<<<<<<< * assert len(key) == self.key_size * cdef uint32_t[3] data */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_9hashindex_10ChunkIndex_17add, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ChunkIndex_add, NULL, __pyx_n_s_borg_hashindex, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_9hashindex_ChunkIndex, __pyx_n_s_add, __pyx_t_3) < 0) __PYX_ERR(0, 426, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_4borg_9hashindex_ChunkIndex); /* "borg/hashindex.pyx":450 * raise Exception('hashindex_set failed') * * def merge(self, ChunkIndex other): # <<<<<<<<<<<<<< * cdef unsigned char *key = NULL * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_9hashindex_10ChunkIndex_19merge, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ChunkIndex_merge, NULL, __pyx_n_s_borg_hashindex, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_9hashindex_ChunkIndex, __pyx_n_s_merge, __pyx_t_3) < 0) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_4borg_9hashindex_ChunkIndex); /* "borg/hashindex.pyx":459 * self._add(key, (key + self.key_size)) * * def zero_csize_ids(self): # <<<<<<<<<<<<<< * cdef unsigned char *key = NULL * cdef uint32_t *values */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_9hashindex_10ChunkIndex_21zero_csize_ids, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ChunkIndex_zero_csize_ids, NULL, __pyx_n_s_borg_hashindex, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 459, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_9hashindex_ChunkIndex, __pyx_n_s_zero_csize_ids, __pyx_t_3) < 0) __PYX_ERR(0, 459, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_4borg_9hashindex_ChunkIndex); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_9hashindex_10ChunkIndex_23__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ChunkIndex___reduce_cython, NULL, __pyx_n_s_borg_hashindex, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_9hashindex_10ChunkIndex_25__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ChunkIndex___setstate_cython, NULL, __pyx_n_s_borg_hashindex, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_9hashindex_16ChunkKeyIterator_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ChunkKeyIterator___reduce_cython, NULL, __pyx_n_s_borg_hashindex, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_9hashindex_16ChunkKeyIterator_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ChunkKeyIterator___setstate_cyth, NULL, __pyx_n_s_borg_hashindex, __pyx_d, ((PyObject *)__pyx_codeobj__56)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/hashindex.pyx":524 * cache_sync_free(self.sync) * * def feed(self, chunk): # <<<<<<<<<<<<<< * cdef Py_buffer chunk_buf = ro_buffer(chunk) * cdef int rc */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_9hashindex_17CacheSynchronizer_5feed, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_CacheSynchronizer_feed, NULL, __pyx_n_s_borg_hashindex, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4borg_9hashindex_CacheSynchronizer, __pyx_n_s_feed, __pyx_t_3) < 0) __PYX_ERR(0, 524, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_4borg_9hashindex_CacheSynchronizer); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_9hashindex_17CacheSynchronizer_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_CacheSynchronizer___reduce_cytho, NULL, __pyx_n_s_borg_hashindex, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_9hashindex_17CacheSynchronizer_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_CacheSynchronizer___setstate_cyt, NULL, __pyx_n_s_borg_hashindex, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/hashindex.pyx":1 * # -*- coding: utf-8 -*- # <<<<<<<<<<<<<< * from collections import namedtuple * import locale */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init borg.hashindex", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init borg.hashindex"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectLookupSpecial */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) { PyObject *res; PyTypeObject *tp = Py_TYPE(obj); #if PY_MAJOR_VERSION < 3 if (unlikely(PyInstance_Check(obj))) return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name); #endif res = _PyType_Lookup(tp, attr_name); if (likely(res)) { descrgetfunc f = Py_TYPE(res)->tp_descr_get; if (!f) { Py_INCREF(res); } else { res = f(res, obj, (PyObject *)tp); } } else if (with_error) { PyErr_SetObject(PyExc_AttributeError, attr_name); } return res; } #endif /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* GetTopmostException */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) { _PyErr_StackItem *exc_info = tstate->exc_info; while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && exc_info->previous_item != NULL) { exc_info = exc_info->previous_item; } return exc_info; } #endif /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); PyObject *exc_value = exc_info->exc_value; if (exc_value == NULL || exc_value == Py_None) { *value = NULL; *type = NULL; *tb = NULL; } else { *value = exc_value; Py_INCREF(*value); *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); *tb = PyException_GetTraceback(exc_value); } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); *type = exc_info->exc_type; *value = exc_info->exc_value; *tb = exc_info->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #else *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #endif } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; PyObject *tmp_value = exc_info->exc_value; exc_info->exc_value = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = type; exc_info->exc_value = value; exc_info->exc_traceback = tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } #endif /* GetException */ #if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) #endif { PyObject *local_type = NULL, *local_value, *local_tb = NULL; #if CYTHON_FAST_THREAD_STATE PyObject *tmp_type, *tmp_value, *tmp_tb; #if PY_VERSION_HEX >= 0x030C00A6 local_value = tstate->current_exception; tstate->current_exception = 0; if (likely(local_value)) { local_type = (PyObject*) Py_TYPE(local_value); Py_INCREF(local_type); local_tb = PyException_GetTraceback(local_value); } #else local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 if (unlikely(tstate->current_exception)) #elif CYTHON_FAST_THREAD_STATE if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE #if CYTHON_USE_EXC_INFO_STACK { _PyErr_StackItem *exc_info = tstate->exc_info; #if PY_VERSION_HEX >= 0x030B00a4 tmp_value = exc_info->exc_value; exc_info->exc_value = local_value; tmp_type = NULL; tmp_tb = NULL; Py_XDECREF(local_type); Py_XDECREF(local_tb); #else tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = local_type; exc_info->exc_value = local_value; exc_info->exc_traceback = local_tb; #endif } #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* KeywordStringCheck */ static int __Pyx_CheckKeywordStrings( PyObject *kw, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0)) goto invalid_keyword; return 1; #else if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) { Py_ssize_t kwsize; #if CYTHON_ASSUME_SAFE_MACROS kwsize = PyTuple_GET_SIZE(kw); #else kwsize = PyTuple_Size(kw); if (kwsize < 0) return 0; #endif if (unlikely(kwsize == 0)) return 1; if (!kw_allowed) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, 0); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif goto invalid_keyword; } #if PY_VERSION_HEX < 0x03090000 for (pos = 0; pos < kwsize; pos++) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, pos); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } #endif return 1; } while (PyDict_Next(kw, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if (!kw_allowed && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } /* GetItemInt */ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (unlikely(!j)) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_subscript) { PyObject *r, *key = PyInt_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); return r; } if (likely(sm && sm->sq_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return sm->sq_item(o, i); } } #else if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* ObjectGetItem */ #if CYTHON_USE_TYPE_SLOTS static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { PyObject *runerr = NULL; Py_ssize_t key_value; key_value = __Pyx_PyIndex_AsSsize_t(index); if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); } if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index)); PyErr_Clear(); PyErr_Format(PyExc_IndexError, "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name); __Pyx_DECREF_TypeName(index_type_name); } return NULL; } static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { __Pyx_TypeName obj_type_name; if (likely(PyType_Check(obj))) { PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem); if (!meth) { PyErr_Clear(); } else { PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); Py_DECREF(meth); return result; } } obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); return NULL; } static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { PyTypeObject *tp = Py_TYPE(obj); PyMappingMethods *mm = tp->tp_as_mapping; PySequenceMethods *sm = tp->tp_as_sequence; if (likely(mm && mm->mp_subscript)) { return mm->mp_subscript(obj, key); } if (likely(sm && sm->sq_item)) { return __Pyx_PyObject_GetIndex(obj, key); } return __Pyx_PyObject_GetItem_Slow(obj, key); } #endif /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* ArgTypeTest */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) { __Pyx_TypeName type_name; __Pyx_TypeName obj_type_name; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } else if (exact) { #if PY_MAJOR_VERSION == 2 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(__Pyx_TypeCheck(obj, type))) return 1; } type_name = __Pyx_PyType_GetName(type); obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); __Pyx_DECREF_TypeName(type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; } /* ExtTypeTest */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { __Pyx_TypeName obj_type_name; __Pyx_TypeName type_name; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (likely(__Pyx_TypeCheck(obj, type))) return 1; obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); type_name = __Pyx_PyType_GetName(type); PyErr_Format(PyExc_TypeError, "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME, obj_type_name, type_name); __Pyx_DECREF_TypeName(obj_type_name); __Pyx_DECREF_TypeName(type_name); return 0; } /* decode_c_string */ static CYTHON_INLINE PyObject* __Pyx_decode_c_string( const char* cstring, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { Py_ssize_t length; if (unlikely((start < 0) | (stop < 0))) { size_t slen = strlen(cstring); if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "c-string too long to convert to Python"); return NULL; } length = (Py_ssize_t) slen; if (start < 0) { start += length; if (start < 0) start = 0; } if (stop < 0) stop += length; } if (unlikely(stop <= start)) return __Pyx_NewRef(__pyx_empty_unicode); length = stop - start; cstring += start; if (decode_func) { return decode_func(cstring, length, errors); } else { return PyUnicode_Decode(cstring, length, encoding, errors); } } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP __Pyx_TypeName type_name; PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) #elif PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (likely(descr != NULL)) { *method = descr; return 0; } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(name)); #endif __Pyx_DECREF_TypeName(type_name); return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_CallOneArg(method, obj); Py_DECREF(method); return result; } if (unlikely(!method)) goto bad; result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* ValidateBasesTuple */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; #if CYTHON_ASSUME_SAFE_MACROS n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); if (n < 0) return -1; #endif for (i = 1; i < n; i++) { #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; #elif CYTHON_ASSUME_SAFE_MACROS PyObject *b0 = PyTuple_GET_ITEM(bases, i); #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; #endif PyTypeObject *b; #if PY_MAJOR_VERSION < 3 if (PyClass_Check(b0)) { PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); __Pyx_DECREF_TypeName(b_name); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); if (!py_b_dictoffset) goto dictoffset_return; b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); Py_DECREF(py_b_dictoffset); if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; #endif if (b_dictoffset) { { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "extension type '%.200s' has no __dict__ slot, " "but base type '" __Pyx_FMT_TYPENAME "' has: " "either add 'cdef dict __dict__' to the extension type " "or add '__slots__ = [...]' to the base type", type_name, b_name); __Pyx_DECREF_TypeName(b_name); } #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif } return 0; } #endif /* PyType_Ready */ static int __Pyx_PyType_Ready(PyTypeObject *t) { #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS (void)__Pyx_validate_bases_tuple; #endif return PyType_Ready(t); #else int r; PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 gc_was_enabled = PyGC_Disable(); (void)__Pyx_PyObject_CallMethod0; #else PyObject *ret, *py_status; PyObject *gc = NULL; #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) gc = PyImport_GetModule(__pyx_kp_u_gc); #endif if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); if (unlikely(!gc)) return -1; py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; } gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; } Py_DECREF(ret); } else if (unlikely(gc_was_enabled == -1)) { Py_DECREF(gc); return -1; } #endif t->tp_flags |= Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A0000 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; #endif #else (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) PyGC_Enable(); #else if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); } else { Py_XDECREF(tp); Py_XDECREF(v); Py_XDECREF(tb); r = -1; } } Py_DECREF(gc); #endif } #endif return r; #endif } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, attr_name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(attr_name)); #endif __Pyx_DECREF_TypeName(type_name); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* PyObject_GenericGetAttr */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { return PyObject_GenericGetAttr(obj, attr_name); } return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); } #endif /* SetupReduce */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { int ret; PyObject *name_attr; name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name); if (likely(name_attr)) { ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); } else { ret = -1; } if (unlikely(ret < 0)) { PyErr_Clear(); ret = 0; } Py_XDECREF(name_attr); return ret; } static int __Pyx_setup_reduce(PyObject* type_obj) { int ret = 0; PyObject *object_reduce = NULL; PyObject *object_getstate = NULL; PyObject *object_reduce_ex = NULL; PyObject *reduce = NULL; PyObject *reduce_ex = NULL; PyObject *reduce_cython = NULL; PyObject *setstate = NULL; PyObject *setstate_cython = NULL; PyObject *getstate = NULL; #if CYTHON_USE_PYTYPE_LOOKUP getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate); #else getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate); if (!getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (getstate) { #if CYTHON_USE_PYTYPE_LOOKUP object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate); #else object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate); if (!object_getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (object_getstate != getstate) { goto __PYX_GOOD; } } #if CYTHON_USE_PYTYPE_LOOKUP object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #else object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #endif reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; if (reduce_ex == object_reduce_ex) { #if CYTHON_USE_PYTYPE_LOOKUP object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #else object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #endif reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); if (likely(reduce_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (reduce == object_reduce || PyErr_Occurred()) { goto __PYX_BAD; } setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate); if (!setstate) PyErr_Clear(); if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); if (likely(setstate_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (!setstate || PyErr_Occurred()) { goto __PYX_BAD; } } PyType_Modified((PyTypeObject*)type_obj); } } goto __PYX_GOOD; __PYX_BAD: if (!PyErr_Occurred()) { __Pyx_TypeName type_obj_name = __Pyx_PyType_GetName((PyTypeObject*)type_obj); PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name); __Pyx_DECREF_TypeName(type_obj_name); } ret = -1; __PYX_GOOD: #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); Py_XDECREF(object_getstate); Py_XDECREF(getstate); #endif Py_XDECREF(reduce); Py_XDECREF(reduce_ex); Py_XDECREF(reduce_cython); Py_XDECREF(setstate); Py_XDECREF(setstate_cython); return ret; } #endif /* SetVTable */ static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) { PyObject *ob = PyCapsule_New(vtable, 0, 0); if (unlikely(!ob)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_n_s_pyx_vtable, ob) < 0)) #else if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_n_s_pyx_vtable, ob) < 0)) #endif goto bad; Py_DECREF(ob); return 0; bad: Py_XDECREF(ob); return -1; } /* GetVTable */ static void* __Pyx_GetVtable(PyTypeObject *type) { void* ptr; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable); #else PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable); #endif if (!ob) goto bad; ptr = PyCapsule_GetPointer(ob, 0); if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } /* MergeVTables */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_MergeVtables(PyTypeObject *type) { int i; void** base_vtables; __Pyx_TypeName tp_base_name; __Pyx_TypeName base_name; void* unknown = (void*)-1; PyObject* bases = type->tp_bases; int base_depth = 0; { PyTypeObject* base = type->tp_base; while (base) { base_depth += 1; base = base->tp_base; } } base_vtables = (void**) malloc(sizeof(void*) * (size_t)(base_depth + 1)); base_vtables[0] = unknown; for (i = 1; i < PyTuple_GET_SIZE(bases); i++) { void* base_vtable = __Pyx_GetVtable(((PyTypeObject*)PyTuple_GET_ITEM(bases, i))); if (base_vtable != NULL) { int j; PyTypeObject* base = type->tp_base; for (j = 0; j < base_depth; j++) { if (base_vtables[j] == unknown) { base_vtables[j] = __Pyx_GetVtable(base); base_vtables[j + 1] = unknown; } if (base_vtables[j] == base_vtable) { break; } else if (base_vtables[j] == NULL) { goto bad; } base = base->tp_base; } } } PyErr_Clear(); free(base_vtables); return 0; bad: tp_base_name = __Pyx_PyType_GetName(type->tp_base); base_name = __Pyx_PyType_GetName((PyTypeObject*)PyTuple_GET_ITEM(bases, i)); PyErr_Format(PyExc_TypeError, "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name); __Pyx_DECREF_TypeName(tp_base_name); __Pyx_DECREF_TypeName(base_name); free(base_vtables); return -1; } #endif /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType_3_0_10 #define __PYX_HAVE_RT_ImportType_3_0_10 static PyTypeObject *__Pyx_ImportType_3_0_10(PyObject *module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_10 check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; Py_ssize_t itemsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; PyObject *py_itemsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #if !CYTHON_COMPILING_IN_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; itemsize = ((PyTypeObject *)result)->tp_itemsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); if (!py_itemsize) goto bad; itemsize = PyLong_AsSsize_t(py_itemsize); Py_DECREF(py_itemsize); py_itemsize = 0; if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (itemsize) { if (size % alignment) { alignment = size % alignment; } if (itemsize < (Py_ssize_t)alignment) itemsize = (Py_ssize_t)alignment; } if ((size_t)(basicsize + itemsize) < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize+itemsize); goto bad; } if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_10 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd-%zd from PyObject", module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_10 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(result); return NULL; } #endif /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__9); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s__10; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* ModInt[long] */ static CYTHON_INLINE long __Pyx_mod_long(long a, long b) { long r = a % b; r += ((r != 0) & ((r ^ b) < 0)) * b; return r; } /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* ClassMethod */ static PyObject* __Pyx_Method_ClassMethod(PyObject *method) { #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM <= 0x05080000 if (PyObject_TypeCheck(method, &PyWrapperDescr_Type)) { return PyClassMethod_New(method); } #else #if CYTHON_COMPILING_IN_PYPY if (PyMethodDescr_Check(method)) #else #if PY_MAJOR_VERSION == 2 static PyTypeObject *methoddescr_type = NULL; if (unlikely(methoddescr_type == NULL)) { PyObject *meth = PyObject_GetAttrString((PyObject*)&PyList_Type, "append"); if (unlikely(!meth)) return NULL; methoddescr_type = Py_TYPE(meth); Py_DECREF(meth); } #else PyTypeObject *methoddescr_type = &PyMethodDescr_Type; #endif if (__Pyx_TypeCheck(method, methoddescr_type)) #endif { PyMethodDescrObject *descr = (PyMethodDescrObject *)method; #if PY_VERSION_HEX < 0x03020000 PyTypeObject *d_type = descr->d_type; #else PyTypeObject *d_type = descr->d_common.d_type; #endif return PyDescr_NewClassMethod(d_type, descr->d_method); } #endif else if (PyMethod_Check(method)) { return PyClassMethod_New(PyMethod_GET_FUNCTION(method)); } else { return PyClassMethod_New(method); } } /* GetNameInClass */ static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) { PyObject *result; PyObject *dict; assert(PyType_Check(nmspace)); #if CYTHON_USE_TYPE_SLOTS dict = ((PyTypeObject*)nmspace)->tp_dict; Py_XINCREF(dict); #else dict = PyObject_GetAttr(nmspace, __pyx_n_s_dict); #endif if (likely(dict)) { result = PyObject_GetItem(dict, name); Py_DECREF(dict); if (result) { return result; } } PyErr_Clear(); __Pyx_GetModuleGlobalNameUncached(result, name); return result; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint32_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint32_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint32_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(uint32_t), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint32_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (int) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (int) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = __Pyx_NewRef(v); } val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint64_t neg_one = (uint64_t) -1, const_zero = (uint64_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint64_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint64_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint64_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint64_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(uint64_t), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint64_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(uint32_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint32_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint32_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(uint32_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 2 * PyLong_SHIFT)) { return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 3: if ((8 * sizeof(uint32_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 3 * PyLong_SHIFT)) { return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 4: if ((8 * sizeof(uint32_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 4 * PyLong_SHIFT)) { return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint32_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(uint32_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint32_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(uint32_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 2: if ((8 * sizeof(uint32_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { return (uint32_t) ((((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -3: if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 3: if ((8 * sizeof(uint32_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { return (uint32_t) ((((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -4: if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 4: if ((8 * sizeof(uint32_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT)) { return (uint32_t) ((((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; } } #endif if ((sizeof(uint32_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint32_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { uint32_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (uint32_t) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (uint32_t) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint32_t) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (uint32_t) -1; } else { stepval = __Pyx_NewRef(v); } val = (uint32_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(uint32_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((uint32_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(uint32_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((uint32_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((uint32_t) 1) << (sizeof(uint32_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (uint32_t) -1; } } else { uint32_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint32_t) -1; val = __Pyx_PyInt_As_uint32_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint32_t"); return (uint32_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint32_t"); return (uint32_t) -1; } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__61); } return name; } #endif /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (long) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (long) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = __Pyx_NewRef(v); } val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/hashindex.pyx0000644000076500000240000004634014641074756016472 0ustar00twstaff# -*- coding: utf-8 -*- from collections import namedtuple import locale import os cimport cython from libc.stdint cimport uint32_t, UINT32_MAX, uint64_t from libc.errno cimport errno from libc.string cimport memcpy from cpython.exc cimport PyErr_SetFromErrnoWithFilename from cpython.buffer cimport PyBUF_SIMPLE, PyObject_GetBuffer, PyBuffer_Release from cpython.bytes cimport PyBytes_FromStringAndSize, PyBytes_CheckExact, PyBytes_GET_SIZE, PyBytes_AS_STRING API_VERSION = '1.4_01' cdef extern from "_hashindex.c": ctypedef struct HashIndex: pass ctypedef struct FuseVersionsElement: uint32_t version char hash[16] HashIndex *hashindex_read(object file_py, int permit_compact) except * HashIndex *hashindex_init(int capacity, int key_size, int value_size) void hashindex_free(HashIndex *index) int hashindex_len(HashIndex *index) int hashindex_size(HashIndex *index) void hashindex_write(HashIndex *index, object file_py) except * unsigned char *hashindex_get(HashIndex *index, unsigned char *key) unsigned char *hashindex_next_key(HashIndex *index, unsigned char *key) int hashindex_delete(HashIndex *index, unsigned char *key) int hashindex_set(HashIndex *index, unsigned char *key, void *value) uint64_t hashindex_compact(HashIndex *index) uint32_t _htole32(uint32_t v) uint32_t _le32toh(uint32_t v) double HASH_MAX_LOAD cdef extern from "cache_sync/cache_sync.c": ctypedef struct CacheSyncCtx: pass CacheSyncCtx *cache_sync_init(HashIndex *chunks) const char *cache_sync_error(const CacheSyncCtx *ctx) uint64_t cache_sync_num_files_totals(const CacheSyncCtx *ctx) uint64_t cache_sync_num_files_parts(const CacheSyncCtx *ctx) uint64_t cache_sync_size_totals(const CacheSyncCtx *ctx) uint64_t cache_sync_size_parts(const CacheSyncCtx *ctx) uint64_t cache_sync_csize_totals(const CacheSyncCtx *ctx) uint64_t cache_sync_csize_parts(const CacheSyncCtx *ctx) int cache_sync_feed(CacheSyncCtx *ctx, void *data, uint32_t length) void cache_sync_free(CacheSyncCtx *ctx) uint32_t _MAX_VALUE cdef _NoDefault = object() """ The HashIndex is *not* a general purpose data structure. The value size must be at least 4 bytes, and these first bytes are used for in-band signalling in the data structure itself. The constant MAX_VALUE defines the valid range for these 4 bytes when interpreted as an uint32_t from 0 to MAX_VALUE (inclusive). The following reserved values beyond MAX_VALUE are currently in use (byte order is LE):: 0xffffffff marks empty entries in the hashtable 0xfffffffe marks deleted entries in the hashtable None of the publicly available classes in this module will accept nor return a reserved value; AssertionError is raised instead. """ assert UINT32_MAX == 2**32-1 assert _MAX_VALUE % 2 == 1 @cython.internal cdef class IndexBase: cdef HashIndex *index cdef int key_size _key_size = 32 MAX_LOAD_FACTOR = HASH_MAX_LOAD MAX_VALUE = _MAX_VALUE def __cinit__(self, capacity=0, path=None, permit_compact=False, usable=None): self.key_size = self._key_size if path: if isinstance(path, (str, bytes)): with open(path, 'rb') as fd: self.index = hashindex_read(fd, permit_compact) else: self.index = hashindex_read(path, permit_compact) assert self.index, 'hashindex_read() returned NULL with no exception set' else: if usable is not None: capacity = int(usable / self.MAX_LOAD_FACTOR) self.index = hashindex_init(capacity, self.key_size, self.value_size) if not self.index: raise Exception('hashindex_init failed') def __dealloc__(self): if self.index: hashindex_free(self.index) @classmethod def read(cls, path, permit_compact=False): return cls(path=path, permit_compact=permit_compact) def write(self, path): if isinstance(path, (str, bytes)): with open(path, 'wb') as fd: hashindex_write(self.index, fd) else: hashindex_write(self.index, path) def clear(self): hashindex_free(self.index) self.index = hashindex_init(0, self.key_size, self.value_size) if not self.index: raise Exception('hashindex_init failed') def setdefault(self, key, value): if not key in self: self[key] = value return self[key] def __delitem__(self, key): assert len(key) == self.key_size rc = hashindex_delete(self.index, key) if rc == 1: return # success if rc == -1: raise KeyError(key) if rc == 0: raise Exception('hashindex_delete failed') def get(self, key, default=None): try: return self[key] except KeyError: return default def pop(self, key, default=_NoDefault): try: value = self[key] del self[key] return value except KeyError: if default != _NoDefault: return default raise def __len__(self): return hashindex_len(self.index) def size(self): """Return size (bytes) of hash table.""" return hashindex_size(self.index) def compact(self): return hashindex_compact(self.index) cdef class FuseVersionsIndex(IndexBase): # 4 byte version + 16 byte file contents hash value_size = 20 _key_size = 16 def __getitem__(self, key): cdef FuseVersionsElement *data assert len(key) == self.key_size data = hashindex_get(self.index, key) if data == NULL: raise KeyError(key) return _le32toh(data.version), PyBytes_FromStringAndSize(data.hash, 16) def __setitem__(self, key, value): cdef FuseVersionsElement data assert len(key) == self.key_size data.version = value[0] assert data.version <= _MAX_VALUE, "maximum number of versions reached" if not PyBytes_CheckExact(value[1]) or PyBytes_GET_SIZE(value[1]) != 16: raise TypeError("Expected bytes of length 16 for second value") memcpy(data.hash, PyBytes_AS_STRING(value[1]), 16) data.version = _htole32(data.version) if not hashindex_set(self.index, key, &data): raise Exception('hashindex_set failed') def __contains__(self, key): assert len(key) == self.key_size return hashindex_get(self.index, key) != NULL cdef class NSIndex(IndexBase): value_size = 8 def __getitem__(self, key): assert len(key) == self.key_size data = hashindex_get(self.index, key) if not data: raise KeyError(key) cdef uint32_t segment = _le32toh(data[0]) assert segment <= _MAX_VALUE, "maximum number of segments reached" return segment, _le32toh(data[1]) def __setitem__(self, key, value): assert len(key) == self.key_size cdef uint32_t[2] data cdef uint32_t segment = value[0] assert segment <= _MAX_VALUE, "maximum number of segments reached" data[0] = _htole32(segment) data[1] = _htole32(value[1]) if not hashindex_set(self.index, key, data): raise Exception('hashindex_set failed') def __contains__(self, key): cdef uint32_t segment assert len(key) == self.key_size data = hashindex_get(self.index, key) if data != NULL: segment = _le32toh(data[0]) assert segment <= _MAX_VALUE, "maximum number of segments reached" return data != NULL def iteritems(self, marker=None): cdef const unsigned char *key iter = NSKeyIterator(self.key_size) iter.idx = self iter.index = self.index if marker: key = hashindex_get(self.index, marker) if marker is None: raise IndexError iter.key = key - self.key_size return iter cdef class NSKeyIterator: cdef NSIndex idx cdef HashIndex *index cdef const unsigned char *key cdef int key_size cdef int exhausted def __cinit__(self, key_size): self.key = NULL self.key_size = key_size self.exhausted = 0 def __iter__(self): return self def __next__(self): if self.exhausted: raise StopIteration self.key = hashindex_next_key(self.index, self.key) if not self.key: self.exhausted = 1 raise StopIteration cdef uint32_t *value = (self.key + self.key_size) cdef uint32_t segment = _le32toh(value[0]) assert segment <= _MAX_VALUE, "maximum number of segments reached" return (self.key)[:self.key_size], (segment, _le32toh(value[1])) ChunkIndexEntry = namedtuple('ChunkIndexEntry', 'refcount size csize') cdef class ChunkIndex(IndexBase): """ Mapping of 32 byte keys to (refcount, size, csize), which are all 32-bit unsigned. The reference count cannot overflow. If an overflow would occur, the refcount is fixed to MAX_VALUE and will neither increase nor decrease by incref(), decref() or add(). Prior signed 32-bit overflow is handled correctly for most cases: All values from UINT32_MAX (2**32-1, inclusive) to MAX_VALUE (exclusive) are reserved and either cause silent data loss (-1, -2) or will raise an AssertionError when accessed. Other values are handled correctly. Note that previously the refcount could also reach 0 by *increasing* it. Assigning refcounts in this reserved range is an invalid operation and raises AssertionError. """ value_size = 12 def __getitem__(self, key): assert len(key) == self.key_size data = hashindex_get(self.index, key) if not data: raise KeyError(key) cdef uint32_t refcount = _le32toh(data[0]) assert refcount <= _MAX_VALUE, "invalid reference count" return ChunkIndexEntry(refcount, _le32toh(data[1]), _le32toh(data[2])) def __setitem__(self, key, value): assert len(key) == self.key_size cdef uint32_t[3] data cdef uint32_t refcount = value[0] assert refcount <= _MAX_VALUE, "invalid reference count" data[0] = _htole32(refcount) data[1] = _htole32(value[1]) data[2] = _htole32(value[2]) if not hashindex_set(self.index, key, data): raise Exception('hashindex_set failed') def __contains__(self, key): assert len(key) == self.key_size data = hashindex_get(self.index, key) if data != NULL: assert _le32toh(data[0]) <= _MAX_VALUE, "invalid reference count" return data != NULL def incref(self, key): """Increase refcount for 'key', return (refcount, size, csize)""" assert len(key) == self.key_size data = hashindex_get(self.index, key) if not data: raise KeyError(key) cdef uint32_t refcount = _le32toh(data[0]) assert refcount <= _MAX_VALUE, "invalid reference count" if refcount != _MAX_VALUE: refcount += 1 data[0] = _htole32(refcount) return refcount, _le32toh(data[1]), _le32toh(data[2]) def decref(self, key): """Decrease refcount for 'key', return (refcount, size, csize)""" assert len(key) == self.key_size data = hashindex_get(self.index, key) if not data: raise KeyError(key) cdef uint32_t refcount = _le32toh(data[0]) # Never decrease a reference count of zero assert 0 < refcount <= _MAX_VALUE, "invalid reference count" if refcount != _MAX_VALUE: refcount -= 1 data[0] = _htole32(refcount) return refcount, _le32toh(data[1]), _le32toh(data[2]) def iteritems(self, marker=None): cdef const unsigned char *key iter = ChunkKeyIterator(self.key_size) iter.idx = self iter.index = self.index if marker: key = hashindex_get(self.index, marker) if marker is None: raise IndexError iter.key = key - self.key_size return iter def summarize(self): cdef uint64_t size = 0, csize = 0, unique_size = 0, unique_csize = 0, chunks = 0, unique_chunks = 0 cdef uint32_t *values cdef uint32_t refcount cdef unsigned char *key = NULL while True: key = hashindex_next_key(self.index, key) if not key: break unique_chunks += 1 values = (key + self.key_size) refcount = _le32toh(values[0]) assert refcount <= _MAX_VALUE, "invalid reference count" chunks += refcount unique_size += _le32toh(values[1]) unique_csize += _le32toh(values[2]) size += _le32toh(values[1]) * _le32toh(values[0]) csize += _le32toh(values[2]) * _le32toh(values[0]) return size, csize, unique_size, unique_csize, unique_chunks, chunks def stats_against(self, ChunkIndex master_index): """ Calculate chunk statistics of this index against *master_index*. A chunk is counted as unique if the number of references in this index matches the number of references in *master_index*. This index must be a subset of *master_index*. Return the same statistics tuple as summarize: size, csize, unique_size, unique_csize, unique_chunks, chunks. """ cdef uint64_t size = 0, csize = 0, unique_size = 0, unique_csize = 0, chunks = 0, unique_chunks = 0 cdef uint32_t our_refcount, chunk_size, chunk_csize cdef const uint32_t *our_values cdef const uint32_t *master_values cdef const unsigned char *key = NULL cdef HashIndex *master = master_index.index while True: key = hashindex_next_key(self.index, key) if not key: break our_values = (key + self.key_size) master_values = hashindex_get(master, key) if not master_values: raise ValueError('stats_against: key contained in self but not in master_index.') our_refcount = _le32toh(our_values[0]) chunk_size = _le32toh(master_values[1]) chunk_csize = _le32toh(master_values[2]) chunks += our_refcount size += chunk_size * our_refcount csize += chunk_csize * our_refcount if our_values[0] == master_values[0]: # our refcount equals the master's refcount, so this chunk is unique to us unique_chunks += 1 unique_size += chunk_size unique_csize += chunk_csize return size, csize, unique_size, unique_csize, unique_chunks, chunks def add(self, key, refs, size, csize): assert len(key) == self.key_size cdef uint32_t[3] data data[0] = _htole32(refs) data[1] = _htole32(size) data[2] = _htole32(csize) self._add( key, data) cdef _add(self, unsigned char *key, uint32_t *data): cdef uint64_t refcount1, refcount2, result64 values = hashindex_get(self.index, key) if values: refcount1 = _le32toh(values[0]) refcount2 = _le32toh(data[0]) assert refcount1 <= _MAX_VALUE, "invalid reference count" assert refcount2 <= _MAX_VALUE, "invalid reference count" result64 = refcount1 + refcount2 values[0] = _htole32(min(result64, _MAX_VALUE)) values[1] = data[1] values[2] = data[2] else: if not hashindex_set(self.index, key, data): raise Exception('hashindex_set failed') def merge(self, ChunkIndex other): cdef unsigned char *key = NULL while True: key = hashindex_next_key(other.index, key) if not key: break self._add(key, (key + self.key_size)) def zero_csize_ids(self): cdef unsigned char *key = NULL cdef uint32_t *values entries = [] while True: key = hashindex_next_key(self.index, key) if not key: break values = (key + self.key_size) refcount = _le32toh(values[0]) assert refcount <= _MAX_VALUE, "invalid reference count" if _le32toh(values[2]) == 0: # csize == 0 entries.append(PyBytes_FromStringAndSize( key, self.key_size)) return entries cdef class ChunkKeyIterator: cdef ChunkIndex idx cdef HashIndex *index cdef const unsigned char *key cdef int key_size cdef int exhausted def __cinit__(self, key_size): self.key = NULL self.key_size = key_size self.exhausted = 0 def __iter__(self): return self def __next__(self): if self.exhausted: raise StopIteration self.key = hashindex_next_key(self.index, self.key) if not self.key: self.exhausted = 1 raise StopIteration cdef uint32_t *value = (self.key + self.key_size) cdef uint32_t refcount = _le32toh(value[0]) assert refcount <= _MAX_VALUE, "invalid reference count" return (self.key)[:self.key_size], ChunkIndexEntry(refcount, _le32toh(value[1]), _le32toh(value[2])) cdef Py_buffer ro_buffer(object data) except *: cdef Py_buffer view PyObject_GetBuffer(data, &view, PyBUF_SIMPLE) return view cdef class CacheSynchronizer: cdef ChunkIndex chunks cdef CacheSyncCtx *sync def __cinit__(self, chunks): self.chunks = chunks self.sync = cache_sync_init(self.chunks.index) if not self.sync: raise Exception('cache_sync_init failed') def __dealloc__(self): if self.sync: cache_sync_free(self.sync) def feed(self, chunk): cdef Py_buffer chunk_buf = ro_buffer(chunk) cdef int rc rc = cache_sync_feed(self.sync, chunk_buf.buf, chunk_buf.len) PyBuffer_Release(&chunk_buf) if not rc: error = cache_sync_error(self.sync) if error != NULL: raise ValueError('cache_sync_feed failed: ' + error.decode('ascii')) @property def num_files_totals(self): return cache_sync_num_files_totals(self.sync) @property def num_files_parts(self): return cache_sync_num_files_parts(self.sync) @property def size_totals(self): return cache_sync_size_totals(self.sync) @property def size_parts(self): return cache_sync_size_parts(self.sync) @property def csize_totals(self): return cache_sync_csize_totals(self.sync) @property def csize_parts(self): return cache_sync_csize_parts(self.sync) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719958149.8311555 borgbackup-1.4.0/src/borg/helpers/0000755000076500000240000000000014641075206015377 5ustar00twstaff././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/helpers/__init__.py0000644000076500000240000001130014641074756017514 0ustar00twstaff""" This package contains all sorts of small helper / utility functionality, that did not fit better elsewhere. Code used to be in borg/helpers.py but was split into the modules in this package, which are imported into here for compatibility. """ from contextlib import contextmanager from .checks import * # NOQA from .datastruct import * # NOQA from .errors import * # NOQA from .fs import * # NOQA from .manifest import * # NOQA from .misc import * # NOQA from .parseformat import * # NOQA from .process import * # NOQA from .progress import * # NOQA from .time import * # NOQA from .yes import * # NOQA from .msgpack import is_slow_msgpack, is_supported_msgpack, int_to_bigint, bigint_to_int, get_limited_unpacker from . import msgpack # generic mechanism to enable users to invoke workarounds by setting the # BORG_WORKAROUNDS environment variable to a list of comma-separated strings. # see the docs for a list of known workaround strings. workarounds = tuple(os.environ.get('BORG_WORKAROUNDS', '').split(',')) @contextmanager def ignore_invalid_archive_tam(): global workarounds saved = workarounds if 'ignore_invalid_archive_tam' not in workarounds: # we really need this workaround here or borg will likely raise an exception. workarounds += ('ignore_invalid_archive_tam',) yield workarounds = saved # element data type for warnings_list: warning_info = namedtuple("warning_info", "wc,msg,args,wt") """ The global warnings_list variable is used to collect warning_info elements while borg is running. """ _warnings_list = [] def add_warning(msg, *args, **kwargs): global _warnings_list warning_code = kwargs.get("wc", EXIT_WARNING) assert isinstance(warning_code, int) warning_type = kwargs.get("wt", "percent") assert warning_type in ("percent", "curly") _warnings_list.append(warning_info(warning_code, msg, args, warning_type)) """ The global exit_code variable is used so that modules other than archiver can increase the program exit code if a warning or error occurred during their operation. """ _exit_code = EXIT_SUCCESS def classify_ec(ec): if not isinstance(ec, int): raise TypeError("ec must be of type int") if EXIT_SIGNAL_BASE <= ec <= 255: return "signal" elif ec == EXIT_ERROR or EXIT_ERROR_BASE <= ec < EXIT_WARNING_BASE: return "error" elif ec == EXIT_WARNING or EXIT_WARNING_BASE <= ec < EXIT_SIGNAL_BASE: return "warning" elif ec == EXIT_SUCCESS: return "success" else: raise ValueError(f"invalid error code: {ec}") def max_ec(ec1, ec2): """return the more severe error code of ec1 and ec2""" # note: usually, there can be only 1 error-class ec, the other ec is then either success or warning. ec1_class = classify_ec(ec1) ec2_class = classify_ec(ec2) if ec1_class == "signal": return ec1 if ec2_class == "signal": return ec2 if ec1_class == "error": return ec1 if ec2_class == "error": return ec2 if ec1_class == "warning": return ec1 if ec2_class == "warning": return ec2 assert ec1 == ec2 == EXIT_SUCCESS return EXIT_SUCCESS def set_ec(ec): """ Sets the exit code of the program to ec IF ec is more severe than the current exit code. """ global _exit_code _exit_code = max_ec(_exit_code, ec) def init_ec_warnings(ec=EXIT_SUCCESS, warnings=None): """ (Re-)Init the globals for the exit code and the warnings list. """ global _exit_code, _warnings_list _exit_code = ec warnings = [] if warnings is None else warnings assert isinstance(warnings, list) _warnings_list = warnings def get_ec(ec=None): """ compute the final return code of the borg process """ if ec is not None: set_ec(ec) global _exit_code exit_code_class = classify_ec(_exit_code) if exit_code_class in ("signal", "error", "warning"): # there was a signal/error/warning, return its exit code return _exit_code assert exit_code_class == "success" global _warnings_list if not _warnings_list: # we do not have any warnings in warnings list, return success exit code return _exit_code # looks like we have some warning(s) rcs = sorted(set(w_info.wc for w_info in _warnings_list)) logger.debug(f"rcs: {rcs!r}") if len(rcs) == 1: # easy: there was only one kind of warning, so we can be specific return rcs[0] # there were different kinds of warnings return EXIT_WARNING # generic warning rc, user has to look into the logs def get_reset_ec(ec=None): """Like get_ec, but re-initialize ec/warnings afterwards.""" rc = get_ec(ec) init_ec_warnings() return rc ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/helpers/checks.py0000644000076500000240000000215214641074756017222 0ustar00twstaffimport os import sys from .errors import RTError from ..platformflags import is_win32, is_linux, is_freebsd, is_darwin def check_python(): if is_win32: required_funcs = {os.stat} else: required_funcs = {os.stat, os.utime, os.chown} if not os.supports_follow_symlinks.issuperset(required_funcs): raise RTError("""FATAL: this Python was compiled for a too old (g)libc and misses required functionality.""") def check_extension_modules(): import borg.crypto.low_level from .. import platform, compress, item, chunker, hashindex msg = """The Borg binary extension modules do not seem to be properly installed.""" if hashindex.API_VERSION != '1.4_01': raise RTError(msg) if chunker.API_VERSION != '1.4_01': raise RTError(msg) if compress.API_VERSION != '1.4_01': raise RTError(msg) if borg.crypto.low_level.API_VERSION != '1.4_01': raise RTError(msg) if item.API_VERSION != '1.4_01': raise RTError(msg) if platform.API_VERSION != platform.OS_API_VERSION or platform.API_VERSION != '1.4_01': raise RTError(msg) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/helpers/datastruct.py0000644000076500000240000001025314641074756020141 0ustar00twstafffrom .errors import Error class StableDict(dict): """A dict subclass with stable items() ordering""" def items(self): return sorted(super().items()) class Buffer: """ Provides a managed, resizable buffer. """ class MemoryLimitExceeded(Error, OSError): """Requested buffer size {} is above the limit of {}.""" def __init__(self, allocator, size=4096, limit=None): """ Initialize the buffer: use allocator(size) call to allocate a buffer. Optionally, set the upper for the buffer size. """ assert callable(allocator), 'must give alloc(size) function as first param' assert limit is None or size <= limit, 'initial size must be <= limit' self.allocator = allocator self.limit = limit self.resize(size, init=True) def __len__(self): return len(self.buffer) def resize(self, size, init=False): """ resize the buffer - to avoid frequent reallocation, we usually always grow (if needed). giving init=True it is possible to first-time initialize or shrink the buffer. if a buffer size beyond the limit is requested, raise Buffer.MemoryLimitExceeded (OSError). """ size = int(size) if self.limit is not None and size > self.limit: raise Buffer.MemoryLimitExceeded(size, self.limit) if init or len(self) < size: self.buffer = self.allocator(size) def get(self, size=None, init=False): """ return a buffer of at least the requested size (None: any current size). init=True can be given to trigger shrinking of the buffer to the given size. """ if size is not None: self.resize(size, init) return self.buffer class EfficientCollectionQueue: """ An efficient FIFO queue that splits received elements into chunks. """ class SizeUnderflow(Error): """Could not pop_front first {} elements, collection only has {} elements..""" def __init__(self, split_size, member_type): """ Initializes empty queue. Requires split_size to define maximum chunk size. Requires member_type to be type defining what base collection looks like. """ self.buffers = [] self.size = 0 self.split_size = split_size self.member_type = member_type def peek_front(self): """ Returns first chunk from queue without removing it. Returned collection will have between 1 and split_size length. Returns empty collection when nothing is queued. """ if not self.buffers: return self.member_type() buffer = self.buffers[0] return buffer def pop_front(self, size): """ Removes first size elements from queue. Throws if requested removal size is larger than whole queue. """ if size > self.size: raise EfficientCollectionQueue.SizeUnderflow(size, self.size) while size > 0: buffer = self.buffers[0] to_remove = min(size, len(buffer)) buffer = buffer[to_remove:] if buffer: self.buffers[0] = buffer else: del self.buffers[0] size -= to_remove self.size -= to_remove def push_back(self, data): """ Adds data at end of queue. Takes care to chunk data into split_size sized elements. """ if not self.buffers: self.buffers = [self.member_type()] while data: buffer = self.buffers[-1] if len(buffer) >= self.split_size: buffer = self.member_type() self.buffers.append(buffer) to_add = min(len(data), self.split_size - len(buffer)) buffer += data[:to_add] data = data[to_add:] self.buffers[-1] = buffer self.size += to_add def __len__(self): """ Current queue length for all elements in all chunks. """ return self.size def __bool__(self): """ Returns true if queue isn't empty. """ return self.size != 0 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/helpers/errors.py0000644000076500000240000001063014641074756017276 0ustar00twstaffimport os from ..constants import * # NOQA import borg.crypto.low_level modern_ec = os.environ.get("BORG_EXIT_CODES", "legacy") == "modern" class ErrorBase(Exception): """ErrorBase: {}""" # Error base class # if we raise such an Error and it is only caught by the uppermost # exception handler (that exits short after with the given exit_code), # it is always a (fatal and abrupt) error, never just a warning. exit_mcode = EXIT_ERROR # modern, more specific exit code (defaults to EXIT_ERROR) # show a traceback? traceback = False def __init__(self, *args): super().__init__(*args) self.args = args def get_message(self): return type(self).__doc__.format(*self.args) __str__ = get_message @property def exit_code(self): # legacy: borg used to always use rc 2 (EXIT_ERROR) for all errors. # modern: users can opt in to more specific return codes, using BORG_EXIT_CODES: return self.exit_mcode if modern_ec else EXIT_ERROR class Error(ErrorBase): """Error: {}""" class ErrorWithTraceback(Error): """Error: {}""" # like Error, but show a traceback also traceback = True class IntegrityError(ErrorWithTraceback, borg.crypto.low_level.IntegrityError): """Data integrity error: {}""" exit_mcode = 90 class DecompressionError(IntegrityError): """Decompression error: {}""" exit_mcode = 92 class CancelledByUser(Error): """Cancelled by user.""" exit_mcode = 3 class RTError(Error): """Runtime Error: {}""" class CommandError(Error): """Command Error: {}""" exit_mcode = 4 class BorgWarning: """Warning: {}""" # Warning base class # please note that this class and its subclasses are NOT exceptions, we do not raise them. # so this is just to have inheritance, inspectability and the exit_code property. exit_mcode = EXIT_WARNING # modern, more specific exit code (defaults to EXIT_WARNING) def __init__(self, *args): self.args = args def get_message(self): return type(self).__doc__.format(*self.args) __str__ = get_message @property def exit_code(self): # legacy: borg used to always use rc 1 (EXIT_WARNING) for all warnings. # modern: users can opt in to more specific return codes, using BORG_EXIT_CODES: return self.exit_mcode if modern_ec else EXIT_WARNING class FileChangedWarning(BorgWarning): """{}: file changed while we backed it up""" exit_mcode = 100 class IncludePatternNeverMatchedWarning(BorgWarning): """Include pattern '{}' never matched.""" exit_mcode = 101 class BackupWarning(BorgWarning): """{}: {}""" # this is to wrap a caught BackupError exception, so it can be given to print_warning_instance @property def exit_code(self): if not modern_ec: return EXIT_WARNING exc = self.args[1] assert isinstance(exc, BackupError) return exc.exit_mcode class BackupError(ErrorBase): """{}: backup error""" # Exception raised for non-OSError-based exceptions while accessing backup files. exit_mcode = 102 class BackupRaceConditionError(BackupError): """{}: file type or inode changed while we backed it up (race condition, skipped file)""" # Exception raised when encountering a critical race condition while trying to back up a file. exit_mcode = 103 class BackupOSError(BackupError): """{}: {}""" # Wrapper for OSError raised while accessing backup files. # # Borg does different kinds of IO, and IO failures have different consequences. # This wrapper represents failures of input file or extraction IO. # These are non-critical and are only reported (warnings). # # Any unwrapped IO error is critical and aborts execution (for example repository IO failure). exit_mcode = 104 def __init__(self, op, os_error): self.op = op self.os_error = os_error self.errno = os_error.errno self.strerror = os_error.strerror self.filename = os_error.filename def __str__(self): if self.op: return f'{self.op}: {self.os_error}' else: return str(self.os_error) class BackupPermissionError(BackupOSError): """{}: {}""" exit_mcode = 105 class BackupIOError(BackupOSError): """{}: {}""" exit_mcode = 106 class BackupFileNotFoundError(BackupOSError): """{}: {}""" exit_mcode = 107 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/helpers/fs.py0000644000076500000240000003762714641074756016411 0ustar00twstaffimport errno import os import os.path import re import stat import subprocess import sys import textwrap from .errors import Error from .process import prepare_subprocess_env from ..platformflags import is_win32 from ..constants import * # NOQA from ..logger import create_logger logger = create_logger() def ensure_dir(path, mode=stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO, pretty_deadly=True): """ Ensures that the dir exists with the right permissions. 1) Make sure the directory exists in a race-free operation 2) If mode is not None and the directory has been created, give the right permissions to the leaf directory. The current umask value is masked out first. 3) If pretty_deadly is True, catch exceptions, reraise them with a pretty message. Returns if the directory has been created and has the right permissions, An exception otherwise. If a deadly exception happened it is reraised. """ try: os.makedirs(path, mode=mode, exist_ok=True) except OSError as e: if pretty_deadly: raise Error(str(e)) else: raise def get_base_dir(): """Get home directory / base directory for borg: - BORG_BASE_DIR, if set - HOME, if set - ~$USER, if USER is set - ~ """ base_dir = os.environ.get('BORG_BASE_DIR') or os.environ.get('HOME') # os.path.expanduser() behaves differently for '~' and '~someuser' as # parameters: when called with an explicit username, the possibly set # environment variable HOME is no longer respected. So we have to check if # it is set and only expand the user's home directory if HOME is unset. if not base_dir: base_dir = os.path.expanduser('~%s' % os.environ.get('USER', '')) return base_dir def get_keys_dir(): """Determine where to repository keys and cache""" keys_dir = os.environ.get('BORG_KEYS_DIR') if keys_dir is None: # note: do not just give this as default to the environment.get(), see issue #5979. keys_dir = os.path.join(get_config_dir(), 'keys') ensure_dir(keys_dir) return keys_dir def get_security_dir(repository_id=None): """Determine where to store local security information.""" security_dir = os.environ.get('BORG_SECURITY_DIR') if security_dir is None: # note: do not just give this as default to the environment.get(), see issue #5979. security_dir = os.path.join(get_config_dir(), 'security') if repository_id: security_dir = os.path.join(security_dir, repository_id) ensure_dir(security_dir) return security_dir def get_cache_dir(): """Determine where to repository keys and cache""" # Get cache home path cache_home = os.path.join(get_base_dir(), '.cache') # Try to use XDG_CACHE_HOME instead if BORG_BASE_DIR isn't explicitly set if not os.environ.get('BORG_BASE_DIR'): cache_home = os.environ.get('XDG_CACHE_HOME', cache_home) # Use BORG_CACHE_DIR if set, otherwise assemble final path from cache home path cache_dir = os.environ.get('BORG_CACHE_DIR', os.path.join(cache_home, 'borg')) # Create path if it doesn't exist yet ensure_dir(cache_dir) cache_tag_fn = os.path.join(cache_dir, CACHE_TAG_NAME) if not os.path.exists(cache_tag_fn): cache_tag_contents = CACHE_TAG_CONTENTS + textwrap.dedent(""" # This file is a cache directory tag created by Borg. # For information about cache directory tags, see: # http://www.bford.info/cachedir/spec.html """).encode('ascii') from ..platform import SaveFile with SaveFile(cache_tag_fn, binary=True) as fd: fd.write(cache_tag_contents) return cache_dir def get_config_dir(): """Determine where to store whole config""" # Get config home path config_home = os.path.join(get_base_dir(), '.config') # Try to use XDG_CONFIG_HOME instead if BORG_BASE_DIR isn't explicitly set if not os.environ.get('BORG_BASE_DIR'): config_home = os.environ.get('XDG_CONFIG_HOME', config_home) # Use BORG_CONFIG_DIR if set, otherwise assemble final path from config home path config_dir = os.environ.get('BORG_CONFIG_DIR', os.path.join(config_home, 'borg')) # Create path if it doesn't exist yet ensure_dir(config_dir) return config_dir def dir_is_cachedir(path): """Determines whether the specified path is a cache directory (and therefore should potentially be excluded from the backup) according to the CACHEDIR.TAG protocol (http://www.bford.info/cachedir/spec.html). """ tag_path = os.path.join(path, CACHE_TAG_NAME) try: if os.path.exists(tag_path): with open(tag_path, 'rb') as tag_file: tag_data = tag_file.read(len(CACHE_TAG_CONTENTS)) if tag_data == CACHE_TAG_CONTENTS: return True except OSError: pass return False def dir_is_tagged(path, exclude_caches, exclude_if_present): """Determines whether the specified path is excluded by being a cache directory or containing user-specified tag files/directories. Returns a list of the names of the tag files/directories (either CACHEDIR.TAG or the matching user-specified files/directories). """ # TODO: do operations based on the directory fd tag_names = [] if exclude_caches and dir_is_cachedir(path): tag_names.append(CACHE_TAG_NAME) if exclude_if_present is not None: for tag in exclude_if_present: tag_path = os.path.join(path, tag) if os.path.exists(tag_path): tag_names.append(tag) return tag_names _safe_re = re.compile(r'^((\.\.)?/+)+') def make_path_safe(path): """Make path safe by making it relative and local """ return _safe_re.sub('', path) or '.' def get_strip_prefix(path): # similar to how rsync does it, we allow users to give paths like: # /this/gets/stripped/./this/is/kept # the whole path is what is used to read from the fs, # the strip_prefix will be /this/gets/stripped/ and # this/is/kept is the path being archived. pos = path.find('/./') # detect slashdot hack if pos > 0: # found a prefix to strip! make sure it ends with one "/"! return os.path.normpath(path[:pos]) + os.sep else: # no or empty prefix, nothing to strip! return None def hardlinkable(mode): """return True if we support hardlinked items of this type""" return stat.S_ISREG(mode) or stat.S_ISBLK(mode) or stat.S_ISCHR(mode) or stat.S_ISFIFO(mode) def scandir_keyfunc(dirent): try: return (0, dirent.inode()) except OSError as e: # maybe a permission denied error while doing a stat() on the dirent logger.debug('scandir_inorder: Unable to stat %s: %s', dirent.path, e) # order this dirent after all the others lexically by file name # we may not break the whole scandir just because of an exception in one dirent # ignore the exception for now, since another stat will be done later anyways # (or the entry will be skipped by an exclude pattern) return (1, dirent.name) def scandir_inorder(*, path, fd=None): arg = fd if fd is not None else path return sorted(os.scandir(arg), key=scandir_keyfunc) def secure_erase(path, *, avoid_collateral_damage): """Attempt to securely erase a file by writing random data over it before deleting it. If avoid_collateral_damage is True, we only secure erase if the total link count is 1, otherwise we just do a normal "delete" (unlink) without first overwriting it with random. This avoids other hardlinks pointing to same inode as getting damaged, but might be less secure. A typical scenario where this is useful are quick "hardlink copies" of bigger directories. If avoid_collateral_damage is False, we always secure erase. If there are hardlinks pointing to the same inode as , they will contain random garbage afterwards. """ with open(path, 'r+b') as fd: st = os.stat(fd.fileno()) if not (st.st_nlink > 1 and avoid_collateral_damage): fd.write(os.urandom(st.st_size)) fd.flush() os.fsync(fd.fileno()) os.unlink(path) def safe_unlink(path): """ Safely unlink (delete) *path*. If we run out of space while deleting the file, we try truncating it first. BUT we truncate only if path is the only hardlink referring to this content. Use this when deleting potentially large files when recovering from a VFS error such as ENOSPC. It can help a full file system recover. Refer to the "File system interaction" section in repository.py for further explanations. """ try: os.unlink(path) except OSError as unlink_err: if unlink_err.errno != errno.ENOSPC: # not free space related, give up here. raise # we ran out of space while trying to delete the file. st = os.stat(path) if st.st_nlink > 1: # rather give up here than cause collateral damage to the other hardlink. raise # no other hardlink! try to recover free space by truncating this file. try: # Do not create *path* if it does not exist, open for truncation in r+b mode (=O_RDWR|O_BINARY). with open(path, 'r+b') as fd: fd.truncate() except OSError: # truncate didn't work, so we still have the original unlink issue - give up: raise unlink_err else: # successfully truncated the file, try again deleting it: os.unlink(path) def dash_open(path, mode): assert '+' not in mode # the streams are either r or w, but never both if path == '-': stream = sys.stdin if 'r' in mode else sys.stdout return stream.buffer if 'b' in mode else stream else: return open(path, mode) def O_(*flags): result = 0 for flag in flags: result |= getattr(os, 'O_' + flag, 0) return result flags_base = O_('BINARY', 'NOCTTY', 'RDONLY') flags_special = flags_base | O_('NOFOLLOW') # BLOCK == wait when reading devices or fifos flags_special_follow = flags_base # BLOCK == wait when reading symlinked devices or fifos flags_normal = flags_base | O_('NONBLOCK', 'NOFOLLOW') flags_noatime = flags_normal | O_('NOATIME') flags_dir = O_('DIRECTORY', 'RDONLY', 'NOFOLLOW') def os_open(*, flags, path=None, parent_fd=None, name=None, noatime=False): """ Use os.open to open a fs item. If parent_fd and name are given, they are preferred and openat will be used, path is not used in this case. :param path: full (but not necessarily absolute) path :param parent_fd: open directory file descriptor :param name: name relative to parent_fd :param flags: open flags for os.open() (int) :param noatime: True if access time shall be preserved :return: file descriptor """ if name and parent_fd is not None: # name is neither None nor empty, parent_fd given. fname = name # use name relative to parent_fd else: fname, parent_fd = path, None # just use the path if is_win32 and os.path.isdir(fname): # Directories can not be opened on Windows. return None _flags_normal = flags if noatime: _flags_noatime = _flags_normal | O_('NOATIME') try: # if we have O_NOATIME, this likely will succeed if we are root or owner of file: fd = os.open(fname, _flags_noatime, dir_fd=parent_fd) except PermissionError: if _flags_noatime == _flags_normal: # we do not have O_NOATIME, no need to try again: raise # Was this EPERM due to the O_NOATIME flag? Try again without it: fd = os.open(fname, _flags_normal, dir_fd=parent_fd) except OSError as exc: # O_NOATIME causes EROFS when accessing a volume shadow copy in WSL1 from . import workarounds if 'retry_erofs' in workarounds and exc.errno == errno.EROFS and _flags_noatime != _flags_normal: fd = os.open(fname, _flags_normal, dir_fd=parent_fd) else: raise else: fd = os.open(fname, _flags_normal, dir_fd=parent_fd) return fd def os_stat(*, path=None, parent_fd=None, name=None, follow_symlinks=False): """ Use os.stat to open a fs item. If parent_fd and name are given, they are preferred and statat will be used, path is not used in this case. :param path: full (but not necessarily absolute) path :param parent_fd: open directory file descriptor :param name: name relative to parent_fd :return: stat info """ if name and parent_fd is not None: # name is neither None nor empty, parent_fd given. fname = name # use name relative to parent_fd else: fname, parent_fd = path, None # just use the path return os.stat(fname, dir_fd=parent_fd, follow_symlinks=follow_symlinks) def umount(mountpoint): from . import set_ec env = prepare_subprocess_env(system=True) try: rc = subprocess.call(['fusermount', '-u', mountpoint], env=env) except FileNotFoundError: rc = subprocess.call(['umount', mountpoint], env=env) set_ec(rc) # below is a slightly modified tempfile.mkstemp that has an additional mode parameter. # see https://github.com/borgbackup/borg/issues/6933 and https://github.com/borgbackup/borg/issues/6400 import os as _os # NOQA import sys as _sys # NOQA import errno as _errno # NOQA from tempfile import _sanitize_params, _get_candidate_names, TMP_MAX, _text_openflags, _bin_openflags # NOQA def _mkstemp_inner(dir, pre, suf, flags, output_type, mode=0o600): """Code common to mkstemp, TemporaryFile, and NamedTemporaryFile.""" dir = _os.path.abspath(dir) names = _get_candidate_names() if output_type is bytes: names = map(_os.fsencode, names) for seq in range(TMP_MAX): name = next(names) file = _os.path.join(dir, pre + name + suf) _sys.audit("tempfile.mkstemp", file) try: fd = _os.open(file, flags, mode) except FileExistsError: continue # try again except PermissionError: # This exception is thrown when a directory with the chosen name # already exists on windows. if _os.name == "nt" and _os.path.isdir(dir) and _os.access(dir, _os.W_OK): continue else: raise return fd, file raise FileExistsError(_errno.EEXIST, "No usable temporary file name found") def mkstemp_mode(suffix=None, prefix=None, dir=None, text=False, mode=0o600): """User-callable function to create and return a unique temporary file. The return value is a pair (fd, name) where fd is the file descriptor returned by os.open, and name is the filename. If 'suffix' is not None, the file name will end with that suffix, otherwise there will be no suffix. If 'prefix' is not None, the file name will begin with that prefix, otherwise a default prefix is used. If 'dir' is not None, the file will be created in that directory, otherwise a default directory is used. If 'text' is specified and true, the file is opened in text mode. Else (the default) the file is opened in binary mode. If any of 'suffix', 'prefix' and 'dir' are not None, they must be the same type. If they are bytes, the returned name will be bytes; str otherwise. The file is readable and writable only by the creating user ID. If the operating system uses permission bits to indicate whether a file is executable, the file is executable by no one. The file descriptor is not inherited by children of this process. Caller is responsible for deleting the file when done with it. """ prefix, suffix, dir, output_type = _sanitize_params(prefix, suffix, dir) if text: flags = _text_openflags else: flags = _bin_openflags return _mkstemp_inner(dir, prefix, suffix, flags, output_type, mode) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/helpers/manifest.py0000644000076500000240000002614114641074756017574 0ustar00twstaffimport enum import os import os.path import re from collections import abc, namedtuple from datetime import datetime, timedelta from operator import attrgetter from .errors import Error from ..logger import create_logger logger = create_logger() from .datastruct import StableDict from .parseformat import bin_to_hex, safe_encode, safe_decode from .time import parse_timestamp, utcnow from .. import shellpattern from ..constants import * # NOQA class MandatoryFeatureUnsupported(Error): """Unsupported repository feature(s) {}. A newer version of borg is required to access this repository.""" exit_mcode = 25 class NoManifestError(Error): """Repository has no manifest.""" exit_mcode = 26 ArchiveInfo = namedtuple('ArchiveInfo', 'name id ts') # timestamp is a replacement for ts, archive is an alias for name (see SortBySpec) AI_HUMAN_SORT_KEYS = ['timestamp', 'archive'] + list(ArchiveInfo._fields) AI_HUMAN_SORT_KEYS.remove('ts') class Archives(abc.MutableMapping): """ Nice wrapper around the archives dict, making sure only valid types/values get in and we can deal with str keys (and it internally encodes to byte keys) and either str timestamps or datetime timestamps. """ def __init__(self): # key: encoded archive name, value: dict(b'id': bytes_id, b'time': bytes_iso_ts) self._archives = {} def __len__(self): return len(self._archives) def __iter__(self): return iter(safe_decode(name) for name in self._archives) def __getitem__(self, name): assert isinstance(name, str) _name = safe_encode(name) values = self._archives.get(_name) if values is None: raise KeyError ts = parse_timestamp(values[b'time'].decode()) return ArchiveInfo(name=name, id=values[b'id'], ts=ts) def __setitem__(self, name, info): assert isinstance(name, str) name = safe_encode(name) assert isinstance(info, tuple) id, ts = info assert isinstance(id, bytes) if isinstance(ts, datetime): ts = ts.replace(tzinfo=None).strftime(ISO_FORMAT) assert isinstance(ts, str) ts = ts.encode() self._archives[name] = {b'id': id, b'time': ts} def __delitem__(self, name): assert isinstance(name, str) name = safe_encode(name) del self._archives[name] def list(self, *, glob=None, match_end=r'\Z', sort_by=(), consider_checkpoints=True, first=None, last=None, reverse=False): """ Return list of ArchiveInfo instances according to the parameters. First match *glob* (considering *match_end*), then *sort_by*. Apply *first* and *last* filters, and then possibly *reverse* the list. *sort_by* is a list of sort keys applied in reverse order. Note: for better robustness, all filtering / limiting parameters must default to "not limit / not filter", so a FULL archive list is produced by a simple .list(). some callers EXPECT to iterate over all archives in a repo for correct operation. """ if isinstance(sort_by, (str, bytes)): raise TypeError('sort_by must be a sequence of str') regex = re.compile(shellpattern.translate(glob or '*', match_end=match_end)) archives = [x for x in self.values() if regex.match(x.name) is not None] if not consider_checkpoints: archives = [x for x in archives if '.checkpoint' not in x.name] for sortkey in reversed(sort_by): archives.sort(key=attrgetter(sortkey)) if first: archives = archives[:first] elif last: archives = archives[max(len(archives) - last, 0):] if reverse: archives.reverse() return archives def list_considering(self, args): """ get a list of archives, considering --first/last/prefix/glob-archives/sort/consider-checkpoints cmdline args """ if args.location.archive: raise Error('The options --first, --last, --prefix, and --glob-archives, and --consider-checkpoints can only be used on repository targets.') if args.prefix is not None: args.glob_archives = args.prefix + '*' return self.list(sort_by=args.sort_by.split(','), consider_checkpoints=args.consider_checkpoints, glob=args.glob_archives, first=args.first, last=args.last) def set_raw_dict(self, d): """set the dict we get from the msgpack unpacker""" for k, v in d.items(): assert isinstance(k, bytes) assert isinstance(v, dict) and b'id' in v and b'time' in v self._archives[k] = v def get_raw_dict(self): """get the dict we can give to the msgpack packer""" return self._archives class Manifest: @enum.unique class Operation(enum.Enum): # The comments here only roughly describe the scope of each feature. In the end, additions need to be # based on potential problems older clients could produce when accessing newer repositories and the # tradeofs of locking version out or still allowing access. As all older versions and their exact # behaviours are known when introducing new features sometimes this might not match the general descriptions # below. # The READ operation describes which features are needed to safely list and extract the archives in the # repository. READ = 'read' # The CHECK operation is for all operations that need either to understand every detail # of the repository (for consistency checks and repairs) or are seldom used functions that just # should use the most restrictive feature set because more fine grained compatibility tracking is # not needed. CHECK = 'check' # The WRITE operation is for adding archives. Features here ensure that older clients don't add archives # in an old format, or is used to lock out clients that for other reasons can no longer safely add new # archives. WRITE = 'write' # The DELETE operation is for all operations (like archive deletion) that need a 100% correct reference # count and the need to be able to find all (directly and indirectly) referenced chunks of a given archive. DELETE = 'delete' NO_OPERATION_CHECK = tuple() SUPPORTED_REPO_FEATURES = frozenset([]) MANIFEST_ID = b'\0' * 32 def __init__(self, key, repository, item_keys=None): self.archives = Archives() self.config = {} self.key = key self.repository = repository self.item_keys = frozenset(item_keys) if item_keys is not None else ITEM_KEYS self.tam_verified = False self.timestamp = None @property def id_str(self): return bin_to_hex(self.id) @property def last_timestamp(self): return parse_timestamp(self.timestamp, tzinfo=None) @classmethod def load(cls, repository, operations, key=None, force_tam_not_required=False): from ..item import ManifestItem from ..crypto.key import key_factory, tam_required_file, tam_required from ..repository import Repository try: cdata = repository.get(cls.MANIFEST_ID) except Repository.ObjectNotFound: raise NoManifestError if not key: key = key_factory(repository, cdata) manifest = cls(key, repository) data = key.decrypt(None, cdata) manifest_dict, manifest.tam_verified = key.unpack_and_verify_manifest(data, force_tam_not_required=force_tam_not_required) m = ManifestItem(internal_dict=manifest_dict) manifest.id = key.id_hash(data) if m.get('version') not in (1, 2): raise ValueError('Invalid manifest version') manifest.archives.set_raw_dict(m.archives) manifest.timestamp = m.get('timestamp') manifest.config = m.config # valid item keys are whatever is known in the repo or every key we know manifest.item_keys = ITEM_KEYS | frozenset(key.decode() for key in m.get('item_keys', [])) if manifest.tam_verified: manifest_required = manifest.config.get(b'tam_required', False) security_required = tam_required(repository) if manifest_required and not security_required: logger.debug('Manifest is TAM verified and says TAM is required, updating security database...') file = tam_required_file(repository) open(file, 'w').close() if not manifest_required and security_required: logger.debug('Manifest is TAM verified and says TAM is *not* required, updating security database...') os.unlink(tam_required_file(repository)) manifest.check_repository_compatibility(operations) return manifest, key def check_repository_compatibility(self, operations): for operation in operations: assert isinstance(operation, self.Operation) feature_flags = self.config.get(b'feature_flags', None) if feature_flags is None: return if operation.value.encode() not in feature_flags: continue requirements = feature_flags[operation.value.encode()] if b'mandatory' in requirements: unsupported = set(requirements[b'mandatory']) - self.SUPPORTED_REPO_FEATURES if unsupported: raise MandatoryFeatureUnsupported([f.decode() for f in unsupported]) def get_all_mandatory_features(self): result = {} feature_flags = self.config.get(b'feature_flags', None) if feature_flags is None: return result for operation, requirements in feature_flags.items(): if b'mandatory' in requirements: result[operation.decode()] = {feature.decode() for feature in requirements[b'mandatory']} return result def write(self): from ..item import ManifestItem if self.key.tam_required: self.config[b'tam_required'] = True # self.timestamp needs to be strictly monotonically increasing. Clocks often are not set correctly if self.timestamp is None: self.timestamp = utcnow().strftime(ISO_FORMAT) else: prev_ts = self.last_timestamp incremented = (prev_ts + timedelta(microseconds=1)).strftime(ISO_FORMAT) self.timestamp = max(incremented, utcnow().strftime(ISO_FORMAT)) # include checks for limits as enforced by limited unpacker (used by load()) assert len(self.archives) <= MAX_ARCHIVES assert all(len(name) <= 255 for name in self.archives) assert len(self.item_keys) <= 100 manifest = ManifestItem( version=1, archives=StableDict(self.archives.get_raw_dict()), timestamp=self.timestamp, config=StableDict(self.config), item_keys=tuple(sorted(self.item_keys)), ) self.tam_verified = True data = self.key.pack_and_authenticate_metadata(manifest.as_dict()) self.id = self.key.id_hash(data) self.repository.put(self.MANIFEST_ID, self.key.encrypt(data)) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/helpers/misc.py0000644000076500000240000002077314641074756016726 0ustar00twstaffimport logging import io import os import os.path import platform import sys from collections import deque, OrderedDict from datetime import datetime, timezone, timedelta from itertools import islice from operator import attrgetter from ..logger import create_logger logger = create_logger() from .time import to_localtime from . import msgpack from .. import __version__ as borg_version from .. import chunker from ..constants import CH_BUZHASH, CH_FIXED def prune_within(archives, hours, kept_because): target = datetime.now(timezone.utc) - timedelta(seconds=hours * 3600) kept_counter = 0 result = [] for a in archives: if a.ts > target: kept_counter += 1 kept_because[a.id] = ("within", kept_counter) result.append(a) return result PRUNING_PATTERNS = OrderedDict([ ("secondly", '%Y-%m-%d %H:%M:%S'), ("minutely", '%Y-%m-%d %H:%M'), ("hourly", '%Y-%m-%d %H'), ("daily", '%Y-%m-%d'), ("weekly", '%G-%V'), ("monthly", '%Y-%m'), ("yearly", '%Y'), ]) def prune_split(archives, rule, n, kept_because=None): last = None keep = [] pattern = PRUNING_PATTERNS[rule] if kept_because is None: kept_because = {} if n == 0: return keep a = None for a in sorted(archives, key=attrgetter('ts'), reverse=True): period = to_localtime(a.ts).strftime(pattern) if period != last: last = period if a.id not in kept_because: keep.append(a) kept_because[a.id] = (rule, len(keep)) if len(keep) == n: break # Keep oldest archive if we didn't reach the target retention count if a is not None and len(keep) < n and a.id not in kept_because: keep.append(a) kept_because[a.id] = (rule+"[oldest]", len(keep)) return keep def sysinfo(): show_sysinfo = os.environ.get('BORG_SHOW_SYSINFO', 'yes').lower() if show_sysinfo == 'no': return '' python_implementation = platform.python_implementation() python_version = platform.python_version() # platform.uname() does a shell call internally to get processor info, # creating #3732 issue, so rather use os.uname(). try: uname = os.uname() except AttributeError: uname = None if sys.platform.startswith('linux'): linux_distribution = ('Unknown Linux', '', '') else: linux_distribution = None try: msgpack_version = '.'.join(str(v) for v in msgpack.version) except: msgpack_version = 'unknown' from ..fuse_impl import llfuse, BORG_FUSE_IMPL llfuse_name = llfuse.__name__ if llfuse else 'None' llfuse_version = (' %s' % llfuse.__version__) if llfuse else '' llfuse_info = f'{llfuse_name}{llfuse_version} [{BORG_FUSE_IMPL}]' info = [] if uname is not None: info.append('Platform: {}'.format(' '.join(uname))) if linux_distribution is not None: info.append('Linux: %s %s %s' % linux_distribution) info.append('Borg: {} Python: {} {} msgpack: {} fuse: {}'.format( borg_version, python_implementation, python_version, msgpack_version, llfuse_info)) info.append('PID: %d CWD: %s' % (os.getpid(), os.getcwd())) info.append('sys.argv: %r' % sys.argv) info.append('SSH_ORIGINAL_COMMAND: %r' % os.environ.get('SSH_ORIGINAL_COMMAND')) info.append('') return '\n'.join(info) def log_multi(*msgs, level=logging.INFO, logger=logger): """ log multiple lines of text, each line by a separate logging call for cosmetic reasons each positional argument may be a single or multiple lines (separated by newlines) of text. """ lines = [] for msg in msgs: lines.extend(msg.splitlines()) for line in lines: logger.log(level, line) def normalize_chunker_params(cp): assert isinstance(cp, (list, tuple)) if isinstance(cp, list): cp = tuple(cp) if len(cp) == 4 and isinstance(cp[0], int): # this is a borg < 1.2 chunker_params tuple, no chunker algo specified, but we only had buzhash: cp = (CH_BUZHASH, ) + cp assert cp[0] in (CH_BUZHASH, CH_FIXED) return cp class ChunkIteratorFileWrapper: """File-like wrapper for chunk iterators""" def __init__(self, chunk_iterator, read_callback=None): """ *chunk_iterator* should be an iterator yielding bytes. These will be buffered internally as necessary to satisfy .read() calls. *read_callback* will be called with one argument, some byte string that has just been read and will be subsequently returned to a caller of .read(). It can be used to update a progress display. """ self.chunk_iterator = chunk_iterator self.chunk_offset = 0 self.chunk = b'' self.exhausted = False self.read_callback = read_callback def _refill(self): remaining = len(self.chunk) - self.chunk_offset if not remaining: try: chunk = next(self.chunk_iterator) self.chunk = memoryview(chunk) except StopIteration: self.exhausted = True return 0 # EOF self.chunk_offset = 0 remaining = len(self.chunk) return remaining def _read(self, nbytes): if not nbytes: return b'' remaining = self._refill() will_read = min(remaining, nbytes) self.chunk_offset += will_read return self.chunk[self.chunk_offset - will_read:self.chunk_offset] def read(self, nbytes): parts = [] while nbytes and not self.exhausted: read_data = self._read(nbytes) nbytes -= len(read_data) parts.append(read_data) if self.read_callback: self.read_callback(read_data) return b''.join(parts) def open_item(archive, item): """Return file-like object for archived item (with chunks).""" chunk_iterator = archive.pipeline.fetch_many([c.id for c in item.chunks]) return ChunkIteratorFileWrapper(chunk_iterator) def chunkit(it, size): """ Chunk an iterator into pieces of . >>> list(chunker('ABCDEFG', 3)) [['A', 'B', 'C'], ['D', 'E', 'F'], ['G']] """ iterable = iter(it) return iter(lambda: list(islice(iterable, size)), []) def consume(iterator, n=None): """Advance the iterator n-steps ahead. If n is none, consume entirely.""" # Use functions that consume iterators at C speed. if n is None: # feed the entire iterator into a zero-length deque deque(iterator, maxlen=0) else: # advance to the empty slice starting at position n next(islice(iterator, n, n), None) class ErrorIgnoringTextIOWrapper(io.TextIOWrapper): def read(self, n): if not self.closed: try: return super().read(n) except BrokenPipeError: try: super().close() except OSError: pass return '' def write(self, s): if not self.closed: try: return super().write(s) except BrokenPipeError: try: super().close() except OSError: pass return len(s) def iter_separated(fd, sep=None, read_size=4096): """Iter over chunks of open file ``fd`` delimited by ``sep``. Doesn't trim.""" buf = fd.read(read_size) is_str = isinstance(buf, str) part = '' if is_str else b'' sep = sep or ('\n' if is_str else b'\n') while len(buf) > 0: part2, *items = buf.split(sep) *full, part = (part + part2, *items) yield from full buf = fd.read(read_size) # won't yield an empty part if stream ended with `sep` # or if there was no data before EOF if len(part) > 0: yield part def get_tar_filter(fname, decompress): # Note that filter is None if fname is '-'. if fname.endswith(('.tar.gz', '.tgz')): filter = 'gzip -d' if decompress else 'gzip' elif fname.endswith(('.tar.bz2', '.tbz')): filter = 'bzip2 -d' if decompress else 'bzip2' elif fname.endswith(('.tar.xz', '.txz')): filter = 'xz -d' if decompress else 'xz' elif fname.endswith(('.tar.lz4', )): filter = 'lz4 -d' if decompress else 'lz4' elif fname.endswith(('.tar.zstd', '.tar.zst')): filter = 'zstd -d' if decompress else 'zstd' else: filter = None logger.debug('Automatically determined tar filter: %s', filter) return filter ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/helpers/msgpack.py0000644000076500000240000001370414641074756017414 0ustar00twstafffrom .datastruct import StableDict from ..constants import * # NOQA # wrapping msgpack --------------------------------------------------------------------------------------------------- # # due to the breaking api changes in upstream msgpack (from 0.x to 1.0), we wrapped it the way we need it - # to avoid having lots of clutter in the calling code. see tickets #968 and #3632. # as borg 1.4 now requires msgpack > 1.0 anyway, the wrapper has reduced functionality, but was kept. # # Packing # ------- # use_bin_type = False is needed to generate the old msgpack format (not msgpack 2.0 spec) as borg always did. # unicode_errors = None is needed because usage of it is deprecated # # Unpacking # --------- # raw = True is needed to unpack the old msgpack format to bytes (not str, about the decoding see item.pyx). # unicode_errors = None is needed because usage of it is deprecated from msgpack import Packer as mp_Packer from msgpack import packb as mp_packb from msgpack import pack as mp_pack from msgpack import Unpacker as mp_Unpacker from msgpack import unpackb as mp_unpackb from msgpack import unpack as mp_unpack from msgpack import version as mp_version from msgpack import ExtType from msgpack import OutOfData version = mp_version class PackException(Exception): """Exception while msgpack packing""" class UnpackException(Exception): """Exception while msgpack unpacking""" class Packer(mp_Packer): def __init__(self, *, default=None, unicode_errors=None, use_single_float=False, autoreset=True, use_bin_type=False, strict_types=False): assert unicode_errors is None super().__init__(default=default, unicode_errors=unicode_errors, use_single_float=use_single_float, autoreset=autoreset, use_bin_type=use_bin_type, strict_types=strict_types) def pack(self, obj): try: return super().pack(obj) except Exception as e: raise PackException(e) def packb(o, *, use_bin_type=False, unicode_errors=None, **kwargs): assert unicode_errors is None try: return mp_packb(o, use_bin_type=use_bin_type, unicode_errors=unicode_errors, **kwargs) except Exception as e: raise PackException(e) def pack(o, stream, *, use_bin_type=False, unicode_errors=None, **kwargs): assert unicode_errors is None try: return mp_pack(o, stream, use_bin_type=use_bin_type, unicode_errors=unicode_errors, **kwargs) except Exception as e: raise PackException(e) class Unpacker(mp_Unpacker): def __init__(self, file_like=None, *, read_size=0, use_list=True, raw=True, object_hook=None, object_pairs_hook=None, list_hook=None, unicode_errors=None, max_buffer_size=0, ext_hook=ExtType, strict_map_key=False): assert raw is True assert unicode_errors is None kw = dict(file_like=file_like, read_size=read_size, use_list=use_list, raw=raw, object_hook=object_hook, object_pairs_hook=object_pairs_hook, list_hook=list_hook, unicode_errors=unicode_errors, max_buffer_size=max_buffer_size, ext_hook=ext_hook, strict_map_key=strict_map_key) super().__init__(**kw) def unpack(self): try: return super().unpack() except OutOfData: raise except Exception as e: raise UnpackException(e) def __next__(self): try: return super().__next__() except StopIteration: raise except Exception as e: raise UnpackException(e) next = __next__ def unpackb(packed, *, raw=True, unicode_errors=None, strict_map_key=False, **kwargs): assert unicode_errors is None try: kw = dict(raw=raw, unicode_errors=unicode_errors, strict_map_key=strict_map_key) kw.update(kwargs) return mp_unpackb(packed, **kw) except Exception as e: raise UnpackException(e) def unpack(stream, *, raw=True, unicode_errors=None, strict_map_key=False, **kwargs): assert unicode_errors is None try: kw = dict(raw=raw, unicode_errors=unicode_errors, strict_map_key=strict_map_key) kw.update(kwargs) return mp_unpack(stream, **kw) except Exception as e: raise UnpackException(e) # msgpacking related utilities ----------------------------------------------- def is_slow_msgpack(): import msgpack import msgpack.fallback return msgpack.Packer is msgpack.fallback.Packer def is_supported_msgpack(): # DO NOT CHANGE OR REMOVE! See also requirements and comments in pyproject.toml. import msgpack return (1, 0, 3) <= msgpack.version <= (1, 1, 0) and \ msgpack.version not in [] # < add bad releases here to deny list def get_limited_unpacker(kind): """return a limited Unpacker because we should not trust msgpack data received from remote""" # Note: msgpack >= 0.6.1 auto-computes DoS-safe max values from len(data) for # unpack(data) or from max_buffer_size for Unpacker(max_buffer_size=N). args = dict(use_list=False, max_buffer_size=3 * max(BUFSIZE, MAX_OBJECT_SIZE)) # return tuples, not lists if kind in ('server', 'client'): pass # nothing special elif kind in ('manifest', 'archive', 'key'): args.update(dict(use_list=True, object_hook=StableDict)) # default value else: raise ValueError('kind must be "server", "client", "manifest", "archive" or "key"') return Unpacker(**args) def bigint_to_int(mtime): """Convert bytearray to int """ if isinstance(mtime, bytes): return int.from_bytes(mtime, 'little', signed=True) return mtime def int_to_bigint(value): """Convert integers larger than 64 bits to bytearray Smaller integers are left alone """ if value.bit_length() > 63: return value.to_bytes((value.bit_length() + 9) // 8, 'little', signed=True) return value ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/helpers/parseformat.py0000644000076500000240000011731414641074756020314 0ustar00twstaffimport argparse import binascii import hashlib import json import os import os.path import re import shlex import socket import stat import uuid from collections import Counter, OrderedDict from datetime import datetime, timezone from functools import partial from string import Formatter from ..logger import create_logger logger = create_logger() from .errors import Error from .fs import get_keys_dir from .time import OutputTimestamp, format_time, to_localtime, safe_timestamp, safe_s from .. import __version__ as borg_version from .. import __version_tuple__ as borg_version_tuple from ..constants import * # NOQA from ..platformflags import is_win32 def bin_to_hex(binary): return binascii.hexlify(binary).decode('ascii') def hex_to_bin(hex, length=None): try: binary = binascii.unhexlify(hex) binary_len = len(binary) if length is not None and binary_len != length: raise ValueError(f"Expected {length} bytes ({2 * length} hex digits), got {binary_len} bytes.") except binascii.Error as e: raise ValueError(str(e)) from None return binary def safe_decode(s, coding='utf-8', errors='surrogateescape'): """decode bytes to str, with round-tripping "invalid" bytes""" if s is None: return None return s.decode(coding, errors) def safe_encode(s, coding='utf-8', errors='surrogateescape'): """encode str to bytes, with round-tripping "invalid" bytes""" if s is None: return None return s.encode(coding, errors) def remove_surrogates(s, errors='replace'): """Replace surrogates generated by fsdecode with '?'""" return s.encode('utf-8', errors).decode('utf-8') def eval_escapes(s): """Evaluate literal escape sequences in a string (eg `\\n` -> `\n`).""" return s.encode('ascii', 'backslashreplace').decode('unicode-escape') def decode_dict(d, keys, encoding='utf-8', errors='surrogateescape'): for key in keys: if isinstance(d.get(key), bytes): d[key] = d[key].decode(encoding, errors) return d def positive_int_validator(value): """argparse type for positive integers""" int_value = int(value) if int_value <= 0: raise argparse.ArgumentTypeError('A positive integer is required: %s' % value) return int_value def interval(s): """Convert a string representing a valid interval to a number of hours.""" multiplier = {'H': 1, 'd': 24, 'w': 24 * 7, 'm': 24 * 31, 'y': 24 * 365} if s.endswith(tuple(multiplier.keys())): number = s[:-1] suffix = s[-1] else: # range suffixes in ascending multiplier order ranges = [k for k, v in sorted(multiplier.items(), key=lambda t: t[1])] raise argparse.ArgumentTypeError( f'Unexpected interval time unit "{s[-1]}": expected one of {ranges!r}') try: hours = int(number) * multiplier[suffix] except ValueError: hours = -1 if hours <= 0: raise argparse.ArgumentTypeError( 'Unexpected interval number "%s": expected an integer greater than 0' % number) return hours def ChunkerParams(s): def reject_or_warn(msg, reject): if reject: raise argparse.ArgumentTypeError(msg) else: logger.warning(msg) params = s.strip().split(',') count = len(params) if count == 0: reject_or_warn('no chunker params given', True) algo = params[0].lower() if algo == CH_FIXED and 2 <= count <= 3: # fixed, block_size[, header_size] block_size = int(params[1]) header_size = int(params[2]) if count == 3 else 0 if block_size < 64: # we are only disallowing the most extreme cases of abuse here - this does NOT imply # that cutting chunks of the minimum allowed size is efficient concerning storage # or in-memory chunk management. # choose the block (chunk) size wisely: if you have a lot of data and you cut # it into very small chunks, you are asking for trouble! reject_or_warn('block_size must not be less than 64 Bytes', False) if block_size > MAX_DATA_SIZE or header_size > MAX_DATA_SIZE: reject_or_warn('block_size and header_size must not exceed MAX_DATA_SIZE [%d]' % MAX_DATA_SIZE, True) return algo, block_size, header_size if algo == 'default' and count == 1: # default return CHUNKER_PARAMS # this must stay last as it deals with old-style compat mode (no algorithm, 4 params, buzhash): if algo == CH_BUZHASH and count == 5 or count == 4: # [buzhash, ]chunk_min, chunk_max, chunk_mask, window_size chunk_min, chunk_max, chunk_mask, window_size = (int(p) for p in params[count - 4:]) if not (chunk_min <= chunk_mask <= chunk_max): reject_or_warn('required: chunk_min <= chunk_mask <= chunk_max', False) if chunk_min < 6: # see comment in 'fixed' algo check reject_or_warn('min. chunk size exponent must not be less than 6 (2^6 = 64B min. chunk size)', False) if chunk_max > 23: reject_or_warn('max. chunk size exponent must not be more than 23 (2^23 = 8MiB max. chunk size)', True) return CH_BUZHASH, chunk_min, chunk_max, chunk_mask, window_size raise argparse.ArgumentTypeError('invalid chunker params') def FilesCacheMode(s): ENTRIES_MAP = dict(ctime='c', mtime='m', size='s', inode='i', rechunk='r', disabled='d') VALID_MODES = ('cis', 'ims', 'cs', 'ms', 'cr', 'mr', 'd', 's') # letters in alpha order entries = set(s.strip().split(',')) if not entries <= set(ENTRIES_MAP): raise argparse.ArgumentTypeError( 'cache mode must be a comma-separated list of: %s' % ','.join(sorted(ENTRIES_MAP)) ) short_entries = {ENTRIES_MAP[entry] for entry in entries} mode = ''.join(sorted(short_entries)) if mode not in VALID_MODES: raise argparse.ArgumentTypeError('cache mode short must be one of: %s' % ','.join(VALID_MODES)) return mode def partial_format(format, mapping): """ Apply format.format_map(mapping) while preserving unknown keys Does not support attribute access, indexing and ![rsa] conversions """ for key, value in mapping.items(): key = re.escape(key) format = re.sub(fr'(? 0 else '' fmt = '{0:{1}.{2}f}{3}{4}{5}' prec = 0 for unit in units[:-1]: if abs(round(num, precision)) < power: break num /= float(power) prec = precision else: unit = units[-1] return fmt.format(num, sign, prec, sep, unit, suffix) def sizeof_fmt_iec(num, suffix='B', sep='', precision=2, sign=False): return sizeof_fmt(num, suffix=suffix, sep=sep, precision=precision, sign=sign, units=['', 'Ki', 'Mi', 'Gi', 'Ti', 'Pi', 'Ei', 'Zi', 'Yi'], power=1024) def sizeof_fmt_decimal(num, suffix='B', sep='', precision=2, sign=False): return sizeof_fmt(num, suffix=suffix, sep=sep, precision=precision, sign=sign, units=['', 'k', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'], power=1000) def format_archive(archive): return '%-36s %s [%s]' % ( archive.name, format_time(to_localtime(archive.ts)), bin_to_hex(archive.id), ) def parse_stringified_list(s): l = re.split(" *, *", s) return [item for item in l if item != ''] class Location: """Object representing a repository / archive location """ proto = user = _host = port = path = archive = None # user must not contain "@", ":" or "/". # Quoting adduser error message: # "To avoid problems, the username should consist only of letters, digits, # underscores, periods, at signs and dashes, and not start with a dash # (as defined by IEEE Std 1003.1-2001)." # We use "@" as separator between username and hostname, so we must # disallow it within the pure username part. optional_user_re = r""" (?:(?P[^@:/]+)@)? """ # path must not contain :: (it ends at :: or string end), but may contain single colons. # to avoid ambiguities with other regexes, it must also not start with ":" nor with "//" nor with "ssh://". scp_path_re = r""" (?!(:|//|ssh://)) # not starting with ":" or // or ssh:// (?P([^:]|(:(?!:)))+) # any chars, but no "::" """ # file_path must not contain :: (it ends at :: or string end), but may contain single colons. # it must start with a / and that slash is part of the path. file_path_re = r""" (?P(([^/]*)/([^:]|(:(?!:)))+)) # start opt. servername, then /, then any chars, but no "::" """ # abs_path must not contain :: (it ends at :: or string end), but may contain single colons. # it must start with a / and that slash is part of the path. abs_path_re = r""" (?P(/([^:]|(:(?!:)))+)) # start with /, then any chars, but no "::" """ # optional ::archive_name at the end, archive name must not contain "/". # borg mount's FUSE filesystem creates one level of directories from # the archive names and of course "/" is not valid in a directory name. optional_archive_re = r""" (?: :: # "::" as separator (?P[^/]+) # archive name must not contain "/" )?$""" # must match until the end # host NAME, or host IP ADDRESS (v4 or v6, v6 must be in square brackets) host_re = r""" (?P( (?!\[)[^:/]+(?ssh):// # ssh:// """ + optional_user_re + host_re + r""" # user@ (optional), host name or address (?::(?P\d+))? # :port (optional) """ + abs_path_re + optional_archive_re, re.VERBOSE) # path or path::archive file_re = re.compile(r""" (?Pfile):// # file:// """ + file_path_re + optional_archive_re, re.VERBOSE) # servername/path, path or path::archive # note: scp_re is also used for local paths scp_re = re.compile(r""" ( """ + optional_user_re + host_re + r""" # user@ (optional), host name or address : # : (required!) )? # user@host: part is optional """ + scp_path_re + optional_archive_re, re.VERBOSE) # path with optional archive # get the repo from BORG_REPO env and the optional archive from param. # if the syntax requires giving REPOSITORY (see "borg mount"), # use "::" to let it use the env var. # if REPOSITORY argument is optional, it'll automatically use the env. env_re = re.compile(r""" # the repo part is fetched from BORG_REPO (?:::$) # just "::" is ok (when a pos. arg is required, no archive) | # or """ + optional_archive_re, re.VERBOSE) # archive name (optional, may be empty) win_file_re = re.compile(r""" (?:file://)? # optional file protocol (?P (?:[a-zA-Z]:)? # Drive letter followed by a colon (optional) (?:[^:]+) # Anything which does not contain a :, at least one character ) """ + optional_archive_re, re.VERBOSE) # archive name (optional, may be empty) def __init__(self, text='', overrides={}): if not self.parse(text, overrides): raise ValueError('Invalid location format: "%s"' % self.processed) def parse(self, text, overrides={}): self.raw = text # as given by user, might contain placeholders self.processed = text = replace_placeholders(text, overrides) # after placeholder replacement valid = self._parse(text) if valid: return True m = self.env_re.match(text) if not m: return False repo_raw = os.environ.get('BORG_REPO') if repo_raw is None: return False repo = replace_placeholders(repo_raw, overrides) valid = self._parse(repo) self.archive = m.group('archive') self.raw = repo_raw if not self.archive else repo_raw + self.raw self.processed = repo if not self.archive else f'{repo}::{self.archive}' return valid def _parse(self, text): def normpath_special(p): # avoid that normpath strips away our relative path hack and even makes p absolute relative = p.startswith('/./') p = os.path.normpath(p) return ('/.' + p) if relative else p if is_win32: m = self.win_file_re.match(text) if m: self.proto = 'file' self.path = m.group('path') self.archive = m.group('archive') return True # On windows we currently only support windows paths return False m = self.ssh_re.match(text) if m: self.proto = m.group('proto') self.user = m.group('user') self._host = m.group('host') self.port = m.group('port') and int(m.group('port')) or None self.path = normpath_special(m.group('path')) self.archive = m.group('archive') return True m = self.file_re.match(text) if m: self.proto = m.group('proto') self.path = normpath_special(m.group('path')) self.archive = m.group('archive') return True m = self.scp_re.match(text) if m: self.user = m.group('user') self._host = m.group('host') self.path = normpath_special(m.group('path')) self.archive = m.group('archive') self.proto = self._host and 'ssh' or 'file' return True return False def __str__(self): items = [ 'proto=%r' % self.proto, 'user=%r' % self.user, 'host=%r' % self.host, 'port=%r' % self.port, 'path=%r' % self.path, 'archive=%r' % self.archive, ] return ', '.join(items) def to_key_filename(self): name = re.sub(r'[^\w]', '_', self.path).strip('_') if self.proto != 'file': name = re.sub(r'[^\w]', '_', self.host) + '__' + name if len(name) > 100: # Limit file names to some reasonable length. Most file systems # limit them to 255 [unit of choice]; due to variations in unicode # handling we truncate to 100 *characters*. name = name[:100] return os.path.join(get_keys_dir(), name) def __repr__(self): return "Location(%s)" % self @property def host(self): # strip square brackets used for IPv6 addrs if self._host is not None: return self._host.lstrip('[').rstrip(']') def canonical_path(self): if self.proto == 'file': return self.path else: if self.path and self.path.startswith('~'): path = '/' + self.path # /~/x = path x relative to home dir elif self.path and not self.path.startswith('/'): path = '/./' + self.path # /./x = path x relative to cwd else: path = self.path return 'ssh://{}{}{}{}'.format(f'{self.user}@' if self.user else '', self._host, # needed for ipv6 addrs f':{self.port}' if self.port else '', path) def with_timestamp(self, timestamp): return Location(self.raw, overrides={ 'now': DatetimeWrapper(timestamp.astimezone(None)), 'utcnow': DatetimeWrapper(timestamp), }) def omit_archive(self): loc = Location(self.raw) loc.archive = None loc.raw = loc.raw.split("::")[0] loc.processed = loc.processed.split("::")[0] return loc def location_validator(archive=None, proto=None): def validator(text): try: loc = Location(text) except ValueError as err: raise argparse.ArgumentTypeError(str(err)) from None if archive is True and not loc.archive: raise argparse.ArgumentTypeError('"%s": No archive specified' % text) elif archive is False and loc.archive: raise argparse.ArgumentTypeError('"%s": No archive can be specified' % text) if proto is not None and loc.proto != proto: if proto == 'file': raise argparse.ArgumentTypeError('"%s": Repository must be local' % text) else: raise argparse.ArgumentTypeError('"%s": Repository must be remote' % text) return loc return validator def archivename_validator(): def validator(text): text = replace_placeholders(text) if '/' in text or '::' in text or not text: raise argparse.ArgumentTypeError('Invalid archive name: "%s"' % text) return text return validator class BaseFormatter: FIXED_KEYS = { # Formatting aids 'LF': '\n', 'SPACE': ' ', 'TAB': '\t', 'CR': '\r', 'NUL': '\0', 'NEWLINE': os.linesep, 'NL': os.linesep, } def get_item_data(self, item): raise NotImplementedError def format_item(self, item): return self.format.format_map(self.get_item_data(item)) @staticmethod def keys_help(): return "- NEWLINE: OS dependent line separator\n" \ "- NL: alias of NEWLINE\n" \ "- NUL: NUL character for creating print0 / xargs -0 like output, see barchive and bpath keys below\n" \ "- SPACE\n" \ "- TAB\n" \ "- CR\n" \ "- LF" class ArchiveFormatter(BaseFormatter): KEY_DESCRIPTIONS = { 'archive': 'archive name interpreted as text (might be missing non-text characters, see barchive)', 'name': 'alias of "archive"', 'barchive': 'verbatim archive name, can contain any character except NUL', 'comment': 'archive comment interpreted as text (might be missing non-text characters, see bcomment)', 'bcomment': 'verbatim archive comment, can contain any character except NUL', # *start* is the key used by borg-info for this timestamp, this makes the formats more compatible 'start': 'time (start) of creation of the archive', 'time': 'alias of "start"', 'end': 'time (end) of creation of the archive', 'command_line': 'command line which was used to create the archive', 'id': 'internal ID of the archive', 'hostname': 'hostname of host on which this archive was created', 'username': 'username of user who created this archive', 'tam': 'TAM authentication state of this archive', } KEY_GROUPS = ( ('archive', 'name', 'barchive', 'comment', 'bcomment', 'id', 'tam'), ('start', 'time', 'end', 'command_line'), ('hostname', 'username'), ) @classmethod def available_keys(cls): from .manifest import ArchiveInfo fake_archive_info = ArchiveInfo('archivename', b'\1'*32, datetime(1970, 1, 1, tzinfo=timezone.utc)) formatter = cls('', None, None, None) keys = [] keys.extend(formatter.call_keys.keys()) keys.extend(formatter.get_item_data(fake_archive_info).keys()) return keys @classmethod def keys_help(cls): help = [] keys = cls.available_keys() for key in cls.FIXED_KEYS: keys.remove(key) for group in cls.KEY_GROUPS: for key in group: keys.remove(key) text = "- " + key if key in cls.KEY_DESCRIPTIONS: text += ": " + cls.KEY_DESCRIPTIONS[key] help.append(text) help.append("") assert not keys, str(keys) return "\n".join(help) def __init__(self, format, repository, manifest, key, *, json=False, iec=False): self.repository = repository self.manifest = manifest self.key = key self.name = None self.id = None self._archive = None self.json = json self.iec = iec static_keys = {} # here could be stuff on repo level, above archive level static_keys.update(self.FIXED_KEYS) self.format = partial_format(format, static_keys) self.format_keys = {f[1] for f in Formatter().parse(format)} self.call_keys = { 'hostname': partial(self.get_meta, 'hostname', rs=True), 'username': partial(self.get_meta, 'username', rs=True), 'comment': partial(self.get_meta, 'comment', rs=True), 'bcomment': partial(self.get_meta, 'comment', rs=False), 'end': self.get_ts_end, 'command_line': self.get_cmdline, 'tam': self.get_tam, } self.used_call_keys = set(self.call_keys) & self.format_keys if self.json: self.item_data = {} self.format_item = self.format_item_json else: self.item_data = static_keys def format_item_json(self, item): return json.dumps(self.get_item_data(item), cls=BorgJsonEncoder, sort_keys=True) + '\n' def get_item_data(self, archive_info): self.name = archive_info.name self.id = archive_info.id item_data = {} item_data.update(self.item_data) item_data.update({ 'name': remove_surrogates(archive_info.name), 'archive': remove_surrogates(archive_info.name), 'barchive': archive_info.name, 'id': bin_to_hex(archive_info.id), 'time': self.format_time(archive_info.ts), 'start': self.format_time(archive_info.ts), }) for key in self.used_call_keys: item_data[key] = self.call_keys[key]() return item_data @property def archive(self): """lazy load / update loaded archive""" if self._archive is None or self._archive.id != self.id: from ..archive import Archive self._archive = Archive(self.repository, self.key, self.manifest, self.name, iec=self.iec) return self._archive def get_meta(self, key, rs): value = self.archive.metadata.get(key, '') return remove_surrogates(value) if rs else value def get_cmdline(self): cmdline = map(remove_surrogates, self.archive.metadata.get('cmdline', [])) if self.json: return list(cmdline) else: return ' '.join(map(shlex.quote, cmdline)) def get_ts_end(self): return self.format_time(self.archive.ts_end) def get_tam(self): return 'verified' if self.archive.tam_verified else 'none' def format_time(self, ts): return OutputTimestamp(ts) class ItemFormatter(BaseFormatter): # we provide the hash algos from python stdlib (except shake_*) and additionally xxh64. # shake_* is not provided because it uses an incompatible .digest() method to support variable length. hash_algorithms = hashlib.algorithms_guaranteed.union({'xxh64'}).difference({'shake_128', 'shake_256'}) KEY_DESCRIPTIONS = { 'bpath': 'verbatim POSIX path, can contain any character except NUL', 'path': 'path interpreted as text (might be missing non-text characters, see bpath)', 'source': 'link target for links (identical to linktarget)', 'extra': 'prepends {source} with " -> " for soft links and " link to " for hard links', 'csize': 'compressed size', 'dsize': 'deduplicated size', 'dcsize': 'deduplicated compressed size', 'num_chunks': 'number of chunks in this file', 'unique_chunks': 'number of unique chunks in this file', 'xxh64': 'XXH64 checksum of this file (note: this is NOT a cryptographic hash!)', 'health': 'either "healthy" (file ok) or "broken" (if file has all-zero replacement chunks)', } KEY_GROUPS = ( ('type', 'mode', 'uid', 'gid', 'user', 'group', 'path', 'bpath', 'source', 'linktarget', 'flags'), ('size', 'csize', 'dsize', 'dcsize', 'num_chunks', 'unique_chunks'), ('mtime', 'ctime', 'atime', 'isomtime', 'isoctime', 'isoatime'), tuple(sorted(hash_algorithms)), ('archiveid', 'archivename', 'extra'), ('health', ) ) KEYS_REQUIRING_CACHE = ( 'dsize', 'dcsize', 'unique_chunks', ) @classmethod def available_keys(cls): class FakeArchive: fpr = name = "" from ..item import Item fake_item = Item(mode=0, path='', user='', group='', mtime=0, uid=0, gid=0) formatter = cls(FakeArchive, "") keys = [] keys.extend(formatter.call_keys.keys()) keys.extend(formatter.get_item_data(fake_item).keys()) return keys @classmethod def keys_help(cls): help = [] keys = cls.available_keys() for key in cls.FIXED_KEYS: keys.remove(key) for group in cls.KEY_GROUPS: for key in group: keys.remove(key) text = "- " + key if key in cls.KEY_DESCRIPTIONS: text += ": " + cls.KEY_DESCRIPTIONS[key] help.append(text) help.append("") assert not keys, str(keys) return "\n".join(help) @classmethod def format_needs_cache(cls, format): format_keys = {f[1] for f in Formatter().parse(format)} return any(key in cls.KEYS_REQUIRING_CACHE for key in format_keys) def __init__(self, archive, format, *, json_lines=False): from ..algorithms.checksums import StreamingXXH64 self.xxh64 = StreamingXXH64 self.archive = archive self.json_lines = json_lines static_keys = { 'archivename': archive.name, 'archiveid': archive.fpr, } static_keys.update(self.FIXED_KEYS) if self.json_lines: self.item_data = {} self.format_item = self.format_item_json else: self.item_data = static_keys self.format = partial_format(format, static_keys) self.format_keys = {f[1] for f in Formatter().parse(format)} self.call_keys = { 'size': self.calculate_size, 'csize': self.calculate_csize, 'dsize': partial(self.sum_unique_chunks_metadata, lambda chunk: chunk.size), 'dcsize': partial(self.sum_unique_chunks_metadata, lambda chunk: chunk.csize), 'num_chunks': self.calculate_num_chunks, 'unique_chunks': partial(self.sum_unique_chunks_metadata, lambda chunk: 1), 'isomtime': partial(self.format_iso_time, 'mtime'), 'isoctime': partial(self.format_iso_time, 'ctime'), 'isoatime': partial(self.format_iso_time, 'atime'), 'mtime': partial(self.format_time, 'mtime'), 'ctime': partial(self.format_time, 'ctime'), 'atime': partial(self.format_time, 'atime'), } for hash_function in self.hash_algorithms: self.call_keys[hash_function] = partial(self.hash_item, hash_function) self.used_call_keys = set(self.call_keys) & self.format_keys def format_item_json(self, item): return json.dumps(self.get_item_data(item), cls=BorgJsonEncoder) + '\n' def get_item_data(self, item): item_data = {} item_data.update(self.item_data) mode = stat.filemode(item.mode) item_type = mode[0] source = item.get('source', '') extra = '' if source: source = remove_surrogates(source) if item_type == 'l': extra = ' -> %s' % source else: mode = 'h' + mode[1:] extra = ' link to %s' % source item_data['type'] = item_type item_data['mode'] = mode item_data['user'] = item.user or item.uid item_data['group'] = item.group or item.gid item_data['uid'] = item.uid item_data['gid'] = item.gid item_data['path'] = remove_surrogates(item.path) if self.json_lines: item_data['healthy'] = 'chunks_healthy' not in item else: item_data['bpath'] = item.path item_data['extra'] = extra item_data['health'] = 'broken' if 'chunks_healthy' in item else 'healthy' item_data['source'] = source item_data['linktarget'] = source item_data['flags'] = item.get('bsdflags', 0) for key in self.used_call_keys: item_data[key] = self.call_keys[key](item) return item_data def sum_unique_chunks_metadata(self, metadata_func, item): """ sum unique chunks metadata, a unique chunk is a chunk which is referenced globally as often as it is in the item item: The item to sum its unique chunks' metadata metadata_func: A function that takes a parameter of type ChunkIndexEntry and returns a number, used to return the metadata needed from the chunk """ chunk_index = self.archive.cache.chunks chunks = item.get('chunks', []) chunks_counter = Counter(c.id for c in chunks) return sum(metadata_func(c) for c in chunks if chunk_index[c.id].refcount == chunks_counter[c.id]) def calculate_num_chunks(self, item): return len(item.get('chunks', [])) def calculate_size(self, item): # note: does not support hardlink slaves, they will be size 0 return item.get_size(compressed=False) def calculate_csize(self, item): # note: does not support hardlink slaves, they will be csize 0 return item.get_size(compressed=True) def hash_item(self, hash_function, item): if 'chunks' not in item: return "" if hash_function == 'xxh64': hash = self.xxh64() elif hash_function in self.hash_algorithms: hash = hashlib.new(hash_function) for data in self.archive.pipeline.fetch_many([c.id for c in item.chunks]): hash.update(data) return hash.hexdigest() def format_time(self, key, item): return OutputTimestamp(safe_timestamp(item.get(key) or item.mtime)) def format_iso_time(self, key, item): return self.format_time(key, item).isoformat() def file_status(mode): if stat.S_ISREG(mode): return 'A' elif stat.S_ISDIR(mode): return 'd' elif stat.S_ISBLK(mode): return 'b' elif stat.S_ISCHR(mode): return 'c' elif stat.S_ISLNK(mode): return 's' elif stat.S_ISFIFO(mode): return 'f' return '?' def clean_lines(lines, lstrip=None, rstrip=None, remove_empty=True, remove_comments=True): """ clean lines (usually read from a config file): 1. strip whitespace (left and right), 2. remove empty lines, 3. remove comments. note: only "pure comment lines" are supported, no support for "trailing comments". :param lines: input line iterator (e.g. list or open text file) that gives unclean input lines :param lstrip: lstrip call arguments or False, if lstripping is not desired :param rstrip: rstrip call arguments or False, if rstripping is not desired :param remove_comments: remove comment lines (lines starting with "#") :param remove_empty: remove empty lines :return: yields processed lines """ for line in lines: if lstrip is not False: line = line.lstrip(lstrip) if rstrip is not False: line = line.rstrip(rstrip) if remove_empty and not line: continue if remove_comments and line.startswith('#'): continue yield line def swidth_slice(string, max_width): """ Return a slice of *max_width* cells from *string*. Negative *max_width* means from the end of string. *max_width* is in units of character cells (or "columns"). Latin characters are usually one cell wide, many CJK characters are two cells wide. """ from ..platform import swidth reverse = max_width < 0 max_width = abs(max_width) if reverse: string = reversed(string) current_swidth = 0 result = [] for character in string: current_swidth += swidth(character) if current_swidth > max_width: break result.append(character) if reverse: result.reverse() return ''.join(result) def ellipsis_truncate(msg, space): """ shorten a long string by adding ellipsis between it and return it, example: this_is_a_very_long_string -------> this_is..._string """ from ..platform import swidth ellipsis_width = swidth('...') msg_width = swidth(msg) if space < 8: # if there is very little space, just show ... return '...' + ' ' * (space - ellipsis_width) if space < ellipsis_width + msg_width: return '{}...{}'.format(swidth_slice(msg, space // 2 - ellipsis_width), swidth_slice(msg, -space // 2)) return msg + ' ' * (space - msg_width) class BorgJsonEncoder(json.JSONEncoder): def default(self, o): from ..repository import Repository from ..remote import RemoteRepository from ..archive import Archive from ..cache import LocalCache, AdHocCache if isinstance(o, Repository) or isinstance(o, RemoteRepository): return { 'id': bin_to_hex(o.id), 'location': o._location.canonical_path(), } if isinstance(o, Archive): return o.info() if isinstance(o, LocalCache): return { 'path': o.path, 'stats': o.stats(), } if isinstance(o, AdHocCache): return { 'stats': o.stats(), } if callable(getattr(o, 'to_json', None)): return o.to_json() return super().default(o) def basic_json_data(manifest, *, cache=None, extra=None): key = manifest.key data = extra or {} data.update({ 'repository': BorgJsonEncoder().default(manifest.repository), 'encryption': { 'mode': key.ARG_NAME, }, }) data['repository']['last_modified'] = OutputTimestamp(manifest.last_timestamp.replace(tzinfo=timezone.utc)) if key.NAME.startswith('key file'): data['encryption']['keyfile'] = key.find_key() if cache: data['cache'] = cache return data def json_dump(obj): """Dump using BorgJSONEncoder.""" return json.dumps(obj, sort_keys=True, indent=4, cls=BorgJsonEncoder) def json_print(obj): print(json_dump(obj)) def prepare_dump_dict(d): def decode_bytes(value): # this should somehow be reversible later, but usual strings should # look nice and chunk ids should mostly show in hex. Use a special # inband signaling character (ASCII DEL) to distinguish between # decoded and hex mode. if not value.startswith(b'\x7f'): try: value = value.decode() return value except UnicodeDecodeError: pass return '\u007f' + bin_to_hex(value) def decode_tuple(t): res = [] for value in t: if isinstance(value, dict): value = decode(value) elif isinstance(value, tuple) or isinstance(value, list): value = decode_tuple(value) elif isinstance(value, bytes): value = decode_bytes(value) res.append(value) return res def decode(d): res = OrderedDict() for key, value in d.items(): if isinstance(value, dict): value = decode(value) elif isinstance(value, (tuple, list)): value = decode_tuple(value) elif isinstance(value, bytes): value = decode_bytes(value) if isinstance(key, bytes): key = key.decode() res[key] = value return res return decode(d) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/helpers/process.py0000644000076500000240000003536714641074756017456 0ustar00twstaffimport contextlib import os import os.path import re import shlex import signal import subprocess import sys import time import traceback from .. import __version__ from ..platformflags import is_win32, is_linux, is_freebsd, is_darwin from ..logger import create_logger logger = create_logger() from ..helpers import EXIT_SUCCESS, EXIT_WARNING, EXIT_SIGNAL_BASE, Error @contextlib.contextmanager def _daemonize(): from ..platform import get_process_id old_id = get_process_id() pid = os.fork() if pid: exit_code = EXIT_SUCCESS try: yield old_id, None except _ExitCodeException as e: exit_code = e.exit_code finally: logger.debug('Daemonizing: Foreground process (%s, %s, %s) is now dying.' % old_id) os._exit(exit_code) os.setsid() pid = os.fork() if pid: os._exit(0) os.chdir('/') os.close(0) os.close(1) fd = os.open(os.devnull, os.O_RDWR) os.dup2(fd, 0) os.dup2(fd, 1) new_id = get_process_id() try: yield old_id, new_id finally: # Close / redirect stderr to /dev/null only now # for the case that we want to log something before yield returns. os.close(2) os.dup2(fd, 2) def daemonize(): """Detach process from controlling terminal and run in background Returns: old and new get_process_id tuples """ with _daemonize() as (old_id, new_id): return old_id, new_id @contextlib.contextmanager def daemonizing(*, timeout=5): """Like daemonize(), but as context manager. The with-body is executed in the background process, while the foreground process survives until the body is left or the given timeout is exceeded. In the latter case a warning is reported by the foreground. Context variable is (old_id, new_id) get_process_id tuples. An exception raised in the body is reported by the foreground as a warning as well as propagated outside the body in the background. In case of a warning, the foreground exits with exit code EXIT_WARNING instead of EXIT_SUCCESS. """ with _daemonize() as (old_id, new_id): if new_id is None: # The original / parent process, waiting for a signal to die. logger.debug('Daemonizing: Foreground process (%s, %s, %s) is waiting for background process...' % old_id) exit_code = EXIT_SUCCESS # Indeed, SIGHUP and SIGTERM handlers should have been set on archiver.run(). Just in case... with signal_handler('SIGINT', raising_signal_handler(KeyboardInterrupt)), \ signal_handler('SIGHUP', raising_signal_handler(SigHup)), \ signal_handler('SIGTERM', raising_signal_handler(SigTerm)): try: if timeout > 0: time.sleep(timeout) except SigTerm: # Normal termination; expected from grandchild, see 'os.kill()' below pass except SigHup: # Background wants to indicate a problem; see 'os.kill()' below, # log message will come from grandchild. exit_code = EXIT_WARNING except KeyboardInterrupt: # Manual termination. logger.debug('Daemonizing: Foreground process (%s, %s, %s) received SIGINT.' % old_id) exit_code = EXIT_SIGNAL_BASE + 2 except BaseException as e: # Just in case... logger.warning('Daemonizing: Foreground process received an exception while waiting:\n' + ''.join(traceback.format_exception(e.__class__, e, e.__traceback__))) exit_code = EXIT_WARNING else: logger.warning('Daemonizing: Background process did not respond (timeout). Is it alive?') exit_code = EXIT_WARNING finally: # Don't call with-body, but die immediately! # return would be sufficient, but we want to pass the exit code. raise _ExitCodeException(exit_code) # The background / grandchild process. sig_to_foreground = signal.SIGTERM logger.debug('Daemonizing: Background process (%s, %s, %s) is starting...' % new_id) try: yield old_id, new_id except BaseException as e: sig_to_foreground = signal.SIGHUP logger.warning('Daemonizing: Background process raised an exception while starting:\n' + ''.join(traceback.format_exception(e.__class__, e, e.__traceback__))) raise e else: logger.debug('Daemonizing: Background process (%s, %s, %s) has started.' % new_id) finally: try: os.kill(old_id[1], sig_to_foreground) except BaseException as e: logger.error('Daemonizing: Trying to kill the foreground process raised an exception:\n' + ''.join(traceback.format_exception(e.__class__, e, e.__traceback__))) class _ExitCodeException(BaseException): def __init__(self, exit_code): self.exit_code = exit_code class SignalException(BaseException): """base class for all signal-based exceptions""" class SigHup(SignalException): """raised on SIGHUP signal""" class SigTerm(SignalException): """raised on SIGTERM signal""" @contextlib.contextmanager def signal_handler(sig, handler): """ when entering context, set up signal handler for signal . when leaving context, restore original signal handler. can bei either a str when giving a signal.SIGXXX attribute name (it won't crash if the attribute name does not exist as some names are platform specific) or a int, when giving a signal number. is any handler value as accepted by the signal.signal(sig, handler). """ if isinstance(sig, str): sig = getattr(signal, sig, None) if sig is not None: orig_handler = signal.signal(sig, handler) try: yield finally: if sig is not None: signal.signal(sig, orig_handler) def raising_signal_handler(exc_cls): def handler(sig_no, frame): # setting SIG_IGN avoids that an incoming second signal of this # kind would raise a 2nd exception while we still process the # exception handler for exc_cls for the 1st signal. signal.signal(sig_no, signal.SIG_IGN) raise exc_cls return handler class SigIntManager: def __init__(self): self._sig_int_triggered = False self._action_triggered = False self._action_done = False self.ctx = signal_handler('SIGINT', self.handler) self.debounce_interval = 20000000 # ns self.last = None # monotonic time when we last processed SIGINT def __bool__(self): # this will be True (and stay True) after the first Ctrl-C/SIGINT return self._sig_int_triggered def action_triggered(self): # this is True to indicate that the action shall be done return self._action_triggered def action_done(self): # this will be True after the action has completed return self._action_done def action_completed(self): # this must be called when the action triggered is completed, # to avoid that the action is repeatedly triggered. self._action_triggered = False self._action_done = True def handler(self, sig_no, stack): # Ignore a SIGINT if it comes too quickly after the last one, e.g. because it # was caused by the same Ctrl-C key press and a parent process forwarded it to us. # This can easily happen for the pyinstaller-made binaries because the bootloader # process and the borg process are in same process group (see #8155), but maybe also # under other circumstances. now = time.monotonic_ns() if self.last is None: # first SIGINT self.last = now self._sig_int_triggered = True self._action_triggered = True elif now - self.last >= self.debounce_interval: # second SIGINT # restore the original signal handler for the 3rd+ SIGINT - # this implies that this handler here loses control! self.__exit__(None, None, None) # handle 2nd SIGINT like the default handler would do it: raise KeyboardInterrupt # python docs say this might show up at an arbitrary place. def __enter__(self): self.ctx.__enter__() def __exit__(self, exception_type, exception_value, traceback): # restore the original ctrl-c handler, so the next ctrl-c / SIGINT does the normal thing: if self.ctx: self.ctx.__exit__(exception_type, exception_value, traceback) self.ctx = None # global flag which might trigger some special behaviour on first ctrl-c / SIGINT, # e.g. if this is interrupting "borg create", it shall try to create a checkpoint. sig_int = SigIntManager() def ignore_sigint(): """ Ignore SIGINT, see also issue #6912. Ctrl-C will send a SIGINT to both the main process (borg) and subprocesses (e.g. ssh for remote ssh:// repos), but often we do not want the subprocess getting killed (e.g. because it is still needed to cleanly shut down borg). To avoid that: Popen(..., preexec_fn=ignore_sigint) """ signal.signal(signal.SIGINT, signal.SIG_IGN) def popen_with_error_handling(cmd_line: str, log_prefix='', **kwargs): """ Handle typical errors raised by subprocess.Popen. Return None if an error occurred, otherwise return the Popen object. *cmd_line* is split using shlex (e.g. 'gzip -9' => ['gzip', '-9']). Log messages will be prefixed with *log_prefix*; if set, it should end with a space (e.g. log_prefix='--some-option: '). Does not change the exit code. """ assert not kwargs.get('shell'), 'Sorry pal, shell mode is a no-no' try: command = shlex.split(cmd_line) if not command: raise ValueError('an empty command line is not permitted') except ValueError as ve: logger.error('%s%s', log_prefix, ve) return logger.debug('%scommand line: %s', log_prefix, command) try: return subprocess.Popen(command, **kwargs) except FileNotFoundError: logger.error('%sexecutable not found: %s', log_prefix, command[0]) return except PermissionError: logger.error('%spermission denied: %s', log_prefix, command[0]) return def is_terminal(fd=sys.stdout): return hasattr(fd, 'isatty') and fd.isatty() and (not is_win32 or 'ANSICON' in os.environ) def prepare_subprocess_env(system, env=None): """ Prepare the environment for a subprocess we are going to create. :param system: True for preparing to invoke system-installed binaries, False for stuff inside the pyinstaller environment (like borg, python). :param env: optionally give a environment dict here. if not given, default to os.environ. :return: a modified copy of the environment """ env = dict(env if env is not None else os.environ) if system: # a pyinstaller binary's bootloader modifies LD_LIBRARY_PATH=/tmp/_MEIXXXXXX, # but we do not want that system binaries (like ssh or other) pick up # (non-matching) libraries from there. # thus we install the original LDLP, before pyinstaller has modified it: lp_key = 'LD_LIBRARY_PATH' lp_orig = env.get(lp_key + '_ORIG') # pyinstaller >= 20160820 / v3.2.1 has this if lp_orig is not None: env[lp_key] = lp_orig else: # We get here in 2 cases: # 1. when not running a pyinstaller-made binary. # in this case, we must not kill LDLP. # 2. when running a pyinstaller-made binary and there was no LDLP # in the original env (in this case, the pyinstaller bootloader # does *not* put ..._ORIG into the env either). # in this case, we must kill LDLP. # We can recognize this via sys.frozen and sys._MEIPASS being set. lp = env.get(lp_key) if lp is not None and getattr(sys, 'frozen', False) and hasattr(sys, '_MEIPASS'): env.pop(lp_key) # security: do not give secrets to subprocess env.pop('BORG_PASSPHRASE', None) # for information, give borg version to the subprocess env['BORG_VERSION'] = __version__ return env @contextlib.contextmanager def create_filter_process(cmd, stream, stream_close, inbound=True): if cmd: # put a filter process between stream and us (e.g. a [de]compression command) # inbound: --> filter --> us # outbound: us --> filter --> filter_stream = stream filter_stream_close = stream_close env = prepare_subprocess_env(system=True) # There is no deadlock potential here (the subprocess docs warn about this), because # communication with the process is a one-way road, i.e. the process can never block # for us to do something while we block on the process for something different. if inbound: proc = popen_with_error_handling(cmd, stdout=subprocess.PIPE, stdin=filter_stream, log_prefix='filter-process: ', env=env, preexec_fn=ignore_sigint) else: proc = popen_with_error_handling(cmd, stdin=subprocess.PIPE, stdout=filter_stream, log_prefix='filter-process: ', env=env, preexec_fn=ignore_sigint) if not proc: raise Error(f'filter {cmd}: process creation failed') stream = proc.stdout if inbound else proc.stdin # inbound: do not close the pipe (this is the task of the filter process [== writer]) # outbound: close the pipe, otherwise the filter process would not notice when we are done. stream_close = not inbound try: yield stream except Exception: # something went wrong with processing the stream by borg logger.debug('Exception, killing the filter...') if cmd: proc.kill() borg_succeeded = False raise else: borg_succeeded = True finally: if stream_close: stream.close() if cmd: logger.debug('Done, waiting for filter to die...') rc = proc.wait() logger.debug('filter cmd exited with code %d', rc) if filter_stream_close: filter_stream.close() if borg_succeeded and rc: # if borg did not succeed, we know that we killed the filter process raise Error('filter %s failed, rc=%d' % (cmd, rc)) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/helpers/progress.py0000644000076500000240000001544614641074756017640 0ustar00twstaffimport logging import json import sys import time from shutil import get_terminal_size from ..logger import create_logger logger = create_logger() from .parseformat import ellipsis_truncate def justify_to_terminal_size(message): terminal_space = get_terminal_size(fallback=(-1, -1))[0] # justify only if we are outputting to a terminal if terminal_space != -1: return message.ljust(terminal_space) return message class ProgressIndicatorBase: LOGGER = 'borg.output.progress' JSON_TYPE = None json = False operation_id_counter = 0 @classmethod def operation_id(cls): """Unique number, can be used by receiving applications to distinguish different operations.""" cls.operation_id_counter += 1 return cls.operation_id_counter def __init__(self, msgid=None): self.handler = None self.logger = logging.getLogger(self.LOGGER) self.id = self.operation_id() self.msgid = msgid # If there are no handlers, set one up explicitly because the # terminator and propagation needs to be set. If there are, # they must have been set up by BORG_LOGGING_CONF: skip setup. if not self.logger.handlers: self.handler = logging.StreamHandler(stream=sys.stderr) self.handler.setLevel(logging.INFO) logger = logging.getLogger('borg') # Some special attributes on the borg logger, created by setup_logging # But also be able to work without that try: formatter = logger.formatter terminator = '\n' if logger.json else '\r' self.json = logger.json except AttributeError: terminator = '\r' else: self.handler.setFormatter(formatter) self.handler.terminator = terminator self.logger.addHandler(self.handler) if self.logger.level == logging.NOTSET: self.logger.setLevel(logging.WARN) self.logger.propagate = False # If --progress is not set then the progress logger level will be WARN # due to setup_implied_logging (it may be NOTSET with a logging config file, # but the interactions there are generally unclear), so self.emit becomes # False, which is correct. # If --progress is set then the level will be INFO as per setup_implied_logging; # note that this is always the case for serve processes due to a "args.progress |= is_serve". # In this case self.emit is True. self.emit = self.logger.getEffectiveLevel() == logging.INFO def __del__(self): if self.handler is not None: self.logger.removeHandler(self.handler) self.handler.close() def output_json(self, *, finished=False, **kwargs): assert self.json if not self.emit: return kwargs.update(dict( operation=self.id, msgid=self.msgid, type=self.JSON_TYPE, finished=finished, time=time.time(), )) print(json.dumps(kwargs), file=sys.stderr, flush=True) def finish(self): if self.json: self.output_json(finished=True) else: self.output('') class ProgressIndicatorMessage(ProgressIndicatorBase): JSON_TYPE = 'progress_message' def output(self, msg): if self.json: self.output_json(message=msg) else: self.logger.info(justify_to_terminal_size(msg)) class ProgressIndicatorPercent(ProgressIndicatorBase): JSON_TYPE = 'progress_percent' def __init__(self, total=0, step=5, start=0, msg="%3.0f%%", msgid=None): """ Percentage-based progress indicator :param total: total amount of items :param step: step size in percent :param start: at which percent value to start :param msg: output message, must contain one %f placeholder for the percentage """ self.counter = 0 # 0 .. (total-1) self.total = total self.trigger_at = start # output next percentage value when reaching (at least) this self.step = step self.msg = msg super().__init__(msgid=msgid) def progress(self, current=None, increase=1): if current is not None: self.counter = current pct = self.counter * 100 / self.total self.counter += increase if pct >= self.trigger_at: self.trigger_at += self.step return pct def show(self, current=None, increase=1, info=None): """ Show and output the progress message :param current: set the current percentage [None] :param increase: increase the current percentage [None] :param info: array of strings to be formatted with msg [None] """ pct = self.progress(current, increase) if pct is not None: # truncate the last argument, if no space is available if info is not None: if not self.json: from ..platform import swidth # avoid circular import # no need to truncate if we're not outputting to a terminal terminal_space = get_terminal_size(fallback=(-1, -1))[0] if terminal_space != -1: space = terminal_space - swidth(self.msg % tuple([pct] + info[:-1] + [''])) info[-1] = ellipsis_truncate(info[-1], space) return self.output(self.msg % tuple([pct] + info), justify=False, info=info) return self.output(self.msg % pct) def output(self, message, justify=True, info=None): if self.json: self.output_json(message=message, current=self.counter, total=self.total, info=info) else: if justify: message = justify_to_terminal_size(message) self.logger.info(message) class ProgressIndicatorEndless: def __init__(self, step=10, file=None): """ Progress indicator (long row of dots) :param step: every Nth call, call the func :param file: output file, default: sys.stderr """ self.counter = 0 # call counter self.triggered = 0 # increases 1 per trigger event self.step = step # trigger every calls if file is None: file = sys.stderr self.file = file def progress(self): self.counter += 1 trigger = self.counter % self.step == 0 if trigger: self.triggered += 1 return trigger def show(self): trigger = self.progress() if trigger: return self.output(self.triggered) def output(self, triggered): print('.', end='', file=self.file, flush=True) def finish(self): print(file=self.file) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/helpers/time.py0000644000076500000240000001113014641074756016714 0ustar00twstaffimport os import time from datetime import datetime, timezone from ..constants import ISO_FORMAT, ISO_FORMAT_NO_USECS def to_localtime(ts): """Convert datetime object from UTC to local time zone""" return datetime(*time.localtime((ts - datetime(1970, 1, 1, tzinfo=timezone.utc)).total_seconds())[:6]) def utcnow(): """Returns a naive datetime instance representing the time in the UTC timezone""" return datetime.now(timezone.utc).replace(tzinfo=None) def parse_timestamp(timestamp, tzinfo=timezone.utc): """Parse a ISO 8601 timestamp string""" fmt = ISO_FORMAT if '.' in timestamp else ISO_FORMAT_NO_USECS dt = datetime.strptime(timestamp, fmt) if tzinfo is not None: dt = dt.replace(tzinfo=tzinfo) return dt def timestamp(s): """Convert a --timestamp=s argument to a datetime object""" try: # is it pointing to a file / directory? ts = safe_s(os.stat(s).st_mtime) return datetime.fromtimestamp(ts, tz=timezone.utc) except OSError: # didn't work, try parsing as timestamp. UTC, no TZ, no microsecs support. for format in ('%Y-%m-%dT%H:%M:%SZ', '%Y-%m-%dT%H:%M:%S+00:00', '%Y-%m-%dT%H:%M:%S', '%Y-%m-%d %H:%M:%S', '%Y-%m-%dT%H:%M', '%Y-%m-%d %H:%M', '%Y-%m-%d', '%Y-%j', ): try: return datetime.strptime(s, format).replace(tzinfo=timezone.utc) except ValueError: continue raise ValueError # Not too rarely, we get crappy timestamps from the fs, that overflow some computations. # As they are crap anyway (valid filesystem timestamps always refer to the past up to # the present, but never to the future), nothing is lost if we just clamp them to the # maximum value we can support. # As long as people are using borg on 32bit platforms to access borg archives, we must # keep this value True. But we can expect that we can stop supporting 32bit platforms # well before coming close to the year 2038, so this will never be a practical problem. SUPPORT_32BIT_PLATFORMS = True # set this to False before y2038. if SUPPORT_32BIT_PLATFORMS: # second timestamps will fit into a signed int32 (platform time_t limit). # nanosecond timestamps thus will naturally fit into a signed int64. # subtract last 48h to avoid any issues that could be caused by tz calculations. # this is in the year 2038, so it is also less than y9999 (which is a datetime internal limit). # msgpack can pack up to uint64. MAX_S = 2**31-1 - 48*3600 MAX_NS = MAX_S * 1000000000 else: # nanosecond timestamps will fit into a signed int64. # subtract last 48h to avoid any issues that could be caused by tz calculations. # this is in the year 2262, so it is also less than y9999 (which is a datetime internal limit). # round down to 1e9 multiple, so MAX_NS corresponds precisely to a integer MAX_S. # msgpack can pack up to uint64. MAX_NS = (2**63-1 - 48*3600*1000000000) // 1000000000 * 1000000000 MAX_S = MAX_NS // 1000000000 def safe_s(ts): if 0 <= ts <= MAX_S: return ts elif ts < 0: return 0 else: return MAX_S def safe_ns(ts): if 0 <= ts <= MAX_NS: return ts elif ts < 0: return 0 else: return MAX_NS def safe_timestamp(item_timestamp_ns): t_ns = safe_ns(item_timestamp_ns) return datetime.fromtimestamp(t_ns / 1e9) def format_time(ts: datetime, format_spec=''): """ Convert *ts* to a human-friendly format with textual weekday. """ return ts.strftime('%a, %Y-%m-%d %H:%M:%S' if format_spec == '' else format_spec) def isoformat_time(ts: datetime): """ Format *ts* according to ISO 8601. """ # note: first make all datetime objects tz aware before adding %z here. return ts.strftime(ISO_FORMAT) def format_timedelta(td): """Format timedelta in a human friendly format """ ts = td.total_seconds() s = ts % 60 m = int(ts / 60) % 60 h = int(ts / 3600) % 24 txt = '%.2f seconds' % s if m: txt = '%d minutes %s' % (m, txt) if h: txt = '%d hours %s' % (h, txt) if td.days: txt = '%d days %s' % (td.days, txt) return txt class OutputTimestamp: def __init__(self, ts: datetime): if ts.tzinfo == timezone.utc: ts = to_localtime(ts) self.ts = ts def __format__(self, format_spec): return format_time(self.ts, format_spec=format_spec) def __str__(self): return f'{self}' def isoformat(self): return isoformat_time(self.ts) to_json = isoformat ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/helpers/yes.py0000644000076500000240000001113414641074756016562 0ustar00twstaffimport logging import json import os import os.path import sys FALSISH = ('No', 'NO', 'no', 'N', 'n', '0', ) TRUISH = ('Yes', 'YES', 'yes', 'Y', 'y', '1', ) DEFAULTISH = ('Default', 'DEFAULT', 'default', 'D', 'd', '', ) def yes(msg=None, false_msg=None, true_msg=None, default_msg=None, retry_msg=None, invalid_msg=None, env_msg='{} (from {})', falsish=FALSISH, truish=TRUISH, defaultish=DEFAULTISH, default=False, retry=True, env_var_override=None, ofile=None, input=input, prompt=True, msgid=None): """Output (usually a question) and let user input an answer. Qualifies the answer according to falsish, truish and defaultish as True, False or . If it didn't qualify and retry is False (no retries wanted), return the default [which defaults to False]. If retry is True let user retry answering until answer is qualified. If env_var_override is given and this var is present in the environment, do not ask the user, but just use the env var contents as answer as if it was typed in. Otherwise read input from stdin and proceed as normal. If EOF is received instead an input or an invalid input without retry possibility, return default. :param msg: introducing message to output on ofile, no \n is added [None] :param retry_msg: retry message to output on ofile, no \n is added [None] :param false_msg: message to output before returning False [None] :param true_msg: message to output before returning True [None] :param default_msg: message to output before returning a [None] :param invalid_msg: message to output after a invalid answer was given [None] :param env_msg: message to output when using input from env_var_override ['{} (from {})'], needs to have 2 placeholders for answer and env var name :param falsish: sequence of answers qualifying as False :param truish: sequence of answers qualifying as True :param defaultish: sequence of answers qualifying as :param default: default return value (defaultish answer was given or no-answer condition) [False] :param retry: if True and input is incorrect, retry. Otherwise return default. [True] :param env_var_override: environment variable name [None] :param ofile: output stream [sys.stderr] :param input: input function [input from builtins] :return: boolean answer value, True or False """ def output(msg, msg_type, is_prompt=False, **kwargs): json_output = getattr(logging.getLogger('borg'), 'json', False) if json_output: kwargs.update(dict( type='question_%s' % msg_type, msgid=msgid, message=msg, )) print(json.dumps(kwargs), file=sys.stderr) else: if is_prompt: print(msg, file=ofile, end='', flush=True) else: print(msg, file=ofile) msgid = msgid or env_var_override # note: we do not assign sys.stderr as default above, so it is # really evaluated NOW, not at function definition time. if ofile is None: ofile = sys.stderr if default not in (True, False): raise ValueError("invalid default value, must be True or False") if msg: output(msg, 'prompt', is_prompt=True) while True: answer = None if env_var_override: answer = os.environ.get(env_var_override) if answer is not None and env_msg: output(env_msg.format(answer, env_var_override), 'env_answer', env_var=env_var_override) if answer is None: if not prompt: return default try: answer = input() except EOFError: # avoid defaultish[0], defaultish could be empty answer = truish[0] if default else falsish[0] if answer in defaultish: if default_msg: output(default_msg, 'accepted_default') return default if answer in truish: if true_msg: output(true_msg, 'accepted_true') return True if answer in falsish: if false_msg: output(false_msg, 'accepted_false') return False # if we get here, the answer was invalid if invalid_msg: output(invalid_msg, 'invalid_answer') if not retry: return default if retry_msg: output(retry_msg, 'prompt_retry', is_prompt=True) # in case we used an environment variable and it gave an invalid answer, do not use it again: env_var_override = None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719958060.0 borgbackup-1.4.0/src/borg/item.c0000644000076500000240000501627214641075054015055 0ustar00twstaff/* Generated by Cython 3.0.10 */ /* BEGIN: Cython Metadata { "distutils": { "depends": [ "src/borg/_item.c" ], "extra_compile_args": [ "-Wall", "-Wextra", "-Wpointer-arith" ], "include_dirs": [ "src/borg" ], "name": "borg.item", "sources": [ "src/borg/item.pyx" ] }, "module_name": "borg.item" } END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_10" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x03000AF0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 1 #endif #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #if PY_VERSION_HEX >= 0x030d00A4 # define __Pyx_PyCFunctionFast PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords #else # define __Pyx_PyCFunctionFast _PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__borg__item #define __PYX_HAVE_API__borg__item /* Early includes */ #include "_item.c" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/borg/item.pyx", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property; struct __pyx_obj_4borg_4item___pyx_scope_struct_1_get_size; struct __pyx_obj_4borg_4item___pyx_scope_struct_2_genexpr; struct __pyx_obj_4borg_4item___pyx_scope_struct_3_genexpr; struct __pyx_obj_4borg_4item___pyx_scope_struct_4_genexpr; struct __pyx_obj_4borg_4item___pyx_scope_struct_5_genexpr; struct __pyx_obj_4borg_4item___pyx_scope_struct_6_genexpr; /* "borg/item.pyx":98 * return getattr(self, self._check_key(key), default) * * @staticmethod # <<<<<<<<<<<<<< * def _make_property(key, value_type, value_type_name=None, encode=None, decode=None): * """return a property that deals with self._dict[key]""" */ struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property { PyObject_HEAD PyObject *__pyx_v_attr_error_msg; PyObject *__pyx_v_decode; PyObject *__pyx_v_encode; PyObject *__pyx_v_key; PyObject *__pyx_v_type_error_msg; PyObject *__pyx_v_value_type; }; /* "borg/item.pyx":196 * part = PropDict._make_property('part', int) * * def get_size(self, hardlink_masters=None, memorize=False, compressed=False, from_chunks=False, consider_ids=None): # <<<<<<<<<<<<<< * """ * Determine the (uncompressed or compressed) size of this item. */ struct __pyx_obj_4borg_4item___pyx_scope_struct_1_get_size { PyObject_HEAD PyObject *__pyx_v_attr; PyObject *__pyx_v_consider_ids; }; /* "borg/item.pyx":242 * return 0 * if consider_ids is not None: * size = sum(getattr(ChunkListEntry(*chunk), attr) for chunk in chunks if chunk.id in consider_ids) # <<<<<<<<<<<<<< * else: * size = sum(getattr(ChunkListEntry(*chunk), attr) for chunk in chunks) */ struct __pyx_obj_4borg_4item___pyx_scope_struct_2_genexpr { PyObject_HEAD struct __pyx_obj_4borg_4item___pyx_scope_struct_1_get_size *__pyx_outer_scope; PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_chunk; PyObject *__pyx_t_0; Py_ssize_t __pyx_t_1; PyObject *(*__pyx_t_2)(PyObject *); }; /* "borg/item.pyx":244 * size = sum(getattr(ChunkListEntry(*chunk), attr) for chunk in chunks if chunk.id in consider_ids) * else: * size = sum(getattr(ChunkListEntry(*chunk), attr) for chunk in chunks) # <<<<<<<<<<<<<< * # if requested, memorize the precomputed (c)size for items that have an own chunks list: * if memorize and having_chunks: */ struct __pyx_obj_4borg_4item___pyx_scope_struct_3_genexpr { PyObject_HEAD struct __pyx_obj_4borg_4item___pyx_scope_struct_1_get_size *__pyx_outer_scope; PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_chunk; PyObject *__pyx_t_0; Py_ssize_t __pyx_t_1; PyObject *(*__pyx_t_2)(PyObject *); }; /* "borg/item.pyx":347 * """encode a tuple that might contain str items""" * # we have str, but want to give bytes to msgpack.pack * return tuple(safe_encode(e) if isinstance(e, str) else e for e in t) # <<<<<<<<<<<<<< * * */ struct __pyx_obj_4borg_4item___pyx_scope_struct_4_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_e; PyObject *__pyx_t_0; Py_ssize_t __pyx_t_1; PyObject *(*__pyx_t_2)(PyObject *); }; /* "borg/item.pyx":353 * """decode a tuple that might contain bytes items""" * # we get bytes objects from msgpack.unpack, but want str * return tuple(safe_decode(e) if isinstance(e, bytes) else e for e in t) # <<<<<<<<<<<<<< * * */ struct __pyx_obj_4borg_4item___pyx_scope_struct_5_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_e; PyObject *__pyx_t_0; Py_ssize_t __pyx_t_1; PyObject *(*__pyx_t_2)(PyObject *); }; /* "borg/item.pyx":466 * if self.equal: * return 'equal' * return ' '.join(str for d,str in self._changes) # <<<<<<<<<<<<<< * * def _equal(self, chunk_iterator1, chunk_iterator2): */ struct __pyx_obj_4borg_4item___pyx_scope_struct_6_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_d; PyObject *__pyx_v_str; PyObject *__pyx_t_0; Py_ssize_t __pyx_t_1; PyObject *(*__pyx_t_2)(PyObject *); }; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* PyObjectSetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); #else #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* PyObjectCallNoArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* RaiseNoneIterError.proto */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); /* UnpackTupleError.proto */ static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /* UnpackTuple2.proto */ #define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\ (likely(is_tuple || PyTuple_Check(tuple)) ?\ (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\ __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\ (__Pyx_UnpackTupleError(tuple, 2), -1)) :\ __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple)) static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple); static int __Pyx_unpack_tuple2_generic( PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple); /* dict_iter.proto */ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name, Py_ssize_t* p_orig_length, int* p_is_dict); static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* PySequenceContains.proto */ static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { int result = PySequence_Contains(seq, item); return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } /* GetAttr3.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); /* RaiseClosureNameError.proto */ static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname); /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* ObjectGetItem.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key); #else #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) #endif /* GetTopmostException.proto */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); #endif /* SaveResetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* AssertionsEnabled.proto */ #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define __Pyx_init_assertions_enabled() (0) #define __pyx_assertions_enabled() (1) #elif CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030C0000) static int __pyx_assertions_enabled_flag; #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag) static int __Pyx_init_assertions_enabled(void) { PyObject *builtins, *debug, *debug_str; int flag; builtins = PyEval_GetBuiltins(); if (!builtins) goto bad; debug_str = PyUnicode_FromStringAndSize("__debug__", 9); if (!debug_str) goto bad; debug = PyObject_GetItem(builtins, debug_str); Py_DECREF(debug_str); if (!debug) goto bad; flag = PyObject_IsTrue(debug); Py_DECREF(debug); if (flag == -1) goto bad; __pyx_assertions_enabled_flag = flag; return 0; bad: __pyx_assertions_enabled_flag = 1; return -1; } #else #define __Pyx_init_assertions_enabled() (0) #define __pyx_assertions_enabled() (!Py_OptimizeFlag) #endif /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* RaiseUnboundLocalError.proto */ static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); /* GetAttr.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /* pep479.proto */ static void __Pyx_Generator_Replace_StopIteration(int in_async_gen); /* ListAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 L->ob_item[len] = x; #else PyList_SET_ITEM(list, len, x); #endif __Pyx_SET_SIZE(list, len + 1); return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif /* ListExtend.proto */ static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 PyObject* none = _PyList_Extend((PyListObject*)L, v); if (unlikely(!none)) return -1; Py_DECREF(none); return 0; #else return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v); #endif } /* ListCompAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len)) { Py_INCREF(x); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 L->ob_item[len] = x; #else PyList_SET_ITEM(list, len, x); #endif __Pyx_SET_SIZE(list, len + 1); return 0; } return PyList_Append(list, x); } #else #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) #endif /* PyObjectCall2Args.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* PyObjectCallMethod1.proto */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); /* StringJoin.proto */ #if PY_MAJOR_VERSION < 3 #define __Pyx_PyString_Join __Pyx_PyBytes_Join #define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v)) #else #define __Pyx_PyString_Join PyUnicode_Join #define __Pyx_PyBaseString_Join PyUnicode_Join #endif static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); /* PyObjectFormatSimple.proto */ #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_FormatSimple(s, f) (\ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ PyObject_Format(s, f)) #elif PY_MAJOR_VERSION < 3 #define __Pyx_PyObject_FormatSimple(s, f) (\ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\ PyObject_Format(s, f)) #elif CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_FormatSimple(s, f) (\ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\ likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\ PyObject_Format(s, f)) #else #define __Pyx_PyObject_FormatSimple(s, f) (\ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ PyObject_Format(s, f)) #endif /* IterNext.proto */ #define __Pyx_PyIter_Next(obj) __Pyx_PyIter_Next2(obj, NULL) static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject *, PyObject *); /* SliceObject.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); /* ValidateBasesTuple.proto */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); #endif /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* SetNameInClass.proto */ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) #elif CYTHON_COMPILING_IN_CPYTHON #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value)) #else #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) #endif /* CalculateMetaclass.proto */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); /* PyObjectLookupSpecial.proto */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0) #define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1) static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error); #else #define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n) #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) #endif /* Py3ClassCreate.proto */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc); static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /* Py3UpdateBases.proto */ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases); /* ClassMethod.proto */ #include "descrobject.h" CYTHON_UNUSED static PyObject* __Pyx_Method_ClassMethod(PyObject *method); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* SwapException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif /* CoroutineBase.proto */ struct __pyx_CoroutineObject; typedef PyObject *(*__pyx_coroutine_body_t)(struct __pyx_CoroutineObject *, PyThreadState *, PyObject *); #if CYTHON_USE_EXC_INFO_STACK #define __Pyx_ExcInfoStruct _PyErr_StackItem #else typedef struct { PyObject *exc_type; PyObject *exc_value; PyObject *exc_traceback; } __Pyx_ExcInfoStruct; #endif typedef struct __pyx_CoroutineObject { PyObject_HEAD __pyx_coroutine_body_t body; PyObject *closure; __Pyx_ExcInfoStruct gi_exc_state; PyObject *gi_weakreflist; PyObject *classobj; PyObject *yieldfrom; PyObject *gi_name; PyObject *gi_qualname; PyObject *gi_modulename; PyObject *gi_code; PyObject *gi_frame; int resume_label; char is_running; } __pyx_CoroutineObject; static __pyx_CoroutineObject *__Pyx__Coroutine_New( PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, PyObject *name, PyObject *qualname, PyObject *module_name); static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, PyObject *name, PyObject *qualname, PyObject *module_name); static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self); static int __Pyx_Coroutine_clear(PyObject *self); static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value); static PyObject *__Pyx_Coroutine_Close(PyObject *self); static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args); #if CYTHON_USE_EXC_INFO_STACK #define __Pyx_Coroutine_SwapException(self) #define __Pyx_Coroutine_ResetAndClearException(self) __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state) #else #define __Pyx_Coroutine_SwapException(self) {\ __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\ __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\ } #define __Pyx_Coroutine_ResetAndClearException(self) {\ __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\ (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\ } #endif #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue) #else #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue) #endif static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue); static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state); /* PatchModuleWithCoroutine.proto */ static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code); /* PatchGeneratorABC.proto */ static int __Pyx_patch_abc(void); /* Generator.proto */ #define __Pyx_Generator_USED #define __Pyx_Generator_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_GeneratorType) #define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\ __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name) static PyObject *__Pyx_Generator_Next(PyObject *self); static int __pyx_Generator_init(PyObject *module); /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "borg.item" */ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "borg.item" extern int __pyx_module_is_main_borg__item; int __pyx_module_is_main_borg__item = 0; /* Implementation of "borg.item" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_staticmethod; static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_AssertionError; static PyObject *__pyx_builtin_property; static PyObject *__pyx_builtin_KeyError; static PyObject *__pyx_builtin_AttributeError; static PyObject *__pyx_builtin_sum; static PyObject *__pyx_builtin_object; /* #### Code section: string_decls ### */ static const char __pyx_k_a[] = "a"; static const char __pyx_k_b[] = "b"; static const char __pyx_k_c[] = "c"; static const char __pyx_k_d[] = "d"; static const char __pyx_k_k[] = "k"; static const char __pyx_k_t[] = "t"; static const char __pyx_k_v[] = "v"; static const char __pyx_k_ai[] = "ai"; static const char __pyx_k_bi[] = "bi"; static const char __pyx_k_ch[] = "ch"; static const char __pyx_k_eq[] = "__eq__"; static const char __pyx_k_g1[] = "g1"; static const char __pyx_k_g2[] = "g2"; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k_id[] = "id"; static const char __pyx_k_kw[] = "kw"; static const char __pyx_k_pd[] = "pd"; static const char __pyx_k_sz[] = "sz"; static const char __pyx_k_u1[] = "u1"; static const char __pyx_k_u2[] = "u2"; static const char __pyx_k_9_9[] = "{:>9} {:>9}"; static const char __pyx_k_Key[] = "Key"; static const char __pyx_k__10[] = " "; static const char __pyx_k__13[] = "[{}:{} -> {}:{}]"; static const char __pyx_k__14[] = "[{} -> {}]"; static const char __pyx_k__15[] = "[{}: {} -> {}]"; static const char __pyx_k__16[] = "*"; static const char __pyx_k__17[] = "."; static const char __pyx_k__38[] = "_"; static const char __pyx_k__81[] = "?"; static const char __pyx_k_chg[] = "chg"; static const char __pyx_k_cls[] = "cls"; static const char __pyx_k_del[] = "_del"; static const char __pyx_k_doc[] = "doc"; static const char __pyx_k_end[] = "end"; static const char __pyx_k_get[] = "_get"; static const char __pyx_k_gid[] = "gid"; static const char __pyx_k_key[] = "key"; static const char __pyx_k_new[] = "new_"; static const char __pyx_k_old[] = "old_"; static const char __pyx_k_s_s[] = "%s (%s)"; static const char __pyx_k_set[] = "_set"; static const char __pyx_k_sum[] = "sum"; static const char __pyx_k_ts1[] = "ts1"; static const char __pyx_k_ts2[] = "ts2"; static const char __pyx_k_uid[] = "uid"; static const char __pyx_k_Item[] = "Item"; static const char __pyx_k_alen[] = "alen"; static const char __pyx_k_args[] = "args"; static const char __pyx_k_attr[] = "attr"; static const char __pyx_k_blen[] = "blen"; static const char __pyx_k_data[] = "data"; static const char __pyx_k_dict[] = "_dict"; static const char __pyx_k_fifo[] = "fifo"; static const char __pyx_k_hash[] = "hash"; static const char __pyx_k_init[] = "__init__"; static const char __pyx_k_join[] = "join"; static const char __pyx_k_link[] = "link"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_mode[] = "mode"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_optr[] = "optr"; static const char __pyx_k_part[] = "part"; static const char __pyx_k_path[] = "path"; static const char __pyx_k_rdev[] = "rdev"; static const char __pyx_k_repr[] = "__repr__"; static const char __pyx_k_salt[] = "salt"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_send[] = "send"; static const char __pyx_k_sign[] = "sign"; static const char __pyx_k_size[] = "size"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_stat[] = "stat"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_time[] = "time"; static const char __pyx_k_type[] = "type"; static const char __pyx_k_user[] = "user"; static const char __pyx_k_added[] = "added "; static const char __pyx_k_atime[] = "atime"; static const char __pyx_k_attrs[] = "attrs"; static const char __pyx_k_class[] = "__class__"; static const char __pyx_k_close[] = "close"; static const char __pyx_k_csize[] = "csize"; static const char __pyx_k_ctime[] = "ctime"; static const char __pyx_k_doc_2[] = "__doc__"; static const char __pyx_k_equal[] = "_equal"; static const char __pyx_k_get_2[] = "get"; static const char __pyx_k_group[] = "group"; static const char __pyx_k_item1[] = "item1"; static const char __pyx_k_item2[] = "item2"; static const char __pyx_k_items[] = "items"; static const char __pyx_k_mode1[] = "mode1"; static const char __pyx_k_mode2[] = "mode2"; static const char __pyx_k_mtime[] = "mtime"; static const char __pyx_k_nlink[] = "nlink"; static const char __pyx_k_other[] = "other"; static const char __pyx_k_owner[] = "owner"; static const char __pyx_k_slots[] = "__slots__"; static const char __pyx_k_super[] = "super"; static const char __pyx_k_throw[] = "throw"; static const char __pyx_k_value[] = "value"; static const char __pyx_k_1_4_01[] = "1.4_01"; static const char __pyx_k_bigint[] = "bigint"; static const char __pyx_k_blkdev[] = "blkdev"; static const char __pyx_k_chrdev[] = "chrdev"; static const char __pyx_k_chunks[] = "chunks"; static const char __pyx_k_config[] = "config"; static const char __pyx_k_decode[] = "decode"; static const char __pyx_k_dict_2[] = "__dict__"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_encode[] = "encode"; static const char __pyx_k_format[] = "format"; static const char __pyx_k_g_attr[] = "g_attr"; static const char __pyx_k_id_key[] = "id_key"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_is_blk[] = "is_blk"; static const char __pyx_k_is_chr[] = "is_chr"; static const char __pyx_k_is_dir[] = "is_dir"; static const char __pyx_k_master[] = "master"; static const char __pyx_k_module[] = "__module__"; static const char __pyx_k_name_2[] = "name"; static const char __pyx_k_nfiles[] = "nfiles"; static const char __pyx_k_object[] = "object"; static const char __pyx_k_source[] = "source"; static const char __pyx_k_u_attr[] = "u_attr"; static const char __pyx_k_update[] = "update"; static const char __pyx_k_xattrs[] = "xattrs"; static const char __pyx_k_S_ISBLK[] = "S_ISBLK"; static const char __pyx_k_S_ISCHR[] = "S_ISCHR"; static const char __pyx_k_S_ISDIR[] = "S_ISDIR"; static const char __pyx_k_S_ISLNK[] = "S_ISLNK"; static const char __pyx_k_added_2[] = "added"; static const char __pyx_k_as_dict[] = "as_dict"; static const char __pyx_k_changes[] = "_changes"; static const char __pyx_k_chunks1[] = "chunks1"; static const char __pyx_k_chunks2[] = "chunks2"; static const char __pyx_k_cmdline[] = "cmdline"; static const char __pyx_k_comment[] = "comment"; static const char __pyx_k_default[] = "default"; static const char __pyx_k_deleted[] = "deleted"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_enc_key[] = "enc_key"; static const char __pyx_k_equal_2[] = "equal"; static const char __pyx_k_genexpr[] = "genexpr"; static const char __pyx_k_helpers[] = "helpers"; static const char __pyx_k_is_fifo[] = "is_fifo"; static const char __pyx_k_is_link[] = "is_link"; static const char __pyx_k_is_type[] = "_is_type"; static const char __pyx_k_item1_2[] = "_item1"; static const char __pyx_k_item2_2[] = "_item2"; static const char __pyx_k_prepare[] = "__prepare__"; static const char __pyx_k_removed[] = "removed "; static const char __pyx_k_to_optr[] = "to_optr"; static const char __pyx_k_version[] = "version"; static const char __pyx_k_ItemDiff[] = "ItemDiff"; static const char __pyx_k_KeyError[] = "KeyError"; static const char __pyx_k_PropDict[] = "PropDict"; static const char __pyx_k_S_ISFIFO[] = "S_ISFIFO"; static const char __pyx_k_acl_nfs4[] = "acl_nfs4"; static const char __pyx_k_added_13[] = "added {:>13}"; static const char __pyx_k_archives[] = "archives"; static const char __pyx_k_bsdflags[] = "bsdflags"; static const char __pyx_k_contains[] = "__contains__"; static const char __pyx_k_filemode[] = "filemode"; static const char __pyx_k_get_size[] = "get_size"; static const char __pyx_k_hostname[] = "hostname"; static const char __pyx_k_memorize[] = "memorize"; static const char __pyx_k_modified[] = "modified"; static const char __pyx_k_new_mode[] = "new_mode"; static const char __pyx_k_new_user[] = "new_user"; static const char __pyx_k_old_mode[] = "old_mode"; static const char __pyx_k_old_user[] = "old_user"; static const char __pyx_k_property[] = "property"; static const char __pyx_k_qualname[] = "__qualname__"; static const char __pyx_k_set_name[] = "__set_name__"; static const char __pyx_k_slicelen[] = "slicelen"; static const char __pyx_k_time_end[] = "time_end"; static const char __pyx_k_typetest[] = "typetest"; static const char __pyx_k_username[] = "username"; static const char __pyx_k_ITEM_KEYS[] = "ITEM_KEYS"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_added_ids[] = "added_ids"; static const char __pyx_k_algorithm[] = "algorithm"; static const char __pyx_k_attr_list[] = "attr_list"; static const char __pyx_k_birthtime[] = "birthtime"; static const char __pyx_k_borg_item[] = "borg.item"; static const char __pyx_k_changes_2[] = "changes"; static const char __pyx_k_check_key[] = "_check_key"; static const char __pyx_k_constants[] = "constants"; static const char __pyx_k_data_dict[] = "data_dict"; static const char __pyx_k_directory[] = "directory"; static const char __pyx_k_from_optr[] = "from_optr"; static const char __pyx_k_isenabled[] = "isenabled"; static const char __pyx_k_item_keys[] = "item_keys"; static const char __pyx_k_item_type[] = "item_type"; static const char __pyx_k_link_diff[] = "_link_diff"; static const char __pyx_k_metaclass[] = "__metaclass__"; static const char __pyx_k_mode_diff[] = "_mode_diff"; static const char __pyx_k_new_group[] = "new_group"; static const char __pyx_k_old_group[] = "old_group"; static const char __pyx_k_precision[] = "precision"; static const char __pyx_k_removed_2[] = "removed"; static const char __pyx_k_timestamp[] = "timestamp"; static const char __pyx_k_StableDict[] = "StableDict"; static const char __pyx_k_VALID_KEYS[] = "VALID_KEYS"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_acl_access[] = "acl_access"; static const char __pyx_k_chunk_ids1[] = "chunk_ids1"; static const char __pyx_k_chunk_ids2[] = "chunk_ids2"; static const char __pyx_k_chunk_seed[] = "chunk_seed"; static const char __pyx_k_compressed[] = "compressed"; static const char __pyx_k_iterations[] = "iterations"; static const char __pyx_k_namedtuple[] = "namedtuple"; static const char __pyx_k_owner_diff[] = "_owner_diff"; static const char __pyx_k_removed_11[] = "removed {:>11}"; static const char __pyx_k_size_parts[] = "size_parts"; static const char __pyx_k_time_diffs[] = "_time_diffs"; static const char __pyx_k_value_type[] = "value_type"; static const char __pyx_k_API_VERSION[] = "API_VERSION"; static const char __pyx_k_ArchiveItem[] = "ArchiveItem"; static const char __pyx_k_Item_is_blk[] = "Item.is_blk"; static const char __pyx_k_Item_is_chr[] = "Item.is_chr"; static const char __pyx_k_Item_is_dir[] = "Item.is_dir"; static const char __pyx_k_acl_default[] = "acl_default"; static const char __pyx_k_collections[] = "collections"; static const char __pyx_k_csize_parts[] = "csize_parts"; static const char __pyx_k_from_chunks[] = "from_chunks"; static const char __pyx_k_mro_entries[] = "__mro_entries__"; static const char __pyx_k_numeric_ids[] = "numeric_ids"; static const char __pyx_k_removed_ids[] = "removed_ids"; static const char __pyx_k_safe_decode[] = "safe_decode"; static const char __pyx_k_safe_encode[] = "safe_encode"; static const char __pyx_k_ARCHIVE_KEYS[] = "ARCHIVE_KEYS"; static const char __pyx_k_EncryptedKey[] = "EncryptedKey"; static const char __pyx_k_Item_is_fifo[] = "Item.is_fifo"; static const char __pyx_k_Item_is_link[] = "Item.is_link"; static const char __pyx_k_Item_to_optr[] = "Item.to_optr"; static const char __pyx_k_ManifestItem[] = "ManifestItem"; static const char __pyx_k_PropDict_get[] = "PropDict.get"; static const char __pyx_k_acl_extended[] = "acl_extended"; static const char __pyx_k_changed_link[] = "changed link"; static const char __pyx_k_consider_ids[] = "consider_ids"; static const char __pyx_k_content_diff[] = "_content_diff"; static const char __pyx_k_content_only[] = "content_only"; static const char __pyx_k_enc_hmac_key[] = "enc_hmac_key"; static const char __pyx_k_helpers_time[] = "helpers.time"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_list_or_None[] = "list or None"; static const char __pyx_k_nfiles_parts[] = "nfiles_parts"; static const char __pyx_k_staticmethod[] = "staticmethod"; static const char __pyx_k_tam_required[] = "tam_required"; static const char __pyx_k_tuple_decode[] = "tuple_decode"; static const char __pyx_k_tuple_encode[] = "tuple_encode"; static const char __pyx_k_Item__is_type[] = "Item._is_type"; static const char __pyx_k_Item_get_size[] = "Item.get_size"; static const char __pyx_k_PropDict___eq[] = "PropDict.__eq__"; static const char __pyx_k_bigint_to_int[] = "bigint_to_int"; static const char __pyx_k_class_getitem[] = "__class_getitem__"; static const char __pyx_k_content_equal[] = "_content_equal"; static const char __pyx_k_having_chunks[] = "having_chunks"; static const char __pyx_k_id_size_csize[] = "id size csize"; static const char __pyx_k_init_subclass[] = "__init_subclass__"; static const char __pyx_k_int_to_bigint[] = "int_to_bigint"; static const char __pyx_k_internal_dict[] = "internal_dict"; static const char __pyx_k_make_property[] = "_make_property"; static const char __pyx_k_numeric_ids_2[] = "_numeric_ids"; static const char __pyx_k_presence_diff[] = "_presence_diff"; static const char __pyx_k_recreate_args[] = "recreate_args"; static const char __pyx_k_repository_id[] = "repository_id"; static const char __pyx_k_AssertionError[] = "AssertionError"; static const char __pyx_k_AttributeError[] = "AttributeError"; static const char __pyx_k_ChunkListEntry[] = "ChunkListEntry"; static const char __pyx_k_Item_from_optr[] = "Item.from_optr"; static const char __pyx_k_attr_error_msg[] = "attr_error_msg"; static const char __pyx_k_chunker_params[] = "chunker_params"; static const char __pyx_k_chunks_healthy[] = "chunks_healthy"; static const char __pyx_k_content_only_2[] = "_content_only"; static const char __pyx_k_create_deleted[] = "create_deleted"; static const char __pyx_k_safe_timestamp[] = "safe_timestamp"; static const char __pyx_k_type_error_msg[] = "type_error_msg"; static const char __pyx_k_ItemDiff___init[] = "ItemDiff.__init__"; static const char __pyx_k_ItemDiff___repr[] = "ItemDiff.__repr__"; static const char __pyx_k_ItemDiff__equal[] = "ItemDiff._equal"; static const char __pyx_k_OutputTimestamp[] = "OutputTimestamp"; static const char __pyx_k_PropDict___init[] = "PropDict.__init__"; static const char __pyx_k_PropDict___repr[] = "PropDict.__repr__"; static const char __pyx_k_PropDict_update[] = "PropDict.update"; static const char __pyx_k_chunk_iterator1[] = "chunk_iterator1"; static const char __pyx_k_chunk_iterator2[] = "chunk_iterator2"; static const char __pyx_k_hardlink_master[] = "hardlink_master"; static const char __pyx_k_key_must_be_str[] = "key must be str"; static const char __pyx_k_update_internal[] = "update_internal"; static const char __pyx_k_value_type_name[] = "value_type_name"; static const char __pyx_k_ItemDiff_changes[] = "ItemDiff.changes"; static const char __pyx_k_PropDict_as_dict[] = "PropDict.as_dict"; static const char __pyx_k_format_file_size[] = "format_file_size"; static const char __pyx_k_hardlink_masters[] = "hardlink_masters"; static const char __pyx_k_recreate_cmdline[] = "recreate_cmdline"; static const char __pyx_k_s_internal_dict_r[] = "%s(internal_dict=%r)"; static const char __pyx_k_s_value_must_be_s[] = "%s value must be %s"; static const char __pyx_k_src_borg_item_pyx[] = "src/borg/item.pyx"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_recreate_source_id[] = "recreate_source_id"; static const char __pyx_k_ItemDiff__link_diff[] = "ItemDiff._link_diff"; static const char __pyx_k_ItemDiff__mode_diff[] = "ItemDiff._mode_diff"; static const char __pyx_k_Item_create_deleted[] = "Item.create_deleted"; static const char __pyx_k_PropDict___contains[] = "PropDict.__contains__"; static const char __pyx_k_PropDict__check_key[] = "PropDict._check_key"; static const char __pyx_k_ItemDiff__owner_diff[] = "ItemDiff._owner_diff"; static const char __pyx_k_ItemDiff__time_diffs[] = "ItemDiff._time_diffs"; static const char __pyx_k_chunker_params_tuple[] = "chunker-params tuple"; static const char __pyx_k_attribute_s_not_found[] = "attribute %s not found"; static const char __pyx_k_can_compare_chunk_ids[] = "can_compare_chunk_ids"; static const char __pyx_k_chunks_contents_equal[] = "chunks_contents_equal"; static const char __pyx_k_surrogate_escaped_str[] = "surrogate-escaped str"; static const char __pyx_k_ItemDiff__content_diff[] = "ItemDiff._content_diff"; static const char __pyx_k_ItemDiff__content_equal[] = "ItemDiff._content_equal"; static const char __pyx_k_ItemDiff__presence_diff[] = "ItemDiff._presence_diff"; static const char __pyx_k_PropDict__make_property[] = "PropDict._make_property"; static const char __pyx_k_can_compare_chunk_ids_2[] = "_can_compare_chunk_ids"; static const char __pyx_k_recreate_partial_chunks[] = "recreate_partial_chunks"; static const char __pyx_k_PropDict_update_internal[] = "PropDict.update_internal"; static const char __pyx_k_data_dict_must_be_a_dict[] = "data_dict must be a dict"; static const char __pyx_k_key_s_is_not_a_valid_key[] = "key '%s' is not a valid key"; static const char __pyx_k_tuple_decode_locals_genexpr[] = "tuple_decode..genexpr"; static const char __pyx_k_tuple_encode_locals_genexpr[] = "tuple_encode..genexpr"; static const char __pyx_k_Item_get_size_locals_genexpr[] = "Item.get_size..genexpr"; static const char __pyx_k_internal_dict_must_be_a_dict[] = "internal_dict must be a dict"; static const char __pyx_k_surrogate_escaped_str_or_None[] = "surrogate-escaped str or None"; static const char __pyx_k_PropDict__make_property_locals[] = "PropDict._make_property.._get"; static const char __pyx_k_ArchiveItem_abstraction_that_de[] = "\n ArchiveItem abstraction that deals with validation and the low-level details internally:\n\n An ArchiveItem is created either from msgpack unpacker output, from another dict, from kwargs or\n built step-by-step by setting attributes.\n\n msgpack gives us a dict with bytes-typed keys, just give it to ArchiveItem(d) and use arch.xxx later.\n\n If a ArchiveItem shall be serialized, give as_dict() method output to msgpack packer.\n "; static const char __pyx_k_Comparison_of_two_items_from_di[] = "\n Comparison of two items from different archives.\n\n The items may have different paths and still be considered equal (e.g. for renames).\n It does not include extended or time attributes in the comparison.\n "; static const char __pyx_k_EncryptedKey_abstraction_that_d[] = "\n EncryptedKey abstraction that deals with validation and the low-level details internally:\n\n A EncryptedKey is created either from msgpack unpacker output, from another dict, from kwargs or\n built step-by-step by setting attributes.\n\n msgpack gives us a dict with bytes-typed keys, just give it to EncryptedKey(d) and use enc_key.xxx later.\n\n If a EncryptedKey shall be serialized, give as_dict() method output to msgpack packer.\n "; static const char __pyx_k_Item_abstraction_that_deals_wit[] = "\n Item abstraction that deals with validation and the low-level details internally:\n\n Items are created either from msgpack unpacker output, from another dict, from kwargs or\n built step-by-step by setting attributes.\n\n msgpack gives us a dict with bytes-typed keys, just give it to Item(internal_dict=d) and use item.key_name later.\n msgpack gives us byte-typed values for stuff that should be str, we automatically decode when getting\n such a property and encode when setting it.\n\n If an Item shall be serialized, give as_dict() method output to msgpack packer.\n\n A bug in Attic up to and including release 0.13 added a (meaningless) 'acl' key to every item.\n We must never re-use this key. See test_attic013_acl_bug for details.\n "; static const char __pyx_k_Key_abstraction_that_deals_with[] = "\n Key abstraction that deals with validation and the low-level details internally:\n\n A Key is created either from msgpack unpacker output, from another dict, from kwargs or\n built step-by-step by setting attributes.\n\n msgpack gives us a dict with bytes-typed keys, just give it to Key(d) and use key.xxx later.\n\n If a Key shall be serialized, give as_dict() method output to msgpack packer.\n "; static const char __pyx_k_Manage_a_dictionary_via_propert[] = "\n Manage a dictionary via properties.\n\n - initialization by giving a dict or kw args\n - on initialization, normalize dict keys to be str type\n - access dict via properties, like: x.key_name\n - membership check via: 'key_name' in x\n - optionally, encode when setting a value\n - optionally, decode when getting a value\n - be safe against typos in key names: check against VALID_KEYS\n - when setting a value: check type of value\n\n When \"packing\" a dict, ie. you have a dict with some data and want to convert it into an instance,\n then use eg. Item({'a': 1, ...}). This way all keys in your dictionary are validated.\n\n When \"unpacking\", that is you've read a dictionary with some data from somewhere (eg. msgpack),\n then use eg. Item(internal_dict={...}). This does not validate the keys, therefore unknown keys\n are ignored instead of causing an error.\n "; static const char __pyx_k_ManifestItem_abstraction_that_d[] = "\n ManifestItem abstraction that deals with validation and the low-level details internally:\n\n A ManifestItem is created either from msgpack unpacker output, from another dict, from kwargs or\n built step-by-step by setting attributes.\n\n msgpack gives us a dict with bytes-typed keys, just give it to ManifestItem(d) and use manifest.xxx later.\n\n If a ManifestItem shall be serialized, give as_dict() method output to msgpack packer.\n "; static const char __pyx_k_Can_t_store_size_when_considerin[] = "Can't store size when considering only certain ids"; static const char __pyx_k_ItemDiff___repr___locals_genexpr[] = "ItemDiff.__repr__..genexpr"; static const char __pyx_k_Item_does_not_have_a_csize_field[] = "Item does not have a csize field."; static const char __pyx_k_PropDict__make_property_locals_2[] = "PropDict._make_property.._set"; static const char __pyx_k_PropDict__make_property_locals_3[] = "PropDict._make_property.._del"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_4borg_4item_8PropDict___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data_dict, PyObject *__pyx_v_internal_dict, PyObject *__pyx_v_kw); /* proto */ static PyObject *__pyx_pf_4borg_4item_8PropDict_2update(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_d); /* proto */ static PyObject *__pyx_pf_4borg_4item_8PropDict_4update_internal(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_d); /* proto */ static PyObject *__pyx_pf_4borg_4item_8PropDict_6__eq__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_4borg_4item_8PropDict_8__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_4item_8PropDict_10as_dict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_4item_8PropDict_12_check_key(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_4borg_4item_8PropDict_14__contains__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_4borg_4item_8PropDict_16get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_default); /* proto */ static PyObject *__pyx_pf_4borg_4item_8PropDict_14_make_property__get(PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_4item_8PropDict_14_make_property_2_set(PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_4borg_4item_8PropDict_14_make_property_4_del(PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_4item_8PropDict_18_make_property(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value_type, PyObject *__pyx_v_value_type_name, PyObject *__pyx_v_encode, PyObject *__pyx_v_decode); /* proto */ static PyObject *__pyx_pf_4borg_4item_4Item_8get_size_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ static PyObject *__pyx_pf_4borg_4item_4Item_8get_size_3genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ static PyObject *__pyx_pf_4borg_4item_4Item_get_size(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_hardlink_masters, PyObject *__pyx_v_memorize, PyObject *__pyx_v_compressed, PyObject *__pyx_v_from_chunks, PyObject *__pyx_v_consider_ids); /* proto */ static PyObject *__pyx_pf_4borg_4item_4Item_2to_optr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_4item_4Item_4from_optr(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_optr); /* proto */ static PyObject *__pyx_pf_4borg_4item_4Item_6create_deleted(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_path); /* proto */ static PyObject *__pyx_pf_4borg_4item_4Item_8is_link(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_4item_4Item_10is_dir(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_4item_4Item_12is_fifo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_4item_4Item_14is_blk(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_4item_4Item_16is_chr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_4item_4Item_18_is_type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_typetest); /* proto */ static PyObject *__pyx_pf_4borg_4item_12tuple_encode_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ static PyObject *__pyx_pf_4borg_4item_tuple_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t); /* proto */ static PyObject *__pyx_pf_4borg_4item_12tuple_decode_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ static PyObject *__pyx_pf_4borg_4item_2tuple_decode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t); /* proto */ static PyObject *__pyx_pf_4borg_4item_8ItemDiff___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item1, PyObject *__pyx_v_item2, PyObject *__pyx_v_chunk_iterator1, PyObject *__pyx_v_chunk_iterator2, PyObject *__pyx_v_numeric_ids, PyObject *__pyx_v_can_compare_chunk_ids, PyObject *__pyx_v_content_only); /* proto */ static PyObject *__pyx_pf_4borg_4item_8ItemDiff_2changes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_4item_8ItemDiff_8__repr___genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ static PyObject *__pyx_pf_4borg_4item_8ItemDiff_4__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_4item_8ItemDiff_6_equal(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_chunk_iterator1, PyObject *__pyx_v_chunk_iterator2); /* proto */ static PyObject *__pyx_pf_4borg_4item_8ItemDiff_8_presence_diff(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item_type); /* proto */ static PyObject *__pyx_pf_4borg_4item_8ItemDiff_10_link_diff(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_4item_8ItemDiff_12_content_diff(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_4item_8ItemDiff_14_owner_diff(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_4item_8ItemDiff_16_mode_diff(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_4item_8ItemDiff_18_time_diffs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4borg_4item_8ItemDiff_20_content_equal(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_chunk_iterator1, PyObject *__pyx_v_chunk_iterator2); /* proto */ static PyObject *__pyx_pf_4borg_4item_4chunks_contents_equal(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_chunks1, PyObject *__pyx_v_chunks2); /* proto */ static PyObject *__pyx_tp_new_4borg_4item___pyx_scope_struct___make_property(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_4borg_4item___pyx_scope_struct_1_get_size(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_4borg_4item___pyx_scope_struct_2_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_4borg_4item___pyx_scope_struct_3_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_4borg_4item___pyx_scope_struct_4_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_4borg_4item___pyx_scope_struct_5_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_4borg_4item___pyx_scope_struct_6_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE PyObject *__pyx_type_4borg_4item___pyx_scope_struct___make_property; PyObject *__pyx_type_4borg_4item___pyx_scope_struct_1_get_size; PyObject *__pyx_type_4borg_4item___pyx_scope_struct_2_genexpr; PyObject *__pyx_type_4borg_4item___pyx_scope_struct_3_genexpr; PyObject *__pyx_type_4borg_4item___pyx_scope_struct_4_genexpr; PyObject *__pyx_type_4borg_4item___pyx_scope_struct_5_genexpr; PyObject *__pyx_type_4borg_4item___pyx_scope_struct_6_genexpr; #endif PyTypeObject *__pyx_ptype_4borg_4item___pyx_scope_struct___make_property; PyTypeObject *__pyx_ptype_4borg_4item___pyx_scope_struct_1_get_size; PyTypeObject *__pyx_ptype_4borg_4item___pyx_scope_struct_2_genexpr; PyTypeObject *__pyx_ptype_4borg_4item___pyx_scope_struct_3_genexpr; PyTypeObject *__pyx_ptype_4borg_4item___pyx_scope_struct_4_genexpr; PyTypeObject *__pyx_ptype_4borg_4item___pyx_scope_struct_5_genexpr; PyTypeObject *__pyx_ptype_4borg_4item___pyx_scope_struct_6_genexpr; PyObject *__pyx_kp_s_1_4_01; PyObject *__pyx_kp_s_9_9; PyObject *__pyx_n_s_API_VERSION; PyObject *__pyx_n_s_ARCHIVE_KEYS; PyObject *__pyx_n_s_ArchiveItem; PyObject *__pyx_kp_s_ArchiveItem_abstraction_that_de; PyObject *__pyx_n_s_AssertionError; PyObject *__pyx_n_s_AttributeError; PyObject *__pyx_kp_s_Can_t_store_size_when_considerin; PyObject *__pyx_n_s_ChunkListEntry; PyObject *__pyx_kp_s_Comparison_of_two_items_from_di; PyObject *__pyx_n_s_EncryptedKey; PyObject *__pyx_kp_s_EncryptedKey_abstraction_that_d; PyObject *__pyx_n_s_ITEM_KEYS; PyObject *__pyx_n_s_Item; PyObject *__pyx_n_s_ItemDiff; PyObject *__pyx_n_s_ItemDiff___init; PyObject *__pyx_n_s_ItemDiff___repr; PyObject *__pyx_n_s_ItemDiff___repr___locals_genexpr; PyObject *__pyx_n_s_ItemDiff__content_diff; PyObject *__pyx_n_s_ItemDiff__content_equal; PyObject *__pyx_n_s_ItemDiff__equal; PyObject *__pyx_n_s_ItemDiff__link_diff; PyObject *__pyx_n_s_ItemDiff__mode_diff; PyObject *__pyx_n_s_ItemDiff__owner_diff; PyObject *__pyx_n_s_ItemDiff__presence_diff; PyObject *__pyx_n_s_ItemDiff__time_diffs; PyObject *__pyx_n_s_ItemDiff_changes; PyObject *__pyx_n_s_Item__is_type; PyObject *__pyx_kp_s_Item_abstraction_that_deals_wit; PyObject *__pyx_n_s_Item_create_deleted; PyObject *__pyx_kp_s_Item_does_not_have_a_csize_field; PyObject *__pyx_n_s_Item_from_optr; PyObject *__pyx_n_s_Item_get_size; PyObject *__pyx_n_s_Item_get_size_locals_genexpr; PyObject *__pyx_n_s_Item_is_blk; PyObject *__pyx_n_s_Item_is_chr; PyObject *__pyx_n_s_Item_is_dir; PyObject *__pyx_n_s_Item_is_fifo; PyObject *__pyx_n_s_Item_is_link; PyObject *__pyx_n_s_Item_to_optr; PyObject *__pyx_n_s_Key; PyObject *__pyx_n_s_KeyError; PyObject *__pyx_kp_s_Key_abstraction_that_deals_with; PyObject *__pyx_kp_s_Manage_a_dictionary_via_propert; PyObject *__pyx_n_s_ManifestItem; PyObject *__pyx_kp_s_ManifestItem_abstraction_that_d; PyObject *__pyx_n_s_OutputTimestamp; PyObject *__pyx_n_s_PropDict; PyObject *__pyx_n_s_PropDict___contains; PyObject *__pyx_n_s_PropDict___eq; PyObject *__pyx_n_s_PropDict___init; PyObject *__pyx_n_s_PropDict___repr; PyObject *__pyx_n_s_PropDict__check_key; PyObject *__pyx_n_s_PropDict__make_property; PyObject *__pyx_n_s_PropDict__make_property_locals; PyObject *__pyx_n_s_PropDict__make_property_locals_2; PyObject *__pyx_n_s_PropDict__make_property_locals_3; PyObject *__pyx_n_s_PropDict_as_dict; PyObject *__pyx_n_s_PropDict_get; PyObject *__pyx_n_s_PropDict_update; PyObject *__pyx_n_s_PropDict_update_internal; PyObject *__pyx_n_s_S_ISBLK; PyObject *__pyx_n_s_S_ISCHR; PyObject *__pyx_n_s_S_ISDIR; PyObject *__pyx_n_s_S_ISFIFO; PyObject *__pyx_n_s_S_ISLNK; PyObject *__pyx_n_s_StableDict; PyObject *__pyx_n_s_TypeError; PyObject *__pyx_n_s_VALID_KEYS; PyObject *__pyx_n_s_ValueError; PyObject *__pyx_kp_s__10; PyObject *__pyx_kp_s__13; PyObject *__pyx_kp_s__14; PyObject *__pyx_kp_s__15; PyObject *__pyx_n_s__16; PyObject *__pyx_kp_u__17; PyObject *__pyx_n_s__38; PyObject *__pyx_n_s__81; PyObject *__pyx_n_s_a; PyObject *__pyx_n_s_acl_access; PyObject *__pyx_n_s_acl_default; PyObject *__pyx_n_s_acl_extended; PyObject *__pyx_n_s_acl_nfs4; PyObject *__pyx_kp_s_added; PyObject *__pyx_kp_s_added_13; PyObject *__pyx_n_s_added_2; PyObject *__pyx_n_s_added_ids; PyObject *__pyx_n_s_ai; PyObject *__pyx_n_s_alen; PyObject *__pyx_n_s_algorithm; PyObject *__pyx_n_s_archives; PyObject *__pyx_n_s_args; PyObject *__pyx_n_s_as_dict; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_atime; PyObject *__pyx_n_s_attr; PyObject *__pyx_n_s_attr_error_msg; PyObject *__pyx_n_s_attr_list; PyObject *__pyx_kp_s_attribute_s_not_found; PyObject *__pyx_n_s_attrs; PyObject *__pyx_n_s_b; PyObject *__pyx_n_s_bi; PyObject *__pyx_n_s_bigint; PyObject *__pyx_n_s_bigint_to_int; PyObject *__pyx_n_s_birthtime; PyObject *__pyx_n_s_blen; PyObject *__pyx_n_s_blkdev; PyObject *__pyx_n_s_borg_item; PyObject *__pyx_n_s_bsdflags; PyObject *__pyx_n_s_c; PyObject *__pyx_n_s_can_compare_chunk_ids; PyObject *__pyx_n_s_can_compare_chunk_ids_2; PyObject *__pyx_n_s_ch; PyObject *__pyx_kp_s_changed_link; PyObject *__pyx_n_s_changes; PyObject *__pyx_n_s_changes_2; PyObject *__pyx_n_s_check_key; PyObject *__pyx_n_s_chg; PyObject *__pyx_n_s_chrdev; PyObject *__pyx_n_s_chunk_ids1; PyObject *__pyx_n_s_chunk_ids2; PyObject *__pyx_n_s_chunk_iterator1; PyObject *__pyx_n_s_chunk_iterator2; PyObject *__pyx_n_s_chunk_seed; PyObject *__pyx_n_s_chunker_params; PyObject *__pyx_kp_s_chunker_params_tuple; PyObject *__pyx_n_s_chunks; PyObject *__pyx_n_s_chunks1; PyObject *__pyx_n_s_chunks2; PyObject *__pyx_n_s_chunks_contents_equal; PyObject *__pyx_n_s_chunks_healthy; PyObject *__pyx_n_s_class; PyObject *__pyx_n_s_class_getitem; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_close; PyObject *__pyx_n_s_cls; PyObject *__pyx_n_s_cmdline; PyObject *__pyx_n_s_collections; PyObject *__pyx_n_s_comment; PyObject *__pyx_n_s_compressed; PyObject *__pyx_n_s_config; PyObject *__pyx_n_s_consider_ids; PyObject *__pyx_n_s_constants; PyObject *__pyx_n_s_contains; PyObject *__pyx_n_s_content_diff; PyObject *__pyx_n_s_content_equal; PyObject *__pyx_n_s_content_only; PyObject *__pyx_n_s_content_only_2; PyObject *__pyx_n_s_create_deleted; PyObject *__pyx_n_s_csize; PyObject *__pyx_n_s_csize_parts; PyObject *__pyx_n_s_ctime; PyObject *__pyx_n_s_d; PyObject *__pyx_n_s_data; PyObject *__pyx_n_s_data_dict; PyObject *__pyx_kp_s_data_dict_must_be_a_dict; PyObject *__pyx_n_s_decode; PyObject *__pyx_n_s_default; PyObject *__pyx_n_s_del; PyObject *__pyx_n_s_deleted; PyObject *__pyx_n_s_dict; PyObject *__pyx_n_s_dict_2; PyObject *__pyx_n_s_directory; PyObject *__pyx_kp_u_disable; PyObject *__pyx_n_s_doc; PyObject *__pyx_n_s_doc_2; PyObject *__pyx_kp_u_enable; PyObject *__pyx_n_s_enc_hmac_key; PyObject *__pyx_n_s_enc_key; PyObject *__pyx_n_s_encode; PyObject *__pyx_n_s_end; PyObject *__pyx_n_s_eq; PyObject *__pyx_n_s_equal; PyObject *__pyx_n_s_equal_2; PyObject *__pyx_n_s_fifo; PyObject *__pyx_n_s_filemode; PyObject *__pyx_n_s_format; PyObject *__pyx_n_s_format_file_size; PyObject *__pyx_n_s_from_chunks; PyObject *__pyx_n_s_from_optr; PyObject *__pyx_n_s_g1; PyObject *__pyx_n_s_g2; PyObject *__pyx_n_s_g_attr; PyObject *__pyx_kp_u_gc; PyObject *__pyx_n_s_genexpr; PyObject *__pyx_n_s_get; PyObject *__pyx_n_s_get_2; PyObject *__pyx_n_s_get_size; PyObject *__pyx_n_s_gid; PyObject *__pyx_n_s_group; PyObject *__pyx_n_s_hardlink_master; PyObject *__pyx_n_s_hardlink_masters; PyObject *__pyx_n_s_hash; PyObject *__pyx_n_s_having_chunks; PyObject *__pyx_n_s_helpers; PyObject *__pyx_n_s_helpers_time; PyObject *__pyx_n_s_hostname; PyObject *__pyx_n_s_id; PyObject *__pyx_n_s_id_key; PyObject *__pyx_kp_s_id_size_csize; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_init; PyObject *__pyx_n_s_init_subclass; PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_int_to_bigint; PyObject *__pyx_n_s_internal_dict; PyObject *__pyx_kp_s_internal_dict_must_be_a_dict; PyObject *__pyx_n_s_is_blk; PyObject *__pyx_n_s_is_chr; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_n_s_is_dir; PyObject *__pyx_n_s_is_fifo; PyObject *__pyx_n_s_is_link; PyObject *__pyx_n_s_is_type; PyObject *__pyx_kp_u_isenabled; PyObject *__pyx_n_s_item1; PyObject *__pyx_n_s_item1_2; PyObject *__pyx_n_s_item2; PyObject *__pyx_n_s_item2_2; PyObject *__pyx_n_s_item_keys; PyObject *__pyx_n_s_item_type; PyObject *__pyx_n_s_items; PyObject *__pyx_n_s_iterations; PyObject *__pyx_n_s_join; PyObject *__pyx_n_s_k; PyObject *__pyx_n_s_key; PyObject *__pyx_kp_s_key_must_be_str; PyObject *__pyx_kp_s_key_s_is_not_a_valid_key; PyObject *__pyx_n_s_kw; PyObject *__pyx_n_s_link; PyObject *__pyx_n_s_link_diff; PyObject *__pyx_kp_s_list_or_None; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_make_property; PyObject *__pyx_n_s_master; PyObject *__pyx_n_s_memorize; PyObject *__pyx_n_s_metaclass; PyObject *__pyx_n_s_mode; PyObject *__pyx_n_s_mode1; PyObject *__pyx_n_s_mode2; PyObject *__pyx_n_s_mode_diff; PyObject *__pyx_n_s_modified; PyObject *__pyx_n_s_module; PyObject *__pyx_n_s_mro_entries; PyObject *__pyx_n_s_mtime; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_name_2; PyObject *__pyx_n_s_namedtuple; PyObject *__pyx_n_u_new; PyObject *__pyx_n_s_new_group; PyObject *__pyx_n_s_new_mode; PyObject *__pyx_n_s_new_user; PyObject *__pyx_n_s_nfiles; PyObject *__pyx_n_s_nfiles_parts; PyObject *__pyx_n_s_nlink; PyObject *__pyx_n_s_numeric_ids; PyObject *__pyx_n_s_numeric_ids_2; PyObject *__pyx_n_s_object; PyObject *__pyx_n_u_old; PyObject *__pyx_n_s_old_group; PyObject *__pyx_n_s_old_mode; PyObject *__pyx_n_s_old_user; PyObject *__pyx_n_s_optr; PyObject *__pyx_n_s_other; PyObject *__pyx_n_s_owner; PyObject *__pyx_n_s_owner_diff; PyObject *__pyx_n_s_part; PyObject *__pyx_n_s_path; PyObject *__pyx_n_s_pd; PyObject *__pyx_n_s_precision; PyObject *__pyx_n_s_prepare; PyObject *__pyx_n_s_presence_diff; PyObject *__pyx_n_s_property; PyObject *__pyx_n_s_qualname; PyObject *__pyx_n_s_rdev; PyObject *__pyx_n_s_recreate_args; PyObject *__pyx_n_s_recreate_cmdline; PyObject *__pyx_n_s_recreate_partial_chunks; PyObject *__pyx_n_s_recreate_source_id; PyObject *__pyx_kp_s_removed; PyObject *__pyx_kp_s_removed_11; PyObject *__pyx_n_s_removed_2; PyObject *__pyx_n_s_removed_ids; PyObject *__pyx_n_s_repository_id; PyObject *__pyx_n_s_repr; PyObject *__pyx_kp_s_s_internal_dict_r; PyObject *__pyx_kp_s_s_s; PyObject *__pyx_kp_s_s_value_must_be_s; PyObject *__pyx_n_s_safe_decode; PyObject *__pyx_n_s_safe_encode; PyObject *__pyx_n_s_safe_timestamp; PyObject *__pyx_n_s_salt; PyObject *__pyx_n_s_self; PyObject *__pyx_n_s_send; PyObject *__pyx_n_s_set; PyObject *__pyx_n_s_set_name; PyObject *__pyx_n_s_sign; PyObject *__pyx_n_s_size; PyObject *__pyx_n_s_size_parts; PyObject *__pyx_n_s_slicelen; PyObject *__pyx_n_s_slots; PyObject *__pyx_n_s_source; PyObject *__pyx_n_s_spec; PyObject *__pyx_kp_s_src_borg_item_pyx; PyObject *__pyx_n_s_stat; PyObject *__pyx_n_s_staticmethod; PyObject *__pyx_n_s_sum; PyObject *__pyx_n_s_super; PyObject *__pyx_kp_s_surrogate_escaped_str; PyObject *__pyx_kp_s_surrogate_escaped_str_or_None; PyObject *__pyx_n_s_sz; PyObject *__pyx_n_s_t; PyObject *__pyx_n_s_tam_required; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_throw; PyObject *__pyx_n_s_time; PyObject *__pyx_n_s_time_diffs; PyObject *__pyx_n_s_time_end; PyObject *__pyx_n_s_timestamp; PyObject *__pyx_n_s_to_optr; PyObject *__pyx_n_s_ts1; PyObject *__pyx_n_s_ts2; PyObject *__pyx_n_s_tuple_decode; PyObject *__pyx_n_s_tuple_decode_locals_genexpr; PyObject *__pyx_n_s_tuple_encode; PyObject *__pyx_n_s_tuple_encode_locals_genexpr; PyObject *__pyx_n_s_type; PyObject *__pyx_n_s_type_error_msg; PyObject *__pyx_n_s_typetest; PyObject *__pyx_n_s_u1; PyObject *__pyx_n_s_u2; PyObject *__pyx_n_s_u_attr; PyObject *__pyx_n_s_uid; PyObject *__pyx_n_s_update; PyObject *__pyx_n_s_update_internal; PyObject *__pyx_n_s_user; PyObject *__pyx_n_s_username; PyObject *__pyx_n_s_v; PyObject *__pyx_n_s_value; PyObject *__pyx_n_s_value_type; PyObject *__pyx_n_s_value_type_name; PyObject *__pyx_n_s_version; PyObject *__pyx_n_s_xattrs; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_tuple_; PyObject *__pyx_tuple__2; PyObject *__pyx_tuple__3; PyObject *__pyx_tuple__4; PyObject *__pyx_tuple__7; PyObject *__pyx_tuple__9; PyObject *__pyx_tuple__11; PyObject *__pyx_tuple__12; PyObject *__pyx_tuple__18; PyObject *__pyx_tuple__19; PyObject *__pyx_tuple__21; PyObject *__pyx_tuple__24; PyObject *__pyx_tuple__28; PyObject *__pyx_tuple__31; PyObject *__pyx_tuple__33; PyObject *__pyx_tuple__34; PyObject *__pyx_tuple__36; PyObject *__pyx_tuple__37; PyObject *__pyx_tuple__39; PyObject *__pyx_tuple__41; PyObject *__pyx_tuple__43; PyObject *__pyx_tuple__45; PyObject *__pyx_tuple__52; PyObject *__pyx_tuple__54; PyObject *__pyx_tuple__57; PyObject *__pyx_tuple__59; PyObject *__pyx_tuple__61; PyObject *__pyx_tuple__63; PyObject *__pyx_tuple__65; PyObject *__pyx_tuple__67; PyObject *__pyx_tuple__69; PyObject *__pyx_tuple__71; PyObject *__pyx_tuple__73; PyObject *__pyx_tuple__75; PyObject *__pyx_tuple__77; PyObject *__pyx_tuple__79; PyObject *__pyx_codeobj__5; PyObject *__pyx_codeobj__6; PyObject *__pyx_codeobj__8; PyObject *__pyx_codeobj__20; PyObject *__pyx_codeobj__22; PyObject *__pyx_codeobj__23; PyObject *__pyx_codeobj__25; PyObject *__pyx_codeobj__26; PyObject *__pyx_codeobj__27; PyObject *__pyx_codeobj__29; PyObject *__pyx_codeobj__30; PyObject *__pyx_codeobj__32; PyObject *__pyx_codeobj__35; PyObject *__pyx_codeobj__40; PyObject *__pyx_codeobj__42; PyObject *__pyx_codeobj__44; PyObject *__pyx_codeobj__46; PyObject *__pyx_codeobj__47; PyObject *__pyx_codeobj__48; PyObject *__pyx_codeobj__49; PyObject *__pyx_codeobj__50; PyObject *__pyx_codeobj__51; PyObject *__pyx_codeobj__53; PyObject *__pyx_codeobj__55; PyObject *__pyx_codeobj__56; PyObject *__pyx_codeobj__58; PyObject *__pyx_codeobj__60; PyObject *__pyx_codeobj__62; PyObject *__pyx_codeobj__64; PyObject *__pyx_codeobj__66; PyObject *__pyx_codeobj__68; PyObject *__pyx_codeobj__70; PyObject *__pyx_codeobj__72; PyObject *__pyx_codeobj__74; PyObject *__pyx_codeobj__76; PyObject *__pyx_codeobj__78; PyObject *__pyx_codeobj__80; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_4borg_4item___pyx_scope_struct___make_property); Py_CLEAR(clear_module_state->__pyx_type_4borg_4item___pyx_scope_struct___make_property); Py_CLEAR(clear_module_state->__pyx_ptype_4borg_4item___pyx_scope_struct_1_get_size); Py_CLEAR(clear_module_state->__pyx_type_4borg_4item___pyx_scope_struct_1_get_size); Py_CLEAR(clear_module_state->__pyx_ptype_4borg_4item___pyx_scope_struct_2_genexpr); Py_CLEAR(clear_module_state->__pyx_type_4borg_4item___pyx_scope_struct_2_genexpr); Py_CLEAR(clear_module_state->__pyx_ptype_4borg_4item___pyx_scope_struct_3_genexpr); Py_CLEAR(clear_module_state->__pyx_type_4borg_4item___pyx_scope_struct_3_genexpr); Py_CLEAR(clear_module_state->__pyx_ptype_4borg_4item___pyx_scope_struct_4_genexpr); Py_CLEAR(clear_module_state->__pyx_type_4borg_4item___pyx_scope_struct_4_genexpr); Py_CLEAR(clear_module_state->__pyx_ptype_4borg_4item___pyx_scope_struct_5_genexpr); Py_CLEAR(clear_module_state->__pyx_type_4borg_4item___pyx_scope_struct_5_genexpr); Py_CLEAR(clear_module_state->__pyx_ptype_4borg_4item___pyx_scope_struct_6_genexpr); Py_CLEAR(clear_module_state->__pyx_type_4borg_4item___pyx_scope_struct_6_genexpr); Py_CLEAR(clear_module_state->__pyx_kp_s_1_4_01); Py_CLEAR(clear_module_state->__pyx_kp_s_9_9); Py_CLEAR(clear_module_state->__pyx_n_s_API_VERSION); Py_CLEAR(clear_module_state->__pyx_n_s_ARCHIVE_KEYS); Py_CLEAR(clear_module_state->__pyx_n_s_ArchiveItem); Py_CLEAR(clear_module_state->__pyx_kp_s_ArchiveItem_abstraction_that_de); Py_CLEAR(clear_module_state->__pyx_n_s_AssertionError); Py_CLEAR(clear_module_state->__pyx_n_s_AttributeError); Py_CLEAR(clear_module_state->__pyx_kp_s_Can_t_store_size_when_considerin); Py_CLEAR(clear_module_state->__pyx_n_s_ChunkListEntry); Py_CLEAR(clear_module_state->__pyx_kp_s_Comparison_of_two_items_from_di); Py_CLEAR(clear_module_state->__pyx_n_s_EncryptedKey); Py_CLEAR(clear_module_state->__pyx_kp_s_EncryptedKey_abstraction_that_d); Py_CLEAR(clear_module_state->__pyx_n_s_ITEM_KEYS); Py_CLEAR(clear_module_state->__pyx_n_s_Item); Py_CLEAR(clear_module_state->__pyx_n_s_ItemDiff); Py_CLEAR(clear_module_state->__pyx_n_s_ItemDiff___init); Py_CLEAR(clear_module_state->__pyx_n_s_ItemDiff___repr); Py_CLEAR(clear_module_state->__pyx_n_s_ItemDiff___repr___locals_genexpr); Py_CLEAR(clear_module_state->__pyx_n_s_ItemDiff__content_diff); Py_CLEAR(clear_module_state->__pyx_n_s_ItemDiff__content_equal); Py_CLEAR(clear_module_state->__pyx_n_s_ItemDiff__equal); Py_CLEAR(clear_module_state->__pyx_n_s_ItemDiff__link_diff); Py_CLEAR(clear_module_state->__pyx_n_s_ItemDiff__mode_diff); Py_CLEAR(clear_module_state->__pyx_n_s_ItemDiff__owner_diff); Py_CLEAR(clear_module_state->__pyx_n_s_ItemDiff__presence_diff); Py_CLEAR(clear_module_state->__pyx_n_s_ItemDiff__time_diffs); Py_CLEAR(clear_module_state->__pyx_n_s_ItemDiff_changes); Py_CLEAR(clear_module_state->__pyx_n_s_Item__is_type); Py_CLEAR(clear_module_state->__pyx_kp_s_Item_abstraction_that_deals_wit); Py_CLEAR(clear_module_state->__pyx_n_s_Item_create_deleted); Py_CLEAR(clear_module_state->__pyx_kp_s_Item_does_not_have_a_csize_field); Py_CLEAR(clear_module_state->__pyx_n_s_Item_from_optr); Py_CLEAR(clear_module_state->__pyx_n_s_Item_get_size); Py_CLEAR(clear_module_state->__pyx_n_s_Item_get_size_locals_genexpr); Py_CLEAR(clear_module_state->__pyx_n_s_Item_is_blk); Py_CLEAR(clear_module_state->__pyx_n_s_Item_is_chr); Py_CLEAR(clear_module_state->__pyx_n_s_Item_is_dir); Py_CLEAR(clear_module_state->__pyx_n_s_Item_is_fifo); Py_CLEAR(clear_module_state->__pyx_n_s_Item_is_link); Py_CLEAR(clear_module_state->__pyx_n_s_Item_to_optr); Py_CLEAR(clear_module_state->__pyx_n_s_Key); Py_CLEAR(clear_module_state->__pyx_n_s_KeyError); Py_CLEAR(clear_module_state->__pyx_kp_s_Key_abstraction_that_deals_with); Py_CLEAR(clear_module_state->__pyx_kp_s_Manage_a_dictionary_via_propert); Py_CLEAR(clear_module_state->__pyx_n_s_ManifestItem); Py_CLEAR(clear_module_state->__pyx_kp_s_ManifestItem_abstraction_that_d); Py_CLEAR(clear_module_state->__pyx_n_s_OutputTimestamp); Py_CLEAR(clear_module_state->__pyx_n_s_PropDict); Py_CLEAR(clear_module_state->__pyx_n_s_PropDict___contains); Py_CLEAR(clear_module_state->__pyx_n_s_PropDict___eq); Py_CLEAR(clear_module_state->__pyx_n_s_PropDict___init); Py_CLEAR(clear_module_state->__pyx_n_s_PropDict___repr); Py_CLEAR(clear_module_state->__pyx_n_s_PropDict__check_key); Py_CLEAR(clear_module_state->__pyx_n_s_PropDict__make_property); Py_CLEAR(clear_module_state->__pyx_n_s_PropDict__make_property_locals); Py_CLEAR(clear_module_state->__pyx_n_s_PropDict__make_property_locals_2); Py_CLEAR(clear_module_state->__pyx_n_s_PropDict__make_property_locals_3); Py_CLEAR(clear_module_state->__pyx_n_s_PropDict_as_dict); Py_CLEAR(clear_module_state->__pyx_n_s_PropDict_get); Py_CLEAR(clear_module_state->__pyx_n_s_PropDict_update); Py_CLEAR(clear_module_state->__pyx_n_s_PropDict_update_internal); Py_CLEAR(clear_module_state->__pyx_n_s_S_ISBLK); Py_CLEAR(clear_module_state->__pyx_n_s_S_ISCHR); Py_CLEAR(clear_module_state->__pyx_n_s_S_ISDIR); Py_CLEAR(clear_module_state->__pyx_n_s_S_ISFIFO); Py_CLEAR(clear_module_state->__pyx_n_s_S_ISLNK); Py_CLEAR(clear_module_state->__pyx_n_s_StableDict); Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); Py_CLEAR(clear_module_state->__pyx_n_s_VALID_KEYS); Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); Py_CLEAR(clear_module_state->__pyx_kp_s__10); Py_CLEAR(clear_module_state->__pyx_kp_s__13); Py_CLEAR(clear_module_state->__pyx_kp_s__14); Py_CLEAR(clear_module_state->__pyx_kp_s__15); Py_CLEAR(clear_module_state->__pyx_n_s__16); Py_CLEAR(clear_module_state->__pyx_kp_u__17); Py_CLEAR(clear_module_state->__pyx_n_s__38); Py_CLEAR(clear_module_state->__pyx_n_s__81); Py_CLEAR(clear_module_state->__pyx_n_s_a); Py_CLEAR(clear_module_state->__pyx_n_s_acl_access); Py_CLEAR(clear_module_state->__pyx_n_s_acl_default); Py_CLEAR(clear_module_state->__pyx_n_s_acl_extended); Py_CLEAR(clear_module_state->__pyx_n_s_acl_nfs4); Py_CLEAR(clear_module_state->__pyx_kp_s_added); Py_CLEAR(clear_module_state->__pyx_kp_s_added_13); Py_CLEAR(clear_module_state->__pyx_n_s_added_2); Py_CLEAR(clear_module_state->__pyx_n_s_added_ids); Py_CLEAR(clear_module_state->__pyx_n_s_ai); Py_CLEAR(clear_module_state->__pyx_n_s_alen); Py_CLEAR(clear_module_state->__pyx_n_s_algorithm); Py_CLEAR(clear_module_state->__pyx_n_s_archives); Py_CLEAR(clear_module_state->__pyx_n_s_args); Py_CLEAR(clear_module_state->__pyx_n_s_as_dict); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_atime); Py_CLEAR(clear_module_state->__pyx_n_s_attr); Py_CLEAR(clear_module_state->__pyx_n_s_attr_error_msg); Py_CLEAR(clear_module_state->__pyx_n_s_attr_list); Py_CLEAR(clear_module_state->__pyx_kp_s_attribute_s_not_found); Py_CLEAR(clear_module_state->__pyx_n_s_attrs); Py_CLEAR(clear_module_state->__pyx_n_s_b); Py_CLEAR(clear_module_state->__pyx_n_s_bi); Py_CLEAR(clear_module_state->__pyx_n_s_bigint); Py_CLEAR(clear_module_state->__pyx_n_s_bigint_to_int); Py_CLEAR(clear_module_state->__pyx_n_s_birthtime); Py_CLEAR(clear_module_state->__pyx_n_s_blen); Py_CLEAR(clear_module_state->__pyx_n_s_blkdev); Py_CLEAR(clear_module_state->__pyx_n_s_borg_item); Py_CLEAR(clear_module_state->__pyx_n_s_bsdflags); Py_CLEAR(clear_module_state->__pyx_n_s_c); Py_CLEAR(clear_module_state->__pyx_n_s_can_compare_chunk_ids); Py_CLEAR(clear_module_state->__pyx_n_s_can_compare_chunk_ids_2); Py_CLEAR(clear_module_state->__pyx_n_s_ch); Py_CLEAR(clear_module_state->__pyx_kp_s_changed_link); Py_CLEAR(clear_module_state->__pyx_n_s_changes); Py_CLEAR(clear_module_state->__pyx_n_s_changes_2); Py_CLEAR(clear_module_state->__pyx_n_s_check_key); Py_CLEAR(clear_module_state->__pyx_n_s_chg); Py_CLEAR(clear_module_state->__pyx_n_s_chrdev); Py_CLEAR(clear_module_state->__pyx_n_s_chunk_ids1); Py_CLEAR(clear_module_state->__pyx_n_s_chunk_ids2); Py_CLEAR(clear_module_state->__pyx_n_s_chunk_iterator1); Py_CLEAR(clear_module_state->__pyx_n_s_chunk_iterator2); Py_CLEAR(clear_module_state->__pyx_n_s_chunk_seed); Py_CLEAR(clear_module_state->__pyx_n_s_chunker_params); Py_CLEAR(clear_module_state->__pyx_kp_s_chunker_params_tuple); Py_CLEAR(clear_module_state->__pyx_n_s_chunks); Py_CLEAR(clear_module_state->__pyx_n_s_chunks1); Py_CLEAR(clear_module_state->__pyx_n_s_chunks2); Py_CLEAR(clear_module_state->__pyx_n_s_chunks_contents_equal); Py_CLEAR(clear_module_state->__pyx_n_s_chunks_healthy); Py_CLEAR(clear_module_state->__pyx_n_s_class); Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_close); Py_CLEAR(clear_module_state->__pyx_n_s_cls); Py_CLEAR(clear_module_state->__pyx_n_s_cmdline); Py_CLEAR(clear_module_state->__pyx_n_s_collections); Py_CLEAR(clear_module_state->__pyx_n_s_comment); Py_CLEAR(clear_module_state->__pyx_n_s_compressed); Py_CLEAR(clear_module_state->__pyx_n_s_config); Py_CLEAR(clear_module_state->__pyx_n_s_consider_ids); Py_CLEAR(clear_module_state->__pyx_n_s_constants); Py_CLEAR(clear_module_state->__pyx_n_s_contains); Py_CLEAR(clear_module_state->__pyx_n_s_content_diff); Py_CLEAR(clear_module_state->__pyx_n_s_content_equal); Py_CLEAR(clear_module_state->__pyx_n_s_content_only); Py_CLEAR(clear_module_state->__pyx_n_s_content_only_2); Py_CLEAR(clear_module_state->__pyx_n_s_create_deleted); Py_CLEAR(clear_module_state->__pyx_n_s_csize); Py_CLEAR(clear_module_state->__pyx_n_s_csize_parts); Py_CLEAR(clear_module_state->__pyx_n_s_ctime); Py_CLEAR(clear_module_state->__pyx_n_s_d); Py_CLEAR(clear_module_state->__pyx_n_s_data); Py_CLEAR(clear_module_state->__pyx_n_s_data_dict); Py_CLEAR(clear_module_state->__pyx_kp_s_data_dict_must_be_a_dict); Py_CLEAR(clear_module_state->__pyx_n_s_decode); Py_CLEAR(clear_module_state->__pyx_n_s_default); Py_CLEAR(clear_module_state->__pyx_n_s_del); Py_CLEAR(clear_module_state->__pyx_n_s_deleted); Py_CLEAR(clear_module_state->__pyx_n_s_dict); Py_CLEAR(clear_module_state->__pyx_n_s_dict_2); Py_CLEAR(clear_module_state->__pyx_n_s_directory); Py_CLEAR(clear_module_state->__pyx_kp_u_disable); Py_CLEAR(clear_module_state->__pyx_n_s_doc); Py_CLEAR(clear_module_state->__pyx_n_s_doc_2); Py_CLEAR(clear_module_state->__pyx_kp_u_enable); Py_CLEAR(clear_module_state->__pyx_n_s_enc_hmac_key); Py_CLEAR(clear_module_state->__pyx_n_s_enc_key); Py_CLEAR(clear_module_state->__pyx_n_s_encode); Py_CLEAR(clear_module_state->__pyx_n_s_end); Py_CLEAR(clear_module_state->__pyx_n_s_eq); Py_CLEAR(clear_module_state->__pyx_n_s_equal); Py_CLEAR(clear_module_state->__pyx_n_s_equal_2); Py_CLEAR(clear_module_state->__pyx_n_s_fifo); Py_CLEAR(clear_module_state->__pyx_n_s_filemode); Py_CLEAR(clear_module_state->__pyx_n_s_format); Py_CLEAR(clear_module_state->__pyx_n_s_format_file_size); Py_CLEAR(clear_module_state->__pyx_n_s_from_chunks); Py_CLEAR(clear_module_state->__pyx_n_s_from_optr); Py_CLEAR(clear_module_state->__pyx_n_s_g1); Py_CLEAR(clear_module_state->__pyx_n_s_g2); Py_CLEAR(clear_module_state->__pyx_n_s_g_attr); Py_CLEAR(clear_module_state->__pyx_kp_u_gc); Py_CLEAR(clear_module_state->__pyx_n_s_genexpr); Py_CLEAR(clear_module_state->__pyx_n_s_get); Py_CLEAR(clear_module_state->__pyx_n_s_get_2); Py_CLEAR(clear_module_state->__pyx_n_s_get_size); Py_CLEAR(clear_module_state->__pyx_n_s_gid); Py_CLEAR(clear_module_state->__pyx_n_s_group); Py_CLEAR(clear_module_state->__pyx_n_s_hardlink_master); Py_CLEAR(clear_module_state->__pyx_n_s_hardlink_masters); Py_CLEAR(clear_module_state->__pyx_n_s_hash); Py_CLEAR(clear_module_state->__pyx_n_s_having_chunks); Py_CLEAR(clear_module_state->__pyx_n_s_helpers); Py_CLEAR(clear_module_state->__pyx_n_s_helpers_time); Py_CLEAR(clear_module_state->__pyx_n_s_hostname); Py_CLEAR(clear_module_state->__pyx_n_s_id); Py_CLEAR(clear_module_state->__pyx_n_s_id_key); Py_CLEAR(clear_module_state->__pyx_kp_s_id_size_csize); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_init); Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_int_to_bigint); Py_CLEAR(clear_module_state->__pyx_n_s_internal_dict); Py_CLEAR(clear_module_state->__pyx_kp_s_internal_dict_must_be_a_dict); Py_CLEAR(clear_module_state->__pyx_n_s_is_blk); Py_CLEAR(clear_module_state->__pyx_n_s_is_chr); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_n_s_is_dir); Py_CLEAR(clear_module_state->__pyx_n_s_is_fifo); Py_CLEAR(clear_module_state->__pyx_n_s_is_link); Py_CLEAR(clear_module_state->__pyx_n_s_is_type); Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); Py_CLEAR(clear_module_state->__pyx_n_s_item1); Py_CLEAR(clear_module_state->__pyx_n_s_item1_2); Py_CLEAR(clear_module_state->__pyx_n_s_item2); Py_CLEAR(clear_module_state->__pyx_n_s_item2_2); Py_CLEAR(clear_module_state->__pyx_n_s_item_keys); Py_CLEAR(clear_module_state->__pyx_n_s_item_type); Py_CLEAR(clear_module_state->__pyx_n_s_items); Py_CLEAR(clear_module_state->__pyx_n_s_iterations); Py_CLEAR(clear_module_state->__pyx_n_s_join); Py_CLEAR(clear_module_state->__pyx_n_s_k); Py_CLEAR(clear_module_state->__pyx_n_s_key); Py_CLEAR(clear_module_state->__pyx_kp_s_key_must_be_str); Py_CLEAR(clear_module_state->__pyx_kp_s_key_s_is_not_a_valid_key); Py_CLEAR(clear_module_state->__pyx_n_s_kw); Py_CLEAR(clear_module_state->__pyx_n_s_link); Py_CLEAR(clear_module_state->__pyx_n_s_link_diff); Py_CLEAR(clear_module_state->__pyx_kp_s_list_or_None); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_make_property); Py_CLEAR(clear_module_state->__pyx_n_s_master); Py_CLEAR(clear_module_state->__pyx_n_s_memorize); Py_CLEAR(clear_module_state->__pyx_n_s_metaclass); Py_CLEAR(clear_module_state->__pyx_n_s_mode); Py_CLEAR(clear_module_state->__pyx_n_s_mode1); Py_CLEAR(clear_module_state->__pyx_n_s_mode2); Py_CLEAR(clear_module_state->__pyx_n_s_mode_diff); Py_CLEAR(clear_module_state->__pyx_n_s_modified); Py_CLEAR(clear_module_state->__pyx_n_s_module); Py_CLEAR(clear_module_state->__pyx_n_s_mro_entries); Py_CLEAR(clear_module_state->__pyx_n_s_mtime); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_name_2); Py_CLEAR(clear_module_state->__pyx_n_s_namedtuple); Py_CLEAR(clear_module_state->__pyx_n_u_new); Py_CLEAR(clear_module_state->__pyx_n_s_new_group); Py_CLEAR(clear_module_state->__pyx_n_s_new_mode); Py_CLEAR(clear_module_state->__pyx_n_s_new_user); Py_CLEAR(clear_module_state->__pyx_n_s_nfiles); Py_CLEAR(clear_module_state->__pyx_n_s_nfiles_parts); Py_CLEAR(clear_module_state->__pyx_n_s_nlink); Py_CLEAR(clear_module_state->__pyx_n_s_numeric_ids); Py_CLEAR(clear_module_state->__pyx_n_s_numeric_ids_2); Py_CLEAR(clear_module_state->__pyx_n_s_object); Py_CLEAR(clear_module_state->__pyx_n_u_old); Py_CLEAR(clear_module_state->__pyx_n_s_old_group); Py_CLEAR(clear_module_state->__pyx_n_s_old_mode); Py_CLEAR(clear_module_state->__pyx_n_s_old_user); Py_CLEAR(clear_module_state->__pyx_n_s_optr); Py_CLEAR(clear_module_state->__pyx_n_s_other); Py_CLEAR(clear_module_state->__pyx_n_s_owner); Py_CLEAR(clear_module_state->__pyx_n_s_owner_diff); Py_CLEAR(clear_module_state->__pyx_n_s_part); Py_CLEAR(clear_module_state->__pyx_n_s_path); Py_CLEAR(clear_module_state->__pyx_n_s_pd); Py_CLEAR(clear_module_state->__pyx_n_s_precision); Py_CLEAR(clear_module_state->__pyx_n_s_prepare); Py_CLEAR(clear_module_state->__pyx_n_s_presence_diff); Py_CLEAR(clear_module_state->__pyx_n_s_property); Py_CLEAR(clear_module_state->__pyx_n_s_qualname); Py_CLEAR(clear_module_state->__pyx_n_s_rdev); Py_CLEAR(clear_module_state->__pyx_n_s_recreate_args); Py_CLEAR(clear_module_state->__pyx_n_s_recreate_cmdline); Py_CLEAR(clear_module_state->__pyx_n_s_recreate_partial_chunks); Py_CLEAR(clear_module_state->__pyx_n_s_recreate_source_id); Py_CLEAR(clear_module_state->__pyx_kp_s_removed); Py_CLEAR(clear_module_state->__pyx_kp_s_removed_11); Py_CLEAR(clear_module_state->__pyx_n_s_removed_2); Py_CLEAR(clear_module_state->__pyx_n_s_removed_ids); Py_CLEAR(clear_module_state->__pyx_n_s_repository_id); Py_CLEAR(clear_module_state->__pyx_n_s_repr); Py_CLEAR(clear_module_state->__pyx_kp_s_s_internal_dict_r); Py_CLEAR(clear_module_state->__pyx_kp_s_s_s); Py_CLEAR(clear_module_state->__pyx_kp_s_s_value_must_be_s); Py_CLEAR(clear_module_state->__pyx_n_s_safe_decode); Py_CLEAR(clear_module_state->__pyx_n_s_safe_encode); Py_CLEAR(clear_module_state->__pyx_n_s_safe_timestamp); Py_CLEAR(clear_module_state->__pyx_n_s_salt); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_n_s_send); Py_CLEAR(clear_module_state->__pyx_n_s_set); Py_CLEAR(clear_module_state->__pyx_n_s_set_name); Py_CLEAR(clear_module_state->__pyx_n_s_sign); Py_CLEAR(clear_module_state->__pyx_n_s_size); Py_CLEAR(clear_module_state->__pyx_n_s_size_parts); Py_CLEAR(clear_module_state->__pyx_n_s_slicelen); Py_CLEAR(clear_module_state->__pyx_n_s_slots); Py_CLEAR(clear_module_state->__pyx_n_s_source); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_kp_s_src_borg_item_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_stat); Py_CLEAR(clear_module_state->__pyx_n_s_staticmethod); Py_CLEAR(clear_module_state->__pyx_n_s_sum); Py_CLEAR(clear_module_state->__pyx_n_s_super); Py_CLEAR(clear_module_state->__pyx_kp_s_surrogate_escaped_str); Py_CLEAR(clear_module_state->__pyx_kp_s_surrogate_escaped_str_or_None); Py_CLEAR(clear_module_state->__pyx_n_s_sz); Py_CLEAR(clear_module_state->__pyx_n_s_t); Py_CLEAR(clear_module_state->__pyx_n_s_tam_required); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_throw); Py_CLEAR(clear_module_state->__pyx_n_s_time); Py_CLEAR(clear_module_state->__pyx_n_s_time_diffs); Py_CLEAR(clear_module_state->__pyx_n_s_time_end); Py_CLEAR(clear_module_state->__pyx_n_s_timestamp); Py_CLEAR(clear_module_state->__pyx_n_s_to_optr); Py_CLEAR(clear_module_state->__pyx_n_s_ts1); Py_CLEAR(clear_module_state->__pyx_n_s_ts2); Py_CLEAR(clear_module_state->__pyx_n_s_tuple_decode); Py_CLEAR(clear_module_state->__pyx_n_s_tuple_decode_locals_genexpr); Py_CLEAR(clear_module_state->__pyx_n_s_tuple_encode); Py_CLEAR(clear_module_state->__pyx_n_s_tuple_encode_locals_genexpr); Py_CLEAR(clear_module_state->__pyx_n_s_type); Py_CLEAR(clear_module_state->__pyx_n_s_type_error_msg); Py_CLEAR(clear_module_state->__pyx_n_s_typetest); Py_CLEAR(clear_module_state->__pyx_n_s_u1); Py_CLEAR(clear_module_state->__pyx_n_s_u2); Py_CLEAR(clear_module_state->__pyx_n_s_u_attr); Py_CLEAR(clear_module_state->__pyx_n_s_uid); Py_CLEAR(clear_module_state->__pyx_n_s_update); Py_CLEAR(clear_module_state->__pyx_n_s_update_internal); Py_CLEAR(clear_module_state->__pyx_n_s_user); Py_CLEAR(clear_module_state->__pyx_n_s_username); Py_CLEAR(clear_module_state->__pyx_n_s_v); Py_CLEAR(clear_module_state->__pyx_n_s_value); Py_CLEAR(clear_module_state->__pyx_n_s_value_type); Py_CLEAR(clear_module_state->__pyx_n_s_value_type_name); Py_CLEAR(clear_module_state->__pyx_n_s_version); Py_CLEAR(clear_module_state->__pyx_n_s_xattrs); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_1); Py_CLEAR(clear_module_state->__pyx_tuple_); Py_CLEAR(clear_module_state->__pyx_tuple__2); Py_CLEAR(clear_module_state->__pyx_tuple__3); Py_CLEAR(clear_module_state->__pyx_tuple__4); Py_CLEAR(clear_module_state->__pyx_tuple__7); Py_CLEAR(clear_module_state->__pyx_tuple__9); Py_CLEAR(clear_module_state->__pyx_tuple__11); Py_CLEAR(clear_module_state->__pyx_tuple__12); Py_CLEAR(clear_module_state->__pyx_tuple__18); Py_CLEAR(clear_module_state->__pyx_tuple__19); Py_CLEAR(clear_module_state->__pyx_tuple__21); Py_CLEAR(clear_module_state->__pyx_tuple__24); Py_CLEAR(clear_module_state->__pyx_tuple__28); Py_CLEAR(clear_module_state->__pyx_tuple__31); Py_CLEAR(clear_module_state->__pyx_tuple__33); Py_CLEAR(clear_module_state->__pyx_tuple__34); Py_CLEAR(clear_module_state->__pyx_tuple__36); Py_CLEAR(clear_module_state->__pyx_tuple__37); Py_CLEAR(clear_module_state->__pyx_tuple__39); Py_CLEAR(clear_module_state->__pyx_tuple__41); Py_CLEAR(clear_module_state->__pyx_tuple__43); Py_CLEAR(clear_module_state->__pyx_tuple__45); Py_CLEAR(clear_module_state->__pyx_tuple__52); Py_CLEAR(clear_module_state->__pyx_tuple__54); Py_CLEAR(clear_module_state->__pyx_tuple__57); Py_CLEAR(clear_module_state->__pyx_tuple__59); Py_CLEAR(clear_module_state->__pyx_tuple__61); Py_CLEAR(clear_module_state->__pyx_tuple__63); Py_CLEAR(clear_module_state->__pyx_tuple__65); Py_CLEAR(clear_module_state->__pyx_tuple__67); Py_CLEAR(clear_module_state->__pyx_tuple__69); Py_CLEAR(clear_module_state->__pyx_tuple__71); Py_CLEAR(clear_module_state->__pyx_tuple__73); Py_CLEAR(clear_module_state->__pyx_tuple__75); Py_CLEAR(clear_module_state->__pyx_tuple__77); Py_CLEAR(clear_module_state->__pyx_tuple__79); Py_CLEAR(clear_module_state->__pyx_codeobj__5); Py_CLEAR(clear_module_state->__pyx_codeobj__6); Py_CLEAR(clear_module_state->__pyx_codeobj__8); Py_CLEAR(clear_module_state->__pyx_codeobj__20); Py_CLEAR(clear_module_state->__pyx_codeobj__22); Py_CLEAR(clear_module_state->__pyx_codeobj__23); Py_CLEAR(clear_module_state->__pyx_codeobj__25); Py_CLEAR(clear_module_state->__pyx_codeobj__26); Py_CLEAR(clear_module_state->__pyx_codeobj__27); Py_CLEAR(clear_module_state->__pyx_codeobj__29); Py_CLEAR(clear_module_state->__pyx_codeobj__30); Py_CLEAR(clear_module_state->__pyx_codeobj__32); Py_CLEAR(clear_module_state->__pyx_codeobj__35); Py_CLEAR(clear_module_state->__pyx_codeobj__40); Py_CLEAR(clear_module_state->__pyx_codeobj__42); Py_CLEAR(clear_module_state->__pyx_codeobj__44); Py_CLEAR(clear_module_state->__pyx_codeobj__46); Py_CLEAR(clear_module_state->__pyx_codeobj__47); Py_CLEAR(clear_module_state->__pyx_codeobj__48); Py_CLEAR(clear_module_state->__pyx_codeobj__49); Py_CLEAR(clear_module_state->__pyx_codeobj__50); Py_CLEAR(clear_module_state->__pyx_codeobj__51); Py_CLEAR(clear_module_state->__pyx_codeobj__53); Py_CLEAR(clear_module_state->__pyx_codeobj__55); Py_CLEAR(clear_module_state->__pyx_codeobj__56); Py_CLEAR(clear_module_state->__pyx_codeobj__58); Py_CLEAR(clear_module_state->__pyx_codeobj__60); Py_CLEAR(clear_module_state->__pyx_codeobj__62); Py_CLEAR(clear_module_state->__pyx_codeobj__64); Py_CLEAR(clear_module_state->__pyx_codeobj__66); Py_CLEAR(clear_module_state->__pyx_codeobj__68); Py_CLEAR(clear_module_state->__pyx_codeobj__70); Py_CLEAR(clear_module_state->__pyx_codeobj__72); Py_CLEAR(clear_module_state->__pyx_codeobj__74); Py_CLEAR(clear_module_state->__pyx_codeobj__76); Py_CLEAR(clear_module_state->__pyx_codeobj__78); Py_CLEAR(clear_module_state->__pyx_codeobj__80); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_4borg_4item___pyx_scope_struct___make_property); Py_VISIT(traverse_module_state->__pyx_type_4borg_4item___pyx_scope_struct___make_property); Py_VISIT(traverse_module_state->__pyx_ptype_4borg_4item___pyx_scope_struct_1_get_size); Py_VISIT(traverse_module_state->__pyx_type_4borg_4item___pyx_scope_struct_1_get_size); Py_VISIT(traverse_module_state->__pyx_ptype_4borg_4item___pyx_scope_struct_2_genexpr); Py_VISIT(traverse_module_state->__pyx_type_4borg_4item___pyx_scope_struct_2_genexpr); Py_VISIT(traverse_module_state->__pyx_ptype_4borg_4item___pyx_scope_struct_3_genexpr); Py_VISIT(traverse_module_state->__pyx_type_4borg_4item___pyx_scope_struct_3_genexpr); Py_VISIT(traverse_module_state->__pyx_ptype_4borg_4item___pyx_scope_struct_4_genexpr); Py_VISIT(traverse_module_state->__pyx_type_4borg_4item___pyx_scope_struct_4_genexpr); Py_VISIT(traverse_module_state->__pyx_ptype_4borg_4item___pyx_scope_struct_5_genexpr); Py_VISIT(traverse_module_state->__pyx_type_4borg_4item___pyx_scope_struct_5_genexpr); Py_VISIT(traverse_module_state->__pyx_ptype_4borg_4item___pyx_scope_struct_6_genexpr); Py_VISIT(traverse_module_state->__pyx_type_4borg_4item___pyx_scope_struct_6_genexpr); Py_VISIT(traverse_module_state->__pyx_kp_s_1_4_01); Py_VISIT(traverse_module_state->__pyx_kp_s_9_9); Py_VISIT(traverse_module_state->__pyx_n_s_API_VERSION); Py_VISIT(traverse_module_state->__pyx_n_s_ARCHIVE_KEYS); Py_VISIT(traverse_module_state->__pyx_n_s_ArchiveItem); Py_VISIT(traverse_module_state->__pyx_kp_s_ArchiveItem_abstraction_that_de); Py_VISIT(traverse_module_state->__pyx_n_s_AssertionError); Py_VISIT(traverse_module_state->__pyx_n_s_AttributeError); Py_VISIT(traverse_module_state->__pyx_kp_s_Can_t_store_size_when_considerin); Py_VISIT(traverse_module_state->__pyx_n_s_ChunkListEntry); Py_VISIT(traverse_module_state->__pyx_kp_s_Comparison_of_two_items_from_di); Py_VISIT(traverse_module_state->__pyx_n_s_EncryptedKey); Py_VISIT(traverse_module_state->__pyx_kp_s_EncryptedKey_abstraction_that_d); Py_VISIT(traverse_module_state->__pyx_n_s_ITEM_KEYS); Py_VISIT(traverse_module_state->__pyx_n_s_Item); Py_VISIT(traverse_module_state->__pyx_n_s_ItemDiff); Py_VISIT(traverse_module_state->__pyx_n_s_ItemDiff___init); Py_VISIT(traverse_module_state->__pyx_n_s_ItemDiff___repr); Py_VISIT(traverse_module_state->__pyx_n_s_ItemDiff___repr___locals_genexpr); Py_VISIT(traverse_module_state->__pyx_n_s_ItemDiff__content_diff); Py_VISIT(traverse_module_state->__pyx_n_s_ItemDiff__content_equal); Py_VISIT(traverse_module_state->__pyx_n_s_ItemDiff__equal); Py_VISIT(traverse_module_state->__pyx_n_s_ItemDiff__link_diff); Py_VISIT(traverse_module_state->__pyx_n_s_ItemDiff__mode_diff); Py_VISIT(traverse_module_state->__pyx_n_s_ItemDiff__owner_diff); Py_VISIT(traverse_module_state->__pyx_n_s_ItemDiff__presence_diff); Py_VISIT(traverse_module_state->__pyx_n_s_ItemDiff__time_diffs); Py_VISIT(traverse_module_state->__pyx_n_s_ItemDiff_changes); Py_VISIT(traverse_module_state->__pyx_n_s_Item__is_type); Py_VISIT(traverse_module_state->__pyx_kp_s_Item_abstraction_that_deals_wit); Py_VISIT(traverse_module_state->__pyx_n_s_Item_create_deleted); Py_VISIT(traverse_module_state->__pyx_kp_s_Item_does_not_have_a_csize_field); Py_VISIT(traverse_module_state->__pyx_n_s_Item_from_optr); Py_VISIT(traverse_module_state->__pyx_n_s_Item_get_size); Py_VISIT(traverse_module_state->__pyx_n_s_Item_get_size_locals_genexpr); Py_VISIT(traverse_module_state->__pyx_n_s_Item_is_blk); Py_VISIT(traverse_module_state->__pyx_n_s_Item_is_chr); Py_VISIT(traverse_module_state->__pyx_n_s_Item_is_dir); Py_VISIT(traverse_module_state->__pyx_n_s_Item_is_fifo); Py_VISIT(traverse_module_state->__pyx_n_s_Item_is_link); Py_VISIT(traverse_module_state->__pyx_n_s_Item_to_optr); Py_VISIT(traverse_module_state->__pyx_n_s_Key); Py_VISIT(traverse_module_state->__pyx_n_s_KeyError); Py_VISIT(traverse_module_state->__pyx_kp_s_Key_abstraction_that_deals_with); Py_VISIT(traverse_module_state->__pyx_kp_s_Manage_a_dictionary_via_propert); Py_VISIT(traverse_module_state->__pyx_n_s_ManifestItem); Py_VISIT(traverse_module_state->__pyx_kp_s_ManifestItem_abstraction_that_d); Py_VISIT(traverse_module_state->__pyx_n_s_OutputTimestamp); Py_VISIT(traverse_module_state->__pyx_n_s_PropDict); Py_VISIT(traverse_module_state->__pyx_n_s_PropDict___contains); Py_VISIT(traverse_module_state->__pyx_n_s_PropDict___eq); Py_VISIT(traverse_module_state->__pyx_n_s_PropDict___init); Py_VISIT(traverse_module_state->__pyx_n_s_PropDict___repr); Py_VISIT(traverse_module_state->__pyx_n_s_PropDict__check_key); Py_VISIT(traverse_module_state->__pyx_n_s_PropDict__make_property); Py_VISIT(traverse_module_state->__pyx_n_s_PropDict__make_property_locals); Py_VISIT(traverse_module_state->__pyx_n_s_PropDict__make_property_locals_2); Py_VISIT(traverse_module_state->__pyx_n_s_PropDict__make_property_locals_3); Py_VISIT(traverse_module_state->__pyx_n_s_PropDict_as_dict); Py_VISIT(traverse_module_state->__pyx_n_s_PropDict_get); Py_VISIT(traverse_module_state->__pyx_n_s_PropDict_update); Py_VISIT(traverse_module_state->__pyx_n_s_PropDict_update_internal); Py_VISIT(traverse_module_state->__pyx_n_s_S_ISBLK); Py_VISIT(traverse_module_state->__pyx_n_s_S_ISCHR); Py_VISIT(traverse_module_state->__pyx_n_s_S_ISDIR); Py_VISIT(traverse_module_state->__pyx_n_s_S_ISFIFO); Py_VISIT(traverse_module_state->__pyx_n_s_S_ISLNK); Py_VISIT(traverse_module_state->__pyx_n_s_StableDict); Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); Py_VISIT(traverse_module_state->__pyx_n_s_VALID_KEYS); Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); Py_VISIT(traverse_module_state->__pyx_kp_s__10); Py_VISIT(traverse_module_state->__pyx_kp_s__13); Py_VISIT(traverse_module_state->__pyx_kp_s__14); Py_VISIT(traverse_module_state->__pyx_kp_s__15); Py_VISIT(traverse_module_state->__pyx_n_s__16); Py_VISIT(traverse_module_state->__pyx_kp_u__17); Py_VISIT(traverse_module_state->__pyx_n_s__38); Py_VISIT(traverse_module_state->__pyx_n_s__81); Py_VISIT(traverse_module_state->__pyx_n_s_a); Py_VISIT(traverse_module_state->__pyx_n_s_acl_access); Py_VISIT(traverse_module_state->__pyx_n_s_acl_default); Py_VISIT(traverse_module_state->__pyx_n_s_acl_extended); Py_VISIT(traverse_module_state->__pyx_n_s_acl_nfs4); Py_VISIT(traverse_module_state->__pyx_kp_s_added); Py_VISIT(traverse_module_state->__pyx_kp_s_added_13); Py_VISIT(traverse_module_state->__pyx_n_s_added_2); Py_VISIT(traverse_module_state->__pyx_n_s_added_ids); Py_VISIT(traverse_module_state->__pyx_n_s_ai); Py_VISIT(traverse_module_state->__pyx_n_s_alen); Py_VISIT(traverse_module_state->__pyx_n_s_algorithm); Py_VISIT(traverse_module_state->__pyx_n_s_archives); Py_VISIT(traverse_module_state->__pyx_n_s_args); Py_VISIT(traverse_module_state->__pyx_n_s_as_dict); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_atime); Py_VISIT(traverse_module_state->__pyx_n_s_attr); Py_VISIT(traverse_module_state->__pyx_n_s_attr_error_msg); Py_VISIT(traverse_module_state->__pyx_n_s_attr_list); Py_VISIT(traverse_module_state->__pyx_kp_s_attribute_s_not_found); Py_VISIT(traverse_module_state->__pyx_n_s_attrs); Py_VISIT(traverse_module_state->__pyx_n_s_b); Py_VISIT(traverse_module_state->__pyx_n_s_bi); Py_VISIT(traverse_module_state->__pyx_n_s_bigint); Py_VISIT(traverse_module_state->__pyx_n_s_bigint_to_int); Py_VISIT(traverse_module_state->__pyx_n_s_birthtime); Py_VISIT(traverse_module_state->__pyx_n_s_blen); Py_VISIT(traverse_module_state->__pyx_n_s_blkdev); Py_VISIT(traverse_module_state->__pyx_n_s_borg_item); Py_VISIT(traverse_module_state->__pyx_n_s_bsdflags); Py_VISIT(traverse_module_state->__pyx_n_s_c); Py_VISIT(traverse_module_state->__pyx_n_s_can_compare_chunk_ids); Py_VISIT(traverse_module_state->__pyx_n_s_can_compare_chunk_ids_2); Py_VISIT(traverse_module_state->__pyx_n_s_ch); Py_VISIT(traverse_module_state->__pyx_kp_s_changed_link); Py_VISIT(traverse_module_state->__pyx_n_s_changes); Py_VISIT(traverse_module_state->__pyx_n_s_changes_2); Py_VISIT(traverse_module_state->__pyx_n_s_check_key); Py_VISIT(traverse_module_state->__pyx_n_s_chg); Py_VISIT(traverse_module_state->__pyx_n_s_chrdev); Py_VISIT(traverse_module_state->__pyx_n_s_chunk_ids1); Py_VISIT(traverse_module_state->__pyx_n_s_chunk_ids2); Py_VISIT(traverse_module_state->__pyx_n_s_chunk_iterator1); Py_VISIT(traverse_module_state->__pyx_n_s_chunk_iterator2); Py_VISIT(traverse_module_state->__pyx_n_s_chunk_seed); Py_VISIT(traverse_module_state->__pyx_n_s_chunker_params); Py_VISIT(traverse_module_state->__pyx_kp_s_chunker_params_tuple); Py_VISIT(traverse_module_state->__pyx_n_s_chunks); Py_VISIT(traverse_module_state->__pyx_n_s_chunks1); Py_VISIT(traverse_module_state->__pyx_n_s_chunks2); Py_VISIT(traverse_module_state->__pyx_n_s_chunks_contents_equal); Py_VISIT(traverse_module_state->__pyx_n_s_chunks_healthy); Py_VISIT(traverse_module_state->__pyx_n_s_class); Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_close); Py_VISIT(traverse_module_state->__pyx_n_s_cls); Py_VISIT(traverse_module_state->__pyx_n_s_cmdline); Py_VISIT(traverse_module_state->__pyx_n_s_collections); Py_VISIT(traverse_module_state->__pyx_n_s_comment); Py_VISIT(traverse_module_state->__pyx_n_s_compressed); Py_VISIT(traverse_module_state->__pyx_n_s_config); Py_VISIT(traverse_module_state->__pyx_n_s_consider_ids); Py_VISIT(traverse_module_state->__pyx_n_s_constants); Py_VISIT(traverse_module_state->__pyx_n_s_contains); Py_VISIT(traverse_module_state->__pyx_n_s_content_diff); Py_VISIT(traverse_module_state->__pyx_n_s_content_equal); Py_VISIT(traverse_module_state->__pyx_n_s_content_only); Py_VISIT(traverse_module_state->__pyx_n_s_content_only_2); Py_VISIT(traverse_module_state->__pyx_n_s_create_deleted); Py_VISIT(traverse_module_state->__pyx_n_s_csize); Py_VISIT(traverse_module_state->__pyx_n_s_csize_parts); Py_VISIT(traverse_module_state->__pyx_n_s_ctime); Py_VISIT(traverse_module_state->__pyx_n_s_d); Py_VISIT(traverse_module_state->__pyx_n_s_data); Py_VISIT(traverse_module_state->__pyx_n_s_data_dict); Py_VISIT(traverse_module_state->__pyx_kp_s_data_dict_must_be_a_dict); Py_VISIT(traverse_module_state->__pyx_n_s_decode); Py_VISIT(traverse_module_state->__pyx_n_s_default); Py_VISIT(traverse_module_state->__pyx_n_s_del); Py_VISIT(traverse_module_state->__pyx_n_s_deleted); Py_VISIT(traverse_module_state->__pyx_n_s_dict); Py_VISIT(traverse_module_state->__pyx_n_s_dict_2); Py_VISIT(traverse_module_state->__pyx_n_s_directory); Py_VISIT(traverse_module_state->__pyx_kp_u_disable); Py_VISIT(traverse_module_state->__pyx_n_s_doc); Py_VISIT(traverse_module_state->__pyx_n_s_doc_2); Py_VISIT(traverse_module_state->__pyx_kp_u_enable); Py_VISIT(traverse_module_state->__pyx_n_s_enc_hmac_key); Py_VISIT(traverse_module_state->__pyx_n_s_enc_key); Py_VISIT(traverse_module_state->__pyx_n_s_encode); Py_VISIT(traverse_module_state->__pyx_n_s_end); Py_VISIT(traverse_module_state->__pyx_n_s_eq); Py_VISIT(traverse_module_state->__pyx_n_s_equal); Py_VISIT(traverse_module_state->__pyx_n_s_equal_2); Py_VISIT(traverse_module_state->__pyx_n_s_fifo); Py_VISIT(traverse_module_state->__pyx_n_s_filemode); Py_VISIT(traverse_module_state->__pyx_n_s_format); Py_VISIT(traverse_module_state->__pyx_n_s_format_file_size); Py_VISIT(traverse_module_state->__pyx_n_s_from_chunks); Py_VISIT(traverse_module_state->__pyx_n_s_from_optr); Py_VISIT(traverse_module_state->__pyx_n_s_g1); Py_VISIT(traverse_module_state->__pyx_n_s_g2); Py_VISIT(traverse_module_state->__pyx_n_s_g_attr); Py_VISIT(traverse_module_state->__pyx_kp_u_gc); Py_VISIT(traverse_module_state->__pyx_n_s_genexpr); Py_VISIT(traverse_module_state->__pyx_n_s_get); Py_VISIT(traverse_module_state->__pyx_n_s_get_2); Py_VISIT(traverse_module_state->__pyx_n_s_get_size); Py_VISIT(traverse_module_state->__pyx_n_s_gid); Py_VISIT(traverse_module_state->__pyx_n_s_group); Py_VISIT(traverse_module_state->__pyx_n_s_hardlink_master); Py_VISIT(traverse_module_state->__pyx_n_s_hardlink_masters); Py_VISIT(traverse_module_state->__pyx_n_s_hash); Py_VISIT(traverse_module_state->__pyx_n_s_having_chunks); Py_VISIT(traverse_module_state->__pyx_n_s_helpers); Py_VISIT(traverse_module_state->__pyx_n_s_helpers_time); Py_VISIT(traverse_module_state->__pyx_n_s_hostname); Py_VISIT(traverse_module_state->__pyx_n_s_id); Py_VISIT(traverse_module_state->__pyx_n_s_id_key); Py_VISIT(traverse_module_state->__pyx_kp_s_id_size_csize); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_init); Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_int_to_bigint); Py_VISIT(traverse_module_state->__pyx_n_s_internal_dict); Py_VISIT(traverse_module_state->__pyx_kp_s_internal_dict_must_be_a_dict); Py_VISIT(traverse_module_state->__pyx_n_s_is_blk); Py_VISIT(traverse_module_state->__pyx_n_s_is_chr); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_n_s_is_dir); Py_VISIT(traverse_module_state->__pyx_n_s_is_fifo); Py_VISIT(traverse_module_state->__pyx_n_s_is_link); Py_VISIT(traverse_module_state->__pyx_n_s_is_type); Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); Py_VISIT(traverse_module_state->__pyx_n_s_item1); Py_VISIT(traverse_module_state->__pyx_n_s_item1_2); Py_VISIT(traverse_module_state->__pyx_n_s_item2); Py_VISIT(traverse_module_state->__pyx_n_s_item2_2); Py_VISIT(traverse_module_state->__pyx_n_s_item_keys); Py_VISIT(traverse_module_state->__pyx_n_s_item_type); Py_VISIT(traverse_module_state->__pyx_n_s_items); Py_VISIT(traverse_module_state->__pyx_n_s_iterations); Py_VISIT(traverse_module_state->__pyx_n_s_join); Py_VISIT(traverse_module_state->__pyx_n_s_k); Py_VISIT(traverse_module_state->__pyx_n_s_key); Py_VISIT(traverse_module_state->__pyx_kp_s_key_must_be_str); Py_VISIT(traverse_module_state->__pyx_kp_s_key_s_is_not_a_valid_key); Py_VISIT(traverse_module_state->__pyx_n_s_kw); Py_VISIT(traverse_module_state->__pyx_n_s_link); Py_VISIT(traverse_module_state->__pyx_n_s_link_diff); Py_VISIT(traverse_module_state->__pyx_kp_s_list_or_None); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_make_property); Py_VISIT(traverse_module_state->__pyx_n_s_master); Py_VISIT(traverse_module_state->__pyx_n_s_memorize); Py_VISIT(traverse_module_state->__pyx_n_s_metaclass); Py_VISIT(traverse_module_state->__pyx_n_s_mode); Py_VISIT(traverse_module_state->__pyx_n_s_mode1); Py_VISIT(traverse_module_state->__pyx_n_s_mode2); Py_VISIT(traverse_module_state->__pyx_n_s_mode_diff); Py_VISIT(traverse_module_state->__pyx_n_s_modified); Py_VISIT(traverse_module_state->__pyx_n_s_module); Py_VISIT(traverse_module_state->__pyx_n_s_mro_entries); Py_VISIT(traverse_module_state->__pyx_n_s_mtime); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_name_2); Py_VISIT(traverse_module_state->__pyx_n_s_namedtuple); Py_VISIT(traverse_module_state->__pyx_n_u_new); Py_VISIT(traverse_module_state->__pyx_n_s_new_group); Py_VISIT(traverse_module_state->__pyx_n_s_new_mode); Py_VISIT(traverse_module_state->__pyx_n_s_new_user); Py_VISIT(traverse_module_state->__pyx_n_s_nfiles); Py_VISIT(traverse_module_state->__pyx_n_s_nfiles_parts); Py_VISIT(traverse_module_state->__pyx_n_s_nlink); Py_VISIT(traverse_module_state->__pyx_n_s_numeric_ids); Py_VISIT(traverse_module_state->__pyx_n_s_numeric_ids_2); Py_VISIT(traverse_module_state->__pyx_n_s_object); Py_VISIT(traverse_module_state->__pyx_n_u_old); Py_VISIT(traverse_module_state->__pyx_n_s_old_group); Py_VISIT(traverse_module_state->__pyx_n_s_old_mode); Py_VISIT(traverse_module_state->__pyx_n_s_old_user); Py_VISIT(traverse_module_state->__pyx_n_s_optr); Py_VISIT(traverse_module_state->__pyx_n_s_other); Py_VISIT(traverse_module_state->__pyx_n_s_owner); Py_VISIT(traverse_module_state->__pyx_n_s_owner_diff); Py_VISIT(traverse_module_state->__pyx_n_s_part); Py_VISIT(traverse_module_state->__pyx_n_s_path); Py_VISIT(traverse_module_state->__pyx_n_s_pd); Py_VISIT(traverse_module_state->__pyx_n_s_precision); Py_VISIT(traverse_module_state->__pyx_n_s_prepare); Py_VISIT(traverse_module_state->__pyx_n_s_presence_diff); Py_VISIT(traverse_module_state->__pyx_n_s_property); Py_VISIT(traverse_module_state->__pyx_n_s_qualname); Py_VISIT(traverse_module_state->__pyx_n_s_rdev); Py_VISIT(traverse_module_state->__pyx_n_s_recreate_args); Py_VISIT(traverse_module_state->__pyx_n_s_recreate_cmdline); Py_VISIT(traverse_module_state->__pyx_n_s_recreate_partial_chunks); Py_VISIT(traverse_module_state->__pyx_n_s_recreate_source_id); Py_VISIT(traverse_module_state->__pyx_kp_s_removed); Py_VISIT(traverse_module_state->__pyx_kp_s_removed_11); Py_VISIT(traverse_module_state->__pyx_n_s_removed_2); Py_VISIT(traverse_module_state->__pyx_n_s_removed_ids); Py_VISIT(traverse_module_state->__pyx_n_s_repository_id); Py_VISIT(traverse_module_state->__pyx_n_s_repr); Py_VISIT(traverse_module_state->__pyx_kp_s_s_internal_dict_r); Py_VISIT(traverse_module_state->__pyx_kp_s_s_s); Py_VISIT(traverse_module_state->__pyx_kp_s_s_value_must_be_s); Py_VISIT(traverse_module_state->__pyx_n_s_safe_decode); Py_VISIT(traverse_module_state->__pyx_n_s_safe_encode); Py_VISIT(traverse_module_state->__pyx_n_s_safe_timestamp); Py_VISIT(traverse_module_state->__pyx_n_s_salt); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_n_s_send); Py_VISIT(traverse_module_state->__pyx_n_s_set); Py_VISIT(traverse_module_state->__pyx_n_s_set_name); Py_VISIT(traverse_module_state->__pyx_n_s_sign); Py_VISIT(traverse_module_state->__pyx_n_s_size); Py_VISIT(traverse_module_state->__pyx_n_s_size_parts); Py_VISIT(traverse_module_state->__pyx_n_s_slicelen); Py_VISIT(traverse_module_state->__pyx_n_s_slots); Py_VISIT(traverse_module_state->__pyx_n_s_source); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_kp_s_src_borg_item_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_stat); Py_VISIT(traverse_module_state->__pyx_n_s_staticmethod); Py_VISIT(traverse_module_state->__pyx_n_s_sum); Py_VISIT(traverse_module_state->__pyx_n_s_super); Py_VISIT(traverse_module_state->__pyx_kp_s_surrogate_escaped_str); Py_VISIT(traverse_module_state->__pyx_kp_s_surrogate_escaped_str_or_None); Py_VISIT(traverse_module_state->__pyx_n_s_sz); Py_VISIT(traverse_module_state->__pyx_n_s_t); Py_VISIT(traverse_module_state->__pyx_n_s_tam_required); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_throw); Py_VISIT(traverse_module_state->__pyx_n_s_time); Py_VISIT(traverse_module_state->__pyx_n_s_time_diffs); Py_VISIT(traverse_module_state->__pyx_n_s_time_end); Py_VISIT(traverse_module_state->__pyx_n_s_timestamp); Py_VISIT(traverse_module_state->__pyx_n_s_to_optr); Py_VISIT(traverse_module_state->__pyx_n_s_ts1); Py_VISIT(traverse_module_state->__pyx_n_s_ts2); Py_VISIT(traverse_module_state->__pyx_n_s_tuple_decode); Py_VISIT(traverse_module_state->__pyx_n_s_tuple_decode_locals_genexpr); Py_VISIT(traverse_module_state->__pyx_n_s_tuple_encode); Py_VISIT(traverse_module_state->__pyx_n_s_tuple_encode_locals_genexpr); Py_VISIT(traverse_module_state->__pyx_n_s_type); Py_VISIT(traverse_module_state->__pyx_n_s_type_error_msg); Py_VISIT(traverse_module_state->__pyx_n_s_typetest); Py_VISIT(traverse_module_state->__pyx_n_s_u1); Py_VISIT(traverse_module_state->__pyx_n_s_u2); Py_VISIT(traverse_module_state->__pyx_n_s_u_attr); Py_VISIT(traverse_module_state->__pyx_n_s_uid); Py_VISIT(traverse_module_state->__pyx_n_s_update); Py_VISIT(traverse_module_state->__pyx_n_s_update_internal); Py_VISIT(traverse_module_state->__pyx_n_s_user); Py_VISIT(traverse_module_state->__pyx_n_s_username); Py_VISIT(traverse_module_state->__pyx_n_s_v); Py_VISIT(traverse_module_state->__pyx_n_s_value); Py_VISIT(traverse_module_state->__pyx_n_s_value_type); Py_VISIT(traverse_module_state->__pyx_n_s_value_type_name); Py_VISIT(traverse_module_state->__pyx_n_s_version); Py_VISIT(traverse_module_state->__pyx_n_s_xattrs); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_int_1); Py_VISIT(traverse_module_state->__pyx_tuple_); Py_VISIT(traverse_module_state->__pyx_tuple__2); Py_VISIT(traverse_module_state->__pyx_tuple__3); Py_VISIT(traverse_module_state->__pyx_tuple__4); Py_VISIT(traverse_module_state->__pyx_tuple__7); Py_VISIT(traverse_module_state->__pyx_tuple__9); Py_VISIT(traverse_module_state->__pyx_tuple__11); Py_VISIT(traverse_module_state->__pyx_tuple__12); Py_VISIT(traverse_module_state->__pyx_tuple__18); Py_VISIT(traverse_module_state->__pyx_tuple__19); Py_VISIT(traverse_module_state->__pyx_tuple__21); Py_VISIT(traverse_module_state->__pyx_tuple__24); Py_VISIT(traverse_module_state->__pyx_tuple__28); Py_VISIT(traverse_module_state->__pyx_tuple__31); Py_VISIT(traverse_module_state->__pyx_tuple__33); Py_VISIT(traverse_module_state->__pyx_tuple__34); Py_VISIT(traverse_module_state->__pyx_tuple__36); Py_VISIT(traverse_module_state->__pyx_tuple__37); Py_VISIT(traverse_module_state->__pyx_tuple__39); Py_VISIT(traverse_module_state->__pyx_tuple__41); Py_VISIT(traverse_module_state->__pyx_tuple__43); Py_VISIT(traverse_module_state->__pyx_tuple__45); Py_VISIT(traverse_module_state->__pyx_tuple__52); Py_VISIT(traverse_module_state->__pyx_tuple__54); Py_VISIT(traverse_module_state->__pyx_tuple__57); Py_VISIT(traverse_module_state->__pyx_tuple__59); Py_VISIT(traverse_module_state->__pyx_tuple__61); Py_VISIT(traverse_module_state->__pyx_tuple__63); Py_VISIT(traverse_module_state->__pyx_tuple__65); Py_VISIT(traverse_module_state->__pyx_tuple__67); Py_VISIT(traverse_module_state->__pyx_tuple__69); Py_VISIT(traverse_module_state->__pyx_tuple__71); Py_VISIT(traverse_module_state->__pyx_tuple__73); Py_VISIT(traverse_module_state->__pyx_tuple__75); Py_VISIT(traverse_module_state->__pyx_tuple__77); Py_VISIT(traverse_module_state->__pyx_tuple__79); Py_VISIT(traverse_module_state->__pyx_codeobj__5); Py_VISIT(traverse_module_state->__pyx_codeobj__6); Py_VISIT(traverse_module_state->__pyx_codeobj__8); Py_VISIT(traverse_module_state->__pyx_codeobj__20); Py_VISIT(traverse_module_state->__pyx_codeobj__22); Py_VISIT(traverse_module_state->__pyx_codeobj__23); Py_VISIT(traverse_module_state->__pyx_codeobj__25); Py_VISIT(traverse_module_state->__pyx_codeobj__26); Py_VISIT(traverse_module_state->__pyx_codeobj__27); Py_VISIT(traverse_module_state->__pyx_codeobj__29); Py_VISIT(traverse_module_state->__pyx_codeobj__30); Py_VISIT(traverse_module_state->__pyx_codeobj__32); Py_VISIT(traverse_module_state->__pyx_codeobj__35); Py_VISIT(traverse_module_state->__pyx_codeobj__40); Py_VISIT(traverse_module_state->__pyx_codeobj__42); Py_VISIT(traverse_module_state->__pyx_codeobj__44); Py_VISIT(traverse_module_state->__pyx_codeobj__46); Py_VISIT(traverse_module_state->__pyx_codeobj__47); Py_VISIT(traverse_module_state->__pyx_codeobj__48); Py_VISIT(traverse_module_state->__pyx_codeobj__49); Py_VISIT(traverse_module_state->__pyx_codeobj__50); Py_VISIT(traverse_module_state->__pyx_codeobj__51); Py_VISIT(traverse_module_state->__pyx_codeobj__53); Py_VISIT(traverse_module_state->__pyx_codeobj__55); Py_VISIT(traverse_module_state->__pyx_codeobj__56); Py_VISIT(traverse_module_state->__pyx_codeobj__58); Py_VISIT(traverse_module_state->__pyx_codeobj__60); Py_VISIT(traverse_module_state->__pyx_codeobj__62); Py_VISIT(traverse_module_state->__pyx_codeobj__64); Py_VISIT(traverse_module_state->__pyx_codeobj__66); Py_VISIT(traverse_module_state->__pyx_codeobj__68); Py_VISIT(traverse_module_state->__pyx_codeobj__70); Py_VISIT(traverse_module_state->__pyx_codeobj__72); Py_VISIT(traverse_module_state->__pyx_codeobj__74); Py_VISIT(traverse_module_state->__pyx_codeobj__76); Py_VISIT(traverse_module_state->__pyx_codeobj__78); Py_VISIT(traverse_module_state->__pyx_codeobj__80); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #define __pyx_type_4borg_4item___pyx_scope_struct___make_property __pyx_mstate_global->__pyx_type_4borg_4item___pyx_scope_struct___make_property #define __pyx_type_4borg_4item___pyx_scope_struct_1_get_size __pyx_mstate_global->__pyx_type_4borg_4item___pyx_scope_struct_1_get_size #define __pyx_type_4borg_4item___pyx_scope_struct_2_genexpr __pyx_mstate_global->__pyx_type_4borg_4item___pyx_scope_struct_2_genexpr #define __pyx_type_4borg_4item___pyx_scope_struct_3_genexpr __pyx_mstate_global->__pyx_type_4borg_4item___pyx_scope_struct_3_genexpr #define __pyx_type_4borg_4item___pyx_scope_struct_4_genexpr __pyx_mstate_global->__pyx_type_4borg_4item___pyx_scope_struct_4_genexpr #define __pyx_type_4borg_4item___pyx_scope_struct_5_genexpr __pyx_mstate_global->__pyx_type_4borg_4item___pyx_scope_struct_5_genexpr #define __pyx_type_4borg_4item___pyx_scope_struct_6_genexpr __pyx_mstate_global->__pyx_type_4borg_4item___pyx_scope_struct_6_genexpr #endif #define __pyx_ptype_4borg_4item___pyx_scope_struct___make_property __pyx_mstate_global->__pyx_ptype_4borg_4item___pyx_scope_struct___make_property #define __pyx_ptype_4borg_4item___pyx_scope_struct_1_get_size __pyx_mstate_global->__pyx_ptype_4borg_4item___pyx_scope_struct_1_get_size #define __pyx_ptype_4borg_4item___pyx_scope_struct_2_genexpr __pyx_mstate_global->__pyx_ptype_4borg_4item___pyx_scope_struct_2_genexpr #define __pyx_ptype_4borg_4item___pyx_scope_struct_3_genexpr __pyx_mstate_global->__pyx_ptype_4borg_4item___pyx_scope_struct_3_genexpr #define __pyx_ptype_4borg_4item___pyx_scope_struct_4_genexpr __pyx_mstate_global->__pyx_ptype_4borg_4item___pyx_scope_struct_4_genexpr #define __pyx_ptype_4borg_4item___pyx_scope_struct_5_genexpr __pyx_mstate_global->__pyx_ptype_4borg_4item___pyx_scope_struct_5_genexpr #define __pyx_ptype_4borg_4item___pyx_scope_struct_6_genexpr __pyx_mstate_global->__pyx_ptype_4borg_4item___pyx_scope_struct_6_genexpr #define __pyx_kp_s_1_4_01 __pyx_mstate_global->__pyx_kp_s_1_4_01 #define __pyx_kp_s_9_9 __pyx_mstate_global->__pyx_kp_s_9_9 #define __pyx_n_s_API_VERSION __pyx_mstate_global->__pyx_n_s_API_VERSION #define __pyx_n_s_ARCHIVE_KEYS __pyx_mstate_global->__pyx_n_s_ARCHIVE_KEYS #define __pyx_n_s_ArchiveItem __pyx_mstate_global->__pyx_n_s_ArchiveItem #define __pyx_kp_s_ArchiveItem_abstraction_that_de __pyx_mstate_global->__pyx_kp_s_ArchiveItem_abstraction_that_de #define __pyx_n_s_AssertionError __pyx_mstate_global->__pyx_n_s_AssertionError #define __pyx_n_s_AttributeError __pyx_mstate_global->__pyx_n_s_AttributeError #define __pyx_kp_s_Can_t_store_size_when_considerin __pyx_mstate_global->__pyx_kp_s_Can_t_store_size_when_considerin #define __pyx_n_s_ChunkListEntry __pyx_mstate_global->__pyx_n_s_ChunkListEntry #define __pyx_kp_s_Comparison_of_two_items_from_di __pyx_mstate_global->__pyx_kp_s_Comparison_of_two_items_from_di #define __pyx_n_s_EncryptedKey __pyx_mstate_global->__pyx_n_s_EncryptedKey #define __pyx_kp_s_EncryptedKey_abstraction_that_d __pyx_mstate_global->__pyx_kp_s_EncryptedKey_abstraction_that_d #define __pyx_n_s_ITEM_KEYS __pyx_mstate_global->__pyx_n_s_ITEM_KEYS #define __pyx_n_s_Item __pyx_mstate_global->__pyx_n_s_Item #define __pyx_n_s_ItemDiff __pyx_mstate_global->__pyx_n_s_ItemDiff #define __pyx_n_s_ItemDiff___init __pyx_mstate_global->__pyx_n_s_ItemDiff___init #define __pyx_n_s_ItemDiff___repr __pyx_mstate_global->__pyx_n_s_ItemDiff___repr #define __pyx_n_s_ItemDiff___repr___locals_genexpr __pyx_mstate_global->__pyx_n_s_ItemDiff___repr___locals_genexpr #define __pyx_n_s_ItemDiff__content_diff __pyx_mstate_global->__pyx_n_s_ItemDiff__content_diff #define __pyx_n_s_ItemDiff__content_equal __pyx_mstate_global->__pyx_n_s_ItemDiff__content_equal #define __pyx_n_s_ItemDiff__equal __pyx_mstate_global->__pyx_n_s_ItemDiff__equal #define __pyx_n_s_ItemDiff__link_diff __pyx_mstate_global->__pyx_n_s_ItemDiff__link_diff #define __pyx_n_s_ItemDiff__mode_diff __pyx_mstate_global->__pyx_n_s_ItemDiff__mode_diff #define __pyx_n_s_ItemDiff__owner_diff __pyx_mstate_global->__pyx_n_s_ItemDiff__owner_diff #define __pyx_n_s_ItemDiff__presence_diff __pyx_mstate_global->__pyx_n_s_ItemDiff__presence_diff #define __pyx_n_s_ItemDiff__time_diffs __pyx_mstate_global->__pyx_n_s_ItemDiff__time_diffs #define __pyx_n_s_ItemDiff_changes __pyx_mstate_global->__pyx_n_s_ItemDiff_changes #define __pyx_n_s_Item__is_type __pyx_mstate_global->__pyx_n_s_Item__is_type #define __pyx_kp_s_Item_abstraction_that_deals_wit __pyx_mstate_global->__pyx_kp_s_Item_abstraction_that_deals_wit #define __pyx_n_s_Item_create_deleted __pyx_mstate_global->__pyx_n_s_Item_create_deleted #define __pyx_kp_s_Item_does_not_have_a_csize_field __pyx_mstate_global->__pyx_kp_s_Item_does_not_have_a_csize_field #define __pyx_n_s_Item_from_optr __pyx_mstate_global->__pyx_n_s_Item_from_optr #define __pyx_n_s_Item_get_size __pyx_mstate_global->__pyx_n_s_Item_get_size #define __pyx_n_s_Item_get_size_locals_genexpr __pyx_mstate_global->__pyx_n_s_Item_get_size_locals_genexpr #define __pyx_n_s_Item_is_blk __pyx_mstate_global->__pyx_n_s_Item_is_blk #define __pyx_n_s_Item_is_chr __pyx_mstate_global->__pyx_n_s_Item_is_chr #define __pyx_n_s_Item_is_dir __pyx_mstate_global->__pyx_n_s_Item_is_dir #define __pyx_n_s_Item_is_fifo __pyx_mstate_global->__pyx_n_s_Item_is_fifo #define __pyx_n_s_Item_is_link __pyx_mstate_global->__pyx_n_s_Item_is_link #define __pyx_n_s_Item_to_optr __pyx_mstate_global->__pyx_n_s_Item_to_optr #define __pyx_n_s_Key __pyx_mstate_global->__pyx_n_s_Key #define __pyx_n_s_KeyError __pyx_mstate_global->__pyx_n_s_KeyError #define __pyx_kp_s_Key_abstraction_that_deals_with __pyx_mstate_global->__pyx_kp_s_Key_abstraction_that_deals_with #define __pyx_kp_s_Manage_a_dictionary_via_propert __pyx_mstate_global->__pyx_kp_s_Manage_a_dictionary_via_propert #define __pyx_n_s_ManifestItem __pyx_mstate_global->__pyx_n_s_ManifestItem #define __pyx_kp_s_ManifestItem_abstraction_that_d __pyx_mstate_global->__pyx_kp_s_ManifestItem_abstraction_that_d #define __pyx_n_s_OutputTimestamp __pyx_mstate_global->__pyx_n_s_OutputTimestamp #define __pyx_n_s_PropDict __pyx_mstate_global->__pyx_n_s_PropDict #define __pyx_n_s_PropDict___contains __pyx_mstate_global->__pyx_n_s_PropDict___contains #define __pyx_n_s_PropDict___eq __pyx_mstate_global->__pyx_n_s_PropDict___eq #define __pyx_n_s_PropDict___init __pyx_mstate_global->__pyx_n_s_PropDict___init #define __pyx_n_s_PropDict___repr __pyx_mstate_global->__pyx_n_s_PropDict___repr #define __pyx_n_s_PropDict__check_key __pyx_mstate_global->__pyx_n_s_PropDict__check_key #define __pyx_n_s_PropDict__make_property __pyx_mstate_global->__pyx_n_s_PropDict__make_property #define __pyx_n_s_PropDict__make_property_locals __pyx_mstate_global->__pyx_n_s_PropDict__make_property_locals #define __pyx_n_s_PropDict__make_property_locals_2 __pyx_mstate_global->__pyx_n_s_PropDict__make_property_locals_2 #define __pyx_n_s_PropDict__make_property_locals_3 __pyx_mstate_global->__pyx_n_s_PropDict__make_property_locals_3 #define __pyx_n_s_PropDict_as_dict __pyx_mstate_global->__pyx_n_s_PropDict_as_dict #define __pyx_n_s_PropDict_get __pyx_mstate_global->__pyx_n_s_PropDict_get #define __pyx_n_s_PropDict_update __pyx_mstate_global->__pyx_n_s_PropDict_update #define __pyx_n_s_PropDict_update_internal __pyx_mstate_global->__pyx_n_s_PropDict_update_internal #define __pyx_n_s_S_ISBLK __pyx_mstate_global->__pyx_n_s_S_ISBLK #define __pyx_n_s_S_ISCHR __pyx_mstate_global->__pyx_n_s_S_ISCHR #define __pyx_n_s_S_ISDIR __pyx_mstate_global->__pyx_n_s_S_ISDIR #define __pyx_n_s_S_ISFIFO __pyx_mstate_global->__pyx_n_s_S_ISFIFO #define __pyx_n_s_S_ISLNK __pyx_mstate_global->__pyx_n_s_S_ISLNK #define __pyx_n_s_StableDict __pyx_mstate_global->__pyx_n_s_StableDict #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError #define __pyx_n_s_VALID_KEYS __pyx_mstate_global->__pyx_n_s_VALID_KEYS #define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError #define __pyx_kp_s__10 __pyx_mstate_global->__pyx_kp_s__10 #define __pyx_kp_s__13 __pyx_mstate_global->__pyx_kp_s__13 #define __pyx_kp_s__14 __pyx_mstate_global->__pyx_kp_s__14 #define __pyx_kp_s__15 __pyx_mstate_global->__pyx_kp_s__15 #define __pyx_n_s__16 __pyx_mstate_global->__pyx_n_s__16 #define __pyx_kp_u__17 __pyx_mstate_global->__pyx_kp_u__17 #define __pyx_n_s__38 __pyx_mstate_global->__pyx_n_s__38 #define __pyx_n_s__81 __pyx_mstate_global->__pyx_n_s__81 #define __pyx_n_s_a __pyx_mstate_global->__pyx_n_s_a #define __pyx_n_s_acl_access __pyx_mstate_global->__pyx_n_s_acl_access #define __pyx_n_s_acl_default __pyx_mstate_global->__pyx_n_s_acl_default #define __pyx_n_s_acl_extended __pyx_mstate_global->__pyx_n_s_acl_extended #define __pyx_n_s_acl_nfs4 __pyx_mstate_global->__pyx_n_s_acl_nfs4 #define __pyx_kp_s_added __pyx_mstate_global->__pyx_kp_s_added #define __pyx_kp_s_added_13 __pyx_mstate_global->__pyx_kp_s_added_13 #define __pyx_n_s_added_2 __pyx_mstate_global->__pyx_n_s_added_2 #define __pyx_n_s_added_ids __pyx_mstate_global->__pyx_n_s_added_ids #define __pyx_n_s_ai __pyx_mstate_global->__pyx_n_s_ai #define __pyx_n_s_alen __pyx_mstate_global->__pyx_n_s_alen #define __pyx_n_s_algorithm __pyx_mstate_global->__pyx_n_s_algorithm #define __pyx_n_s_archives __pyx_mstate_global->__pyx_n_s_archives #define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args #define __pyx_n_s_as_dict __pyx_mstate_global->__pyx_n_s_as_dict #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_atime __pyx_mstate_global->__pyx_n_s_atime #define __pyx_n_s_attr __pyx_mstate_global->__pyx_n_s_attr #define __pyx_n_s_attr_error_msg __pyx_mstate_global->__pyx_n_s_attr_error_msg #define __pyx_n_s_attr_list __pyx_mstate_global->__pyx_n_s_attr_list #define __pyx_kp_s_attribute_s_not_found __pyx_mstate_global->__pyx_kp_s_attribute_s_not_found #define __pyx_n_s_attrs __pyx_mstate_global->__pyx_n_s_attrs #define __pyx_n_s_b __pyx_mstate_global->__pyx_n_s_b #define __pyx_n_s_bi __pyx_mstate_global->__pyx_n_s_bi #define __pyx_n_s_bigint __pyx_mstate_global->__pyx_n_s_bigint #define __pyx_n_s_bigint_to_int __pyx_mstate_global->__pyx_n_s_bigint_to_int #define __pyx_n_s_birthtime __pyx_mstate_global->__pyx_n_s_birthtime #define __pyx_n_s_blen __pyx_mstate_global->__pyx_n_s_blen #define __pyx_n_s_blkdev __pyx_mstate_global->__pyx_n_s_blkdev #define __pyx_n_s_borg_item __pyx_mstate_global->__pyx_n_s_borg_item #define __pyx_n_s_bsdflags __pyx_mstate_global->__pyx_n_s_bsdflags #define __pyx_n_s_c __pyx_mstate_global->__pyx_n_s_c #define __pyx_n_s_can_compare_chunk_ids __pyx_mstate_global->__pyx_n_s_can_compare_chunk_ids #define __pyx_n_s_can_compare_chunk_ids_2 __pyx_mstate_global->__pyx_n_s_can_compare_chunk_ids_2 #define __pyx_n_s_ch __pyx_mstate_global->__pyx_n_s_ch #define __pyx_kp_s_changed_link __pyx_mstate_global->__pyx_kp_s_changed_link #define __pyx_n_s_changes __pyx_mstate_global->__pyx_n_s_changes #define __pyx_n_s_changes_2 __pyx_mstate_global->__pyx_n_s_changes_2 #define __pyx_n_s_check_key __pyx_mstate_global->__pyx_n_s_check_key #define __pyx_n_s_chg __pyx_mstate_global->__pyx_n_s_chg #define __pyx_n_s_chrdev __pyx_mstate_global->__pyx_n_s_chrdev #define __pyx_n_s_chunk_ids1 __pyx_mstate_global->__pyx_n_s_chunk_ids1 #define __pyx_n_s_chunk_ids2 __pyx_mstate_global->__pyx_n_s_chunk_ids2 #define __pyx_n_s_chunk_iterator1 __pyx_mstate_global->__pyx_n_s_chunk_iterator1 #define __pyx_n_s_chunk_iterator2 __pyx_mstate_global->__pyx_n_s_chunk_iterator2 #define __pyx_n_s_chunk_seed __pyx_mstate_global->__pyx_n_s_chunk_seed #define __pyx_n_s_chunker_params __pyx_mstate_global->__pyx_n_s_chunker_params #define __pyx_kp_s_chunker_params_tuple __pyx_mstate_global->__pyx_kp_s_chunker_params_tuple #define __pyx_n_s_chunks __pyx_mstate_global->__pyx_n_s_chunks #define __pyx_n_s_chunks1 __pyx_mstate_global->__pyx_n_s_chunks1 #define __pyx_n_s_chunks2 __pyx_mstate_global->__pyx_n_s_chunks2 #define __pyx_n_s_chunks_contents_equal __pyx_mstate_global->__pyx_n_s_chunks_contents_equal #define __pyx_n_s_chunks_healthy __pyx_mstate_global->__pyx_n_s_chunks_healthy #define __pyx_n_s_class __pyx_mstate_global->__pyx_n_s_class #define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_close __pyx_mstate_global->__pyx_n_s_close #define __pyx_n_s_cls __pyx_mstate_global->__pyx_n_s_cls #define __pyx_n_s_cmdline __pyx_mstate_global->__pyx_n_s_cmdline #define __pyx_n_s_collections __pyx_mstate_global->__pyx_n_s_collections #define __pyx_n_s_comment __pyx_mstate_global->__pyx_n_s_comment #define __pyx_n_s_compressed __pyx_mstate_global->__pyx_n_s_compressed #define __pyx_n_s_config __pyx_mstate_global->__pyx_n_s_config #define __pyx_n_s_consider_ids __pyx_mstate_global->__pyx_n_s_consider_ids #define __pyx_n_s_constants __pyx_mstate_global->__pyx_n_s_constants #define __pyx_n_s_contains __pyx_mstate_global->__pyx_n_s_contains #define __pyx_n_s_content_diff __pyx_mstate_global->__pyx_n_s_content_diff #define __pyx_n_s_content_equal __pyx_mstate_global->__pyx_n_s_content_equal #define __pyx_n_s_content_only __pyx_mstate_global->__pyx_n_s_content_only #define __pyx_n_s_content_only_2 __pyx_mstate_global->__pyx_n_s_content_only_2 #define __pyx_n_s_create_deleted __pyx_mstate_global->__pyx_n_s_create_deleted #define __pyx_n_s_csize __pyx_mstate_global->__pyx_n_s_csize #define __pyx_n_s_csize_parts __pyx_mstate_global->__pyx_n_s_csize_parts #define __pyx_n_s_ctime __pyx_mstate_global->__pyx_n_s_ctime #define __pyx_n_s_d __pyx_mstate_global->__pyx_n_s_d #define __pyx_n_s_data __pyx_mstate_global->__pyx_n_s_data #define __pyx_n_s_data_dict __pyx_mstate_global->__pyx_n_s_data_dict #define __pyx_kp_s_data_dict_must_be_a_dict __pyx_mstate_global->__pyx_kp_s_data_dict_must_be_a_dict #define __pyx_n_s_decode __pyx_mstate_global->__pyx_n_s_decode #define __pyx_n_s_default __pyx_mstate_global->__pyx_n_s_default #define __pyx_n_s_del __pyx_mstate_global->__pyx_n_s_del #define __pyx_n_s_deleted __pyx_mstate_global->__pyx_n_s_deleted #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict #define __pyx_n_s_dict_2 __pyx_mstate_global->__pyx_n_s_dict_2 #define __pyx_n_s_directory __pyx_mstate_global->__pyx_n_s_directory #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable #define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc #define __pyx_n_s_doc_2 __pyx_mstate_global->__pyx_n_s_doc_2 #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable #define __pyx_n_s_enc_hmac_key __pyx_mstate_global->__pyx_n_s_enc_hmac_key #define __pyx_n_s_enc_key __pyx_mstate_global->__pyx_n_s_enc_key #define __pyx_n_s_encode __pyx_mstate_global->__pyx_n_s_encode #define __pyx_n_s_end __pyx_mstate_global->__pyx_n_s_end #define __pyx_n_s_eq __pyx_mstate_global->__pyx_n_s_eq #define __pyx_n_s_equal __pyx_mstate_global->__pyx_n_s_equal #define __pyx_n_s_equal_2 __pyx_mstate_global->__pyx_n_s_equal_2 #define __pyx_n_s_fifo __pyx_mstate_global->__pyx_n_s_fifo #define __pyx_n_s_filemode __pyx_mstate_global->__pyx_n_s_filemode #define __pyx_n_s_format __pyx_mstate_global->__pyx_n_s_format #define __pyx_n_s_format_file_size __pyx_mstate_global->__pyx_n_s_format_file_size #define __pyx_n_s_from_chunks __pyx_mstate_global->__pyx_n_s_from_chunks #define __pyx_n_s_from_optr __pyx_mstate_global->__pyx_n_s_from_optr #define __pyx_n_s_g1 __pyx_mstate_global->__pyx_n_s_g1 #define __pyx_n_s_g2 __pyx_mstate_global->__pyx_n_s_g2 #define __pyx_n_s_g_attr __pyx_mstate_global->__pyx_n_s_g_attr #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc #define __pyx_n_s_genexpr __pyx_mstate_global->__pyx_n_s_genexpr #define __pyx_n_s_get __pyx_mstate_global->__pyx_n_s_get #define __pyx_n_s_get_2 __pyx_mstate_global->__pyx_n_s_get_2 #define __pyx_n_s_get_size __pyx_mstate_global->__pyx_n_s_get_size #define __pyx_n_s_gid __pyx_mstate_global->__pyx_n_s_gid #define __pyx_n_s_group __pyx_mstate_global->__pyx_n_s_group #define __pyx_n_s_hardlink_master __pyx_mstate_global->__pyx_n_s_hardlink_master #define __pyx_n_s_hardlink_masters __pyx_mstate_global->__pyx_n_s_hardlink_masters #define __pyx_n_s_hash __pyx_mstate_global->__pyx_n_s_hash #define __pyx_n_s_having_chunks __pyx_mstate_global->__pyx_n_s_having_chunks #define __pyx_n_s_helpers __pyx_mstate_global->__pyx_n_s_helpers #define __pyx_n_s_helpers_time __pyx_mstate_global->__pyx_n_s_helpers_time #define __pyx_n_s_hostname __pyx_mstate_global->__pyx_n_s_hostname #define __pyx_n_s_id __pyx_mstate_global->__pyx_n_s_id #define __pyx_n_s_id_key __pyx_mstate_global->__pyx_n_s_id_key #define __pyx_kp_s_id_size_csize __pyx_mstate_global->__pyx_kp_s_id_size_csize #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init #define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_int_to_bigint __pyx_mstate_global->__pyx_n_s_int_to_bigint #define __pyx_n_s_internal_dict __pyx_mstate_global->__pyx_n_s_internal_dict #define __pyx_kp_s_internal_dict_must_be_a_dict __pyx_mstate_global->__pyx_kp_s_internal_dict_must_be_a_dict #define __pyx_n_s_is_blk __pyx_mstate_global->__pyx_n_s_is_blk #define __pyx_n_s_is_chr __pyx_mstate_global->__pyx_n_s_is_chr #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_n_s_is_dir __pyx_mstate_global->__pyx_n_s_is_dir #define __pyx_n_s_is_fifo __pyx_mstate_global->__pyx_n_s_is_fifo #define __pyx_n_s_is_link __pyx_mstate_global->__pyx_n_s_is_link #define __pyx_n_s_is_type __pyx_mstate_global->__pyx_n_s_is_type #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled #define __pyx_n_s_item1 __pyx_mstate_global->__pyx_n_s_item1 #define __pyx_n_s_item1_2 __pyx_mstate_global->__pyx_n_s_item1_2 #define __pyx_n_s_item2 __pyx_mstate_global->__pyx_n_s_item2 #define __pyx_n_s_item2_2 __pyx_mstate_global->__pyx_n_s_item2_2 #define __pyx_n_s_item_keys __pyx_mstate_global->__pyx_n_s_item_keys #define __pyx_n_s_item_type __pyx_mstate_global->__pyx_n_s_item_type #define __pyx_n_s_items __pyx_mstate_global->__pyx_n_s_items #define __pyx_n_s_iterations __pyx_mstate_global->__pyx_n_s_iterations #define __pyx_n_s_join __pyx_mstate_global->__pyx_n_s_join #define __pyx_n_s_k __pyx_mstate_global->__pyx_n_s_k #define __pyx_n_s_key __pyx_mstate_global->__pyx_n_s_key #define __pyx_kp_s_key_must_be_str __pyx_mstate_global->__pyx_kp_s_key_must_be_str #define __pyx_kp_s_key_s_is_not_a_valid_key __pyx_mstate_global->__pyx_kp_s_key_s_is_not_a_valid_key #define __pyx_n_s_kw __pyx_mstate_global->__pyx_n_s_kw #define __pyx_n_s_link __pyx_mstate_global->__pyx_n_s_link #define __pyx_n_s_link_diff __pyx_mstate_global->__pyx_n_s_link_diff #define __pyx_kp_s_list_or_None __pyx_mstate_global->__pyx_kp_s_list_or_None #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_make_property __pyx_mstate_global->__pyx_n_s_make_property #define __pyx_n_s_master __pyx_mstate_global->__pyx_n_s_master #define __pyx_n_s_memorize __pyx_mstate_global->__pyx_n_s_memorize #define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass #define __pyx_n_s_mode __pyx_mstate_global->__pyx_n_s_mode #define __pyx_n_s_mode1 __pyx_mstate_global->__pyx_n_s_mode1 #define __pyx_n_s_mode2 __pyx_mstate_global->__pyx_n_s_mode2 #define __pyx_n_s_mode_diff __pyx_mstate_global->__pyx_n_s_mode_diff #define __pyx_n_s_modified __pyx_mstate_global->__pyx_n_s_modified #define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module #define __pyx_n_s_mro_entries __pyx_mstate_global->__pyx_n_s_mro_entries #define __pyx_n_s_mtime __pyx_mstate_global->__pyx_n_s_mtime #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_name_2 __pyx_mstate_global->__pyx_n_s_name_2 #define __pyx_n_s_namedtuple __pyx_mstate_global->__pyx_n_s_namedtuple #define __pyx_n_u_new __pyx_mstate_global->__pyx_n_u_new #define __pyx_n_s_new_group __pyx_mstate_global->__pyx_n_s_new_group #define __pyx_n_s_new_mode __pyx_mstate_global->__pyx_n_s_new_mode #define __pyx_n_s_new_user __pyx_mstate_global->__pyx_n_s_new_user #define __pyx_n_s_nfiles __pyx_mstate_global->__pyx_n_s_nfiles #define __pyx_n_s_nfiles_parts __pyx_mstate_global->__pyx_n_s_nfiles_parts #define __pyx_n_s_nlink __pyx_mstate_global->__pyx_n_s_nlink #define __pyx_n_s_numeric_ids __pyx_mstate_global->__pyx_n_s_numeric_ids #define __pyx_n_s_numeric_ids_2 __pyx_mstate_global->__pyx_n_s_numeric_ids_2 #define __pyx_n_s_object __pyx_mstate_global->__pyx_n_s_object #define __pyx_n_u_old __pyx_mstate_global->__pyx_n_u_old #define __pyx_n_s_old_group __pyx_mstate_global->__pyx_n_s_old_group #define __pyx_n_s_old_mode __pyx_mstate_global->__pyx_n_s_old_mode #define __pyx_n_s_old_user __pyx_mstate_global->__pyx_n_s_old_user #define __pyx_n_s_optr __pyx_mstate_global->__pyx_n_s_optr #define __pyx_n_s_other __pyx_mstate_global->__pyx_n_s_other #define __pyx_n_s_owner __pyx_mstate_global->__pyx_n_s_owner #define __pyx_n_s_owner_diff __pyx_mstate_global->__pyx_n_s_owner_diff #define __pyx_n_s_part __pyx_mstate_global->__pyx_n_s_part #define __pyx_n_s_path __pyx_mstate_global->__pyx_n_s_path #define __pyx_n_s_pd __pyx_mstate_global->__pyx_n_s_pd #define __pyx_n_s_precision __pyx_mstate_global->__pyx_n_s_precision #define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare #define __pyx_n_s_presence_diff __pyx_mstate_global->__pyx_n_s_presence_diff #define __pyx_n_s_property __pyx_mstate_global->__pyx_n_s_property #define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname #define __pyx_n_s_rdev __pyx_mstate_global->__pyx_n_s_rdev #define __pyx_n_s_recreate_args __pyx_mstate_global->__pyx_n_s_recreate_args #define __pyx_n_s_recreate_cmdline __pyx_mstate_global->__pyx_n_s_recreate_cmdline #define __pyx_n_s_recreate_partial_chunks __pyx_mstate_global->__pyx_n_s_recreate_partial_chunks #define __pyx_n_s_recreate_source_id __pyx_mstate_global->__pyx_n_s_recreate_source_id #define __pyx_kp_s_removed __pyx_mstate_global->__pyx_kp_s_removed #define __pyx_kp_s_removed_11 __pyx_mstate_global->__pyx_kp_s_removed_11 #define __pyx_n_s_removed_2 __pyx_mstate_global->__pyx_n_s_removed_2 #define __pyx_n_s_removed_ids __pyx_mstate_global->__pyx_n_s_removed_ids #define __pyx_n_s_repository_id __pyx_mstate_global->__pyx_n_s_repository_id #define __pyx_n_s_repr __pyx_mstate_global->__pyx_n_s_repr #define __pyx_kp_s_s_internal_dict_r __pyx_mstate_global->__pyx_kp_s_s_internal_dict_r #define __pyx_kp_s_s_s __pyx_mstate_global->__pyx_kp_s_s_s #define __pyx_kp_s_s_value_must_be_s __pyx_mstate_global->__pyx_kp_s_s_value_must_be_s #define __pyx_n_s_safe_decode __pyx_mstate_global->__pyx_n_s_safe_decode #define __pyx_n_s_safe_encode __pyx_mstate_global->__pyx_n_s_safe_encode #define __pyx_n_s_safe_timestamp __pyx_mstate_global->__pyx_n_s_safe_timestamp #define __pyx_n_s_salt __pyx_mstate_global->__pyx_n_s_salt #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_n_s_send __pyx_mstate_global->__pyx_n_s_send #define __pyx_n_s_set __pyx_mstate_global->__pyx_n_s_set #define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name #define __pyx_n_s_sign __pyx_mstate_global->__pyx_n_s_sign #define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size #define __pyx_n_s_size_parts __pyx_mstate_global->__pyx_n_s_size_parts #define __pyx_n_s_slicelen __pyx_mstate_global->__pyx_n_s_slicelen #define __pyx_n_s_slots __pyx_mstate_global->__pyx_n_s_slots #define __pyx_n_s_source __pyx_mstate_global->__pyx_n_s_source #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_kp_s_src_borg_item_pyx __pyx_mstate_global->__pyx_kp_s_src_borg_item_pyx #define __pyx_n_s_stat __pyx_mstate_global->__pyx_n_s_stat #define __pyx_n_s_staticmethod __pyx_mstate_global->__pyx_n_s_staticmethod #define __pyx_n_s_sum __pyx_mstate_global->__pyx_n_s_sum #define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super #define __pyx_kp_s_surrogate_escaped_str __pyx_mstate_global->__pyx_kp_s_surrogate_escaped_str #define __pyx_kp_s_surrogate_escaped_str_or_None __pyx_mstate_global->__pyx_kp_s_surrogate_escaped_str_or_None #define __pyx_n_s_sz __pyx_mstate_global->__pyx_n_s_sz #define __pyx_n_s_t __pyx_mstate_global->__pyx_n_s_t #define __pyx_n_s_tam_required __pyx_mstate_global->__pyx_n_s_tam_required #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_throw __pyx_mstate_global->__pyx_n_s_throw #define __pyx_n_s_time __pyx_mstate_global->__pyx_n_s_time #define __pyx_n_s_time_diffs __pyx_mstate_global->__pyx_n_s_time_diffs #define __pyx_n_s_time_end __pyx_mstate_global->__pyx_n_s_time_end #define __pyx_n_s_timestamp __pyx_mstate_global->__pyx_n_s_timestamp #define __pyx_n_s_to_optr __pyx_mstate_global->__pyx_n_s_to_optr #define __pyx_n_s_ts1 __pyx_mstate_global->__pyx_n_s_ts1 #define __pyx_n_s_ts2 __pyx_mstate_global->__pyx_n_s_ts2 #define __pyx_n_s_tuple_decode __pyx_mstate_global->__pyx_n_s_tuple_decode #define __pyx_n_s_tuple_decode_locals_genexpr __pyx_mstate_global->__pyx_n_s_tuple_decode_locals_genexpr #define __pyx_n_s_tuple_encode __pyx_mstate_global->__pyx_n_s_tuple_encode #define __pyx_n_s_tuple_encode_locals_genexpr __pyx_mstate_global->__pyx_n_s_tuple_encode_locals_genexpr #define __pyx_n_s_type __pyx_mstate_global->__pyx_n_s_type #define __pyx_n_s_type_error_msg __pyx_mstate_global->__pyx_n_s_type_error_msg #define __pyx_n_s_typetest __pyx_mstate_global->__pyx_n_s_typetest #define __pyx_n_s_u1 __pyx_mstate_global->__pyx_n_s_u1 #define __pyx_n_s_u2 __pyx_mstate_global->__pyx_n_s_u2 #define __pyx_n_s_u_attr __pyx_mstate_global->__pyx_n_s_u_attr #define __pyx_n_s_uid __pyx_mstate_global->__pyx_n_s_uid #define __pyx_n_s_update __pyx_mstate_global->__pyx_n_s_update #define __pyx_n_s_update_internal __pyx_mstate_global->__pyx_n_s_update_internal #define __pyx_n_s_user __pyx_mstate_global->__pyx_n_s_user #define __pyx_n_s_username __pyx_mstate_global->__pyx_n_s_username #define __pyx_n_s_v __pyx_mstate_global->__pyx_n_s_v #define __pyx_n_s_value __pyx_mstate_global->__pyx_n_s_value #define __pyx_n_s_value_type __pyx_mstate_global->__pyx_n_s_value_type #define __pyx_n_s_value_type_name __pyx_mstate_global->__pyx_n_s_value_type_name #define __pyx_n_s_version __pyx_mstate_global->__pyx_n_s_version #define __pyx_n_s_xattrs __pyx_mstate_global->__pyx_n_s_xattrs #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 #define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_ #define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 #define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 #define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 #define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 #define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9 #define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11 #define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12 #define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18 #define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19 #define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21 #define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24 #define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28 #define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31 #define __pyx_tuple__33 __pyx_mstate_global->__pyx_tuple__33 #define __pyx_tuple__34 __pyx_mstate_global->__pyx_tuple__34 #define __pyx_tuple__36 __pyx_mstate_global->__pyx_tuple__36 #define __pyx_tuple__37 __pyx_mstate_global->__pyx_tuple__37 #define __pyx_tuple__39 __pyx_mstate_global->__pyx_tuple__39 #define __pyx_tuple__41 __pyx_mstate_global->__pyx_tuple__41 #define __pyx_tuple__43 __pyx_mstate_global->__pyx_tuple__43 #define __pyx_tuple__45 __pyx_mstate_global->__pyx_tuple__45 #define __pyx_tuple__52 __pyx_mstate_global->__pyx_tuple__52 #define __pyx_tuple__54 __pyx_mstate_global->__pyx_tuple__54 #define __pyx_tuple__57 __pyx_mstate_global->__pyx_tuple__57 #define __pyx_tuple__59 __pyx_mstate_global->__pyx_tuple__59 #define __pyx_tuple__61 __pyx_mstate_global->__pyx_tuple__61 #define __pyx_tuple__63 __pyx_mstate_global->__pyx_tuple__63 #define __pyx_tuple__65 __pyx_mstate_global->__pyx_tuple__65 #define __pyx_tuple__67 __pyx_mstate_global->__pyx_tuple__67 #define __pyx_tuple__69 __pyx_mstate_global->__pyx_tuple__69 #define __pyx_tuple__71 __pyx_mstate_global->__pyx_tuple__71 #define __pyx_tuple__73 __pyx_mstate_global->__pyx_tuple__73 #define __pyx_tuple__75 __pyx_mstate_global->__pyx_tuple__75 #define __pyx_tuple__77 __pyx_mstate_global->__pyx_tuple__77 #define __pyx_tuple__79 __pyx_mstate_global->__pyx_tuple__79 #define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 #define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6 #define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8 #define __pyx_codeobj__20 __pyx_mstate_global->__pyx_codeobj__20 #define __pyx_codeobj__22 __pyx_mstate_global->__pyx_codeobj__22 #define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23 #define __pyx_codeobj__25 __pyx_mstate_global->__pyx_codeobj__25 #define __pyx_codeobj__26 __pyx_mstate_global->__pyx_codeobj__26 #define __pyx_codeobj__27 __pyx_mstate_global->__pyx_codeobj__27 #define __pyx_codeobj__29 __pyx_mstate_global->__pyx_codeobj__29 #define __pyx_codeobj__30 __pyx_mstate_global->__pyx_codeobj__30 #define __pyx_codeobj__32 __pyx_mstate_global->__pyx_codeobj__32 #define __pyx_codeobj__35 __pyx_mstate_global->__pyx_codeobj__35 #define __pyx_codeobj__40 __pyx_mstate_global->__pyx_codeobj__40 #define __pyx_codeobj__42 __pyx_mstate_global->__pyx_codeobj__42 #define __pyx_codeobj__44 __pyx_mstate_global->__pyx_codeobj__44 #define __pyx_codeobj__46 __pyx_mstate_global->__pyx_codeobj__46 #define __pyx_codeobj__47 __pyx_mstate_global->__pyx_codeobj__47 #define __pyx_codeobj__48 __pyx_mstate_global->__pyx_codeobj__48 #define __pyx_codeobj__49 __pyx_mstate_global->__pyx_codeobj__49 #define __pyx_codeobj__50 __pyx_mstate_global->__pyx_codeobj__50 #define __pyx_codeobj__51 __pyx_mstate_global->__pyx_codeobj__51 #define __pyx_codeobj__53 __pyx_mstate_global->__pyx_codeobj__53 #define __pyx_codeobj__55 __pyx_mstate_global->__pyx_codeobj__55 #define __pyx_codeobj__56 __pyx_mstate_global->__pyx_codeobj__56 #define __pyx_codeobj__58 __pyx_mstate_global->__pyx_codeobj__58 #define __pyx_codeobj__60 __pyx_mstate_global->__pyx_codeobj__60 #define __pyx_codeobj__62 __pyx_mstate_global->__pyx_codeobj__62 #define __pyx_codeobj__64 __pyx_mstate_global->__pyx_codeobj__64 #define __pyx_codeobj__66 __pyx_mstate_global->__pyx_codeobj__66 #define __pyx_codeobj__68 __pyx_mstate_global->__pyx_codeobj__68 #define __pyx_codeobj__70 __pyx_mstate_global->__pyx_codeobj__70 #define __pyx_codeobj__72 __pyx_mstate_global->__pyx_codeobj__72 #define __pyx_codeobj__74 __pyx_mstate_global->__pyx_codeobj__74 #define __pyx_codeobj__76 __pyx_mstate_global->__pyx_codeobj__76 #define __pyx_codeobj__78 __pyx_mstate_global->__pyx_codeobj__78 #define __pyx_codeobj__80 __pyx_mstate_global->__pyx_codeobj__80 /* #### Code section: module_code ### */ /* "borg/item.pyx":43 * __slots__ = ("_dict", ) # avoid setting attributes not supported by properties * * def __init__(self, data_dict=None, internal_dict=None, **kw): # <<<<<<<<<<<<<< * self._dict = {} * if internal_dict is None: */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_4item_8PropDict_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_4item_8PropDict_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_4item_8PropDict_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_4item_8PropDict_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_data_dict = 0; PyObject *__pyx_v_internal_dict = 0; PyObject *__pyx_v_kw = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL; __Pyx_GOTREF(__pyx_v_kw); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_data_dict,&__pyx_n_s_internal_dict,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data_dict); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_internal_dict); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kw, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 43, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_data_dict = values[1]; __pyx_v_internal_dict = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 43, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0; __Pyx_AddTraceback("borg.item.PropDict.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_4item_8PropDict___init__(__pyx_self, __pyx_v_self, __pyx_v_data_dict, __pyx_v_internal_dict, __pyx_v_kw); /* function exit code */ __Pyx_DECREF(__pyx_v_kw); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_4item_8PropDict___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data_dict, PyObject *__pyx_v_internal_dict, PyObject *__pyx_v_kw) { PyObject *__pyx_v_data = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "borg/item.pyx":44 * * def __init__(self, data_dict=None, internal_dict=None, **kw): * self._dict = {} # <<<<<<<<<<<<<< * if internal_dict is None: * pass # nothing to do */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_dict, __pyx_t_1) < 0) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/item.pyx":45 * def __init__(self, data_dict=None, internal_dict=None, **kw): * self._dict = {} * if internal_dict is None: # <<<<<<<<<<<<<< * pass # nothing to do * elif isinstance(internal_dict, dict): */ __pyx_t_2 = (__pyx_v_internal_dict == Py_None); if (__pyx_t_2) { goto __pyx_L3; } /* "borg/item.pyx":47 * if internal_dict is None: * pass # nothing to do * elif isinstance(internal_dict, dict): # <<<<<<<<<<<<<< * self.update_internal(internal_dict) * else: */ __pyx_t_2 = PyDict_Check(__pyx_v_internal_dict); if (likely(__pyx_t_2)) { /* "borg/item.pyx":48 * pass # nothing to do * elif isinstance(internal_dict, dict): * self.update_internal(internal_dict) # <<<<<<<<<<<<<< * else: * raise TypeError("internal_dict must be a dict") */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_update_internal); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_internal_dict}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/item.pyx":47 * if internal_dict is None: * pass # nothing to do * elif isinstance(internal_dict, dict): # <<<<<<<<<<<<<< * self.update_internal(internal_dict) * else: */ goto __pyx_L3; } /* "borg/item.pyx":50 * self.update_internal(internal_dict) * else: * raise TypeError("internal_dict must be a dict") # <<<<<<<<<<<<<< * if data_dict is None: * data = kw */ /*else*/ { __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 50, __pyx_L1_error) } __pyx_L3:; /* "borg/item.pyx":51 * else: * raise TypeError("internal_dict must be a dict") * if data_dict is None: # <<<<<<<<<<<<<< * data = kw * elif isinstance(data_dict, dict): */ __pyx_t_2 = (__pyx_v_data_dict == Py_None); if (__pyx_t_2) { /* "borg/item.pyx":52 * raise TypeError("internal_dict must be a dict") * if data_dict is None: * data = kw # <<<<<<<<<<<<<< * elif isinstance(data_dict, dict): * data = data_dict */ __Pyx_INCREF(__pyx_v_kw); __pyx_v_data = __pyx_v_kw; /* "borg/item.pyx":51 * else: * raise TypeError("internal_dict must be a dict") * if data_dict is None: # <<<<<<<<<<<<<< * data = kw * elif isinstance(data_dict, dict): */ goto __pyx_L4; } /* "borg/item.pyx":53 * if data_dict is None: * data = kw * elif isinstance(data_dict, dict): # <<<<<<<<<<<<<< * data = data_dict * else: */ __pyx_t_2 = PyDict_Check(__pyx_v_data_dict); if (likely(__pyx_t_2)) { /* "borg/item.pyx":54 * data = kw * elif isinstance(data_dict, dict): * data = data_dict # <<<<<<<<<<<<<< * else: * raise TypeError("data_dict must be a dict") */ __Pyx_INCREF(__pyx_v_data_dict); __pyx_v_data = __pyx_v_data_dict; /* "borg/item.pyx":53 * if data_dict is None: * data = kw * elif isinstance(data_dict, dict): # <<<<<<<<<<<<<< * data = data_dict * else: */ goto __pyx_L4; } /* "borg/item.pyx":56 * data = data_dict * else: * raise TypeError("data_dict must be a dict") # <<<<<<<<<<<<<< * if data: * self.update(data) */ /*else*/ { __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 56, __pyx_L1_error) } __pyx_L4:; /* "borg/item.pyx":57 * else: * raise TypeError("data_dict must be a dict") * if data: # <<<<<<<<<<<<<< * self.update(data) * */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_data); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 57, __pyx_L1_error) if (__pyx_t_2) { /* "borg/item.pyx":58 * raise TypeError("data_dict must be a dict") * if data: * self.update(data) # <<<<<<<<<<<<<< * * def update(self, d): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_update); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_data}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/item.pyx":57 * else: * raise TypeError("data_dict must be a dict") * if data: # <<<<<<<<<<<<<< * self.update(data) * */ } /* "borg/item.pyx":43 * __slots__ = ("_dict", ) # avoid setting attributes not supported by properties * * def __init__(self, data_dict=None, internal_dict=None, **kw): # <<<<<<<<<<<<<< * self._dict = {} * if internal_dict is None: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("borg.item.PropDict.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_data); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/item.pyx":60 * self.update(data) * * def update(self, d): # <<<<<<<<<<<<<< * for k, v in d.items(): * if isinstance(k, bytes): */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_4item_8PropDict_3update(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_4item_8PropDict_3update = {"update", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_4item_8PropDict_3update, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_4item_8PropDict_3update(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_d = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("update (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_d,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 60, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_d)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 60, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("update", 1, 2, 2, 1); __PYX_ERR(0, 60, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "update") < 0)) __PYX_ERR(0, 60, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_d = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("update", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 60, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.item.PropDict.update", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_4item_8PropDict_2update(__pyx_self, __pyx_v_self, __pyx_v_d); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_4item_8PropDict_2update(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_d) { PyObject *__pyx_v_k = NULL; PyObject *__pyx_v_v = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("update", 1); /* "borg/item.pyx":61 * * def update(self, d): * for k, v in d.items(): # <<<<<<<<<<<<<< * if isinstance(k, bytes): * k = k.decode() */ __pyx_t_2 = 0; if (unlikely(__pyx_v_d == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 61, __pyx_L1_error) } __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_d, 0, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; while (1) { __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4); if (unlikely(__pyx_t_7 == 0)) break; if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_6); __pyx_t_6 = 0; /* "borg/item.pyx":62 * def update(self, d): * for k, v in d.items(): * if isinstance(k, bytes): # <<<<<<<<<<<<<< * k = k.decode() * setattr(self, self._check_key(k), v) */ __pyx_t_8 = PyBytes_Check(__pyx_v_k); if (__pyx_t_8) { /* "borg/item.pyx":63 * for k, v in d.items(): * if isinstance(k, bytes): * k = k.decode() # <<<<<<<<<<<<<< * setattr(self, self._check_key(k), v) * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_k, __pyx_n_s_decode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF_SET(__pyx_v_k, __pyx_t_6); __pyx_t_6 = 0; /* "borg/item.pyx":62 * def update(self, d): * for k, v in d.items(): * if isinstance(k, bytes): # <<<<<<<<<<<<<< * k = k.decode() * setattr(self, self._check_key(k), v) */ } /* "borg/item.pyx":64 * if isinstance(k, bytes): * k = k.decode() * setattr(self, self._check_key(k), v) # <<<<<<<<<<<<<< * * def update_internal(self, d): */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_check_key); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_k}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_10 = PyObject_SetAttr(__pyx_v_self, __pyx_t_6, __pyx_v_v); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/item.pyx":60 * self.update(data) * * def update(self, d): # <<<<<<<<<<<<<< * for k, v in d.items(): * if isinstance(k, bytes): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("borg.item.PropDict.update", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_k); __Pyx_XDECREF(__pyx_v_v); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/item.pyx":66 * setattr(self, self._check_key(k), v) * * def update_internal(self, d): # <<<<<<<<<<<<<< * for k, v in d.items(): * if isinstance(k, bytes): */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_4item_8PropDict_5update_internal(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_4item_8PropDict_5update_internal = {"update_internal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_4item_8PropDict_5update_internal, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_4item_8PropDict_5update_internal(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_d = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("update_internal (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_d,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 66, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_d)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 66, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("update_internal", 1, 2, 2, 1); __PYX_ERR(0, 66, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "update_internal") < 0)) __PYX_ERR(0, 66, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_d = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("update_internal", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 66, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.item.PropDict.update_internal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_4item_8PropDict_4update_internal(__pyx_self, __pyx_v_self, __pyx_v_d); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_4item_8PropDict_4update_internal(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_d) { PyObject *__pyx_v_k = NULL; PyObject *__pyx_v_v = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("update_internal", 1); /* "borg/item.pyx":67 * * def update_internal(self, d): * for k, v in d.items(): # <<<<<<<<<<<<<< * if isinstance(k, bytes): * k = k.decode() */ __pyx_t_2 = 0; if (unlikely(__pyx_v_d == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 67, __pyx_L1_error) } __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_d, 0, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; while (1) { __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4); if (unlikely(__pyx_t_7 == 0)) break; if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_6); __pyx_t_6 = 0; /* "borg/item.pyx":68 * def update_internal(self, d): * for k, v in d.items(): * if isinstance(k, bytes): # <<<<<<<<<<<<<< * k = k.decode() * self._dict[k] = v */ __pyx_t_8 = PyBytes_Check(__pyx_v_k); if (__pyx_t_8) { /* "borg/item.pyx":69 * for k, v in d.items(): * if isinstance(k, bytes): * k = k.decode() # <<<<<<<<<<<<<< * self._dict[k] = v * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_k, __pyx_n_s_decode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF_SET(__pyx_v_k, __pyx_t_6); __pyx_t_6 = 0; /* "borg/item.pyx":68 * def update_internal(self, d): * for k, v in d.items(): * if isinstance(k, bytes): # <<<<<<<<<<<<<< * k = k.decode() * self._dict[k] = v */ } /* "borg/item.pyx":70 * if isinstance(k, bytes): * k = k.decode() * self._dict[k] = v # <<<<<<<<<<<<<< * * def __eq__(self, other): */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (unlikely((PyObject_SetItem(__pyx_t_6, __pyx_v_k, __pyx_v_v) < 0))) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/item.pyx":66 * setattr(self, self._check_key(k), v) * * def update_internal(self, d): # <<<<<<<<<<<<<< * for k, v in d.items(): * if isinstance(k, bytes): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("borg.item.PropDict.update_internal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_k); __Pyx_XDECREF(__pyx_v_v); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/item.pyx":72 * self._dict[k] = v * * def __eq__(self, other): # <<<<<<<<<<<<<< * return self.as_dict() == other.as_dict() * */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_4item_8PropDict_7__eq__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_4item_8PropDict_7__eq__ = {"__eq__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_4item_8PropDict_7__eq__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_4item_8PropDict_7__eq__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_other = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 72, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_other)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 72, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__eq__", 1, 2, 2, 1); __PYX_ERR(0, 72, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__eq__") < 0)) __PYX_ERR(0, 72, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_other = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__eq__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 72, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.item.PropDict.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_4item_8PropDict_6__eq__(__pyx_self, __pyx_v_self, __pyx_v_other); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_4item_8PropDict_6__eq__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__eq__", 1); /* "borg/item.pyx":73 * * def __eq__(self, other): * return self.as_dict() == other.as_dict() # <<<<<<<<<<<<<< * * def __repr__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_as_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_as_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "borg/item.pyx":72 * self._dict[k] = v * * def __eq__(self, other): # <<<<<<<<<<<<<< * return self.as_dict() == other.as_dict() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("borg.item.PropDict.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/item.pyx":75 * return self.as_dict() == other.as_dict() * * def __repr__(self): # <<<<<<<<<<<<<< * return '%s(internal_dict=%r)' % (self.__class__.__name__, self._dict) * */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_4item_8PropDict_9__repr__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_4item_8PropDict_9__repr__ = {"__repr__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_4item_8PropDict_9__repr__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_4item_8PropDict_9__repr__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 75, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__repr__") < 0)) __PYX_ERR(0, 75, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 75, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.item.PropDict.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_4item_8PropDict_8__repr__(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_4item_8PropDict_8__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 1); /* "borg/item.pyx":76 * * def __repr__(self): * return '%s(internal_dict=%r)' % (self.__class__.__name__, self._dict) # <<<<<<<<<<<<<< * * def as_dict(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_internal_dict_r, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/item.pyx":75 * return self.as_dict() == other.as_dict() * * def __repr__(self): # <<<<<<<<<<<<<< * return '%s(internal_dict=%r)' % (self.__class__.__name__, self._dict) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("borg.item.PropDict.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/item.pyx":78 * return '%s(internal_dict=%r)' % (self.__class__.__name__, self._dict) * * def as_dict(self): # <<<<<<<<<<<<<< * """return the internal dictionary""" * return StableDict(self._dict) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_4item_8PropDict_11as_dict(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_4item_8PropDict_10as_dict, "return the internal dictionary"); static PyMethodDef __pyx_mdef_4borg_4item_8PropDict_11as_dict = {"as_dict", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_4item_8PropDict_11as_dict, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_4item_8PropDict_10as_dict}; static PyObject *__pyx_pw_4borg_4item_8PropDict_11as_dict(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("as_dict (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "as_dict") < 0)) __PYX_ERR(0, 78, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("as_dict", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 78, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.item.PropDict.as_dict", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_4item_8PropDict_10as_dict(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_4item_8PropDict_10as_dict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("as_dict", 1); /* "borg/item.pyx":80 * def as_dict(self): * """return the internal dictionary""" * return StableDict(self._dict) # <<<<<<<<<<<<<< * * def _check_key(self, key): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_StableDict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/item.pyx":78 * return '%s(internal_dict=%r)' % (self.__class__.__name__, self._dict) * * def as_dict(self): # <<<<<<<<<<<<<< * """return the internal dictionary""" * return StableDict(self._dict) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("borg.item.PropDict.as_dict", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/item.pyx":82 * return StableDict(self._dict) * * def _check_key(self, key): # <<<<<<<<<<<<<< * """make sure key is of type str and known""" * if not isinstance(key, str): */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_4item_8PropDict_13_check_key(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_4item_8PropDict_12_check_key, "make sure key is of type str and known"); static PyMethodDef __pyx_mdef_4borg_4item_8PropDict_13_check_key = {"_check_key", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_4item_8PropDict_13_check_key, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_4item_8PropDict_12_check_key}; static PyObject *__pyx_pw_4borg_4item_8PropDict_13_check_key(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_key = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_check_key (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_key)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("_check_key", 1, 2, 2, 1); __PYX_ERR(0, 82, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_check_key") < 0)) __PYX_ERR(0, 82, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_key = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_check_key", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 82, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.item.PropDict._check_key", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_4item_8PropDict_12_check_key(__pyx_self, __pyx_v_self, __pyx_v_key); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_4item_8PropDict_12_check_key(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_check_key", 1); /* "borg/item.pyx":84 * def _check_key(self, key): * """make sure key is of type str and known""" * if not isinstance(key, str): # <<<<<<<<<<<<<< * raise TypeError("key must be str") * if key not in self.VALID_KEYS: */ __pyx_t_1 = PyString_Check(__pyx_v_key); __pyx_t_2 = (!__pyx_t_1); if (unlikely(__pyx_t_2)) { /* "borg/item.pyx":85 * """make sure key is of type str and known""" * if not isinstance(key, str): * raise TypeError("key must be str") # <<<<<<<<<<<<<< * if key not in self.VALID_KEYS: * raise ValueError("key '%s' is not a valid key" % key) */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 85, __pyx_L1_error) /* "borg/item.pyx":84 * def _check_key(self, key): * """make sure key is of type str and known""" * if not isinstance(key, str): # <<<<<<<<<<<<<< * raise TypeError("key must be str") * if key not in self.VALID_KEYS: */ } /* "borg/item.pyx":86 * if not isinstance(key, str): * raise TypeError("key must be str") * if key not in self.VALID_KEYS: # <<<<<<<<<<<<<< * raise ValueError("key '%s' is not a valid key" % key) * return key */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_VALID_KEYS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_key, __pyx_t_3, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_t_2)) { /* "borg/item.pyx":87 * raise TypeError("key must be str") * if key not in self.VALID_KEYS: * raise ValueError("key '%s' is not a valid key" % key) # <<<<<<<<<<<<<< * return key * */ __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_key_s_is_not_a_valid_key, __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 87, __pyx_L1_error) /* "borg/item.pyx":86 * if not isinstance(key, str): * raise TypeError("key must be str") * if key not in self.VALID_KEYS: # <<<<<<<<<<<<<< * raise ValueError("key '%s' is not a valid key" % key) * return key */ } /* "borg/item.pyx":88 * if key not in self.VALID_KEYS: * raise ValueError("key '%s' is not a valid key" % key) * return key # <<<<<<<<<<<<<< * * def __contains__(self, key): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_key); __pyx_r = __pyx_v_key; goto __pyx_L0; /* "borg/item.pyx":82 * return StableDict(self._dict) * * def _check_key(self, key): # <<<<<<<<<<<<<< * """make sure key is of type str and known""" * if not isinstance(key, str): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("borg.item.PropDict._check_key", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/item.pyx":90 * return key * * def __contains__(self, key): # <<<<<<<<<<<<<< * """do we have this key?""" * return self._check_key(key) in self._dict */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_4item_8PropDict_15__contains__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_4item_8PropDict_14__contains__, "do we have this key?"); static PyMethodDef __pyx_mdef_4borg_4item_8PropDict_15__contains__ = {"__contains__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_4item_8PropDict_15__contains__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_4item_8PropDict_14__contains__}; static PyObject *__pyx_pw_4borg_4item_8PropDict_15__contains__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_key = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__contains__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_key)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__contains__", 1, 2, 2, 1); __PYX_ERR(0, 90, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__contains__") < 0)) __PYX_ERR(0, 90, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_key = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__contains__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 90, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.item.PropDict.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_4item_8PropDict_14__contains__(__pyx_self, __pyx_v_self, __pyx_v_key); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_4item_8PropDict_14__contains__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__contains__", 1); /* "borg/item.pyx":92 * def __contains__(self, key): * """do we have this key?""" * return self._check_key(key) in self._dict # <<<<<<<<<<<<<< * * def get(self, key, default=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_check_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_key}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "borg/item.pyx":90 * return key * * def __contains__(self, key): # <<<<<<<<<<<<<< * """do we have this key?""" * return self._check_key(key) in self._dict */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("borg.item.PropDict.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/item.pyx":94 * return self._check_key(key) in self._dict * * def get(self, key, default=None): # <<<<<<<<<<<<<< * """get value for key, return default if key does not exist""" * return getattr(self, self._check_key(key), default) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_4item_8PropDict_17get(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_4item_8PropDict_16get, "get value for key, return default if key does not exist"); static PyMethodDef __pyx_mdef_4borg_4item_8PropDict_17get = {"get", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_4item_8PropDict_17get, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_4item_8PropDict_16get}; static PyObject *__pyx_pw_4borg_4item_8PropDict_17get(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_key = 0; PyObject *__pyx_v_default = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_default,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_key)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("get", 0, 2, 3, 1); __PYX_ERR(0, 94, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_default); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get") < 0)) __PYX_ERR(0, 94, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_key = values[1]; __pyx_v_default = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 94, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.item.PropDict.get", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_4item_8PropDict_16get(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_default); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_4item_8PropDict_16get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_default) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get", 1); /* "borg/item.pyx":96 * def get(self, key, default=None): * """get value for key, return default if key does not exist""" * return getattr(self, self._check_key(key), default) # <<<<<<<<<<<<<< * * @staticmethod */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_check_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_key}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_2 = __Pyx_GetAttr3(__pyx_v_self, __pyx_t_1, __pyx_v_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "borg/item.pyx":94 * return self._check_key(key) in self._dict * * def get(self, key, default=None): # <<<<<<<<<<<<<< * """get value for key, return default if key does not exist""" * return getattr(self, self._check_key(key), default) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("borg.item.PropDict.get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/item.pyx":98 * return getattr(self, self._check_key(key), default) * * @staticmethod # <<<<<<<<<<<<<< * def _make_property(key, value_type, value_type_name=None, encode=None, decode=None): * """return a property that deals with self._dict[key]""" */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_4item_8PropDict_19_make_property(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_4item_8PropDict_18_make_property, "return a property that deals with self._dict[key]"); static PyMethodDef __pyx_mdef_4borg_4item_8PropDict_19_make_property = {"_make_property", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_4item_8PropDict_19_make_property, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_4item_8PropDict_18_make_property}; static PyObject *__pyx_pw_4borg_4item_8PropDict_19_make_property(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_key = 0; PyObject *__pyx_v_value_type = 0; PyObject *__pyx_v_value_type_name = 0; PyObject *__pyx_v_encode = 0; PyObject *__pyx_v_decode = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_make_property (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_value_type,&__pyx_n_s_value_type_name,&__pyx_n_s_encode,&__pyx_n_s_decode,0}; /* "borg/item.pyx":99 * * @staticmethod * def _make_property(key, value_type, value_type_name=None, encode=None, decode=None): # <<<<<<<<<<<<<< * """return a property that deals with self._dict[key]""" * assert isinstance(key, str) */ values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_key)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("_make_property", 0, 2, 5, 1); __PYX_ERR(0, 98, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value_type_name); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_encode); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_decode); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_make_property") < 0)) __PYX_ERR(0, 98, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_key = values[0]; __pyx_v_value_type = values[1]; __pyx_v_value_type_name = values[2]; __pyx_v_encode = values[3]; __pyx_v_decode = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_make_property", 0, 2, 5, __pyx_nargs); __PYX_ERR(0, 98, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.item.PropDict._make_property", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_4item_8PropDict_18_make_property(__pyx_self, __pyx_v_key, __pyx_v_value_type, __pyx_v_value_type_name, __pyx_v_encode, __pyx_v_decode); /* "borg/item.pyx":98 * return getattr(self, self._check_key(key), default) * * @staticmethod # <<<<<<<<<<<<<< * def _make_property(key, value_type, value_type_name=None, encode=None, decode=None): * """return a property that deals with self._dict[key]""" */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/item.pyx":108 * attr_error_msg = "attribute %s not found" % key * * def _get(self): # <<<<<<<<<<<<<< * try: * value = self._dict[key] */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_4item_8PropDict_14_make_property_1_get(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_4item_8PropDict_14_make_property_1_get = {"_get", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_4item_8PropDict_14_make_property_1_get, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_4item_8PropDict_14_make_property_1_get(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_get (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_get") < 0)) __PYX_ERR(0, 108, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_get", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 108, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.item.PropDict._make_property._get", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_4item_8PropDict_14_make_property__get(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_4item_8PropDict_14_make_property__get(PyObject *__pyx_self, PyObject *__pyx_v_self) { struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property *__pyx_cur_scope; struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property *__pyx_outer_scope; PyObject *__pyx_v_value = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get", 1); __pyx_outer_scope = (struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; /* "borg/item.pyx":109 * * def _get(self): * try: # <<<<<<<<<<<<<< * value = self._dict[key] * except KeyError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "borg/item.pyx":110 * def _get(self): * try: * value = self._dict[key] # <<<<<<<<<<<<<< * except KeyError: * raise AttributeError(attr_error_msg) from None */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 110, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(!__pyx_cur_scope->__pyx_v_key)) { __Pyx_RaiseClosureNameError("key"); __PYX_ERR(0, 110, __pyx_L3_error) } __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_cur_scope->__pyx_v_key); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 110, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_value = __pyx_t_5; __pyx_t_5 = 0; /* "borg/item.pyx":109 * * def _get(self): * try: # <<<<<<<<<<<<<< * value = self._dict[key] * except KeyError: */ } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/item.pyx":111 * try: * value = self._dict[key] * except KeyError: # <<<<<<<<<<<<<< * raise AttributeError(attr_error_msg) from None * if decode is not None: */ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_6) { __Pyx_AddTraceback("borg.item.PropDict._make_property._get", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(0, 111, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_7); /* "borg/item.pyx":112 * value = self._dict[key] * except KeyError: * raise AttributeError(attr_error_msg) from None # <<<<<<<<<<<<<< * if decode is not None: * value = decode(value) */ if (unlikely(!__pyx_cur_scope->__pyx_v_attr_error_msg)) { __Pyx_RaiseClosureNameError("attr_error_msg"); __PYX_ERR(0, 112, __pyx_L5_except_error) } __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AttributeError, __pyx_cur_scope->__pyx_v_attr_error_msg); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 112, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, Py_None); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(0, 112, __pyx_L5_except_error) } goto __pyx_L5_except_error; /* "borg/item.pyx":109 * * def _get(self): * try: # <<<<<<<<<<<<<< * value = self._dict[key] * except KeyError: */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L8_try_end:; } /* "borg/item.pyx":113 * except KeyError: * raise AttributeError(attr_error_msg) from None * if decode is not None: # <<<<<<<<<<<<<< * value = decode(value) * return value */ if (unlikely(!__pyx_cur_scope->__pyx_v_decode)) { __Pyx_RaiseClosureNameError("decode"); __PYX_ERR(0, 113, __pyx_L1_error) } __pyx_t_9 = (__pyx_cur_scope->__pyx_v_decode != Py_None); if (__pyx_t_9) { /* "borg/item.pyx":114 * raise AttributeError(attr_error_msg) from None * if decode is not None: * value = decode(value) # <<<<<<<<<<<<<< * return value * */ if (unlikely(!__pyx_cur_scope->__pyx_v_decode)) { __Pyx_RaiseClosureNameError("decode"); __PYX_ERR(0, 114, __pyx_L1_error) } __Pyx_INCREF(__pyx_cur_scope->__pyx_v_decode); __pyx_t_4 = __pyx_cur_scope->__pyx_v_decode; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_value}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_7); __pyx_t_7 = 0; /* "borg/item.pyx":113 * except KeyError: * raise AttributeError(attr_error_msg) from None * if decode is not None: # <<<<<<<<<<<<<< * value = decode(value) * return value */ } /* "borg/item.pyx":115 * if decode is not None: * value = decode(value) * return value # <<<<<<<<<<<<<< * * def _set(self, value): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_value); __pyx_r = __pyx_v_value; goto __pyx_L0; /* "borg/item.pyx":108 * attr_error_msg = "attribute %s not found" % key * * def _get(self): # <<<<<<<<<<<<<< * try: * value = self._dict[key] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("borg.item.PropDict._make_property._get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_value); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/item.pyx":117 * return value * * def _set(self, value): # <<<<<<<<<<<<<< * if not isinstance(value, value_type): * raise TypeError(type_error_msg) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_4item_8PropDict_14_make_property_3_set(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_4item_8PropDict_14_make_property_3_set = {"_set", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_4item_8PropDict_14_make_property_3_set, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_4item_8PropDict_14_make_property_3_set(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_value = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_set (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_value,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 117, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 117, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("_set", 1, 2, 2, 1); __PYX_ERR(0, 117, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_set") < 0)) __PYX_ERR(0, 117, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_value = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_set", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 117, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.item.PropDict._make_property._set", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_4item_8PropDict_14_make_property_2_set(__pyx_self, __pyx_v_self, __pyx_v_value); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_4item_8PropDict_14_make_property_2_set(PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value) { struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property *__pyx_cur_scope; struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property *__pyx_outer_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_set", 0); __pyx_outer_scope = (struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; __Pyx_INCREF(__pyx_v_value); /* "borg/item.pyx":118 * * def _set(self, value): * if not isinstance(value, value_type): # <<<<<<<<<<<<<< * raise TypeError(type_error_msg) * if encode is not None: */ if (unlikely(!__pyx_cur_scope->__pyx_v_value_type)) { __Pyx_RaiseClosureNameError("value_type"); __PYX_ERR(0, 118, __pyx_L1_error) } __pyx_t_1 = __pyx_cur_scope->__pyx_v_value_type; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_value, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (!__pyx_t_2); if (unlikely(__pyx_t_3)) { /* "borg/item.pyx":119 * def _set(self, value): * if not isinstance(value, value_type): * raise TypeError(type_error_msg) # <<<<<<<<<<<<<< * if encode is not None: * value = encode(value) */ if (unlikely(!__pyx_cur_scope->__pyx_v_type_error_msg)) { __Pyx_RaiseClosureNameError("type_error_msg"); __PYX_ERR(0, 119, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_cur_scope->__pyx_v_type_error_msg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 119, __pyx_L1_error) /* "borg/item.pyx":118 * * def _set(self, value): * if not isinstance(value, value_type): # <<<<<<<<<<<<<< * raise TypeError(type_error_msg) * if encode is not None: */ } /* "borg/item.pyx":120 * if not isinstance(value, value_type): * raise TypeError(type_error_msg) * if encode is not None: # <<<<<<<<<<<<<< * value = encode(value) * self._dict[key] = value */ if (unlikely(!__pyx_cur_scope->__pyx_v_encode)) { __Pyx_RaiseClosureNameError("encode"); __PYX_ERR(0, 120, __pyx_L1_error) } __pyx_t_3 = (__pyx_cur_scope->__pyx_v_encode != Py_None); if (__pyx_t_3) { /* "borg/item.pyx":121 * raise TypeError(type_error_msg) * if encode is not None: * value = encode(value) # <<<<<<<<<<<<<< * self._dict[key] = value * */ if (unlikely(!__pyx_cur_scope->__pyx_v_encode)) { __Pyx_RaiseClosureNameError("encode"); __PYX_ERR(0, 121, __pyx_L1_error) } __Pyx_INCREF(__pyx_cur_scope->__pyx_v_encode); __pyx_t_4 = __pyx_cur_scope->__pyx_v_encode; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; /* "borg/item.pyx":120 * if not isinstance(value, value_type): * raise TypeError(type_error_msg) * if encode is not None: # <<<<<<<<<<<<<< * value = encode(value) * self._dict[key] = value */ } /* "borg/item.pyx":122 * if encode is not None: * value = encode(value) * self._dict[key] = value # <<<<<<<<<<<<<< * * def _del(self): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(!__pyx_cur_scope->__pyx_v_key)) { __Pyx_RaiseClosureNameError("key"); __PYX_ERR(0, 122, __pyx_L1_error) } if (unlikely((PyObject_SetItem(__pyx_t_1, __pyx_cur_scope->__pyx_v_key, __pyx_v_value) < 0))) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/item.pyx":117 * return value * * def _set(self, value): # <<<<<<<<<<<<<< * if not isinstance(value, value_type): * raise TypeError(type_error_msg) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("borg.item.PropDict._make_property._set", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_value); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/item.pyx":124 * self._dict[key] = value * * def _del(self): # <<<<<<<<<<<<<< * try: * del self._dict[key] */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_4item_8PropDict_14_make_property_5_del(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_4item_8PropDict_14_make_property_5_del = {"_del", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_4item_8PropDict_14_make_property_5_del, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_4item_8PropDict_14_make_property_5_del(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_del (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_del") < 0)) __PYX_ERR(0, 124, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_del", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 124, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.item.PropDict._make_property._del", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_4item_8PropDict_14_make_property_4_del(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_4item_8PropDict_14_make_property_4_del(PyObject *__pyx_self, PyObject *__pyx_v_self) { struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property *__pyx_cur_scope; struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property *__pyx_outer_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_del", 1); __pyx_outer_scope = (struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; /* "borg/item.pyx":125 * * def _del(self): * try: # <<<<<<<<<<<<<< * del self._dict[key] * except KeyError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "borg/item.pyx":126 * def _del(self): * try: * del self._dict[key] # <<<<<<<<<<<<<< * except KeyError: * raise AttributeError(attr_error_msg) from None */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(!__pyx_cur_scope->__pyx_v_key)) { __Pyx_RaiseClosureNameError("key"); __PYX_ERR(0, 126, __pyx_L3_error) } if (unlikely((PyObject_DelItem(__pyx_t_4, __pyx_cur_scope->__pyx_v_key) < 0))) __PYX_ERR(0, 126, __pyx_L3_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "borg/item.pyx":125 * * def _del(self): * try: # <<<<<<<<<<<<<< * del self._dict[key] * except KeyError: */ } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /* "borg/item.pyx":127 * try: * del self._dict[key] * except KeyError: # <<<<<<<<<<<<<< * raise AttributeError(attr_error_msg) from None * */ __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_5) { __Pyx_AddTraceback("borg.item.PropDict._make_property._del", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 127, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); /* "borg/item.pyx":128 * del self._dict[key] * except KeyError: * raise AttributeError(attr_error_msg) from None # <<<<<<<<<<<<<< * * return property(_get, _set, _del, doc=doc) */ if (unlikely(!__pyx_cur_scope->__pyx_v_attr_error_msg)) { __Pyx_RaiseClosureNameError("attr_error_msg"); __PYX_ERR(0, 128, __pyx_L5_except_error) } __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AttributeError, __pyx_cur_scope->__pyx_v_attr_error_msg); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 128, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, Py_None); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(0, 128, __pyx_L5_except_error) } goto __pyx_L5_except_error; /* "borg/item.pyx":125 * * def _del(self): * try: # <<<<<<<<<<<<<< * del self._dict[key] * except KeyError: */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L8_try_end:; } /* "borg/item.pyx":124 * self._dict[key] = value * * def _del(self): # <<<<<<<<<<<<<< * try: * del self._dict[key] */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("borg.item.PropDict._make_property._del", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/item.pyx":98 * return getattr(self, self._check_key(key), default) * * @staticmethod # <<<<<<<<<<<<<< * def _make_property(key, value_type, value_type_name=None, encode=None, decode=None): * """return a property that deals with self._dict[key]""" */ static PyObject *__pyx_pf_4borg_4item_8PropDict_18_make_property(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value_type, PyObject *__pyx_v_value_type_name, PyObject *__pyx_v_encode, PyObject *__pyx_v_decode) { struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property *__pyx_cur_scope; PyObject *__pyx_v_doc = NULL; PyObject *__pyx_v__get = 0; PyObject *__pyx_v__set = 0; PyObject *__pyx_v__del = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_make_property", 0); __pyx_cur_scope = (struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property *)__pyx_tp_new_4borg_4item___pyx_scope_struct___make_property(__pyx_ptype_4borg_4item___pyx_scope_struct___make_property, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 98, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_key = __pyx_v_key; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_key); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_key); __pyx_cur_scope->__pyx_v_value_type = __pyx_v_value_type; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value_type); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_value_type); __pyx_cur_scope->__pyx_v_encode = __pyx_v_encode; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_encode); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_encode); __pyx_cur_scope->__pyx_v_decode = __pyx_v_decode; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_decode); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_decode); __Pyx_INCREF(__pyx_v_value_type_name); /* "borg/item.pyx":101 * def _make_property(key, value_type, value_type_name=None, encode=None, decode=None): * """return a property that deals with self._dict[key]""" * assert isinstance(key, str) # <<<<<<<<<<<<<< * if value_type_name is None: * value_type_name = value_type.__name__ */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = __pyx_cur_scope->__pyx_v_key; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = PyString_Check(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 101, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 101, __pyx_L1_error) #endif /* "borg/item.pyx":102 * """return a property that deals with self._dict[key]""" * assert isinstance(key, str) * if value_type_name is None: # <<<<<<<<<<<<<< * value_type_name = value_type.__name__ * doc = "%s (%s)" % (key, value_type_name) */ __pyx_t_2 = (__pyx_v_value_type_name == Py_None); if (__pyx_t_2) { /* "borg/item.pyx":103 * assert isinstance(key, str) * if value_type_name is None: * value_type_name = value_type.__name__ # <<<<<<<<<<<<<< * doc = "%s (%s)" % (key, value_type_name) * type_error_msg = "%s value must be %s" % (key, value_type_name) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_value_type, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_value_type_name, __pyx_t_1); __pyx_t_1 = 0; /* "borg/item.pyx":102 * """return a property that deals with self._dict[key]""" * assert isinstance(key, str) * if value_type_name is None: # <<<<<<<<<<<<<< * value_type_name = value_type.__name__ * doc = "%s (%s)" % (key, value_type_name) */ } /* "borg/item.pyx":104 * if value_type_name is None: * value_type_name = value_type.__name__ * doc = "%s (%s)" % (key, value_type_name) # <<<<<<<<<<<<<< * type_error_msg = "%s value must be %s" % (key, value_type_name) * attr_error_msg = "attribute %s not found" % key */ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_key); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_key); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_key)) __PYX_ERR(0, 104, __pyx_L1_error); __Pyx_INCREF(__pyx_v_value_type_name); __Pyx_GIVEREF(__pyx_v_value_type_name); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_value_type_name)) __PYX_ERR(0, 104, __pyx_L1_error); __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_doc = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "borg/item.pyx":105 * value_type_name = value_type.__name__ * doc = "%s (%s)" % (key, value_type_name) * type_error_msg = "%s value must be %s" % (key, value_type_name) # <<<<<<<<<<<<<< * attr_error_msg = "attribute %s not found" % key * */ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_key); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_key); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_key)) __PYX_ERR(0, 105, __pyx_L1_error); __Pyx_INCREF(__pyx_v_value_type_name); __Pyx_GIVEREF(__pyx_v_value_type_name); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_value_type_name)) __PYX_ERR(0, 105, __pyx_L1_error); __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_value_must_be_s, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_type_error_msg = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "borg/item.pyx":106 * doc = "%s (%s)" % (key, value_type_name) * type_error_msg = "%s value must be %s" % (key, value_type_name) * attr_error_msg = "attribute %s not found" % key # <<<<<<<<<<<<<< * * def _get(self): */ __pyx_t_1 = __Pyx_PyString_FormatSafe(__pyx_kp_s_attribute_s_not_found, __pyx_cur_scope->__pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_attr_error_msg = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "borg/item.pyx":108 * attr_error_msg = "attribute %s not found" % key * * def _get(self): # <<<<<<<<<<<<<< * try: * value = self._dict[key] */ __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_8PropDict_14_make_property_1_get, 0, __pyx_n_s_PropDict__make_property_locals, ((PyObject*)__pyx_cur_scope), __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v__get = __pyx_t_1; __pyx_t_1 = 0; /* "borg/item.pyx":117 * return value * * def _set(self, value): # <<<<<<<<<<<<<< * if not isinstance(value, value_type): * raise TypeError(type_error_msg) */ __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_8PropDict_14_make_property_3_set, 0, __pyx_n_s_PropDict__make_property_locals_2, ((PyObject*)__pyx_cur_scope), __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v__set = __pyx_t_1; __pyx_t_1 = 0; /* "borg/item.pyx":124 * self._dict[key] = value * * def _del(self): # <<<<<<<<<<<<<< * try: * del self._dict[key] */ __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_8PropDict_14_make_property_5_del, 0, __pyx_n_s_PropDict__make_property_locals_3, ((PyObject*)__pyx_cur_scope), __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v__del = __pyx_t_1; __pyx_t_1 = 0; /* "borg/item.pyx":130 * raise AttributeError(attr_error_msg) from None * * return property(_get, _set, _del, doc=doc) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v__get); __Pyx_GIVEREF(__pyx_v__get); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__get)) __PYX_ERR(0, 130, __pyx_L1_error); __Pyx_INCREF(__pyx_v__set); __Pyx_GIVEREF(__pyx_v__set); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v__set)) __PYX_ERR(0, 130, __pyx_L1_error); __Pyx_INCREF(__pyx_v__del); __Pyx_GIVEREF(__pyx_v__del); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v__del)) __PYX_ERR(0, 130, __pyx_L1_error); __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_doc, __pyx_v_doc) < 0) __PYX_ERR(0, 130, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "borg/item.pyx":98 * return getattr(self, self._check_key(key), default) * * @staticmethod # <<<<<<<<<<<<<< * def _make_property(key, value_type, value_type_name=None, encode=None, decode=None): * """return a property that deals with self._dict[key]""" */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("borg.item.PropDict._make_property", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_doc); __Pyx_XDECREF(__pyx_v__get); __Pyx_XDECREF(__pyx_v__set); __Pyx_XDECREF(__pyx_v__del); __Pyx_XDECREF(__pyx_v_value_type_name); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/item.pyx":196 * part = PropDict._make_property('part', int) * * def get_size(self, hardlink_masters=None, memorize=False, compressed=False, from_chunks=False, consider_ids=None): # <<<<<<<<<<<<<< * """ * Determine the (uncompressed or compressed) size of this item. */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_4item_4Item_1get_size(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_4item_4Item_get_size, "\n Determine the (uncompressed or compressed) size of this item.\n\n :param hardlink_masters: If given, the size of hardlink slaves is computed via the hardlink master's chunk list,\n otherwise size will be returned as 0.\n :param memorize: Whether the computed size value will be stored into the item.\n :param compressed: Whether the compressed or uncompressed size will be returned.\n :param from_chunks: If true, size is computed from chunks even if a precomputed value is available.\n :param consider_ids: Returns the size of the given ids only.\n "); static PyMethodDef __pyx_mdef_4borg_4item_4Item_1get_size = {"get_size", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_4item_4Item_1get_size, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_4item_4Item_get_size}; static PyObject *__pyx_pw_4borg_4item_4Item_1get_size(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_hardlink_masters = 0; PyObject *__pyx_v_memorize = 0; PyObject *__pyx_v_compressed = 0; PyObject *__pyx_v_from_chunks = 0; PyObject *__pyx_v_consider_ids = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[6] = {0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_size (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_hardlink_masters,&__pyx_n_s_memorize,&__pyx_n_s_compressed,&__pyx_n_s_from_chunks,&__pyx_n_s_consider_ids,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 196, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hardlink_masters); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 196, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_memorize); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 196, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_compressed); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 196, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_from_chunks); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 196, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_consider_ids); if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 196, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_size") < 0)) __PYX_ERR(0, 196, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_hardlink_masters = values[1]; __pyx_v_memorize = values[2]; __pyx_v_compressed = values[3]; __pyx_v_from_chunks = values[4]; __pyx_v_consider_ids = values[5]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_size", 0, 1, 6, __pyx_nargs); __PYX_ERR(0, 196, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.item.Item.get_size", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_4item_4Item_get_size(__pyx_self, __pyx_v_self, __pyx_v_hardlink_masters, __pyx_v_memorize, __pyx_v_compressed, __pyx_v_from_chunks, __pyx_v_consider_ids); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_4borg_4item_4Item_8get_size_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "borg/item.pyx":242 * return 0 * if consider_ids is not None: * size = sum(getattr(ChunkListEntry(*chunk), attr) for chunk in chunks if chunk.id in consider_ids) # <<<<<<<<<<<<<< * else: * size = sum(getattr(ChunkListEntry(*chunk), attr) for chunk in chunks) */ static PyObject *__pyx_pf_4borg_4item_4Item_8get_size_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { struct __pyx_obj_4borg_4item___pyx_scope_struct_2_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); __pyx_cur_scope = (struct __pyx_obj_4borg_4item___pyx_scope_struct_2_genexpr *)__pyx_tp_new_4borg_4item___pyx_scope_struct_2_genexpr(__pyx_ptype_4borg_4item___pyx_scope_struct_2_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_4borg_4item___pyx_scope_struct_2_genexpr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 242, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4borg_4item___pyx_scope_struct_1_get_size *) __pyx_self; __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4borg_4item_4Item_8get_size_2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Item_get_size_locals_genexpr, __pyx_n_s_borg_item); if (unlikely(!gen)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.item.Item.get_size.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_4borg_4item_4Item_8get_size_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_4borg_4item___pyx_scope_struct_2_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4borg_4item___pyx_scope_struct_2_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L7_resume_from_yield; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 242, __pyx_L1_error) if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 242, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 242, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 242, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 242, __pyx_L1_error) #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 242, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 242, __pyx_L1_error) #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 242, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_chunk); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_chunk, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_chunk, __pyx_n_s_id); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_consider_ids)) { __Pyx_RaiseClosureNameError("consider_ids"); __PYX_ERR(0, 242, __pyx_L1_error) } __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_consider_ids, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ChunkListEntry); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_cur_scope->__pyx_v_chunk); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_attr)) { __Pyx_RaiseClosureNameError("attr"); __PYX_ERR(0, 242, __pyx_L1_error) } __pyx_t_6 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_attr; __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = __Pyx_GetAttr(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; __Pyx_XGIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; __pyx_cur_scope->__pyx_t_2 = __pyx_t_3; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, yielding value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L7_resume_from_yield:; __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 242, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_4borg_4item_4Item_8get_size_5generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "borg/item.pyx":244 * size = sum(getattr(ChunkListEntry(*chunk), attr) for chunk in chunks if chunk.id in consider_ids) * else: * size = sum(getattr(ChunkListEntry(*chunk), attr) for chunk in chunks) # <<<<<<<<<<<<<< * # if requested, memorize the precomputed (c)size for items that have an own chunks list: * if memorize and having_chunks: */ static PyObject *__pyx_pf_4borg_4item_4Item_8get_size_3genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { struct __pyx_obj_4borg_4item___pyx_scope_struct_3_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); __pyx_cur_scope = (struct __pyx_obj_4borg_4item___pyx_scope_struct_3_genexpr *)__pyx_tp_new_4borg_4item___pyx_scope_struct_3_genexpr(__pyx_ptype_4borg_4item___pyx_scope_struct_3_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_4borg_4item___pyx_scope_struct_3_genexpr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 244, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4borg_4item___pyx_scope_struct_1_get_size *) __pyx_self; __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4borg_4item_4Item_8get_size_5generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Item_get_size_locals_genexpr, __pyx_n_s_borg_item); if (unlikely(!gen)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.item.Item.get_size.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_4borg_4item_4Item_8get_size_5generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_4borg_4item___pyx_scope_struct_3_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4borg_4item___pyx_scope_struct_3_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L6_resume_from_yield; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 244, __pyx_L1_error) if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 244, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 244, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 244, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 244, __pyx_L1_error) #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 244, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 244, __pyx_L1_error) #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 244, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_chunk); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_chunk, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ChunkListEntry); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_cur_scope->__pyx_v_chunk); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_attr)) { __Pyx_RaiseClosureNameError("attr"); __PYX_ERR(0, 244, __pyx_L1_error) } __pyx_t_5 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_attr; __Pyx_INCREF(__pyx_t_5); __pyx_t_4 = __Pyx_GetAttr(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; __Pyx_XGIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; __pyx_cur_scope->__pyx_t_2 = __pyx_t_3; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, yielding value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L6_resume_from_yield:; __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 244, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/item.pyx":196 * part = PropDict._make_property('part', int) * * def get_size(self, hardlink_masters=None, memorize=False, compressed=False, from_chunks=False, consider_ids=None): # <<<<<<<<<<<<<< * """ * Determine the (uncompressed or compressed) size of this item. */ static PyObject *__pyx_pf_4borg_4item_4Item_get_size(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_hardlink_masters, PyObject *__pyx_v_memorize, PyObject *__pyx_v_compressed, PyObject *__pyx_v_from_chunks, PyObject *__pyx_v_consider_ids) { struct __pyx_obj_4borg_4item___pyx_scope_struct_1_get_size *__pyx_cur_scope; PyObject *__pyx_v_size = NULL; PyObject *__pyx_v_chunks = NULL; int __pyx_v_having_chunks; PyObject *__pyx_v_master = NULL; CYTHON_UNUSED PyObject *__pyx_v__ = NULL; PyObject *__pyx_gb_4borg_4item_4Item_8get_size_2generator = 0; PyObject *__pyx_gb_4borg_4item_4Item_8get_size_5generator1 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; Py_ssize_t __pyx_t_14; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; PyObject *__pyx_t_22 = NULL; PyObject *__pyx_t_23 = NULL; PyObject *(*__pyx_t_24)(PyObject *); int __pyx_t_25; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_size", 0); __pyx_cur_scope = (struct __pyx_obj_4borg_4item___pyx_scope_struct_1_get_size *)__pyx_tp_new_4borg_4item___pyx_scope_struct_1_get_size(__pyx_ptype_4borg_4item___pyx_scope_struct_1_get_size, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_4borg_4item___pyx_scope_struct_1_get_size *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 196, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_consider_ids = __pyx_v_consider_ids; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_consider_ids); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_consider_ids); /* "borg/item.pyx":207 * :param consider_ids: Returns the size of the given ids only. * """ * attr = 'csize' if compressed else 'size' # <<<<<<<<<<<<<< * assert not (compressed and memorize), 'Item does not have a csize field.' * assert not (consider_ids is not None and memorize), "Can't store size when considering only certain ids" */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_compressed); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 207, __pyx_L1_error) if (__pyx_t_2) { __Pyx_INCREF(__pyx_n_s_csize); __pyx_t_1 = __pyx_n_s_csize; } else { __Pyx_INCREF(__pyx_n_s_size); __pyx_t_1 = __pyx_n_s_size; } __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_attr = __pyx_t_1; __pyx_t_1 = 0; /* "borg/item.pyx":208 * """ * attr = 'csize' if compressed else 'size' * assert not (compressed and memorize), 'Item does not have a csize field.' # <<<<<<<<<<<<<< * assert not (consider_ids is not None and memorize), "Can't store size when considering only certain ids" * try: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_compressed); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 208, __pyx_L1_error) if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L3_bool_binop_done; } __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_memorize); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 208, __pyx_L1_error) __pyx_t_2 = __pyx_t_3; __pyx_L3_bool_binop_done:; __pyx_t_3 = (!__pyx_t_2); if (unlikely(!__pyx_t_3)) { __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_kp_s_Item_does_not_have_a_csize_field, 0, 0); __PYX_ERR(0, 208, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 208, __pyx_L1_error) #endif /* "borg/item.pyx":209 * attr = 'csize' if compressed else 'size' * assert not (compressed and memorize), 'Item does not have a csize field.' * assert not (consider_ids is not None and memorize), "Can't store size when considering only certain ids" # <<<<<<<<<<<<<< * try: * if from_chunks or consider_ids is not None: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_2 = (__pyx_cur_scope->__pyx_v_consider_ids != Py_None); if (__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; goto __pyx_L5_bool_binop_done; } __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_memorize); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 209, __pyx_L1_error) __pyx_t_3 = __pyx_t_2; __pyx_L5_bool_binop_done:; __pyx_t_2 = (!__pyx_t_3); if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_kp_s_Can_t_store_size_when_considerin, 0, 0); __PYX_ERR(0, 209, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 209, __pyx_L1_error) #endif /* "borg/item.pyx":210 * assert not (compressed and memorize), 'Item does not have a csize field.' * assert not (consider_ids is not None and memorize), "Can't store size when considering only certain ids" * try: # <<<<<<<<<<<<<< * if from_chunks or consider_ids is not None: * raise AttributeError */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); /*try:*/ { /* "borg/item.pyx":211 * assert not (consider_ids is not None and memorize), "Can't store size when considering only certain ids" * try: * if from_chunks or consider_ids is not None: # <<<<<<<<<<<<<< * raise AttributeError * size = getattr(self, attr) */ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_from_chunks); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 211, __pyx_L7_error) if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L14_bool_binop_done; } __pyx_t_3 = (__pyx_cur_scope->__pyx_v_consider_ids != Py_None); __pyx_t_2 = __pyx_t_3; __pyx_L14_bool_binop_done:; if (unlikely(__pyx_t_2)) { /* "borg/item.pyx":212 * try: * if from_chunks or consider_ids is not None: * raise AttributeError # <<<<<<<<<<<<<< * size = getattr(self, attr) * except AttributeError: */ __Pyx_Raise(__pyx_builtin_AttributeError, 0, 0, 0); __PYX_ERR(0, 212, __pyx_L7_error) /* "borg/item.pyx":211 * assert not (consider_ids is not None and memorize), "Can't store size when considering only certain ids" * try: * if from_chunks or consider_ids is not None: # <<<<<<<<<<<<<< * raise AttributeError * size = getattr(self, attr) */ } /* "borg/item.pyx":213 * if from_chunks or consider_ids is not None: * raise AttributeError * size = getattr(self, attr) # <<<<<<<<<<<<<< * except AttributeError: * if stat.S_ISLNK(self.mode): */ __pyx_t_1 = __pyx_cur_scope->__pyx_v_attr; __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = __Pyx_GetAttr(__pyx_v_self, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 213, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_7; __pyx_t_7 = 0; /* "borg/item.pyx":210 * assert not (compressed and memorize), 'Item does not have a csize field.' * assert not (consider_ids is not None and memorize), "Can't store size when considering only certain ids" * try: # <<<<<<<<<<<<<< * if from_chunks or consider_ids is not None: * raise AttributeError */ } __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L12_try_end; __pyx_L7_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/item.pyx":214 * raise AttributeError * size = getattr(self, attr) * except AttributeError: # <<<<<<<<<<<<<< * if stat.S_ISLNK(self.mode): * # get out of here quickly. symlinks have no own chunks, their fs size is the length of the target name. */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError); if (__pyx_t_8) { __Pyx_AddTraceback("borg.item.Item.get_size", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_1, &__pyx_t_9) < 0) __PYX_ERR(0, 214, __pyx_L9_except_error) __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_9); /* "borg/item.pyx":215 * size = getattr(self, attr) * except AttributeError: * if stat.S_ISLNK(self.mode): # <<<<<<<<<<<<<< * # get out of here quickly. symlinks have no own chunks, their fs size is the length of the target name. * # also, there is the dual-use issue of .source (#2343), so don't confuse it with a hardlink slave. */ __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_stat); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 215, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_S_ISLNK); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 215, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 215, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_13 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_12))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_11}; __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 215, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 215, __pyx_L9_except_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_2) { /* "borg/item.pyx":218 * # get out of here quickly. symlinks have no own chunks, their fs size is the length of the target name. * # also, there is the dual-use issue of .source (#2343), so don't confuse it with a hardlink slave. * return len(self.source) # <<<<<<<<<<<<<< * # no precomputed (c)size value available, compute it: * try: */ __Pyx_XDECREF(__pyx_r); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_source); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 218, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_14 = PyObject_Length(__pyx_t_10); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 218, __pyx_L9_except_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = PyInt_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 218, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_10); __pyx_r = __pyx_t_10; __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L10_except_return; /* "borg/item.pyx":215 * size = getattr(self, attr) * except AttributeError: * if stat.S_ISLNK(self.mode): # <<<<<<<<<<<<<< * # get out of here quickly. symlinks have no own chunks, their fs size is the length of the target name. * # also, there is the dual-use issue of .source (#2343), so don't confuse it with a hardlink slave. */ } /* "borg/item.pyx":220 * return len(self.source) * # no precomputed (c)size value available, compute it: * try: # <<<<<<<<<<<<<< * chunks = getattr(self, 'chunks') * having_chunks = True */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); /*try:*/ { /* "borg/item.pyx":221 * # no precomputed (c)size value available, compute it: * try: * chunks = getattr(self, 'chunks') # <<<<<<<<<<<<<< * having_chunks = True * except AttributeError: */ __pyx_t_10 = __Pyx_GetAttr(__pyx_v_self, __pyx_n_s_chunks); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 221, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_10); __pyx_v_chunks = __pyx_t_10; __pyx_t_10 = 0; /* "borg/item.pyx":222 * try: * chunks = getattr(self, 'chunks') * having_chunks = True # <<<<<<<<<<<<<< * except AttributeError: * having_chunks = False */ __pyx_v_having_chunks = 1; /* "borg/item.pyx":220 * return len(self.source) * # no precomputed (c)size value available, compute it: * try: # <<<<<<<<<<<<<< * chunks = getattr(self, 'chunks') * having_chunks = True */ } __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; goto __pyx_L26_try_end; __pyx_L19_error:; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; /* "borg/item.pyx":223 * chunks = getattr(self, 'chunks') * having_chunks = True * except AttributeError: # <<<<<<<<<<<<<< * having_chunks = False * # this item has no (own) chunks list, but if this is a hardlink slave */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError); if (__pyx_t_8) { __Pyx_AddTraceback("borg.item.Item.get_size", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_12, &__pyx_t_11) < 0) __PYX_ERR(0, 223, __pyx_L21_except_error) __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_11); /* "borg/item.pyx":224 * having_chunks = True * except AttributeError: * having_chunks = False # <<<<<<<<<<<<<< * # this item has no (own) chunks list, but if this is a hardlink slave * # and we know the master, we can still compute the size. */ __pyx_v_having_chunks = 0; /* "borg/item.pyx":227 * # this item has no (own) chunks list, but if this is a hardlink slave * # and we know the master, we can still compute the size. * if hardlink_masters is None: # <<<<<<<<<<<<<< * chunks = None * else: */ __pyx_t_2 = (__pyx_v_hardlink_masters == Py_None); if (__pyx_t_2) { /* "borg/item.pyx":228 * # and we know the master, we can still compute the size. * if hardlink_masters is None: * chunks = None # <<<<<<<<<<<<<< * else: * try: */ __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_chunks, Py_None); /* "borg/item.pyx":227 * # this item has no (own) chunks list, but if this is a hardlink slave * # and we know the master, we can still compute the size. * if hardlink_masters is None: # <<<<<<<<<<<<<< * chunks = None * else: */ goto __pyx_L29; } /* "borg/item.pyx":230 * chunks = None * else: * try: # <<<<<<<<<<<<<< * master = getattr(self, 'source') * except AttributeError: */ /*else*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); /*try:*/ { /* "borg/item.pyx":231 * else: * try: * master = getattr(self, 'source') # <<<<<<<<<<<<<< * except AttributeError: * # not a hardlink slave, likely a directory or special file w/o chunks */ __pyx_t_13 = __Pyx_GetAttr(__pyx_v_self, __pyx_n_s_source); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 231, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_13); __pyx_v_master = __pyx_t_13; __pyx_t_13 = 0; /* "borg/item.pyx":230 * chunks = None * else: * try: # <<<<<<<<<<<<<< * master = getattr(self, 'source') * except AttributeError: */ } /* "borg/item.pyx":238 * # hardlink slave, try to fetch hardlink master's chunks list * # todo: put precomputed size into hardlink_masters' values and use it, if present * chunks, _ = hardlink_masters.get(master, (None, None)) # <<<<<<<<<<<<<< * if chunks is None: * return 0 */ /*else:*/ { __pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_v_hardlink_masters, __pyx_n_s_get_2); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 238, __pyx_L32_except_error) __Pyx_GOTREF(__pyx_t_21); __pyx_t_22 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_21))) { __pyx_t_22 = PyMethod_GET_SELF(__pyx_t_21); if (likely(__pyx_t_22)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_21); __Pyx_INCREF(__pyx_t_22); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_21, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_22, __pyx_v_master, __pyx_tuple__9}; __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_21, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 238, __pyx_L32_except_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; } if ((likely(PyTuple_CheckExact(__pyx_t_13))) || (PyList_CheckExact(__pyx_t_13))) { PyObject* sequence = __pyx_t_13; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 238, __pyx_L32_except_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_21 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_22 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_21 = PyList_GET_ITEM(sequence, 0); __pyx_t_22 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_21); __Pyx_INCREF(__pyx_t_22); #else __pyx_t_21 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 238, __pyx_L32_except_error) __Pyx_GOTREF(__pyx_t_21); __pyx_t_22 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 238, __pyx_L32_except_error) __Pyx_GOTREF(__pyx_t_22); #endif __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } else { Py_ssize_t index = -1; __pyx_t_23 = PyObject_GetIter(__pyx_t_13); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 238, __pyx_L32_except_error) __Pyx_GOTREF(__pyx_t_23); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_24 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_23); index = 0; __pyx_t_21 = __pyx_t_24(__pyx_t_23); if (unlikely(!__pyx_t_21)) goto __pyx_L38_unpacking_failed; __Pyx_GOTREF(__pyx_t_21); index = 1; __pyx_t_22 = __pyx_t_24(__pyx_t_23); if (unlikely(!__pyx_t_22)) goto __pyx_L38_unpacking_failed; __Pyx_GOTREF(__pyx_t_22); if (__Pyx_IternextUnpackEndCheck(__pyx_t_24(__pyx_t_23), 2) < 0) __PYX_ERR(0, 238, __pyx_L32_except_error) __pyx_t_24 = NULL; __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; goto __pyx_L39_unpacking_done; __pyx_L38_unpacking_failed:; __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; __pyx_t_24 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 238, __pyx_L32_except_error) __pyx_L39_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_chunks, __pyx_t_21); __pyx_t_21 = 0; __pyx_v__ = __pyx_t_22; __pyx_t_22 = 0; } __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; goto __pyx_L37_try_end; __pyx_L30_error:; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; /* "borg/item.pyx":232 * try: * master = getattr(self, 'source') * except AttributeError: # <<<<<<<<<<<<<< * # not a hardlink slave, likely a directory or special file w/o chunks * chunks = None */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError); if (__pyx_t_8) { __Pyx_AddTraceback("borg.item.Item.get_size", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_13, &__pyx_t_22, &__pyx_t_21) < 0) __PYX_ERR(0, 232, __pyx_L32_except_error) __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_21); /* "borg/item.pyx":234 * except AttributeError: * # not a hardlink slave, likely a directory or special file w/o chunks * chunks = None # <<<<<<<<<<<<<< * else: * # hardlink slave, try to fetch hardlink master's chunks list */ __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_chunks, Py_None); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; goto __pyx_L31_exception_handled; } goto __pyx_L32_except_error; /* "borg/item.pyx":230 * chunks = None * else: * try: # <<<<<<<<<<<<<< * master = getattr(self, 'source') * except AttributeError: */ __pyx_L32_except_error:; __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20); goto __pyx_L21_except_error; __pyx_L31_exception_handled:; __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20); __pyx_L37_try_end:; } } __pyx_L29:; /* "borg/item.pyx":239 * # todo: put precomputed size into hardlink_masters' values and use it, if present * chunks, _ = hardlink_masters.get(master, (None, None)) * if chunks is None: # <<<<<<<<<<<<<< * return 0 * if consider_ids is not None: */ __pyx_t_2 = (__pyx_v_chunks == Py_None); if (__pyx_t_2) { /* "borg/item.pyx":240 * chunks, _ = hardlink_masters.get(master, (None, None)) * if chunks is None: * return 0 # <<<<<<<<<<<<<< * if consider_ids is not None: * size = sum(getattr(ChunkListEntry(*chunk), attr) for chunk in chunks if chunk.id in consider_ids) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_int_0); __pyx_r = __pyx_int_0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; goto __pyx_L22_except_return; /* "borg/item.pyx":239 * # todo: put precomputed size into hardlink_masters' values and use it, if present * chunks, _ = hardlink_masters.get(master, (None, None)) * if chunks is None: # <<<<<<<<<<<<<< * return 0 * if consider_ids is not None: */ } __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L20_exception_handled; } goto __pyx_L21_except_error; /* "borg/item.pyx":220 * return len(self.source) * # no precomputed (c)size value available, compute it: * try: # <<<<<<<<<<<<<< * chunks = getattr(self, 'chunks') * having_chunks = True */ __pyx_L21_except_error:; __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); goto __pyx_L9_except_error; __pyx_L22_except_return:; __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); goto __pyx_L10_except_return; __pyx_L20_exception_handled:; __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); __pyx_L26_try_end:; } /* "borg/item.pyx":241 * if chunks is None: * return 0 * if consider_ids is not None: # <<<<<<<<<<<<<< * size = sum(getattr(ChunkListEntry(*chunk), attr) for chunk in chunks if chunk.id in consider_ids) * else: */ __pyx_t_2 = (__pyx_cur_scope->__pyx_v_consider_ids != Py_None); if (__pyx_t_2) { /* "borg/item.pyx":242 * return 0 * if consider_ids is not None: * size = sum(getattr(ChunkListEntry(*chunk), attr) for chunk in chunks if chunk.id in consider_ids) # <<<<<<<<<<<<<< * else: * size = sum(getattr(ChunkListEntry(*chunk), attr) for chunk in chunks) */ __pyx_t_11 = __pyx_pf_4borg_4item_4Item_8get_size_genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_chunks); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 242, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 242, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF_SET(__pyx_v_size, __pyx_t_12); __pyx_t_12 = 0; /* "borg/item.pyx":241 * if chunks is None: * return 0 * if consider_ids is not None: # <<<<<<<<<<<<<< * size = sum(getattr(ChunkListEntry(*chunk), attr) for chunk in chunks if chunk.id in consider_ids) * else: */ goto __pyx_L43; } /* "borg/item.pyx":244 * size = sum(getattr(ChunkListEntry(*chunk), attr) for chunk in chunks if chunk.id in consider_ids) * else: * size = sum(getattr(ChunkListEntry(*chunk), attr) for chunk in chunks) # <<<<<<<<<<<<<< * # if requested, memorize the precomputed (c)size for items that have an own chunks list: * if memorize and having_chunks: */ /*else*/ { __pyx_t_12 = __pyx_pf_4borg_4item_4Item_8get_size_3genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_chunks); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 244, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 244, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_v_size, __pyx_t_11); __pyx_t_11 = 0; } __pyx_L43:; /* "borg/item.pyx":246 * size = sum(getattr(ChunkListEntry(*chunk), attr) for chunk in chunks) * # if requested, memorize the precomputed (c)size for items that have an own chunks list: * if memorize and having_chunks: # <<<<<<<<<<<<<< * setattr(self, attr, size) * return size */ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_memorize); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 246, __pyx_L9_except_error) if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L45_bool_binop_done; } __pyx_t_2 = __pyx_v_having_chunks; __pyx_L45_bool_binop_done:; if (__pyx_t_2) { /* "borg/item.pyx":247 * # if requested, memorize the precomputed (c)size for items that have an own chunks list: * if memorize and having_chunks: * setattr(self, attr, size) # <<<<<<<<<<<<<< * return size * */ __pyx_t_11 = __pyx_cur_scope->__pyx_v_attr; __Pyx_INCREF(__pyx_t_11); __pyx_t_25 = PyObject_SetAttr(__pyx_v_self, __pyx_t_11, __pyx_v_size); if (unlikely(__pyx_t_25 == ((int)-1))) __PYX_ERR(0, 247, __pyx_L9_except_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "borg/item.pyx":246 * size = sum(getattr(ChunkListEntry(*chunk), attr) for chunk in chunks) * # if requested, memorize the precomputed (c)size for items that have an own chunks list: * if memorize and having_chunks: # <<<<<<<<<<<<<< * setattr(self, attr, size) * return size */ } __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L8_exception_handled; } goto __pyx_L9_except_error; /* "borg/item.pyx":210 * assert not (compressed and memorize), 'Item does not have a csize field.' * assert not (consider_ids is not None and memorize), "Can't store size when considering only certain ids" * try: # <<<<<<<<<<<<<< * if from_chunks or consider_ids is not None: * raise AttributeError */ __pyx_L9_except_error:; __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); goto __pyx_L1_error; __pyx_L10_except_return:; __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); goto __pyx_L0; __pyx_L8_exception_handled:; __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); __pyx_L12_try_end:; } /* "borg/item.pyx":248 * if memorize and having_chunks: * setattr(self, attr, size) * return size # <<<<<<<<<<<<<< * * def to_optr(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_size); __pyx_r = __pyx_v_size; goto __pyx_L0; /* "borg/item.pyx":196 * part = PropDict._make_property('part', int) * * def get_size(self, hardlink_masters=None, memorize=False, compressed=False, from_chunks=False, consider_ids=None): # <<<<<<<<<<<<<< * """ * Determine the (uncompressed or compressed) size of this item. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_21); __Pyx_XDECREF(__pyx_t_22); __Pyx_XDECREF(__pyx_t_23); __Pyx_AddTraceback("borg.item.Item.get_size", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_size); __Pyx_XDECREF(__pyx_v_chunks); __Pyx_XDECREF(__pyx_v_master); __Pyx_XDECREF(__pyx_v__); __Pyx_XDECREF(__pyx_gb_4borg_4item_4Item_8get_size_2generator); __Pyx_XDECREF(__pyx_gb_4borg_4item_4Item_8get_size_5generator1); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/item.pyx":250 * return size * * def to_optr(self): # <<<<<<<<<<<<<< * """ * Return an "object pointer" (optr), an opaque bag of bytes. */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_4item_4Item_3to_optr(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_4item_4Item_2to_optr, "\n Return an \"object pointer\" (optr), an opaque bag of bytes.\n The return value is effectively a reference to this object\n that can be passed exactly once to Item.from_optr to get this\n object back.\n\n to_optr/from_optr must be used symmetrically,\n don't call from_optr multiple times.\n\n This object can't be deallocated after a call to to_optr()\n until from_optr() is called.\n "); static PyMethodDef __pyx_mdef_4borg_4item_4Item_3to_optr = {"to_optr", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_4item_4Item_3to_optr, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_4item_4Item_2to_optr}; static PyObject *__pyx_pw_4borg_4item_4Item_3to_optr(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("to_optr (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 250, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_optr") < 0)) __PYX_ERR(0, 250, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("to_optr", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 250, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.item.Item.to_optr", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_4item_4Item_2to_optr(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_4item_4Item_2to_optr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("to_optr", 1); /* "borg/item.pyx":263 * until from_optr() is called. * """ * return _object_to_optr(self) # <<<<<<<<<<<<<< * * @classmethod */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = _object_to_optr(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/item.pyx":250 * return size * * def to_optr(self): # <<<<<<<<<<<<<< * """ * Return an "object pointer" (optr), an opaque bag of bytes. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("borg.item.Item.to_optr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/item.pyx":265 * return _object_to_optr(self) * * @classmethod # <<<<<<<<<<<<<< * def from_optr(self, optr): * return _optr_to_object(optr) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_4item_4Item_5from_optr(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_4item_4Item_5from_optr = {"from_optr", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_4item_4Item_5from_optr, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_4item_4Item_5from_optr(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_self = 0; PyObject *__pyx_v_optr = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("from_optr (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_optr,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 265, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_optr)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 265, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("from_optr", 1, 2, 2, 1); __PYX_ERR(0, 265, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "from_optr") < 0)) __PYX_ERR(0, 265, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_optr = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("from_optr", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 265, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.item.Item.from_optr", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_4item_4Item_4from_optr(__pyx_self, __pyx_v_self, __pyx_v_optr); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_4item_4Item_4from_optr(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_optr) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("from_optr", 1); /* "borg/item.pyx":267 * @classmethod * def from_optr(self, optr): * return _optr_to_object(optr) # <<<<<<<<<<<<<< * * @classmethod */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = _optr_to_object(__pyx_v_optr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/item.pyx":265 * return _object_to_optr(self) * * @classmethod # <<<<<<<<<<<<<< * def from_optr(self, optr): * return _optr_to_object(optr) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("borg.item.Item.from_optr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/item.pyx":269 * return _optr_to_object(optr) * * @classmethod # <<<<<<<<<<<<<< * def create_deleted(cls, path): * return cls(deleted=True, chunks=[], mode=0, path=path) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_4item_4Item_7create_deleted(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_4item_4Item_7create_deleted = {"create_deleted", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_4item_4Item_7create_deleted, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_4item_4Item_7create_deleted(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_cls = 0; PyObject *__pyx_v_path = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create_deleted (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_path,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cls)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_path)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("create_deleted", 1, 2, 2, 1); __PYX_ERR(0, 269, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "create_deleted") < 0)) __PYX_ERR(0, 269, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_cls = values[0]; __pyx_v_path = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create_deleted", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 269, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.item.Item.create_deleted", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_4item_4Item_6create_deleted(__pyx_self, __pyx_v_cls, __pyx_v_path); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_4item_4Item_6create_deleted(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_path) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_deleted", 1); /* "borg/item.pyx":271 * @classmethod * def create_deleted(cls, path): * return cls(deleted=True, chunks=[], mode=0, path=path) # <<<<<<<<<<<<<< * * def is_link(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_deleted, Py_True) < 0) __PYX_ERR(0, 271, __pyx_L1_error) __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_chunks, __pyx_t_2) < 0) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mode, __pyx_int_0) < 0) __PYX_ERR(0, 271, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_path, __pyx_v_path) < 0) __PYX_ERR(0, 271, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_cls, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "borg/item.pyx":269 * return _optr_to_object(optr) * * @classmethod # <<<<<<<<<<<<<< * def create_deleted(cls, path): * return cls(deleted=True, chunks=[], mode=0, path=path) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("borg.item.Item.create_deleted", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/item.pyx":273 * return cls(deleted=True, chunks=[], mode=0, path=path) * * def is_link(self): # <<<<<<<<<<<<<< * return self._is_type(stat.S_ISLNK) * */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_4item_4Item_9is_link(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_4item_4Item_9is_link = {"is_link", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_4item_4Item_9is_link, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_4item_4Item_9is_link(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_link (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 273, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_link") < 0)) __PYX_ERR(0, 273, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("is_link", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 273, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.item.Item.is_link", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_4item_4Item_8is_link(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_4item_4Item_8is_link(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_link", 1); /* "borg/item.pyx":274 * * def is_link(self): * return self._is_type(stat.S_ISLNK) # <<<<<<<<<<<<<< * * def is_dir(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_is_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_stat); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_S_ISLNK); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/item.pyx":273 * return cls(deleted=True, chunks=[], mode=0, path=path) * * def is_link(self): # <<<<<<<<<<<<<< * return self._is_type(stat.S_ISLNK) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("borg.item.Item.is_link", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/item.pyx":276 * return self._is_type(stat.S_ISLNK) * * def is_dir(self): # <<<<<<<<<<<<<< * return self._is_type(stat.S_ISDIR) * */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_4item_4Item_11is_dir(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_4item_4Item_11is_dir = {"is_dir", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_4item_4Item_11is_dir, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_4item_4Item_11is_dir(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_dir (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 276, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_dir") < 0)) __PYX_ERR(0, 276, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("is_dir", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 276, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.item.Item.is_dir", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_4item_4Item_10is_dir(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_4item_4Item_10is_dir(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_dir", 1); /* "borg/item.pyx":277 * * def is_dir(self): * return self._is_type(stat.S_ISDIR) # <<<<<<<<<<<<<< * * def is_fifo(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_is_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_stat); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_S_ISDIR); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/item.pyx":276 * return self._is_type(stat.S_ISLNK) * * def is_dir(self): # <<<<<<<<<<<<<< * return self._is_type(stat.S_ISDIR) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("borg.item.Item.is_dir", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/item.pyx":279 * return self._is_type(stat.S_ISDIR) * * def is_fifo(self): # <<<<<<<<<<<<<< * return self._is_type(stat.S_ISFIFO) * */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_4item_4Item_13is_fifo(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_4item_4Item_13is_fifo = {"is_fifo", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_4item_4Item_13is_fifo, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_4item_4Item_13is_fifo(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_fifo (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 279, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_fifo") < 0)) __PYX_ERR(0, 279, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("is_fifo", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 279, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.item.Item.is_fifo", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_4item_4Item_12is_fifo(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_4item_4Item_12is_fifo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_fifo", 1); /* "borg/item.pyx":280 * * def is_fifo(self): * return self._is_type(stat.S_ISFIFO) # <<<<<<<<<<<<<< * * def is_blk(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_is_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_stat); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_S_ISFIFO); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/item.pyx":279 * return self._is_type(stat.S_ISDIR) * * def is_fifo(self): # <<<<<<<<<<<<<< * return self._is_type(stat.S_ISFIFO) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("borg.item.Item.is_fifo", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/item.pyx":282 * return self._is_type(stat.S_ISFIFO) * * def is_blk(self): # <<<<<<<<<<<<<< * return self._is_type(stat.S_ISBLK) * */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_4item_4Item_15is_blk(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_4item_4Item_15is_blk = {"is_blk", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_4item_4Item_15is_blk, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_4item_4Item_15is_blk(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_blk (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 282, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_blk") < 0)) __PYX_ERR(0, 282, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("is_blk", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 282, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.item.Item.is_blk", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_4item_4Item_14is_blk(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_4item_4Item_14is_blk(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_blk", 1); /* "borg/item.pyx":283 * * def is_blk(self): * return self._is_type(stat.S_ISBLK) # <<<<<<<<<<<<<< * * def is_chr(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_is_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_stat); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_S_ISBLK); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/item.pyx":282 * return self._is_type(stat.S_ISFIFO) * * def is_blk(self): # <<<<<<<<<<<<<< * return self._is_type(stat.S_ISBLK) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("borg.item.Item.is_blk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/item.pyx":285 * return self._is_type(stat.S_ISBLK) * * def is_chr(self): # <<<<<<<<<<<<<< * return self._is_type(stat.S_ISCHR) * */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_4item_4Item_17is_chr(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_4item_4Item_17is_chr = {"is_chr", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_4item_4Item_17is_chr, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_4item_4Item_17is_chr(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_chr (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 285, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_chr") < 0)) __PYX_ERR(0, 285, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("is_chr", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 285, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.item.Item.is_chr", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_4item_4Item_16is_chr(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_4item_4Item_16is_chr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_chr", 1); /* "borg/item.pyx":286 * * def is_chr(self): * return self._is_type(stat.S_ISCHR) # <<<<<<<<<<<<<< * * def _is_type(self, typetest): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_is_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_stat); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_S_ISCHR); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/item.pyx":285 * return self._is_type(stat.S_ISBLK) * * def is_chr(self): # <<<<<<<<<<<<<< * return self._is_type(stat.S_ISCHR) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("borg.item.Item.is_chr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/item.pyx":288 * return self._is_type(stat.S_ISCHR) * * def _is_type(self, typetest): # <<<<<<<<<<<<<< * try: * return typetest(self.mode) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_4item_4Item_19_is_type(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_4item_4Item_19_is_type = {"_is_type", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_4item_4Item_19_is_type, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_4item_4Item_19_is_type(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_typetest = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_is_type (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_typetest,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 288, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_typetest)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 288, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("_is_type", 1, 2, 2, 1); __PYX_ERR(0, 288, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_is_type") < 0)) __PYX_ERR(0, 288, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_typetest = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_is_type", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 288, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.item.Item._is_type", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_4item_4Item_18_is_type(__pyx_self, __pyx_v_self, __pyx_v_typetest); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_4item_4Item_18_is_type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_typetest) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_is_type", 1); /* "borg/item.pyx":289 * * def _is_type(self, typetest): * try: # <<<<<<<<<<<<<< * return typetest(self.mode) * except AttributeError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "borg/item.pyx":290 * def _is_type(self, typetest): * try: * return typetest(self.mode) # <<<<<<<<<<<<<< * except AttributeError: * return False */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 290, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_typetest); __pyx_t_6 = __pyx_v_typetest; __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 290, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L7_try_return; /* "borg/item.pyx":289 * * def _is_type(self, typetest): * try: # <<<<<<<<<<<<<< * return typetest(self.mode) * except AttributeError: */ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/item.pyx":291 * try: * return typetest(self.mode) * except AttributeError: # <<<<<<<<<<<<<< * return False * */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError); if (__pyx_t_8) { __Pyx_AddTraceback("borg.item.Item._is_type", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(0, 291, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_5); /* "borg/item.pyx":292 * return typetest(self.mode) * except AttributeError: * return False # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L6_except_return; } goto __pyx_L5_except_error; /* "borg/item.pyx":289 * * def _is_type(self, typetest): * try: # <<<<<<<<<<<<<< * return typetest(self.mode) * except AttributeError: */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L7_try_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; __pyx_L6_except_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; } /* "borg/item.pyx":288 * return self._is_type(stat.S_ISCHR) * * def _is_type(self, typetest): # <<<<<<<<<<<<<< * try: * return typetest(self.mode) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("borg.item.Item._is_type", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/item.pyx":344 * * * def tuple_encode(t): # <<<<<<<<<<<<<< * """encode a tuple that might contain str items""" * # we have str, but want to give bytes to msgpack.pack */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_4item_1tuple_encode(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_4item_tuple_encode, "encode a tuple that might contain str items"); static PyMethodDef __pyx_mdef_4borg_4item_1tuple_encode = {"tuple_encode", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_4item_1tuple_encode, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_4item_tuple_encode}; static PyObject *__pyx_pw_4borg_4item_1tuple_encode(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_t = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("tuple_encode (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 344, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "tuple_encode") < 0)) __PYX_ERR(0, 344, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_t = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("tuple_encode", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 344, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.item.tuple_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_4item_tuple_encode(__pyx_self, __pyx_v_t); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_4borg_4item_12tuple_encode_2generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "borg/item.pyx":347 * """encode a tuple that might contain str items""" * # we have str, but want to give bytes to msgpack.pack * return tuple(safe_encode(e) if isinstance(e, str) else e for e in t) # <<<<<<<<<<<<<< * * */ static PyObject *__pyx_pf_4borg_4item_12tuple_encode_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { struct __pyx_obj_4borg_4item___pyx_scope_struct_4_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); __pyx_cur_scope = (struct __pyx_obj_4borg_4item___pyx_scope_struct_4_genexpr *)__pyx_tp_new_4borg_4item___pyx_scope_struct_4_genexpr(__pyx_ptype_4borg_4item___pyx_scope_struct_4_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_4borg_4item___pyx_scope_struct_4_genexpr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 347, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4borg_4item_12tuple_encode_2generator2, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_tuple_encode_locals_genexpr, __pyx_n_s_borg_item); if (unlikely(!gen)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.item.tuple_encode.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_4borg_4item_12tuple_encode_2generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_4borg_4item___pyx_scope_struct_4_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4borg_4item___pyx_scope_struct_4_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L6_resume_from_yield; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 347, __pyx_L1_error) if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 347, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 347, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 347, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 347, __pyx_L1_error) #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 347, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 347, __pyx_L1_error) #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 347, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_e); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_e, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = PyString_Check(__pyx_cur_scope->__pyx_v_e); if (__pyx_t_5) { __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_safe_encode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_cur_scope->__pyx_v_e}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_t_4 = __pyx_t_6; __pyx_t_6 = 0; } else { __Pyx_INCREF(__pyx_cur_scope->__pyx_v_e); __pyx_t_4 = __pyx_cur_scope->__pyx_v_e; } __pyx_r = __pyx_t_4; __pyx_t_4 = 0; __Pyx_XGIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; __pyx_cur_scope->__pyx_t_2 = __pyx_t_3; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, yielding value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L6_resume_from_yield:; __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 347, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/item.pyx":344 * * * def tuple_encode(t): # <<<<<<<<<<<<<< * """encode a tuple that might contain str items""" * # we have str, but want to give bytes to msgpack.pack */ static PyObject *__pyx_pf_4borg_4item_tuple_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t) { PyObject *__pyx_gb_4borg_4item_12tuple_encode_2generator2 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("tuple_encode", 1); /* "borg/item.pyx":347 * """encode a tuple that might contain str items""" * # we have str, but want to give bytes to msgpack.pack * return tuple(safe_encode(e) if isinstance(e, str) else e for e in t) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_pf_4borg_4item_12tuple_encode_genexpr(NULL, __pyx_v_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "borg/item.pyx":344 * * * def tuple_encode(t): # <<<<<<<<<<<<<< * """encode a tuple that might contain str items""" * # we have str, but want to give bytes to msgpack.pack */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("borg.item.tuple_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_gb_4borg_4item_12tuple_encode_2generator2); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/item.pyx":350 * * * def tuple_decode(t): # <<<<<<<<<<<<<< * """decode a tuple that might contain bytes items""" * # we get bytes objects from msgpack.unpack, but want str */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_4item_3tuple_decode(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_4item_2tuple_decode, "decode a tuple that might contain bytes items"); static PyMethodDef __pyx_mdef_4borg_4item_3tuple_decode = {"tuple_decode", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_4item_3tuple_decode, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_4item_2tuple_decode}; static PyObject *__pyx_pw_4borg_4item_3tuple_decode(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_t = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("tuple_decode (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 350, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "tuple_decode") < 0)) __PYX_ERR(0, 350, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_t = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("tuple_decode", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 350, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.item.tuple_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_4item_2tuple_decode(__pyx_self, __pyx_v_t); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_4borg_4item_12tuple_decode_2generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "borg/item.pyx":353 * """decode a tuple that might contain bytes items""" * # we get bytes objects from msgpack.unpack, but want str * return tuple(safe_decode(e) if isinstance(e, bytes) else e for e in t) # <<<<<<<<<<<<<< * * */ static PyObject *__pyx_pf_4borg_4item_12tuple_decode_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { struct __pyx_obj_4borg_4item___pyx_scope_struct_5_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); __pyx_cur_scope = (struct __pyx_obj_4borg_4item___pyx_scope_struct_5_genexpr *)__pyx_tp_new_4borg_4item___pyx_scope_struct_5_genexpr(__pyx_ptype_4borg_4item___pyx_scope_struct_5_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_4borg_4item___pyx_scope_struct_5_genexpr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 353, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4borg_4item_12tuple_decode_2generator3, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_tuple_decode_locals_genexpr, __pyx_n_s_borg_item); if (unlikely(!gen)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.item.tuple_decode.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_4borg_4item_12tuple_decode_2generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_4borg_4item___pyx_scope_struct_5_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4borg_4item___pyx_scope_struct_5_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L6_resume_from_yield; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 353, __pyx_L1_error) if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 353, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 353, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 353, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 353, __pyx_L1_error) #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 353, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 353, __pyx_L1_error) #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 353, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_e); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_e, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = PyBytes_Check(__pyx_cur_scope->__pyx_v_e); if (__pyx_t_5) { __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_safe_decode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_cur_scope->__pyx_v_e}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_t_4 = __pyx_t_6; __pyx_t_6 = 0; } else { __Pyx_INCREF(__pyx_cur_scope->__pyx_v_e); __pyx_t_4 = __pyx_cur_scope->__pyx_v_e; } __pyx_r = __pyx_t_4; __pyx_t_4 = 0; __Pyx_XGIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; __pyx_cur_scope->__pyx_t_2 = __pyx_t_3; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, yielding value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L6_resume_from_yield:; __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 353, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/item.pyx":350 * * * def tuple_decode(t): # <<<<<<<<<<<<<< * """decode a tuple that might contain bytes items""" * # we get bytes objects from msgpack.unpack, but want str */ static PyObject *__pyx_pf_4borg_4item_2tuple_decode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t) { PyObject *__pyx_gb_4borg_4item_12tuple_decode_2generator3 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("tuple_decode", 1); /* "borg/item.pyx":353 * """decode a tuple that might contain bytes items""" * # we get bytes objects from msgpack.unpack, but want str * return tuple(safe_decode(e) if isinstance(e, bytes) else e for e in t) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_pf_4borg_4item_12tuple_decode_genexpr(NULL, __pyx_v_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "borg/item.pyx":350 * * * def tuple_decode(t): # <<<<<<<<<<<<<< * """decode a tuple that might contain bytes items""" * # we get bytes objects from msgpack.unpack, but want str */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("borg.item.tuple_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_gb_4borg_4item_12tuple_decode_2generator3); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/item.pyx":425 * """ * * def __init__(self, item1, item2, chunk_iterator1, chunk_iterator2, numeric_ids=False, can_compare_chunk_ids=False, content_only=False): # <<<<<<<<<<<<<< * self._item1 = item1 * self._item2 = item2 */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_4item_8ItemDiff_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_4item_8ItemDiff_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_4item_8ItemDiff_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_4item_8ItemDiff_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_item1 = 0; PyObject *__pyx_v_item2 = 0; PyObject *__pyx_v_chunk_iterator1 = 0; PyObject *__pyx_v_chunk_iterator2 = 0; PyObject *__pyx_v_numeric_ids = 0; PyObject *__pyx_v_can_compare_chunk_ids = 0; PyObject *__pyx_v_content_only = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[8] = {0,0,0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_item1,&__pyx_n_s_item2,&__pyx_n_s_chunk_iterator1,&__pyx_n_s_chunk_iterator2,&__pyx_n_s_numeric_ids,&__pyx_n_s_can_compare_chunk_ids,&__pyx_n_s_content_only,0}; values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); values[6] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); values[7] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 425, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_item1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 425, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 8, 1); __PYX_ERR(0, 425, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_item2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 425, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 8, 2); __PYX_ERR(0, 425, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_chunk_iterator1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 425, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 8, 3); __PYX_ERR(0, 425, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_chunk_iterator2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 425, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 8, 4); __PYX_ERR(0, 425, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_numeric_ids); if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 425, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_can_compare_chunk_ids); if (value) { values[6] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 425, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_content_only); if (value) { values[7] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 425, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 425, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_item1 = values[1]; __pyx_v_item2 = values[2]; __pyx_v_chunk_iterator1 = values[3]; __pyx_v_chunk_iterator2 = values[4]; __pyx_v_numeric_ids = values[5]; __pyx_v_can_compare_chunk_ids = values[6]; __pyx_v_content_only = values[7]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 8, __pyx_nargs); __PYX_ERR(0, 425, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.item.ItemDiff.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_4item_8ItemDiff___init__(__pyx_self, __pyx_v_self, __pyx_v_item1, __pyx_v_item2, __pyx_v_chunk_iterator1, __pyx_v_chunk_iterator2, __pyx_v_numeric_ids, __pyx_v_can_compare_chunk_ids, __pyx_v_content_only); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_4item_8ItemDiff___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item1, PyObject *__pyx_v_item2, PyObject *__pyx_v_chunk_iterator1, PyObject *__pyx_v_chunk_iterator2, PyObject *__pyx_v_numeric_ids, PyObject *__pyx_v_can_compare_chunk_ids, PyObject *__pyx_v_content_only) { PyObject *__pyx_v_changes = NULL; PyObject *__pyx_8genexpr4__pyx_v_ch = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; Py_ssize_t __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "borg/item.pyx":426 * * def __init__(self, item1, item2, chunk_iterator1, chunk_iterator2, numeric_ids=False, can_compare_chunk_ids=False, content_only=False): * self._item1 = item1 # <<<<<<<<<<<<<< * self._item2 = item2 * self._content_only = content_only */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_item1_2, __pyx_v_item1) < 0) __PYX_ERR(0, 426, __pyx_L1_error) /* "borg/item.pyx":427 * def __init__(self, item1, item2, chunk_iterator1, chunk_iterator2, numeric_ids=False, can_compare_chunk_ids=False, content_only=False): * self._item1 = item1 * self._item2 = item2 # <<<<<<<<<<<<<< * self._content_only = content_only * self._numeric_ids = numeric_ids */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_item2_2, __pyx_v_item2) < 0) __PYX_ERR(0, 427, __pyx_L1_error) /* "borg/item.pyx":428 * self._item1 = item1 * self._item2 = item2 * self._content_only = content_only # <<<<<<<<<<<<<< * self._numeric_ids = numeric_ids * self._can_compare_chunk_ids = can_compare_chunk_ids */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_content_only_2, __pyx_v_content_only) < 0) __PYX_ERR(0, 428, __pyx_L1_error) /* "borg/item.pyx":429 * self._item2 = item2 * self._content_only = content_only * self._numeric_ids = numeric_ids # <<<<<<<<<<<<<< * self._can_compare_chunk_ids = can_compare_chunk_ids * self.equal = self._equal(chunk_iterator1, chunk_iterator2) */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_numeric_ids_2, __pyx_v_numeric_ids) < 0) __PYX_ERR(0, 429, __pyx_L1_error) /* "borg/item.pyx":430 * self._content_only = content_only * self._numeric_ids = numeric_ids * self._can_compare_chunk_ids = can_compare_chunk_ids # <<<<<<<<<<<<<< * self.equal = self._equal(chunk_iterator1, chunk_iterator2) * changes = [] */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_can_compare_chunk_ids_2, __pyx_v_can_compare_chunk_ids) < 0) __PYX_ERR(0, 430, __pyx_L1_error) /* "borg/item.pyx":431 * self._numeric_ids = numeric_ids * self._can_compare_chunk_ids = can_compare_chunk_ids * self.equal = self._equal(chunk_iterator1, chunk_iterator2) # <<<<<<<<<<<<<< * changes = [] * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_equal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_chunk_iterator1, __pyx_v_chunk_iterator2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_equal_2, __pyx_t_1) < 0) __PYX_ERR(0, 431, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/item.pyx":432 * self._can_compare_chunk_ids = can_compare_chunk_ids * self.equal = self._equal(chunk_iterator1, chunk_iterator2) * changes = [] # <<<<<<<<<<<<<< * * if self._item1.is_link() or self._item2.is_link(): */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_changes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "borg/item.pyx":434 * changes = [] * * if self._item1.is_link() or self._item2.is_link(): # <<<<<<<<<<<<<< * changes.append(self._link_diff()) * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item1_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_is_link); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item2_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_is_link); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = __pyx_t_6; __pyx_L4_bool_binop_done:; if (__pyx_t_5) { /* "borg/item.pyx":435 * * if self._item1.is_link() or self._item2.is_link(): * changes.append(self._link_diff()) # <<<<<<<<<<<<<< * * if 'chunks' in self._item1 and 'chunks' in self._item2: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_link_diff); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_changes, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 435, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/item.pyx":434 * changes = [] * * if self._item1.is_link() or self._item2.is_link(): # <<<<<<<<<<<<<< * changes.append(self._link_diff()) * */ } /* "borg/item.pyx":437 * changes.append(self._link_diff()) * * if 'chunks' in self._item1 and 'chunks' in self._item2: # <<<<<<<<<<<<<< * changes.append(self._content_diff()) * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item1_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_chunks, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 437, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L7_bool_binop_done; } __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item2_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_chunks, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 437, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = __pyx_t_6; __pyx_L7_bool_binop_done:; if (__pyx_t_5) { /* "borg/item.pyx":438 * * if 'chunks' in self._item1 and 'chunks' in self._item2: * changes.append(self._content_diff()) # <<<<<<<<<<<<<< * * if self._item1.is_dir() or self._item2.is_dir(): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_content_diff); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_changes, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/item.pyx":437 * changes.append(self._link_diff()) * * if 'chunks' in self._item1 and 'chunks' in self._item2: # <<<<<<<<<<<<<< * changes.append(self._content_diff()) * */ } /* "borg/item.pyx":440 * changes.append(self._content_diff()) * * if self._item1.is_dir() or self._item2.is_dir(): # <<<<<<<<<<<<<< * changes.append(self._presence_diff('directory')) * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item1_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_is_dir); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L10_bool_binop_done; } __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item2_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_is_dir); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = __pyx_t_6; __pyx_L10_bool_binop_done:; if (__pyx_t_5) { /* "borg/item.pyx":441 * * if self._item1.is_dir() or self._item2.is_dir(): * changes.append(self._presence_diff('directory')) # <<<<<<<<<<<<<< * * if self._item1.is_blk() or self._item2.is_blk(): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_presence_diff); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_n_s_directory}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_changes, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 441, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/item.pyx":440 * changes.append(self._content_diff()) * * if self._item1.is_dir() or self._item2.is_dir(): # <<<<<<<<<<<<<< * changes.append(self._presence_diff('directory')) * */ } /* "borg/item.pyx":443 * changes.append(self._presence_diff('directory')) * * if self._item1.is_blk() or self._item2.is_blk(): # <<<<<<<<<<<<<< * changes.append(self._presence_diff('blkdev')) * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item1_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_is_blk); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L13_bool_binop_done; } __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item2_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_is_blk); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = __pyx_t_6; __pyx_L13_bool_binop_done:; if (__pyx_t_5) { /* "borg/item.pyx":444 * * if self._item1.is_blk() or self._item2.is_blk(): * changes.append(self._presence_diff('blkdev')) # <<<<<<<<<<<<<< * * if self._item1.is_chr() or self._item2.is_chr(): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_presence_diff); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_n_s_blkdev}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_changes, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/item.pyx":443 * changes.append(self._presence_diff('directory')) * * if self._item1.is_blk() or self._item2.is_blk(): # <<<<<<<<<<<<<< * changes.append(self._presence_diff('blkdev')) * */ } /* "borg/item.pyx":446 * changes.append(self._presence_diff('blkdev')) * * if self._item1.is_chr() or self._item2.is_chr(): # <<<<<<<<<<<<<< * changes.append(self._presence_diff('chrdev')) * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item1_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_is_chr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 446, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L16_bool_binop_done; } __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item2_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_is_chr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 446, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = __pyx_t_6; __pyx_L16_bool_binop_done:; if (__pyx_t_5) { /* "borg/item.pyx":447 * * if self._item1.is_chr() or self._item2.is_chr(): * changes.append(self._presence_diff('chrdev')) # <<<<<<<<<<<<<< * * if self._item1.is_fifo() or self._item2.is_fifo(): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_presence_diff); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_n_s_chrdev}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_changes, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/item.pyx":446 * changes.append(self._presence_diff('blkdev')) * * if self._item1.is_chr() or self._item2.is_chr(): # <<<<<<<<<<<<<< * changes.append(self._presence_diff('chrdev')) * */ } /* "borg/item.pyx":449 * changes.append(self._presence_diff('chrdev')) * * if self._item1.is_fifo() or self._item2.is_fifo(): # <<<<<<<<<<<<<< * changes.append(self._presence_diff('fifo')) * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item1_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_is_fifo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L19_bool_binop_done; } __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item2_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_is_fifo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = __pyx_t_6; __pyx_L19_bool_binop_done:; if (__pyx_t_5) { /* "borg/item.pyx":450 * * if self._item1.is_fifo() or self._item2.is_fifo(): * changes.append(self._presence_diff('fifo')) # <<<<<<<<<<<<<< * * if not (self._item1.get('deleted') or self._item2.get('deleted')) and not self._content_only: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_presence_diff); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_n_s_fifo}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_changes, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/item.pyx":449 * changes.append(self._presence_diff('chrdev')) * * if self._item1.is_fifo() or self._item2.is_fifo(): # <<<<<<<<<<<<<< * changes.append(self._presence_diff('fifo')) * */ } /* "borg/item.pyx":452 * changes.append(self._presence_diff('fifo')) * * if not (self._item1.get('deleted') or self._item2.get('deleted')) and not self._content_only: # <<<<<<<<<<<<<< * changes.append(self._owner_diff()) * changes.append(self._mode_diff()) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item1_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_n_s_deleted}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_8) { } else { __pyx_t_6 = __pyx_t_8; goto __pyx_L24_bool_binop_done; } __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item2_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_n_s_deleted}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __pyx_t_8; __pyx_L24_bool_binop_done:; __pyx_t_8 = (!__pyx_t_6); if (__pyx_t_8) { } else { __pyx_t_5 = __pyx_t_8; goto __pyx_L22_bool_binop_done; } __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_content_only_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = (!__pyx_t_8); __pyx_t_5 = __pyx_t_6; __pyx_L22_bool_binop_done:; if (__pyx_t_5) { /* "borg/item.pyx":453 * * if not (self._item1.get('deleted') or self._item2.get('deleted')) and not self._content_only: * changes.append(self._owner_diff()) # <<<<<<<<<<<<<< * changes.append(self._mode_diff()) * changes.extend(self._time_diffs()) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_owner_diff); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_changes, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/item.pyx":454 * if not (self._item1.get('deleted') or self._item2.get('deleted')) and not self._content_only: * changes.append(self._owner_diff()) * changes.append(self._mode_diff()) # <<<<<<<<<<<<<< * changes.extend(self._time_diffs()) * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mode_diff); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_changes, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 454, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/item.pyx":455 * changes.append(self._owner_diff()) * changes.append(self._mode_diff()) * changes.extend(self._time_diffs()) # <<<<<<<<<<<<<< * * # filter out empty changes */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_time_diffs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_7 = __Pyx_PyList_Extend(__pyx_v_changes, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 455, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/item.pyx":452 * changes.append(self._presence_diff('fifo')) * * if not (self._item1.get('deleted') or self._item2.get('deleted')) and not self._content_only: # <<<<<<<<<<<<<< * changes.append(self._owner_diff()) * changes.append(self._mode_diff()) */ } /* "borg/item.pyx":458 * * # filter out empty changes * self._changes = [ch for ch in changes if ch] # <<<<<<<<<<<<<< * * def changes(self): */ { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L28_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_v_changes; __Pyx_INCREF(__pyx_t_2); __pyx_t_9 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 458, __pyx_L28_error) #endif if (__pyx_t_9 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 458, __pyx_L28_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L28_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_ch, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_8genexpr4__pyx_v_ch); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 458, __pyx_L28_error) if (__pyx_t_5) { if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_8genexpr4__pyx_v_ch))) __PYX_ERR(0, 458, __pyx_L28_error) } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_ch); __pyx_8genexpr4__pyx_v_ch = 0; goto __pyx_L33_exit_scope; __pyx_L28_error:; __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_ch); __pyx_8genexpr4__pyx_v_ch = 0; goto __pyx_L1_error; __pyx_L33_exit_scope:; } /* exit inner scope */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_changes, __pyx_t_1) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/item.pyx":425 * """ * * def __init__(self, item1, item2, chunk_iterator1, chunk_iterator2, numeric_ids=False, can_compare_chunk_ids=False, content_only=False): # <<<<<<<<<<<<<< * self._item1 = item1 * self._item2 = item2 */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("borg.item.ItemDiff.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_changes); __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_ch); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/item.pyx":460 * self._changes = [ch for ch in changes if ch] * * def changes(self): # <<<<<<<<<<<<<< * return self._changes * */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_4item_8ItemDiff_3changes(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_4item_8ItemDiff_3changes = {"changes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_4item_8ItemDiff_3changes, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_4item_8ItemDiff_3changes(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("changes (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "changes") < 0)) __PYX_ERR(0, 460, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("changes", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 460, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.item.ItemDiff.changes", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_4item_8ItemDiff_2changes(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_4item_8ItemDiff_2changes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("changes", 1); /* "borg/item.pyx":461 * * def changes(self): * return self._changes # <<<<<<<<<<<<<< * * def __repr__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_changes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/item.pyx":460 * self._changes = [ch for ch in changes if ch] * * def changes(self): # <<<<<<<<<<<<<< * return self._changes * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("borg.item.ItemDiff.changes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/item.pyx":463 * return self._changes * * def __repr__(self): # <<<<<<<<<<<<<< * if self.equal: * return 'equal' */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_4item_8ItemDiff_5__repr__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_4item_8ItemDiff_5__repr__ = {"__repr__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_4item_8ItemDiff_5__repr__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_4item_8ItemDiff_5__repr__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 463, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__repr__") < 0)) __PYX_ERR(0, 463, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 463, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.item.ItemDiff.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_4item_8ItemDiff_4__repr__(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_4borg_4item_8ItemDiff_8__repr___2generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "borg/item.pyx":466 * if self.equal: * return 'equal' * return ' '.join(str for d,str in self._changes) # <<<<<<<<<<<<<< * * def _equal(self, chunk_iterator1, chunk_iterator2): */ static PyObject *__pyx_pf_4borg_4item_8ItemDiff_8__repr___genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { struct __pyx_obj_4borg_4item___pyx_scope_struct_6_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); __pyx_cur_scope = (struct __pyx_obj_4borg_4item___pyx_scope_struct_6_genexpr *)__pyx_tp_new_4borg_4item___pyx_scope_struct_6_genexpr(__pyx_ptype_4borg_4item___pyx_scope_struct_6_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_4borg_4item___pyx_scope_struct_6_genexpr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 466, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4borg_4item_8ItemDiff_8__repr___2generator4, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_ItemDiff___repr___locals_genexpr, __pyx_n_s_borg_item); if (unlikely(!gen)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.item.ItemDiff.__repr__.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_4borg_4item_8ItemDiff_8__repr___2generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_4borg_4item___pyx_scope_struct_6_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4borg_4item___pyx_scope_struct_6_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L8_resume_from_yield; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 466, __pyx_L1_error) if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 466, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 466, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 466, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 466, __pyx_L1_error) #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 466, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 466, __pyx_L1_error) #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 466, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 466, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 466, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 466, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_d); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_d, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_str); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_str, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_str); __pyx_r = __pyx_cur_scope->__pyx_v_str; __Pyx_XGIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; __pyx_cur_scope->__pyx_t_2 = __pyx_t_3; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, yielding value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L8_resume_from_yield:; __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 466, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/item.pyx":463 * return self._changes * * def __repr__(self): # <<<<<<<<<<<<<< * if self.equal: * return 'equal' */ static PyObject *__pyx_pf_4borg_4item_8ItemDiff_4__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_gb_4borg_4item_8ItemDiff_8__repr___2generator4 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 1); /* "borg/item.pyx":464 * * def __repr__(self): * if self.equal: # <<<<<<<<<<<<<< * return 'equal' * return ' '.join(str for d,str in self._changes) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_equal_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "borg/item.pyx":465 * def __repr__(self): * if self.equal: * return 'equal' # <<<<<<<<<<<<<< * return ' '.join(str for d,str in self._changes) * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_s_equal_2); __pyx_r = __pyx_n_s_equal_2; goto __pyx_L0; /* "borg/item.pyx":464 * * def __repr__(self): * if self.equal: # <<<<<<<<<<<<<< * return 'equal' * return ' '.join(str for d,str in self._changes) */ } /* "borg/item.pyx":466 * if self.equal: * return 'equal' * return ' '.join(str for d,str in self._changes) # <<<<<<<<<<<<<< * * def _equal(self, chunk_iterator1, chunk_iterator2): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_changes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __pyx_pf_4borg_4item_8ItemDiff_8__repr___genexpr(NULL, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__10, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/item.pyx":463 * return self._changes * * def __repr__(self): # <<<<<<<<<<<<<< * if self.equal: * return 'equal' */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("borg.item.ItemDiff.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_gb_4borg_4item_8ItemDiff_8__repr___2generator4); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/item.pyx":468 * return ' '.join(str for d,str in self._changes) * * def _equal(self, chunk_iterator1, chunk_iterator2): # <<<<<<<<<<<<<< * # if both are deleted, there is nothing at path regardless of what was deleted * if self._item1.get('deleted') and self._item2.get('deleted'): */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_4item_8ItemDiff_7_equal(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_4item_8ItemDiff_7_equal = {"_equal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_4item_8ItemDiff_7_equal, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_4item_8ItemDiff_7_equal(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_chunk_iterator1 = 0; PyObject *__pyx_v_chunk_iterator2 = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_equal (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_chunk_iterator1,&__pyx_n_s_chunk_iterator2,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 468, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_chunk_iterator1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 468, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("_equal", 1, 3, 3, 1); __PYX_ERR(0, 468, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_chunk_iterator2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 468, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("_equal", 1, 3, 3, 2); __PYX_ERR(0, 468, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_equal") < 0)) __PYX_ERR(0, 468, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_self = values[0]; __pyx_v_chunk_iterator1 = values[1]; __pyx_v_chunk_iterator2 = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_equal", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 468, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.item.ItemDiff._equal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_4item_8ItemDiff_6_equal(__pyx_self, __pyx_v_self, __pyx_v_chunk_iterator1, __pyx_v_chunk_iterator2); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_4item_8ItemDiff_6_equal(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_chunk_iterator1, PyObject *__pyx_v_chunk_iterator2) { PyObject *__pyx_v_attr_list = NULL; PyObject *__pyx_v_attr = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; Py_ssize_t __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_equal", 1); /* "borg/item.pyx":470 * def _equal(self, chunk_iterator1, chunk_iterator2): * # if both are deleted, there is nothing at path regardless of what was deleted * if self._item1.get('deleted') and self._item2.get('deleted'): # <<<<<<<<<<<<<< * return True * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item1_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_n_s_deleted}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item2_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_n_s_deleted}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __pyx_t_6; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "borg/item.pyx":471 * # if both are deleted, there is nothing at path regardless of what was deleted * if self._item1.get('deleted') and self._item2.get('deleted'): * return True # <<<<<<<<<<<<<< * * attr_list = ['deleted', 'source'] */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "borg/item.pyx":470 * def _equal(self, chunk_iterator1, chunk_iterator2): * # if both are deleted, there is nothing at path regardless of what was deleted * if self._item1.get('deleted') and self._item2.get('deleted'): # <<<<<<<<<<<<<< * return True * */ } /* "borg/item.pyx":473 * return True * * attr_list = ['deleted', 'source'] # <<<<<<<<<<<<<< * if not self._content_only: * attr_list += ['mode', 'ctime', 'mtime'] */ __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_deleted); __Pyx_GIVEREF(__pyx_n_s_deleted); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_deleted)) __PYX_ERR(0, 473, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_source); __Pyx_GIVEREF(__pyx_n_s_source); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_source)) __PYX_ERR(0, 473, __pyx_L1_error); __pyx_v_attr_list = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "borg/item.pyx":474 * * attr_list = ['deleted', 'source'] * if not self._content_only: # <<<<<<<<<<<<<< * attr_list += ['mode', 'ctime', 'mtime'] * attr_list += ['uid', 'gid'] if self._numeric_ids else ['user', 'group'] */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_content_only_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = (!__pyx_t_1); if (__pyx_t_6) { /* "borg/item.pyx":475 * attr_list = ['deleted', 'source'] * if not self._content_only: * attr_list += ['mode', 'ctime', 'mtime'] # <<<<<<<<<<<<<< * attr_list += ['uid', 'gid'] if self._numeric_ids else ['user', 'group'] * */ __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_mode); __Pyx_GIVEREF(__pyx_n_s_mode); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_mode)) __PYX_ERR(0, 475, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_ctime); __Pyx_GIVEREF(__pyx_n_s_ctime); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_ctime)) __PYX_ERR(0, 475, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_mtime); __Pyx_GIVEREF(__pyx_n_s_mtime); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_mtime)) __PYX_ERR(0, 475, __pyx_L1_error); __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_attr_list, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_attr_list, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; /* "borg/item.pyx":476 * if not self._content_only: * attr_list += ['mode', 'ctime', 'mtime'] * attr_list += ['uid', 'gid'] if self._numeric_ids else ['user', 'group'] # <<<<<<<<<<<<<< * * for attr in attr_list: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_numeric_ids_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 476, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_6) { __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_uid); __Pyx_GIVEREF(__pyx_n_s_uid); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_uid)) __PYX_ERR(0, 476, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_gid); __Pyx_GIVEREF(__pyx_n_s_gid); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_gid)) __PYX_ERR(0, 476, __pyx_L1_error); __pyx_t_3 = __pyx_t_2; __pyx_t_2 = 0; } else { __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_user); __Pyx_GIVEREF(__pyx_n_s_user); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_user)) __PYX_ERR(0, 476, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_group); __Pyx_GIVEREF(__pyx_n_s_group); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_group)) __PYX_ERR(0, 476, __pyx_L1_error); __pyx_t_3 = __pyx_t_2; __pyx_t_2 = 0; } __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_attr_list, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_attr_list, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; /* "borg/item.pyx":474 * * attr_list = ['deleted', 'source'] * if not self._content_only: # <<<<<<<<<<<<<< * attr_list += ['mode', 'ctime', 'mtime'] * attr_list += ['uid', 'gid'] if self._numeric_ids else ['user', 'group'] */ } /* "borg/item.pyx":478 * attr_list += ['uid', 'gid'] if self._numeric_ids else ['user', 'group'] * * for attr in attr_list: # <<<<<<<<<<<<<< * if self._item1.get(attr) != self._item2.get(attr): * return False */ __pyx_t_2 = __pyx_v_attr_list; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 478, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 478, __pyx_L1_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_attr, __pyx_t_3); __pyx_t_3 = 0; /* "borg/item.pyx":479 * * for attr in attr_list: * if self._item1.get(attr) != self._item2.get(attr): # <<<<<<<<<<<<<< * return False * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item1_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_attr}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item2_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_attr}; __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __pyx_t_9 = PyObject_RichCompare(__pyx_t_3, __pyx_t_8, Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_6) { /* "borg/item.pyx":480 * for attr in attr_list: * if self._item1.get(attr) != self._item2.get(attr): * return False # <<<<<<<<<<<<<< * * if 'mode' in self._item1: # mode of item1 and item2 is equal */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; /* "borg/item.pyx":479 * * for attr in attr_list: * if self._item1.get(attr) != self._item2.get(attr): # <<<<<<<<<<<<<< * return False * */ } /* "borg/item.pyx":478 * attr_list += ['uid', 'gid'] if self._numeric_ids else ['user', 'group'] * * for attr in attr_list: # <<<<<<<<<<<<<< * if self._item1.get(attr) != self._item2.get(attr): * return False */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/item.pyx":482 * return False * * if 'mode' in self._item1: # mode of item1 and item2 is equal # <<<<<<<<<<<<<< * if (self._item1.is_link() and 'source' in self._item1 and 'source' in self._item2 * and self._item1.source != self._item2.source): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item1_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_mode, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 482, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_6) { /* "borg/item.pyx":483 * * if 'mode' in self._item1: # mode of item1 and item2 is equal * if (self._item1.is_link() and 'source' in self._item1 and 'source' in self._item2 # <<<<<<<<<<<<<< * and self._item1.source != self._item2.source): * return False */ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item1_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_is_link); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 483, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { } else { __pyx_t_6 = __pyx_t_1; goto __pyx_L13_bool_binop_done; } __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item1_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_source, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 483, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { } else { __pyx_t_6 = __pyx_t_1; goto __pyx_L13_bool_binop_done; } /* "borg/item.pyx":484 * if 'mode' in self._item1: # mode of item1 and item2 is equal * if (self._item1.is_link() and 'source' in self._item1 and 'source' in self._item2 * and self._item1.source != self._item2.source): # <<<<<<<<<<<<<< * return False * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item2_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_source, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 483, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { } else { __pyx_t_6 = __pyx_t_1; goto __pyx_L13_bool_binop_done; } __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item1_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_source); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item2_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_source); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_RichCompare(__pyx_t_8, __pyx_t_9, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 484, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 484, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = __pyx_t_1; __pyx_L13_bool_binop_done:; /* "borg/item.pyx":483 * * if 'mode' in self._item1: # mode of item1 and item2 is equal * if (self._item1.is_link() and 'source' in self._item1 and 'source' in self._item2 # <<<<<<<<<<<<<< * and self._item1.source != self._item2.source): * return False */ if (__pyx_t_6) { /* "borg/item.pyx":485 * if (self._item1.is_link() and 'source' in self._item1 and 'source' in self._item2 * and self._item1.source != self._item2.source): * return False # <<<<<<<<<<<<<< * * if 'chunks' in self._item1 and 'chunks' in self._item2: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "borg/item.pyx":483 * * if 'mode' in self._item1: # mode of item1 and item2 is equal * if (self._item1.is_link() and 'source' in self._item1 and 'source' in self._item2 # <<<<<<<<<<<<<< * and self._item1.source != self._item2.source): * return False */ } /* "borg/item.pyx":482 * return False * * if 'mode' in self._item1: # mode of item1 and item2 is equal # <<<<<<<<<<<<<< * if (self._item1.is_link() and 'source' in self._item1 and 'source' in self._item2 * and self._item1.source != self._item2.source): */ } /* "borg/item.pyx":487 * return False * * if 'chunks' in self._item1 and 'chunks' in self._item2: # <<<<<<<<<<<<<< * return self._content_equal(chunk_iterator1, chunk_iterator2) * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item1_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_chunks, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { } else { __pyx_t_6 = __pyx_t_1; goto __pyx_L18_bool_binop_done; } __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item2_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_chunks, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = __pyx_t_1; __pyx_L18_bool_binop_done:; if (__pyx_t_6) { /* "borg/item.pyx":488 * * if 'chunks' in self._item1 and 'chunks' in self._item2: * return self._content_equal(chunk_iterator1, chunk_iterator2) # <<<<<<<<<<<<<< * * return True */ __Pyx_XDECREF(__pyx_r); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_content_equal); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_chunk_iterator1, __pyx_v_chunk_iterator2}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "borg/item.pyx":487 * return False * * if 'chunks' in self._item1 and 'chunks' in self._item2: # <<<<<<<<<<<<<< * return self._content_equal(chunk_iterator1, chunk_iterator2) * */ } /* "borg/item.pyx":490 * return self._content_equal(chunk_iterator1, chunk_iterator2) * * return True # <<<<<<<<<<<<<< * * def _presence_diff(self, item_type): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "borg/item.pyx":468 * return ' '.join(str for d,str in self._changes) * * def _equal(self, chunk_iterator1, chunk_iterator2): # <<<<<<<<<<<<<< * # if both are deleted, there is nothing at path regardless of what was deleted * if self._item1.get('deleted') and self._item2.get('deleted'): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("borg.item.ItemDiff._equal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_attr_list); __Pyx_XDECREF(__pyx_v_attr); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/item.pyx":492 * return True * * def _presence_diff(self, item_type): # <<<<<<<<<<<<<< * if not self._item1.get('deleted') and self._item2.get('deleted'): * chg = 'removed ' + item_type */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_4item_8ItemDiff_9_presence_diff(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_4item_8ItemDiff_9_presence_diff = {"_presence_diff", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_4item_8ItemDiff_9_presence_diff, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_4item_8ItemDiff_9_presence_diff(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_item_type = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_presence_diff (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_item_type,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 492, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_item_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 492, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("_presence_diff", 1, 2, 2, 1); __PYX_ERR(0, 492, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_presence_diff") < 0)) __PYX_ERR(0, 492, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_item_type = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_presence_diff", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 492, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.item.ItemDiff._presence_diff", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_4item_8ItemDiff_8_presence_diff(__pyx_self, __pyx_v_self, __pyx_v_item_type); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_4item_8ItemDiff_8_presence_diff(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item_type) { PyObject *__pyx_v_chg = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_presence_diff", 1); /* "borg/item.pyx":493 * * def _presence_diff(self, item_type): * if not self._item1.get('deleted') and self._item2.get('deleted'): # <<<<<<<<<<<<<< * chg = 'removed ' + item_type * return ({"type": chg}, chg) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item1_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_n_s_deleted}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 493, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_7 = (!__pyx_t_6); if (__pyx_t_7) { } else { __pyx_t_1 = __pyx_t_7; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item2_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_n_s_deleted}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 493, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __pyx_t_7; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "borg/item.pyx":494 * def _presence_diff(self, item_type): * if not self._item1.get('deleted') and self._item2.get('deleted'): * chg = 'removed ' + item_type # <<<<<<<<<<<<<< * return ({"type": chg}, chg) * if self._item1.get('deleted') and not self._item2.get('deleted'): */ __pyx_t_2 = PyNumber_Add(__pyx_kp_s_removed, __pyx_v_item_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_chg = __pyx_t_2; __pyx_t_2 = 0; /* "borg/item.pyx":495 * if not self._item1.get('deleted') and self._item2.get('deleted'): * chg = 'removed ' + item_type * return ({"type": chg}, chg) # <<<<<<<<<<<<<< * if self._item1.get('deleted') and not self._item2.get('deleted'): * chg = 'added ' + item_type */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_type, __pyx_v_chg) < 0) __PYX_ERR(0, 495, __pyx_L1_error) __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 495, __pyx_L1_error); __Pyx_INCREF(__pyx_v_chg); __Pyx_GIVEREF(__pyx_v_chg); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_chg)) __PYX_ERR(0, 495, __pyx_L1_error); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "borg/item.pyx":493 * * def _presence_diff(self, item_type): * if not self._item1.get('deleted') and self._item2.get('deleted'): # <<<<<<<<<<<<<< * chg = 'removed ' + item_type * return ({"type": chg}, chg) */ } /* "borg/item.pyx":496 * chg = 'removed ' + item_type * return ({"type": chg}, chg) * if self._item1.get('deleted') and not self._item2.get('deleted'): # <<<<<<<<<<<<<< * chg = 'added ' + item_type * return ({"type": chg}, chg) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item1_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_n_s_deleted}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_7) { } else { __pyx_t_1 = __pyx_t_7; goto __pyx_L7_bool_binop_done; } __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item2_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_n_s_deleted}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = (!__pyx_t_7); __pyx_t_1 = __pyx_t_6; __pyx_L7_bool_binop_done:; if (__pyx_t_1) { /* "borg/item.pyx":497 * return ({"type": chg}, chg) * if self._item1.get('deleted') and not self._item2.get('deleted'): * chg = 'added ' + item_type # <<<<<<<<<<<<<< * return ({"type": chg}, chg) * */ __pyx_t_3 = PyNumber_Add(__pyx_kp_s_added, __pyx_v_item_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_chg = __pyx_t_3; __pyx_t_3 = 0; /* "borg/item.pyx":498 * if self._item1.get('deleted') and not self._item2.get('deleted'): * chg = 'added ' + item_type * return ({"type": chg}, chg) # <<<<<<<<<<<<<< * * def _link_diff(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_type, __pyx_v_chg) < 0) __PYX_ERR(0, 498, __pyx_L1_error) __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 498, __pyx_L1_error); __Pyx_INCREF(__pyx_v_chg); __Pyx_GIVEREF(__pyx_v_chg); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_chg)) __PYX_ERR(0, 498, __pyx_L1_error); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "borg/item.pyx":496 * chg = 'removed ' + item_type * return ({"type": chg}, chg) * if self._item1.get('deleted') and not self._item2.get('deleted'): # <<<<<<<<<<<<<< * chg = 'added ' + item_type * return ({"type": chg}, chg) */ } /* "borg/item.pyx":492 * return True * * def _presence_diff(self, item_type): # <<<<<<<<<<<<<< * if not self._item1.get('deleted') and self._item2.get('deleted'): * chg = 'removed ' + item_type */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("borg.item.ItemDiff._presence_diff", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_chg); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/item.pyx":500 * return ({"type": chg}, chg) * * def _link_diff(self): # <<<<<<<<<<<<<< * pd = self._presence_diff('link') * if pd is not None: */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_4item_8ItemDiff_11_link_diff(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_4item_8ItemDiff_11_link_diff = {"_link_diff", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_4item_8ItemDiff_11_link_diff, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_4item_8ItemDiff_11_link_diff(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_link_diff (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 500, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_link_diff") < 0)) __PYX_ERR(0, 500, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_link_diff", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 500, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.item.ItemDiff._link_diff", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_4item_8ItemDiff_10_link_diff(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_4item_8ItemDiff_10_link_diff(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_v_pd = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_link_diff", 1); /* "borg/item.pyx":501 * * def _link_diff(self): * pd = self._presence_diff('link') # <<<<<<<<<<<<<< * if pd is not None: * return pd */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_presence_diff); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_n_s_link}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_pd = __pyx_t_1; __pyx_t_1 = 0; /* "borg/item.pyx":502 * def _link_diff(self): * pd = self._presence_diff('link') * if pd is not None: # <<<<<<<<<<<<<< * return pd * if 'source' in self._item1 and 'source' in self._item2 and self._item1.source != self._item2.source: */ __pyx_t_5 = (__pyx_v_pd != Py_None); if (__pyx_t_5) { /* "borg/item.pyx":503 * pd = self._presence_diff('link') * if pd is not None: * return pd # <<<<<<<<<<<<<< * if 'source' in self._item1 and 'source' in self._item2 and self._item1.source != self._item2.source: * return ({"type": 'changed link'}, 'changed link') */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_pd); __pyx_r = __pyx_v_pd; goto __pyx_L0; /* "borg/item.pyx":502 * def _link_diff(self): * pd = self._presence_diff('link') * if pd is not None: # <<<<<<<<<<<<<< * return pd * if 'source' in self._item1 and 'source' in self._item2 and self._item1.source != self._item2.source: */ } /* "borg/item.pyx":504 * if pd is not None: * return pd * if 'source' in self._item1 and 'source' in self._item2 and self._item1.source != self._item2.source: # <<<<<<<<<<<<<< * return ({"type": 'changed link'}, 'changed link') * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item1_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_source, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L5_bool_binop_done; } __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item2_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_source, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L5_bool_binop_done; } __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item1_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_source); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item2_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_source); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = __pyx_t_6; __pyx_L5_bool_binop_done:; if (__pyx_t_5) { /* "borg/item.pyx":505 * return pd * if 'source' in self._item1 and 'source' in self._item2 and self._item1.source != self._item2.source: * return ({"type": 'changed link'}, 'changed link') # <<<<<<<<<<<<<< * * def _content_diff(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_type, __pyx_kp_s_changed_link) < 0) __PYX_ERR(0, 505, __pyx_L1_error) __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 505, __pyx_L1_error); __Pyx_INCREF(__pyx_kp_s_changed_link); __Pyx_GIVEREF(__pyx_kp_s_changed_link); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_s_changed_link)) __PYX_ERR(0, 505, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "borg/item.pyx":504 * if pd is not None: * return pd * if 'source' in self._item1 and 'source' in self._item2 and self._item1.source != self._item2.source: # <<<<<<<<<<<<<< * return ({"type": 'changed link'}, 'changed link') * */ } /* "borg/item.pyx":500 * return ({"type": chg}, chg) * * def _link_diff(self): # <<<<<<<<<<<<<< * pd = self._presence_diff('link') * if pd is not None: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("borg.item.ItemDiff._link_diff", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_pd); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/item.pyx":507 * return ({"type": 'changed link'}, 'changed link') * * def _content_diff(self): # <<<<<<<<<<<<<< * if self._item1.get('deleted'): * sz = self._item2.get_size() */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_4item_8ItemDiff_13_content_diff(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_4item_8ItemDiff_13_content_diff = {"_content_diff", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_4item_8ItemDiff_13_content_diff, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_4item_8ItemDiff_13_content_diff(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_content_diff (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 507, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_content_diff") < 0)) __PYX_ERR(0, 507, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_content_diff", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 507, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.item.ItemDiff._content_diff", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_4item_8ItemDiff_12_content_diff(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_4item_8ItemDiff_12_content_diff(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_v_sz = NULL; PyObject *__pyx_v_chunk_ids1 = NULL; PyObject *__pyx_v_chunk_ids2 = NULL; PyObject *__pyx_v_added_ids = NULL; PyObject *__pyx_v_removed_ids = NULL; PyObject *__pyx_v_added = NULL; PyObject *__pyx_v_removed = NULL; PyObject *__pyx_8genexpr6__pyx_v_c = NULL; PyObject *__pyx_8genexpr7__pyx_v_c = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; Py_ssize_t __pyx_t_10; PyObject *(*__pyx_t_11)(PyObject *); PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_content_diff", 1); /* "borg/item.pyx":508 * * def _content_diff(self): * if self._item1.get('deleted'): # <<<<<<<<<<<<<< * sz = self._item2.get_size() * return ({"type": "added", "size": sz}, 'added {:>13}'.format(format_file_size(sz))) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item1_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_n_s_deleted}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { /* "borg/item.pyx":509 * def _content_diff(self): * if self._item1.get('deleted'): * sz = self._item2.get_size() # <<<<<<<<<<<<<< * return ({"type": "added", "size": sz}, 'added {:>13}'.format(format_file_size(sz))) * if self._item2.get('deleted'): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item2_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_sz = __pyx_t_1; __pyx_t_1 = 0; /* "borg/item.pyx":510 * if self._item1.get('deleted'): * sz = self._item2.get_size() * return ({"type": "added", "size": sz}, 'added {:>13}'.format(format_file_size(sz))) # <<<<<<<<<<<<<< * if self._item2.get('deleted'): * sz = self._item1.get_size() */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_type, __pyx_n_s_added_2) < 0) __PYX_ERR(0, 510, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_size, __pyx_v_sz) < 0) __PYX_ERR(0, 510, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_added_13, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_format_file_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_sz}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_t_7 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 510, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 510, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "borg/item.pyx":508 * * def _content_diff(self): * if self._item1.get('deleted'): # <<<<<<<<<<<<<< * sz = self._item2.get_size() * return ({"type": "added", "size": sz}, 'added {:>13}'.format(format_file_size(sz))) */ } /* "borg/item.pyx":511 * sz = self._item2.get_size() * return ({"type": "added", "size": sz}, 'added {:>13}'.format(format_file_size(sz))) * if self._item2.get('deleted'): # <<<<<<<<<<<<<< * sz = self._item1.get_size() * return ({"type": "removed", "size": sz}, 'removed {:>11}'.format(format_file_size(sz))) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item2_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 511, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 511, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_n_s_deleted}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 511, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 511, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_5) { /* "borg/item.pyx":512 * return ({"type": "added", "size": sz}, 'added {:>13}'.format(format_file_size(sz))) * if self._item2.get('deleted'): * sz = self._item1.get_size() # <<<<<<<<<<<<<< * return ({"type": "removed", "size": sz}, 'removed {:>11}'.format(format_file_size(sz))) * if not self._can_compare_chunk_ids: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item1_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_sz = __pyx_t_3; __pyx_t_3 = 0; /* "borg/item.pyx":513 * if self._item2.get('deleted'): * sz = self._item1.get_size() * return ({"type": "removed", "size": sz}, 'removed {:>11}'.format(format_file_size(sz))) # <<<<<<<<<<<<<< * if not self._can_compare_chunk_ids: * return ({"type": "modified"}, "modified") */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_type, __pyx_n_s_removed_2) < 0) __PYX_ERR(0, 513, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_size, __pyx_v_sz) < 0) __PYX_ERR(0, 513, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_removed_11, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_format_file_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_sz}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_t_7 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 513, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 513, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/item.pyx":511 * sz = self._item2.get_size() * return ({"type": "added", "size": sz}, 'added {:>13}'.format(format_file_size(sz))) * if self._item2.get('deleted'): # <<<<<<<<<<<<<< * sz = self._item1.get_size() * return ({"type": "removed", "size": sz}, 'removed {:>11}'.format(format_file_size(sz))) */ } /* "borg/item.pyx":514 * sz = self._item1.get_size() * return ({"type": "removed", "size": sz}, 'removed {:>11}'.format(format_file_size(sz))) * if not self._can_compare_chunk_ids: # <<<<<<<<<<<<<< * return ({"type": "modified"}, "modified") * chunk_ids1 = {c.id for c in self._item1.chunks} */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_can_compare_chunk_ids_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = (!__pyx_t_5); if (__pyx_t_9) { /* "borg/item.pyx":515 * return ({"type": "removed", "size": sz}, 'removed {:>11}'.format(format_file_size(sz))) * if not self._can_compare_chunk_ids: * return ({"type": "modified"}, "modified") # <<<<<<<<<<<<<< * chunk_ids1 = {c.id for c in self._item1.chunks} * chunk_ids2 = {c.id for c in self._item2.chunks} */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_type, __pyx_n_s_modified) < 0) __PYX_ERR(0, 515, __pyx_L1_error) __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 515, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_modified); __Pyx_GIVEREF(__pyx_n_s_modified); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_modified)) __PYX_ERR(0, 515, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "borg/item.pyx":514 * sz = self._item1.get_size() * return ({"type": "removed", "size": sz}, 'removed {:>11}'.format(format_file_size(sz))) * if not self._can_compare_chunk_ids: # <<<<<<<<<<<<<< * return ({"type": "modified"}, "modified") * chunk_ids1 = {c.id for c in self._item1.chunks} */ } /* "borg/item.pyx":516 * if not self._can_compare_chunk_ids: * return ({"type": "modified"}, "modified") * chunk_ids1 = {c.id for c in self._item1.chunks} # <<<<<<<<<<<<<< * chunk_ids2 = {c.id for c in self._item2.chunks} * added_ids = chunk_ids2 - chunk_ids1 */ { /* enter inner scope */ __pyx_t_2 = PySet_New(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 516, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item1_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_chunks); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 516, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_10 = 0; __pyx_t_11 = NULL; } else { __pyx_t_10 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 516, __pyx_L8_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_11)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 516, __pyx_L8_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 516, __pyx_L8_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 516, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 516, __pyx_L8_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 516, __pyx_L8_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 516, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_11(__pyx_t_1); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 516, __pyx_L8_error) } break; } __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_8genexpr6__pyx_v_c, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr6__pyx_v_c, __pyx_n_s_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 516, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely(PySet_Add(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 516, __pyx_L8_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_c); __pyx_8genexpr6__pyx_v_c = 0; goto __pyx_L12_exit_scope; __pyx_L8_error:; __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_c); __pyx_8genexpr6__pyx_v_c = 0; goto __pyx_L1_error; __pyx_L12_exit_scope:; } /* exit inner scope */ __pyx_v_chunk_ids1 = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "borg/item.pyx":517 * return ({"type": "modified"}, "modified") * chunk_ids1 = {c.id for c in self._item1.chunks} * chunk_ids2 = {c.id for c in self._item2.chunks} # <<<<<<<<<<<<<< * added_ids = chunk_ids2 - chunk_ids1 * removed_ids = chunk_ids1 - chunk_ids2 */ { /* enter inner scope */ __pyx_t_2 = PySet_New(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 517, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item2_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_chunks); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 517, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_10 = 0; __pyx_t_11 = NULL; } else { __pyx_t_10 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 517, __pyx_L15_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_11)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 517, __pyx_L15_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 517, __pyx_L15_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 517, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 517, __pyx_L15_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 517, __pyx_L15_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 517, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_11(__pyx_t_1); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 517, __pyx_L15_error) } break; } __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_c, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr7__pyx_v_c, __pyx_n_s_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 517, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely(PySet_Add(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 517, __pyx_L15_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_c); __pyx_8genexpr7__pyx_v_c = 0; goto __pyx_L19_exit_scope; __pyx_L15_error:; __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_c); __pyx_8genexpr7__pyx_v_c = 0; goto __pyx_L1_error; __pyx_L19_exit_scope:; } /* exit inner scope */ __pyx_v_chunk_ids2 = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "borg/item.pyx":518 * chunk_ids1 = {c.id for c in self._item1.chunks} * chunk_ids2 = {c.id for c in self._item2.chunks} * added_ids = chunk_ids2 - chunk_ids1 # <<<<<<<<<<<<<< * removed_ids = chunk_ids1 - chunk_ids2 * added = self._item2.get_size(consider_ids=added_ids) */ __pyx_t_2 = PyNumber_Subtract(__pyx_v_chunk_ids2, __pyx_v_chunk_ids1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_added_ids = __pyx_t_2; __pyx_t_2 = 0; /* "borg/item.pyx":519 * chunk_ids2 = {c.id for c in self._item2.chunks} * added_ids = chunk_ids2 - chunk_ids1 * removed_ids = chunk_ids1 - chunk_ids2 # <<<<<<<<<<<<<< * added = self._item2.get_size(consider_ids=added_ids) * removed = self._item1.get_size(consider_ids=removed_ids) */ __pyx_t_2 = PyNumber_Subtract(__pyx_v_chunk_ids1, __pyx_v_chunk_ids2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_removed_ids = __pyx_t_2; __pyx_t_2 = 0; /* "borg/item.pyx":520 * added_ids = chunk_ids2 - chunk_ids1 * removed_ids = chunk_ids1 - chunk_ids2 * added = self._item2.get_size(consider_ids=added_ids) # <<<<<<<<<<<<<< * removed = self._item1.get_size(consider_ids=removed_ids) * return ({"type": "modified", "added": added, "removed": removed}, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item2_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_consider_ids, __pyx_v_added_ids) < 0) __PYX_ERR(0, 520, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_added = __pyx_t_3; __pyx_t_3 = 0; /* "borg/item.pyx":521 * removed_ids = chunk_ids1 - chunk_ids2 * added = self._item2.get_size(consider_ids=added_ids) * removed = self._item1.get_size(consider_ids=removed_ids) # <<<<<<<<<<<<<< * return ({"type": "modified", "added": added, "removed": removed}, * '{:>9} {:>9}'.format(format_file_size(added, precision=1, sign=True), */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item1_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_consider_ids, __pyx_v_removed_ids) < 0) __PYX_ERR(0, 521, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_removed = __pyx_t_1; __pyx_t_1 = 0; /* "borg/item.pyx":522 * added = self._item2.get_size(consider_ids=added_ids) * removed = self._item1.get_size(consider_ids=removed_ids) * return ({"type": "modified", "added": added, "removed": removed}, # <<<<<<<<<<<<<< * '{:>9} {:>9}'.format(format_file_size(added, precision=1, sign=True), * format_file_size(-removed, precision=1, sign=True))) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_type, __pyx_n_s_modified) < 0) __PYX_ERR(0, 522, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_added_2, __pyx_v_added) < 0) __PYX_ERR(0, 522, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_removed_2, __pyx_v_removed) < 0) __PYX_ERR(0, 522, __pyx_L1_error) /* "borg/item.pyx":523 * removed = self._item1.get_size(consider_ids=removed_ids) * return ({"type": "modified", "added": added, "removed": removed}, * '{:>9} {:>9}'.format(format_file_size(added, precision=1, sign=True), # <<<<<<<<<<<<<< * format_file_size(-removed, precision=1, sign=True))) * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_9_9, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_format_file_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_added); __Pyx_GIVEREF(__pyx_v_added); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_added)) __PYX_ERR(0, 523, __pyx_L1_error); __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_precision, __pyx_int_1) < 0) __PYX_ERR(0, 523, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_sign, Py_True) < 0) __PYX_ERR(0, 523, __pyx_L1_error) __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "borg/item.pyx":524 * return ({"type": "modified", "added": added, "removed": removed}, * '{:>9} {:>9}'.format(format_file_size(added, precision=1, sign=True), * format_file_size(-removed, precision=1, sign=True))) # <<<<<<<<<<<<<< * * def _owner_diff(self): */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_format_file_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = PyNumber_Negative(__pyx_v_removed); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7)) __PYX_ERR(0, 524, __pyx_L1_error); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_precision, __pyx_int_1) < 0) __PYX_ERR(0, 524, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_sign, Py_True) < 0) __PYX_ERR(0, 524, __pyx_L1_error) __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_12, __pyx_t_13}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } /* "borg/item.pyx":522 * added = self._item2.get_size(consider_ids=added_ids) * removed = self._item1.get_size(consider_ids=removed_ids) * return ({"type": "modified", "added": added, "removed": removed}, # <<<<<<<<<<<<<< * '{:>9} {:>9}'.format(format_file_size(added, precision=1, sign=True), * format_file_size(-removed, precision=1, sign=True))) */ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3)) __PYX_ERR(0, 522, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "borg/item.pyx":507 * return ({"type": 'changed link'}, 'changed link') * * def _content_diff(self): # <<<<<<<<<<<<<< * if self._item1.get('deleted'): * sz = self._item2.get_size() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_AddTraceback("borg.item.ItemDiff._content_diff", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_sz); __Pyx_XDECREF(__pyx_v_chunk_ids1); __Pyx_XDECREF(__pyx_v_chunk_ids2); __Pyx_XDECREF(__pyx_v_added_ids); __Pyx_XDECREF(__pyx_v_removed_ids); __Pyx_XDECREF(__pyx_v_added); __Pyx_XDECREF(__pyx_v_removed); __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_c); __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/item.pyx":526 * format_file_size(-removed, precision=1, sign=True))) * * def _owner_diff(self): # <<<<<<<<<<<<<< * u_attr, g_attr = ('uid', 'gid') if self._numeric_ids else ('user', 'group') * u1, g1 = self._item1.get(u_attr), self._item1.get(g_attr) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_4item_8ItemDiff_15_owner_diff(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_4item_8ItemDiff_15_owner_diff = {"_owner_diff", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_4item_8ItemDiff_15_owner_diff, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_4item_8ItemDiff_15_owner_diff(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_owner_diff (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 526, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_owner_diff") < 0)) __PYX_ERR(0, 526, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_owner_diff", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 526, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.item.ItemDiff._owner_diff", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_4item_8ItemDiff_14_owner_diff(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_4item_8ItemDiff_14_owner_diff(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_v_u_attr = NULL; PyObject *__pyx_v_g_attr = NULL; PyObject *__pyx_v_u1 = NULL; PyObject *__pyx_v_g1 = NULL; PyObject *__pyx_v_u2 = NULL; PyObject *__pyx_v_g2 = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_owner_diff", 1); /* "borg/item.pyx":527 * * def _owner_diff(self): * u_attr, g_attr = ('uid', 'gid') if self._numeric_ids else ('user', 'group') # <<<<<<<<<<<<<< * u1, g1 = self._item1.get(u_attr), self._item1.get(g_attr) * u2, g2 = self._item2.get(u_attr), self._item2.get(g_attr) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_numeric_ids_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { __Pyx_INCREF(__pyx_tuple__11); __pyx_t_1 = __pyx_tuple__11; } else { __Pyx_INCREF(__pyx_tuple__12); __pyx_t_1 = __pyx_tuple__12; } if (likely(__pyx_t_1 != Py_None)) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 527, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 527, __pyx_L1_error) } __pyx_v_u_attr = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_g_attr = __pyx_t_4; __pyx_t_4 = 0; /* "borg/item.pyx":528 * def _owner_diff(self): * u_attr, g_attr = ('uid', 'gid') if self._numeric_ids else ('user', 'group') * u1, g1 = self._item1.get(u_attr), self._item1.get(g_attr) # <<<<<<<<<<<<<< * u2, g2 = self._item2.get(u_attr), self._item2.get(g_attr) * if (u1, g1) != (u2, g2): */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item1_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_u_attr}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item1_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_g_attr}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_v_u1 = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_g1 = __pyx_t_2; __pyx_t_2 = 0; /* "borg/item.pyx":529 * u_attr, g_attr = ('uid', 'gid') if self._numeric_ids else ('user', 'group') * u1, g1 = self._item1.get(u_attr), self._item1.get(g_attr) * u2, g2 = self._item2.get(u_attr), self._item2.get(g_attr) # <<<<<<<<<<<<<< * if (u1, g1) != (u2, g2): * return ({"type": "owner", "old_user": u1, "old_group": g1, "new_user": u2, "new_group": g2}, */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item2_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_u_attr}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item2_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_g_attr}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_u2 = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_g2 = __pyx_t_6; __pyx_t_6 = 0; /* "borg/item.pyx":530 * u1, g1 = self._item1.get(u_attr), self._item1.get(g_attr) * u2, g2 = self._item2.get(u_attr), self._item2.get(g_attr) * if (u1, g1) != (u2, g2): # <<<<<<<<<<<<<< * return ({"type": "owner", "old_user": u1, "old_group": g1, "new_user": u2, "new_group": g2}, * '[{}:{} -> {}:{}]'.format(u1, g1, u2, g2)) */ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_u1); __Pyx_GIVEREF(__pyx_v_u1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_u1)) __PYX_ERR(0, 530, __pyx_L1_error); __Pyx_INCREF(__pyx_v_g1); __Pyx_GIVEREF(__pyx_v_g1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_g1)) __PYX_ERR(0, 530, __pyx_L1_error); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_u2); __Pyx_GIVEREF(__pyx_v_u2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_u2)) __PYX_ERR(0, 530, __pyx_L1_error); __Pyx_INCREF(__pyx_v_g2); __Pyx_GIVEREF(__pyx_v_g2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_g2)) __PYX_ERR(0, 530, __pyx_L1_error); __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 530, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 530, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { /* "borg/item.pyx":531 * u2, g2 = self._item2.get(u_attr), self._item2.get(g_attr) * if (u1, g1) != (u2, g2): * return ({"type": "owner", "old_user": u1, "old_group": g1, "new_user": u2, "new_group": g2}, # <<<<<<<<<<<<<< * '[{}:{} -> {}:{}]'.format(u1, g1, u2, g2)) * */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_type, __pyx_n_s_owner) < 0) __PYX_ERR(0, 531, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_old_user, __pyx_v_u1) < 0) __PYX_ERR(0, 531, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_old_group, __pyx_v_g1) < 0) __PYX_ERR(0, 531, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_new_user, __pyx_v_u2) < 0) __PYX_ERR(0, 531, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_new_group, __pyx_v_g2) < 0) __PYX_ERR(0, 531, __pyx_L1_error) /* "borg/item.pyx":532 * if (u1, g1) != (u2, g2): * return ({"type": "owner", "old_user": u1, "old_group": g1, "new_user": u2, "new_group": g2}, * '[{}:{} -> {}:{}]'.format(u1, g1, u2, g2)) # <<<<<<<<<<<<<< * * def _mode_diff(self): */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s__13, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 532, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_1, __pyx_v_u1, __pyx_v_g1, __pyx_v_u2, __pyx_v_g2}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_5, 4+__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 532, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } /* "borg/item.pyx":531 * u2, g2 = self._item2.get(u_attr), self._item2.get(g_attr) * if (u1, g1) != (u2, g2): * return ({"type": "owner", "old_user": u1, "old_group": g1, "new_user": u2, "new_group": g2}, # <<<<<<<<<<<<<< * '[{}:{} -> {}:{}]'.format(u1, g1, u2, g2)) * */ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2)) __PYX_ERR(0, 531, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "borg/item.pyx":530 * u1, g1 = self._item1.get(u_attr), self._item1.get(g_attr) * u2, g2 = self._item2.get(u_attr), self._item2.get(g_attr) * if (u1, g1) != (u2, g2): # <<<<<<<<<<<<<< * return ({"type": "owner", "old_user": u1, "old_group": g1, "new_user": u2, "new_group": g2}, * '[{}:{} -> {}:{}]'.format(u1, g1, u2, g2)) */ } /* "borg/item.pyx":526 * format_file_size(-removed, precision=1, sign=True))) * * def _owner_diff(self): # <<<<<<<<<<<<<< * u_attr, g_attr = ('uid', 'gid') if self._numeric_ids else ('user', 'group') * u1, g1 = self._item1.get(u_attr), self._item1.get(g_attr) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("borg.item.ItemDiff._owner_diff", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_u_attr); __Pyx_XDECREF(__pyx_v_g_attr); __Pyx_XDECREF(__pyx_v_u1); __Pyx_XDECREF(__pyx_v_g1); __Pyx_XDECREF(__pyx_v_u2); __Pyx_XDECREF(__pyx_v_g2); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/item.pyx":534 * '[{}:{} -> {}:{}]'.format(u1, g1, u2, g2)) * * def _mode_diff(self): # <<<<<<<<<<<<<< * if 'mode' in self._item1 and 'mode' in self._item2 and self._item1.mode != self._item2.mode: * mode1 = stat.filemode(self._item1.mode) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_4item_8ItemDiff_17_mode_diff(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_4item_8ItemDiff_17_mode_diff = {"_mode_diff", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_4item_8ItemDiff_17_mode_diff, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_4item_8ItemDiff_17_mode_diff(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_mode_diff (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 534, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_mode_diff") < 0)) __PYX_ERR(0, 534, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_mode_diff", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 534, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.item.ItemDiff._mode_diff", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_4item_8ItemDiff_16_mode_diff(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_4item_8ItemDiff_16_mode_diff(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_v_mode1 = NULL; PyObject *__pyx_v_mode2 = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_mode_diff", 1); /* "borg/item.pyx":535 * * def _mode_diff(self): * if 'mode' in self._item1 and 'mode' in self._item2 and self._item1.mode != self._item2.mode: # <<<<<<<<<<<<<< * mode1 = stat.filemode(self._item1.mode) * mode2 = stat.filemode(self._item2.mode) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item1_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_mode, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item2_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_mode, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item1_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_mode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item2_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "borg/item.pyx":536 * def _mode_diff(self): * if 'mode' in self._item1 and 'mode' in self._item2 and self._item1.mode != self._item2.mode: * mode1 = stat.filemode(self._item1.mode) # <<<<<<<<<<<<<< * mode2 = stat.filemode(self._item2.mode) * return ({"type": "mode", "old_mode": mode1, "new_mode": mode2}, '[{} -> {}]'.format(mode1, mode2)) */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_stat); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_filemode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item1_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_mode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_mode1 = __pyx_t_2; __pyx_t_2 = 0; /* "borg/item.pyx":537 * if 'mode' in self._item1 and 'mode' in self._item2 and self._item1.mode != self._item2.mode: * mode1 = stat.filemode(self._item1.mode) * mode2 = stat.filemode(self._item2.mode) # <<<<<<<<<<<<<< * return ({"type": "mode", "old_mode": mode1, "new_mode": mode2}, '[{} -> {}]'.format(mode1, mode2)) * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_stat); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_filemode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item2_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_v_mode2 = __pyx_t_2; __pyx_t_2 = 0; /* "borg/item.pyx":538 * mode1 = stat.filemode(self._item1.mode) * mode2 = stat.filemode(self._item2.mode) * return ({"type": "mode", "old_mode": mode1, "new_mode": mode2}, '[{} -> {}]'.format(mode1, mode2)) # <<<<<<<<<<<<<< * * def _time_diffs(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_type, __pyx_n_s_mode) < 0) __PYX_ERR(0, 538, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_old_mode, __pyx_v_mode1) < 0) __PYX_ERR(0, 538, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_new_mode, __pyx_v_mode2) < 0) __PYX_ERR(0, 538, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s__14, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_mode1, __pyx_v_mode2}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2)) __PYX_ERR(0, 538, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6)) __PYX_ERR(0, 538, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_6 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "borg/item.pyx":535 * * def _mode_diff(self): * if 'mode' in self._item1 and 'mode' in self._item2 and self._item1.mode != self._item2.mode: # <<<<<<<<<<<<<< * mode1 = stat.filemode(self._item1.mode) * mode2 = stat.filemode(self._item2.mode) */ } /* "borg/item.pyx":534 * '[{}:{} -> {}:{}]'.format(u1, g1, u2, g2)) * * def _mode_diff(self): # <<<<<<<<<<<<<< * if 'mode' in self._item1 and 'mode' in self._item2 and self._item1.mode != self._item2.mode: * mode1 = stat.filemode(self._item1.mode) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("borg.item.ItemDiff._mode_diff", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_mode1); __Pyx_XDECREF(__pyx_v_mode2); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/item.pyx":540 * return ({"type": "mode", "old_mode": mode1, "new_mode": mode2}, '[{} -> {}]'.format(mode1, mode2)) * * def _time_diffs(self): # <<<<<<<<<<<<<< * changes = [] * attrs = ["ctime", "mtime"] */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_4item_8ItemDiff_19_time_diffs(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_4item_8ItemDiff_19_time_diffs = {"_time_diffs", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_4item_8ItemDiff_19_time_diffs, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_4item_8ItemDiff_19_time_diffs(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_time_diffs (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 540, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_time_diffs") < 0)) __PYX_ERR(0, 540, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_time_diffs", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 540, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.item.ItemDiff._time_diffs", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_4item_8ItemDiff_18_time_diffs(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_4item_8ItemDiff_18_time_diffs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_v_changes = NULL; PyObject *__pyx_v_attrs = NULL; PyObject *__pyx_v_attr = NULL; PyObject *__pyx_v_ts1 = NULL; PyObject *__pyx_v_ts2 = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_time_diffs", 1); /* "borg/item.pyx":541 * * def _time_diffs(self): * changes = [] # <<<<<<<<<<<<<< * attrs = ["ctime", "mtime"] * for attr in attrs: */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_changes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "borg/item.pyx":542 * def _time_diffs(self): * changes = [] * attrs = ["ctime", "mtime"] # <<<<<<<<<<<<<< * for attr in attrs: * if attr in self._item1 and attr in self._item2 and self._item1.get(attr) != self._item2.get(attr): */ __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_ctime); __Pyx_GIVEREF(__pyx_n_s_ctime); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_ctime)) __PYX_ERR(0, 542, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_mtime); __Pyx_GIVEREF(__pyx_n_s_mtime); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_mtime)) __PYX_ERR(0, 542, __pyx_L1_error); __pyx_v_attrs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "borg/item.pyx":543 * changes = [] * attrs = ["ctime", "mtime"] * for attr in attrs: # <<<<<<<<<<<<<< * if attr in self._item1 and attr in self._item2 and self._item1.get(attr) != self._item2.get(attr): * ts1 = OutputTimestamp(safe_timestamp(self._item1.get(attr))) */ __pyx_t_1 = __pyx_v_attrs; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 543, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 543, __pyx_L1_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_attr, __pyx_t_3); __pyx_t_3 = 0; /* "borg/item.pyx":544 * attrs = ["ctime", "mtime"] * for attr in attrs: * if attr in self._item1 and attr in self._item2 and self._item1.get(attr) != self._item2.get(attr): # <<<<<<<<<<<<<< * ts1 = OutputTimestamp(safe_timestamp(self._item1.get(attr))) * ts2 = OutputTimestamp(safe_timestamp(self._item2.get(attr))) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item1_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_attr, __pyx_t_3, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item2_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_attr, __pyx_t_3, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L6_bool_binop_done; } __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item1_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_get_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_attr}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item2_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_get_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_attr}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __pyx_t_9 = PyObject_RichCompare(__pyx_t_3, __pyx_t_7, Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_4 = __pyx_t_5; __pyx_L6_bool_binop_done:; if (__pyx_t_4) { /* "borg/item.pyx":545 * for attr in attrs: * if attr in self._item1 and attr in self._item2 and self._item1.get(attr) != self._item2.get(attr): * ts1 = OutputTimestamp(safe_timestamp(self._item1.get(attr))) # <<<<<<<<<<<<<< * ts2 = OutputTimestamp(safe_timestamp(self._item2.get(attr))) * changes.append(({"type": attr, f"old_{attr}": ts1, f"new_{attr}": ts2}, '[{}: {} -> {}]'.format(attr, ts1, ts2))) */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_OutputTimestamp); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_safe_timestamp); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item1_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_get_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_attr}; __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __pyx_t_12 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_10}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_6 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_3}; __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_XDECREF_SET(__pyx_v_ts1, __pyx_t_9); __pyx_t_9 = 0; /* "borg/item.pyx":546 * if attr in self._item1 and attr in self._item2 and self._item1.get(attr) != self._item2.get(attr): * ts1 = OutputTimestamp(safe_timestamp(self._item1.get(attr))) * ts2 = OutputTimestamp(safe_timestamp(self._item2.get(attr))) # <<<<<<<<<<<<<< * changes.append(({"type": attr, f"old_{attr}": ts1, f"new_{attr}": ts2}, '[{}: {} -> {}]'.format(attr, ts1, ts2))) * return changes */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_OutputTimestamp); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_safe_timestamp); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item2_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_get_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_11))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_attr}; __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __pyx_t_11 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_10}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_6 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_3}; __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_XDECREF_SET(__pyx_v_ts2, __pyx_t_9); __pyx_t_9 = 0; /* "borg/item.pyx":547 * ts1 = OutputTimestamp(safe_timestamp(self._item1.get(attr))) * ts2 = OutputTimestamp(safe_timestamp(self._item2.get(attr))) * changes.append(({"type": attr, f"old_{attr}": ts1, f"new_{attr}": ts2}, '[{}: {} -> {}]'.format(attr, ts1, ts2))) # <<<<<<<<<<<<<< * return changes * */ __pyx_t_9 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_type, __pyx_v_attr) < 0) __PYX_ERR(0, 547, __pyx_L1_error) __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_attr, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_n_u_old, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (PyDict_SetItem(__pyx_t_9, __pyx_t_3, __pyx_v_ts1) < 0) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_v_attr, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_n_u_new, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_t_9, __pyx_t_7, __pyx_v_ts2) < 0) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s__15, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_v_attr, __pyx_v_ts1, __pyx_v_ts2}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 3+__pyx_t_8); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_9); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9)) __PYX_ERR(0, 547, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7)) __PYX_ERR(0, 547, __pyx_L1_error); __pyx_t_9 = 0; __pyx_t_7 = 0; __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_changes, __pyx_t_3); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/item.pyx":544 * attrs = ["ctime", "mtime"] * for attr in attrs: * if attr in self._item1 and attr in self._item2 and self._item1.get(attr) != self._item2.get(attr): # <<<<<<<<<<<<<< * ts1 = OutputTimestamp(safe_timestamp(self._item1.get(attr))) * ts2 = OutputTimestamp(safe_timestamp(self._item2.get(attr))) */ } /* "borg/item.pyx":543 * changes = [] * attrs = ["ctime", "mtime"] * for attr in attrs: # <<<<<<<<<<<<<< * if attr in self._item1 and attr in self._item2 and self._item1.get(attr) != self._item2.get(attr): * ts1 = OutputTimestamp(safe_timestamp(self._item1.get(attr))) */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/item.pyx":548 * ts2 = OutputTimestamp(safe_timestamp(self._item2.get(attr))) * changes.append(({"type": attr, f"old_{attr}": ts1, f"new_{attr}": ts2}, '[{}: {} -> {}]'.format(attr, ts1, ts2))) * return changes # <<<<<<<<<<<<<< * * def _content_equal(self, chunk_iterator1, chunk_iterator2): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_changes); __pyx_r = __pyx_v_changes; goto __pyx_L0; /* "borg/item.pyx":540 * return ({"type": "mode", "old_mode": mode1, "new_mode": mode2}, '[{} -> {}]'.format(mode1, mode2)) * * def _time_diffs(self): # <<<<<<<<<<<<<< * changes = [] * attrs = ["ctime", "mtime"] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("borg.item.ItemDiff._time_diffs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_changes); __Pyx_XDECREF(__pyx_v_attrs); __Pyx_XDECREF(__pyx_v_attr); __Pyx_XDECREF(__pyx_v_ts1); __Pyx_XDECREF(__pyx_v_ts2); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/item.pyx":550 * return changes * * def _content_equal(self, chunk_iterator1, chunk_iterator2): # <<<<<<<<<<<<<< * if self._can_compare_chunk_ids: * return self._item1.chunks == self._item2.chunks */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_4item_8ItemDiff_21_content_equal(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_4item_8ItemDiff_21_content_equal = {"_content_equal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_4item_8ItemDiff_21_content_equal, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_4item_8ItemDiff_21_content_equal(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_chunk_iterator1 = 0; PyObject *__pyx_v_chunk_iterator2 = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_content_equal (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_chunk_iterator1,&__pyx_n_s_chunk_iterator2,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 550, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_chunk_iterator1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 550, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("_content_equal", 1, 3, 3, 1); __PYX_ERR(0, 550, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_chunk_iterator2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 550, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("_content_equal", 1, 3, 3, 2); __PYX_ERR(0, 550, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_content_equal") < 0)) __PYX_ERR(0, 550, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_self = values[0]; __pyx_v_chunk_iterator1 = values[1]; __pyx_v_chunk_iterator2 = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_content_equal", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 550, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.item.ItemDiff._content_equal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_4item_8ItemDiff_20_content_equal(__pyx_self, __pyx_v_self, __pyx_v_chunk_iterator1, __pyx_v_chunk_iterator2); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_4item_8ItemDiff_20_content_equal(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_chunk_iterator1, PyObject *__pyx_v_chunk_iterator2) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_content_equal", 1); /* "borg/item.pyx":551 * * def _content_equal(self, chunk_iterator1, chunk_iterator2): * if self._can_compare_chunk_ids: # <<<<<<<<<<<<<< * return self._item1.chunks == self._item2.chunks * if self._item1.get_size() != self._item2.get_size(): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_can_compare_chunk_ids_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "borg/item.pyx":552 * def _content_equal(self, chunk_iterator1, chunk_iterator2): * if self._can_compare_chunk_ids: * return self._item1.chunks == self._item2.chunks # <<<<<<<<<<<<<< * if self._item1.get_size() != self._item2.get_size(): * return False */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item1_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_chunks); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item2_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_chunks); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/item.pyx":551 * * def _content_equal(self, chunk_iterator1, chunk_iterator2): * if self._can_compare_chunk_ids: # <<<<<<<<<<<<<< * return self._item1.chunks == self._item2.chunks * if self._item1.get_size() != self._item2.get_size(): */ } /* "borg/item.pyx":553 * if self._can_compare_chunk_ids: * return self._item1.chunks == self._item2.chunks * if self._item1.get_size() != self._item2.get_size(): # <<<<<<<<<<<<<< * return False * return chunks_contents_equal(chunk_iterator1, chunk_iterator2) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item1_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_item2_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_2) { /* "borg/item.pyx":554 * return self._item1.chunks == self._item2.chunks * if self._item1.get_size() != self._item2.get_size(): * return False # <<<<<<<<<<<<<< * return chunks_contents_equal(chunk_iterator1, chunk_iterator2) * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "borg/item.pyx":553 * if self._can_compare_chunk_ids: * return self._item1.chunks == self._item2.chunks * if self._item1.get_size() != self._item2.get_size(): # <<<<<<<<<<<<<< * return False * return chunks_contents_equal(chunk_iterator1, chunk_iterator2) */ } /* "borg/item.pyx":555 * if self._item1.get_size() != self._item2.get_size(): * return False * return chunks_contents_equal(chunk_iterator1, chunk_iterator2) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_chunks_contents_equal); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_chunk_iterator1, __pyx_v_chunk_iterator2}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "borg/item.pyx":550 * return changes * * def _content_equal(self, chunk_iterator1, chunk_iterator2): # <<<<<<<<<<<<<< * if self._can_compare_chunk_ids: * return self._item1.chunks == self._item2.chunks */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("borg.item.ItemDiff._content_equal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/item.pyx":558 * * * def chunks_contents_equal(chunks1, chunks2): # <<<<<<<<<<<<<< * """ * Compare chunk content and return True if they are identical. */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_4item_5chunks_contents_equal(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_4item_4chunks_contents_equal, "\n Compare chunk content and return True if they are identical.\n\n The chunks must be given as chunk iterators (like returned by :meth:`.DownloadPipeline.fetch_many`).\n "); static PyMethodDef __pyx_mdef_4borg_4item_5chunks_contents_equal = {"chunks_contents_equal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_4item_5chunks_contents_equal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_4item_4chunks_contents_equal}; static PyObject *__pyx_pw_4borg_4item_5chunks_contents_equal(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_chunks1 = 0; PyObject *__pyx_v_chunks2 = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("chunks_contents_equal (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_chunks1,&__pyx_n_s_chunks2,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_chunks1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 558, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_chunks2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 558, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("chunks_contents_equal", 1, 2, 2, 1); __PYX_ERR(0, 558, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "chunks_contents_equal") < 0)) __PYX_ERR(0, 558, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_chunks1 = values[0]; __pyx_v_chunks2 = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("chunks_contents_equal", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 558, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.item.chunks_contents_equal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_4item_4chunks_contents_equal(__pyx_self, __pyx_v_chunks1, __pyx_v_chunks2); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_4item_4chunks_contents_equal(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_chunks1, PyObject *__pyx_v_chunks2) { PyObject *__pyx_v_end = NULL; PyObject *__pyx_v_alen = NULL; PyObject *__pyx_v_ai = NULL; PyObject *__pyx_v_blen = NULL; PyObject *__pyx_v_bi = NULL; PyObject *__pyx_v_a = NULL; PyObject *__pyx_v_b = NULL; PyObject *__pyx_v_slicelen = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("chunks_contents_equal", 1); /* "borg/item.pyx":565 * """ * * end = object() # <<<<<<<<<<<<<< * alen = ai = 0 * blen = bi = 0 */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_object); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_end = __pyx_t_1; __pyx_t_1 = 0; /* "borg/item.pyx":566 * * end = object() * alen = ai = 0 # <<<<<<<<<<<<<< * blen = bi = 0 * while True: */ __Pyx_INCREF(__pyx_int_0); __pyx_v_alen = __pyx_int_0; __Pyx_INCREF(__pyx_int_0); __pyx_v_ai = __pyx_int_0; /* "borg/item.pyx":567 * end = object() * alen = ai = 0 * blen = bi = 0 # <<<<<<<<<<<<<< * while True: * if not alen - ai: */ __Pyx_INCREF(__pyx_int_0); __pyx_v_blen = __pyx_int_0; __Pyx_INCREF(__pyx_int_0); __pyx_v_bi = __pyx_int_0; /* "borg/item.pyx":568 * alen = ai = 0 * blen = bi = 0 * while True: # <<<<<<<<<<<<<< * if not alen - ai: * a = next(chunks1, end) */ while (1) { /* "borg/item.pyx":569 * blen = bi = 0 * while True: * if not alen - ai: # <<<<<<<<<<<<<< * a = next(chunks1, end) * if a is end: */ __pyx_t_1 = PyNumber_Subtract(__pyx_v_alen, __pyx_v_ai); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (!__pyx_t_2); if (__pyx_t_3) { /* "borg/item.pyx":570 * while True: * if not alen - ai: * a = next(chunks1, end) # <<<<<<<<<<<<<< * if a is end: * return not blen - bi and next(chunks2, end) is end */ __pyx_t_1 = __Pyx_PyIter_Next2(__pyx_v_chunks1, __pyx_v_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_a, __pyx_t_1); __pyx_t_1 = 0; /* "borg/item.pyx":571 * if not alen - ai: * a = next(chunks1, end) * if a is end: # <<<<<<<<<<<<<< * return not blen - bi and next(chunks2, end) is end * a = memoryview(a) */ __pyx_t_3 = (__pyx_v_a == __pyx_v_end); if (__pyx_t_3) { /* "borg/item.pyx":572 * a = next(chunks1, end) * if a is end: * return not blen - bi and next(chunks2, end) is end # <<<<<<<<<<<<<< * a = memoryview(a) * alen = len(a) */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = PyNumber_Subtract(__pyx_v_blen, __pyx_v_bi); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = (!__pyx_t_3); if (__pyx_t_2) { } else { __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L7_bool_binop_done; } __pyx_t_4 = __Pyx_PyIter_Next2(__pyx_v_chunks2, __pyx_v_end); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = (__pyx_t_4 == __pyx_v_end); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __pyx_t_4; __pyx_t_4 = 0; __pyx_L7_bool_binop_done:; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/item.pyx":571 * if not alen - ai: * a = next(chunks1, end) * if a is end: # <<<<<<<<<<<<<< * return not blen - bi and next(chunks2, end) is end * a = memoryview(a) */ } /* "borg/item.pyx":573 * if a is end: * return not blen - bi and next(chunks2, end) is end * a = memoryview(a) # <<<<<<<<<<<<<< * alen = len(a) * ai = 0 */ __pyx_t_1 = PyMemoryView_FromObject(__pyx_v_a); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_a, __pyx_t_1); __pyx_t_1 = 0; /* "borg/item.pyx":574 * return not blen - bi and next(chunks2, end) is end * a = memoryview(a) * alen = len(a) # <<<<<<<<<<<<<< * ai = 0 * if not blen - bi: */ __pyx_t_5 = PyObject_Length(__pyx_v_a); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 574, __pyx_L1_error) __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_alen, __pyx_t_1); __pyx_t_1 = 0; /* "borg/item.pyx":575 * a = memoryview(a) * alen = len(a) * ai = 0 # <<<<<<<<<<<<<< * if not blen - bi: * b = next(chunks2, end) */ __Pyx_INCREF(__pyx_int_0); __Pyx_DECREF_SET(__pyx_v_ai, __pyx_int_0); /* "borg/item.pyx":569 * blen = bi = 0 * while True: * if not alen - ai: # <<<<<<<<<<<<<< * a = next(chunks1, end) * if a is end: */ } /* "borg/item.pyx":576 * alen = len(a) * ai = 0 * if not blen - bi: # <<<<<<<<<<<<<< * b = next(chunks2, end) * if b is end: */ __pyx_t_1 = PyNumber_Subtract(__pyx_v_blen, __pyx_v_bi); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 576, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (!__pyx_t_2); if (__pyx_t_3) { /* "borg/item.pyx":577 * ai = 0 * if not blen - bi: * b = next(chunks2, end) # <<<<<<<<<<<<<< * if b is end: * return not alen - ai and next(chunks1, end) is end */ __pyx_t_1 = __Pyx_PyIter_Next2(__pyx_v_chunks2, __pyx_v_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_b, __pyx_t_1); __pyx_t_1 = 0; /* "borg/item.pyx":578 * if not blen - bi: * b = next(chunks2, end) * if b is end: # <<<<<<<<<<<<<< * return not alen - ai and next(chunks1, end) is end * b = memoryview(b) */ __pyx_t_3 = (__pyx_v_b == __pyx_v_end); if (__pyx_t_3) { /* "borg/item.pyx":579 * b = next(chunks2, end) * if b is end: * return not alen - ai and next(chunks1, end) is end # <<<<<<<<<<<<<< * b = memoryview(b) * blen = len(b) */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = PyNumber_Subtract(__pyx_v_alen, __pyx_v_ai); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 579, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = (!__pyx_t_3); if (__pyx_t_2) { } else { __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L11_bool_binop_done; } __pyx_t_4 = __Pyx_PyIter_Next2(__pyx_v_chunks1, __pyx_v_end); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = (__pyx_t_4 == __pyx_v_end); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __pyx_t_4; __pyx_t_4 = 0; __pyx_L11_bool_binop_done:; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/item.pyx":578 * if not blen - bi: * b = next(chunks2, end) * if b is end: # <<<<<<<<<<<<<< * return not alen - ai and next(chunks1, end) is end * b = memoryview(b) */ } /* "borg/item.pyx":580 * if b is end: * return not alen - ai and next(chunks1, end) is end * b = memoryview(b) # <<<<<<<<<<<<<< * blen = len(b) * bi = 0 */ __pyx_t_1 = PyMemoryView_FromObject(__pyx_v_b); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_b, __pyx_t_1); __pyx_t_1 = 0; /* "borg/item.pyx":581 * return not alen - ai and next(chunks1, end) is end * b = memoryview(b) * blen = len(b) # <<<<<<<<<<<<<< * bi = 0 * slicelen = min(alen - ai, blen - bi) */ __pyx_t_5 = PyObject_Length(__pyx_v_b); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 581, __pyx_L1_error) __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_blen, __pyx_t_1); __pyx_t_1 = 0; /* "borg/item.pyx":582 * b = memoryview(b) * blen = len(b) * bi = 0 # <<<<<<<<<<<<<< * slicelen = min(alen - ai, blen - bi) * if a[ai:ai + slicelen] != b[bi:bi + slicelen]: */ __Pyx_INCREF(__pyx_int_0); __Pyx_DECREF_SET(__pyx_v_bi, __pyx_int_0); /* "borg/item.pyx":576 * alen = len(a) * ai = 0 * if not blen - bi: # <<<<<<<<<<<<<< * b = next(chunks2, end) * if b is end: */ } /* "borg/item.pyx":583 * blen = len(b) * bi = 0 * slicelen = min(alen - ai, blen - bi) # <<<<<<<<<<<<<< * if a[ai:ai + slicelen] != b[bi:bi + slicelen]: * return False */ __pyx_t_1 = PyNumber_Subtract(__pyx_v_blen, __pyx_v_bi); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyNumber_Subtract(__pyx_v_alen, __pyx_v_ai); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 583, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_2) { __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = __pyx_t_1; } else { __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = __pyx_t_4; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_t_6; __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_slicelen, __pyx_t_1); __pyx_t_1 = 0; /* "borg/item.pyx":584 * bi = 0 * slicelen = min(alen - ai, blen - bi) * if a[ai:ai + slicelen] != b[bi:bi + slicelen]: # <<<<<<<<<<<<<< * return False * ai += slicelen */ if (unlikely(!__pyx_v_a)) { __Pyx_RaiseUnboundLocalError("a"); __PYX_ERR(0, 584, __pyx_L1_error) } __pyx_t_1 = PyNumber_Add(__pyx_v_ai, __pyx_v_slicelen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_a, 0, 0, &__pyx_v_ai, &__pyx_t_1, NULL, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_v_b)) { __Pyx_RaiseUnboundLocalError("b"); __PYX_ERR(0, 584, __pyx_L1_error) } __pyx_t_1 = PyNumber_Add(__pyx_v_bi, __pyx_v_slicelen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_b, 0, 0, &__pyx_v_bi, &__pyx_t_1, NULL, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "borg/item.pyx":585 * slicelen = min(alen - ai, blen - bi) * if a[ai:ai + slicelen] != b[bi:bi + slicelen]: * return False # <<<<<<<<<<<<<< * ai += slicelen * bi += slicelen */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "borg/item.pyx":584 * bi = 0 * slicelen = min(alen - ai, blen - bi) * if a[ai:ai + slicelen] != b[bi:bi + slicelen]: # <<<<<<<<<<<<<< * return False * ai += slicelen */ } /* "borg/item.pyx":586 * if a[ai:ai + slicelen] != b[bi:bi + slicelen]: * return False * ai += slicelen # <<<<<<<<<<<<<< * bi += slicelen */ __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_ai, __pyx_v_slicelen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_ai, __pyx_t_1); __pyx_t_1 = 0; /* "borg/item.pyx":587 * return False * ai += slicelen * bi += slicelen # <<<<<<<<<<<<<< */ __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_bi, __pyx_v_slicelen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_bi, __pyx_t_1); __pyx_t_1 = 0; } /* "borg/item.pyx":558 * * * def chunks_contents_equal(chunks1, chunks2): # <<<<<<<<<<<<<< * """ * Compare chunk content and return True if they are identical. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("borg.item.chunks_contents_equal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_end); __Pyx_XDECREF(__pyx_v_alen); __Pyx_XDECREF(__pyx_v_ai); __Pyx_XDECREF(__pyx_v_blen); __Pyx_XDECREF(__pyx_v_bi); __Pyx_XDECREF(__pyx_v_a); __Pyx_XDECREF(__pyx_v_b); __Pyx_XDECREF(__pyx_v_slicelen); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } #if CYTHON_USE_FREELISTS static struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property *__pyx_freelist_4borg_4item___pyx_scope_struct___make_property[8]; static int __pyx_freecount_4borg_4item___pyx_scope_struct___make_property = 0; #endif static PyObject *__pyx_tp_new_4borg_4item___pyx_scope_struct___make_property(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_freecount_4borg_4item___pyx_scope_struct___make_property > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property)))) { o = (PyObject*)__pyx_freelist_4borg_4item___pyx_scope_struct___make_property[--__pyx_freecount_4borg_4item___pyx_scope_struct___make_property]; memset(o, 0, sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif return o; } static void __pyx_tp_dealloc_4borg_4item___pyx_scope_struct___make_property(PyObject *o) { struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property *p = (struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4borg_4item___pyx_scope_struct___make_property) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_attr_error_msg); Py_CLEAR(p->__pyx_v_decode); Py_CLEAR(p->__pyx_v_encode); Py_CLEAR(p->__pyx_v_key); Py_CLEAR(p->__pyx_v_type_error_msg); Py_CLEAR(p->__pyx_v_value_type); #if CYTHON_USE_FREELISTS if (((int)(__pyx_freecount_4borg_4item___pyx_scope_struct___make_property < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property)))) { __pyx_freelist_4borg_4item___pyx_scope_struct___make_property[__pyx_freecount_4borg_4item___pyx_scope_struct___make_property++] = ((struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static int __pyx_tp_traverse_4borg_4item___pyx_scope_struct___make_property(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property *p = (struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property *)o; if (p->__pyx_v_decode) { e = (*v)(p->__pyx_v_decode, a); if (e) return e; } if (p->__pyx_v_encode) { e = (*v)(p->__pyx_v_encode, a); if (e) return e; } if (p->__pyx_v_key) { e = (*v)(p->__pyx_v_key, a); if (e) return e; } if (p->__pyx_v_value_type) { e = (*v)(p->__pyx_v_value_type, a); if (e) return e; } return 0; } static int __pyx_tp_clear_4borg_4item___pyx_scope_struct___make_property(PyObject *o) { PyObject* tmp; struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property *p = (struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property *)o; tmp = ((PyObject*)p->__pyx_v_decode); p->__pyx_v_decode = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_encode); p->__pyx_v_encode = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_key); p->__pyx_v_key = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_value_type); p->__pyx_v_value_type = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_4borg_4item___pyx_scope_struct___make_property_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4borg_4item___pyx_scope_struct___make_property}, {Py_tp_traverse, (void *)__pyx_tp_traverse_4borg_4item___pyx_scope_struct___make_property}, {Py_tp_clear, (void *)__pyx_tp_clear_4borg_4item___pyx_scope_struct___make_property}, {Py_tp_new, (void *)__pyx_tp_new_4borg_4item___pyx_scope_struct___make_property}, {0, 0}, }; static PyType_Spec __pyx_type_4borg_4item___pyx_scope_struct___make_property_spec = { "borg.item.__pyx_scope_struct___make_property", sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, __pyx_type_4borg_4item___pyx_scope_struct___make_property_slots, }; #else static PyTypeObject __pyx_type_4borg_4item___pyx_scope_struct___make_property = { PyVarObject_HEAD_INIT(0, 0) "borg.item.""__pyx_scope_struct___make_property", /*tp_name*/ sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4borg_4item___pyx_scope_struct___make_property, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_4borg_4item___pyx_scope_struct___make_property, /*tp_traverse*/ __pyx_tp_clear_4borg_4item___pyx_scope_struct___make_property, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4borg_4item___pyx_scope_struct___make_property, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif #if CYTHON_USE_FREELISTS static struct __pyx_obj_4borg_4item___pyx_scope_struct_1_get_size *__pyx_freelist_4borg_4item___pyx_scope_struct_1_get_size[8]; static int __pyx_freecount_4borg_4item___pyx_scope_struct_1_get_size = 0; #endif static PyObject *__pyx_tp_new_4borg_4item___pyx_scope_struct_1_get_size(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_freecount_4borg_4item___pyx_scope_struct_1_get_size > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct_1_get_size)))) { o = (PyObject*)__pyx_freelist_4borg_4item___pyx_scope_struct_1_get_size[--__pyx_freecount_4borg_4item___pyx_scope_struct_1_get_size]; memset(o, 0, sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct_1_get_size)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif return o; } static void __pyx_tp_dealloc_4borg_4item___pyx_scope_struct_1_get_size(PyObject *o) { struct __pyx_obj_4borg_4item___pyx_scope_struct_1_get_size *p = (struct __pyx_obj_4borg_4item___pyx_scope_struct_1_get_size *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4borg_4item___pyx_scope_struct_1_get_size) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_attr); Py_CLEAR(p->__pyx_v_consider_ids); #if CYTHON_USE_FREELISTS if (((int)(__pyx_freecount_4borg_4item___pyx_scope_struct_1_get_size < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct_1_get_size)))) { __pyx_freelist_4borg_4item___pyx_scope_struct_1_get_size[__pyx_freecount_4borg_4item___pyx_scope_struct_1_get_size++] = ((struct __pyx_obj_4borg_4item___pyx_scope_struct_1_get_size *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static int __pyx_tp_traverse_4borg_4item___pyx_scope_struct_1_get_size(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4borg_4item___pyx_scope_struct_1_get_size *p = (struct __pyx_obj_4borg_4item___pyx_scope_struct_1_get_size *)o; if (p->__pyx_v_attr) { e = (*v)(p->__pyx_v_attr, a); if (e) return e; } if (p->__pyx_v_consider_ids) { e = (*v)(p->__pyx_v_consider_ids, a); if (e) return e; } return 0; } static int __pyx_tp_clear_4borg_4item___pyx_scope_struct_1_get_size(PyObject *o) { PyObject* tmp; struct __pyx_obj_4borg_4item___pyx_scope_struct_1_get_size *p = (struct __pyx_obj_4borg_4item___pyx_scope_struct_1_get_size *)o; tmp = ((PyObject*)p->__pyx_v_attr); p->__pyx_v_attr = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_consider_ids); p->__pyx_v_consider_ids = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_4borg_4item___pyx_scope_struct_1_get_size_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4borg_4item___pyx_scope_struct_1_get_size}, {Py_tp_traverse, (void *)__pyx_tp_traverse_4borg_4item___pyx_scope_struct_1_get_size}, {Py_tp_clear, (void *)__pyx_tp_clear_4borg_4item___pyx_scope_struct_1_get_size}, {Py_tp_new, (void *)__pyx_tp_new_4borg_4item___pyx_scope_struct_1_get_size}, {0, 0}, }; static PyType_Spec __pyx_type_4borg_4item___pyx_scope_struct_1_get_size_spec = { "borg.item.__pyx_scope_struct_1_get_size", sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct_1_get_size), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, __pyx_type_4borg_4item___pyx_scope_struct_1_get_size_slots, }; #else static PyTypeObject __pyx_type_4borg_4item___pyx_scope_struct_1_get_size = { PyVarObject_HEAD_INIT(0, 0) "borg.item.""__pyx_scope_struct_1_get_size", /*tp_name*/ sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct_1_get_size), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4borg_4item___pyx_scope_struct_1_get_size, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_4borg_4item___pyx_scope_struct_1_get_size, /*tp_traverse*/ __pyx_tp_clear_4borg_4item___pyx_scope_struct_1_get_size, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4borg_4item___pyx_scope_struct_1_get_size, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif #if CYTHON_USE_FREELISTS static struct __pyx_obj_4borg_4item___pyx_scope_struct_2_genexpr *__pyx_freelist_4borg_4item___pyx_scope_struct_2_genexpr[8]; static int __pyx_freecount_4borg_4item___pyx_scope_struct_2_genexpr = 0; #endif static PyObject *__pyx_tp_new_4borg_4item___pyx_scope_struct_2_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_freecount_4borg_4item___pyx_scope_struct_2_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct_2_genexpr)))) { o = (PyObject*)__pyx_freelist_4borg_4item___pyx_scope_struct_2_genexpr[--__pyx_freecount_4borg_4item___pyx_scope_struct_2_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct_2_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif return o; } static void __pyx_tp_dealloc_4borg_4item___pyx_scope_struct_2_genexpr(PyObject *o) { struct __pyx_obj_4borg_4item___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_4borg_4item___pyx_scope_struct_2_genexpr *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4borg_4item___pyx_scope_struct_2_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_chunk); Py_CLEAR(p->__pyx_t_0); #if CYTHON_USE_FREELISTS if (((int)(__pyx_freecount_4borg_4item___pyx_scope_struct_2_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct_2_genexpr)))) { __pyx_freelist_4borg_4item___pyx_scope_struct_2_genexpr[__pyx_freecount_4borg_4item___pyx_scope_struct_2_genexpr++] = ((struct __pyx_obj_4borg_4item___pyx_scope_struct_2_genexpr *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static int __pyx_tp_traverse_4borg_4item___pyx_scope_struct_2_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4borg_4item___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_4borg_4item___pyx_scope_struct_2_genexpr *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } if (p->__pyx_genexpr_arg_0) { e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; } if (p->__pyx_v_chunk) { e = (*v)(p->__pyx_v_chunk, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } return 0; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_4borg_4item___pyx_scope_struct_2_genexpr_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4borg_4item___pyx_scope_struct_2_genexpr}, {Py_tp_traverse, (void *)__pyx_tp_traverse_4borg_4item___pyx_scope_struct_2_genexpr}, {Py_tp_new, (void *)__pyx_tp_new_4borg_4item___pyx_scope_struct_2_genexpr}, {0, 0}, }; static PyType_Spec __pyx_type_4borg_4item___pyx_scope_struct_2_genexpr_spec = { "borg.item.__pyx_scope_struct_2_genexpr", sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct_2_genexpr), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, __pyx_type_4borg_4item___pyx_scope_struct_2_genexpr_slots, }; #else static PyTypeObject __pyx_type_4borg_4item___pyx_scope_struct_2_genexpr = { PyVarObject_HEAD_INIT(0, 0) "borg.item.""__pyx_scope_struct_2_genexpr", /*tp_name*/ sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct_2_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4borg_4item___pyx_scope_struct_2_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_4borg_4item___pyx_scope_struct_2_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4borg_4item___pyx_scope_struct_2_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif #if CYTHON_USE_FREELISTS static struct __pyx_obj_4borg_4item___pyx_scope_struct_3_genexpr *__pyx_freelist_4borg_4item___pyx_scope_struct_3_genexpr[8]; static int __pyx_freecount_4borg_4item___pyx_scope_struct_3_genexpr = 0; #endif static PyObject *__pyx_tp_new_4borg_4item___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_freecount_4borg_4item___pyx_scope_struct_3_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct_3_genexpr)))) { o = (PyObject*)__pyx_freelist_4borg_4item___pyx_scope_struct_3_genexpr[--__pyx_freecount_4borg_4item___pyx_scope_struct_3_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct_3_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif return o; } static void __pyx_tp_dealloc_4borg_4item___pyx_scope_struct_3_genexpr(PyObject *o) { struct __pyx_obj_4borg_4item___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_4borg_4item___pyx_scope_struct_3_genexpr *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4borg_4item___pyx_scope_struct_3_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_chunk); Py_CLEAR(p->__pyx_t_0); #if CYTHON_USE_FREELISTS if (((int)(__pyx_freecount_4borg_4item___pyx_scope_struct_3_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct_3_genexpr)))) { __pyx_freelist_4borg_4item___pyx_scope_struct_3_genexpr[__pyx_freecount_4borg_4item___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_4borg_4item___pyx_scope_struct_3_genexpr *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static int __pyx_tp_traverse_4borg_4item___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4borg_4item___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_4borg_4item___pyx_scope_struct_3_genexpr *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } if (p->__pyx_genexpr_arg_0) { e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; } if (p->__pyx_v_chunk) { e = (*v)(p->__pyx_v_chunk, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } return 0; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_4borg_4item___pyx_scope_struct_3_genexpr_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4borg_4item___pyx_scope_struct_3_genexpr}, {Py_tp_traverse, (void *)__pyx_tp_traverse_4borg_4item___pyx_scope_struct_3_genexpr}, {Py_tp_new, (void *)__pyx_tp_new_4borg_4item___pyx_scope_struct_3_genexpr}, {0, 0}, }; static PyType_Spec __pyx_type_4borg_4item___pyx_scope_struct_3_genexpr_spec = { "borg.item.__pyx_scope_struct_3_genexpr", sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct_3_genexpr), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, __pyx_type_4borg_4item___pyx_scope_struct_3_genexpr_slots, }; #else static PyTypeObject __pyx_type_4borg_4item___pyx_scope_struct_3_genexpr = { PyVarObject_HEAD_INIT(0, 0) "borg.item.""__pyx_scope_struct_3_genexpr", /*tp_name*/ sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct_3_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4borg_4item___pyx_scope_struct_3_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_4borg_4item___pyx_scope_struct_3_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4borg_4item___pyx_scope_struct_3_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif #if CYTHON_USE_FREELISTS static struct __pyx_obj_4borg_4item___pyx_scope_struct_4_genexpr *__pyx_freelist_4borg_4item___pyx_scope_struct_4_genexpr[8]; static int __pyx_freecount_4borg_4item___pyx_scope_struct_4_genexpr = 0; #endif static PyObject *__pyx_tp_new_4borg_4item___pyx_scope_struct_4_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_freecount_4borg_4item___pyx_scope_struct_4_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct_4_genexpr)))) { o = (PyObject*)__pyx_freelist_4borg_4item___pyx_scope_struct_4_genexpr[--__pyx_freecount_4borg_4item___pyx_scope_struct_4_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct_4_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif return o; } static void __pyx_tp_dealloc_4borg_4item___pyx_scope_struct_4_genexpr(PyObject *o) { struct __pyx_obj_4borg_4item___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_4borg_4item___pyx_scope_struct_4_genexpr *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4borg_4item___pyx_scope_struct_4_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_e); Py_CLEAR(p->__pyx_t_0); #if CYTHON_USE_FREELISTS if (((int)(__pyx_freecount_4borg_4item___pyx_scope_struct_4_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct_4_genexpr)))) { __pyx_freelist_4borg_4item___pyx_scope_struct_4_genexpr[__pyx_freecount_4borg_4item___pyx_scope_struct_4_genexpr++] = ((struct __pyx_obj_4borg_4item___pyx_scope_struct_4_genexpr *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static int __pyx_tp_traverse_4borg_4item___pyx_scope_struct_4_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4borg_4item___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_4borg_4item___pyx_scope_struct_4_genexpr *)o; if (p->__pyx_genexpr_arg_0) { e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; } if (p->__pyx_v_e) { e = (*v)(p->__pyx_v_e, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } return 0; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_4borg_4item___pyx_scope_struct_4_genexpr_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4borg_4item___pyx_scope_struct_4_genexpr}, {Py_tp_traverse, (void *)__pyx_tp_traverse_4borg_4item___pyx_scope_struct_4_genexpr}, {Py_tp_new, (void *)__pyx_tp_new_4borg_4item___pyx_scope_struct_4_genexpr}, {0, 0}, }; static PyType_Spec __pyx_type_4borg_4item___pyx_scope_struct_4_genexpr_spec = { "borg.item.__pyx_scope_struct_4_genexpr", sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct_4_genexpr), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, __pyx_type_4borg_4item___pyx_scope_struct_4_genexpr_slots, }; #else static PyTypeObject __pyx_type_4borg_4item___pyx_scope_struct_4_genexpr = { PyVarObject_HEAD_INIT(0, 0) "borg.item.""__pyx_scope_struct_4_genexpr", /*tp_name*/ sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct_4_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4borg_4item___pyx_scope_struct_4_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_4borg_4item___pyx_scope_struct_4_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4borg_4item___pyx_scope_struct_4_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif #if CYTHON_USE_FREELISTS static struct __pyx_obj_4borg_4item___pyx_scope_struct_5_genexpr *__pyx_freelist_4borg_4item___pyx_scope_struct_5_genexpr[8]; static int __pyx_freecount_4borg_4item___pyx_scope_struct_5_genexpr = 0; #endif static PyObject *__pyx_tp_new_4borg_4item___pyx_scope_struct_5_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_freecount_4borg_4item___pyx_scope_struct_5_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct_5_genexpr)))) { o = (PyObject*)__pyx_freelist_4borg_4item___pyx_scope_struct_5_genexpr[--__pyx_freecount_4borg_4item___pyx_scope_struct_5_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct_5_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif return o; } static void __pyx_tp_dealloc_4borg_4item___pyx_scope_struct_5_genexpr(PyObject *o) { struct __pyx_obj_4borg_4item___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_4borg_4item___pyx_scope_struct_5_genexpr *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4borg_4item___pyx_scope_struct_5_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_e); Py_CLEAR(p->__pyx_t_0); #if CYTHON_USE_FREELISTS if (((int)(__pyx_freecount_4borg_4item___pyx_scope_struct_5_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct_5_genexpr)))) { __pyx_freelist_4borg_4item___pyx_scope_struct_5_genexpr[__pyx_freecount_4borg_4item___pyx_scope_struct_5_genexpr++] = ((struct __pyx_obj_4borg_4item___pyx_scope_struct_5_genexpr *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static int __pyx_tp_traverse_4borg_4item___pyx_scope_struct_5_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4borg_4item___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_4borg_4item___pyx_scope_struct_5_genexpr *)o; if (p->__pyx_genexpr_arg_0) { e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; } if (p->__pyx_v_e) { e = (*v)(p->__pyx_v_e, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } return 0; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_4borg_4item___pyx_scope_struct_5_genexpr_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4borg_4item___pyx_scope_struct_5_genexpr}, {Py_tp_traverse, (void *)__pyx_tp_traverse_4borg_4item___pyx_scope_struct_5_genexpr}, {Py_tp_new, (void *)__pyx_tp_new_4borg_4item___pyx_scope_struct_5_genexpr}, {0, 0}, }; static PyType_Spec __pyx_type_4borg_4item___pyx_scope_struct_5_genexpr_spec = { "borg.item.__pyx_scope_struct_5_genexpr", sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct_5_genexpr), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, __pyx_type_4borg_4item___pyx_scope_struct_5_genexpr_slots, }; #else static PyTypeObject __pyx_type_4borg_4item___pyx_scope_struct_5_genexpr = { PyVarObject_HEAD_INIT(0, 0) "borg.item.""__pyx_scope_struct_5_genexpr", /*tp_name*/ sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct_5_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4borg_4item___pyx_scope_struct_5_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_4borg_4item___pyx_scope_struct_5_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4borg_4item___pyx_scope_struct_5_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif #if CYTHON_USE_FREELISTS static struct __pyx_obj_4borg_4item___pyx_scope_struct_6_genexpr *__pyx_freelist_4borg_4item___pyx_scope_struct_6_genexpr[8]; static int __pyx_freecount_4borg_4item___pyx_scope_struct_6_genexpr = 0; #endif static PyObject *__pyx_tp_new_4borg_4item___pyx_scope_struct_6_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_freecount_4borg_4item___pyx_scope_struct_6_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct_6_genexpr)))) { o = (PyObject*)__pyx_freelist_4borg_4item___pyx_scope_struct_6_genexpr[--__pyx_freecount_4borg_4item___pyx_scope_struct_6_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct_6_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif return o; } static void __pyx_tp_dealloc_4borg_4item___pyx_scope_struct_6_genexpr(PyObject *o) { struct __pyx_obj_4borg_4item___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_4borg_4item___pyx_scope_struct_6_genexpr *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4borg_4item___pyx_scope_struct_6_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_d); Py_CLEAR(p->__pyx_v_str); Py_CLEAR(p->__pyx_t_0); #if CYTHON_USE_FREELISTS if (((int)(__pyx_freecount_4borg_4item___pyx_scope_struct_6_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct_6_genexpr)))) { __pyx_freelist_4borg_4item___pyx_scope_struct_6_genexpr[__pyx_freecount_4borg_4item___pyx_scope_struct_6_genexpr++] = ((struct __pyx_obj_4borg_4item___pyx_scope_struct_6_genexpr *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static int __pyx_tp_traverse_4borg_4item___pyx_scope_struct_6_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4borg_4item___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_4borg_4item___pyx_scope_struct_6_genexpr *)o; if (p->__pyx_genexpr_arg_0) { e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; } if (p->__pyx_v_d) { e = (*v)(p->__pyx_v_d, a); if (e) return e; } if (p->__pyx_v_str) { e = (*v)(p->__pyx_v_str, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } return 0; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_4borg_4item___pyx_scope_struct_6_genexpr_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4borg_4item___pyx_scope_struct_6_genexpr}, {Py_tp_traverse, (void *)__pyx_tp_traverse_4borg_4item___pyx_scope_struct_6_genexpr}, {Py_tp_new, (void *)__pyx_tp_new_4borg_4item___pyx_scope_struct_6_genexpr}, {0, 0}, }; static PyType_Spec __pyx_type_4borg_4item___pyx_scope_struct_6_genexpr_spec = { "borg.item.__pyx_scope_struct_6_genexpr", sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct_6_genexpr), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, __pyx_type_4borg_4item___pyx_scope_struct_6_genexpr_slots, }; #else static PyTypeObject __pyx_type_4borg_4item___pyx_scope_struct_6_genexpr = { PyVarObject_HEAD_INIT(0, 0) "borg.item.""__pyx_scope_struct_6_genexpr", /*tp_name*/ sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct_6_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4borg_4item___pyx_scope_struct_6_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_4borg_4item___pyx_scope_struct_6_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4borg_4item___pyx_scope_struct_6_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_1_4_01, __pyx_k_1_4_01, sizeof(__pyx_k_1_4_01), 0, 0, 1, 0}, {&__pyx_kp_s_9_9, __pyx_k_9_9, sizeof(__pyx_k_9_9), 0, 0, 1, 0}, {&__pyx_n_s_API_VERSION, __pyx_k_API_VERSION, sizeof(__pyx_k_API_VERSION), 0, 0, 1, 1}, {&__pyx_n_s_ARCHIVE_KEYS, __pyx_k_ARCHIVE_KEYS, sizeof(__pyx_k_ARCHIVE_KEYS), 0, 0, 1, 1}, {&__pyx_n_s_ArchiveItem, __pyx_k_ArchiveItem, sizeof(__pyx_k_ArchiveItem), 0, 0, 1, 1}, {&__pyx_kp_s_ArchiveItem_abstraction_that_de, __pyx_k_ArchiveItem_abstraction_that_de, sizeof(__pyx_k_ArchiveItem_abstraction_that_de), 0, 0, 1, 0}, {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1}, {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1}, {&__pyx_kp_s_Can_t_store_size_when_considerin, __pyx_k_Can_t_store_size_when_considerin, sizeof(__pyx_k_Can_t_store_size_when_considerin), 0, 0, 1, 0}, {&__pyx_n_s_ChunkListEntry, __pyx_k_ChunkListEntry, sizeof(__pyx_k_ChunkListEntry), 0, 0, 1, 1}, {&__pyx_kp_s_Comparison_of_two_items_from_di, __pyx_k_Comparison_of_two_items_from_di, sizeof(__pyx_k_Comparison_of_two_items_from_di), 0, 0, 1, 0}, {&__pyx_n_s_EncryptedKey, __pyx_k_EncryptedKey, sizeof(__pyx_k_EncryptedKey), 0, 0, 1, 1}, {&__pyx_kp_s_EncryptedKey_abstraction_that_d, __pyx_k_EncryptedKey_abstraction_that_d, sizeof(__pyx_k_EncryptedKey_abstraction_that_d), 0, 0, 1, 0}, {&__pyx_n_s_ITEM_KEYS, __pyx_k_ITEM_KEYS, sizeof(__pyx_k_ITEM_KEYS), 0, 0, 1, 1}, {&__pyx_n_s_Item, __pyx_k_Item, sizeof(__pyx_k_Item), 0, 0, 1, 1}, {&__pyx_n_s_ItemDiff, __pyx_k_ItemDiff, sizeof(__pyx_k_ItemDiff), 0, 0, 1, 1}, {&__pyx_n_s_ItemDiff___init, __pyx_k_ItemDiff___init, sizeof(__pyx_k_ItemDiff___init), 0, 0, 1, 1}, {&__pyx_n_s_ItemDiff___repr, __pyx_k_ItemDiff___repr, sizeof(__pyx_k_ItemDiff___repr), 0, 0, 1, 1}, {&__pyx_n_s_ItemDiff___repr___locals_genexpr, __pyx_k_ItemDiff___repr___locals_genexpr, sizeof(__pyx_k_ItemDiff___repr___locals_genexpr), 0, 0, 1, 1}, {&__pyx_n_s_ItemDiff__content_diff, __pyx_k_ItemDiff__content_diff, sizeof(__pyx_k_ItemDiff__content_diff), 0, 0, 1, 1}, {&__pyx_n_s_ItemDiff__content_equal, __pyx_k_ItemDiff__content_equal, sizeof(__pyx_k_ItemDiff__content_equal), 0, 0, 1, 1}, {&__pyx_n_s_ItemDiff__equal, __pyx_k_ItemDiff__equal, sizeof(__pyx_k_ItemDiff__equal), 0, 0, 1, 1}, {&__pyx_n_s_ItemDiff__link_diff, __pyx_k_ItemDiff__link_diff, sizeof(__pyx_k_ItemDiff__link_diff), 0, 0, 1, 1}, {&__pyx_n_s_ItemDiff__mode_diff, __pyx_k_ItemDiff__mode_diff, sizeof(__pyx_k_ItemDiff__mode_diff), 0, 0, 1, 1}, {&__pyx_n_s_ItemDiff__owner_diff, __pyx_k_ItemDiff__owner_diff, sizeof(__pyx_k_ItemDiff__owner_diff), 0, 0, 1, 1}, {&__pyx_n_s_ItemDiff__presence_diff, __pyx_k_ItemDiff__presence_diff, sizeof(__pyx_k_ItemDiff__presence_diff), 0, 0, 1, 1}, {&__pyx_n_s_ItemDiff__time_diffs, __pyx_k_ItemDiff__time_diffs, sizeof(__pyx_k_ItemDiff__time_diffs), 0, 0, 1, 1}, {&__pyx_n_s_ItemDiff_changes, __pyx_k_ItemDiff_changes, sizeof(__pyx_k_ItemDiff_changes), 0, 0, 1, 1}, {&__pyx_n_s_Item__is_type, __pyx_k_Item__is_type, sizeof(__pyx_k_Item__is_type), 0, 0, 1, 1}, {&__pyx_kp_s_Item_abstraction_that_deals_wit, __pyx_k_Item_abstraction_that_deals_wit, sizeof(__pyx_k_Item_abstraction_that_deals_wit), 0, 0, 1, 0}, {&__pyx_n_s_Item_create_deleted, __pyx_k_Item_create_deleted, sizeof(__pyx_k_Item_create_deleted), 0, 0, 1, 1}, {&__pyx_kp_s_Item_does_not_have_a_csize_field, __pyx_k_Item_does_not_have_a_csize_field, sizeof(__pyx_k_Item_does_not_have_a_csize_field), 0, 0, 1, 0}, {&__pyx_n_s_Item_from_optr, __pyx_k_Item_from_optr, sizeof(__pyx_k_Item_from_optr), 0, 0, 1, 1}, {&__pyx_n_s_Item_get_size, __pyx_k_Item_get_size, sizeof(__pyx_k_Item_get_size), 0, 0, 1, 1}, {&__pyx_n_s_Item_get_size_locals_genexpr, __pyx_k_Item_get_size_locals_genexpr, sizeof(__pyx_k_Item_get_size_locals_genexpr), 0, 0, 1, 1}, {&__pyx_n_s_Item_is_blk, __pyx_k_Item_is_blk, sizeof(__pyx_k_Item_is_blk), 0, 0, 1, 1}, {&__pyx_n_s_Item_is_chr, __pyx_k_Item_is_chr, sizeof(__pyx_k_Item_is_chr), 0, 0, 1, 1}, {&__pyx_n_s_Item_is_dir, __pyx_k_Item_is_dir, sizeof(__pyx_k_Item_is_dir), 0, 0, 1, 1}, {&__pyx_n_s_Item_is_fifo, __pyx_k_Item_is_fifo, sizeof(__pyx_k_Item_is_fifo), 0, 0, 1, 1}, {&__pyx_n_s_Item_is_link, __pyx_k_Item_is_link, sizeof(__pyx_k_Item_is_link), 0, 0, 1, 1}, {&__pyx_n_s_Item_to_optr, __pyx_k_Item_to_optr, sizeof(__pyx_k_Item_to_optr), 0, 0, 1, 1}, {&__pyx_n_s_Key, __pyx_k_Key, sizeof(__pyx_k_Key), 0, 0, 1, 1}, {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, {&__pyx_kp_s_Key_abstraction_that_deals_with, __pyx_k_Key_abstraction_that_deals_with, sizeof(__pyx_k_Key_abstraction_that_deals_with), 0, 0, 1, 0}, {&__pyx_kp_s_Manage_a_dictionary_via_propert, __pyx_k_Manage_a_dictionary_via_propert, sizeof(__pyx_k_Manage_a_dictionary_via_propert), 0, 0, 1, 0}, {&__pyx_n_s_ManifestItem, __pyx_k_ManifestItem, sizeof(__pyx_k_ManifestItem), 0, 0, 1, 1}, {&__pyx_kp_s_ManifestItem_abstraction_that_d, __pyx_k_ManifestItem_abstraction_that_d, sizeof(__pyx_k_ManifestItem_abstraction_that_d), 0, 0, 1, 0}, {&__pyx_n_s_OutputTimestamp, __pyx_k_OutputTimestamp, sizeof(__pyx_k_OutputTimestamp), 0, 0, 1, 1}, {&__pyx_n_s_PropDict, __pyx_k_PropDict, sizeof(__pyx_k_PropDict), 0, 0, 1, 1}, {&__pyx_n_s_PropDict___contains, __pyx_k_PropDict___contains, sizeof(__pyx_k_PropDict___contains), 0, 0, 1, 1}, {&__pyx_n_s_PropDict___eq, __pyx_k_PropDict___eq, sizeof(__pyx_k_PropDict___eq), 0, 0, 1, 1}, {&__pyx_n_s_PropDict___init, __pyx_k_PropDict___init, sizeof(__pyx_k_PropDict___init), 0, 0, 1, 1}, {&__pyx_n_s_PropDict___repr, __pyx_k_PropDict___repr, sizeof(__pyx_k_PropDict___repr), 0, 0, 1, 1}, {&__pyx_n_s_PropDict__check_key, __pyx_k_PropDict__check_key, sizeof(__pyx_k_PropDict__check_key), 0, 0, 1, 1}, {&__pyx_n_s_PropDict__make_property, __pyx_k_PropDict__make_property, sizeof(__pyx_k_PropDict__make_property), 0, 0, 1, 1}, {&__pyx_n_s_PropDict__make_property_locals, __pyx_k_PropDict__make_property_locals, sizeof(__pyx_k_PropDict__make_property_locals), 0, 0, 1, 1}, {&__pyx_n_s_PropDict__make_property_locals_2, __pyx_k_PropDict__make_property_locals_2, sizeof(__pyx_k_PropDict__make_property_locals_2), 0, 0, 1, 1}, {&__pyx_n_s_PropDict__make_property_locals_3, __pyx_k_PropDict__make_property_locals_3, sizeof(__pyx_k_PropDict__make_property_locals_3), 0, 0, 1, 1}, {&__pyx_n_s_PropDict_as_dict, __pyx_k_PropDict_as_dict, sizeof(__pyx_k_PropDict_as_dict), 0, 0, 1, 1}, {&__pyx_n_s_PropDict_get, __pyx_k_PropDict_get, sizeof(__pyx_k_PropDict_get), 0, 0, 1, 1}, {&__pyx_n_s_PropDict_update, __pyx_k_PropDict_update, sizeof(__pyx_k_PropDict_update), 0, 0, 1, 1}, {&__pyx_n_s_PropDict_update_internal, __pyx_k_PropDict_update_internal, sizeof(__pyx_k_PropDict_update_internal), 0, 0, 1, 1}, {&__pyx_n_s_S_ISBLK, __pyx_k_S_ISBLK, sizeof(__pyx_k_S_ISBLK), 0, 0, 1, 1}, {&__pyx_n_s_S_ISCHR, __pyx_k_S_ISCHR, sizeof(__pyx_k_S_ISCHR), 0, 0, 1, 1}, {&__pyx_n_s_S_ISDIR, __pyx_k_S_ISDIR, sizeof(__pyx_k_S_ISDIR), 0, 0, 1, 1}, {&__pyx_n_s_S_ISFIFO, __pyx_k_S_ISFIFO, sizeof(__pyx_k_S_ISFIFO), 0, 0, 1, 1}, {&__pyx_n_s_S_ISLNK, __pyx_k_S_ISLNK, sizeof(__pyx_k_S_ISLNK), 0, 0, 1, 1}, {&__pyx_n_s_StableDict, __pyx_k_StableDict, sizeof(__pyx_k_StableDict), 0, 0, 1, 1}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s_VALID_KEYS, __pyx_k_VALID_KEYS, sizeof(__pyx_k_VALID_KEYS), 0, 0, 1, 1}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_kp_s__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 0, 1, 0}, {&__pyx_kp_s__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 0, 1, 0}, {&__pyx_kp_s__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 0, 1, 0}, {&__pyx_kp_s__15, __pyx_k__15, sizeof(__pyx_k__15), 0, 0, 1, 0}, {&__pyx_n_s__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 0, 1, 1}, {&__pyx_kp_u__17, __pyx_k__17, sizeof(__pyx_k__17), 0, 1, 0, 0}, {&__pyx_n_s__38, __pyx_k__38, sizeof(__pyx_k__38), 0, 0, 1, 1}, {&__pyx_n_s__81, __pyx_k__81, sizeof(__pyx_k__81), 0, 0, 1, 1}, {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, {&__pyx_n_s_acl_access, __pyx_k_acl_access, sizeof(__pyx_k_acl_access), 0, 0, 1, 1}, {&__pyx_n_s_acl_default, __pyx_k_acl_default, sizeof(__pyx_k_acl_default), 0, 0, 1, 1}, {&__pyx_n_s_acl_extended, __pyx_k_acl_extended, sizeof(__pyx_k_acl_extended), 0, 0, 1, 1}, {&__pyx_n_s_acl_nfs4, __pyx_k_acl_nfs4, sizeof(__pyx_k_acl_nfs4), 0, 0, 1, 1}, {&__pyx_kp_s_added, __pyx_k_added, sizeof(__pyx_k_added), 0, 0, 1, 0}, {&__pyx_kp_s_added_13, __pyx_k_added_13, sizeof(__pyx_k_added_13), 0, 0, 1, 0}, {&__pyx_n_s_added_2, __pyx_k_added_2, sizeof(__pyx_k_added_2), 0, 0, 1, 1}, {&__pyx_n_s_added_ids, __pyx_k_added_ids, sizeof(__pyx_k_added_ids), 0, 0, 1, 1}, {&__pyx_n_s_ai, __pyx_k_ai, sizeof(__pyx_k_ai), 0, 0, 1, 1}, {&__pyx_n_s_alen, __pyx_k_alen, sizeof(__pyx_k_alen), 0, 0, 1, 1}, {&__pyx_n_s_algorithm, __pyx_k_algorithm, sizeof(__pyx_k_algorithm), 0, 0, 1, 1}, {&__pyx_n_s_archives, __pyx_k_archives, sizeof(__pyx_k_archives), 0, 0, 1, 1}, {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, {&__pyx_n_s_as_dict, __pyx_k_as_dict, sizeof(__pyx_k_as_dict), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_atime, __pyx_k_atime, sizeof(__pyx_k_atime), 0, 0, 1, 1}, {&__pyx_n_s_attr, __pyx_k_attr, sizeof(__pyx_k_attr), 0, 0, 1, 1}, {&__pyx_n_s_attr_error_msg, __pyx_k_attr_error_msg, sizeof(__pyx_k_attr_error_msg), 0, 0, 1, 1}, {&__pyx_n_s_attr_list, __pyx_k_attr_list, sizeof(__pyx_k_attr_list), 0, 0, 1, 1}, {&__pyx_kp_s_attribute_s_not_found, __pyx_k_attribute_s_not_found, sizeof(__pyx_k_attribute_s_not_found), 0, 0, 1, 0}, {&__pyx_n_s_attrs, __pyx_k_attrs, sizeof(__pyx_k_attrs), 0, 0, 1, 1}, {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1}, {&__pyx_n_s_bi, __pyx_k_bi, sizeof(__pyx_k_bi), 0, 0, 1, 1}, {&__pyx_n_s_bigint, __pyx_k_bigint, sizeof(__pyx_k_bigint), 0, 0, 1, 1}, {&__pyx_n_s_bigint_to_int, __pyx_k_bigint_to_int, sizeof(__pyx_k_bigint_to_int), 0, 0, 1, 1}, {&__pyx_n_s_birthtime, __pyx_k_birthtime, sizeof(__pyx_k_birthtime), 0, 0, 1, 1}, {&__pyx_n_s_blen, __pyx_k_blen, sizeof(__pyx_k_blen), 0, 0, 1, 1}, {&__pyx_n_s_blkdev, __pyx_k_blkdev, sizeof(__pyx_k_blkdev), 0, 0, 1, 1}, {&__pyx_n_s_borg_item, __pyx_k_borg_item, sizeof(__pyx_k_borg_item), 0, 0, 1, 1}, {&__pyx_n_s_bsdflags, __pyx_k_bsdflags, sizeof(__pyx_k_bsdflags), 0, 0, 1, 1}, {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, {&__pyx_n_s_can_compare_chunk_ids, __pyx_k_can_compare_chunk_ids, sizeof(__pyx_k_can_compare_chunk_ids), 0, 0, 1, 1}, {&__pyx_n_s_can_compare_chunk_ids_2, __pyx_k_can_compare_chunk_ids_2, sizeof(__pyx_k_can_compare_chunk_ids_2), 0, 0, 1, 1}, {&__pyx_n_s_ch, __pyx_k_ch, sizeof(__pyx_k_ch), 0, 0, 1, 1}, {&__pyx_kp_s_changed_link, __pyx_k_changed_link, sizeof(__pyx_k_changed_link), 0, 0, 1, 0}, {&__pyx_n_s_changes, __pyx_k_changes, sizeof(__pyx_k_changes), 0, 0, 1, 1}, {&__pyx_n_s_changes_2, __pyx_k_changes_2, sizeof(__pyx_k_changes_2), 0, 0, 1, 1}, {&__pyx_n_s_check_key, __pyx_k_check_key, sizeof(__pyx_k_check_key), 0, 0, 1, 1}, {&__pyx_n_s_chg, __pyx_k_chg, sizeof(__pyx_k_chg), 0, 0, 1, 1}, {&__pyx_n_s_chrdev, __pyx_k_chrdev, sizeof(__pyx_k_chrdev), 0, 0, 1, 1}, {&__pyx_n_s_chunk_ids1, __pyx_k_chunk_ids1, sizeof(__pyx_k_chunk_ids1), 0, 0, 1, 1}, {&__pyx_n_s_chunk_ids2, __pyx_k_chunk_ids2, sizeof(__pyx_k_chunk_ids2), 0, 0, 1, 1}, {&__pyx_n_s_chunk_iterator1, __pyx_k_chunk_iterator1, sizeof(__pyx_k_chunk_iterator1), 0, 0, 1, 1}, {&__pyx_n_s_chunk_iterator2, __pyx_k_chunk_iterator2, sizeof(__pyx_k_chunk_iterator2), 0, 0, 1, 1}, {&__pyx_n_s_chunk_seed, __pyx_k_chunk_seed, sizeof(__pyx_k_chunk_seed), 0, 0, 1, 1}, {&__pyx_n_s_chunker_params, __pyx_k_chunker_params, sizeof(__pyx_k_chunker_params), 0, 0, 1, 1}, {&__pyx_kp_s_chunker_params_tuple, __pyx_k_chunker_params_tuple, sizeof(__pyx_k_chunker_params_tuple), 0, 0, 1, 0}, {&__pyx_n_s_chunks, __pyx_k_chunks, sizeof(__pyx_k_chunks), 0, 0, 1, 1}, {&__pyx_n_s_chunks1, __pyx_k_chunks1, sizeof(__pyx_k_chunks1), 0, 0, 1, 1}, {&__pyx_n_s_chunks2, __pyx_k_chunks2, sizeof(__pyx_k_chunks2), 0, 0, 1, 1}, {&__pyx_n_s_chunks_contents_equal, __pyx_k_chunks_contents_equal, sizeof(__pyx_k_chunks_contents_equal), 0, 0, 1, 1}, {&__pyx_n_s_chunks_healthy, __pyx_k_chunks_healthy, sizeof(__pyx_k_chunks_healthy), 0, 0, 1, 1}, {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, {&__pyx_n_s_cls, __pyx_k_cls, sizeof(__pyx_k_cls), 0, 0, 1, 1}, {&__pyx_n_s_cmdline, __pyx_k_cmdline, sizeof(__pyx_k_cmdline), 0, 0, 1, 1}, {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1}, {&__pyx_n_s_comment, __pyx_k_comment, sizeof(__pyx_k_comment), 0, 0, 1, 1}, {&__pyx_n_s_compressed, __pyx_k_compressed, sizeof(__pyx_k_compressed), 0, 0, 1, 1}, {&__pyx_n_s_config, __pyx_k_config, sizeof(__pyx_k_config), 0, 0, 1, 1}, {&__pyx_n_s_consider_ids, __pyx_k_consider_ids, sizeof(__pyx_k_consider_ids), 0, 0, 1, 1}, {&__pyx_n_s_constants, __pyx_k_constants, sizeof(__pyx_k_constants), 0, 0, 1, 1}, {&__pyx_n_s_contains, __pyx_k_contains, sizeof(__pyx_k_contains), 0, 0, 1, 1}, {&__pyx_n_s_content_diff, __pyx_k_content_diff, sizeof(__pyx_k_content_diff), 0, 0, 1, 1}, {&__pyx_n_s_content_equal, __pyx_k_content_equal, sizeof(__pyx_k_content_equal), 0, 0, 1, 1}, {&__pyx_n_s_content_only, __pyx_k_content_only, sizeof(__pyx_k_content_only), 0, 0, 1, 1}, {&__pyx_n_s_content_only_2, __pyx_k_content_only_2, sizeof(__pyx_k_content_only_2), 0, 0, 1, 1}, {&__pyx_n_s_create_deleted, __pyx_k_create_deleted, sizeof(__pyx_k_create_deleted), 0, 0, 1, 1}, {&__pyx_n_s_csize, __pyx_k_csize, sizeof(__pyx_k_csize), 0, 0, 1, 1}, {&__pyx_n_s_csize_parts, __pyx_k_csize_parts, sizeof(__pyx_k_csize_parts), 0, 0, 1, 1}, {&__pyx_n_s_ctime, __pyx_k_ctime, sizeof(__pyx_k_ctime), 0, 0, 1, 1}, {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1}, {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, {&__pyx_n_s_data_dict, __pyx_k_data_dict, sizeof(__pyx_k_data_dict), 0, 0, 1, 1}, {&__pyx_kp_s_data_dict_must_be_a_dict, __pyx_k_data_dict_must_be_a_dict, sizeof(__pyx_k_data_dict_must_be_a_dict), 0, 0, 1, 0}, {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1}, {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1}, {&__pyx_n_s_del, __pyx_k_del, sizeof(__pyx_k_del), 0, 0, 1, 1}, {&__pyx_n_s_deleted, __pyx_k_deleted, sizeof(__pyx_k_deleted), 0, 0, 1, 1}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1}, {&__pyx_n_s_directory, __pyx_k_directory, sizeof(__pyx_k_directory), 0, 0, 1, 1}, {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, {&__pyx_n_s_doc_2, __pyx_k_doc_2, sizeof(__pyx_k_doc_2), 0, 0, 1, 1}, {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, {&__pyx_n_s_enc_hmac_key, __pyx_k_enc_hmac_key, sizeof(__pyx_k_enc_hmac_key), 0, 0, 1, 1}, {&__pyx_n_s_enc_key, __pyx_k_enc_key, sizeof(__pyx_k_enc_key), 0, 0, 1, 1}, {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, {&__pyx_n_s_eq, __pyx_k_eq, sizeof(__pyx_k_eq), 0, 0, 1, 1}, {&__pyx_n_s_equal, __pyx_k_equal, sizeof(__pyx_k_equal), 0, 0, 1, 1}, {&__pyx_n_s_equal_2, __pyx_k_equal_2, sizeof(__pyx_k_equal_2), 0, 0, 1, 1}, {&__pyx_n_s_fifo, __pyx_k_fifo, sizeof(__pyx_k_fifo), 0, 0, 1, 1}, {&__pyx_n_s_filemode, __pyx_k_filemode, sizeof(__pyx_k_filemode), 0, 0, 1, 1}, {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, {&__pyx_n_s_format_file_size, __pyx_k_format_file_size, sizeof(__pyx_k_format_file_size), 0, 0, 1, 1}, {&__pyx_n_s_from_chunks, __pyx_k_from_chunks, sizeof(__pyx_k_from_chunks), 0, 0, 1, 1}, {&__pyx_n_s_from_optr, __pyx_k_from_optr, sizeof(__pyx_k_from_optr), 0, 0, 1, 1}, {&__pyx_n_s_g1, __pyx_k_g1, sizeof(__pyx_k_g1), 0, 0, 1, 1}, {&__pyx_n_s_g2, __pyx_k_g2, sizeof(__pyx_k_g2), 0, 0, 1, 1}, {&__pyx_n_s_g_attr, __pyx_k_g_attr, sizeof(__pyx_k_g_attr), 0, 0, 1, 1}, {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1}, {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, {&__pyx_n_s_get_2, __pyx_k_get_2, sizeof(__pyx_k_get_2), 0, 0, 1, 1}, {&__pyx_n_s_get_size, __pyx_k_get_size, sizeof(__pyx_k_get_size), 0, 0, 1, 1}, {&__pyx_n_s_gid, __pyx_k_gid, sizeof(__pyx_k_gid), 0, 0, 1, 1}, {&__pyx_n_s_group, __pyx_k_group, sizeof(__pyx_k_group), 0, 0, 1, 1}, {&__pyx_n_s_hardlink_master, __pyx_k_hardlink_master, sizeof(__pyx_k_hardlink_master), 0, 0, 1, 1}, {&__pyx_n_s_hardlink_masters, __pyx_k_hardlink_masters, sizeof(__pyx_k_hardlink_masters), 0, 0, 1, 1}, {&__pyx_n_s_hash, __pyx_k_hash, sizeof(__pyx_k_hash), 0, 0, 1, 1}, {&__pyx_n_s_having_chunks, __pyx_k_having_chunks, sizeof(__pyx_k_having_chunks), 0, 0, 1, 1}, {&__pyx_n_s_helpers, __pyx_k_helpers, sizeof(__pyx_k_helpers), 0, 0, 1, 1}, {&__pyx_n_s_helpers_time, __pyx_k_helpers_time, sizeof(__pyx_k_helpers_time), 0, 0, 1, 1}, {&__pyx_n_s_hostname, __pyx_k_hostname, sizeof(__pyx_k_hostname), 0, 0, 1, 1}, {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, {&__pyx_n_s_id_key, __pyx_k_id_key, sizeof(__pyx_k_id_key), 0, 0, 1, 1}, {&__pyx_kp_s_id_size_csize, __pyx_k_id_size_csize, sizeof(__pyx_k_id_size_csize), 0, 0, 1, 0}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_int_to_bigint, __pyx_k_int_to_bigint, sizeof(__pyx_k_int_to_bigint), 0, 0, 1, 1}, {&__pyx_n_s_internal_dict, __pyx_k_internal_dict, sizeof(__pyx_k_internal_dict), 0, 0, 1, 1}, {&__pyx_kp_s_internal_dict_must_be_a_dict, __pyx_k_internal_dict_must_be_a_dict, sizeof(__pyx_k_internal_dict_must_be_a_dict), 0, 0, 1, 0}, {&__pyx_n_s_is_blk, __pyx_k_is_blk, sizeof(__pyx_k_is_blk), 0, 0, 1, 1}, {&__pyx_n_s_is_chr, __pyx_k_is_chr, sizeof(__pyx_k_is_chr), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_n_s_is_dir, __pyx_k_is_dir, sizeof(__pyx_k_is_dir), 0, 0, 1, 1}, {&__pyx_n_s_is_fifo, __pyx_k_is_fifo, sizeof(__pyx_k_is_fifo), 0, 0, 1, 1}, {&__pyx_n_s_is_link, __pyx_k_is_link, sizeof(__pyx_k_is_link), 0, 0, 1, 1}, {&__pyx_n_s_is_type, __pyx_k_is_type, sizeof(__pyx_k_is_type), 0, 0, 1, 1}, {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, {&__pyx_n_s_item1, __pyx_k_item1, sizeof(__pyx_k_item1), 0, 0, 1, 1}, {&__pyx_n_s_item1_2, __pyx_k_item1_2, sizeof(__pyx_k_item1_2), 0, 0, 1, 1}, {&__pyx_n_s_item2, __pyx_k_item2, sizeof(__pyx_k_item2), 0, 0, 1, 1}, {&__pyx_n_s_item2_2, __pyx_k_item2_2, sizeof(__pyx_k_item2_2), 0, 0, 1, 1}, {&__pyx_n_s_item_keys, __pyx_k_item_keys, sizeof(__pyx_k_item_keys), 0, 0, 1, 1}, {&__pyx_n_s_item_type, __pyx_k_item_type, sizeof(__pyx_k_item_type), 0, 0, 1, 1}, {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1}, {&__pyx_n_s_iterations, __pyx_k_iterations, sizeof(__pyx_k_iterations), 0, 0, 1, 1}, {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1}, {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, {&__pyx_kp_s_key_must_be_str, __pyx_k_key_must_be_str, sizeof(__pyx_k_key_must_be_str), 0, 0, 1, 0}, {&__pyx_kp_s_key_s_is_not_a_valid_key, __pyx_k_key_s_is_not_a_valid_key, sizeof(__pyx_k_key_s_is_not_a_valid_key), 0, 0, 1, 0}, {&__pyx_n_s_kw, __pyx_k_kw, sizeof(__pyx_k_kw), 0, 0, 1, 1}, {&__pyx_n_s_link, __pyx_k_link, sizeof(__pyx_k_link), 0, 0, 1, 1}, {&__pyx_n_s_link_diff, __pyx_k_link_diff, sizeof(__pyx_k_link_diff), 0, 0, 1, 1}, {&__pyx_kp_s_list_or_None, __pyx_k_list_or_None, sizeof(__pyx_k_list_or_None), 0, 0, 1, 0}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_make_property, __pyx_k_make_property, sizeof(__pyx_k_make_property), 0, 0, 1, 1}, {&__pyx_n_s_master, __pyx_k_master, sizeof(__pyx_k_master), 0, 0, 1, 1}, {&__pyx_n_s_memorize, __pyx_k_memorize, sizeof(__pyx_k_memorize), 0, 0, 1, 1}, {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, {&__pyx_n_s_mode1, __pyx_k_mode1, sizeof(__pyx_k_mode1), 0, 0, 1, 1}, {&__pyx_n_s_mode2, __pyx_k_mode2, sizeof(__pyx_k_mode2), 0, 0, 1, 1}, {&__pyx_n_s_mode_diff, __pyx_k_mode_diff, sizeof(__pyx_k_mode_diff), 0, 0, 1, 1}, {&__pyx_n_s_modified, __pyx_k_modified, sizeof(__pyx_k_modified), 0, 0, 1, 1}, {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, {&__pyx_n_s_mro_entries, __pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 0, 1, 1}, {&__pyx_n_s_mtime, __pyx_k_mtime, sizeof(__pyx_k_mtime), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, {&__pyx_n_s_namedtuple, __pyx_k_namedtuple, sizeof(__pyx_k_namedtuple), 0, 0, 1, 1}, {&__pyx_n_u_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 1, 0, 1}, {&__pyx_n_s_new_group, __pyx_k_new_group, sizeof(__pyx_k_new_group), 0, 0, 1, 1}, {&__pyx_n_s_new_mode, __pyx_k_new_mode, sizeof(__pyx_k_new_mode), 0, 0, 1, 1}, {&__pyx_n_s_new_user, __pyx_k_new_user, sizeof(__pyx_k_new_user), 0, 0, 1, 1}, {&__pyx_n_s_nfiles, __pyx_k_nfiles, sizeof(__pyx_k_nfiles), 0, 0, 1, 1}, {&__pyx_n_s_nfiles_parts, __pyx_k_nfiles_parts, sizeof(__pyx_k_nfiles_parts), 0, 0, 1, 1}, {&__pyx_n_s_nlink, __pyx_k_nlink, sizeof(__pyx_k_nlink), 0, 0, 1, 1}, {&__pyx_n_s_numeric_ids, __pyx_k_numeric_ids, sizeof(__pyx_k_numeric_ids), 0, 0, 1, 1}, {&__pyx_n_s_numeric_ids_2, __pyx_k_numeric_ids_2, sizeof(__pyx_k_numeric_ids_2), 0, 0, 1, 1}, {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, {&__pyx_n_u_old, __pyx_k_old, sizeof(__pyx_k_old), 0, 1, 0, 1}, {&__pyx_n_s_old_group, __pyx_k_old_group, sizeof(__pyx_k_old_group), 0, 0, 1, 1}, {&__pyx_n_s_old_mode, __pyx_k_old_mode, sizeof(__pyx_k_old_mode), 0, 0, 1, 1}, {&__pyx_n_s_old_user, __pyx_k_old_user, sizeof(__pyx_k_old_user), 0, 0, 1, 1}, {&__pyx_n_s_optr, __pyx_k_optr, sizeof(__pyx_k_optr), 0, 0, 1, 1}, {&__pyx_n_s_other, __pyx_k_other, sizeof(__pyx_k_other), 0, 0, 1, 1}, {&__pyx_n_s_owner, __pyx_k_owner, sizeof(__pyx_k_owner), 0, 0, 1, 1}, {&__pyx_n_s_owner_diff, __pyx_k_owner_diff, sizeof(__pyx_k_owner_diff), 0, 0, 1, 1}, {&__pyx_n_s_part, __pyx_k_part, sizeof(__pyx_k_part), 0, 0, 1, 1}, {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, {&__pyx_n_s_pd, __pyx_k_pd, sizeof(__pyx_k_pd), 0, 0, 1, 1}, {&__pyx_n_s_precision, __pyx_k_precision, sizeof(__pyx_k_precision), 0, 0, 1, 1}, {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, {&__pyx_n_s_presence_diff, __pyx_k_presence_diff, sizeof(__pyx_k_presence_diff), 0, 0, 1, 1}, {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1}, {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, {&__pyx_n_s_rdev, __pyx_k_rdev, sizeof(__pyx_k_rdev), 0, 0, 1, 1}, {&__pyx_n_s_recreate_args, __pyx_k_recreate_args, sizeof(__pyx_k_recreate_args), 0, 0, 1, 1}, {&__pyx_n_s_recreate_cmdline, __pyx_k_recreate_cmdline, sizeof(__pyx_k_recreate_cmdline), 0, 0, 1, 1}, {&__pyx_n_s_recreate_partial_chunks, __pyx_k_recreate_partial_chunks, sizeof(__pyx_k_recreate_partial_chunks), 0, 0, 1, 1}, {&__pyx_n_s_recreate_source_id, __pyx_k_recreate_source_id, sizeof(__pyx_k_recreate_source_id), 0, 0, 1, 1}, {&__pyx_kp_s_removed, __pyx_k_removed, sizeof(__pyx_k_removed), 0, 0, 1, 0}, {&__pyx_kp_s_removed_11, __pyx_k_removed_11, sizeof(__pyx_k_removed_11), 0, 0, 1, 0}, {&__pyx_n_s_removed_2, __pyx_k_removed_2, sizeof(__pyx_k_removed_2), 0, 0, 1, 1}, {&__pyx_n_s_removed_ids, __pyx_k_removed_ids, sizeof(__pyx_k_removed_ids), 0, 0, 1, 1}, {&__pyx_n_s_repository_id, __pyx_k_repository_id, sizeof(__pyx_k_repository_id), 0, 0, 1, 1}, {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1}, {&__pyx_kp_s_s_internal_dict_r, __pyx_k_s_internal_dict_r, sizeof(__pyx_k_s_internal_dict_r), 0, 0, 1, 0}, {&__pyx_kp_s_s_s, __pyx_k_s_s, sizeof(__pyx_k_s_s), 0, 0, 1, 0}, {&__pyx_kp_s_s_value_must_be_s, __pyx_k_s_value_must_be_s, sizeof(__pyx_k_s_value_must_be_s), 0, 0, 1, 0}, {&__pyx_n_s_safe_decode, __pyx_k_safe_decode, sizeof(__pyx_k_safe_decode), 0, 0, 1, 1}, {&__pyx_n_s_safe_encode, __pyx_k_safe_encode, sizeof(__pyx_k_safe_encode), 0, 0, 1, 1}, {&__pyx_n_s_safe_timestamp, __pyx_k_safe_timestamp, sizeof(__pyx_k_safe_timestamp), 0, 0, 1, 1}, {&__pyx_n_s_salt, __pyx_k_salt, sizeof(__pyx_k_salt), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1}, {&__pyx_n_s_set, __pyx_k_set, sizeof(__pyx_k_set), 0, 0, 1, 1}, {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1}, {&__pyx_n_s_sign, __pyx_k_sign, sizeof(__pyx_k_sign), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_size_parts, __pyx_k_size_parts, sizeof(__pyx_k_size_parts), 0, 0, 1, 1}, {&__pyx_n_s_slicelen, __pyx_k_slicelen, sizeof(__pyx_k_slicelen), 0, 0, 1, 1}, {&__pyx_n_s_slots, __pyx_k_slots, sizeof(__pyx_k_slots), 0, 0, 1, 1}, {&__pyx_n_s_source, __pyx_k_source, sizeof(__pyx_k_source), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_kp_s_src_borg_item_pyx, __pyx_k_src_borg_item_pyx, sizeof(__pyx_k_src_borg_item_pyx), 0, 0, 1, 0}, {&__pyx_n_s_stat, __pyx_k_stat, sizeof(__pyx_k_stat), 0, 0, 1, 1}, {&__pyx_n_s_staticmethod, __pyx_k_staticmethod, sizeof(__pyx_k_staticmethod), 0, 0, 1, 1}, {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1}, {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, {&__pyx_kp_s_surrogate_escaped_str, __pyx_k_surrogate_escaped_str, sizeof(__pyx_k_surrogate_escaped_str), 0, 0, 1, 0}, {&__pyx_kp_s_surrogate_escaped_str_or_None, __pyx_k_surrogate_escaped_str_or_None, sizeof(__pyx_k_surrogate_escaped_str_or_None), 0, 0, 1, 0}, {&__pyx_n_s_sz, __pyx_k_sz, sizeof(__pyx_k_sz), 0, 0, 1, 1}, {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1}, {&__pyx_n_s_tam_required, __pyx_k_tam_required, sizeof(__pyx_k_tam_required), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1}, {&__pyx_n_s_time_diffs, __pyx_k_time_diffs, sizeof(__pyx_k_time_diffs), 0, 0, 1, 1}, {&__pyx_n_s_time_end, __pyx_k_time_end, sizeof(__pyx_k_time_end), 0, 0, 1, 1}, {&__pyx_n_s_timestamp, __pyx_k_timestamp, sizeof(__pyx_k_timestamp), 0, 0, 1, 1}, {&__pyx_n_s_to_optr, __pyx_k_to_optr, sizeof(__pyx_k_to_optr), 0, 0, 1, 1}, {&__pyx_n_s_ts1, __pyx_k_ts1, sizeof(__pyx_k_ts1), 0, 0, 1, 1}, {&__pyx_n_s_ts2, __pyx_k_ts2, sizeof(__pyx_k_ts2), 0, 0, 1, 1}, {&__pyx_n_s_tuple_decode, __pyx_k_tuple_decode, sizeof(__pyx_k_tuple_decode), 0, 0, 1, 1}, {&__pyx_n_s_tuple_decode_locals_genexpr, __pyx_k_tuple_decode_locals_genexpr, sizeof(__pyx_k_tuple_decode_locals_genexpr), 0, 0, 1, 1}, {&__pyx_n_s_tuple_encode, __pyx_k_tuple_encode, sizeof(__pyx_k_tuple_encode), 0, 0, 1, 1}, {&__pyx_n_s_tuple_encode_locals_genexpr, __pyx_k_tuple_encode_locals_genexpr, sizeof(__pyx_k_tuple_encode_locals_genexpr), 0, 0, 1, 1}, {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1}, {&__pyx_n_s_type_error_msg, __pyx_k_type_error_msg, sizeof(__pyx_k_type_error_msg), 0, 0, 1, 1}, {&__pyx_n_s_typetest, __pyx_k_typetest, sizeof(__pyx_k_typetest), 0, 0, 1, 1}, {&__pyx_n_s_u1, __pyx_k_u1, sizeof(__pyx_k_u1), 0, 0, 1, 1}, {&__pyx_n_s_u2, __pyx_k_u2, sizeof(__pyx_k_u2), 0, 0, 1, 1}, {&__pyx_n_s_u_attr, __pyx_k_u_attr, sizeof(__pyx_k_u_attr), 0, 0, 1, 1}, {&__pyx_n_s_uid, __pyx_k_uid, sizeof(__pyx_k_uid), 0, 0, 1, 1}, {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, {&__pyx_n_s_update_internal, __pyx_k_update_internal, sizeof(__pyx_k_update_internal), 0, 0, 1, 1}, {&__pyx_n_s_user, __pyx_k_user, sizeof(__pyx_k_user), 0, 0, 1, 1}, {&__pyx_n_s_username, __pyx_k_username, sizeof(__pyx_k_username), 0, 0, 1, 1}, {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1}, {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, {&__pyx_n_s_value_type, __pyx_k_value_type, sizeof(__pyx_k_value_type), 0, 0, 1, 1}, {&__pyx_n_s_value_type_name, __pyx_k_value_type_name, sizeof(__pyx_k_value_type_name), 0, 0, 1, 1}, {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1}, {&__pyx_n_s_xattrs, __pyx_k_xattrs, sizeof(__pyx_k_xattrs), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(0, 98, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 50, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 87, __pyx_L1_error) __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 101, __pyx_L1_error) __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) __PYX_ERR(0, 130, __pyx_L1_error) __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 111, __pyx_L1_error) __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 112, __pyx_L1_error) __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 242, __pyx_L1_error) __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 565, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "borg/item.pyx":50 * self.update_internal(internal_dict) * else: * raise TypeError("internal_dict must be a dict") # <<<<<<<<<<<<<< * if data_dict is None: * data = kw */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_internal_dict_must_be_a_dict); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "borg/item.pyx":56 * data = data_dict * else: * raise TypeError("data_dict must be a dict") # <<<<<<<<<<<<<< * if data: * self.update(data) */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_data_dict_must_be_a_dict); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "borg/item.pyx":85 * """make sure key is of type str and known""" * if not isinstance(key, str): * raise TypeError("key must be str") # <<<<<<<<<<<<<< * if key not in self.VALID_KEYS: * raise ValueError("key '%s' is not a valid key" % key) */ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_key_must_be_str); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "borg/item.pyx":108 * attr_error_msg = "attribute %s not found" % key * * def _get(self): # <<<<<<<<<<<<<< * try: * value = self._dict[key] */ __pyx_tuple__4 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_get, 108, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 108, __pyx_L1_error) /* "borg/item.pyx":117 * return value * * def _set(self, value): # <<<<<<<<<<<<<< * if not isinstance(value, value_type): * raise TypeError(type_error_msg) */ __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_set, 117, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 117, __pyx_L1_error) /* "borg/item.pyx":124 * self._dict[key] = value * * def _del(self): # <<<<<<<<<<<<<< * try: * del self._dict[key] */ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_del, 124, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 124, __pyx_L1_error) /* "borg/item.pyx":238 * # hardlink slave, try to fetch hardlink master's chunks list * # todo: put precomputed size into hardlink_masters' values and use it, if present * chunks, _ = hardlink_masters.get(master, (None, None)) # <<<<<<<<<<<<<< * if chunks is None: * return 0 */ __pyx_tuple__9 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); /* "borg/item.pyx":527 * * def _owner_diff(self): * u_attr, g_attr = ('uid', 'gid') if self._numeric_ids else ('user', 'group') # <<<<<<<<<<<<<< * u1, g1 = self._item1.get(u_attr), self._item1.get(g_attr) * u2, g2 = self._item2.get(u_attr), self._item2.get(g_attr) */ __pyx_tuple__11 = PyTuple_Pack(2, __pyx_n_s_uid, __pyx_n_s_gid); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); __pyx_tuple__12 = PyTuple_Pack(2, __pyx_n_s_user, __pyx_n_s_group); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); /* "borg/item.pyx":41 * VALID_KEYS = None # override with in child class * * __slots__ = ("_dict", ) # avoid setting attributes not supported by properties # <<<<<<<<<<<<<< * * def __init__(self, data_dict=None, internal_dict=None, **kw): */ __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_dict); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); /* "borg/item.pyx":43 * __slots__ = ("_dict", ) # avoid setting attributes not supported by properties * * def __init__(self, data_dict=None, internal_dict=None, **kw): # <<<<<<<<<<<<<< * self._dict = {} * if internal_dict is None: */ __pyx_tuple__19 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_data_dict, __pyx_n_s_internal_dict, __pyx_n_s_kw, __pyx_n_s_data); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_init, 43, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 43, __pyx_L1_error) /* "borg/item.pyx":60 * self.update(data) * * def update(self, d): # <<<<<<<<<<<<<< * for k, v in d.items(): * if isinstance(k, bytes): */ __pyx_tuple__21 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_d, __pyx_n_s_k, __pyx_n_s_v); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_update, 60, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 60, __pyx_L1_error) /* "borg/item.pyx":66 * setattr(self, self._check_key(k), v) * * def update_internal(self, d): # <<<<<<<<<<<<<< * for k, v in d.items(): * if isinstance(k, bytes): */ __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_update_internal, 66, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 66, __pyx_L1_error) /* "borg/item.pyx":72 * self._dict[k] = v * * def __eq__(self, other): # <<<<<<<<<<<<<< * return self.as_dict() == other.as_dict() * */ __pyx_tuple__24 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_eq, 72, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 72, __pyx_L1_error) /* "borg/item.pyx":75 * return self.as_dict() == other.as_dict() * * def __repr__(self): # <<<<<<<<<<<<<< * return '%s(internal_dict=%r)' % (self.__class__.__name__, self._dict) * */ __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_repr, 75, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 75, __pyx_L1_error) /* "borg/item.pyx":78 * return '%s(internal_dict=%r)' % (self.__class__.__name__, self._dict) * * def as_dict(self): # <<<<<<<<<<<<<< * """return the internal dictionary""" * return StableDict(self._dict) */ __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_as_dict, 78, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 78, __pyx_L1_error) /* "borg/item.pyx":82 * return StableDict(self._dict) * * def _check_key(self, key): # <<<<<<<<<<<<<< * """make sure key is of type str and known""" * if not isinstance(key, str): */ __pyx_tuple__28 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_key); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__28); __Pyx_GIVEREF(__pyx_tuple__28); __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_check_key, 82, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 82, __pyx_L1_error) /* "borg/item.pyx":90 * return key * * def __contains__(self, key): # <<<<<<<<<<<<<< * """do we have this key?""" * return self._check_key(key) in self._dict */ __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_contains, 90, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 90, __pyx_L1_error) /* "borg/item.pyx":94 * return self._check_key(key) in self._dict * * def get(self, key, default=None): # <<<<<<<<<<<<<< * """get value for key, return default if key does not exist""" * return getattr(self, self._check_key(key), default) */ __pyx_tuple__31 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_default); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_get_2, 94, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 94, __pyx_L1_error) __pyx_tuple__33 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__33); __Pyx_GIVEREF(__pyx_tuple__33); /* "borg/item.pyx":98 * return getattr(self, self._check_key(key), default) * * @staticmethod # <<<<<<<<<<<<<< * def _make_property(key, value_type, value_type_name=None, encode=None, decode=None): * """return a property that deals with self._dict[key]""" */ __pyx_tuple__34 = PyTuple_Pack(14, __pyx_n_s_key, __pyx_n_s_value_type, __pyx_n_s_value_type_name, __pyx_n_s_encode, __pyx_n_s_decode, __pyx_n_s_doc, __pyx_n_s_type_error_msg, __pyx_n_s_attr_error_msg, __pyx_n_s_get, __pyx_n_s_get, __pyx_n_s_set, __pyx_n_s_set, __pyx_n_s_del, __pyx_n_s_del); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__34); __Pyx_GIVEREF(__pyx_tuple__34); __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_make_property, 98, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 98, __pyx_L1_error) __pyx_tuple__36 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__36); __Pyx_GIVEREF(__pyx_tuple__36); /* "borg/item.pyx":133 * * * ChunkListEntry = namedtuple('ChunkListEntry', 'id size csize') # <<<<<<<<<<<<<< * * class Item(PropDict): */ __pyx_tuple__37 = PyTuple_Pack(2, __pyx_n_s_ChunkListEntry, __pyx_kp_s_id_size_csize); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__37); __Pyx_GIVEREF(__pyx_tuple__37); /* "borg/item.pyx":196 * part = PropDict._make_property('part', int) * * def get_size(self, hardlink_masters=None, memorize=False, compressed=False, from_chunks=False, consider_ids=None): # <<<<<<<<<<<<<< * """ * Determine the (uncompressed or compressed) size of this item. */ __pyx_tuple__39 = PyTuple_Pack(15, __pyx_n_s_self, __pyx_n_s_hardlink_masters, __pyx_n_s_memorize, __pyx_n_s_compressed, __pyx_n_s_from_chunks, __pyx_n_s_consider_ids, __pyx_n_s_attr, __pyx_n_s_size, __pyx_n_s_chunks, __pyx_n_s_having_chunks, __pyx_n_s_master, __pyx_n_s__38, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__39); __Pyx_GIVEREF(__pyx_tuple__39); __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_get_size, 196, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 196, __pyx_L1_error) __pyx_tuple__41 = PyTuple_Pack(5, Py_None, ((PyObject *)Py_False), ((PyObject *)Py_False), ((PyObject *)Py_False), Py_None); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__41); __Pyx_GIVEREF(__pyx_tuple__41); /* "borg/item.pyx":250 * return size * * def to_optr(self): # <<<<<<<<<<<<<< * """ * Return an "object pointer" (optr), an opaque bag of bytes. */ __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_to_optr, 250, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 250, __pyx_L1_error) /* "borg/item.pyx":265 * return _object_to_optr(self) * * @classmethod # <<<<<<<<<<<<<< * def from_optr(self, optr): * return _optr_to_object(optr) */ __pyx_tuple__43 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_optr); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__43); __Pyx_GIVEREF(__pyx_tuple__43); __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_from_optr, 265, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 265, __pyx_L1_error) /* "borg/item.pyx":269 * return _optr_to_object(optr) * * @classmethod # <<<<<<<<<<<<<< * def create_deleted(cls, path): * return cls(deleted=True, chunks=[], mode=0, path=path) */ __pyx_tuple__45 = PyTuple_Pack(2, __pyx_n_s_cls, __pyx_n_s_path); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__45); __Pyx_GIVEREF(__pyx_tuple__45); __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_create_deleted, 269, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 269, __pyx_L1_error) /* "borg/item.pyx":273 * return cls(deleted=True, chunks=[], mode=0, path=path) * * def is_link(self): # <<<<<<<<<<<<<< * return self._is_type(stat.S_ISLNK) * */ __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_is_link, 273, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 273, __pyx_L1_error) /* "borg/item.pyx":276 * return self._is_type(stat.S_ISLNK) * * def is_dir(self): # <<<<<<<<<<<<<< * return self._is_type(stat.S_ISDIR) * */ __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_is_dir, 276, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 276, __pyx_L1_error) /* "borg/item.pyx":279 * return self._is_type(stat.S_ISDIR) * * def is_fifo(self): # <<<<<<<<<<<<<< * return self._is_type(stat.S_ISFIFO) * */ __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_is_fifo, 279, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 279, __pyx_L1_error) /* "borg/item.pyx":282 * return self._is_type(stat.S_ISFIFO) * * def is_blk(self): # <<<<<<<<<<<<<< * return self._is_type(stat.S_ISBLK) * */ __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_is_blk, 282, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 282, __pyx_L1_error) /* "borg/item.pyx":285 * return self._is_type(stat.S_ISBLK) * * def is_chr(self): # <<<<<<<<<<<<<< * return self._is_type(stat.S_ISCHR) * */ __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_is_chr, 285, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 285, __pyx_L1_error) /* "borg/item.pyx":288 * return self._is_type(stat.S_ISCHR) * * def _is_type(self, typetest): # <<<<<<<<<<<<<< * try: * return typetest(self.mode) */ __pyx_tuple__52 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_typetest); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__52); __Pyx_GIVEREF(__pyx_tuple__52); __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_is_type, 288, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 288, __pyx_L1_error) /* "borg/item.pyx":344 * * * def tuple_encode(t): # <<<<<<<<<<<<<< * """encode a tuple that might contain str items""" * # we have str, but want to give bytes to msgpack.pack */ __pyx_tuple__54 = PyTuple_Pack(3, __pyx_n_s_t, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__54); __Pyx_GIVEREF(__pyx_tuple__54); __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_tuple_encode, 344, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 344, __pyx_L1_error) /* "borg/item.pyx":350 * * * def tuple_decode(t): # <<<<<<<<<<<<<< * """decode a tuple that might contain bytes items""" * # we get bytes objects from msgpack.unpack, but want str */ __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_tuple_decode, 350, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 350, __pyx_L1_error) /* "borg/item.pyx":425 * """ * * def __init__(self, item1, item2, chunk_iterator1, chunk_iterator2, numeric_ids=False, can_compare_chunk_ids=False, content_only=False): # <<<<<<<<<<<<<< * self._item1 = item1 * self._item2 = item2 */ __pyx_tuple__57 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_item1, __pyx_n_s_item2, __pyx_n_s_chunk_iterator1, __pyx_n_s_chunk_iterator2, __pyx_n_s_numeric_ids, __pyx_n_s_can_compare_chunk_ids, __pyx_n_s_content_only, __pyx_n_s_changes_2, __pyx_n_s_ch); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__57); __Pyx_GIVEREF(__pyx_tuple__57); __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(8, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_init, 425, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 425, __pyx_L1_error) __pyx_tuple__59 = PyTuple_Pack(3, ((PyObject *)Py_False), ((PyObject *)Py_False), ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__59); __Pyx_GIVEREF(__pyx_tuple__59); /* "borg/item.pyx":460 * self._changes = [ch for ch in changes if ch] * * def changes(self): # <<<<<<<<<<<<<< * return self._changes * */ __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_changes_2, 460, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 460, __pyx_L1_error) /* "borg/item.pyx":463 * return self._changes * * def __repr__(self): # <<<<<<<<<<<<<< * if self.equal: * return 'equal' */ __pyx_tuple__61 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__61); __Pyx_GIVEREF(__pyx_tuple__61); __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_repr, 463, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 463, __pyx_L1_error) /* "borg/item.pyx":468 * return ' '.join(str for d,str in self._changes) * * def _equal(self, chunk_iterator1, chunk_iterator2): # <<<<<<<<<<<<<< * # if both are deleted, there is nothing at path regardless of what was deleted * if self._item1.get('deleted') and self._item2.get('deleted'): */ __pyx_tuple__63 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_chunk_iterator1, __pyx_n_s_chunk_iterator2, __pyx_n_s_attr_list, __pyx_n_s_attr); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__63); __Pyx_GIVEREF(__pyx_tuple__63); __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_equal, 468, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 468, __pyx_L1_error) /* "borg/item.pyx":492 * return True * * def _presence_diff(self, item_type): # <<<<<<<<<<<<<< * if not self._item1.get('deleted') and self._item2.get('deleted'): * chg = 'removed ' + item_type */ __pyx_tuple__65 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_item_type, __pyx_n_s_chg); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 492, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__65); __Pyx_GIVEREF(__pyx_tuple__65); __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_presence_diff, 492, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 492, __pyx_L1_error) /* "borg/item.pyx":500 * return ({"type": chg}, chg) * * def _link_diff(self): # <<<<<<<<<<<<<< * pd = self._presence_diff('link') * if pd is not None: */ __pyx_tuple__67 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pd); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 500, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__67); __Pyx_GIVEREF(__pyx_tuple__67); __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_link_diff, 500, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 500, __pyx_L1_error) /* "borg/item.pyx":507 * return ({"type": 'changed link'}, 'changed link') * * def _content_diff(self): # <<<<<<<<<<<<<< * if self._item1.get('deleted'): * sz = self._item2.get_size() */ __pyx_tuple__69 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_sz, __pyx_n_s_chunk_ids1, __pyx_n_s_chunk_ids2, __pyx_n_s_added_ids, __pyx_n_s_removed_ids, __pyx_n_s_added_2, __pyx_n_s_removed_2, __pyx_n_s_c, __pyx_n_s_c); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 507, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__69); __Pyx_GIVEREF(__pyx_tuple__69); __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_content_diff, 507, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 507, __pyx_L1_error) /* "borg/item.pyx":526 * format_file_size(-removed, precision=1, sign=True))) * * def _owner_diff(self): # <<<<<<<<<<<<<< * u_attr, g_attr = ('uid', 'gid') if self._numeric_ids else ('user', 'group') * u1, g1 = self._item1.get(u_attr), self._item1.get(g_attr) */ __pyx_tuple__71 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_u_attr, __pyx_n_s_g_attr, __pyx_n_s_u1, __pyx_n_s_g1, __pyx_n_s_u2, __pyx_n_s_g2); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__71); __Pyx_GIVEREF(__pyx_tuple__71); __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_owner_diff, 526, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 526, __pyx_L1_error) /* "borg/item.pyx":534 * '[{}:{} -> {}:{}]'.format(u1, g1, u2, g2)) * * def _mode_diff(self): # <<<<<<<<<<<<<< * if 'mode' in self._item1 and 'mode' in self._item2 and self._item1.mode != self._item2.mode: * mode1 = stat.filemode(self._item1.mode) */ __pyx_tuple__73 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_mode1, __pyx_n_s_mode2); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__73); __Pyx_GIVEREF(__pyx_tuple__73); __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_mode_diff, 534, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 534, __pyx_L1_error) /* "borg/item.pyx":540 * return ({"type": "mode", "old_mode": mode1, "new_mode": mode2}, '[{} -> {}]'.format(mode1, mode2)) * * def _time_diffs(self): # <<<<<<<<<<<<<< * changes = [] * attrs = ["ctime", "mtime"] */ __pyx_tuple__75 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_changes_2, __pyx_n_s_attrs, __pyx_n_s_attr, __pyx_n_s_ts1, __pyx_n_s_ts2); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__75); __Pyx_GIVEREF(__pyx_tuple__75); __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_time_diffs, 540, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) __PYX_ERR(0, 540, __pyx_L1_error) /* "borg/item.pyx":550 * return changes * * def _content_equal(self, chunk_iterator1, chunk_iterator2): # <<<<<<<<<<<<<< * if self._can_compare_chunk_ids: * return self._item1.chunks == self._item2.chunks */ __pyx_tuple__77 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_chunk_iterator1, __pyx_n_s_chunk_iterator2); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__77); __Pyx_GIVEREF(__pyx_tuple__77); __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_content_equal, 550, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) __PYX_ERR(0, 550, __pyx_L1_error) /* "borg/item.pyx":558 * * * def chunks_contents_equal(chunks1, chunks2): # <<<<<<<<<<<<<< * """ * Compare chunk content and return True if they are identical. */ __pyx_tuple__79 = PyTuple_Pack(10, __pyx_n_s_chunks1, __pyx_n_s_chunks2, __pyx_n_s_end, __pyx_n_s_alen, __pyx_n_s_ai, __pyx_n_s_blen, __pyx_n_s_bi, __pyx_n_s_a, __pyx_n_s_b, __pyx_n_s_slicelen); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__79); __Pyx_GIVEREF(__pyx_tuple__79); __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_chunks_contents_equal, 558, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { /* AssertionsEnabled.init */ if (likely(__Pyx_init_assertions_enabled() == 0)); else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS __pyx_ptype_4borg_4item___pyx_scope_struct___make_property = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4borg_4item___pyx_scope_struct___make_property_spec, NULL); if (unlikely(!__pyx_ptype_4borg_4item___pyx_scope_struct___make_property)) __PYX_ERR(0, 98, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4borg_4item___pyx_scope_struct___make_property_spec, __pyx_ptype_4borg_4item___pyx_scope_struct___make_property) < 0) __PYX_ERR(0, 98, __pyx_L1_error) #else __pyx_ptype_4borg_4item___pyx_scope_struct___make_property = &__pyx_type_4borg_4item___pyx_scope_struct___make_property; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_4borg_4item___pyx_scope_struct___make_property) < 0) __PYX_ERR(0, 98, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_4borg_4item___pyx_scope_struct___make_property->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4borg_4item___pyx_scope_struct___make_property->tp_dictoffset && __pyx_ptype_4borg_4item___pyx_scope_struct___make_property->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_4borg_4item___pyx_scope_struct___make_property->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_4borg_4item___pyx_scope_struct_1_get_size = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4borg_4item___pyx_scope_struct_1_get_size_spec, NULL); if (unlikely(!__pyx_ptype_4borg_4item___pyx_scope_struct_1_get_size)) __PYX_ERR(0, 196, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4borg_4item___pyx_scope_struct_1_get_size_spec, __pyx_ptype_4borg_4item___pyx_scope_struct_1_get_size) < 0) __PYX_ERR(0, 196, __pyx_L1_error) #else __pyx_ptype_4borg_4item___pyx_scope_struct_1_get_size = &__pyx_type_4borg_4item___pyx_scope_struct_1_get_size; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_4borg_4item___pyx_scope_struct_1_get_size) < 0) __PYX_ERR(0, 196, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_4borg_4item___pyx_scope_struct_1_get_size->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4borg_4item___pyx_scope_struct_1_get_size->tp_dictoffset && __pyx_ptype_4borg_4item___pyx_scope_struct_1_get_size->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_4borg_4item___pyx_scope_struct_1_get_size->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_4borg_4item___pyx_scope_struct_2_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4borg_4item___pyx_scope_struct_2_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_4borg_4item___pyx_scope_struct_2_genexpr)) __PYX_ERR(0, 242, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4borg_4item___pyx_scope_struct_2_genexpr_spec, __pyx_ptype_4borg_4item___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 242, __pyx_L1_error) #else __pyx_ptype_4borg_4item___pyx_scope_struct_2_genexpr = &__pyx_type_4borg_4item___pyx_scope_struct_2_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_4borg_4item___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 242, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_4borg_4item___pyx_scope_struct_2_genexpr->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4borg_4item___pyx_scope_struct_2_genexpr->tp_dictoffset && __pyx_ptype_4borg_4item___pyx_scope_struct_2_genexpr->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_4borg_4item___pyx_scope_struct_2_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_4borg_4item___pyx_scope_struct_3_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4borg_4item___pyx_scope_struct_3_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_4borg_4item___pyx_scope_struct_3_genexpr)) __PYX_ERR(0, 244, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4borg_4item___pyx_scope_struct_3_genexpr_spec, __pyx_ptype_4borg_4item___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 244, __pyx_L1_error) #else __pyx_ptype_4borg_4item___pyx_scope_struct_3_genexpr = &__pyx_type_4borg_4item___pyx_scope_struct_3_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_4borg_4item___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 244, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_4borg_4item___pyx_scope_struct_3_genexpr->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4borg_4item___pyx_scope_struct_3_genexpr->tp_dictoffset && __pyx_ptype_4borg_4item___pyx_scope_struct_3_genexpr->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_4borg_4item___pyx_scope_struct_3_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_4borg_4item___pyx_scope_struct_4_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4borg_4item___pyx_scope_struct_4_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_4borg_4item___pyx_scope_struct_4_genexpr)) __PYX_ERR(0, 347, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4borg_4item___pyx_scope_struct_4_genexpr_spec, __pyx_ptype_4borg_4item___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 347, __pyx_L1_error) #else __pyx_ptype_4borg_4item___pyx_scope_struct_4_genexpr = &__pyx_type_4borg_4item___pyx_scope_struct_4_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_4borg_4item___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 347, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_4borg_4item___pyx_scope_struct_4_genexpr->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4borg_4item___pyx_scope_struct_4_genexpr->tp_dictoffset && __pyx_ptype_4borg_4item___pyx_scope_struct_4_genexpr->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_4borg_4item___pyx_scope_struct_4_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_4borg_4item___pyx_scope_struct_5_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4borg_4item___pyx_scope_struct_5_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_4borg_4item___pyx_scope_struct_5_genexpr)) __PYX_ERR(0, 353, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4borg_4item___pyx_scope_struct_5_genexpr_spec, __pyx_ptype_4borg_4item___pyx_scope_struct_5_genexpr) < 0) __PYX_ERR(0, 353, __pyx_L1_error) #else __pyx_ptype_4borg_4item___pyx_scope_struct_5_genexpr = &__pyx_type_4borg_4item___pyx_scope_struct_5_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_4borg_4item___pyx_scope_struct_5_genexpr) < 0) __PYX_ERR(0, 353, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_4borg_4item___pyx_scope_struct_5_genexpr->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4borg_4item___pyx_scope_struct_5_genexpr->tp_dictoffset && __pyx_ptype_4borg_4item___pyx_scope_struct_5_genexpr->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_4borg_4item___pyx_scope_struct_5_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_4borg_4item___pyx_scope_struct_6_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4borg_4item___pyx_scope_struct_6_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_4borg_4item___pyx_scope_struct_6_genexpr)) __PYX_ERR(0, 466, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4borg_4item___pyx_scope_struct_6_genexpr_spec, __pyx_ptype_4borg_4item___pyx_scope_struct_6_genexpr) < 0) __PYX_ERR(0, 466, __pyx_L1_error) #else __pyx_ptype_4borg_4item___pyx_scope_struct_6_genexpr = &__pyx_type_4borg_4item___pyx_scope_struct_6_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_4borg_4item___pyx_scope_struct_6_genexpr) < 0) __PYX_ERR(0, 466, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_4borg_4item___pyx_scope_struct_6_genexpr->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4borg_4item___pyx_scope_struct_6_genexpr->tp_dictoffset && __pyx_ptype_4borg_4item___pyx_scope_struct_6_genexpr->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_4borg_4item___pyx_scope_struct_6_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_item(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_item}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "item", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC inititem(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC inititem(void) #else __Pyx_PyMODINIT_FUNC PyInit_item(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_item(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_item(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'item' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("item", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "item" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_item(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_borg__item) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "borg.item")) { if (unlikely((PyDict_SetItemString(modules, "borg.item", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) (void)__Pyx_modinit_type_import_code(); (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "borg/item.pyx":1 * import stat # <<<<<<<<<<<<<< * from collections import namedtuple * */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_stat, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_stat, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/item.pyx":2 * import stat * from collections import namedtuple # <<<<<<<<<<<<<< * * from .constants import ITEM_KEYS, ARCHIVE_KEYS */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_namedtuple); __Pyx_GIVEREF(__pyx_n_s_namedtuple); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_namedtuple)) __PYX_ERR(0, 2, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_collections, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_namedtuple); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_namedtuple, __pyx_t_2) < 0) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/item.pyx":4 * from collections import namedtuple * * from .constants import ITEM_KEYS, ARCHIVE_KEYS # <<<<<<<<<<<<<< * from .helpers import safe_encode, safe_decode * from .helpers import bigint_to_int, int_to_bigint */ __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_ITEM_KEYS); __Pyx_GIVEREF(__pyx_n_s_ITEM_KEYS); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_ITEM_KEYS)) __PYX_ERR(0, 4, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_ARCHIVE_KEYS); __Pyx_GIVEREF(__pyx_n_s_ARCHIVE_KEYS); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_ARCHIVE_KEYS)) __PYX_ERR(0, 4, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_constants, __pyx_t_3, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ITEM_KEYS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ITEM_KEYS, __pyx_t_3) < 0) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ARCHIVE_KEYS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARCHIVE_KEYS, __pyx_t_3) < 0) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/item.pyx":5 * * from .constants import ITEM_KEYS, ARCHIVE_KEYS * from .helpers import safe_encode, safe_decode # <<<<<<<<<<<<<< * from .helpers import bigint_to_int, int_to_bigint * from .helpers import StableDict */ __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_safe_encode); __Pyx_GIVEREF(__pyx_n_s_safe_encode); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_safe_encode)) __PYX_ERR(0, 5, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_safe_decode); __Pyx_GIVEREF(__pyx_n_s_safe_decode); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_safe_decode)) __PYX_ERR(0, 5, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_helpers, __pyx_t_2, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_safe_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_safe_encode, __pyx_t_2) < 0) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_safe_decode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_safe_decode, __pyx_t_2) < 0) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/item.pyx":6 * from .constants import ITEM_KEYS, ARCHIVE_KEYS * from .helpers import safe_encode, safe_decode * from .helpers import bigint_to_int, int_to_bigint # <<<<<<<<<<<<<< * from .helpers import StableDict * from .helpers import format_file_size */ __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_bigint_to_int); __Pyx_GIVEREF(__pyx_n_s_bigint_to_int); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_bigint_to_int)) __PYX_ERR(0, 6, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_int_to_bigint); __Pyx_GIVEREF(__pyx_n_s_int_to_bigint); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_int_to_bigint)) __PYX_ERR(0, 6, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_helpers, __pyx_t_3, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_bigint_to_int); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_bigint_to_int, __pyx_t_3) < 0) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_int_to_bigint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_int_to_bigint, __pyx_t_3) < 0) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/item.pyx":7 * from .helpers import safe_encode, safe_decode * from .helpers import bigint_to_int, int_to_bigint * from .helpers import StableDict # <<<<<<<<<<<<<< * from .helpers import format_file_size * from .helpers.time import OutputTimestamp, safe_timestamp */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_StableDict); __Pyx_GIVEREF(__pyx_n_s_StableDict); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_StableDict)) __PYX_ERR(0, 7, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_helpers, __pyx_t_2, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_StableDict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_StableDict, __pyx_t_2) < 0) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/item.pyx":8 * from .helpers import bigint_to_int, int_to_bigint * from .helpers import StableDict * from .helpers import format_file_size # <<<<<<<<<<<<<< * from .helpers.time import OutputTimestamp, safe_timestamp * */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_format_file_size); __Pyx_GIVEREF(__pyx_n_s_format_file_size); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_format_file_size)) __PYX_ERR(0, 8, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_helpers, __pyx_t_3, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_format_file_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_format_file_size, __pyx_t_3) < 0) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/item.pyx":9 * from .helpers import StableDict * from .helpers import format_file_size * from .helpers.time import OutputTimestamp, safe_timestamp # <<<<<<<<<<<<<< * * cdef extern from "_item.c": */ __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_OutputTimestamp); __Pyx_GIVEREF(__pyx_n_s_OutputTimestamp); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_OutputTimestamp)) __PYX_ERR(0, 9, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_safe_timestamp); __Pyx_GIVEREF(__pyx_n_s_safe_timestamp); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_safe_timestamp)) __PYX_ERR(0, 9, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_helpers_time, __pyx_t_2, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_OutputTimestamp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_OutputTimestamp, __pyx_t_2) < 0) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_safe_timestamp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_safe_timestamp, __pyx_t_2) < 0) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/item.pyx":16 * * * API_VERSION = '1.4_01' # <<<<<<<<<<<<<< * * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_API_VERSION, __pyx_kp_s_1_4_01) < 0) __PYX_ERR(0, 16, __pyx_L1_error) /* "borg/item.pyx":19 * * * class PropDict: # <<<<<<<<<<<<<< * """ * Manage a dictionary via properties. */ __pyx_t_3 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_PropDict, __pyx_n_s_PropDict, (PyObject *) NULL, __pyx_n_s_borg_item, __pyx_kp_s_Manage_a_dictionary_via_propert); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "borg/item.pyx":39 * are ignored instead of causing an error. * """ * VALID_KEYS = None # override with in child class # <<<<<<<<<<<<<< * * __slots__ = ("_dict", ) # avoid setting attributes not supported by properties */ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_VALID_KEYS, Py_None) < 0) __PYX_ERR(0, 39, __pyx_L1_error) /* "borg/item.pyx":41 * VALID_KEYS = None # override with in child class * * __slots__ = ("_dict", ) # avoid setting attributes not supported by properties # <<<<<<<<<<<<<< * * def __init__(self, data_dict=None, internal_dict=None, **kw): */ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_slots, __pyx_tuple__18) < 0) __PYX_ERR(0, 41, __pyx_L1_error) /* "borg/item.pyx":43 * __slots__ = ("_dict", ) # avoid setting attributes not supported by properties * * def __init__(self, data_dict=None, internal_dict=None, **kw): # <<<<<<<<<<<<<< * self._dict = {} * if internal_dict is None: */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_8PropDict_1__init__, 0, __pyx_n_s_PropDict___init, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__9); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/item.pyx":60 * self.update(data) * * def update(self, d): # <<<<<<<<<<<<<< * for k, v in d.items(): * if isinstance(k, bytes): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_8PropDict_3update, 0, __pyx_n_s_PropDict_update, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_update, __pyx_t_2) < 0) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/item.pyx":66 * setattr(self, self._check_key(k), v) * * def update_internal(self, d): # <<<<<<<<<<<<<< * for k, v in d.items(): * if isinstance(k, bytes): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_8PropDict_5update_internal, 0, __pyx_n_s_PropDict_update_internal, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_update_internal, __pyx_t_2) < 0) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/item.pyx":72 * self._dict[k] = v * * def __eq__(self, other): # <<<<<<<<<<<<<< * return self.as_dict() == other.as_dict() * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_8PropDict_7__eq__, 0, __pyx_n_s_PropDict___eq, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_eq, __pyx_t_2) < 0) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/item.pyx":75 * return self.as_dict() == other.as_dict() * * def __repr__(self): # <<<<<<<<<<<<<< * return '%s(internal_dict=%r)' % (self.__class__.__name__, self._dict) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_8PropDict_9__repr__, 0, __pyx_n_s_PropDict___repr, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_repr, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/item.pyx":78 * return '%s(internal_dict=%r)' % (self.__class__.__name__, self._dict) * * def as_dict(self): # <<<<<<<<<<<<<< * """return the internal dictionary""" * return StableDict(self._dict) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_8PropDict_11as_dict, 0, __pyx_n_s_PropDict_as_dict, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_as_dict, __pyx_t_2) < 0) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/item.pyx":82 * return StableDict(self._dict) * * def _check_key(self, key): # <<<<<<<<<<<<<< * """make sure key is of type str and known""" * if not isinstance(key, str): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_8PropDict_13_check_key, 0, __pyx_n_s_PropDict__check_key, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_check_key, __pyx_t_2) < 0) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/item.pyx":90 * return key * * def __contains__(self, key): # <<<<<<<<<<<<<< * """do we have this key?""" * return self._check_key(key) in self._dict */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_8PropDict_15__contains__, 0, __pyx_n_s_PropDict___contains, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_contains, __pyx_t_2) < 0) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/item.pyx":94 * return self._check_key(key) in self._dict * * def get(self, key, default=None): # <<<<<<<<<<<<<< * """get value for key, return default if key does not exist""" * return getattr(self, self._check_key(key), default) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_8PropDict_17get, 0, __pyx_n_s_PropDict_get, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__33); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_get_2, __pyx_t_2) < 0) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/item.pyx":98 * return getattr(self, self._check_key(key), default) * * @staticmethod # <<<<<<<<<<<<<< * def _make_property(key, value_type, value_type_name=None, encode=None, decode=None): * """return a property that deals with self._dict[key]""" */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_8PropDict_19_make_property, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_PropDict__make_property, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__36); __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_make_property, __pyx_t_4) < 0) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "borg/item.pyx":19 * * * class PropDict: # <<<<<<<<<<<<<< * """ * Manage a dictionary via properties. */ __pyx_t_4 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_PropDict, __pyx_empty_tuple, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PropDict, __pyx_t_4) < 0) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/item.pyx":133 * * * ChunkListEntry = namedtuple('ChunkListEntry', 'id size csize') # <<<<<<<<<<<<<< * * class Item(PropDict): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_namedtuple); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_ChunkListEntry, __pyx_t_4) < 0) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "borg/item.pyx":135 * ChunkListEntry = namedtuple('ChunkListEntry', 'id size csize') * * class Item(PropDict): # <<<<<<<<<<<<<< * """ * Item abstraction that deals with validation and the low-level details internally: */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 135, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_4, __pyx_n_s_Item, __pyx_n_s_Item, (PyObject *) NULL, __pyx_n_s_borg_item, __pyx_kp_s_Item_abstraction_that_deals_wit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_4 != __pyx_t_3) { if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_3) < 0))) __PYX_ERR(0, 135, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/item.pyx":152 * """ * * VALID_KEYS = ITEM_KEYS | {'deleted', 'nlink', } # str-typed keys # <<<<<<<<<<<<<< * * __slots__ = ("_dict", ) # avoid setting attributes not supported by properties */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ITEM_KEYS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = PySet_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PySet_Add(__pyx_t_6, __pyx_n_s_deleted) < 0) __PYX_ERR(0, 152, __pyx_L1_error) if (PySet_Add(__pyx_t_6, __pyx_n_s_nlink) < 0) __PYX_ERR(0, 152, __pyx_L1_error) __pyx_t_7 = PyNumber_Or(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_VALID_KEYS, __pyx_t_7) < 0) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/item.pyx":154 * VALID_KEYS = ITEM_KEYS | {'deleted', 'nlink', } # str-typed keys * * __slots__ = ("_dict", ) # avoid setting attributes not supported by properties # <<<<<<<<<<<<<< * * # properties statically defined, so that IDEs can know their names: */ if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_slots, __pyx_tuple__18) < 0) __PYX_ERR(0, 154, __pyx_L1_error) /* "borg/item.pyx":158 * # properties statically defined, so that IDEs can know their names: * * path = PropDict._make_property('path', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) # <<<<<<<<<<<<<< * source = PropDict._make_property('source', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) * user = PropDict._make_property('user', (str, type(None)), 'surrogate-escaped str or None', encode=safe_encode, decode=safe_decode) */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_make_property); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_n_s_path); __Pyx_GIVEREF(__pyx_n_s_path); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_path)) __PYX_ERR(0, 158, __pyx_L1_error); __Pyx_INCREF((PyObject *)(&PyString_Type)); __Pyx_GIVEREF((PyObject *)(&PyString_Type)); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)(&PyString_Type)))) __PYX_ERR(0, 158, __pyx_L1_error); __Pyx_INCREF(__pyx_kp_s_surrogate_escaped_str); __Pyx_GIVEREF(__pyx_kp_s_surrogate_escaped_str); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_kp_s_surrogate_escaped_str)) __PYX_ERR(0, 158, __pyx_L1_error); __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_safe_encode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_encode, __pyx_t_8) < 0) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_safe_decode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_decode, __pyx_t_8) < 0) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_path, __pyx_t_8) < 0) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "borg/item.pyx":159 * * path = PropDict._make_property('path', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) * source = PropDict._make_property('source', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) # <<<<<<<<<<<<<< * user = PropDict._make_property('user', (str, type(None)), 'surrogate-escaped str or None', encode=safe_encode, decode=safe_decode) * group = PropDict._make_property('group', (str, type(None)), 'surrogate-escaped str or None', encode=safe_encode, decode=safe_decode) */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_make_property); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_n_s_source); __Pyx_GIVEREF(__pyx_n_s_source); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_n_s_source)) __PYX_ERR(0, 159, __pyx_L1_error); __Pyx_INCREF((PyObject *)(&PyString_Type)); __Pyx_GIVEREF((PyObject *)(&PyString_Type)); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, ((PyObject *)(&PyString_Type)))) __PYX_ERR(0, 159, __pyx_L1_error); __Pyx_INCREF(__pyx_kp_s_surrogate_escaped_str); __Pyx_GIVEREF(__pyx_kp_s_surrogate_escaped_str); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_kp_s_surrogate_escaped_str)) __PYX_ERR(0, 159, __pyx_L1_error); __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_safe_encode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_encode, __pyx_t_6) < 0) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_safe_decode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_decode, __pyx_t_6) < 0) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_source, __pyx_t_6) < 0) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "borg/item.pyx":160 * path = PropDict._make_property('path', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) * source = PropDict._make_property('source', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) * user = PropDict._make_property('user', (str, type(None)), 'surrogate-escaped str or None', encode=safe_encode, decode=safe_decode) # <<<<<<<<<<<<<< * group = PropDict._make_property('group', (str, type(None)), 'surrogate-escaped str or None', encode=safe_encode, decode=safe_decode) * */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_make_property); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF((PyObject *)(&PyString_Type)); __Pyx_GIVEREF((PyObject *)(&PyString_Type)); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)(&PyString_Type)))) __PYX_ERR(0, 160, __pyx_L1_error); __Pyx_INCREF(((PyObject *)Py_TYPE(Py_None))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(Py_None))); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)Py_TYPE(Py_None)))) __PYX_ERR(0, 160, __pyx_L1_error); __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_n_s_user); __Pyx_GIVEREF(__pyx_n_s_user); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_n_s_user)) __PYX_ERR(0, 160, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6)) __PYX_ERR(0, 160, __pyx_L1_error); __Pyx_INCREF(__pyx_kp_s_surrogate_escaped_str_or_None); __Pyx_GIVEREF(__pyx_kp_s_surrogate_escaped_str_or_None); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_kp_s_surrogate_escaped_str_or_None)) __PYX_ERR(0, 160, __pyx_L1_error); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_safe_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_encode, __pyx_t_3) < 0) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_safe_decode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_decode, __pyx_t_3) < 0) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_user, __pyx_t_3) < 0) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/item.pyx":161 * source = PropDict._make_property('source', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) * user = PropDict._make_property('user', (str, type(None)), 'surrogate-escaped str or None', encode=safe_encode, decode=safe_decode) * group = PropDict._make_property('group', (str, type(None)), 'surrogate-escaped str or None', encode=safe_encode, decode=safe_decode) # <<<<<<<<<<<<<< * * acl_access = PropDict._make_property('acl_access', bytes) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_make_property); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF((PyObject *)(&PyString_Type)); __Pyx_GIVEREF((PyObject *)(&PyString_Type)); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)(&PyString_Type)))) __PYX_ERR(0, 161, __pyx_L1_error); __Pyx_INCREF(((PyObject *)Py_TYPE(Py_None))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(Py_None))); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)Py_TYPE(Py_None)))) __PYX_ERR(0, 161, __pyx_L1_error); __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_n_s_group); __Pyx_GIVEREF(__pyx_n_s_group); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_n_s_group)) __PYX_ERR(0, 161, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3)) __PYX_ERR(0, 161, __pyx_L1_error); __Pyx_INCREF(__pyx_kp_s_surrogate_escaped_str_or_None); __Pyx_GIVEREF(__pyx_kp_s_surrogate_escaped_str_or_None); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_kp_s_surrogate_escaped_str_or_None)) __PYX_ERR(0, 161, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_safe_encode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_encode, __pyx_t_7) < 0) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_safe_decode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_decode, __pyx_t_7) < 0) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_group, __pyx_t_7) < 0) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/item.pyx":163 * group = PropDict._make_property('group', (str, type(None)), 'surrogate-escaped str or None', encode=safe_encode, decode=safe_decode) * * acl_access = PropDict._make_property('acl_access', bytes) # <<<<<<<<<<<<<< * acl_default = PropDict._make_property('acl_default', bytes) * acl_extended = PropDict._make_property('acl_extended', bytes) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_make_property); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_n_s_acl_access, ((PyObject *)(&PyBytes_Type))}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_acl_access, __pyx_t_7) < 0) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/item.pyx":164 * * acl_access = PropDict._make_property('acl_access', bytes) * acl_default = PropDict._make_property('acl_default', bytes) # <<<<<<<<<<<<<< * acl_extended = PropDict._make_property('acl_extended', bytes) * acl_nfs4 = PropDict._make_property('acl_nfs4', bytes) */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_make_property); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_n_s_acl_default, ((PyObject *)(&PyBytes_Type))}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_acl_default, __pyx_t_7) < 0) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/item.pyx":165 * acl_access = PropDict._make_property('acl_access', bytes) * acl_default = PropDict._make_property('acl_default', bytes) * acl_extended = PropDict._make_property('acl_extended', bytes) # <<<<<<<<<<<<<< * acl_nfs4 = PropDict._make_property('acl_nfs4', bytes) * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_make_property); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_n_s_acl_extended, ((PyObject *)(&PyBytes_Type))}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_acl_extended, __pyx_t_7) < 0) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/item.pyx":166 * acl_default = PropDict._make_property('acl_default', bytes) * acl_extended = PropDict._make_property('acl_extended', bytes) * acl_nfs4 = PropDict._make_property('acl_nfs4', bytes) # <<<<<<<<<<<<<< * * mode = PropDict._make_property('mode', int) */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_make_property); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_n_s_acl_nfs4, ((PyObject *)(&PyBytes_Type))}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_acl_nfs4, __pyx_t_7) < 0) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/item.pyx":168 * acl_nfs4 = PropDict._make_property('acl_nfs4', bytes) * * mode = PropDict._make_property('mode', int) # <<<<<<<<<<<<<< * uid = PropDict._make_property('uid', int) * gid = PropDict._make_property('gid', int) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_make_property); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_n_s_mode, ((PyObject *)(&PyInt_Type))}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_mode, __pyx_t_7) < 0) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/item.pyx":169 * * mode = PropDict._make_property('mode', int) * uid = PropDict._make_property('uid', int) # <<<<<<<<<<<<<< * gid = PropDict._make_property('gid', int) * rdev = PropDict._make_property('rdev', int) */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_make_property); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_n_s_uid, ((PyObject *)(&PyInt_Type))}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_uid, __pyx_t_7) < 0) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/item.pyx":170 * mode = PropDict._make_property('mode', int) * uid = PropDict._make_property('uid', int) * gid = PropDict._make_property('gid', int) # <<<<<<<<<<<<<< * rdev = PropDict._make_property('rdev', int) * bsdflags = PropDict._make_property('bsdflags', int) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_make_property); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_n_s_gid, ((PyObject *)(&PyInt_Type))}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_gid, __pyx_t_7) < 0) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/item.pyx":171 * uid = PropDict._make_property('uid', int) * gid = PropDict._make_property('gid', int) * rdev = PropDict._make_property('rdev', int) # <<<<<<<<<<<<<< * bsdflags = PropDict._make_property('bsdflags', int) * */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_make_property); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_n_s_rdev, ((PyObject *)(&PyInt_Type))}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_rdev, __pyx_t_7) < 0) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/item.pyx":172 * gid = PropDict._make_property('gid', int) * rdev = PropDict._make_property('rdev', int) * bsdflags = PropDict._make_property('bsdflags', int) # <<<<<<<<<<<<<< * * # note: we need to keep the bigint conversion for compatibility with borg 1.0 archives. */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_make_property); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_n_s_bsdflags, ((PyObject *)(&PyInt_Type))}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_bsdflags, __pyx_t_7) < 0) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/item.pyx":175 * * # note: we need to keep the bigint conversion for compatibility with borg 1.0 archives. * atime = PropDict._make_property('atime', int, 'bigint', encode=int_to_bigint, decode=bigint_to_int) # <<<<<<<<<<<<<< * ctime = PropDict._make_property('ctime', int, 'bigint', encode=int_to_bigint, decode=bigint_to_int) * mtime = PropDict._make_property('mtime', int, 'bigint', encode=int_to_bigint, decode=bigint_to_int) */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_make_property); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_n_s_atime); __Pyx_GIVEREF(__pyx_n_s_atime); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_atime)) __PYX_ERR(0, 175, __pyx_L1_error); __Pyx_INCREF((PyObject *)(&PyInt_Type)); __Pyx_GIVEREF((PyObject *)(&PyInt_Type)); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)(&PyInt_Type)))) __PYX_ERR(0, 175, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_bigint); __Pyx_GIVEREF(__pyx_n_s_bigint); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_n_s_bigint)) __PYX_ERR(0, 175, __pyx_L1_error); __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_int_to_bigint); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_encode, __pyx_t_6) < 0) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_bigint_to_int); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_decode, __pyx_t_6) < 0) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_atime, __pyx_t_6) < 0) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "borg/item.pyx":176 * # note: we need to keep the bigint conversion for compatibility with borg 1.0 archives. * atime = PropDict._make_property('atime', int, 'bigint', encode=int_to_bigint, decode=bigint_to_int) * ctime = PropDict._make_property('ctime', int, 'bigint', encode=int_to_bigint, decode=bigint_to_int) # <<<<<<<<<<<<<< * mtime = PropDict._make_property('mtime', int, 'bigint', encode=int_to_bigint, decode=bigint_to_int) * birthtime = PropDict._make_property('birthtime', int, 'bigint', encode=int_to_bigint, decode=bigint_to_int) */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_make_property); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_n_s_ctime); __Pyx_GIVEREF(__pyx_n_s_ctime); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_ctime)) __PYX_ERR(0, 176, __pyx_L1_error); __Pyx_INCREF((PyObject *)(&PyInt_Type)); __Pyx_GIVEREF((PyObject *)(&PyInt_Type)); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)(&PyInt_Type)))) __PYX_ERR(0, 176, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_bigint); __Pyx_GIVEREF(__pyx_n_s_bigint); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_n_s_bigint)) __PYX_ERR(0, 176, __pyx_L1_error); __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_int_to_bigint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_encode, __pyx_t_8) < 0) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_bigint_to_int); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_decode, __pyx_t_8) < 0) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_ctime, __pyx_t_8) < 0) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "borg/item.pyx":177 * atime = PropDict._make_property('atime', int, 'bigint', encode=int_to_bigint, decode=bigint_to_int) * ctime = PropDict._make_property('ctime', int, 'bigint', encode=int_to_bigint, decode=bigint_to_int) * mtime = PropDict._make_property('mtime', int, 'bigint', encode=int_to_bigint, decode=bigint_to_int) # <<<<<<<<<<<<<< * birthtime = PropDict._make_property('birthtime', int, 'bigint', encode=int_to_bigint, decode=bigint_to_int) * */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_make_property); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_n_s_mtime); __Pyx_GIVEREF(__pyx_n_s_mtime); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_n_s_mtime)) __PYX_ERR(0, 177, __pyx_L1_error); __Pyx_INCREF((PyObject *)(&PyInt_Type)); __Pyx_GIVEREF((PyObject *)(&PyInt_Type)); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, ((PyObject *)(&PyInt_Type)))) __PYX_ERR(0, 177, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_bigint); __Pyx_GIVEREF(__pyx_n_s_bigint); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_n_s_bigint)) __PYX_ERR(0, 177, __pyx_L1_error); __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_int_to_bigint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_encode, __pyx_t_3) < 0) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_bigint_to_int); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_decode, __pyx_t_3) < 0) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_mtime, __pyx_t_3) < 0) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/item.pyx":178 * ctime = PropDict._make_property('ctime', int, 'bigint', encode=int_to_bigint, decode=bigint_to_int) * mtime = PropDict._make_property('mtime', int, 'bigint', encode=int_to_bigint, decode=bigint_to_int) * birthtime = PropDict._make_property('birthtime', int, 'bigint', encode=int_to_bigint, decode=bigint_to_int) # <<<<<<<<<<<<<< * * # size is only present for items with a chunk list and then it is sum(chunk_sizes) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_make_property); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_birthtime); __Pyx_GIVEREF(__pyx_n_s_birthtime); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_birthtime)) __PYX_ERR(0, 178, __pyx_L1_error); __Pyx_INCREF((PyObject *)(&PyInt_Type)); __Pyx_GIVEREF((PyObject *)(&PyInt_Type)); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)(&PyInt_Type)))) __PYX_ERR(0, 178, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_bigint); __Pyx_GIVEREF(__pyx_n_s_bigint); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_bigint)) __PYX_ERR(0, 178, __pyx_L1_error); __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_int_to_bigint); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_encode, __pyx_t_7) < 0) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_bigint_to_int); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_decode, __pyx_t_7) < 0) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_birthtime, __pyx_t_7) < 0) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/item.pyx":182 * # size is only present for items with a chunk list and then it is sum(chunk_sizes) * # compatibility note: this is a new feature, in old archives size will be missing. * size = PropDict._make_property('size', int) # <<<<<<<<<<<<<< * * hardlink_master = PropDict._make_property('hardlink_master', bool) */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_make_property); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_n_s_size, ((PyObject *)(&PyInt_Type))}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_size, __pyx_t_7) < 0) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/item.pyx":184 * size = PropDict._make_property('size', int) * * hardlink_master = PropDict._make_property('hardlink_master', bool) # <<<<<<<<<<<<<< * * chunks = PropDict._make_property('chunks', (list, type(None)), 'list or None') */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_make_property); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_n_s_hardlink_master, ((PyObject*)&PyBool_Type)}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_hardlink_master, __pyx_t_7) < 0) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/item.pyx":186 * hardlink_master = PropDict._make_property('hardlink_master', bool) * * chunks = PropDict._make_property('chunks', (list, type(None)), 'list or None') # <<<<<<<<<<<<<< * chunks_healthy = PropDict._make_property('chunks_healthy', (list, type(None)), 'list or None') * */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_make_property); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF((PyObject *)(&PyList_Type)); __Pyx_GIVEREF((PyObject *)(&PyList_Type)); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)(&PyList_Type)))) __PYX_ERR(0, 186, __pyx_L1_error); __Pyx_INCREF(((PyObject *)Py_TYPE(Py_None))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(Py_None))); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, ((PyObject *)Py_TYPE(Py_None)))) __PYX_ERR(0, 186, __pyx_L1_error); __pyx_t_6 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_n_s_chunks, __pyx_t_8, __pyx_kp_s_list_or_None}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_9, 3+__pyx_t_9); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_chunks, __pyx_t_7) < 0) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/item.pyx":187 * * chunks = PropDict._make_property('chunks', (list, type(None)), 'list or None') * chunks_healthy = PropDict._make_property('chunks_healthy', (list, type(None)), 'list or None') # <<<<<<<<<<<<<< * * xattrs = PropDict._make_property('xattrs', StableDict) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_make_property); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF((PyObject *)(&PyList_Type)); __Pyx_GIVEREF((PyObject *)(&PyList_Type)); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)(&PyList_Type)))) __PYX_ERR(0, 187, __pyx_L1_error); __Pyx_INCREF(((PyObject *)Py_TYPE(Py_None))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(Py_None))); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)Py_TYPE(Py_None)))) __PYX_ERR(0, 187, __pyx_L1_error); __pyx_t_6 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_n_s_chunks_healthy, __pyx_t_3, __pyx_kp_s_list_or_None}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 3+__pyx_t_9); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_chunks_healthy, __pyx_t_7) < 0) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/item.pyx":189 * chunks_healthy = PropDict._make_property('chunks_healthy', (list, type(None)), 'list or None') * * xattrs = PropDict._make_property('xattrs', StableDict) # <<<<<<<<<<<<<< * * deleted = PropDict._make_property('deleted', bool) */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_make_property); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_StableDict); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_n_s_xattrs, __pyx_t_8}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_xattrs, __pyx_t_7) < 0) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/item.pyx":191 * xattrs = PropDict._make_property('xattrs', StableDict) * * deleted = PropDict._make_property('deleted', bool) # <<<<<<<<<<<<<< * nlink = PropDict._make_property('nlink', int) * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_make_property); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_n_s_deleted, ((PyObject*)&PyBool_Type)}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_deleted, __pyx_t_7) < 0) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/item.pyx":192 * * deleted = PropDict._make_property('deleted', bool) * nlink = PropDict._make_property('nlink', int) # <<<<<<<<<<<<<< * * part = PropDict._make_property('part', int) */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_make_property); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_n_s_nlink, ((PyObject *)(&PyInt_Type))}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_nlink, __pyx_t_7) < 0) __PYX_ERR(0, 192, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/item.pyx":194 * nlink = PropDict._make_property('nlink', int) * * part = PropDict._make_property('part', int) # <<<<<<<<<<<<<< * * def get_size(self, hardlink_masters=None, memorize=False, compressed=False, from_chunks=False, consider_ids=None): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_make_property); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_n_s_part, ((PyObject *)(&PyInt_Type))}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_part, __pyx_t_7) < 0) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/item.pyx":196 * part = PropDict._make_property('part', int) * * def get_size(self, hardlink_masters=None, memorize=False, compressed=False, from_chunks=False, consider_ids=None): # <<<<<<<<<<<<<< * """ * Determine the (uncompressed or compressed) size of this item. */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_4Item_1get_size, 0, __pyx_n_s_Item_get_size, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__41); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_get_size, __pyx_t_7) < 0) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/item.pyx":250 * return size * * def to_optr(self): # <<<<<<<<<<<<<< * """ * Return an "object pointer" (optr), an opaque bag of bytes. */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_4Item_3to_optr, 0, __pyx_n_s_Item_to_optr, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__42)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_to_optr, __pyx_t_7) < 0) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/item.pyx":265 * return _object_to_optr(self) * * @classmethod # <<<<<<<<<<<<<< * def from_optr(self, optr): * return _optr_to_object(optr) */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_4Item_5from_optr, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_Item_from_optr, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_Method_ClassMethod(__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_from_optr, __pyx_t_8) < 0) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "borg/item.pyx":269 * return _optr_to_object(optr) * * @classmethod # <<<<<<<<<<<<<< * def create_deleted(cls, path): * return cls(deleted=True, chunks=[], mode=0, path=path) */ __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_4Item_7create_deleted, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_Item_create_deleted, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_create_deleted, __pyx_t_7) < 0) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/item.pyx":273 * return cls(deleted=True, chunks=[], mode=0, path=path) * * def is_link(self): # <<<<<<<<<<<<<< * return self._is_type(stat.S_ISLNK) * */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_4Item_9is_link, 0, __pyx_n_s_Item_is_link, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_is_link, __pyx_t_7) < 0) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/item.pyx":276 * return self._is_type(stat.S_ISLNK) * * def is_dir(self): # <<<<<<<<<<<<<< * return self._is_type(stat.S_ISDIR) * */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_4Item_11is_dir, 0, __pyx_n_s_Item_is_dir, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_is_dir, __pyx_t_7) < 0) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/item.pyx":279 * return self._is_type(stat.S_ISDIR) * * def is_fifo(self): # <<<<<<<<<<<<<< * return self._is_type(stat.S_ISFIFO) * */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_4Item_13is_fifo, 0, __pyx_n_s_Item_is_fifo, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_is_fifo, __pyx_t_7) < 0) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/item.pyx":282 * return self._is_type(stat.S_ISFIFO) * * def is_blk(self): # <<<<<<<<<<<<<< * return self._is_type(stat.S_ISBLK) * */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_4Item_15is_blk, 0, __pyx_n_s_Item_is_blk, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_is_blk, __pyx_t_7) < 0) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/item.pyx":285 * return self._is_type(stat.S_ISBLK) * * def is_chr(self): # <<<<<<<<<<<<<< * return self._is_type(stat.S_ISCHR) * */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_4Item_17is_chr, 0, __pyx_n_s_Item_is_chr, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_is_chr, __pyx_t_7) < 0) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/item.pyx":288 * return self._is_type(stat.S_ISCHR) * * def _is_type(self, typetest): # <<<<<<<<<<<<<< * try: * return typetest(self.mode) */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_4Item_19_is_type, 0, __pyx_n_s_Item__is_type, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_is_type, __pyx_t_7) < 0) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/item.pyx":135 * ChunkListEntry = namedtuple('ChunkListEntry', 'id size csize') * * class Item(PropDict): # <<<<<<<<<<<<<< * """ * Item abstraction that deals with validation and the low-level details internally: */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Item, __pyx_t_4, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Item, __pyx_t_7) < 0) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "borg/item.pyx":295 * * * class EncryptedKey(PropDict): # <<<<<<<<<<<<<< * """ * EncryptedKey abstraction that deals with validation and the low-level details internally: */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4)) __PYX_ERR(0, 295, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_4, __pyx_n_s_EncryptedKey, __pyx_n_s_EncryptedKey, (PyObject *) NULL, __pyx_n_s_borg_item, __pyx_kp_s_EncryptedKey_abstraction_that_d); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_4 != __pyx_t_2) { if (unlikely((PyDict_SetItemString(__pyx_t_7, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(0, 295, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/item.pyx":307 * """ * * VALID_KEYS = {'version', 'algorithm', 'iterations', 'salt', 'hash', 'data'} # str-typed keys # <<<<<<<<<<<<<< * * __slots__ = ("_dict", ) # avoid setting attributes not supported by properties */ __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PySet_Add(__pyx_t_2, __pyx_n_s_version) < 0) __PYX_ERR(0, 307, __pyx_L1_error) if (PySet_Add(__pyx_t_2, __pyx_n_s_algorithm) < 0) __PYX_ERR(0, 307, __pyx_L1_error) if (PySet_Add(__pyx_t_2, __pyx_n_s_iterations) < 0) __PYX_ERR(0, 307, __pyx_L1_error) if (PySet_Add(__pyx_t_2, __pyx_n_s_salt) < 0) __PYX_ERR(0, 307, __pyx_L1_error) if (PySet_Add(__pyx_t_2, __pyx_n_s_hash) < 0) __PYX_ERR(0, 307, __pyx_L1_error) if (PySet_Add(__pyx_t_2, __pyx_n_s_data) < 0) __PYX_ERR(0, 307, __pyx_L1_error) if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_VALID_KEYS, __pyx_t_2) < 0) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/item.pyx":309 * VALID_KEYS = {'version', 'algorithm', 'iterations', 'salt', 'hash', 'data'} # str-typed keys * * __slots__ = ("_dict", ) # avoid setting attributes not supported by properties # <<<<<<<<<<<<<< * * version = PropDict._make_property('version', int) */ if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_slots, __pyx_tuple__18) < 0) __PYX_ERR(0, 309, __pyx_L1_error) /* "borg/item.pyx":311 * __slots__ = ("_dict", ) # avoid setting attributes not supported by properties * * version = PropDict._make_property('version', int) # <<<<<<<<<<<<<< * algorithm = PropDict._make_property('algorithm', str, encode=str.encode, decode=bytes.decode) * iterations = PropDict._make_property('iterations', int) */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_make_property); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_n_s_version, ((PyObject *)(&PyInt_Type))}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_version, __pyx_t_2) < 0) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/item.pyx":312 * * version = PropDict._make_property('version', int) * algorithm = PropDict._make_property('algorithm', str, encode=str.encode, decode=bytes.decode) # <<<<<<<<<<<<<< * iterations = PropDict._make_property('iterations', int) * salt = PropDict._make_property('salt', bytes) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_make_property); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_algorithm); __Pyx_GIVEREF(__pyx_n_s_algorithm); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_algorithm)) __PYX_ERR(0, 312, __pyx_L1_error); __Pyx_INCREF((PyObject *)(&PyString_Type)); __Pyx_GIVEREF((PyObject *)(&PyString_Type)); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)(&PyString_Type)))) __PYX_ERR(0, 312, __pyx_L1_error); __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyString_Type)), __pyx_n_s_encode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_encode, __pyx_t_6) < 0) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyBytes_Type)), __pyx_n_s_decode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_decode, __pyx_t_6) < 0) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_algorithm, __pyx_t_6) < 0) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "borg/item.pyx":313 * version = PropDict._make_property('version', int) * algorithm = PropDict._make_property('algorithm', str, encode=str.encode, decode=bytes.decode) * iterations = PropDict._make_property('iterations', int) # <<<<<<<<<<<<<< * salt = PropDict._make_property('salt', bytes) * hash = PropDict._make_property('hash', bytes) */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_make_property); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_n_s_iterations, ((PyObject *)(&PyInt_Type))}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_iterations, __pyx_t_6) < 0) __PYX_ERR(0, 313, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "borg/item.pyx":314 * algorithm = PropDict._make_property('algorithm', str, encode=str.encode, decode=bytes.decode) * iterations = PropDict._make_property('iterations', int) * salt = PropDict._make_property('salt', bytes) # <<<<<<<<<<<<<< * hash = PropDict._make_property('hash', bytes) * data = PropDict._make_property('data', bytes) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_make_property); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_n_s_salt, ((PyObject *)(&PyBytes_Type))}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_salt, __pyx_t_6) < 0) __PYX_ERR(0, 314, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "borg/item.pyx":315 * iterations = PropDict._make_property('iterations', int) * salt = PropDict._make_property('salt', bytes) * hash = PropDict._make_property('hash', bytes) # <<<<<<<<<<<<<< * data = PropDict._make_property('data', bytes) * */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_make_property); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_n_s_hash, ((PyObject *)(&PyBytes_Type))}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_hash, __pyx_t_6) < 0) __PYX_ERR(0, 315, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "borg/item.pyx":316 * salt = PropDict._make_property('salt', bytes) * hash = PropDict._make_property('hash', bytes) * data = PropDict._make_property('data', bytes) # <<<<<<<<<<<<<< * * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_make_property); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_n_s_data, ((PyObject *)(&PyBytes_Type))}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_data, __pyx_t_6) < 0) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "borg/item.pyx":295 * * * class EncryptedKey(PropDict): # <<<<<<<<<<<<<< * """ * EncryptedKey abstraction that deals with validation and the low-level details internally: */ __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_n_s_EncryptedKey, __pyx_t_4, __pyx_t_7, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_d, __pyx_n_s_EncryptedKey, __pyx_t_6) < 0) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "borg/item.pyx":319 * * * class Key(PropDict): # <<<<<<<<<<<<<< * """ * Key abstraction that deals with validation and the low-level details internally: */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(0, 319, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_7, __pyx_t_4, __pyx_n_s_Key, __pyx_n_s_Key, (PyObject *) NULL, __pyx_n_s_borg_item, __pyx_kp_s_Key_abstraction_that_deals_with); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4 != __pyx_t_5) { if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 319, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/item.pyx":331 * """ * * VALID_KEYS = {'version', 'repository_id', 'enc_key', 'enc_hmac_key', 'id_key', 'chunk_seed', 'tam_required'} # str-typed keys # <<<<<<<<<<<<<< * * __slots__ = ("_dict", ) # avoid setting attributes not supported by properties */ __pyx_t_5 = PySet_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PySet_Add(__pyx_t_5, __pyx_n_s_version) < 0) __PYX_ERR(0, 331, __pyx_L1_error) if (PySet_Add(__pyx_t_5, __pyx_n_s_repository_id) < 0) __PYX_ERR(0, 331, __pyx_L1_error) if (PySet_Add(__pyx_t_5, __pyx_n_s_enc_key) < 0) __PYX_ERR(0, 331, __pyx_L1_error) if (PySet_Add(__pyx_t_5, __pyx_n_s_enc_hmac_key) < 0) __PYX_ERR(0, 331, __pyx_L1_error) if (PySet_Add(__pyx_t_5, __pyx_n_s_id_key) < 0) __PYX_ERR(0, 331, __pyx_L1_error) if (PySet_Add(__pyx_t_5, __pyx_n_s_chunk_seed) < 0) __PYX_ERR(0, 331, __pyx_L1_error) if (PySet_Add(__pyx_t_5, __pyx_n_s_tam_required) < 0) __PYX_ERR(0, 331, __pyx_L1_error) if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_VALID_KEYS, __pyx_t_5) < 0) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/item.pyx":333 * VALID_KEYS = {'version', 'repository_id', 'enc_key', 'enc_hmac_key', 'id_key', 'chunk_seed', 'tam_required'} # str-typed keys * * __slots__ = ("_dict", ) # avoid setting attributes not supported by properties # <<<<<<<<<<<<<< * * version = PropDict._make_property('version', int) */ if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_slots, __pyx_tuple__18) < 0) __PYX_ERR(0, 333, __pyx_L1_error) /* "borg/item.pyx":335 * __slots__ = ("_dict", ) # avoid setting attributes not supported by properties * * version = PropDict._make_property('version', int) # <<<<<<<<<<<<<< * repository_id = PropDict._make_property('repository_id', bytes) * enc_key = PropDict._make_property('enc_key', bytes) */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_make_property); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_n_s_version, ((PyObject *)(&PyInt_Type))}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_version, __pyx_t_5) < 0) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/item.pyx":336 * * version = PropDict._make_property('version', int) * repository_id = PropDict._make_property('repository_id', bytes) # <<<<<<<<<<<<<< * enc_key = PropDict._make_property('enc_key', bytes) * enc_hmac_key = PropDict._make_property('enc_hmac_key', bytes) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_make_property); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_n_s_repository_id, ((PyObject *)(&PyBytes_Type))}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_repository_id, __pyx_t_5) < 0) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/item.pyx":337 * version = PropDict._make_property('version', int) * repository_id = PropDict._make_property('repository_id', bytes) * enc_key = PropDict._make_property('enc_key', bytes) # <<<<<<<<<<<<<< * enc_hmac_key = PropDict._make_property('enc_hmac_key', bytes) * id_key = PropDict._make_property('id_key', bytes) */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_make_property); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_n_s_enc_key, ((PyObject *)(&PyBytes_Type))}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_enc_key, __pyx_t_5) < 0) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/item.pyx":338 * repository_id = PropDict._make_property('repository_id', bytes) * enc_key = PropDict._make_property('enc_key', bytes) * enc_hmac_key = PropDict._make_property('enc_hmac_key', bytes) # <<<<<<<<<<<<<< * id_key = PropDict._make_property('id_key', bytes) * chunk_seed = PropDict._make_property('chunk_seed', int) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_make_property); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_n_s_enc_hmac_key, ((PyObject *)(&PyBytes_Type))}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_enc_hmac_key, __pyx_t_5) < 0) __PYX_ERR(0, 338, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/item.pyx":339 * enc_key = PropDict._make_property('enc_key', bytes) * enc_hmac_key = PropDict._make_property('enc_hmac_key', bytes) * id_key = PropDict._make_property('id_key', bytes) # <<<<<<<<<<<<<< * chunk_seed = PropDict._make_property('chunk_seed', int) * tam_required = PropDict._make_property('tam_required', bool) */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_make_property); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_n_s_id_key, ((PyObject *)(&PyBytes_Type))}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_id_key, __pyx_t_5) < 0) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/item.pyx":340 * enc_hmac_key = PropDict._make_property('enc_hmac_key', bytes) * id_key = PropDict._make_property('id_key', bytes) * chunk_seed = PropDict._make_property('chunk_seed', int) # <<<<<<<<<<<<<< * tam_required = PropDict._make_property('tam_required', bool) * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_make_property); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_n_s_chunk_seed, ((PyObject *)(&PyInt_Type))}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_chunk_seed, __pyx_t_5) < 0) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/item.pyx":341 * id_key = PropDict._make_property('id_key', bytes) * chunk_seed = PropDict._make_property('chunk_seed', int) * tam_required = PropDict._make_property('tam_required', bool) # <<<<<<<<<<<<<< * * */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_make_property); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_n_s_tam_required, ((PyObject*)&PyBool_Type)}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_tam_required, __pyx_t_5) < 0) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/item.pyx":319 * * * class Key(PropDict): # <<<<<<<<<<<<<< * """ * Key abstraction that deals with validation and the low-level details internally: */ __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_n_s_Key, __pyx_t_4, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Key, __pyx_t_5) < 0) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "borg/item.pyx":344 * * * def tuple_encode(t): # <<<<<<<<<<<<<< * """encode a tuple that might contain str items""" * # we have str, but want to give bytes to msgpack.pack */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_1tuple_encode, 0, __pyx_n_s_tuple_encode, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_tuple_encode, __pyx_t_4) < 0) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "borg/item.pyx":350 * * * def tuple_decode(t): # <<<<<<<<<<<<<< * """decode a tuple that might contain bytes items""" * # we get bytes objects from msgpack.unpack, but want str */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_3tuple_decode, 0, __pyx_n_s_tuple_decode, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__56)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_tuple_decode, __pyx_t_4) < 0) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "borg/item.pyx":356 * * * class ArchiveItem(PropDict): # <<<<<<<<<<<<<< * """ * ArchiveItem abstraction that deals with validation and the low-level details internally: */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4)) __PYX_ERR(0, 356, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_4, __pyx_n_s_ArchiveItem, __pyx_n_s_ArchiveItem, (PyObject *) NULL, __pyx_n_s_borg_item, __pyx_kp_s_ArchiveItem_abstraction_that_de); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_4 != __pyx_t_7) { if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_7) < 0))) __PYX_ERR(0, 356, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/item.pyx":368 * """ * * VALID_KEYS = ARCHIVE_KEYS # str-typed keys # <<<<<<<<<<<<<< * * __slots__ = ("_dict", ) # avoid setting attributes not supported by properties */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ARCHIVE_KEYS); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_VALID_KEYS, __pyx_t_7) < 0) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/item.pyx":370 * VALID_KEYS = ARCHIVE_KEYS # str-typed keys * * __slots__ = ("_dict", ) # avoid setting attributes not supported by properties # <<<<<<<<<<<<<< * * version = PropDict._make_property('version', int) */ if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_slots, __pyx_tuple__18) < 0) __PYX_ERR(0, 370, __pyx_L1_error) /* "borg/item.pyx":372 * __slots__ = ("_dict", ) # avoid setting attributes not supported by properties * * version = PropDict._make_property('version', int) # <<<<<<<<<<<<<< * name = PropDict._make_property('name', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) * items = PropDict._make_property('items', list) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_make_property); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_n_s_version, ((PyObject *)(&PyInt_Type))}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_version, __pyx_t_7) < 0) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/item.pyx":373 * * version = PropDict._make_property('version', int) * name = PropDict._make_property('name', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) # <<<<<<<<<<<<<< * items = PropDict._make_property('items', list) * cmdline = PropDict._make_property('cmdline', list) # list of s-e-str */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_make_property); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_n_s_name_2); __Pyx_GIVEREF(__pyx_n_s_name_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_name_2)) __PYX_ERR(0, 373, __pyx_L1_error); __Pyx_INCREF((PyObject *)(&PyString_Type)); __Pyx_GIVEREF((PyObject *)(&PyString_Type)); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)(&PyString_Type)))) __PYX_ERR(0, 373, __pyx_L1_error); __Pyx_INCREF(__pyx_kp_s_surrogate_escaped_str); __Pyx_GIVEREF(__pyx_kp_s_surrogate_escaped_str); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_kp_s_surrogate_escaped_str)) __PYX_ERR(0, 373, __pyx_L1_error); __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_safe_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_encode, __pyx_t_3) < 0) __PYX_ERR(0, 373, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_safe_decode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_decode, __pyx_t_3) < 0) __PYX_ERR(0, 373, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_name_2, __pyx_t_3) < 0) __PYX_ERR(0, 373, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/item.pyx":374 * version = PropDict._make_property('version', int) * name = PropDict._make_property('name', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) * items = PropDict._make_property('items', list) # <<<<<<<<<<<<<< * cmdline = PropDict._make_property('cmdline', list) # list of s-e-str * hostname = PropDict._make_property('hostname', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_make_property); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_n_s_items, ((PyObject *)(&PyList_Type))}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_items, __pyx_t_3) < 0) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/item.pyx":375 * name = PropDict._make_property('name', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) * items = PropDict._make_property('items', list) * cmdline = PropDict._make_property('cmdline', list) # list of s-e-str # <<<<<<<<<<<<<< * hostname = PropDict._make_property('hostname', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) * username = PropDict._make_property('username', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_make_property); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_n_s_cmdline, ((PyObject *)(&PyList_Type))}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_cmdline, __pyx_t_3) < 0) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/item.pyx":376 * items = PropDict._make_property('items', list) * cmdline = PropDict._make_property('cmdline', list) # list of s-e-str * hostname = PropDict._make_property('hostname', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) # <<<<<<<<<<<<<< * username = PropDict._make_property('username', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) * time = PropDict._make_property('time', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_make_property); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_hostname); __Pyx_GIVEREF(__pyx_n_s_hostname); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_hostname)) __PYX_ERR(0, 376, __pyx_L1_error); __Pyx_INCREF((PyObject *)(&PyString_Type)); __Pyx_GIVEREF((PyObject *)(&PyString_Type)); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)(&PyString_Type)))) __PYX_ERR(0, 376, __pyx_L1_error); __Pyx_INCREF(__pyx_kp_s_surrogate_escaped_str); __Pyx_GIVEREF(__pyx_kp_s_surrogate_escaped_str); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_s_surrogate_escaped_str)) __PYX_ERR(0, 376, __pyx_L1_error); __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_safe_encode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_encode, __pyx_t_8) < 0) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_safe_decode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_decode, __pyx_t_8) < 0) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_hostname, __pyx_t_8) < 0) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "borg/item.pyx":377 * cmdline = PropDict._make_property('cmdline', list) # list of s-e-str * hostname = PropDict._make_property('hostname', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) * username = PropDict._make_property('username', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) # <<<<<<<<<<<<<< * time = PropDict._make_property('time', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) * time_end = PropDict._make_property('time_end', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_make_property); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_n_s_username); __Pyx_GIVEREF(__pyx_n_s_username); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_n_s_username)) __PYX_ERR(0, 377, __pyx_L1_error); __Pyx_INCREF((PyObject *)(&PyString_Type)); __Pyx_GIVEREF((PyObject *)(&PyString_Type)); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, ((PyObject *)(&PyString_Type)))) __PYX_ERR(0, 377, __pyx_L1_error); __Pyx_INCREF(__pyx_kp_s_surrogate_escaped_str); __Pyx_GIVEREF(__pyx_kp_s_surrogate_escaped_str); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_kp_s_surrogate_escaped_str)) __PYX_ERR(0, 377, __pyx_L1_error); __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_safe_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_encode, __pyx_t_2) < 0) __PYX_ERR(0, 377, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_safe_decode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_decode, __pyx_t_2) < 0) __PYX_ERR(0, 377, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_username, __pyx_t_2) < 0) __PYX_ERR(0, 377, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/item.pyx":378 * hostname = PropDict._make_property('hostname', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) * username = PropDict._make_property('username', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) * time = PropDict._make_property('time', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) # <<<<<<<<<<<<<< * time_end = PropDict._make_property('time_end', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) * comment = PropDict._make_property('comment', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_make_property); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_time); __Pyx_GIVEREF(__pyx_n_s_time); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_time)) __PYX_ERR(0, 378, __pyx_L1_error); __Pyx_INCREF((PyObject *)(&PyString_Type)); __Pyx_GIVEREF((PyObject *)(&PyString_Type)); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)(&PyString_Type)))) __PYX_ERR(0, 378, __pyx_L1_error); __Pyx_INCREF(__pyx_kp_s_surrogate_escaped_str); __Pyx_GIVEREF(__pyx_kp_s_surrogate_escaped_str); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_s_surrogate_escaped_str)) __PYX_ERR(0, 378, __pyx_L1_error); __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_safe_encode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_encode, __pyx_t_7) < 0) __PYX_ERR(0, 378, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_safe_decode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_decode, __pyx_t_7) < 0) __PYX_ERR(0, 378, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_time, __pyx_t_7) < 0) __PYX_ERR(0, 378, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/item.pyx":379 * username = PropDict._make_property('username', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) * time = PropDict._make_property('time', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) * time_end = PropDict._make_property('time_end', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) # <<<<<<<<<<<<<< * comment = PropDict._make_property('comment', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) * chunker_params = PropDict._make_property('chunker_params', tuple, 'chunker-params tuple', encode=tuple_encode, decode=tuple_decode) */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_make_property); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_n_s_time_end); __Pyx_GIVEREF(__pyx_n_s_time_end); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_time_end)) __PYX_ERR(0, 379, __pyx_L1_error); __Pyx_INCREF((PyObject *)(&PyString_Type)); __Pyx_GIVEREF((PyObject *)(&PyString_Type)); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)(&PyString_Type)))) __PYX_ERR(0, 379, __pyx_L1_error); __Pyx_INCREF(__pyx_kp_s_surrogate_escaped_str); __Pyx_GIVEREF(__pyx_kp_s_surrogate_escaped_str); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_kp_s_surrogate_escaped_str)) __PYX_ERR(0, 379, __pyx_L1_error); __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_safe_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_encode, __pyx_t_3) < 0) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_safe_decode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_decode, __pyx_t_3) < 0) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_time_end, __pyx_t_3) < 0) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/item.pyx":380 * time = PropDict._make_property('time', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) * time_end = PropDict._make_property('time_end', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) * comment = PropDict._make_property('comment', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) # <<<<<<<<<<<<<< * chunker_params = PropDict._make_property('chunker_params', tuple, 'chunker-params tuple', encode=tuple_encode, decode=tuple_decode) * recreate_cmdline = PropDict._make_property('recreate_cmdline', list) # list of s-e-str */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_make_property); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_comment); __Pyx_GIVEREF(__pyx_n_s_comment); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_comment)) __PYX_ERR(0, 380, __pyx_L1_error); __Pyx_INCREF((PyObject *)(&PyString_Type)); __Pyx_GIVEREF((PyObject *)(&PyString_Type)); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)(&PyString_Type)))) __PYX_ERR(0, 380, __pyx_L1_error); __Pyx_INCREF(__pyx_kp_s_surrogate_escaped_str); __Pyx_GIVEREF(__pyx_kp_s_surrogate_escaped_str); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_s_surrogate_escaped_str)) __PYX_ERR(0, 380, __pyx_L1_error); __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_safe_encode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_encode, __pyx_t_8) < 0) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_safe_decode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_decode, __pyx_t_8) < 0) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_comment, __pyx_t_8) < 0) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "borg/item.pyx":381 * time_end = PropDict._make_property('time_end', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) * comment = PropDict._make_property('comment', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) * chunker_params = PropDict._make_property('chunker_params', tuple, 'chunker-params tuple', encode=tuple_encode, decode=tuple_decode) # <<<<<<<<<<<<<< * recreate_cmdline = PropDict._make_property('recreate_cmdline', list) # list of s-e-str * # recreate_source_id, recreate_args, recreate_partial_chunks were used in 1.1.0b1 .. b2 */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_make_property); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_n_s_chunker_params); __Pyx_GIVEREF(__pyx_n_s_chunker_params); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_n_s_chunker_params)) __PYX_ERR(0, 381, __pyx_L1_error); __Pyx_INCREF((PyObject *)(&PyTuple_Type)); __Pyx_GIVEREF((PyObject *)(&PyTuple_Type)); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, ((PyObject *)(&PyTuple_Type)))) __PYX_ERR(0, 381, __pyx_L1_error); __Pyx_INCREF(__pyx_kp_s_chunker_params_tuple); __Pyx_GIVEREF(__pyx_kp_s_chunker_params_tuple); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_kp_s_chunker_params_tuple)) __PYX_ERR(0, 381, __pyx_L1_error); __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tuple_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_encode, __pyx_t_2) < 0) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tuple_decode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_decode, __pyx_t_2) < 0) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_chunker_params, __pyx_t_2) < 0) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/item.pyx":382 * comment = PropDict._make_property('comment', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) * chunker_params = PropDict._make_property('chunker_params', tuple, 'chunker-params tuple', encode=tuple_encode, decode=tuple_decode) * recreate_cmdline = PropDict._make_property('recreate_cmdline', list) # list of s-e-str # <<<<<<<<<<<<<< * # recreate_source_id, recreate_args, recreate_partial_chunks were used in 1.1.0b1 .. b2 * recreate_source_id = PropDict._make_property('recreate_source_id', bytes) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_make_property); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_n_s_recreate_cmdline, ((PyObject *)(&PyList_Type))}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_recreate_cmdline, __pyx_t_2) < 0) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/item.pyx":384 * recreate_cmdline = PropDict._make_property('recreate_cmdline', list) # list of s-e-str * # recreate_source_id, recreate_args, recreate_partial_chunks were used in 1.1.0b1 .. b2 * recreate_source_id = PropDict._make_property('recreate_source_id', bytes) # <<<<<<<<<<<<<< * recreate_args = PropDict._make_property('recreate_args', list) # list of s-e-str * recreate_partial_chunks = PropDict._make_property('recreate_partial_chunks', list) # list of tuples */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_make_property); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_n_s_recreate_source_id, ((PyObject *)(&PyBytes_Type))}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_recreate_source_id, __pyx_t_2) < 0) __PYX_ERR(0, 384, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/item.pyx":385 * # recreate_source_id, recreate_args, recreate_partial_chunks were used in 1.1.0b1 .. b2 * recreate_source_id = PropDict._make_property('recreate_source_id', bytes) * recreate_args = PropDict._make_property('recreate_args', list) # list of s-e-str # <<<<<<<<<<<<<< * recreate_partial_chunks = PropDict._make_property('recreate_partial_chunks', list) # list of tuples * size = PropDict._make_property('size', int) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_make_property); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_n_s_recreate_args, ((PyObject *)(&PyList_Type))}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_recreate_args, __pyx_t_2) < 0) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/item.pyx":386 * recreate_source_id = PropDict._make_property('recreate_source_id', bytes) * recreate_args = PropDict._make_property('recreate_args', list) # list of s-e-str * recreate_partial_chunks = PropDict._make_property('recreate_partial_chunks', list) # list of tuples # <<<<<<<<<<<<<< * size = PropDict._make_property('size', int) * csize = PropDict._make_property('csize', int) */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_make_property); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_n_s_recreate_partial_chunks, ((PyObject *)(&PyList_Type))}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_recreate_partial_chunks, __pyx_t_2) < 0) __PYX_ERR(0, 386, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/item.pyx":387 * recreate_args = PropDict._make_property('recreate_args', list) # list of s-e-str * recreate_partial_chunks = PropDict._make_property('recreate_partial_chunks', list) # list of tuples * size = PropDict._make_property('size', int) # <<<<<<<<<<<<<< * csize = PropDict._make_property('csize', int) * nfiles = PropDict._make_property('nfiles', int) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_make_property); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_n_s_size, ((PyObject *)(&PyInt_Type))}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_size, __pyx_t_2) < 0) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/item.pyx":388 * recreate_partial_chunks = PropDict._make_property('recreate_partial_chunks', list) # list of tuples * size = PropDict._make_property('size', int) * csize = PropDict._make_property('csize', int) # <<<<<<<<<<<<<< * nfiles = PropDict._make_property('nfiles', int) * size_parts = PropDict._make_property('size_parts', int) */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_make_property); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_n_s_csize, ((PyObject *)(&PyInt_Type))}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_csize, __pyx_t_2) < 0) __PYX_ERR(0, 388, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/item.pyx":389 * size = PropDict._make_property('size', int) * csize = PropDict._make_property('csize', int) * nfiles = PropDict._make_property('nfiles', int) # <<<<<<<<<<<<<< * size_parts = PropDict._make_property('size_parts', int) * csize_parts = PropDict._make_property('csize_parts', int) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_make_property); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_n_s_nfiles, ((PyObject *)(&PyInt_Type))}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_nfiles, __pyx_t_2) < 0) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/item.pyx":390 * csize = PropDict._make_property('csize', int) * nfiles = PropDict._make_property('nfiles', int) * size_parts = PropDict._make_property('size_parts', int) # <<<<<<<<<<<<<< * csize_parts = PropDict._make_property('csize_parts', int) * nfiles_parts = PropDict._make_property('nfiles_parts', int) */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_make_property); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_n_s_size_parts, ((PyObject *)(&PyInt_Type))}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_size_parts, __pyx_t_2) < 0) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/item.pyx":391 * nfiles = PropDict._make_property('nfiles', int) * size_parts = PropDict._make_property('size_parts', int) * csize_parts = PropDict._make_property('csize_parts', int) # <<<<<<<<<<<<<< * nfiles_parts = PropDict._make_property('nfiles_parts', int) * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_make_property); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_n_s_csize_parts, ((PyObject *)(&PyInt_Type))}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_csize_parts, __pyx_t_2) < 0) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/item.pyx":392 * size_parts = PropDict._make_property('size_parts', int) * csize_parts = PropDict._make_property('csize_parts', int) * nfiles_parts = PropDict._make_property('nfiles_parts', int) # <<<<<<<<<<<<<< * * */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_make_property); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_n_s_nfiles_parts, ((PyObject *)(&PyInt_Type))}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_nfiles_parts, __pyx_t_2) < 0) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/item.pyx":356 * * * class ArchiveItem(PropDict): # <<<<<<<<<<<<<< * """ * ArchiveItem abstraction that deals with validation and the low-level details internally: */ __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_n_s_ArchiveItem, __pyx_t_4, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ArchiveItem, __pyx_t_2) < 0) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "borg/item.pyx":395 * * * class ManifestItem(PropDict): # <<<<<<<<<<<<<< * """ * ManifestItem abstraction that deals with validation and the low-level details internally: */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(0, 395, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_4, __pyx_n_s_ManifestItem, __pyx_n_s_ManifestItem, (PyObject *) NULL, __pyx_n_s_borg_item, __pyx_kp_s_ManifestItem_abstraction_that_d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__pyx_t_4 != __pyx_t_6) { if (unlikely((PyDict_SetItemString(__pyx_t_2, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 395, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "borg/item.pyx":407 * """ * * VALID_KEYS = {'version', 'archives', 'timestamp', 'config', 'item_keys', } # str-typed keys # <<<<<<<<<<<<<< * * __slots__ = ("_dict", ) # avoid setting attributes not supported by properties */ __pyx_t_6 = PySet_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PySet_Add(__pyx_t_6, __pyx_n_s_version) < 0) __PYX_ERR(0, 407, __pyx_L1_error) if (PySet_Add(__pyx_t_6, __pyx_n_s_archives) < 0) __PYX_ERR(0, 407, __pyx_L1_error) if (PySet_Add(__pyx_t_6, __pyx_n_s_timestamp) < 0) __PYX_ERR(0, 407, __pyx_L1_error) if (PySet_Add(__pyx_t_6, __pyx_n_s_config) < 0) __PYX_ERR(0, 407, __pyx_L1_error) if (PySet_Add(__pyx_t_6, __pyx_n_s_item_keys) < 0) __PYX_ERR(0, 407, __pyx_L1_error) if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_VALID_KEYS, __pyx_t_6) < 0) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "borg/item.pyx":409 * VALID_KEYS = {'version', 'archives', 'timestamp', 'config', 'item_keys', } # str-typed keys * * __slots__ = ("_dict", ) # avoid setting attributes not supported by properties # <<<<<<<<<<<<<< * * version = PropDict._make_property('version', int) */ if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_slots, __pyx_tuple__18) < 0) __PYX_ERR(0, 409, __pyx_L1_error) /* "borg/item.pyx":411 * __slots__ = ("_dict", ) # avoid setting attributes not supported by properties * * version = PropDict._make_property('version', int) # <<<<<<<<<<<<<< * archives = PropDict._make_property('archives', dict) # name -> dict * timestamp = PropDict._make_property('timestamp', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_make_property); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_n_s_version, ((PyObject *)(&PyInt_Type))}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_version, __pyx_t_6) < 0) __PYX_ERR(0, 411, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "borg/item.pyx":412 * * version = PropDict._make_property('version', int) * archives = PropDict._make_property('archives', dict) # name -> dict # <<<<<<<<<<<<<< * timestamp = PropDict._make_property('timestamp', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) * config = PropDict._make_property('config', dict) */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_make_property); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_n_s_archives, ((PyObject *)(&PyDict_Type))}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_archives, __pyx_t_6) < 0) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "borg/item.pyx":413 * version = PropDict._make_property('version', int) * archives = PropDict._make_property('archives', dict) # name -> dict * timestamp = PropDict._make_property('timestamp', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) # <<<<<<<<<<<<<< * config = PropDict._make_property('config', dict) * item_keys = PropDict._make_property('item_keys', tuple) */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_make_property); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_n_s_timestamp); __Pyx_GIVEREF(__pyx_n_s_timestamp); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_timestamp)) __PYX_ERR(0, 413, __pyx_L1_error); __Pyx_INCREF((PyObject *)(&PyString_Type)); __Pyx_GIVEREF((PyObject *)(&PyString_Type)); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)(&PyString_Type)))) __PYX_ERR(0, 413, __pyx_L1_error); __Pyx_INCREF(__pyx_kp_s_surrogate_escaped_str); __Pyx_GIVEREF(__pyx_kp_s_surrogate_escaped_str); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_kp_s_surrogate_escaped_str)) __PYX_ERR(0, 413, __pyx_L1_error); __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_safe_encode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_encode, __pyx_t_7) < 0) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_safe_decode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_decode, __pyx_t_7) < 0) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_timestamp, __pyx_t_7) < 0) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/item.pyx":414 * archives = PropDict._make_property('archives', dict) # name -> dict * timestamp = PropDict._make_property('timestamp', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) * config = PropDict._make_property('config', dict) # <<<<<<<<<<<<<< * item_keys = PropDict._make_property('item_keys', tuple) * */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_make_property); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_n_s_config, ((PyObject *)(&PyDict_Type))}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_config, __pyx_t_7) < 0) __PYX_ERR(0, 414, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/item.pyx":415 * timestamp = PropDict._make_property('timestamp', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) * config = PropDict._make_property('config', dict) * item_keys = PropDict._make_property('item_keys', tuple) # <<<<<<<<<<<<<< * * class ItemDiff: */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_make_property); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_n_s_item_keys, ((PyObject *)(&PyTuple_Type))}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_item_keys, __pyx_t_7) < 0) __PYX_ERR(0, 415, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/item.pyx":395 * * * class ManifestItem(PropDict): # <<<<<<<<<<<<<< * """ * ManifestItem abstraction that deals with validation and the low-level details internally: */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_n_s_ManifestItem, __pyx_t_4, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ManifestItem, __pyx_t_7) < 0) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "borg/item.pyx":417 * item_keys = PropDict._make_property('item_keys', tuple) * * class ItemDiff: # <<<<<<<<<<<<<< * """ * Comparison of two items from different archives. */ __pyx_t_4 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_ItemDiff, __pyx_n_s_ItemDiff, (PyObject *) NULL, __pyx_n_s_borg_item, __pyx_kp_s_Comparison_of_two_items_from_di); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "borg/item.pyx":425 * """ * * def __init__(self, item1, item2, chunk_iterator1, chunk_iterator2, numeric_ids=False, can_compare_chunk_ids=False, content_only=False): # <<<<<<<<<<<<<< * self._item1 = item1 * self._item2 = item2 */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_8ItemDiff_1__init__, 0, __pyx_n_s_ItemDiff___init, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__59); if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_init, __pyx_t_5) < 0) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/item.pyx":460 * self._changes = [ch for ch in changes if ch] * * def changes(self): # <<<<<<<<<<<<<< * return self._changes * */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_8ItemDiff_3changes, 0, __pyx_n_s_ItemDiff_changes, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_changes_2, __pyx_t_5) < 0) __PYX_ERR(0, 460, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/item.pyx":463 * return self._changes * * def __repr__(self): # <<<<<<<<<<<<<< * if self.equal: * return 'equal' */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_8ItemDiff_5__repr__, 0, __pyx_n_s_ItemDiff___repr, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_repr, __pyx_t_5) < 0) __PYX_ERR(0, 463, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/item.pyx":468 * return ' '.join(str for d,str in self._changes) * * def _equal(self, chunk_iterator1, chunk_iterator2): # <<<<<<<<<<<<<< * # if both are deleted, there is nothing at path regardless of what was deleted * if self._item1.get('deleted') and self._item2.get('deleted'): */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_8ItemDiff_7_equal, 0, __pyx_n_s_ItemDiff__equal, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_equal, __pyx_t_5) < 0) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/item.pyx":492 * return True * * def _presence_diff(self, item_type): # <<<<<<<<<<<<<< * if not self._item1.get('deleted') and self._item2.get('deleted'): * chg = 'removed ' + item_type */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_8ItemDiff_9_presence_diff, 0, __pyx_n_s_ItemDiff__presence_diff, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 492, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_presence_diff, __pyx_t_5) < 0) __PYX_ERR(0, 492, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/item.pyx":500 * return ({"type": chg}, chg) * * def _link_diff(self): # <<<<<<<<<<<<<< * pd = self._presence_diff('link') * if pd is not None: */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_8ItemDiff_11_link_diff, 0, __pyx_n_s_ItemDiff__link_diff, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_link_diff, __pyx_t_5) < 0) __PYX_ERR(0, 500, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/item.pyx":507 * return ({"type": 'changed link'}, 'changed link') * * def _content_diff(self): # <<<<<<<<<<<<<< * if self._item1.get('deleted'): * sz = self._item2.get_size() */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_8ItemDiff_13_content_diff, 0, __pyx_n_s_ItemDiff__content_diff, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_content_diff, __pyx_t_5) < 0) __PYX_ERR(0, 507, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/item.pyx":526 * format_file_size(-removed, precision=1, sign=True))) * * def _owner_diff(self): # <<<<<<<<<<<<<< * u_attr, g_attr = ('uid', 'gid') if self._numeric_ids else ('user', 'group') * u1, g1 = self._item1.get(u_attr), self._item1.get(g_attr) */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_8ItemDiff_15_owner_diff, 0, __pyx_n_s_ItemDiff__owner_diff, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_owner_diff, __pyx_t_5) < 0) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/item.pyx":534 * '[{}:{} -> {}:{}]'.format(u1, g1, u2, g2)) * * def _mode_diff(self): # <<<<<<<<<<<<<< * if 'mode' in self._item1 and 'mode' in self._item2 and self._item1.mode != self._item2.mode: * mode1 = stat.filemode(self._item1.mode) */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_8ItemDiff_17_mode_diff, 0, __pyx_n_s_ItemDiff__mode_diff, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_mode_diff, __pyx_t_5) < 0) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/item.pyx":540 * return ({"type": "mode", "old_mode": mode1, "new_mode": mode2}, '[{} -> {}]'.format(mode1, mode2)) * * def _time_diffs(self): # <<<<<<<<<<<<<< * changes = [] * attrs = ["ctime", "mtime"] */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_8ItemDiff_19_time_diffs, 0, __pyx_n_s_ItemDiff__time_diffs, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__76)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_time_diffs, __pyx_t_5) < 0) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/item.pyx":550 * return changes * * def _content_equal(self, chunk_iterator1, chunk_iterator2): # <<<<<<<<<<<<<< * if self._can_compare_chunk_ids: * return self._item1.chunks == self._item2.chunks */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_8ItemDiff_21_content_equal, 0, __pyx_n_s_ItemDiff__content_equal, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__78)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_content_equal, __pyx_t_5) < 0) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/item.pyx":417 * item_keys = PropDict._make_property('item_keys', tuple) * * class ItemDiff: # <<<<<<<<<<<<<< * """ * Comparison of two items from different archives. */ __pyx_t_5 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_ItemDiff, __pyx_empty_tuple, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ItemDiff, __pyx_t_5) < 0) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "borg/item.pyx":558 * * * def chunks_contents_equal(chunks1, chunks2): # <<<<<<<<<<<<<< * """ * Compare chunk content and return True if they are identical. */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_5chunks_contents_equal, 0, __pyx_n_s_chunks_contents_equal, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_chunks_contents_equal, __pyx_t_4) < 0) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "borg/item.pyx":1 * import stat # <<<<<<<<<<<<<< * from collections import namedtuple * */ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init borg.item", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init borg.item"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* PyObjectSetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_setattr)) return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); #endif return PyObject_SetAttr(obj, attr_name, value); } #endif /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return -1; __Pyx_PyErr_Clear(); return 0; } return 0; } /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP __Pyx_TypeName type_name; PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) #elif PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (likely(descr != NULL)) { *method = descr; return 0; } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(name)); #endif __Pyx_DECREF_TypeName(type_name); return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_CallOneArg(method, obj); Py_DECREF(method); return result; } if (unlikely(!method)) goto bad; result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } return __Pyx_IterFinish(); } /* RaiseNoneIterError */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* UnpackTupleError */ static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { if (t == Py_None) { __Pyx_RaiseNoneNotIterableError(); } else if (PyTuple_GET_SIZE(t) < index) { __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); } else { __Pyx_RaiseTooManyValuesError(index); } } /* UnpackTuple2 */ static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) { PyObject *value1 = NULL, *value2 = NULL; #if CYTHON_COMPILING_IN_PYPY value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad; value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad; #else value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1); value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2); #endif if (decref_tuple) { Py_DECREF(tuple); } *pvalue1 = value1; *pvalue2 = value2; return 0; #if CYTHON_COMPILING_IN_PYPY bad: Py_XDECREF(value1); Py_XDECREF(value2); if (decref_tuple) { Py_XDECREF(tuple); } return -1; #endif } static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int has_known_size, int decref_tuple) { Py_ssize_t index; PyObject *value1 = NULL, *value2 = NULL, *iter = NULL; iternextfunc iternext; iter = PyObject_GetIter(tuple); if (unlikely(!iter)) goto bad; if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; } iternext = __Pyx_PyObject_GetIterNextFunc(iter); value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; } value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; } if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad; Py_DECREF(iter); *pvalue1 = value1; *pvalue2 = value2; return 0; unpacking_failed: if (!has_known_size && __Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); bad: Py_XDECREF(iter); Py_XDECREF(value1); Py_XDECREF(value2); if (decref_tuple) { Py_XDECREF(tuple); } return -1; } /* dict_iter */ #if CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 #include #endif static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, Py_ssize_t* p_orig_length, int* p_source_is_dict) { is_dict = is_dict || likely(PyDict_CheckExact(iterable)); *p_source_is_dict = is_dict; if (is_dict) { #if !CYTHON_COMPILING_IN_PYPY *p_orig_length = PyDict_Size(iterable); Py_INCREF(iterable); return iterable; #elif PY_MAJOR_VERSION >= 3 static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL; PyObject **pp = NULL; if (method_name) { const char *name = PyUnicode_AsUTF8(method_name); if (strcmp(name, "iteritems") == 0) pp = &py_items; else if (strcmp(name, "iterkeys") == 0) pp = &py_keys; else if (strcmp(name, "itervalues") == 0) pp = &py_values; if (pp) { if (!*pp) { *pp = PyUnicode_FromString(name + 4); if (!*pp) return NULL; } method_name = *pp; } } #endif } *p_orig_length = 0; if (method_name) { PyObject* iter; iterable = __Pyx_PyObject_CallMethod0(iterable, method_name); if (!iterable) return NULL; #if !CYTHON_COMPILING_IN_PYPY if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable)) return iterable; #endif iter = PyObject_GetIter(iterable); Py_DECREF(iterable); return iter; } return PyObject_GetIter(iterable); } static CYTHON_INLINE int __Pyx_dict_iter_next( PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { PyObject* next_item; #if !CYTHON_COMPILING_IN_PYPY if (source_is_dict) { PyObject *key, *value; if (unlikely(orig_length != PyDict_Size(iter_obj))) { PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); return -1; } if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { return 0; } if (pitem) { PyObject* tuple = PyTuple_New(2); if (unlikely(!tuple)) { return -1; } Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(tuple, 0, key); PyTuple_SET_ITEM(tuple, 1, value); *pitem = tuple; } else { if (pkey) { Py_INCREF(key); *pkey = key; } if (pvalue) { Py_INCREF(value); *pvalue = value; } } return 1; } else if (PyTuple_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; *ppos = pos + 1; next_item = PyTuple_GET_ITEM(iter_obj, pos); Py_INCREF(next_item); } else if (PyList_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; *ppos = pos + 1; next_item = PyList_GET_ITEM(iter_obj, pos); Py_INCREF(next_item); } else #endif { next_item = PyIter_Next(iter_obj); if (unlikely(!next_item)) { return __Pyx_IterFinish(); } } if (pitem) { *pitem = next_item; } else if (pkey && pvalue) { if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1)) return -1; } else if (pkey) { *pkey = next_item; } else { *pvalue = next_item; } return 1; } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* GetAttr3 */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static PyObject *__Pyx_GetAttr3Default(PyObject *d) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) return NULL; __Pyx_PyErr_Clear(); Py_INCREF(d); return d; } #endif static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { PyObject *r; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 int res = PyObject_GetOptionalAttr(o, n, &r); return (res != 0) ? r : __Pyx_NewRef(d); #else #if CYTHON_USE_TYPE_SLOTS if (likely(PyString_Check(n))) { r = __Pyx_PyObject_GetAttrStrNoError(o, n); if (unlikely(!r) && likely(!PyErr_Occurred())) { r = __Pyx_NewRef(d); } return r; } #endif r = PyObject_GetAttr(o, n); return (likely(r)) ? r : __Pyx_GetAttr3Default(d); #endif } /* RaiseClosureNameError */ static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) { PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname); } /* GetItemInt */ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (unlikely(!j)) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_subscript) { PyObject *r, *key = PyInt_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); return r; } if (likely(sm && sm->sq_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return sm->sq_item(o, i); } } #else if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* ObjectGetItem */ #if CYTHON_USE_TYPE_SLOTS static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { PyObject *runerr = NULL; Py_ssize_t key_value; key_value = __Pyx_PyIndex_AsSsize_t(index); if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); } if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index)); PyErr_Clear(); PyErr_Format(PyExc_IndexError, "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name); __Pyx_DECREF_TypeName(index_type_name); } return NULL; } static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { __Pyx_TypeName obj_type_name; if (likely(PyType_Check(obj))) { PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem); if (!meth) { PyErr_Clear(); } else { PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); Py_DECREF(meth); return result; } } obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); return NULL; } static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { PyTypeObject *tp = Py_TYPE(obj); PyMappingMethods *mm = tp->tp_as_mapping; PySequenceMethods *sm = tp->tp_as_sequence; if (likely(mm && mm->mp_subscript)) { return mm->mp_subscript(obj, key); } if (likely(sm && sm->sq_item)) { return __Pyx_PyObject_GetIndex(obj, key); } return __Pyx_PyObject_GetItem_Slow(obj, key); } #endif /* GetTopmostException */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) { _PyErr_StackItem *exc_info = tstate->exc_info; while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && exc_info->previous_item != NULL) { exc_info = exc_info->previous_item; } return exc_info; } #endif /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); PyObject *exc_value = exc_info->exc_value; if (exc_value == NULL || exc_value == Py_None) { *value = NULL; *type = NULL; *tb = NULL; } else { *value = exc_value; Py_INCREF(*value); *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); *tb = PyException_GetTraceback(exc_value); } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); *type = exc_info->exc_type; *value = exc_info->exc_value; *tb = exc_info->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #else *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #endif } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; PyObject *tmp_value = exc_info->exc_value; exc_info->exc_value = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = type; exc_info->exc_value = value; exc_info->exc_traceback = tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } #endif /* GetException */ #if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) #endif { PyObject *local_type = NULL, *local_value, *local_tb = NULL; #if CYTHON_FAST_THREAD_STATE PyObject *tmp_type, *tmp_value, *tmp_tb; #if PY_VERSION_HEX >= 0x030C00A6 local_value = tstate->current_exception; tstate->current_exception = 0; if (likely(local_value)) { local_type = (PyObject*) Py_TYPE(local_value); Py_INCREF(local_type); local_tb = PyException_GetTraceback(local_value); } #else local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 if (unlikely(tstate->current_exception)) #elif CYTHON_FAST_THREAD_STATE if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE #if CYTHON_USE_EXC_INFO_STACK { _PyErr_StackItem *exc_info = tstate->exc_info; #if PY_VERSION_HEX >= 0x030B00a4 tmp_value = exc_info->exc_value; exc_info->exc_value = local_value; tmp_type = NULL; tmp_tb = NULL; Py_XDECREF(local_type); Py_XDECREF(local_tb); #else tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = local_type; exc_info->exc_value = local_value; exc_info->exc_traceback = local_tb; #endif } #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* RaiseUnboundLocalError */ static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); } /* GetAttr */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { #if CYTHON_USE_TYPE_SLOTS #if PY_MAJOR_VERSION >= 3 if (likely(PyUnicode_Check(n))) #else if (likely(PyString_Check(n))) #endif return __Pyx_PyObject_GetAttrStr(o, n); #endif return PyObject_GetAttr(o, n); } /* pep479 */ static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) { PyObject *exc, *val, *tb, *cur_exc; __Pyx_PyThreadState_declare #ifdef __Pyx_StopAsyncIteration_USED int is_async_stopiteration = 0; #endif CYTHON_MAYBE_UNUSED_VAR(in_async_gen); cur_exc = PyErr_Occurred(); if (likely(!__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopIteration))) { #ifdef __Pyx_StopAsyncIteration_USED if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, __Pyx_PyExc_StopAsyncIteration))) { is_async_stopiteration = 1; } else #endif return; } __Pyx_PyThreadState_assign __Pyx_GetException(&exc, &val, &tb); Py_XDECREF(exc); Py_XDECREF(val); Py_XDECREF(tb); PyErr_SetString(PyExc_RuntimeError, #ifdef __Pyx_StopAsyncIteration_USED is_async_stopiteration ? "async generator raised StopAsyncIteration" : in_async_gen ? "async generator raised StopIteration" : #endif "generator raised StopIteration"); } /* PyObjectCall2Args */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args[3] = {NULL, arg1, arg2}; return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectCallMethod1 */ #if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2) static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); Py_DECREF(method); return result; } #endif static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { #if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2 PyObject *args[2] = {obj, arg}; (void) __Pyx_PyObject_GetMethod; (void) __Pyx_PyObject_CallOneArg; (void) __Pyx_PyObject_Call2Args; return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); #else PyObject *method = NULL, *result; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_Call2Args(method, obj, arg); Py_DECREF(method); return result; } if (unlikely(!method)) return NULL; return __Pyx__PyObject_CallMethod1(method, arg); #endif } /* StringJoin */ static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) { (void) __Pyx_PyObject_CallMethod1; #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION < 3 return _PyString_Join(sep, values); #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 return _PyBytes_Join(sep, values); #else return __Pyx_PyObject_CallMethod1(sep, __pyx_n_s_join, values); #endif } /* IterNext */ static PyObject *__Pyx_PyIter_Next2Default(PyObject* defval) { PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (!defval || unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return NULL; __Pyx_PyErr_Clear(); Py_INCREF(defval); return defval; } if (defval) { Py_INCREF(defval); return defval; } __Pyx_PyErr_SetNone(PyExc_StopIteration); return NULL; } static void __Pyx_PyIter_Next_ErrorNoIterator(PyObject *iterator) { __Pyx_TypeName iterator_type_name = __Pyx_PyType_GetName(Py_TYPE(iterator)); PyErr_Format(PyExc_TypeError, __Pyx_FMT_TYPENAME " object is not an iterator", iterator_type_name); __Pyx_DECREF_TypeName(iterator_type_name); } static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject* iterator, PyObject* defval) { PyObject* next; iternextfunc iternext = Py_TYPE(iterator)->tp_iternext; if (likely(iternext)) { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY next = iternext(iterator); if (likely(next)) return next; #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 if (unlikely(iternext == &_PyObject_NextNotImplemented)) return NULL; #endif #else next = PyIter_Next(iterator); if (likely(next)) return next; #endif } else if (CYTHON_USE_TYPE_SLOTS || unlikely(!PyIter_Check(iterator))) { __Pyx_PyIter_Next_ErrorNoIterator(iterator); return NULL; } #if !CYTHON_USE_TYPE_SLOTS else { next = PyIter_Next(iterator); if (likely(next)) return next; } #endif return __Pyx_PyIter_Next2Default(defval); } /* SliceObject */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, int has_cstart, int has_cstop, int wraparound) { __Pyx_TypeName obj_type_name; #if CYTHON_USE_TYPE_SLOTS PyMappingMethods* mp; #if PY_MAJOR_VERSION < 3 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; if (likely(ms && ms->sq_slice)) { if (!has_cstart) { if (_py_start && (*_py_start != Py_None)) { cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstart = 0; } if (!has_cstop) { if (_py_stop && (*_py_stop != Py_None)) { cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstop = PY_SSIZE_T_MAX; } if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { Py_ssize_t l = ms->sq_length(obj); if (likely(l >= 0)) { if (cstop < 0) { cstop += l; if (cstop < 0) cstop = 0; } if (cstart < 0) { cstart += l; if (cstart < 0) cstart = 0; } } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) goto bad; PyErr_Clear(); } } return ms->sq_slice(obj, cstart, cstop); } #else CYTHON_UNUSED_VAR(wraparound); #endif mp = Py_TYPE(obj)->tp_as_mapping; if (likely(mp && mp->mp_subscript)) #else CYTHON_UNUSED_VAR(wraparound); #endif { PyObject* result; PyObject *py_slice, *py_start, *py_stop; if (_py_slice) { py_slice = *_py_slice; } else { PyObject* owned_start = NULL; PyObject* owned_stop = NULL; if (_py_start) { py_start = *_py_start; } else { if (has_cstart) { owned_start = py_start = PyInt_FromSsize_t(cstart); if (unlikely(!py_start)) goto bad; } else py_start = Py_None; } if (_py_stop) { py_stop = *_py_stop; } else { if (has_cstop) { owned_stop = py_stop = PyInt_FromSsize_t(cstop); if (unlikely(!py_stop)) { Py_XDECREF(owned_start); goto bad; } } else py_stop = Py_None; } py_slice = PySlice_New(py_start, py_stop, Py_None); Py_XDECREF(owned_start); Py_XDECREF(owned_stop); if (unlikely(!py_slice)) goto bad; } #if CYTHON_USE_TYPE_SLOTS result = mp->mp_subscript(obj, py_slice); #else result = PyObject_GetItem(obj, py_slice); #endif if (!_py_slice) { Py_DECREF(py_slice); } return result; } obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' object is unsliceable", obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); bad: return NULL; } /* ValidateBasesTuple */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; #if CYTHON_ASSUME_SAFE_MACROS n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); if (n < 0) return -1; #endif for (i = 1; i < n; i++) { #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; #elif CYTHON_ASSUME_SAFE_MACROS PyObject *b0 = PyTuple_GET_ITEM(bases, i); #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; #endif PyTypeObject *b; #if PY_MAJOR_VERSION < 3 if (PyClass_Check(b0)) { PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); __Pyx_DECREF_TypeName(b_name); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); if (!py_b_dictoffset) goto dictoffset_return; b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); Py_DECREF(py_b_dictoffset); if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; #endif if (b_dictoffset) { { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "extension type '%.200s' has no __dict__ slot, " "but base type '" __Pyx_FMT_TYPENAME "' has: " "either add 'cdef dict __dict__' to the extension type " "or add '__slots__ = [...]' to the base type", type_name, b_name); __Pyx_DECREF_TypeName(b_name); } #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif } return 0; } #endif /* PyType_Ready */ static int __Pyx_PyType_Ready(PyTypeObject *t) { #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS (void)__Pyx_validate_bases_tuple; #endif return PyType_Ready(t); #else int r; PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 gc_was_enabled = PyGC_Disable(); (void)__Pyx_PyObject_CallMethod0; #else PyObject *ret, *py_status; PyObject *gc = NULL; #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) gc = PyImport_GetModule(__pyx_kp_u_gc); #endif if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); if (unlikely(!gc)) return -1; py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; } gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; } Py_DECREF(ret); } else if (unlikely(gc_was_enabled == -1)) { Py_DECREF(gc); return -1; } #endif t->tp_flags |= Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A0000 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; #endif #else (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) PyGC_Enable(); #else if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); } else { Py_XDECREF(tp); Py_XDECREF(v); Py_XDECREF(tb); r = -1; } } Py_DECREF(gc); #endif } #endif return r; #endif } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, attr_name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(attr_name)); #endif __Pyx_DECREF_TypeName(type_name); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s__16; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__17); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* CalculateMetaclass */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases; #if CYTHON_ASSUME_SAFE_MACROS nbases = PyTuple_GET_SIZE(bases); #else nbases = PyTuple_Size(bases); if (nbases < 0) return NULL; #endif for (i=0; i < nbases; i++) { PyTypeObject *tmptype; #if CYTHON_ASSUME_SAFE_MACROS PyObject *tmp = PyTuple_GET_ITEM(bases, i); #else PyObject *tmp = PyTuple_GetItem(bases, i); if (!tmp) return NULL; #endif tmptype = Py_TYPE(tmp); #if PY_MAJOR_VERSION < 3 if (tmptype == &PyClass_Type) continue; #endif if (!metaclass) { metaclass = tmptype; continue; } if (PyType_IsSubtype(metaclass, tmptype)) continue; if (PyType_IsSubtype(tmptype, metaclass)) { metaclass = tmptype; continue; } PyErr_SetString(PyExc_TypeError, "metaclass conflict: " "the metaclass of a derived class " "must be a (non-strict) subclass " "of the metaclasses of all its bases"); return NULL; } if (!metaclass) { #if PY_MAJOR_VERSION < 3 metaclass = &PyClass_Type; #else metaclass = &PyType_Type; #endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; } /* PyObjectLookupSpecial */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) { PyObject *res; PyTypeObject *tp = Py_TYPE(obj); #if PY_MAJOR_VERSION < 3 if (unlikely(PyInstance_Check(obj))) return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name); #endif res = _PyType_Lookup(tp, attr_name); if (likely(res)) { descrgetfunc f = Py_TYPE(res)->tp_descr_get; if (!f) { Py_INCREF(res); } else { res = f(res, obj, (PyObject *)tp); } } else if (with_error) { PyErr_SetObject(PyExc_AttributeError, attr_name); } return res; } #endif /* Py3ClassCreate */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; if (metaclass) { PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare); if (prep) { PyObject *pargs[3] = {NULL, name, bases}; ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); Py_DECREF(prep); } else { if (unlikely(PyErr_Occurred())) return NULL; ns = PyDict_New(); } } else { ns = PyDict_New(); } if (unlikely(!ns)) return NULL; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; #if PY_VERSION_HEX >= 0x03030000 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; #else CYTHON_MAYBE_UNUSED_VAR(qualname); #endif if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc_2, doc) < 0)) goto bad; return ns; bad: Py_DECREF(ns); return NULL; } #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS static int __Pyx_SetNamesPEP487(PyObject *type_obj) { PyTypeObject *type = (PyTypeObject*) type_obj; PyObject *names_to_set, *key, *value, *set_name, *tmp; Py_ssize_t i = 0; #if CYTHON_USE_TYPE_SLOTS names_to_set = PyDict_Copy(type->tp_dict); #else { PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict_2); names_to_set = NULL; if (likely(d)) { PyObject *names_to_set = PyDict_New(); int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1; Py_DECREF(d); if (unlikely(ret < 0)) Py_CLEAR(names_to_set); } } #endif if (unlikely(names_to_set == NULL)) goto bad; while (PyDict_Next(names_to_set, &i, &key, &value)) { set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name); if (unlikely(set_name != NULL)) { tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key); Py_DECREF(set_name); if (unlikely(tmp == NULL)) { __Pyx_TypeName value_type_name = __Pyx_PyType_GetName(Py_TYPE(value)); __Pyx_TypeName type_name = __Pyx_PyType_GetName(type); PyErr_Format(PyExc_RuntimeError, #if PY_MAJOR_VERSION >= 3 "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'", value_type_name, key, type_name); #else "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'", value_type_name, PyString_Check(key) ? PyString_AS_STRING(key) : "?", type_name); #endif goto bad; } else { Py_DECREF(tmp); } } else if (unlikely(PyErr_Occurred())) { goto bad; } } Py_DECREF(names_to_set); return 0; bad: Py_XDECREF(names_to_set); return -1; } static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) { #if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS PyTypeObject *type = (PyTypeObject*) type_obj; PyObject *mro = type->tp_mro; Py_ssize_t i, nbases; if (unlikely(!mro)) goto done; (void) &__Pyx_GetBuiltinName; Py_INCREF(mro); nbases = PyTuple_GET_SIZE(mro); assert(PyTuple_GET_ITEM(mro, 0) == type_obj); for (i = 1; i < nbases-1; i++) { PyObject *base, *dict, *meth; base = PyTuple_GET_ITEM(mro, i); dict = ((PyTypeObject *)base)->tp_dict; meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass); if (unlikely(meth)) { descrgetfunc f = Py_TYPE(meth)->tp_descr_get; PyObject *res; Py_INCREF(meth); if (likely(f)) { res = f(meth, NULL, type_obj); Py_DECREF(meth); if (unlikely(!res)) goto bad; meth = res; } res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw); Py_DECREF(meth); if (unlikely(!res)) goto bad; Py_DECREF(res); goto done; } else if (unlikely(PyErr_Occurred())) { goto bad; } } done: Py_XDECREF(mro); return type_obj; bad: Py_XDECREF(mro); Py_DECREF(type_obj); return NULL; #else PyObject *super_type, *super, *func, *res; #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) super_type = __Pyx_GetBuiltinName(__pyx_n_s_super); #else super_type = (PyObject*) &PySuper_Type; (void) &__Pyx_GetBuiltinName; #endif super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL; #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) Py_XDECREF(super_type); #endif if (unlikely(!super)) { Py_CLEAR(type_obj); goto done; } func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass); Py_DECREF(super); if (likely(!func)) { if (unlikely(PyErr_Occurred())) Py_CLEAR(type_obj); goto done; } res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw); Py_DECREF(func); if (unlikely(!res)) Py_CLEAR(type_obj); Py_XDECREF(res); done: return type_obj; #endif } #endif static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass) { PyObject *result; PyObject *owned_metaclass = NULL; PyObject *margs[4] = {NULL, name, bases, dict}; if (allow_py2_metaclass) { owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { PyErr_Clear(); } else { return NULL; } } if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); Py_XDECREF(owned_metaclass); if (unlikely(!metaclass)) return NULL; owned_metaclass = metaclass; } result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, #if PY_VERSION_HEX < 0x030600A4 (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw #else mkw #endif ); Py_XDECREF(owned_metaclass); #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS if (likely(result) && likely(PyType_Check(result))) { if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) { Py_CLEAR(result); } else { result = __Pyx_InitSubclassPEP487(result, mkw); } } #else (void) &__Pyx_GetBuiltinName; #endif return result; } /* Py3UpdateBases */ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases) { Py_ssize_t i, j, size_bases; PyObject *base, *meth, *new_base, *result, *new_bases = NULL; size_bases = PyTuple_GET_SIZE(bases); for (i = 0; i < size_bases; i++) { base = PyTuple_GET_ITEM(bases, i); if (PyType_Check(base)) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { goto error; } } continue; } meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_n_s_mro_entries); if (!meth && PyErr_Occurred()) { goto error; } if (!meth) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { goto error; } } continue; } new_base = __Pyx_PyObject_CallOneArg(meth, bases); Py_DECREF(meth); if (!new_base) { goto error; } if (!PyTuple_Check(new_base)) { PyErr_SetString(PyExc_TypeError, "__mro_entries__ must return a tuple"); Py_DECREF(new_base); goto error; } if (!new_bases) { if (!(new_bases = PyList_New(i))) { goto error; } for (j = 0; j < i; j++) { base = PyTuple_GET_ITEM(bases, j); PyList_SET_ITEM(new_bases, j, base); Py_INCREF(base); } } j = PyList_GET_SIZE(new_bases); if (PyList_SetSlice(new_bases, j, j, new_base) < 0) { goto error; } Py_DECREF(new_base); } if (!new_bases) { Py_INCREF(bases); return bases; } result = PyList_AsTuple(new_bases); Py_DECREF(new_bases); return result; error: Py_XDECREF(new_bases); return NULL; } /* ClassMethod */ static PyObject* __Pyx_Method_ClassMethod(PyObject *method) { #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM <= 0x05080000 if (PyObject_TypeCheck(method, &PyWrapperDescr_Type)) { return PyClassMethod_New(method); } #else #if CYTHON_COMPILING_IN_PYPY if (PyMethodDescr_Check(method)) #else #if PY_MAJOR_VERSION == 2 static PyTypeObject *methoddescr_type = NULL; if (unlikely(methoddescr_type == NULL)) { PyObject *meth = PyObject_GetAttrString((PyObject*)&PyList_Type, "append"); if (unlikely(!meth)) return NULL; methoddescr_type = Py_TYPE(meth); Py_DECREF(meth); } #else PyTypeObject *methoddescr_type = &PyMethodDescr_Type; #endif if (__Pyx_TypeCheck(method, methoddescr_type)) #endif { PyMethodDescrObject *descr = (PyMethodDescrObject *)method; #if PY_VERSION_HEX < 0x03020000 PyTypeObject *d_type = descr->d_type; #else PyTypeObject *d_type = descr->d_common.d_type; #endif return PyDescr_NewClassMethod(d_type, descr->d_method); } #endif else if (PyMethod_Check(method)) { return PyClassMethod_New(PyMethod_GET_FUNCTION(method)); } else { return PyClassMethod_New(method); } } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__81); } return name; } #endif /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (long) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (long) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = __Pyx_NewRef(v); } val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (int) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (int) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = __Pyx_NewRef(v); } val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; tmp_value = exc_info->exc_value; exc_info->exc_value = *value; if (tmp_value == NULL || tmp_value == Py_None) { Py_XDECREF(tmp_value); tmp_value = NULL; tmp_type = NULL; tmp_tb = NULL; } else { tmp_type = (PyObject*) Py_TYPE(tmp_value); Py_INCREF(tmp_type); #if CYTHON_COMPILING_IN_CPYTHON tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback; Py_XINCREF(tmp_tb); #else tmp_tb = PyException_GetTraceback(tmp_value); #endif } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = *type; exc_info->exc_value = *value; exc_info->exc_traceback = *tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = *type; tstate->exc_value = *value; tstate->exc_traceback = *tb; #endif *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); PyErr_SetExcInfo(*type, *value, *tb); *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #endif /* CoroutineBase */ #include #if PY_VERSION_HEX >= 0x030b00a6 #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyObject **pvalue) { PyObject *et, *ev, *tb; PyObject *value = NULL; CYTHON_UNUSED_VAR(__pyx_tstate); __Pyx_ErrFetch(&et, &ev, &tb); if (!et) { Py_XDECREF(tb); Py_XDECREF(ev); Py_INCREF(Py_None); *pvalue = Py_None; return 0; } if (likely(et == PyExc_StopIteration)) { if (!ev) { Py_INCREF(Py_None); value = Py_None; } #if PY_VERSION_HEX >= 0x030300A0 else if (likely(__Pyx_IS_TYPE(ev, (PyTypeObject*)PyExc_StopIteration))) { value = ((PyStopIterationObject *)ev)->value; Py_INCREF(value); Py_DECREF(ev); } #endif else if (unlikely(PyTuple_Check(ev))) { if (PyTuple_GET_SIZE(ev) >= 1) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS value = PyTuple_GET_ITEM(ev, 0); Py_INCREF(value); #else value = PySequence_ITEM(ev, 0); #endif } else { Py_INCREF(Py_None); value = Py_None; } Py_DECREF(ev); } else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) { value = ev; } if (likely(value)) { Py_XDECREF(tb); Py_DECREF(et); *pvalue = value; return 0; } } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) { __Pyx_ErrRestore(et, ev, tb); return -1; } PyErr_NormalizeException(&et, &ev, &tb); if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) { __Pyx_ErrRestore(et, ev, tb); return -1; } Py_XDECREF(tb); Py_DECREF(et); #if PY_VERSION_HEX >= 0x030300A0 value = ((PyStopIterationObject *)ev)->value; Py_INCREF(value); Py_DECREF(ev); #else { PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args); Py_DECREF(ev); if (likely(args)) { value = PySequence_GetItem(args, 0); Py_DECREF(args); } if (unlikely(!value)) { __Pyx_ErrRestore(NULL, NULL, NULL); Py_INCREF(Py_None); value = Py_None; } } #endif *pvalue = value; return 0; } static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) { #if PY_VERSION_HEX >= 0x030B00a4 Py_CLEAR(exc_state->exc_value); #else PyObject *t, *v, *tb; t = exc_state->exc_type; v = exc_state->exc_value; tb = exc_state->exc_traceback; exc_state->exc_type = NULL; exc_state->exc_value = NULL; exc_state->exc_traceback = NULL; Py_XDECREF(t); Py_XDECREF(v); Py_XDECREF(tb); #endif } #define __Pyx_Coroutine_AlreadyRunningError(gen) (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL) static void __Pyx__Coroutine_AlreadyRunningError(__pyx_CoroutineObject *gen) { const char *msg; CYTHON_MAYBE_UNUSED_VAR(gen); if ((0)) { #ifdef __Pyx_Coroutine_USED } else if (__Pyx_Coroutine_Check((PyObject*)gen)) { msg = "coroutine already executing"; #endif #ifdef __Pyx_AsyncGen_USED } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) { msg = "async generator already executing"; #endif } else { msg = "generator already executing"; } PyErr_SetString(PyExc_ValueError, msg); } #define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL) static void __Pyx__Coroutine_NotStartedError(PyObject *gen) { const char *msg; CYTHON_MAYBE_UNUSED_VAR(gen); if ((0)) { #ifdef __Pyx_Coroutine_USED } else if (__Pyx_Coroutine_Check(gen)) { msg = "can't send non-None value to a just-started coroutine"; #endif #ifdef __Pyx_AsyncGen_USED } else if (__Pyx_AsyncGen_CheckExact(gen)) { msg = "can't send non-None value to a just-started async generator"; #endif } else { msg = "can't send non-None value to a just-started generator"; } PyErr_SetString(PyExc_TypeError, msg); } #define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL) static void __Pyx__Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *value, int closing) { CYTHON_MAYBE_UNUSED_VAR(gen); CYTHON_MAYBE_UNUSED_VAR(closing); #ifdef __Pyx_Coroutine_USED if (!closing && __Pyx_Coroutine_Check(gen)) { PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine"); } else #endif if (value) { #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(gen)) PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration); else #endif PyErr_SetNone(PyExc_StopIteration); } } static PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) { __Pyx_PyThreadState_declare PyThreadState *tstate; __Pyx_ExcInfoStruct *exc_state; PyObject *retval; assert(!self->is_running); if (unlikely(self->resume_label == 0)) { if (unlikely(value && value != Py_None)) { return __Pyx_Coroutine_NotStartedError((PyObject*)self); } } if (unlikely(self->resume_label == -1)) { return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing); } #if CYTHON_FAST_THREAD_STATE __Pyx_PyThreadState_assign tstate = __pyx_tstate; #else tstate = __Pyx_PyThreadState_Current; #endif exc_state = &self->gi_exc_state; if (exc_state->exc_value) { #if CYTHON_COMPILING_IN_PYPY #else PyObject *exc_tb; #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON exc_tb = PyException_GetTraceback(exc_state->exc_value); #elif PY_VERSION_HEX >= 0x030B00a4 exc_tb = ((PyBaseExceptionObject*) exc_state->exc_value)->traceback; #else exc_tb = exc_state->exc_traceback; #endif if (exc_tb) { PyTracebackObject *tb = (PyTracebackObject *) exc_tb; PyFrameObject *f = tb->tb_frame; assert(f->f_back == NULL); #if PY_VERSION_HEX >= 0x030B00A1 f->f_back = PyThreadState_GetFrame(tstate); #else Py_XINCREF(tstate->frame); f->f_back = tstate->frame; #endif #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON Py_DECREF(exc_tb); #endif } #endif } #if CYTHON_USE_EXC_INFO_STACK exc_state->previous_item = tstate->exc_info; tstate->exc_info = exc_state; #else if (exc_state->exc_type) { __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback); } else { __Pyx_Coroutine_ExceptionClear(exc_state); __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback); } #endif self->is_running = 1; retval = self->body(self, tstate, value); self->is_running = 0; #if CYTHON_USE_EXC_INFO_STACK exc_state = &self->gi_exc_state; tstate->exc_info = exc_state->previous_item; exc_state->previous_item = NULL; __Pyx_Coroutine_ResetFrameBackpointer(exc_state); #endif return retval; } static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) { #if CYTHON_COMPILING_IN_PYPY CYTHON_UNUSED_VAR(exc_state); #else PyObject *exc_tb; #if PY_VERSION_HEX >= 0x030B00a4 if (!exc_state->exc_value) return; exc_tb = PyException_GetTraceback(exc_state->exc_value); #else exc_tb = exc_state->exc_traceback; #endif if (likely(exc_tb)) { PyTracebackObject *tb = (PyTracebackObject *) exc_tb; PyFrameObject *f = tb->tb_frame; Py_CLEAR(f->f_back); #if PY_VERSION_HEX >= 0x030B00a4 Py_DECREF(exc_tb); #endif } #endif } static CYTHON_INLINE PyObject *__Pyx_Coroutine_MethodReturn(PyObject* gen, PyObject *retval) { CYTHON_MAYBE_UNUSED_VAR(gen); if (unlikely(!retval)) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (!__Pyx_PyErr_Occurred()) { PyObject *exc = PyExc_StopIteration; #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(gen)) exc = __Pyx_PyExc_StopAsyncIteration; #endif __Pyx_PyErr_SetNone(exc); } } return retval; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) static CYTHON_INLINE PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) { #if PY_VERSION_HEX <= 0x030A00A1 return _PyGen_Send(gen, arg); #else PyObject *result; if (PyIter_Send((PyObject*)gen, arg ? arg : Py_None, &result) == PYGEN_RETURN) { if (PyAsyncGen_CheckExact(gen)) { assert(result == Py_None); PyErr_SetNone(PyExc_StopAsyncIteration); } else if (result == Py_None) { PyErr_SetNone(PyExc_StopIteration); } else { #if PY_VERSION_HEX < 0x030d00A1 _PyGen_SetStopIterationValue(result); #else if (!PyTuple_Check(result) && !PyExceptionInstance_Check(result)) { PyErr_SetObject(PyExc_StopIteration, result); } else { PyObject *exc = __Pyx_PyObject_CallOneArg(PyExc_StopIteration, result); if (likely(exc != NULL)) { PyErr_SetObject(PyExc_StopIteration, exc); Py_DECREF(exc); } } #endif } Py_DECREF(result); result = NULL; } return result; #endif } #endif static CYTHON_INLINE PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) { PyObject *ret; PyObject *val = NULL; __Pyx_Coroutine_Undelegate(gen); __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val); ret = __Pyx_Coroutine_SendEx(gen, val, 0); Py_XDECREF(val); return ret; } static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) { PyObject *retval; __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; PyObject *yf = gen->yieldfrom; if (unlikely(gen->is_running)) return __Pyx_Coroutine_AlreadyRunningError(gen); if (yf) { PyObject *ret; gen->is_running = 1; #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { ret = __Pyx_Coroutine_Send(yf, value); } else #endif #ifdef __Pyx_Coroutine_USED if (__Pyx_Coroutine_Check(yf)) { ret = __Pyx_Coroutine_Send(yf, value); } else #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_PyAsyncGenASend_CheckExact(yf)) { ret = __Pyx_async_gen_asend_send(yf, value); } else #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) if (PyGen_CheckExact(yf)) { ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); } else #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) if (PyCoro_CheckExact(yf)) { ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); } else #endif { if (value == Py_None) ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf); else ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value); } gen->is_running = 0; if (likely(ret)) { return ret; } retval = __Pyx_Coroutine_FinishDelegation(gen); } else { retval = __Pyx_Coroutine_SendEx(gen, value, 0); } return __Pyx_Coroutine_MethodReturn(self, retval); } static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) { PyObject *retval = NULL; int err = 0; #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { retval = __Pyx_Coroutine_Close(yf); if (!retval) return -1; } else #endif #ifdef __Pyx_Coroutine_USED if (__Pyx_Coroutine_Check(yf)) { retval = __Pyx_Coroutine_Close(yf); if (!retval) return -1; } else if (__Pyx_CoroutineAwait_CheckExact(yf)) { retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL); if (!retval) return -1; } else #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_PyAsyncGenASend_CheckExact(yf)) { retval = __Pyx_async_gen_asend_close(yf, NULL); } else if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) { retval = __Pyx_async_gen_athrow_close(yf, NULL); } else #endif { PyObject *meth; gen->is_running = 1; meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_close); if (unlikely(!meth)) { if (unlikely(PyErr_Occurred())) { PyErr_WriteUnraisable(yf); } } else { retval = __Pyx_PyObject_CallNoArg(meth); Py_DECREF(meth); if (unlikely(!retval)) err = -1; } gen->is_running = 0; } Py_XDECREF(retval); return err; } static PyObject *__Pyx_Generator_Next(PyObject *self) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; PyObject *yf = gen->yieldfrom; if (unlikely(gen->is_running)) return __Pyx_Coroutine_AlreadyRunningError(gen); if (yf) { PyObject *ret; gen->is_running = 1; #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { ret = __Pyx_Generator_Next(yf); } else #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) if (PyGen_CheckExact(yf)) { ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL); } else #endif #ifdef __Pyx_Coroutine_USED if (__Pyx_Coroutine_Check(yf)) { ret = __Pyx_Coroutine_Send(yf, Py_None); } else #endif ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf); gen->is_running = 0; if (likely(ret)) { return ret; } return __Pyx_Coroutine_FinishDelegation(gen); } return __Pyx_Coroutine_SendEx(gen, Py_None, 0); } static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, PyObject *arg) { CYTHON_UNUSED_VAR(arg); return __Pyx_Coroutine_Close(self); } static PyObject *__Pyx_Coroutine_Close(PyObject *self) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; PyObject *retval, *raised_exception; PyObject *yf = gen->yieldfrom; int err = 0; if (unlikely(gen->is_running)) return __Pyx_Coroutine_AlreadyRunningError(gen); if (yf) { Py_INCREF(yf); err = __Pyx_Coroutine_CloseIter(gen, yf); __Pyx_Coroutine_Undelegate(gen); Py_DECREF(yf); } if (err == 0) PyErr_SetNone(PyExc_GeneratorExit); retval = __Pyx_Coroutine_SendEx(gen, NULL, 1); if (unlikely(retval)) { const char *msg; Py_DECREF(retval); if ((0)) { #ifdef __Pyx_Coroutine_USED } else if (__Pyx_Coroutine_Check(self)) { msg = "coroutine ignored GeneratorExit"; #endif #ifdef __Pyx_AsyncGen_USED } else if (__Pyx_AsyncGen_CheckExact(self)) { #if PY_VERSION_HEX < 0x03060000 msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)"; #else msg = "async generator ignored GeneratorExit"; #endif #endif } else { msg = "generator ignored GeneratorExit"; } PyErr_SetString(PyExc_RuntimeError, msg); return NULL; } raised_exception = PyErr_Occurred(); if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) { if (raised_exception) PyErr_Clear(); Py_INCREF(Py_None); return Py_None; } return NULL; } static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb, PyObject *args, int close_on_genexit) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; PyObject *yf = gen->yieldfrom; if (unlikely(gen->is_running)) return __Pyx_Coroutine_AlreadyRunningError(gen); if (yf) { PyObject *ret; Py_INCREF(yf); if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) { int err = __Pyx_Coroutine_CloseIter(gen, yf); Py_DECREF(yf); __Pyx_Coroutine_Undelegate(gen); if (err < 0) return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); goto throw_here; } gen->is_running = 1; if (0 #ifdef __Pyx_Generator_USED || __Pyx_Generator_CheckExact(yf) #endif #ifdef __Pyx_Coroutine_USED || __Pyx_Coroutine_Check(yf) #endif ) { ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit); #ifdef __Pyx_Coroutine_USED } else if (__Pyx_CoroutineAwait_CheckExact(yf)) { ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit); #endif } else { PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_throw); if (unlikely(!meth)) { Py_DECREF(yf); if (unlikely(PyErr_Occurred())) { gen->is_running = 0; return NULL; } __Pyx_Coroutine_Undelegate(gen); gen->is_running = 0; goto throw_here; } if (likely(args)) { ret = __Pyx_PyObject_Call(meth, args, NULL); } else { PyObject *cargs[4] = {NULL, typ, val, tb}; ret = __Pyx_PyObject_FastCall(meth, cargs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } Py_DECREF(meth); } gen->is_running = 0; Py_DECREF(yf); if (!ret) { ret = __Pyx_Coroutine_FinishDelegation(gen); } return __Pyx_Coroutine_MethodReturn(self, ret); } throw_here: __Pyx_Raise(typ, val, tb, NULL); return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); } static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) { PyObject *typ; PyObject *val = NULL; PyObject *tb = NULL; if (unlikely(!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))) return NULL; return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1); } static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) { #if PY_VERSION_HEX >= 0x030B00a4 Py_VISIT(exc_state->exc_value); #else Py_VISIT(exc_state->exc_type); Py_VISIT(exc_state->exc_value); Py_VISIT(exc_state->exc_traceback); #endif return 0; } static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) { Py_VISIT(gen->closure); Py_VISIT(gen->classobj); Py_VISIT(gen->yieldfrom); return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg); } static int __Pyx_Coroutine_clear(PyObject *self) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; Py_CLEAR(gen->closure); Py_CLEAR(gen->classobj); Py_CLEAR(gen->yieldfrom); __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state); #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(self)) { Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer); } #endif Py_CLEAR(gen->gi_code); Py_CLEAR(gen->gi_frame); Py_CLEAR(gen->gi_name); Py_CLEAR(gen->gi_qualname); Py_CLEAR(gen->gi_modulename); return 0; } static void __Pyx_Coroutine_dealloc(PyObject *self) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; PyObject_GC_UnTrack(gen); if (gen->gi_weakreflist != NULL) PyObject_ClearWeakRefs(self); if (gen->resume_label >= 0) { PyObject_GC_Track(self); #if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE if (unlikely(PyObject_CallFinalizerFromDealloc(self))) #else Py_TYPE(gen)->tp_del(self); if (unlikely(Py_REFCNT(self) > 0)) #endif { return; } PyObject_GC_UnTrack(self); } #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(self)) { /* We have to handle this case for asynchronous generators right here, because this code has to be between UNTRACK and GC_Del. */ Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer); } #endif __Pyx_Coroutine_clear(self); __Pyx_PyHeapTypeObject_GC_Del(gen); } static void __Pyx_Coroutine_del(PyObject *self) { PyObject *error_type, *error_value, *error_traceback; __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; __Pyx_PyThreadState_declare if (gen->resume_label < 0) { return; } #if !CYTHON_USE_TP_FINALIZE assert(self->ob_refcnt == 0); __Pyx_SET_REFCNT(self, 1); #endif __Pyx_PyThreadState_assign __Pyx_ErrFetch(&error_type, &error_value, &error_traceback); #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(self)) { __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self; PyObject *finalizer = agen->ag_finalizer; if (finalizer && !agen->ag_closed) { PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self); if (unlikely(!res)) { PyErr_WriteUnraisable(self); } else { Py_DECREF(res); } __Pyx_ErrRestore(error_type, error_value, error_traceback); return; } } #endif if (unlikely(gen->resume_label == 0 && !error_value)) { #ifdef __Pyx_Coroutine_USED #ifdef __Pyx_Generator_USED if (!__Pyx_Generator_CheckExact(self)) #endif { PyObject_GC_UnTrack(self); #if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat) if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0)) PyErr_WriteUnraisable(self); #else {PyObject *msg; char *cmsg; #if CYTHON_COMPILING_IN_PYPY msg = NULL; cmsg = (char*) "coroutine was never awaited"; #else char *cname; PyObject *qualname; qualname = gen->gi_qualname; cname = PyString_AS_STRING(qualname); msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname); if (unlikely(!msg)) { PyErr_Clear(); cmsg = (char*) "coroutine was never awaited"; } else { cmsg = PyString_AS_STRING(msg); } #endif if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0)) PyErr_WriteUnraisable(self); Py_XDECREF(msg);} #endif PyObject_GC_Track(self); } #endif } else { PyObject *res = __Pyx_Coroutine_Close(self); if (unlikely(!res)) { if (PyErr_Occurred()) PyErr_WriteUnraisable(self); } else { Py_DECREF(res); } } __Pyx_ErrRestore(error_type, error_value, error_traceback); #if !CYTHON_USE_TP_FINALIZE assert(Py_REFCNT(self) > 0); if (likely(--self->ob_refcnt == 0)) { return; } { Py_ssize_t refcnt = Py_REFCNT(self); _Py_NewReference(self); __Pyx_SET_REFCNT(self, refcnt); } #if CYTHON_COMPILING_IN_CPYTHON assert(PyType_IS_GC(Py_TYPE(self)) && _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED); _Py_DEC_REFTOTAL; #endif #ifdef COUNT_ALLOCS --Py_TYPE(self)->tp_frees; --Py_TYPE(self)->tp_allocs; #endif #endif } static PyObject * __Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, void *context) { PyObject *name = self->gi_name; CYTHON_UNUSED_VAR(context); if (unlikely(!name)) name = Py_None; Py_INCREF(name); return name; } static int __Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(self->gi_name, value); return 0; } static PyObject * __Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, void *context) { PyObject *name = self->gi_qualname; CYTHON_UNUSED_VAR(context); if (unlikely(!name)) name = Py_None; Py_INCREF(name); return name; } static int __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(self->gi_qualname, value); return 0; } static PyObject * __Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context) { PyObject *frame = self->gi_frame; CYTHON_UNUSED_VAR(context); if (!frame) { if (unlikely(!self->gi_code)) { Py_RETURN_NONE; } frame = (PyObject *) PyFrame_New( PyThreadState_Get(), /*PyThreadState *tstate,*/ (PyCodeObject*) self->gi_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (unlikely(!frame)) return NULL; self->gi_frame = frame; } Py_INCREF(frame); return frame; } static __pyx_CoroutineObject *__Pyx__Coroutine_New( PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, PyObject *name, PyObject *qualname, PyObject *module_name) { __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type); if (unlikely(!gen)) return NULL; return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name); } static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, PyObject *name, PyObject *qualname, PyObject *module_name) { gen->body = body; gen->closure = closure; Py_XINCREF(closure); gen->is_running = 0; gen->resume_label = 0; gen->classobj = NULL; gen->yieldfrom = NULL; #if PY_VERSION_HEX >= 0x030B00a4 gen->gi_exc_state.exc_value = NULL; #else gen->gi_exc_state.exc_type = NULL; gen->gi_exc_state.exc_value = NULL; gen->gi_exc_state.exc_traceback = NULL; #endif #if CYTHON_USE_EXC_INFO_STACK gen->gi_exc_state.previous_item = NULL; #endif gen->gi_weakreflist = NULL; Py_XINCREF(qualname); gen->gi_qualname = qualname; Py_XINCREF(name); gen->gi_name = name; Py_XINCREF(module_name); gen->gi_modulename = module_name; Py_XINCREF(code); gen->gi_code = code; gen->gi_frame = NULL; PyObject_GC_Track(gen); return gen; } /* PatchModuleWithCoroutine */ static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) { #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) int result; PyObject *globals, *result_obj; globals = PyDict_New(); if (unlikely(!globals)) goto ignore; result = PyDict_SetItemString(globals, "_cython_coroutine_type", #ifdef __Pyx_Coroutine_USED (PyObject*)__pyx_CoroutineType); #else Py_None); #endif if (unlikely(result < 0)) goto ignore; result = PyDict_SetItemString(globals, "_cython_generator_type", #ifdef __Pyx_Generator_USED (PyObject*)__pyx_GeneratorType); #else Py_None); #endif if (unlikely(result < 0)) goto ignore; if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore; if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore; result_obj = PyRun_String(py_code, Py_file_input, globals, globals); if (unlikely(!result_obj)) goto ignore; Py_DECREF(result_obj); Py_DECREF(globals); return module; ignore: Py_XDECREF(globals); PyErr_WriteUnraisable(module); if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) { Py_DECREF(module); module = NULL; } #else py_code++; #endif return module; } /* PatchGeneratorABC */ #ifndef CYTHON_REGISTER_ABCS #define CYTHON_REGISTER_ABCS 1 #endif #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) static PyObject* __Pyx_patch_abc_module(PyObject *module); static PyObject* __Pyx_patch_abc_module(PyObject *module) { module = __Pyx_Coroutine_patch_module( module, "" "if _cython_generator_type is not None:\n" " try: Generator = _module.Generator\n" " except AttributeError: pass\n" " else: Generator.register(_cython_generator_type)\n" "if _cython_coroutine_type is not None:\n" " try: Coroutine = _module.Coroutine\n" " except AttributeError: pass\n" " else: Coroutine.register(_cython_coroutine_type)\n" ); return module; } #endif static int __Pyx_patch_abc(void) { #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) static int abc_patched = 0; if (CYTHON_REGISTER_ABCS && !abc_patched) { PyObject *module; module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections"); if (unlikely(!module)) { PyErr_WriteUnraisable(NULL); if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, ((PY_MAJOR_VERSION >= 3) ? "Cython module failed to register with collections.abc module" : "Cython module failed to register with collections module"), 1) < 0)) { return -1; } } else { module = __Pyx_patch_abc_module(module); abc_patched = 1; if (unlikely(!module)) return -1; Py_DECREF(module); } module = PyImport_ImportModule("backports_abc"); if (module) { module = __Pyx_patch_abc_module(module); Py_XDECREF(module); } if (!module) { PyErr_Clear(); } } #else if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL); #endif return 0; } /* Generator */ static PyMethodDef __pyx_Generator_methods[] = { {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O, (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS, (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")}, {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS, (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")}, {0, 0, 0, 0} }; static PyMemberDef __pyx_Generator_memberlist[] = { {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL}, {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY, (char*) PyDoc_STR("object being iterated by 'yield from', or None")}, {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL}, {(char *) "__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0}, #if CYTHON_USE_TYPE_SPECS {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0}, #endif {0, 0, 0, 0, 0} }; static PyGetSetDef __pyx_Generator_getsets[] = { {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name, (char*) PyDoc_STR("name of the generator"), 0}, {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname, (char*) PyDoc_STR("qualified name of the generator"), 0}, {(char *) "gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL, (char*) PyDoc_STR("Frame of the generator"), 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_GeneratorType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_Coroutine_dealloc}, {Py_tp_traverse, (void *)__Pyx_Coroutine_traverse}, {Py_tp_iter, (void *)PyObject_SelfIter}, {Py_tp_iternext, (void *)__Pyx_Generator_Next}, {Py_tp_methods, (void *)__pyx_Generator_methods}, {Py_tp_members, (void *)__pyx_Generator_memberlist}, {Py_tp_getset, (void *)__pyx_Generator_getsets}, {Py_tp_getattro, (void *) __Pyx_PyObject_GenericGetAttrNoDict}, #if CYTHON_USE_TP_FINALIZE {Py_tp_finalize, (void *)__Pyx_Coroutine_del}, #endif {0, 0}, }; static PyType_Spec __pyx_GeneratorType_spec = { __PYX_TYPE_MODULE_PREFIX "generator", sizeof(__pyx_CoroutineObject), 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, __pyx_GeneratorType_slots }; #else static PyTypeObject __pyx_GeneratorType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "generator", sizeof(__pyx_CoroutineObject), 0, (destructor) __Pyx_Coroutine_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, 0, (traverseproc) __Pyx_Coroutine_traverse, 0, 0, offsetof(__pyx_CoroutineObject, gi_weakreflist), 0, (iternextfunc) __Pyx_Generator_Next, __pyx_Generator_methods, __pyx_Generator_memberlist, __pyx_Generator_getsets, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if CYTHON_USE_TP_FINALIZE 0, #else __Pyx_Coroutine_del, #endif 0, #if CYTHON_USE_TP_FINALIZE __Pyx_Coroutine_del, #elif PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_Generator_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_GeneratorType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter; __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type); #endif if (unlikely(!__pyx_GeneratorType)) { return -1; } return 0; } /* CheckBinaryVersion */ static unsigned long __Pyx_get_runtime_version(void) { #if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/item.pyx0000644000076500000240000006115014641074756015451 0ustar00twstaffimport stat from collections import namedtuple from .constants import ITEM_KEYS, ARCHIVE_KEYS from .helpers import safe_encode, safe_decode from .helpers import bigint_to_int, int_to_bigint from .helpers import StableDict from .helpers import format_file_size from .helpers.time import OutputTimestamp, safe_timestamp cdef extern from "_item.c": object _object_to_optr(object obj) object _optr_to_object(object bytes) API_VERSION = '1.4_01' class PropDict: """ Manage a dictionary via properties. - initialization by giving a dict or kw args - on initialization, normalize dict keys to be str type - access dict via properties, like: x.key_name - membership check via: 'key_name' in x - optionally, encode when setting a value - optionally, decode when getting a value - be safe against typos in key names: check against VALID_KEYS - when setting a value: check type of value When "packing" a dict, ie. you have a dict with some data and want to convert it into an instance, then use eg. Item({'a': 1, ...}). This way all keys in your dictionary are validated. When "unpacking", that is you've read a dictionary with some data from somewhere (eg. msgpack), then use eg. Item(internal_dict={...}). This does not validate the keys, therefore unknown keys are ignored instead of causing an error. """ VALID_KEYS = None # override with in child class __slots__ = ("_dict", ) # avoid setting attributes not supported by properties def __init__(self, data_dict=None, internal_dict=None, **kw): self._dict = {} if internal_dict is None: pass # nothing to do elif isinstance(internal_dict, dict): self.update_internal(internal_dict) else: raise TypeError("internal_dict must be a dict") if data_dict is None: data = kw elif isinstance(data_dict, dict): data = data_dict else: raise TypeError("data_dict must be a dict") if data: self.update(data) def update(self, d): for k, v in d.items(): if isinstance(k, bytes): k = k.decode() setattr(self, self._check_key(k), v) def update_internal(self, d): for k, v in d.items(): if isinstance(k, bytes): k = k.decode() self._dict[k] = v def __eq__(self, other): return self.as_dict() == other.as_dict() def __repr__(self): return '%s(internal_dict=%r)' % (self.__class__.__name__, self._dict) def as_dict(self): """return the internal dictionary""" return StableDict(self._dict) def _check_key(self, key): """make sure key is of type str and known""" if not isinstance(key, str): raise TypeError("key must be str") if key not in self.VALID_KEYS: raise ValueError("key '%s' is not a valid key" % key) return key def __contains__(self, key): """do we have this key?""" return self._check_key(key) in self._dict def get(self, key, default=None): """get value for key, return default if key does not exist""" return getattr(self, self._check_key(key), default) @staticmethod def _make_property(key, value_type, value_type_name=None, encode=None, decode=None): """return a property that deals with self._dict[key]""" assert isinstance(key, str) if value_type_name is None: value_type_name = value_type.__name__ doc = "%s (%s)" % (key, value_type_name) type_error_msg = "%s value must be %s" % (key, value_type_name) attr_error_msg = "attribute %s not found" % key def _get(self): try: value = self._dict[key] except KeyError: raise AttributeError(attr_error_msg) from None if decode is not None: value = decode(value) return value def _set(self, value): if not isinstance(value, value_type): raise TypeError(type_error_msg) if encode is not None: value = encode(value) self._dict[key] = value def _del(self): try: del self._dict[key] except KeyError: raise AttributeError(attr_error_msg) from None return property(_get, _set, _del, doc=doc) ChunkListEntry = namedtuple('ChunkListEntry', 'id size csize') class Item(PropDict): """ Item abstraction that deals with validation and the low-level details internally: Items are created either from msgpack unpacker output, from another dict, from kwargs or built step-by-step by setting attributes. msgpack gives us a dict with bytes-typed keys, just give it to Item(internal_dict=d) and use item.key_name later. msgpack gives us byte-typed values for stuff that should be str, we automatically decode when getting such a property and encode when setting it. If an Item shall be serialized, give as_dict() method output to msgpack packer. A bug in Attic up to and including release 0.13 added a (meaningless) 'acl' key to every item. We must never re-use this key. See test_attic013_acl_bug for details. """ VALID_KEYS = ITEM_KEYS | {'deleted', 'nlink', } # str-typed keys __slots__ = ("_dict", ) # avoid setting attributes not supported by properties # properties statically defined, so that IDEs can know their names: path = PropDict._make_property('path', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) source = PropDict._make_property('source', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) user = PropDict._make_property('user', (str, type(None)), 'surrogate-escaped str or None', encode=safe_encode, decode=safe_decode) group = PropDict._make_property('group', (str, type(None)), 'surrogate-escaped str or None', encode=safe_encode, decode=safe_decode) acl_access = PropDict._make_property('acl_access', bytes) acl_default = PropDict._make_property('acl_default', bytes) acl_extended = PropDict._make_property('acl_extended', bytes) acl_nfs4 = PropDict._make_property('acl_nfs4', bytes) mode = PropDict._make_property('mode', int) uid = PropDict._make_property('uid', int) gid = PropDict._make_property('gid', int) rdev = PropDict._make_property('rdev', int) bsdflags = PropDict._make_property('bsdflags', int) # note: we need to keep the bigint conversion for compatibility with borg 1.0 archives. atime = PropDict._make_property('atime', int, 'bigint', encode=int_to_bigint, decode=bigint_to_int) ctime = PropDict._make_property('ctime', int, 'bigint', encode=int_to_bigint, decode=bigint_to_int) mtime = PropDict._make_property('mtime', int, 'bigint', encode=int_to_bigint, decode=bigint_to_int) birthtime = PropDict._make_property('birthtime', int, 'bigint', encode=int_to_bigint, decode=bigint_to_int) # size is only present for items with a chunk list and then it is sum(chunk_sizes) # compatibility note: this is a new feature, in old archives size will be missing. size = PropDict._make_property('size', int) hardlink_master = PropDict._make_property('hardlink_master', bool) chunks = PropDict._make_property('chunks', (list, type(None)), 'list or None') chunks_healthy = PropDict._make_property('chunks_healthy', (list, type(None)), 'list or None') xattrs = PropDict._make_property('xattrs', StableDict) deleted = PropDict._make_property('deleted', bool) nlink = PropDict._make_property('nlink', int) part = PropDict._make_property('part', int) def get_size(self, hardlink_masters=None, memorize=False, compressed=False, from_chunks=False, consider_ids=None): """ Determine the (uncompressed or compressed) size of this item. :param hardlink_masters: If given, the size of hardlink slaves is computed via the hardlink master's chunk list, otherwise size will be returned as 0. :param memorize: Whether the computed size value will be stored into the item. :param compressed: Whether the compressed or uncompressed size will be returned. :param from_chunks: If true, size is computed from chunks even if a precomputed value is available. :param consider_ids: Returns the size of the given ids only. """ attr = 'csize' if compressed else 'size' assert not (compressed and memorize), 'Item does not have a csize field.' assert not (consider_ids is not None and memorize), "Can't store size when considering only certain ids" try: if from_chunks or consider_ids is not None: raise AttributeError size = getattr(self, attr) except AttributeError: if stat.S_ISLNK(self.mode): # get out of here quickly. symlinks have no own chunks, their fs size is the length of the target name. # also, there is the dual-use issue of .source (#2343), so don't confuse it with a hardlink slave. return len(self.source) # no precomputed (c)size value available, compute it: try: chunks = getattr(self, 'chunks') having_chunks = True except AttributeError: having_chunks = False # this item has no (own) chunks list, but if this is a hardlink slave # and we know the master, we can still compute the size. if hardlink_masters is None: chunks = None else: try: master = getattr(self, 'source') except AttributeError: # not a hardlink slave, likely a directory or special file w/o chunks chunks = None else: # hardlink slave, try to fetch hardlink master's chunks list # todo: put precomputed size into hardlink_masters' values and use it, if present chunks, _ = hardlink_masters.get(master, (None, None)) if chunks is None: return 0 if consider_ids is not None: size = sum(getattr(ChunkListEntry(*chunk), attr) for chunk in chunks if chunk.id in consider_ids) else: size = sum(getattr(ChunkListEntry(*chunk), attr) for chunk in chunks) # if requested, memorize the precomputed (c)size for items that have an own chunks list: if memorize and having_chunks: setattr(self, attr, size) return size def to_optr(self): """ Return an "object pointer" (optr), an opaque bag of bytes. The return value is effectively a reference to this object that can be passed exactly once to Item.from_optr to get this object back. to_optr/from_optr must be used symmetrically, don't call from_optr multiple times. This object can't be deallocated after a call to to_optr() until from_optr() is called. """ return _object_to_optr(self) @classmethod def from_optr(self, optr): return _optr_to_object(optr) @classmethod def create_deleted(cls, path): return cls(deleted=True, chunks=[], mode=0, path=path) def is_link(self): return self._is_type(stat.S_ISLNK) def is_dir(self): return self._is_type(stat.S_ISDIR) def is_fifo(self): return self._is_type(stat.S_ISFIFO) def is_blk(self): return self._is_type(stat.S_ISBLK) def is_chr(self): return self._is_type(stat.S_ISCHR) def _is_type(self, typetest): try: return typetest(self.mode) except AttributeError: return False class EncryptedKey(PropDict): """ EncryptedKey abstraction that deals with validation and the low-level details internally: A EncryptedKey is created either from msgpack unpacker output, from another dict, from kwargs or built step-by-step by setting attributes. msgpack gives us a dict with bytes-typed keys, just give it to EncryptedKey(d) and use enc_key.xxx later. If a EncryptedKey shall be serialized, give as_dict() method output to msgpack packer. """ VALID_KEYS = {'version', 'algorithm', 'iterations', 'salt', 'hash', 'data'} # str-typed keys __slots__ = ("_dict", ) # avoid setting attributes not supported by properties version = PropDict._make_property('version', int) algorithm = PropDict._make_property('algorithm', str, encode=str.encode, decode=bytes.decode) iterations = PropDict._make_property('iterations', int) salt = PropDict._make_property('salt', bytes) hash = PropDict._make_property('hash', bytes) data = PropDict._make_property('data', bytes) class Key(PropDict): """ Key abstraction that deals with validation and the low-level details internally: A Key is created either from msgpack unpacker output, from another dict, from kwargs or built step-by-step by setting attributes. msgpack gives us a dict with bytes-typed keys, just give it to Key(d) and use key.xxx later. If a Key shall be serialized, give as_dict() method output to msgpack packer. """ VALID_KEYS = {'version', 'repository_id', 'enc_key', 'enc_hmac_key', 'id_key', 'chunk_seed', 'tam_required'} # str-typed keys __slots__ = ("_dict", ) # avoid setting attributes not supported by properties version = PropDict._make_property('version', int) repository_id = PropDict._make_property('repository_id', bytes) enc_key = PropDict._make_property('enc_key', bytes) enc_hmac_key = PropDict._make_property('enc_hmac_key', bytes) id_key = PropDict._make_property('id_key', bytes) chunk_seed = PropDict._make_property('chunk_seed', int) tam_required = PropDict._make_property('tam_required', bool) def tuple_encode(t): """encode a tuple that might contain str items""" # we have str, but want to give bytes to msgpack.pack return tuple(safe_encode(e) if isinstance(e, str) else e for e in t) def tuple_decode(t): """decode a tuple that might contain bytes items""" # we get bytes objects from msgpack.unpack, but want str return tuple(safe_decode(e) if isinstance(e, bytes) else e for e in t) class ArchiveItem(PropDict): """ ArchiveItem abstraction that deals with validation and the low-level details internally: An ArchiveItem is created either from msgpack unpacker output, from another dict, from kwargs or built step-by-step by setting attributes. msgpack gives us a dict with bytes-typed keys, just give it to ArchiveItem(d) and use arch.xxx later. If a ArchiveItem shall be serialized, give as_dict() method output to msgpack packer. """ VALID_KEYS = ARCHIVE_KEYS # str-typed keys __slots__ = ("_dict", ) # avoid setting attributes not supported by properties version = PropDict._make_property('version', int) name = PropDict._make_property('name', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) items = PropDict._make_property('items', list) cmdline = PropDict._make_property('cmdline', list) # list of s-e-str hostname = PropDict._make_property('hostname', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) username = PropDict._make_property('username', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) time = PropDict._make_property('time', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) time_end = PropDict._make_property('time_end', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) comment = PropDict._make_property('comment', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) chunker_params = PropDict._make_property('chunker_params', tuple, 'chunker-params tuple', encode=tuple_encode, decode=tuple_decode) recreate_cmdline = PropDict._make_property('recreate_cmdline', list) # list of s-e-str # recreate_source_id, recreate_args, recreate_partial_chunks were used in 1.1.0b1 .. b2 recreate_source_id = PropDict._make_property('recreate_source_id', bytes) recreate_args = PropDict._make_property('recreate_args', list) # list of s-e-str recreate_partial_chunks = PropDict._make_property('recreate_partial_chunks', list) # list of tuples size = PropDict._make_property('size', int) csize = PropDict._make_property('csize', int) nfiles = PropDict._make_property('nfiles', int) size_parts = PropDict._make_property('size_parts', int) csize_parts = PropDict._make_property('csize_parts', int) nfiles_parts = PropDict._make_property('nfiles_parts', int) class ManifestItem(PropDict): """ ManifestItem abstraction that deals with validation and the low-level details internally: A ManifestItem is created either from msgpack unpacker output, from another dict, from kwargs or built step-by-step by setting attributes. msgpack gives us a dict with bytes-typed keys, just give it to ManifestItem(d) and use manifest.xxx later. If a ManifestItem shall be serialized, give as_dict() method output to msgpack packer. """ VALID_KEYS = {'version', 'archives', 'timestamp', 'config', 'item_keys', } # str-typed keys __slots__ = ("_dict", ) # avoid setting attributes not supported by properties version = PropDict._make_property('version', int) archives = PropDict._make_property('archives', dict) # name -> dict timestamp = PropDict._make_property('timestamp', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) config = PropDict._make_property('config', dict) item_keys = PropDict._make_property('item_keys', tuple) class ItemDiff: """ Comparison of two items from different archives. The items may have different paths and still be considered equal (e.g. for renames). It does not include extended or time attributes in the comparison. """ def __init__(self, item1, item2, chunk_iterator1, chunk_iterator2, numeric_ids=False, can_compare_chunk_ids=False, content_only=False): self._item1 = item1 self._item2 = item2 self._content_only = content_only self._numeric_ids = numeric_ids self._can_compare_chunk_ids = can_compare_chunk_ids self.equal = self._equal(chunk_iterator1, chunk_iterator2) changes = [] if self._item1.is_link() or self._item2.is_link(): changes.append(self._link_diff()) if 'chunks' in self._item1 and 'chunks' in self._item2: changes.append(self._content_diff()) if self._item1.is_dir() or self._item2.is_dir(): changes.append(self._presence_diff('directory')) if self._item1.is_blk() or self._item2.is_blk(): changes.append(self._presence_diff('blkdev')) if self._item1.is_chr() or self._item2.is_chr(): changes.append(self._presence_diff('chrdev')) if self._item1.is_fifo() or self._item2.is_fifo(): changes.append(self._presence_diff('fifo')) if not (self._item1.get('deleted') or self._item2.get('deleted')) and not self._content_only: changes.append(self._owner_diff()) changes.append(self._mode_diff()) changes.extend(self._time_diffs()) # filter out empty changes self._changes = [ch for ch in changes if ch] def changes(self): return self._changes def __repr__(self): if self.equal: return 'equal' return ' '.join(str for d,str in self._changes) def _equal(self, chunk_iterator1, chunk_iterator2): # if both are deleted, there is nothing at path regardless of what was deleted if self._item1.get('deleted') and self._item2.get('deleted'): return True attr_list = ['deleted', 'source'] if not self._content_only: attr_list += ['mode', 'ctime', 'mtime'] attr_list += ['uid', 'gid'] if self._numeric_ids else ['user', 'group'] for attr in attr_list: if self._item1.get(attr) != self._item2.get(attr): return False if 'mode' in self._item1: # mode of item1 and item2 is equal if (self._item1.is_link() and 'source' in self._item1 and 'source' in self._item2 and self._item1.source != self._item2.source): return False if 'chunks' in self._item1 and 'chunks' in self._item2: return self._content_equal(chunk_iterator1, chunk_iterator2) return True def _presence_diff(self, item_type): if not self._item1.get('deleted') and self._item2.get('deleted'): chg = 'removed ' + item_type return ({"type": chg}, chg) if self._item1.get('deleted') and not self._item2.get('deleted'): chg = 'added ' + item_type return ({"type": chg}, chg) def _link_diff(self): pd = self._presence_diff('link') if pd is not None: return pd if 'source' in self._item1 and 'source' in self._item2 and self._item1.source != self._item2.source: return ({"type": 'changed link'}, 'changed link') def _content_diff(self): if self._item1.get('deleted'): sz = self._item2.get_size() return ({"type": "added", "size": sz}, 'added {:>13}'.format(format_file_size(sz))) if self._item2.get('deleted'): sz = self._item1.get_size() return ({"type": "removed", "size": sz}, 'removed {:>11}'.format(format_file_size(sz))) if not self._can_compare_chunk_ids: return ({"type": "modified"}, "modified") chunk_ids1 = {c.id for c in self._item1.chunks} chunk_ids2 = {c.id for c in self._item2.chunks} added_ids = chunk_ids2 - chunk_ids1 removed_ids = chunk_ids1 - chunk_ids2 added = self._item2.get_size(consider_ids=added_ids) removed = self._item1.get_size(consider_ids=removed_ids) return ({"type": "modified", "added": added, "removed": removed}, '{:>9} {:>9}'.format(format_file_size(added, precision=1, sign=True), format_file_size(-removed, precision=1, sign=True))) def _owner_diff(self): u_attr, g_attr = ('uid', 'gid') if self._numeric_ids else ('user', 'group') u1, g1 = self._item1.get(u_attr), self._item1.get(g_attr) u2, g2 = self._item2.get(u_attr), self._item2.get(g_attr) if (u1, g1) != (u2, g2): return ({"type": "owner", "old_user": u1, "old_group": g1, "new_user": u2, "new_group": g2}, '[{}:{} -> {}:{}]'.format(u1, g1, u2, g2)) def _mode_diff(self): if 'mode' in self._item1 and 'mode' in self._item2 and self._item1.mode != self._item2.mode: mode1 = stat.filemode(self._item1.mode) mode2 = stat.filemode(self._item2.mode) return ({"type": "mode", "old_mode": mode1, "new_mode": mode2}, '[{} -> {}]'.format(mode1, mode2)) def _time_diffs(self): changes = [] attrs = ["ctime", "mtime"] for attr in attrs: if attr in self._item1 and attr in self._item2 and self._item1.get(attr) != self._item2.get(attr): ts1 = OutputTimestamp(safe_timestamp(self._item1.get(attr))) ts2 = OutputTimestamp(safe_timestamp(self._item2.get(attr))) changes.append(({"type": attr, f"old_{attr}": ts1, f"new_{attr}": ts2}, '[{}: {} -> {}]'.format(attr, ts1, ts2))) return changes def _content_equal(self, chunk_iterator1, chunk_iterator2): if self._can_compare_chunk_ids: return self._item1.chunks == self._item2.chunks if self._item1.get_size() != self._item2.get_size(): return False return chunks_contents_equal(chunk_iterator1, chunk_iterator2) def chunks_contents_equal(chunks1, chunks2): """ Compare chunk content and return True if they are identical. The chunks must be given as chunk iterators (like returned by :meth:`.DownloadPipeline.fetch_many`). """ end = object() alen = ai = 0 blen = bi = 0 while True: if not alen - ai: a = next(chunks1, end) if a is end: return not blen - bi and next(chunks2, end) is end a = memoryview(a) alen = len(a) ai = 0 if not blen - bi: b = next(chunks2, end) if b is end: return not alen - ai and next(chunks1, end) is end b = memoryview(b) blen = len(b) bi = 0 slicelen = min(alen - ai, blen - bi) if a[ai:ai + slicelen] != b[bi:bi + slicelen]: return False ai += slicelen bi += slicelen ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/locking.py0000644000076500000240000004025114641074756015750 0ustar00twstaffimport errno import json import os import tempfile import time from . import platform from .helpers import Error, ErrorWithTraceback from .logger import create_logger ADD, REMOVE, REMOVE2 = 'add', 'remove', 'remove2' SHARED, EXCLUSIVE = 'shared', 'exclusive' logger = create_logger(__name__) class TimeoutTimer: """ A timer for timeout checks (can also deal with "never timeout"). It can also compute and optionally execute a reasonable sleep time (e.g. to avoid polling too often or to support thread/process rescheduling). """ def __init__(self, timeout=None, sleep=None): """ Initialize a timer. :param timeout: time out interval [s] or None (never timeout, wait forever) [default] :param sleep: sleep interval [s] (>= 0: do sleep call, <0: don't call sleep) or None (autocompute: use 10% of timeout [but not more than 60s], or 1s for "never timeout" mode) """ if timeout is not None and timeout < 0: raise ValueError("timeout must be >= 0") self.timeout_interval = timeout if sleep is None: if timeout is None: sleep = 1.0 else: sleep = min(60.0, timeout / 10.0) self.sleep_interval = sleep self.start_time = None self.end_time = None def __repr__(self): return "<{}: start={!r} end={!r} timeout={!r} sleep={!r}>".format( self.__class__.__name__, self.start_time, self.end_time, self.timeout_interval, self.sleep_interval) def start(self): self.start_time = time.time() if self.timeout_interval is not None: self.end_time = self.start_time + self.timeout_interval return self def sleep(self): if self.sleep_interval >= 0: time.sleep(self.sleep_interval) def timed_out(self): return self.end_time is not None and time.time() >= self.end_time def timed_out_or_sleep(self): if self.timed_out(): return True else: self.sleep() return False class LockError(Error): """Failed to acquire the lock {}.""" exit_mcode = 70 class LockErrorT(ErrorWithTraceback): """Failed to acquire the lock {}.""" exit_mcode = 71 class LockFailed(LockErrorT): """Failed to create/acquire the lock {} ({}).""" exit_mcode = 72 class LockTimeout(LockError): """Failed to create/acquire the lock {} (timeout).""" exit_mcode = 73 class NotLocked(LockErrorT): """Failed to release the lock {} (was not locked).""" exit_mcode = 74 class NotMyLock(LockErrorT): """Failed to release the lock {} (was/is locked, but not by me).""" exit_mcode = 75 class ExclusiveLock: """An exclusive Lock based on mkdir fs operation being atomic. If possible, try to use the contextmanager here like:: with ExclusiveLock(...) as lock: ... This makes sure the lock is released again if the block is left, no matter how (e.g. if an exception occurred). """ def __init__(self, path, timeout=None, sleep=None, id=None): self.timeout = timeout self.sleep = sleep self.path = os.path.abspath(path) self.id = id or platform.get_process_id() self.unique_name = os.path.join(self.path, "%s.%d-%x" % self.id) self.kill_stale_locks = True self.stale_warning_printed = False def __enter__(self): return self.acquire() def __exit__(self, *exc): self.release() def __repr__(self): return f"<{self.__class__.__name__}: {self.unique_name!r}>" def acquire(self, timeout=None, sleep=None): if timeout is None: timeout = self.timeout if sleep is None: sleep = self.sleep parent_path, base_name = os.path.split(self.path) unique_base_name = os.path.basename(self.unique_name) temp_path = None try: temp_path = tempfile.mkdtemp(".tmp", base_name + '.', parent_path) temp_unique_name = os.path.join(temp_path, unique_base_name) with open(temp_unique_name, "wb"): pass except OSError as err: raise LockFailed(self.path, str(err)) from None else: timer = TimeoutTimer(timeout, sleep).start() while True: try: os.replace(temp_path, self.path) except OSError: # already locked if self.by_me(): return self self.kill_stale_lock() if timer.timed_out_or_sleep(): raise LockTimeout(self.path) from None else: temp_path = None # see finally:-block below return self finally: if temp_path is not None: # Renaming failed for some reason, so temp_dir still exists and # should be cleaned up anyway. Try to clean up, but don't crash. try: os.unlink(temp_unique_name) except: pass try: os.rmdir(temp_path) except: pass def release(self): if not self.is_locked(): raise NotLocked(self.path) if not self.by_me(): raise NotMyLock(self.path) os.unlink(self.unique_name) try: os.rmdir(self.path) except OSError as err: if err.errno not in (errno.ENOTEMPTY, errno.EEXIST, errno.ENOENT): # EACCES or EIO or ... = we cannot operate anyway, so re-throw raise err # else: # Directory is not empty or doesn't exist any more. # this means we lost the race to somebody else -- which is ok. def is_locked(self): return os.path.exists(self.path) def by_me(self): return os.path.exists(self.unique_name) def kill_stale_lock(self): try: names = os.listdir(self.path) except FileNotFoundError: # another process did our job in the meantime. pass else: for name in names: try: host_pid, thread_str = name.rsplit('-', 1) host, pid_str = host_pid.rsplit('.', 1) pid = int(pid_str) thread = int(thread_str, 16) except ValueError: # Malformed lock name? Or just some new format we don't understand? logger.error("Found malformed lock %s in %s. Please check/fix manually.", name, self.path) return False if platform.process_alive(host, pid, thread): return False if not self.kill_stale_locks: if not self.stale_warning_printed: # Log this at warning level to hint the user at the ability logger.warning("Found stale lock %s, but not deleting because self.kill_stale_locks = False.", name) self.stale_warning_printed = True return False try: os.unlink(os.path.join(self.path, name)) logger.warning('Killed stale lock %s.', name) except OSError as err: if not self.stale_warning_printed: # This error will bubble up and likely result in locking failure logger.error('Found stale lock %s, but cannot delete due to %s', name, str(err)) self.stale_warning_printed = True return False try: os.rmdir(self.path) except OSError as err: if err.errno in (errno.ENOTEMPTY, errno.EEXIST, errno.ENOENT): # Directory is not empty or doesn't exist any more = we lost the race to somebody else--which is ok. return False # EACCES or EIO or ... = we cannot operate anyway logger.error('Failed to remove lock dir: %s', str(err)) return False return True def break_lock(self): if self.is_locked(): for name in os.listdir(self.path): os.unlink(os.path.join(self.path, name)) os.rmdir(self.path) def migrate_lock(self, old_id, new_id): """migrate the lock ownership from old_id to new_id""" assert self.id == old_id new_unique_name = os.path.join(self.path, "%s.%d-%x" % new_id) if self.is_locked() and self.by_me(): with open(new_unique_name, "wb"): pass os.unlink(self.unique_name) self.id, self.unique_name = new_id, new_unique_name class LockRoster: """ A Lock Roster to track shared/exclusive lockers. Note: you usually should call the methods with an exclusive lock held, to avoid conflicting access by multiple threads/processes/machines. """ def __init__(self, path, id=None): self.path = path self.id = id or platform.get_process_id() self.kill_stale_locks = True def load(self): try: with open(self.path) as f: data = json.load(f) # Just nuke the stale locks early on load if self.kill_stale_locks: for key in (SHARED, EXCLUSIVE): try: entries = data[key] except KeyError: continue elements = set() for host, pid, thread in entries: if platform.process_alive(host, pid, thread): elements.add((host, pid, thread)) else: logger.warning('Removed stale %s roster lock for host %s pid %d thread %d.', key, host, pid, thread) data[key] = list(elements) except (FileNotFoundError, ValueError): # no or corrupt/empty roster file? data = {} return data def save(self, data): with open(self.path, "w") as f: json.dump(data, f) def remove(self): try: os.unlink(self.path) except FileNotFoundError: pass def get(self, key): roster = self.load() return {tuple(e) for e in roster.get(key, [])} def empty(self, *keys): return all(not self.get(key) for key in keys) def modify(self, key, op): roster = self.load() try: elements = {tuple(e) for e in roster[key]} except KeyError: elements = set() if op == ADD: elements.add(self.id) elif op == REMOVE: # note: we ignore it if the element is already not present anymore. # this has been frequently seen in teardowns involving Repository.__del__ and Repository.__exit__. elements.discard(self.id) elif op == REMOVE2: # needed for callers that do not want to ignore. elements.remove(self.id) else: raise ValueError('Unknown LockRoster op %r' % op) roster[key] = list(list(e) for e in elements) self.save(roster) def migrate_lock(self, key, old_id, new_id): """migrate the lock ownership from old_id to new_id""" assert self.id == old_id # need to temporarily switch off stale lock killing as we want to # rather migrate than kill them (at least the one made by old_id). killing, self.kill_stale_locks = self.kill_stale_locks, False try: try: self.modify(key, REMOVE2) except KeyError: # entry was not there, so no need to add a new one, but still update our id self.id = new_id else: # old entry removed, update our id and add a updated entry self.id = new_id self.modify(key, ADD) finally: self.kill_stale_locks = killing class Lock: """ A Lock for a resource that can be accessed in a shared or exclusive way. Typically, write access to a resource needs an exclusive lock (1 writer, no one is allowed reading) and read access to a resource needs a shared lock (multiple readers are allowed). If possible, try to use the contextmanager here like:: with Lock(...) as lock: ... This makes sure the lock is released again if the block is left, no matter how (e.g. if an exception occurred). """ def __init__(self, path, exclusive=False, sleep=None, timeout=None, id=None): self.path = path self.is_exclusive = exclusive self.sleep = sleep self.timeout = timeout self.id = id or platform.get_process_id() # globally keeping track of shared and exclusive lockers: self._roster = LockRoster(path + '.roster', id=id) # an exclusive lock, used for: # - holding while doing roster queries / updates # - holding while the Lock itself is exclusive self._lock = ExclusiveLock(path + '.exclusive', id=id, timeout=timeout) def __enter__(self): return self.acquire() def __exit__(self, *exc): self.release() def __repr__(self): return f"<{self.__class__.__name__}: {self.id!r}>" def acquire(self, exclusive=None, remove=None, sleep=None): if exclusive is None: exclusive = self.is_exclusive sleep = sleep or self.sleep or 0.2 if exclusive: self._wait_for_readers_finishing(remove, sleep) self._roster.modify(EXCLUSIVE, ADD) else: with self._lock: if remove is not None: self._roster.modify(remove, REMOVE) self._roster.modify(SHARED, ADD) self.is_exclusive = exclusive return self def _wait_for_readers_finishing(self, remove, sleep): timer = TimeoutTimer(self.timeout, sleep).start() while True: self._lock.acquire() try: if remove is not None: self._roster.modify(remove, REMOVE) if len(self._roster.get(SHARED)) == 0: return # we are the only one and we keep the lock! # restore the roster state as before (undo the roster change): if remove is not None: self._roster.modify(remove, ADD) except: # avoid orphan lock when an exception happens here, e.g. Ctrl-C! self._lock.release() raise else: self._lock.release() if timer.timed_out_or_sleep(): raise LockTimeout(self.path) def release(self): if self.is_exclusive: self._roster.modify(EXCLUSIVE, REMOVE) if self._roster.empty(EXCLUSIVE, SHARED): self._roster.remove() self._lock.release() else: with self._lock: self._roster.modify(SHARED, REMOVE) if self._roster.empty(EXCLUSIVE, SHARED): self._roster.remove() def upgrade(self): # WARNING: if multiple read-lockers want to upgrade, it will deadlock because they # all will wait until the other read locks go away - and that won't happen. if not self.is_exclusive: self.acquire(exclusive=True, remove=SHARED) def downgrade(self): if self.is_exclusive: self.acquire(exclusive=False, remove=EXCLUSIVE) def got_exclusive_lock(self): return self.is_exclusive and self._lock.is_locked() and self._lock.by_me() def break_lock(self): self._roster.remove() self._lock.break_lock() def migrate_lock(self, old_id, new_id): assert self.id == old_id self.id = new_id if self.is_exclusive: self._lock.migrate_lock(old_id, new_id) self._roster.migrate_lock(EXCLUSIVE, old_id, new_id) else: with self._lock: self._lock.migrate_lock(old_id, new_id) self._roster.migrate_lock(SHARED, old_id, new_id) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/logger.py0000644000076500000240000002223214641074756015600 0ustar00twstaff"""logging facilities The way to use this is as follows: * each module declares its own logger, using: from .logger import create_logger logger = create_logger() * then each module uses logger.info/warning/debug/etc according to the level it believes is appropriate: logger.debug('debugging info for developers or power users') logger.info('normal, informational output') logger.warning('warn about a non-fatal error or sth else') logger.error('a fatal error') ... and so on. see the `logging documentation `_ for more information * console interaction happens on stderr, that includes interactive reporting functions like `help`, `info` and `list` * ...except ``input()`` is special, because we can't control the stream it is using, unfortunately. we assume that it won't clutter stdout, because interaction would be broken then anyways * what is output on INFO level is additionally controlled by commandline flags """ import inspect import json import logging import logging.config import logging.handlers # needed for handlers defined there being configurable in logging.conf file import os import warnings configured = False # use something like this to ignore warnings: # warnings.filterwarnings('ignore', r'... regex for warning message to ignore ...') def _log_warning(message, category, filename, lineno, file=None, line=None): # for warnings, we just want to use the logging system, not stderr or other files msg = f"{filename}:{lineno}: {category.__name__}: {message}" logger = create_logger(__name__) # Note: the warning will look like coming from here, # but msg contains info about where it really comes from logger.warning(msg) def setup_logging(stream=None, conf_fname=None, env_var='BORG_LOGGING_CONF', level='info', is_serve=False, json=False): """setup logging module according to the arguments provided if conf_fname is given (or the config file name can be determined via the env_var, if given): load this logging configuration. otherwise, set up a stream handler logger on stderr (by default, if no stream is provided). if is_serve == True, we configure a special log format as expected by the borg client log message interceptor. """ global configured err_msg = None if env_var: conf_fname = os.environ.get(env_var, conf_fname) if conf_fname: try: conf_fname = os.path.abspath(conf_fname) # we open the conf file here to be able to give a reasonable # error message in case of failure (if we give the filename to # fileConfig(), it silently ignores unreadable files and gives # unhelpful error msgs like "No section: 'formatters'"): with open(conf_fname) as f: logging.config.fileConfig(f) configured = True logger = logging.getLogger(__name__) borg_logger = logging.getLogger('borg') borg_logger.json = json logger.debug(f'using logging configuration read from "{conf_fname}"') warnings.showwarning = _log_warning return None except Exception as err: # XXX be more precise err_msg = str(err) # if we did not / not successfully load a logging configuration, fallback to this: logger = logging.getLogger('') handler = logging.StreamHandler(stream) if is_serve and not json: fmt = '$LOG %(levelname)s %(name)s Remote: %(message)s' else: fmt = '%(message)s' formatter = JsonFormatter(fmt) if json else logging.Formatter(fmt) handler.setFormatter(formatter) borg_logger = logging.getLogger('borg') borg_logger.formatter = formatter borg_logger.json = json if configured and logger.handlers: # The RepositoryServer can call setup_logging a second time to adjust the output # mode from text-ish is_serve to json is_serve. # Thus, remove the previously installed handler, if any. logger.handlers[0].close() logger.handlers.clear() logger.addHandler(handler) logger.setLevel(level.upper()) configured = True logger = logging.getLogger(__name__) if err_msg: logger.warning(f'setup_logging for "{conf_fname}" failed with "{err_msg}".') logger.debug('using builtin fallback logging configuration') warnings.showwarning = _log_warning return handler def find_parent_module(): """find the name of the first module calling this module if we cannot find it, we return the current module's name (__name__) instead. """ try: frame = inspect.currentframe().f_back module = inspect.getmodule(frame) while module is None or module.__name__ == __name__: frame = frame.f_back module = inspect.getmodule(frame) return module.__name__ except AttributeError: # somehow we failed to find our module # return the logger module name by default return __name__ def create_logger(name=None): """lazily create a Logger object with the proper path, which is returned by find_parent_module() by default, or is provided via the commandline this is really a shortcut for: logger = logging.getLogger(__name__) we use it to avoid errors and provide a more standard API. We must create the logger lazily, because this is usually called from module level (and thus executed at import time - BEFORE setup_logging() was called). By doing it lazily we can do the setup first, we just have to be careful not to call any logger methods before the setup_logging() call. If you try, you'll get an exception. """ class LazyLogger: def __init__(self, name=None): self.__name = name or find_parent_module() self.__real_logger = None @property def __logger(self): if self.__real_logger is None: if not configured: raise Exception("tried to call a logger before setup_logging() was called") self.__real_logger = logging.getLogger(self.__name) if self.__name.startswith('borg.debug.') and self.__real_logger.level == logging.NOTSET: self.__real_logger.setLevel('WARNING') return self.__real_logger def getChild(self, suffix): return LazyLogger(self.__name + '.' + suffix) def setLevel(self, level): return self.__logger.setLevel(level) def log(self, level, msg, *args, **kwargs): if 'msgid' in kwargs: kwargs.setdefault('extra', {})['msgid'] = kwargs.pop('msgid') return self.__logger.log(level, msg, *args, **kwargs) def exception(self, msg, *args, exc_info=True, **kwargs): if 'msgid' in kwargs: kwargs.setdefault('extra', {})['msgid'] = kwargs.pop('msgid') return self.__logger.exception(msg, *args, exc_info=exc_info, **kwargs) def debug(self, msg, *args, **kwargs): if 'msgid' in kwargs: kwargs.setdefault('extra', {})['msgid'] = kwargs.pop('msgid') return self.__logger.debug(msg, *args, **kwargs) def info(self, msg, *args, **kwargs): if 'msgid' in kwargs: kwargs.setdefault('extra', {})['msgid'] = kwargs.pop('msgid') return self.__logger.info(msg, *args, **kwargs) def warning(self, msg, *args, **kwargs): if 'msgid' in kwargs: kwargs.setdefault('extra', {})['msgid'] = kwargs.pop('msgid') return self.__logger.warning(msg, *args, **kwargs) def error(self, msg, *args, **kwargs): if 'msgid' in kwargs: kwargs.setdefault('extra', {})['msgid'] = kwargs.pop('msgid') return self.__logger.error(msg, *args, **kwargs) def critical(self, msg, *args, **kwargs): if 'msgid' in kwargs: kwargs.setdefault('extra', {})['msgid'] = kwargs.pop('msgid') return self.__logger.critical(msg, *args, **kwargs) return LazyLogger(name) class JsonFormatter(logging.Formatter): RECORD_ATTRIBUTES = ( 'levelname', 'name', 'message', # msgid is an attribute we made up in Borg to expose a non-changing handle for log messages 'msgid', ) # Other attributes that are not very useful but do exist: # processName, process, relativeCreated, stack_info, thread, threadName # msg == message # *args* are the unformatted arguments passed to the logger function, not useful now, # become useful if sanitized properly (must be JSON serializable) in the code + # fixed message IDs are assigned. # exc_info, exc_text are generally uninteresting because the message will have that def format(self, record): super().format(record) data = { 'type': 'log_message', 'time': record.created, 'message': '', 'levelname': 'CRITICAL', } for attr in self.RECORD_ATTRIBUTES: value = getattr(record, attr, None) if value: data[attr] = value return json.dumps(data) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/lrucache.py0000644000076500000240000000332214641074756016106 0ustar00twstaffsentinel = object() class LRUCache: def __init__(self, capacity, dispose): self._cache = {} self._lru = [] self._capacity = capacity self._dispose = dispose def __setitem__(self, key, value): assert key not in self._cache, ( "Unexpected attempt to replace a cached item," " without first deleting the old item.") self._lru.append(key) while len(self._lru) > self._capacity: del self[self._lru[0]] self._cache[key] = value def __getitem__(self, key): value = self._cache[key] # raise KeyError if not found self._lru.remove(key) self._lru.append(key) return value def __delitem__(self, key): value = self._cache.pop(key) # raise KeyError if not found self._dispose(value) self._lru.remove(key) def __contains__(self, key): return key in self._cache def get(self, key, default=None): value = self._cache.get(key, sentinel) if value is sentinel: return default self._lru.remove(key) self._lru.append(key) return value def upd(self, key, value): # special use only: update the value for an existing key without having to dispose it first # this method complements __setitem__ which should be used for the normal use case. assert key in self._cache, "Unexpected attempt to update a non-existing item." self._cache[key] = value def clear(self): for value in self._cache.values(): self._dispose(value) self._cache.clear() def items(self): return self._cache.items() def __len__(self): return len(self._cache) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/nanorst.py0000644000076500000240000001547214641074756016015 0ustar00twstaffimport io import sys from .helpers import is_terminal class TextPecker: def __init__(self, s): self.str = s self.i = 0 def read(self, n): self.i += n return self.str[self.i - n:self.i] def peek(self, n): if n >= 0: return self.str[self.i:self.i + n] else: return self.str[self.i + n - 1:self.i - 1] def peekline(self): out = '' i = self.i while i < len(self.str) and self.str[i] != '\n': out += self.str[i] i += 1 return out def readline(self): out = self.peekline() self.i += len(out) return out def process_directive(directive, arguments, out, state_hook): if directive == 'container' and arguments == 'experimental': state_hook('text', '**', out) out.write('++ Experimental ++') state_hook('**', 'text', out) else: state_hook('text', '**', out) out.write(directive.title()) out.write(':\n') state_hook('**', 'text', out) if arguments: out.write(arguments) out.write('\n') def rst_to_text(text, state_hook=None, references=None): """ Convert rST to a more human text form. This is a very loose conversion. No advanced rST features are supported. The generated output directly depends on the input (e.g. indentation of admonitions). """ state_hook = state_hook or (lambda old_state, new_state, out: None) references = references or {} state = 'text' inline_mode = 'replace' text = TextPecker(text) out = io.StringIO() inline_single = ('*', '`') while True: char = text.read(1) if not char: break next = text.peek(1) # type: str if state == 'text': if char == '\\' and text.peek(1) in inline_single: continue if text.peek(-1) != '\\': if char in inline_single and next != char: state_hook(state, char, out) state = char continue if char == next == '*': state_hook(state, '**', out) state = '**' text.read(1) continue if char == next == '`': state_hook(state, '``', out) state = '``' text.read(1) continue if text.peek(-1).isspace() and char == ':' and text.peek(5) == 'ref:`': # translate reference text.read(5) ref = '' while True: char = text.peek(1) if char == '`': text.read(1) break if char == '\n': text.read(1) continue # merge line breaks in :ref:`...\n...` ref += text.read(1) try: out.write(references[ref]) except KeyError: raise ValueError("Undefined reference in Archiver help: %r — please add reference " "substitution to 'rst_plain_text_references'" % ref) continue if char == ':' and text.peek(2) == ':\n': # End of line code block text.read(2) state_hook(state, 'code-block', out) state = 'code-block' out.write(':\n') continue if text.peek(-2) in ('\n\n', '') and char == next == '.': text.read(2) directive, is_directive, arguments = text.readline().partition('::') text.read(1) if not is_directive: # partition: if the separator is not in the text, the leftmost output is the entire input if directive == 'nanorst: inline-fill': inline_mode = 'fill' elif directive == 'nanorst: inline-replace': inline_mode = 'replace' continue process_directive(directive, arguments.strip(), out, state_hook) continue if state in inline_single and char == state: state_hook(state, 'text', out) state = 'text' if inline_mode == 'fill': out.write(2 * ' ') continue if state == '``' and char == next == '`': state_hook(state, 'text', out) state = 'text' text.read(1) if inline_mode == 'fill': out.write(4 * ' ') continue if state == '**' and char == next == '*': state_hook(state, 'text', out) state = 'text' text.read(1) continue if state == 'code-block' and char == next == '\n' and text.peek(5)[1:] != ' ': # Foo:: # # *stuff* *code* *ignore .. all markup* # # More arcane stuff # # Regular text... state_hook(state, 'text', out) state = 'text' out.write(char) assert state == 'text', 'Invalid final state %r (This usually indicates unmatched */**)' % state return out.getvalue() class RstToTextLazy: def __init__(self, str, state_hook=None, references=None): self.str = str self.state_hook = state_hook self.references = references self._rst = None @property def rst(self): if self._rst is None: self._rst = rst_to_text(self.str, self.state_hook, self.references) return self._rst def __getattr__(self, item): return getattr(self.rst, item) def __str__(self): return self.rst def __add__(self, other): return self.rst + other def __iter__(self): return iter(self.rst) def __contains__(self, item): return item in self.rst def ansi_escapes(old_state, new_state, out): if old_state == 'text' and new_state in ('*', '`', '``'): out.write('\033[4m') if old_state == 'text' and new_state == '**': out.write('\033[1m') if old_state in ('*', '`', '``', '**') and new_state == 'text': out.write('\033[0m') def rst_to_terminal(rst, references=None, destination=sys.stdout): """ Convert *rst* to a lazy string. If *destination* is a file-like object connected to a terminal, enrich text with suitable ANSI escapes. Otherwise return plain text. """ if is_terminal(destination): rst_state_hook = ansi_escapes else: rst_state_hook = None return RstToTextLazy(rst, rst_state_hook, references) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/paperkey.html0000644000076500000240000020075514641074756016465 0ustar00twstaff BorgBackup Printable Key Template

To create a printable key, either paste the contents of your keyfile or a key export in the text field below, or select a key export file.

To create a key export use

borg key export /path/to/repository exportfile.txt

If you are using keyfile mode, keyfiles are usually stored in $HOME/.config/borg/keys/

You can edit the parts with light blue border in the print preview below by click into them.

Key security: This print template will never send anything to remote servers. But keep in mind, that printing might involve computers that can store the printed image, for example with cloud printing services, or networked printers.

QR error correction:
QR code size
Text size
Text columns
BorgBackup Printable Key Backup
To restore either scan the QR code below, decode it and import it using
borg key import /path/to/repo scannedfile
Or run
borg key import --paper /path/to/repo
and type in the text below.

Notes:
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/patterns.py0000644000076500000240000003300614641074756016162 0ustar00twstaffimport argparse import fnmatch import os.path import re import sys import unicodedata from collections import namedtuple from enum import Enum from . import shellpattern from .helpers import clean_lines from .helpers.errors import Error def parse_patternfile_line(line, roots, ie_commands, fallback): """Parse a pattern-file line and act depending on which command it represents.""" ie_command = parse_inclexcl_command(line, fallback=fallback) if ie_command.cmd is IECommand.RootPath: roots.append(ie_command.val) elif ie_command.cmd is IECommand.PatternStyle: fallback = ie_command.val else: # it is some kind of include/exclude command ie_commands.append(ie_command) return fallback def load_pattern_file(fileobj, roots, ie_commands, fallback=None): if fallback is None: fallback = ShellPattern # ShellPattern is defined later in this module for line in clean_lines(fileobj): fallback = parse_patternfile_line(line, roots, ie_commands, fallback) def load_exclude_file(fileobj, patterns): for patternstr in clean_lines(fileobj): patterns.append(parse_exclude_pattern(patternstr)) class ArgparsePatternAction(argparse.Action): def __init__(self, nargs=1, **kw): super().__init__(nargs=nargs, **kw) def __call__(self, parser, args, values, option_string=None): parse_patternfile_line(values[0], args.paths, args.patterns, ShellPattern) class ArgparsePatternFileAction(argparse.Action): def __init__(self, nargs=1, **kw): super().__init__(nargs=nargs, **kw) def __call__(self, parser, args, values, option_string=None): """Load and parse patterns from a file. Lines empty or starting with '#' after stripping whitespace on both line ends are ignored. """ filename = values[0] try: with open(filename) as f: self.parse(f, args) except FileNotFoundError as e: raise Error(str(e)) def parse(self, fobj, args): load_pattern_file(fobj, args.paths, args.patterns) class ArgparseExcludeFileAction(ArgparsePatternFileAction): def parse(self, fobj, args): load_exclude_file(fobj, args.patterns) class PatternMatcher: """Represents a collection of pattern objects to match paths against. *fallback* is a boolean value that *match()* returns if no matching patterns are found. """ def __init__(self, fallback=None): self._items = [] # Value to return from match function when none of the patterns match. self.fallback = fallback # optimizations self._path_full_patterns = {} # full path -> return value # indicates whether the last match() call ended on a pattern for which # we should recurse into any matching folder. Will be set to True or # False when calling match(). self.recurse_dir = None # whether to recurse into directories when no match is found # TODO: allow modification as a config option? self.recurse_dir_default = True self.include_patterns = [] # TODO: move this info to parse_inclexcl_command and store in PatternBase subclass? self.is_include_cmd = { IECommand.Exclude: False, IECommand.ExcludeNoRecurse: False, IECommand.Include: True } def empty(self): return not len(self._items) and not len(self._path_full_patterns) def _add(self, pattern, cmd): """*cmd* is an IECommand value. """ if isinstance(pattern, PathFullPattern): key = pattern.pattern # full, normalized path self._path_full_patterns[key] = cmd else: self._items.append((pattern, cmd)) def add(self, patterns, cmd): """Add list of patterns to internal list. *cmd* indicates whether the pattern is an include/exclude pattern, and whether recursion should be done on excluded folders. """ for pattern in patterns: self._add(pattern, cmd) def add_includepaths(self, include_paths): """Used to add inclusion-paths from args.paths (from commandline). """ include_patterns = [parse_pattern(p, PathPrefixPattern) for p in include_paths] self.add(include_patterns, IECommand.Include) self.fallback = not include_patterns self.include_patterns = include_patterns def get_unmatched_include_patterns(self): """Note that this only returns patterns added via *add_includepaths* and it won't return PathFullPattern patterns as we do not match_count for them. """ return [p for p in self.include_patterns if p.match_count == 0 and not isinstance(p, PathFullPattern)] def add_inclexcl(self, patterns): """Add list of patterns (of type CmdTuple) to internal list. """ for pattern, cmd in patterns: self._add(pattern, cmd) def match(self, path): """Return True or False depending on whether *path* is matched. If no match is found among the patterns in this matcher, then the value in self.fallback is returned (defaults to None). """ path = normalize_path(path).lstrip(os.path.sep) # do a fast lookup for full path matches (note: we do not count such matches): non_existent = object() value = self._path_full_patterns.get(path, non_existent) if value is not non_existent: # we have a full path match! self.recurse_dir = command_recurses_dir(value) return self.is_include_cmd[value] # this is the slow way, if we have many patterns in self._items: for (pattern, cmd) in self._items: if pattern.match(path, normalize=False): self.recurse_dir = pattern.recurse_dir return self.is_include_cmd[cmd] # by default we will recurse if there is no match self.recurse_dir = self.recurse_dir_default return self.fallback def normalize_path(path): """normalize paths for MacOS (but do nothing on other platforms)""" # HFS+ converts paths to a canonical form, so users shouldn't be required to enter an exact match. # Windows and Unix filesystems allow different forms, so users always have to enter an exact match. return unicodedata.normalize('NFD', path) if sys.platform == 'darwin' else path class PatternBase: """Shared logic for inclusion/exclusion patterns. """ PREFIX = NotImplemented def __init__(self, pattern, recurse_dir=False): self.pattern_orig = pattern self.match_count = 0 pattern = normalize_path(pattern) self._prepare(pattern) self.recurse_dir = recurse_dir def match(self, path, normalize=True): """Return a boolean indicating whether *path* is matched by this pattern. If normalize is True (default), the path will get normalized using normalize_path(), otherwise it is assumed that it already is normalized using that function. """ if normalize: path = normalize_path(path) matches = self._match(path) if matches: self.match_count += 1 return matches def __repr__(self): return f'{type(self)}({self.pattern})' def __str__(self): return self.pattern_orig def _prepare(self, pattern): "Should set the value of self.pattern" raise NotImplementedError def _match(self, path): raise NotImplementedError class PathFullPattern(PatternBase): """Full match of a path.""" PREFIX = "pf" def _prepare(self, pattern): self.pattern = os.path.normpath(pattern).lstrip(os.path.sep) # sep at beginning is removed def _match(self, path): return path == self.pattern # For PathPrefixPattern, FnmatchPattern and ShellPattern, we require that the pattern either match the whole path # or an initial segment of the path up to but not including a path separator. To unify the two cases, we add a path # separator to the end of the path before matching. class PathPrefixPattern(PatternBase): """Literal files or directories listed on the command line for some operations (e.g. extract, but not create). If a directory is specified, all paths that start with that path match as well. A trailing slash makes no difference. """ PREFIX = "pp" def _prepare(self, pattern): sep = os.path.sep self.pattern = (os.path.normpath(pattern).rstrip(sep) + sep).lstrip(sep) # sep at beginning is removed def _match(self, path): return (path + os.path.sep).startswith(self.pattern) class FnmatchPattern(PatternBase): """Shell glob patterns to exclude. A trailing slash means to exclude the contents of a directory, but not the directory itself. """ PREFIX = "fm" def _prepare(self, pattern): if pattern.endswith(os.path.sep): pattern = os.path.normpath(pattern).rstrip(os.path.sep) + os.path.sep + '*' + os.path.sep else: pattern = os.path.normpath(pattern) + os.path.sep + '*' self.pattern = pattern.lstrip(os.path.sep) # sep at beginning is removed # fnmatch and re.match both cache compiled regular expressions. # Nevertheless, this is about 10 times faster. self.regex = re.compile(fnmatch.translate(self.pattern)) def _match(self, path): return (self.regex.match(path + os.path.sep) is not None) class ShellPattern(PatternBase): """Shell glob patterns to exclude. A trailing slash means to exclude the contents of a directory, but not the directory itself. """ PREFIX = "sh" def _prepare(self, pattern): sep = os.path.sep if pattern.endswith(sep): pattern = os.path.normpath(pattern).rstrip(sep) + sep + "**" + sep + "*" + sep else: pattern = os.path.normpath(pattern) + sep + "**" + sep + "*" self.pattern = pattern.lstrip(sep) # sep at beginning is removed self.regex = re.compile(shellpattern.translate(self.pattern)) def _match(self, path): return (self.regex.match(path + os.path.sep) is not None) class RegexPattern(PatternBase): """Regular expression to exclude. """ PREFIX = "re" def _prepare(self, pattern): self.pattern = pattern # sep at beginning is NOT removed self.regex = re.compile(pattern) def _match(self, path): # Normalize path separators if os.path.sep != '/': path = path.replace(os.path.sep, '/') return (self.regex.search(path) is not None) _PATTERN_CLASSES = { FnmatchPattern, PathFullPattern, PathPrefixPattern, RegexPattern, ShellPattern, } _PATTERN_CLASS_BY_PREFIX = {i.PREFIX: i for i in _PATTERN_CLASSES} CmdTuple = namedtuple('CmdTuple', 'val cmd') class IECommand(Enum): """A command that an InclExcl file line can represent. """ RootPath = 1 PatternStyle = 2 Include = 3 Exclude = 4 ExcludeNoRecurse = 5 def command_recurses_dir(cmd): # TODO?: raise error or return None if *cmd* is RootPath or PatternStyle return cmd not in [IECommand.ExcludeNoRecurse] def get_pattern_class(prefix): try: return _PATTERN_CLASS_BY_PREFIX[prefix] except KeyError: raise ValueError(f"Unknown pattern style: {prefix}") from None def parse_pattern(pattern, fallback=FnmatchPattern, recurse_dir=True): """Read pattern from string and return an instance of the appropriate implementation class. """ if len(pattern) > 2 and pattern[2] == ":" and pattern[:2].isalnum(): (style, pattern) = (pattern[:2], pattern[3:]) cls = get_pattern_class(style) else: cls = fallback return cls(pattern, recurse_dir) def parse_exclude_pattern(pattern_str, fallback=FnmatchPattern): """Read pattern from string and return an instance of the appropriate implementation class. """ epattern_obj = parse_pattern(pattern_str, fallback, recurse_dir=False) return CmdTuple(epattern_obj, IECommand.ExcludeNoRecurse) def parse_inclexcl_command(cmd_line_str, fallback=ShellPattern): """Read a --patterns-from command from string and return a CmdTuple object.""" cmd_prefix_map = { '-': IECommand.Exclude, '!': IECommand.ExcludeNoRecurse, '+': IECommand.Include, 'R': IECommand.RootPath, 'r': IECommand.RootPath, 'P': IECommand.PatternStyle, 'p': IECommand.PatternStyle, } if not cmd_line_str: raise argparse.ArgumentTypeError("A pattern/command must not be empty.") cmd = cmd_prefix_map.get(cmd_line_str[0]) if cmd is None: raise argparse.ArgumentTypeError("A pattern/command must start with any of: %s" % ', '.join(cmd_prefix_map)) # remaining text on command-line following the command character remainder_str = cmd_line_str[1:].lstrip() if not remainder_str: raise argparse.ArgumentTypeError("A pattern/command must have a value part.") if cmd is IECommand.RootPath: # TODO: validate string? val = remainder_str elif cmd is IECommand.PatternStyle: # then remainder_str is something like 're' or 'sh' try: val = get_pattern_class(remainder_str) except ValueError: raise argparse.ArgumentTypeError(f"Invalid pattern style: {remainder_str}") else: # determine recurse_dir based on command type recurse_dir = command_recurses_dir(cmd) val = parse_pattern(remainder_str, fallback, recurse_dir) return CmdTuple(val, cmd) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719958149.8389964 borgbackup-1.4.0/src/borg/platform/0000755000076500000240000000000014641075206015561 5ustar00twstaff././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/platform/__init__.py0000644000076500000240000000307414641074756017707 0ustar00twstaff""" Platform-specific APIs. Public APIs are documented in platform.base. """ from ..platformflags import is_win32, is_linux, is_freebsd, is_darwin from .base import listxattr, getxattr, setxattr, ENOATTR from .base import acl_get, acl_set from .base import set_flags, get_flags from .base import SaveFile, SyncFile, sync_dir, fdatasync, safe_fadvise from .base import swidth, API_VERSION from .base import process_alive, get_process_id, local_pid_alive, fqdn, hostname, hostid OS_API_VERSION = API_VERSION if not is_win32: from .posix import process_alive, local_pid_alive # posix swidth implementation works for: linux, freebsd, darwin, openindiana, cygwin from .posix import swidth from .posix import get_errno from .posix import uid2user, user2uid, gid2group, group2gid, getosusername else: from .windows import process_alive, local_pid_alive from .windows import uid2user, user2uid, gid2group, group2gid, getosusername if is_linux: # pragma: linux only from .linux import API_VERSION as OS_API_VERSION from .linux import listxattr, getxattr, setxattr from .linux import acl_get, acl_set from .linux import set_flags, get_flags from .linux import SyncFile elif is_freebsd: # pragma: freebsd only from .freebsd import API_VERSION as OS_API_VERSION from .freebsd import listxattr, getxattr, setxattr from .freebsd import acl_get, acl_set elif is_darwin: # pragma: darwin only from .darwin import API_VERSION as OS_API_VERSION from .darwin import listxattr, getxattr, setxattr from .darwin import acl_get, acl_set ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/platform/base.py0000644000076500000240000002517514641074756017070 0ustar00twstaffimport errno import os import socket import uuid from borg.helpers import safe_unlink from borg.platformflags import is_win32 """ platform base module ==================== Contains platform API implementations based on what Python itself provides. More specific APIs are stubs in this module. When functions in this module use platform APIs themselves they access the public platform API: that way platform APIs provided by the platform-specific support module are correctly composed into the base functionality. """ API_VERSION = '1.4_01' fdatasync = getattr(os, 'fdatasync', os.fsync) from .xattr import ENOATTR def listxattr(path, *, follow_symlinks=False): """ Return xattr names of a file (list of bytes objects). *path* can either be a path (bytes) or an open file descriptor (int). *follow_symlinks* indicates whether symlinks should be followed and only applies when *path* is not an open file descriptor. """ return [] def getxattr(path, name, *, follow_symlinks=False): """ Read xattr and return its value (as bytes). *path* can either be a path (bytes) or an open file descriptor (int). *name* is the name of the xattr to read (bytes). *follow_symlinks* indicates whether symlinks should be followed and only applies when *path* is not an open file descriptor. """ # as this base dummy implementation returns [] from listxattr, # it must raise here for any given name: raise OSError(ENOATTR, os.strerror(ENOATTR), path) def setxattr(path, name, value, *, follow_symlinks=False): """ Write xattr on *path*. *path* can either be a path (bytes) or an open file descriptor (int). *name* is the name of the xattr to read (bytes). *value* is the value to write (bytes). *follow_symlinks* indicates whether symlinks should be followed and only applies when *path* is not an open file descriptor. """ def acl_get(path, item, st, numeric_ids=False, fd=None): """ Saves ACL Entries If `numeric_ids` is True the user/group field is not preserved only uid/gid """ def acl_set(path, item, numeric_ids=False, fd=None): """ Restore ACL Entries If `numeric_ids` is True the stored uid/gid is used instead of the user/group names """ try: from os import lchflags def set_flags(path, bsd_flags, fd=None): lchflags(path, bsd_flags) except ImportError: def set_flags(path, bsd_flags, fd=None): pass def get_flags(path, st, fd=None): """Return BSD-style file flags for path or stat without following symlinks.""" return getattr(st, 'st_flags', 0) def sync_dir(path): if is_win32: # Opening directories is not supported on windows. # TODO: do we need to handle this in some other way? return fd = os.open(path, os.O_RDONLY) try: os.fsync(fd) except OSError as os_error: # Some network filesystems don't support this and fail with EINVAL. # Other error codes (e.g. EIO) shouldn't be silenced. if os_error.errno != errno.EINVAL: raise finally: os.close(fd) def safe_fadvise(fd, offset, len, advice): if hasattr(os, 'posix_fadvise'): advice = getattr(os, 'POSIX_FADV_' + advice) try: os.posix_fadvise(fd, offset, len, advice) except OSError: # usually, posix_fadvise can't fail for us, but there seem to # be failures when running borg under docker on ARM, likely due # to a bug outside of borg. # also, there is a python wrapper bug, always giving errno = 0. # https://github.com/borgbackup/borg/issues/2095 # as this call is not critical for correct function (just to # optimize cache usage), we ignore these errors. pass class SyncFile: """ A file class that is supposed to enable write ordering (one way or another) and data durability after close(). The degree to which either is possible varies with operating system, file system and hardware. This fallback implements a naive and slow way of doing this. On some operating systems it can't actually guarantee any of the above, since fsync() doesn't guarantee it. Furthermore it may not be possible at all to satisfy the above guarantees on some hardware or operating systems. In these cases we hope that the thorough checksumming implemented catches any corrupted data due to misordered, delayed or partial writes. Note that POSIX doesn't specify *anything* about power failures (or similar failures). A system that routinely loses files or corrupts file on power loss is POSIX compliant. Calling SyncFile(path) for an existing path will raise FileExistsError, see comment in __init__. TODO: Use F_FULLSYNC on OSX. TODO: A Windows implementation should use CreateFile with FILE_FLAG_WRITE_THROUGH. """ def __init__(self, path, *, fd=None, binary=False): """ Open a SyncFile. :param path: full path/filename :param fd: additionally to path, it is possible to give an already open OS-level fd that corresponds to path (like from os.open(path, ...) or os.mkstemp(...)) :param binary: whether to open in binary mode, default is False. """ mode = 'xb' if binary else 'x' # x -> raise FileExists exception in open() if file exists already self.path = path if fd is None: self.f = open(path, mode=mode) # python file object else: self.f = os.fdopen(fd, mode=mode) self.fd = self.f.fileno() # OS-level fd def __enter__(self): return self def __exit__(self, exc_type, exc_val, exc_tb): self.close() def write(self, data): self.f.write(data) def sync(self): """ Synchronize file contents. Everything written prior to sync() must become durable before anything written after sync(). """ from .. import platform self.f.flush() platform.fdatasync(self.fd) # tell the OS that it does not need to cache what we just wrote, # avoids spoiling the cache for the OS and other processes. safe_fadvise(self.fd, 0, 0, 'DONTNEED') def close(self): """sync() and close.""" from .. import platform dirname = None try: dirname = os.path.dirname(self.path) self.sync() finally: self.f.close() if dirname: platform.sync_dir(dirname) class SaveFile: """ Update file contents atomically. Must be used as a context manager (defining the scope of the transaction). On a journaling file system the file contents are always updated atomically and won't become corrupted, even on power failures or crashes (for caveats see SyncFile). SaveFile can safely by used in parallel (e.g. by multiple processes) to write to the same target path. Whatever writer finishes last (executes the os.replace last) "wins" and has successfully written its content to the target path. Internally used temporary files are created in the target directory and are named -.tmp and cleaned up in normal and error conditions. """ def __init__(self, path, binary=False): self.binary = binary self.path = path self.dir = os.path.dirname(path) self.tmp_prefix = os.path.basename(path) + '-' self.tmp_fd = None # OS-level fd self.tmp_fname = None # full path/filename corresponding to self.tmp_fd self.f = None # python-file-like SyncFile def __enter__(self): from .. import platform from ..helpers.fs import mkstemp_mode self.tmp_fd, self.tmp_fname = mkstemp_mode(prefix=self.tmp_prefix, suffix='.tmp', dir=self.dir, mode=0o666) self.f = platform.SyncFile(self.tmp_fname, fd=self.tmp_fd, binary=self.binary) return self.f def __exit__(self, exc_type, exc_val, exc_tb): from .. import platform self.f.close() # this indirectly also closes self.tmp_fd self.tmp_fd = None if exc_type is not None: safe_unlink(self.tmp_fname) # with-body has failed, clean up tmp file return # continue processing the exception normally try: os.replace(self.tmp_fname, self.path) # POSIX: atomic rename except OSError: safe_unlink(self.tmp_fname) # rename has failed, clean up tmp file raise finally: platform.sync_dir(self.dir) def swidth(s): """terminal output width of string For western scripts, this is just len(s), but for cjk glyphs, 2 cells are used. """ return len(s) # patched socket.getfqdn() - see https://bugs.python.org/issue5004 def getfqdn(name=''): """Get fully qualified domain name from name. An empty argument is interpreted as meaning the local host. """ name = name.strip() if not name or name == '0.0.0.0': name = socket.gethostname() try: addrs = socket.getaddrinfo(name, None, 0, socket.SOCK_DGRAM, 0, socket.AI_CANONNAME) except OSError: pass else: for addr in addrs: if addr[3]: name = addr[3] break return name # for performance reasons, only determine hostname / fqdn / hostid once. # XXX this sometimes requires live internet access for issuing a DNS query in the background. hostname = socket.gethostname() fqdn = getfqdn(hostname) # some people put the fqdn into /etc/hostname (which is wrong, should be the short hostname) # fix this (do the same as "hostname --short" cli command does internally): hostname = hostname.split('.')[0] # uuid.getnode() is problematic in some environments (e.g. OpenVZ, see #3968) where the virtual MAC address # is all-zero. uuid.getnode falls back to returning a random value in that case, which is not what we want. # thus, we offer BORG_HOST_ID where a user can set an own, unique id for each of his hosts. hostid = os.environ.get('BORG_HOST_ID') if not hostid: hostid = f'{fqdn}@{uuid.getnode()}' def get_process_id(): """ Return identification tuple (hostname, pid, thread_id) for 'us'. This always returns the current pid, which might be different from before, e.g. if daemonize() was used. Note: Currently thread_id is *always* zero. """ thread_id = 0 pid = os.getpid() return hostid, pid, thread_id def process_alive(host, pid, thread): """ Check if the (host, pid, thread_id) combination corresponds to a potentially alive process. """ raise NotImplementedError def local_pid_alive(pid): """Return whether *pid* is alive.""" raise NotImplementedError ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719958148.0 borgbackup-1.4.0/src/borg/platform/darwin.c0000644000076500000240000211224114641075204017212 0ustar00twstaff/* Generated by Cython 3.0.10 */ /* BEGIN: Cython Metadata { "distutils": { "depends": [], "extra_compile_args": [ "-Wall", "-Wextra", "-Wpointer-arith" ], "name": "borg.platform.darwin", "sources": [ "src/borg/platform/darwin.pyx" ] }, "module_name": "borg.platform.darwin" } END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_10" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x03000AF0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 1 #endif #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #if PY_VERSION_HEX >= 0x030d00A4 # define __Pyx_PyCFunctionFast PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords #else # define __Pyx_PyCFunctionFast _PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__borg__platform__darwin #define __PYX_HAVE_API__borg__platform__darwin /* Early includes */ #include #include #include "sys/xattr.h" #include "sys/acl.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/borg/platform/darwin.pyx", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct__listxattr; struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr; struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr; /* "borg/platform/darwin.pyx":41 * * * def listxattr(path, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, buf, size): * if isinstance(path, int): */ struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct__listxattr { PyObject_HEAD PyObject *__pyx_v_follow_symlinks; }; /* "borg/platform/darwin.pyx":55 * * * def getxattr(path, name, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, name, buf, size): * if isinstance(path, int): */ struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr { PyObject_HEAD PyObject *__pyx_v_follow_symlinks; }; /* "borg/platform/darwin.pyx":69 * * * def setxattr(path, name, value, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, name, value, size): * if isinstance(path, int): */ struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr { PyObject_HEAD PyObject *__pyx_v_follow_symlinks; }; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* RaiseClosureNameError.proto */ static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname); /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* SliceObject.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); /* ListCompAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len)) { Py_INCREF(x); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 L->ob_item[len] = x; #else PyList_SET_ITEM(list, len, x); #endif __Pyx_SET_SIZE(list, len + 1); return 0; } return PyList_Append(list, x); } #else #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) #endif /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* StrEquals.proto */ #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals #else #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals #endif /* SetItemInt.proto */ #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\ __Pyx_SetItemInt_Generic(o, to_py_func(i), v))) static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v); static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list, int wraparound, int boundscheck); /* ListAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 L->ob_item[len] = x; #else PyList_SET_ITEM(list, len, x); #endif __Pyx_SET_SIZE(list, len + 1); return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif /* PyObjectCall2Args.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod1.proto */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); /* StringJoin.proto */ #if PY_MAJOR_VERSION < 3 #define __Pyx_PyString_Join __Pyx_PyBytes_Join #define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v)) #else #define __Pyx_PyString_Join PyUnicode_Join #define __Pyx_PyBaseString_Join PyUnicode_Join #endif static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* SwapException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif /* GetTopmostException.proto */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); #endif /* SaveResetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* PyObjectCallNoArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* ValidateBasesTuple.proto */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); #endif /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc.stdint" */ /* Module declarations from "libc" */ /* Module declarations from "libc.errno" */ /* Module declarations from "borg.platform.darwin" */ static int __pyx_v_4borg_8platform_6darwin_XATTR_NOFLAGS; /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "borg.platform.darwin" extern int __pyx_module_is_main_borg__platform__darwin; int __pyx_module_is_main_borg__platform__darwin = 0; /* Implementation of "borg.platform.darwin" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_OSError; /* #### Code section: string_decls ### */ static const char __pyx_k_n[] = "n"; static const char __pyx_k__7[] = "\n"; static const char __pyx_k__8[] = ":"; static const char __pyx_k__9[] = ""; static const char __pyx_k_fd[] = "fd"; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k_os[] = "os"; static const char __pyx_k_st[] = "st"; static const char __pyx_k__10[] = "*"; static const char __pyx_k__11[] = "."; static const char __pyx_k__26[] = "?"; static const char __pyx_k_acl[] = "acl"; static const char __pyx_k_buf[] = "buf"; static const char __pyx_k_get[] = "get"; static const char __pyx_k_func[] = "func"; static const char __pyx_k_item[] = "item"; static const char __pyx_k_join[] = "join"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "name"; static const char __pyx_k_path[] = "path"; static const char __pyx_k_size[] = "size"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_text[] = "text"; static const char __pyx_k_user[] = "user"; static const char __pyx_k_entry[] = "entry"; static const char __pyx_k_group[] = "group"; static const char __pyx_k_posix[] = "posix"; static const char __pyx_k_split[] = "split"; static const char __pyx_k_value[] = "value"; static const char __pyx_k_xattr[] = "xattr"; static const char __pyx_k_1_4_01[] = "1.4_01"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_fields[] = "fields"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_name_2[] = "__name__"; static const char __pyx_k_OSError[] = "OSError"; static const char __pyx_k_acl_get[] = "acl_get"; static const char __pyx_k_acl_set[] = "acl_set"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_entries[] = "entries"; static const char __pyx_k_helpers[] = "helpers"; static const char __pyx_k_acl_text[] = "acl_text"; static const char __pyx_k_fsdecode[] = "fsdecode"; static const char __pyx_k_fsencode[] = "fsencode"; static const char __pyx_k_getxattr[] = "getxattr"; static const char __pyx_k_setxattr[] = "setxattr"; static const char __pyx_k_strerror[] = "strerror"; static const char __pyx_k_user2uid[] = "user2uid"; static const char __pyx_k_group2gid[] = "group2gid"; static const char __pyx_k_isenabled[] = "isenabled"; static const char __pyx_k_listxattr[] = "listxattr"; static const char __pyx_k_API_VERSION[] = "API_VERSION"; static const char __pyx_k_numeric_ids[] = "numeric_ids"; static const char __pyx_k_safe_decode[] = "safe_decode"; static const char __pyx_k_safe_encode[] = "safe_encode"; static const char __pyx_k_acl_extended[] = "acl_extended"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_split_string0[] = "split_string0"; static const char __pyx_k_getxattr_inner[] = "_getxattr_inner"; static const char __pyx_k_setxattr_inner[] = "_setxattr_inner"; static const char __pyx_k_follow_symlinks[] = "follow_symlinks"; static const char __pyx_k_listxattr_inner[] = "_listxattr_inner"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_borg_platform_darwin[] = "borg.platform.darwin"; static const char __pyx_k_getxattr_locals_func[] = "getxattr..func"; static const char __pyx_k_setxattr_locals_func[] = "setxattr..func"; static const char __pyx_k_listxattr_locals_func[] = "listxattr..func"; static const char __pyx_k_src_borg_platform_darwin_pyx[] = "src/borg/platform/darwin.pyx"; static const char __pyx_k_remove_non_numeric_identifier[] = "_remove_non_numeric_identifier"; static const char __pyx_k_remove_numeric_id_if_possible[] = "_remove_numeric_id_if_possible"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_4borg_8platform_6darwin_9listxattr_func(PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_buf, PyObject *__pyx_v_size); /* proto */ static PyObject *__pyx_pf_4borg_8platform_6darwin_listxattr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_follow_symlinks); /* proto */ static PyObject *__pyx_pf_4borg_8platform_6darwin_8getxattr_func(PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_name, PyObject *__pyx_v_buf, PyObject *__pyx_v_size); /* proto */ static PyObject *__pyx_pf_4borg_8platform_6darwin_2getxattr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_name, PyObject *__pyx_v_follow_symlinks); /* proto */ static PyObject *__pyx_pf_4borg_8platform_6darwin_8setxattr_func(PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_name, PyObject *__pyx_v_value, PyObject *__pyx_v_size); /* proto */ static PyObject *__pyx_pf_4borg_8platform_6darwin_4setxattr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_name, PyObject *__pyx_v_value, PyObject *__pyx_v_follow_symlinks); /* proto */ static PyObject *__pyx_pf_4borg_8platform_6darwin_6_remove_numeric_id_if_possible(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_acl); /* proto */ static PyObject *__pyx_pf_4borg_8platform_6darwin_8_remove_non_numeric_identifier(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_acl); /* proto */ static PyObject *__pyx_pf_4borg_8platform_6darwin_10acl_get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_item, CYTHON_UNUSED PyObject *__pyx_v_st, PyObject *__pyx_v_numeric_ids, PyObject *__pyx_v_fd); /* proto */ static PyObject *__pyx_pf_4borg_8platform_6darwin_12acl_set(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_item, PyObject *__pyx_v_numeric_ids, PyObject *__pyx_v_fd); /* proto */ static PyObject *__pyx_tp_new_4borg_8platform_6darwin___pyx_scope_struct__listxattr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE PyObject *__pyx_type_4borg_8platform_6darwin___pyx_scope_struct__listxattr; PyObject *__pyx_type_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr; PyObject *__pyx_type_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr; #endif PyTypeObject *__pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct__listxattr; PyTypeObject *__pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr; PyTypeObject *__pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr; PyObject *__pyx_kp_s_1_4_01; PyObject *__pyx_n_s_API_VERSION; PyObject *__pyx_n_s_OSError; PyObject *__pyx_n_s__10; PyObject *__pyx_kp_u__11; PyObject *__pyx_n_s__26; PyObject *__pyx_kp_s__7; PyObject *__pyx_kp_s__8; PyObject *__pyx_kp_s__9; PyObject *__pyx_n_s_acl; PyObject *__pyx_n_s_acl_extended; PyObject *__pyx_n_s_acl_get; PyObject *__pyx_n_s_acl_set; PyObject *__pyx_n_s_acl_text; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_borg_platform_darwin; PyObject *__pyx_n_s_buf; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_kp_u_disable; PyObject *__pyx_kp_u_enable; PyObject *__pyx_n_s_entries; PyObject *__pyx_n_s_entry; PyObject *__pyx_n_s_fd; PyObject *__pyx_n_s_fields; PyObject *__pyx_n_s_follow_symlinks; PyObject *__pyx_n_s_fsdecode; PyObject *__pyx_n_s_fsencode; PyObject *__pyx_n_s_func; PyObject *__pyx_kp_u_gc; PyObject *__pyx_n_s_get; PyObject *__pyx_n_s_getxattr; PyObject *__pyx_n_s_getxattr_inner; PyObject *__pyx_n_s_getxattr_locals_func; PyObject *__pyx_n_s_group; PyObject *__pyx_n_s_group2gid; PyObject *__pyx_n_s_helpers; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_kp_u_isenabled; PyObject *__pyx_n_s_item; PyObject *__pyx_n_s_join; PyObject *__pyx_n_s_listxattr; PyObject *__pyx_n_s_listxattr_inner; PyObject *__pyx_n_s_listxattr_locals_func; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_n; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_name_2; PyObject *__pyx_n_s_numeric_ids; PyObject *__pyx_n_s_os; PyObject *__pyx_n_s_path; PyObject *__pyx_n_s_posix; PyObject *__pyx_n_s_remove_non_numeric_identifier; PyObject *__pyx_n_s_remove_numeric_id_if_possible; PyObject *__pyx_n_s_safe_decode; PyObject *__pyx_n_s_safe_encode; PyObject *__pyx_n_s_setxattr; PyObject *__pyx_n_s_setxattr_inner; PyObject *__pyx_n_s_setxattr_locals_func; PyObject *__pyx_n_s_size; PyObject *__pyx_n_s_spec; PyObject *__pyx_n_s_split; PyObject *__pyx_n_s_split_string0; PyObject *__pyx_kp_s_src_borg_platform_darwin_pyx; PyObject *__pyx_n_s_st; PyObject *__pyx_n_s_strerror; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_text; PyObject *__pyx_n_s_user; PyObject *__pyx_n_s_user2uid; PyObject *__pyx_n_s_value; PyObject *__pyx_n_s_xattr; PyObject *__pyx_tuple_; PyObject *__pyx_tuple__3; PyObject *__pyx_tuple__5; PyObject *__pyx_tuple__12; PyObject *__pyx_tuple__14; PyObject *__pyx_tuple__16; PyObject *__pyx_tuple__18; PyObject *__pyx_tuple__21; PyObject *__pyx_tuple__23; PyObject *__pyx_tuple__24; PyObject *__pyx_codeobj__2; PyObject *__pyx_codeobj__4; PyObject *__pyx_codeobj__6; PyObject *__pyx_codeobj__13; PyObject *__pyx_codeobj__15; PyObject *__pyx_codeobj__17; PyObject *__pyx_codeobj__19; PyObject *__pyx_codeobj__20; PyObject *__pyx_codeobj__22; PyObject *__pyx_codeobj__25; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct__listxattr); Py_CLEAR(clear_module_state->__pyx_type_4borg_8platform_6darwin___pyx_scope_struct__listxattr); Py_CLEAR(clear_module_state->__pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr); Py_CLEAR(clear_module_state->__pyx_type_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr); Py_CLEAR(clear_module_state->__pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr); Py_CLEAR(clear_module_state->__pyx_type_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr); Py_CLEAR(clear_module_state->__pyx_kp_s_1_4_01); Py_CLEAR(clear_module_state->__pyx_n_s_API_VERSION); Py_CLEAR(clear_module_state->__pyx_n_s_OSError); Py_CLEAR(clear_module_state->__pyx_n_s__10); Py_CLEAR(clear_module_state->__pyx_kp_u__11); Py_CLEAR(clear_module_state->__pyx_n_s__26); Py_CLEAR(clear_module_state->__pyx_kp_s__7); Py_CLEAR(clear_module_state->__pyx_kp_s__8); Py_CLEAR(clear_module_state->__pyx_kp_s__9); Py_CLEAR(clear_module_state->__pyx_n_s_acl); Py_CLEAR(clear_module_state->__pyx_n_s_acl_extended); Py_CLEAR(clear_module_state->__pyx_n_s_acl_get); Py_CLEAR(clear_module_state->__pyx_n_s_acl_set); Py_CLEAR(clear_module_state->__pyx_n_s_acl_text); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_borg_platform_darwin); Py_CLEAR(clear_module_state->__pyx_n_s_buf); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_kp_u_disable); Py_CLEAR(clear_module_state->__pyx_kp_u_enable); Py_CLEAR(clear_module_state->__pyx_n_s_entries); Py_CLEAR(clear_module_state->__pyx_n_s_entry); Py_CLEAR(clear_module_state->__pyx_n_s_fd); Py_CLEAR(clear_module_state->__pyx_n_s_fields); Py_CLEAR(clear_module_state->__pyx_n_s_follow_symlinks); Py_CLEAR(clear_module_state->__pyx_n_s_fsdecode); Py_CLEAR(clear_module_state->__pyx_n_s_fsencode); Py_CLEAR(clear_module_state->__pyx_n_s_func); Py_CLEAR(clear_module_state->__pyx_kp_u_gc); Py_CLEAR(clear_module_state->__pyx_n_s_get); Py_CLEAR(clear_module_state->__pyx_n_s_getxattr); Py_CLEAR(clear_module_state->__pyx_n_s_getxattr_inner); Py_CLEAR(clear_module_state->__pyx_n_s_getxattr_locals_func); Py_CLEAR(clear_module_state->__pyx_n_s_group); Py_CLEAR(clear_module_state->__pyx_n_s_group2gid); Py_CLEAR(clear_module_state->__pyx_n_s_helpers); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); Py_CLEAR(clear_module_state->__pyx_n_s_item); Py_CLEAR(clear_module_state->__pyx_n_s_join); Py_CLEAR(clear_module_state->__pyx_n_s_listxattr); Py_CLEAR(clear_module_state->__pyx_n_s_listxattr_inner); Py_CLEAR(clear_module_state->__pyx_n_s_listxattr_locals_func); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_n); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_name_2); Py_CLEAR(clear_module_state->__pyx_n_s_numeric_ids); Py_CLEAR(clear_module_state->__pyx_n_s_os); Py_CLEAR(clear_module_state->__pyx_n_s_path); Py_CLEAR(clear_module_state->__pyx_n_s_posix); Py_CLEAR(clear_module_state->__pyx_n_s_remove_non_numeric_identifier); Py_CLEAR(clear_module_state->__pyx_n_s_remove_numeric_id_if_possible); Py_CLEAR(clear_module_state->__pyx_n_s_safe_decode); Py_CLEAR(clear_module_state->__pyx_n_s_safe_encode); Py_CLEAR(clear_module_state->__pyx_n_s_setxattr); Py_CLEAR(clear_module_state->__pyx_n_s_setxattr_inner); Py_CLEAR(clear_module_state->__pyx_n_s_setxattr_locals_func); Py_CLEAR(clear_module_state->__pyx_n_s_size); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_n_s_split); Py_CLEAR(clear_module_state->__pyx_n_s_split_string0); Py_CLEAR(clear_module_state->__pyx_kp_s_src_borg_platform_darwin_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_st); Py_CLEAR(clear_module_state->__pyx_n_s_strerror); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_text); Py_CLEAR(clear_module_state->__pyx_n_s_user); Py_CLEAR(clear_module_state->__pyx_n_s_user2uid); Py_CLEAR(clear_module_state->__pyx_n_s_value); Py_CLEAR(clear_module_state->__pyx_n_s_xattr); Py_CLEAR(clear_module_state->__pyx_tuple_); Py_CLEAR(clear_module_state->__pyx_tuple__3); Py_CLEAR(clear_module_state->__pyx_tuple__5); Py_CLEAR(clear_module_state->__pyx_tuple__12); Py_CLEAR(clear_module_state->__pyx_tuple__14); Py_CLEAR(clear_module_state->__pyx_tuple__16); Py_CLEAR(clear_module_state->__pyx_tuple__18); Py_CLEAR(clear_module_state->__pyx_tuple__21); Py_CLEAR(clear_module_state->__pyx_tuple__23); Py_CLEAR(clear_module_state->__pyx_tuple__24); Py_CLEAR(clear_module_state->__pyx_codeobj__2); Py_CLEAR(clear_module_state->__pyx_codeobj__4); Py_CLEAR(clear_module_state->__pyx_codeobj__6); Py_CLEAR(clear_module_state->__pyx_codeobj__13); Py_CLEAR(clear_module_state->__pyx_codeobj__15); Py_CLEAR(clear_module_state->__pyx_codeobj__17); Py_CLEAR(clear_module_state->__pyx_codeobj__19); Py_CLEAR(clear_module_state->__pyx_codeobj__20); Py_CLEAR(clear_module_state->__pyx_codeobj__22); Py_CLEAR(clear_module_state->__pyx_codeobj__25); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct__listxattr); Py_VISIT(traverse_module_state->__pyx_type_4borg_8platform_6darwin___pyx_scope_struct__listxattr); Py_VISIT(traverse_module_state->__pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr); Py_VISIT(traverse_module_state->__pyx_type_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr); Py_VISIT(traverse_module_state->__pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr); Py_VISIT(traverse_module_state->__pyx_type_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr); Py_VISIT(traverse_module_state->__pyx_kp_s_1_4_01); Py_VISIT(traverse_module_state->__pyx_n_s_API_VERSION); Py_VISIT(traverse_module_state->__pyx_n_s_OSError); Py_VISIT(traverse_module_state->__pyx_n_s__10); Py_VISIT(traverse_module_state->__pyx_kp_u__11); Py_VISIT(traverse_module_state->__pyx_n_s__26); Py_VISIT(traverse_module_state->__pyx_kp_s__7); Py_VISIT(traverse_module_state->__pyx_kp_s__8); Py_VISIT(traverse_module_state->__pyx_kp_s__9); Py_VISIT(traverse_module_state->__pyx_n_s_acl); Py_VISIT(traverse_module_state->__pyx_n_s_acl_extended); Py_VISIT(traverse_module_state->__pyx_n_s_acl_get); Py_VISIT(traverse_module_state->__pyx_n_s_acl_set); Py_VISIT(traverse_module_state->__pyx_n_s_acl_text); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_borg_platform_darwin); Py_VISIT(traverse_module_state->__pyx_n_s_buf); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_kp_u_disable); Py_VISIT(traverse_module_state->__pyx_kp_u_enable); Py_VISIT(traverse_module_state->__pyx_n_s_entries); Py_VISIT(traverse_module_state->__pyx_n_s_entry); Py_VISIT(traverse_module_state->__pyx_n_s_fd); Py_VISIT(traverse_module_state->__pyx_n_s_fields); Py_VISIT(traverse_module_state->__pyx_n_s_follow_symlinks); Py_VISIT(traverse_module_state->__pyx_n_s_fsdecode); Py_VISIT(traverse_module_state->__pyx_n_s_fsencode); Py_VISIT(traverse_module_state->__pyx_n_s_func); Py_VISIT(traverse_module_state->__pyx_kp_u_gc); Py_VISIT(traverse_module_state->__pyx_n_s_get); Py_VISIT(traverse_module_state->__pyx_n_s_getxattr); Py_VISIT(traverse_module_state->__pyx_n_s_getxattr_inner); Py_VISIT(traverse_module_state->__pyx_n_s_getxattr_locals_func); Py_VISIT(traverse_module_state->__pyx_n_s_group); Py_VISIT(traverse_module_state->__pyx_n_s_group2gid); Py_VISIT(traverse_module_state->__pyx_n_s_helpers); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); Py_VISIT(traverse_module_state->__pyx_n_s_item); Py_VISIT(traverse_module_state->__pyx_n_s_join); Py_VISIT(traverse_module_state->__pyx_n_s_listxattr); Py_VISIT(traverse_module_state->__pyx_n_s_listxattr_inner); Py_VISIT(traverse_module_state->__pyx_n_s_listxattr_locals_func); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_n); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_name_2); Py_VISIT(traverse_module_state->__pyx_n_s_numeric_ids); Py_VISIT(traverse_module_state->__pyx_n_s_os); Py_VISIT(traverse_module_state->__pyx_n_s_path); Py_VISIT(traverse_module_state->__pyx_n_s_posix); Py_VISIT(traverse_module_state->__pyx_n_s_remove_non_numeric_identifier); Py_VISIT(traverse_module_state->__pyx_n_s_remove_numeric_id_if_possible); Py_VISIT(traverse_module_state->__pyx_n_s_safe_decode); Py_VISIT(traverse_module_state->__pyx_n_s_safe_encode); Py_VISIT(traverse_module_state->__pyx_n_s_setxattr); Py_VISIT(traverse_module_state->__pyx_n_s_setxattr_inner); Py_VISIT(traverse_module_state->__pyx_n_s_setxattr_locals_func); Py_VISIT(traverse_module_state->__pyx_n_s_size); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_n_s_split); Py_VISIT(traverse_module_state->__pyx_n_s_split_string0); Py_VISIT(traverse_module_state->__pyx_kp_s_src_borg_platform_darwin_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_st); Py_VISIT(traverse_module_state->__pyx_n_s_strerror); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_text); Py_VISIT(traverse_module_state->__pyx_n_s_user); Py_VISIT(traverse_module_state->__pyx_n_s_user2uid); Py_VISIT(traverse_module_state->__pyx_n_s_value); Py_VISIT(traverse_module_state->__pyx_n_s_xattr); Py_VISIT(traverse_module_state->__pyx_tuple_); Py_VISIT(traverse_module_state->__pyx_tuple__3); Py_VISIT(traverse_module_state->__pyx_tuple__5); Py_VISIT(traverse_module_state->__pyx_tuple__12); Py_VISIT(traverse_module_state->__pyx_tuple__14); Py_VISIT(traverse_module_state->__pyx_tuple__16); Py_VISIT(traverse_module_state->__pyx_tuple__18); Py_VISIT(traverse_module_state->__pyx_tuple__21); Py_VISIT(traverse_module_state->__pyx_tuple__23); Py_VISIT(traverse_module_state->__pyx_tuple__24); Py_VISIT(traverse_module_state->__pyx_codeobj__2); Py_VISIT(traverse_module_state->__pyx_codeobj__4); Py_VISIT(traverse_module_state->__pyx_codeobj__6); Py_VISIT(traverse_module_state->__pyx_codeobj__13); Py_VISIT(traverse_module_state->__pyx_codeobj__15); Py_VISIT(traverse_module_state->__pyx_codeobj__17); Py_VISIT(traverse_module_state->__pyx_codeobj__19); Py_VISIT(traverse_module_state->__pyx_codeobj__20); Py_VISIT(traverse_module_state->__pyx_codeobj__22); Py_VISIT(traverse_module_state->__pyx_codeobj__25); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #define __pyx_type_4borg_8platform_6darwin___pyx_scope_struct__listxattr __pyx_mstate_global->__pyx_type_4borg_8platform_6darwin___pyx_scope_struct__listxattr #define __pyx_type_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr __pyx_mstate_global->__pyx_type_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr #define __pyx_type_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr __pyx_mstate_global->__pyx_type_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr #endif #define __pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct__listxattr __pyx_mstate_global->__pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct__listxattr #define __pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr __pyx_mstate_global->__pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr #define __pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr __pyx_mstate_global->__pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr #define __pyx_kp_s_1_4_01 __pyx_mstate_global->__pyx_kp_s_1_4_01 #define __pyx_n_s_API_VERSION __pyx_mstate_global->__pyx_n_s_API_VERSION #define __pyx_n_s_OSError __pyx_mstate_global->__pyx_n_s_OSError #define __pyx_n_s__10 __pyx_mstate_global->__pyx_n_s__10 #define __pyx_kp_u__11 __pyx_mstate_global->__pyx_kp_u__11 #define __pyx_n_s__26 __pyx_mstate_global->__pyx_n_s__26 #define __pyx_kp_s__7 __pyx_mstate_global->__pyx_kp_s__7 #define __pyx_kp_s__8 __pyx_mstate_global->__pyx_kp_s__8 #define __pyx_kp_s__9 __pyx_mstate_global->__pyx_kp_s__9 #define __pyx_n_s_acl __pyx_mstate_global->__pyx_n_s_acl #define __pyx_n_s_acl_extended __pyx_mstate_global->__pyx_n_s_acl_extended #define __pyx_n_s_acl_get __pyx_mstate_global->__pyx_n_s_acl_get #define __pyx_n_s_acl_set __pyx_mstate_global->__pyx_n_s_acl_set #define __pyx_n_s_acl_text __pyx_mstate_global->__pyx_n_s_acl_text #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_borg_platform_darwin __pyx_mstate_global->__pyx_n_s_borg_platform_darwin #define __pyx_n_s_buf __pyx_mstate_global->__pyx_n_s_buf #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable #define __pyx_n_s_entries __pyx_mstate_global->__pyx_n_s_entries #define __pyx_n_s_entry __pyx_mstate_global->__pyx_n_s_entry #define __pyx_n_s_fd __pyx_mstate_global->__pyx_n_s_fd #define __pyx_n_s_fields __pyx_mstate_global->__pyx_n_s_fields #define __pyx_n_s_follow_symlinks __pyx_mstate_global->__pyx_n_s_follow_symlinks #define __pyx_n_s_fsdecode __pyx_mstate_global->__pyx_n_s_fsdecode #define __pyx_n_s_fsencode __pyx_mstate_global->__pyx_n_s_fsencode #define __pyx_n_s_func __pyx_mstate_global->__pyx_n_s_func #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc #define __pyx_n_s_get __pyx_mstate_global->__pyx_n_s_get #define __pyx_n_s_getxattr __pyx_mstate_global->__pyx_n_s_getxattr #define __pyx_n_s_getxattr_inner __pyx_mstate_global->__pyx_n_s_getxattr_inner #define __pyx_n_s_getxattr_locals_func __pyx_mstate_global->__pyx_n_s_getxattr_locals_func #define __pyx_n_s_group __pyx_mstate_global->__pyx_n_s_group #define __pyx_n_s_group2gid __pyx_mstate_global->__pyx_n_s_group2gid #define __pyx_n_s_helpers __pyx_mstate_global->__pyx_n_s_helpers #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled #define __pyx_n_s_item __pyx_mstate_global->__pyx_n_s_item #define __pyx_n_s_join __pyx_mstate_global->__pyx_n_s_join #define __pyx_n_s_listxattr __pyx_mstate_global->__pyx_n_s_listxattr #define __pyx_n_s_listxattr_inner __pyx_mstate_global->__pyx_n_s_listxattr_inner #define __pyx_n_s_listxattr_locals_func __pyx_mstate_global->__pyx_n_s_listxattr_locals_func #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_n __pyx_mstate_global->__pyx_n_s_n #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_name_2 __pyx_mstate_global->__pyx_n_s_name_2 #define __pyx_n_s_numeric_ids __pyx_mstate_global->__pyx_n_s_numeric_ids #define __pyx_n_s_os __pyx_mstate_global->__pyx_n_s_os #define __pyx_n_s_path __pyx_mstate_global->__pyx_n_s_path #define __pyx_n_s_posix __pyx_mstate_global->__pyx_n_s_posix #define __pyx_n_s_remove_non_numeric_identifier __pyx_mstate_global->__pyx_n_s_remove_non_numeric_identifier #define __pyx_n_s_remove_numeric_id_if_possible __pyx_mstate_global->__pyx_n_s_remove_numeric_id_if_possible #define __pyx_n_s_safe_decode __pyx_mstate_global->__pyx_n_s_safe_decode #define __pyx_n_s_safe_encode __pyx_mstate_global->__pyx_n_s_safe_encode #define __pyx_n_s_setxattr __pyx_mstate_global->__pyx_n_s_setxattr #define __pyx_n_s_setxattr_inner __pyx_mstate_global->__pyx_n_s_setxattr_inner #define __pyx_n_s_setxattr_locals_func __pyx_mstate_global->__pyx_n_s_setxattr_locals_func #define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_n_s_split __pyx_mstate_global->__pyx_n_s_split #define __pyx_n_s_split_string0 __pyx_mstate_global->__pyx_n_s_split_string0 #define __pyx_kp_s_src_borg_platform_darwin_pyx __pyx_mstate_global->__pyx_kp_s_src_borg_platform_darwin_pyx #define __pyx_n_s_st __pyx_mstate_global->__pyx_n_s_st #define __pyx_n_s_strerror __pyx_mstate_global->__pyx_n_s_strerror #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_text __pyx_mstate_global->__pyx_n_s_text #define __pyx_n_s_user __pyx_mstate_global->__pyx_n_s_user #define __pyx_n_s_user2uid __pyx_mstate_global->__pyx_n_s_user2uid #define __pyx_n_s_value __pyx_mstate_global->__pyx_n_s_value #define __pyx_n_s_xattr __pyx_mstate_global->__pyx_n_s_xattr #define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_ #define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 #define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5 #define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12 #define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 #define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16 #define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18 #define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21 #define __pyx_tuple__23 __pyx_mstate_global->__pyx_tuple__23 #define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24 #define __pyx_codeobj__2 __pyx_mstate_global->__pyx_codeobj__2 #define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4 #define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6 #define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 #define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 #define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19 #define __pyx_codeobj__20 __pyx_mstate_global->__pyx_codeobj__20 #define __pyx_codeobj__22 __pyx_mstate_global->__pyx_codeobj__22 #define __pyx_codeobj__25 __pyx_mstate_global->__pyx_codeobj__25 /* #### Code section: module_code ### */ /* "borg/platform/darwin.pyx":41 * * * def listxattr(path, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, buf, size): * if isinstance(path, int): */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_6darwin_1listxattr(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8platform_6darwin_1listxattr = {"listxattr", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_6darwin_1listxattr, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8platform_6darwin_1listxattr(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_path = 0; PyObject *__pyx_v_follow_symlinks = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("listxattr (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_follow_symlinks,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_path)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 41, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (kw_args == 1) { const Py_ssize_t index = 1; PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 41, __pyx_L3_error) } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "listxattr") < 0)) __PYX_ERR(0, 41, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_path = values[0]; __pyx_v_follow_symlinks = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("listxattr", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 41, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.darwin.listxattr", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_6darwin_listxattr(__pyx_self, __pyx_v_path, __pyx_v_follow_symlinks); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/darwin.pyx":42 * * def listxattr(path, *, follow_symlinks=False): * def func(path, buf, size): # <<<<<<<<<<<<<< * if isinstance(path, int): * return c_flistxattr(path, buf, size, XATTR_NOFLAGS) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_6darwin_9listxattr_1func(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8platform_6darwin_9listxattr_1func = {"func", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_6darwin_9listxattr_1func, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8platform_6darwin_9listxattr_1func(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_path = 0; PyObject *__pyx_v_buf = 0; PyObject *__pyx_v_size = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("func (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_buf,&__pyx_n_s_size,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_path)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 42, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_buf)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 42, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("func", 1, 3, 3, 1); __PYX_ERR(0, 42, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 42, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("func", 1, 3, 3, 2); __PYX_ERR(0, 42, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "func") < 0)) __PYX_ERR(0, 42, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_path = values[0]; __pyx_v_buf = values[1]; __pyx_v_size = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("func", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 42, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.darwin.listxattr.func", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_6darwin_9listxattr_func(__pyx_self, __pyx_v_path, __pyx_v_buf, __pyx_v_size); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8platform_6darwin_9listxattr_func(PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_buf, PyObject *__pyx_v_size) { struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct__listxattr *__pyx_cur_scope; struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct__listxattr *__pyx_outer_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; char *__pyx_t_3; size_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; char const *__pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("func", 1); __pyx_outer_scope = (struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct__listxattr *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; /* "borg/platform/darwin.pyx":43 * def listxattr(path, *, follow_symlinks=False): * def func(path, buf, size): * if isinstance(path, int): # <<<<<<<<<<<<<< * return c_flistxattr(path, buf, size, XATTR_NOFLAGS) * else: */ __pyx_t_1 = PyInt_Check(__pyx_v_path); if (__pyx_t_1) { /* "borg/platform/darwin.pyx":44 * def func(path, buf, size): * if isinstance(path, int): * return c_flistxattr(path, buf, size, XATTR_NOFLAGS) # <<<<<<<<<<<<<< * else: * if follow_symlinks: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_path); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_AsWritableString(__pyx_v_buf); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_v_size); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L1_error) __pyx_t_5 = PyInt_FromSsize_t(flistxattr(__pyx_t_2, ((char *)__pyx_t_3), __pyx_t_4, __pyx_v_4borg_8platform_6darwin_XATTR_NOFLAGS)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "borg/platform/darwin.pyx":43 * def listxattr(path, *, follow_symlinks=False): * def func(path, buf, size): * if isinstance(path, int): # <<<<<<<<<<<<<< * return c_flistxattr(path, buf, size, XATTR_NOFLAGS) * else: */ } /* "borg/platform/darwin.pyx":46 * return c_flistxattr(path, buf, size, XATTR_NOFLAGS) * else: * if follow_symlinks: # <<<<<<<<<<<<<< * return c_listxattr(path, buf, size, XATTR_NOFLAGS) * else: */ /*else*/ { if (unlikely(!__pyx_cur_scope->__pyx_v_follow_symlinks)) { __Pyx_RaiseClosureNameError("follow_symlinks"); __PYX_ERR(0, 46, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_follow_symlinks); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 46, __pyx_L1_error) if (__pyx_t_1) { /* "borg/platform/darwin.pyx":47 * else: * if follow_symlinks: * return c_listxattr(path, buf, size, XATTR_NOFLAGS) # <<<<<<<<<<<<<< * else: * return c_listxattr(path, buf, size, XATTR_NOFOLLOW) */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_path); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 47, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_AsWritableString(__pyx_v_buf); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 47, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_v_size); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 47, __pyx_L1_error) __pyx_t_5 = PyInt_FromSsize_t(listxattr(__pyx_t_6, ((char *)__pyx_t_3), __pyx_t_4, __pyx_v_4borg_8platform_6darwin_XATTR_NOFLAGS)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "borg/platform/darwin.pyx":46 * return c_flistxattr(path, buf, size, XATTR_NOFLAGS) * else: * if follow_symlinks: # <<<<<<<<<<<<<< * return c_listxattr(path, buf, size, XATTR_NOFLAGS) * else: */ } /* "borg/platform/darwin.pyx":49 * return c_listxattr(path, buf, size, XATTR_NOFLAGS) * else: * return c_listxattr(path, buf, size, XATTR_NOFOLLOW) # <<<<<<<<<<<<<< * * n, buf = _listxattr_inner(func, path) */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_path); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 49, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_AsWritableString(__pyx_v_buf); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 49, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_v_size); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 49, __pyx_L1_error) __pyx_t_5 = PyInt_FromSsize_t(listxattr(__pyx_t_6, ((char *)__pyx_t_3), __pyx_t_4, XATTR_NOFOLLOW)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; } } /* "borg/platform/darwin.pyx":42 * * def listxattr(path, *, follow_symlinks=False): * def func(path, buf, size): # <<<<<<<<<<<<<< * if isinstance(path, int): * return c_flistxattr(path, buf, size, XATTR_NOFLAGS) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("borg.platform.darwin.listxattr.func", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/darwin.pyx":41 * * * def listxattr(path, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, buf, size): * if isinstance(path, int): */ static PyObject *__pyx_pf_4borg_8platform_6darwin_listxattr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_follow_symlinks) { struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct__listxattr *__pyx_cur_scope; PyObject *__pyx_v_func = 0; PyObject *__pyx_v_n = NULL; PyObject *__pyx_v_buf = NULL; PyObject *__pyx_7genexpr__pyx_v_name = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); PyObject *__pyx_t_7 = NULL; Py_ssize_t __pyx_t_8; PyObject *(*__pyx_t_9)(PyObject *); int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("listxattr", 0); __pyx_cur_scope = (struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct__listxattr *)__pyx_tp_new_4borg_8platform_6darwin___pyx_scope_struct__listxattr(__pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct__listxattr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct__listxattr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 41, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_follow_symlinks = __pyx_v_follow_symlinks; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_follow_symlinks); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_follow_symlinks); /* "borg/platform/darwin.pyx":42 * * def listxattr(path, *, follow_symlinks=False): * def func(path, buf, size): # <<<<<<<<<<<<<< * if isinstance(path, int): * return c_flistxattr(path, buf, size, XATTR_NOFLAGS) */ __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_6darwin_9listxattr_1func, 0, __pyx_n_s_listxattr_locals_func, ((PyObject*)__pyx_cur_scope), __pyx_n_s_borg_platform_darwin, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_func = __pyx_t_1; __pyx_t_1 = 0; /* "borg/platform/darwin.pyx":51 * return c_listxattr(path, buf, size, XATTR_NOFOLLOW) * * n, buf = _listxattr_inner(func, path) # <<<<<<<<<<<<<< * return [name for name in split_string0(buf[:n]) if name] * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_listxattr_inner); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_func, __pyx_v_path}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 51, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 51, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 51, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_n = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_buf = __pyx_t_3; __pyx_t_3 = 0; /* "borg/platform/darwin.pyx":52 * * n, buf = _listxattr_inner(func, path) * return [name for name in split_string0(buf[:n]) if name] # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_split_string0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_buf, 0, 0, NULL, &__pyx_v_n, NULL, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 52, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 52, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 52, __pyx_L7_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_9)) { if (likely(PyList_CheckExact(__pyx_t_2))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 52, __pyx_L7_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 52, __pyx_L7_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 52, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 52, __pyx_L7_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 52, __pyx_L7_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 52, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_9(__pyx_t_2); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 52, __pyx_L7_error) } break; } __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_name, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_7genexpr__pyx_v_name); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 52, __pyx_L7_error) if (__pyx_t_10) { if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_7genexpr__pyx_v_name))) __PYX_ERR(0, 52, __pyx_L7_error) } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_7genexpr__pyx_v_name); __pyx_7genexpr__pyx_v_name = 0; goto __pyx_L12_exit_scope; __pyx_L7_error:; __Pyx_XDECREF(__pyx_7genexpr__pyx_v_name); __pyx_7genexpr__pyx_v_name = 0; goto __pyx_L1_error; __pyx_L12_exit_scope:; } /* exit inner scope */ __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/platform/darwin.pyx":41 * * * def listxattr(path, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, buf, size): * if isinstance(path, int): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("borg.platform.darwin.listxattr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_func); __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_buf); __Pyx_XDECREF(__pyx_7genexpr__pyx_v_name); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/darwin.pyx":55 * * * def getxattr(path, name, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, name, buf, size): * if isinstance(path, int): */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_6darwin_3getxattr(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8platform_6darwin_3getxattr = {"getxattr", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_6darwin_3getxattr, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8platform_6darwin_3getxattr(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_path = 0; PyObject *__pyx_v_name = 0; PyObject *__pyx_v_follow_symlinks = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getxattr (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_name,&__pyx_n_s_follow_symlinks,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_path)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("getxattr", 1, 2, 2, 1); __PYX_ERR(0, 55, __pyx_L3_error) } } if (kw_args == 1) { const Py_ssize_t index = 2; PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L3_error) } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getxattr") < 0)) __PYX_ERR(0, 55, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_path = values[0]; __pyx_v_name = values[1]; __pyx_v_follow_symlinks = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getxattr", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 55, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.darwin.getxattr", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_6darwin_2getxattr(__pyx_self, __pyx_v_path, __pyx_v_name, __pyx_v_follow_symlinks); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/darwin.pyx":56 * * def getxattr(path, name, *, follow_symlinks=False): * def func(path, name, buf, size): # <<<<<<<<<<<<<< * if isinstance(path, int): * return c_fgetxattr(path, name, buf, size, 0, XATTR_NOFLAGS) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_6darwin_8getxattr_1func(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8platform_6darwin_8getxattr_1func = {"func", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_6darwin_8getxattr_1func, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8platform_6darwin_8getxattr_1func(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_path = 0; PyObject *__pyx_v_name = 0; PyObject *__pyx_v_buf = 0; PyObject *__pyx_v_size = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("func (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_name,&__pyx_n_s_buf,&__pyx_n_s_size,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_path)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("func", 1, 4, 4, 1); __PYX_ERR(0, 56, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_buf)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("func", 1, 4, 4, 2); __PYX_ERR(0, 56, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("func", 1, 4, 4, 3); __PYX_ERR(0, 56, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "func") < 0)) __PYX_ERR(0, 56, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); } __pyx_v_path = values[0]; __pyx_v_name = values[1]; __pyx_v_buf = values[2]; __pyx_v_size = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("func", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 56, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.darwin.getxattr.func", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_6darwin_8getxattr_func(__pyx_self, __pyx_v_path, __pyx_v_name, __pyx_v_buf, __pyx_v_size); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8platform_6darwin_8getxattr_func(PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_name, PyObject *__pyx_v_buf, PyObject *__pyx_v_size) { struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr *__pyx_cur_scope; struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr *__pyx_outer_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; char const *__pyx_t_3; char *__pyx_t_4; size_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; char const *__pyx_t_7; char const *__pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("func", 1); __pyx_outer_scope = (struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; /* "borg/platform/darwin.pyx":57 * def getxattr(path, name, *, follow_symlinks=False): * def func(path, name, buf, size): * if isinstance(path, int): # <<<<<<<<<<<<<< * return c_fgetxattr(path, name, buf, size, 0, XATTR_NOFLAGS) * else: */ __pyx_t_1 = PyInt_Check(__pyx_v_path); if (__pyx_t_1) { /* "borg/platform/darwin.pyx":58 * def func(path, name, buf, size): * if isinstance(path, int): * return c_fgetxattr(path, name, buf, size, 0, XATTR_NOFLAGS) # <<<<<<<<<<<<<< * else: * if follow_symlinks: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_path); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 58, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 58, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_AsWritableString(__pyx_v_buf); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 58, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_v_size); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 58, __pyx_L1_error) __pyx_t_6 = PyInt_FromSsize_t(fgetxattr(__pyx_t_2, __pyx_t_3, ((char *)__pyx_t_4), __pyx_t_5, 0, __pyx_v_4borg_8platform_6darwin_XATTR_NOFLAGS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "borg/platform/darwin.pyx":57 * def getxattr(path, name, *, follow_symlinks=False): * def func(path, name, buf, size): * if isinstance(path, int): # <<<<<<<<<<<<<< * return c_fgetxattr(path, name, buf, size, 0, XATTR_NOFLAGS) * else: */ } /* "borg/platform/darwin.pyx":60 * return c_fgetxattr(path, name, buf, size, 0, XATTR_NOFLAGS) * else: * if follow_symlinks: # <<<<<<<<<<<<<< * return c_getxattr(path, name, buf, size, 0, XATTR_NOFLAGS) * else: */ /*else*/ { if (unlikely(!__pyx_cur_scope->__pyx_v_follow_symlinks)) { __Pyx_RaiseClosureNameError("follow_symlinks"); __PYX_ERR(0, 60, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_follow_symlinks); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 60, __pyx_L1_error) if (__pyx_t_1) { /* "borg/platform/darwin.pyx":61 * else: * if follow_symlinks: * return c_getxattr(path, name, buf, size, 0, XATTR_NOFLAGS) # <<<<<<<<<<<<<< * else: * return c_getxattr(path, name, buf, size, 0, XATTR_NOFOLLOW) */ __Pyx_XDECREF(__pyx_r); __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_path); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L1_error) __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_AsWritableString(__pyx_v_buf); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_v_size); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L1_error) __pyx_t_6 = PyInt_FromSsize_t(getxattr(__pyx_t_7, __pyx_t_8, ((char *)__pyx_t_4), __pyx_t_5, 0, __pyx_v_4borg_8platform_6darwin_XATTR_NOFLAGS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "borg/platform/darwin.pyx":60 * return c_fgetxattr(path, name, buf, size, 0, XATTR_NOFLAGS) * else: * if follow_symlinks: # <<<<<<<<<<<<<< * return c_getxattr(path, name, buf, size, 0, XATTR_NOFLAGS) * else: */ } /* "borg/platform/darwin.pyx":63 * return c_getxattr(path, name, buf, size, 0, XATTR_NOFLAGS) * else: * return c_getxattr(path, name, buf, size, 0, XATTR_NOFOLLOW) # <<<<<<<<<<<<<< * * n, buf = _getxattr_inner(func, path, name) */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_path); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error) __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_AsWritableString(__pyx_v_buf); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_v_size); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error) __pyx_t_6 = PyInt_FromSsize_t(getxattr(__pyx_t_7, __pyx_t_8, ((char *)__pyx_t_4), __pyx_t_5, 0, XATTR_NOFOLLOW)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; } } /* "borg/platform/darwin.pyx":56 * * def getxattr(path, name, *, follow_symlinks=False): * def func(path, name, buf, size): # <<<<<<<<<<<<<< * if isinstance(path, int): * return c_fgetxattr(path, name, buf, size, 0, XATTR_NOFLAGS) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("borg.platform.darwin.getxattr.func", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/darwin.pyx":55 * * * def getxattr(path, name, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, name, buf, size): * if isinstance(path, int): */ static PyObject *__pyx_pf_4borg_8platform_6darwin_2getxattr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_name, PyObject *__pyx_v_follow_symlinks) { struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr *__pyx_cur_scope; PyObject *__pyx_v_func = 0; PyObject *__pyx_v_n = NULL; PyObject *__pyx_v_buf = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getxattr", 0); __pyx_cur_scope = (struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr *)__pyx_tp_new_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr(__pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 55, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_follow_symlinks = __pyx_v_follow_symlinks; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_follow_symlinks); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_follow_symlinks); /* "borg/platform/darwin.pyx":56 * * def getxattr(path, name, *, follow_symlinks=False): * def func(path, name, buf, size): # <<<<<<<<<<<<<< * if isinstance(path, int): * return c_fgetxattr(path, name, buf, size, 0, XATTR_NOFLAGS) */ __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_6darwin_8getxattr_1func, 0, __pyx_n_s_getxattr_locals_func, ((PyObject*)__pyx_cur_scope), __pyx_n_s_borg_platform_darwin, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_func = __pyx_t_1; __pyx_t_1 = 0; /* "borg/platform/darwin.pyx":65 * return c_getxattr(path, name, buf, size, 0, XATTR_NOFOLLOW) * * n, buf = _getxattr_inner(func, path, name) # <<<<<<<<<<<<<< * return bytes(buf[:n]) * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_getxattr_inner); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_func, __pyx_v_path, __pyx_v_name}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 3+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 65, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 65, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 65, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_n = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_buf = __pyx_t_3; __pyx_t_3 = 0; /* "borg/platform/darwin.pyx":66 * * n, buf = _getxattr_inner(func, path, name) * return bytes(buf[:n]) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_buf, 0, 0, NULL, &__pyx_v_n, NULL, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "borg/platform/darwin.pyx":55 * * * def getxattr(path, name, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, name, buf, size): * if isinstance(path, int): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("borg.platform.darwin.getxattr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_func); __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_buf); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/darwin.pyx":69 * * * def setxattr(path, name, value, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, name, value, size): * if isinstance(path, int): */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_6darwin_5setxattr(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8platform_6darwin_5setxattr = {"setxattr", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_6darwin_5setxattr, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8platform_6darwin_5setxattr(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_path = 0; PyObject *__pyx_v_name = 0; PyObject *__pyx_v_value = 0; PyObject *__pyx_v_follow_symlinks = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setxattr (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_name,&__pyx_n_s_value,&__pyx_n_s_follow_symlinks,0}; values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_path)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 69, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 69, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setxattr", 1, 3, 3, 1); __PYX_ERR(0, 69, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 69, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setxattr", 1, 3, 3, 2); __PYX_ERR(0, 69, __pyx_L3_error) } } if (kw_args == 1) { const Py_ssize_t index = 3; PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 69, __pyx_L3_error) } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setxattr") < 0)) __PYX_ERR(0, 69, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_path = values[0]; __pyx_v_name = values[1]; __pyx_v_value = values[2]; __pyx_v_follow_symlinks = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setxattr", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 69, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.darwin.setxattr", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_6darwin_4setxattr(__pyx_self, __pyx_v_path, __pyx_v_name, __pyx_v_value, __pyx_v_follow_symlinks); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/darwin.pyx":70 * * def setxattr(path, name, value, *, follow_symlinks=False): * def func(path, name, value, size): # <<<<<<<<<<<<<< * if isinstance(path, int): * return c_fsetxattr(path, name, value, size, 0, XATTR_NOFLAGS) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_6darwin_8setxattr_1func(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8platform_6darwin_8setxattr_1func = {"func", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_6darwin_8setxattr_1func, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8platform_6darwin_8setxattr_1func(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_path = 0; PyObject *__pyx_v_name = 0; PyObject *__pyx_v_value = 0; PyObject *__pyx_v_size = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("func (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_name,&__pyx_n_s_value,&__pyx_n_s_size,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_path)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 70, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 70, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("func", 1, 4, 4, 1); __PYX_ERR(0, 70, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 70, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("func", 1, 4, 4, 2); __PYX_ERR(0, 70, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 70, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("func", 1, 4, 4, 3); __PYX_ERR(0, 70, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "func") < 0)) __PYX_ERR(0, 70, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); } __pyx_v_path = values[0]; __pyx_v_name = values[1]; __pyx_v_value = values[2]; __pyx_v_size = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("func", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 70, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.darwin.setxattr.func", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_6darwin_8setxattr_func(__pyx_self, __pyx_v_path, __pyx_v_name, __pyx_v_value, __pyx_v_size); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8platform_6darwin_8setxattr_func(PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_name, PyObject *__pyx_v_value, PyObject *__pyx_v_size) { struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr *__pyx_cur_scope; struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr *__pyx_outer_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; char const *__pyx_t_3; char *__pyx_t_4; size_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; char const *__pyx_t_7; char const *__pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("func", 1); __pyx_outer_scope = (struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; /* "borg/platform/darwin.pyx":71 * def setxattr(path, name, value, *, follow_symlinks=False): * def func(path, name, value, size): * if isinstance(path, int): # <<<<<<<<<<<<<< * return c_fsetxattr(path, name, value, size, 0, XATTR_NOFLAGS) * else: */ __pyx_t_1 = PyInt_Check(__pyx_v_path); if (__pyx_t_1) { /* "borg/platform/darwin.pyx":72 * def func(path, name, value, size): * if isinstance(path, int): * return c_fsetxattr(path, name, value, size, 0, XATTR_NOFLAGS) # <<<<<<<<<<<<<< * else: * if follow_symlinks: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_path); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 72, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 72, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_AsWritableString(__pyx_v_value); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 72, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_v_size); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 72, __pyx_L1_error) __pyx_t_6 = __Pyx_PyInt_From_int(fsetxattr(__pyx_t_2, __pyx_t_3, ((char *)__pyx_t_4), __pyx_t_5, 0, __pyx_v_4borg_8platform_6darwin_XATTR_NOFLAGS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "borg/platform/darwin.pyx":71 * def setxattr(path, name, value, *, follow_symlinks=False): * def func(path, name, value, size): * if isinstance(path, int): # <<<<<<<<<<<<<< * return c_fsetxattr(path, name, value, size, 0, XATTR_NOFLAGS) * else: */ } /* "borg/platform/darwin.pyx":74 * return c_fsetxattr(path, name, value, size, 0, XATTR_NOFLAGS) * else: * if follow_symlinks: # <<<<<<<<<<<<<< * return c_setxattr(path, name, value, size, 0, XATTR_NOFLAGS) * else: */ /*else*/ { if (unlikely(!__pyx_cur_scope->__pyx_v_follow_symlinks)) { __Pyx_RaiseClosureNameError("follow_symlinks"); __PYX_ERR(0, 74, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_follow_symlinks); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 74, __pyx_L1_error) if (__pyx_t_1) { /* "borg/platform/darwin.pyx":75 * else: * if follow_symlinks: * return c_setxattr(path, name, value, size, 0, XATTR_NOFLAGS) # <<<<<<<<<<<<<< * else: * return c_setxattr(path, name, value, size, 0, XATTR_NOFOLLOW) */ __Pyx_XDECREF(__pyx_r); __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_path); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 75, __pyx_L1_error) __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 75, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_AsWritableString(__pyx_v_value); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 75, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_v_size); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 75, __pyx_L1_error) __pyx_t_6 = __Pyx_PyInt_From_int(setxattr(__pyx_t_7, __pyx_t_8, ((char *)__pyx_t_4), __pyx_t_5, 0, __pyx_v_4borg_8platform_6darwin_XATTR_NOFLAGS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "borg/platform/darwin.pyx":74 * return c_fsetxattr(path, name, value, size, 0, XATTR_NOFLAGS) * else: * if follow_symlinks: # <<<<<<<<<<<<<< * return c_setxattr(path, name, value, size, 0, XATTR_NOFLAGS) * else: */ } /* "borg/platform/darwin.pyx":77 * return c_setxattr(path, name, value, size, 0, XATTR_NOFLAGS) * else: * return c_setxattr(path, name, value, size, 0, XATTR_NOFOLLOW) # <<<<<<<<<<<<<< * * _setxattr_inner(func, path, name, value) */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_path); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 77, __pyx_L1_error) __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 77, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_AsWritableString(__pyx_v_value); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 77, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_v_size); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 77, __pyx_L1_error) __pyx_t_6 = __Pyx_PyInt_From_int(setxattr(__pyx_t_7, __pyx_t_8, ((char *)__pyx_t_4), __pyx_t_5, 0, XATTR_NOFOLLOW)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; } } /* "borg/platform/darwin.pyx":70 * * def setxattr(path, name, value, *, follow_symlinks=False): * def func(path, name, value, size): # <<<<<<<<<<<<<< * if isinstance(path, int): * return c_fsetxattr(path, name, value, size, 0, XATTR_NOFLAGS) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("borg.platform.darwin.setxattr.func", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/darwin.pyx":69 * * * def setxattr(path, name, value, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, name, value, size): * if isinstance(path, int): */ static PyObject *__pyx_pf_4borg_8platform_6darwin_4setxattr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_name, PyObject *__pyx_v_value, PyObject *__pyx_v_follow_symlinks) { struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr *__pyx_cur_scope; PyObject *__pyx_v_func = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setxattr", 0); __pyx_cur_scope = (struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr *)__pyx_tp_new_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr(__pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 69, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_follow_symlinks = __pyx_v_follow_symlinks; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_follow_symlinks); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_follow_symlinks); /* "borg/platform/darwin.pyx":70 * * def setxattr(path, name, value, *, follow_symlinks=False): * def func(path, name, value, size): # <<<<<<<<<<<<<< * if isinstance(path, int): * return c_fsetxattr(path, name, value, size, 0, XATTR_NOFLAGS) */ __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_6darwin_8setxattr_1func, 0, __pyx_n_s_setxattr_locals_func, ((PyObject*)__pyx_cur_scope), __pyx_n_s_borg_platform_darwin, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_func = __pyx_t_1; __pyx_t_1 = 0; /* "borg/platform/darwin.pyx":79 * return c_setxattr(path, name, value, size, 0, XATTR_NOFOLLOW) * * _setxattr_inner(func, path, name, value) # <<<<<<<<<<<<<< * * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_setxattr_inner); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_v_func, __pyx_v_path, __pyx_v_name, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/platform/darwin.pyx":69 * * * def setxattr(path, name, value, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, name, value, size): * if isinstance(path, int): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("borg.platform.darwin.setxattr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_func); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/darwin.pyx":82 * * * def _remove_numeric_id_if_possible(acl): # <<<<<<<<<<<<<< * """Replace the user/group field with the local uid/gid if possible * """ */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_6darwin_7_remove_numeric_id_if_possible(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_8platform_6darwin_6_remove_numeric_id_if_possible, "Replace the user/group field with the local uid/gid if possible\n "); static PyMethodDef __pyx_mdef_4borg_8platform_6darwin_7_remove_numeric_id_if_possible = {"_remove_numeric_id_if_possible", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_6darwin_7_remove_numeric_id_if_possible, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_8platform_6darwin_6_remove_numeric_id_if_possible}; static PyObject *__pyx_pw_4borg_8platform_6darwin_7_remove_numeric_id_if_possible(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_acl = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_remove_numeric_id_if_possible (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_acl,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_acl)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_remove_numeric_id_if_possible") < 0)) __PYX_ERR(0, 82, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_acl = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_remove_numeric_id_if_possible", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 82, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.darwin._remove_numeric_id_if_possible", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_6darwin_6_remove_numeric_id_if_possible(__pyx_self, __pyx_v_acl); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8platform_6darwin_6_remove_numeric_id_if_possible(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_acl) { PyObject *__pyx_v_entries = NULL; PyObject *__pyx_v_entry = NULL; PyObject *__pyx_v_fields = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; Py_ssize_t __pyx_t_6; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_remove_numeric_id_if_possible", 1); /* "borg/platform/darwin.pyx":85 * """Replace the user/group field with the local uid/gid if possible * """ * entries = [] # <<<<<<<<<<<<<< * for entry in safe_decode(acl).split('\n'): * if entry: */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_entries = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "borg/platform/darwin.pyx":86 * """ * entries = [] * for entry in safe_decode(acl).split('\n'): # <<<<<<<<<<<<<< * if entry: * fields = entry.split(':') */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_safe_decode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_acl}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_s__7}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 86, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_3))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 86, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 86, __pyx_L1_error) #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 86, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 86, __pyx_L1_error) #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 86, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_entry, __pyx_t_1); __pyx_t_1 = 0; /* "borg/platform/darwin.pyx":87 * entries = [] * for entry in safe_decode(acl).split('\n'): * if entry: # <<<<<<<<<<<<<< * fields = entry.split(':') * if fields[0] == 'user': */ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_entry); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 87, __pyx_L1_error) if (__pyx_t_8) { /* "borg/platform/darwin.pyx":88 * for entry in safe_decode(acl).split('\n'): * if entry: * fields = entry.split(':') # <<<<<<<<<<<<<< * if fields[0] == 'user': * if user2uid(fields[2]) is not None: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_entry, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s__8}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_XDECREF_SET(__pyx_v_fields, __pyx_t_1); __pyx_t_1 = 0; /* "borg/platform/darwin.pyx":89 * if entry: * fields = entry.split(':') * if fields[0] == 'user': # <<<<<<<<<<<<<< * if user2uid(fields[2]) is not None: * fields[1] = fields[3] = '' */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_fields, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_user, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_8) { /* "borg/platform/darwin.pyx":90 * fields = entry.split(':') * if fields[0] == 'user': * if user2uid(fields[2]) is not None: # <<<<<<<<<<<<<< * fields[1] = fields[3] = '' * elif fields[0] == 'group': */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_user2uid); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_fields, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_8 = (__pyx_t_1 != Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_8) { /* "borg/platform/darwin.pyx":91 * if fields[0] == 'user': * if user2uid(fields[2]) is not None: * fields[1] = fields[3] = '' # <<<<<<<<<<<<<< * elif fields[0] == 'group': * if group2gid(fields[2]) is not None: */ if (unlikely((__Pyx_SetItemInt(__pyx_v_fields, 1, __pyx_kp_s__9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0))) __PYX_ERR(0, 91, __pyx_L1_error) if (unlikely((__Pyx_SetItemInt(__pyx_v_fields, 3, __pyx_kp_s__9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0))) __PYX_ERR(0, 91, __pyx_L1_error) /* "borg/platform/darwin.pyx":90 * fields = entry.split(':') * if fields[0] == 'user': * if user2uid(fields[2]) is not None: # <<<<<<<<<<<<<< * fields[1] = fields[3] = '' * elif fields[0] == 'group': */ } /* "borg/platform/darwin.pyx":89 * if entry: * fields = entry.split(':') * if fields[0] == 'user': # <<<<<<<<<<<<<< * if user2uid(fields[2]) is not None: * fields[1] = fields[3] = '' */ goto __pyx_L6; } /* "borg/platform/darwin.pyx":92 * if user2uid(fields[2]) is not None: * fields[1] = fields[3] = '' * elif fields[0] == 'group': # <<<<<<<<<<<<<< * if group2gid(fields[2]) is not None: * fields[1] = fields[3] = '' */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_fields, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_group, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_8) { /* "borg/platform/darwin.pyx":93 * fields[1] = fields[3] = '' * elif fields[0] == 'group': * if group2gid(fields[2]) is not None: # <<<<<<<<<<<<<< * fields[1] = fields[3] = '' * entries.append(':'.join(fields)) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_group2gid); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_fields, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_8 = (__pyx_t_1 != Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_8) { /* "borg/platform/darwin.pyx":94 * elif fields[0] == 'group': * if group2gid(fields[2]) is not None: * fields[1] = fields[3] = '' # <<<<<<<<<<<<<< * entries.append(':'.join(fields)) * return safe_encode('\n'.join(entries)) */ if (unlikely((__Pyx_SetItemInt(__pyx_v_fields, 1, __pyx_kp_s__9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0))) __PYX_ERR(0, 94, __pyx_L1_error) if (unlikely((__Pyx_SetItemInt(__pyx_v_fields, 3, __pyx_kp_s__9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0))) __PYX_ERR(0, 94, __pyx_L1_error) /* "borg/platform/darwin.pyx":93 * fields[1] = fields[3] = '' * elif fields[0] == 'group': * if group2gid(fields[2]) is not None: # <<<<<<<<<<<<<< * fields[1] = fields[3] = '' * entries.append(':'.join(fields)) */ } /* "borg/platform/darwin.pyx":92 * if user2uid(fields[2]) is not None: * fields[1] = fields[3] = '' * elif fields[0] == 'group': # <<<<<<<<<<<<<< * if group2gid(fields[2]) is not None: * fields[1] = fields[3] = '' */ } __pyx_L6:; /* "borg/platform/darwin.pyx":95 * if group2gid(fields[2]) is not None: * fields[1] = fields[3] = '' * entries.append(':'.join(fields)) # <<<<<<<<<<<<<< * return safe_encode('\n'.join(entries)) * */ __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__8, __pyx_v_fields); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_entries, __pyx_t_1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/platform/darwin.pyx":87 * entries = [] * for entry in safe_decode(acl).split('\n'): * if entry: # <<<<<<<<<<<<<< * fields = entry.split(':') * if fields[0] == 'user': */ } /* "borg/platform/darwin.pyx":86 * """ * entries = [] * for entry in safe_decode(acl).split('\n'): # <<<<<<<<<<<<<< * if entry: * fields = entry.split(':') */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/darwin.pyx":96 * fields[1] = fields[3] = '' * entries.append(':'.join(fields)) * return safe_encode('\n'.join(entries)) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_safe_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__7, __pyx_v_entries); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "borg/platform/darwin.pyx":82 * * * def _remove_numeric_id_if_possible(acl): # <<<<<<<<<<<<<< * """Replace the user/group field with the local uid/gid if possible * """ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("borg.platform.darwin._remove_numeric_id_if_possible", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_entries); __Pyx_XDECREF(__pyx_v_entry); __Pyx_XDECREF(__pyx_v_fields); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/darwin.pyx":99 * * * def _remove_non_numeric_identifier(acl): # <<<<<<<<<<<<<< * """Remove user and group names from the acl * """ */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_6darwin_9_remove_non_numeric_identifier(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_8platform_6darwin_8_remove_non_numeric_identifier, "Remove user and group names from the acl\n "); static PyMethodDef __pyx_mdef_4borg_8platform_6darwin_9_remove_non_numeric_identifier = {"_remove_non_numeric_identifier", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_6darwin_9_remove_non_numeric_identifier, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_8platform_6darwin_8_remove_non_numeric_identifier}; static PyObject *__pyx_pw_4borg_8platform_6darwin_9_remove_non_numeric_identifier(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_acl = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_remove_non_numeric_identifier (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_acl,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_acl)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 99, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_remove_non_numeric_identifier") < 0)) __PYX_ERR(0, 99, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_acl = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_remove_non_numeric_identifier", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 99, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.darwin._remove_non_numeric_identifier", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_6darwin_8_remove_non_numeric_identifier(__pyx_self, __pyx_v_acl); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8platform_6darwin_8_remove_non_numeric_identifier(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_acl) { PyObject *__pyx_v_entries = NULL; PyObject *__pyx_v_entry = NULL; PyObject *__pyx_v_fields = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; Py_ssize_t __pyx_t_6; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; int __pyx_t_9; int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_remove_non_numeric_identifier", 1); /* "borg/platform/darwin.pyx":102 * """Remove user and group names from the acl * """ * entries = [] # <<<<<<<<<<<<<< * for entry in safe_decode(acl).split('\n'): * if entry: */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_entries = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "borg/platform/darwin.pyx":103 * """ * entries = [] * for entry in safe_decode(acl).split('\n'): # <<<<<<<<<<<<<< * if entry: * fields = entry.split(':') */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_safe_decode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_acl}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_s__7}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 103, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_3))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 103, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 103, __pyx_L1_error) #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 103, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 103, __pyx_L1_error) #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 103, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_entry, __pyx_t_1); __pyx_t_1 = 0; /* "borg/platform/darwin.pyx":104 * entries = [] * for entry in safe_decode(acl).split('\n'): * if entry: # <<<<<<<<<<<<<< * fields = entry.split(':') * if fields[0] in ('user', 'group'): */ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_entry); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 104, __pyx_L1_error) if (__pyx_t_8) { /* "borg/platform/darwin.pyx":105 * for entry in safe_decode(acl).split('\n'): * if entry: * fields = entry.split(':') # <<<<<<<<<<<<<< * if fields[0] in ('user', 'group'): * fields[2] = '' */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_entry, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s__8}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_XDECREF_SET(__pyx_v_fields, __pyx_t_1); __pyx_t_1 = 0; /* "borg/platform/darwin.pyx":106 * if entry: * fields = entry.split(':') * if fields[0] in ('user', 'group'): # <<<<<<<<<<<<<< * fields[2] = '' * entries.append(':'.join(fields)) */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_fields, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_user, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 106, __pyx_L1_error) if (!__pyx_t_9) { } else { __pyx_t_8 = __pyx_t_9; goto __pyx_L7_bool_binop_done; } __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_group, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 106, __pyx_L1_error) __pyx_t_8 = __pyx_t_9; __pyx_L7_bool_binop_done:; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = __pyx_t_8; if (__pyx_t_9) { /* "borg/platform/darwin.pyx":107 * fields = entry.split(':') * if fields[0] in ('user', 'group'): * fields[2] = '' # <<<<<<<<<<<<<< * entries.append(':'.join(fields)) * else: */ if (unlikely((__Pyx_SetItemInt(__pyx_v_fields, 2, __pyx_kp_s__9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0))) __PYX_ERR(0, 107, __pyx_L1_error) /* "borg/platform/darwin.pyx":108 * if fields[0] in ('user', 'group'): * fields[2] = '' * entries.append(':'.join(fields)) # <<<<<<<<<<<<<< * else: * entries.append(entry) */ __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__8, __pyx_v_fields); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_entries, __pyx_t_1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/platform/darwin.pyx":106 * if entry: * fields = entry.split(':') * if fields[0] in ('user', 'group'): # <<<<<<<<<<<<<< * fields[2] = '' * entries.append(':'.join(fields)) */ goto __pyx_L6; } /* "borg/platform/darwin.pyx":110 * entries.append(':'.join(fields)) * else: * entries.append(entry) # <<<<<<<<<<<<<< * return safe_encode('\n'.join(entries)) * */ /*else*/ { __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_entries, __pyx_v_entry); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 110, __pyx_L1_error) } __pyx_L6:; /* "borg/platform/darwin.pyx":104 * entries = [] * for entry in safe_decode(acl).split('\n'): * if entry: # <<<<<<<<<<<<<< * fields = entry.split(':') * if fields[0] in ('user', 'group'): */ } /* "borg/platform/darwin.pyx":103 * """ * entries = [] * for entry in safe_decode(acl).split('\n'): # <<<<<<<<<<<<<< * if entry: * fields = entry.split(':') */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/darwin.pyx":111 * else: * entries.append(entry) * return safe_encode('\n'.join(entries)) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_safe_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__7, __pyx_v_entries); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "borg/platform/darwin.pyx":99 * * * def _remove_non_numeric_identifier(acl): # <<<<<<<<<<<<<< * """Remove user and group names from the acl * """ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("borg.platform.darwin._remove_non_numeric_identifier", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_entries); __Pyx_XDECREF(__pyx_v_entry); __Pyx_XDECREF(__pyx_v_fields); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/darwin.pyx":114 * * * def acl_get(path, item, st, numeric_ids=False, fd=None): # <<<<<<<<<<<<<< * cdef acl_t acl = NULL * cdef char *text = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_6darwin_11acl_get(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8platform_6darwin_11acl_get = {"acl_get", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_6darwin_11acl_get, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8platform_6darwin_11acl_get(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_path = 0; PyObject *__pyx_v_item = 0; CYTHON_UNUSED PyObject *__pyx_v_st = 0; PyObject *__pyx_v_numeric_ids = 0; PyObject *__pyx_v_fd = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("acl_get (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_item,&__pyx_n_s_st,&__pyx_n_s_numeric_ids,&__pyx_n_s_fd,0}; values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_path)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_item)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("acl_get", 0, 3, 5, 1); __PYX_ERR(0, 114, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("acl_get", 0, 3, 5, 2); __PYX_ERR(0, 114, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_numeric_ids); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fd); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "acl_get") < 0)) __PYX_ERR(0, 114, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_path = values[0]; __pyx_v_item = values[1]; __pyx_v_st = values[2]; __pyx_v_numeric_ids = values[3]; __pyx_v_fd = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("acl_get", 0, 3, 5, __pyx_nargs); __PYX_ERR(0, 114, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.darwin.acl_get", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_6darwin_10acl_get(__pyx_self, __pyx_v_path, __pyx_v_item, __pyx_v_st, __pyx_v_numeric_ids, __pyx_v_fd); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8platform_6darwin_10acl_get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_item, CYTHON_UNUSED PyObject *__pyx_v_st, PyObject *__pyx_v_numeric_ids, PyObject *__pyx_v_fd) { acl_t __pyx_v_acl; char *__pyx_v_text; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; char const *__pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; char const *__pyx_t_10; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("acl_get", 0); __Pyx_INCREF(__pyx_v_path); /* "borg/platform/darwin.pyx":115 * * def acl_get(path, item, st, numeric_ids=False, fd=None): * cdef acl_t acl = NULL # <<<<<<<<<<<<<< * cdef char *text = NULL * if isinstance(path, str): */ __pyx_v_acl = NULL; /* "borg/platform/darwin.pyx":116 * def acl_get(path, item, st, numeric_ids=False, fd=None): * cdef acl_t acl = NULL * cdef char *text = NULL # <<<<<<<<<<<<<< * if isinstance(path, str): * path = os.fsencode(path) */ __pyx_v_text = NULL; /* "borg/platform/darwin.pyx":117 * cdef acl_t acl = NULL * cdef char *text = NULL * if isinstance(path, str): # <<<<<<<<<<<<<< * path = os.fsencode(path) * try: */ __pyx_t_1 = PyString_Check(__pyx_v_path); if (__pyx_t_1) { /* "borg/platform/darwin.pyx":118 * cdef char *text = NULL * if isinstance(path, str): * path = os.fsencode(path) # <<<<<<<<<<<<<< * try: * if fd is not None: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_fsencode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_path}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_path, __pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/darwin.pyx":117 * cdef acl_t acl = NULL * cdef char *text = NULL * if isinstance(path, str): # <<<<<<<<<<<<<< * path = os.fsencode(path) * try: */ } /* "borg/platform/darwin.pyx":119 * if isinstance(path, str): * path = os.fsencode(path) * try: # <<<<<<<<<<<<<< * if fd is not None: * acl = acl_get_fd_np(fd, ACL_TYPE_EXTENDED) */ /*try:*/ { /* "borg/platform/darwin.pyx":120 * path = os.fsencode(path) * try: * if fd is not None: # <<<<<<<<<<<<<< * acl = acl_get_fd_np(fd, ACL_TYPE_EXTENDED) * else: */ __pyx_t_1 = (__pyx_v_fd != Py_None); if (__pyx_t_1) { /* "borg/platform/darwin.pyx":121 * try: * if fd is not None: * acl = acl_get_fd_np(fd, ACL_TYPE_EXTENDED) # <<<<<<<<<<<<<< * else: * acl = acl_get_link_np(path, ACL_TYPE_EXTENDED) */ __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_fd); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 121, __pyx_L5_error) __pyx_v_acl = acl_get_fd_np(__pyx_t_5, ACL_TYPE_EXTENDED); /* "borg/platform/darwin.pyx":120 * path = os.fsencode(path) * try: * if fd is not None: # <<<<<<<<<<<<<< * acl = acl_get_fd_np(fd, ACL_TYPE_EXTENDED) * else: */ goto __pyx_L7; } /* "borg/platform/darwin.pyx":123 * acl = acl_get_fd_np(fd, ACL_TYPE_EXTENDED) * else: * acl = acl_get_link_np(path, ACL_TYPE_EXTENDED) # <<<<<<<<<<<<<< * if acl == NULL: * if errno.errno == errno.ENOENT: */ /*else*/ { __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_path); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 123, __pyx_L5_error) __pyx_v_acl = acl_get_link_np(__pyx_t_6, ACL_TYPE_EXTENDED); } __pyx_L7:; /* "borg/platform/darwin.pyx":124 * else: * acl = acl_get_link_np(path, ACL_TYPE_EXTENDED) * if acl == NULL: # <<<<<<<<<<<<<< * if errno.errno == errno.ENOENT: * # macOS weirdness: if a file has no ACLs, it sets errno to ENOENT. :-( */ __pyx_t_1 = (__pyx_v_acl == NULL); if (__pyx_t_1) { /* "borg/platform/darwin.pyx":125 * acl = acl_get_link_np(path, ACL_TYPE_EXTENDED) * if acl == NULL: * if errno.errno == errno.ENOENT: # <<<<<<<<<<<<<< * # macOS weirdness: if a file has no ACLs, it sets errno to ENOENT. :-( * return */ __pyx_t_1 = (errno == ENOENT); if (__pyx_t_1) { /* "borg/platform/darwin.pyx":127 * if errno.errno == errno.ENOENT: * # macOS weirdness: if a file has no ACLs, it sets errno to ENOENT. :-( * return # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * text = acl_to_text(acl, NULL) */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L4_return; /* "borg/platform/darwin.pyx":125 * acl = acl_get_link_np(path, ACL_TYPE_EXTENDED) * if acl == NULL: * if errno.errno == errno.ENOENT: # <<<<<<<<<<<<<< * # macOS weirdness: if a file has no ACLs, it sets errno to ENOENT. :-( * return */ } /* "borg/platform/darwin.pyx":128 * # macOS weirdness: if a file has no ACLs, it sets errno to ENOENT. :-( * return * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) # <<<<<<<<<<<<<< * text = acl_to_text(acl, NULL) * if text == NULL: */ __pyx_t_2 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_strerror); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 128, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_3}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_fsdecode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 128, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_path}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 128, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 128, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2)) __PYX_ERR(0, 128, __pyx_L5_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_4)) __PYX_ERR(0, 128, __pyx_L5_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7)) __PYX_ERR(0, 128, __pyx_L5_error); __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 128, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __PYX_ERR(0, 128, __pyx_L5_error) /* "borg/platform/darwin.pyx":124 * else: * acl = acl_get_link_np(path, ACL_TYPE_EXTENDED) * if acl == NULL: # <<<<<<<<<<<<<< * if errno.errno == errno.ENOENT: * # macOS weirdness: if a file has no ACLs, it sets errno to ENOENT. :-( */ } /* "borg/platform/darwin.pyx":129 * return * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * text = acl_to_text(acl, NULL) # <<<<<<<<<<<<<< * if text == NULL: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) */ __pyx_v_text = acl_to_text(__pyx_v_acl, NULL); /* "borg/platform/darwin.pyx":130 * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * text = acl_to_text(acl, NULL) * if text == NULL: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * if numeric_ids: */ __pyx_t_1 = (__pyx_v_text == NULL); if (unlikely(__pyx_t_1)) { /* "borg/platform/darwin.pyx":131 * text = acl_to_text(acl, NULL) * if text == NULL: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) # <<<<<<<<<<<<<< * if numeric_ids: * item['acl_extended'] = _remove_non_numeric_identifier(text) */ __pyx_t_7 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 131, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 131, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_strerror); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 131, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4}; __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 131, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 131, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_fsdecode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 131, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_path}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 131, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7)) __PYX_ERR(0, 131, __pyx_L5_error); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_8)) __PYX_ERR(0, 131, __pyx_L5_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(0, 131, __pyx_L5_error); __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 131, __pyx_L5_error) /* "borg/platform/darwin.pyx":130 * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * text = acl_to_text(acl, NULL) * if text == NULL: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * if numeric_ids: */ } /* "borg/platform/darwin.pyx":132 * if text == NULL: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * if numeric_ids: # <<<<<<<<<<<<<< * item['acl_extended'] = _remove_non_numeric_identifier(text) * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_numeric_ids); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 132, __pyx_L5_error) if (__pyx_t_1) { /* "borg/platform/darwin.pyx":133 * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * if numeric_ids: * item['acl_extended'] = _remove_non_numeric_identifier(text) # <<<<<<<<<<<<<< * else: * item['acl_extended'] = text */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_remove_non_numeric_identifier); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 133, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyBytes_FromString(__pyx_v_text); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 133, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_8}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if (unlikely((PyObject_SetItem(__pyx_v_item, __pyx_n_s_acl_extended, __pyx_t_2) < 0))) __PYX_ERR(0, 133, __pyx_L5_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/darwin.pyx":132 * if text == NULL: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * if numeric_ids: # <<<<<<<<<<<<<< * item['acl_extended'] = _remove_non_numeric_identifier(text) * else: */ goto __pyx_L11; } /* "borg/platform/darwin.pyx":135 * item['acl_extended'] = _remove_non_numeric_identifier(text) * else: * item['acl_extended'] = text # <<<<<<<<<<<<<< * finally: * acl_free(text) */ /*else*/ { __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_text); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely((PyObject_SetItem(__pyx_v_item, __pyx_n_s_acl_extended, __pyx_t_2) < 0))) __PYX_ERR(0, 135, __pyx_L5_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L11:; } /* "borg/platform/darwin.pyx":137 * item['acl_extended'] = text * finally: * acl_free(text) # <<<<<<<<<<<<<< * acl_free(acl) * */ /*finally:*/ { /*normal exit:*/{ (void)(acl_free(__pyx_v_text)); /* "borg/platform/darwin.pyx":138 * finally: * acl_free(text) * acl_free(acl) # <<<<<<<<<<<<<< * * */ (void)(acl_free(__pyx_v_acl)); goto __pyx_L6; } __pyx_L5_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __pyx_t_5 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_10 = __pyx_filename; { /* "borg/platform/darwin.pyx":137 * item['acl_extended'] = text * finally: * acl_free(text) # <<<<<<<<<<<<<< * acl_free(acl) * */ (void)(acl_free(__pyx_v_text)); /* "borg/platform/darwin.pyx":138 * finally: * acl_free(text) * acl_free(acl) # <<<<<<<<<<<<<< * * */ (void)(acl_free(__pyx_v_acl)); } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); } __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ErrRestore(__pyx_t_11, __pyx_t_12, __pyx_t_13); __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_10; goto __pyx_L1_error; } __pyx_L4_return: { __pyx_t_16 = __pyx_r; __pyx_r = 0; /* "borg/platform/darwin.pyx":137 * item['acl_extended'] = text * finally: * acl_free(text) # <<<<<<<<<<<<<< * acl_free(acl) * */ (void)(acl_free(__pyx_v_text)); /* "borg/platform/darwin.pyx":138 * finally: * acl_free(text) * acl_free(acl) # <<<<<<<<<<<<<< * * */ (void)(acl_free(__pyx_v_acl)); __pyx_r = __pyx_t_16; __pyx_t_16 = 0; goto __pyx_L0; } __pyx_L6:; } /* "borg/platform/darwin.pyx":114 * * * def acl_get(path, item, st, numeric_ids=False, fd=None): # <<<<<<<<<<<<<< * cdef acl_t acl = NULL * cdef char *text = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("borg.platform.darwin.acl_get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_path); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/darwin.pyx":141 * * * def acl_set(path, item, numeric_ids=False, fd=None): # <<<<<<<<<<<<<< * cdef acl_t acl = NULL * acl_text = item.get('acl_extended') */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_6darwin_13acl_set(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8platform_6darwin_13acl_set = {"acl_set", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_6darwin_13acl_set, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8platform_6darwin_13acl_set(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_path = 0; PyObject *__pyx_v_item = 0; PyObject *__pyx_v_numeric_ids = 0; PyObject *__pyx_v_fd = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("acl_set (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_item,&__pyx_n_s_numeric_ids,&__pyx_n_s_fd,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_path)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 141, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_item)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 141, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("acl_set", 0, 2, 4, 1); __PYX_ERR(0, 141, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_numeric_ids); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 141, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fd); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 141, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "acl_set") < 0)) __PYX_ERR(0, 141, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_path = values[0]; __pyx_v_item = values[1]; __pyx_v_numeric_ids = values[2]; __pyx_v_fd = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("acl_set", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 141, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.darwin.acl_set", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_6darwin_12acl_set(__pyx_self, __pyx_v_path, __pyx_v_item, __pyx_v_numeric_ids, __pyx_v_fd); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8platform_6darwin_12acl_set(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_item, PyObject *__pyx_v_numeric_ids, PyObject *__pyx_v_fd) { acl_t __pyx_v_acl; PyObject *__pyx_v_acl_text = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; char const *__pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; char const *__pyx_t_9; int __pyx_t_10; char const *__pyx_t_11; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("acl_set", 0); __Pyx_INCREF(__pyx_v_path); /* "borg/platform/darwin.pyx":142 * * def acl_set(path, item, numeric_ids=False, fd=None): * cdef acl_t acl = NULL # <<<<<<<<<<<<<< * acl_text = item.get('acl_extended') * if acl_text is not None: */ __pyx_v_acl = NULL; /* "borg/platform/darwin.pyx":143 * def acl_set(path, item, numeric_ids=False, fd=None): * cdef acl_t acl = NULL * acl_text = item.get('acl_extended') # <<<<<<<<<<<<<< * if acl_text is not None: * try: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_n_s_acl_extended}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_acl_text = __pyx_t_1; __pyx_t_1 = 0; /* "borg/platform/darwin.pyx":144 * cdef acl_t acl = NULL * acl_text = item.get('acl_extended') * if acl_text is not None: # <<<<<<<<<<<<<< * try: * if isinstance(path, str): */ __pyx_t_5 = (__pyx_v_acl_text != Py_None); if (__pyx_t_5) { /* "borg/platform/darwin.pyx":145 * acl_text = item.get('acl_extended') * if acl_text is not None: * try: # <<<<<<<<<<<<<< * if isinstance(path, str): * path = os.fsencode(path) */ /*try:*/ { /* "borg/platform/darwin.pyx":146 * if acl_text is not None: * try: * if isinstance(path, str): # <<<<<<<<<<<<<< * path = os.fsencode(path) * if numeric_ids: */ __pyx_t_5 = PyString_Check(__pyx_v_path); if (__pyx_t_5) { /* "borg/platform/darwin.pyx":147 * try: * if isinstance(path, str): * path = os.fsencode(path) # <<<<<<<<<<<<<< * if numeric_ids: * acl = acl_from_text(acl_text) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_fsencode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_path}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF_SET(__pyx_v_path, __pyx_t_1); __pyx_t_1 = 0; /* "borg/platform/darwin.pyx":146 * if acl_text is not None: * try: * if isinstance(path, str): # <<<<<<<<<<<<<< * path = os.fsencode(path) * if numeric_ids: */ } /* "borg/platform/darwin.pyx":148 * if isinstance(path, str): * path = os.fsencode(path) * if numeric_ids: # <<<<<<<<<<<<<< * acl = acl_from_text(acl_text) * else: */ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_numeric_ids); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 148, __pyx_L5_error) if (__pyx_t_5) { /* "borg/platform/darwin.pyx":149 * path = os.fsencode(path) * if numeric_ids: * acl = acl_from_text(acl_text) # <<<<<<<<<<<<<< * else: * acl = acl_from_text(_remove_numeric_id_if_possible(acl_text)) */ __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_acl_text); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 149, __pyx_L5_error) __pyx_v_acl = acl_from_text(__pyx_t_6); /* "borg/platform/darwin.pyx":148 * if isinstance(path, str): * path = os.fsencode(path) * if numeric_ids: # <<<<<<<<<<<<<< * acl = acl_from_text(acl_text) * else: */ goto __pyx_L8; } /* "borg/platform/darwin.pyx":151 * acl = acl_from_text(acl_text) * else: * acl = acl_from_text(_remove_numeric_id_if_possible(acl_text)) # <<<<<<<<<<<<<< * if acl == NULL: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) */ /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_remove_numeric_id_if_possible); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 151, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_acl_text}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); __PYX_ERR(0, 151, __pyx_L5_error) } __pyx_t_6 = __Pyx_PyBytes_AsString(__pyx_t_1); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 151, __pyx_L5_error) __pyx_v_acl = acl_from_text(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L8:; /* "borg/platform/darwin.pyx":152 * else: * acl = acl_from_text(_remove_numeric_id_if_possible(acl_text)) * if acl == NULL: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * if fd is not None: */ __pyx_t_5 = (__pyx_v_acl == NULL); if (unlikely(__pyx_t_5)) { /* "borg/platform/darwin.pyx":153 * acl = acl_from_text(_remove_numeric_id_if_possible(acl_text)) * if acl == NULL: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) # <<<<<<<<<<<<<< * if fd is not None: * if acl_set_fd_np(fd, acl, ACL_TYPE_EXTENDED) == -1: */ __pyx_t_1 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_strerror); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 153, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_2}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 153, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_fsdecode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 153, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_path}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 153, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 153, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1)) __PYX_ERR(0, 153, __pyx_L5_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3)) __PYX_ERR(0, 153, __pyx_L5_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7)) __PYX_ERR(0, 153, __pyx_L5_error); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 153, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __PYX_ERR(0, 153, __pyx_L5_error) /* "borg/platform/darwin.pyx":152 * else: * acl = acl_from_text(_remove_numeric_id_if_possible(acl_text)) * if acl == NULL: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * if fd is not None: */ } /* "borg/platform/darwin.pyx":154 * if acl == NULL: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * if fd is not None: # <<<<<<<<<<<<<< * if acl_set_fd_np(fd, acl, ACL_TYPE_EXTENDED) == -1: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) */ __pyx_t_5 = (__pyx_v_fd != Py_None); if (__pyx_t_5) { /* "borg/platform/darwin.pyx":155 * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * if fd is not None: * if acl_set_fd_np(fd, acl, ACL_TYPE_EXTENDED) == -1: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * else: */ __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_fd); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 155, __pyx_L5_error) __pyx_t_5 = (acl_set_fd_np(__pyx_t_4, __pyx_v_acl, ACL_TYPE_EXTENDED) == -1L); if (unlikely(__pyx_t_5)) { /* "borg/platform/darwin.pyx":156 * if fd is not None: * if acl_set_fd_np(fd, acl, ACL_TYPE_EXTENDED) == -1: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) # <<<<<<<<<<<<<< * else: * if acl_set_link_np(path, ACL_TYPE_EXTENDED, acl) == -1: */ __pyx_t_7 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 156, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 156, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_strerror); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 156, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3}; __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 156, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 156, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_fsdecode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_path}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7)) __PYX_ERR(0, 156, __pyx_L5_error); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_8)) __PYX_ERR(0, 156, __pyx_L5_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1)) __PYX_ERR(0, 156, __pyx_L5_error); __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 156, __pyx_L5_error) /* "borg/platform/darwin.pyx":155 * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * if fd is not None: * if acl_set_fd_np(fd, acl, ACL_TYPE_EXTENDED) == -1: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * else: */ } /* "borg/platform/darwin.pyx":154 * if acl == NULL: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * if fd is not None: # <<<<<<<<<<<<<< * if acl_set_fd_np(fd, acl, ACL_TYPE_EXTENDED) == -1: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) */ goto __pyx_L10; } /* "borg/platform/darwin.pyx":158 * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * else: * if acl_set_link_np(path, ACL_TYPE_EXTENDED, acl) == -1: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * finally: */ /*else*/ { __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v_path); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 158, __pyx_L5_error) __pyx_t_5 = (acl_set_link_np(__pyx_t_9, ACL_TYPE_EXTENDED, __pyx_v_acl) == -1L); if (unlikely(__pyx_t_5)) { /* "borg/platform/darwin.pyx":159 * else: * if acl_set_link_np(path, ACL_TYPE_EXTENDED, acl) == -1: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) # <<<<<<<<<<<<<< * finally: * acl_free(acl) */ __pyx_t_1 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_os); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 159, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_strerror); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 159, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 159, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_8}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_os); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 159, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_fsdecode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_path}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 159, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 159, __pyx_L5_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 159, __pyx_L5_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_7)) __PYX_ERR(0, 159, __pyx_L5_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 159, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __PYX_ERR(0, 159, __pyx_L5_error) /* "borg/platform/darwin.pyx":158 * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * else: * if acl_set_link_np(path, ACL_TYPE_EXTENDED, acl) == -1: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * finally: */ } } __pyx_L10:; } /* "borg/platform/darwin.pyx":161 * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * finally: * acl_free(acl) # <<<<<<<<<<<<<< */ /*finally:*/ { /*normal exit:*/{ (void)(acl_free(__pyx_v_acl)); goto __pyx_L6; } __pyx_L5_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __pyx_t_4 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename; { (void)(acl_free(__pyx_v_acl)); } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); } __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14); __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11; goto __pyx_L1_error; } __pyx_L6:; } /* "borg/platform/darwin.pyx":144 * cdef acl_t acl = NULL * acl_text = item.get('acl_extended') * if acl_text is not None: # <<<<<<<<<<<<<< * try: * if isinstance(path, str): */ } /* "borg/platform/darwin.pyx":141 * * * def acl_set(path, item, numeric_ids=False, fd=None): # <<<<<<<<<<<<<< * cdef acl_t acl = NULL * acl_text = item.get('acl_extended') */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("borg.platform.darwin.acl_set", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_acl_text); __Pyx_XDECREF(__pyx_v_path); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } #if CYTHON_USE_FREELISTS static struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct__listxattr *__pyx_freelist_4borg_8platform_6darwin___pyx_scope_struct__listxattr[8]; static int __pyx_freecount_4borg_8platform_6darwin___pyx_scope_struct__listxattr = 0; #endif static PyObject *__pyx_tp_new_4borg_8platform_6darwin___pyx_scope_struct__listxattr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_freecount_4borg_8platform_6darwin___pyx_scope_struct__listxattr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct__listxattr)))) { o = (PyObject*)__pyx_freelist_4borg_8platform_6darwin___pyx_scope_struct__listxattr[--__pyx_freecount_4borg_8platform_6darwin___pyx_scope_struct__listxattr]; memset(o, 0, sizeof(struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct__listxattr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif return o; } static void __pyx_tp_dealloc_4borg_8platform_6darwin___pyx_scope_struct__listxattr(PyObject *o) { struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct__listxattr *p = (struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct__listxattr *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4borg_8platform_6darwin___pyx_scope_struct__listxattr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_follow_symlinks); #if CYTHON_USE_FREELISTS if (((int)(__pyx_freecount_4borg_8platform_6darwin___pyx_scope_struct__listxattr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct__listxattr)))) { __pyx_freelist_4borg_8platform_6darwin___pyx_scope_struct__listxattr[__pyx_freecount_4borg_8platform_6darwin___pyx_scope_struct__listxattr++] = ((struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct__listxattr *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static int __pyx_tp_traverse_4borg_8platform_6darwin___pyx_scope_struct__listxattr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct__listxattr *p = (struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct__listxattr *)o; if (p->__pyx_v_follow_symlinks) { e = (*v)(p->__pyx_v_follow_symlinks, a); if (e) return e; } return 0; } static int __pyx_tp_clear_4borg_8platform_6darwin___pyx_scope_struct__listxattr(PyObject *o) { PyObject* tmp; struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct__listxattr *p = (struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct__listxattr *)o; tmp = ((PyObject*)p->__pyx_v_follow_symlinks); p->__pyx_v_follow_symlinks = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_4borg_8platform_6darwin___pyx_scope_struct__listxattr_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4borg_8platform_6darwin___pyx_scope_struct__listxattr}, {Py_tp_traverse, (void *)__pyx_tp_traverse_4borg_8platform_6darwin___pyx_scope_struct__listxattr}, {Py_tp_clear, (void *)__pyx_tp_clear_4borg_8platform_6darwin___pyx_scope_struct__listxattr}, {Py_tp_new, (void *)__pyx_tp_new_4borg_8platform_6darwin___pyx_scope_struct__listxattr}, {0, 0}, }; static PyType_Spec __pyx_type_4borg_8platform_6darwin___pyx_scope_struct__listxattr_spec = { "borg.platform.darwin.__pyx_scope_struct__listxattr", sizeof(struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct__listxattr), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, __pyx_type_4borg_8platform_6darwin___pyx_scope_struct__listxattr_slots, }; #else static PyTypeObject __pyx_type_4borg_8platform_6darwin___pyx_scope_struct__listxattr = { PyVarObject_HEAD_INIT(0, 0) "borg.platform.darwin.""__pyx_scope_struct__listxattr", /*tp_name*/ sizeof(struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct__listxattr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4borg_8platform_6darwin___pyx_scope_struct__listxattr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_4borg_8platform_6darwin___pyx_scope_struct__listxattr, /*tp_traverse*/ __pyx_tp_clear_4borg_8platform_6darwin___pyx_scope_struct__listxattr, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4borg_8platform_6darwin___pyx_scope_struct__listxattr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif #if CYTHON_USE_FREELISTS static struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr *__pyx_freelist_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr[8]; static int __pyx_freecount_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr = 0; #endif static PyObject *__pyx_tp_new_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_freecount_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr)))) { o = (PyObject*)__pyx_freelist_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr[--__pyx_freecount_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr]; memset(o, 0, sizeof(struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif return o; } static void __pyx_tp_dealloc_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr(PyObject *o) { struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr *p = (struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_follow_symlinks); #if CYTHON_USE_FREELISTS if (((int)(__pyx_freecount_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr)))) { __pyx_freelist_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr[__pyx_freecount_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr++] = ((struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static int __pyx_tp_traverse_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr *p = (struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr *)o; if (p->__pyx_v_follow_symlinks) { e = (*v)(p->__pyx_v_follow_symlinks, a); if (e) return e; } return 0; } static int __pyx_tp_clear_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr(PyObject *o) { PyObject* tmp; struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr *p = (struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr *)o; tmp = ((PyObject*)p->__pyx_v_follow_symlinks); p->__pyx_v_follow_symlinks = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr}, {Py_tp_traverse, (void *)__pyx_tp_traverse_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr}, {Py_tp_clear, (void *)__pyx_tp_clear_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr}, {Py_tp_new, (void *)__pyx_tp_new_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr}, {0, 0}, }; static PyType_Spec __pyx_type_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr_spec = { "borg.platform.darwin.__pyx_scope_struct_1_getxattr", sizeof(struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, __pyx_type_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr_slots, }; #else static PyTypeObject __pyx_type_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr = { PyVarObject_HEAD_INIT(0, 0) "borg.platform.darwin.""__pyx_scope_struct_1_getxattr", /*tp_name*/ sizeof(struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr, /*tp_traverse*/ __pyx_tp_clear_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif #if CYTHON_USE_FREELISTS static struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr *__pyx_freelist_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr[8]; static int __pyx_freecount_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr = 0; #endif static PyObject *__pyx_tp_new_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_freecount_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr)))) { o = (PyObject*)__pyx_freelist_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr[--__pyx_freecount_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr]; memset(o, 0, sizeof(struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif return o; } static void __pyx_tp_dealloc_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr(PyObject *o) { struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr *p = (struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_follow_symlinks); #if CYTHON_USE_FREELISTS if (((int)(__pyx_freecount_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr)))) { __pyx_freelist_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr[__pyx_freecount_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr++] = ((struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static int __pyx_tp_traverse_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr *p = (struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr *)o; if (p->__pyx_v_follow_symlinks) { e = (*v)(p->__pyx_v_follow_symlinks, a); if (e) return e; } return 0; } static int __pyx_tp_clear_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr(PyObject *o) { PyObject* tmp; struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr *p = (struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr *)o; tmp = ((PyObject*)p->__pyx_v_follow_symlinks); p->__pyx_v_follow_symlinks = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr}, {Py_tp_traverse, (void *)__pyx_tp_traverse_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr}, {Py_tp_clear, (void *)__pyx_tp_clear_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr}, {Py_tp_new, (void *)__pyx_tp_new_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr}, {0, 0}, }; static PyType_Spec __pyx_type_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr_spec = { "borg.platform.darwin.__pyx_scope_struct_2_setxattr", sizeof(struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, __pyx_type_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr_slots, }; #else static PyTypeObject __pyx_type_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr = { PyVarObject_HEAD_INIT(0, 0) "borg.platform.darwin.""__pyx_scope_struct_2_setxattr", /*tp_name*/ sizeof(struct __pyx_obj_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr, /*tp_traverse*/ __pyx_tp_clear_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_1_4_01, __pyx_k_1_4_01, sizeof(__pyx_k_1_4_01), 0, 0, 1, 0}, {&__pyx_n_s_API_VERSION, __pyx_k_API_VERSION, sizeof(__pyx_k_API_VERSION), 0, 0, 1, 1}, {&__pyx_n_s_OSError, __pyx_k_OSError, sizeof(__pyx_k_OSError), 0, 0, 1, 1}, {&__pyx_n_s__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 0, 1, 1}, {&__pyx_kp_u__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 1, 0, 0}, {&__pyx_n_s__26, __pyx_k__26, sizeof(__pyx_k__26), 0, 0, 1, 1}, {&__pyx_kp_s__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 0, 1, 0}, {&__pyx_kp_s__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 0, 1, 0}, {&__pyx_kp_s__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 0, 1, 0}, {&__pyx_n_s_acl, __pyx_k_acl, sizeof(__pyx_k_acl), 0, 0, 1, 1}, {&__pyx_n_s_acl_extended, __pyx_k_acl_extended, sizeof(__pyx_k_acl_extended), 0, 0, 1, 1}, {&__pyx_n_s_acl_get, __pyx_k_acl_get, sizeof(__pyx_k_acl_get), 0, 0, 1, 1}, {&__pyx_n_s_acl_set, __pyx_k_acl_set, sizeof(__pyx_k_acl_set), 0, 0, 1, 1}, {&__pyx_n_s_acl_text, __pyx_k_acl_text, sizeof(__pyx_k_acl_text), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_borg_platform_darwin, __pyx_k_borg_platform_darwin, sizeof(__pyx_k_borg_platform_darwin), 0, 0, 1, 1}, {&__pyx_n_s_buf, __pyx_k_buf, sizeof(__pyx_k_buf), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, {&__pyx_n_s_entries, __pyx_k_entries, sizeof(__pyx_k_entries), 0, 0, 1, 1}, {&__pyx_n_s_entry, __pyx_k_entry, sizeof(__pyx_k_entry), 0, 0, 1, 1}, {&__pyx_n_s_fd, __pyx_k_fd, sizeof(__pyx_k_fd), 0, 0, 1, 1}, {&__pyx_n_s_fields, __pyx_k_fields, sizeof(__pyx_k_fields), 0, 0, 1, 1}, {&__pyx_n_s_follow_symlinks, __pyx_k_follow_symlinks, sizeof(__pyx_k_follow_symlinks), 0, 0, 1, 1}, {&__pyx_n_s_fsdecode, __pyx_k_fsdecode, sizeof(__pyx_k_fsdecode), 0, 0, 1, 1}, {&__pyx_n_s_fsencode, __pyx_k_fsencode, sizeof(__pyx_k_fsencode), 0, 0, 1, 1}, {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1}, {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, {&__pyx_n_s_getxattr, __pyx_k_getxattr, sizeof(__pyx_k_getxattr), 0, 0, 1, 1}, {&__pyx_n_s_getxattr_inner, __pyx_k_getxattr_inner, sizeof(__pyx_k_getxattr_inner), 0, 0, 1, 1}, {&__pyx_n_s_getxattr_locals_func, __pyx_k_getxattr_locals_func, sizeof(__pyx_k_getxattr_locals_func), 0, 0, 1, 1}, {&__pyx_n_s_group, __pyx_k_group, sizeof(__pyx_k_group), 0, 0, 1, 1}, {&__pyx_n_s_group2gid, __pyx_k_group2gid, sizeof(__pyx_k_group2gid), 0, 0, 1, 1}, {&__pyx_n_s_helpers, __pyx_k_helpers, sizeof(__pyx_k_helpers), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, {&__pyx_n_s_item, __pyx_k_item, sizeof(__pyx_k_item), 0, 0, 1, 1}, {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, {&__pyx_n_s_listxattr, __pyx_k_listxattr, sizeof(__pyx_k_listxattr), 0, 0, 1, 1}, {&__pyx_n_s_listxattr_inner, __pyx_k_listxattr_inner, sizeof(__pyx_k_listxattr_inner), 0, 0, 1, 1}, {&__pyx_n_s_listxattr_locals_func, __pyx_k_listxattr_locals_func, sizeof(__pyx_k_listxattr_locals_func), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, {&__pyx_n_s_numeric_ids, __pyx_k_numeric_ids, sizeof(__pyx_k_numeric_ids), 0, 0, 1, 1}, {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, {&__pyx_n_s_posix, __pyx_k_posix, sizeof(__pyx_k_posix), 0, 0, 1, 1}, {&__pyx_n_s_remove_non_numeric_identifier, __pyx_k_remove_non_numeric_identifier, sizeof(__pyx_k_remove_non_numeric_identifier), 0, 0, 1, 1}, {&__pyx_n_s_remove_numeric_id_if_possible, __pyx_k_remove_numeric_id_if_possible, sizeof(__pyx_k_remove_numeric_id_if_possible), 0, 0, 1, 1}, {&__pyx_n_s_safe_decode, __pyx_k_safe_decode, sizeof(__pyx_k_safe_decode), 0, 0, 1, 1}, {&__pyx_n_s_safe_encode, __pyx_k_safe_encode, sizeof(__pyx_k_safe_encode), 0, 0, 1, 1}, {&__pyx_n_s_setxattr, __pyx_k_setxattr, sizeof(__pyx_k_setxattr), 0, 0, 1, 1}, {&__pyx_n_s_setxattr_inner, __pyx_k_setxattr_inner, sizeof(__pyx_k_setxattr_inner), 0, 0, 1, 1}, {&__pyx_n_s_setxattr_locals_func, __pyx_k_setxattr_locals_func, sizeof(__pyx_k_setxattr_locals_func), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1}, {&__pyx_n_s_split_string0, __pyx_k_split_string0, sizeof(__pyx_k_split_string0), 0, 0, 1, 1}, {&__pyx_kp_s_src_borg_platform_darwin_pyx, __pyx_k_src_borg_platform_darwin_pyx, sizeof(__pyx_k_src_borg_platform_darwin_pyx), 0, 0, 1, 0}, {&__pyx_n_s_st, __pyx_k_st, sizeof(__pyx_k_st), 0, 0, 1, 1}, {&__pyx_n_s_strerror, __pyx_k_strerror, sizeof(__pyx_k_strerror), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_text, __pyx_k_text, sizeof(__pyx_k_text), 0, 0, 1, 1}, {&__pyx_n_s_user, __pyx_k_user, sizeof(__pyx_k_user), 0, 0, 1, 1}, {&__pyx_n_s_user2uid, __pyx_k_user2uid, sizeof(__pyx_k_user2uid), 0, 0, 1, 1}, {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, {&__pyx_n_s_xattr, __pyx_k_xattr, sizeof(__pyx_k_xattr), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_OSError = __Pyx_GetBuiltinName(__pyx_n_s_OSError); if (!__pyx_builtin_OSError) __PYX_ERR(0, 128, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "borg/platform/darwin.pyx":42 * * def listxattr(path, *, follow_symlinks=False): * def func(path, buf, size): # <<<<<<<<<<<<<< * if isinstance(path, int): * return c_flistxattr(path, buf, size, XATTR_NOFLAGS) */ __pyx_tuple_ = PyTuple_Pack(3, __pyx_n_s_path, __pyx_n_s_buf, __pyx_n_s_size); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple_, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_darwin_pyx, __pyx_n_s_func, 42, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 42, __pyx_L1_error) /* "borg/platform/darwin.pyx":56 * * def getxattr(path, name, *, follow_symlinks=False): * def func(path, name, buf, size): # <<<<<<<<<<<<<< * if isinstance(path, int): * return c_fgetxattr(path, name, buf, size, 0, XATTR_NOFLAGS) */ __pyx_tuple__3 = PyTuple_Pack(4, __pyx_n_s_path, __pyx_n_s_name, __pyx_n_s_buf, __pyx_n_s_size); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_darwin_pyx, __pyx_n_s_func, 56, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 56, __pyx_L1_error) /* "borg/platform/darwin.pyx":70 * * def setxattr(path, name, value, *, follow_symlinks=False): * def func(path, name, value, size): # <<<<<<<<<<<<<< * if isinstance(path, int): * return c_fsetxattr(path, name, value, size, 0, XATTR_NOFLAGS) */ __pyx_tuple__5 = PyTuple_Pack(4, __pyx_n_s_path, __pyx_n_s_name, __pyx_n_s_value, __pyx_n_s_size); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_darwin_pyx, __pyx_n_s_func, 70, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 70, __pyx_L1_error) /* "borg/platform/darwin.pyx":41 * * * def listxattr(path, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, buf, size): * if isinstance(path, int): */ __pyx_tuple__12 = PyTuple_Pack(7, __pyx_n_s_path, __pyx_n_s_follow_symlinks, __pyx_n_s_func, __pyx_n_s_func, __pyx_n_s_n, __pyx_n_s_buf, __pyx_n_s_name); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_darwin_pyx, __pyx_n_s_listxattr, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 41, __pyx_L1_error) /* "borg/platform/darwin.pyx":55 * * * def getxattr(path, name, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, name, buf, size): * if isinstance(path, int): */ __pyx_tuple__14 = PyTuple_Pack(7, __pyx_n_s_path, __pyx_n_s_name, __pyx_n_s_follow_symlinks, __pyx_n_s_func, __pyx_n_s_func, __pyx_n_s_n, __pyx_n_s_buf); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(2, 0, 1, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_darwin_pyx, __pyx_n_s_getxattr, 55, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 55, __pyx_L1_error) /* "borg/platform/darwin.pyx":69 * * * def setxattr(path, name, value, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, name, value, size): * if isinstance(path, int): */ __pyx_tuple__16 = PyTuple_Pack(6, __pyx_n_s_path, __pyx_n_s_name, __pyx_n_s_value, __pyx_n_s_follow_symlinks, __pyx_n_s_func, __pyx_n_s_func); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(3, 0, 1, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_darwin_pyx, __pyx_n_s_setxattr, 69, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 69, __pyx_L1_error) /* "borg/platform/darwin.pyx":82 * * * def _remove_numeric_id_if_possible(acl): # <<<<<<<<<<<<<< * """Replace the user/group field with the local uid/gid if possible * """ */ __pyx_tuple__18 = PyTuple_Pack(4, __pyx_n_s_acl, __pyx_n_s_entries, __pyx_n_s_entry, __pyx_n_s_fields); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_darwin_pyx, __pyx_n_s_remove_numeric_id_if_possible, 82, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 82, __pyx_L1_error) /* "borg/platform/darwin.pyx":99 * * * def _remove_non_numeric_identifier(acl): # <<<<<<<<<<<<<< * """Remove user and group names from the acl * """ */ __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_darwin_pyx, __pyx_n_s_remove_non_numeric_identifier, 99, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 99, __pyx_L1_error) /* "borg/platform/darwin.pyx":114 * * * def acl_get(path, item, st, numeric_ids=False, fd=None): # <<<<<<<<<<<<<< * cdef acl_t acl = NULL * cdef char *text = NULL */ __pyx_tuple__21 = PyTuple_Pack(7, __pyx_n_s_path, __pyx_n_s_item, __pyx_n_s_st, __pyx_n_s_numeric_ids, __pyx_n_s_fd, __pyx_n_s_acl, __pyx_n_s_text); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_darwin_pyx, __pyx_n_s_acl_get, 114, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 114, __pyx_L1_error) __pyx_tuple__23 = PyTuple_Pack(2, ((PyObject *)Py_False), Py_None); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23); /* "borg/platform/darwin.pyx":141 * * * def acl_set(path, item, numeric_ids=False, fd=None): # <<<<<<<<<<<<<< * cdef acl_t acl = NULL * acl_text = item.get('acl_extended') */ __pyx_tuple__24 = PyTuple_Pack(6, __pyx_n_s_path, __pyx_n_s_item, __pyx_n_s_numeric_ids, __pyx_n_s_fd, __pyx_n_s_acl, __pyx_n_s_acl_text); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_darwin_pyx, __pyx_n_s_acl_set, 141, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS __pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct__listxattr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4borg_8platform_6darwin___pyx_scope_struct__listxattr_spec, NULL); if (unlikely(!__pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct__listxattr)) __PYX_ERR(0, 41, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4borg_8platform_6darwin___pyx_scope_struct__listxattr_spec, __pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct__listxattr) < 0) __PYX_ERR(0, 41, __pyx_L1_error) #else __pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct__listxattr = &__pyx_type_4borg_8platform_6darwin___pyx_scope_struct__listxattr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct__listxattr) < 0) __PYX_ERR(0, 41, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct__listxattr->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct__listxattr->tp_dictoffset && __pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct__listxattr->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct__listxattr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr_spec, NULL); if (unlikely(!__pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr)) __PYX_ERR(0, 55, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr_spec, __pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr) < 0) __PYX_ERR(0, 55, __pyx_L1_error) #else __pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr = &__pyx_type_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr) < 0) __PYX_ERR(0, 55, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr->tp_dictoffset && __pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct_1_getxattr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr_spec, NULL); if (unlikely(!__pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr)) __PYX_ERR(0, 69, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr_spec, __pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr) < 0) __PYX_ERR(0, 69, __pyx_L1_error) #else __pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr = &__pyx_type_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr) < 0) __PYX_ERR(0, 69, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr->tp_dictoffset && __pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_4borg_8platform_6darwin___pyx_scope_struct_2_setxattr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_darwin(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_darwin}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "darwin", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initdarwin(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initdarwin(void) #else __Pyx_PyMODINIT_FUNC PyInit_darwin(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_darwin(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_darwin(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'darwin' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("darwin", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "darwin" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_darwin(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_borg__platform__darwin) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "borg.platform.darwin")) { if (unlikely((PyDict_SetItemString(modules, "borg.platform.darwin", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) (void)__Pyx_modinit_type_import_code(); (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "borg/platform/darwin.pyx":1 * import os # <<<<<<<<<<<<<< * * from libc.stdint cimport uint32_t */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_os, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/darwin.pyx":6 * from libc cimport errno * * from .posix import user2uid, group2gid # <<<<<<<<<<<<<< * from ..helpers import safe_decode, safe_encode * from .xattr import _listxattr_inner, _getxattr_inner, _setxattr_inner, split_string0 */ __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_user2uid); __Pyx_GIVEREF(__pyx_n_s_user2uid); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_user2uid)) __PYX_ERR(0, 6, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_group2gid); __Pyx_GIVEREF(__pyx_n_s_group2gid); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_group2gid)) __PYX_ERR(0, 6, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_posix, __pyx_t_2, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_user2uid); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_user2uid, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_group2gid); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_group2gid, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/darwin.pyx":7 * * from .posix import user2uid, group2gid * from ..helpers import safe_decode, safe_encode # <<<<<<<<<<<<<< * from .xattr import _listxattr_inner, _getxattr_inner, _setxattr_inner, split_string0 * */ __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_safe_decode); __Pyx_GIVEREF(__pyx_n_s_safe_decode); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_safe_decode)) __PYX_ERR(0, 7, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_safe_encode); __Pyx_GIVEREF(__pyx_n_s_safe_encode); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_safe_encode)) __PYX_ERR(0, 7, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_helpers, __pyx_t_3, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_safe_decode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_safe_decode, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_safe_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_safe_encode, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/darwin.pyx":8 * from .posix import user2uid, group2gid * from ..helpers import safe_decode, safe_encode * from .xattr import _listxattr_inner, _getxattr_inner, _setxattr_inner, split_string0 # <<<<<<<<<<<<<< * * API_VERSION = '1.4_01' */ __pyx_t_2 = PyList_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_listxattr_inner); __Pyx_GIVEREF(__pyx_n_s_listxattr_inner); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_listxattr_inner)) __PYX_ERR(0, 8, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_getxattr_inner); __Pyx_GIVEREF(__pyx_n_s_getxattr_inner); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_getxattr_inner)) __PYX_ERR(0, 8, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_setxattr_inner); __Pyx_GIVEREF(__pyx_n_s_setxattr_inner); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_setxattr_inner)) __PYX_ERR(0, 8, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_split_string0); __Pyx_GIVEREF(__pyx_n_s_split_string0); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_split_string0)) __PYX_ERR(0, 8, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_xattr, __pyx_t_2, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_listxattr_inner); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_listxattr_inner, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_getxattr_inner); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_getxattr_inner, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_setxattr_inner); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setxattr_inner, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_split_string0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_split_string0, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/darwin.pyx":10 * from .xattr import _listxattr_inner, _getxattr_inner, _setxattr_inner, split_string0 * * API_VERSION = '1.4_01' # <<<<<<<<<<<<<< * * cdef extern from "sys/xattr.h": */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_API_VERSION, __pyx_kp_s_1_4_01) < 0) __PYX_ERR(0, 10, __pyx_L1_error) /* "borg/platform/darwin.pyx":24 * int XATTR_NOFOLLOW * * cdef int XATTR_NOFLAGS = 0x0000 # <<<<<<<<<<<<<< * * cdef extern from "sys/acl.h": */ __pyx_v_4borg_8platform_6darwin_XATTR_NOFLAGS = 0x0000; /* "borg/platform/darwin.pyx":41 * * * def listxattr(path, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, buf, size): * if isinstance(path, int): */ __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_follow_symlinks, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 41, __pyx_L1_error) __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_6darwin_1listxattr, 0, __pyx_n_s_listxattr, NULL, __pyx_n_s_borg_platform_darwin, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_2, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_listxattr, __pyx_t_2) < 0) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/darwin.pyx":55 * * * def getxattr(path, name, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, name, buf, size): * if isinstance(path, int): */ __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_follow_symlinks, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 55, __pyx_L1_error) __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_6darwin_3getxattr, 0, __pyx_n_s_getxattr, NULL, __pyx_n_s_borg_platform_darwin, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_3, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_getxattr, __pyx_t_3) < 0) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/darwin.pyx":69 * * * def setxattr(path, name, value, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, name, value, size): * if isinstance(path, int): */ __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_follow_symlinks, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 69, __pyx_L1_error) __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_6darwin_5setxattr, 0, __pyx_n_s_setxattr, NULL, __pyx_n_s_borg_platform_darwin, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_2, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_setxattr, __pyx_t_2) < 0) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/darwin.pyx":82 * * * def _remove_numeric_id_if_possible(acl): # <<<<<<<<<<<<<< * """Replace the user/group field with the local uid/gid if possible * """ */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_6darwin_7_remove_numeric_id_if_possible, 0, __pyx_n_s_remove_numeric_id_if_possible, NULL, __pyx_n_s_borg_platform_darwin, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_remove_numeric_id_if_possible, __pyx_t_2) < 0) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/darwin.pyx":99 * * * def _remove_non_numeric_identifier(acl): # <<<<<<<<<<<<<< * """Remove user and group names from the acl * """ */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_6darwin_9_remove_non_numeric_identifier, 0, __pyx_n_s_remove_non_numeric_identifier, NULL, __pyx_n_s_borg_platform_darwin, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_remove_non_numeric_identifier, __pyx_t_2) < 0) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/darwin.pyx":114 * * * def acl_get(path, item, st, numeric_ids=False, fd=None): # <<<<<<<<<<<<<< * cdef acl_t acl = NULL * cdef char *text = NULL */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_6darwin_11acl_get, 0, __pyx_n_s_acl_get, NULL, __pyx_n_s_borg_platform_darwin, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__23); if (PyDict_SetItem(__pyx_d, __pyx_n_s_acl_get, __pyx_t_2) < 0) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/darwin.pyx":141 * * * def acl_set(path, item, numeric_ids=False, fd=None): # <<<<<<<<<<<<<< * cdef acl_t acl = NULL * acl_text = item.get('acl_extended') */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_6darwin_13acl_set, 0, __pyx_n_s_acl_set, NULL, __pyx_n_s_borg_platform_darwin, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__23); if (PyDict_SetItem(__pyx_d, __pyx_n_s_acl_set, __pyx_t_2) < 0) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/darwin.pyx":1 * import os # <<<<<<<<<<<<<< * * from libc.stdint cimport uint32_t */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init borg.platform.darwin", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init borg.platform.darwin"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* RaiseClosureNameError */ static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) { PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname); } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return -1; __Pyx_PyErr_Clear(); return 0; } return 0; } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } return __Pyx_IterFinish(); } /* SliceObject */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, int has_cstart, int has_cstop, int wraparound) { __Pyx_TypeName obj_type_name; #if CYTHON_USE_TYPE_SLOTS PyMappingMethods* mp; #if PY_MAJOR_VERSION < 3 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; if (likely(ms && ms->sq_slice)) { if (!has_cstart) { if (_py_start && (*_py_start != Py_None)) { cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstart = 0; } if (!has_cstop) { if (_py_stop && (*_py_stop != Py_None)) { cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstop = PY_SSIZE_T_MAX; } if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { Py_ssize_t l = ms->sq_length(obj); if (likely(l >= 0)) { if (cstop < 0) { cstop += l; if (cstop < 0) cstop = 0; } if (cstart < 0) { cstart += l; if (cstart < 0) cstart = 0; } } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) goto bad; PyErr_Clear(); } } return ms->sq_slice(obj, cstart, cstop); } #else CYTHON_UNUSED_VAR(wraparound); #endif mp = Py_TYPE(obj)->tp_as_mapping; if (likely(mp && mp->mp_subscript)) #else CYTHON_UNUSED_VAR(wraparound); #endif { PyObject* result; PyObject *py_slice, *py_start, *py_stop; if (_py_slice) { py_slice = *_py_slice; } else { PyObject* owned_start = NULL; PyObject* owned_stop = NULL; if (_py_start) { py_start = *_py_start; } else { if (has_cstart) { owned_start = py_start = PyInt_FromSsize_t(cstart); if (unlikely(!py_start)) goto bad; } else py_start = Py_None; } if (_py_stop) { py_stop = *_py_stop; } else { if (has_cstop) { owned_stop = py_stop = PyInt_FromSsize_t(cstop); if (unlikely(!py_stop)) { Py_XDECREF(owned_start); goto bad; } } else py_stop = Py_None; } py_slice = PySlice_New(py_start, py_stop, Py_None); Py_XDECREF(owned_start); Py_XDECREF(owned_stop); if (unlikely(!py_slice)) goto bad; } #if CYTHON_USE_TYPE_SLOTS result = mp->mp_subscript(obj, py_slice); #else result = PyObject_GetItem(obj, py_slice); #endif if (!_py_slice) { Py_DECREF(py_slice); } return result; } obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' object is unsliceable", obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); bad: return NULL; } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* GetItemInt */ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (unlikely(!j)) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_subscript) { PyObject *r, *key = PyInt_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); return r; } if (likely(sm && sm->sq_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return sm->sq_item(o, i); } } #else if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* SetItemInt */ static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { int r; if (unlikely(!j)) return -1; r = PyObject_SetItem(o, j, v); Py_DECREF(j); return r; } static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o)); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) { PyObject* old = PyList_GET_ITEM(o, n); Py_INCREF(v); PyList_SET_ITEM(o, n, v); Py_DECREF(old); return 1; } } else { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_ass_subscript) { int r; PyObject *key = PyInt_FromSsize_t(i); if (unlikely(!key)) return -1; r = mm->mp_ass_subscript(o, key, v); Py_DECREF(key); return r; } if (likely(sm && sm->sq_ass_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return -1; PyErr_Clear(); } } return sm->sq_ass_item(o, i, v); } } #else if (is_list || !PyMapping_Check(o)) { return PySequence_SetItem(o, i, v); } #endif return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v); } /* PyObjectCall2Args */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args[3] = {NULL, arg1, arg2}; return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP __Pyx_TypeName type_name; PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) #elif PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (likely(descr != NULL)) { *method = descr; return 0; } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(name)); #endif __Pyx_DECREF_TypeName(type_name); return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod1 */ #if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2) static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); Py_DECREF(method); return result; } #endif static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { #if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2 PyObject *args[2] = {obj, arg}; (void) __Pyx_PyObject_GetMethod; (void) __Pyx_PyObject_CallOneArg; (void) __Pyx_PyObject_Call2Args; return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); #else PyObject *method = NULL, *result; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_Call2Args(method, obj, arg); Py_DECREF(method); return result; } if (unlikely(!method)) return NULL; return __Pyx__PyObject_CallMethod1(method, arg); #endif } /* StringJoin */ static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) { (void) __Pyx_PyObject_CallMethod1; #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION < 3 return _PyString_Join(sep, values); #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 return _PyBytes_Join(sep, values); #else return __Pyx_PyObject_CallMethod1(sep, __pyx_n_s_join, values); #endif } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* GetException */ #if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) #endif { PyObject *local_type = NULL, *local_value, *local_tb = NULL; #if CYTHON_FAST_THREAD_STATE PyObject *tmp_type, *tmp_value, *tmp_tb; #if PY_VERSION_HEX >= 0x030C00A6 local_value = tstate->current_exception; tstate->current_exception = 0; if (likely(local_value)) { local_type = (PyObject*) Py_TYPE(local_value); Py_INCREF(local_type); local_tb = PyException_GetTraceback(local_value); } #else local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 if (unlikely(tstate->current_exception)) #elif CYTHON_FAST_THREAD_STATE if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE #if CYTHON_USE_EXC_INFO_STACK { _PyErr_StackItem *exc_info = tstate->exc_info; #if PY_VERSION_HEX >= 0x030B00a4 tmp_value = exc_info->exc_value; exc_info->exc_value = local_value; tmp_type = NULL; tmp_tb = NULL; Py_XDECREF(local_type); Py_XDECREF(local_tb); #else tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = local_type; exc_info->exc_value = local_value; exc_info->exc_traceback = local_tb; #endif } #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } /* SwapException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; tmp_value = exc_info->exc_value; exc_info->exc_value = *value; if (tmp_value == NULL || tmp_value == Py_None) { Py_XDECREF(tmp_value); tmp_value = NULL; tmp_type = NULL; tmp_tb = NULL; } else { tmp_type = (PyObject*) Py_TYPE(tmp_value); Py_INCREF(tmp_type); #if CYTHON_COMPILING_IN_CPYTHON tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback; Py_XINCREF(tmp_tb); #else tmp_tb = PyException_GetTraceback(tmp_value); #endif } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = *type; exc_info->exc_value = *value; exc_info->exc_traceback = *tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = *type; tstate->exc_value = *value; tstate->exc_traceback = *tb; #endif *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); PyErr_SetExcInfo(*type, *value, *tb); *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #endif /* GetTopmostException */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) { _PyErr_StackItem *exc_info = tstate->exc_info; while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && exc_info->previous_item != NULL) { exc_info = exc_info->previous_item; } return exc_info; } #endif /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); PyObject *exc_value = exc_info->exc_value; if (exc_value == NULL || exc_value == Py_None) { *value = NULL; *type = NULL; *tb = NULL; } else { *value = exc_value; Py_INCREF(*value); *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); *tb = PyException_GetTraceback(exc_value); } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); *type = exc_info->exc_type; *value = exc_info->exc_value; *tb = exc_info->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #else *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #endif } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; PyObject *tmp_value = exc_info->exc_value; exc_info->exc_value = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = type; exc_info->exc_value = value; exc_info->exc_traceback = tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } #endif /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_CallOneArg(method, obj); Py_DECREF(method); return result; } if (unlikely(!method)) goto bad; result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* ValidateBasesTuple */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; #if CYTHON_ASSUME_SAFE_MACROS n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); if (n < 0) return -1; #endif for (i = 1; i < n; i++) { #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; #elif CYTHON_ASSUME_SAFE_MACROS PyObject *b0 = PyTuple_GET_ITEM(bases, i); #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; #endif PyTypeObject *b; #if PY_MAJOR_VERSION < 3 if (PyClass_Check(b0)) { PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); __Pyx_DECREF_TypeName(b_name); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); if (!py_b_dictoffset) goto dictoffset_return; b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); Py_DECREF(py_b_dictoffset); if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; #endif if (b_dictoffset) { { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "extension type '%.200s' has no __dict__ slot, " "but base type '" __Pyx_FMT_TYPENAME "' has: " "either add 'cdef dict __dict__' to the extension type " "or add '__slots__ = [...]' to the base type", type_name, b_name); __Pyx_DECREF_TypeName(b_name); } #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif } return 0; } #endif /* PyType_Ready */ static int __Pyx_PyType_Ready(PyTypeObject *t) { #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS (void)__Pyx_validate_bases_tuple; #endif return PyType_Ready(t); #else int r; PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 gc_was_enabled = PyGC_Disable(); (void)__Pyx_PyObject_CallMethod0; #else PyObject *ret, *py_status; PyObject *gc = NULL; #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) gc = PyImport_GetModule(__pyx_kp_u_gc); #endif if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); if (unlikely(!gc)) return -1; py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; } gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; } Py_DECREF(ret); } else if (unlikely(gc_was_enabled == -1)) { Py_DECREF(gc); return -1; } #endif t->tp_flags |= Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A0000 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; #endif #else (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) PyGC_Enable(); #else if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); } else { Py_XDECREF(tp); Py_XDECREF(v); Py_XDECREF(tb); r = -1; } } Py_DECREF(gc); #endif } #endif return r; #endif } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, attr_name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(attr_name)); #endif __Pyx_DECREF_TypeName(type_name); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s__10; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__11); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (int) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (int) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = __Pyx_NewRef(v); } val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntFromPy */ static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const size_t neg_one = (size_t) -1, const_zero = (size_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(size_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (size_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(size_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(size_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) >= 2 * PyLong_SHIFT)) { return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } } break; case 3: if ((8 * sizeof(size_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) >= 3 * PyLong_SHIFT)) { return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } } break; case 4: if ((8 * sizeof(size_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) >= 4 * PyLong_SHIFT)) { return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (size_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(size_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(size_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) { return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); } } break; case 2: if ((8 * sizeof(size_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) { return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); } } break; case -3: if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) { return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); } } break; case 3: if ((8 * sizeof(size_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) { return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); } } break; case -4: if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT)) { return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); } } break; case 4: if ((8 * sizeof(size_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT)) { return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); } } break; } } #endif if ((sizeof(size_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(size_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { size_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (size_t) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (size_t) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (size_t) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (size_t) -1; } else { stepval = __Pyx_NewRef(v); } val = (size_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(size_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((size_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(size_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((size_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((size_t) 1) << (sizeof(size_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (size_t) -1; } } else { size_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (size_t) -1; val = __Pyx_PyInt_As_size_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to size_t"); return (size_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to size_t"); return (size_t) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name_2); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__26); } return name; } #endif /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (long) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (long) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = __Pyx_NewRef(v); } val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/platform/darwin.pyx0000644000076500000240000001350114641074756017620 0ustar00twstaffimport os from libc.stdint cimport uint32_t from libc cimport errno from .posix import user2uid, group2gid from ..helpers import safe_decode, safe_encode from .xattr import _listxattr_inner, _getxattr_inner, _setxattr_inner, split_string0 API_VERSION = '1.4_01' cdef extern from "sys/xattr.h": ssize_t c_listxattr "listxattr" (const char *path, char *list, size_t size, int flags) ssize_t c_flistxattr "flistxattr" (int filedes, char *list, size_t size, int flags) ssize_t c_getxattr "getxattr" (const char *path, const char *name, void *value, size_t size, uint32_t pos, int flags) ssize_t c_fgetxattr "fgetxattr" (int filedes, const char *name, void *value, size_t size, uint32_t pos, int flags) int c_setxattr "setxattr" (const char *path, const char *name, const void *value, size_t size, uint32_t pos, int flags) int c_fsetxattr "fsetxattr" (int filedes, const char *name, const void *value, size_t size, uint32_t pos, int flags) int XATTR_NOFOLLOW cdef int XATTR_NOFLAGS = 0x0000 cdef extern from "sys/acl.h": ctypedef struct _acl_t: pass ctypedef _acl_t *acl_t int acl_free(void *obj) acl_t acl_get_link_np(const char *path, int type) acl_t acl_get_fd_np(int fd, int type) int acl_set_link_np(const char *path, int type, acl_t acl) int acl_set_fd_np(int fd, acl_t acl, int type) acl_t acl_from_text(const char *buf) char *acl_to_text(acl_t acl, ssize_t *len_p) int ACL_TYPE_EXTENDED def listxattr(path, *, follow_symlinks=False): def func(path, buf, size): if isinstance(path, int): return c_flistxattr(path, buf, size, XATTR_NOFLAGS) else: if follow_symlinks: return c_listxattr(path, buf, size, XATTR_NOFLAGS) else: return c_listxattr(path, buf, size, XATTR_NOFOLLOW) n, buf = _listxattr_inner(func, path) return [name for name in split_string0(buf[:n]) if name] def getxattr(path, name, *, follow_symlinks=False): def func(path, name, buf, size): if isinstance(path, int): return c_fgetxattr(path, name, buf, size, 0, XATTR_NOFLAGS) else: if follow_symlinks: return c_getxattr(path, name, buf, size, 0, XATTR_NOFLAGS) else: return c_getxattr(path, name, buf, size, 0, XATTR_NOFOLLOW) n, buf = _getxattr_inner(func, path, name) return bytes(buf[:n]) def setxattr(path, name, value, *, follow_symlinks=False): def func(path, name, value, size): if isinstance(path, int): return c_fsetxattr(path, name, value, size, 0, XATTR_NOFLAGS) else: if follow_symlinks: return c_setxattr(path, name, value, size, 0, XATTR_NOFLAGS) else: return c_setxattr(path, name, value, size, 0, XATTR_NOFOLLOW) _setxattr_inner(func, path, name, value) def _remove_numeric_id_if_possible(acl): """Replace the user/group field with the local uid/gid if possible """ entries = [] for entry in safe_decode(acl).split('\n'): if entry: fields = entry.split(':') if fields[0] == 'user': if user2uid(fields[2]) is not None: fields[1] = fields[3] = '' elif fields[0] == 'group': if group2gid(fields[2]) is not None: fields[1] = fields[3] = '' entries.append(':'.join(fields)) return safe_encode('\n'.join(entries)) def _remove_non_numeric_identifier(acl): """Remove user and group names from the acl """ entries = [] for entry in safe_decode(acl).split('\n'): if entry: fields = entry.split(':') if fields[0] in ('user', 'group'): fields[2] = '' entries.append(':'.join(fields)) else: entries.append(entry) return safe_encode('\n'.join(entries)) def acl_get(path, item, st, numeric_ids=False, fd=None): cdef acl_t acl = NULL cdef char *text = NULL if isinstance(path, str): path = os.fsencode(path) try: if fd is not None: acl = acl_get_fd_np(fd, ACL_TYPE_EXTENDED) else: acl = acl_get_link_np(path, ACL_TYPE_EXTENDED) if acl == NULL: if errno.errno == errno.ENOENT: # macOS weirdness: if a file has no ACLs, it sets errno to ENOENT. :-( return raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) text = acl_to_text(acl, NULL) if text == NULL: raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) if numeric_ids: item['acl_extended'] = _remove_non_numeric_identifier(text) else: item['acl_extended'] = text finally: acl_free(text) acl_free(acl) def acl_set(path, item, numeric_ids=False, fd=None): cdef acl_t acl = NULL acl_text = item.get('acl_extended') if acl_text is not None: try: if isinstance(path, str): path = os.fsencode(path) if numeric_ids: acl = acl_from_text(acl_text) else: acl = acl_from_text(_remove_numeric_id_if_possible(acl_text)) if acl == NULL: raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) if fd is not None: if acl_set_fd_np(fd, acl, ACL_TYPE_EXTENDED) == -1: raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) else: if acl_set_link_np(path, ACL_TYPE_EXTENDED, acl) == -1: raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) finally: acl_free(acl) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719958148.0 borgbackup-1.4.0/src/borg/platform/freebsd.c0000644000076500000240000223413014641075204017342 0ustar00twstaff/* Generated by Cython 3.0.10 */ /* BEGIN: Cython Metadata { "distutils": { "depends": [], "extra_compile_args": [ "-Wall", "-Wextra", "-Wpointer-arith" ], "name": "borg.platform.freebsd", "sources": [ "src/borg/platform/freebsd.pyx" ] }, "module_name": "borg.platform.freebsd" } END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_10" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x03000AF0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 1 #endif #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #if PY_VERSION_HEX >= 0x030d00A4 # define __Pyx_PyCFunctionFast PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords #else # define __Pyx_PyCFunctionFast _PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__borg__platform__freebsd #define __PYX_HAVE_API__borg__platform__freebsd /* Early includes */ #include #include "sys/extattr.h" #include "sys/types.h" #include "sys/acl.h" #include "unistd.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/borg/platform/freebsd.pyx", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct__listxattr; struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr; struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr; struct __pyx_opt_args_4borg_8platform_7freebsd__get_acl; struct __pyx_opt_args_4borg_8platform_7freebsd__set_acl; /* "borg/platform/freebsd.pyx":127 * * * cdef _get_acl(p, type, item, attribute, flags, fd=None): # <<<<<<<<<<<<<< * cdef acl_t acl * cdef char *text */ struct __pyx_opt_args_4borg_8platform_7freebsd__get_acl { int __pyx_n; PyObject *fd; }; /* "borg/platform/freebsd.pyx":171 * * * cdef _set_acl(p, type, item, attribute, numeric_ids=False, fd=None): # <<<<<<<<<<<<<< * cdef acl_t acl * text = item.get(attribute) */ struct __pyx_opt_args_4borg_8platform_7freebsd__set_acl { int __pyx_n; PyObject *numeric_ids; PyObject *fd; }; /* "borg/platform/freebsd.pyx":76 * * * def listxattr(path, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, buf, size): * if isinstance(path, int): */ struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct__listxattr { PyObject_HEAD PyObject *__pyx_v_follow_symlinks; PyObject *__pyx_v_ns_id; }; /* "borg/platform/freebsd.pyx":92 * * * def getxattr(path, name, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, name, buf, size): * if isinstance(path, int): */ struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr { PyObject_HEAD PyObject *__pyx_v_follow_symlinks; PyObject *__pyx_v_ns_id; }; /* "borg/platform/freebsd.pyx":108 * * * def setxattr(path, name, value, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, name, value, size): * if isinstance(path, int): */ struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr { PyObject_HEAD PyObject *__pyx_v_follow_symlinks; PyObject *__pyx_v_ns_id; }; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* RaiseClosureNameError.proto */ static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname); /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* ObjectGetItem.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key); #else #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) #endif /* SliceObject.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); /* ListCompAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len)) { Py_INCREF(x); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 L->ob_item[len] = x; #else PyList_SET_ITEM(list, len, x); #endif __Pyx_SET_SIZE(list, len + 1); return 0; } return PyList_Append(list, x); } #else #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) #endif /* GetTopmostException.proto */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); #endif /* SaveResetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* SwapException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif /* ListAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 L->ob_item[len] = x; #else PyList_SET_ITEM(list, len, x); #endif __Pyx_SET_SIZE(list, len + 1); return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif /* PyObjectCall2Args.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod1.proto */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); /* StringJoin.proto */ #if PY_MAJOR_VERSION < 3 #define __Pyx_PyString_Join __Pyx_PyBytes_Join #define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v)) #else #define __Pyx_PyString_Join PyUnicode_Join #define __Pyx_PyBaseString_Join PyUnicode_Join #endif static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); /* PyObjectCallNoArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* ValidateBasesTuple.proto */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); #endif /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc" */ /* Module declarations from "libc.errno" */ /* Module declarations from "borg.platform.freebsd" */ static PyObject *__pyx_f_4borg_8platform_7freebsd__get_acl(PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, struct __pyx_opt_args_4borg_8platform_7freebsd__get_acl *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_4borg_8platform_7freebsd__set_acl(PyObject *, PyObject *, PyObject *, PyObject *, struct __pyx_opt_args_4borg_8platform_7freebsd__set_acl *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_4borg_8platform_7freebsd__nfs4_use_stored_uid_gid(PyObject *); /*proto*/ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "borg.platform.freebsd" extern int __pyx_module_is_main_borg__platform__freebsd; int __pyx_module_is_main_borg__platform__freebsd = 0; /* Implementation of "borg.platform.freebsd" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_KeyError; static PyObject *__pyx_builtin_OSError; /* #### Code section: string_decls ### */ static const char __pyx_k_[] = "."; static const char __pyx_k_n[] = "n"; static const char __pyx_k__9[] = "\n"; static const char __pyx_k_fd[] = "fd"; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k_ns[] = "ns"; static const char __pyx_k_os[] = "os"; static const char __pyx_k_st[] = "st"; static const char __pyx_k__10[] = ":"; static const char __pyx_k__12[] = "*"; static const char __pyx_k__26[] = "?"; static const char __pyx_k_buf[] = "buf"; static const char __pyx_k_get[] = "get"; static const char __pyx_k_ret[] = "ret"; static const char __pyx_k_func[] = "func"; static const char __pyx_k_item[] = "item"; static const char __pyx_k_join[] = "join"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "name"; static const char __pyx_k_path[] = "path"; static const char __pyx_k_size[] = "size"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_stat[] = "stat"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_user[] = "user"; static const char __pyx_k_flags[] = "flags"; static const char __pyx_k_group[] = "group:"; static const char __pyx_k_ns_id[] = "ns_id"; static const char __pyx_k_posix[] = "posix"; static const char __pyx_k_split[] = "split"; static const char __pyx_k_value[] = "value"; static const char __pyx_k_xattr[] = "xattr"; static const char __pyx_k_1_4_01[] = "1.4_01"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_name_2[] = "__name__"; static const char __pyx_k_user_2[] = "user:"; static const char __pyx_k_OSError[] = "OSError"; static const char __pyx_k_S_ISDIR[] = "S_ISDIR"; static const char __pyx_k_acl_get[] = "acl_get"; static const char __pyx_k_acl_set[] = "acl_set"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_helpers[] = "helpers"; static const char __pyx_k_ns_name[] = "ns_name"; static const char __pyx_k_st_mode[] = "st_mode"; static const char __pyx_k_KeyError[] = "KeyError"; static const char __pyx_k_acl_nfs4[] = "acl_nfs4"; static const char __pyx_k_fsdecode[] = "fsdecode"; static const char __pyx_k_fsencode[] = "fsencode"; static const char __pyx_k_getxattr[] = "getxattr"; static const char __pyx_k_nfs4_acl[] = "nfs4_acl"; static const char __pyx_k_setxattr[] = "setxattr"; static const char __pyx_k_split_ns[] = "split_ns"; static const char __pyx_k_strerror[] = "strerror"; static const char __pyx_k_NS_ID_MAP[] = "NS_ID_MAP"; static const char __pyx_k_isenabled[] = "isenabled"; static const char __pyx_k_listxattr[] = "listxattr"; static const char __pyx_k_acl_access[] = "acl_access"; static const char __pyx_k_default_ns[] = "default_ns"; static const char __pyx_k_startswith[] = "startswith"; static const char __pyx_k_API_VERSION[] = "API_VERSION"; static const char __pyx_k_acl_default[] = "acl_default"; static const char __pyx_k_numeric_ids[] = "numeric_ids"; static const char __pyx_k_safe_decode[] = "safe_decode"; static const char __pyx_k_safe_encode[] = "safe_encode"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_class_getitem[] = "__class_getitem__"; static const char __pyx_k_ns_name_tuple[] = "ns_name_tuple"; static const char __pyx_k_split_lstring[] = "split_lstring"; static const char __pyx_k_getxattr_inner[] = "_getxattr_inner"; static const char __pyx_k_setxattr_inner[] = "_setxattr_inner"; static const char __pyx_k_follow_symlinks[] = "follow_symlinks"; static const char __pyx_k_listxattr_inner[] = "_listxattr_inner"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_getxattr_locals_func[] = "getxattr..func"; static const char __pyx_k_setxattr_locals_func[] = "setxattr..func"; static const char __pyx_k_borg_platform_freebsd[] = "borg.platform.freebsd"; static const char __pyx_k_listxattr_locals_func[] = "listxattr..func"; static const char __pyx_k_posix_acl_use_stored_uid_gid[] = "posix_acl_use_stored_uid_gid"; static const char __pyx_k_src_borg_platform_freebsd_pyx[] = "src/borg/platform/freebsd.pyx"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_4borg_8platform_7freebsd_split_ns(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ns_name, PyObject *__pyx_v_default_ns); /* proto */ static PyObject *__pyx_pf_4borg_8platform_7freebsd_9listxattr_func(PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_buf, PyObject *__pyx_v_size); /* proto */ static PyObject *__pyx_pf_4borg_8platform_7freebsd_2listxattr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_follow_symlinks); /* proto */ static PyObject *__pyx_pf_4borg_8platform_7freebsd_8getxattr_func(PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_name, PyObject *__pyx_v_buf, PyObject *__pyx_v_size); /* proto */ static PyObject *__pyx_pf_4borg_8platform_7freebsd_4getxattr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_name, PyObject *__pyx_v_follow_symlinks); /* proto */ static PyObject *__pyx_pf_4borg_8platform_7freebsd_8setxattr_func(PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_name, PyObject *__pyx_v_value, PyObject *__pyx_v_size); /* proto */ static PyObject *__pyx_pf_4borg_8platform_7freebsd_6setxattr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_name, PyObject *__pyx_v_value, PyObject *__pyx_v_follow_symlinks); /* proto */ static PyObject *__pyx_pf_4borg_8platform_7freebsd_8acl_get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_item, PyObject *__pyx_v_st, PyObject *__pyx_v_numeric_ids, PyObject *__pyx_v_fd); /* proto */ static PyObject *__pyx_pf_4borg_8platform_7freebsd_10acl_set(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_item, PyObject *__pyx_v_numeric_ids, PyObject *__pyx_v_fd); /* proto */ static PyObject *__pyx_tp_new_4borg_8platform_7freebsd___pyx_scope_struct__listxattr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE PyObject *__pyx_type_4borg_8platform_7freebsd___pyx_scope_struct__listxattr; PyObject *__pyx_type_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr; PyObject *__pyx_type_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr; #endif PyTypeObject *__pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct__listxattr; PyTypeObject *__pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr; PyTypeObject *__pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr; PyObject *__pyx_kp_b_; PyObject *__pyx_kp_u_; PyObject *__pyx_kp_s_1_4_01; PyObject *__pyx_n_s_API_VERSION; PyObject *__pyx_n_s_KeyError; PyObject *__pyx_n_s_NS_ID_MAP; PyObject *__pyx_n_s_OSError; PyObject *__pyx_n_s_S_ISDIR; PyObject *__pyx_kp_s__10; PyObject *__pyx_n_s__12; PyObject *__pyx_n_s__26; PyObject *__pyx_kp_s__9; PyObject *__pyx_n_s_acl_access; PyObject *__pyx_n_s_acl_default; PyObject *__pyx_n_s_acl_get; PyObject *__pyx_n_s_acl_nfs4; PyObject *__pyx_n_s_acl_set; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_borg_platform_freebsd; PyObject *__pyx_n_s_buf; PyObject *__pyx_n_s_class_getitem; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_default_ns; PyObject *__pyx_kp_u_disable; PyObject *__pyx_kp_u_enable; PyObject *__pyx_n_s_fd; PyObject *__pyx_n_s_flags; PyObject *__pyx_n_s_follow_symlinks; PyObject *__pyx_n_s_fsdecode; PyObject *__pyx_n_s_fsencode; PyObject *__pyx_n_s_func; PyObject *__pyx_kp_u_gc; PyObject *__pyx_n_s_get; PyObject *__pyx_n_s_getxattr; PyObject *__pyx_n_s_getxattr_inner; PyObject *__pyx_n_s_getxattr_locals_func; PyObject *__pyx_kp_s_group; PyObject *__pyx_n_s_helpers; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_kp_u_isenabled; PyObject *__pyx_n_s_item; PyObject *__pyx_n_s_join; PyObject *__pyx_n_s_listxattr; PyObject *__pyx_n_s_listxattr_inner; PyObject *__pyx_n_s_listxattr_locals_func; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_n; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_name_2; PyObject *__pyx_n_s_nfs4_acl; PyObject *__pyx_n_s_ns; PyObject *__pyx_n_s_ns_id; PyObject *__pyx_n_s_ns_name; PyObject *__pyx_n_s_ns_name_tuple; PyObject *__pyx_n_s_numeric_ids; PyObject *__pyx_n_s_os; PyObject *__pyx_n_s_path; PyObject *__pyx_n_s_posix; PyObject *__pyx_n_s_posix_acl_use_stored_uid_gid; PyObject *__pyx_n_s_ret; PyObject *__pyx_n_s_safe_decode; PyObject *__pyx_n_s_safe_encode; PyObject *__pyx_n_s_setxattr; PyObject *__pyx_n_s_setxattr_inner; PyObject *__pyx_n_s_setxattr_locals_func; PyObject *__pyx_n_s_size; PyObject *__pyx_n_s_spec; PyObject *__pyx_n_s_split; PyObject *__pyx_n_s_split_lstring; PyObject *__pyx_n_s_split_ns; PyObject *__pyx_kp_s_src_borg_platform_freebsd_pyx; PyObject *__pyx_n_s_st; PyObject *__pyx_n_s_st_mode; PyObject *__pyx_n_s_startswith; PyObject *__pyx_n_s_stat; PyObject *__pyx_n_s_strerror; PyObject *__pyx_n_s_test; PyObject *__pyx_n_b_user; PyObject *__pyx_kp_s_user_2; PyObject *__pyx_n_s_value; PyObject *__pyx_n_s_xattr; PyObject *__pyx_int_1; PyObject *__pyx_int_2; PyObject *__pyx_int_neg_1; PyObject *__pyx_tuple__2; PyObject *__pyx_tuple__3; PyObject *__pyx_tuple__5; PyObject *__pyx_tuple__7; PyObject *__pyx_slice__11; PyObject *__pyx_tuple__13; PyObject *__pyx_tuple__15; PyObject *__pyx_tuple__17; PyObject *__pyx_tuple__19; PyObject *__pyx_tuple__21; PyObject *__pyx_tuple__23; PyObject *__pyx_tuple__24; PyObject *__pyx_codeobj__4; PyObject *__pyx_codeobj__6; PyObject *__pyx_codeobj__8; PyObject *__pyx_codeobj__14; PyObject *__pyx_codeobj__16; PyObject *__pyx_codeobj__18; PyObject *__pyx_codeobj__20; PyObject *__pyx_codeobj__22; PyObject *__pyx_codeobj__25; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct__listxattr); Py_CLEAR(clear_module_state->__pyx_type_4borg_8platform_7freebsd___pyx_scope_struct__listxattr); Py_CLEAR(clear_module_state->__pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr); Py_CLEAR(clear_module_state->__pyx_type_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr); Py_CLEAR(clear_module_state->__pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr); Py_CLEAR(clear_module_state->__pyx_type_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr); Py_CLEAR(clear_module_state->__pyx_kp_b_); Py_CLEAR(clear_module_state->__pyx_kp_u_); Py_CLEAR(clear_module_state->__pyx_kp_s_1_4_01); Py_CLEAR(clear_module_state->__pyx_n_s_API_VERSION); Py_CLEAR(clear_module_state->__pyx_n_s_KeyError); Py_CLEAR(clear_module_state->__pyx_n_s_NS_ID_MAP); Py_CLEAR(clear_module_state->__pyx_n_s_OSError); Py_CLEAR(clear_module_state->__pyx_n_s_S_ISDIR); Py_CLEAR(clear_module_state->__pyx_kp_s__10); Py_CLEAR(clear_module_state->__pyx_n_s__12); Py_CLEAR(clear_module_state->__pyx_n_s__26); Py_CLEAR(clear_module_state->__pyx_kp_s__9); Py_CLEAR(clear_module_state->__pyx_n_s_acl_access); Py_CLEAR(clear_module_state->__pyx_n_s_acl_default); Py_CLEAR(clear_module_state->__pyx_n_s_acl_get); Py_CLEAR(clear_module_state->__pyx_n_s_acl_nfs4); Py_CLEAR(clear_module_state->__pyx_n_s_acl_set); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_borg_platform_freebsd); Py_CLEAR(clear_module_state->__pyx_n_s_buf); Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_default_ns); Py_CLEAR(clear_module_state->__pyx_kp_u_disable); Py_CLEAR(clear_module_state->__pyx_kp_u_enable); Py_CLEAR(clear_module_state->__pyx_n_s_fd); Py_CLEAR(clear_module_state->__pyx_n_s_flags); Py_CLEAR(clear_module_state->__pyx_n_s_follow_symlinks); Py_CLEAR(clear_module_state->__pyx_n_s_fsdecode); Py_CLEAR(clear_module_state->__pyx_n_s_fsencode); Py_CLEAR(clear_module_state->__pyx_n_s_func); Py_CLEAR(clear_module_state->__pyx_kp_u_gc); Py_CLEAR(clear_module_state->__pyx_n_s_get); Py_CLEAR(clear_module_state->__pyx_n_s_getxattr); Py_CLEAR(clear_module_state->__pyx_n_s_getxattr_inner); Py_CLEAR(clear_module_state->__pyx_n_s_getxattr_locals_func); Py_CLEAR(clear_module_state->__pyx_kp_s_group); Py_CLEAR(clear_module_state->__pyx_n_s_helpers); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); Py_CLEAR(clear_module_state->__pyx_n_s_item); Py_CLEAR(clear_module_state->__pyx_n_s_join); Py_CLEAR(clear_module_state->__pyx_n_s_listxattr); Py_CLEAR(clear_module_state->__pyx_n_s_listxattr_inner); Py_CLEAR(clear_module_state->__pyx_n_s_listxattr_locals_func); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_n); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_name_2); Py_CLEAR(clear_module_state->__pyx_n_s_nfs4_acl); Py_CLEAR(clear_module_state->__pyx_n_s_ns); Py_CLEAR(clear_module_state->__pyx_n_s_ns_id); Py_CLEAR(clear_module_state->__pyx_n_s_ns_name); Py_CLEAR(clear_module_state->__pyx_n_s_ns_name_tuple); Py_CLEAR(clear_module_state->__pyx_n_s_numeric_ids); Py_CLEAR(clear_module_state->__pyx_n_s_os); Py_CLEAR(clear_module_state->__pyx_n_s_path); Py_CLEAR(clear_module_state->__pyx_n_s_posix); Py_CLEAR(clear_module_state->__pyx_n_s_posix_acl_use_stored_uid_gid); Py_CLEAR(clear_module_state->__pyx_n_s_ret); Py_CLEAR(clear_module_state->__pyx_n_s_safe_decode); Py_CLEAR(clear_module_state->__pyx_n_s_safe_encode); Py_CLEAR(clear_module_state->__pyx_n_s_setxattr); Py_CLEAR(clear_module_state->__pyx_n_s_setxattr_inner); Py_CLEAR(clear_module_state->__pyx_n_s_setxattr_locals_func); Py_CLEAR(clear_module_state->__pyx_n_s_size); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_n_s_split); Py_CLEAR(clear_module_state->__pyx_n_s_split_lstring); Py_CLEAR(clear_module_state->__pyx_n_s_split_ns); Py_CLEAR(clear_module_state->__pyx_kp_s_src_borg_platform_freebsd_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_st); Py_CLEAR(clear_module_state->__pyx_n_s_st_mode); Py_CLEAR(clear_module_state->__pyx_n_s_startswith); Py_CLEAR(clear_module_state->__pyx_n_s_stat); Py_CLEAR(clear_module_state->__pyx_n_s_strerror); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_b_user); Py_CLEAR(clear_module_state->__pyx_kp_s_user_2); Py_CLEAR(clear_module_state->__pyx_n_s_value); Py_CLEAR(clear_module_state->__pyx_n_s_xattr); Py_CLEAR(clear_module_state->__pyx_int_1); Py_CLEAR(clear_module_state->__pyx_int_2); Py_CLEAR(clear_module_state->__pyx_int_neg_1); Py_CLEAR(clear_module_state->__pyx_tuple__2); Py_CLEAR(clear_module_state->__pyx_tuple__3); Py_CLEAR(clear_module_state->__pyx_tuple__5); Py_CLEAR(clear_module_state->__pyx_tuple__7); Py_CLEAR(clear_module_state->__pyx_slice__11); Py_CLEAR(clear_module_state->__pyx_tuple__13); Py_CLEAR(clear_module_state->__pyx_tuple__15); Py_CLEAR(clear_module_state->__pyx_tuple__17); Py_CLEAR(clear_module_state->__pyx_tuple__19); Py_CLEAR(clear_module_state->__pyx_tuple__21); Py_CLEAR(clear_module_state->__pyx_tuple__23); Py_CLEAR(clear_module_state->__pyx_tuple__24); Py_CLEAR(clear_module_state->__pyx_codeobj__4); Py_CLEAR(clear_module_state->__pyx_codeobj__6); Py_CLEAR(clear_module_state->__pyx_codeobj__8); Py_CLEAR(clear_module_state->__pyx_codeobj__14); Py_CLEAR(clear_module_state->__pyx_codeobj__16); Py_CLEAR(clear_module_state->__pyx_codeobj__18); Py_CLEAR(clear_module_state->__pyx_codeobj__20); Py_CLEAR(clear_module_state->__pyx_codeobj__22); Py_CLEAR(clear_module_state->__pyx_codeobj__25); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct__listxattr); Py_VISIT(traverse_module_state->__pyx_type_4borg_8platform_7freebsd___pyx_scope_struct__listxattr); Py_VISIT(traverse_module_state->__pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr); Py_VISIT(traverse_module_state->__pyx_type_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr); Py_VISIT(traverse_module_state->__pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr); Py_VISIT(traverse_module_state->__pyx_type_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr); Py_VISIT(traverse_module_state->__pyx_kp_b_); Py_VISIT(traverse_module_state->__pyx_kp_u_); Py_VISIT(traverse_module_state->__pyx_kp_s_1_4_01); Py_VISIT(traverse_module_state->__pyx_n_s_API_VERSION); Py_VISIT(traverse_module_state->__pyx_n_s_KeyError); Py_VISIT(traverse_module_state->__pyx_n_s_NS_ID_MAP); Py_VISIT(traverse_module_state->__pyx_n_s_OSError); Py_VISIT(traverse_module_state->__pyx_n_s_S_ISDIR); Py_VISIT(traverse_module_state->__pyx_kp_s__10); Py_VISIT(traverse_module_state->__pyx_n_s__12); Py_VISIT(traverse_module_state->__pyx_n_s__26); Py_VISIT(traverse_module_state->__pyx_kp_s__9); Py_VISIT(traverse_module_state->__pyx_n_s_acl_access); Py_VISIT(traverse_module_state->__pyx_n_s_acl_default); Py_VISIT(traverse_module_state->__pyx_n_s_acl_get); Py_VISIT(traverse_module_state->__pyx_n_s_acl_nfs4); Py_VISIT(traverse_module_state->__pyx_n_s_acl_set); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_borg_platform_freebsd); Py_VISIT(traverse_module_state->__pyx_n_s_buf); Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_default_ns); Py_VISIT(traverse_module_state->__pyx_kp_u_disable); Py_VISIT(traverse_module_state->__pyx_kp_u_enable); Py_VISIT(traverse_module_state->__pyx_n_s_fd); Py_VISIT(traverse_module_state->__pyx_n_s_flags); Py_VISIT(traverse_module_state->__pyx_n_s_follow_symlinks); Py_VISIT(traverse_module_state->__pyx_n_s_fsdecode); Py_VISIT(traverse_module_state->__pyx_n_s_fsencode); Py_VISIT(traverse_module_state->__pyx_n_s_func); Py_VISIT(traverse_module_state->__pyx_kp_u_gc); Py_VISIT(traverse_module_state->__pyx_n_s_get); Py_VISIT(traverse_module_state->__pyx_n_s_getxattr); Py_VISIT(traverse_module_state->__pyx_n_s_getxattr_inner); Py_VISIT(traverse_module_state->__pyx_n_s_getxattr_locals_func); Py_VISIT(traverse_module_state->__pyx_kp_s_group); Py_VISIT(traverse_module_state->__pyx_n_s_helpers); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); Py_VISIT(traverse_module_state->__pyx_n_s_item); Py_VISIT(traverse_module_state->__pyx_n_s_join); Py_VISIT(traverse_module_state->__pyx_n_s_listxattr); Py_VISIT(traverse_module_state->__pyx_n_s_listxattr_inner); Py_VISIT(traverse_module_state->__pyx_n_s_listxattr_locals_func); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_n); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_name_2); Py_VISIT(traverse_module_state->__pyx_n_s_nfs4_acl); Py_VISIT(traverse_module_state->__pyx_n_s_ns); Py_VISIT(traverse_module_state->__pyx_n_s_ns_id); Py_VISIT(traverse_module_state->__pyx_n_s_ns_name); Py_VISIT(traverse_module_state->__pyx_n_s_ns_name_tuple); Py_VISIT(traverse_module_state->__pyx_n_s_numeric_ids); Py_VISIT(traverse_module_state->__pyx_n_s_os); Py_VISIT(traverse_module_state->__pyx_n_s_path); Py_VISIT(traverse_module_state->__pyx_n_s_posix); Py_VISIT(traverse_module_state->__pyx_n_s_posix_acl_use_stored_uid_gid); Py_VISIT(traverse_module_state->__pyx_n_s_ret); Py_VISIT(traverse_module_state->__pyx_n_s_safe_decode); Py_VISIT(traverse_module_state->__pyx_n_s_safe_encode); Py_VISIT(traverse_module_state->__pyx_n_s_setxattr); Py_VISIT(traverse_module_state->__pyx_n_s_setxattr_inner); Py_VISIT(traverse_module_state->__pyx_n_s_setxattr_locals_func); Py_VISIT(traverse_module_state->__pyx_n_s_size); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_n_s_split); Py_VISIT(traverse_module_state->__pyx_n_s_split_lstring); Py_VISIT(traverse_module_state->__pyx_n_s_split_ns); Py_VISIT(traverse_module_state->__pyx_kp_s_src_borg_platform_freebsd_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_st); Py_VISIT(traverse_module_state->__pyx_n_s_st_mode); Py_VISIT(traverse_module_state->__pyx_n_s_startswith); Py_VISIT(traverse_module_state->__pyx_n_s_stat); Py_VISIT(traverse_module_state->__pyx_n_s_strerror); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_b_user); Py_VISIT(traverse_module_state->__pyx_kp_s_user_2); Py_VISIT(traverse_module_state->__pyx_n_s_value); Py_VISIT(traverse_module_state->__pyx_n_s_xattr); Py_VISIT(traverse_module_state->__pyx_int_1); Py_VISIT(traverse_module_state->__pyx_int_2); Py_VISIT(traverse_module_state->__pyx_int_neg_1); Py_VISIT(traverse_module_state->__pyx_tuple__2); Py_VISIT(traverse_module_state->__pyx_tuple__3); Py_VISIT(traverse_module_state->__pyx_tuple__5); Py_VISIT(traverse_module_state->__pyx_tuple__7); Py_VISIT(traverse_module_state->__pyx_slice__11); Py_VISIT(traverse_module_state->__pyx_tuple__13); Py_VISIT(traverse_module_state->__pyx_tuple__15); Py_VISIT(traverse_module_state->__pyx_tuple__17); Py_VISIT(traverse_module_state->__pyx_tuple__19); Py_VISIT(traverse_module_state->__pyx_tuple__21); Py_VISIT(traverse_module_state->__pyx_tuple__23); Py_VISIT(traverse_module_state->__pyx_tuple__24); Py_VISIT(traverse_module_state->__pyx_codeobj__4); Py_VISIT(traverse_module_state->__pyx_codeobj__6); Py_VISIT(traverse_module_state->__pyx_codeobj__8); Py_VISIT(traverse_module_state->__pyx_codeobj__14); Py_VISIT(traverse_module_state->__pyx_codeobj__16); Py_VISIT(traverse_module_state->__pyx_codeobj__18); Py_VISIT(traverse_module_state->__pyx_codeobj__20); Py_VISIT(traverse_module_state->__pyx_codeobj__22); Py_VISIT(traverse_module_state->__pyx_codeobj__25); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #define __pyx_type_4borg_8platform_7freebsd___pyx_scope_struct__listxattr __pyx_mstate_global->__pyx_type_4borg_8platform_7freebsd___pyx_scope_struct__listxattr #define __pyx_type_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr __pyx_mstate_global->__pyx_type_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr #define __pyx_type_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr __pyx_mstate_global->__pyx_type_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr #endif #define __pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct__listxattr __pyx_mstate_global->__pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct__listxattr #define __pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr __pyx_mstate_global->__pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr #define __pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr __pyx_mstate_global->__pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr #define __pyx_kp_b_ __pyx_mstate_global->__pyx_kp_b_ #define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_ #define __pyx_kp_s_1_4_01 __pyx_mstate_global->__pyx_kp_s_1_4_01 #define __pyx_n_s_API_VERSION __pyx_mstate_global->__pyx_n_s_API_VERSION #define __pyx_n_s_KeyError __pyx_mstate_global->__pyx_n_s_KeyError #define __pyx_n_s_NS_ID_MAP __pyx_mstate_global->__pyx_n_s_NS_ID_MAP #define __pyx_n_s_OSError __pyx_mstate_global->__pyx_n_s_OSError #define __pyx_n_s_S_ISDIR __pyx_mstate_global->__pyx_n_s_S_ISDIR #define __pyx_kp_s__10 __pyx_mstate_global->__pyx_kp_s__10 #define __pyx_n_s__12 __pyx_mstate_global->__pyx_n_s__12 #define __pyx_n_s__26 __pyx_mstate_global->__pyx_n_s__26 #define __pyx_kp_s__9 __pyx_mstate_global->__pyx_kp_s__9 #define __pyx_n_s_acl_access __pyx_mstate_global->__pyx_n_s_acl_access #define __pyx_n_s_acl_default __pyx_mstate_global->__pyx_n_s_acl_default #define __pyx_n_s_acl_get __pyx_mstate_global->__pyx_n_s_acl_get #define __pyx_n_s_acl_nfs4 __pyx_mstate_global->__pyx_n_s_acl_nfs4 #define __pyx_n_s_acl_set __pyx_mstate_global->__pyx_n_s_acl_set #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_borg_platform_freebsd __pyx_mstate_global->__pyx_n_s_borg_platform_freebsd #define __pyx_n_s_buf __pyx_mstate_global->__pyx_n_s_buf #define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_default_ns __pyx_mstate_global->__pyx_n_s_default_ns #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable #define __pyx_n_s_fd __pyx_mstate_global->__pyx_n_s_fd #define __pyx_n_s_flags __pyx_mstate_global->__pyx_n_s_flags #define __pyx_n_s_follow_symlinks __pyx_mstate_global->__pyx_n_s_follow_symlinks #define __pyx_n_s_fsdecode __pyx_mstate_global->__pyx_n_s_fsdecode #define __pyx_n_s_fsencode __pyx_mstate_global->__pyx_n_s_fsencode #define __pyx_n_s_func __pyx_mstate_global->__pyx_n_s_func #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc #define __pyx_n_s_get __pyx_mstate_global->__pyx_n_s_get #define __pyx_n_s_getxattr __pyx_mstate_global->__pyx_n_s_getxattr #define __pyx_n_s_getxattr_inner __pyx_mstate_global->__pyx_n_s_getxattr_inner #define __pyx_n_s_getxattr_locals_func __pyx_mstate_global->__pyx_n_s_getxattr_locals_func #define __pyx_kp_s_group __pyx_mstate_global->__pyx_kp_s_group #define __pyx_n_s_helpers __pyx_mstate_global->__pyx_n_s_helpers #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled #define __pyx_n_s_item __pyx_mstate_global->__pyx_n_s_item #define __pyx_n_s_join __pyx_mstate_global->__pyx_n_s_join #define __pyx_n_s_listxattr __pyx_mstate_global->__pyx_n_s_listxattr #define __pyx_n_s_listxattr_inner __pyx_mstate_global->__pyx_n_s_listxattr_inner #define __pyx_n_s_listxattr_locals_func __pyx_mstate_global->__pyx_n_s_listxattr_locals_func #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_n __pyx_mstate_global->__pyx_n_s_n #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_name_2 __pyx_mstate_global->__pyx_n_s_name_2 #define __pyx_n_s_nfs4_acl __pyx_mstate_global->__pyx_n_s_nfs4_acl #define __pyx_n_s_ns __pyx_mstate_global->__pyx_n_s_ns #define __pyx_n_s_ns_id __pyx_mstate_global->__pyx_n_s_ns_id #define __pyx_n_s_ns_name __pyx_mstate_global->__pyx_n_s_ns_name #define __pyx_n_s_ns_name_tuple __pyx_mstate_global->__pyx_n_s_ns_name_tuple #define __pyx_n_s_numeric_ids __pyx_mstate_global->__pyx_n_s_numeric_ids #define __pyx_n_s_os __pyx_mstate_global->__pyx_n_s_os #define __pyx_n_s_path __pyx_mstate_global->__pyx_n_s_path #define __pyx_n_s_posix __pyx_mstate_global->__pyx_n_s_posix #define __pyx_n_s_posix_acl_use_stored_uid_gid __pyx_mstate_global->__pyx_n_s_posix_acl_use_stored_uid_gid #define __pyx_n_s_ret __pyx_mstate_global->__pyx_n_s_ret #define __pyx_n_s_safe_decode __pyx_mstate_global->__pyx_n_s_safe_decode #define __pyx_n_s_safe_encode __pyx_mstate_global->__pyx_n_s_safe_encode #define __pyx_n_s_setxattr __pyx_mstate_global->__pyx_n_s_setxattr #define __pyx_n_s_setxattr_inner __pyx_mstate_global->__pyx_n_s_setxattr_inner #define __pyx_n_s_setxattr_locals_func __pyx_mstate_global->__pyx_n_s_setxattr_locals_func #define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_n_s_split __pyx_mstate_global->__pyx_n_s_split #define __pyx_n_s_split_lstring __pyx_mstate_global->__pyx_n_s_split_lstring #define __pyx_n_s_split_ns __pyx_mstate_global->__pyx_n_s_split_ns #define __pyx_kp_s_src_borg_platform_freebsd_pyx __pyx_mstate_global->__pyx_kp_s_src_borg_platform_freebsd_pyx #define __pyx_n_s_st __pyx_mstate_global->__pyx_n_s_st #define __pyx_n_s_st_mode __pyx_mstate_global->__pyx_n_s_st_mode #define __pyx_n_s_startswith __pyx_mstate_global->__pyx_n_s_startswith #define __pyx_n_s_stat __pyx_mstate_global->__pyx_n_s_stat #define __pyx_n_s_strerror __pyx_mstate_global->__pyx_n_s_strerror #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_b_user __pyx_mstate_global->__pyx_n_b_user #define __pyx_kp_s_user_2 __pyx_mstate_global->__pyx_kp_s_user_2 #define __pyx_n_s_value __pyx_mstate_global->__pyx_n_s_value #define __pyx_n_s_xattr __pyx_mstate_global->__pyx_n_s_xattr #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 #define __pyx_int_2 __pyx_mstate_global->__pyx_int_2 #define __pyx_int_neg_1 __pyx_mstate_global->__pyx_int_neg_1 #define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 #define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 #define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5 #define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 #define __pyx_slice__11 __pyx_mstate_global->__pyx_slice__11 #define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13 #define __pyx_tuple__15 __pyx_mstate_global->__pyx_tuple__15 #define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17 #define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19 #define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21 #define __pyx_tuple__23 __pyx_mstate_global->__pyx_tuple__23 #define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24 #define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4 #define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6 #define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8 #define __pyx_codeobj__14 __pyx_mstate_global->__pyx_codeobj__14 #define __pyx_codeobj__16 __pyx_mstate_global->__pyx_codeobj__16 #define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 #define __pyx_codeobj__20 __pyx_mstate_global->__pyx_codeobj__20 #define __pyx_codeobj__22 __pyx_mstate_global->__pyx_codeobj__22 #define __pyx_codeobj__25 __pyx_mstate_global->__pyx_codeobj__25 /* #### Code section: module_code ### */ /* "borg/platform/freebsd.pyx":59 * * * def split_ns(ns_name, default_ns): # <<<<<<<<<<<<<< * # split ns_name (which is in the form of b"namespace.name") into namespace and name. * # if there is no namespace given in ns_name, default to default_ns. */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_7freebsd_1split_ns(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8platform_7freebsd_1split_ns = {"split_ns", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_7freebsd_1split_ns, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8platform_7freebsd_1split_ns(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_ns_name = 0; PyObject *__pyx_v_default_ns = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("split_ns (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ns_name,&__pyx_n_s_default_ns,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ns_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_default_ns)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("split_ns", 1, 2, 2, 1); __PYX_ERR(0, 59, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "split_ns") < 0)) __PYX_ERR(0, 59, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_ns_name = values[0]; __pyx_v_default_ns = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("split_ns", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 59, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.freebsd.split_ns", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_7freebsd_split_ns(__pyx_self, __pyx_v_ns_name, __pyx_v_default_ns); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8platform_7freebsd_split_ns(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ns_name, PyObject *__pyx_v_default_ns) { PyObject *__pyx_v_ns_name_tuple = NULL; PyObject *__pyx_v_ns = NULL; PyObject *__pyx_v_name = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("split_ns", 1); /* "borg/platform/freebsd.pyx":66 * # we also need to deal with "unexpected" namespaces here, they could come * # from borg archives made on other operating systems. * ns_name_tuple = ns_name.split(b".", 1) # <<<<<<<<<<<<<< * if len(ns_name_tuple) == 2: * # we have a namespace prefix in the given name */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ns_name, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ns_name_tuple = __pyx_t_2; __pyx_t_2 = 0; /* "borg/platform/freebsd.pyx":67 * # from borg archives made on other operating systems. * ns_name_tuple = ns_name.split(b".", 1) * if len(ns_name_tuple) == 2: # <<<<<<<<<<<<<< * # we have a namespace prefix in the given name * ns, name = ns_name_tuple */ __pyx_t_3 = PyObject_Length(__pyx_v_ns_name_tuple); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 67, __pyx_L1_error) __pyx_t_4 = (__pyx_t_3 == 2); if (__pyx_t_4) { /* "borg/platform/freebsd.pyx":69 * if len(ns_name_tuple) == 2: * # we have a namespace prefix in the given name * ns, name = ns_name_tuple # <<<<<<<<<<<<<< * else: * # no namespace given in ns_name (== no dot found), maybe data coming from an old borg archive. */ if ((likely(PyTuple_CheckExact(__pyx_v_ns_name_tuple))) || (PyList_CheckExact(__pyx_v_ns_name_tuple))) { PyObject* sequence = __pyx_v_ns_name_tuple; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 69, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_ns_name_tuple); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 69, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 69, __pyx_L1_error) __pyx_L5_unpacking_done:; } __pyx_v_ns = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_name = __pyx_t_1; __pyx_t_1 = 0; /* "borg/platform/freebsd.pyx":67 * # from borg archives made on other operating systems. * ns_name_tuple = ns_name.split(b".", 1) * if len(ns_name_tuple) == 2: # <<<<<<<<<<<<<< * # we have a namespace prefix in the given name * ns, name = ns_name_tuple */ goto __pyx_L3; } /* "borg/platform/freebsd.pyx":72 * else: * # no namespace given in ns_name (== no dot found), maybe data coming from an old borg archive. * ns, name = default_ns, ns_name # <<<<<<<<<<<<<< * return ns, name * */ /*else*/ { __pyx_t_1 = __pyx_v_default_ns; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __pyx_v_ns_name; __Pyx_INCREF(__pyx_t_2); __pyx_v_ns = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_name = __pyx_t_2; __pyx_t_2 = 0; } __pyx_L3:; /* "borg/platform/freebsd.pyx":73 * # no namespace given in ns_name (== no dot found), maybe data coming from an old borg archive. * ns, name = default_ns, ns_name * return ns, name # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_ns); __Pyx_GIVEREF(__pyx_v_ns); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_ns)) __PYX_ERR(0, 73, __pyx_L1_error); __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_name)) __PYX_ERR(0, 73, __pyx_L1_error); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "borg/platform/freebsd.pyx":59 * * * def split_ns(ns_name, default_ns): # <<<<<<<<<<<<<< * # split ns_name (which is in the form of b"namespace.name") into namespace and name. * # if there is no namespace given in ns_name, default to default_ns. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("borg.platform.freebsd.split_ns", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ns_name_tuple); __Pyx_XDECREF(__pyx_v_ns); __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/freebsd.pyx":76 * * * def listxattr(path, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, buf, size): * if isinstance(path, int): */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_7freebsd_3listxattr(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8platform_7freebsd_3listxattr = {"listxattr", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_7freebsd_3listxattr, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8platform_7freebsd_3listxattr(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_path = 0; PyObject *__pyx_v_follow_symlinks = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("listxattr (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_follow_symlinks,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_path)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 76, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (kw_args == 1) { const Py_ssize_t index = 1; PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 76, __pyx_L3_error) } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "listxattr") < 0)) __PYX_ERR(0, 76, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_path = values[0]; __pyx_v_follow_symlinks = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("listxattr", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 76, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.freebsd.listxattr", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_7freebsd_2listxattr(__pyx_self, __pyx_v_path, __pyx_v_follow_symlinks); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/freebsd.pyx":77 * * def listxattr(path, *, follow_symlinks=False): * def func(path, buf, size): # <<<<<<<<<<<<<< * if isinstance(path, int): * return c_extattr_list_fd(path, ns_id, buf, size) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_7freebsd_9listxattr_1func(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8platform_7freebsd_9listxattr_1func = {"func", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_7freebsd_9listxattr_1func, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8platform_7freebsd_9listxattr_1func(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_path = 0; PyObject *__pyx_v_buf = 0; PyObject *__pyx_v_size = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("func (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_buf,&__pyx_n_s_size,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_path)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 77, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_buf)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 77, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("func", 1, 3, 3, 1); __PYX_ERR(0, 77, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 77, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("func", 1, 3, 3, 2); __PYX_ERR(0, 77, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "func") < 0)) __PYX_ERR(0, 77, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_path = values[0]; __pyx_v_buf = values[1]; __pyx_v_size = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("func", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 77, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.freebsd.listxattr.func", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_7freebsd_9listxattr_func(__pyx_self, __pyx_v_path, __pyx_v_buf, __pyx_v_size); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8platform_7freebsd_9listxattr_func(PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_buf, PyObject *__pyx_v_size) { struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct__listxattr *__pyx_cur_scope; struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct__listxattr *__pyx_outer_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; char *__pyx_t_4; size_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; char const *__pyx_t_7; char const *__pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("func", 1); __pyx_outer_scope = (struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct__listxattr *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; /* "borg/platform/freebsd.pyx":78 * def listxattr(path, *, follow_symlinks=False): * def func(path, buf, size): * if isinstance(path, int): # <<<<<<<<<<<<<< * return c_extattr_list_fd(path, ns_id, buf, size) * else: */ __pyx_t_1 = PyInt_Check(__pyx_v_path); if (__pyx_t_1) { /* "borg/platform/freebsd.pyx":79 * def func(path, buf, size): * if isinstance(path, int): * return c_extattr_list_fd(path, ns_id, buf, size) # <<<<<<<<<<<<<< * else: * if follow_symlinks: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_path); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L1_error) if (unlikely(!__pyx_cur_scope->__pyx_v_ns_id)) { __Pyx_RaiseClosureNameError("ns_id"); __PYX_ERR(0, 79, __pyx_L1_error) } __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_cur_scope->__pyx_v_ns_id); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_AsWritableString(__pyx_v_buf); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_v_size); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L1_error) __pyx_t_6 = PyInt_FromSsize_t(extattr_list_fd(__pyx_t_2, __pyx_t_3, ((char *)__pyx_t_4), __pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "borg/platform/freebsd.pyx":78 * def listxattr(path, *, follow_symlinks=False): * def func(path, buf, size): * if isinstance(path, int): # <<<<<<<<<<<<<< * return c_extattr_list_fd(path, ns_id, buf, size) * else: */ } /* "borg/platform/freebsd.pyx":81 * return c_extattr_list_fd(path, ns_id, buf, size) * else: * if follow_symlinks: # <<<<<<<<<<<<<< * return c_extattr_list_file(path, ns_id, buf, size) * else: */ /*else*/ { if (unlikely(!__pyx_cur_scope->__pyx_v_follow_symlinks)) { __Pyx_RaiseClosureNameError("follow_symlinks"); __PYX_ERR(0, 81, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_follow_symlinks); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 81, __pyx_L1_error) if (__pyx_t_1) { /* "borg/platform/freebsd.pyx":82 * else: * if follow_symlinks: * return c_extattr_list_file(path, ns_id, buf, size) # <<<<<<<<<<<<<< * else: * return c_extattr_list_link(path, ns_id, buf, size) */ __Pyx_XDECREF(__pyx_r); __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_path); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L1_error) if (unlikely(!__pyx_cur_scope->__pyx_v_ns_id)) { __Pyx_RaiseClosureNameError("ns_id"); __PYX_ERR(0, 82, __pyx_L1_error) } __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_cur_scope->__pyx_v_ns_id); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_AsWritableString(__pyx_v_buf); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_v_size); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L1_error) __pyx_t_6 = PyInt_FromSsize_t(extattr_list_file(__pyx_t_7, __pyx_t_3, ((char *)__pyx_t_4), __pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "borg/platform/freebsd.pyx":81 * return c_extattr_list_fd(path, ns_id, buf, size) * else: * if follow_symlinks: # <<<<<<<<<<<<<< * return c_extattr_list_file(path, ns_id, buf, size) * else: */ } /* "borg/platform/freebsd.pyx":84 * return c_extattr_list_file(path, ns_id, buf, size) * else: * return c_extattr_list_link(path, ns_id, buf, size) # <<<<<<<<<<<<<< * * ns = b"user" */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_path); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 84, __pyx_L1_error) if (unlikely(!__pyx_cur_scope->__pyx_v_ns_id)) { __Pyx_RaiseClosureNameError("ns_id"); __PYX_ERR(0, 84, __pyx_L1_error) } __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_cur_scope->__pyx_v_ns_id); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 84, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_AsWritableString(__pyx_v_buf); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 84, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_v_size); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 84, __pyx_L1_error) __pyx_t_6 = PyInt_FromSsize_t(extattr_list_link(__pyx_t_8, __pyx_t_3, ((char *)__pyx_t_4), __pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; } } /* "borg/platform/freebsd.pyx":77 * * def listxattr(path, *, follow_symlinks=False): * def func(path, buf, size): # <<<<<<<<<<<<<< * if isinstance(path, int): * return c_extattr_list_fd(path, ns_id, buf, size) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("borg.platform.freebsd.listxattr.func", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/freebsd.pyx":76 * * * def listxattr(path, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, buf, size): * if isinstance(path, int): */ static PyObject *__pyx_pf_4borg_8platform_7freebsd_2listxattr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_follow_symlinks) { struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct__listxattr *__pyx_cur_scope; PyObject *__pyx_v_func = 0; PyObject *__pyx_v_ns = NULL; PyObject *__pyx_v_n = NULL; PyObject *__pyx_v_buf = NULL; PyObject *__pyx_7genexpr__pyx_v_name = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); PyObject *__pyx_t_7 = NULL; Py_ssize_t __pyx_t_8; PyObject *(*__pyx_t_9)(PyObject *); int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("listxattr", 0); __pyx_cur_scope = (struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct__listxattr *)__pyx_tp_new_4borg_8platform_7freebsd___pyx_scope_struct__listxattr(__pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct__listxattr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct__listxattr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 76, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_follow_symlinks = __pyx_v_follow_symlinks; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_follow_symlinks); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_follow_symlinks); /* "borg/platform/freebsd.pyx":77 * * def listxattr(path, *, follow_symlinks=False): * def func(path, buf, size): # <<<<<<<<<<<<<< * if isinstance(path, int): * return c_extattr_list_fd(path, ns_id, buf, size) */ __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_7freebsd_9listxattr_1func, 0, __pyx_n_s_listxattr_locals_func, ((PyObject*)__pyx_cur_scope), __pyx_n_s_borg_platform_freebsd, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_func = __pyx_t_1; __pyx_t_1 = 0; /* "borg/platform/freebsd.pyx":86 * return c_extattr_list_link(path, ns_id, buf, size) * * ns = b"user" # <<<<<<<<<<<<<< * ns_id = NS_ID_MAP[ns] * n, buf = _listxattr_inner(func, path) */ __Pyx_INCREF(__pyx_n_b_user); __pyx_v_ns = __pyx_n_b_user; /* "borg/platform/freebsd.pyx":87 * * ns = b"user" * ns_id = NS_ID_MAP[ns] # <<<<<<<<<<<<<< * n, buf = _listxattr_inner(func, path) * return [ns + b"." + name for name in split_lstring(buf[:n]) if name] */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NS_ID_MAP); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_ns); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_ns_id = __pyx_t_2; __pyx_t_2 = 0; /* "borg/platform/freebsd.pyx":88 * ns = b"user" * ns_id = NS_ID_MAP[ns] * n, buf = _listxattr_inner(func, path) # <<<<<<<<<<<<<< * return [ns + b"." + name for name in split_lstring(buf[:n]) if name] * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_listxattr_inner); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_func, __pyx_v_path}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 88, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); index = 0; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 88, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 88, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_n = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_buf = __pyx_t_3; __pyx_t_3 = 0; /* "borg/platform/freebsd.pyx":89 * ns_id = NS_ID_MAP[ns] * n, buf = _listxattr_inner(func, path) * return [ns + b"." + name for name in split_lstring(buf[:n]) if name] # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_split_lstring); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_buf, 0, 0, NULL, &__pyx_v_n, NULL, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 89, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 89, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 89, __pyx_L7_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_9)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 89, __pyx_L7_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 89, __pyx_L7_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 89, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 89, __pyx_L7_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 89, __pyx_L7_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 89, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_9(__pyx_t_1); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 89, __pyx_L7_error) } break; } __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_name, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_7genexpr__pyx_v_name); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 89, __pyx_L7_error) if (__pyx_t_10) { __pyx_t_3 = PyNumber_Add(__pyx_v_ns, __pyx_kp_b_); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 89, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_7genexpr__pyx_v_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 89, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 89, __pyx_L7_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_7genexpr__pyx_v_name); __pyx_7genexpr__pyx_v_name = 0; goto __pyx_L12_exit_scope; __pyx_L7_error:; __Pyx_XDECREF(__pyx_7genexpr__pyx_v_name); __pyx_7genexpr__pyx_v_name = 0; goto __pyx_L1_error; __pyx_L12_exit_scope:; } /* exit inner scope */ __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "borg/platform/freebsd.pyx":76 * * * def listxattr(path, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, buf, size): * if isinstance(path, int): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("borg.platform.freebsd.listxattr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_func); __Pyx_XDECREF(__pyx_v_ns); __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_buf); __Pyx_XDECREF(__pyx_7genexpr__pyx_v_name); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/freebsd.pyx":92 * * * def getxattr(path, name, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, name, buf, size): * if isinstance(path, int): */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_7freebsd_5getxattr(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8platform_7freebsd_5getxattr = {"getxattr", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_7freebsd_5getxattr, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8platform_7freebsd_5getxattr(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_path = 0; PyObject *__pyx_v_name = 0; PyObject *__pyx_v_follow_symlinks = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getxattr (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_name,&__pyx_n_s_follow_symlinks,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_path)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("getxattr", 1, 2, 2, 1); __PYX_ERR(0, 92, __pyx_L3_error) } } if (kw_args == 1) { const Py_ssize_t index = 2; PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L3_error) } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getxattr") < 0)) __PYX_ERR(0, 92, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_path = values[0]; __pyx_v_name = values[1]; __pyx_v_follow_symlinks = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getxattr", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 92, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.freebsd.getxattr", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_7freebsd_4getxattr(__pyx_self, __pyx_v_path, __pyx_v_name, __pyx_v_follow_symlinks); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/freebsd.pyx":93 * * def getxattr(path, name, *, follow_symlinks=False): * def func(path, name, buf, size): # <<<<<<<<<<<<<< * if isinstance(path, int): * return c_extattr_get_fd(path, ns_id, name, buf, size) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_7freebsd_8getxattr_1func(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8platform_7freebsd_8getxattr_1func = {"func", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_7freebsd_8getxattr_1func, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8platform_7freebsd_8getxattr_1func(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_path = 0; PyObject *__pyx_v_name = 0; PyObject *__pyx_v_buf = 0; PyObject *__pyx_v_size = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("func (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_name,&__pyx_n_s_buf,&__pyx_n_s_size,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_path)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 93, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 93, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("func", 1, 4, 4, 1); __PYX_ERR(0, 93, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_buf)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 93, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("func", 1, 4, 4, 2); __PYX_ERR(0, 93, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 93, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("func", 1, 4, 4, 3); __PYX_ERR(0, 93, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "func") < 0)) __PYX_ERR(0, 93, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); } __pyx_v_path = values[0]; __pyx_v_name = values[1]; __pyx_v_buf = values[2]; __pyx_v_size = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("func", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 93, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.freebsd.getxattr.func", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_7freebsd_8getxattr_func(__pyx_self, __pyx_v_path, __pyx_v_name, __pyx_v_buf, __pyx_v_size); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8platform_7freebsd_8getxattr_func(PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_name, PyObject *__pyx_v_buf, PyObject *__pyx_v_size) { struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr *__pyx_cur_scope; struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr *__pyx_outer_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; char const *__pyx_t_4; char *__pyx_t_5; size_t __pyx_t_6; PyObject *__pyx_t_7 = NULL; char const *__pyx_t_8; char const *__pyx_t_9; char const *__pyx_t_10; char const *__pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("func", 1); __pyx_outer_scope = (struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; /* "borg/platform/freebsd.pyx":94 * def getxattr(path, name, *, follow_symlinks=False): * def func(path, name, buf, size): * if isinstance(path, int): # <<<<<<<<<<<<<< * return c_extattr_get_fd(path, ns_id, name, buf, size) * else: */ __pyx_t_1 = PyInt_Check(__pyx_v_path); if (__pyx_t_1) { /* "borg/platform/freebsd.pyx":95 * def func(path, name, buf, size): * if isinstance(path, int): * return c_extattr_get_fd(path, ns_id, name, buf, size) # <<<<<<<<<<<<<< * else: * if follow_symlinks: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_path); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 95, __pyx_L1_error) if (unlikely(!__pyx_cur_scope->__pyx_v_ns_id)) { __Pyx_RaiseClosureNameError("ns_id"); __PYX_ERR(0, 95, __pyx_L1_error) } __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_cur_scope->__pyx_v_ns_id); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 95, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 95, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_AsWritableString(__pyx_v_buf); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 95, __pyx_L1_error) __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_v_size); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 95, __pyx_L1_error) __pyx_t_7 = PyInt_FromSsize_t(extattr_get_fd(__pyx_t_2, __pyx_t_3, __pyx_t_4, ((char *)__pyx_t_5), __pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; /* "borg/platform/freebsd.pyx":94 * def getxattr(path, name, *, follow_symlinks=False): * def func(path, name, buf, size): * if isinstance(path, int): # <<<<<<<<<<<<<< * return c_extattr_get_fd(path, ns_id, name, buf, size) * else: */ } /* "borg/platform/freebsd.pyx":97 * return c_extattr_get_fd(path, ns_id, name, buf, size) * else: * if follow_symlinks: # <<<<<<<<<<<<<< * return c_extattr_get_file(path, ns_id, name, buf, size) * else: */ /*else*/ { if (unlikely(!__pyx_cur_scope->__pyx_v_follow_symlinks)) { __Pyx_RaiseClosureNameError("follow_symlinks"); __PYX_ERR(0, 97, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_follow_symlinks); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 97, __pyx_L1_error) if (__pyx_t_1) { /* "borg/platform/freebsd.pyx":98 * else: * if follow_symlinks: * return c_extattr_get_file(path, ns_id, name, buf, size) # <<<<<<<<<<<<<< * else: * return c_extattr_get_link(path, ns_id, name, buf, size) */ __Pyx_XDECREF(__pyx_r); __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_path); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L1_error) if (unlikely(!__pyx_cur_scope->__pyx_v_ns_id)) { __Pyx_RaiseClosureNameError("ns_id"); __PYX_ERR(0, 98, __pyx_L1_error) } __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_cur_scope->__pyx_v_ns_id); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L1_error) __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_AsWritableString(__pyx_v_buf); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L1_error) __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_v_size); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L1_error) __pyx_t_7 = PyInt_FromSsize_t(extattr_get_file(__pyx_t_8, __pyx_t_3, __pyx_t_9, ((char *)__pyx_t_5), __pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; /* "borg/platform/freebsd.pyx":97 * return c_extattr_get_fd(path, ns_id, name, buf, size) * else: * if follow_symlinks: # <<<<<<<<<<<<<< * return c_extattr_get_file(path, ns_id, name, buf, size) * else: */ } /* "borg/platform/freebsd.pyx":100 * return c_extattr_get_file(path, ns_id, name, buf, size) * else: * return c_extattr_get_link(path, ns_id, name, buf, size) # <<<<<<<<<<<<<< * * ns, name = split_ns(name, b"user") */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_10 = __Pyx_PyObject_AsString(__pyx_v_path); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error) if (unlikely(!__pyx_cur_scope->__pyx_v_ns_id)) { __Pyx_RaiseClosureNameError("ns_id"); __PYX_ERR(0, 100, __pyx_L1_error) } __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_cur_scope->__pyx_v_ns_id); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error) __pyx_t_11 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_AsWritableString(__pyx_v_buf); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error) __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_v_size); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error) __pyx_t_7 = PyInt_FromSsize_t(extattr_get_link(__pyx_t_10, __pyx_t_3, __pyx_t_11, ((char *)__pyx_t_5), __pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; } } /* "borg/platform/freebsd.pyx":93 * * def getxattr(path, name, *, follow_symlinks=False): * def func(path, name, buf, size): # <<<<<<<<<<<<<< * if isinstance(path, int): * return c_extattr_get_fd(path, ns_id, name, buf, size) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("borg.platform.freebsd.getxattr.func", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/freebsd.pyx":92 * * * def getxattr(path, name, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, name, buf, size): * if isinstance(path, int): */ static PyObject *__pyx_pf_4borg_8platform_7freebsd_4getxattr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_name, PyObject *__pyx_v_follow_symlinks) { struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr *__pyx_cur_scope; PyObject *__pyx_v_func = 0; PyObject *__pyx_v_ns = NULL; PyObject *__pyx_v_n = NULL; PyObject *__pyx_v_buf = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getxattr", 0); __pyx_cur_scope = (struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr *)__pyx_tp_new_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr(__pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 92, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_follow_symlinks = __pyx_v_follow_symlinks; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_follow_symlinks); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_follow_symlinks); __Pyx_INCREF(__pyx_v_name); /* "borg/platform/freebsd.pyx":93 * * def getxattr(path, name, *, follow_symlinks=False): * def func(path, name, buf, size): # <<<<<<<<<<<<<< * if isinstance(path, int): * return c_extattr_get_fd(path, ns_id, name, buf, size) */ __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_7freebsd_8getxattr_1func, 0, __pyx_n_s_getxattr_locals_func, ((PyObject*)__pyx_cur_scope), __pyx_n_s_borg_platform_freebsd, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_func = __pyx_t_1; __pyx_t_1 = 0; /* "borg/platform/freebsd.pyx":102 * return c_extattr_get_link(path, ns_id, name, buf, size) * * ns, name = split_ns(name, b"user") # <<<<<<<<<<<<<< * ns_id = NS_ID_MAP[ns] # this will raise a KeyError it the namespace is unsupported * n, buf = _getxattr_inner(func, path, name) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_split_ns); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_name, __pyx_n_b_user}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 102, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 102, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 102, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_ns = __pyx_t_2; __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/freebsd.pyx":103 * * ns, name = split_ns(name, b"user") * ns_id = NS_ID_MAP[ns] # this will raise a KeyError it the namespace is unsupported # <<<<<<<<<<<<<< * n, buf = _getxattr_inner(func, path, name) * return bytes(buf[:n]) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NS_ID_MAP); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_ns); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_ns_id = __pyx_t_3; __pyx_t_3 = 0; /* "borg/platform/freebsd.pyx":104 * ns, name = split_ns(name, b"user") * ns_id = NS_ID_MAP[ns] # this will raise a KeyError it the namespace is unsupported * n, buf = _getxattr_inner(func, path, name) # <<<<<<<<<<<<<< * return bytes(buf[:n]) * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_getxattr_inner); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_func, __pyx_v_path, __pyx_v_name}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 3+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 104, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); index = 0; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 104, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 104, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_n = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_buf = __pyx_t_2; __pyx_t_2 = 0; /* "borg/platform/freebsd.pyx":105 * ns_id = NS_ID_MAP[ns] # this will raise a KeyError it the namespace is unsupported * n, buf = _getxattr_inner(func, path, name) * return bytes(buf[:n]) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_buf, 0, 0, NULL, &__pyx_v_n, NULL, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "borg/platform/freebsd.pyx":92 * * * def getxattr(path, name, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, name, buf, size): * if isinstance(path, int): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("borg.platform.freebsd.getxattr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_func); __Pyx_XDECREF(__pyx_v_ns); __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_buf); __Pyx_XDECREF(__pyx_v_name); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/freebsd.pyx":108 * * * def setxattr(path, name, value, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, name, value, size): * if isinstance(path, int): */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_7freebsd_7setxattr(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8platform_7freebsd_7setxattr = {"setxattr", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_7freebsd_7setxattr, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8platform_7freebsd_7setxattr(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_path = 0; PyObject *__pyx_v_name = 0; PyObject *__pyx_v_value = 0; PyObject *__pyx_v_follow_symlinks = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setxattr (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_name,&__pyx_n_s_value,&__pyx_n_s_follow_symlinks,0}; values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_path)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setxattr", 1, 3, 3, 1); __PYX_ERR(0, 108, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setxattr", 1, 3, 3, 2); __PYX_ERR(0, 108, __pyx_L3_error) } } if (kw_args == 1) { const Py_ssize_t index = 3; PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L3_error) } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setxattr") < 0)) __PYX_ERR(0, 108, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_path = values[0]; __pyx_v_name = values[1]; __pyx_v_value = values[2]; __pyx_v_follow_symlinks = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setxattr", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 108, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.freebsd.setxattr", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_7freebsd_6setxattr(__pyx_self, __pyx_v_path, __pyx_v_name, __pyx_v_value, __pyx_v_follow_symlinks); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/freebsd.pyx":109 * * def setxattr(path, name, value, *, follow_symlinks=False): * def func(path, name, value, size): # <<<<<<<<<<<<<< * if isinstance(path, int): * return c_extattr_set_fd(path, ns_id, name, value, size) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_7freebsd_8setxattr_1func(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8platform_7freebsd_8setxattr_1func = {"func", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_7freebsd_8setxattr_1func, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8platform_7freebsd_8setxattr_1func(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_path = 0; PyObject *__pyx_v_name = 0; PyObject *__pyx_v_value = 0; PyObject *__pyx_v_size = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("func (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_name,&__pyx_n_s_value,&__pyx_n_s_size,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_path)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 109, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 109, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("func", 1, 4, 4, 1); __PYX_ERR(0, 109, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 109, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("func", 1, 4, 4, 2); __PYX_ERR(0, 109, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 109, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("func", 1, 4, 4, 3); __PYX_ERR(0, 109, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "func") < 0)) __PYX_ERR(0, 109, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); } __pyx_v_path = values[0]; __pyx_v_name = values[1]; __pyx_v_value = values[2]; __pyx_v_size = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("func", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 109, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.freebsd.setxattr.func", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_7freebsd_8setxattr_func(__pyx_self, __pyx_v_path, __pyx_v_name, __pyx_v_value, __pyx_v_size); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8platform_7freebsd_8setxattr_func(PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_name, PyObject *__pyx_v_value, PyObject *__pyx_v_size) { struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr *__pyx_cur_scope; struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr *__pyx_outer_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; char const *__pyx_t_4; char *__pyx_t_5; size_t __pyx_t_6; PyObject *__pyx_t_7 = NULL; char const *__pyx_t_8; char const *__pyx_t_9; char const *__pyx_t_10; char const *__pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("func", 1); __pyx_outer_scope = (struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; /* "borg/platform/freebsd.pyx":110 * def setxattr(path, name, value, *, follow_symlinks=False): * def func(path, name, value, size): * if isinstance(path, int): # <<<<<<<<<<<<<< * return c_extattr_set_fd(path, ns_id, name, value, size) * else: */ __pyx_t_1 = PyInt_Check(__pyx_v_path); if (__pyx_t_1) { /* "borg/platform/freebsd.pyx":111 * def func(path, name, value, size): * if isinstance(path, int): * return c_extattr_set_fd(path, ns_id, name, value, size) # <<<<<<<<<<<<<< * else: * if follow_symlinks: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_path); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 111, __pyx_L1_error) if (unlikely(!__pyx_cur_scope->__pyx_v_ns_id)) { __Pyx_RaiseClosureNameError("ns_id"); __PYX_ERR(0, 111, __pyx_L1_error) } __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_cur_scope->__pyx_v_ns_id); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 111, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 111, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_AsWritableString(__pyx_v_value); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 111, __pyx_L1_error) __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_v_size); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 111, __pyx_L1_error) __pyx_t_7 = __Pyx_PyInt_From_int(extattr_set_fd(__pyx_t_2, __pyx_t_3, __pyx_t_4, ((char *)__pyx_t_5), __pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; /* "borg/platform/freebsd.pyx":110 * def setxattr(path, name, value, *, follow_symlinks=False): * def func(path, name, value, size): * if isinstance(path, int): # <<<<<<<<<<<<<< * return c_extattr_set_fd(path, ns_id, name, value, size) * else: */ } /* "borg/platform/freebsd.pyx":113 * return c_extattr_set_fd(path, ns_id, name, value, size) * else: * if follow_symlinks: # <<<<<<<<<<<<<< * return c_extattr_set_file(path, ns_id, name, value, size) * else: */ /*else*/ { if (unlikely(!__pyx_cur_scope->__pyx_v_follow_symlinks)) { __Pyx_RaiseClosureNameError("follow_symlinks"); __PYX_ERR(0, 113, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_follow_symlinks); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 113, __pyx_L1_error) if (__pyx_t_1) { /* "borg/platform/freebsd.pyx":114 * else: * if follow_symlinks: * return c_extattr_set_file(path, ns_id, name, value, size) # <<<<<<<<<<<<<< * else: * return c_extattr_set_link(path, ns_id, name, value, size) */ __Pyx_XDECREF(__pyx_r); __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_path); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L1_error) if (unlikely(!__pyx_cur_scope->__pyx_v_ns_id)) { __Pyx_RaiseClosureNameError("ns_id"); __PYX_ERR(0, 114, __pyx_L1_error) } __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_cur_scope->__pyx_v_ns_id); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L1_error) __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_AsWritableString(__pyx_v_value); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L1_error) __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_v_size); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L1_error) __pyx_t_7 = __Pyx_PyInt_From_int(extattr_set_file(__pyx_t_8, __pyx_t_3, __pyx_t_9, ((char *)__pyx_t_5), __pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; /* "borg/platform/freebsd.pyx":113 * return c_extattr_set_fd(path, ns_id, name, value, size) * else: * if follow_symlinks: # <<<<<<<<<<<<<< * return c_extattr_set_file(path, ns_id, name, value, size) * else: */ } /* "borg/platform/freebsd.pyx":116 * return c_extattr_set_file(path, ns_id, name, value, size) * else: * return c_extattr_set_link(path, ns_id, name, value, size) # <<<<<<<<<<<<<< * * ns, name = split_ns(name, b"user") */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_10 = __Pyx_PyObject_AsString(__pyx_v_path); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L1_error) if (unlikely(!__pyx_cur_scope->__pyx_v_ns_id)) { __Pyx_RaiseClosureNameError("ns_id"); __PYX_ERR(0, 116, __pyx_L1_error) } __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_cur_scope->__pyx_v_ns_id); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L1_error) __pyx_t_11 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_AsWritableString(__pyx_v_value); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L1_error) __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_v_size); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L1_error) __pyx_t_7 = __Pyx_PyInt_From_int(extattr_set_link(__pyx_t_10, __pyx_t_3, __pyx_t_11, ((char *)__pyx_t_5), __pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; } } /* "borg/platform/freebsd.pyx":109 * * def setxattr(path, name, value, *, follow_symlinks=False): * def func(path, name, value, size): # <<<<<<<<<<<<<< * if isinstance(path, int): * return c_extattr_set_fd(path, ns_id, name, value, size) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("borg.platform.freebsd.setxattr.func", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/freebsd.pyx":108 * * * def setxattr(path, name, value, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, name, value, size): * if isinstance(path, int): */ static PyObject *__pyx_pf_4borg_8platform_7freebsd_6setxattr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_name, PyObject *__pyx_v_value, PyObject *__pyx_v_follow_symlinks) { struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr *__pyx_cur_scope; PyObject *__pyx_v_func = 0; PyObject *__pyx_v_ns = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setxattr", 0); __pyx_cur_scope = (struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr *)__pyx_tp_new_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr(__pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 108, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_follow_symlinks = __pyx_v_follow_symlinks; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_follow_symlinks); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_follow_symlinks); __Pyx_INCREF(__pyx_v_name); /* "borg/platform/freebsd.pyx":109 * * def setxattr(path, name, value, *, follow_symlinks=False): * def func(path, name, value, size): # <<<<<<<<<<<<<< * if isinstance(path, int): * return c_extattr_set_fd(path, ns_id, name, value, size) */ __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_7freebsd_8setxattr_1func, 0, __pyx_n_s_setxattr_locals_func, ((PyObject*)__pyx_cur_scope), __pyx_n_s_borg_platform_freebsd, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_func = __pyx_t_1; __pyx_t_1 = 0; /* "borg/platform/freebsd.pyx":118 * return c_extattr_set_link(path, ns_id, name, value, size) * * ns, name = split_ns(name, b"user") # <<<<<<<<<<<<<< * try: * ns_id = NS_ID_MAP[ns] # this will raise a KeyError it the namespace is unsupported */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_split_ns); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_name, __pyx_n_b_user}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 118, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 118, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 118, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_ns = __pyx_t_2; __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/freebsd.pyx":119 * * ns, name = split_ns(name, b"user") * try: # <<<<<<<<<<<<<< * ns_id = NS_ID_MAP[ns] # this will raise a KeyError it the namespace is unsupported * except KeyError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); /*try:*/ { /* "borg/platform/freebsd.pyx":120 * ns, name = split_ns(name, b"user") * try: * ns_id = NS_ID_MAP[ns] # this will raise a KeyError it the namespace is unsupported # <<<<<<<<<<<<<< * except KeyError: * pass */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NS_ID_MAP); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_ns); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 120, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_ns_id = __pyx_t_3; __pyx_t_3 = 0; /* "borg/platform/freebsd.pyx":119 * * ns, name = split_ns(name, b"user") * try: # <<<<<<<<<<<<<< * ns_id = NS_ID_MAP[ns] # this will raise a KeyError it the namespace is unsupported * except KeyError: */ } /* "borg/platform/freebsd.pyx":124 * pass * else: * _setxattr_inner(func, path, name, value) # <<<<<<<<<<<<<< * * */ /*else:*/ { __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_setxattr_inner); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_2, __pyx_v_func, __pyx_v_path, __pyx_v_name, __pyx_v_value}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 124, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L10_try_end; __pyx_L5_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/platform/freebsd.pyx":121 * try: * ns_id = NS_ID_MAP[ns] # this will raise a KeyError it the namespace is unsupported * except KeyError: # <<<<<<<<<<<<<< * pass * else: */ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_4) { __Pyx_ErrRestore(0,0,0); goto __pyx_L6_exception_handled; } goto __pyx_L7_except_error; /* "borg/platform/freebsd.pyx":119 * * ns, name = split_ns(name, b"user") * try: # <<<<<<<<<<<<<< * ns_id = NS_ID_MAP[ns] # this will raise a KeyError it the namespace is unsupported * except KeyError: */ __pyx_L7_except_error:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L1_error; __pyx_L6_exception_handled:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); __pyx_L10_try_end:; } /* "borg/platform/freebsd.pyx":108 * * * def setxattr(path, name, value, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, name, value, size): * if isinstance(path, int): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("borg.platform.freebsd.setxattr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_func); __Pyx_XDECREF(__pyx_v_ns); __Pyx_XDECREF(__pyx_v_name); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/freebsd.pyx":127 * * * cdef _get_acl(p, type, item, attribute, flags, fd=None): # <<<<<<<<<<<<<< * cdef acl_t acl * cdef char *text */ static PyObject *__pyx_f_4borg_8platform_7freebsd__get_acl(PyObject *__pyx_v_p, PyObject *__pyx_v_type, PyObject *__pyx_v_item, PyObject *__pyx_v_attribute, PyObject *__pyx_v_flags, struct __pyx_opt_args_4borg_8platform_7freebsd__get_acl *__pyx_optional_args) { PyObject *__pyx_v_fd = ((PyObject *)Py_None); acl_t __pyx_v_acl; char *__pyx_v_text; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; char const *__pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_acl", 1); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_fd = __pyx_optional_args->fd; } } /* "borg/platform/freebsd.pyx":130 * cdef acl_t acl * cdef char *text * if fd is not None: # <<<<<<<<<<<<<< * acl = acl_get_fd_np(fd, type) * else: */ __pyx_t_1 = (__pyx_v_fd != Py_None); if (__pyx_t_1) { /* "borg/platform/freebsd.pyx":131 * cdef char *text * if fd is not None: * acl = acl_get_fd_np(fd, type) # <<<<<<<<<<<<<< * else: * acl = acl_get_link_np(p, type) */ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_fd); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_type); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L1_error) __pyx_v_acl = acl_get_fd_np(__pyx_t_2, __pyx_t_3); /* "borg/platform/freebsd.pyx":130 * cdef acl_t acl * cdef char *text * if fd is not None: # <<<<<<<<<<<<<< * acl = acl_get_fd_np(fd, type) * else: */ goto __pyx_L3; } /* "borg/platform/freebsd.pyx":133 * acl = acl_get_fd_np(fd, type) * else: * acl = acl_get_link_np(p, type) # <<<<<<<<<<<<<< * if acl == NULL: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(p)) */ /*else*/ { __pyx_t_4 = __Pyx_PyObject_AsString(__pyx_v_p); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 133, __pyx_L1_error) __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_type); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 133, __pyx_L1_error) __pyx_v_acl = acl_get_link_np(__pyx_t_4, __pyx_t_3); } __pyx_L3:; /* "borg/platform/freebsd.pyx":134 * else: * acl = acl_get_link_np(p, type) * if acl == NULL: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(p)) * text = acl_to_text_np(acl, NULL, flags) */ __pyx_t_1 = (__pyx_v_acl == NULL); if (unlikely(__pyx_t_1)) { /* "borg/platform/freebsd.pyx":135 * acl = acl_get_link_np(p, type) * if acl == NULL: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(p)) # <<<<<<<<<<<<<< * text = acl_to_text_np(acl, NULL, flags) * if text == NULL: */ __pyx_t_5 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_os); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_strerror); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = NULL; __pyx_t_3 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_3 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_7}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_3, 1+__pyx_t_3); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_os); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_fsdecode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; __pyx_t_3 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_3 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_p}; __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_3, 1+__pyx_t_3); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5)) __PYX_ERR(0, 135, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_6)) __PYX_ERR(0, 135, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_8)) __PYX_ERR(0, 135, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(0, 135, __pyx_L1_error) /* "borg/platform/freebsd.pyx":134 * else: * acl = acl_get_link_np(p, type) * if acl == NULL: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(p)) * text = acl_to_text_np(acl, NULL, flags) */ } /* "borg/platform/freebsd.pyx":136 * if acl == NULL: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(p)) * text = acl_to_text_np(acl, NULL, flags) # <<<<<<<<<<<<<< * if text == NULL: * acl_free(acl) */ __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_flags); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error) __pyx_v_text = acl_to_text_np(__pyx_v_acl, NULL, __pyx_t_3); /* "borg/platform/freebsd.pyx":137 * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(p)) * text = acl_to_text_np(acl, NULL, flags) * if text == NULL: # <<<<<<<<<<<<<< * acl_free(acl) * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(p)) */ __pyx_t_1 = (__pyx_v_text == NULL); if (unlikely(__pyx_t_1)) { /* "borg/platform/freebsd.pyx":138 * text = acl_to_text_np(acl, NULL, flags) * if text == NULL: * acl_free(acl) # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(p)) * item[attribute] = text */ (void)(acl_free(__pyx_v_acl)); /* "borg/platform/freebsd.pyx":139 * if text == NULL: * acl_free(acl) * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(p)) # <<<<<<<<<<<<<< * item[attribute] = text * acl_free(text) */ __pyx_t_8 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_strerror); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_3 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_3 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6}; __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_3, 1+__pyx_t_3); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_fsdecode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_3 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_3 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_p}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_3, 1+__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8)) __PYX_ERR(0, 139, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_9); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_9)) __PYX_ERR(0, 139, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_5)) __PYX_ERR(0, 139, __pyx_L1_error); __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(0, 139, __pyx_L1_error) /* "borg/platform/freebsd.pyx":137 * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(p)) * text = acl_to_text_np(acl, NULL, flags) * if text == NULL: # <<<<<<<<<<<<<< * acl_free(acl) * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(p)) */ } /* "borg/platform/freebsd.pyx":140 * acl_free(acl) * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(p)) * item[attribute] = text # <<<<<<<<<<<<<< * acl_free(text) * acl_free(acl) */ __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_text); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely((PyObject_SetItem(__pyx_v_item, __pyx_v_attribute, __pyx_t_5) < 0))) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/platform/freebsd.pyx":141 * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(p)) * item[attribute] = text * acl_free(text) # <<<<<<<<<<<<<< * acl_free(acl) * */ (void)(acl_free(__pyx_v_text)); /* "borg/platform/freebsd.pyx":142 * item[attribute] = text * acl_free(text) * acl_free(acl) # <<<<<<<<<<<<<< * * def acl_get(path, item, st, numeric_ids=False, fd=None): */ (void)(acl_free(__pyx_v_acl)); /* "borg/platform/freebsd.pyx":127 * * * cdef _get_acl(p, type, item, attribute, flags, fd=None): # <<<<<<<<<<<<<< * cdef acl_t acl * cdef char *text */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("borg.platform.freebsd._get_acl", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/freebsd.pyx":144 * acl_free(acl) * * def acl_get(path, item, st, numeric_ids=False, fd=None): # <<<<<<<<<<<<<< * """Saves ACL Entries * */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_7freebsd_9acl_get(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_8platform_7freebsd_8acl_get, "Saves ACL Entries\n\n If `numeric_ids` is True the user/group field is not preserved only uid/gid\n "); static PyMethodDef __pyx_mdef_4borg_8platform_7freebsd_9acl_get = {"acl_get", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_7freebsd_9acl_get, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_8platform_7freebsd_8acl_get}; static PyObject *__pyx_pw_4borg_8platform_7freebsd_9acl_get(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_path = 0; PyObject *__pyx_v_item = 0; PyObject *__pyx_v_st = 0; PyObject *__pyx_v_numeric_ids = 0; PyObject *__pyx_v_fd = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("acl_get (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_item,&__pyx_n_s_st,&__pyx_n_s_numeric_ids,&__pyx_n_s_fd,0}; values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_path)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 144, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_item)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 144, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("acl_get", 0, 3, 5, 1); __PYX_ERR(0, 144, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 144, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("acl_get", 0, 3, 5, 2); __PYX_ERR(0, 144, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_numeric_ids); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 144, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fd); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 144, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "acl_get") < 0)) __PYX_ERR(0, 144, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_path = values[0]; __pyx_v_item = values[1]; __pyx_v_st = values[2]; __pyx_v_numeric_ids = values[3]; __pyx_v_fd = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("acl_get", 0, 3, 5, __pyx_nargs); __PYX_ERR(0, 144, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.freebsd.acl_get", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_7freebsd_8acl_get(__pyx_self, __pyx_v_path, __pyx_v_item, __pyx_v_st, __pyx_v_numeric_ids, __pyx_v_fd); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8platform_7freebsd_8acl_get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_item, PyObject *__pyx_v_st, PyObject *__pyx_v_numeric_ids, PyObject *__pyx_v_fd) { int __pyx_v_flags; long __pyx_v_ret; PyObject *__pyx_v_nfs4_acl = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations long __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; char const *__pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; char const *__pyx_t_10; struct __pyx_opt_args_4borg_8platform_7freebsd__get_acl __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("acl_get", 0); __Pyx_INCREF(__pyx_v_path); /* "borg/platform/freebsd.pyx":149 * If `numeric_ids` is True the user/group field is not preserved only uid/gid * """ * cdef int flags = ACL_TEXT_APPEND_ID # <<<<<<<<<<<<<< * flags |= ACL_TEXT_NUMERIC_IDS if numeric_ids else 0 * if isinstance(path, str): */ __pyx_v_flags = ACL_TEXT_APPEND_ID; /* "borg/platform/freebsd.pyx":150 * """ * cdef int flags = ACL_TEXT_APPEND_ID * flags |= ACL_TEXT_NUMERIC_IDS if numeric_ids else 0 # <<<<<<<<<<<<<< * if isinstance(path, str): * path = os.fsencode(path) */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_numeric_ids); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 150, __pyx_L1_error) if (__pyx_t_2) { __pyx_t_1 = ACL_TEXT_NUMERIC_IDS; } else { __pyx_t_1 = 0; } __pyx_v_flags = (__pyx_v_flags | __pyx_t_1); /* "borg/platform/freebsd.pyx":151 * cdef int flags = ACL_TEXT_APPEND_ID * flags |= ACL_TEXT_NUMERIC_IDS if numeric_ids else 0 * if isinstance(path, str): # <<<<<<<<<<<<<< * path = os.fsencode(path) * ret = acl_extended_link_np(path) */ __pyx_t_2 = PyString_Check(__pyx_v_path); if (__pyx_t_2) { /* "borg/platform/freebsd.pyx":152 * flags |= ACL_TEXT_NUMERIC_IDS if numeric_ids else 0 * if isinstance(path, str): * path = os.fsencode(path) # <<<<<<<<<<<<<< * ret = acl_extended_link_np(path) * if ret < 0: */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_fsencode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_path}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF_SET(__pyx_v_path, __pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/freebsd.pyx":151 * cdef int flags = ACL_TEXT_APPEND_ID * flags |= ACL_TEXT_NUMERIC_IDS if numeric_ids else 0 * if isinstance(path, str): # <<<<<<<<<<<<<< * path = os.fsencode(path) * ret = acl_extended_link_np(path) */ } /* "borg/platform/freebsd.pyx":153 * if isinstance(path, str): * path = os.fsencode(path) * ret = acl_extended_link_np(path) # <<<<<<<<<<<<<< * if ret < 0: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) */ __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_path); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 153, __pyx_L1_error) __pyx_v_ret = acl_extended_link_np(__pyx_t_7); /* "borg/platform/freebsd.pyx":154 * path = os.fsencode(path) * ret = acl_extended_link_np(path) * if ret < 0: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * if ret == 0: */ __pyx_t_2 = (__pyx_v_ret < 0); if (unlikely(__pyx_t_2)) { /* "borg/platform/freebsd.pyx":155 * ret = acl_extended_link_np(path) * if ret < 0: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) # <<<<<<<<<<<<<< * if ret == 0: * # there is no ACL defining permissions other than those defined by the traditional file permission bits. */ __pyx_t_3 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_strerror); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_4}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_fsdecode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_path}; __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3)) __PYX_ERR(0, 155, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_5)) __PYX_ERR(0, 155, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_8)) __PYX_ERR(0, 155, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_5 = 0; __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(0, 155, __pyx_L1_error) /* "borg/platform/freebsd.pyx":154 * path = os.fsencode(path) * ret = acl_extended_link_np(path) * if ret < 0: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * if ret == 0: */ } /* "borg/platform/freebsd.pyx":156 * if ret < 0: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * if ret == 0: # <<<<<<<<<<<<<< * # there is no ACL defining permissions other than those defined by the traditional file permission bits. * return */ __pyx_t_2 = (__pyx_v_ret == 0); if (__pyx_t_2) { /* "borg/platform/freebsd.pyx":158 * if ret == 0: * # there is no ACL defining permissions other than those defined by the traditional file permission bits. * return # <<<<<<<<<<<<<< * ret = lpathconf(path, _PC_ACL_NFS4) * if ret < 0: */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "borg/platform/freebsd.pyx":156 * if ret < 0: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * if ret == 0: # <<<<<<<<<<<<<< * # there is no ACL defining permissions other than those defined by the traditional file permission bits. * return */ } /* "borg/platform/freebsd.pyx":159 * # there is no ACL defining permissions other than those defined by the traditional file permission bits. * return * ret = lpathconf(path, _PC_ACL_NFS4) # <<<<<<<<<<<<<< * if ret < 0: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) */ __pyx_t_10 = __Pyx_PyObject_AsString(__pyx_v_path); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 159, __pyx_L1_error) __pyx_v_ret = lpathconf(__pyx_t_10, _PC_ACL_NFS4); /* "borg/platform/freebsd.pyx":160 * return * ret = lpathconf(path, _PC_ACL_NFS4) * if ret < 0: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * nfs4_acl = ret == 1 */ __pyx_t_2 = (__pyx_v_ret < 0); if (unlikely(__pyx_t_2)) { /* "borg/platform/freebsd.pyx":161 * ret = lpathconf(path, _PC_ACL_NFS4) * if ret < 0: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) # <<<<<<<<<<<<<< * nfs4_acl = ret == 1 * if nfs4_acl: */ __pyx_t_8 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_strerror); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_fsdecode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_path}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8)) __PYX_ERR(0, 161, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_9); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_9)) __PYX_ERR(0, 161, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3)) __PYX_ERR(0, 161, __pyx_L1_error); __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 161, __pyx_L1_error) /* "borg/platform/freebsd.pyx":160 * return * ret = lpathconf(path, _PC_ACL_NFS4) * if ret < 0: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * nfs4_acl = ret == 1 */ } /* "borg/platform/freebsd.pyx":162 * if ret < 0: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * nfs4_acl = ret == 1 # <<<<<<<<<<<<<< * if nfs4_acl: * _get_acl(path, ACL_TYPE_NFS4, item, 'acl_nfs4', flags, fd=fd) */ __pyx_t_3 = __Pyx_PyBool_FromLong((__pyx_v_ret == 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_nfs4_acl = __pyx_t_3; __pyx_t_3 = 0; /* "borg/platform/freebsd.pyx":163 * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * nfs4_acl = ret == 1 * if nfs4_acl: # <<<<<<<<<<<<<< * _get_acl(path, ACL_TYPE_NFS4, item, 'acl_nfs4', flags, fd=fd) * else: */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_nfs4_acl); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 163, __pyx_L1_error) if (__pyx_t_2) { /* "borg/platform/freebsd.pyx":164 * nfs4_acl = ret == 1 * if nfs4_acl: * _get_acl(path, ACL_TYPE_NFS4, item, 'acl_nfs4', flags, fd=fd) # <<<<<<<<<<<<<< * else: * _get_acl(path, ACL_TYPE_ACCESS, item, 'acl_access', flags, fd=fd) */ __pyx_t_3 = __Pyx_PyInt_From_int(ACL_TYPE_NFS4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11.__pyx_n = 1; __pyx_t_11.fd = __pyx_v_fd; __pyx_t_9 = __pyx_f_4borg_8platform_7freebsd__get_acl(__pyx_v_path, __pyx_t_3, __pyx_v_item, __pyx_n_s_acl_nfs4, __pyx_t_4, &__pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "borg/platform/freebsd.pyx":163 * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * nfs4_acl = ret == 1 * if nfs4_acl: # <<<<<<<<<<<<<< * _get_acl(path, ACL_TYPE_NFS4, item, 'acl_nfs4', flags, fd=fd) * else: */ goto __pyx_L7; } /* "borg/platform/freebsd.pyx":166 * _get_acl(path, ACL_TYPE_NFS4, item, 'acl_nfs4', flags, fd=fd) * else: * _get_acl(path, ACL_TYPE_ACCESS, item, 'acl_access', flags, fd=fd) # <<<<<<<<<<<<<< * if stat.S_ISDIR(st.st_mode): * _get_acl(path, ACL_TYPE_DEFAULT, item, 'acl_default', flags, fd=fd) */ /*else*/ { __pyx_t_9 = __Pyx_PyInt_From_int(ACL_TYPE_ACCESS); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11.__pyx_n = 1; __pyx_t_11.fd = __pyx_v_fd; __pyx_t_3 = __pyx_f_4borg_8platform_7freebsd__get_acl(__pyx_v_path, __pyx_t_9, __pyx_v_item, __pyx_n_s_acl_access, __pyx_t_4, &__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/freebsd.pyx":167 * else: * _get_acl(path, ACL_TYPE_ACCESS, item, 'acl_access', flags, fd=fd) * if stat.S_ISDIR(st.st_mode): # <<<<<<<<<<<<<< * _get_acl(path, ACL_TYPE_DEFAULT, item, 'acl_default', flags, fd=fd) * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_stat); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_S_ISDIR); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_st, __pyx_n_s_st_mode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_4}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { /* "borg/platform/freebsd.pyx":168 * _get_acl(path, ACL_TYPE_ACCESS, item, 'acl_access', flags, fd=fd) * if stat.S_ISDIR(st.st_mode): * _get_acl(path, ACL_TYPE_DEFAULT, item, 'acl_default', flags, fd=fd) # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __Pyx_PyInt_From_int(ACL_TYPE_DEFAULT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_11.__pyx_n = 1; __pyx_t_11.fd = __pyx_v_fd; __pyx_t_4 = __pyx_f_4borg_8platform_7freebsd__get_acl(__pyx_v_path, __pyx_t_3, __pyx_v_item, __pyx_n_s_acl_default, __pyx_t_9, &__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "borg/platform/freebsd.pyx":167 * else: * _get_acl(path, ACL_TYPE_ACCESS, item, 'acl_access', flags, fd=fd) * if stat.S_ISDIR(st.st_mode): # <<<<<<<<<<<<<< * _get_acl(path, ACL_TYPE_DEFAULT, item, 'acl_default', flags, fd=fd) * */ } } __pyx_L7:; /* "borg/platform/freebsd.pyx":144 * acl_free(acl) * * def acl_get(path, item, st, numeric_ids=False, fd=None): # <<<<<<<<<<<<<< * """Saves ACL Entries * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("borg.platform.freebsd.acl_get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_nfs4_acl); __Pyx_XDECREF(__pyx_v_path); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/freebsd.pyx":171 * * * cdef _set_acl(p, type, item, attribute, numeric_ids=False, fd=None): # <<<<<<<<<<<<<< * cdef acl_t acl * text = item.get(attribute) */ static PyObject *__pyx_f_4borg_8platform_7freebsd__set_acl(PyObject *__pyx_v_p, PyObject *__pyx_v_type, PyObject *__pyx_v_item, PyObject *__pyx_v_attribute, struct __pyx_opt_args_4borg_8platform_7freebsd__set_acl *__pyx_optional_args) { PyObject *__pyx_v_numeric_ids = ((PyObject *)Py_False); PyObject *__pyx_v_fd = ((PyObject *)Py_None); acl_t __pyx_v_acl; PyObject *__pyx_v_text = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; int __pyx_t_6; char const *__pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; char const *__pyx_t_11; char const *__pyx_t_12; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_set_acl", 1); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_numeric_ids = __pyx_optional_args->numeric_ids; if (__pyx_optional_args->__pyx_n > 1) { __pyx_v_fd = __pyx_optional_args->fd; } } } /* "borg/platform/freebsd.pyx":173 * cdef _set_acl(p, type, item, attribute, numeric_ids=False, fd=None): * cdef acl_t acl * text = item.get(attribute) # <<<<<<<<<<<<<< * if text: * if numeric_ids: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_attribute}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_text = __pyx_t_1; __pyx_t_1 = 0; /* "borg/platform/freebsd.pyx":174 * cdef acl_t acl * text = item.get(attribute) * if text: # <<<<<<<<<<<<<< * if numeric_ids: * if type == ACL_TYPE_NFS4: */ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_text); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 174, __pyx_L1_error) if (__pyx_t_5) { /* "borg/platform/freebsd.pyx":175 * text = item.get(attribute) * if text: * if numeric_ids: # <<<<<<<<<<<<<< * if type == ACL_TYPE_NFS4: * text = _nfs4_use_stored_uid_gid(text) */ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_numeric_ids); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 175, __pyx_L1_error) if (__pyx_t_5) { /* "borg/platform/freebsd.pyx":176 * if text: * if numeric_ids: * if type == ACL_TYPE_NFS4: # <<<<<<<<<<<<<< * text = _nfs4_use_stored_uid_gid(text) * elif type in (ACL_TYPE_ACCESS, ACL_TYPE_DEFAULT): */ __pyx_t_1 = __Pyx_PyInt_From_int(ACL_TYPE_NFS4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_v_type, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_5) { /* "borg/platform/freebsd.pyx":177 * if numeric_ids: * if type == ACL_TYPE_NFS4: * text = _nfs4_use_stored_uid_gid(text) # <<<<<<<<<<<<<< * elif type in (ACL_TYPE_ACCESS, ACL_TYPE_DEFAULT): * text = posix_acl_use_stored_uid_gid(text) */ __pyx_t_2 = __pyx_f_4borg_8platform_7freebsd__nfs4_use_stored_uid_gid(__pyx_v_text); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_text, __pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/freebsd.pyx":176 * if text: * if numeric_ids: * if type == ACL_TYPE_NFS4: # <<<<<<<<<<<<<< * text = _nfs4_use_stored_uid_gid(text) * elif type in (ACL_TYPE_ACCESS, ACL_TYPE_DEFAULT): */ goto __pyx_L5; } /* "borg/platform/freebsd.pyx":178 * if type == ACL_TYPE_NFS4: * text = _nfs4_use_stored_uid_gid(text) * elif type in (ACL_TYPE_ACCESS, ACL_TYPE_DEFAULT): # <<<<<<<<<<<<<< * text = posix_acl_use_stored_uid_gid(text) * acl = acl_from_text(text) */ __Pyx_INCREF(__pyx_v_type); __pyx_t_2 = __pyx_v_type; __pyx_t_1 = __Pyx_PyInt_From_int(ACL_TYPE_ACCESS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = __Pyx_PyInt_From_int(ACL_TYPE_DEFAULT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = __pyx_t_6; __pyx_L6_bool_binop_done:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = __pyx_t_5; if (__pyx_t_6) { /* "borg/platform/freebsd.pyx":179 * text = _nfs4_use_stored_uid_gid(text) * elif type in (ACL_TYPE_ACCESS, ACL_TYPE_DEFAULT): * text = posix_acl_use_stored_uid_gid(text) # <<<<<<<<<<<<<< * acl = acl_from_text(text) * if acl == NULL: */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_posix_acl_use_stored_uid_gid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_text}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF_SET(__pyx_v_text, __pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/freebsd.pyx":178 * if type == ACL_TYPE_NFS4: * text = _nfs4_use_stored_uid_gid(text) * elif type in (ACL_TYPE_ACCESS, ACL_TYPE_DEFAULT): # <<<<<<<<<<<<<< * text = posix_acl_use_stored_uid_gid(text) * acl = acl_from_text(text) */ } __pyx_L5:; /* "borg/platform/freebsd.pyx":175 * text = item.get(attribute) * if text: * if numeric_ids: # <<<<<<<<<<<<<< * if type == ACL_TYPE_NFS4: * text = _nfs4_use_stored_uid_gid(text) */ } /* "borg/platform/freebsd.pyx":180 * elif type in (ACL_TYPE_ACCESS, ACL_TYPE_DEFAULT): * text = posix_acl_use_stored_uid_gid(text) * acl = acl_from_text(text) # <<<<<<<<<<<<<< * if acl == NULL: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(p)) */ if (unlikely(__pyx_v_text == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); __PYX_ERR(0, 180, __pyx_L1_error) } __pyx_t_7 = __Pyx_PyBytes_AsString(__pyx_v_text); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 180, __pyx_L1_error) __pyx_v_acl = acl_from_text(__pyx_t_7); /* "borg/platform/freebsd.pyx":181 * text = posix_acl_use_stored_uid_gid(text) * acl = acl_from_text(text) * if acl == NULL: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(p)) * try: */ __pyx_t_6 = (__pyx_v_acl == NULL); if (unlikely(__pyx_t_6)) { /* "borg/platform/freebsd.pyx":182 * acl = acl_from_text(text) * if acl == NULL: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(p)) # <<<<<<<<<<<<<< * try: * if fd is not None: */ __pyx_t_2 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_strerror); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_fsdecode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_p}; __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2)) __PYX_ERR(0, 182, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_8)) __PYX_ERR(0, 182, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(0, 182, __pyx_L1_error) /* "borg/platform/freebsd.pyx":181 * text = posix_acl_use_stored_uid_gid(text) * acl = acl_from_text(text) * if acl == NULL: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(p)) * try: */ } /* "borg/platform/freebsd.pyx":183 * if acl == NULL: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(p)) * try: # <<<<<<<<<<<<<< * if fd is not None: * if acl_set_fd_np(fd, acl, type) == -1: */ /*try:*/ { /* "borg/platform/freebsd.pyx":184 * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(p)) * try: * if fd is not None: # <<<<<<<<<<<<<< * if acl_set_fd_np(fd, acl, type) == -1: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(p)) */ __pyx_t_6 = (__pyx_v_fd != Py_None); if (__pyx_t_6) { /* "borg/platform/freebsd.pyx":185 * try: * if fd is not None: * if acl_set_fd_np(fd, acl, type) == -1: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(p)) * else: */ __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_fd); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L10_error) __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_type); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L10_error) __pyx_t_6 = (acl_set_fd_np(__pyx_t_4, __pyx_v_acl, __pyx_t_10) == -1L); if (unlikely(__pyx_t_6)) { /* "borg/platform/freebsd.pyx":186 * if fd is not None: * if acl_set_fd_np(fd, acl, type) == -1: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(p)) # <<<<<<<<<<<<<< * else: * if acl_set_link_np(p, type, acl) == -1: */ __pyx_t_8 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 186, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_strerror); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_1}; __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 186, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_fsdecode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 186, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_p}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 186, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8)) __PYX_ERR(0, 186, __pyx_L10_error); __Pyx_GIVEREF(__pyx_t_9); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_9)) __PYX_ERR(0, 186, __pyx_L10_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(0, 186, __pyx_L10_error); __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 186, __pyx_L10_error) /* "borg/platform/freebsd.pyx":185 * try: * if fd is not None: * if acl_set_fd_np(fd, acl, type) == -1: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(p)) * else: */ } /* "borg/platform/freebsd.pyx":184 * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(p)) * try: * if fd is not None: # <<<<<<<<<<<<<< * if acl_set_fd_np(fd, acl, type) == -1: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(p)) */ goto __pyx_L12; } /* "borg/platform/freebsd.pyx":188 * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(p)) * else: * if acl_set_link_np(p, type, acl) == -1: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(p)) * finally: */ /*else*/ { __pyx_t_11 = __Pyx_PyObject_AsString(__pyx_v_p); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) __PYX_ERR(0, 188, __pyx_L10_error) __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_type); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 188, __pyx_L10_error) __pyx_t_6 = (acl_set_link_np(__pyx_t_11, __pyx_t_10, __pyx_v_acl) == -1L); if (unlikely(__pyx_t_6)) { /* "borg/platform/freebsd.pyx":189 * else: * if acl_set_link_np(p, type, acl) == -1: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(p)) # <<<<<<<<<<<<<< * finally: * acl_free(acl) */ __pyx_t_2 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_os); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 189, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_strerror); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 189, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 189, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_9}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 189, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_os); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 189, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_fsdecode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_p}; __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 189, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 189, __pyx_L10_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3)) __PYX_ERR(0, 189, __pyx_L10_error); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_8)) __PYX_ERR(0, 189, __pyx_L10_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 189, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(0, 189, __pyx_L10_error) /* "borg/platform/freebsd.pyx":188 * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(p)) * else: * if acl_set_link_np(p, type, acl) == -1: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(p)) * finally: */ } } __pyx_L12:; } /* "borg/platform/freebsd.pyx":191 * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(p)) * finally: * acl_free(acl) # <<<<<<<<<<<<<< * * */ /*finally:*/ { /*normal exit:*/{ (void)(acl_free(__pyx_v_acl)); goto __pyx_L11; } __pyx_L10_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __pyx_t_10 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_12 = __pyx_filename; { (void)(acl_free(__pyx_v_acl)); } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18); } __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ErrRestore(__pyx_t_13, __pyx_t_14, __pyx_t_15); __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_12; goto __pyx_L1_error; } __pyx_L11:; } /* "borg/platform/freebsd.pyx":174 * cdef acl_t acl * text = item.get(attribute) * if text: # <<<<<<<<<<<<<< * if numeric_ids: * if type == ACL_TYPE_NFS4: */ } /* "borg/platform/freebsd.pyx":171 * * * cdef _set_acl(p, type, item, attribute, numeric_ids=False, fd=None): # <<<<<<<<<<<<<< * cdef acl_t acl * text = item.get(attribute) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("borg.platform.freebsd._set_acl", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_text); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/freebsd.pyx":194 * * * cdef _nfs4_use_stored_uid_gid(acl): # <<<<<<<<<<<<<< * """Replace the user/group field with the stored uid/gid * """ */ static PyObject *__pyx_f_4borg_8platform_7freebsd__nfs4_use_stored_uid_gid(PyObject *__pyx_v_acl) { PyObject *__pyx_v_entries = NULL; PyObject *__pyx_v_entry = NULL; PyObject *__pyx_v_fields = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; Py_ssize_t __pyx_t_6; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_nfs4_use_stored_uid_gid", 1); /* "borg/platform/freebsd.pyx":197 * """Replace the user/group field with the stored uid/gid * """ * entries = [] # <<<<<<<<<<<<<< * for entry in safe_decode(acl).split('\n'): * if entry: */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_entries = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "borg/platform/freebsd.pyx":198 * """ * entries = [] * for entry in safe_decode(acl).split('\n'): # <<<<<<<<<<<<<< * if entry: * if entry.startswith('user:') or entry.startswith('group:'): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_safe_decode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_acl}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_s__9}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 198, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_3))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 198, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 198, __pyx_L1_error) #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 198, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 198, __pyx_L1_error) #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 198, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_entry, __pyx_t_1); __pyx_t_1 = 0; /* "borg/platform/freebsd.pyx":199 * entries = [] * for entry in safe_decode(acl).split('\n'): * if entry: # <<<<<<<<<<<<<< * if entry.startswith('user:') or entry.startswith('group:'): * fields = entry.split(':') */ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_entry); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 199, __pyx_L1_error) if (__pyx_t_8) { /* "borg/platform/freebsd.pyx":200 * for entry in safe_decode(acl).split('\n'): * if entry: * if entry.startswith('user:') or entry.startswith('group:'): # <<<<<<<<<<<<<< * fields = entry.split(':') * entries.append(':'.join(fields[0], fields[5], *fields[2:-1])) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_entry, __pyx_n_s_startswith); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_user_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_9) { } else { __pyx_t_8 = __pyx_t_9; goto __pyx_L7_bool_binop_done; } __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_entry, __pyx_n_s_startswith); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_group}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = __pyx_t_9; __pyx_L7_bool_binop_done:; if (__pyx_t_8) { /* "borg/platform/freebsd.pyx":201 * if entry: * if entry.startswith('user:') or entry.startswith('group:'): * fields = entry.split(':') # <<<<<<<<<<<<<< * entries.append(':'.join(fields[0], fields[5], *fields[2:-1])) * else: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_entry, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s__10}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_XDECREF_SET(__pyx_v_fields, __pyx_t_1); __pyx_t_1 = 0; /* "borg/platform/freebsd.pyx":202 * if entry.startswith('user:') or entry.startswith('group:'): * fields = entry.split(':') * entries.append(':'.join(fields[0], fields[5], *fields[2:-1])) # <<<<<<<<<<<<<< * else: * entries.append(entry) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s__10, __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_fields, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_fields, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_4)) __PYX_ERR(0, 202, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_fields, 2, -1L, NULL, NULL, &__pyx_slice__11, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyNumber_Add(__pyx_t_10, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_entries, __pyx_t_2); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/freebsd.pyx":200 * for entry in safe_decode(acl).split('\n'): * if entry: * if entry.startswith('user:') or entry.startswith('group:'): # <<<<<<<<<<<<<< * fields = entry.split(':') * entries.append(':'.join(fields[0], fields[5], *fields[2:-1])) */ goto __pyx_L6; } /* "borg/platform/freebsd.pyx":204 * entries.append(':'.join(fields[0], fields[5], *fields[2:-1])) * else: * entries.append(entry) # <<<<<<<<<<<<<< * return safe_encode('\n'.join(entries)) * */ /*else*/ { __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_entries, __pyx_v_entry); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 204, __pyx_L1_error) } __pyx_L6:; /* "borg/platform/freebsd.pyx":199 * entries = [] * for entry in safe_decode(acl).split('\n'): * if entry: # <<<<<<<<<<<<<< * if entry.startswith('user:') or entry.startswith('group:'): * fields = entry.split(':') */ } /* "borg/platform/freebsd.pyx":198 * """ * entries = [] * for entry in safe_decode(acl).split('\n'): # <<<<<<<<<<<<<< * if entry: * if entry.startswith('user:') or entry.startswith('group:'): */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/freebsd.pyx":205 * else: * entries.append(entry) * return safe_encode('\n'.join(entries)) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_safe_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyString_Join(__pyx_kp_s__9, __pyx_v_entries); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_4}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "borg/platform/freebsd.pyx":194 * * * cdef _nfs4_use_stored_uid_gid(acl): # <<<<<<<<<<<<<< * """Replace the user/group field with the stored uid/gid * """ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("borg.platform.freebsd._nfs4_use_stored_uid_gid", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_entries); __Pyx_XDECREF(__pyx_v_entry); __Pyx_XDECREF(__pyx_v_fields); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/freebsd.pyx":208 * * * def acl_set(path, item, numeric_ids=False, fd=None): # <<<<<<<<<<<<<< * """Restore ACL Entries * */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_7freebsd_11acl_set(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_8platform_7freebsd_10acl_set, "Restore ACL Entries\n\n If `numeric_ids` is True the stored uid/gid is used instead\n of the user/group names\n "); static PyMethodDef __pyx_mdef_4borg_8platform_7freebsd_11acl_set = {"acl_set", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_7freebsd_11acl_set, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_8platform_7freebsd_10acl_set}; static PyObject *__pyx_pw_4borg_8platform_7freebsd_11acl_set(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_path = 0; PyObject *__pyx_v_item = 0; PyObject *__pyx_v_numeric_ids = 0; PyObject *__pyx_v_fd = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("acl_set (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_item,&__pyx_n_s_numeric_ids,&__pyx_n_s_fd,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_path)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 208, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_item)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 208, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("acl_set", 0, 2, 4, 1); __PYX_ERR(0, 208, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_numeric_ids); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 208, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fd); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 208, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "acl_set") < 0)) __PYX_ERR(0, 208, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_path = values[0]; __pyx_v_item = values[1]; __pyx_v_numeric_ids = values[2]; __pyx_v_fd = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("acl_set", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 208, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.freebsd.acl_set", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_7freebsd_10acl_set(__pyx_self, __pyx_v_path, __pyx_v_item, __pyx_v_numeric_ids, __pyx_v_fd); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8platform_7freebsd_10acl_set(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_item, PyObject *__pyx_v_numeric_ids, PyObject *__pyx_v_fd) { long __pyx_v_ret; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; char const *__pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; struct __pyx_opt_args_4borg_8platform_7freebsd__set_acl __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("acl_set", 0); __Pyx_INCREF(__pyx_v_path); /* "borg/platform/freebsd.pyx":214 * of the user/group names * """ * if isinstance(path, str): # <<<<<<<<<<<<<< * path = os.fsencode(path) * ret = lpathconf(path, _PC_ACL_NFS4) */ __pyx_t_1 = PyString_Check(__pyx_v_path); if (__pyx_t_1) { /* "borg/platform/freebsd.pyx":215 * """ * if isinstance(path, str): * path = os.fsencode(path) # <<<<<<<<<<<<<< * ret = lpathconf(path, _PC_ACL_NFS4) * if ret < 0: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_fsencode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_path}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_path, __pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/freebsd.pyx":214 * of the user/group names * """ * if isinstance(path, str): # <<<<<<<<<<<<<< * path = os.fsencode(path) * ret = lpathconf(path, _PC_ACL_NFS4) */ } /* "borg/platform/freebsd.pyx":216 * if isinstance(path, str): * path = os.fsencode(path) * ret = lpathconf(path, _PC_ACL_NFS4) # <<<<<<<<<<<<<< * if ret < 0: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) */ __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_path); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 216, __pyx_L1_error) __pyx_v_ret = lpathconf(__pyx_t_6, _PC_ACL_NFS4); /* "borg/platform/freebsd.pyx":217 * path = os.fsencode(path) * ret = lpathconf(path, _PC_ACL_NFS4) * if ret < 0: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * if ret == 1: */ __pyx_t_1 = (__pyx_v_ret < 0); if (unlikely(__pyx_t_1)) { /* "borg/platform/freebsd.pyx":218 * ret = lpathconf(path, _PC_ACL_NFS4) * if ret < 0: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) # <<<<<<<<<<<<<< * if ret == 1: * _set_acl(path, ACL_TYPE_NFS4, item, 'acl_nfs4', numeric_ids, fd=fd) */ __pyx_t_2 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_strerror); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_3}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_fsdecode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_path}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_4)) __PYX_ERR(0, 218, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7)) __PYX_ERR(0, 218, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __PYX_ERR(0, 218, __pyx_L1_error) /* "borg/platform/freebsd.pyx":217 * path = os.fsencode(path) * ret = lpathconf(path, _PC_ACL_NFS4) * if ret < 0: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * if ret == 1: */ } /* "borg/platform/freebsd.pyx":219 * if ret < 0: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * if ret == 1: # <<<<<<<<<<<<<< * _set_acl(path, ACL_TYPE_NFS4, item, 'acl_nfs4', numeric_ids, fd=fd) * ret = lpathconf(path, _PC_ACL_EXTENDED) */ __pyx_t_1 = (__pyx_v_ret == 1); if (__pyx_t_1) { /* "borg/platform/freebsd.pyx":220 * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * if ret == 1: * _set_acl(path, ACL_TYPE_NFS4, item, 'acl_nfs4', numeric_ids, fd=fd) # <<<<<<<<<<<<<< * ret = lpathconf(path, _PC_ACL_EXTENDED) * if ret < 0: */ __pyx_t_7 = __Pyx_PyInt_From_int(ACL_TYPE_NFS4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9.__pyx_n = 2; __pyx_t_9.numeric_ids = __pyx_v_numeric_ids; __pyx_t_9.fd = __pyx_v_fd; __pyx_t_8 = __pyx_f_4borg_8platform_7freebsd__set_acl(__pyx_v_path, __pyx_t_7, __pyx_v_item, __pyx_n_s_acl_nfs4, &__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "borg/platform/freebsd.pyx":219 * if ret < 0: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * if ret == 1: # <<<<<<<<<<<<<< * _set_acl(path, ACL_TYPE_NFS4, item, 'acl_nfs4', numeric_ids, fd=fd) * ret = lpathconf(path, _PC_ACL_EXTENDED) */ } /* "borg/platform/freebsd.pyx":221 * if ret == 1: * _set_acl(path, ACL_TYPE_NFS4, item, 'acl_nfs4', numeric_ids, fd=fd) * ret = lpathconf(path, _PC_ACL_EXTENDED) # <<<<<<<<<<<<<< * if ret < 0: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) */ __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_path); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 221, __pyx_L1_error) __pyx_v_ret = lpathconf(__pyx_t_6, _PC_ACL_EXTENDED); /* "borg/platform/freebsd.pyx":222 * _set_acl(path, ACL_TYPE_NFS4, item, 'acl_nfs4', numeric_ids, fd=fd) * ret = lpathconf(path, _PC_ACL_EXTENDED) * if ret < 0: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * if ret == 1: */ __pyx_t_1 = (__pyx_v_ret < 0); if (unlikely(__pyx_t_1)) { /* "borg/platform/freebsd.pyx":223 * ret = lpathconf(path, _PC_ACL_EXTENDED) * if ret < 0: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) # <<<<<<<<<<<<<< * if ret == 1: * _set_acl(path, ACL_TYPE_ACCESS, item, 'acl_access', numeric_ids, fd=fd) */ __pyx_t_8 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_strerror); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_fsdecode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_path}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8)) __PYX_ERR(0, 223, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7)) __PYX_ERR(0, 223, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error); __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 223, __pyx_L1_error) /* "borg/platform/freebsd.pyx":222 * _set_acl(path, ACL_TYPE_NFS4, item, 'acl_nfs4', numeric_ids, fd=fd) * ret = lpathconf(path, _PC_ACL_EXTENDED) * if ret < 0: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * if ret == 1: */ } /* "borg/platform/freebsd.pyx":224 * if ret < 0: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * if ret == 1: # <<<<<<<<<<<<<< * _set_acl(path, ACL_TYPE_ACCESS, item, 'acl_access', numeric_ids, fd=fd) * _set_acl(path, ACL_TYPE_DEFAULT, item, 'acl_default', numeric_ids, fd=fd) */ __pyx_t_1 = (__pyx_v_ret == 1); if (__pyx_t_1) { /* "borg/platform/freebsd.pyx":225 * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * if ret == 1: * _set_acl(path, ACL_TYPE_ACCESS, item, 'acl_access', numeric_ids, fd=fd) # <<<<<<<<<<<<<< * _set_acl(path, ACL_TYPE_DEFAULT, item, 'acl_default', numeric_ids, fd=fd) */ __pyx_t_2 = __Pyx_PyInt_From_int(ACL_TYPE_ACCESS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9.__pyx_n = 2; __pyx_t_9.numeric_ids = __pyx_v_numeric_ids; __pyx_t_9.fd = __pyx_v_fd; __pyx_t_3 = __pyx_f_4borg_8platform_7freebsd__set_acl(__pyx_v_path, __pyx_t_2, __pyx_v_item, __pyx_n_s_acl_access, &__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/freebsd.pyx":226 * if ret == 1: * _set_acl(path, ACL_TYPE_ACCESS, item, 'acl_access', numeric_ids, fd=fd) * _set_acl(path, ACL_TYPE_DEFAULT, item, 'acl_default', numeric_ids, fd=fd) # <<<<<<<<<<<<<< */ __pyx_t_3 = __Pyx_PyInt_From_int(ACL_TYPE_DEFAULT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9.__pyx_n = 2; __pyx_t_9.numeric_ids = __pyx_v_numeric_ids; __pyx_t_9.fd = __pyx_v_fd; __pyx_t_2 = __pyx_f_4borg_8platform_7freebsd__set_acl(__pyx_v_path, __pyx_t_3, __pyx_v_item, __pyx_n_s_acl_default, &__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/freebsd.pyx":224 * if ret < 0: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * if ret == 1: # <<<<<<<<<<<<<< * _set_acl(path, ACL_TYPE_ACCESS, item, 'acl_access', numeric_ids, fd=fd) * _set_acl(path, ACL_TYPE_DEFAULT, item, 'acl_default', numeric_ids, fd=fd) */ } /* "borg/platform/freebsd.pyx":208 * * * def acl_set(path, item, numeric_ids=False, fd=None): # <<<<<<<<<<<<<< * """Restore ACL Entries * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("borg.platform.freebsd.acl_set", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_path); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } #if CYTHON_USE_FREELISTS static struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct__listxattr *__pyx_freelist_4borg_8platform_7freebsd___pyx_scope_struct__listxattr[8]; static int __pyx_freecount_4borg_8platform_7freebsd___pyx_scope_struct__listxattr = 0; #endif static PyObject *__pyx_tp_new_4borg_8platform_7freebsd___pyx_scope_struct__listxattr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_freecount_4borg_8platform_7freebsd___pyx_scope_struct__listxattr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct__listxattr)))) { o = (PyObject*)__pyx_freelist_4borg_8platform_7freebsd___pyx_scope_struct__listxattr[--__pyx_freecount_4borg_8platform_7freebsd___pyx_scope_struct__listxattr]; memset(o, 0, sizeof(struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct__listxattr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif return o; } static void __pyx_tp_dealloc_4borg_8platform_7freebsd___pyx_scope_struct__listxattr(PyObject *o) { struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct__listxattr *p = (struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct__listxattr *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4borg_8platform_7freebsd___pyx_scope_struct__listxattr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_follow_symlinks); Py_CLEAR(p->__pyx_v_ns_id); #if CYTHON_USE_FREELISTS if (((int)(__pyx_freecount_4borg_8platform_7freebsd___pyx_scope_struct__listxattr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct__listxattr)))) { __pyx_freelist_4borg_8platform_7freebsd___pyx_scope_struct__listxattr[__pyx_freecount_4borg_8platform_7freebsd___pyx_scope_struct__listxattr++] = ((struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct__listxattr *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static int __pyx_tp_traverse_4borg_8platform_7freebsd___pyx_scope_struct__listxattr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct__listxattr *p = (struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct__listxattr *)o; if (p->__pyx_v_follow_symlinks) { e = (*v)(p->__pyx_v_follow_symlinks, a); if (e) return e; } if (p->__pyx_v_ns_id) { e = (*v)(p->__pyx_v_ns_id, a); if (e) return e; } return 0; } static int __pyx_tp_clear_4borg_8platform_7freebsd___pyx_scope_struct__listxattr(PyObject *o) { PyObject* tmp; struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct__listxattr *p = (struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct__listxattr *)o; tmp = ((PyObject*)p->__pyx_v_follow_symlinks); p->__pyx_v_follow_symlinks = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_ns_id); p->__pyx_v_ns_id = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_4borg_8platform_7freebsd___pyx_scope_struct__listxattr_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4borg_8platform_7freebsd___pyx_scope_struct__listxattr}, {Py_tp_traverse, (void *)__pyx_tp_traverse_4borg_8platform_7freebsd___pyx_scope_struct__listxattr}, {Py_tp_clear, (void *)__pyx_tp_clear_4borg_8platform_7freebsd___pyx_scope_struct__listxattr}, {Py_tp_new, (void *)__pyx_tp_new_4borg_8platform_7freebsd___pyx_scope_struct__listxattr}, {0, 0}, }; static PyType_Spec __pyx_type_4borg_8platform_7freebsd___pyx_scope_struct__listxattr_spec = { "borg.platform.freebsd.__pyx_scope_struct__listxattr", sizeof(struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct__listxattr), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, __pyx_type_4borg_8platform_7freebsd___pyx_scope_struct__listxattr_slots, }; #else static PyTypeObject __pyx_type_4borg_8platform_7freebsd___pyx_scope_struct__listxattr = { PyVarObject_HEAD_INIT(0, 0) "borg.platform.freebsd.""__pyx_scope_struct__listxattr", /*tp_name*/ sizeof(struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct__listxattr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4borg_8platform_7freebsd___pyx_scope_struct__listxattr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_4borg_8platform_7freebsd___pyx_scope_struct__listxattr, /*tp_traverse*/ __pyx_tp_clear_4borg_8platform_7freebsd___pyx_scope_struct__listxattr, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4borg_8platform_7freebsd___pyx_scope_struct__listxattr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif #if CYTHON_USE_FREELISTS static struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr *__pyx_freelist_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr[8]; static int __pyx_freecount_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr = 0; #endif static PyObject *__pyx_tp_new_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_freecount_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr)))) { o = (PyObject*)__pyx_freelist_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr[--__pyx_freecount_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr]; memset(o, 0, sizeof(struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif return o; } static void __pyx_tp_dealloc_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr(PyObject *o) { struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr *p = (struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_follow_symlinks); Py_CLEAR(p->__pyx_v_ns_id); #if CYTHON_USE_FREELISTS if (((int)(__pyx_freecount_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr)))) { __pyx_freelist_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr[__pyx_freecount_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr++] = ((struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static int __pyx_tp_traverse_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr *p = (struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr *)o; if (p->__pyx_v_follow_symlinks) { e = (*v)(p->__pyx_v_follow_symlinks, a); if (e) return e; } if (p->__pyx_v_ns_id) { e = (*v)(p->__pyx_v_ns_id, a); if (e) return e; } return 0; } static int __pyx_tp_clear_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr(PyObject *o) { PyObject* tmp; struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr *p = (struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr *)o; tmp = ((PyObject*)p->__pyx_v_follow_symlinks); p->__pyx_v_follow_symlinks = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_ns_id); p->__pyx_v_ns_id = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr}, {Py_tp_traverse, (void *)__pyx_tp_traverse_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr}, {Py_tp_clear, (void *)__pyx_tp_clear_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr}, {Py_tp_new, (void *)__pyx_tp_new_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr}, {0, 0}, }; static PyType_Spec __pyx_type_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr_spec = { "borg.platform.freebsd.__pyx_scope_struct_1_getxattr", sizeof(struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, __pyx_type_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr_slots, }; #else static PyTypeObject __pyx_type_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr = { PyVarObject_HEAD_INIT(0, 0) "borg.platform.freebsd.""__pyx_scope_struct_1_getxattr", /*tp_name*/ sizeof(struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr, /*tp_traverse*/ __pyx_tp_clear_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif #if CYTHON_USE_FREELISTS static struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr *__pyx_freelist_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr[8]; static int __pyx_freecount_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr = 0; #endif static PyObject *__pyx_tp_new_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_freecount_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr)))) { o = (PyObject*)__pyx_freelist_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr[--__pyx_freecount_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr]; memset(o, 0, sizeof(struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif return o; } static void __pyx_tp_dealloc_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr(PyObject *o) { struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr *p = (struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_follow_symlinks); Py_CLEAR(p->__pyx_v_ns_id); #if CYTHON_USE_FREELISTS if (((int)(__pyx_freecount_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr)))) { __pyx_freelist_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr[__pyx_freecount_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr++] = ((struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static int __pyx_tp_traverse_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr *p = (struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr *)o; if (p->__pyx_v_follow_symlinks) { e = (*v)(p->__pyx_v_follow_symlinks, a); if (e) return e; } if (p->__pyx_v_ns_id) { e = (*v)(p->__pyx_v_ns_id, a); if (e) return e; } return 0; } static int __pyx_tp_clear_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr(PyObject *o) { PyObject* tmp; struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr *p = (struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr *)o; tmp = ((PyObject*)p->__pyx_v_follow_symlinks); p->__pyx_v_follow_symlinks = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_ns_id); p->__pyx_v_ns_id = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr}, {Py_tp_traverse, (void *)__pyx_tp_traverse_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr}, {Py_tp_clear, (void *)__pyx_tp_clear_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr}, {Py_tp_new, (void *)__pyx_tp_new_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr}, {0, 0}, }; static PyType_Spec __pyx_type_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr_spec = { "borg.platform.freebsd.__pyx_scope_struct_2_setxattr", sizeof(struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, __pyx_type_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr_slots, }; #else static PyTypeObject __pyx_type_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr = { PyVarObject_HEAD_INIT(0, 0) "borg.platform.freebsd.""__pyx_scope_struct_2_setxattr", /*tp_name*/ sizeof(struct __pyx_obj_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr, /*tp_traverse*/ __pyx_tp_clear_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_b_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 0, 0}, {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0}, {&__pyx_kp_s_1_4_01, __pyx_k_1_4_01, sizeof(__pyx_k_1_4_01), 0, 0, 1, 0}, {&__pyx_n_s_API_VERSION, __pyx_k_API_VERSION, sizeof(__pyx_k_API_VERSION), 0, 0, 1, 1}, {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, {&__pyx_n_s_NS_ID_MAP, __pyx_k_NS_ID_MAP, sizeof(__pyx_k_NS_ID_MAP), 0, 0, 1, 1}, {&__pyx_n_s_OSError, __pyx_k_OSError, sizeof(__pyx_k_OSError), 0, 0, 1, 1}, {&__pyx_n_s_S_ISDIR, __pyx_k_S_ISDIR, sizeof(__pyx_k_S_ISDIR), 0, 0, 1, 1}, {&__pyx_kp_s__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 0, 1, 0}, {&__pyx_n_s__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 0, 1, 1}, {&__pyx_n_s__26, __pyx_k__26, sizeof(__pyx_k__26), 0, 0, 1, 1}, {&__pyx_kp_s__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 0, 1, 0}, {&__pyx_n_s_acl_access, __pyx_k_acl_access, sizeof(__pyx_k_acl_access), 0, 0, 1, 1}, {&__pyx_n_s_acl_default, __pyx_k_acl_default, sizeof(__pyx_k_acl_default), 0, 0, 1, 1}, {&__pyx_n_s_acl_get, __pyx_k_acl_get, sizeof(__pyx_k_acl_get), 0, 0, 1, 1}, {&__pyx_n_s_acl_nfs4, __pyx_k_acl_nfs4, sizeof(__pyx_k_acl_nfs4), 0, 0, 1, 1}, {&__pyx_n_s_acl_set, __pyx_k_acl_set, sizeof(__pyx_k_acl_set), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_borg_platform_freebsd, __pyx_k_borg_platform_freebsd, sizeof(__pyx_k_borg_platform_freebsd), 0, 0, 1, 1}, {&__pyx_n_s_buf, __pyx_k_buf, sizeof(__pyx_k_buf), 0, 0, 1, 1}, {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_default_ns, __pyx_k_default_ns, sizeof(__pyx_k_default_ns), 0, 0, 1, 1}, {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, {&__pyx_n_s_fd, __pyx_k_fd, sizeof(__pyx_k_fd), 0, 0, 1, 1}, {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, {&__pyx_n_s_follow_symlinks, __pyx_k_follow_symlinks, sizeof(__pyx_k_follow_symlinks), 0, 0, 1, 1}, {&__pyx_n_s_fsdecode, __pyx_k_fsdecode, sizeof(__pyx_k_fsdecode), 0, 0, 1, 1}, {&__pyx_n_s_fsencode, __pyx_k_fsencode, sizeof(__pyx_k_fsencode), 0, 0, 1, 1}, {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1}, {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, {&__pyx_n_s_getxattr, __pyx_k_getxattr, sizeof(__pyx_k_getxattr), 0, 0, 1, 1}, {&__pyx_n_s_getxattr_inner, __pyx_k_getxattr_inner, sizeof(__pyx_k_getxattr_inner), 0, 0, 1, 1}, {&__pyx_n_s_getxattr_locals_func, __pyx_k_getxattr_locals_func, sizeof(__pyx_k_getxattr_locals_func), 0, 0, 1, 1}, {&__pyx_kp_s_group, __pyx_k_group, sizeof(__pyx_k_group), 0, 0, 1, 0}, {&__pyx_n_s_helpers, __pyx_k_helpers, sizeof(__pyx_k_helpers), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, {&__pyx_n_s_item, __pyx_k_item, sizeof(__pyx_k_item), 0, 0, 1, 1}, {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, {&__pyx_n_s_listxattr, __pyx_k_listxattr, sizeof(__pyx_k_listxattr), 0, 0, 1, 1}, {&__pyx_n_s_listxattr_inner, __pyx_k_listxattr_inner, sizeof(__pyx_k_listxattr_inner), 0, 0, 1, 1}, {&__pyx_n_s_listxattr_locals_func, __pyx_k_listxattr_locals_func, sizeof(__pyx_k_listxattr_locals_func), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, {&__pyx_n_s_nfs4_acl, __pyx_k_nfs4_acl, sizeof(__pyx_k_nfs4_acl), 0, 0, 1, 1}, {&__pyx_n_s_ns, __pyx_k_ns, sizeof(__pyx_k_ns), 0, 0, 1, 1}, {&__pyx_n_s_ns_id, __pyx_k_ns_id, sizeof(__pyx_k_ns_id), 0, 0, 1, 1}, {&__pyx_n_s_ns_name, __pyx_k_ns_name, sizeof(__pyx_k_ns_name), 0, 0, 1, 1}, {&__pyx_n_s_ns_name_tuple, __pyx_k_ns_name_tuple, sizeof(__pyx_k_ns_name_tuple), 0, 0, 1, 1}, {&__pyx_n_s_numeric_ids, __pyx_k_numeric_ids, sizeof(__pyx_k_numeric_ids), 0, 0, 1, 1}, {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, {&__pyx_n_s_posix, __pyx_k_posix, sizeof(__pyx_k_posix), 0, 0, 1, 1}, {&__pyx_n_s_posix_acl_use_stored_uid_gid, __pyx_k_posix_acl_use_stored_uid_gid, sizeof(__pyx_k_posix_acl_use_stored_uid_gid), 0, 0, 1, 1}, {&__pyx_n_s_ret, __pyx_k_ret, sizeof(__pyx_k_ret), 0, 0, 1, 1}, {&__pyx_n_s_safe_decode, __pyx_k_safe_decode, sizeof(__pyx_k_safe_decode), 0, 0, 1, 1}, {&__pyx_n_s_safe_encode, __pyx_k_safe_encode, sizeof(__pyx_k_safe_encode), 0, 0, 1, 1}, {&__pyx_n_s_setxattr, __pyx_k_setxattr, sizeof(__pyx_k_setxattr), 0, 0, 1, 1}, {&__pyx_n_s_setxattr_inner, __pyx_k_setxattr_inner, sizeof(__pyx_k_setxattr_inner), 0, 0, 1, 1}, {&__pyx_n_s_setxattr_locals_func, __pyx_k_setxattr_locals_func, sizeof(__pyx_k_setxattr_locals_func), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1}, {&__pyx_n_s_split_lstring, __pyx_k_split_lstring, sizeof(__pyx_k_split_lstring), 0, 0, 1, 1}, {&__pyx_n_s_split_ns, __pyx_k_split_ns, sizeof(__pyx_k_split_ns), 0, 0, 1, 1}, {&__pyx_kp_s_src_borg_platform_freebsd_pyx, __pyx_k_src_borg_platform_freebsd_pyx, sizeof(__pyx_k_src_borg_platform_freebsd_pyx), 0, 0, 1, 0}, {&__pyx_n_s_st, __pyx_k_st, sizeof(__pyx_k_st), 0, 0, 1, 1}, {&__pyx_n_s_st_mode, __pyx_k_st_mode, sizeof(__pyx_k_st_mode), 0, 0, 1, 1}, {&__pyx_n_s_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 0, 1, 1}, {&__pyx_n_s_stat, __pyx_k_stat, sizeof(__pyx_k_stat), 0, 0, 1, 1}, {&__pyx_n_s_strerror, __pyx_k_strerror, sizeof(__pyx_k_strerror), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_b_user, __pyx_k_user, sizeof(__pyx_k_user), 0, 0, 0, 1}, {&__pyx_kp_s_user_2, __pyx_k_user_2, sizeof(__pyx_k_user_2), 0, 0, 1, 0}, {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, {&__pyx_n_s_xattr, __pyx_k_xattr, sizeof(__pyx_k_xattr), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 121, __pyx_L1_error) __pyx_builtin_OSError = __Pyx_GetBuiltinName(__pyx_n_s_OSError); if (!__pyx_builtin_OSError) __PYX_ERR(0, 135, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "borg/platform/freebsd.pyx":66 * # we also need to deal with "unexpected" namespaces here, they could come * # from borg archives made on other operating systems. * ns_name_tuple = ns_name.split(b".", 1) # <<<<<<<<<<<<<< * if len(ns_name_tuple) == 2: * # we have a namespace prefix in the given name */ __pyx_tuple__2 = PyTuple_Pack(2, __pyx_kp_b_, __pyx_int_1); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "borg/platform/freebsd.pyx":77 * * def listxattr(path, *, follow_symlinks=False): * def func(path, buf, size): # <<<<<<<<<<<<<< * if isinstance(path, int): * return c_extattr_list_fd(path, ns_id, buf, size) */ __pyx_tuple__3 = PyTuple_Pack(3, __pyx_n_s_path, __pyx_n_s_buf, __pyx_n_s_size); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_freebsd_pyx, __pyx_n_s_func, 77, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 77, __pyx_L1_error) /* "borg/platform/freebsd.pyx":93 * * def getxattr(path, name, *, follow_symlinks=False): * def func(path, name, buf, size): # <<<<<<<<<<<<<< * if isinstance(path, int): * return c_extattr_get_fd(path, ns_id, name, buf, size) */ __pyx_tuple__5 = PyTuple_Pack(4, __pyx_n_s_path, __pyx_n_s_name, __pyx_n_s_buf, __pyx_n_s_size); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_freebsd_pyx, __pyx_n_s_func, 93, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 93, __pyx_L1_error) /* "borg/platform/freebsd.pyx":109 * * def setxattr(path, name, value, *, follow_symlinks=False): * def func(path, name, value, size): # <<<<<<<<<<<<<< * if isinstance(path, int): * return c_extattr_set_fd(path, ns_id, name, value, size) */ __pyx_tuple__7 = PyTuple_Pack(4, __pyx_n_s_path, __pyx_n_s_name, __pyx_n_s_value, __pyx_n_s_size); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_freebsd_pyx, __pyx_n_s_func, 109, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 109, __pyx_L1_error) /* "borg/platform/freebsd.pyx":202 * if entry.startswith('user:') or entry.startswith('group:'): * fields = entry.split(':') * entries.append(':'.join(fields[0], fields[5], *fields[2:-1])) # <<<<<<<<<<<<<< * else: * entries.append(entry) */ __pyx_slice__11 = PySlice_New(__pyx_int_2, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__11)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__11); __Pyx_GIVEREF(__pyx_slice__11); /* "borg/platform/freebsd.pyx":59 * * * def split_ns(ns_name, default_ns): # <<<<<<<<<<<<<< * # split ns_name (which is in the form of b"namespace.name") into namespace and name. * # if there is no namespace given in ns_name, default to default_ns. */ __pyx_tuple__13 = PyTuple_Pack(5, __pyx_n_s_ns_name, __pyx_n_s_default_ns, __pyx_n_s_ns_name_tuple, __pyx_n_s_ns, __pyx_n_s_name); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_freebsd_pyx, __pyx_n_s_split_ns, 59, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 59, __pyx_L1_error) /* "borg/platform/freebsd.pyx":76 * * * def listxattr(path, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, buf, size): * if isinstance(path, int): */ __pyx_tuple__15 = PyTuple_Pack(9, __pyx_n_s_path, __pyx_n_s_follow_symlinks, __pyx_n_s_func, __pyx_n_s_func, __pyx_n_s_ns, __pyx_n_s_ns_id, __pyx_n_s_n, __pyx_n_s_buf, __pyx_n_s_name); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_freebsd_pyx, __pyx_n_s_listxattr, 76, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 76, __pyx_L1_error) /* "borg/platform/freebsd.pyx":92 * * * def getxattr(path, name, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, name, buf, size): * if isinstance(path, int): */ __pyx_tuple__17 = PyTuple_Pack(9, __pyx_n_s_path, __pyx_n_s_name, __pyx_n_s_follow_symlinks, __pyx_n_s_func, __pyx_n_s_func, __pyx_n_s_ns, __pyx_n_s_ns_id, __pyx_n_s_n, __pyx_n_s_buf); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(2, 0, 1, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_freebsd_pyx, __pyx_n_s_getxattr, 92, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 92, __pyx_L1_error) /* "borg/platform/freebsd.pyx":108 * * * def setxattr(path, name, value, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, name, value, size): * if isinstance(path, int): */ __pyx_tuple__19 = PyTuple_Pack(8, __pyx_n_s_path, __pyx_n_s_name, __pyx_n_s_value, __pyx_n_s_follow_symlinks, __pyx_n_s_func, __pyx_n_s_func, __pyx_n_s_ns, __pyx_n_s_ns_id); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(3, 0, 1, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_freebsd_pyx, __pyx_n_s_setxattr, 108, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 108, __pyx_L1_error) /* "borg/platform/freebsd.pyx":144 * acl_free(acl) * * def acl_get(path, item, st, numeric_ids=False, fd=None): # <<<<<<<<<<<<<< * """Saves ACL Entries * */ __pyx_tuple__21 = PyTuple_Pack(8, __pyx_n_s_path, __pyx_n_s_item, __pyx_n_s_st, __pyx_n_s_numeric_ids, __pyx_n_s_fd, __pyx_n_s_flags, __pyx_n_s_ret, __pyx_n_s_nfs4_acl); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_freebsd_pyx, __pyx_n_s_acl_get, 144, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 144, __pyx_L1_error) __pyx_tuple__23 = PyTuple_Pack(2, ((PyObject *)Py_False), Py_None); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23); /* "borg/platform/freebsd.pyx":208 * * * def acl_set(path, item, numeric_ids=False, fd=None): # <<<<<<<<<<<<<< * """Restore ACL Entries * */ __pyx_tuple__24 = PyTuple_Pack(5, __pyx_n_s_path, __pyx_n_s_item, __pyx_n_s_numeric_ids, __pyx_n_s_fd, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_freebsd_pyx, __pyx_n_s_acl_set, 208, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS __pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct__listxattr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4borg_8platform_7freebsd___pyx_scope_struct__listxattr_spec, NULL); if (unlikely(!__pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct__listxattr)) __PYX_ERR(0, 76, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4borg_8platform_7freebsd___pyx_scope_struct__listxattr_spec, __pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct__listxattr) < 0) __PYX_ERR(0, 76, __pyx_L1_error) #else __pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct__listxattr = &__pyx_type_4borg_8platform_7freebsd___pyx_scope_struct__listxattr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct__listxattr) < 0) __PYX_ERR(0, 76, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct__listxattr->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct__listxattr->tp_dictoffset && __pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct__listxattr->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct__listxattr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr_spec, NULL); if (unlikely(!__pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr)) __PYX_ERR(0, 92, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr_spec, __pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr) < 0) __PYX_ERR(0, 92, __pyx_L1_error) #else __pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr = &__pyx_type_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr) < 0) __PYX_ERR(0, 92, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr->tp_dictoffset && __pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct_1_getxattr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr_spec, NULL); if (unlikely(!__pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr)) __PYX_ERR(0, 108, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr_spec, __pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr) < 0) __PYX_ERR(0, 108, __pyx_L1_error) #else __pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr = &__pyx_type_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr) < 0) __PYX_ERR(0, 108, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr->tp_dictoffset && __pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_4borg_8platform_7freebsd___pyx_scope_struct_2_setxattr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_freebsd(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_freebsd}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "freebsd", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initfreebsd(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initfreebsd(void) #else __Pyx_PyMODINIT_FUNC PyInit_freebsd(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_freebsd(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_freebsd(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'freebsd' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("freebsd", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "freebsd" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_freebsd(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_borg__platform__freebsd) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "borg.platform.freebsd")) { if (unlikely((PyDict_SetItemString(modules, "borg.platform.freebsd", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) (void)__Pyx_modinit_type_import_code(); (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "borg/platform/freebsd.pyx":1 * import os # <<<<<<<<<<<<<< * import stat * */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_os, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/freebsd.pyx":2 * import os * import stat # <<<<<<<<<<<<<< * * from .posix import posix_acl_use_stored_uid_gid */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_stat, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_stat, __pyx_t_2) < 0) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/freebsd.pyx":4 * import stat * * from .posix import posix_acl_use_stored_uid_gid # <<<<<<<<<<<<<< * from ..helpers import safe_encode, safe_decode * from .xattr import _listxattr_inner, _getxattr_inner, _setxattr_inner, split_lstring */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_posix_acl_use_stored_uid_gid); __Pyx_GIVEREF(__pyx_n_s_posix_acl_use_stored_uid_gid); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_posix_acl_use_stored_uid_gid)) __PYX_ERR(0, 4, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_posix, __pyx_t_2, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_posix_acl_use_stored_uid_gid); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_posix_acl_use_stored_uid_gid, __pyx_t_2) < 0) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/freebsd.pyx":5 * * from .posix import posix_acl_use_stored_uid_gid * from ..helpers import safe_encode, safe_decode # <<<<<<<<<<<<<< * from .xattr import _listxattr_inner, _getxattr_inner, _setxattr_inner, split_lstring * */ __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_safe_encode); __Pyx_GIVEREF(__pyx_n_s_safe_encode); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_safe_encode)) __PYX_ERR(0, 5, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_safe_decode); __Pyx_GIVEREF(__pyx_n_s_safe_decode); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_safe_decode)) __PYX_ERR(0, 5, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_helpers, __pyx_t_3, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_safe_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_safe_encode, __pyx_t_3) < 0) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_safe_decode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_safe_decode, __pyx_t_3) < 0) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/freebsd.pyx":6 * from .posix import posix_acl_use_stored_uid_gid * from ..helpers import safe_encode, safe_decode * from .xattr import _listxattr_inner, _getxattr_inner, _setxattr_inner, split_lstring # <<<<<<<<<<<<<< * * from libc cimport errno */ __pyx_t_2 = PyList_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_listxattr_inner); __Pyx_GIVEREF(__pyx_n_s_listxattr_inner); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_listxattr_inner)) __PYX_ERR(0, 6, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_getxattr_inner); __Pyx_GIVEREF(__pyx_n_s_getxattr_inner); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_getxattr_inner)) __PYX_ERR(0, 6, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_setxattr_inner); __Pyx_GIVEREF(__pyx_n_s_setxattr_inner); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_setxattr_inner)) __PYX_ERR(0, 6, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_split_lstring); __Pyx_GIVEREF(__pyx_n_s_split_lstring); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_split_lstring)) __PYX_ERR(0, 6, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_xattr, __pyx_t_2, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_listxattr_inner); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_listxattr_inner, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_getxattr_inner); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_getxattr_inner, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_setxattr_inner); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setxattr_inner, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_split_lstring); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_split_lstring, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/freebsd.pyx":10 * from libc cimport errno * * API_VERSION = '1.4_01' # <<<<<<<<<<<<<< * * cdef extern from "sys/extattr.h": */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_API_VERSION, __pyx_kp_s_1_4_01) < 0) __PYX_ERR(0, 10, __pyx_L1_error) /* "borg/platform/freebsd.pyx":56 * # On FreeBSD, borg currently only deals with the USER namespace as it is unclear * # whether (and if so, how exactly) it should deal with the SYSTEM namespace. * NS_ID_MAP = {b"user": EXTATTR_NAMESPACE_USER, } # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_int(EXTATTR_NAMESPACE_USER); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_n_b_user, __pyx_t_2) < 0) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_NS_ID_MAP, __pyx_t_3) < 0) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/freebsd.pyx":59 * * * def split_ns(ns_name, default_ns): # <<<<<<<<<<<<<< * # split ns_name (which is in the form of b"namespace.name") into namespace and name. * # if there is no namespace given in ns_name, default to default_ns. */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_7freebsd_1split_ns, 0, __pyx_n_s_split_ns, NULL, __pyx_n_s_borg_platform_freebsd, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_split_ns, __pyx_t_3) < 0) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/freebsd.pyx":76 * * * def listxattr(path, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, buf, size): * if isinstance(path, int): */ __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_follow_symlinks, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 76, __pyx_L1_error) __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_7freebsd_3listxattr, 0, __pyx_n_s_listxattr, NULL, __pyx_n_s_borg_platform_freebsd, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_2, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_listxattr, __pyx_t_2) < 0) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/freebsd.pyx":92 * * * def getxattr(path, name, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, name, buf, size): * if isinstance(path, int): */ __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_follow_symlinks, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 92, __pyx_L1_error) __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_7freebsd_5getxattr, 0, __pyx_n_s_getxattr, NULL, __pyx_n_s_borg_platform_freebsd, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_3, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_getxattr, __pyx_t_3) < 0) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/freebsd.pyx":108 * * * def setxattr(path, name, value, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, name, value, size): * if isinstance(path, int): */ __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_follow_symlinks, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 108, __pyx_L1_error) __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_7freebsd_7setxattr, 0, __pyx_n_s_setxattr, NULL, __pyx_n_s_borg_platform_freebsd, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_2, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_setxattr, __pyx_t_2) < 0) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/freebsd.pyx":144 * acl_free(acl) * * def acl_get(path, item, st, numeric_ids=False, fd=None): # <<<<<<<<<<<<<< * """Saves ACL Entries * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_7freebsd_9acl_get, 0, __pyx_n_s_acl_get, NULL, __pyx_n_s_borg_platform_freebsd, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__23); if (PyDict_SetItem(__pyx_d, __pyx_n_s_acl_get, __pyx_t_2) < 0) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/freebsd.pyx":208 * * * def acl_set(path, item, numeric_ids=False, fd=None): # <<<<<<<<<<<<<< * """Restore ACL Entries * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_7freebsd_11acl_set, 0, __pyx_n_s_acl_set, NULL, __pyx_n_s_borg_platform_freebsd, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__23); if (PyDict_SetItem(__pyx_d, __pyx_n_s_acl_set, __pyx_t_2) < 0) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/freebsd.pyx":1 * import os # <<<<<<<<<<<<<< * import stat * */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init borg.platform.freebsd", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init borg.platform.freebsd"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return -1; __Pyx_PyErr_Clear(); return 0; } return 0; } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } return __Pyx_IterFinish(); } /* RaiseClosureNameError */ static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) { PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname); } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* GetItemInt */ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (unlikely(!j)) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_subscript) { PyObject *r, *key = PyInt_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); return r; } if (likely(sm && sm->sq_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return sm->sq_item(o, i); } } #else if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* ObjectGetItem */ #if CYTHON_USE_TYPE_SLOTS static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { PyObject *runerr = NULL; Py_ssize_t key_value; key_value = __Pyx_PyIndex_AsSsize_t(index); if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); } if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index)); PyErr_Clear(); PyErr_Format(PyExc_IndexError, "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name); __Pyx_DECREF_TypeName(index_type_name); } return NULL; } static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { __Pyx_TypeName obj_type_name; if (likely(PyType_Check(obj))) { PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem); if (!meth) { PyErr_Clear(); } else { PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); Py_DECREF(meth); return result; } } obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); return NULL; } static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { PyTypeObject *tp = Py_TYPE(obj); PyMappingMethods *mm = tp->tp_as_mapping; PySequenceMethods *sm = tp->tp_as_sequence; if (likely(mm && mm->mp_subscript)) { return mm->mp_subscript(obj, key); } if (likely(sm && sm->sq_item)) { return __Pyx_PyObject_GetIndex(obj, key); } return __Pyx_PyObject_GetItem_Slow(obj, key); } #endif /* SliceObject */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, int has_cstart, int has_cstop, int wraparound) { __Pyx_TypeName obj_type_name; #if CYTHON_USE_TYPE_SLOTS PyMappingMethods* mp; #if PY_MAJOR_VERSION < 3 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; if (likely(ms && ms->sq_slice)) { if (!has_cstart) { if (_py_start && (*_py_start != Py_None)) { cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstart = 0; } if (!has_cstop) { if (_py_stop && (*_py_stop != Py_None)) { cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstop = PY_SSIZE_T_MAX; } if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { Py_ssize_t l = ms->sq_length(obj); if (likely(l >= 0)) { if (cstop < 0) { cstop += l; if (cstop < 0) cstop = 0; } if (cstart < 0) { cstart += l; if (cstart < 0) cstart = 0; } } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) goto bad; PyErr_Clear(); } } return ms->sq_slice(obj, cstart, cstop); } #else CYTHON_UNUSED_VAR(wraparound); #endif mp = Py_TYPE(obj)->tp_as_mapping; if (likely(mp && mp->mp_subscript)) #else CYTHON_UNUSED_VAR(wraparound); #endif { PyObject* result; PyObject *py_slice, *py_start, *py_stop; if (_py_slice) { py_slice = *_py_slice; } else { PyObject* owned_start = NULL; PyObject* owned_stop = NULL; if (_py_start) { py_start = *_py_start; } else { if (has_cstart) { owned_start = py_start = PyInt_FromSsize_t(cstart); if (unlikely(!py_start)) goto bad; } else py_start = Py_None; } if (_py_stop) { py_stop = *_py_stop; } else { if (has_cstop) { owned_stop = py_stop = PyInt_FromSsize_t(cstop); if (unlikely(!py_stop)) { Py_XDECREF(owned_start); goto bad; } } else py_stop = Py_None; } py_slice = PySlice_New(py_start, py_stop, Py_None); Py_XDECREF(owned_start); Py_XDECREF(owned_stop); if (unlikely(!py_slice)) goto bad; } #if CYTHON_USE_TYPE_SLOTS result = mp->mp_subscript(obj, py_slice); #else result = PyObject_GetItem(obj, py_slice); #endif if (!_py_slice) { Py_DECREF(py_slice); } return result; } obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' object is unsliceable", obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); bad: return NULL; } /* GetTopmostException */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) { _PyErr_StackItem *exc_info = tstate->exc_info; while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && exc_info->previous_item != NULL) { exc_info = exc_info->previous_item; } return exc_info; } #endif /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); PyObject *exc_value = exc_info->exc_value; if (exc_value == NULL || exc_value == Py_None) { *value = NULL; *type = NULL; *tb = NULL; } else { *value = exc_value; Py_INCREF(*value); *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); *tb = PyException_GetTraceback(exc_value); } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); *type = exc_info->exc_type; *value = exc_info->exc_value; *tb = exc_info->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #else *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #endif } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; PyObject *tmp_value = exc_info->exc_value; exc_info->exc_value = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = type; exc_info->exc_value = value; exc_info->exc_traceback = tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } #endif /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* GetException */ #if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) #endif { PyObject *local_type = NULL, *local_value, *local_tb = NULL; #if CYTHON_FAST_THREAD_STATE PyObject *tmp_type, *tmp_value, *tmp_tb; #if PY_VERSION_HEX >= 0x030C00A6 local_value = tstate->current_exception; tstate->current_exception = 0; if (likely(local_value)) { local_type = (PyObject*) Py_TYPE(local_value); Py_INCREF(local_type); local_tb = PyException_GetTraceback(local_value); } #else local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 if (unlikely(tstate->current_exception)) #elif CYTHON_FAST_THREAD_STATE if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE #if CYTHON_USE_EXC_INFO_STACK { _PyErr_StackItem *exc_info = tstate->exc_info; #if PY_VERSION_HEX >= 0x030B00a4 tmp_value = exc_info->exc_value; exc_info->exc_value = local_value; tmp_type = NULL; tmp_tb = NULL; Py_XDECREF(local_type); Py_XDECREF(local_tb); #else tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = local_type; exc_info->exc_value = local_value; exc_info->exc_traceback = local_tb; #endif } #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } /* SwapException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; tmp_value = exc_info->exc_value; exc_info->exc_value = *value; if (tmp_value == NULL || tmp_value == Py_None) { Py_XDECREF(tmp_value); tmp_value = NULL; tmp_type = NULL; tmp_tb = NULL; } else { tmp_type = (PyObject*) Py_TYPE(tmp_value); Py_INCREF(tmp_type); #if CYTHON_COMPILING_IN_CPYTHON tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback; Py_XINCREF(tmp_tb); #else tmp_tb = PyException_GetTraceback(tmp_value); #endif } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = *type; exc_info->exc_value = *value; exc_info->exc_traceback = *tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = *type; tstate->exc_value = *value; tstate->exc_traceback = *tb; #endif *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); PyErr_SetExcInfo(*type, *value, *tb); *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #endif /* PyObjectCall2Args */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args[3] = {NULL, arg1, arg2}; return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP __Pyx_TypeName type_name; PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) #elif PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (likely(descr != NULL)) { *method = descr; return 0; } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(name)); #endif __Pyx_DECREF_TypeName(type_name); return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod1 */ #if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2) static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); Py_DECREF(method); return result; } #endif static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { #if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2 PyObject *args[2] = {obj, arg}; (void) __Pyx_PyObject_GetMethod; (void) __Pyx_PyObject_CallOneArg; (void) __Pyx_PyObject_Call2Args; return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); #else PyObject *method = NULL, *result; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_Call2Args(method, obj, arg); Py_DECREF(method); return result; } if (unlikely(!method)) return NULL; return __Pyx__PyObject_CallMethod1(method, arg); #endif } /* StringJoin */ static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) { (void) __Pyx_PyObject_CallMethod1; #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION < 3 return _PyString_Join(sep, values); #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 return _PyBytes_Join(sep, values); #else return __Pyx_PyObject_CallMethod1(sep, __pyx_n_s_join, values); #endif } /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_CallOneArg(method, obj); Py_DECREF(method); return result; } if (unlikely(!method)) goto bad; result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* ValidateBasesTuple */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; #if CYTHON_ASSUME_SAFE_MACROS n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); if (n < 0) return -1; #endif for (i = 1; i < n; i++) { #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; #elif CYTHON_ASSUME_SAFE_MACROS PyObject *b0 = PyTuple_GET_ITEM(bases, i); #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; #endif PyTypeObject *b; #if PY_MAJOR_VERSION < 3 if (PyClass_Check(b0)) { PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); __Pyx_DECREF_TypeName(b_name); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); if (!py_b_dictoffset) goto dictoffset_return; b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); Py_DECREF(py_b_dictoffset); if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; #endif if (b_dictoffset) { { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "extension type '%.200s' has no __dict__ slot, " "but base type '" __Pyx_FMT_TYPENAME "' has: " "either add 'cdef dict __dict__' to the extension type " "or add '__slots__ = [...]' to the base type", type_name, b_name); __Pyx_DECREF_TypeName(b_name); } #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif } return 0; } #endif /* PyType_Ready */ static int __Pyx_PyType_Ready(PyTypeObject *t) { #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS (void)__Pyx_validate_bases_tuple; #endif return PyType_Ready(t); #else int r; PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 gc_was_enabled = PyGC_Disable(); (void)__Pyx_PyObject_CallMethod0; #else PyObject *ret, *py_status; PyObject *gc = NULL; #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) gc = PyImport_GetModule(__pyx_kp_u_gc); #endif if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); if (unlikely(!gc)) return -1; py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; } gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; } Py_DECREF(ret); } else if (unlikely(gc_was_enabled == -1)) { Py_DECREF(gc); return -1; } #endif t->tp_flags |= Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A0000 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; #endif #else (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) PyGC_Enable(); #else if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); } else { Py_XDECREF(tp); Py_XDECREF(v); Py_XDECREF(tb); r = -1; } } Py_DECREF(gc); #endif } #endif return r; #endif } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, attr_name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(attr_name)); #endif __Pyx_DECREF_TypeName(type_name); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s__12; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u_); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (int) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (int) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = __Pyx_NewRef(v); } val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntFromPy */ static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const size_t neg_one = (size_t) -1, const_zero = (size_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(size_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (size_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(size_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(size_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) >= 2 * PyLong_SHIFT)) { return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } } break; case 3: if ((8 * sizeof(size_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) >= 3 * PyLong_SHIFT)) { return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } } break; case 4: if ((8 * sizeof(size_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) >= 4 * PyLong_SHIFT)) { return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (size_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(size_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(size_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) { return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); } } break; case 2: if ((8 * sizeof(size_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) { return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); } } break; case -3: if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) { return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); } } break; case 3: if ((8 * sizeof(size_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) { return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); } } break; case -4: if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT)) { return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); } } break; case 4: if ((8 * sizeof(size_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT)) { return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); } } break; } } #endif if ((sizeof(size_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(size_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { size_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (size_t) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (size_t) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (size_t) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (size_t) -1; } else { stepval = __Pyx_NewRef(v); } val = (size_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(size_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((size_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(size_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((size_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((size_t) 1) << (sizeof(size_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (size_t) -1; } } else { size_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (size_t) -1; val = __Pyx_PyInt_As_size_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to size_t"); return (size_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to size_t"); return (size_t) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name_2); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__26); } return name; } #endif /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (long) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (long) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = __Pyx_NewRef(v); } val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/platform/freebsd.pyx0000644000076500000240000002124614641074756017753 0ustar00twstaffimport os import stat from .posix import posix_acl_use_stored_uid_gid from ..helpers import safe_encode, safe_decode from .xattr import _listxattr_inner, _getxattr_inner, _setxattr_inner, split_lstring from libc cimport errno API_VERSION = '1.4_01' cdef extern from "sys/extattr.h": ssize_t c_extattr_list_file "extattr_list_file" (const char *path, int attrnamespace, void *data, size_t nbytes) ssize_t c_extattr_list_link "extattr_list_link" (const char *path, int attrnamespace, void *data, size_t nbytes) ssize_t c_extattr_list_fd "extattr_list_fd" (int fd, int attrnamespace, void *data, size_t nbytes) ssize_t c_extattr_get_file "extattr_get_file" (const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes) ssize_t c_extattr_get_link "extattr_get_link" (const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes) ssize_t c_extattr_get_fd "extattr_get_fd" (int fd, int attrnamespace, const char *attrname, void *data, size_t nbytes) int c_extattr_set_file "extattr_set_file" (const char *path, int attrnamespace, const char *attrname, const void *data, size_t nbytes) int c_extattr_set_link "extattr_set_link" (const char *path, int attrnamespace, const char *attrname, const void *data, size_t nbytes) int c_extattr_set_fd "extattr_set_fd" (int fd, int attrnamespace, const char *attrname, const void *data, size_t nbytes) int EXTATTR_NAMESPACE_USER cdef extern from "sys/types.h": int ACL_TYPE_ACCESS int ACL_TYPE_DEFAULT int ACL_TYPE_NFS4 cdef extern from "sys/acl.h": ctypedef struct _acl_t: pass ctypedef _acl_t *acl_t int acl_free(void *obj) acl_t acl_get_link_np(const char *path, int type) acl_t acl_get_fd_np(int fd, int type) int acl_set_link_np(const char *path, int type, acl_t acl) int acl_set_fd_np(int fd, acl_t acl, int type) acl_t acl_from_text(const char *buf) char *acl_to_text_np(acl_t acl, ssize_t *len, int flags) int ACL_TEXT_NUMERIC_IDS int ACL_TEXT_APPEND_ID int acl_extended_link_np(const char * path) # check also: acl_is_trivial_np cdef extern from "unistd.h": long lpathconf(const char *path, int name) int _PC_ACL_NFS4 int _PC_ACL_EXTENDED # On FreeBSD, borg currently only deals with the USER namespace as it is unclear # whether (and if so, how exactly) it should deal with the SYSTEM namespace. NS_ID_MAP = {b"user": EXTATTR_NAMESPACE_USER, } def split_ns(ns_name, default_ns): # split ns_name (which is in the form of b"namespace.name") into namespace and name. # if there is no namespace given in ns_name, default to default_ns. # note: # borg < 1.1.10 on FreeBSD did not prefix the namespace to the names, see #3952. # we also need to deal with "unexpected" namespaces here, they could come # from borg archives made on other operating systems. ns_name_tuple = ns_name.split(b".", 1) if len(ns_name_tuple) == 2: # we have a namespace prefix in the given name ns, name = ns_name_tuple else: # no namespace given in ns_name (== no dot found), maybe data coming from an old borg archive. ns, name = default_ns, ns_name return ns, name def listxattr(path, *, follow_symlinks=False): def func(path, buf, size): if isinstance(path, int): return c_extattr_list_fd(path, ns_id, buf, size) else: if follow_symlinks: return c_extattr_list_file(path, ns_id, buf, size) else: return c_extattr_list_link(path, ns_id, buf, size) ns = b"user" ns_id = NS_ID_MAP[ns] n, buf = _listxattr_inner(func, path) return [ns + b"." + name for name in split_lstring(buf[:n]) if name] def getxattr(path, name, *, follow_symlinks=False): def func(path, name, buf, size): if isinstance(path, int): return c_extattr_get_fd(path, ns_id, name, buf, size) else: if follow_symlinks: return c_extattr_get_file(path, ns_id, name, buf, size) else: return c_extattr_get_link(path, ns_id, name, buf, size) ns, name = split_ns(name, b"user") ns_id = NS_ID_MAP[ns] # this will raise a KeyError it the namespace is unsupported n, buf = _getxattr_inner(func, path, name) return bytes(buf[:n]) def setxattr(path, name, value, *, follow_symlinks=False): def func(path, name, value, size): if isinstance(path, int): return c_extattr_set_fd(path, ns_id, name, value, size) else: if follow_symlinks: return c_extattr_set_file(path, ns_id, name, value, size) else: return c_extattr_set_link(path, ns_id, name, value, size) ns, name = split_ns(name, b"user") try: ns_id = NS_ID_MAP[ns] # this will raise a KeyError it the namespace is unsupported except KeyError: pass else: _setxattr_inner(func, path, name, value) cdef _get_acl(p, type, item, attribute, flags, fd=None): cdef acl_t acl cdef char *text if fd is not None: acl = acl_get_fd_np(fd, type) else: acl = acl_get_link_np(p, type) if acl == NULL: raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(p)) text = acl_to_text_np(acl, NULL, flags) if text == NULL: acl_free(acl) raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(p)) item[attribute] = text acl_free(text) acl_free(acl) def acl_get(path, item, st, numeric_ids=False, fd=None): """Saves ACL Entries If `numeric_ids` is True the user/group field is not preserved only uid/gid """ cdef int flags = ACL_TEXT_APPEND_ID flags |= ACL_TEXT_NUMERIC_IDS if numeric_ids else 0 if isinstance(path, str): path = os.fsencode(path) ret = acl_extended_link_np(path) if ret < 0: raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) if ret == 0: # there is no ACL defining permissions other than those defined by the traditional file permission bits. return ret = lpathconf(path, _PC_ACL_NFS4) if ret < 0: raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) nfs4_acl = ret == 1 if nfs4_acl: _get_acl(path, ACL_TYPE_NFS4, item, 'acl_nfs4', flags, fd=fd) else: _get_acl(path, ACL_TYPE_ACCESS, item, 'acl_access', flags, fd=fd) if stat.S_ISDIR(st.st_mode): _get_acl(path, ACL_TYPE_DEFAULT, item, 'acl_default', flags, fd=fd) cdef _set_acl(p, type, item, attribute, numeric_ids=False, fd=None): cdef acl_t acl text = item.get(attribute) if text: if numeric_ids: if type == ACL_TYPE_NFS4: text = _nfs4_use_stored_uid_gid(text) elif type in (ACL_TYPE_ACCESS, ACL_TYPE_DEFAULT): text = posix_acl_use_stored_uid_gid(text) acl = acl_from_text(text) if acl == NULL: raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(p)) try: if fd is not None: if acl_set_fd_np(fd, acl, type) == -1: raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(p)) else: if acl_set_link_np(p, type, acl) == -1: raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(p)) finally: acl_free(acl) cdef _nfs4_use_stored_uid_gid(acl): """Replace the user/group field with the stored uid/gid """ entries = [] for entry in safe_decode(acl).split('\n'): if entry: if entry.startswith('user:') or entry.startswith('group:'): fields = entry.split(':') entries.append(':'.join(fields[0], fields[5], *fields[2:-1])) else: entries.append(entry) return safe_encode('\n'.join(entries)) def acl_set(path, item, numeric_ids=False, fd=None): """Restore ACL Entries If `numeric_ids` is True the stored uid/gid is used instead of the user/group names """ if isinstance(path, str): path = os.fsencode(path) ret = lpathconf(path, _PC_ACL_NFS4) if ret < 0: raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) if ret == 1: _set_acl(path, ACL_TYPE_NFS4, item, 'acl_nfs4', numeric_ids, fd=fd) ret = lpathconf(path, _PC_ACL_EXTENDED) if ret < 0: raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) if ret == 1: _set_acl(path, ACL_TYPE_ACCESS, item, 'acl_access', numeric_ids, fd=fd) _set_acl(path, ACL_TYPE_DEFAULT, item, 'acl_default', numeric_ids, fd=fd) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719958148.0 borgbackup-1.4.0/src/borg/platform/linux.c0000644000076500000240000321002614641075204017066 0ustar00twstaff/* Generated by Cython 3.0.10 */ /* BEGIN: Cython Metadata { "distutils": { "depends": [], "extra_compile_args": [ "-Wall", "-Wextra", "-Wpointer-arith" ], "libraries": [ "acl" ], "name": "borg.platform.linux", "sources": [ "src/borg/platform/linux.pyx" ] }, "module_name": "borg.platform.linux" } END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_10" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x03000AF0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 1 #endif #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #if PY_VERSION_HEX >= 0x030d00A4 # define __Pyx_PyCFunctionFast PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords #else # define __Pyx_PyCFunctionFast _PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__borg__platform__linux #define __PYX_HAVE_API__borg__platform__linux /* Early includes */ #include #include #include "sys/xattr.h" #include "sys/types.h" #include "sys/acl.h" #include "acl/libacl.h" #include "linux/fs.h" #include "sys/ioctl.h" #include "unistd.h" #include "string.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/borg/platform/linux.pyx", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct__listxattr; struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct_1_getxattr; struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct_2_setxattr; /* "borg/platform/linux.pyx":82 * * * def listxattr(path, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, buf, size): * if isinstance(path, int): */ struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct__listxattr { PyObject_HEAD PyObject *__pyx_v_follow_symlinks; }; /* "borg/platform/linux.pyx":97 * * * def getxattr(path, name, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, name, buf, size): * if isinstance(path, int): */ struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct_1_getxattr { PyObject_HEAD PyObject *__pyx_v_follow_symlinks; }; /* "borg/platform/linux.pyx":111 * * * def setxattr(path, name, value, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, name, value, size): * flags = 0 */ struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct_2_setxattr { PyObject_HEAD PyObject *__pyx_v_follow_symlinks; }; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* RaiseClosureNameError.proto */ static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname); /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* SliceObject.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); /* ListCompAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len)) { Py_INCREF(x); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 L->ob_item[len] = x; #else PyList_SET_ITEM(list, len, x); #endif __Pyx_SET_SIZE(list, len + 1); return 0; } return PyList_Append(list, x); } #else #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) #endif /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* PyObjectCallNoArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* RaiseNoneIterError.proto */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); /* UnpackTupleError.proto */ static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /* UnpackTuple2.proto */ #define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\ (likely(is_tuple || PyTuple_Check(tuple)) ?\ (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\ __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\ (__Pyx_UnpackTupleError(tuple, 2), -1)) :\ __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple)) static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple); static int __Pyx_unpack_tuple2_generic( PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple); /* dict_iter.proto */ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name, Py_ssize_t* p_orig_length, int* p_is_dict); static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); /* decode_c_string_utf16.proto */ static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) { int byteorder = 0; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) { int byteorder = -1; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) { int byteorder = 1; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } /* decode_c_string.proto */ static CYTHON_INLINE PyObject* __Pyx_decode_c_string( const char* cstring, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* SwapException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif /* GetTopmostException.proto */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); #endif /* SaveResetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* StrEquals.proto */ #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals #else #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals #endif /* PyObject_Str.proto */ #define __Pyx_PyObject_Str(obj)\ (likely(PyString_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj)) /* SetItemInt.proto */ #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\ __Pyx_SetItemInt_Generic(o, to_py_func(i), v))) static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v); static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list, int wraparound, int boundscheck); /* ListAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 L->ob_item[len] = x; #else PyList_SET_ITEM(list, len, x); #endif __Pyx_SET_SIZE(list, len + 1); return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif /* PyObjectCall2Args.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* PyObjectCallMethod1.proto */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); /* StringJoin.proto */ #if PY_MAJOR_VERSION < 3 #define __Pyx_PyString_Join __Pyx_PyBytes_Join #define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v)) #else #define __Pyx_PyString_Join PyUnicode_Join #define __Pyx_PyBaseString_Join PyUnicode_Join #endif static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); /* AssertionsEnabled.proto */ #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define __Pyx_init_assertions_enabled() (0) #define __pyx_assertions_enabled() (1) #elif CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030C0000) static int __pyx_assertions_enabled_flag; #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag) static int __Pyx_init_assertions_enabled(void) { PyObject *builtins, *debug, *debug_str; int flag; builtins = PyEval_GetBuiltins(); if (!builtins) goto bad; debug_str = PyUnicode_FromStringAndSize("__debug__", 9); if (!debug_str) goto bad; debug = PyObject_GetItem(builtins, debug_str); Py_DECREF(debug_str); if (!debug) goto bad; flag = PyObject_IsTrue(debug); Py_DECREF(debug); if (flag == -1) goto bad; __pyx_assertions_enabled_flag = flag; return 0; bad: __pyx_assertions_enabled_flag = 1; return -1; } #else #define __Pyx_init_assertions_enabled() (0) #define __pyx_assertions_enabled() (!Py_OptimizeFlag) #endif /* PyIntCompare.proto */ static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace); /* PyIntCompare.proto */ static CYTHON_INLINE int __Pyx_PyInt_BoolNeObjC(PyObject *op1, PyObject *op2, long intval, long inplace); /* PyObjectSetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); #else #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif /* ValidateBasesTuple.proto */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); #endif /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* PySequenceContains.proto */ static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { int result = PySequence_Contains(seq, item); return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } /* Py3UpdateBases.proto */ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases); /* CalculateMetaclass.proto */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); /* PyObjectLookupSpecial.proto */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0) #define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1) static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error); #else #define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n) #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) #endif /* Py3ClassCreate.proto */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc); static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /* SetNameInClass.proto */ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) #elif CYTHON_COMPILING_IN_CPYTHON #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value)) #else #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) #endif /* CyFunctionClassCell.proto */ static int __Pyx_CyFunction_InitClassCell(PyObject *cyfunctions, PyObject *classobj); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc" */ /* Module declarations from "libc.errno" */ /* Module declarations from "libc.stdint" */ /* Module declarations from "borg.platform.linux" */ static unsigned int __pyx_v_4borg_8platform_5linux_PAGE_MASK; static PyObject *__pyx_f_4borg_8platform_5linux_acl_append_numeric_ids(PyObject *); /*proto*/ static PyObject *__pyx_f_4borg_8platform_5linux_acl_numeric_ids(PyObject *); /*proto*/ static PyObject *__pyx_f_4borg_8platform_5linux__sync_file_range(PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "borg.platform.linux" extern int __pyx_module_is_main_borg__platform__linux; int __pyx_module_is_main_borg__platform__linux = 0; /* Implementation of "borg.platform.linux" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_ImportError; static PyObject *__pyx_builtin_OSError; static PyObject *__pyx_builtin_AssertionError; static PyObject *__pyx_builtin_super; /* #### Code section: string_decls ### */ static const char __pyx_k_M[] = "M"; static const char __pyx_k_f[] = "f"; static const char __pyx_k_n[] = "n"; static const char __pyx_k__7[] = "\n"; static const char __pyx_k__8[] = ":"; static const char __pyx_k_fd[] = "fd"; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k_os[] = "os"; static const char __pyx_k_re[] = "re"; static const char __pyx_k_st[] = "st"; static const char __pyx_k__10[] = ""; static const char __pyx_k__12[] = "*"; static const char __pyx_k__13[] = "."; static const char __pyx_k__14[] = " *#.*"; static const char __pyx_k__39[] = "?"; static const char __pyx_k_acl[] = "acl"; static const char __pyx_k_buf[] = "buf"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_get[] = "get"; static const char __pyx_k_ret[] = "ret"; static const char __pyx_k_sub[] = "sub"; static const char __pyx_k_base[] = "base"; static const char __pyx_k_data[] = "data"; static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_func[] = "func"; static const char __pyx_k_init[] = "__init__"; static const char __pyx_k_item[] = "item"; static const char __pyx_k_join[] = "join"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_mode[] = "mode"; static const char __pyx_k_name[] = "name"; static const char __pyx_k_open[] = "open"; static const char __pyx_k_path[] = "path"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_size[] = "size"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_stat[] = "stat"; static const char __pyx_k_sync[] = "sync"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_user[] = "user"; static const char __pyx_k_close[] = "close"; static const char __pyx_k_entry[] = "entry"; static const char __pyx_k_flags[] = "flags"; static const char __pyx_k_flush[] = "flush"; static const char __pyx_k_group[] = "group"; static const char __pyx_k_items[] = "items"; static const char __pyx_k_posix[] = "posix"; static const char __pyx_k_split[] = "split"; static const char __pyx_k_super[] = "super"; static const char __pyx_k_value[] = "value"; static const char __pyx_k_write[] = "write"; static const char __pyx_k_xattr[] = "xattr"; static const char __pyx_k_1_4_01[] = "1.4_01"; static const char __pyx_k_binary[] = "binary"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_fields[] = "fields"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_module[] = "__module__"; static const char __pyx_k_name_2[] = "__name__"; static const char __pyx_k_offset[] = "offset"; static const char __pyx_k_OSError[] = "OSError"; static const char __pyx_k_S_ISBLK[] = "S_ISBLK"; static const char __pyx_k_S_ISCHR[] = "S_ISCHR"; static const char __pyx_k_S_ISDIR[] = "S_ISDIR"; static const char __pyx_k_S_ISLNK[] = "S_ISLNK"; static const char __pyx_k_acl_get[] = "acl_get"; static const char __pyx_k_acl_set[] = "acl_set"; static const char __pyx_k_compile[] = "compile"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_entries[] = "entries"; static const char __pyx_k_helpers[] = "helpers"; static const char __pyx_k_open_fd[] = "open_fd"; static const char __pyx_k_prepare[] = "__prepare__"; static const char __pyx_k_st_mode[] = "st_mode"; static const char __pyx_k_DONTNEED[] = "DONTNEED"; static const char __pyx_k_O_RDONLY[] = "O_RDONLY"; static const char __pyx_k_SyncFile[] = "SyncFile"; static const char __pyx_k_bsd_flag[] = "bsd_flag"; static const char __pyx_k_fsdecode[] = "fsdecode"; static const char __pyx_k_fsencode[] = "fsencode"; static const char __pyx_k_getxattr[] = "getxattr"; static const char __pyx_k_qualname[] = "__qualname__"; static const char __pyx_k_set_name[] = "__set_name__"; static const char __pyx_k_setxattr[] = "setxattr"; static const char __pyx_k_strerror[] = "strerror"; static const char __pyx_k_user2uid[] = "user2uid"; static const char __pyx_k_UF_APPEND[] = "UF_APPEND"; static const char __pyx_k_UF_NODUMP[] = "UF_NODUMP"; static const char __pyx_k_bsd_flags[] = "bsd_flags"; static const char __pyx_k_converter[] = "converter"; static const char __pyx_k_fdatasync[] = "fdatasync"; static const char __pyx_k_get_flags[] = "get_flags"; static const char __pyx_k_group2gid[] = "group2gid"; static const char __pyx_k_isenabled[] = "isenabled"; static const char __pyx_k_last_sync[] = "last_sync"; static const char __pyx_k_listxattr[] = "listxattr"; static const char __pyx_k_metaclass[] = "__metaclass__"; static const char __pyx_k_set_flags[] = "set_flags"; static const char __pyx_k_O_NOFOLLOW[] = "O_NOFOLLOW"; static const char __pyx_k_O_NONBLOCK[] = "O_NONBLOCK"; static const char __pyx_k_access_acl[] = "access_acl"; static const char __pyx_k_acl_access[] = "acl_access"; static const char __pyx_k_comment_re[] = "_comment_re"; static const char __pyx_k_linux_flag[] = "linux_flag"; static const char __pyx_k_startswith[] = "startswith"; static const char __pyx_k_subprocess[] = "subprocess"; static const char __pyx_k_API_VERSION[] = "API_VERSION"; static const char __pyx_k_ImportError[] = "ImportError"; static const char __pyx_k_access_text[] = "access_text"; static const char __pyx_k_acl_default[] = "acl_default"; static const char __pyx_k_default_acl[] = "default_acl"; static const char __pyx_k_linux_flags[] = "linux_flags"; static const char __pyx_k_mro_entries[] = "__mro_entries__"; static const char __pyx_k_numeric_ids[] = "numeric_ids"; static const char __pyx_k_safe_decode[] = "safe_decode"; static const char __pyx_k_safe_encode[] = "safe_encode"; static const char __pyx_k_workarounds[] = "workarounds"; static const char __pyx_k_BaseSyncFile[] = "BaseSyncFile"; static const char __pyx_k_UF_IMMUTABLE[] = "UF_IMMUTABLE"; static const char __pyx_k_basesyncfile[] = "basesyncfile"; static const char __pyx_k_default_text[] = "default_text"; static const char __pyx_k_error_number[] = "error_number"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_pending_sync[] = "pending_sync"; static const char __pyx_k_safe_fadvise[] = "safe_fadvise"; static const char __pyx_k_write_window[] = "write_window"; static const char __pyx_k_SyncFile_sync[] = "SyncFile.sync"; static const char __pyx_k_UF_COMPRESSED[] = "UF_COMPRESSED"; static const char __pyx_k_init_subclass[] = "__init_subclass__"; static const char __pyx_k_split_string0[] = "split_string0"; static const char __pyx_k_syncfilerange[] = "syncfilerange"; static const char __pyx_k_AssertionError[] = "AssertionError"; static const char __pyx_k_SyncFile_write[] = "SyncFile.write"; static const char __pyx_k_getxattr_inner[] = "_getxattr_inner"; static const char __pyx_k_setxattr_inner[] = "_setxattr_inner"; static const char __pyx_k_SyncFile___init[] = "SyncFile.__init__"; static const char __pyx_k_follow_symlinks[] = "follow_symlinks"; static const char __pyx_k_listxattr_inner[] = "_listxattr_inner"; static const char __pyx_k_sync_file_range[] = "sync_file_range"; static const char __pyx_k_system_posix_acl[] = "system.posix_acl_"; static const char __pyx_k_BSD_TO_LINUX_FLAGS[] = "BSD_TO_LINUX_FLAGS"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_borg_platform_linux[] = "borg.platform.linux"; static const char __pyx_k_getxattr_locals_func[] = "getxattr..func"; static const char __pyx_k_setxattr_locals_func[] = "setxattr..func"; static const char __pyx_k_SYNC_FILE_RANGE_WRITE[] = "SYNC_FILE_RANGE_WRITE"; static const char __pyx_k_acl_use_local_uid_gid[] = "acl_use_local_uid_gid"; static const char __pyx_k_listxattr_locals_func[] = "listxattr..func"; static const char __pyx_k_SYNC_FILE_RANGE_LOADED[] = "SYNC_FILE_RANGE_LOADED"; static const char __pyx_k_length_d_not_page_aligned[] = "length %d not page-aligned"; static const char __pyx_k_offset_d_not_page_aligned[] = "offset %d not page-aligned"; static const char __pyx_k_SYNC_FILE_RANGE_WAIT_AFTER[] = "SYNC_FILE_RANGE_WAIT_AFTER"; static const char __pyx_k_SYNC_FILE_RANGE_WAIT_BEFORE[] = "SYNC_FILE_RANGE_WAIT_BEFORE"; static const char __pyx_k_src_borg_platform_linux_pyx[] = "src/borg/platform/linux.pyx"; static const char __pyx_k_posix_acl_use_stored_uid_gid[] = "posix_acl_use_stored_uid_gid"; static const char __pyx_k_Implemented_using_sync_file_ran[] = "\n Implemented using sync_file_range for asynchronous write-out and fdatasync for actual durability.\n\n \"write-out\" means that dirty pages (= data that was written) are submitted to an I/O queue and will be send to\n disk in the immediate future.\n "; /* #### Code section: decls ### */ static PyObject *__pyx_pf_4borg_8platform_5linux_9listxattr_func(PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_buf, PyObject *__pyx_v_size); /* proto */ static PyObject *__pyx_pf_4borg_8platform_5linux_listxattr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_follow_symlinks); /* proto */ static PyObject *__pyx_pf_4borg_8platform_5linux_8getxattr_func(PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_name, PyObject *__pyx_v_buf, PyObject *__pyx_v_size); /* proto */ static PyObject *__pyx_pf_4borg_8platform_5linux_2getxattr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_name, PyObject *__pyx_v_follow_symlinks); /* proto */ static PyObject *__pyx_pf_4borg_8platform_5linux_8setxattr_func(PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_name, PyObject *__pyx_v_value, PyObject *__pyx_v_size); /* proto */ static PyObject *__pyx_pf_4borg_8platform_5linux_4setxattr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_name, PyObject *__pyx_v_value, PyObject *__pyx_v_follow_symlinks); /* proto */ static PyObject *__pyx_pf_4borg_8platform_5linux_6set_flags(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_bsd_flags, PyObject *__pyx_v_fd); /* proto */ static PyObject *__pyx_pf_4borg_8platform_5linux_8get_flags(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_st, PyObject *__pyx_v_fd); /* proto */ static PyObject *__pyx_pf_4borg_8platform_5linux_10acl_use_local_uid_gid(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_acl); /* proto */ static PyObject *__pyx_pf_4borg_8platform_5linux_12acl_get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_item, PyObject *__pyx_v_st, PyObject *__pyx_v_numeric_ids, PyObject *__pyx_v_fd); /* proto */ static PyObject *__pyx_pf_4borg_8platform_5linux_14acl_set(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_item, PyObject *__pyx_v_numeric_ids, PyObject *__pyx_v_fd); /* proto */ static PyObject *__pyx_pf_4borg_8platform_5linux_8SyncFile___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_fd, PyObject *__pyx_v_binary); /* proto */ static PyObject *__pyx_pf_4borg_8platform_5linux_8SyncFile_2write(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_4borg_8platform_5linux_8SyncFile_4sync(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_tp_new_4borg_8platform_5linux___pyx_scope_struct__listxattr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_4borg_8platform_5linux___pyx_scope_struct_1_getxattr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_4borg_8platform_5linux___pyx_scope_struct_2_setxattr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE PyObject *__pyx_type_4borg_8platform_5linux___pyx_scope_struct__listxattr; PyObject *__pyx_type_4borg_8platform_5linux___pyx_scope_struct_1_getxattr; PyObject *__pyx_type_4borg_8platform_5linux___pyx_scope_struct_2_setxattr; #endif PyTypeObject *__pyx_ptype_4borg_8platform_5linux___pyx_scope_struct__listxattr; PyTypeObject *__pyx_ptype_4borg_8platform_5linux___pyx_scope_struct_1_getxattr; PyTypeObject *__pyx_ptype_4borg_8platform_5linux___pyx_scope_struct_2_setxattr; PyObject *__pyx_kp_s_1_4_01; PyObject *__pyx_n_s_API_VERSION; PyObject *__pyx_n_s_AssertionError; PyObject *__pyx_n_s_BSD_TO_LINUX_FLAGS; PyObject *__pyx_n_s_BaseSyncFile; PyObject *__pyx_n_s_DONTNEED; PyObject *__pyx_kp_s_Implemented_using_sync_file_ran; PyObject *__pyx_n_s_ImportError; PyObject *__pyx_n_s_M; PyObject *__pyx_n_s_OSError; PyObject *__pyx_n_s_O_NOFOLLOW; PyObject *__pyx_n_s_O_NONBLOCK; PyObject *__pyx_n_s_O_RDONLY; PyObject *__pyx_n_s_SYNC_FILE_RANGE_LOADED; PyObject *__pyx_n_s_SYNC_FILE_RANGE_WAIT_AFTER; PyObject *__pyx_n_s_SYNC_FILE_RANGE_WAIT_BEFORE; PyObject *__pyx_n_s_SYNC_FILE_RANGE_WRITE; PyObject *__pyx_n_s_S_ISBLK; PyObject *__pyx_n_s_S_ISCHR; PyObject *__pyx_n_s_S_ISDIR; PyObject *__pyx_n_s_S_ISLNK; PyObject *__pyx_n_s_SyncFile; PyObject *__pyx_n_s_SyncFile___init; PyObject *__pyx_n_s_SyncFile_sync; PyObject *__pyx_n_s_SyncFile_write; PyObject *__pyx_n_s_UF_APPEND; PyObject *__pyx_n_s_UF_COMPRESSED; PyObject *__pyx_n_s_UF_IMMUTABLE; PyObject *__pyx_n_s_UF_NODUMP; PyObject *__pyx_kp_s__10; PyObject *__pyx_n_s__12; PyObject *__pyx_kp_u__13; PyObject *__pyx_kp_s__14; PyObject *__pyx_n_s__39; PyObject *__pyx_kp_s__7; PyObject *__pyx_kp_s__8; PyObject *__pyx_n_s_access_acl; PyObject *__pyx_n_s_access_text; PyObject *__pyx_n_s_acl; PyObject *__pyx_n_s_acl_access; PyObject *__pyx_n_s_acl_default; PyObject *__pyx_n_s_acl_get; PyObject *__pyx_n_s_acl_set; PyObject *__pyx_n_s_acl_use_local_uid_gid; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_base; PyObject *__pyx_n_s_basesyncfile; PyObject *__pyx_n_s_binary; PyObject *__pyx_n_s_borg_platform_linux; PyObject *__pyx_n_s_bsd_flag; PyObject *__pyx_n_s_bsd_flags; PyObject *__pyx_n_s_buf; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_close; PyObject *__pyx_n_s_comment_re; PyObject *__pyx_n_s_compile; PyObject *__pyx_n_s_converter; PyObject *__pyx_n_s_data; PyObject *__pyx_n_s_default_acl; PyObject *__pyx_n_s_default_text; PyObject *__pyx_n_s_dict; PyObject *__pyx_kp_u_disable; PyObject *__pyx_n_s_doc; PyObject *__pyx_kp_u_enable; PyObject *__pyx_n_s_entries; PyObject *__pyx_n_s_entry; PyObject *__pyx_n_s_error_number; PyObject *__pyx_n_s_f; PyObject *__pyx_n_s_fd; PyObject *__pyx_n_s_fdatasync; PyObject *__pyx_n_s_fields; PyObject *__pyx_n_s_flags; PyObject *__pyx_n_s_flush; PyObject *__pyx_n_s_follow_symlinks; PyObject *__pyx_n_s_fsdecode; PyObject *__pyx_n_s_fsencode; PyObject *__pyx_n_s_func; PyObject *__pyx_kp_u_gc; PyObject *__pyx_n_s_get; PyObject *__pyx_n_s_get_flags; PyObject *__pyx_n_s_getxattr; PyObject *__pyx_n_s_getxattr_inner; PyObject *__pyx_n_s_getxattr_locals_func; PyObject *__pyx_n_s_group; PyObject *__pyx_n_s_group2gid; PyObject *__pyx_n_s_helpers; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_init; PyObject *__pyx_n_s_init_subclass; PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_kp_u_isenabled; PyObject *__pyx_n_s_item; PyObject *__pyx_n_s_items; PyObject *__pyx_n_s_join; PyObject *__pyx_n_s_last_sync; PyObject *__pyx_kp_s_length_d_not_page_aligned; PyObject *__pyx_n_s_linux_flag; PyObject *__pyx_n_s_linux_flags; PyObject *__pyx_n_s_listxattr; PyObject *__pyx_n_s_listxattr_inner; PyObject *__pyx_n_s_listxattr_locals_func; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_metaclass; PyObject *__pyx_n_s_mode; PyObject *__pyx_n_s_module; PyObject *__pyx_n_s_mro_entries; PyObject *__pyx_n_s_n; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_name_2; PyObject *__pyx_n_s_numeric_ids; PyObject *__pyx_n_s_offset; PyObject *__pyx_kp_s_offset_d_not_page_aligned; PyObject *__pyx_n_s_open; PyObject *__pyx_n_s_open_fd; PyObject *__pyx_n_s_os; PyObject *__pyx_n_s_path; PyObject *__pyx_n_s_pending_sync; PyObject *__pyx_n_s_posix; PyObject *__pyx_n_s_posix_acl_use_stored_uid_gid; PyObject *__pyx_n_s_prepare; PyObject *__pyx_n_s_qualname; PyObject *__pyx_n_s_re; PyObject *__pyx_n_s_ret; PyObject *__pyx_n_s_safe_decode; PyObject *__pyx_n_s_safe_encode; PyObject *__pyx_n_s_safe_fadvise; PyObject *__pyx_n_s_self; PyObject *__pyx_n_s_set_flags; PyObject *__pyx_n_s_set_name; PyObject *__pyx_n_s_setxattr; PyObject *__pyx_n_s_setxattr_inner; PyObject *__pyx_n_s_setxattr_locals_func; PyObject *__pyx_n_s_size; PyObject *__pyx_n_s_spec; PyObject *__pyx_n_s_split; PyObject *__pyx_n_s_split_string0; PyObject *__pyx_kp_s_src_borg_platform_linux_pyx; PyObject *__pyx_n_s_st; PyObject *__pyx_n_s_st_mode; PyObject *__pyx_n_s_startswith; PyObject *__pyx_n_s_stat; PyObject *__pyx_n_s_strerror; PyObject *__pyx_n_s_sub; PyObject *__pyx_n_s_subprocess; PyObject *__pyx_n_s_super; PyObject *__pyx_n_s_sync; PyObject *__pyx_n_s_sync_file_range; PyObject *__pyx_n_s_syncfilerange; PyObject *__pyx_kp_b_system_posix_acl; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_user; PyObject *__pyx_n_s_user2uid; PyObject *__pyx_n_s_value; PyObject *__pyx_n_s_workarounds; PyObject *__pyx_n_s_write; PyObject *__pyx_n_s_write_window; PyObject *__pyx_n_s_xattr; PyObject *__pyx_int_0; PyObject *__pyx_int_3; PyObject *__pyx_tuple_; PyObject *__pyx_slice__9; PyObject *__pyx_tuple__3; PyObject *__pyx_tuple__5; PyObject *__pyx_tuple__11; PyObject *__pyx_tuple__15; PyObject *__pyx_tuple__17; PyObject *__pyx_tuple__19; PyObject *__pyx_tuple__21; PyObject *__pyx_tuple__23; PyObject *__pyx_tuple__24; PyObject *__pyx_tuple__26; PyObject *__pyx_tuple__28; PyObject *__pyx_tuple__30; PyObject *__pyx_tuple__31; PyObject *__pyx_tuple__33; PyObject *__pyx_tuple__35; PyObject *__pyx_tuple__37; PyObject *__pyx_codeobj__2; PyObject *__pyx_codeobj__4; PyObject *__pyx_codeobj__6; PyObject *__pyx_codeobj__16; PyObject *__pyx_codeobj__18; PyObject *__pyx_codeobj__20; PyObject *__pyx_codeobj__22; PyObject *__pyx_codeobj__25; PyObject *__pyx_codeobj__27; PyObject *__pyx_codeobj__29; PyObject *__pyx_codeobj__32; PyObject *__pyx_codeobj__34; PyObject *__pyx_codeobj__36; PyObject *__pyx_codeobj__38; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_4borg_8platform_5linux___pyx_scope_struct__listxattr); Py_CLEAR(clear_module_state->__pyx_type_4borg_8platform_5linux___pyx_scope_struct__listxattr); Py_CLEAR(clear_module_state->__pyx_ptype_4borg_8platform_5linux___pyx_scope_struct_1_getxattr); Py_CLEAR(clear_module_state->__pyx_type_4borg_8platform_5linux___pyx_scope_struct_1_getxattr); Py_CLEAR(clear_module_state->__pyx_ptype_4borg_8platform_5linux___pyx_scope_struct_2_setxattr); Py_CLEAR(clear_module_state->__pyx_type_4borg_8platform_5linux___pyx_scope_struct_2_setxattr); Py_CLEAR(clear_module_state->__pyx_kp_s_1_4_01); Py_CLEAR(clear_module_state->__pyx_n_s_API_VERSION); Py_CLEAR(clear_module_state->__pyx_n_s_AssertionError); Py_CLEAR(clear_module_state->__pyx_n_s_BSD_TO_LINUX_FLAGS); Py_CLEAR(clear_module_state->__pyx_n_s_BaseSyncFile); Py_CLEAR(clear_module_state->__pyx_n_s_DONTNEED); Py_CLEAR(clear_module_state->__pyx_kp_s_Implemented_using_sync_file_ran); Py_CLEAR(clear_module_state->__pyx_n_s_ImportError); Py_CLEAR(clear_module_state->__pyx_n_s_M); Py_CLEAR(clear_module_state->__pyx_n_s_OSError); Py_CLEAR(clear_module_state->__pyx_n_s_O_NOFOLLOW); Py_CLEAR(clear_module_state->__pyx_n_s_O_NONBLOCK); Py_CLEAR(clear_module_state->__pyx_n_s_O_RDONLY); Py_CLEAR(clear_module_state->__pyx_n_s_SYNC_FILE_RANGE_LOADED); Py_CLEAR(clear_module_state->__pyx_n_s_SYNC_FILE_RANGE_WAIT_AFTER); Py_CLEAR(clear_module_state->__pyx_n_s_SYNC_FILE_RANGE_WAIT_BEFORE); Py_CLEAR(clear_module_state->__pyx_n_s_SYNC_FILE_RANGE_WRITE); Py_CLEAR(clear_module_state->__pyx_n_s_S_ISBLK); Py_CLEAR(clear_module_state->__pyx_n_s_S_ISCHR); Py_CLEAR(clear_module_state->__pyx_n_s_S_ISDIR); Py_CLEAR(clear_module_state->__pyx_n_s_S_ISLNK); Py_CLEAR(clear_module_state->__pyx_n_s_SyncFile); Py_CLEAR(clear_module_state->__pyx_n_s_SyncFile___init); Py_CLEAR(clear_module_state->__pyx_n_s_SyncFile_sync); Py_CLEAR(clear_module_state->__pyx_n_s_SyncFile_write); Py_CLEAR(clear_module_state->__pyx_n_s_UF_APPEND); Py_CLEAR(clear_module_state->__pyx_n_s_UF_COMPRESSED); Py_CLEAR(clear_module_state->__pyx_n_s_UF_IMMUTABLE); Py_CLEAR(clear_module_state->__pyx_n_s_UF_NODUMP); Py_CLEAR(clear_module_state->__pyx_kp_s__10); Py_CLEAR(clear_module_state->__pyx_n_s__12); Py_CLEAR(clear_module_state->__pyx_kp_u__13); Py_CLEAR(clear_module_state->__pyx_kp_s__14); Py_CLEAR(clear_module_state->__pyx_n_s__39); Py_CLEAR(clear_module_state->__pyx_kp_s__7); Py_CLEAR(clear_module_state->__pyx_kp_s__8); Py_CLEAR(clear_module_state->__pyx_n_s_access_acl); Py_CLEAR(clear_module_state->__pyx_n_s_access_text); Py_CLEAR(clear_module_state->__pyx_n_s_acl); Py_CLEAR(clear_module_state->__pyx_n_s_acl_access); Py_CLEAR(clear_module_state->__pyx_n_s_acl_default); Py_CLEAR(clear_module_state->__pyx_n_s_acl_get); Py_CLEAR(clear_module_state->__pyx_n_s_acl_set); Py_CLEAR(clear_module_state->__pyx_n_s_acl_use_local_uid_gid); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_base); Py_CLEAR(clear_module_state->__pyx_n_s_basesyncfile); Py_CLEAR(clear_module_state->__pyx_n_s_binary); Py_CLEAR(clear_module_state->__pyx_n_s_borg_platform_linux); Py_CLEAR(clear_module_state->__pyx_n_s_bsd_flag); Py_CLEAR(clear_module_state->__pyx_n_s_bsd_flags); Py_CLEAR(clear_module_state->__pyx_n_s_buf); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_close); Py_CLEAR(clear_module_state->__pyx_n_s_comment_re); Py_CLEAR(clear_module_state->__pyx_n_s_compile); Py_CLEAR(clear_module_state->__pyx_n_s_converter); Py_CLEAR(clear_module_state->__pyx_n_s_data); Py_CLEAR(clear_module_state->__pyx_n_s_default_acl); Py_CLEAR(clear_module_state->__pyx_n_s_default_text); Py_CLEAR(clear_module_state->__pyx_n_s_dict); Py_CLEAR(clear_module_state->__pyx_kp_u_disable); Py_CLEAR(clear_module_state->__pyx_n_s_doc); Py_CLEAR(clear_module_state->__pyx_kp_u_enable); Py_CLEAR(clear_module_state->__pyx_n_s_entries); Py_CLEAR(clear_module_state->__pyx_n_s_entry); Py_CLEAR(clear_module_state->__pyx_n_s_error_number); Py_CLEAR(clear_module_state->__pyx_n_s_f); Py_CLEAR(clear_module_state->__pyx_n_s_fd); Py_CLEAR(clear_module_state->__pyx_n_s_fdatasync); Py_CLEAR(clear_module_state->__pyx_n_s_fields); Py_CLEAR(clear_module_state->__pyx_n_s_flags); Py_CLEAR(clear_module_state->__pyx_n_s_flush); Py_CLEAR(clear_module_state->__pyx_n_s_follow_symlinks); Py_CLEAR(clear_module_state->__pyx_n_s_fsdecode); Py_CLEAR(clear_module_state->__pyx_n_s_fsencode); Py_CLEAR(clear_module_state->__pyx_n_s_func); Py_CLEAR(clear_module_state->__pyx_kp_u_gc); Py_CLEAR(clear_module_state->__pyx_n_s_get); Py_CLEAR(clear_module_state->__pyx_n_s_get_flags); Py_CLEAR(clear_module_state->__pyx_n_s_getxattr); Py_CLEAR(clear_module_state->__pyx_n_s_getxattr_inner); Py_CLEAR(clear_module_state->__pyx_n_s_getxattr_locals_func); Py_CLEAR(clear_module_state->__pyx_n_s_group); Py_CLEAR(clear_module_state->__pyx_n_s_group2gid); Py_CLEAR(clear_module_state->__pyx_n_s_helpers); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_init); Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); Py_CLEAR(clear_module_state->__pyx_n_s_item); Py_CLEAR(clear_module_state->__pyx_n_s_items); Py_CLEAR(clear_module_state->__pyx_n_s_join); Py_CLEAR(clear_module_state->__pyx_n_s_last_sync); Py_CLEAR(clear_module_state->__pyx_kp_s_length_d_not_page_aligned); Py_CLEAR(clear_module_state->__pyx_n_s_linux_flag); Py_CLEAR(clear_module_state->__pyx_n_s_linux_flags); Py_CLEAR(clear_module_state->__pyx_n_s_listxattr); Py_CLEAR(clear_module_state->__pyx_n_s_listxattr_inner); Py_CLEAR(clear_module_state->__pyx_n_s_listxattr_locals_func); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_metaclass); Py_CLEAR(clear_module_state->__pyx_n_s_mode); Py_CLEAR(clear_module_state->__pyx_n_s_module); Py_CLEAR(clear_module_state->__pyx_n_s_mro_entries); Py_CLEAR(clear_module_state->__pyx_n_s_n); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_name_2); Py_CLEAR(clear_module_state->__pyx_n_s_numeric_ids); Py_CLEAR(clear_module_state->__pyx_n_s_offset); Py_CLEAR(clear_module_state->__pyx_kp_s_offset_d_not_page_aligned); Py_CLEAR(clear_module_state->__pyx_n_s_open); Py_CLEAR(clear_module_state->__pyx_n_s_open_fd); Py_CLEAR(clear_module_state->__pyx_n_s_os); Py_CLEAR(clear_module_state->__pyx_n_s_path); Py_CLEAR(clear_module_state->__pyx_n_s_pending_sync); Py_CLEAR(clear_module_state->__pyx_n_s_posix); Py_CLEAR(clear_module_state->__pyx_n_s_posix_acl_use_stored_uid_gid); Py_CLEAR(clear_module_state->__pyx_n_s_prepare); Py_CLEAR(clear_module_state->__pyx_n_s_qualname); Py_CLEAR(clear_module_state->__pyx_n_s_re); Py_CLEAR(clear_module_state->__pyx_n_s_ret); Py_CLEAR(clear_module_state->__pyx_n_s_safe_decode); Py_CLEAR(clear_module_state->__pyx_n_s_safe_encode); Py_CLEAR(clear_module_state->__pyx_n_s_safe_fadvise); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_n_s_set_flags); Py_CLEAR(clear_module_state->__pyx_n_s_set_name); Py_CLEAR(clear_module_state->__pyx_n_s_setxattr); Py_CLEAR(clear_module_state->__pyx_n_s_setxattr_inner); Py_CLEAR(clear_module_state->__pyx_n_s_setxattr_locals_func); Py_CLEAR(clear_module_state->__pyx_n_s_size); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_n_s_split); Py_CLEAR(clear_module_state->__pyx_n_s_split_string0); Py_CLEAR(clear_module_state->__pyx_kp_s_src_borg_platform_linux_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_st); Py_CLEAR(clear_module_state->__pyx_n_s_st_mode); Py_CLEAR(clear_module_state->__pyx_n_s_startswith); Py_CLEAR(clear_module_state->__pyx_n_s_stat); Py_CLEAR(clear_module_state->__pyx_n_s_strerror); Py_CLEAR(clear_module_state->__pyx_n_s_sub); Py_CLEAR(clear_module_state->__pyx_n_s_subprocess); Py_CLEAR(clear_module_state->__pyx_n_s_super); Py_CLEAR(clear_module_state->__pyx_n_s_sync); Py_CLEAR(clear_module_state->__pyx_n_s_sync_file_range); Py_CLEAR(clear_module_state->__pyx_n_s_syncfilerange); Py_CLEAR(clear_module_state->__pyx_kp_b_system_posix_acl); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_user); Py_CLEAR(clear_module_state->__pyx_n_s_user2uid); Py_CLEAR(clear_module_state->__pyx_n_s_value); Py_CLEAR(clear_module_state->__pyx_n_s_workarounds); Py_CLEAR(clear_module_state->__pyx_n_s_write); Py_CLEAR(clear_module_state->__pyx_n_s_write_window); Py_CLEAR(clear_module_state->__pyx_n_s_xattr); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_3); Py_CLEAR(clear_module_state->__pyx_tuple_); Py_CLEAR(clear_module_state->__pyx_slice__9); Py_CLEAR(clear_module_state->__pyx_tuple__3); Py_CLEAR(clear_module_state->__pyx_tuple__5); Py_CLEAR(clear_module_state->__pyx_tuple__11); Py_CLEAR(clear_module_state->__pyx_tuple__15); Py_CLEAR(clear_module_state->__pyx_tuple__17); Py_CLEAR(clear_module_state->__pyx_tuple__19); Py_CLEAR(clear_module_state->__pyx_tuple__21); Py_CLEAR(clear_module_state->__pyx_tuple__23); Py_CLEAR(clear_module_state->__pyx_tuple__24); Py_CLEAR(clear_module_state->__pyx_tuple__26); Py_CLEAR(clear_module_state->__pyx_tuple__28); Py_CLEAR(clear_module_state->__pyx_tuple__30); Py_CLEAR(clear_module_state->__pyx_tuple__31); Py_CLEAR(clear_module_state->__pyx_tuple__33); Py_CLEAR(clear_module_state->__pyx_tuple__35); Py_CLEAR(clear_module_state->__pyx_tuple__37); Py_CLEAR(clear_module_state->__pyx_codeobj__2); Py_CLEAR(clear_module_state->__pyx_codeobj__4); Py_CLEAR(clear_module_state->__pyx_codeobj__6); Py_CLEAR(clear_module_state->__pyx_codeobj__16); Py_CLEAR(clear_module_state->__pyx_codeobj__18); Py_CLEAR(clear_module_state->__pyx_codeobj__20); Py_CLEAR(clear_module_state->__pyx_codeobj__22); Py_CLEAR(clear_module_state->__pyx_codeobj__25); Py_CLEAR(clear_module_state->__pyx_codeobj__27); Py_CLEAR(clear_module_state->__pyx_codeobj__29); Py_CLEAR(clear_module_state->__pyx_codeobj__32); Py_CLEAR(clear_module_state->__pyx_codeobj__34); Py_CLEAR(clear_module_state->__pyx_codeobj__36); Py_CLEAR(clear_module_state->__pyx_codeobj__38); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_4borg_8platform_5linux___pyx_scope_struct__listxattr); Py_VISIT(traverse_module_state->__pyx_type_4borg_8platform_5linux___pyx_scope_struct__listxattr); Py_VISIT(traverse_module_state->__pyx_ptype_4borg_8platform_5linux___pyx_scope_struct_1_getxattr); Py_VISIT(traverse_module_state->__pyx_type_4borg_8platform_5linux___pyx_scope_struct_1_getxattr); Py_VISIT(traverse_module_state->__pyx_ptype_4borg_8platform_5linux___pyx_scope_struct_2_setxattr); Py_VISIT(traverse_module_state->__pyx_type_4borg_8platform_5linux___pyx_scope_struct_2_setxattr); Py_VISIT(traverse_module_state->__pyx_kp_s_1_4_01); Py_VISIT(traverse_module_state->__pyx_n_s_API_VERSION); Py_VISIT(traverse_module_state->__pyx_n_s_AssertionError); Py_VISIT(traverse_module_state->__pyx_n_s_BSD_TO_LINUX_FLAGS); Py_VISIT(traverse_module_state->__pyx_n_s_BaseSyncFile); Py_VISIT(traverse_module_state->__pyx_n_s_DONTNEED); Py_VISIT(traverse_module_state->__pyx_kp_s_Implemented_using_sync_file_ran); Py_VISIT(traverse_module_state->__pyx_n_s_ImportError); Py_VISIT(traverse_module_state->__pyx_n_s_M); Py_VISIT(traverse_module_state->__pyx_n_s_OSError); Py_VISIT(traverse_module_state->__pyx_n_s_O_NOFOLLOW); Py_VISIT(traverse_module_state->__pyx_n_s_O_NONBLOCK); Py_VISIT(traverse_module_state->__pyx_n_s_O_RDONLY); Py_VISIT(traverse_module_state->__pyx_n_s_SYNC_FILE_RANGE_LOADED); Py_VISIT(traverse_module_state->__pyx_n_s_SYNC_FILE_RANGE_WAIT_AFTER); Py_VISIT(traverse_module_state->__pyx_n_s_SYNC_FILE_RANGE_WAIT_BEFORE); Py_VISIT(traverse_module_state->__pyx_n_s_SYNC_FILE_RANGE_WRITE); Py_VISIT(traverse_module_state->__pyx_n_s_S_ISBLK); Py_VISIT(traverse_module_state->__pyx_n_s_S_ISCHR); Py_VISIT(traverse_module_state->__pyx_n_s_S_ISDIR); Py_VISIT(traverse_module_state->__pyx_n_s_S_ISLNK); Py_VISIT(traverse_module_state->__pyx_n_s_SyncFile); Py_VISIT(traverse_module_state->__pyx_n_s_SyncFile___init); Py_VISIT(traverse_module_state->__pyx_n_s_SyncFile_sync); Py_VISIT(traverse_module_state->__pyx_n_s_SyncFile_write); Py_VISIT(traverse_module_state->__pyx_n_s_UF_APPEND); Py_VISIT(traverse_module_state->__pyx_n_s_UF_COMPRESSED); Py_VISIT(traverse_module_state->__pyx_n_s_UF_IMMUTABLE); Py_VISIT(traverse_module_state->__pyx_n_s_UF_NODUMP); Py_VISIT(traverse_module_state->__pyx_kp_s__10); Py_VISIT(traverse_module_state->__pyx_n_s__12); Py_VISIT(traverse_module_state->__pyx_kp_u__13); Py_VISIT(traverse_module_state->__pyx_kp_s__14); Py_VISIT(traverse_module_state->__pyx_n_s__39); Py_VISIT(traverse_module_state->__pyx_kp_s__7); Py_VISIT(traverse_module_state->__pyx_kp_s__8); Py_VISIT(traverse_module_state->__pyx_n_s_access_acl); Py_VISIT(traverse_module_state->__pyx_n_s_access_text); Py_VISIT(traverse_module_state->__pyx_n_s_acl); Py_VISIT(traverse_module_state->__pyx_n_s_acl_access); Py_VISIT(traverse_module_state->__pyx_n_s_acl_default); Py_VISIT(traverse_module_state->__pyx_n_s_acl_get); Py_VISIT(traverse_module_state->__pyx_n_s_acl_set); Py_VISIT(traverse_module_state->__pyx_n_s_acl_use_local_uid_gid); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_base); Py_VISIT(traverse_module_state->__pyx_n_s_basesyncfile); Py_VISIT(traverse_module_state->__pyx_n_s_binary); Py_VISIT(traverse_module_state->__pyx_n_s_borg_platform_linux); Py_VISIT(traverse_module_state->__pyx_n_s_bsd_flag); Py_VISIT(traverse_module_state->__pyx_n_s_bsd_flags); Py_VISIT(traverse_module_state->__pyx_n_s_buf); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_close); Py_VISIT(traverse_module_state->__pyx_n_s_comment_re); Py_VISIT(traverse_module_state->__pyx_n_s_compile); Py_VISIT(traverse_module_state->__pyx_n_s_converter); Py_VISIT(traverse_module_state->__pyx_n_s_data); Py_VISIT(traverse_module_state->__pyx_n_s_default_acl); Py_VISIT(traverse_module_state->__pyx_n_s_default_text); Py_VISIT(traverse_module_state->__pyx_n_s_dict); Py_VISIT(traverse_module_state->__pyx_kp_u_disable); Py_VISIT(traverse_module_state->__pyx_n_s_doc); Py_VISIT(traverse_module_state->__pyx_kp_u_enable); Py_VISIT(traverse_module_state->__pyx_n_s_entries); Py_VISIT(traverse_module_state->__pyx_n_s_entry); Py_VISIT(traverse_module_state->__pyx_n_s_error_number); Py_VISIT(traverse_module_state->__pyx_n_s_f); Py_VISIT(traverse_module_state->__pyx_n_s_fd); Py_VISIT(traverse_module_state->__pyx_n_s_fdatasync); Py_VISIT(traverse_module_state->__pyx_n_s_fields); Py_VISIT(traverse_module_state->__pyx_n_s_flags); Py_VISIT(traverse_module_state->__pyx_n_s_flush); Py_VISIT(traverse_module_state->__pyx_n_s_follow_symlinks); Py_VISIT(traverse_module_state->__pyx_n_s_fsdecode); Py_VISIT(traverse_module_state->__pyx_n_s_fsencode); Py_VISIT(traverse_module_state->__pyx_n_s_func); Py_VISIT(traverse_module_state->__pyx_kp_u_gc); Py_VISIT(traverse_module_state->__pyx_n_s_get); Py_VISIT(traverse_module_state->__pyx_n_s_get_flags); Py_VISIT(traverse_module_state->__pyx_n_s_getxattr); Py_VISIT(traverse_module_state->__pyx_n_s_getxattr_inner); Py_VISIT(traverse_module_state->__pyx_n_s_getxattr_locals_func); Py_VISIT(traverse_module_state->__pyx_n_s_group); Py_VISIT(traverse_module_state->__pyx_n_s_group2gid); Py_VISIT(traverse_module_state->__pyx_n_s_helpers); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_init); Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); Py_VISIT(traverse_module_state->__pyx_n_s_item); Py_VISIT(traverse_module_state->__pyx_n_s_items); Py_VISIT(traverse_module_state->__pyx_n_s_join); Py_VISIT(traverse_module_state->__pyx_n_s_last_sync); Py_VISIT(traverse_module_state->__pyx_kp_s_length_d_not_page_aligned); Py_VISIT(traverse_module_state->__pyx_n_s_linux_flag); Py_VISIT(traverse_module_state->__pyx_n_s_linux_flags); Py_VISIT(traverse_module_state->__pyx_n_s_listxattr); Py_VISIT(traverse_module_state->__pyx_n_s_listxattr_inner); Py_VISIT(traverse_module_state->__pyx_n_s_listxattr_locals_func); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_metaclass); Py_VISIT(traverse_module_state->__pyx_n_s_mode); Py_VISIT(traverse_module_state->__pyx_n_s_module); Py_VISIT(traverse_module_state->__pyx_n_s_mro_entries); Py_VISIT(traverse_module_state->__pyx_n_s_n); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_name_2); Py_VISIT(traverse_module_state->__pyx_n_s_numeric_ids); Py_VISIT(traverse_module_state->__pyx_n_s_offset); Py_VISIT(traverse_module_state->__pyx_kp_s_offset_d_not_page_aligned); Py_VISIT(traverse_module_state->__pyx_n_s_open); Py_VISIT(traverse_module_state->__pyx_n_s_open_fd); Py_VISIT(traverse_module_state->__pyx_n_s_os); Py_VISIT(traverse_module_state->__pyx_n_s_path); Py_VISIT(traverse_module_state->__pyx_n_s_pending_sync); Py_VISIT(traverse_module_state->__pyx_n_s_posix); Py_VISIT(traverse_module_state->__pyx_n_s_posix_acl_use_stored_uid_gid); Py_VISIT(traverse_module_state->__pyx_n_s_prepare); Py_VISIT(traverse_module_state->__pyx_n_s_qualname); Py_VISIT(traverse_module_state->__pyx_n_s_re); Py_VISIT(traverse_module_state->__pyx_n_s_ret); Py_VISIT(traverse_module_state->__pyx_n_s_safe_decode); Py_VISIT(traverse_module_state->__pyx_n_s_safe_encode); Py_VISIT(traverse_module_state->__pyx_n_s_safe_fadvise); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_n_s_set_flags); Py_VISIT(traverse_module_state->__pyx_n_s_set_name); Py_VISIT(traverse_module_state->__pyx_n_s_setxattr); Py_VISIT(traverse_module_state->__pyx_n_s_setxattr_inner); Py_VISIT(traverse_module_state->__pyx_n_s_setxattr_locals_func); Py_VISIT(traverse_module_state->__pyx_n_s_size); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_n_s_split); Py_VISIT(traverse_module_state->__pyx_n_s_split_string0); Py_VISIT(traverse_module_state->__pyx_kp_s_src_borg_platform_linux_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_st); Py_VISIT(traverse_module_state->__pyx_n_s_st_mode); Py_VISIT(traverse_module_state->__pyx_n_s_startswith); Py_VISIT(traverse_module_state->__pyx_n_s_stat); Py_VISIT(traverse_module_state->__pyx_n_s_strerror); Py_VISIT(traverse_module_state->__pyx_n_s_sub); Py_VISIT(traverse_module_state->__pyx_n_s_subprocess); Py_VISIT(traverse_module_state->__pyx_n_s_super); Py_VISIT(traverse_module_state->__pyx_n_s_sync); Py_VISIT(traverse_module_state->__pyx_n_s_sync_file_range); Py_VISIT(traverse_module_state->__pyx_n_s_syncfilerange); Py_VISIT(traverse_module_state->__pyx_kp_b_system_posix_acl); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_user); Py_VISIT(traverse_module_state->__pyx_n_s_user2uid); Py_VISIT(traverse_module_state->__pyx_n_s_value); Py_VISIT(traverse_module_state->__pyx_n_s_workarounds); Py_VISIT(traverse_module_state->__pyx_n_s_write); Py_VISIT(traverse_module_state->__pyx_n_s_write_window); Py_VISIT(traverse_module_state->__pyx_n_s_xattr); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_int_3); Py_VISIT(traverse_module_state->__pyx_tuple_); Py_VISIT(traverse_module_state->__pyx_slice__9); Py_VISIT(traverse_module_state->__pyx_tuple__3); Py_VISIT(traverse_module_state->__pyx_tuple__5); Py_VISIT(traverse_module_state->__pyx_tuple__11); Py_VISIT(traverse_module_state->__pyx_tuple__15); Py_VISIT(traverse_module_state->__pyx_tuple__17); Py_VISIT(traverse_module_state->__pyx_tuple__19); Py_VISIT(traverse_module_state->__pyx_tuple__21); Py_VISIT(traverse_module_state->__pyx_tuple__23); Py_VISIT(traverse_module_state->__pyx_tuple__24); Py_VISIT(traverse_module_state->__pyx_tuple__26); Py_VISIT(traverse_module_state->__pyx_tuple__28); Py_VISIT(traverse_module_state->__pyx_tuple__30); Py_VISIT(traverse_module_state->__pyx_tuple__31); Py_VISIT(traverse_module_state->__pyx_tuple__33); Py_VISIT(traverse_module_state->__pyx_tuple__35); Py_VISIT(traverse_module_state->__pyx_tuple__37); Py_VISIT(traverse_module_state->__pyx_codeobj__2); Py_VISIT(traverse_module_state->__pyx_codeobj__4); Py_VISIT(traverse_module_state->__pyx_codeobj__6); Py_VISIT(traverse_module_state->__pyx_codeobj__16); Py_VISIT(traverse_module_state->__pyx_codeobj__18); Py_VISIT(traverse_module_state->__pyx_codeobj__20); Py_VISIT(traverse_module_state->__pyx_codeobj__22); Py_VISIT(traverse_module_state->__pyx_codeobj__25); Py_VISIT(traverse_module_state->__pyx_codeobj__27); Py_VISIT(traverse_module_state->__pyx_codeobj__29); Py_VISIT(traverse_module_state->__pyx_codeobj__32); Py_VISIT(traverse_module_state->__pyx_codeobj__34); Py_VISIT(traverse_module_state->__pyx_codeobj__36); Py_VISIT(traverse_module_state->__pyx_codeobj__38); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #define __pyx_type_4borg_8platform_5linux___pyx_scope_struct__listxattr __pyx_mstate_global->__pyx_type_4borg_8platform_5linux___pyx_scope_struct__listxattr #define __pyx_type_4borg_8platform_5linux___pyx_scope_struct_1_getxattr __pyx_mstate_global->__pyx_type_4borg_8platform_5linux___pyx_scope_struct_1_getxattr #define __pyx_type_4borg_8platform_5linux___pyx_scope_struct_2_setxattr __pyx_mstate_global->__pyx_type_4borg_8platform_5linux___pyx_scope_struct_2_setxattr #endif #define __pyx_ptype_4borg_8platform_5linux___pyx_scope_struct__listxattr __pyx_mstate_global->__pyx_ptype_4borg_8platform_5linux___pyx_scope_struct__listxattr #define __pyx_ptype_4borg_8platform_5linux___pyx_scope_struct_1_getxattr __pyx_mstate_global->__pyx_ptype_4borg_8platform_5linux___pyx_scope_struct_1_getxattr #define __pyx_ptype_4borg_8platform_5linux___pyx_scope_struct_2_setxattr __pyx_mstate_global->__pyx_ptype_4borg_8platform_5linux___pyx_scope_struct_2_setxattr #define __pyx_kp_s_1_4_01 __pyx_mstate_global->__pyx_kp_s_1_4_01 #define __pyx_n_s_API_VERSION __pyx_mstate_global->__pyx_n_s_API_VERSION #define __pyx_n_s_AssertionError __pyx_mstate_global->__pyx_n_s_AssertionError #define __pyx_n_s_BSD_TO_LINUX_FLAGS __pyx_mstate_global->__pyx_n_s_BSD_TO_LINUX_FLAGS #define __pyx_n_s_BaseSyncFile __pyx_mstate_global->__pyx_n_s_BaseSyncFile #define __pyx_n_s_DONTNEED __pyx_mstate_global->__pyx_n_s_DONTNEED #define __pyx_kp_s_Implemented_using_sync_file_ran __pyx_mstate_global->__pyx_kp_s_Implemented_using_sync_file_ran #define __pyx_n_s_ImportError __pyx_mstate_global->__pyx_n_s_ImportError #define __pyx_n_s_M __pyx_mstate_global->__pyx_n_s_M #define __pyx_n_s_OSError __pyx_mstate_global->__pyx_n_s_OSError #define __pyx_n_s_O_NOFOLLOW __pyx_mstate_global->__pyx_n_s_O_NOFOLLOW #define __pyx_n_s_O_NONBLOCK __pyx_mstate_global->__pyx_n_s_O_NONBLOCK #define __pyx_n_s_O_RDONLY __pyx_mstate_global->__pyx_n_s_O_RDONLY #define __pyx_n_s_SYNC_FILE_RANGE_LOADED __pyx_mstate_global->__pyx_n_s_SYNC_FILE_RANGE_LOADED #define __pyx_n_s_SYNC_FILE_RANGE_WAIT_AFTER __pyx_mstate_global->__pyx_n_s_SYNC_FILE_RANGE_WAIT_AFTER #define __pyx_n_s_SYNC_FILE_RANGE_WAIT_BEFORE __pyx_mstate_global->__pyx_n_s_SYNC_FILE_RANGE_WAIT_BEFORE #define __pyx_n_s_SYNC_FILE_RANGE_WRITE __pyx_mstate_global->__pyx_n_s_SYNC_FILE_RANGE_WRITE #define __pyx_n_s_S_ISBLK __pyx_mstate_global->__pyx_n_s_S_ISBLK #define __pyx_n_s_S_ISCHR __pyx_mstate_global->__pyx_n_s_S_ISCHR #define __pyx_n_s_S_ISDIR __pyx_mstate_global->__pyx_n_s_S_ISDIR #define __pyx_n_s_S_ISLNK __pyx_mstate_global->__pyx_n_s_S_ISLNK #define __pyx_n_s_SyncFile __pyx_mstate_global->__pyx_n_s_SyncFile #define __pyx_n_s_SyncFile___init __pyx_mstate_global->__pyx_n_s_SyncFile___init #define __pyx_n_s_SyncFile_sync __pyx_mstate_global->__pyx_n_s_SyncFile_sync #define __pyx_n_s_SyncFile_write __pyx_mstate_global->__pyx_n_s_SyncFile_write #define __pyx_n_s_UF_APPEND __pyx_mstate_global->__pyx_n_s_UF_APPEND #define __pyx_n_s_UF_COMPRESSED __pyx_mstate_global->__pyx_n_s_UF_COMPRESSED #define __pyx_n_s_UF_IMMUTABLE __pyx_mstate_global->__pyx_n_s_UF_IMMUTABLE #define __pyx_n_s_UF_NODUMP __pyx_mstate_global->__pyx_n_s_UF_NODUMP #define __pyx_kp_s__10 __pyx_mstate_global->__pyx_kp_s__10 #define __pyx_n_s__12 __pyx_mstate_global->__pyx_n_s__12 #define __pyx_kp_u__13 __pyx_mstate_global->__pyx_kp_u__13 #define __pyx_kp_s__14 __pyx_mstate_global->__pyx_kp_s__14 #define __pyx_n_s__39 __pyx_mstate_global->__pyx_n_s__39 #define __pyx_kp_s__7 __pyx_mstate_global->__pyx_kp_s__7 #define __pyx_kp_s__8 __pyx_mstate_global->__pyx_kp_s__8 #define __pyx_n_s_access_acl __pyx_mstate_global->__pyx_n_s_access_acl #define __pyx_n_s_access_text __pyx_mstate_global->__pyx_n_s_access_text #define __pyx_n_s_acl __pyx_mstate_global->__pyx_n_s_acl #define __pyx_n_s_acl_access __pyx_mstate_global->__pyx_n_s_acl_access #define __pyx_n_s_acl_default __pyx_mstate_global->__pyx_n_s_acl_default #define __pyx_n_s_acl_get __pyx_mstate_global->__pyx_n_s_acl_get #define __pyx_n_s_acl_set __pyx_mstate_global->__pyx_n_s_acl_set #define __pyx_n_s_acl_use_local_uid_gid __pyx_mstate_global->__pyx_n_s_acl_use_local_uid_gid #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_base __pyx_mstate_global->__pyx_n_s_base #define __pyx_n_s_basesyncfile __pyx_mstate_global->__pyx_n_s_basesyncfile #define __pyx_n_s_binary __pyx_mstate_global->__pyx_n_s_binary #define __pyx_n_s_borg_platform_linux __pyx_mstate_global->__pyx_n_s_borg_platform_linux #define __pyx_n_s_bsd_flag __pyx_mstate_global->__pyx_n_s_bsd_flag #define __pyx_n_s_bsd_flags __pyx_mstate_global->__pyx_n_s_bsd_flags #define __pyx_n_s_buf __pyx_mstate_global->__pyx_n_s_buf #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_close __pyx_mstate_global->__pyx_n_s_close #define __pyx_n_s_comment_re __pyx_mstate_global->__pyx_n_s_comment_re #define __pyx_n_s_compile __pyx_mstate_global->__pyx_n_s_compile #define __pyx_n_s_converter __pyx_mstate_global->__pyx_n_s_converter #define __pyx_n_s_data __pyx_mstate_global->__pyx_n_s_data #define __pyx_n_s_default_acl __pyx_mstate_global->__pyx_n_s_default_acl #define __pyx_n_s_default_text __pyx_mstate_global->__pyx_n_s_default_text #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable #define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable #define __pyx_n_s_entries __pyx_mstate_global->__pyx_n_s_entries #define __pyx_n_s_entry __pyx_mstate_global->__pyx_n_s_entry #define __pyx_n_s_error_number __pyx_mstate_global->__pyx_n_s_error_number #define __pyx_n_s_f __pyx_mstate_global->__pyx_n_s_f #define __pyx_n_s_fd __pyx_mstate_global->__pyx_n_s_fd #define __pyx_n_s_fdatasync __pyx_mstate_global->__pyx_n_s_fdatasync #define __pyx_n_s_fields __pyx_mstate_global->__pyx_n_s_fields #define __pyx_n_s_flags __pyx_mstate_global->__pyx_n_s_flags #define __pyx_n_s_flush __pyx_mstate_global->__pyx_n_s_flush #define __pyx_n_s_follow_symlinks __pyx_mstate_global->__pyx_n_s_follow_symlinks #define __pyx_n_s_fsdecode __pyx_mstate_global->__pyx_n_s_fsdecode #define __pyx_n_s_fsencode __pyx_mstate_global->__pyx_n_s_fsencode #define __pyx_n_s_func __pyx_mstate_global->__pyx_n_s_func #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc #define __pyx_n_s_get __pyx_mstate_global->__pyx_n_s_get #define __pyx_n_s_get_flags __pyx_mstate_global->__pyx_n_s_get_flags #define __pyx_n_s_getxattr __pyx_mstate_global->__pyx_n_s_getxattr #define __pyx_n_s_getxattr_inner __pyx_mstate_global->__pyx_n_s_getxattr_inner #define __pyx_n_s_getxattr_locals_func __pyx_mstate_global->__pyx_n_s_getxattr_locals_func #define __pyx_n_s_group __pyx_mstate_global->__pyx_n_s_group #define __pyx_n_s_group2gid __pyx_mstate_global->__pyx_n_s_group2gid #define __pyx_n_s_helpers __pyx_mstate_global->__pyx_n_s_helpers #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init #define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled #define __pyx_n_s_item __pyx_mstate_global->__pyx_n_s_item #define __pyx_n_s_items __pyx_mstate_global->__pyx_n_s_items #define __pyx_n_s_join __pyx_mstate_global->__pyx_n_s_join #define __pyx_n_s_last_sync __pyx_mstate_global->__pyx_n_s_last_sync #define __pyx_kp_s_length_d_not_page_aligned __pyx_mstate_global->__pyx_kp_s_length_d_not_page_aligned #define __pyx_n_s_linux_flag __pyx_mstate_global->__pyx_n_s_linux_flag #define __pyx_n_s_linux_flags __pyx_mstate_global->__pyx_n_s_linux_flags #define __pyx_n_s_listxattr __pyx_mstate_global->__pyx_n_s_listxattr #define __pyx_n_s_listxattr_inner __pyx_mstate_global->__pyx_n_s_listxattr_inner #define __pyx_n_s_listxattr_locals_func __pyx_mstate_global->__pyx_n_s_listxattr_locals_func #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass #define __pyx_n_s_mode __pyx_mstate_global->__pyx_n_s_mode #define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module #define __pyx_n_s_mro_entries __pyx_mstate_global->__pyx_n_s_mro_entries #define __pyx_n_s_n __pyx_mstate_global->__pyx_n_s_n #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_name_2 __pyx_mstate_global->__pyx_n_s_name_2 #define __pyx_n_s_numeric_ids __pyx_mstate_global->__pyx_n_s_numeric_ids #define __pyx_n_s_offset __pyx_mstate_global->__pyx_n_s_offset #define __pyx_kp_s_offset_d_not_page_aligned __pyx_mstate_global->__pyx_kp_s_offset_d_not_page_aligned #define __pyx_n_s_open __pyx_mstate_global->__pyx_n_s_open #define __pyx_n_s_open_fd __pyx_mstate_global->__pyx_n_s_open_fd #define __pyx_n_s_os __pyx_mstate_global->__pyx_n_s_os #define __pyx_n_s_path __pyx_mstate_global->__pyx_n_s_path #define __pyx_n_s_pending_sync __pyx_mstate_global->__pyx_n_s_pending_sync #define __pyx_n_s_posix __pyx_mstate_global->__pyx_n_s_posix #define __pyx_n_s_posix_acl_use_stored_uid_gid __pyx_mstate_global->__pyx_n_s_posix_acl_use_stored_uid_gid #define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare #define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname #define __pyx_n_s_re __pyx_mstate_global->__pyx_n_s_re #define __pyx_n_s_ret __pyx_mstate_global->__pyx_n_s_ret #define __pyx_n_s_safe_decode __pyx_mstate_global->__pyx_n_s_safe_decode #define __pyx_n_s_safe_encode __pyx_mstate_global->__pyx_n_s_safe_encode #define __pyx_n_s_safe_fadvise __pyx_mstate_global->__pyx_n_s_safe_fadvise #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_n_s_set_flags __pyx_mstate_global->__pyx_n_s_set_flags #define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name #define __pyx_n_s_setxattr __pyx_mstate_global->__pyx_n_s_setxattr #define __pyx_n_s_setxattr_inner __pyx_mstate_global->__pyx_n_s_setxattr_inner #define __pyx_n_s_setxattr_locals_func __pyx_mstate_global->__pyx_n_s_setxattr_locals_func #define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_n_s_split __pyx_mstate_global->__pyx_n_s_split #define __pyx_n_s_split_string0 __pyx_mstate_global->__pyx_n_s_split_string0 #define __pyx_kp_s_src_borg_platform_linux_pyx __pyx_mstate_global->__pyx_kp_s_src_borg_platform_linux_pyx #define __pyx_n_s_st __pyx_mstate_global->__pyx_n_s_st #define __pyx_n_s_st_mode __pyx_mstate_global->__pyx_n_s_st_mode #define __pyx_n_s_startswith __pyx_mstate_global->__pyx_n_s_startswith #define __pyx_n_s_stat __pyx_mstate_global->__pyx_n_s_stat #define __pyx_n_s_strerror __pyx_mstate_global->__pyx_n_s_strerror #define __pyx_n_s_sub __pyx_mstate_global->__pyx_n_s_sub #define __pyx_n_s_subprocess __pyx_mstate_global->__pyx_n_s_subprocess #define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super #define __pyx_n_s_sync __pyx_mstate_global->__pyx_n_s_sync #define __pyx_n_s_sync_file_range __pyx_mstate_global->__pyx_n_s_sync_file_range #define __pyx_n_s_syncfilerange __pyx_mstate_global->__pyx_n_s_syncfilerange #define __pyx_kp_b_system_posix_acl __pyx_mstate_global->__pyx_kp_b_system_posix_acl #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_user __pyx_mstate_global->__pyx_n_s_user #define __pyx_n_s_user2uid __pyx_mstate_global->__pyx_n_s_user2uid #define __pyx_n_s_value __pyx_mstate_global->__pyx_n_s_value #define __pyx_n_s_workarounds __pyx_mstate_global->__pyx_n_s_workarounds #define __pyx_n_s_write __pyx_mstate_global->__pyx_n_s_write #define __pyx_n_s_write_window __pyx_mstate_global->__pyx_n_s_write_window #define __pyx_n_s_xattr __pyx_mstate_global->__pyx_n_s_xattr #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_int_3 __pyx_mstate_global->__pyx_int_3 #define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_ #define __pyx_slice__9 __pyx_mstate_global->__pyx_slice__9 #define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 #define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5 #define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11 #define __pyx_tuple__15 __pyx_mstate_global->__pyx_tuple__15 #define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17 #define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19 #define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21 #define __pyx_tuple__23 __pyx_mstate_global->__pyx_tuple__23 #define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24 #define __pyx_tuple__26 __pyx_mstate_global->__pyx_tuple__26 #define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28 #define __pyx_tuple__30 __pyx_mstate_global->__pyx_tuple__30 #define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31 #define __pyx_tuple__33 __pyx_mstate_global->__pyx_tuple__33 #define __pyx_tuple__35 __pyx_mstate_global->__pyx_tuple__35 #define __pyx_tuple__37 __pyx_mstate_global->__pyx_tuple__37 #define __pyx_codeobj__2 __pyx_mstate_global->__pyx_codeobj__2 #define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4 #define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6 #define __pyx_codeobj__16 __pyx_mstate_global->__pyx_codeobj__16 #define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 #define __pyx_codeobj__20 __pyx_mstate_global->__pyx_codeobj__20 #define __pyx_codeobj__22 __pyx_mstate_global->__pyx_codeobj__22 #define __pyx_codeobj__25 __pyx_mstate_global->__pyx_codeobj__25 #define __pyx_codeobj__27 __pyx_mstate_global->__pyx_codeobj__27 #define __pyx_codeobj__29 __pyx_mstate_global->__pyx_codeobj__29 #define __pyx_codeobj__32 __pyx_mstate_global->__pyx_codeobj__32 #define __pyx_codeobj__34 __pyx_mstate_global->__pyx_codeobj__34 #define __pyx_codeobj__36 __pyx_mstate_global->__pyx_codeobj__36 #define __pyx_codeobj__38 __pyx_mstate_global->__pyx_codeobj__38 /* #### Code section: module_code ### */ /* "borg/platform/linux.pyx":82 * * * def listxattr(path, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, buf, size): * if isinstance(path, int): */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_5linux_1listxattr(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8platform_5linux_1listxattr = {"listxattr", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_5linux_1listxattr, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8platform_5linux_1listxattr(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_path = 0; PyObject *__pyx_v_follow_symlinks = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("listxattr (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_follow_symlinks,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_path)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (kw_args == 1) { const Py_ssize_t index = 1; PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L3_error) } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "listxattr") < 0)) __PYX_ERR(0, 82, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_path = values[0]; __pyx_v_follow_symlinks = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("listxattr", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 82, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.linux.listxattr", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_5linux_listxattr(__pyx_self, __pyx_v_path, __pyx_v_follow_symlinks); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/linux.pyx":83 * * def listxattr(path, *, follow_symlinks=False): * def func(path, buf, size): # <<<<<<<<<<<<<< * if isinstance(path, int): * return c_flistxattr(path, buf, size) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_5linux_9listxattr_1func(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8platform_5linux_9listxattr_1func = {"func", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_5linux_9listxattr_1func, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8platform_5linux_9listxattr_1func(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_path = 0; PyObject *__pyx_v_buf = 0; PyObject *__pyx_v_size = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("func (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_buf,&__pyx_n_s_size,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_path)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 83, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_buf)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 83, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("func", 1, 3, 3, 1); __PYX_ERR(0, 83, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 83, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("func", 1, 3, 3, 2); __PYX_ERR(0, 83, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "func") < 0)) __PYX_ERR(0, 83, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_path = values[0]; __pyx_v_buf = values[1]; __pyx_v_size = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("func", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 83, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.linux.listxattr.func", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_5linux_9listxattr_func(__pyx_self, __pyx_v_path, __pyx_v_buf, __pyx_v_size); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8platform_5linux_9listxattr_func(PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_buf, PyObject *__pyx_v_size) { struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct__listxattr *__pyx_cur_scope; struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct__listxattr *__pyx_outer_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; char *__pyx_t_3; size_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; char const *__pyx_t_6; char const *__pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("func", 1); __pyx_outer_scope = (struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct__listxattr *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; /* "borg/platform/linux.pyx":84 * def listxattr(path, *, follow_symlinks=False): * def func(path, buf, size): * if isinstance(path, int): # <<<<<<<<<<<<<< * return c_flistxattr(path, buf, size) * else: */ __pyx_t_1 = PyInt_Check(__pyx_v_path); if (__pyx_t_1) { /* "borg/platform/linux.pyx":85 * def func(path, buf, size): * if isinstance(path, int): * return c_flistxattr(path, buf, size) # <<<<<<<<<<<<<< * else: * if follow_symlinks: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_path); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 85, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_AsWritableString(__pyx_v_buf); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 85, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_v_size); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 85, __pyx_L1_error) __pyx_t_5 = PyInt_FromSsize_t(flistxattr(__pyx_t_2, ((char *)__pyx_t_3), __pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "borg/platform/linux.pyx":84 * def listxattr(path, *, follow_symlinks=False): * def func(path, buf, size): * if isinstance(path, int): # <<<<<<<<<<<<<< * return c_flistxattr(path, buf, size) * else: */ } /* "borg/platform/linux.pyx":87 * return c_flistxattr(path, buf, size) * else: * if follow_symlinks: # <<<<<<<<<<<<<< * return c_listxattr(path, buf, size) * else: */ /*else*/ { if (unlikely(!__pyx_cur_scope->__pyx_v_follow_symlinks)) { __Pyx_RaiseClosureNameError("follow_symlinks"); __PYX_ERR(0, 87, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_follow_symlinks); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 87, __pyx_L1_error) if (__pyx_t_1) { /* "borg/platform/linux.pyx":88 * else: * if follow_symlinks: * return c_listxattr(path, buf, size) # <<<<<<<<<<<<<< * else: * return c_llistxattr(path, buf, size) */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_path); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_AsWritableString(__pyx_v_buf); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_v_size); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error) __pyx_t_5 = PyInt_FromSsize_t(listxattr(__pyx_t_6, ((char *)__pyx_t_3), __pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "borg/platform/linux.pyx":87 * return c_flistxattr(path, buf, size) * else: * if follow_symlinks: # <<<<<<<<<<<<<< * return c_listxattr(path, buf, size) * else: */ } /* "borg/platform/linux.pyx":90 * return c_listxattr(path, buf, size) * else: * return c_llistxattr(path, buf, size) # <<<<<<<<<<<<<< * * n, buf = _listxattr_inner(func, path) */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_path); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_AsWritableString(__pyx_v_buf); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_v_size); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L1_error) __pyx_t_5 = PyInt_FromSsize_t(llistxattr(__pyx_t_7, ((char *)__pyx_t_3), __pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; } } /* "borg/platform/linux.pyx":83 * * def listxattr(path, *, follow_symlinks=False): * def func(path, buf, size): # <<<<<<<<<<<<<< * if isinstance(path, int): * return c_flistxattr(path, buf, size) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("borg.platform.linux.listxattr.func", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/linux.pyx":82 * * * def listxattr(path, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, buf, size): * if isinstance(path, int): */ static PyObject *__pyx_pf_4borg_8platform_5linux_listxattr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_follow_symlinks) { struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct__listxattr *__pyx_cur_scope; PyObject *__pyx_v_func = 0; PyObject *__pyx_v_n = NULL; PyObject *__pyx_v_buf = NULL; PyObject *__pyx_7genexpr__pyx_v_name = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); PyObject *__pyx_t_7 = NULL; Py_ssize_t __pyx_t_8; PyObject *(*__pyx_t_9)(PyObject *); int __pyx_t_10; int __pyx_t_11; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("listxattr", 0); __pyx_cur_scope = (struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct__listxattr *)__pyx_tp_new_4borg_8platform_5linux___pyx_scope_struct__listxattr(__pyx_ptype_4borg_8platform_5linux___pyx_scope_struct__listxattr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct__listxattr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 82, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_follow_symlinks = __pyx_v_follow_symlinks; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_follow_symlinks); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_follow_symlinks); /* "borg/platform/linux.pyx":83 * * def listxattr(path, *, follow_symlinks=False): * def func(path, buf, size): # <<<<<<<<<<<<<< * if isinstance(path, int): * return c_flistxattr(path, buf, size) */ __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_5linux_9listxattr_1func, 0, __pyx_n_s_listxattr_locals_func, ((PyObject*)__pyx_cur_scope), __pyx_n_s_borg_platform_linux, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_func = __pyx_t_1; __pyx_t_1 = 0; /* "borg/platform/linux.pyx":92 * return c_llistxattr(path, buf, size) * * n, buf = _listxattr_inner(func, path) # <<<<<<<<<<<<<< * return [name for name in split_string0(buf[:n]) * if name and not name.startswith(b'system.posix_acl_')] */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_listxattr_inner); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_func, __pyx_v_path}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 92, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 92, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 92, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_n = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_buf = __pyx_t_3; __pyx_t_3 = 0; /* "borg/platform/linux.pyx":93 * * n, buf = _listxattr_inner(func, path) * return [name for name in split_string0(buf[:n]) # <<<<<<<<<<<<<< * if name and not name.startswith(b'system.posix_acl_')] * */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_split_string0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_buf, 0, 0, NULL, &__pyx_v_n, NULL, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 93, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 93, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 93, __pyx_L7_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_9)) { if (likely(PyList_CheckExact(__pyx_t_2))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 93, __pyx_L7_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 93, __pyx_L7_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 93, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 93, __pyx_L7_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 93, __pyx_L7_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 93, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_9(__pyx_t_2); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 93, __pyx_L7_error) } break; } __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_name, __pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/linux.pyx":94 * n, buf = _listxattr_inner(func, path) * return [name for name in split_string0(buf[:n]) * if name and not name.startswith(b'system.posix_acl_')] # <<<<<<<<<<<<<< * * */ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_7genexpr__pyx_v_name); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 94, __pyx_L7_error) if (__pyx_t_11) { } else { __pyx_t_10 = __pyx_t_11; goto __pyx_L11_bool_binop_done; } __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_7genexpr__pyx_v_name, __pyx_n_s_startswith); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 94, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_kp_b_system_posix_acl}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 94, __pyx_L7_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_12 = (!__pyx_t_11); __pyx_t_10 = __pyx_t_12; __pyx_L11_bool_binop_done:; if (__pyx_t_10) { /* "borg/platform/linux.pyx":93 * * n, buf = _listxattr_inner(func, path) * return [name for name in split_string0(buf[:n]) # <<<<<<<<<<<<<< * if name and not name.startswith(b'system.posix_acl_')] * */ if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_7genexpr__pyx_v_name))) __PYX_ERR(0, 93, __pyx_L7_error) /* "borg/platform/linux.pyx":94 * n, buf = _listxattr_inner(func, path) * return [name for name in split_string0(buf[:n]) * if name and not name.startswith(b'system.posix_acl_')] # <<<<<<<<<<<<<< * * */ } /* "borg/platform/linux.pyx":93 * * n, buf = _listxattr_inner(func, path) * return [name for name in split_string0(buf[:n]) # <<<<<<<<<<<<<< * if name and not name.startswith(b'system.posix_acl_')] * */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_7genexpr__pyx_v_name); __pyx_7genexpr__pyx_v_name = 0; goto __pyx_L14_exit_scope; __pyx_L7_error:; __Pyx_XDECREF(__pyx_7genexpr__pyx_v_name); __pyx_7genexpr__pyx_v_name = 0; goto __pyx_L1_error; __pyx_L14_exit_scope:; } /* exit inner scope */ __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/platform/linux.pyx":82 * * * def listxattr(path, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, buf, size): * if isinstance(path, int): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("borg.platform.linux.listxattr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_func); __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_buf); __Pyx_XDECREF(__pyx_7genexpr__pyx_v_name); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/linux.pyx":97 * * * def getxattr(path, name, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, name, buf, size): * if isinstance(path, int): */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_5linux_3getxattr(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8platform_5linux_3getxattr = {"getxattr", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_5linux_3getxattr, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8platform_5linux_3getxattr(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_path = 0; PyObject *__pyx_v_name = 0; PyObject *__pyx_v_follow_symlinks = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getxattr (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_name,&__pyx_n_s_follow_symlinks,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_path)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 97, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 97, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("getxattr", 1, 2, 2, 1); __PYX_ERR(0, 97, __pyx_L3_error) } } if (kw_args == 1) { const Py_ssize_t index = 2; PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 97, __pyx_L3_error) } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getxattr") < 0)) __PYX_ERR(0, 97, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_path = values[0]; __pyx_v_name = values[1]; __pyx_v_follow_symlinks = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getxattr", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 97, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.linux.getxattr", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_5linux_2getxattr(__pyx_self, __pyx_v_path, __pyx_v_name, __pyx_v_follow_symlinks); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/linux.pyx":98 * * def getxattr(path, name, *, follow_symlinks=False): * def func(path, name, buf, size): # <<<<<<<<<<<<<< * if isinstance(path, int): * return c_fgetxattr(path, name, buf, size) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_5linux_8getxattr_1func(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8platform_5linux_8getxattr_1func = {"func", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_5linux_8getxattr_1func, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8platform_5linux_8getxattr_1func(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_path = 0; PyObject *__pyx_v_name = 0; PyObject *__pyx_v_buf = 0; PyObject *__pyx_v_size = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("func (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_name,&__pyx_n_s_buf,&__pyx_n_s_size,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_path)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("func", 1, 4, 4, 1); __PYX_ERR(0, 98, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_buf)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("func", 1, 4, 4, 2); __PYX_ERR(0, 98, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("func", 1, 4, 4, 3); __PYX_ERR(0, 98, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "func") < 0)) __PYX_ERR(0, 98, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); } __pyx_v_path = values[0]; __pyx_v_name = values[1]; __pyx_v_buf = values[2]; __pyx_v_size = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("func", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 98, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.linux.getxattr.func", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_5linux_8getxattr_func(__pyx_self, __pyx_v_path, __pyx_v_name, __pyx_v_buf, __pyx_v_size); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8platform_5linux_8getxattr_func(PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_name, PyObject *__pyx_v_buf, PyObject *__pyx_v_size) { struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct_1_getxattr *__pyx_cur_scope; struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct_1_getxattr *__pyx_outer_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; char const *__pyx_t_3; char *__pyx_t_4; size_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; char const *__pyx_t_7; char const *__pyx_t_8; char const *__pyx_t_9; char const *__pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("func", 1); __pyx_outer_scope = (struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct_1_getxattr *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; /* "borg/platform/linux.pyx":99 * def getxattr(path, name, *, follow_symlinks=False): * def func(path, name, buf, size): * if isinstance(path, int): # <<<<<<<<<<<<<< * return c_fgetxattr(path, name, buf, size) * else: */ __pyx_t_1 = PyInt_Check(__pyx_v_path); if (__pyx_t_1) { /* "borg/platform/linux.pyx":100 * def func(path, name, buf, size): * if isinstance(path, int): * return c_fgetxattr(path, name, buf, size) # <<<<<<<<<<<<<< * else: * if follow_symlinks: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_path); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_AsWritableString(__pyx_v_buf); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_v_size); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error) __pyx_t_6 = PyInt_FromSsize_t(fgetxattr(__pyx_t_2, __pyx_t_3, ((char *)__pyx_t_4), __pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "borg/platform/linux.pyx":99 * def getxattr(path, name, *, follow_symlinks=False): * def func(path, name, buf, size): * if isinstance(path, int): # <<<<<<<<<<<<<< * return c_fgetxattr(path, name, buf, size) * else: */ } /* "borg/platform/linux.pyx":102 * return c_fgetxattr(path, name, buf, size) * else: * if follow_symlinks: # <<<<<<<<<<<<<< * return c_getxattr(path, name, buf, size) * else: */ /*else*/ { if (unlikely(!__pyx_cur_scope->__pyx_v_follow_symlinks)) { __Pyx_RaiseClosureNameError("follow_symlinks"); __PYX_ERR(0, 102, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_follow_symlinks); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 102, __pyx_L1_error) if (__pyx_t_1) { /* "borg/platform/linux.pyx":103 * else: * if follow_symlinks: * return c_getxattr(path, name, buf, size) # <<<<<<<<<<<<<< * else: * return c_lgetxattr(path, name, buf, size) */ __Pyx_XDECREF(__pyx_r); __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_path); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 103, __pyx_L1_error) __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 103, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_AsWritableString(__pyx_v_buf); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 103, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_v_size); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 103, __pyx_L1_error) __pyx_t_6 = PyInt_FromSsize_t(getxattr(__pyx_t_7, __pyx_t_8, ((char *)__pyx_t_4), __pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "borg/platform/linux.pyx":102 * return c_fgetxattr(path, name, buf, size) * else: * if follow_symlinks: # <<<<<<<<<<<<<< * return c_getxattr(path, name, buf, size) * else: */ } /* "borg/platform/linux.pyx":105 * return c_getxattr(path, name, buf, size) * else: * return c_lgetxattr(path, name, buf, size) # <<<<<<<<<<<<<< * * n, buf = _getxattr_inner(func, path, name) */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v_path); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L1_error) __pyx_t_10 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_AsWritableString(__pyx_v_buf); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_v_size); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L1_error) __pyx_t_6 = PyInt_FromSsize_t(lgetxattr(__pyx_t_9, __pyx_t_10, ((char *)__pyx_t_4), __pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; } } /* "borg/platform/linux.pyx":98 * * def getxattr(path, name, *, follow_symlinks=False): * def func(path, name, buf, size): # <<<<<<<<<<<<<< * if isinstance(path, int): * return c_fgetxattr(path, name, buf, size) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("borg.platform.linux.getxattr.func", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/linux.pyx":97 * * * def getxattr(path, name, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, name, buf, size): * if isinstance(path, int): */ static PyObject *__pyx_pf_4borg_8platform_5linux_2getxattr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_name, PyObject *__pyx_v_follow_symlinks) { struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct_1_getxattr *__pyx_cur_scope; PyObject *__pyx_v_func = 0; PyObject *__pyx_v_n = NULL; PyObject *__pyx_v_buf = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getxattr", 0); __pyx_cur_scope = (struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct_1_getxattr *)__pyx_tp_new_4borg_8platform_5linux___pyx_scope_struct_1_getxattr(__pyx_ptype_4borg_8platform_5linux___pyx_scope_struct_1_getxattr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct_1_getxattr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 97, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_follow_symlinks = __pyx_v_follow_symlinks; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_follow_symlinks); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_follow_symlinks); /* "borg/platform/linux.pyx":98 * * def getxattr(path, name, *, follow_symlinks=False): * def func(path, name, buf, size): # <<<<<<<<<<<<<< * if isinstance(path, int): * return c_fgetxattr(path, name, buf, size) */ __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_5linux_8getxattr_1func, 0, __pyx_n_s_getxattr_locals_func, ((PyObject*)__pyx_cur_scope), __pyx_n_s_borg_platform_linux, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_func = __pyx_t_1; __pyx_t_1 = 0; /* "borg/platform/linux.pyx":107 * return c_lgetxattr(path, name, buf, size) * * n, buf = _getxattr_inner(func, path, name) # <<<<<<<<<<<<<< * return bytes(buf[:n]) * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_getxattr_inner); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_func, __pyx_v_path, __pyx_v_name}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 3+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 107, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 107, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 107, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_n = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_buf = __pyx_t_3; __pyx_t_3 = 0; /* "borg/platform/linux.pyx":108 * * n, buf = _getxattr_inner(func, path, name) * return bytes(buf[:n]) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_buf, 0, 0, NULL, &__pyx_v_n, NULL, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "borg/platform/linux.pyx":97 * * * def getxattr(path, name, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, name, buf, size): * if isinstance(path, int): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("borg.platform.linux.getxattr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_func); __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_buf); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/linux.pyx":111 * * * def setxattr(path, name, value, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, name, value, size): * flags = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_5linux_5setxattr(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8platform_5linux_5setxattr = {"setxattr", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_5linux_5setxattr, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8platform_5linux_5setxattr(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_path = 0; PyObject *__pyx_v_name = 0; PyObject *__pyx_v_value = 0; PyObject *__pyx_v_follow_symlinks = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setxattr (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_name,&__pyx_n_s_value,&__pyx_n_s_follow_symlinks,0}; values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_path)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 111, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 111, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setxattr", 1, 3, 3, 1); __PYX_ERR(0, 111, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 111, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("setxattr", 1, 3, 3, 2); __PYX_ERR(0, 111, __pyx_L3_error) } } if (kw_args == 1) { const Py_ssize_t index = 3; PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 111, __pyx_L3_error) } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setxattr") < 0)) __PYX_ERR(0, 111, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_path = values[0]; __pyx_v_name = values[1]; __pyx_v_value = values[2]; __pyx_v_follow_symlinks = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setxattr", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 111, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.linux.setxattr", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_5linux_4setxattr(__pyx_self, __pyx_v_path, __pyx_v_name, __pyx_v_value, __pyx_v_follow_symlinks); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/linux.pyx":112 * * def setxattr(path, name, value, *, follow_symlinks=False): * def func(path, name, value, size): # <<<<<<<<<<<<<< * flags = 0 * if isinstance(path, int): */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_5linux_8setxattr_1func(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8platform_5linux_8setxattr_1func = {"func", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_5linux_8setxattr_1func, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8platform_5linux_8setxattr_1func(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_path = 0; PyObject *__pyx_v_name = 0; PyObject *__pyx_v_value = 0; PyObject *__pyx_v_size = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("func (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_name,&__pyx_n_s_value,&__pyx_n_s_size,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_path)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("func", 1, 4, 4, 1); __PYX_ERR(0, 112, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("func", 1, 4, 4, 2); __PYX_ERR(0, 112, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("func", 1, 4, 4, 3); __PYX_ERR(0, 112, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "func") < 0)) __PYX_ERR(0, 112, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); } __pyx_v_path = values[0]; __pyx_v_name = values[1]; __pyx_v_value = values[2]; __pyx_v_size = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("func", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 112, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.linux.setxattr.func", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_5linux_8setxattr_func(__pyx_self, __pyx_v_path, __pyx_v_name, __pyx_v_value, __pyx_v_size); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8platform_5linux_8setxattr_func(PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_name, PyObject *__pyx_v_value, PyObject *__pyx_v_size) { struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct_2_setxattr *__pyx_cur_scope; struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct_2_setxattr *__pyx_outer_scope; long __pyx_v_flags; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; char const *__pyx_t_3; char *__pyx_t_4; size_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; char const *__pyx_t_7; char const *__pyx_t_8; char const *__pyx_t_9; char const *__pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("func", 1); __pyx_outer_scope = (struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct_2_setxattr *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; /* "borg/platform/linux.pyx":113 * def setxattr(path, name, value, *, follow_symlinks=False): * def func(path, name, value, size): * flags = 0 # <<<<<<<<<<<<<< * if isinstance(path, int): * return c_fsetxattr(path, name, value, size, flags) */ __pyx_v_flags = 0; /* "borg/platform/linux.pyx":114 * def func(path, name, value, size): * flags = 0 * if isinstance(path, int): # <<<<<<<<<<<<<< * return c_fsetxattr(path, name, value, size, flags) * else: */ __pyx_t_1 = PyInt_Check(__pyx_v_path); if (__pyx_t_1) { /* "borg/platform/linux.pyx":115 * flags = 0 * if isinstance(path, int): * return c_fsetxattr(path, name, value, size, flags) # <<<<<<<<<<<<<< * else: * if follow_symlinks: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_path); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 115, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 115, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_AsWritableString(__pyx_v_value); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 115, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_v_size); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 115, __pyx_L1_error) __pyx_t_6 = __Pyx_PyInt_From_int(fsetxattr(__pyx_t_2, __pyx_t_3, ((char *)__pyx_t_4), __pyx_t_5, __pyx_v_flags)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "borg/platform/linux.pyx":114 * def func(path, name, value, size): * flags = 0 * if isinstance(path, int): # <<<<<<<<<<<<<< * return c_fsetxattr(path, name, value, size, flags) * else: */ } /* "borg/platform/linux.pyx":117 * return c_fsetxattr(path, name, value, size, flags) * else: * if follow_symlinks: # <<<<<<<<<<<<<< * return c_setxattr(path, name, value, size, flags) * else: */ /*else*/ { if (unlikely(!__pyx_cur_scope->__pyx_v_follow_symlinks)) { __Pyx_RaiseClosureNameError("follow_symlinks"); __PYX_ERR(0, 117, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_follow_symlinks); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 117, __pyx_L1_error) if (__pyx_t_1) { /* "borg/platform/linux.pyx":118 * else: * if follow_symlinks: * return c_setxattr(path, name, value, size, flags) # <<<<<<<<<<<<<< * else: * return c_lsetxattr(path, name, value, size, flags) */ __Pyx_XDECREF(__pyx_r); __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_path); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 118, __pyx_L1_error) __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 118, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_AsWritableString(__pyx_v_value); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 118, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_v_size); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 118, __pyx_L1_error) __pyx_t_6 = __Pyx_PyInt_From_int(setxattr(__pyx_t_7, __pyx_t_8, ((char *)__pyx_t_4), __pyx_t_5, __pyx_v_flags)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "borg/platform/linux.pyx":117 * return c_fsetxattr(path, name, value, size, flags) * else: * if follow_symlinks: # <<<<<<<<<<<<<< * return c_setxattr(path, name, value, size, flags) * else: */ } /* "borg/platform/linux.pyx":120 * return c_setxattr(path, name, value, size, flags) * else: * return c_lsetxattr(path, name, value, size, flags) # <<<<<<<<<<<<<< * * _setxattr_inner(func, path, name, value) */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v_path); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L1_error) __pyx_t_10 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_AsWritableString(__pyx_v_value); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_v_size); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L1_error) __pyx_t_6 = __Pyx_PyInt_From_int(lsetxattr(__pyx_t_9, __pyx_t_10, ((char *)__pyx_t_4), __pyx_t_5, __pyx_v_flags)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; } } /* "borg/platform/linux.pyx":112 * * def setxattr(path, name, value, *, follow_symlinks=False): * def func(path, name, value, size): # <<<<<<<<<<<<<< * flags = 0 * if isinstance(path, int): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("borg.platform.linux.setxattr.func", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/linux.pyx":111 * * * def setxattr(path, name, value, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, name, value, size): * flags = 0 */ static PyObject *__pyx_pf_4borg_8platform_5linux_4setxattr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_name, PyObject *__pyx_v_value, PyObject *__pyx_v_follow_symlinks) { struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct_2_setxattr *__pyx_cur_scope; PyObject *__pyx_v_func = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setxattr", 0); __pyx_cur_scope = (struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct_2_setxattr *)__pyx_tp_new_4borg_8platform_5linux___pyx_scope_struct_2_setxattr(__pyx_ptype_4borg_8platform_5linux___pyx_scope_struct_2_setxattr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct_2_setxattr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 111, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_follow_symlinks = __pyx_v_follow_symlinks; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_follow_symlinks); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_follow_symlinks); /* "borg/platform/linux.pyx":112 * * def setxattr(path, name, value, *, follow_symlinks=False): * def func(path, name, value, size): # <<<<<<<<<<<<<< * flags = 0 * if isinstance(path, int): */ __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_5linux_8setxattr_1func, 0, __pyx_n_s_setxattr_locals_func, ((PyObject*)__pyx_cur_scope), __pyx_n_s_borg_platform_linux, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_func = __pyx_t_1; __pyx_t_1 = 0; /* "borg/platform/linux.pyx":122 * return c_lsetxattr(path, name, value, size, flags) * * _setxattr_inner(func, path, name, value) # <<<<<<<<<<<<<< * * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_setxattr_inner); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_v_func, __pyx_v_path, __pyx_v_name, __pyx_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/platform/linux.pyx":111 * * * def setxattr(path, name, value, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, name, value, size): * flags = 0 */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("borg.platform.linux.setxattr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_func); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/linux.pyx":133 * * * def set_flags(path, bsd_flags, fd=None): # <<<<<<<<<<<<<< * if fd is None: * st = os.stat(path, follow_symlinks=False) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_5linux_7set_flags(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8platform_5linux_7set_flags = {"set_flags", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_5linux_7set_flags, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8platform_5linux_7set_flags(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_path = 0; PyObject *__pyx_v_bsd_flags = 0; PyObject *__pyx_v_fd = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_flags (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_bsd_flags,&__pyx_n_s_fd,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_path)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 133, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bsd_flags)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 133, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("set_flags", 0, 2, 3, 1); __PYX_ERR(0, 133, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fd); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 133, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_flags") < 0)) __PYX_ERR(0, 133, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_path = values[0]; __pyx_v_bsd_flags = values[1]; __pyx_v_fd = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_flags", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 133, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.linux.set_flags", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_5linux_6set_flags(__pyx_self, __pyx_v_path, __pyx_v_bsd_flags, __pyx_v_fd); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8platform_5linux_6set_flags(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_bsd_flags, PyObject *__pyx_v_fd) { PyObject *__pyx_v_st = NULL; int __pyx_v_flags; PyObject *__pyx_v_bsd_flag = NULL; PyObject *__pyx_v_linux_flag = NULL; PyObject *__pyx_v_open_fd = NULL; int __pyx_v_error_number; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_t_7; Py_ssize_t __pyx_t_8; Py_ssize_t __pyx_t_9; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; char *__pyx_t_12; char const *__pyx_t_13; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; int __pyx_t_20; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_flags", 0); __Pyx_INCREF(__pyx_v_fd); /* "borg/platform/linux.pyx":134 * * def set_flags(path, bsd_flags, fd=None): * if fd is None: # <<<<<<<<<<<<<< * st = os.stat(path, follow_symlinks=False) * if stat.S_ISBLK(st.st_mode) or stat.S_ISCHR(st.st_mode) or stat.S_ISLNK(st.st_mode): */ __pyx_t_1 = (__pyx_v_fd == Py_None); if (__pyx_t_1) { /* "borg/platform/linux.pyx":135 * def set_flags(path, bsd_flags, fd=None): * if fd is None: * st = os.stat(path, follow_symlinks=False) # <<<<<<<<<<<<<< * if stat.S_ISBLK(st.st_mode) or stat.S_ISCHR(st.st_mode) or stat.S_ISLNK(st.st_mode): * # see comment in get_flags() */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stat); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_path); __Pyx_GIVEREF(__pyx_v_path); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_path)) __PYX_ERR(0, 135, __pyx_L1_error); __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_follow_symlinks, Py_False) < 0) __PYX_ERR(0, 135, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_st = __pyx_t_5; __pyx_t_5 = 0; /* "borg/platform/linux.pyx":136 * if fd is None: * st = os.stat(path, follow_symlinks=False) * if stat.S_ISBLK(st.st_mode) or stat.S_ISCHR(st.st_mode) or stat.S_ISLNK(st.st_mode): # <<<<<<<<<<<<<< * # see comment in get_flags() * return */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_stat); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_S_ISBLK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_st, __pyx_n_s_st_mode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!__pyx_t_7) { } else { __pyx_t_1 = __pyx_t_7; goto __pyx_L5_bool_binop_done; } __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_stat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_S_ISCHR); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_st, __pyx_n_s_st_mode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_2}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!__pyx_t_7) { } else { __pyx_t_1 = __pyx_t_7; goto __pyx_L5_bool_binop_done; } __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_stat); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_S_ISLNK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_st, __pyx_n_s_st_mode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __pyx_t_7; __pyx_L5_bool_binop_done:; if (__pyx_t_1) { /* "borg/platform/linux.pyx":138 * if stat.S_ISBLK(st.st_mode) or stat.S_ISCHR(st.st_mode) or stat.S_ISLNK(st.st_mode): * # see comment in get_flags() * return # <<<<<<<<<<<<<< * cdef int flags = 0 * for bsd_flag, linux_flag in BSD_TO_LINUX_FLAGS.items(): */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "borg/platform/linux.pyx":136 * if fd is None: * st = os.stat(path, follow_symlinks=False) * if stat.S_ISBLK(st.st_mode) or stat.S_ISCHR(st.st_mode) or stat.S_ISLNK(st.st_mode): # <<<<<<<<<<<<<< * # see comment in get_flags() * return */ } /* "borg/platform/linux.pyx":134 * * def set_flags(path, bsd_flags, fd=None): * if fd is None: # <<<<<<<<<<<<<< * st = os.stat(path, follow_symlinks=False) * if stat.S_ISBLK(st.st_mode) or stat.S_ISCHR(st.st_mode) or stat.S_ISLNK(st.st_mode): */ } /* "borg/platform/linux.pyx":139 * # see comment in get_flags() * return * cdef int flags = 0 # <<<<<<<<<<<<<< * for bsd_flag, linux_flag in BSD_TO_LINUX_FLAGS.items(): * if bsd_flags & bsd_flag: */ __pyx_v_flags = 0; /* "borg/platform/linux.pyx":140 * return * cdef int flags = 0 * for bsd_flag, linux_flag in BSD_TO_LINUX_FLAGS.items(): # <<<<<<<<<<<<<< * if bsd_flags & bsd_flag: * flags |= linux_flag */ __pyx_t_8 = 0; __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BSD_TO_LINUX_FLAGS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(__pyx_t_2 == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 140, __pyx_L1_error) } __pyx_t_4 = __Pyx_dict_iterator(__pyx_t_2, 0, __pyx_n_s_items, (&__pyx_t_9), (&__pyx_t_6)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = __pyx_t_4; __pyx_t_4 = 0; while (1) { __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_9, &__pyx_t_8, &__pyx_t_4, &__pyx_t_2, NULL, __pyx_t_6); if (unlikely(__pyx_t_10 == 0)) break; if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_bsd_flag, __pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_linux_flag, __pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/linux.pyx":141 * cdef int flags = 0 * for bsd_flag, linux_flag in BSD_TO_LINUX_FLAGS.items(): * if bsd_flags & bsd_flag: # <<<<<<<<<<<<<< * flags |= linux_flag * open_fd = fd is None */ __pyx_t_2 = PyNumber_And(__pyx_v_bsd_flags, __pyx_v_bsd_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* "borg/platform/linux.pyx":142 * for bsd_flag, linux_flag in BSD_TO_LINUX_FLAGS.items(): * if bsd_flags & bsd_flag: * flags |= linux_flag # <<<<<<<<<<<<<< * open_fd = fd is None * if open_fd: */ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyNumber_InPlaceOr(__pyx_t_2, __pyx_v_linux_flag); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_flags = __pyx_t_10; /* "borg/platform/linux.pyx":141 * cdef int flags = 0 * for bsd_flag, linux_flag in BSD_TO_LINUX_FLAGS.items(): * if bsd_flags & bsd_flag: # <<<<<<<<<<<<<< * flags |= linux_flag * open_fd = fd is None */ } } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/platform/linux.pyx":143 * if bsd_flags & bsd_flag: * flags |= linux_flag * open_fd = fd is None # <<<<<<<<<<<<<< * if open_fd: * fd = os.open(path, os.O_RDONLY|os.O_NONBLOCK|os.O_NOFOLLOW) */ __pyx_t_1 = (__pyx_v_fd == Py_None); __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_open_fd = __pyx_t_5; __pyx_t_5 = 0; /* "borg/platform/linux.pyx":144 * flags |= linux_flag * open_fd = fd is None * if open_fd: # <<<<<<<<<<<<<< * fd = os.open(path, os.O_RDONLY|os.O_NONBLOCK|os.O_NOFOLLOW) * try: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_open_fd); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 144, __pyx_L1_error) if (__pyx_t_1) { /* "borg/platform/linux.pyx":145 * open_fd = fd is None * if open_fd: * fd = os.open(path, os.O_RDONLY|os.O_NONBLOCK|os.O_NOFOLLOW) # <<<<<<<<<<<<<< * try: * if ioctl(fd, FS_IOC_SETFLAGS, &flags) == -1: */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_O_RDONLY); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_O_NONBLOCK); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyNumber_Or(__pyx_t_3, __pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_os); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_O_NOFOLLOW); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = PyNumber_Or(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_path, __pyx_t_11}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF_SET(__pyx_v_fd, __pyx_t_5); __pyx_t_5 = 0; /* "borg/platform/linux.pyx":144 * flags |= linux_flag * open_fd = fd is None * if open_fd: # <<<<<<<<<<<<<< * fd = os.open(path, os.O_RDONLY|os.O_NONBLOCK|os.O_NOFOLLOW) * try: */ } /* "borg/platform/linux.pyx":146 * if open_fd: * fd = os.open(path, os.O_RDONLY|os.O_NONBLOCK|os.O_NOFOLLOW) * try: # <<<<<<<<<<<<<< * if ioctl(fd, FS_IOC_SETFLAGS, &flags) == -1: * error_number = errno.errno */ /*try:*/ { /* "borg/platform/linux.pyx":147 * fd = os.open(path, os.O_RDONLY|os.O_NONBLOCK|os.O_NOFOLLOW) * try: * if ioctl(fd, FS_IOC_SETFLAGS, &flags) == -1: # <<<<<<<<<<<<<< * error_number = errno.errno * if error_number != errno.EOPNOTSUPP: */ __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_fd); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L13_error) __pyx_t_1 = (ioctl(__pyx_t_6, FS_IOC_SETFLAGS, (&__pyx_v_flags)) == -1L); if (__pyx_t_1) { /* "borg/platform/linux.pyx":148 * try: * if ioctl(fd, FS_IOC_SETFLAGS, &flags) == -1: * error_number = errno.errno # <<<<<<<<<<<<<< * if error_number != errno.EOPNOTSUPP: * raise OSError(error_number, strerror(error_number).decode(), path) */ __pyx_v_error_number = errno; /* "borg/platform/linux.pyx":149 * if ioctl(fd, FS_IOC_SETFLAGS, &flags) == -1: * error_number = errno.errno * if error_number != errno.EOPNOTSUPP: # <<<<<<<<<<<<<< * raise OSError(error_number, strerror(error_number).decode(), path) * finally: */ __pyx_t_1 = (__pyx_v_error_number != EOPNOTSUPP); if (unlikely(__pyx_t_1)) { /* "borg/platform/linux.pyx":150 * error_number = errno.errno * if error_number != errno.EOPNOTSUPP: * raise OSError(error_number, strerror(error_number).decode(), path) # <<<<<<<<<<<<<< * finally: * if open_fd: */ __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_error_number); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 150, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_12 = strerror(__pyx_v_error_number); __pyx_t_9 = __Pyx_ssize_strlen(__pyx_t_12); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 150, __pyx_L13_error) __pyx_t_2 = __Pyx_decode_c_string(__pyx_t_12, 0, __pyx_t_9, NULL, NULL, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 150, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5)) __PYX_ERR(0, 150, __pyx_L13_error); __Pyx_INCREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_2)) __PYX_ERR(0, 150, __pyx_L13_error); __Pyx_INCREF(__pyx_v_path); __Pyx_GIVEREF(__pyx_v_path); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_v_path)) __PYX_ERR(0, 150, __pyx_L13_error); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 150, __pyx_L13_error) /* "borg/platform/linux.pyx":149 * if ioctl(fd, FS_IOC_SETFLAGS, &flags) == -1: * error_number = errno.errno * if error_number != errno.EOPNOTSUPP: # <<<<<<<<<<<<<< * raise OSError(error_number, strerror(error_number).decode(), path) * finally: */ } /* "borg/platform/linux.pyx":147 * fd = os.open(path, os.O_RDONLY|os.O_NONBLOCK|os.O_NOFOLLOW) * try: * if ioctl(fd, FS_IOC_SETFLAGS, &flags) == -1: # <<<<<<<<<<<<<< * error_number = errno.errno * if error_number != errno.EOPNOTSUPP: */ } } /* "borg/platform/linux.pyx":152 * raise OSError(error_number, strerror(error_number).decode(), path) * finally: * if open_fd: # <<<<<<<<<<<<<< * os.close(fd) * */ /*finally:*/ { /*normal exit:*/{ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_open_fd); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 152, __pyx_L1_error) if (__pyx_t_1) { /* "borg/platform/linux.pyx":153 * finally: * if open_fd: * os.close(fd) # <<<<<<<<<<<<<< * * */ __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_os); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_close); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_fd}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/linux.pyx":152 * raise OSError(error_number, strerror(error_number).decode(), path) * finally: * if open_fd: # <<<<<<<<<<<<<< * os.close(fd) * */ } goto __pyx_L14; } __pyx_L13_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __pyx_t_6 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_13 = __pyx_filename; { __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_open_fd); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 152, __pyx_L19_error) if (__pyx_t_1) { /* "borg/platform/linux.pyx":153 * finally: * if open_fd: * os.close(fd) # <<<<<<<<<<<<<< * * */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 153, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_close); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 153, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_20 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_11))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); __pyx_t_20 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_fd}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_20, 1+__pyx_t_20); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/linux.pyx":152 * raise OSError(error_number, strerror(error_number).decode(), path) * finally: * if open_fd: # <<<<<<<<<<<<<< * os.close(fd) * */ } } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19); } __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ErrRestore(__pyx_t_14, __pyx_t_15, __pyx_t_16); __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_13; goto __pyx_L1_error; __pyx_L19_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19); } __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; goto __pyx_L1_error; } __pyx_L14:; } /* "borg/platform/linux.pyx":133 * * * def set_flags(path, bsd_flags, fd=None): # <<<<<<<<<<<<<< * if fd is None: * st = os.stat(path, follow_symlinks=False) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("borg.platform.linux.set_flags", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_st); __Pyx_XDECREF(__pyx_v_bsd_flag); __Pyx_XDECREF(__pyx_v_linux_flag); __Pyx_XDECREF(__pyx_v_open_fd); __Pyx_XDECREF(__pyx_v_fd); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/linux.pyx":156 * * * def get_flags(path, st, fd=None): # <<<<<<<<<<<<<< * if stat.S_ISBLK(st.st_mode) or stat.S_ISCHR(st.st_mode) or stat.S_ISLNK(st.st_mode): * # avoid opening devices files - trying to open non-present devices can be rather slow. */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_5linux_9get_flags(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8platform_5linux_9get_flags = {"get_flags", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_5linux_9get_flags, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8platform_5linux_9get_flags(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_path = 0; PyObject *__pyx_v_st = 0; PyObject *__pyx_v_fd = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_flags (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_st,&__pyx_n_s_fd,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_path)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 156, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 156, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("get_flags", 0, 2, 3, 1); __PYX_ERR(0, 156, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fd); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 156, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_flags") < 0)) __PYX_ERR(0, 156, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_path = values[0]; __pyx_v_st = values[1]; __pyx_v_fd = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_flags", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 156, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.linux.get_flags", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_5linux_8get_flags(__pyx_self, __pyx_v_path, __pyx_v_st, __pyx_v_fd); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8platform_5linux_8get_flags(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_st, PyObject *__pyx_v_fd) { int __pyx_v_linux_flags; PyObject *__pyx_v_open_fd = NULL; PyObject *__pyx_v_bsd_flags = NULL; PyObject *__pyx_v_bsd_flag = NULL; PyObject *__pyx_v_linux_flag = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; char const *__pyx_t_13; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; int __pyx_t_17; Py_ssize_t __pyx_t_18; Py_ssize_t __pyx_t_19; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_flags", 0); __Pyx_INCREF(__pyx_v_fd); /* "borg/platform/linux.pyx":157 * * def get_flags(path, st, fd=None): * if stat.S_ISBLK(st.st_mode) or stat.S_ISCHR(st.st_mode) or stat.S_ISLNK(st.st_mode): # <<<<<<<<<<<<<< * # avoid opening devices files - trying to open non-present devices can be rather slow. * # avoid opening symlinks, O_NOFOLLOW would make the open() fail anyway. */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_stat); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_S_ISBLK); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_st, __pyx_n_s_st_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_7) { } else { __pyx_t_1 = __pyx_t_7; goto __pyx_L4_bool_binop_done; } __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_stat); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_S_ISCHR); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_st, __pyx_n_s_st_mode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_7) { } else { __pyx_t_1 = __pyx_t_7; goto __pyx_L4_bool_binop_done; } __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_stat); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_S_ISLNK); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_st, __pyx_n_s_st_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __pyx_t_7; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "borg/platform/linux.pyx":160 * # avoid opening devices files - trying to open non-present devices can be rather slow. * # avoid opening symlinks, O_NOFOLLOW would make the open() fail anyway. * return 0 # <<<<<<<<<<<<<< * cdef int linux_flags * open_fd = fd is None */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_int_0); __pyx_r = __pyx_int_0; goto __pyx_L0; /* "borg/platform/linux.pyx":157 * * def get_flags(path, st, fd=None): * if stat.S_ISBLK(st.st_mode) or stat.S_ISCHR(st.st_mode) or stat.S_ISLNK(st.st_mode): # <<<<<<<<<<<<<< * # avoid opening devices files - trying to open non-present devices can be rather slow. * # avoid opening symlinks, O_NOFOLLOW would make the open() fail anyway. */ } /* "borg/platform/linux.pyx":162 * return 0 * cdef int linux_flags * open_fd = fd is None # <<<<<<<<<<<<<< * if open_fd: * try: */ __pyx_t_1 = (__pyx_v_fd == Py_None); __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_open_fd = __pyx_t_2; __pyx_t_2 = 0; /* "borg/platform/linux.pyx":163 * cdef int linux_flags * open_fd = fd is None * if open_fd: # <<<<<<<<<<<<<< * try: * fd = os.open(path, os.O_RDONLY|os.O_NONBLOCK|os.O_NOFOLLOW) */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_open_fd); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 163, __pyx_L1_error) if (__pyx_t_1) { /* "borg/platform/linux.pyx":164 * open_fd = fd is None * if open_fd: * try: # <<<<<<<<<<<<<< * fd = os.open(path, os.O_RDONLY|os.O_NONBLOCK|os.O_NOFOLLOW) * except OSError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); /*try:*/ { /* "borg/platform/linux.pyx":165 * if open_fd: * try: * fd = os.open(path, os.O_RDONLY|os.O_NONBLOCK|os.O_NOFOLLOW) # <<<<<<<<<<<<<< * except OSError: * return 0 */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_open); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_O_RDONLY); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 165, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_O_NONBLOCK); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 165, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyNumber_Or(__pyx_t_5, __pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_os); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 165, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_O_NOFOLLOW); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 165, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = PyNumber_Or(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 165, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_path, __pyx_t_11}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF_SET(__pyx_v_fd, __pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/linux.pyx":164 * open_fd = fd is None * if open_fd: * try: # <<<<<<<<<<<<<< * fd = os.open(path, os.O_RDONLY|os.O_NONBLOCK|os.O_NOFOLLOW) * except OSError: */ } __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L13_try_end; __pyx_L8_error:; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/platform/linux.pyx":166 * try: * fd = os.open(path, os.O_RDONLY|os.O_NONBLOCK|os.O_NOFOLLOW) * except OSError: # <<<<<<<<<<<<<< * return 0 * try: */ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_OSError); if (__pyx_t_6) { __Pyx_AddTraceback("borg.platform.linux.get_flags", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_11) < 0) __PYX_ERR(0, 166, __pyx_L10_except_error) __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_11); /* "borg/platform/linux.pyx":167 * fd = os.open(path, os.O_RDONLY|os.O_NONBLOCK|os.O_NOFOLLOW) * except OSError: * return 0 # <<<<<<<<<<<<<< * try: * if ioctl(fd, FS_IOC_GETFLAGS, &linux_flags) == -1: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_int_0); __pyx_r = __pyx_int_0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L11_except_return; } goto __pyx_L10_except_error; /* "borg/platform/linux.pyx":164 * open_fd = fd is None * if open_fd: * try: # <<<<<<<<<<<<<< * fd = os.open(path, os.O_RDONLY|os.O_NONBLOCK|os.O_NOFOLLOW) * except OSError: */ __pyx_L10_except_error:; __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); goto __pyx_L1_error; __pyx_L11_except_return:; __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); goto __pyx_L0; __pyx_L13_try_end:; } /* "borg/platform/linux.pyx":163 * cdef int linux_flags * open_fd = fd is None * if open_fd: # <<<<<<<<<<<<<< * try: * fd = os.open(path, os.O_RDONLY|os.O_NONBLOCK|os.O_NOFOLLOW) */ } /* "borg/platform/linux.pyx":168 * except OSError: * return 0 * try: # <<<<<<<<<<<<<< * if ioctl(fd, FS_IOC_GETFLAGS, &linux_flags) == -1: * return 0 */ /*try:*/ { /* "borg/platform/linux.pyx":169 * return 0 * try: * if ioctl(fd, FS_IOC_GETFLAGS, &linux_flags) == -1: # <<<<<<<<<<<<<< * return 0 * finally: */ __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_fd); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 169, __pyx_L17_error) __pyx_t_1 = (ioctl(__pyx_t_6, FS_IOC_GETFLAGS, (&__pyx_v_linux_flags)) == -1L); if (__pyx_t_1) { /* "borg/platform/linux.pyx":170 * try: * if ioctl(fd, FS_IOC_GETFLAGS, &linux_flags) == -1: * return 0 # <<<<<<<<<<<<<< * finally: * if open_fd: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_int_0); __pyx_r = __pyx_int_0; goto __pyx_L16_return; /* "borg/platform/linux.pyx":169 * return 0 * try: * if ioctl(fd, FS_IOC_GETFLAGS, &linux_flags) == -1: # <<<<<<<<<<<<<< * return 0 * finally: */ } } /* "borg/platform/linux.pyx":172 * return 0 * finally: * if open_fd: # <<<<<<<<<<<<<< * os.close(fd) * bsd_flags = 0 */ /*finally:*/ { /*normal exit:*/{ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_open_fd); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 172, __pyx_L1_error) if (__pyx_t_1) { /* "borg/platform/linux.pyx":173 * finally: * if open_fd: * os.close(fd) # <<<<<<<<<<<<<< * bsd_flags = 0 * for bsd_flag, linux_flag in BSD_TO_LINUX_FLAGS.items(): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_fd}; __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "borg/platform/linux.pyx":172 * return 0 * finally: * if open_fd: # <<<<<<<<<<<<<< * os.close(fd) * bsd_flags = 0 */ } goto __pyx_L18; } __pyx_L17_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_10 = 0; __pyx_t_9 = 0; __pyx_t_8 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __pyx_t_6 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename; { __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_open_fd); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 172, __pyx_L22_error) if (__pyx_t_1) { /* "borg/platform/linux.pyx":173 * finally: * if open_fd: * os.close(fd) # <<<<<<<<<<<<<< * bsd_flags = 0 * for bsd_flag, linux_flag in BSD_TO_LINUX_FLAGS.items(): */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 173, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_close); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 173, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_17 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_17 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_fd}; __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_17, 1+__pyx_t_17); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 173, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "borg/platform/linux.pyx":172 * return 0 * finally: * if open_fd: # <<<<<<<<<<<<<< * os.close(fd) * bsd_flags = 0 */ } } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); } __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ErrRestore(__pyx_t_10, __pyx_t_9, __pyx_t_8); __pyx_t_10 = 0; __pyx_t_9 = 0; __pyx_t_8 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13; goto __pyx_L1_error; __pyx_L22_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); } __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; goto __pyx_L1_error; } __pyx_L16_return: { __pyx_t_16 = __pyx_r; __pyx_r = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_open_fd); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 172, __pyx_L1_error) if (__pyx_t_1) { /* "borg/platform/linux.pyx":173 * finally: * if open_fd: * os.close(fd) # <<<<<<<<<<<<<< * bsd_flags = 0 * for bsd_flag, linux_flag in BSD_TO_LINUX_FLAGS.items(): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_12 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_12 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_fd}; __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "borg/platform/linux.pyx":172 * return 0 * finally: * if open_fd: # <<<<<<<<<<<<<< * os.close(fd) * bsd_flags = 0 */ } __pyx_r = __pyx_t_16; __pyx_t_16 = 0; goto __pyx_L0; } __pyx_L18:; } /* "borg/platform/linux.pyx":174 * if open_fd: * os.close(fd) * bsd_flags = 0 # <<<<<<<<<<<<<< * for bsd_flag, linux_flag in BSD_TO_LINUX_FLAGS.items(): * if linux_flags & linux_flag: */ __Pyx_INCREF(__pyx_int_0); __pyx_v_bsd_flags = __pyx_int_0; /* "borg/platform/linux.pyx":175 * os.close(fd) * bsd_flags = 0 * for bsd_flag, linux_flag in BSD_TO_LINUX_FLAGS.items(): # <<<<<<<<<<<<<< * if linux_flags & linux_flag: * bsd_flags |= bsd_flag */ __pyx_t_18 = 0; __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BSD_TO_LINUX_FLAGS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(__pyx_t_2 == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 175, __pyx_L1_error) } __pyx_t_3 = __Pyx_dict_iterator(__pyx_t_2, 0, __pyx_n_s_items, (&__pyx_t_19), (&__pyx_t_12)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = __pyx_t_3; __pyx_t_3 = 0; while (1) { __pyx_t_6 = __Pyx_dict_iter_next(__pyx_t_11, __pyx_t_19, &__pyx_t_18, &__pyx_t_3, &__pyx_t_2, NULL, __pyx_t_12); if (unlikely(__pyx_t_6 == 0)) break; if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_bsd_flag, __pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_linux_flag, __pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/linux.pyx":176 * bsd_flags = 0 * for bsd_flag, linux_flag in BSD_TO_LINUX_FLAGS.items(): * if linux_flags & linux_flag: # <<<<<<<<<<<<<< * bsd_flags |= bsd_flag * return bsd_flags */ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_linux_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_And(__pyx_t_2, __pyx_v_linux_flag); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { /* "borg/platform/linux.pyx":177 * for bsd_flag, linux_flag in BSD_TO_LINUX_FLAGS.items(): * if linux_flags & linux_flag: * bsd_flags |= bsd_flag # <<<<<<<<<<<<<< * return bsd_flags * */ __pyx_t_3 = PyNumber_InPlaceOr(__pyx_v_bsd_flags, __pyx_v_bsd_flag); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_bsd_flags, __pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/linux.pyx":176 * bsd_flags = 0 * for bsd_flag, linux_flag in BSD_TO_LINUX_FLAGS.items(): * if linux_flags & linux_flag: # <<<<<<<<<<<<<< * bsd_flags |= bsd_flag * return bsd_flags */ } } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "borg/platform/linux.pyx":178 * if linux_flags & linux_flag: * bsd_flags |= bsd_flag * return bsd_flags # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_bsd_flags); __pyx_r = __pyx_v_bsd_flags; goto __pyx_L0; /* "borg/platform/linux.pyx":156 * * * def get_flags(path, st, fd=None): # <<<<<<<<<<<<<< * if stat.S_ISBLK(st.st_mode) or stat.S_ISCHR(st.st_mode) or stat.S_ISLNK(st.st_mode): * # avoid opening devices files - trying to open non-present devices can be rather slow. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("borg.platform.linux.get_flags", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_open_fd); __Pyx_XDECREF(__pyx_v_bsd_flags); __Pyx_XDECREF(__pyx_v_bsd_flag); __Pyx_XDECREF(__pyx_v_linux_flag); __Pyx_XDECREF(__pyx_v_fd); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/linux.pyx":181 * * * def acl_use_local_uid_gid(acl): # <<<<<<<<<<<<<< * """Replace the user/group field with the local uid/gid if possible * """ */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_5linux_11acl_use_local_uid_gid(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_8platform_5linux_10acl_use_local_uid_gid, "Replace the user/group field with the local uid/gid if possible\n "); static PyMethodDef __pyx_mdef_4borg_8platform_5linux_11acl_use_local_uid_gid = {"acl_use_local_uid_gid", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_5linux_11acl_use_local_uid_gid, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_8platform_5linux_10acl_use_local_uid_gid}; static PyObject *__pyx_pw_4borg_8platform_5linux_11acl_use_local_uid_gid(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_acl = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("acl_use_local_uid_gid (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_acl,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_acl)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "acl_use_local_uid_gid") < 0)) __PYX_ERR(0, 181, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_acl = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("acl_use_local_uid_gid", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 181, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.linux.acl_use_local_uid_gid", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_5linux_10acl_use_local_uid_gid(__pyx_self, __pyx_v_acl); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8platform_5linux_10acl_use_local_uid_gid(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_acl) { PyObject *__pyx_v_entries = NULL; PyObject *__pyx_v_entry = NULL; PyObject *__pyx_v_fields = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; Py_ssize_t __pyx_t_6; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("acl_use_local_uid_gid", 1); /* "borg/platform/linux.pyx":184 * """Replace the user/group field with the local uid/gid if possible * """ * entries = [] # <<<<<<<<<<<<<< * for entry in safe_decode(acl).split('\n'): * if entry: */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_entries = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "borg/platform/linux.pyx":185 * """ * entries = [] * for entry in safe_decode(acl).split('\n'): # <<<<<<<<<<<<<< * if entry: * fields = entry.split(':') */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_safe_decode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_acl}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_s__7}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 185, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_3))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 185, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 185, __pyx_L1_error) #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 185, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 185, __pyx_L1_error) #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 185, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_entry, __pyx_t_1); __pyx_t_1 = 0; /* "borg/platform/linux.pyx":186 * entries = [] * for entry in safe_decode(acl).split('\n'): * if entry: # <<<<<<<<<<<<<< * fields = entry.split(':') * if fields[0] == 'user' and fields[1]: */ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_entry); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 186, __pyx_L1_error) if (__pyx_t_8) { /* "borg/platform/linux.pyx":187 * for entry in safe_decode(acl).split('\n'): * if entry: * fields = entry.split(':') # <<<<<<<<<<<<<< * if fields[0] == 'user' and fields[1]: * fields[1] = str(user2uid(fields[1], fields[3])) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_entry, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s__8}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_XDECREF_SET(__pyx_v_fields, __pyx_t_1); __pyx_t_1 = 0; /* "borg/platform/linux.pyx":188 * if entry: * fields = entry.split(':') * if fields[0] == 'user' and fields[1]: # <<<<<<<<<<<<<< * fields[1] = str(user2uid(fields[1], fields[3])) * elif fields[0] == 'group' and fields[1]: */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_fields, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_user, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_9) { } else { __pyx_t_8 = __pyx_t_9; goto __pyx_L7_bool_binop_done; } __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_fields, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = __pyx_t_9; __pyx_L7_bool_binop_done:; if (__pyx_t_8) { /* "borg/platform/linux.pyx":189 * fields = entry.split(':') * if fields[0] == 'user' and fields[1]: * fields[1] = str(user2uid(fields[1], fields[3])) # <<<<<<<<<<<<<< * elif fields[0] == 'group' and fields[1]: * fields[1] = str(group2gid(fields[1], fields[3])) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_user2uid); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_fields, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_fields, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_4, __pyx_t_10}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_2 = __Pyx_PyObject_Str(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely((__Pyx_SetItemInt(__pyx_v_fields, 1, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0))) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/linux.pyx":188 * if entry: * fields = entry.split(':') * if fields[0] == 'user' and fields[1]: # <<<<<<<<<<<<<< * fields[1] = str(user2uid(fields[1], fields[3])) * elif fields[0] == 'group' and fields[1]: */ goto __pyx_L6; } /* "borg/platform/linux.pyx":190 * if fields[0] == 'user' and fields[1]: * fields[1] = str(user2uid(fields[1], fields[3])) * elif fields[0] == 'group' and fields[1]: # <<<<<<<<<<<<<< * fields[1] = str(group2gid(fields[1], fields[3])) * entries.append(':'.join(fields[:3])) */ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_fields, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_group, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_9) { } else { __pyx_t_8 = __pyx_t_9; goto __pyx_L9_bool_binop_done; } __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_fields, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = __pyx_t_9; __pyx_L9_bool_binop_done:; if (__pyx_t_8) { /* "borg/platform/linux.pyx":191 * fields[1] = str(user2uid(fields[1], fields[3])) * elif fields[0] == 'group' and fields[1]: * fields[1] = str(group2gid(fields[1], fields[3])) # <<<<<<<<<<<<<< * entries.append(':'.join(fields[:3])) * return safe_encode('\n'.join(entries)) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_group2gid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_fields, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_fields, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_10, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_t_1 = __Pyx_PyObject_Str(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely((__Pyx_SetItemInt(__pyx_v_fields, 1, __pyx_t_1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0))) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/platform/linux.pyx":190 * if fields[0] == 'user' and fields[1]: * fields[1] = str(user2uid(fields[1], fields[3])) * elif fields[0] == 'group' and fields[1]: # <<<<<<<<<<<<<< * fields[1] = str(group2gid(fields[1], fields[3])) * entries.append(':'.join(fields[:3])) */ } __pyx_L6:; /* "borg/platform/linux.pyx":192 * elif fields[0] == 'group' and fields[1]: * fields[1] = str(group2gid(fields[1], fields[3])) * entries.append(':'.join(fields[:3])) # <<<<<<<<<<<<<< * return safe_encode('\n'.join(entries)) * */ __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_fields, 0, 3, NULL, NULL, &__pyx_slice__9, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__8, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_entries, __pyx_t_2); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 192, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/linux.pyx":186 * entries = [] * for entry in safe_decode(acl).split('\n'): * if entry: # <<<<<<<<<<<<<< * fields = entry.split(':') * if fields[0] == 'user' and fields[1]: */ } /* "borg/platform/linux.pyx":185 * """ * entries = [] * for entry in safe_decode(acl).split('\n'): # <<<<<<<<<<<<<< * if entry: * fields = entry.split(':') */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/linux.pyx":193 * fields[1] = str(group2gid(fields[1], fields[3])) * entries.append(':'.join(fields[:3])) * return safe_encode('\n'.join(entries)) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_safe_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__7, __pyx_v_entries); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_1}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "borg/platform/linux.pyx":181 * * * def acl_use_local_uid_gid(acl): # <<<<<<<<<<<<<< * """Replace the user/group field with the local uid/gid if possible * """ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("borg.platform.linux.acl_use_local_uid_gid", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_entries); __Pyx_XDECREF(__pyx_v_entry); __Pyx_XDECREF(__pyx_v_fields); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/linux.pyx":196 * * * cdef acl_append_numeric_ids(acl): # <<<<<<<<<<<<<< * """Extend the "POSIX 1003.1e draft standard 17" format with an additional uid/gid field * """ */ static PyObject *__pyx_f_4borg_8platform_5linux_acl_append_numeric_ids(PyObject *__pyx_v_acl) { PyObject *__pyx_v_entries = NULL; PyObject *__pyx_v_entry = NULL; PyObject *__pyx_v_type = NULL; PyObject *__pyx_v_name = NULL; PyObject *__pyx_v_permission = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; Py_ssize_t __pyx_t_8; PyObject *(*__pyx_t_9)(PyObject *); int __pyx_t_10; PyObject *(*__pyx_t_11)(PyObject *); int __pyx_t_12; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("acl_append_numeric_ids", 1); /* "borg/platform/linux.pyx":199 * """Extend the "POSIX 1003.1e draft standard 17" format with an additional uid/gid field * """ * entries = [] # <<<<<<<<<<<<<< * for entry in _comment_re.sub('', safe_decode(acl)).split('\n'): * if entry: */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_entries = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "borg/platform/linux.pyx":200 * """ * entries = [] * for entry in _comment_re.sub('', safe_decode(acl)).split('\n'): # <<<<<<<<<<<<<< * if entry: * type, name, permission = entry.split(':') */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_comment_re); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sub); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_safe_decode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_acl}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_kp_s__10, __pyx_t_3}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_s__7}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 200, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_9)) { if (likely(PyList_CheckExact(__pyx_t_4))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 200, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 200, __pyx_L1_error) #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 200, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 200, __pyx_L1_error) #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 200, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_entry, __pyx_t_1); __pyx_t_1 = 0; /* "borg/platform/linux.pyx":201 * entries = [] * for entry in _comment_re.sub('', safe_decode(acl)).split('\n'): * if entry: # <<<<<<<<<<<<<< * type, name, permission = entry.split(':') * if name and type == 'user': */ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_entry); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 201, __pyx_L1_error) if (__pyx_t_10) { /* "borg/platform/linux.pyx":202 * for entry in _comment_re.sub('', safe_decode(acl)).split('\n'): * if entry: * type, name, permission = entry.split(':') # <<<<<<<<<<<<<< * if name and type == 'user': * entries.append(':'.join([type, name, permission, str(user2uid(name, name))])) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_entry, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s__8}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 202, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_2 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 2; __pyx_t_5 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_6), 3) < 0) __PYX_ERR(0, 202, __pyx_L1_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 202, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_type, __pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_permission, __pyx_t_5); __pyx_t_5 = 0; /* "borg/platform/linux.pyx":203 * if entry: * type, name, permission = entry.split(':') * if name and type == 'user': # <<<<<<<<<<<<<< * entries.append(':'.join([type, name, permission, str(user2uid(name, name))])) * elif name and type == 'group': */ __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_name); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 203, __pyx_L1_error) if (__pyx_t_12) { } else { __pyx_t_10 = __pyx_t_12; goto __pyx_L9_bool_binop_done; } __pyx_t_12 = (__Pyx_PyString_Equals(__pyx_v_type, __pyx_n_s_user, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 203, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __pyx_L9_bool_binop_done:; if (__pyx_t_10) { /* "borg/platform/linux.pyx":204 * type, name, permission = entry.split(':') * if name and type == 'user': * entries.append(':'.join([type, name, permission, str(user2uid(name, name))])) # <<<<<<<<<<<<<< * elif name and type == 'group': * entries.append(':'.join([type, name, permission, str(group2gid(name, name))])) */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_user2uid); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_name, __pyx_v_name}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_5 = __Pyx_PyObject_Str(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyList_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_type); __Pyx_GIVEREF(__pyx_v_type); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_type)) __PYX_ERR(0, 204, __pyx_L1_error); __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_v_name)) __PYX_ERR(0, 204, __pyx_L1_error); __Pyx_INCREF(__pyx_v_permission); __Pyx_GIVEREF(__pyx_v_permission); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_v_permission)) __PYX_ERR(0, 204, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_t_5)) __PYX_ERR(0, 204, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyString_Join(__pyx_kp_s__8, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_entries, __pyx_t_5); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "borg/platform/linux.pyx":203 * if entry: * type, name, permission = entry.split(':') * if name and type == 'user': # <<<<<<<<<<<<<< * entries.append(':'.join([type, name, permission, str(user2uid(name, name))])) * elif name and type == 'group': */ goto __pyx_L8; } /* "borg/platform/linux.pyx":205 * if name and type == 'user': * entries.append(':'.join([type, name, permission, str(user2uid(name, name))])) * elif name and type == 'group': # <<<<<<<<<<<<<< * entries.append(':'.join([type, name, permission, str(group2gid(name, name))])) * else: */ __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_name); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 205, __pyx_L1_error) if (__pyx_t_12) { } else { __pyx_t_10 = __pyx_t_12; goto __pyx_L11_bool_binop_done; } __pyx_t_12 = (__Pyx_PyString_Equals(__pyx_v_type, __pyx_n_s_group, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 205, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __pyx_L11_bool_binop_done:; if (__pyx_t_10) { /* "borg/platform/linux.pyx":206 * entries.append(':'.join([type, name, permission, str(user2uid(name, name))])) * elif name and type == 'group': * entries.append(':'.join([type, name, permission, str(group2gid(name, name))])) # <<<<<<<<<<<<<< * else: * entries.append(entry) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_group2gid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_name, __pyx_v_name}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_t_1 = __Pyx_PyObject_Str(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyList_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_type); __Pyx_GIVEREF(__pyx_v_type); if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_v_type)) __PYX_ERR(0, 206, __pyx_L1_error); __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_v_name)) __PYX_ERR(0, 206, __pyx_L1_error); __Pyx_INCREF(__pyx_v_permission); __Pyx_GIVEREF(__pyx_v_permission); if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 2, __pyx_v_permission)) __PYX_ERR(0, 206, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 3, __pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__8, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_entries, __pyx_t_1); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/platform/linux.pyx":205 * if name and type == 'user': * entries.append(':'.join([type, name, permission, str(user2uid(name, name))])) * elif name and type == 'group': # <<<<<<<<<<<<<< * entries.append(':'.join([type, name, permission, str(group2gid(name, name))])) * else: */ goto __pyx_L8; } /* "borg/platform/linux.pyx":208 * entries.append(':'.join([type, name, permission, str(group2gid(name, name))])) * else: * entries.append(entry) # <<<<<<<<<<<<<< * return safe_encode('\n'.join(entries)) * */ /*else*/ { __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_entries, __pyx_v_entry); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 208, __pyx_L1_error) } __pyx_L8:; /* "borg/platform/linux.pyx":201 * entries = [] * for entry in _comment_re.sub('', safe_decode(acl)).split('\n'): * if entry: # <<<<<<<<<<<<<< * type, name, permission = entry.split(':') * if name and type == 'user': */ } /* "borg/platform/linux.pyx":200 * """ * entries = [] * for entry in _comment_re.sub('', safe_decode(acl)).split('\n'): # <<<<<<<<<<<<<< * if entry: * type, name, permission = entry.split(':') */ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "borg/platform/linux.pyx":209 * else: * entries.append(entry) * return safe_encode('\n'.join(entries)) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_safe_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyString_Join(__pyx_kp_s__7, __pyx_v_entries); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "borg/platform/linux.pyx":196 * * * cdef acl_append_numeric_ids(acl): # <<<<<<<<<<<<<< * """Extend the "POSIX 1003.1e draft standard 17" format with an additional uid/gid field * """ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("borg.platform.linux.acl_append_numeric_ids", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_entries); __Pyx_XDECREF(__pyx_v_entry); __Pyx_XDECREF(__pyx_v_type); __Pyx_XDECREF(__pyx_v_name); __Pyx_XDECREF(__pyx_v_permission); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/linux.pyx":212 * * * cdef acl_numeric_ids(acl): # <<<<<<<<<<<<<< * """Replace the "POSIX 1003.1e draft standard 17" user/group field with uid/gid * """ */ static PyObject *__pyx_f_4borg_8platform_5linux_acl_numeric_ids(PyObject *__pyx_v_acl) { PyObject *__pyx_v_entries = NULL; PyObject *__pyx_v_entry = NULL; PyObject *__pyx_v_type = NULL; PyObject *__pyx_v_name = NULL; PyObject *__pyx_v_permission = NULL; PyObject *__pyx_v_uid = NULL; PyObject *__pyx_v_gid = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; Py_ssize_t __pyx_t_8; PyObject *(*__pyx_t_9)(PyObject *); int __pyx_t_10; PyObject *(*__pyx_t_11)(PyObject *); int __pyx_t_12; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("acl_numeric_ids", 1); /* "borg/platform/linux.pyx":215 * """Replace the "POSIX 1003.1e draft standard 17" user/group field with uid/gid * """ * entries = [] # <<<<<<<<<<<<<< * for entry in _comment_re.sub('', safe_decode(acl)).split('\n'): * if entry: */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_entries = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "borg/platform/linux.pyx":216 * """ * entries = [] * for entry in _comment_re.sub('', safe_decode(acl)).split('\n'): # <<<<<<<<<<<<<< * if entry: * type, name, permission = entry.split(':') */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_comment_re); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sub); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_safe_decode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_acl}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_kp_s__10, __pyx_t_3}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_s__7}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 216, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_9)) { if (likely(PyList_CheckExact(__pyx_t_4))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 216, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 216, __pyx_L1_error) #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 216, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 216, __pyx_L1_error) #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 216, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_entry, __pyx_t_1); __pyx_t_1 = 0; /* "borg/platform/linux.pyx":217 * entries = [] * for entry in _comment_re.sub('', safe_decode(acl)).split('\n'): * if entry: # <<<<<<<<<<<<<< * type, name, permission = entry.split(':') * if name and type == 'user': */ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_entry); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 217, __pyx_L1_error) if (__pyx_t_10) { /* "borg/platform/linux.pyx":218 * for entry in _comment_re.sub('', safe_decode(acl)).split('\n'): * if entry: * type, name, permission = entry.split(':') # <<<<<<<<<<<<<< * if name and type == 'user': * uid = str(user2uid(name, name)) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_entry, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s__8}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 218, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_2 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 2; __pyx_t_5 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_6), 3) < 0) __PYX_ERR(0, 218, __pyx_L1_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 218, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_type, __pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_permission, __pyx_t_5); __pyx_t_5 = 0; /* "borg/platform/linux.pyx":219 * if entry: * type, name, permission = entry.split(':') * if name and type == 'user': # <<<<<<<<<<<<<< * uid = str(user2uid(name, name)) * entries.append(':'.join([type, uid, permission, uid])) */ __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_name); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 219, __pyx_L1_error) if (__pyx_t_12) { } else { __pyx_t_10 = __pyx_t_12; goto __pyx_L9_bool_binop_done; } __pyx_t_12 = (__Pyx_PyString_Equals(__pyx_v_type, __pyx_n_s_user, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 219, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __pyx_L9_bool_binop_done:; if (__pyx_t_10) { /* "borg/platform/linux.pyx":220 * type, name, permission = entry.split(':') * if name and type == 'user': * uid = str(user2uid(name, name)) # <<<<<<<<<<<<<< * entries.append(':'.join([type, uid, permission, uid])) * elif name and type == 'group': */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_user2uid); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_name, __pyx_v_name}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_5 = __Pyx_PyObject_Str(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_uid, __pyx_t_5); __pyx_t_5 = 0; /* "borg/platform/linux.pyx":221 * if name and type == 'user': * uid = str(user2uid(name, name)) * entries.append(':'.join([type, uid, permission, uid])) # <<<<<<<<<<<<<< * elif name and type == 'group': * gid = str(group2gid(name, name)) */ __pyx_t_5 = PyList_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_type); __Pyx_GIVEREF(__pyx_v_type); if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_v_type)) __PYX_ERR(0, 221, __pyx_L1_error); __Pyx_INCREF(__pyx_v_uid); __Pyx_GIVEREF(__pyx_v_uid); if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_v_uid)) __PYX_ERR(0, 221, __pyx_L1_error); __Pyx_INCREF(__pyx_v_permission); __Pyx_GIVEREF(__pyx_v_permission); if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 2, __pyx_v_permission)) __PYX_ERR(0, 221, __pyx_L1_error); __Pyx_INCREF(__pyx_v_uid); __Pyx_GIVEREF(__pyx_v_uid); if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 3, __pyx_v_uid)) __PYX_ERR(0, 221, __pyx_L1_error); __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__8, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_entries, __pyx_t_1); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/platform/linux.pyx":219 * if entry: * type, name, permission = entry.split(':') * if name and type == 'user': # <<<<<<<<<<<<<< * uid = str(user2uid(name, name)) * entries.append(':'.join([type, uid, permission, uid])) */ goto __pyx_L8; } /* "borg/platform/linux.pyx":222 * uid = str(user2uid(name, name)) * entries.append(':'.join([type, uid, permission, uid])) * elif name and type == 'group': # <<<<<<<<<<<<<< * gid = str(group2gid(name, name)) * entries.append(':'.join([type, gid, permission, gid])) */ __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_name); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 222, __pyx_L1_error) if (__pyx_t_12) { } else { __pyx_t_10 = __pyx_t_12; goto __pyx_L11_bool_binop_done; } __pyx_t_12 = (__Pyx_PyString_Equals(__pyx_v_type, __pyx_n_s_group, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 222, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __pyx_L11_bool_binop_done:; if (__pyx_t_10) { /* "borg/platform/linux.pyx":223 * entries.append(':'.join([type, uid, permission, uid])) * elif name and type == 'group': * gid = str(group2gid(name, name)) # <<<<<<<<<<<<<< * entries.append(':'.join([type, gid, permission, gid])) * else: */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_group2gid); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_name, __pyx_v_name}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_5 = __Pyx_PyObject_Str(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_gid, __pyx_t_5); __pyx_t_5 = 0; /* "borg/platform/linux.pyx":224 * elif name and type == 'group': * gid = str(group2gid(name, name)) * entries.append(':'.join([type, gid, permission, gid])) # <<<<<<<<<<<<<< * else: * entries.append(entry) */ __pyx_t_5 = PyList_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_type); __Pyx_GIVEREF(__pyx_v_type); if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_v_type)) __PYX_ERR(0, 224, __pyx_L1_error); __Pyx_INCREF(__pyx_v_gid); __Pyx_GIVEREF(__pyx_v_gid); if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_v_gid)) __PYX_ERR(0, 224, __pyx_L1_error); __Pyx_INCREF(__pyx_v_permission); __Pyx_GIVEREF(__pyx_v_permission); if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 2, __pyx_v_permission)) __PYX_ERR(0, 224, __pyx_L1_error); __Pyx_INCREF(__pyx_v_gid); __Pyx_GIVEREF(__pyx_v_gid); if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 3, __pyx_v_gid)) __PYX_ERR(0, 224, __pyx_L1_error); __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__8, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_entries, __pyx_t_1); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/platform/linux.pyx":222 * uid = str(user2uid(name, name)) * entries.append(':'.join([type, uid, permission, uid])) * elif name and type == 'group': # <<<<<<<<<<<<<< * gid = str(group2gid(name, name)) * entries.append(':'.join([type, gid, permission, gid])) */ goto __pyx_L8; } /* "borg/platform/linux.pyx":226 * entries.append(':'.join([type, gid, permission, gid])) * else: * entries.append(entry) # <<<<<<<<<<<<<< * return safe_encode('\n'.join(entries)) * */ /*else*/ { __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_entries, __pyx_v_entry); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 226, __pyx_L1_error) } __pyx_L8:; /* "borg/platform/linux.pyx":217 * entries = [] * for entry in _comment_re.sub('', safe_decode(acl)).split('\n'): * if entry: # <<<<<<<<<<<<<< * type, name, permission = entry.split(':') * if name and type == 'user': */ } /* "borg/platform/linux.pyx":216 * """ * entries = [] * for entry in _comment_re.sub('', safe_decode(acl)).split('\n'): # <<<<<<<<<<<<<< * if entry: * type, name, permission = entry.split(':') */ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "borg/platform/linux.pyx":227 * else: * entries.append(entry) * return safe_encode('\n'.join(entries)) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_safe_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyString_Join(__pyx_kp_s__7, __pyx_v_entries); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "borg/platform/linux.pyx":212 * * * cdef acl_numeric_ids(acl): # <<<<<<<<<<<<<< * """Replace the "POSIX 1003.1e draft standard 17" user/group field with uid/gid * """ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("borg.platform.linux.acl_numeric_ids", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_entries); __Pyx_XDECREF(__pyx_v_entry); __Pyx_XDECREF(__pyx_v_type); __Pyx_XDECREF(__pyx_v_name); __Pyx_XDECREF(__pyx_v_permission); __Pyx_XDECREF(__pyx_v_uid); __Pyx_XDECREF(__pyx_v_gid); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/linux.pyx":230 * * * def acl_get(path, item, st, numeric_ids=False, fd=None): # <<<<<<<<<<<<<< * cdef acl_t default_acl = NULL * cdef acl_t access_acl = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_5linux_13acl_get(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8platform_5linux_13acl_get = {"acl_get", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_5linux_13acl_get, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8platform_5linux_13acl_get(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_path = 0; PyObject *__pyx_v_item = 0; PyObject *__pyx_v_st = 0; PyObject *__pyx_v_numeric_ids = 0; PyObject *__pyx_v_fd = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("acl_get (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_item,&__pyx_n_s_st,&__pyx_n_s_numeric_ids,&__pyx_n_s_fd,0}; values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_path)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_item)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("acl_get", 0, 3, 5, 1); __PYX_ERR(0, 230, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_st)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("acl_get", 0, 3, 5, 2); __PYX_ERR(0, 230, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_numeric_ids); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fd); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "acl_get") < 0)) __PYX_ERR(0, 230, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_path = values[0]; __pyx_v_item = values[1]; __pyx_v_st = values[2]; __pyx_v_numeric_ids = values[3]; __pyx_v_fd = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("acl_get", 0, 3, 5, __pyx_nargs); __PYX_ERR(0, 230, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.linux.acl_get", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_5linux_12acl_get(__pyx_self, __pyx_v_path, __pyx_v_item, __pyx_v_st, __pyx_v_numeric_ids, __pyx_v_fd); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8platform_5linux_12acl_get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_item, PyObject *__pyx_v_st, PyObject *__pyx_v_numeric_ids, PyObject *__pyx_v_fd) { acl_t __pyx_v_default_acl; acl_t __pyx_v_access_acl; char *__pyx_v_default_text; char *__pyx_v_access_text; int __pyx_v_ret; PyObject *(*__pyx_v_converter)(PyObject *); PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; char const *__pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; char const *__pyx_t_9; int __pyx_t_10; char const *__pyx_t_11; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; char const *__pyx_t_18; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("acl_get", 0); __Pyx_INCREF(__pyx_v_path); /* "borg/platform/linux.pyx":231 * * def acl_get(path, item, st, numeric_ids=False, fd=None): * cdef acl_t default_acl = NULL # <<<<<<<<<<<<<< * cdef acl_t access_acl = NULL * cdef char *default_text = NULL */ __pyx_v_default_acl = NULL; /* "borg/platform/linux.pyx":232 * def acl_get(path, item, st, numeric_ids=False, fd=None): * cdef acl_t default_acl = NULL * cdef acl_t access_acl = NULL # <<<<<<<<<<<<<< * cdef char *default_text = NULL * cdef char *access_text = NULL */ __pyx_v_access_acl = NULL; /* "borg/platform/linux.pyx":233 * cdef acl_t default_acl = NULL * cdef acl_t access_acl = NULL * cdef char *default_text = NULL # <<<<<<<<<<<<<< * cdef char *access_text = NULL * cdef int ret = 0 */ __pyx_v_default_text = NULL; /* "borg/platform/linux.pyx":234 * cdef acl_t access_acl = NULL * cdef char *default_text = NULL * cdef char *access_text = NULL # <<<<<<<<<<<<<< * cdef int ret = 0 * */ __pyx_v_access_text = NULL; /* "borg/platform/linux.pyx":235 * cdef char *default_text = NULL * cdef char *access_text = NULL * cdef int ret = 0 # <<<<<<<<<<<<<< * * if isinstance(path, str): */ __pyx_v_ret = 0; /* "borg/platform/linux.pyx":237 * cdef int ret = 0 * * if isinstance(path, str): # <<<<<<<<<<<<<< * path = os.fsencode(path) * if fd is not None: */ __pyx_t_1 = PyString_Check(__pyx_v_path); if (__pyx_t_1) { /* "borg/platform/linux.pyx":238 * * if isinstance(path, str): * path = os.fsencode(path) # <<<<<<<<<<<<<< * if fd is not None: * ret = acl_extended_fd(fd) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_fsencode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_path}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_path, __pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/linux.pyx":237 * cdef int ret = 0 * * if isinstance(path, str): # <<<<<<<<<<<<<< * path = os.fsencode(path) * if fd is not None: */ } /* "borg/platform/linux.pyx":239 * if isinstance(path, str): * path = os.fsencode(path) * if fd is not None: # <<<<<<<<<<<<<< * ret = acl_extended_fd(fd) * else: */ __pyx_t_1 = (__pyx_v_fd != Py_None); if (__pyx_t_1) { /* "borg/platform/linux.pyx":240 * path = os.fsencode(path) * if fd is not None: * ret = acl_extended_fd(fd) # <<<<<<<<<<<<<< * else: * ret = acl_extended_file_nofollow(path) */ __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_fd); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 240, __pyx_L1_error) __pyx_v_ret = acl_extended_fd(__pyx_t_5); /* "borg/platform/linux.pyx":239 * if isinstance(path, str): * path = os.fsencode(path) * if fd is not None: # <<<<<<<<<<<<<< * ret = acl_extended_fd(fd) * else: */ goto __pyx_L4; } /* "borg/platform/linux.pyx":242 * ret = acl_extended_fd(fd) * else: * ret = acl_extended_file_nofollow(path) # <<<<<<<<<<<<<< * if ret < 0: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) */ /*else*/ { __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_path); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 242, __pyx_L1_error) __pyx_v_ret = acl_extended_file_nofollow(__pyx_t_6); } __pyx_L4:; /* "borg/platform/linux.pyx":243 * else: * ret = acl_extended_file_nofollow(path) * if ret < 0: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * if ret == 0: */ __pyx_t_1 = (__pyx_v_ret < 0); if (unlikely(__pyx_t_1)) { /* "borg/platform/linux.pyx":244 * ret = acl_extended_file_nofollow(path) * if ret < 0: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) # <<<<<<<<<<<<<< * if ret == 0: * # there is no ACL defining permissions other than those defined by the traditional file permission bits. */ __pyx_t_2 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_strerror); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_3}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_fsdecode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_path}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2)) __PYX_ERR(0, 244, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_4)) __PYX_ERR(0, 244, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7)) __PYX_ERR(0, 244, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __PYX_ERR(0, 244, __pyx_L1_error) /* "borg/platform/linux.pyx":243 * else: * ret = acl_extended_file_nofollow(path) * if ret < 0: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * if ret == 0: */ } /* "borg/platform/linux.pyx":245 * if ret < 0: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * if ret == 0: # <<<<<<<<<<<<<< * # there is no ACL defining permissions other than those defined by the traditional file permission bits. * # note: this should also be the case for symlink fs objects, as they can not have ACLs. */ __pyx_t_1 = (__pyx_v_ret == 0); if (__pyx_t_1) { /* "borg/platform/linux.pyx":248 * # there is no ACL defining permissions other than those defined by the traditional file permission bits. * # note: this should also be the case for symlink fs objects, as they can not have ACLs. * return # <<<<<<<<<<<<<< * if numeric_ids: * converter = acl_numeric_ids */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "borg/platform/linux.pyx":245 * if ret < 0: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * if ret == 0: # <<<<<<<<<<<<<< * # there is no ACL defining permissions other than those defined by the traditional file permission bits. * # note: this should also be the case for symlink fs objects, as they can not have ACLs. */ } /* "borg/platform/linux.pyx":249 * # note: this should also be the case for symlink fs objects, as they can not have ACLs. * return * if numeric_ids: # <<<<<<<<<<<<<< * converter = acl_numeric_ids * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_numeric_ids); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 249, __pyx_L1_error) if (__pyx_t_1) { /* "borg/platform/linux.pyx":250 * return * if numeric_ids: * converter = acl_numeric_ids # <<<<<<<<<<<<<< * else: * converter = acl_append_numeric_ids */ __pyx_v_converter = __pyx_f_4borg_8platform_5linux_acl_numeric_ids; /* "borg/platform/linux.pyx":249 * # note: this should also be the case for symlink fs objects, as they can not have ACLs. * return * if numeric_ids: # <<<<<<<<<<<<<< * converter = acl_numeric_ids * else: */ goto __pyx_L7; } /* "borg/platform/linux.pyx":252 * converter = acl_numeric_ids * else: * converter = acl_append_numeric_ids # <<<<<<<<<<<<<< * try: * if fd is not None: */ /*else*/ { __pyx_v_converter = __pyx_f_4borg_8platform_5linux_acl_append_numeric_ids; } __pyx_L7:; /* "borg/platform/linux.pyx":253 * else: * converter = acl_append_numeric_ids * try: # <<<<<<<<<<<<<< * if fd is not None: * access_acl = acl_get_fd(fd) */ /*try:*/ { /* "borg/platform/linux.pyx":254 * converter = acl_append_numeric_ids * try: * if fd is not None: # <<<<<<<<<<<<<< * access_acl = acl_get_fd(fd) * else: */ __pyx_t_1 = (__pyx_v_fd != Py_None); if (__pyx_t_1) { /* "borg/platform/linux.pyx":255 * try: * if fd is not None: * access_acl = acl_get_fd(fd) # <<<<<<<<<<<<<< * else: * access_acl = acl_get_file(path, ACL_TYPE_ACCESS) */ __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_fd); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 255, __pyx_L9_error) __pyx_v_access_acl = acl_get_fd(__pyx_t_5); /* "borg/platform/linux.pyx":254 * converter = acl_append_numeric_ids * try: * if fd is not None: # <<<<<<<<<<<<<< * access_acl = acl_get_fd(fd) * else: */ goto __pyx_L11; } /* "borg/platform/linux.pyx":257 * access_acl = acl_get_fd(fd) * else: * access_acl = acl_get_file(path, ACL_TYPE_ACCESS) # <<<<<<<<<<<<<< * if access_acl == NULL: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) */ /*else*/ { __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v_path); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 257, __pyx_L9_error) __pyx_v_access_acl = acl_get_file(__pyx_t_9, ACL_TYPE_ACCESS); } __pyx_L11:; /* "borg/platform/linux.pyx":258 * else: * access_acl = acl_get_file(path, ACL_TYPE_ACCESS) * if access_acl == NULL: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * access_text = acl_to_text(access_acl, NULL) */ __pyx_t_1 = (__pyx_v_access_acl == NULL); if (unlikely(__pyx_t_1)) { /* "borg/platform/linux.pyx":259 * access_acl = acl_get_file(path, ACL_TYPE_ACCESS) * if access_acl == NULL: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) # <<<<<<<<<<<<<< * access_text = acl_to_text(access_acl, NULL) * if access_text == NULL: */ __pyx_t_7 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 259, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 259, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_strerror); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 259, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4}; __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 259, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 259, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_fsdecode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_path}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7)) __PYX_ERR(0, 259, __pyx_L9_error); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_8)) __PYX_ERR(0, 259, __pyx_L9_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(0, 259, __pyx_L9_error); __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 259, __pyx_L9_error) /* "borg/platform/linux.pyx":258 * else: * access_acl = acl_get_file(path, ACL_TYPE_ACCESS) * if access_acl == NULL: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * access_text = acl_to_text(access_acl, NULL) */ } /* "borg/platform/linux.pyx":260 * if access_acl == NULL: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * access_text = acl_to_text(access_acl, NULL) # <<<<<<<<<<<<<< * if access_text == NULL: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) */ __pyx_v_access_text = acl_to_text(__pyx_v_access_acl, NULL); /* "borg/platform/linux.pyx":261 * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * access_text = acl_to_text(access_acl, NULL) * if access_text == NULL: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * item['acl_access'] = converter(access_text) */ __pyx_t_1 = (__pyx_v_access_text == NULL); if (unlikely(__pyx_t_1)) { /* "borg/platform/linux.pyx":262 * access_text = acl_to_text(access_acl, NULL) * if access_text == NULL: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) # <<<<<<<<<<<<<< * item['acl_access'] = converter(access_text) * finally: */ __pyx_t_2 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_os); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 262, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_strerror); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 262, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 262, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_8}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 262, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_os); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 262, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_fsdecode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 262, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_path}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 262, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 262, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 262, __pyx_L9_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 262, __pyx_L9_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_7)) __PYX_ERR(0, 262, __pyx_L9_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 262, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __PYX_ERR(0, 262, __pyx_L9_error) /* "borg/platform/linux.pyx":261 * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * access_text = acl_to_text(access_acl, NULL) * if access_text == NULL: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * item['acl_access'] = converter(access_text) */ } /* "borg/platform/linux.pyx":263 * if access_text == NULL: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * item['acl_access'] = converter(access_text) # <<<<<<<<<<<<<< * finally: * acl_free(access_text) */ __pyx_t_7 = __Pyx_PyBytes_FromString(__pyx_v_access_text); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 263, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __pyx_v_converter(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 263, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely((PyObject_SetItem(__pyx_v_item, __pyx_n_s_acl_access, __pyx_t_4) < 0))) __PYX_ERR(0, 263, __pyx_L9_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } /* "borg/platform/linux.pyx":265 * item['acl_access'] = converter(access_text) * finally: * acl_free(access_text) # <<<<<<<<<<<<<< * acl_free(access_acl) * if stat.S_ISDIR(st.st_mode): */ /*finally:*/ { /*normal exit:*/{ (void)(acl_free(__pyx_v_access_text)); /* "borg/platform/linux.pyx":266 * finally: * acl_free(access_text) * acl_free(access_acl) # <<<<<<<<<<<<<< * if stat.S_ISDIR(st.st_mode): * # only directories can have a default ACL. there is no fd-based api to get it. */ (void)(acl_free(__pyx_v_access_acl)); goto __pyx_L10; } __pyx_L9_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __pyx_t_5 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename; { /* "borg/platform/linux.pyx":265 * item['acl_access'] = converter(access_text) * finally: * acl_free(access_text) # <<<<<<<<<<<<<< * acl_free(access_acl) * if stat.S_ISDIR(st.st_mode): */ (void)(acl_free(__pyx_v_access_text)); /* "borg/platform/linux.pyx":266 * finally: * acl_free(access_text) * acl_free(access_acl) # <<<<<<<<<<<<<< * if stat.S_ISDIR(st.st_mode): * # only directories can have a default ACL. there is no fd-based api to get it. */ (void)(acl_free(__pyx_v_access_acl)); } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); } __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14); __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11; goto __pyx_L1_error; } __pyx_L10:; } /* "borg/platform/linux.pyx":267 * acl_free(access_text) * acl_free(access_acl) * if stat.S_ISDIR(st.st_mode): # <<<<<<<<<<<<<< * # only directories can have a default ACL. there is no fd-based api to get it. * try: */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_stat); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_S_ISDIR); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_st, __pyx_n_s_st_mode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_2 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_7}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { /* "borg/platform/linux.pyx":269 * if stat.S_ISDIR(st.st_mode): * # only directories can have a default ACL. there is no fd-based api to get it. * try: # <<<<<<<<<<<<<< * default_acl = acl_get_file(path, ACL_TYPE_DEFAULT) * if default_acl == NULL: */ /*try:*/ { /* "borg/platform/linux.pyx":270 * # only directories can have a default ACL. there is no fd-based api to get it. * try: * default_acl = acl_get_file(path, ACL_TYPE_DEFAULT) # <<<<<<<<<<<<<< * if default_acl == NULL: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) */ __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v_path); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 270, __pyx_L18_error) __pyx_v_default_acl = acl_get_file(__pyx_t_9, ACL_TYPE_DEFAULT); /* "borg/platform/linux.pyx":271 * try: * default_acl = acl_get_file(path, ACL_TYPE_DEFAULT) * if default_acl == NULL: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * default_text = acl_to_text(default_acl, NULL) */ __pyx_t_1 = (__pyx_v_default_acl == NULL); if (unlikely(__pyx_t_1)) { /* "borg/platform/linux.pyx":272 * default_acl = acl_get_file(path, ACL_TYPE_DEFAULT) * if default_acl == NULL: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) # <<<<<<<<<<<<<< * default_text = acl_to_text(default_acl, NULL) * if default_text == NULL: */ __pyx_t_4 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_os); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 272, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_strerror); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 272, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_7}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_os); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 272, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_fsdecode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 272, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_path}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 272, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4)) __PYX_ERR(0, 272, __pyx_L18_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3)) __PYX_ERR(0, 272, __pyx_L18_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_2)) __PYX_ERR(0, 272, __pyx_L18_error); __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 272, __pyx_L18_error) /* "borg/platform/linux.pyx":271 * try: * default_acl = acl_get_file(path, ACL_TYPE_DEFAULT) * if default_acl == NULL: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * default_text = acl_to_text(default_acl, NULL) */ } /* "borg/platform/linux.pyx":273 * if default_acl == NULL: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * default_text = acl_to_text(default_acl, NULL) # <<<<<<<<<<<<<< * if default_text == NULL: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) */ __pyx_v_default_text = acl_to_text(__pyx_v_default_acl, NULL); /* "borg/platform/linux.pyx":274 * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * default_text = acl_to_text(default_acl, NULL) * if default_text == NULL: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * item['acl_default'] = converter(default_text) */ __pyx_t_1 = (__pyx_v_default_text == NULL); if (unlikely(__pyx_t_1)) { /* "borg/platform/linux.pyx":275 * default_text = acl_to_text(default_acl, NULL) * if default_text == NULL: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) # <<<<<<<<<<<<<< * item['acl_default'] = converter(default_text) * finally: */ __pyx_t_2 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 275, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 275, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_strerror); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 275, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 275, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_3}; __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 275, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 275, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_fsdecode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 275, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_path}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 275, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 275, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2)) __PYX_ERR(0, 275, __pyx_L18_error); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8)) __PYX_ERR(0, 275, __pyx_L18_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_4)) __PYX_ERR(0, 275, __pyx_L18_error); __pyx_t_2 = 0; __pyx_t_8 = 0; __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 275, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 275, __pyx_L18_error) /* "borg/platform/linux.pyx":274 * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * default_text = acl_to_text(default_acl, NULL) * if default_text == NULL: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * item['acl_default'] = converter(default_text) */ } /* "borg/platform/linux.pyx":276 * if default_text == NULL: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * item['acl_default'] = converter(default_text) # <<<<<<<<<<<<<< * finally: * acl_free(default_text) */ __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_default_text); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 276, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __pyx_v_converter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 276, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely((PyObject_SetItem(__pyx_v_item, __pyx_n_s_acl_default, __pyx_t_7) < 0))) __PYX_ERR(0, 276, __pyx_L18_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } /* "borg/platform/linux.pyx":278 * item['acl_default'] = converter(default_text) * finally: * acl_free(default_text) # <<<<<<<<<<<<<< * acl_free(default_acl) * */ /*finally:*/ { /*normal exit:*/{ (void)(acl_free(__pyx_v_default_text)); /* "borg/platform/linux.pyx":279 * finally: * acl_free(default_text) * acl_free(default_acl) # <<<<<<<<<<<<<< * * */ (void)(acl_free(__pyx_v_default_acl)); goto __pyx_L19; } __pyx_L18_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_17 = 0; __pyx_t_16 = 0; __pyx_t_15 = 0; __pyx_t_14 = 0; __pyx_t_13 = 0; __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_13, &__pyx_t_12); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_16, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_16, &__pyx_t_15); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_12); __pyx_t_10 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_18 = __pyx_filename; { /* "borg/platform/linux.pyx":278 * item['acl_default'] = converter(default_text) * finally: * acl_free(default_text) # <<<<<<<<<<<<<< * acl_free(default_acl) * */ (void)(acl_free(__pyx_v_default_text)); /* "borg/platform/linux.pyx":279 * finally: * acl_free(default_text) * acl_free(default_acl) # <<<<<<<<<<<<<< * * */ (void)(acl_free(__pyx_v_default_acl)); } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_13, __pyx_t_12); } __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ErrRestore(__pyx_t_17, __pyx_t_16, __pyx_t_15); __pyx_t_17 = 0; __pyx_t_16 = 0; __pyx_t_15 = 0; __pyx_t_14 = 0; __pyx_t_13 = 0; __pyx_t_12 = 0; __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_18; goto __pyx_L1_error; } __pyx_L19:; } /* "borg/platform/linux.pyx":267 * acl_free(access_text) * acl_free(access_acl) * if stat.S_ISDIR(st.st_mode): # <<<<<<<<<<<<<< * # only directories can have a default ACL. there is no fd-based api to get it. * try: */ } /* "borg/platform/linux.pyx":230 * * * def acl_get(path, item, st, numeric_ids=False, fd=None): # <<<<<<<<<<<<<< * cdef acl_t default_acl = NULL * cdef acl_t access_acl = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("borg.platform.linux.acl_get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_path); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/linux.pyx":282 * * * def acl_set(path, item, numeric_ids=False, fd=None): # <<<<<<<<<<<<<< * cdef acl_t access_acl = NULL * cdef acl_t default_acl = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_5linux_15acl_set(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8platform_5linux_15acl_set = {"acl_set", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_5linux_15acl_set, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8platform_5linux_15acl_set(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_path = 0; PyObject *__pyx_v_item = 0; PyObject *__pyx_v_numeric_ids = 0; PyObject *__pyx_v_fd = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("acl_set (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_item,&__pyx_n_s_numeric_ids,&__pyx_n_s_fd,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_path)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 282, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_item)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 282, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("acl_set", 0, 2, 4, 1); __PYX_ERR(0, 282, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_numeric_ids); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 282, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fd); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 282, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "acl_set") < 0)) __PYX_ERR(0, 282, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_path = values[0]; __pyx_v_item = values[1]; __pyx_v_numeric_ids = values[2]; __pyx_v_fd = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("acl_set", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 282, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.linux.acl_set", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_5linux_14acl_set(__pyx_self, __pyx_v_path, __pyx_v_item, __pyx_v_numeric_ids, __pyx_v_fd); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8platform_5linux_14acl_set(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_item, PyObject *__pyx_v_numeric_ids, PyObject *__pyx_v_fd) { acl_t __pyx_v_access_acl; acl_t __pyx_v_default_acl; PyObject *__pyx_v_converter = NULL; PyObject *__pyx_v_access_text = NULL; PyObject *__pyx_v_default_text = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; char const *__pyx_t_7; PyObject *__pyx_t_8 = NULL; char const *__pyx_t_9; int __pyx_t_10; char const *__pyx_t_11; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; char const *__pyx_t_18; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("acl_set", 0); __Pyx_INCREF(__pyx_v_path); /* "borg/platform/linux.pyx":283 * * def acl_set(path, item, numeric_ids=False, fd=None): * cdef acl_t access_acl = NULL # <<<<<<<<<<<<<< * cdef acl_t default_acl = NULL * */ __pyx_v_access_acl = NULL; /* "borg/platform/linux.pyx":284 * def acl_set(path, item, numeric_ids=False, fd=None): * cdef acl_t access_acl = NULL * cdef acl_t default_acl = NULL # <<<<<<<<<<<<<< * * if stat.S_ISLNK(item.get('mode', 0)): */ __pyx_v_default_acl = NULL; /* "borg/platform/linux.pyx":286 * cdef acl_t default_acl = NULL * * if stat.S_ISLNK(item.get('mode', 0)): # <<<<<<<<<<<<<< * # Linux does not support setting ACLs on symlinks * return */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_stat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_S_ISLNK); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { /* "borg/platform/linux.pyx":288 * if stat.S_ISLNK(item.get('mode', 0)): * # Linux does not support setting ACLs on symlinks * return # <<<<<<<<<<<<<< * * if isinstance(path, str): */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "borg/platform/linux.pyx":286 * cdef acl_t default_acl = NULL * * if stat.S_ISLNK(item.get('mode', 0)): # <<<<<<<<<<<<<< * # Linux does not support setting ACLs on symlinks * return */ } /* "borg/platform/linux.pyx":290 * return * * if isinstance(path, str): # <<<<<<<<<<<<<< * path = os.fsencode(path) * if numeric_ids: */ __pyx_t_6 = PyString_Check(__pyx_v_path); if (__pyx_t_6) { /* "borg/platform/linux.pyx":291 * * if isinstance(path, str): * path = os.fsencode(path) # <<<<<<<<<<<<<< * if numeric_ids: * converter = posix_acl_use_stored_uid_gid */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_fsencode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_path}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_path, __pyx_t_1); __pyx_t_1 = 0; /* "borg/platform/linux.pyx":290 * return * * if isinstance(path, str): # <<<<<<<<<<<<<< * path = os.fsencode(path) * if numeric_ids: */ } /* "borg/platform/linux.pyx":292 * if isinstance(path, str): * path = os.fsencode(path) * if numeric_ids: # <<<<<<<<<<<<<< * converter = posix_acl_use_stored_uid_gid * else: */ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_numeric_ids); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 292, __pyx_L1_error) if (__pyx_t_6) { /* "borg/platform/linux.pyx":293 * path = os.fsencode(path) * if numeric_ids: * converter = posix_acl_use_stored_uid_gid # <<<<<<<<<<<<<< * else: * converter = acl_use_local_uid_gid */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_posix_acl_use_stored_uid_gid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_converter = __pyx_t_1; __pyx_t_1 = 0; /* "borg/platform/linux.pyx":292 * if isinstance(path, str): * path = os.fsencode(path) * if numeric_ids: # <<<<<<<<<<<<<< * converter = posix_acl_use_stored_uid_gid * else: */ goto __pyx_L5; } /* "borg/platform/linux.pyx":295 * converter = posix_acl_use_stored_uid_gid * else: * converter = acl_use_local_uid_gid # <<<<<<<<<<<<<< * access_text = item.get('acl_access') * if access_text: */ /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_acl_use_local_uid_gid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_converter = __pyx_t_1; __pyx_t_1 = 0; } __pyx_L5:; /* "borg/platform/linux.pyx":296 * else: * converter = acl_use_local_uid_gid * access_text = item.get('acl_access') # <<<<<<<<<<<<<< * if access_text: * try: */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_n_s_acl_access}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_access_text = __pyx_t_1; __pyx_t_1 = 0; /* "borg/platform/linux.pyx":297 * converter = acl_use_local_uid_gid * access_text = item.get('acl_access') * if access_text: # <<<<<<<<<<<<<< * try: * access_acl = acl_from_text(converter(access_text)) */ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_access_text); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 297, __pyx_L1_error) if (__pyx_t_6) { /* "borg/platform/linux.pyx":298 * access_text = item.get('acl_access') * if access_text: * try: # <<<<<<<<<<<<<< * access_acl = acl_from_text(converter(access_text)) * if access_acl == NULL: */ /*try:*/ { /* "borg/platform/linux.pyx":299 * if access_text: * try: * access_acl = acl_from_text(converter(access_text)) # <<<<<<<<<<<<<< * if access_acl == NULL: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) */ __Pyx_INCREF(__pyx_v_converter); __pyx_t_4 = __pyx_v_converter; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_access_text}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 299, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); __PYX_ERR(0, 299, __pyx_L8_error) } __pyx_t_7 = __Pyx_PyBytes_AsString(__pyx_t_1); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 299, __pyx_L8_error) __pyx_v_access_acl = acl_from_text(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/platform/linux.pyx":300 * try: * access_acl = acl_from_text(converter(access_text)) * if access_acl == NULL: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * if fd is not None: */ __pyx_t_6 = (__pyx_v_access_acl == NULL); if (unlikely(__pyx_t_6)) { /* "borg/platform/linux.pyx":301 * access_acl = acl_from_text(converter(access_text)) * if access_acl == NULL: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) # <<<<<<<<<<<<<< * if fd is not None: * if acl_set_fd(fd, access_acl) == -1: */ __pyx_t_1 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 301, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_strerror); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 301, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 301, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_3}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 301, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 301, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_fsdecode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 301, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_path}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 301, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 301, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1)) __PYX_ERR(0, 301, __pyx_L8_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_4)) __PYX_ERR(0, 301, __pyx_L8_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_2)) __PYX_ERR(0, 301, __pyx_L8_error); __pyx_t_1 = 0; __pyx_t_4 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 301, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 301, __pyx_L8_error) /* "borg/platform/linux.pyx":300 * try: * access_acl = acl_from_text(converter(access_text)) * if access_acl == NULL: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * if fd is not None: */ } /* "borg/platform/linux.pyx":302 * if access_acl == NULL: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * if fd is not None: # <<<<<<<<<<<<<< * if acl_set_fd(fd, access_acl) == -1: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) */ __pyx_t_6 = (__pyx_v_fd != Py_None); if (__pyx_t_6) { /* "borg/platform/linux.pyx":303 * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * if fd is not None: * if acl_set_fd(fd, access_acl) == -1: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * else: */ __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_fd); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 303, __pyx_L8_error) __pyx_t_6 = (acl_set_fd(__pyx_t_5, __pyx_v_access_acl) == -1L); if (unlikely(__pyx_t_6)) { /* "borg/platform/linux.pyx":304 * if fd is not None: * if acl_set_fd(fd, access_acl) == -1: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) # <<<<<<<<<<<<<< * else: * if acl_set_file(path, ACL_TYPE_ACCESS, access_acl) == -1: */ __pyx_t_2 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_strerror); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4}; __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 304, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_fsdecode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 304, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_path}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 304, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 304, __pyx_L8_error); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_8)) __PYX_ERR(0, 304, __pyx_L8_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1)) __PYX_ERR(0, 304, __pyx_L8_error); __pyx_t_2 = 0; __pyx_t_8 = 0; __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 304, __pyx_L8_error) /* "borg/platform/linux.pyx":303 * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * if fd is not None: * if acl_set_fd(fd, access_acl) == -1: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * else: */ } /* "borg/platform/linux.pyx":302 * if access_acl == NULL: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * if fd is not None: # <<<<<<<<<<<<<< * if acl_set_fd(fd, access_acl) == -1: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) */ goto __pyx_L11; } /* "borg/platform/linux.pyx":306 * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * else: * if acl_set_file(path, ACL_TYPE_ACCESS, access_acl) == -1: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * finally: */ /*else*/ { __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v_path); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 306, __pyx_L8_error) __pyx_t_6 = (acl_set_file(__pyx_t_9, ACL_TYPE_ACCESS, __pyx_v_access_acl) == -1L); if (unlikely(__pyx_t_6)) { /* "borg/platform/linux.pyx":307 * else: * if acl_set_file(path, ACL_TYPE_ACCESS, access_acl) == -1: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) # <<<<<<<<<<<<<< * finally: * acl_free(access_acl) */ __pyx_t_1 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_os); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 307, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_strerror); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 307, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 307, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_8}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_os); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 307, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_fsdecode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_path}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 307, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 307, __pyx_L8_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 307, __pyx_L8_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2)) __PYX_ERR(0, 307, __pyx_L8_error); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 307, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 307, __pyx_L8_error) /* "borg/platform/linux.pyx":306 * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * else: * if acl_set_file(path, ACL_TYPE_ACCESS, access_acl) == -1: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * finally: */ } } __pyx_L11:; } /* "borg/platform/linux.pyx":309 * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * finally: * acl_free(access_acl) # <<<<<<<<<<<<<< * default_text = item.get('acl_default') * if default_text: */ /*finally:*/ { /*normal exit:*/{ (void)(acl_free(__pyx_v_access_acl)); goto __pyx_L9; } __pyx_L8_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __pyx_t_5 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename; { (void)(acl_free(__pyx_v_access_acl)); } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); } __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14); __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11; goto __pyx_L1_error; } __pyx_L9:; } /* "borg/platform/linux.pyx":297 * converter = acl_use_local_uid_gid * access_text = item.get('acl_access') * if access_text: # <<<<<<<<<<<<<< * try: * access_acl = acl_from_text(converter(access_text)) */ } /* "borg/platform/linux.pyx":310 * finally: * acl_free(access_acl) * default_text = item.get('acl_default') # <<<<<<<<<<<<<< * if default_text: * try: */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_n_s_acl_default}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_default_text = __pyx_t_2; __pyx_t_2 = 0; /* "borg/platform/linux.pyx":311 * acl_free(access_acl) * default_text = item.get('acl_default') * if default_text: # <<<<<<<<<<<<<< * try: * default_acl = acl_from_text(converter(default_text)) */ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_default_text); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 311, __pyx_L1_error) if (__pyx_t_6) { /* "borg/platform/linux.pyx":312 * default_text = item.get('acl_default') * if default_text: * try: # <<<<<<<<<<<<<< * default_acl = acl_from_text(converter(default_text)) * if default_acl == NULL: */ /*try:*/ { /* "borg/platform/linux.pyx":313 * if default_text: * try: * default_acl = acl_from_text(converter(default_text)) # <<<<<<<<<<<<<< * if default_acl == NULL: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) */ __Pyx_INCREF(__pyx_v_converter); __pyx_t_4 = __pyx_v_converter; __pyx_t_3 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_default_text}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } if (unlikely(__pyx_t_2 == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); __PYX_ERR(0, 313, __pyx_L18_error) } __pyx_t_7 = __Pyx_PyBytes_AsString(__pyx_t_2); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 313, __pyx_L18_error) __pyx_v_default_acl = acl_from_text(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/linux.pyx":314 * try: * default_acl = acl_from_text(converter(default_text)) * if default_acl == NULL: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * # only directories can get a default ACL. there is no fd-based api to set it. */ __pyx_t_6 = (__pyx_v_default_acl == NULL); if (unlikely(__pyx_t_6)) { /* "borg/platform/linux.pyx":315 * default_acl = acl_from_text(converter(default_text)) * if default_acl == NULL: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) # <<<<<<<<<<<<<< * # only directories can get a default ACL. there is no fd-based api to set it. * if acl_set_file(path, ACL_TYPE_DEFAULT, default_acl) == -1: */ __pyx_t_2 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 315, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 315, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_strerror); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 315, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 315, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_3}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 315, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 315, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_fsdecode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 315, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_path}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 315, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 315, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2)) __PYX_ERR(0, 315, __pyx_L18_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_4)) __PYX_ERR(0, 315, __pyx_L18_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_1)) __PYX_ERR(0, 315, __pyx_L18_error); __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 315, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 315, __pyx_L18_error) /* "borg/platform/linux.pyx":314 * try: * default_acl = acl_from_text(converter(default_text)) * if default_acl == NULL: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * # only directories can get a default ACL. there is no fd-based api to set it. */ } /* "borg/platform/linux.pyx":317 * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * # only directories can get a default ACL. there is no fd-based api to set it. * if acl_set_file(path, ACL_TYPE_DEFAULT, default_acl) == -1: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * finally: */ __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v_path); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 317, __pyx_L18_error) __pyx_t_6 = (acl_set_file(__pyx_t_9, ACL_TYPE_DEFAULT, __pyx_v_default_acl) == -1L); if (unlikely(__pyx_t_6)) { /* "borg/platform/linux.pyx":318 * # only directories can get a default ACL. there is no fd-based api to set it. * if acl_set_file(path, ACL_TYPE_DEFAULT, default_acl) == -1: * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) # <<<<<<<<<<<<<< * finally: * acl_free(default_acl) */ __pyx_t_1 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 318, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_strerror); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 318, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4}; __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 318, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_fsdecode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 318, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_path}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 318, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 318, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 318, __pyx_L18_error); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_8)) __PYX_ERR(0, 318, __pyx_L18_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(0, 318, __pyx_L18_error); __pyx_t_1 = 0; __pyx_t_8 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 318, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 318, __pyx_L18_error) /* "borg/platform/linux.pyx":317 * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * # only directories can get a default ACL. there is no fd-based api to set it. * if acl_set_file(path, ACL_TYPE_DEFAULT, default_acl) == -1: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * finally: */ } } /* "borg/platform/linux.pyx":320 * raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) * finally: * acl_free(default_acl) # <<<<<<<<<<<<<< * * */ /*finally:*/ { /*normal exit:*/{ (void)(acl_free(__pyx_v_default_acl)); goto __pyx_L19; } __pyx_L18_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_17 = 0; __pyx_t_16 = 0; __pyx_t_15 = 0; __pyx_t_14 = 0; __pyx_t_13 = 0; __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_13, &__pyx_t_12); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_16, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_16, &__pyx_t_15); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_12); __pyx_t_10 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_18 = __pyx_filename; { (void)(acl_free(__pyx_v_default_acl)); } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_13, __pyx_t_12); } __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ErrRestore(__pyx_t_17, __pyx_t_16, __pyx_t_15); __pyx_t_17 = 0; __pyx_t_16 = 0; __pyx_t_15 = 0; __pyx_t_14 = 0; __pyx_t_13 = 0; __pyx_t_12 = 0; __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_18; goto __pyx_L1_error; } __pyx_L19:; } /* "borg/platform/linux.pyx":311 * acl_free(access_acl) * default_text = item.get('acl_default') * if default_text: # <<<<<<<<<<<<<< * try: * default_acl = acl_from_text(converter(default_text)) */ } /* "borg/platform/linux.pyx":282 * * * def acl_set(path, item, numeric_ids=False, fd=None): # <<<<<<<<<<<<<< * cdef acl_t access_acl = NULL * cdef acl_t default_acl = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("borg.platform.linux.acl_set", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_converter); __Pyx_XDECREF(__pyx_v_access_text); __Pyx_XDECREF(__pyx_v_default_text); __Pyx_XDECREF(__pyx_v_path); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/linux.pyx":323 * * * cdef _sync_file_range(fd, offset, length, flags): # <<<<<<<<<<<<<< * assert offset & PAGE_MASK == 0, "offset %d not page-aligned" % offset * assert length & PAGE_MASK == 0, "length %d not page-aligned" % length */ static PyObject *__pyx_f_4borg_8platform_5linux__sync_file_range(PyObject *__pyx_v_fd, PyObject *__pyx_v_offset, PyObject *__pyx_v_length, PyObject *__pyx_v_flags) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_sync_file_range", 1); /* "borg/platform/linux.pyx":324 * * cdef _sync_file_range(fd, offset, length, flags): * assert offset & PAGE_MASK == 0, "offset %d not page-aligned" % offset # <<<<<<<<<<<<<< * assert length & PAGE_MASK == 0, "length %d not page-aligned" % length * if sync_file_range(fd, offset, length, flags) != 0: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_4borg_8platform_5linux_PAGE_MASK); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_And(__pyx_v_offset, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__Pyx_PyInt_BoolEqObjC(__pyx_t_2, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 324, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_3)) { __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_offset_d_not_page_aligned, __pyx_v_offset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 324, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 324, __pyx_L1_error) #endif /* "borg/platform/linux.pyx":325 * cdef _sync_file_range(fd, offset, length, flags): * assert offset & PAGE_MASK == 0, "offset %d not page-aligned" % offset * assert length & PAGE_MASK == 0, "length %d not page-aligned" % length # <<<<<<<<<<<<<< * if sync_file_range(fd, offset, length, flags) != 0: * raise OSError(errno.errno, os.strerror(errno.errno)) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_4borg_8platform_5linux_PAGE_MASK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyNumber_And(__pyx_v_length, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = (__Pyx_PyInt_BoolEqObjC(__pyx_t_1, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 325, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_3)) { __pyx_t_1 = __Pyx_PyString_FormatSafe(__pyx_kp_s_length_d_not_page_aligned, __pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_1, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 325, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 325, __pyx_L1_error) #endif /* "borg/platform/linux.pyx":326 * assert offset & PAGE_MASK == 0, "offset %d not page-aligned" % offset * assert length & PAGE_MASK == 0, "length %d not page-aligned" % length * if sync_file_range(fd, offset, length, flags) != 0: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno)) * safe_fadvise(fd, offset, length, 'DONTNEED') */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sync_file_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_4, __pyx_v_fd, __pyx_v_offset, __pyx_v_length, __pyx_v_flags}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 4+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_3 = (__Pyx_PyInt_BoolNeObjC(__pyx_t_1, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_3)) { /* "borg/platform/linux.pyx":327 * assert length & PAGE_MASK == 0, "length %d not page-aligned" % length * if sync_file_range(fd, offset, length, flags) != 0: * raise OSError(errno.errno, os.strerror(errno.errno)) # <<<<<<<<<<<<<< * safe_fadvise(fd, offset, length, 'DONTNEED') * */ __pyx_t_1 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_strerror); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2)) __PYX_ERR(0, 327, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 327, __pyx_L1_error) /* "borg/platform/linux.pyx":326 * assert offset & PAGE_MASK == 0, "offset %d not page-aligned" % offset * assert length & PAGE_MASK == 0, "length %d not page-aligned" % length * if sync_file_range(fd, offset, length, flags) != 0: # <<<<<<<<<<<<<< * raise OSError(errno.errno, os.strerror(errno.errno)) * safe_fadvise(fd, offset, length, 'DONTNEED') */ } /* "borg/platform/linux.pyx":328 * if sync_file_range(fd, offset, length, flags) != 0: * raise OSError(errno.errno, os.strerror(errno.errno)) * safe_fadvise(fd, offset, length, 'DONTNEED') # <<<<<<<<<<<<<< * * */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_safe_fadvise); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_1, __pyx_v_fd, __pyx_v_offset, __pyx_v_length, __pyx_n_s_DONTNEED}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_5, 4+__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/linux.pyx":323 * * * cdef _sync_file_range(fd, offset, length, flags): # <<<<<<<<<<<<<< * assert offset & PAGE_MASK == 0, "offset %d not page-aligned" % offset * assert length & PAGE_MASK == 0, "length %d not page-aligned" % length */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("borg.platform.linux._sync_file_range", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/linux.pyx":350 * """ * * def __init__(self, path, *, fd=None, binary=False): # <<<<<<<<<<<<<< * super().__init__(path, fd=fd, binary=binary) * self.offset = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_5linux_8SyncFile_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8platform_5linux_8SyncFile_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_5linux_8SyncFile_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8platform_5linux_8SyncFile_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_path = 0; PyObject *__pyx_v_fd = 0; PyObject *__pyx_v_binary = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_path,&__pyx_n_s_fd,&__pyx_n_s_binary,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 350, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_path)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 350, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 350, __pyx_L3_error) } } if (kw_args > 0 && likely(kw_args <= 2)) { Py_ssize_t index; for (index = 2; index < 4 && kw_args > 0; index++) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 350, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 350, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_path = values[1]; __pyx_v_fd = values[2]; __pyx_v_binary = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 350, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.linux.SyncFile.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_5linux_8SyncFile___init__(__pyx_self, __pyx_v_self, __pyx_v_path, __pyx_v_fd, __pyx_v_binary); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8platform_5linux_8SyncFile___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_fd, PyObject *__pyx_v_binary) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "borg/platform/linux.pyx":351 * * def __init__(self, path, *, fd=None, binary=False): * super().__init__(path, fd=fd, binary=binary) # <<<<<<<<<<<<<< * self.offset = 0 * self.write_window = (16 * 1024 ** 2) & ~PAGE_MASK */ __pyx_t_1 = __Pyx_CyFunction_GetClassObj(__pyx_self); if (!__pyx_t_1) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 351, __pyx_L1_error) } __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self)) __PYX_ERR(0, 351, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_path); __Pyx_GIVEREF(__pyx_v_path); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_path)) __PYX_ERR(0, 351, __pyx_L1_error); __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_fd, __pyx_v_fd) < 0) __PYX_ERR(0, 351, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_binary, __pyx_v_binary) < 0) __PYX_ERR(0, 351, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "borg/platform/linux.pyx":352 * def __init__(self, path, *, fd=None, binary=False): * super().__init__(path, fd=fd, binary=binary) * self.offset = 0 # <<<<<<<<<<<<<< * self.write_window = (16 * 1024 ** 2) & ~PAGE_MASK * self.last_sync = 0 */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_offset, __pyx_int_0) < 0) __PYX_ERR(0, 352, __pyx_L1_error) /* "borg/platform/linux.pyx":353 * super().__init__(path, fd=fd, binary=binary) * self.offset = 0 * self.write_window = (16 * 1024 ** 2) & ~PAGE_MASK # <<<<<<<<<<<<<< * self.last_sync = 0 * self.pending_sync = None */ __pyx_t_4 = __Pyx_PyInt_From_long((0x1000000 & (~__pyx_v_4borg_8platform_5linux_PAGE_MASK))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_write_window, __pyx_t_4) < 0) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "borg/platform/linux.pyx":354 * self.offset = 0 * self.write_window = (16 * 1024 ** 2) & ~PAGE_MASK * self.last_sync = 0 # <<<<<<<<<<<<<< * self.pending_sync = None * */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_last_sync, __pyx_int_0) < 0) __PYX_ERR(0, 354, __pyx_L1_error) /* "borg/platform/linux.pyx":355 * self.write_window = (16 * 1024 ** 2) & ~PAGE_MASK * self.last_sync = 0 * self.pending_sync = None # <<<<<<<<<<<<<< * * def write(self, data): */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_pending_sync, Py_None) < 0) __PYX_ERR(0, 355, __pyx_L1_error) /* "borg/platform/linux.pyx":350 * """ * * def __init__(self, path, *, fd=None, binary=False): # <<<<<<<<<<<<<< * super().__init__(path, fd=fd, binary=binary) * self.offset = 0 */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("borg.platform.linux.SyncFile.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/linux.pyx":357 * self.pending_sync = None * * def write(self, data): # <<<<<<<<<<<<<< * self.offset += self.f.write(data) * offset = self.offset & ~PAGE_MASK */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_5linux_8SyncFile_3write(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8platform_5linux_8SyncFile_3write = {"write", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_5linux_8SyncFile_3write, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8platform_5linux_8SyncFile_3write(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_data = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("write (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_data,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 357, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 357, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("write", 1, 2, 2, 1); __PYX_ERR(0, 357, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "write") < 0)) __PYX_ERR(0, 357, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_data = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("write", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 357, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.linux.SyncFile.write", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_5linux_8SyncFile_2write(__pyx_self, __pyx_v_self, __pyx_v_data); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8platform_5linux_8SyncFile_2write(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data) { PyObject *__pyx_v_offset = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write", 1); /* "borg/platform/linux.pyx":358 * * def write(self, data): * self.offset += self.f.write(data) # <<<<<<<<<<<<<< * offset = self.offset & ~PAGE_MASK * if offset >= self.last_sync + self.write_window: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_f); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_data}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_offset, __pyx_t_4) < 0) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "borg/platform/linux.pyx":359 * def write(self, data): * self.offset += self.f.write(data) * offset = self.offset & ~PAGE_MASK # <<<<<<<<<<<<<< * if offset >= self.last_sync + self.write_window: * self.f.flush() */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_offset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyInt_From_unsigned_int((~__pyx_v_4borg_8platform_5linux_PAGE_MASK)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyNumber_And(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_offset = __pyx_t_1; __pyx_t_1 = 0; /* "borg/platform/linux.pyx":360 * self.offset += self.f.write(data) * offset = self.offset & ~PAGE_MASK * if offset >= self.last_sync + self.write_window: # <<<<<<<<<<<<<< * self.f.flush() * _sync_file_range(self.fd, self.last_sync, offset - self.last_sync, SYNC_FILE_RANGE_WRITE) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_last_sync); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_write_window); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_RichCompare(__pyx_v_offset, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_6) { /* "borg/platform/linux.pyx":361 * offset = self.offset & ~PAGE_MASK * if offset >= self.last_sync + self.write_window: * self.f.flush() # <<<<<<<<<<<<<< * _sync_file_range(self.fd, self.last_sync, offset - self.last_sync, SYNC_FILE_RANGE_WRITE) * if self.pending_sync is not None: */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_f); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_flush); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/linux.pyx":362 * if offset >= self.last_sync + self.write_window: * self.f.flush() * _sync_file_range(self.fd, self.last_sync, offset - self.last_sync, SYNC_FILE_RANGE_WRITE) # <<<<<<<<<<<<<< * if self.pending_sync is not None: * _sync_file_range(self.fd, self.pending_sync, self.last_sync - self.pending_sync, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_fd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_last_sync); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_last_sync); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyNumber_Subtract(__pyx_v_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_SYNC_FILE_RANGE_WRITE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __pyx_f_4borg_8platform_5linux__sync_file_range(__pyx_t_2, __pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/platform/linux.pyx":363 * self.f.flush() * _sync_file_range(self.fd, self.last_sync, offset - self.last_sync, SYNC_FILE_RANGE_WRITE) * if self.pending_sync is not None: # <<<<<<<<<<<<<< * _sync_file_range(self.fd, self.pending_sync, self.last_sync - self.pending_sync, * SYNC_FILE_RANGE_WRITE | SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WAIT_AFTER) */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_pending_sync); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = (__pyx_t_7 != Py_None); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_6) { /* "borg/platform/linux.pyx":364 * _sync_file_range(self.fd, self.last_sync, offset - self.last_sync, SYNC_FILE_RANGE_WRITE) * if self.pending_sync is not None: * _sync_file_range(self.fd, self.pending_sync, self.last_sync - self.pending_sync, # <<<<<<<<<<<<<< * SYNC_FILE_RANGE_WRITE | SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WAIT_AFTER) * self.pending_sync = self.last_sync */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_fd); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_pending_sync); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_last_sync); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_pending_sync); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Subtract(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/platform/linux.pyx":365 * if self.pending_sync is not None: * _sync_file_range(self.fd, self.pending_sync, self.last_sync - self.pending_sync, * SYNC_FILE_RANGE_WRITE | SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WAIT_AFTER) # <<<<<<<<<<<<<< * self.pending_sync = self.last_sync * self.last_sync = offset */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SYNC_FILE_RANGE_WRITE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SYNC_FILE_RANGE_WAIT_BEFORE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = PyNumber_Or(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SYNC_FILE_RANGE_WAIT_AFTER); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_Or(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/linux.pyx":364 * _sync_file_range(self.fd, self.last_sync, offset - self.last_sync, SYNC_FILE_RANGE_WRITE) * if self.pending_sync is not None: * _sync_file_range(self.fd, self.pending_sync, self.last_sync - self.pending_sync, # <<<<<<<<<<<<<< * SYNC_FILE_RANGE_WRITE | SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WAIT_AFTER) * self.pending_sync = self.last_sync */ __pyx_t_3 = __pyx_f_4borg_8platform_5linux__sync_file_range(__pyx_t_7, __pyx_t_4, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/linux.pyx":363 * self.f.flush() * _sync_file_range(self.fd, self.last_sync, offset - self.last_sync, SYNC_FILE_RANGE_WRITE) * if self.pending_sync is not None: # <<<<<<<<<<<<<< * _sync_file_range(self.fd, self.pending_sync, self.last_sync - self.pending_sync, * SYNC_FILE_RANGE_WRITE | SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WAIT_AFTER) */ } /* "borg/platform/linux.pyx":366 * _sync_file_range(self.fd, self.pending_sync, self.last_sync - self.pending_sync, * SYNC_FILE_RANGE_WRITE | SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WAIT_AFTER) * self.pending_sync = self.last_sync # <<<<<<<<<<<<<< * self.last_sync = offset * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_last_sync); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_pending_sync, __pyx_t_3) < 0) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/linux.pyx":367 * SYNC_FILE_RANGE_WRITE | SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WAIT_AFTER) * self.pending_sync = self.last_sync * self.last_sync = offset # <<<<<<<<<<<<<< * * def sync(self): */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_last_sync, __pyx_v_offset) < 0) __PYX_ERR(0, 367, __pyx_L1_error) /* "borg/platform/linux.pyx":360 * self.offset += self.f.write(data) * offset = self.offset & ~PAGE_MASK * if offset >= self.last_sync + self.write_window: # <<<<<<<<<<<<<< * self.f.flush() * _sync_file_range(self.fd, self.last_sync, offset - self.last_sync, SYNC_FILE_RANGE_WRITE) */ } /* "borg/platform/linux.pyx":357 * self.pending_sync = None * * def write(self, data): # <<<<<<<<<<<<<< * self.offset += self.f.write(data) * offset = self.offset & ~PAGE_MASK */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("borg.platform.linux.SyncFile.write", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_offset); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/linux.pyx":369 * self.last_sync = offset * * def sync(self): # <<<<<<<<<<<<<< * self.f.flush() * os.fdatasync(self.fd) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_5linux_8SyncFile_5sync(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8platform_5linux_8SyncFile_5sync = {"sync", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_5linux_8SyncFile_5sync, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8platform_5linux_8SyncFile_5sync(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sync (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 369, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "sync") < 0)) __PYX_ERR(0, 369, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("sync", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 369, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.linux.SyncFile.sync", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_5linux_8SyncFile_4sync(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8platform_5linux_8SyncFile_4sync(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sync", 1); /* "borg/platform/linux.pyx":370 * * def sync(self): * self.f.flush() # <<<<<<<<<<<<<< * os.fdatasync(self.fd) * # tell the OS that it does not need to cache what we just wrote, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_f); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_flush); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/platform/linux.pyx":371 * def sync(self): * self.f.flush() * os.fdatasync(self.fd) # <<<<<<<<<<<<<< * # tell the OS that it does not need to cache what we just wrote, * # avoids spoiling the cache for the OS and other processes. */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_fdatasync); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_fd); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/platform/linux.pyx":374 * # tell the OS that it does not need to cache what we just wrote, * # avoids spoiling the cache for the OS and other processes. * safe_fadvise(self.fd, 0, 0, 'DONTNEED') # <<<<<<<<<<<<<< */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_safe_fadvise); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_fd); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_5, __pyx_t_3, __pyx_int_0, __pyx_int_0, __pyx_n_s_DONTNEED}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/platform/linux.pyx":369 * self.last_sync = offset * * def sync(self): # <<<<<<<<<<<<<< * self.f.flush() * os.fdatasync(self.fd) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("borg.platform.linux.SyncFile.sync", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } #if CYTHON_USE_FREELISTS static struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct__listxattr *__pyx_freelist_4borg_8platform_5linux___pyx_scope_struct__listxattr[8]; static int __pyx_freecount_4borg_8platform_5linux___pyx_scope_struct__listxattr = 0; #endif static PyObject *__pyx_tp_new_4borg_8platform_5linux___pyx_scope_struct__listxattr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_freecount_4borg_8platform_5linux___pyx_scope_struct__listxattr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct__listxattr)))) { o = (PyObject*)__pyx_freelist_4borg_8platform_5linux___pyx_scope_struct__listxattr[--__pyx_freecount_4borg_8platform_5linux___pyx_scope_struct__listxattr]; memset(o, 0, sizeof(struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct__listxattr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif return o; } static void __pyx_tp_dealloc_4borg_8platform_5linux___pyx_scope_struct__listxattr(PyObject *o) { struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct__listxattr *p = (struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct__listxattr *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4borg_8platform_5linux___pyx_scope_struct__listxattr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_follow_symlinks); #if CYTHON_USE_FREELISTS if (((int)(__pyx_freecount_4borg_8platform_5linux___pyx_scope_struct__listxattr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct__listxattr)))) { __pyx_freelist_4borg_8platform_5linux___pyx_scope_struct__listxattr[__pyx_freecount_4borg_8platform_5linux___pyx_scope_struct__listxattr++] = ((struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct__listxattr *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static int __pyx_tp_traverse_4borg_8platform_5linux___pyx_scope_struct__listxattr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct__listxattr *p = (struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct__listxattr *)o; if (p->__pyx_v_follow_symlinks) { e = (*v)(p->__pyx_v_follow_symlinks, a); if (e) return e; } return 0; } static int __pyx_tp_clear_4borg_8platform_5linux___pyx_scope_struct__listxattr(PyObject *o) { PyObject* tmp; struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct__listxattr *p = (struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct__listxattr *)o; tmp = ((PyObject*)p->__pyx_v_follow_symlinks); p->__pyx_v_follow_symlinks = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_4borg_8platform_5linux___pyx_scope_struct__listxattr_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4borg_8platform_5linux___pyx_scope_struct__listxattr}, {Py_tp_traverse, (void *)__pyx_tp_traverse_4borg_8platform_5linux___pyx_scope_struct__listxattr}, {Py_tp_clear, (void *)__pyx_tp_clear_4borg_8platform_5linux___pyx_scope_struct__listxattr}, {Py_tp_new, (void *)__pyx_tp_new_4borg_8platform_5linux___pyx_scope_struct__listxattr}, {0, 0}, }; static PyType_Spec __pyx_type_4borg_8platform_5linux___pyx_scope_struct__listxattr_spec = { "borg.platform.linux.__pyx_scope_struct__listxattr", sizeof(struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct__listxattr), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, __pyx_type_4borg_8platform_5linux___pyx_scope_struct__listxattr_slots, }; #else static PyTypeObject __pyx_type_4borg_8platform_5linux___pyx_scope_struct__listxattr = { PyVarObject_HEAD_INIT(0, 0) "borg.platform.linux.""__pyx_scope_struct__listxattr", /*tp_name*/ sizeof(struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct__listxattr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4borg_8platform_5linux___pyx_scope_struct__listxattr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_4borg_8platform_5linux___pyx_scope_struct__listxattr, /*tp_traverse*/ __pyx_tp_clear_4borg_8platform_5linux___pyx_scope_struct__listxattr, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4borg_8platform_5linux___pyx_scope_struct__listxattr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif #if CYTHON_USE_FREELISTS static struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct_1_getxattr *__pyx_freelist_4borg_8platform_5linux___pyx_scope_struct_1_getxattr[8]; static int __pyx_freecount_4borg_8platform_5linux___pyx_scope_struct_1_getxattr = 0; #endif static PyObject *__pyx_tp_new_4borg_8platform_5linux___pyx_scope_struct_1_getxattr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_freecount_4borg_8platform_5linux___pyx_scope_struct_1_getxattr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct_1_getxattr)))) { o = (PyObject*)__pyx_freelist_4borg_8platform_5linux___pyx_scope_struct_1_getxattr[--__pyx_freecount_4borg_8platform_5linux___pyx_scope_struct_1_getxattr]; memset(o, 0, sizeof(struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct_1_getxattr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif return o; } static void __pyx_tp_dealloc_4borg_8platform_5linux___pyx_scope_struct_1_getxattr(PyObject *o) { struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct_1_getxattr *p = (struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct_1_getxattr *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4borg_8platform_5linux___pyx_scope_struct_1_getxattr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_follow_symlinks); #if CYTHON_USE_FREELISTS if (((int)(__pyx_freecount_4borg_8platform_5linux___pyx_scope_struct_1_getxattr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct_1_getxattr)))) { __pyx_freelist_4borg_8platform_5linux___pyx_scope_struct_1_getxattr[__pyx_freecount_4borg_8platform_5linux___pyx_scope_struct_1_getxattr++] = ((struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct_1_getxattr *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static int __pyx_tp_traverse_4borg_8platform_5linux___pyx_scope_struct_1_getxattr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct_1_getxattr *p = (struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct_1_getxattr *)o; if (p->__pyx_v_follow_symlinks) { e = (*v)(p->__pyx_v_follow_symlinks, a); if (e) return e; } return 0; } static int __pyx_tp_clear_4borg_8platform_5linux___pyx_scope_struct_1_getxattr(PyObject *o) { PyObject* tmp; struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct_1_getxattr *p = (struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct_1_getxattr *)o; tmp = ((PyObject*)p->__pyx_v_follow_symlinks); p->__pyx_v_follow_symlinks = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_4borg_8platform_5linux___pyx_scope_struct_1_getxattr_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4borg_8platform_5linux___pyx_scope_struct_1_getxattr}, {Py_tp_traverse, (void *)__pyx_tp_traverse_4borg_8platform_5linux___pyx_scope_struct_1_getxattr}, {Py_tp_clear, (void *)__pyx_tp_clear_4borg_8platform_5linux___pyx_scope_struct_1_getxattr}, {Py_tp_new, (void *)__pyx_tp_new_4borg_8platform_5linux___pyx_scope_struct_1_getxattr}, {0, 0}, }; static PyType_Spec __pyx_type_4borg_8platform_5linux___pyx_scope_struct_1_getxattr_spec = { "borg.platform.linux.__pyx_scope_struct_1_getxattr", sizeof(struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct_1_getxattr), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, __pyx_type_4borg_8platform_5linux___pyx_scope_struct_1_getxattr_slots, }; #else static PyTypeObject __pyx_type_4borg_8platform_5linux___pyx_scope_struct_1_getxattr = { PyVarObject_HEAD_INIT(0, 0) "borg.platform.linux.""__pyx_scope_struct_1_getxattr", /*tp_name*/ sizeof(struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct_1_getxattr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4borg_8platform_5linux___pyx_scope_struct_1_getxattr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_4borg_8platform_5linux___pyx_scope_struct_1_getxattr, /*tp_traverse*/ __pyx_tp_clear_4borg_8platform_5linux___pyx_scope_struct_1_getxattr, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4borg_8platform_5linux___pyx_scope_struct_1_getxattr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif #if CYTHON_USE_FREELISTS static struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct_2_setxattr *__pyx_freelist_4borg_8platform_5linux___pyx_scope_struct_2_setxattr[8]; static int __pyx_freecount_4borg_8platform_5linux___pyx_scope_struct_2_setxattr = 0; #endif static PyObject *__pyx_tp_new_4borg_8platform_5linux___pyx_scope_struct_2_setxattr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_freecount_4borg_8platform_5linux___pyx_scope_struct_2_setxattr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct_2_setxattr)))) { o = (PyObject*)__pyx_freelist_4borg_8platform_5linux___pyx_scope_struct_2_setxattr[--__pyx_freecount_4borg_8platform_5linux___pyx_scope_struct_2_setxattr]; memset(o, 0, sizeof(struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct_2_setxattr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif return o; } static void __pyx_tp_dealloc_4borg_8platform_5linux___pyx_scope_struct_2_setxattr(PyObject *o) { struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct_2_setxattr *p = (struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct_2_setxattr *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4borg_8platform_5linux___pyx_scope_struct_2_setxattr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_follow_symlinks); #if CYTHON_USE_FREELISTS if (((int)(__pyx_freecount_4borg_8platform_5linux___pyx_scope_struct_2_setxattr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct_2_setxattr)))) { __pyx_freelist_4borg_8platform_5linux___pyx_scope_struct_2_setxattr[__pyx_freecount_4borg_8platform_5linux___pyx_scope_struct_2_setxattr++] = ((struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct_2_setxattr *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static int __pyx_tp_traverse_4borg_8platform_5linux___pyx_scope_struct_2_setxattr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct_2_setxattr *p = (struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct_2_setxattr *)o; if (p->__pyx_v_follow_symlinks) { e = (*v)(p->__pyx_v_follow_symlinks, a); if (e) return e; } return 0; } static int __pyx_tp_clear_4borg_8platform_5linux___pyx_scope_struct_2_setxattr(PyObject *o) { PyObject* tmp; struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct_2_setxattr *p = (struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct_2_setxattr *)o; tmp = ((PyObject*)p->__pyx_v_follow_symlinks); p->__pyx_v_follow_symlinks = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_4borg_8platform_5linux___pyx_scope_struct_2_setxattr_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4borg_8platform_5linux___pyx_scope_struct_2_setxattr}, {Py_tp_traverse, (void *)__pyx_tp_traverse_4borg_8platform_5linux___pyx_scope_struct_2_setxattr}, {Py_tp_clear, (void *)__pyx_tp_clear_4borg_8platform_5linux___pyx_scope_struct_2_setxattr}, {Py_tp_new, (void *)__pyx_tp_new_4borg_8platform_5linux___pyx_scope_struct_2_setxattr}, {0, 0}, }; static PyType_Spec __pyx_type_4borg_8platform_5linux___pyx_scope_struct_2_setxattr_spec = { "borg.platform.linux.__pyx_scope_struct_2_setxattr", sizeof(struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct_2_setxattr), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, __pyx_type_4borg_8platform_5linux___pyx_scope_struct_2_setxattr_slots, }; #else static PyTypeObject __pyx_type_4borg_8platform_5linux___pyx_scope_struct_2_setxattr = { PyVarObject_HEAD_INIT(0, 0) "borg.platform.linux.""__pyx_scope_struct_2_setxattr", /*tp_name*/ sizeof(struct __pyx_obj_4borg_8platform_5linux___pyx_scope_struct_2_setxattr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4borg_8platform_5linux___pyx_scope_struct_2_setxattr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_4borg_8platform_5linux___pyx_scope_struct_2_setxattr, /*tp_traverse*/ __pyx_tp_clear_4borg_8platform_5linux___pyx_scope_struct_2_setxattr, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4borg_8platform_5linux___pyx_scope_struct_2_setxattr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_1_4_01, __pyx_k_1_4_01, sizeof(__pyx_k_1_4_01), 0, 0, 1, 0}, {&__pyx_n_s_API_VERSION, __pyx_k_API_VERSION, sizeof(__pyx_k_API_VERSION), 0, 0, 1, 1}, {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1}, {&__pyx_n_s_BSD_TO_LINUX_FLAGS, __pyx_k_BSD_TO_LINUX_FLAGS, sizeof(__pyx_k_BSD_TO_LINUX_FLAGS), 0, 0, 1, 1}, {&__pyx_n_s_BaseSyncFile, __pyx_k_BaseSyncFile, sizeof(__pyx_k_BaseSyncFile), 0, 0, 1, 1}, {&__pyx_n_s_DONTNEED, __pyx_k_DONTNEED, sizeof(__pyx_k_DONTNEED), 0, 0, 1, 1}, {&__pyx_kp_s_Implemented_using_sync_file_ran, __pyx_k_Implemented_using_sync_file_ran, sizeof(__pyx_k_Implemented_using_sync_file_ran), 0, 0, 1, 0}, {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, {&__pyx_n_s_M, __pyx_k_M, sizeof(__pyx_k_M), 0, 0, 1, 1}, {&__pyx_n_s_OSError, __pyx_k_OSError, sizeof(__pyx_k_OSError), 0, 0, 1, 1}, {&__pyx_n_s_O_NOFOLLOW, __pyx_k_O_NOFOLLOW, sizeof(__pyx_k_O_NOFOLLOW), 0, 0, 1, 1}, {&__pyx_n_s_O_NONBLOCK, __pyx_k_O_NONBLOCK, sizeof(__pyx_k_O_NONBLOCK), 0, 0, 1, 1}, {&__pyx_n_s_O_RDONLY, __pyx_k_O_RDONLY, sizeof(__pyx_k_O_RDONLY), 0, 0, 1, 1}, {&__pyx_n_s_SYNC_FILE_RANGE_LOADED, __pyx_k_SYNC_FILE_RANGE_LOADED, sizeof(__pyx_k_SYNC_FILE_RANGE_LOADED), 0, 0, 1, 1}, {&__pyx_n_s_SYNC_FILE_RANGE_WAIT_AFTER, __pyx_k_SYNC_FILE_RANGE_WAIT_AFTER, sizeof(__pyx_k_SYNC_FILE_RANGE_WAIT_AFTER), 0, 0, 1, 1}, {&__pyx_n_s_SYNC_FILE_RANGE_WAIT_BEFORE, __pyx_k_SYNC_FILE_RANGE_WAIT_BEFORE, sizeof(__pyx_k_SYNC_FILE_RANGE_WAIT_BEFORE), 0, 0, 1, 1}, {&__pyx_n_s_SYNC_FILE_RANGE_WRITE, __pyx_k_SYNC_FILE_RANGE_WRITE, sizeof(__pyx_k_SYNC_FILE_RANGE_WRITE), 0, 0, 1, 1}, {&__pyx_n_s_S_ISBLK, __pyx_k_S_ISBLK, sizeof(__pyx_k_S_ISBLK), 0, 0, 1, 1}, {&__pyx_n_s_S_ISCHR, __pyx_k_S_ISCHR, sizeof(__pyx_k_S_ISCHR), 0, 0, 1, 1}, {&__pyx_n_s_S_ISDIR, __pyx_k_S_ISDIR, sizeof(__pyx_k_S_ISDIR), 0, 0, 1, 1}, {&__pyx_n_s_S_ISLNK, __pyx_k_S_ISLNK, sizeof(__pyx_k_S_ISLNK), 0, 0, 1, 1}, {&__pyx_n_s_SyncFile, __pyx_k_SyncFile, sizeof(__pyx_k_SyncFile), 0, 0, 1, 1}, {&__pyx_n_s_SyncFile___init, __pyx_k_SyncFile___init, sizeof(__pyx_k_SyncFile___init), 0, 0, 1, 1}, {&__pyx_n_s_SyncFile_sync, __pyx_k_SyncFile_sync, sizeof(__pyx_k_SyncFile_sync), 0, 0, 1, 1}, {&__pyx_n_s_SyncFile_write, __pyx_k_SyncFile_write, sizeof(__pyx_k_SyncFile_write), 0, 0, 1, 1}, {&__pyx_n_s_UF_APPEND, __pyx_k_UF_APPEND, sizeof(__pyx_k_UF_APPEND), 0, 0, 1, 1}, {&__pyx_n_s_UF_COMPRESSED, __pyx_k_UF_COMPRESSED, sizeof(__pyx_k_UF_COMPRESSED), 0, 0, 1, 1}, {&__pyx_n_s_UF_IMMUTABLE, __pyx_k_UF_IMMUTABLE, sizeof(__pyx_k_UF_IMMUTABLE), 0, 0, 1, 1}, {&__pyx_n_s_UF_NODUMP, __pyx_k_UF_NODUMP, sizeof(__pyx_k_UF_NODUMP), 0, 0, 1, 1}, {&__pyx_kp_s__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 0, 1, 0}, {&__pyx_n_s__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 0, 1, 1}, {&__pyx_kp_u__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 1, 0, 0}, {&__pyx_kp_s__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 0, 1, 0}, {&__pyx_n_s__39, __pyx_k__39, sizeof(__pyx_k__39), 0, 0, 1, 1}, {&__pyx_kp_s__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 0, 1, 0}, {&__pyx_kp_s__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 0, 1, 0}, {&__pyx_n_s_access_acl, __pyx_k_access_acl, sizeof(__pyx_k_access_acl), 0, 0, 1, 1}, {&__pyx_n_s_access_text, __pyx_k_access_text, sizeof(__pyx_k_access_text), 0, 0, 1, 1}, {&__pyx_n_s_acl, __pyx_k_acl, sizeof(__pyx_k_acl), 0, 0, 1, 1}, {&__pyx_n_s_acl_access, __pyx_k_acl_access, sizeof(__pyx_k_acl_access), 0, 0, 1, 1}, {&__pyx_n_s_acl_default, __pyx_k_acl_default, sizeof(__pyx_k_acl_default), 0, 0, 1, 1}, {&__pyx_n_s_acl_get, __pyx_k_acl_get, sizeof(__pyx_k_acl_get), 0, 0, 1, 1}, {&__pyx_n_s_acl_set, __pyx_k_acl_set, sizeof(__pyx_k_acl_set), 0, 0, 1, 1}, {&__pyx_n_s_acl_use_local_uid_gid, __pyx_k_acl_use_local_uid_gid, sizeof(__pyx_k_acl_use_local_uid_gid), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, {&__pyx_n_s_basesyncfile, __pyx_k_basesyncfile, sizeof(__pyx_k_basesyncfile), 0, 0, 1, 1}, {&__pyx_n_s_binary, __pyx_k_binary, sizeof(__pyx_k_binary), 0, 0, 1, 1}, {&__pyx_n_s_borg_platform_linux, __pyx_k_borg_platform_linux, sizeof(__pyx_k_borg_platform_linux), 0, 0, 1, 1}, {&__pyx_n_s_bsd_flag, __pyx_k_bsd_flag, sizeof(__pyx_k_bsd_flag), 0, 0, 1, 1}, {&__pyx_n_s_bsd_flags, __pyx_k_bsd_flags, sizeof(__pyx_k_bsd_flags), 0, 0, 1, 1}, {&__pyx_n_s_buf, __pyx_k_buf, sizeof(__pyx_k_buf), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, {&__pyx_n_s_comment_re, __pyx_k_comment_re, sizeof(__pyx_k_comment_re), 0, 0, 1, 1}, {&__pyx_n_s_compile, __pyx_k_compile, sizeof(__pyx_k_compile), 0, 0, 1, 1}, {&__pyx_n_s_converter, __pyx_k_converter, sizeof(__pyx_k_converter), 0, 0, 1, 1}, {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, {&__pyx_n_s_default_acl, __pyx_k_default_acl, sizeof(__pyx_k_default_acl), 0, 0, 1, 1}, {&__pyx_n_s_default_text, __pyx_k_default_text, sizeof(__pyx_k_default_text), 0, 0, 1, 1}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, {&__pyx_n_s_entries, __pyx_k_entries, sizeof(__pyx_k_entries), 0, 0, 1, 1}, {&__pyx_n_s_entry, __pyx_k_entry, sizeof(__pyx_k_entry), 0, 0, 1, 1}, {&__pyx_n_s_error_number, __pyx_k_error_number, sizeof(__pyx_k_error_number), 0, 0, 1, 1}, {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1}, {&__pyx_n_s_fd, __pyx_k_fd, sizeof(__pyx_k_fd), 0, 0, 1, 1}, {&__pyx_n_s_fdatasync, __pyx_k_fdatasync, sizeof(__pyx_k_fdatasync), 0, 0, 1, 1}, {&__pyx_n_s_fields, __pyx_k_fields, sizeof(__pyx_k_fields), 0, 0, 1, 1}, {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, {&__pyx_n_s_flush, __pyx_k_flush, sizeof(__pyx_k_flush), 0, 0, 1, 1}, {&__pyx_n_s_follow_symlinks, __pyx_k_follow_symlinks, sizeof(__pyx_k_follow_symlinks), 0, 0, 1, 1}, {&__pyx_n_s_fsdecode, __pyx_k_fsdecode, sizeof(__pyx_k_fsdecode), 0, 0, 1, 1}, {&__pyx_n_s_fsencode, __pyx_k_fsencode, sizeof(__pyx_k_fsencode), 0, 0, 1, 1}, {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1}, {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, {&__pyx_n_s_get_flags, __pyx_k_get_flags, sizeof(__pyx_k_get_flags), 0, 0, 1, 1}, {&__pyx_n_s_getxattr, __pyx_k_getxattr, sizeof(__pyx_k_getxattr), 0, 0, 1, 1}, {&__pyx_n_s_getxattr_inner, __pyx_k_getxattr_inner, sizeof(__pyx_k_getxattr_inner), 0, 0, 1, 1}, {&__pyx_n_s_getxattr_locals_func, __pyx_k_getxattr_locals_func, sizeof(__pyx_k_getxattr_locals_func), 0, 0, 1, 1}, {&__pyx_n_s_group, __pyx_k_group, sizeof(__pyx_k_group), 0, 0, 1, 1}, {&__pyx_n_s_group2gid, __pyx_k_group2gid, sizeof(__pyx_k_group2gid), 0, 0, 1, 1}, {&__pyx_n_s_helpers, __pyx_k_helpers, sizeof(__pyx_k_helpers), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, {&__pyx_n_s_item, __pyx_k_item, sizeof(__pyx_k_item), 0, 0, 1, 1}, {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1}, {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, {&__pyx_n_s_last_sync, __pyx_k_last_sync, sizeof(__pyx_k_last_sync), 0, 0, 1, 1}, {&__pyx_kp_s_length_d_not_page_aligned, __pyx_k_length_d_not_page_aligned, sizeof(__pyx_k_length_d_not_page_aligned), 0, 0, 1, 0}, {&__pyx_n_s_linux_flag, __pyx_k_linux_flag, sizeof(__pyx_k_linux_flag), 0, 0, 1, 1}, {&__pyx_n_s_linux_flags, __pyx_k_linux_flags, sizeof(__pyx_k_linux_flags), 0, 0, 1, 1}, {&__pyx_n_s_listxattr, __pyx_k_listxattr, sizeof(__pyx_k_listxattr), 0, 0, 1, 1}, {&__pyx_n_s_listxattr_inner, __pyx_k_listxattr_inner, sizeof(__pyx_k_listxattr_inner), 0, 0, 1, 1}, {&__pyx_n_s_listxattr_locals_func, __pyx_k_listxattr_locals_func, sizeof(__pyx_k_listxattr_locals_func), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, {&__pyx_n_s_mro_entries, __pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 0, 1, 1}, {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, {&__pyx_n_s_numeric_ids, __pyx_k_numeric_ids, sizeof(__pyx_k_numeric_ids), 0, 0, 1, 1}, {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1}, {&__pyx_kp_s_offset_d_not_page_aligned, __pyx_k_offset_d_not_page_aligned, sizeof(__pyx_k_offset_d_not_page_aligned), 0, 0, 1, 0}, {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1}, {&__pyx_n_s_open_fd, __pyx_k_open_fd, sizeof(__pyx_k_open_fd), 0, 0, 1, 1}, {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, {&__pyx_n_s_pending_sync, __pyx_k_pending_sync, sizeof(__pyx_k_pending_sync), 0, 0, 1, 1}, {&__pyx_n_s_posix, __pyx_k_posix, sizeof(__pyx_k_posix), 0, 0, 1, 1}, {&__pyx_n_s_posix_acl_use_stored_uid_gid, __pyx_k_posix_acl_use_stored_uid_gid, sizeof(__pyx_k_posix_acl_use_stored_uid_gid), 0, 0, 1, 1}, {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, {&__pyx_n_s_re, __pyx_k_re, sizeof(__pyx_k_re), 0, 0, 1, 1}, {&__pyx_n_s_ret, __pyx_k_ret, sizeof(__pyx_k_ret), 0, 0, 1, 1}, {&__pyx_n_s_safe_decode, __pyx_k_safe_decode, sizeof(__pyx_k_safe_decode), 0, 0, 1, 1}, {&__pyx_n_s_safe_encode, __pyx_k_safe_encode, sizeof(__pyx_k_safe_encode), 0, 0, 1, 1}, {&__pyx_n_s_safe_fadvise, __pyx_k_safe_fadvise, sizeof(__pyx_k_safe_fadvise), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_set_flags, __pyx_k_set_flags, sizeof(__pyx_k_set_flags), 0, 0, 1, 1}, {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1}, {&__pyx_n_s_setxattr, __pyx_k_setxattr, sizeof(__pyx_k_setxattr), 0, 0, 1, 1}, {&__pyx_n_s_setxattr_inner, __pyx_k_setxattr_inner, sizeof(__pyx_k_setxattr_inner), 0, 0, 1, 1}, {&__pyx_n_s_setxattr_locals_func, __pyx_k_setxattr_locals_func, sizeof(__pyx_k_setxattr_locals_func), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1}, {&__pyx_n_s_split_string0, __pyx_k_split_string0, sizeof(__pyx_k_split_string0), 0, 0, 1, 1}, {&__pyx_kp_s_src_borg_platform_linux_pyx, __pyx_k_src_borg_platform_linux_pyx, sizeof(__pyx_k_src_borg_platform_linux_pyx), 0, 0, 1, 0}, {&__pyx_n_s_st, __pyx_k_st, sizeof(__pyx_k_st), 0, 0, 1, 1}, {&__pyx_n_s_st_mode, __pyx_k_st_mode, sizeof(__pyx_k_st_mode), 0, 0, 1, 1}, {&__pyx_n_s_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 0, 1, 1}, {&__pyx_n_s_stat, __pyx_k_stat, sizeof(__pyx_k_stat), 0, 0, 1, 1}, {&__pyx_n_s_strerror, __pyx_k_strerror, sizeof(__pyx_k_strerror), 0, 0, 1, 1}, {&__pyx_n_s_sub, __pyx_k_sub, sizeof(__pyx_k_sub), 0, 0, 1, 1}, {&__pyx_n_s_subprocess, __pyx_k_subprocess, sizeof(__pyx_k_subprocess), 0, 0, 1, 1}, {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, {&__pyx_n_s_sync, __pyx_k_sync, sizeof(__pyx_k_sync), 0, 0, 1, 1}, {&__pyx_n_s_sync_file_range, __pyx_k_sync_file_range, sizeof(__pyx_k_sync_file_range), 0, 0, 1, 1}, {&__pyx_n_s_syncfilerange, __pyx_k_syncfilerange, sizeof(__pyx_k_syncfilerange), 0, 0, 1, 1}, {&__pyx_kp_b_system_posix_acl, __pyx_k_system_posix_acl, sizeof(__pyx_k_system_posix_acl), 0, 0, 0, 0}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_user, __pyx_k_user, sizeof(__pyx_k_user), 0, 0, 1, 1}, {&__pyx_n_s_user2uid, __pyx_k_user2uid, sizeof(__pyx_k_user2uid), 0, 0, 1, 1}, {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, {&__pyx_n_s_workarounds, __pyx_k_workarounds, sizeof(__pyx_k_workarounds), 0, 0, 1, 1}, {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1}, {&__pyx_n_s_write_window, __pyx_k_write_window, sizeof(__pyx_k_write_window), 0, 0, 1, 1}, {&__pyx_n_s_xattr, __pyx_k_xattr, sizeof(__pyx_k_xattr), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 16, __pyx_L1_error) __pyx_builtin_OSError = __Pyx_GetBuiltinName(__pyx_n_s_OSError); if (!__pyx_builtin_OSError) __PYX_ERR(0, 150, __pyx_L1_error) __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 324, __pyx_L1_error) __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 351, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "borg/platform/linux.pyx":83 * * def listxattr(path, *, follow_symlinks=False): * def func(path, buf, size): # <<<<<<<<<<<<<< * if isinstance(path, int): * return c_flistxattr(path, buf, size) */ __pyx_tuple_ = PyTuple_Pack(3, __pyx_n_s_path, __pyx_n_s_buf, __pyx_n_s_size); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple_, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_linux_pyx, __pyx_n_s_func, 83, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 83, __pyx_L1_error) /* "borg/platform/linux.pyx":98 * * def getxattr(path, name, *, follow_symlinks=False): * def func(path, name, buf, size): # <<<<<<<<<<<<<< * if isinstance(path, int): * return c_fgetxattr(path, name, buf, size) */ __pyx_tuple__3 = PyTuple_Pack(4, __pyx_n_s_path, __pyx_n_s_name, __pyx_n_s_buf, __pyx_n_s_size); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_linux_pyx, __pyx_n_s_func, 98, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 98, __pyx_L1_error) /* "borg/platform/linux.pyx":112 * * def setxattr(path, name, value, *, follow_symlinks=False): * def func(path, name, value, size): # <<<<<<<<<<<<<< * flags = 0 * if isinstance(path, int): */ __pyx_tuple__5 = PyTuple_Pack(5, __pyx_n_s_path, __pyx_n_s_name, __pyx_n_s_value, __pyx_n_s_size, __pyx_n_s_flags); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_linux_pyx, __pyx_n_s_func, 112, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 112, __pyx_L1_error) /* "borg/platform/linux.pyx":192 * elif fields[0] == 'group' and fields[1]: * fields[1] = str(group2gid(fields[1], fields[3])) * entries.append(':'.join(fields[:3])) # <<<<<<<<<<<<<< * return safe_encode('\n'.join(entries)) * */ __pyx_slice__9 = PySlice_New(Py_None, __pyx_int_3, Py_None); if (unlikely(!__pyx_slice__9)) __PYX_ERR(0, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__9); __Pyx_GIVEREF(__pyx_slice__9); /* "borg/platform/linux.pyx":286 * cdef acl_t default_acl = NULL * * if stat.S_ISLNK(item.get('mode', 0)): # <<<<<<<<<<<<<< * # Linux does not support setting ACLs on symlinks * return */ __pyx_tuple__11 = PyTuple_Pack(2, __pyx_n_s_mode, __pyx_int_0); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); /* "borg/platform/linux.pyx":82 * * * def listxattr(path, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, buf, size): * if isinstance(path, int): */ __pyx_tuple__15 = PyTuple_Pack(7, __pyx_n_s_path, __pyx_n_s_follow_symlinks, __pyx_n_s_func, __pyx_n_s_func, __pyx_n_s_n, __pyx_n_s_buf, __pyx_n_s_name); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_linux_pyx, __pyx_n_s_listxattr, 82, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 82, __pyx_L1_error) /* "borg/platform/linux.pyx":97 * * * def getxattr(path, name, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, name, buf, size): * if isinstance(path, int): */ __pyx_tuple__17 = PyTuple_Pack(7, __pyx_n_s_path, __pyx_n_s_name, __pyx_n_s_follow_symlinks, __pyx_n_s_func, __pyx_n_s_func, __pyx_n_s_n, __pyx_n_s_buf); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(2, 0, 1, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_linux_pyx, __pyx_n_s_getxattr, 97, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 97, __pyx_L1_error) /* "borg/platform/linux.pyx":111 * * * def setxattr(path, name, value, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, name, value, size): * flags = 0 */ __pyx_tuple__19 = PyTuple_Pack(6, __pyx_n_s_path, __pyx_n_s_name, __pyx_n_s_value, __pyx_n_s_follow_symlinks, __pyx_n_s_func, __pyx_n_s_func); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(3, 0, 1, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_linux_pyx, __pyx_n_s_setxattr, 111, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 111, __pyx_L1_error) /* "borg/platform/linux.pyx":133 * * * def set_flags(path, bsd_flags, fd=None): # <<<<<<<<<<<<<< * if fd is None: * st = os.stat(path, follow_symlinks=False) */ __pyx_tuple__21 = PyTuple_Pack(9, __pyx_n_s_path, __pyx_n_s_bsd_flags, __pyx_n_s_fd, __pyx_n_s_st, __pyx_n_s_flags, __pyx_n_s_bsd_flag, __pyx_n_s_linux_flag, __pyx_n_s_open_fd, __pyx_n_s_error_number); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_linux_pyx, __pyx_n_s_set_flags, 133, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 133, __pyx_L1_error) __pyx_tuple__23 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23); /* "borg/platform/linux.pyx":156 * * * def get_flags(path, st, fd=None): # <<<<<<<<<<<<<< * if stat.S_ISBLK(st.st_mode) or stat.S_ISCHR(st.st_mode) or stat.S_ISLNK(st.st_mode): * # avoid opening devices files - trying to open non-present devices can be rather slow. */ __pyx_tuple__24 = PyTuple_Pack(8, __pyx_n_s_path, __pyx_n_s_st, __pyx_n_s_fd, __pyx_n_s_linux_flags, __pyx_n_s_open_fd, __pyx_n_s_bsd_flags, __pyx_n_s_bsd_flag, __pyx_n_s_linux_flag); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_linux_pyx, __pyx_n_s_get_flags, 156, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 156, __pyx_L1_error) /* "borg/platform/linux.pyx":181 * * * def acl_use_local_uid_gid(acl): # <<<<<<<<<<<<<< * """Replace the user/group field with the local uid/gid if possible * """ */ __pyx_tuple__26 = PyTuple_Pack(4, __pyx_n_s_acl, __pyx_n_s_entries, __pyx_n_s_entry, __pyx_n_s_fields); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__26); __Pyx_GIVEREF(__pyx_tuple__26); __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_linux_pyx, __pyx_n_s_acl_use_local_uid_gid, 181, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 181, __pyx_L1_error) /* "borg/platform/linux.pyx":230 * * * def acl_get(path, item, st, numeric_ids=False, fd=None): # <<<<<<<<<<<<<< * cdef acl_t default_acl = NULL * cdef acl_t access_acl = NULL */ __pyx_tuple__28 = PyTuple_Pack(11, __pyx_n_s_path, __pyx_n_s_item, __pyx_n_s_st, __pyx_n_s_numeric_ids, __pyx_n_s_fd, __pyx_n_s_default_acl, __pyx_n_s_access_acl, __pyx_n_s_default_text, __pyx_n_s_access_text, __pyx_n_s_ret, __pyx_n_s_converter); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__28); __Pyx_GIVEREF(__pyx_tuple__28); __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_linux_pyx, __pyx_n_s_acl_get, 230, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 230, __pyx_L1_error) __pyx_tuple__30 = PyTuple_Pack(2, ((PyObject *)Py_False), Py_None); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__30); __Pyx_GIVEREF(__pyx_tuple__30); /* "borg/platform/linux.pyx":282 * * * def acl_set(path, item, numeric_ids=False, fd=None): # <<<<<<<<<<<<<< * cdef acl_t access_acl = NULL * cdef acl_t default_acl = NULL */ __pyx_tuple__31 = PyTuple_Pack(9, __pyx_n_s_path, __pyx_n_s_item, __pyx_n_s_numeric_ids, __pyx_n_s_fd, __pyx_n_s_access_acl, __pyx_n_s_default_acl, __pyx_n_s_converter, __pyx_n_s_access_text, __pyx_n_s_default_text); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_linux_pyx, __pyx_n_s_acl_set, 282, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 282, __pyx_L1_error) /* "borg/platform/linux.pyx":350 * """ * * def __init__(self, path, *, fd=None, binary=False): # <<<<<<<<<<<<<< * super().__init__(path, fd=fd, binary=binary) * self.offset = 0 */ __pyx_tuple__33 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_path, __pyx_n_s_fd, __pyx_n_s_binary); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__33); __Pyx_GIVEREF(__pyx_tuple__33); __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_linux_pyx, __pyx_n_s_init, 350, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 350, __pyx_L1_error) /* "borg/platform/linux.pyx":357 * self.pending_sync = None * * def write(self, data): # <<<<<<<<<<<<<< * self.offset += self.f.write(data) * offset = self.offset & ~PAGE_MASK */ __pyx_tuple__35 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_data, __pyx_n_s_offset); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__35); __Pyx_GIVEREF(__pyx_tuple__35); __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_linux_pyx, __pyx_n_s_write, 357, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 357, __pyx_L1_error) /* "borg/platform/linux.pyx":369 * self.last_sync = offset * * def sync(self): # <<<<<<<<<<<<<< * self.f.flush() * os.fdatasync(self.fd) */ __pyx_tuple__37 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 369, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__37); __Pyx_GIVEREF(__pyx_tuple__37); __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_linux_pyx, __pyx_n_s_sync, 369, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 369, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { /* AssertionsEnabled.init */ if (likely(__Pyx_init_assertions_enabled() == 0)); else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS __pyx_ptype_4borg_8platform_5linux___pyx_scope_struct__listxattr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4borg_8platform_5linux___pyx_scope_struct__listxattr_spec, NULL); if (unlikely(!__pyx_ptype_4borg_8platform_5linux___pyx_scope_struct__listxattr)) __PYX_ERR(0, 82, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4borg_8platform_5linux___pyx_scope_struct__listxattr_spec, __pyx_ptype_4borg_8platform_5linux___pyx_scope_struct__listxattr) < 0) __PYX_ERR(0, 82, __pyx_L1_error) #else __pyx_ptype_4borg_8platform_5linux___pyx_scope_struct__listxattr = &__pyx_type_4borg_8platform_5linux___pyx_scope_struct__listxattr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_4borg_8platform_5linux___pyx_scope_struct__listxattr) < 0) __PYX_ERR(0, 82, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_4borg_8platform_5linux___pyx_scope_struct__listxattr->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4borg_8platform_5linux___pyx_scope_struct__listxattr->tp_dictoffset && __pyx_ptype_4borg_8platform_5linux___pyx_scope_struct__listxattr->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_4borg_8platform_5linux___pyx_scope_struct__listxattr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_4borg_8platform_5linux___pyx_scope_struct_1_getxattr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4borg_8platform_5linux___pyx_scope_struct_1_getxattr_spec, NULL); if (unlikely(!__pyx_ptype_4borg_8platform_5linux___pyx_scope_struct_1_getxattr)) __PYX_ERR(0, 97, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4borg_8platform_5linux___pyx_scope_struct_1_getxattr_spec, __pyx_ptype_4borg_8platform_5linux___pyx_scope_struct_1_getxattr) < 0) __PYX_ERR(0, 97, __pyx_L1_error) #else __pyx_ptype_4borg_8platform_5linux___pyx_scope_struct_1_getxattr = &__pyx_type_4borg_8platform_5linux___pyx_scope_struct_1_getxattr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_4borg_8platform_5linux___pyx_scope_struct_1_getxattr) < 0) __PYX_ERR(0, 97, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_4borg_8platform_5linux___pyx_scope_struct_1_getxattr->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4borg_8platform_5linux___pyx_scope_struct_1_getxattr->tp_dictoffset && __pyx_ptype_4borg_8platform_5linux___pyx_scope_struct_1_getxattr->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_4borg_8platform_5linux___pyx_scope_struct_1_getxattr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_4borg_8platform_5linux___pyx_scope_struct_2_setxattr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4borg_8platform_5linux___pyx_scope_struct_2_setxattr_spec, NULL); if (unlikely(!__pyx_ptype_4borg_8platform_5linux___pyx_scope_struct_2_setxattr)) __PYX_ERR(0, 111, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4borg_8platform_5linux___pyx_scope_struct_2_setxattr_spec, __pyx_ptype_4borg_8platform_5linux___pyx_scope_struct_2_setxattr) < 0) __PYX_ERR(0, 111, __pyx_L1_error) #else __pyx_ptype_4borg_8platform_5linux___pyx_scope_struct_2_setxattr = &__pyx_type_4borg_8platform_5linux___pyx_scope_struct_2_setxattr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_4borg_8platform_5linux___pyx_scope_struct_2_setxattr) < 0) __PYX_ERR(0, 111, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_4borg_8platform_5linux___pyx_scope_struct_2_setxattr->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4borg_8platform_5linux___pyx_scope_struct_2_setxattr->tp_dictoffset && __pyx_ptype_4borg_8platform_5linux___pyx_scope_struct_2_setxattr->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_4borg_8platform_5linux___pyx_scope_struct_2_setxattr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_linux(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_linux}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "linux", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initlinux(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initlinux(void) #else __Pyx_PyMODINIT_FUNC PyInit_linux(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_linux(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_linux(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_t_9; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'linux' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("linux", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "linux" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_linux(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_borg__platform__linux) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "borg.platform.linux")) { if (unlikely((PyDict_SetItemString(modules, "borg.platform.linux", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) (void)__Pyx_modinit_type_import_code(); (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "borg/platform/linux.pyx":1 * import os # <<<<<<<<<<<<<< * import re * import stat */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_os, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/linux.pyx":2 * import os * import re # <<<<<<<<<<<<<< * import stat * import subprocess */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_re, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_re, __pyx_t_2) < 0) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/linux.pyx":3 * import os * import re * import stat # <<<<<<<<<<<<<< * import subprocess * */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_stat, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_stat, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/linux.pyx":4 * import re * import stat * import subprocess # <<<<<<<<<<<<<< * * from .posix import posix_acl_use_stored_uid_gid */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_subprocess, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_subprocess, __pyx_t_2) < 0) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/linux.pyx":6 * import subprocess * * from .posix import posix_acl_use_stored_uid_gid # <<<<<<<<<<<<<< * from .posix import user2uid, group2gid * from ..helpers import workarounds */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_posix_acl_use_stored_uid_gid); __Pyx_GIVEREF(__pyx_n_s_posix_acl_use_stored_uid_gid); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_posix_acl_use_stored_uid_gid)) __PYX_ERR(0, 6, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_posix, __pyx_t_2, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_posix_acl_use_stored_uid_gid); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_posix_acl_use_stored_uid_gid, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/linux.pyx":7 * * from .posix import posix_acl_use_stored_uid_gid * from .posix import user2uid, group2gid # <<<<<<<<<<<<<< * from ..helpers import workarounds * from ..helpers import safe_decode, safe_encode */ __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_user2uid); __Pyx_GIVEREF(__pyx_n_s_user2uid); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_user2uid)) __PYX_ERR(0, 7, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_group2gid); __Pyx_GIVEREF(__pyx_n_s_group2gid); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_group2gid)) __PYX_ERR(0, 7, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_posix, __pyx_t_3, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_user2uid); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_user2uid, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_group2gid); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_group2gid, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/linux.pyx":8 * from .posix import posix_acl_use_stored_uid_gid * from .posix import user2uid, group2gid * from ..helpers import workarounds # <<<<<<<<<<<<<< * from ..helpers import safe_decode, safe_encode * from .base import SyncFile as BaseSyncFile */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_workarounds); __Pyx_GIVEREF(__pyx_n_s_workarounds); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_workarounds)) __PYX_ERR(0, 8, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_helpers, __pyx_t_2, 2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_workarounds); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_workarounds, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/linux.pyx":9 * from .posix import user2uid, group2gid * from ..helpers import workarounds * from ..helpers import safe_decode, safe_encode # <<<<<<<<<<<<<< * from .base import SyncFile as BaseSyncFile * from .base import safe_fadvise */ __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_safe_decode); __Pyx_GIVEREF(__pyx_n_s_safe_decode); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_safe_decode)) __PYX_ERR(0, 9, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_safe_encode); __Pyx_GIVEREF(__pyx_n_s_safe_encode); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_safe_encode)) __PYX_ERR(0, 9, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_helpers, __pyx_t_3, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_safe_decode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_safe_decode, __pyx_t_3) < 0) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_safe_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_safe_encode, __pyx_t_3) < 0) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/linux.pyx":10 * from ..helpers import workarounds * from ..helpers import safe_decode, safe_encode * from .base import SyncFile as BaseSyncFile # <<<<<<<<<<<<<< * from .base import safe_fadvise * from .xattr import _listxattr_inner, _getxattr_inner, _setxattr_inner, split_string0 */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_SyncFile); __Pyx_GIVEREF(__pyx_n_s_SyncFile); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_SyncFile)) __PYX_ERR(0, 10, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_base, __pyx_t_2, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_SyncFile); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_BaseSyncFile, __pyx_t_2) < 0) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/linux.pyx":11 * from ..helpers import safe_decode, safe_encode * from .base import SyncFile as BaseSyncFile * from .base import safe_fadvise # <<<<<<<<<<<<<< * from .xattr import _listxattr_inner, _getxattr_inner, _setxattr_inner, split_string0 * try: */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_safe_fadvise); __Pyx_GIVEREF(__pyx_n_s_safe_fadvise); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_safe_fadvise)) __PYX_ERR(0, 11, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_base, __pyx_t_3, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_safe_fadvise); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_safe_fadvise, __pyx_t_3) < 0) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/linux.pyx":12 * from .base import SyncFile as BaseSyncFile * from .base import safe_fadvise * from .xattr import _listxattr_inner, _getxattr_inner, _setxattr_inner, split_string0 # <<<<<<<<<<<<<< * try: * from .syncfilerange import sync_file_range, SYNC_FILE_RANGE_WRITE, SYNC_FILE_RANGE_WAIT_BEFORE, SYNC_FILE_RANGE_WAIT_AFTER */ __pyx_t_2 = PyList_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_listxattr_inner); __Pyx_GIVEREF(__pyx_n_s_listxattr_inner); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_listxattr_inner)) __PYX_ERR(0, 12, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_getxattr_inner); __Pyx_GIVEREF(__pyx_n_s_getxattr_inner); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_getxattr_inner)) __PYX_ERR(0, 12, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_setxattr_inner); __Pyx_GIVEREF(__pyx_n_s_setxattr_inner); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_setxattr_inner)) __PYX_ERR(0, 12, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_split_string0); __Pyx_GIVEREF(__pyx_n_s_split_string0); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_split_string0)) __PYX_ERR(0, 12, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_xattr, __pyx_t_2, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_listxattr_inner); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_listxattr_inner, __pyx_t_2) < 0) __PYX_ERR(0, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_getxattr_inner); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_getxattr_inner, __pyx_t_2) < 0) __PYX_ERR(0, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_setxattr_inner); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setxattr_inner, __pyx_t_2) < 0) __PYX_ERR(0, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_split_string0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_split_string0, __pyx_t_2) < 0) __PYX_ERR(0, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/linux.pyx":13 * from .base import safe_fadvise * from .xattr import _listxattr_inner, _getxattr_inner, _setxattr_inner, split_string0 * try: # <<<<<<<<<<<<<< * from .syncfilerange import sync_file_range, SYNC_FILE_RANGE_WRITE, SYNC_FILE_RANGE_WAIT_BEFORE, SYNC_FILE_RANGE_WAIT_AFTER * SYNC_FILE_RANGE_LOADED = True */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_4, &__pyx_t_5); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); /*try:*/ { /* "borg/platform/linux.pyx":14 * from .xattr import _listxattr_inner, _getxattr_inner, _setxattr_inner, split_string0 * try: * from .syncfilerange import sync_file_range, SYNC_FILE_RANGE_WRITE, SYNC_FILE_RANGE_WAIT_BEFORE, SYNC_FILE_RANGE_WAIT_AFTER # <<<<<<<<<<<<<< * SYNC_FILE_RANGE_LOADED = True * except ImportError: */ __pyx_t_3 = PyList_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 14, __pyx_L2_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_sync_file_range); __Pyx_GIVEREF(__pyx_n_s_sync_file_range); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_sync_file_range)) __PYX_ERR(0, 14, __pyx_L2_error); __Pyx_INCREF(__pyx_n_s_SYNC_FILE_RANGE_WRITE); __Pyx_GIVEREF(__pyx_n_s_SYNC_FILE_RANGE_WRITE); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_SYNC_FILE_RANGE_WRITE)) __PYX_ERR(0, 14, __pyx_L2_error); __Pyx_INCREF(__pyx_n_s_SYNC_FILE_RANGE_WAIT_BEFORE); __Pyx_GIVEREF(__pyx_n_s_SYNC_FILE_RANGE_WAIT_BEFORE); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_SYNC_FILE_RANGE_WAIT_BEFORE)) __PYX_ERR(0, 14, __pyx_L2_error); __Pyx_INCREF(__pyx_n_s_SYNC_FILE_RANGE_WAIT_AFTER); __Pyx_GIVEREF(__pyx_n_s_SYNC_FILE_RANGE_WAIT_AFTER); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 3, __pyx_n_s_SYNC_FILE_RANGE_WAIT_AFTER)) __PYX_ERR(0, 14, __pyx_L2_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_syncfilerange, __pyx_t_3, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L2_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_sync_file_range); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 14, __pyx_L2_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_sync_file_range, __pyx_t_3) < 0) __PYX_ERR(0, 14, __pyx_L2_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_SYNC_FILE_RANGE_WRITE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 14, __pyx_L2_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SYNC_FILE_RANGE_WRITE, __pyx_t_3) < 0) __PYX_ERR(0, 14, __pyx_L2_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_SYNC_FILE_RANGE_WAIT_BEFORE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 14, __pyx_L2_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SYNC_FILE_RANGE_WAIT_BEFORE, __pyx_t_3) < 0) __PYX_ERR(0, 14, __pyx_L2_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_SYNC_FILE_RANGE_WAIT_AFTER); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 14, __pyx_L2_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SYNC_FILE_RANGE_WAIT_AFTER, __pyx_t_3) < 0) __PYX_ERR(0, 14, __pyx_L2_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/linux.pyx":15 * try: * from .syncfilerange import sync_file_range, SYNC_FILE_RANGE_WRITE, SYNC_FILE_RANGE_WAIT_BEFORE, SYNC_FILE_RANGE_WAIT_AFTER * SYNC_FILE_RANGE_LOADED = True # <<<<<<<<<<<<<< * except ImportError: * SYNC_FILE_RANGE_LOADED = False */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SYNC_FILE_RANGE_LOADED, Py_True) < 0) __PYX_ERR(0, 15, __pyx_L2_error) /* "borg/platform/linux.pyx":13 * from .base import safe_fadvise * from .xattr import _listxattr_inner, _getxattr_inner, _setxattr_inner, split_string0 * try: # <<<<<<<<<<<<<< * from .syncfilerange import sync_file_range, SYNC_FILE_RANGE_WRITE, SYNC_FILE_RANGE_WAIT_BEFORE, SYNC_FILE_RANGE_WAIT_AFTER * SYNC_FILE_RANGE_LOADED = True */ } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L7_try_end; __pyx_L2_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/linux.pyx":16 * from .syncfilerange import sync_file_range, SYNC_FILE_RANGE_WRITE, SYNC_FILE_RANGE_WAIT_BEFORE, SYNC_FILE_RANGE_WAIT_AFTER * SYNC_FILE_RANGE_LOADED = True * except ImportError: # <<<<<<<<<<<<<< * SYNC_FILE_RANGE_LOADED = False * */ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError); if (__pyx_t_6) { __Pyx_AddTraceback("borg.platform.linux", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_7) < 0) __PYX_ERR(0, 16, __pyx_L4_except_error) __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_7); /* "borg/platform/linux.pyx":17 * SYNC_FILE_RANGE_LOADED = True * except ImportError: * SYNC_FILE_RANGE_LOADED = False # <<<<<<<<<<<<<< * * from libc cimport errno */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SYNC_FILE_RANGE_LOADED, Py_False) < 0) __PYX_ERR(0, 17, __pyx_L4_except_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L3_exception_handled; } goto __pyx_L4_except_error; /* "borg/platform/linux.pyx":13 * from .base import safe_fadvise * from .xattr import _listxattr_inner, _getxattr_inner, _setxattr_inner, split_string0 * try: # <<<<<<<<<<<<<< * from .syncfilerange import sync_file_range, SYNC_FILE_RANGE_WRITE, SYNC_FILE_RANGE_WAIT_BEFORE, SYNC_FILE_RANGE_WAIT_AFTER * SYNC_FILE_RANGE_LOADED = True */ __pyx_L4_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_4, __pyx_t_5); goto __pyx_L1_error; __pyx_L3_exception_handled:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_4, __pyx_t_5); __pyx_L7_try_end:; } /* "borg/platform/linux.pyx":22 * from libc.stdint cimport int64_t * * API_VERSION = '1.4_01' # <<<<<<<<<<<<<< * * cdef extern from "sys/xattr.h": */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_API_VERSION, __pyx_kp_s_1_4_01) < 0) __PYX_ERR(0, 22, __pyx_L1_error) /* "borg/platform/linux.pyx":79 * char *strerror(int errnum) * * _comment_re = re.compile(' *#.*', re.M) # <<<<<<<<<<<<<< * * */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_compile); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_M); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_kp_s__14); __Pyx_GIVEREF(__pyx_kp_s__14); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_kp_s__14)) __PYX_ERR(0, 79, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_comment_re, __pyx_t_2) < 0) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/linux.pyx":82 * * * def listxattr(path, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, buf, size): * if isinstance(path, int): */ __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_follow_symlinks, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 82, __pyx_L1_error) __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_5linux_1listxattr, 0, __pyx_n_s_listxattr, NULL, __pyx_n_s_borg_platform_linux, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_7, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_listxattr, __pyx_t_7) < 0) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/platform/linux.pyx":97 * * * def getxattr(path, name, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, name, buf, size): * if isinstance(path, int): */ __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_follow_symlinks, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 97, __pyx_L1_error) __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_5linux_3getxattr, 0, __pyx_n_s_getxattr, NULL, __pyx_n_s_borg_platform_linux, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_2, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_getxattr, __pyx_t_2) < 0) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/linux.pyx":111 * * * def setxattr(path, name, value, *, follow_symlinks=False): # <<<<<<<<<<<<<< * def func(path, name, value, size): * flags = 0 */ __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_follow_symlinks, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 111, __pyx_L1_error) __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_5linux_5setxattr, 0, __pyx_n_s_setxattr, NULL, __pyx_n_s_borg_platform_linux, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_7, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_setxattr, __pyx_t_7) < 0) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/platform/linux.pyx":126 * * BSD_TO_LINUX_FLAGS = { * stat.UF_NODUMP: FS_NODUMP_FL, # <<<<<<<<<<<<<< * stat.UF_IMMUTABLE: FS_IMMUTABLE_FL, * stat.UF_APPEND: FS_APPEND_FL, */ __pyx_t_7 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_stat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_UF_NODUMP); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(FS_NODUMP_FL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_7, __pyx_t_3, __pyx_t_2) < 0) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/linux.pyx":127 * BSD_TO_LINUX_FLAGS = { * stat.UF_NODUMP: FS_NODUMP_FL, * stat.UF_IMMUTABLE: FS_IMMUTABLE_FL, # <<<<<<<<<<<<<< * stat.UF_APPEND: FS_APPEND_FL, * stat.UF_COMPRESSED: FS_COMPR_FL, */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_stat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_UF_IMMUTABLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(FS_IMMUTABLE_FL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_7, __pyx_t_3, __pyx_t_2) < 0) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/linux.pyx":128 * stat.UF_NODUMP: FS_NODUMP_FL, * stat.UF_IMMUTABLE: FS_IMMUTABLE_FL, * stat.UF_APPEND: FS_APPEND_FL, # <<<<<<<<<<<<<< * stat.UF_COMPRESSED: FS_COMPR_FL, * } */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_stat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_UF_APPEND); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(FS_APPEND_FL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_7, __pyx_t_3, __pyx_t_2) < 0) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/linux.pyx":129 * stat.UF_IMMUTABLE: FS_IMMUTABLE_FL, * stat.UF_APPEND: FS_APPEND_FL, * stat.UF_COMPRESSED: FS_COMPR_FL, # <<<<<<<<<<<<<< * } * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_stat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_UF_COMPRESSED); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(FS_COMPR_FL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_7, __pyx_t_3, __pyx_t_2) < 0) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_BSD_TO_LINUX_FLAGS, __pyx_t_7) < 0) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/platform/linux.pyx":133 * * * def set_flags(path, bsd_flags, fd=None): # <<<<<<<<<<<<<< * if fd is None: * st = os.stat(path, follow_symlinks=False) */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_5linux_7set_flags, 0, __pyx_n_s_set_flags, NULL, __pyx_n_s_borg_platform_linux, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__23); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_flags, __pyx_t_7) < 0) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/platform/linux.pyx":156 * * * def get_flags(path, st, fd=None): # <<<<<<<<<<<<<< * if stat.S_ISBLK(st.st_mode) or stat.S_ISCHR(st.st_mode) or stat.S_ISLNK(st.st_mode): * # avoid opening devices files - trying to open non-present devices can be rather slow. */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_5linux_9get_flags, 0, __pyx_n_s_get_flags, NULL, __pyx_n_s_borg_platform_linux, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__23); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_flags, __pyx_t_7) < 0) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/platform/linux.pyx":181 * * * def acl_use_local_uid_gid(acl): # <<<<<<<<<<<<<< * """Replace the user/group field with the local uid/gid if possible * """ */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_5linux_11acl_use_local_uid_gid, 0, __pyx_n_s_acl_use_local_uid_gid, NULL, __pyx_n_s_borg_platform_linux, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_acl_use_local_uid_gid, __pyx_t_7) < 0) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/platform/linux.pyx":230 * * * def acl_get(path, item, st, numeric_ids=False, fd=None): # <<<<<<<<<<<<<< * cdef acl_t default_acl = NULL * cdef acl_t access_acl = NULL */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_5linux_13acl_get, 0, __pyx_n_s_acl_get, NULL, __pyx_n_s_borg_platform_linux, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__30); if (PyDict_SetItem(__pyx_d, __pyx_n_s_acl_get, __pyx_t_7) < 0) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/platform/linux.pyx":282 * * * def acl_set(path, item, numeric_ids=False, fd=None): # <<<<<<<<<<<<<< * cdef acl_t access_acl = NULL * cdef acl_t default_acl = NULL */ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_5linux_15acl_set, 0, __pyx_n_s_acl_set, NULL, __pyx_n_s_borg_platform_linux, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__30); if (PyDict_SetItem(__pyx_d, __pyx_n_s_acl_set, __pyx_t_7) < 0) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/platform/linux.pyx":331 * * * cdef unsigned PAGE_MASK = sysconf(_SC_PAGESIZE) - 1 # <<<<<<<<<<<<<< * * */ __pyx_v_4borg_8platform_5linux_PAGE_MASK = (sysconf(_SC_PAGESIZE) - 1); /* "borg/platform/linux.pyx":334 * * * if 'basesyncfile' in workarounds or not SYNC_FILE_RANGE_LOADED: # <<<<<<<<<<<<<< * class SyncFile(BaseSyncFile): * # if we are on platforms with a broken or not implemented sync_file_range, */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_workarounds); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_basesyncfile, __pyx_t_7, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (!__pyx_t_9) { } else { __pyx_t_8 = __pyx_t_9; goto __pyx_L11_bool_binop_done; } __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_SYNC_FILE_RANGE_LOADED); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_10 = (!__pyx_t_9); __pyx_t_8 = __pyx_t_10; __pyx_L11_bool_binop_done:; if (__pyx_t_8) { /* "borg/platform/linux.pyx":335 * * if 'basesyncfile' in workarounds or not SYNC_FILE_RANGE_LOADED: * class SyncFile(BaseSyncFile): # <<<<<<<<<<<<<< * # if we are on platforms with a broken or not implemented sync_file_range, * # use the more generic BaseSyncFile to avoid issues. */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_BaseSyncFile); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7)) __PYX_ERR(0, 335, __pyx_L1_error); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PEP560_update_bases(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_11 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_7, __pyx_n_s_SyncFile, __pyx_n_s_SyncFile, (PyObject *) NULL, __pyx_n_s_borg_platform_linux, (PyObject *) NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_7 != __pyx_t_2) { if (unlikely((PyDict_SetItemString(__pyx_t_11, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(0, 335, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_SyncFile, __pyx_t_7, __pyx_t_11, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SyncFile, __pyx_t_2) < 0) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "borg/platform/linux.pyx":334 * * * if 'basesyncfile' in workarounds or not SYNC_FILE_RANGE_LOADED: # <<<<<<<<<<<<<< * class SyncFile(BaseSyncFile): * # if we are on platforms with a broken or not implemented sync_file_range, */ goto __pyx_L10; } /* "borg/platform/linux.pyx":342 * else: * # a real Linux, so we can do better. :) * class SyncFile(BaseSyncFile): # <<<<<<<<<<<<<< * """ * Implemented using sync_file_range for asynchronous write-out and fdatasync for actual durability. */ /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_BaseSyncFile); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7)) __PYX_ERR(0, 342, __pyx_L1_error); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PEP560_update_bases(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_11 = __Pyx_CalculateMetaclass(NULL, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_11, __pyx_t_7, __pyx_n_s_SyncFile, __pyx_n_s_SyncFile, (PyObject *) NULL, __pyx_n_s_borg_platform_linux, __pyx_kp_s_Implemented_using_sync_file_ran); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__pyx_t_7 != __pyx_t_3) { if (unlikely((PyDict_SetItemString(__pyx_t_2, "__orig_bases__", __pyx_t_3) < 0))) __PYX_ERR(0, 342, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "borg/platform/linux.pyx":350 * """ * * def __init__(self, path, *, fd=None, binary=False): # <<<<<<<<<<<<<< * super().__init__(path, fd=fd, binary=binary) * self.offset = 0 */ __pyx_t_12 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_fd, Py_None) < 0) __PYX_ERR(0, 350, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_binary, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 350, __pyx_L1_error) __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_5linux_8SyncFile_1__init__, 0, __pyx_n_s_SyncFile___init, NULL, __pyx_n_s_borg_platform_linux, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_INCREF(__pyx_t_13); PyList_Append(__pyx_t_3, __pyx_t_13); __Pyx_GIVEREF(__pyx_t_13); __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_13, __pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_13) < 0) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "borg/platform/linux.pyx":357 * self.pending_sync = None * * def write(self, data): # <<<<<<<<<<<<<< * self.offset += self.f.write(data) * offset = self.offset & ~PAGE_MASK */ __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_5linux_8SyncFile_3write, 0, __pyx_n_s_SyncFile_write, NULL, __pyx_n_s_borg_platform_linux, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_write, __pyx_t_13) < 0) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "borg/platform/linux.pyx":369 * self.last_sync = offset * * def sync(self): # <<<<<<<<<<<<<< * self.f.flush() * os.fdatasync(self.fd) */ __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_5linux_8SyncFile_5sync, 0, __pyx_n_s_SyncFile_sync, NULL, __pyx_n_s_borg_platform_linux, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_sync, __pyx_t_13) < 0) __PYX_ERR(0, 369, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "borg/platform/linux.pyx":342 * else: * # a real Linux, so we can do better. :) * class SyncFile(BaseSyncFile): # <<<<<<<<<<<<<< * """ * Implemented using sync_file_range for asynchronous write-out and fdatasync for actual durability. */ __pyx_t_13 = __Pyx_Py3ClassCreate(__pyx_t_11, __pyx_n_s_SyncFile, __pyx_t_7, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__Pyx_CyFunction_InitClassCell(__pyx_t_3, __pyx_t_13) < 0) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_SyncFile, __pyx_t_13) < 0) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_L10:; /* "borg/platform/linux.pyx":1 * import os # <<<<<<<<<<<<<< * import re * import stat */ __pyx_t_7 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_7) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init borg.platform.linux", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init borg.platform.linux"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* RaiseClosureNameError */ static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) { PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname); } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return -1; __Pyx_PyErr_Clear(); return 0; } return 0; } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } return __Pyx_IterFinish(); } /* SliceObject */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, int has_cstart, int has_cstop, int wraparound) { __Pyx_TypeName obj_type_name; #if CYTHON_USE_TYPE_SLOTS PyMappingMethods* mp; #if PY_MAJOR_VERSION < 3 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; if (likely(ms && ms->sq_slice)) { if (!has_cstart) { if (_py_start && (*_py_start != Py_None)) { cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstart = 0; } if (!has_cstop) { if (_py_stop && (*_py_stop != Py_None)) { cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstop = PY_SSIZE_T_MAX; } if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { Py_ssize_t l = ms->sq_length(obj); if (likely(l >= 0)) { if (cstop < 0) { cstop += l; if (cstop < 0) cstop = 0; } if (cstart < 0) { cstart += l; if (cstart < 0) cstart = 0; } } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) goto bad; PyErr_Clear(); } } return ms->sq_slice(obj, cstart, cstop); } #else CYTHON_UNUSED_VAR(wraparound); #endif mp = Py_TYPE(obj)->tp_as_mapping; if (likely(mp && mp->mp_subscript)) #else CYTHON_UNUSED_VAR(wraparound); #endif { PyObject* result; PyObject *py_slice, *py_start, *py_stop; if (_py_slice) { py_slice = *_py_slice; } else { PyObject* owned_start = NULL; PyObject* owned_stop = NULL; if (_py_start) { py_start = *_py_start; } else { if (has_cstart) { owned_start = py_start = PyInt_FromSsize_t(cstart); if (unlikely(!py_start)) goto bad; } else py_start = Py_None; } if (_py_stop) { py_stop = *_py_stop; } else { if (has_cstop) { owned_stop = py_stop = PyInt_FromSsize_t(cstop); if (unlikely(!py_stop)) { Py_XDECREF(owned_start); goto bad; } } else py_stop = Py_None; } py_slice = PySlice_New(py_start, py_stop, Py_None); Py_XDECREF(owned_start); Py_XDECREF(owned_stop); if (unlikely(!py_slice)) goto bad; } #if CYTHON_USE_TYPE_SLOTS result = mp->mp_subscript(obj, py_slice); #else result = PyObject_GetItem(obj, py_slice); #endif if (!_py_slice) { Py_DECREF(py_slice); } return result; } obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' object is unsliceable", obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); bad: return NULL; } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP __Pyx_TypeName type_name; PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) #elif PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (likely(descr != NULL)) { *method = descr; return 0; } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(name)); #endif __Pyx_DECREF_TypeName(type_name); return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_CallOneArg(method, obj); Py_DECREF(method); return result; } if (unlikely(!method)) goto bad; result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* RaiseNoneIterError */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* UnpackTupleError */ static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { if (t == Py_None) { __Pyx_RaiseNoneNotIterableError(); } else if (PyTuple_GET_SIZE(t) < index) { __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); } else { __Pyx_RaiseTooManyValuesError(index); } } /* UnpackTuple2 */ static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) { PyObject *value1 = NULL, *value2 = NULL; #if CYTHON_COMPILING_IN_PYPY value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad; value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad; #else value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1); value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2); #endif if (decref_tuple) { Py_DECREF(tuple); } *pvalue1 = value1; *pvalue2 = value2; return 0; #if CYTHON_COMPILING_IN_PYPY bad: Py_XDECREF(value1); Py_XDECREF(value2); if (decref_tuple) { Py_XDECREF(tuple); } return -1; #endif } static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int has_known_size, int decref_tuple) { Py_ssize_t index; PyObject *value1 = NULL, *value2 = NULL, *iter = NULL; iternextfunc iternext; iter = PyObject_GetIter(tuple); if (unlikely(!iter)) goto bad; if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; } iternext = __Pyx_PyObject_GetIterNextFunc(iter); value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; } value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; } if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad; Py_DECREF(iter); *pvalue1 = value1; *pvalue2 = value2; return 0; unpacking_failed: if (!has_known_size && __Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); bad: Py_XDECREF(iter); Py_XDECREF(value1); Py_XDECREF(value2); if (decref_tuple) { Py_XDECREF(tuple); } return -1; } /* dict_iter */ #if CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 #include #endif static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, Py_ssize_t* p_orig_length, int* p_source_is_dict) { is_dict = is_dict || likely(PyDict_CheckExact(iterable)); *p_source_is_dict = is_dict; if (is_dict) { #if !CYTHON_COMPILING_IN_PYPY *p_orig_length = PyDict_Size(iterable); Py_INCREF(iterable); return iterable; #elif PY_MAJOR_VERSION >= 3 static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL; PyObject **pp = NULL; if (method_name) { const char *name = PyUnicode_AsUTF8(method_name); if (strcmp(name, "iteritems") == 0) pp = &py_items; else if (strcmp(name, "iterkeys") == 0) pp = &py_keys; else if (strcmp(name, "itervalues") == 0) pp = &py_values; if (pp) { if (!*pp) { *pp = PyUnicode_FromString(name + 4); if (!*pp) return NULL; } method_name = *pp; } } #endif } *p_orig_length = 0; if (method_name) { PyObject* iter; iterable = __Pyx_PyObject_CallMethod0(iterable, method_name); if (!iterable) return NULL; #if !CYTHON_COMPILING_IN_PYPY if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable)) return iterable; #endif iter = PyObject_GetIter(iterable); Py_DECREF(iterable); return iter; } return PyObject_GetIter(iterable); } static CYTHON_INLINE int __Pyx_dict_iter_next( PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { PyObject* next_item; #if !CYTHON_COMPILING_IN_PYPY if (source_is_dict) { PyObject *key, *value; if (unlikely(orig_length != PyDict_Size(iter_obj))) { PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); return -1; } if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { return 0; } if (pitem) { PyObject* tuple = PyTuple_New(2); if (unlikely(!tuple)) { return -1; } Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(tuple, 0, key); PyTuple_SET_ITEM(tuple, 1, value); *pitem = tuple; } else { if (pkey) { Py_INCREF(key); *pkey = key; } if (pvalue) { Py_INCREF(value); *pvalue = value; } } return 1; } else if (PyTuple_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; *ppos = pos + 1; next_item = PyTuple_GET_ITEM(iter_obj, pos); Py_INCREF(next_item); } else if (PyList_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; *ppos = pos + 1; next_item = PyList_GET_ITEM(iter_obj, pos); Py_INCREF(next_item); } else #endif { next_item = PyIter_Next(iter_obj); if (unlikely(!next_item)) { return __Pyx_IterFinish(); } } if (pitem) { *pitem = next_item; } else if (pkey && pvalue) { if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1)) return -1; } else if (pkey) { *pkey = next_item; } else { *pvalue = next_item; } return 1; } /* decode_c_string */ static CYTHON_INLINE PyObject* __Pyx_decode_c_string( const char* cstring, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { Py_ssize_t length; if (unlikely((start < 0) | (stop < 0))) { size_t slen = strlen(cstring); if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "c-string too long to convert to Python"); return NULL; } length = (Py_ssize_t) slen; if (start < 0) { start += length; if (start < 0) start = 0; } if (stop < 0) stop += length; } if (unlikely(stop <= start)) return __Pyx_NewRef(__pyx_empty_unicode); length = stop - start; cstring += start; if (decode_func) { return decode_func(cstring, length, errors); } else { return PyUnicode_Decode(cstring, length, encoding, errors); } } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* GetException */ #if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) #endif { PyObject *local_type = NULL, *local_value, *local_tb = NULL; #if CYTHON_FAST_THREAD_STATE PyObject *tmp_type, *tmp_value, *tmp_tb; #if PY_VERSION_HEX >= 0x030C00A6 local_value = tstate->current_exception; tstate->current_exception = 0; if (likely(local_value)) { local_type = (PyObject*) Py_TYPE(local_value); Py_INCREF(local_type); local_tb = PyException_GetTraceback(local_value); } #else local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 if (unlikely(tstate->current_exception)) #elif CYTHON_FAST_THREAD_STATE if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE #if CYTHON_USE_EXC_INFO_STACK { _PyErr_StackItem *exc_info = tstate->exc_info; #if PY_VERSION_HEX >= 0x030B00a4 tmp_value = exc_info->exc_value; exc_info->exc_value = local_value; tmp_type = NULL; tmp_tb = NULL; Py_XDECREF(local_type); Py_XDECREF(local_tb); #else tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = local_type; exc_info->exc_value = local_value; exc_info->exc_traceback = local_tb; #endif } #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } /* SwapException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; tmp_value = exc_info->exc_value; exc_info->exc_value = *value; if (tmp_value == NULL || tmp_value == Py_None) { Py_XDECREF(tmp_value); tmp_value = NULL; tmp_type = NULL; tmp_tb = NULL; } else { tmp_type = (PyObject*) Py_TYPE(tmp_value); Py_INCREF(tmp_type); #if CYTHON_COMPILING_IN_CPYTHON tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback; Py_XINCREF(tmp_tb); #else tmp_tb = PyException_GetTraceback(tmp_value); #endif } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = *type; exc_info->exc_value = *value; exc_info->exc_traceback = *tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = *type; tstate->exc_value = *value; tstate->exc_traceback = *tb; #endif *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); PyErr_SetExcInfo(*type, *value, *tb); *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #endif /* GetTopmostException */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) { _PyErr_StackItem *exc_info = tstate->exc_info; while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && exc_info->previous_item != NULL) { exc_info = exc_info->previous_item; } return exc_info; } #endif /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); PyObject *exc_value = exc_info->exc_value; if (exc_value == NULL || exc_value == Py_None) { *value = NULL; *type = NULL; *tb = NULL; } else { *value = exc_value; Py_INCREF(*value); *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); *tb = PyException_GetTraceback(exc_value); } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); *type = exc_info->exc_type; *value = exc_info->exc_value; *tb = exc_info->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #else *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #endif } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; PyObject *tmp_value = exc_info->exc_value; exc_info->exc_value = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = type; exc_info->exc_value = value; exc_info->exc_traceback = tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } #endif /* GetItemInt */ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (unlikely(!j)) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_subscript) { PyObject *r, *key = PyInt_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); return r; } if (likely(sm && sm->sq_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return sm->sq_item(o, i); } } #else if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* SetItemInt */ static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { int r; if (unlikely(!j)) return -1; r = PyObject_SetItem(o, j, v); Py_DECREF(j); return r; } static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o)); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) { PyObject* old = PyList_GET_ITEM(o, n); Py_INCREF(v); PyList_SET_ITEM(o, n, v); Py_DECREF(old); return 1; } } else { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_ass_subscript) { int r; PyObject *key = PyInt_FromSsize_t(i); if (unlikely(!key)) return -1; r = mm->mp_ass_subscript(o, key, v); Py_DECREF(key); return r; } if (likely(sm && sm->sq_ass_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return -1; PyErr_Clear(); } } return sm->sq_ass_item(o, i, v); } } #else if (is_list || !PyMapping_Check(o)) { return PySequence_SetItem(o, i, v); } #endif return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v); } /* PyObjectCall2Args */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args[3] = {NULL, arg1, arg2}; return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectCallMethod1 */ #if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2) static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); Py_DECREF(method); return result; } #endif static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { #if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2 PyObject *args[2] = {obj, arg}; (void) __Pyx_PyObject_GetMethod; (void) __Pyx_PyObject_CallOneArg; (void) __Pyx_PyObject_Call2Args; return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); #else PyObject *method = NULL, *result; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_Call2Args(method, obj, arg); Py_DECREF(method); return result; } if (unlikely(!method)) return NULL; return __Pyx__PyObject_CallMethod1(method, arg); #endif } /* StringJoin */ static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) { (void) __Pyx_PyObject_CallMethod1; #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION < 3 return _PyString_Join(sep, values); #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 return _PyBytes_Join(sep, values); #else return __Pyx_PyObject_CallMethod1(sep, __pyx_n_s_join, values); #endif } /* PyIntCompare */ static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_UNUSED_VAR(inplace); if (op1 == op2) { return 1; } #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); return (a == b); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { int unequal; unsigned long uintval; Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); const digit* digits = __Pyx_PyLong_Digits(op1); if (intval == 0) { return (__Pyx_PyLong_IsZero(op1) == 1); } else if (intval < 0) { if (__Pyx_PyLong_IsNonNeg(op1)) return 0; intval = -intval; } else { if (__Pyx_PyLong_IsNeg(op1)) return 0; } uintval = (unsigned long) intval; #if PyLong_SHIFT * 4 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 4)) { unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif #if PyLong_SHIFT * 3 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 3)) { unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif #if PyLong_SHIFT * 2 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 2)) { unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif #if PyLong_SHIFT * 1 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 1)) { unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); return (unequal == 0); } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif return ((double)a == (double)b); } return __Pyx_PyObject_IsTrueAndDecref( PyObject_RichCompare(op1, op2, Py_EQ)); } /* PyIntCompare */ static CYTHON_INLINE int __Pyx_PyInt_BoolNeObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_UNUSED_VAR(inplace); if (op1 == op2) { return 0; } #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); return (a != b); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { int unequal; unsigned long uintval; Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); const digit* digits = __Pyx_PyLong_Digits(op1); if (intval == 0) { return (__Pyx_PyLong_IsZero(op1) != 1); } else if (intval < 0) { if (__Pyx_PyLong_IsNonNeg(op1)) return 1; intval = -intval; } else { if (__Pyx_PyLong_IsNeg(op1)) return 1; } uintval = (unsigned long) intval; #if PyLong_SHIFT * 4 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 4)) { unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif #if PyLong_SHIFT * 3 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 3)) { unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif #if PyLong_SHIFT * 2 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 2)) { unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif #if PyLong_SHIFT * 1 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 1)) { unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); return (unequal != 0); } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif return ((double)a != (double)b); } return __Pyx_PyObject_IsTrueAndDecref( PyObject_RichCompare(op1, op2, Py_NE)); } /* PyObjectSetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_setattr)) return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); #endif return PyObject_SetAttr(obj, attr_name, value); } #endif /* ValidateBasesTuple */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; #if CYTHON_ASSUME_SAFE_MACROS n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); if (n < 0) return -1; #endif for (i = 1; i < n; i++) { #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; #elif CYTHON_ASSUME_SAFE_MACROS PyObject *b0 = PyTuple_GET_ITEM(bases, i); #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; #endif PyTypeObject *b; #if PY_MAJOR_VERSION < 3 if (PyClass_Check(b0)) { PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); __Pyx_DECREF_TypeName(b_name); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); if (!py_b_dictoffset) goto dictoffset_return; b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); Py_DECREF(py_b_dictoffset); if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; #endif if (b_dictoffset) { { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "extension type '%.200s' has no __dict__ slot, " "but base type '" __Pyx_FMT_TYPENAME "' has: " "either add 'cdef dict __dict__' to the extension type " "or add '__slots__ = [...]' to the base type", type_name, b_name); __Pyx_DECREF_TypeName(b_name); } #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif } return 0; } #endif /* PyType_Ready */ static int __Pyx_PyType_Ready(PyTypeObject *t) { #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS (void)__Pyx_validate_bases_tuple; #endif return PyType_Ready(t); #else int r; PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 gc_was_enabled = PyGC_Disable(); (void)__Pyx_PyObject_CallMethod0; #else PyObject *ret, *py_status; PyObject *gc = NULL; #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) gc = PyImport_GetModule(__pyx_kp_u_gc); #endif if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); if (unlikely(!gc)) return -1; py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; } gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; } Py_DECREF(ret); } else if (unlikely(gc_was_enabled == -1)) { Py_DECREF(gc); return -1; } #endif t->tp_flags |= Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A0000 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; #endif #else (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) PyGC_Enable(); #else if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); } else { Py_XDECREF(tp); Py_XDECREF(v); Py_XDECREF(tb); r = -1; } } Py_DECREF(gc); #endif } #endif return r; #endif } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, attr_name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(attr_name)); #endif __Pyx_DECREF_TypeName(type_name); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s__12; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__13); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* Py3UpdateBases */ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases) { Py_ssize_t i, j, size_bases; PyObject *base, *meth, *new_base, *result, *new_bases = NULL; size_bases = PyTuple_GET_SIZE(bases); for (i = 0; i < size_bases; i++) { base = PyTuple_GET_ITEM(bases, i); if (PyType_Check(base)) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { goto error; } } continue; } meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_n_s_mro_entries); if (!meth && PyErr_Occurred()) { goto error; } if (!meth) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { goto error; } } continue; } new_base = __Pyx_PyObject_CallOneArg(meth, bases); Py_DECREF(meth); if (!new_base) { goto error; } if (!PyTuple_Check(new_base)) { PyErr_SetString(PyExc_TypeError, "__mro_entries__ must return a tuple"); Py_DECREF(new_base); goto error; } if (!new_bases) { if (!(new_bases = PyList_New(i))) { goto error; } for (j = 0; j < i; j++) { base = PyTuple_GET_ITEM(bases, j); PyList_SET_ITEM(new_bases, j, base); Py_INCREF(base); } } j = PyList_GET_SIZE(new_bases); if (PyList_SetSlice(new_bases, j, j, new_base) < 0) { goto error; } Py_DECREF(new_base); } if (!new_bases) { Py_INCREF(bases); return bases; } result = PyList_AsTuple(new_bases); Py_DECREF(new_bases); return result; error: Py_XDECREF(new_bases); return NULL; } /* CalculateMetaclass */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases; #if CYTHON_ASSUME_SAFE_MACROS nbases = PyTuple_GET_SIZE(bases); #else nbases = PyTuple_Size(bases); if (nbases < 0) return NULL; #endif for (i=0; i < nbases; i++) { PyTypeObject *tmptype; #if CYTHON_ASSUME_SAFE_MACROS PyObject *tmp = PyTuple_GET_ITEM(bases, i); #else PyObject *tmp = PyTuple_GetItem(bases, i); if (!tmp) return NULL; #endif tmptype = Py_TYPE(tmp); #if PY_MAJOR_VERSION < 3 if (tmptype == &PyClass_Type) continue; #endif if (!metaclass) { metaclass = tmptype; continue; } if (PyType_IsSubtype(metaclass, tmptype)) continue; if (PyType_IsSubtype(tmptype, metaclass)) { metaclass = tmptype; continue; } PyErr_SetString(PyExc_TypeError, "metaclass conflict: " "the metaclass of a derived class " "must be a (non-strict) subclass " "of the metaclasses of all its bases"); return NULL; } if (!metaclass) { #if PY_MAJOR_VERSION < 3 metaclass = &PyClass_Type; #else metaclass = &PyType_Type; #endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; } /* PyObjectLookupSpecial */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) { PyObject *res; PyTypeObject *tp = Py_TYPE(obj); #if PY_MAJOR_VERSION < 3 if (unlikely(PyInstance_Check(obj))) return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name); #endif res = _PyType_Lookup(tp, attr_name); if (likely(res)) { descrgetfunc f = Py_TYPE(res)->tp_descr_get; if (!f) { Py_INCREF(res); } else { res = f(res, obj, (PyObject *)tp); } } else if (with_error) { PyErr_SetObject(PyExc_AttributeError, attr_name); } return res; } #endif /* Py3ClassCreate */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; if (metaclass) { PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare); if (prep) { PyObject *pargs[3] = {NULL, name, bases}; ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); Py_DECREF(prep); } else { if (unlikely(PyErr_Occurred())) return NULL; ns = PyDict_New(); } } else { ns = PyDict_New(); } if (unlikely(!ns)) return NULL; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; #if PY_VERSION_HEX >= 0x03030000 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; #else CYTHON_MAYBE_UNUSED_VAR(qualname); #endif if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; return ns; bad: Py_DECREF(ns); return NULL; } #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS static int __Pyx_SetNamesPEP487(PyObject *type_obj) { PyTypeObject *type = (PyTypeObject*) type_obj; PyObject *names_to_set, *key, *value, *set_name, *tmp; Py_ssize_t i = 0; #if CYTHON_USE_TYPE_SLOTS names_to_set = PyDict_Copy(type->tp_dict); #else { PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict); names_to_set = NULL; if (likely(d)) { PyObject *names_to_set = PyDict_New(); int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1; Py_DECREF(d); if (unlikely(ret < 0)) Py_CLEAR(names_to_set); } } #endif if (unlikely(names_to_set == NULL)) goto bad; while (PyDict_Next(names_to_set, &i, &key, &value)) { set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name); if (unlikely(set_name != NULL)) { tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key); Py_DECREF(set_name); if (unlikely(tmp == NULL)) { __Pyx_TypeName value_type_name = __Pyx_PyType_GetName(Py_TYPE(value)); __Pyx_TypeName type_name = __Pyx_PyType_GetName(type); PyErr_Format(PyExc_RuntimeError, #if PY_MAJOR_VERSION >= 3 "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'", value_type_name, key, type_name); #else "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'", value_type_name, PyString_Check(key) ? PyString_AS_STRING(key) : "?", type_name); #endif goto bad; } else { Py_DECREF(tmp); } } else if (unlikely(PyErr_Occurred())) { goto bad; } } Py_DECREF(names_to_set); return 0; bad: Py_XDECREF(names_to_set); return -1; } static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) { #if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS PyTypeObject *type = (PyTypeObject*) type_obj; PyObject *mro = type->tp_mro; Py_ssize_t i, nbases; if (unlikely(!mro)) goto done; (void) &__Pyx_GetBuiltinName; Py_INCREF(mro); nbases = PyTuple_GET_SIZE(mro); assert(PyTuple_GET_ITEM(mro, 0) == type_obj); for (i = 1; i < nbases-1; i++) { PyObject *base, *dict, *meth; base = PyTuple_GET_ITEM(mro, i); dict = ((PyTypeObject *)base)->tp_dict; meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass); if (unlikely(meth)) { descrgetfunc f = Py_TYPE(meth)->tp_descr_get; PyObject *res; Py_INCREF(meth); if (likely(f)) { res = f(meth, NULL, type_obj); Py_DECREF(meth); if (unlikely(!res)) goto bad; meth = res; } res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw); Py_DECREF(meth); if (unlikely(!res)) goto bad; Py_DECREF(res); goto done; } else if (unlikely(PyErr_Occurred())) { goto bad; } } done: Py_XDECREF(mro); return type_obj; bad: Py_XDECREF(mro); Py_DECREF(type_obj); return NULL; #else PyObject *super_type, *super, *func, *res; #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) super_type = __Pyx_GetBuiltinName(__pyx_n_s_super); #else super_type = (PyObject*) &PySuper_Type; (void) &__Pyx_GetBuiltinName; #endif super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL; #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) Py_XDECREF(super_type); #endif if (unlikely(!super)) { Py_CLEAR(type_obj); goto done; } func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass); Py_DECREF(super); if (likely(!func)) { if (unlikely(PyErr_Occurred())) Py_CLEAR(type_obj); goto done; } res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw); Py_DECREF(func); if (unlikely(!res)) Py_CLEAR(type_obj); Py_XDECREF(res); done: return type_obj; #endif } #endif static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass) { PyObject *result; PyObject *owned_metaclass = NULL; PyObject *margs[4] = {NULL, name, bases, dict}; if (allow_py2_metaclass) { owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { PyErr_Clear(); } else { return NULL; } } if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); Py_XDECREF(owned_metaclass); if (unlikely(!metaclass)) return NULL; owned_metaclass = metaclass; } result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, #if PY_VERSION_HEX < 0x030600A4 (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw #else mkw #endif ); Py_XDECREF(owned_metaclass); #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS if (likely(result) && likely(PyType_Check(result))) { if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) { Py_CLEAR(result); } else { result = __Pyx_InitSubclassPEP487(result, mkw); } } #else (void) &__Pyx_GetBuiltinName; #endif return result; } /* CyFunctionClassCell */ static int __Pyx_CyFunction_InitClassCell(PyObject *cyfunctions, PyObject *classobj) { Py_ssize_t i, count = PyList_GET_SIZE(cyfunctions); for (i = 0; i < count; i++) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS PyList_GET_ITEM(cyfunctions, i); #else PySequence_ITEM(cyfunctions, i); if (unlikely(!m)) return -1; #endif __Pyx_CyFunction_SetClassObj(m, classobj); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF((PyObject*)m); #endif } return 0; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (int) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (int) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = __Pyx_NewRef(v); } val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntFromPy */ static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const size_t neg_one = (size_t) -1, const_zero = (size_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(size_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (size_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(size_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(size_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) >= 2 * PyLong_SHIFT)) { return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } } break; case 3: if ((8 * sizeof(size_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) >= 3 * PyLong_SHIFT)) { return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } } break; case 4: if ((8 * sizeof(size_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) >= 4 * PyLong_SHIFT)) { return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (size_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(size_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(size_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) { return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); } } break; case 2: if ((8 * sizeof(size_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) { return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); } } break; case -3: if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) { return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); } } break; case 3: if ((8 * sizeof(size_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) { return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); } } break; case -4: if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT)) { return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); } } break; case 4: if ((8 * sizeof(size_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT)) { return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); } } break; } } #endif if ((sizeof(size_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(size_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { size_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (size_t) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (size_t) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (size_t) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (size_t) -1; } else { stepval = __Pyx_NewRef(v); } val = (size_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(size_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((size_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(size_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((size_t) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((size_t) 1) << (sizeof(size_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (size_t) -1; } } else { size_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (size_t) -1; val = __Pyx_PyInt_As_size_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to size_t"); return (size_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to size_t"); return (size_t) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(unsigned int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(unsigned int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(unsigned int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(unsigned int), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(unsigned int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name_2); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__39); } return name; } #endif /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (long) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (long) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = __Pyx_NewRef(v); } val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/platform/linux.pyx0000644000076500000240000003311514641074756017476 0ustar00twstaffimport os import re import stat import subprocess from .posix import posix_acl_use_stored_uid_gid from .posix import user2uid, group2gid from ..helpers import workarounds from ..helpers import safe_decode, safe_encode from .base import SyncFile as BaseSyncFile from .base import safe_fadvise from .xattr import _listxattr_inner, _getxattr_inner, _setxattr_inner, split_string0 try: from .syncfilerange import sync_file_range, SYNC_FILE_RANGE_WRITE, SYNC_FILE_RANGE_WAIT_BEFORE, SYNC_FILE_RANGE_WAIT_AFTER SYNC_FILE_RANGE_LOADED = True except ImportError: SYNC_FILE_RANGE_LOADED = False from libc cimport errno from libc.stdint cimport int64_t API_VERSION = '1.4_01' cdef extern from "sys/xattr.h": ssize_t c_listxattr "listxattr" (const char *path, char *list, size_t size) ssize_t c_llistxattr "llistxattr" (const char *path, char *list, size_t size) ssize_t c_flistxattr "flistxattr" (int filedes, char *list, size_t size) ssize_t c_getxattr "getxattr" (const char *path, const char *name, void *value, size_t size) ssize_t c_lgetxattr "lgetxattr" (const char *path, const char *name, void *value, size_t size) ssize_t c_fgetxattr "fgetxattr" (int filedes, const char *name, void *value, size_t size) int c_setxattr "setxattr" (const char *path, const char *name, const void *value, size_t size, int flags) int c_lsetxattr "lsetxattr" (const char *path, const char *name, const void *value, size_t size, int flags) int c_fsetxattr "fsetxattr" (int filedes, const char *name, const void *value, size_t size, int flags) cdef extern from "sys/types.h": int ACL_TYPE_ACCESS int ACL_TYPE_DEFAULT cdef extern from "sys/acl.h": ctypedef struct _acl_t: pass ctypedef _acl_t *acl_t int acl_free(void *obj) acl_t acl_get_file(const char *path, int type) acl_t acl_get_fd(int fd) int acl_set_file(const char *path, int type, acl_t acl) int acl_set_fd(int fd, acl_t acl) acl_t acl_from_text(const char *buf) char *acl_to_text(acl_t acl, ssize_t *len) cdef extern from "acl/libacl.h": int acl_extended_file_nofollow(const char *path) int acl_extended_fd(int fd) cdef extern from "linux/fs.h": # ioctls int FS_IOC_SETFLAGS int FS_IOC_GETFLAGS # inode flags int FS_NODUMP_FL int FS_IMMUTABLE_FL int FS_APPEND_FL int FS_COMPR_FL cdef extern from "sys/ioctl.h": int ioctl(int fildes, int request, ...) cdef extern from "unistd.h": int _SC_PAGESIZE long sysconf(int name) cdef extern from "string.h": char *strerror(int errnum) _comment_re = re.compile(' *#.*', re.M) def listxattr(path, *, follow_symlinks=False): def func(path, buf, size): if isinstance(path, int): return c_flistxattr(path, buf, size) else: if follow_symlinks: return c_listxattr(path, buf, size) else: return c_llistxattr(path, buf, size) n, buf = _listxattr_inner(func, path) return [name for name in split_string0(buf[:n]) if name and not name.startswith(b'system.posix_acl_')] def getxattr(path, name, *, follow_symlinks=False): def func(path, name, buf, size): if isinstance(path, int): return c_fgetxattr(path, name, buf, size) else: if follow_symlinks: return c_getxattr(path, name, buf, size) else: return c_lgetxattr(path, name, buf, size) n, buf = _getxattr_inner(func, path, name) return bytes(buf[:n]) def setxattr(path, name, value, *, follow_symlinks=False): def func(path, name, value, size): flags = 0 if isinstance(path, int): return c_fsetxattr(path, name, value, size, flags) else: if follow_symlinks: return c_setxattr(path, name, value, size, flags) else: return c_lsetxattr(path, name, value, size, flags) _setxattr_inner(func, path, name, value) BSD_TO_LINUX_FLAGS = { stat.UF_NODUMP: FS_NODUMP_FL, stat.UF_IMMUTABLE: FS_IMMUTABLE_FL, stat.UF_APPEND: FS_APPEND_FL, stat.UF_COMPRESSED: FS_COMPR_FL, } def set_flags(path, bsd_flags, fd=None): if fd is None: st = os.stat(path, follow_symlinks=False) if stat.S_ISBLK(st.st_mode) or stat.S_ISCHR(st.st_mode) or stat.S_ISLNK(st.st_mode): # see comment in get_flags() return cdef int flags = 0 for bsd_flag, linux_flag in BSD_TO_LINUX_FLAGS.items(): if bsd_flags & bsd_flag: flags |= linux_flag open_fd = fd is None if open_fd: fd = os.open(path, os.O_RDONLY|os.O_NONBLOCK|os.O_NOFOLLOW) try: if ioctl(fd, FS_IOC_SETFLAGS, &flags) == -1: error_number = errno.errno if error_number != errno.EOPNOTSUPP: raise OSError(error_number, strerror(error_number).decode(), path) finally: if open_fd: os.close(fd) def get_flags(path, st, fd=None): if stat.S_ISBLK(st.st_mode) or stat.S_ISCHR(st.st_mode) or stat.S_ISLNK(st.st_mode): # avoid opening devices files - trying to open non-present devices can be rather slow. # avoid opening symlinks, O_NOFOLLOW would make the open() fail anyway. return 0 cdef int linux_flags open_fd = fd is None if open_fd: try: fd = os.open(path, os.O_RDONLY|os.O_NONBLOCK|os.O_NOFOLLOW) except OSError: return 0 try: if ioctl(fd, FS_IOC_GETFLAGS, &linux_flags) == -1: return 0 finally: if open_fd: os.close(fd) bsd_flags = 0 for bsd_flag, linux_flag in BSD_TO_LINUX_FLAGS.items(): if linux_flags & linux_flag: bsd_flags |= bsd_flag return bsd_flags def acl_use_local_uid_gid(acl): """Replace the user/group field with the local uid/gid if possible """ entries = [] for entry in safe_decode(acl).split('\n'): if entry: fields = entry.split(':') if fields[0] == 'user' and fields[1]: fields[1] = str(user2uid(fields[1], fields[3])) elif fields[0] == 'group' and fields[1]: fields[1] = str(group2gid(fields[1], fields[3])) entries.append(':'.join(fields[:3])) return safe_encode('\n'.join(entries)) cdef acl_append_numeric_ids(acl): """Extend the "POSIX 1003.1e draft standard 17" format with an additional uid/gid field """ entries = [] for entry in _comment_re.sub('', safe_decode(acl)).split('\n'): if entry: type, name, permission = entry.split(':') if name and type == 'user': entries.append(':'.join([type, name, permission, str(user2uid(name, name))])) elif name and type == 'group': entries.append(':'.join([type, name, permission, str(group2gid(name, name))])) else: entries.append(entry) return safe_encode('\n'.join(entries)) cdef acl_numeric_ids(acl): """Replace the "POSIX 1003.1e draft standard 17" user/group field with uid/gid """ entries = [] for entry in _comment_re.sub('', safe_decode(acl)).split('\n'): if entry: type, name, permission = entry.split(':') if name and type == 'user': uid = str(user2uid(name, name)) entries.append(':'.join([type, uid, permission, uid])) elif name and type == 'group': gid = str(group2gid(name, name)) entries.append(':'.join([type, gid, permission, gid])) else: entries.append(entry) return safe_encode('\n'.join(entries)) def acl_get(path, item, st, numeric_ids=False, fd=None): cdef acl_t default_acl = NULL cdef acl_t access_acl = NULL cdef char *default_text = NULL cdef char *access_text = NULL cdef int ret = 0 if isinstance(path, str): path = os.fsencode(path) if fd is not None: ret = acl_extended_fd(fd) else: ret = acl_extended_file_nofollow(path) if ret < 0: raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) if ret == 0: # there is no ACL defining permissions other than those defined by the traditional file permission bits. # note: this should also be the case for symlink fs objects, as they can not have ACLs. return if numeric_ids: converter = acl_numeric_ids else: converter = acl_append_numeric_ids try: if fd is not None: access_acl = acl_get_fd(fd) else: access_acl = acl_get_file(path, ACL_TYPE_ACCESS) if access_acl == NULL: raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) access_text = acl_to_text(access_acl, NULL) if access_text == NULL: raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) item['acl_access'] = converter(access_text) finally: acl_free(access_text) acl_free(access_acl) if stat.S_ISDIR(st.st_mode): # only directories can have a default ACL. there is no fd-based api to get it. try: default_acl = acl_get_file(path, ACL_TYPE_DEFAULT) if default_acl == NULL: raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) default_text = acl_to_text(default_acl, NULL) if default_text == NULL: raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) item['acl_default'] = converter(default_text) finally: acl_free(default_text) acl_free(default_acl) def acl_set(path, item, numeric_ids=False, fd=None): cdef acl_t access_acl = NULL cdef acl_t default_acl = NULL if stat.S_ISLNK(item.get('mode', 0)): # Linux does not support setting ACLs on symlinks return if isinstance(path, str): path = os.fsencode(path) if numeric_ids: converter = posix_acl_use_stored_uid_gid else: converter = acl_use_local_uid_gid access_text = item.get('acl_access') if access_text: try: access_acl = acl_from_text(converter(access_text)) if access_acl == NULL: raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) if fd is not None: if acl_set_fd(fd, access_acl) == -1: raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) else: if acl_set_file(path, ACL_TYPE_ACCESS, access_acl) == -1: raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) finally: acl_free(access_acl) default_text = item.get('acl_default') if default_text: try: default_acl = acl_from_text(converter(default_text)) if default_acl == NULL: raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) # only directories can get a default ACL. there is no fd-based api to set it. if acl_set_file(path, ACL_TYPE_DEFAULT, default_acl) == -1: raise OSError(errno.errno, os.strerror(errno.errno), os.fsdecode(path)) finally: acl_free(default_acl) cdef _sync_file_range(fd, offset, length, flags): assert offset & PAGE_MASK == 0, "offset %d not page-aligned" % offset assert length & PAGE_MASK == 0, "length %d not page-aligned" % length if sync_file_range(fd, offset, length, flags) != 0: raise OSError(errno.errno, os.strerror(errno.errno)) safe_fadvise(fd, offset, length, 'DONTNEED') cdef unsigned PAGE_MASK = sysconf(_SC_PAGESIZE) - 1 if 'basesyncfile' in workarounds or not SYNC_FILE_RANGE_LOADED: class SyncFile(BaseSyncFile): # if we are on platforms with a broken or not implemented sync_file_range, # use the more generic BaseSyncFile to avoid issues. # see basesyncfile description in our docs for details. pass else: # a real Linux, so we can do better. :) class SyncFile(BaseSyncFile): """ Implemented using sync_file_range for asynchronous write-out and fdatasync for actual durability. "write-out" means that dirty pages (= data that was written) are submitted to an I/O queue and will be send to disk in the immediate future. """ def __init__(self, path, *, fd=None, binary=False): super().__init__(path, fd=fd, binary=binary) self.offset = 0 self.write_window = (16 * 1024 ** 2) & ~PAGE_MASK self.last_sync = 0 self.pending_sync = None def write(self, data): self.offset += self.f.write(data) offset = self.offset & ~PAGE_MASK if offset >= self.last_sync + self.write_window: self.f.flush() _sync_file_range(self.fd, self.last_sync, offset - self.last_sync, SYNC_FILE_RANGE_WRITE) if self.pending_sync is not None: _sync_file_range(self.fd, self.pending_sync, self.last_sync - self.pending_sync, SYNC_FILE_RANGE_WRITE | SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WAIT_AFTER) self.pending_sync = self.last_sync self.last_sync = offset def sync(self): self.f.flush() os.fdatasync(self.fd) # tell the OS that it does not need to cache what we just wrote, # avoids spoiling the cache for the OS and other processes. safe_fadvise(self.fd, 0, 0, 'DONTNEED') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719958149.0 borgbackup-1.4.0/src/borg/platform/posix.c0000644000076500000240000151421214641075205017074 0ustar00twstaff/* Generated by Cython 3.0.10 */ /* BEGIN: Cython Metadata { "distutils": { "depends": [], "extra_compile_args": [ "-Wall", "-Wextra", "-Wpointer-arith" ], "name": "borg.platform.posix", "sources": [ "src/borg/platform/posix.pyx" ] }, "module_name": "borg.platform.posix" } END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_10" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x03000AF0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 1 #endif #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #if PY_VERSION_HEX >= 0x030d00A4 # define __Pyx_PyCFunctionFast PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords #else # define __Pyx_PyCFunctionFast _PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__borg__platform__posix #define __PYX_HAVE_API__borg__platform__posix /* Early includes */ #include #include #include "wchar.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/borg/platform/posix.pyx", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* AssertionsEnabled.proto */ #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define __Pyx_init_assertions_enabled() (0) #define __pyx_assertions_enabled() (1) #elif CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030C0000) static int __pyx_assertions_enabled_flag; #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag) static int __Pyx_init_assertions_enabled(void) { PyObject *builtins, *debug, *debug_str; int flag; builtins = PyEval_GetBuiltins(); if (!builtins) goto bad; debug_str = PyUnicode_FromStringAndSize("__debug__", 9); if (!debug_str) goto bad; debug = PyObject_GetItem(builtins, debug_str); Py_DECREF(debug_str); if (!debug) goto bad; flag = PyObject_IsTrue(debug); Py_DECREF(debug); if (flag == -1) goto bad; __pyx_assertions_enabled_flag = flag; return 0; bad: __pyx_assertions_enabled_flag = 1; return -1; } #else #define __Pyx_init_assertions_enabled() (0) #define __pyx_assertions_enabled() (!Py_OptimizeFlag) #endif /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* PyIntCompare.proto */ static CYTHON_INLINE int __Pyx_PyInt_BoolNeObjC(PyObject *op1, PyObject *op2, long intval, long inplace); /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* GetTopmostException.proto */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); #endif /* SaveResetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* SwapException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif /* ListAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 L->ob_item[len] = x; #else PyList_SET_ITEM(list, len, x); #endif __Pyx_SET_SIZE(list, len + 1); return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif /* PyObjectCall2Args.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod1.proto */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); /* StringJoin.proto */ #if PY_MAJOR_VERSION < 3 #define __Pyx_PyString_Join __Pyx_PyBytes_Join #define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v)) #else #define __Pyx_PyString_Join PyUnicode_Join #define __Pyx_PyBaseString_Join PyUnicode_Join #endif static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc.errno" */ /* Module declarations from "cpython.mem" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "borg.platform.posix" */ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "borg.platform.posix" extern int __pyx_module_is_main_borg__platform__posix; int __pyx_module_is_main_borg__platform__posix = 0; /* Implementation of "borg.platform.posix" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_AssertionError; static PyObject *__pyx_builtin_OSError; static PyObject *__pyx_builtin_KeyError; /* #### Code section: string_decls ### */ static const char __pyx_k_[] = ""; static const char __pyx_k_s[] = "s"; static const char __pyx_k__2[] = "."; static const char __pyx_k__3[] = "\n"; static const char __pyx_k__4[] = ":"; static const char __pyx_k__5[] = "*"; static const char __pyx_k_os[] = "os"; static const char __pyx_k__26[] = "?"; static const char __pyx_k_acl[] = "acl"; static const char __pyx_k_err[] = "err"; static const char __pyx_k_gid[] = "gid"; static const char __pyx_k_grp[] = "grp"; static const char __pyx_k_pid[] = "pid"; static const char __pyx_k_pwd[] = "pwd"; static const char __pyx_k_uid[] = "uid"; static const char __pyx_k_host[] = "host"; static const char __pyx_k_join[] = "join"; static const char __pyx_k_kill[] = "kill"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_size[] = "size"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_user[] = "user"; static const char __pyx_k_ESRCH[] = "ESRCH"; static const char __pyx_k_entry[] = "entry"; static const char __pyx_k_errno[] = "errno"; static const char __pyx_k_group[] = "group"; static const char __pyx_k_split[] = "split"; static const char __pyx_k_fields[] = "fields"; static const char __pyx_k_getuid[] = "getuid"; static const char __pyx_k_gr_gid[] = "gr_gid"; static const char __pyx_k_hostid[] = "hostid"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_pw_uid[] = "pw_uid"; static const char __pyx_k_swidth[] = "swidth"; static const char __pyx_k_thread[] = "thread"; static const char __pyx_k_OSError[] = "OSError"; static const char __pyx_k_default[] = "default"; static const char __pyx_k_entries[] = "entries"; static const char __pyx_k_gr_name[] = "gr_name"; static const char __pyx_k_helpers[] = "helpers"; static const char __pyx_k_maxsize[] = "maxsize"; static const char __pyx_k_pw_name[] = "pw_name"; static const char __pyx_k_KeyError[] = "KeyError"; static const char __pyx_k_as_wchar[] = "as_wchar"; static const char __pyx_k_getgrgid[] = "getgrgid"; static const char __pyx_k_getgrnam[] = "getgrnam"; static const char __pyx_k_getpwnam[] = "getpwnam"; static const char __pyx_k_getpwuid[] = "getpwuid"; static const char __pyx_k_uid2user[] = "uid2user"; static const char __pyx_k_user2uid[] = "user2uid"; static const char __pyx_k_functools[] = "functools"; static const char __pyx_k_get_errno[] = "get_errno"; static const char __pyx_k_gid2group[] = "gid2group"; static const char __pyx_k_group2gid[] = "group2gid"; static const char __pyx_k_lru_cache[] = "lru_cache"; static const char __pyx_k_safe_decode[] = "safe_decode"; static const char __pyx_k_safe_encode[] = "safe_encode"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_getosusername[] = "getosusername"; static const char __pyx_k_process_alive[] = "process_alive"; static const char __pyx_k_AssertionError[] = "AssertionError"; static const char __pyx_k_terminal_width[] = "terminal_width"; static const char __pyx_k_local_pid_alive[] = "local_pid_alive"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_borg_platform_posix[] = "borg.platform.posix"; static const char __pyx_k_src_borg_platform_posix_pyx[] = "src/borg/platform/posix.pyx"; static const char __pyx_k_posix_acl_use_stored_uid_gid[] = "posix_acl_use_stored_uid_gid"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_4borg_8platform_5posix_get_errno(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_4borg_8platform_5posix_2swidth(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s); /* proto */ static PyObject *__pyx_pf_4borg_8platform_5posix_4process_alive(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_host, PyObject *__pyx_v_pid, PyObject *__pyx_v_thread); /* proto */ static PyObject *__pyx_pf_4borg_8platform_5posix_6local_pid_alive(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_pid); /* proto */ static PyObject *__pyx_pf_4borg_8platform_5posix_8uid2user(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_uid, PyObject *__pyx_v_default); /* proto */ static PyObject *__pyx_pf_4borg_8platform_5posix_10user2uid(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_user, PyObject *__pyx_v_default); /* proto */ static PyObject *__pyx_pf_4borg_8platform_5posix_12gid2group(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_gid, PyObject *__pyx_v_default); /* proto */ static PyObject *__pyx_pf_4borg_8platform_5posix_14group2gid(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_group, PyObject *__pyx_v_default); /* proto */ static PyObject *__pyx_pf_4borg_8platform_5posix_16posix_acl_use_stored_uid_gid(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_acl); /* proto */ static PyObject *__pyx_pf_4borg_8platform_5posix_18getosusername(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyObject *__pyx_n_s_; PyObject *__pyx_n_s_AssertionError; PyObject *__pyx_n_s_ESRCH; PyObject *__pyx_n_s_KeyError; PyObject *__pyx_n_s_OSError; PyObject *__pyx_kp_u__2; PyObject *__pyx_n_s__26; PyObject *__pyx_kp_s__3; PyObject *__pyx_kp_s__4; PyObject *__pyx_n_s__5; PyObject *__pyx_n_s_acl; PyObject *__pyx_n_s_as_wchar; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_borg_platform_posix; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_default; PyObject *__pyx_n_s_entries; PyObject *__pyx_n_s_entry; PyObject *__pyx_n_s_err; PyObject *__pyx_n_s_errno; PyObject *__pyx_n_s_fields; PyObject *__pyx_n_s_functools; PyObject *__pyx_n_s_get_errno; PyObject *__pyx_n_s_getgrgid; PyObject *__pyx_n_s_getgrnam; PyObject *__pyx_n_s_getosusername; PyObject *__pyx_n_s_getpwnam; PyObject *__pyx_n_s_getpwuid; PyObject *__pyx_n_s_getuid; PyObject *__pyx_n_s_gid; PyObject *__pyx_n_s_gid2group; PyObject *__pyx_n_s_gr_gid; PyObject *__pyx_n_s_gr_name; PyObject *__pyx_n_s_group; PyObject *__pyx_n_s_group2gid; PyObject *__pyx_n_s_grp; PyObject *__pyx_n_s_helpers; PyObject *__pyx_n_s_host; PyObject *__pyx_n_s_hostid; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_n_s_join; PyObject *__pyx_n_s_kill; PyObject *__pyx_n_s_local_pid_alive; PyObject *__pyx_n_s_lru_cache; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_maxsize; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_os; PyObject *__pyx_n_s_pid; PyObject *__pyx_n_s_posix_acl_use_stored_uid_gid; PyObject *__pyx_n_s_process_alive; PyObject *__pyx_n_s_pw_name; PyObject *__pyx_n_s_pw_uid; PyObject *__pyx_n_s_pwd; PyObject *__pyx_n_s_s; PyObject *__pyx_n_s_safe_decode; PyObject *__pyx_n_s_safe_encode; PyObject *__pyx_n_s_size; PyObject *__pyx_n_s_spec; PyObject *__pyx_n_s_split; PyObject *__pyx_kp_s_src_borg_platform_posix_pyx; PyObject *__pyx_n_s_swidth; PyObject *__pyx_n_s_terminal_width; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_thread; PyObject *__pyx_n_s_uid; PyObject *__pyx_n_s_uid2user; PyObject *__pyx_n_s_user; PyObject *__pyx_n_s_user2uid; PyObject *__pyx_int_0; PyObject *__pyx_tuple__7; PyObject *__pyx_tuple__9; PyObject *__pyx_tuple__11; PyObject *__pyx_tuple__13; PyObject *__pyx_tuple__15; PyObject *__pyx_tuple__16; PyObject *__pyx_tuple__18; PyObject *__pyx_tuple__20; PyObject *__pyx_tuple__22; PyObject *__pyx_tuple__24; PyObject *__pyx_codeobj__6; PyObject *__pyx_codeobj__8; PyObject *__pyx_codeobj__10; PyObject *__pyx_codeobj__12; PyObject *__pyx_codeobj__14; PyObject *__pyx_codeobj__17; PyObject *__pyx_codeobj__19; PyObject *__pyx_codeobj__21; PyObject *__pyx_codeobj__23; PyObject *__pyx_codeobj__25; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_n_s_); Py_CLEAR(clear_module_state->__pyx_n_s_AssertionError); Py_CLEAR(clear_module_state->__pyx_n_s_ESRCH); Py_CLEAR(clear_module_state->__pyx_n_s_KeyError); Py_CLEAR(clear_module_state->__pyx_n_s_OSError); Py_CLEAR(clear_module_state->__pyx_kp_u__2); Py_CLEAR(clear_module_state->__pyx_n_s__26); Py_CLEAR(clear_module_state->__pyx_kp_s__3); Py_CLEAR(clear_module_state->__pyx_kp_s__4); Py_CLEAR(clear_module_state->__pyx_n_s__5); Py_CLEAR(clear_module_state->__pyx_n_s_acl); Py_CLEAR(clear_module_state->__pyx_n_s_as_wchar); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_borg_platform_posix); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_default); Py_CLEAR(clear_module_state->__pyx_n_s_entries); Py_CLEAR(clear_module_state->__pyx_n_s_entry); Py_CLEAR(clear_module_state->__pyx_n_s_err); Py_CLEAR(clear_module_state->__pyx_n_s_errno); Py_CLEAR(clear_module_state->__pyx_n_s_fields); Py_CLEAR(clear_module_state->__pyx_n_s_functools); Py_CLEAR(clear_module_state->__pyx_n_s_get_errno); Py_CLEAR(clear_module_state->__pyx_n_s_getgrgid); Py_CLEAR(clear_module_state->__pyx_n_s_getgrnam); Py_CLEAR(clear_module_state->__pyx_n_s_getosusername); Py_CLEAR(clear_module_state->__pyx_n_s_getpwnam); Py_CLEAR(clear_module_state->__pyx_n_s_getpwuid); Py_CLEAR(clear_module_state->__pyx_n_s_getuid); Py_CLEAR(clear_module_state->__pyx_n_s_gid); Py_CLEAR(clear_module_state->__pyx_n_s_gid2group); Py_CLEAR(clear_module_state->__pyx_n_s_gr_gid); Py_CLEAR(clear_module_state->__pyx_n_s_gr_name); Py_CLEAR(clear_module_state->__pyx_n_s_group); Py_CLEAR(clear_module_state->__pyx_n_s_group2gid); Py_CLEAR(clear_module_state->__pyx_n_s_grp); Py_CLEAR(clear_module_state->__pyx_n_s_helpers); Py_CLEAR(clear_module_state->__pyx_n_s_host); Py_CLEAR(clear_module_state->__pyx_n_s_hostid); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_n_s_join); Py_CLEAR(clear_module_state->__pyx_n_s_kill); Py_CLEAR(clear_module_state->__pyx_n_s_local_pid_alive); Py_CLEAR(clear_module_state->__pyx_n_s_lru_cache); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_maxsize); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_os); Py_CLEAR(clear_module_state->__pyx_n_s_pid); Py_CLEAR(clear_module_state->__pyx_n_s_posix_acl_use_stored_uid_gid); Py_CLEAR(clear_module_state->__pyx_n_s_process_alive); Py_CLEAR(clear_module_state->__pyx_n_s_pw_name); Py_CLEAR(clear_module_state->__pyx_n_s_pw_uid); Py_CLEAR(clear_module_state->__pyx_n_s_pwd); Py_CLEAR(clear_module_state->__pyx_n_s_s); Py_CLEAR(clear_module_state->__pyx_n_s_safe_decode); Py_CLEAR(clear_module_state->__pyx_n_s_safe_encode); Py_CLEAR(clear_module_state->__pyx_n_s_size); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_n_s_split); Py_CLEAR(clear_module_state->__pyx_kp_s_src_borg_platform_posix_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_swidth); Py_CLEAR(clear_module_state->__pyx_n_s_terminal_width); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_thread); Py_CLEAR(clear_module_state->__pyx_n_s_uid); Py_CLEAR(clear_module_state->__pyx_n_s_uid2user); Py_CLEAR(clear_module_state->__pyx_n_s_user); Py_CLEAR(clear_module_state->__pyx_n_s_user2uid); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_tuple__7); Py_CLEAR(clear_module_state->__pyx_tuple__9); Py_CLEAR(clear_module_state->__pyx_tuple__11); Py_CLEAR(clear_module_state->__pyx_tuple__13); Py_CLEAR(clear_module_state->__pyx_tuple__15); Py_CLEAR(clear_module_state->__pyx_tuple__16); Py_CLEAR(clear_module_state->__pyx_tuple__18); Py_CLEAR(clear_module_state->__pyx_tuple__20); Py_CLEAR(clear_module_state->__pyx_tuple__22); Py_CLEAR(clear_module_state->__pyx_tuple__24); Py_CLEAR(clear_module_state->__pyx_codeobj__6); Py_CLEAR(clear_module_state->__pyx_codeobj__8); Py_CLEAR(clear_module_state->__pyx_codeobj__10); Py_CLEAR(clear_module_state->__pyx_codeobj__12); Py_CLEAR(clear_module_state->__pyx_codeobj__14); Py_CLEAR(clear_module_state->__pyx_codeobj__17); Py_CLEAR(clear_module_state->__pyx_codeobj__19); Py_CLEAR(clear_module_state->__pyx_codeobj__21); Py_CLEAR(clear_module_state->__pyx_codeobj__23); Py_CLEAR(clear_module_state->__pyx_codeobj__25); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_n_s_); Py_VISIT(traverse_module_state->__pyx_n_s_AssertionError); Py_VISIT(traverse_module_state->__pyx_n_s_ESRCH); Py_VISIT(traverse_module_state->__pyx_n_s_KeyError); Py_VISIT(traverse_module_state->__pyx_n_s_OSError); Py_VISIT(traverse_module_state->__pyx_kp_u__2); Py_VISIT(traverse_module_state->__pyx_n_s__26); Py_VISIT(traverse_module_state->__pyx_kp_s__3); Py_VISIT(traverse_module_state->__pyx_kp_s__4); Py_VISIT(traverse_module_state->__pyx_n_s__5); Py_VISIT(traverse_module_state->__pyx_n_s_acl); Py_VISIT(traverse_module_state->__pyx_n_s_as_wchar); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_borg_platform_posix); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_default); Py_VISIT(traverse_module_state->__pyx_n_s_entries); Py_VISIT(traverse_module_state->__pyx_n_s_entry); Py_VISIT(traverse_module_state->__pyx_n_s_err); Py_VISIT(traverse_module_state->__pyx_n_s_errno); Py_VISIT(traverse_module_state->__pyx_n_s_fields); Py_VISIT(traverse_module_state->__pyx_n_s_functools); Py_VISIT(traverse_module_state->__pyx_n_s_get_errno); Py_VISIT(traverse_module_state->__pyx_n_s_getgrgid); Py_VISIT(traverse_module_state->__pyx_n_s_getgrnam); Py_VISIT(traverse_module_state->__pyx_n_s_getosusername); Py_VISIT(traverse_module_state->__pyx_n_s_getpwnam); Py_VISIT(traverse_module_state->__pyx_n_s_getpwuid); Py_VISIT(traverse_module_state->__pyx_n_s_getuid); Py_VISIT(traverse_module_state->__pyx_n_s_gid); Py_VISIT(traverse_module_state->__pyx_n_s_gid2group); Py_VISIT(traverse_module_state->__pyx_n_s_gr_gid); Py_VISIT(traverse_module_state->__pyx_n_s_gr_name); Py_VISIT(traverse_module_state->__pyx_n_s_group); Py_VISIT(traverse_module_state->__pyx_n_s_group2gid); Py_VISIT(traverse_module_state->__pyx_n_s_grp); Py_VISIT(traverse_module_state->__pyx_n_s_helpers); Py_VISIT(traverse_module_state->__pyx_n_s_host); Py_VISIT(traverse_module_state->__pyx_n_s_hostid); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_n_s_join); Py_VISIT(traverse_module_state->__pyx_n_s_kill); Py_VISIT(traverse_module_state->__pyx_n_s_local_pid_alive); Py_VISIT(traverse_module_state->__pyx_n_s_lru_cache); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_maxsize); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_os); Py_VISIT(traverse_module_state->__pyx_n_s_pid); Py_VISIT(traverse_module_state->__pyx_n_s_posix_acl_use_stored_uid_gid); Py_VISIT(traverse_module_state->__pyx_n_s_process_alive); Py_VISIT(traverse_module_state->__pyx_n_s_pw_name); Py_VISIT(traverse_module_state->__pyx_n_s_pw_uid); Py_VISIT(traverse_module_state->__pyx_n_s_pwd); Py_VISIT(traverse_module_state->__pyx_n_s_s); Py_VISIT(traverse_module_state->__pyx_n_s_safe_decode); Py_VISIT(traverse_module_state->__pyx_n_s_safe_encode); Py_VISIT(traverse_module_state->__pyx_n_s_size); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_n_s_split); Py_VISIT(traverse_module_state->__pyx_kp_s_src_borg_platform_posix_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_swidth); Py_VISIT(traverse_module_state->__pyx_n_s_terminal_width); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_thread); Py_VISIT(traverse_module_state->__pyx_n_s_uid); Py_VISIT(traverse_module_state->__pyx_n_s_uid2user); Py_VISIT(traverse_module_state->__pyx_n_s_user); Py_VISIT(traverse_module_state->__pyx_n_s_user2uid); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_tuple__7); Py_VISIT(traverse_module_state->__pyx_tuple__9); Py_VISIT(traverse_module_state->__pyx_tuple__11); Py_VISIT(traverse_module_state->__pyx_tuple__13); Py_VISIT(traverse_module_state->__pyx_tuple__15); Py_VISIT(traverse_module_state->__pyx_tuple__16); Py_VISIT(traverse_module_state->__pyx_tuple__18); Py_VISIT(traverse_module_state->__pyx_tuple__20); Py_VISIT(traverse_module_state->__pyx_tuple__22); Py_VISIT(traverse_module_state->__pyx_tuple__24); Py_VISIT(traverse_module_state->__pyx_codeobj__6); Py_VISIT(traverse_module_state->__pyx_codeobj__8); Py_VISIT(traverse_module_state->__pyx_codeobj__10); Py_VISIT(traverse_module_state->__pyx_codeobj__12); Py_VISIT(traverse_module_state->__pyx_codeobj__14); Py_VISIT(traverse_module_state->__pyx_codeobj__17); Py_VISIT(traverse_module_state->__pyx_codeobj__19); Py_VISIT(traverse_module_state->__pyx_codeobj__21); Py_VISIT(traverse_module_state->__pyx_codeobj__23); Py_VISIT(traverse_module_state->__pyx_codeobj__25); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_n_s_ __pyx_mstate_global->__pyx_n_s_ #define __pyx_n_s_AssertionError __pyx_mstate_global->__pyx_n_s_AssertionError #define __pyx_n_s_ESRCH __pyx_mstate_global->__pyx_n_s_ESRCH #define __pyx_n_s_KeyError __pyx_mstate_global->__pyx_n_s_KeyError #define __pyx_n_s_OSError __pyx_mstate_global->__pyx_n_s_OSError #define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2 #define __pyx_n_s__26 __pyx_mstate_global->__pyx_n_s__26 #define __pyx_kp_s__3 __pyx_mstate_global->__pyx_kp_s__3 #define __pyx_kp_s__4 __pyx_mstate_global->__pyx_kp_s__4 #define __pyx_n_s__5 __pyx_mstate_global->__pyx_n_s__5 #define __pyx_n_s_acl __pyx_mstate_global->__pyx_n_s_acl #define __pyx_n_s_as_wchar __pyx_mstate_global->__pyx_n_s_as_wchar #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_borg_platform_posix __pyx_mstate_global->__pyx_n_s_borg_platform_posix #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_default __pyx_mstate_global->__pyx_n_s_default #define __pyx_n_s_entries __pyx_mstate_global->__pyx_n_s_entries #define __pyx_n_s_entry __pyx_mstate_global->__pyx_n_s_entry #define __pyx_n_s_err __pyx_mstate_global->__pyx_n_s_err #define __pyx_n_s_errno __pyx_mstate_global->__pyx_n_s_errno #define __pyx_n_s_fields __pyx_mstate_global->__pyx_n_s_fields #define __pyx_n_s_functools __pyx_mstate_global->__pyx_n_s_functools #define __pyx_n_s_get_errno __pyx_mstate_global->__pyx_n_s_get_errno #define __pyx_n_s_getgrgid __pyx_mstate_global->__pyx_n_s_getgrgid #define __pyx_n_s_getgrnam __pyx_mstate_global->__pyx_n_s_getgrnam #define __pyx_n_s_getosusername __pyx_mstate_global->__pyx_n_s_getosusername #define __pyx_n_s_getpwnam __pyx_mstate_global->__pyx_n_s_getpwnam #define __pyx_n_s_getpwuid __pyx_mstate_global->__pyx_n_s_getpwuid #define __pyx_n_s_getuid __pyx_mstate_global->__pyx_n_s_getuid #define __pyx_n_s_gid __pyx_mstate_global->__pyx_n_s_gid #define __pyx_n_s_gid2group __pyx_mstate_global->__pyx_n_s_gid2group #define __pyx_n_s_gr_gid __pyx_mstate_global->__pyx_n_s_gr_gid #define __pyx_n_s_gr_name __pyx_mstate_global->__pyx_n_s_gr_name #define __pyx_n_s_group __pyx_mstate_global->__pyx_n_s_group #define __pyx_n_s_group2gid __pyx_mstate_global->__pyx_n_s_group2gid #define __pyx_n_s_grp __pyx_mstate_global->__pyx_n_s_grp #define __pyx_n_s_helpers __pyx_mstate_global->__pyx_n_s_helpers #define __pyx_n_s_host __pyx_mstate_global->__pyx_n_s_host #define __pyx_n_s_hostid __pyx_mstate_global->__pyx_n_s_hostid #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_n_s_join __pyx_mstate_global->__pyx_n_s_join #define __pyx_n_s_kill __pyx_mstate_global->__pyx_n_s_kill #define __pyx_n_s_local_pid_alive __pyx_mstate_global->__pyx_n_s_local_pid_alive #define __pyx_n_s_lru_cache __pyx_mstate_global->__pyx_n_s_lru_cache #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_maxsize __pyx_mstate_global->__pyx_n_s_maxsize #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_os __pyx_mstate_global->__pyx_n_s_os #define __pyx_n_s_pid __pyx_mstate_global->__pyx_n_s_pid #define __pyx_n_s_posix_acl_use_stored_uid_gid __pyx_mstate_global->__pyx_n_s_posix_acl_use_stored_uid_gid #define __pyx_n_s_process_alive __pyx_mstate_global->__pyx_n_s_process_alive #define __pyx_n_s_pw_name __pyx_mstate_global->__pyx_n_s_pw_name #define __pyx_n_s_pw_uid __pyx_mstate_global->__pyx_n_s_pw_uid #define __pyx_n_s_pwd __pyx_mstate_global->__pyx_n_s_pwd #define __pyx_n_s_s __pyx_mstate_global->__pyx_n_s_s #define __pyx_n_s_safe_decode __pyx_mstate_global->__pyx_n_s_safe_decode #define __pyx_n_s_safe_encode __pyx_mstate_global->__pyx_n_s_safe_encode #define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_n_s_split __pyx_mstate_global->__pyx_n_s_split #define __pyx_kp_s_src_borg_platform_posix_pyx __pyx_mstate_global->__pyx_kp_s_src_borg_platform_posix_pyx #define __pyx_n_s_swidth __pyx_mstate_global->__pyx_n_s_swidth #define __pyx_n_s_terminal_width __pyx_mstate_global->__pyx_n_s_terminal_width #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_thread __pyx_mstate_global->__pyx_n_s_thread #define __pyx_n_s_uid __pyx_mstate_global->__pyx_n_s_uid #define __pyx_n_s_uid2user __pyx_mstate_global->__pyx_n_s_uid2user #define __pyx_n_s_user __pyx_mstate_global->__pyx_n_s_user #define __pyx_n_s_user2uid __pyx_mstate_global->__pyx_n_s_user2uid #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 #define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9 #define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11 #define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13 #define __pyx_tuple__15 __pyx_mstate_global->__pyx_tuple__15 #define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16 #define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18 #define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20 #define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22 #define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24 #define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6 #define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8 #define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10 #define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 #define __pyx_codeobj__14 __pyx_mstate_global->__pyx_codeobj__14 #define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 #define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19 #define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21 #define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23 #define __pyx_codeobj__25 __pyx_mstate_global->__pyx_codeobj__25 /* #### Code section: module_code ### */ /* "borg/platform/posix.pyx":22 * * * def get_errno(): # <<<<<<<<<<<<<< * return c_errno * */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_5posix_1get_errno(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8platform_5posix_1get_errno = {"get_errno", (PyCFunction)__pyx_pw_4borg_8platform_5posix_1get_errno, METH_NOARGS, 0}; static PyObject *__pyx_pw_4borg_8platform_5posix_1get_errno(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_errno (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_4borg_8platform_5posix_get_errno(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8platform_5posix_get_errno(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_errno", 1); /* "borg/platform/posix.pyx":23 * * def get_errno(): * return c_errno # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/platform/posix.pyx":22 * * * def get_errno(): # <<<<<<<<<<<<<< * return c_errno * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("borg.platform.posix.get_errno", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/posix.pyx":26 * * * def swidth(s): # <<<<<<<<<<<<<< * cdef Py_ssize_t size * cdef wchar_t *as_wchar = PyUnicode_AsWideCharString(s, &size) */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_5posix_3swidth(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8platform_5posix_3swidth = {"swidth", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_5posix_3swidth, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8platform_5posix_3swidth(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_s = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("swidth (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_s,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_s)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 26, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "swidth") < 0)) __PYX_ERR(0, 26, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_s = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("swidth", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 26, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.posix.swidth", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_5posix_2swidth(__pyx_self, __pyx_v_s); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8platform_5posix_2swidth(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s) { Py_ssize_t __pyx_v_size; wchar_t *__pyx_v_as_wchar; int __pyx_v_terminal_width; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations wchar_t *__pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("swidth", 1); /* "borg/platform/posix.pyx":28 * def swidth(s): * cdef Py_ssize_t size * cdef wchar_t *as_wchar = PyUnicode_AsWideCharString(s, &size) # <<<<<<<<<<<<<< * terminal_width = wcswidth(as_wchar, size) * PyMem_Free(as_wchar) */ __pyx_t_1 = PyUnicode_AsWideCharString(__pyx_v_s, (&__pyx_v_size)); if (unlikely(__pyx_t_1 == ((wchar_t *)NULL))) __PYX_ERR(0, 28, __pyx_L1_error) __pyx_v_as_wchar = __pyx_t_1; /* "borg/platform/posix.pyx":29 * cdef Py_ssize_t size * cdef wchar_t *as_wchar = PyUnicode_AsWideCharString(s, &size) * terminal_width = wcswidth(as_wchar, size) # <<<<<<<<<<<<<< * PyMem_Free(as_wchar) * if terminal_width >= 0: */ __pyx_v_terminal_width = wcswidth(__pyx_v_as_wchar, ((size_t)__pyx_v_size)); /* "borg/platform/posix.pyx":30 * cdef wchar_t *as_wchar = PyUnicode_AsWideCharString(s, &size) * terminal_width = wcswidth(as_wchar, size) * PyMem_Free(as_wchar) # <<<<<<<<<<<<<< * if terminal_width >= 0: * return terminal_width */ PyMem_Free(__pyx_v_as_wchar); /* "borg/platform/posix.pyx":31 * terminal_width = wcswidth(as_wchar, size) * PyMem_Free(as_wchar) * if terminal_width >= 0: # <<<<<<<<<<<<<< * return terminal_width * else: */ __pyx_t_2 = (__pyx_v_terminal_width >= 0); if (__pyx_t_2) { /* "borg/platform/posix.pyx":32 * PyMem_Free(as_wchar) * if terminal_width >= 0: * return terminal_width # <<<<<<<<<<<<<< * else: * return len(s) */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_terminal_width); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "borg/platform/posix.pyx":31 * terminal_width = wcswidth(as_wchar, size) * PyMem_Free(as_wchar) * if terminal_width >= 0: # <<<<<<<<<<<<<< * return terminal_width * else: */ } /* "borg/platform/posix.pyx":34 * return terminal_width * else: * return len(s) # <<<<<<<<<<<<<< * * */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_4 = PyObject_Length(__pyx_v_s); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 34, __pyx_L1_error) __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "borg/platform/posix.pyx":26 * * * def swidth(s): # <<<<<<<<<<<<<< * cdef Py_ssize_t size * cdef wchar_t *as_wchar = PyUnicode_AsWideCharString(s, &size) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("borg.platform.posix.swidth", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/posix.pyx":37 * * * def process_alive(host, pid, thread): # <<<<<<<<<<<<<< * """ * Check if the (host, pid, thread_id) combination corresponds to a potentially alive process. */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_5posix_5process_alive(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_8platform_5posix_4process_alive, "\n Check if the (host, pid, thread_id) combination corresponds to a potentially alive process.\n\n If the process is local, then this will be accurate. If the process is not local, then this\n returns always True, since there is no real way to check.\n "); static PyMethodDef __pyx_mdef_4borg_8platform_5posix_5process_alive = {"process_alive", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_5posix_5process_alive, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_8platform_5posix_4process_alive}; static PyObject *__pyx_pw_4borg_8platform_5posix_5process_alive(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_host = 0; PyObject *__pyx_v_pid = 0; PyObject *__pyx_v_thread = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("process_alive (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_host,&__pyx_n_s_pid,&__pyx_n_s_thread,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_host)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 37, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pid)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 37, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("process_alive", 1, 3, 3, 1); __PYX_ERR(0, 37, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_thread)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 37, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("process_alive", 1, 3, 3, 2); __PYX_ERR(0, 37, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "process_alive") < 0)) __PYX_ERR(0, 37, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_host = values[0]; __pyx_v_pid = values[1]; __pyx_v_thread = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("process_alive", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 37, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.posix.process_alive", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_5posix_4process_alive(__pyx_self, __pyx_v_host, __pyx_v_pid, __pyx_v_thread); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8platform_5posix_4process_alive(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_host, PyObject *__pyx_v_pid, PyObject *__pyx_v_thread) { PyObject *__pyx_v_local_pid_alive = NULL; PyObject *__pyx_v_hostid = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("process_alive", 1); /* "borg/platform/posix.pyx":44 * returns always True, since there is no real way to check. * """ * from . import local_pid_alive # <<<<<<<<<<<<<< * from . import hostid * */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_local_pid_alive); __Pyx_GIVEREF(__pyx_n_s_local_pid_alive); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_local_pid_alive)) __PYX_ERR(0, 44, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_local_pid_alive); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_v_local_pid_alive = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/posix.pyx":45 * """ * from . import local_pid_alive * from . import hostid # <<<<<<<<<<<<<< * * assert isinstance(host, str) */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_hostid); __Pyx_GIVEREF(__pyx_n_s_hostid); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_hostid)) __PYX_ERR(0, 45, __pyx_L1_error); __pyx_t_1 = __Pyx_Import(__pyx_n_s_, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_hostid); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_2); __pyx_v_hostid = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "borg/platform/posix.pyx":47 * from . import hostid * * assert isinstance(host, str) # <<<<<<<<<<<<<< * assert isinstance(hostid, str) * assert isinstance(pid, int) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = PyString_Check(__pyx_v_host); if (unlikely(!__pyx_t_3)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 47, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 47, __pyx_L1_error) #endif /* "borg/platform/posix.pyx":48 * * assert isinstance(host, str) * assert isinstance(hostid, str) # <<<<<<<<<<<<<< * assert isinstance(pid, int) * assert isinstance(thread, int) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = PyString_Check(__pyx_v_hostid); if (unlikely(!__pyx_t_3)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 48, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 48, __pyx_L1_error) #endif /* "borg/platform/posix.pyx":49 * assert isinstance(host, str) * assert isinstance(hostid, str) * assert isinstance(pid, int) # <<<<<<<<<<<<<< * assert isinstance(thread, int) * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = PyInt_Check(__pyx_v_pid); if (unlikely(!__pyx_t_3)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 49, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 49, __pyx_L1_error) #endif /* "borg/platform/posix.pyx":50 * assert isinstance(hostid, str) * assert isinstance(pid, int) * assert isinstance(thread, int) # <<<<<<<<<<<<<< * * if host != hostid: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_3 = PyInt_Check(__pyx_v_thread); if (unlikely(!__pyx_t_3)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 50, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 50, __pyx_L1_error) #endif /* "borg/platform/posix.pyx":52 * assert isinstance(thread, int) * * if host != hostid: # <<<<<<<<<<<<<< * return True * */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_host, __pyx_v_hostid, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* "borg/platform/posix.pyx":53 * * if host != hostid: * return True # <<<<<<<<<<<<<< * * if thread != 0: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "borg/platform/posix.pyx":52 * assert isinstance(thread, int) * * if host != hostid: # <<<<<<<<<<<<<< * return True * */ } /* "borg/platform/posix.pyx":55 * return True * * if thread != 0: # <<<<<<<<<<<<<< * # Currently thread is always 0, if we ever decide to set this to a non-zero value, * # this code needs to be revisited, too, to do a sensible thing */ __pyx_t_3 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_thread, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 55, __pyx_L1_error) if (__pyx_t_3) { /* "borg/platform/posix.pyx":58 * # Currently thread is always 0, if we ever decide to set this to a non-zero value, * # this code needs to be revisited, too, to do a sensible thing * return True # <<<<<<<<<<<<<< * * return local_pid_alive(pid) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "borg/platform/posix.pyx":55 * return True * * if thread != 0: # <<<<<<<<<<<<<< * # Currently thread is always 0, if we ever decide to set this to a non-zero value, * # this code needs to be revisited, too, to do a sensible thing */ } /* "borg/platform/posix.pyx":60 * return True * * return local_pid_alive(pid) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_local_pid_alive); __pyx_t_2 = __pyx_v_local_pid_alive; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_pid}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/platform/posix.pyx":37 * * * def process_alive(host, pid, thread): # <<<<<<<<<<<<<< * """ * Check if the (host, pid, thread_id) combination corresponds to a potentially alive process. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("borg.platform.posix.process_alive", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_local_pid_alive); __Pyx_XDECREF(__pyx_v_hostid); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/posix.pyx":63 * * * def local_pid_alive(pid): # <<<<<<<<<<<<<< * """Return whether *pid* is alive.""" * try: */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_5posix_7local_pid_alive(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_8platform_5posix_6local_pid_alive, "Return whether *pid* is alive."); static PyMethodDef __pyx_mdef_4borg_8platform_5posix_7local_pid_alive = {"local_pid_alive", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_5posix_7local_pid_alive, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_8platform_5posix_6local_pid_alive}; static PyObject *__pyx_pw_4borg_8platform_5posix_7local_pid_alive(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_pid = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("local_pid_alive (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pid,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pid)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "local_pid_alive") < 0)) __PYX_ERR(0, 63, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_pid = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("local_pid_alive", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 63, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.posix.local_pid_alive", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_5posix_6local_pid_alive(__pyx_self, __pyx_v_pid); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8platform_5posix_6local_pid_alive(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_pid) { PyObject *__pyx_v_err = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; int __pyx_t_12; char const *__pyx_t_13; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("local_pid_alive", 1); /* "borg/platform/posix.pyx":65 * def local_pid_alive(pid): * """Return whether *pid* is alive.""" * try: # <<<<<<<<<<<<<< * # This doesn't work on Windows. * # This does not kill anything, 0 means "see if we can send a signal to this process or not". */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "borg/platform/posix.pyx":70 * # Possible errors: No such process (== stale lock) or permission denied (not a stale lock). * # If the exception is not raised that means such a pid is valid and we can send a signal to it. * os.kill(pid, 0) # <<<<<<<<<<<<<< * return True * except OSError as err: */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 70, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_kill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 70, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_pid, __pyx_int_0}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 70, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "borg/platform/posix.pyx":71 * # If the exception is not raised that means such a pid is valid and we can send a signal to it. * os.kill(pid, 0) * return True # <<<<<<<<<<<<<< * except OSError as err: * if err.errno == errno.ESRCH: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L7_try_return; /* "borg/platform/posix.pyx":65 * def local_pid_alive(pid): * """Return whether *pid* is alive.""" * try: # <<<<<<<<<<<<<< * # This doesn't work on Windows. * # This does not kill anything, 0 means "see if we can send a signal to this process or not". */ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "borg/platform/posix.pyx":72 * os.kill(pid, 0) * return True * except OSError as err: # <<<<<<<<<<<<<< * if err.errno == errno.ESRCH: * # ESRCH = no such process */ __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_OSError); if (__pyx_t_7) { __Pyx_AddTraceback("borg.platform.posix.local_pid_alive", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(0, 72, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_v_err = __pyx_t_6; /*try:*/ { /* "borg/platform/posix.pyx":73 * return True * except OSError as err: * if err.errno == errno.ESRCH: # <<<<<<<<<<<<<< * # ESRCH = no such process * return False */ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_err, __pyx_n_s_errno); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 73, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_errno); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 73, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ESRCH); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 73, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_t_10, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 73, __pyx_L14_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 73, __pyx_L14_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_11) { /* "borg/platform/posix.pyx":75 * if err.errno == errno.ESRCH: * # ESRCH = no such process * return False # <<<<<<<<<<<<<< * # Any other error (eg. permissions) means that the process ID refers to a live process. * return True */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L13_return; /* "borg/platform/posix.pyx":73 * return True * except OSError as err: * if err.errno == errno.ESRCH: # <<<<<<<<<<<<<< * # ESRCH = no such process * return False */ } /* "borg/platform/posix.pyx":77 * return False * # Any other error (eg. permissions) means that the process ID refers to a live process. * return True # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L13_return; } /* "borg/platform/posix.pyx":72 * os.kill(pid, 0) * return True * except OSError as err: # <<<<<<<<<<<<<< * if err.errno == errno.ESRCH: * # ESRCH = no such process */ /*finally:*/ { __pyx_L14_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __pyx_t_7 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename; { __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19); } __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ErrRestore(__pyx_t_14, __pyx_t_15, __pyx_t_16); __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13; goto __pyx_L5_except_error; } __pyx_L13_return: { __pyx_t_19 = __pyx_r; __pyx_r = 0; __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0; __pyx_r = __pyx_t_19; __pyx_t_19 = 0; goto __pyx_L6_except_return; } } } goto __pyx_L5_except_error; /* "borg/platform/posix.pyx":65 * def local_pid_alive(pid): * """Return whether *pid* is alive.""" * try: # <<<<<<<<<<<<<< * # This doesn't work on Windows. * # This does not kill anything, 0 means "see if we can send a signal to this process or not". */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L7_try_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; __pyx_L6_except_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; } /* "borg/platform/posix.pyx":63 * * * def local_pid_alive(pid): # <<<<<<<<<<<<<< * """Return whether *pid* is alive.""" * try: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("borg.platform.posix.local_pid_alive", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_err); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/posix.pyx":80 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def uid2user(uid, default=None): * try: */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_5posix_9uid2user(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8platform_5posix_9uid2user = {"uid2user", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_5posix_9uid2user, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8platform_5posix_9uid2user(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_uid = 0; PyObject *__pyx_v_default = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("uid2user (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_uid,&__pyx_n_s_default,0}; /* "borg/platform/posix.pyx":81 * * @lru_cache(maxsize=None) * def uid2user(uid, default=None): # <<<<<<<<<<<<<< * try: * return pwd.getpwuid(uid).pw_name */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_uid)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_default); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "uid2user") < 0)) __PYX_ERR(0, 80, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_uid = values[0]; __pyx_v_default = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("uid2user", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 80, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.posix.uid2user", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_5posix_8uid2user(__pyx_self, __pyx_v_uid, __pyx_v_default); /* "borg/platform/posix.pyx":80 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def uid2user(uid, default=None): * try: */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8platform_5posix_8uid2user(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_uid, PyObject *__pyx_v_default) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("uid2user", 1); /* "borg/platform/posix.pyx":82 * @lru_cache(maxsize=None) * def uid2user(uid, default=None): * try: # <<<<<<<<<<<<<< * return pwd.getpwuid(uid).pw_name * except KeyError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "borg/platform/posix.pyx":83 * def uid2user(uid, default=None): * try: * return pwd.getpwuid(uid).pw_name # <<<<<<<<<<<<<< * except KeyError: * return default */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pwd); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 83, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_getpwuid); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 83, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_uid}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 83, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_pw_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 83, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L7_try_return; /* "borg/platform/posix.pyx":82 * @lru_cache(maxsize=None) * def uid2user(uid, default=None): * try: # <<<<<<<<<<<<<< * return pwd.getpwuid(uid).pw_name * except KeyError: */ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "borg/platform/posix.pyx":84 * try: * return pwd.getpwuid(uid).pw_name * except KeyError: # <<<<<<<<<<<<<< * return default * */ __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_7) { __Pyx_AddTraceback("borg.platform.posix.uid2user", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(0, 84, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); /* "borg/platform/posix.pyx":85 * return pwd.getpwuid(uid).pw_name * except KeyError: * return default # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_default); __pyx_r = __pyx_v_default; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L6_except_return; } goto __pyx_L5_except_error; /* "borg/platform/posix.pyx":82 * @lru_cache(maxsize=None) * def uid2user(uid, default=None): * try: # <<<<<<<<<<<<<< * return pwd.getpwuid(uid).pw_name * except KeyError: */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L7_try_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; __pyx_L6_except_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; } /* "borg/platform/posix.pyx":80 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def uid2user(uid, default=None): * try: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("borg.platform.posix.uid2user", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/posix.pyx":88 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def user2uid(user, default=None): * try: */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_5posix_11user2uid(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8platform_5posix_11user2uid = {"user2uid", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_5posix_11user2uid, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8platform_5posix_11user2uid(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_user = 0; PyObject *__pyx_v_default = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("user2uid (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_user,&__pyx_n_s_default,0}; /* "borg/platform/posix.pyx":89 * * @lru_cache(maxsize=None) * def user2uid(user, default=None): # <<<<<<<<<<<<<< * try: * return user and pwd.getpwnam(user).pw_uid */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_user)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_default); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "user2uid") < 0)) __PYX_ERR(0, 88, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_user = values[0]; __pyx_v_default = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("user2uid", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 88, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.posix.user2uid", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_5posix_10user2uid(__pyx_self, __pyx_v_user, __pyx_v_default); /* "borg/platform/posix.pyx":88 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def user2uid(user, default=None): * try: */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8platform_5posix_10user2uid(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_user, PyObject *__pyx_v_default) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("user2uid", 1); /* "borg/platform/posix.pyx":90 * @lru_cache(maxsize=None) * def user2uid(user, default=None): * try: # <<<<<<<<<<<<<< * return user and pwd.getpwnam(user).pw_uid * except KeyError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "borg/platform/posix.pyx":91 * def user2uid(user, default=None): * try: * return user and pwd.getpwnam(user).pw_uid # <<<<<<<<<<<<<< * except KeyError: * return default */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_user); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 91, __pyx_L3_error) if (__pyx_t_5) { } else { __Pyx_INCREF(__pyx_v_user); __pyx_t_4 = __pyx_v_user; goto __pyx_L9_bool_binop_done; } __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_pwd); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 91, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_getpwnam); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 91, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_user}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 91, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_pw_uid); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 91, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_INCREF(__pyx_t_8); __pyx_t_4 = __pyx_t_8; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_L9_bool_binop_done:; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L7_try_return; /* "borg/platform/posix.pyx":90 * @lru_cache(maxsize=None) * def user2uid(user, default=None): * try: # <<<<<<<<<<<<<< * return user and pwd.getpwnam(user).pw_uid * except KeyError: */ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; /* "borg/platform/posix.pyx":92 * try: * return user and pwd.getpwnam(user).pw_uid * except KeyError: # <<<<<<<<<<<<<< * return default * */ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_9) { __Pyx_AddTraceback("borg.platform.posix.user2uid", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(0, 92, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); /* "borg/platform/posix.pyx":93 * return user and pwd.getpwnam(user).pw_uid * except KeyError: * return default # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_default); __pyx_r = __pyx_v_default; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L6_except_return; } goto __pyx_L5_except_error; /* "borg/platform/posix.pyx":90 * @lru_cache(maxsize=None) * def user2uid(user, default=None): * try: # <<<<<<<<<<<<<< * return user and pwd.getpwnam(user).pw_uid * except KeyError: */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L7_try_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; __pyx_L6_except_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; } /* "borg/platform/posix.pyx":88 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def user2uid(user, default=None): * try: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("borg.platform.posix.user2uid", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/posix.pyx":96 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def gid2group(gid, default=None): * try: */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_5posix_13gid2group(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8platform_5posix_13gid2group = {"gid2group", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_5posix_13gid2group, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8platform_5posix_13gid2group(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_gid = 0; PyObject *__pyx_v_default = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gid2group (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gid,&__pyx_n_s_default,0}; /* "borg/platform/posix.pyx":97 * * @lru_cache(maxsize=None) * def gid2group(gid, default=None): # <<<<<<<<<<<<<< * try: * return grp.getgrgid(gid).gr_name */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gid)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_default); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "gid2group") < 0)) __PYX_ERR(0, 96, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_gid = values[0]; __pyx_v_default = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("gid2group", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 96, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.posix.gid2group", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_5posix_12gid2group(__pyx_self, __pyx_v_gid, __pyx_v_default); /* "borg/platform/posix.pyx":96 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def gid2group(gid, default=None): * try: */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8platform_5posix_12gid2group(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_gid, PyObject *__pyx_v_default) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("gid2group", 1); /* "borg/platform/posix.pyx":98 * @lru_cache(maxsize=None) * def gid2group(gid, default=None): * try: # <<<<<<<<<<<<<< * return grp.getgrgid(gid).gr_name * except KeyError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "borg/platform/posix.pyx":99 * def gid2group(gid, default=None): * try: * return grp.getgrgid(gid).gr_name # <<<<<<<<<<<<<< * except KeyError: * return default */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_grp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 99, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_getgrgid); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 99, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_gid}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 99, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_gr_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 99, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L7_try_return; /* "borg/platform/posix.pyx":98 * @lru_cache(maxsize=None) * def gid2group(gid, default=None): * try: # <<<<<<<<<<<<<< * return grp.getgrgid(gid).gr_name * except KeyError: */ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "borg/platform/posix.pyx":100 * try: * return grp.getgrgid(gid).gr_name * except KeyError: # <<<<<<<<<<<<<< * return default * */ __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_7) { __Pyx_AddTraceback("borg.platform.posix.gid2group", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(0, 100, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); /* "borg/platform/posix.pyx":101 * return grp.getgrgid(gid).gr_name * except KeyError: * return default # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_default); __pyx_r = __pyx_v_default; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L6_except_return; } goto __pyx_L5_except_error; /* "borg/platform/posix.pyx":98 * @lru_cache(maxsize=None) * def gid2group(gid, default=None): * try: # <<<<<<<<<<<<<< * return grp.getgrgid(gid).gr_name * except KeyError: */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L7_try_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; __pyx_L6_except_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; } /* "borg/platform/posix.pyx":96 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def gid2group(gid, default=None): * try: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("borg.platform.posix.gid2group", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/posix.pyx":104 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def group2gid(group, default=None): * try: */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_5posix_15group2gid(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8platform_5posix_15group2gid = {"group2gid", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_5posix_15group2gid, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8platform_5posix_15group2gid(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_group = 0; PyObject *__pyx_v_default = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("group2gid (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_group,&__pyx_n_s_default,0}; /* "borg/platform/posix.pyx":105 * * @lru_cache(maxsize=None) * def group2gid(group, default=None): # <<<<<<<<<<<<<< * try: * return group and grp.getgrnam(group).gr_gid */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_group)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_default); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "group2gid") < 0)) __PYX_ERR(0, 104, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_group = values[0]; __pyx_v_default = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("group2gid", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 104, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.posix.group2gid", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_5posix_14group2gid(__pyx_self, __pyx_v_group, __pyx_v_default); /* "borg/platform/posix.pyx":104 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def group2gid(group, default=None): * try: */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8platform_5posix_14group2gid(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_group, PyObject *__pyx_v_default) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("group2gid", 1); /* "borg/platform/posix.pyx":106 * @lru_cache(maxsize=None) * def group2gid(group, default=None): * try: # <<<<<<<<<<<<<< * return group and grp.getgrnam(group).gr_gid * except KeyError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "borg/platform/posix.pyx":107 * def group2gid(group, default=None): * try: * return group and grp.getgrnam(group).gr_gid # <<<<<<<<<<<<<< * except KeyError: * return default */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_group); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 107, __pyx_L3_error) if (__pyx_t_5) { } else { __Pyx_INCREF(__pyx_v_group); __pyx_t_4 = __pyx_v_group; goto __pyx_L9_bool_binop_done; } __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_grp); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 107, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_getgrnam); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 107, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_group}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_gr_gid); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 107, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_INCREF(__pyx_t_8); __pyx_t_4 = __pyx_t_8; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_L9_bool_binop_done:; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L7_try_return; /* "borg/platform/posix.pyx":106 * @lru_cache(maxsize=None) * def group2gid(group, default=None): * try: # <<<<<<<<<<<<<< * return group and grp.getgrnam(group).gr_gid * except KeyError: */ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; /* "borg/platform/posix.pyx":108 * try: * return group and grp.getgrnam(group).gr_gid * except KeyError: # <<<<<<<<<<<<<< * return default * */ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_9) { __Pyx_AddTraceback("borg.platform.posix.group2gid", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(0, 108, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); /* "borg/platform/posix.pyx":109 * return group and grp.getgrnam(group).gr_gid * except KeyError: * return default # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_default); __pyx_r = __pyx_v_default; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L6_except_return; } goto __pyx_L5_except_error; /* "borg/platform/posix.pyx":106 * @lru_cache(maxsize=None) * def group2gid(group, default=None): * try: # <<<<<<<<<<<<<< * return group and grp.getgrnam(group).gr_gid * except KeyError: */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L7_try_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; __pyx_L6_except_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; } /* "borg/platform/posix.pyx":104 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def group2gid(group, default=None): * try: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("borg.platform.posix.group2gid", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/posix.pyx":112 * * * def posix_acl_use_stored_uid_gid(acl): # <<<<<<<<<<<<<< * """Replace the user/group field with the stored uid/gid * """ */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_5posix_17posix_acl_use_stored_uid_gid(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_8platform_5posix_16posix_acl_use_stored_uid_gid, "Replace the user/group field with the stored uid/gid\n "); static PyMethodDef __pyx_mdef_4borg_8platform_5posix_17posix_acl_use_stored_uid_gid = {"posix_acl_use_stored_uid_gid", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_5posix_17posix_acl_use_stored_uid_gid, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_8platform_5posix_16posix_acl_use_stored_uid_gid}; static PyObject *__pyx_pw_4borg_8platform_5posix_17posix_acl_use_stored_uid_gid(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_acl = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("posix_acl_use_stored_uid_gid (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_acl,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_acl)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "posix_acl_use_stored_uid_gid") < 0)) __PYX_ERR(0, 112, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_acl = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("posix_acl_use_stored_uid_gid", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 112, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.posix.posix_acl_use_stored_uid_gid", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_5posix_16posix_acl_use_stored_uid_gid(__pyx_self, __pyx_v_acl); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8platform_5posix_16posix_acl_use_stored_uid_gid(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_acl) { PyObject *__pyx_v_safe_decode = NULL; PyObject *__pyx_v_safe_encode = NULL; PyObject *__pyx_v_entries = NULL; PyObject *__pyx_v_entry = NULL; PyObject *__pyx_v_fields = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; Py_ssize_t __pyx_t_6; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; Py_ssize_t __pyx_t_9; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("posix_acl_use_stored_uid_gid", 1); /* "borg/platform/posix.pyx":115 * """Replace the user/group field with the stored uid/gid * """ * from ..helpers import safe_decode, safe_encode # <<<<<<<<<<<<<< * entries = [] * for entry in safe_decode(acl).split('\n'): */ __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_safe_decode); __Pyx_GIVEREF(__pyx_n_s_safe_decode); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_safe_decode)) __PYX_ERR(0, 115, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_safe_encode); __Pyx_GIVEREF(__pyx_n_s_safe_encode); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_safe_encode)) __PYX_ERR(0, 115, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_helpers, __pyx_t_1, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_safe_decode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_v_safe_decode = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_safe_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_v_safe_encode = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/posix.pyx":116 * """ * from ..helpers import safe_decode, safe_encode * entries = [] # <<<<<<<<<<<<<< * for entry in safe_decode(acl).split('\n'): * if entry: */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_entries = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/posix.pyx":117 * from ..helpers import safe_decode, safe_encode * entries = [] * for entry in safe_decode(acl).split('\n'): # <<<<<<<<<<<<<< * if entry: * fields = entry.split(':') */ __Pyx_INCREF(__pyx_v_safe_decode); __pyx_t_3 = __pyx_v_safe_decode; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_acl}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_kp_s__3}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 117, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_3))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 117, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 117, __pyx_L1_error) #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 117, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 117, __pyx_L1_error) #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 117, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_2); } __Pyx_XDECREF_SET(__pyx_v_entry, __pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/posix.pyx":118 * entries = [] * for entry in safe_decode(acl).split('\n'): * if entry: # <<<<<<<<<<<<<< * fields = entry.split(':') * if len(fields) == 4: */ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_entry); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 118, __pyx_L1_error) if (__pyx_t_8) { /* "borg/platform/posix.pyx":119 * for entry in safe_decode(acl).split('\n'): * if entry: * fields = entry.split(':') # <<<<<<<<<<<<<< * if len(fields) == 4: * entries.append(':'.join([fields[0], fields[3], fields[2]])) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_entry, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s__4}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_XDECREF_SET(__pyx_v_fields, __pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/posix.pyx":120 * if entry: * fields = entry.split(':') * if len(fields) == 4: # <<<<<<<<<<<<<< * entries.append(':'.join([fields[0], fields[3], fields[2]])) * else: */ __pyx_t_9 = PyObject_Length(__pyx_v_fields); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 120, __pyx_L1_error) __pyx_t_8 = (__pyx_t_9 == 4); if (__pyx_t_8) { /* "borg/platform/posix.pyx":121 * fields = entry.split(':') * if len(fields) == 4: * entries.append(':'.join([fields[0], fields[3], fields[2]])) # <<<<<<<<<<<<<< * else: * entries.append(entry) */ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_fields, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_fields, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_fields, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_10 = PyList_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 0, __pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 1, __pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 2, __pyx_t_4)) __PYX_ERR(0, 121, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyString_Join(__pyx_kp_s__4, __pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_entries, __pyx_t_4); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "borg/platform/posix.pyx":120 * if entry: * fields = entry.split(':') * if len(fields) == 4: # <<<<<<<<<<<<<< * entries.append(':'.join([fields[0], fields[3], fields[2]])) * else: */ goto __pyx_L6; } /* "borg/platform/posix.pyx":123 * entries.append(':'.join([fields[0], fields[3], fields[2]])) * else: * entries.append(entry) # <<<<<<<<<<<<<< * return safe_encode('\n'.join(entries)) * */ /*else*/ { __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_entries, __pyx_v_entry); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 123, __pyx_L1_error) } __pyx_L6:; /* "borg/platform/posix.pyx":118 * entries = [] * for entry in safe_decode(acl).split('\n'): * if entry: # <<<<<<<<<<<<<< * fields = entry.split(':') * if len(fields) == 4: */ } /* "borg/platform/posix.pyx":117 * from ..helpers import safe_decode, safe_encode * entries = [] * for entry in safe_decode(acl).split('\n'): # <<<<<<<<<<<<<< * if entry: * fields = entry.split(':') */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/posix.pyx":124 * else: * entries.append(entry) * return safe_encode('\n'.join(entries)) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyString_Join(__pyx_kp_s__3, __pyx_v_entries); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_safe_encode); __pyx_t_10 = __pyx_v_safe_encode; __pyx_t_1 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_4}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "borg/platform/posix.pyx":112 * * * def posix_acl_use_stored_uid_gid(acl): # <<<<<<<<<<<<<< * """Replace the user/group field with the stored uid/gid * """ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("borg.platform.posix.posix_acl_use_stored_uid_gid", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_safe_decode); __Pyx_XDECREF(__pyx_v_safe_encode); __Pyx_XDECREF(__pyx_v_entries); __Pyx_XDECREF(__pyx_v_entry); __Pyx_XDECREF(__pyx_v_fields); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/posix.pyx":127 * * * def getosusername(): # <<<<<<<<<<<<<< * """Return the os user name.""" * uid = os.getuid() */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_5posix_19getosusername(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_8platform_5posix_18getosusername, "Return the os user name."); static PyMethodDef __pyx_mdef_4borg_8platform_5posix_19getosusername = {"getosusername", (PyCFunction)__pyx_pw_4borg_8platform_5posix_19getosusername, METH_NOARGS, __pyx_doc_4borg_8platform_5posix_18getosusername}; static PyObject *__pyx_pw_4borg_8platform_5posix_19getosusername(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getosusername (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_4borg_8platform_5posix_18getosusername(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8platform_5posix_18getosusername(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_v_uid = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getosusername", 1); /* "borg/platform/posix.pyx":129 * def getosusername(): * """Return the os user name.""" * uid = os.getuid() # <<<<<<<<<<<<<< * return uid2user(uid, uid) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_getuid); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_uid = __pyx_t_1; __pyx_t_1 = 0; /* "borg/platform/posix.pyx":130 * """Return the os user name.""" * uid = os.getuid() * return uid2user(uid, uid) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_uid2user); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_uid, __pyx_v_uid}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/platform/posix.pyx":127 * * * def getosusername(): # <<<<<<<<<<<<<< * """Return the os user name.""" * uid = os.getuid() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("borg.platform.posix.getosusername", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_uid); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 1}, {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1}, {&__pyx_n_s_ESRCH, __pyx_k_ESRCH, sizeof(__pyx_k_ESRCH), 0, 0, 1, 1}, {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, {&__pyx_n_s_OSError, __pyx_k_OSError, sizeof(__pyx_k_OSError), 0, 0, 1, 1}, {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0}, {&__pyx_n_s__26, __pyx_k__26, sizeof(__pyx_k__26), 0, 0, 1, 1}, {&__pyx_kp_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 0}, {&__pyx_kp_s__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 1, 0}, {&__pyx_n_s__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 1, 1}, {&__pyx_n_s_acl, __pyx_k_acl, sizeof(__pyx_k_acl), 0, 0, 1, 1}, {&__pyx_n_s_as_wchar, __pyx_k_as_wchar, sizeof(__pyx_k_as_wchar), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_borg_platform_posix, __pyx_k_borg_platform_posix, sizeof(__pyx_k_borg_platform_posix), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1}, {&__pyx_n_s_entries, __pyx_k_entries, sizeof(__pyx_k_entries), 0, 0, 1, 1}, {&__pyx_n_s_entry, __pyx_k_entry, sizeof(__pyx_k_entry), 0, 0, 1, 1}, {&__pyx_n_s_err, __pyx_k_err, sizeof(__pyx_k_err), 0, 0, 1, 1}, {&__pyx_n_s_errno, __pyx_k_errno, sizeof(__pyx_k_errno), 0, 0, 1, 1}, {&__pyx_n_s_fields, __pyx_k_fields, sizeof(__pyx_k_fields), 0, 0, 1, 1}, {&__pyx_n_s_functools, __pyx_k_functools, sizeof(__pyx_k_functools), 0, 0, 1, 1}, {&__pyx_n_s_get_errno, __pyx_k_get_errno, sizeof(__pyx_k_get_errno), 0, 0, 1, 1}, {&__pyx_n_s_getgrgid, __pyx_k_getgrgid, sizeof(__pyx_k_getgrgid), 0, 0, 1, 1}, {&__pyx_n_s_getgrnam, __pyx_k_getgrnam, sizeof(__pyx_k_getgrnam), 0, 0, 1, 1}, {&__pyx_n_s_getosusername, __pyx_k_getosusername, sizeof(__pyx_k_getosusername), 0, 0, 1, 1}, {&__pyx_n_s_getpwnam, __pyx_k_getpwnam, sizeof(__pyx_k_getpwnam), 0, 0, 1, 1}, {&__pyx_n_s_getpwuid, __pyx_k_getpwuid, sizeof(__pyx_k_getpwuid), 0, 0, 1, 1}, {&__pyx_n_s_getuid, __pyx_k_getuid, sizeof(__pyx_k_getuid), 0, 0, 1, 1}, {&__pyx_n_s_gid, __pyx_k_gid, sizeof(__pyx_k_gid), 0, 0, 1, 1}, {&__pyx_n_s_gid2group, __pyx_k_gid2group, sizeof(__pyx_k_gid2group), 0, 0, 1, 1}, {&__pyx_n_s_gr_gid, __pyx_k_gr_gid, sizeof(__pyx_k_gr_gid), 0, 0, 1, 1}, {&__pyx_n_s_gr_name, __pyx_k_gr_name, sizeof(__pyx_k_gr_name), 0, 0, 1, 1}, {&__pyx_n_s_group, __pyx_k_group, sizeof(__pyx_k_group), 0, 0, 1, 1}, {&__pyx_n_s_group2gid, __pyx_k_group2gid, sizeof(__pyx_k_group2gid), 0, 0, 1, 1}, {&__pyx_n_s_grp, __pyx_k_grp, sizeof(__pyx_k_grp), 0, 0, 1, 1}, {&__pyx_n_s_helpers, __pyx_k_helpers, sizeof(__pyx_k_helpers), 0, 0, 1, 1}, {&__pyx_n_s_host, __pyx_k_host, sizeof(__pyx_k_host), 0, 0, 1, 1}, {&__pyx_n_s_hostid, __pyx_k_hostid, sizeof(__pyx_k_hostid), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, {&__pyx_n_s_kill, __pyx_k_kill, sizeof(__pyx_k_kill), 0, 0, 1, 1}, {&__pyx_n_s_local_pid_alive, __pyx_k_local_pid_alive, sizeof(__pyx_k_local_pid_alive), 0, 0, 1, 1}, {&__pyx_n_s_lru_cache, __pyx_k_lru_cache, sizeof(__pyx_k_lru_cache), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_maxsize, __pyx_k_maxsize, sizeof(__pyx_k_maxsize), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, {&__pyx_n_s_pid, __pyx_k_pid, sizeof(__pyx_k_pid), 0, 0, 1, 1}, {&__pyx_n_s_posix_acl_use_stored_uid_gid, __pyx_k_posix_acl_use_stored_uid_gid, sizeof(__pyx_k_posix_acl_use_stored_uid_gid), 0, 0, 1, 1}, {&__pyx_n_s_process_alive, __pyx_k_process_alive, sizeof(__pyx_k_process_alive), 0, 0, 1, 1}, {&__pyx_n_s_pw_name, __pyx_k_pw_name, sizeof(__pyx_k_pw_name), 0, 0, 1, 1}, {&__pyx_n_s_pw_uid, __pyx_k_pw_uid, sizeof(__pyx_k_pw_uid), 0, 0, 1, 1}, {&__pyx_n_s_pwd, __pyx_k_pwd, sizeof(__pyx_k_pwd), 0, 0, 1, 1}, {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1}, {&__pyx_n_s_safe_decode, __pyx_k_safe_decode, sizeof(__pyx_k_safe_decode), 0, 0, 1, 1}, {&__pyx_n_s_safe_encode, __pyx_k_safe_encode, sizeof(__pyx_k_safe_encode), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1}, {&__pyx_kp_s_src_borg_platform_posix_pyx, __pyx_k_src_borg_platform_posix_pyx, sizeof(__pyx_k_src_borg_platform_posix_pyx), 0, 0, 1, 0}, {&__pyx_n_s_swidth, __pyx_k_swidth, sizeof(__pyx_k_swidth), 0, 0, 1, 1}, {&__pyx_n_s_terminal_width, __pyx_k_terminal_width, sizeof(__pyx_k_terminal_width), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_thread, __pyx_k_thread, sizeof(__pyx_k_thread), 0, 0, 1, 1}, {&__pyx_n_s_uid, __pyx_k_uid, sizeof(__pyx_k_uid), 0, 0, 1, 1}, {&__pyx_n_s_uid2user, __pyx_k_uid2user, sizeof(__pyx_k_uid2user), 0, 0, 1, 1}, {&__pyx_n_s_user, __pyx_k_user, sizeof(__pyx_k_user), 0, 0, 1, 1}, {&__pyx_n_s_user2uid, __pyx_k_user2uid, sizeof(__pyx_k_user2uid), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 47, __pyx_L1_error) __pyx_builtin_OSError = __Pyx_GetBuiltinName(__pyx_n_s_OSError); if (!__pyx_builtin_OSError) __PYX_ERR(0, 72, __pyx_L1_error) __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 84, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "borg/platform/posix.pyx":22 * * * def get_errno(): # <<<<<<<<<<<<<< * return c_errno * */ __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_posix_pyx, __pyx_n_s_get_errno, 22, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 22, __pyx_L1_error) /* "borg/platform/posix.pyx":26 * * * def swidth(s): # <<<<<<<<<<<<<< * cdef Py_ssize_t size * cdef wchar_t *as_wchar = PyUnicode_AsWideCharString(s, &size) */ __pyx_tuple__7 = PyTuple_Pack(4, __pyx_n_s_s, __pyx_n_s_size, __pyx_n_s_as_wchar, __pyx_n_s_terminal_width); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_posix_pyx, __pyx_n_s_swidth, 26, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 26, __pyx_L1_error) /* "borg/platform/posix.pyx":37 * * * def process_alive(host, pid, thread): # <<<<<<<<<<<<<< * """ * Check if the (host, pid, thread_id) combination corresponds to a potentially alive process. */ __pyx_tuple__9 = PyTuple_Pack(5, __pyx_n_s_host, __pyx_n_s_pid, __pyx_n_s_thread, __pyx_n_s_local_pid_alive, __pyx_n_s_hostid); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_posix_pyx, __pyx_n_s_process_alive, 37, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 37, __pyx_L1_error) /* "borg/platform/posix.pyx":63 * * * def local_pid_alive(pid): # <<<<<<<<<<<<<< * """Return whether *pid* is alive.""" * try: */ __pyx_tuple__11 = PyTuple_Pack(2, __pyx_n_s_pid, __pyx_n_s_err); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_posix_pyx, __pyx_n_s_local_pid_alive, 63, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 63, __pyx_L1_error) /* "borg/platform/posix.pyx":80 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def uid2user(uid, default=None): * try: */ __pyx_tuple__13 = PyTuple_Pack(2, __pyx_n_s_uid, __pyx_n_s_default); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_posix_pyx, __pyx_n_s_uid2user, 80, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 80, __pyx_L1_error) __pyx_tuple__15 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); /* "borg/platform/posix.pyx":88 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def user2uid(user, default=None): * try: */ __pyx_tuple__16 = PyTuple_Pack(2, __pyx_n_s_user, __pyx_n_s_default); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_posix_pyx, __pyx_n_s_user2uid, 88, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 88, __pyx_L1_error) /* "borg/platform/posix.pyx":96 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def gid2group(gid, default=None): * try: */ __pyx_tuple__18 = PyTuple_Pack(2, __pyx_n_s_gid, __pyx_n_s_default); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_posix_pyx, __pyx_n_s_gid2group, 96, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 96, __pyx_L1_error) /* "borg/platform/posix.pyx":104 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def group2gid(group, default=None): * try: */ __pyx_tuple__20 = PyTuple_Pack(2, __pyx_n_s_group, __pyx_n_s_default); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_posix_pyx, __pyx_n_s_group2gid, 104, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 104, __pyx_L1_error) /* "borg/platform/posix.pyx":112 * * * def posix_acl_use_stored_uid_gid(acl): # <<<<<<<<<<<<<< * """Replace the user/group field with the stored uid/gid * """ */ __pyx_tuple__22 = PyTuple_Pack(6, __pyx_n_s_acl, __pyx_n_s_safe_decode, __pyx_n_s_safe_encode, __pyx_n_s_entries, __pyx_n_s_entry, __pyx_n_s_fields); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_posix_pyx, __pyx_n_s_posix_acl_use_stored_uid_gid, 112, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 112, __pyx_L1_error) /* "borg/platform/posix.pyx":127 * * * def getosusername(): # <<<<<<<<<<<<<< * """Return the os user name.""" * uid = os.getuid() */ __pyx_tuple__24 = PyTuple_Pack(1, __pyx_n_s_uid); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_posix_pyx, __pyx_n_s_getosusername, 127, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { /* AssertionsEnabled.init */ if (likely(__Pyx_init_assertions_enabled() == 0)); else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_posix(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_posix}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "posix", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initposix(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initposix(void) #else __Pyx_PyMODINIT_FUNC PyInit_posix(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_posix(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_posix(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'posix' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("posix", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "posix" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_posix(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_borg__platform__posix) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "borg.platform.posix")) { if (unlikely((PyDict_SetItemString(modules, "borg.platform.posix", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); (void)__Pyx_modinit_type_init_code(); (void)__Pyx_modinit_type_import_code(); (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "borg/platform/posix.pyx":1 * import errno # <<<<<<<<<<<<<< * import os * import grp */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_errno, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_errno, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/posix.pyx":2 * import errno * import os # <<<<<<<<<<<<<< * import grp * import pwd */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_os, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_2) < 0) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/posix.pyx":3 * import errno * import os * import grp # <<<<<<<<<<<<<< * import pwd * from functools import lru_cache */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_grp, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_grp, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/posix.pyx":4 * import os * import grp * import pwd # <<<<<<<<<<<<<< * from functools import lru_cache * */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_pwd, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pwd, __pyx_t_2) < 0) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/posix.pyx":5 * import grp * import pwd * from functools import lru_cache # <<<<<<<<<<<<<< * * from libc.errno cimport errno as c_errno */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_lru_cache); __Pyx_GIVEREF(__pyx_n_s_lru_cache); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_lru_cache)) __PYX_ERR(0, 5, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_functools, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_lru_cache); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_lru_cache, __pyx_t_2) < 0) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/posix.pyx":22 * * * def get_errno(): # <<<<<<<<<<<<<< * return c_errno * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_5posix_1get_errno, 0, __pyx_n_s_get_errno, NULL, __pyx_n_s_borg_platform_posix, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_errno, __pyx_t_3) < 0) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/posix.pyx":26 * * * def swidth(s): # <<<<<<<<<<<<<< * cdef Py_ssize_t size * cdef wchar_t *as_wchar = PyUnicode_AsWideCharString(s, &size) */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_5posix_3swidth, 0, __pyx_n_s_swidth, NULL, __pyx_n_s_borg_platform_posix, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_swidth, __pyx_t_3) < 0) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/posix.pyx":37 * * * def process_alive(host, pid, thread): # <<<<<<<<<<<<<< * """ * Check if the (host, pid, thread_id) combination corresponds to a potentially alive process. */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_5posix_5process_alive, 0, __pyx_n_s_process_alive, NULL, __pyx_n_s_borg_platform_posix, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_process_alive, __pyx_t_3) < 0) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/posix.pyx":63 * * * def local_pid_alive(pid): # <<<<<<<<<<<<<< * """Return whether *pid* is alive.""" * try: */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_5posix_7local_pid_alive, 0, __pyx_n_s_local_pid_alive, NULL, __pyx_n_s_borg_platform_posix, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_local_pid_alive, __pyx_t_3) < 0) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/posix.pyx":80 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def uid2user(uid, default=None): * try: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_lru_cache); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_maxsize, Py_None) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/posix.pyx":81 * * @lru_cache(maxsize=None) * def uid2user(uid, default=None): # <<<<<<<<<<<<<< * try: * return pwd.getpwuid(uid).pw_name */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_5posix_9uid2user, 0, __pyx_n_s_uid2user, NULL, __pyx_n_s_borg_platform_posix, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__15); /* "borg/platform/posix.pyx":80 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def uid2user(uid, default=None): * try: */ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_uid2user, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/posix.pyx":88 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def user2uid(user, default=None): * try: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_lru_cache); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_maxsize, Py_None) < 0) __PYX_ERR(0, 88, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/posix.pyx":89 * * @lru_cache(maxsize=None) * def user2uid(user, default=None): # <<<<<<<<<<<<<< * try: * return user and pwd.getpwnam(user).pw_uid */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_5posix_11user2uid, 0, __pyx_n_s_user2uid, NULL, __pyx_n_s_borg_platform_posix, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__15); /* "borg/platform/posix.pyx":88 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def user2uid(user, default=None): * try: */ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_user2uid, __pyx_t_3) < 0) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/posix.pyx":96 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def gid2group(gid, default=None): * try: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_lru_cache); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_maxsize, Py_None) < 0) __PYX_ERR(0, 96, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/posix.pyx":97 * * @lru_cache(maxsize=None) * def gid2group(gid, default=None): # <<<<<<<<<<<<<< * try: * return grp.getgrgid(gid).gr_name */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_5posix_13gid2group, 0, __pyx_n_s_gid2group, NULL, __pyx_n_s_borg_platform_posix, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__15); /* "borg/platform/posix.pyx":96 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def gid2group(gid, default=None): * try: */ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_gid2group, __pyx_t_3) < 0) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/posix.pyx":104 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def group2gid(group, default=None): * try: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_lru_cache); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_maxsize, Py_None) < 0) __PYX_ERR(0, 104, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/posix.pyx":105 * * @lru_cache(maxsize=None) * def group2gid(group, default=None): # <<<<<<<<<<<<<< * try: * return group and grp.getgrnam(group).gr_gid */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_5posix_15group2gid, 0, __pyx_n_s_group2gid, NULL, __pyx_n_s_borg_platform_posix, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__15); /* "borg/platform/posix.pyx":104 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def group2gid(group, default=None): * try: */ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_group2gid, __pyx_t_3) < 0) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/posix.pyx":112 * * * def posix_acl_use_stored_uid_gid(acl): # <<<<<<<<<<<<<< * """Replace the user/group field with the stored uid/gid * """ */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_5posix_17posix_acl_use_stored_uid_gid, 0, __pyx_n_s_posix_acl_use_stored_uid_gid, NULL, __pyx_n_s_borg_platform_posix, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_posix_acl_use_stored_uid_gid, __pyx_t_3) < 0) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/posix.pyx":127 * * * def getosusername(): # <<<<<<<<<<<<<< * """Return the os user name.""" * uid = os.getuid() */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_5posix_19getosusername, 0, __pyx_n_s_getosusername, NULL, __pyx_n_s_borg_platform_posix, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_getosusername, __pyx_t_3) < 0) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/posix.pyx":1 * import errno # <<<<<<<<<<<<<< * import os * import grp */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init borg.platform.posix", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init borg.platform.posix"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__2); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* PyIntCompare */ static CYTHON_INLINE int __Pyx_PyInt_BoolNeObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_UNUSED_VAR(inplace); if (op1 == op2) { return 0; } #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); return (a != b); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { int unequal; unsigned long uintval; Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); const digit* digits = __Pyx_PyLong_Digits(op1); if (intval == 0) { return (__Pyx_PyLong_IsZero(op1) != 1); } else if (intval < 0) { if (__Pyx_PyLong_IsNonNeg(op1)) return 1; intval = -intval; } else { if (__Pyx_PyLong_IsNeg(op1)) return 1; } uintval = (unsigned long) intval; #if PyLong_SHIFT * 4 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 4)) { unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif #if PyLong_SHIFT * 3 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 3)) { unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif #if PyLong_SHIFT * 2 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 2)) { unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif #if PyLong_SHIFT * 1 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 1)) { unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); return (unequal != 0); } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif return ((double)a != (double)b); } return __Pyx_PyObject_IsTrueAndDecref( PyObject_RichCompare(op1, op2, Py_NE)); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* GetTopmostException */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) { _PyErr_StackItem *exc_info = tstate->exc_info; while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && exc_info->previous_item != NULL) { exc_info = exc_info->previous_item; } return exc_info; } #endif /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); PyObject *exc_value = exc_info->exc_value; if (exc_value == NULL || exc_value == Py_None) { *value = NULL; *type = NULL; *tb = NULL; } else { *value = exc_value; Py_INCREF(*value); *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); *tb = PyException_GetTraceback(exc_value); } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); *type = exc_info->exc_type; *value = exc_info->exc_value; *tb = exc_info->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #else *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #endif } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; PyObject *tmp_value = exc_info->exc_value; exc_info->exc_value = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = type; exc_info->exc_value = value; exc_info->exc_traceback = tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } #endif /* GetException */ #if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) #endif { PyObject *local_type = NULL, *local_value, *local_tb = NULL; #if CYTHON_FAST_THREAD_STATE PyObject *tmp_type, *tmp_value, *tmp_tb; #if PY_VERSION_HEX >= 0x030C00A6 local_value = tstate->current_exception; tstate->current_exception = 0; if (likely(local_value)) { local_type = (PyObject*) Py_TYPE(local_value); Py_INCREF(local_type); local_tb = PyException_GetTraceback(local_value); } #else local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 if (unlikely(tstate->current_exception)) #elif CYTHON_FAST_THREAD_STATE if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE #if CYTHON_USE_EXC_INFO_STACK { _PyErr_StackItem *exc_info = tstate->exc_info; #if PY_VERSION_HEX >= 0x030B00a4 tmp_value = exc_info->exc_value; exc_info->exc_value = local_value; tmp_type = NULL; tmp_tb = NULL; Py_XDECREF(local_type); Py_XDECREF(local_tb); #else tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = local_type; exc_info->exc_value = local_value; exc_info->exc_traceback = local_tb; #endif } #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } /* SwapException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; tmp_value = exc_info->exc_value; exc_info->exc_value = *value; if (tmp_value == NULL || tmp_value == Py_None) { Py_XDECREF(tmp_value); tmp_value = NULL; tmp_type = NULL; tmp_tb = NULL; } else { tmp_type = (PyObject*) Py_TYPE(tmp_value); Py_INCREF(tmp_type); #if CYTHON_COMPILING_IN_CPYTHON tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback; Py_XINCREF(tmp_tb); #else tmp_tb = PyException_GetTraceback(tmp_value); #endif } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = *type; exc_info->exc_value = *value; exc_info->exc_traceback = *tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = *type; tstate->exc_value = *value; tstate->exc_traceback = *tb; #endif *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); PyErr_SetExcInfo(*type, *value, *tb); *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #endif /* PyObjectCall2Args */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args[3] = {NULL, arg1, arg2}; return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP __Pyx_TypeName type_name; PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) #elif PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (likely(descr != NULL)) { *method = descr; return 0; } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(name)); #endif __Pyx_DECREF_TypeName(type_name); return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod1 */ #if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2) static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); Py_DECREF(method); return result; } #endif static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { #if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2 PyObject *args[2] = {obj, arg}; (void) __Pyx_PyObject_GetMethod; (void) __Pyx_PyObject_CallOneArg; (void) __Pyx_PyObject_Call2Args; return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); #else PyObject *method = NULL, *result; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_Call2Args(method, obj, arg); Py_DECREF(method); return result; } if (unlikely(!method)) return NULL; return __Pyx__PyObject_CallMethod1(method, arg); #endif } /* StringJoin */ static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) { (void) __Pyx_PyObject_CallMethod1; #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION < 3 return _PyString_Join(sep, values); #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 return _PyBytes_Join(sep, values); #else return __Pyx_PyObject_CallMethod1(sep, __pyx_n_s_join, values); #endif } /* GetItemInt */ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (unlikely(!j)) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_subscript) { PyObject *r, *key = PyInt_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); return r; } if (likely(sm && sm->sq_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return sm->sq_item(o, i); } } #else if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s__5; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__26); } return name; } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (long) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (long) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = __Pyx_NewRef(v); } val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (int) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (int) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = __Pyx_NewRef(v); } val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/platform/posix.pyx0000644000076500000240000000675614641074756017514 0ustar00twstaffimport errno import os import grp import pwd from functools import lru_cache from libc.errno cimport errno as c_errno from cpython.mem cimport PyMem_Free from libc.stddef cimport wchar_t cdef extern from "wchar.h": # https://www.man7.org/linux/man-pages/man3/wcswidth.3.html cdef int wcswidth(const wchar_t *s, size_t n) cdef extern from "Python.h": # https://docs.python.org/3/c-api/unicode.html#c.PyUnicode_AsWideCharString wchar_t* PyUnicode_AsWideCharString(object, Py_ssize_t*) except NULL def get_errno(): return c_errno def swidth(s): cdef Py_ssize_t size cdef wchar_t *as_wchar = PyUnicode_AsWideCharString(s, &size) terminal_width = wcswidth(as_wchar, size) PyMem_Free(as_wchar) if terminal_width >= 0: return terminal_width else: return len(s) def process_alive(host, pid, thread): """ Check if the (host, pid, thread_id) combination corresponds to a potentially alive process. If the process is local, then this will be accurate. If the process is not local, then this returns always True, since there is no real way to check. """ from . import local_pid_alive from . import hostid assert isinstance(host, str) assert isinstance(hostid, str) assert isinstance(pid, int) assert isinstance(thread, int) if host != hostid: return True if thread != 0: # Currently thread is always 0, if we ever decide to set this to a non-zero value, # this code needs to be revisited, too, to do a sensible thing return True return local_pid_alive(pid) def local_pid_alive(pid): """Return whether *pid* is alive.""" try: # This doesn't work on Windows. # This does not kill anything, 0 means "see if we can send a signal to this process or not". # Possible errors: No such process (== stale lock) or permission denied (not a stale lock). # If the exception is not raised that means such a pid is valid and we can send a signal to it. os.kill(pid, 0) return True except OSError as err: if err.errno == errno.ESRCH: # ESRCH = no such process return False # Any other error (eg. permissions) means that the process ID refers to a live process. return True @lru_cache(maxsize=None) def uid2user(uid, default=None): try: return pwd.getpwuid(uid).pw_name except KeyError: return default @lru_cache(maxsize=None) def user2uid(user, default=None): try: return user and pwd.getpwnam(user).pw_uid except KeyError: return default @lru_cache(maxsize=None) def gid2group(gid, default=None): try: return grp.getgrgid(gid).gr_name except KeyError: return default @lru_cache(maxsize=None) def group2gid(group, default=None): try: return group and grp.getgrnam(group).gr_gid except KeyError: return default def posix_acl_use_stored_uid_gid(acl): """Replace the user/group field with the stored uid/gid """ from ..helpers import safe_decode, safe_encode entries = [] for entry in safe_decode(acl).split('\n'): if entry: fields = entry.split(':') if len(fields) == 4: entries.append(':'.join([fields[0], fields[3], fields[2]])) else: entries.append(entry) return safe_encode('\n'.join(entries)) def getosusername(): """Return the os user name.""" uid = os.getuid() return uid2user(uid, uid) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719958149.0 borgbackup-1.4.0/src/borg/platform/syncfilerange.c0000644000076500000240000046326514641075205020575 0ustar00twstaff/* Generated by Cython 3.0.10 */ /* BEGIN: Cython Metadata { "distutils": { "depends": [], "extra_compile_args": [ "-Wall", "-Wextra", "-Wpointer-arith" ], "name": "borg.platform.syncfilerange", "sources": [ "src/borg/platform/syncfilerange.pyx" ] }, "module_name": "borg.platform.syncfilerange" } END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_10" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x03000AF0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 1 #endif #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #if PY_VERSION_HEX >= 0x030d00A4 # define __Pyx_PyCFunctionFast PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords #else # define __Pyx_PyCFunctionFast _PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__borg__platform__syncfilerange #define __PYX_HAVE_API__borg__platform__syncfilerange /* Early includes */ #include #include "fcntl.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/borg/platform/syncfilerange.pyx", }; /* #### Code section: utility_code_proto_before_types ### */ /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "libc.stdint" */ /* Module declarations from "borg.platform.syncfilerange" */ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "borg.platform.syncfilerange" extern int __pyx_module_is_main_borg__platform__syncfilerange; int __pyx_module_is_main_borg__platform__syncfilerange = 0; /* Implementation of "borg.platform.syncfilerange" */ /* #### Code section: global_var ### */ /* #### Code section: string_decls ### */ static const char __pyx_k_[] = "?"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; /* #### Code section: decls ### */ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyObject *__pyx_n_s_; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_test; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_n_s_); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_test); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_n_s_); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_test); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_n_s_ __pyx_mstate_global->__pyx_n_s_ #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test /* #### Code section: module_code ### */ static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { return 0; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); __Pyx_RefNannyFinishContext(); return 0; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_syncfilerange(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_syncfilerange}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "syncfilerange", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initsyncfilerange(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initsyncfilerange(void) #else __Pyx_PyMODINIT_FUNC PyInit_syncfilerange(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_syncfilerange(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_syncfilerange(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'syncfilerange' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("syncfilerange", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "syncfilerange" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_syncfilerange(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_borg__platform__syncfilerange) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "borg.platform.syncfilerange")) { if (unlikely((PyDict_SetItemString(modules, "borg.platform.syncfilerange", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); (void)__Pyx_modinit_type_init_code(); (void)__Pyx_modinit_type_import_code(); (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "borg/platform/syncfilerange.pyx":1 * from libc.stdint cimport int64_t # <<<<<<<<<<<<<< * * */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init borg.platform.syncfilerange", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init borg.platform.syncfilerange"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s_); } return name; } #endif /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (long) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (long) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = __Pyx_NewRef(v); } val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (int) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (int) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = __Pyx_NewRef(v); } val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/platform/syncfilerange.pyx0000644000076500000240000000111314641074756021161 0ustar00twstafffrom libc.stdint cimport int64_t # Some Linux systems (like Termux on Android 7 or earlier) do not have access # to sync_file_range. By isolating the access to sync_file_range in this # separate extension, it can be imported dynamically from linux.pyx only when # available and systems without support can otherwise use the rest of # linux.pyx. cdef extern from "fcntl.h": int sync_file_range(int fd, int64_t offset, int64_t nbytes, unsigned int flags) unsigned int SYNC_FILE_RANGE_WRITE unsigned int SYNC_FILE_RANGE_WAIT_BEFORE unsigned int SYNC_FILE_RANGE_WAIT_AFTER ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719958059.0 borgbackup-1.4.0/src/borg/platform/windows.c0000644000076500000240000125015014641075053017423 0ustar00twstaff/* Generated by Cython 3.0.10 */ /* BEGIN: Cython Metadata { "distutils": { "depends": [], "extra_compile_args": [ "-Wall", "-Wextra", "-Wpointer-arith" ], "name": "borg.platform.windows", "sources": [ "src/borg/platform/windows.pyx" ] }, "module_name": "borg.platform.windows" } END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_10" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x03000AF0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 1 #endif #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #if PY_VERSION_HEX >= 0x030d00A4 # define __Pyx_PyCFunctionFast PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords #else # define __Pyx_PyCFunctionFast _PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__borg__platform__windows #define __PYX_HAVE_API__borg__platform__windows /* Early includes */ #include "windows.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "src/borg/platform/windows.pyx", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE DWORD __Pyx_PyInt_As_DWORD(PyObject *); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "borg.platform.windows" */ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "borg.platform.windows" extern int __pyx_module_is_main_borg__platform__windows; int __pyx_module_is_main_borg__platform__windows = 0; /* Implementation of "borg.platform.windows" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_NotImplementedError; /* #### Code section: string_decls ### */ static const char __pyx_k_[] = "@"; static const char __pyx_k__2[] = "*"; static const char __pyx_k__3[] = "."; static const char __pyx_k_os[] = "os"; static const char __pyx_k__18[] = "?"; static const char __pyx_k_gid[] = "gid"; static const char __pyx_k_pid[] = "pid"; static const char __pyx_k_uid[] = "uid"; static const char __pyx_k_host[] = "host"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_node[] = "node"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_user[] = "user"; static const char __pyx_k_group[] = "group"; static const char __pyx_k_lower[] = "lower"; static const char __pyx_k_split[] = "split"; static const char __pyx_k_handle[] = "handle"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_thread[] = "thread"; static const char __pyx_k_default[] = "default"; static const char __pyx_k_maxsize[] = "maxsize"; static const char __pyx_k_getlogin[] = "getlogin"; static const char __pyx_k_platform[] = "platform"; static const char __pyx_k_uid2user[] = "uid2user"; static const char __pyx_k_user2uid[] = "user2uid"; static const char __pyx_k_functools[] = "functools"; static const char __pyx_k_gid2group[] = "gid2group"; static const char __pyx_k_group2gid[] = "group2gid"; static const char __pyx_k_lru_cache[] = "lru_cache"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_getosusername[] = "getosusername"; static const char __pyx_k_process_alive[] = "process_alive"; static const char __pyx_k_local_pid_alive[] = "local_pid_alive"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_NotImplementedError[] = "NotImplementedError"; static const char __pyx_k_borg_platform_windows[] = "borg.platform.windows"; static const char __pyx_k_src_borg_platform_windows_pyx[] = "src/borg/platform/windows.pyx"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_4borg_8platform_7windows_uid2user(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_uid, PyObject *__pyx_v_default); /* proto */ static PyObject *__pyx_pf_4borg_8platform_7windows_2user2uid(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_user, PyObject *__pyx_v_default); /* proto */ static PyObject *__pyx_pf_4borg_8platform_7windows_4gid2group(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_gid, PyObject *__pyx_v_default); /* proto */ static PyObject *__pyx_pf_4borg_8platform_7windows_6group2gid(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_group, PyObject *__pyx_v_default); /* proto */ static PyObject *__pyx_pf_4borg_8platform_7windows_8getosusername(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_4borg_8platform_7windows_10process_alive(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_host, PyObject *__pyx_v_pid, CYTHON_UNUSED PyObject *__pyx_v_thread); /* proto */ static PyObject *__pyx_pf_4borg_8platform_7windows_12local_pid_alive(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_pid); /* proto */ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif PyObject *__pyx_kp_s_; PyObject *__pyx_n_s_NotImplementedError; PyObject *__pyx_n_s__18; PyObject *__pyx_n_s__2; PyObject *__pyx_kp_u__3; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_borg_platform_windows; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_default; PyObject *__pyx_n_s_functools; PyObject *__pyx_n_s_getlogin; PyObject *__pyx_n_s_getosusername; PyObject *__pyx_n_s_gid; PyObject *__pyx_n_s_gid2group; PyObject *__pyx_n_s_group; PyObject *__pyx_n_s_group2gid; PyObject *__pyx_n_s_handle; PyObject *__pyx_n_s_host; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_n_s_local_pid_alive; PyObject *__pyx_n_s_lower; PyObject *__pyx_n_s_lru_cache; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_maxsize; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_node; PyObject *__pyx_n_s_os; PyObject *__pyx_n_s_pid; PyObject *__pyx_n_s_platform; PyObject *__pyx_n_s_process_alive; PyObject *__pyx_n_s_spec; PyObject *__pyx_n_s_split; PyObject *__pyx_kp_s_src_borg_platform_windows_pyx; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_thread; PyObject *__pyx_n_s_uid; PyObject *__pyx_n_s_uid2user; PyObject *__pyx_n_s_user; PyObject *__pyx_n_s_user2uid; PyObject *__pyx_tuple__4; PyObject *__pyx_tuple__6; PyObject *__pyx_tuple__7; PyObject *__pyx_tuple__9; PyObject *__pyx_tuple__11; PyObject *__pyx_tuple__14; PyObject *__pyx_tuple__16; PyObject *__pyx_codeobj__5; PyObject *__pyx_codeobj__8; PyObject *__pyx_codeobj__10; PyObject *__pyx_codeobj__12; PyObject *__pyx_codeobj__13; PyObject *__pyx_codeobj__15; PyObject *__pyx_codeobj__17; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_kp_s_); Py_CLEAR(clear_module_state->__pyx_n_s_NotImplementedError); Py_CLEAR(clear_module_state->__pyx_n_s__18); Py_CLEAR(clear_module_state->__pyx_n_s__2); Py_CLEAR(clear_module_state->__pyx_kp_u__3); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_borg_platform_windows); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_default); Py_CLEAR(clear_module_state->__pyx_n_s_functools); Py_CLEAR(clear_module_state->__pyx_n_s_getlogin); Py_CLEAR(clear_module_state->__pyx_n_s_getosusername); Py_CLEAR(clear_module_state->__pyx_n_s_gid); Py_CLEAR(clear_module_state->__pyx_n_s_gid2group); Py_CLEAR(clear_module_state->__pyx_n_s_group); Py_CLEAR(clear_module_state->__pyx_n_s_group2gid); Py_CLEAR(clear_module_state->__pyx_n_s_handle); Py_CLEAR(clear_module_state->__pyx_n_s_host); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_n_s_local_pid_alive); Py_CLEAR(clear_module_state->__pyx_n_s_lower); Py_CLEAR(clear_module_state->__pyx_n_s_lru_cache); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_maxsize); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_node); Py_CLEAR(clear_module_state->__pyx_n_s_os); Py_CLEAR(clear_module_state->__pyx_n_s_pid); Py_CLEAR(clear_module_state->__pyx_n_s_platform); Py_CLEAR(clear_module_state->__pyx_n_s_process_alive); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_n_s_split); Py_CLEAR(clear_module_state->__pyx_kp_s_src_borg_platform_windows_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_thread); Py_CLEAR(clear_module_state->__pyx_n_s_uid); Py_CLEAR(clear_module_state->__pyx_n_s_uid2user); Py_CLEAR(clear_module_state->__pyx_n_s_user); Py_CLEAR(clear_module_state->__pyx_n_s_user2uid); Py_CLEAR(clear_module_state->__pyx_tuple__4); Py_CLEAR(clear_module_state->__pyx_tuple__6); Py_CLEAR(clear_module_state->__pyx_tuple__7); Py_CLEAR(clear_module_state->__pyx_tuple__9); Py_CLEAR(clear_module_state->__pyx_tuple__11); Py_CLEAR(clear_module_state->__pyx_tuple__14); Py_CLEAR(clear_module_state->__pyx_tuple__16); Py_CLEAR(clear_module_state->__pyx_codeobj__5); Py_CLEAR(clear_module_state->__pyx_codeobj__8); Py_CLEAR(clear_module_state->__pyx_codeobj__10); Py_CLEAR(clear_module_state->__pyx_codeobj__12); Py_CLEAR(clear_module_state->__pyx_codeobj__13); Py_CLEAR(clear_module_state->__pyx_codeobj__15); Py_CLEAR(clear_module_state->__pyx_codeobj__17); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_kp_s_); Py_VISIT(traverse_module_state->__pyx_n_s_NotImplementedError); Py_VISIT(traverse_module_state->__pyx_n_s__18); Py_VISIT(traverse_module_state->__pyx_n_s__2); Py_VISIT(traverse_module_state->__pyx_kp_u__3); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_borg_platform_windows); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_default); Py_VISIT(traverse_module_state->__pyx_n_s_functools); Py_VISIT(traverse_module_state->__pyx_n_s_getlogin); Py_VISIT(traverse_module_state->__pyx_n_s_getosusername); Py_VISIT(traverse_module_state->__pyx_n_s_gid); Py_VISIT(traverse_module_state->__pyx_n_s_gid2group); Py_VISIT(traverse_module_state->__pyx_n_s_group); Py_VISIT(traverse_module_state->__pyx_n_s_group2gid); Py_VISIT(traverse_module_state->__pyx_n_s_handle); Py_VISIT(traverse_module_state->__pyx_n_s_host); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_n_s_local_pid_alive); Py_VISIT(traverse_module_state->__pyx_n_s_lower); Py_VISIT(traverse_module_state->__pyx_n_s_lru_cache); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_maxsize); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_node); Py_VISIT(traverse_module_state->__pyx_n_s_os); Py_VISIT(traverse_module_state->__pyx_n_s_pid); Py_VISIT(traverse_module_state->__pyx_n_s_platform); Py_VISIT(traverse_module_state->__pyx_n_s_process_alive); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_n_s_split); Py_VISIT(traverse_module_state->__pyx_kp_s_src_borg_platform_windows_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_thread); Py_VISIT(traverse_module_state->__pyx_n_s_uid); Py_VISIT(traverse_module_state->__pyx_n_s_uid2user); Py_VISIT(traverse_module_state->__pyx_n_s_user); Py_VISIT(traverse_module_state->__pyx_n_s_user2uid); Py_VISIT(traverse_module_state->__pyx_tuple__4); Py_VISIT(traverse_module_state->__pyx_tuple__6); Py_VISIT(traverse_module_state->__pyx_tuple__7); Py_VISIT(traverse_module_state->__pyx_tuple__9); Py_VISIT(traverse_module_state->__pyx_tuple__11); Py_VISIT(traverse_module_state->__pyx_tuple__14); Py_VISIT(traverse_module_state->__pyx_tuple__16); Py_VISIT(traverse_module_state->__pyx_codeobj__5); Py_VISIT(traverse_module_state->__pyx_codeobj__8); Py_VISIT(traverse_module_state->__pyx_codeobj__10); Py_VISIT(traverse_module_state->__pyx_codeobj__12); Py_VISIT(traverse_module_state->__pyx_codeobj__13); Py_VISIT(traverse_module_state->__pyx_codeobj__15); Py_VISIT(traverse_module_state->__pyx_codeobj__17); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_kp_s_ __pyx_mstate_global->__pyx_kp_s_ #define __pyx_n_s_NotImplementedError __pyx_mstate_global->__pyx_n_s_NotImplementedError #define __pyx_n_s__18 __pyx_mstate_global->__pyx_n_s__18 #define __pyx_n_s__2 __pyx_mstate_global->__pyx_n_s__2 #define __pyx_kp_u__3 __pyx_mstate_global->__pyx_kp_u__3 #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_borg_platform_windows __pyx_mstate_global->__pyx_n_s_borg_platform_windows #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_default __pyx_mstate_global->__pyx_n_s_default #define __pyx_n_s_functools __pyx_mstate_global->__pyx_n_s_functools #define __pyx_n_s_getlogin __pyx_mstate_global->__pyx_n_s_getlogin #define __pyx_n_s_getosusername __pyx_mstate_global->__pyx_n_s_getosusername #define __pyx_n_s_gid __pyx_mstate_global->__pyx_n_s_gid #define __pyx_n_s_gid2group __pyx_mstate_global->__pyx_n_s_gid2group #define __pyx_n_s_group __pyx_mstate_global->__pyx_n_s_group #define __pyx_n_s_group2gid __pyx_mstate_global->__pyx_n_s_group2gid #define __pyx_n_s_handle __pyx_mstate_global->__pyx_n_s_handle #define __pyx_n_s_host __pyx_mstate_global->__pyx_n_s_host #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_n_s_local_pid_alive __pyx_mstate_global->__pyx_n_s_local_pid_alive #define __pyx_n_s_lower __pyx_mstate_global->__pyx_n_s_lower #define __pyx_n_s_lru_cache __pyx_mstate_global->__pyx_n_s_lru_cache #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_maxsize __pyx_mstate_global->__pyx_n_s_maxsize #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_node __pyx_mstate_global->__pyx_n_s_node #define __pyx_n_s_os __pyx_mstate_global->__pyx_n_s_os #define __pyx_n_s_pid __pyx_mstate_global->__pyx_n_s_pid #define __pyx_n_s_platform __pyx_mstate_global->__pyx_n_s_platform #define __pyx_n_s_process_alive __pyx_mstate_global->__pyx_n_s_process_alive #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_n_s_split __pyx_mstate_global->__pyx_n_s_split #define __pyx_kp_s_src_borg_platform_windows_pyx __pyx_mstate_global->__pyx_kp_s_src_borg_platform_windows_pyx #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_thread __pyx_mstate_global->__pyx_n_s_thread #define __pyx_n_s_uid __pyx_mstate_global->__pyx_n_s_uid #define __pyx_n_s_uid2user __pyx_mstate_global->__pyx_n_s_uid2user #define __pyx_n_s_user __pyx_mstate_global->__pyx_n_s_user #define __pyx_n_s_user2uid __pyx_mstate_global->__pyx_n_s_user2uid #define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 #define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6 #define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 #define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9 #define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11 #define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 #define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16 #define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 #define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8 #define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10 #define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 #define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 #define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 /* #### Code section: module_code ### */ /* "borg/platform/windows.pyx":17 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def uid2user(uid, default=None): * return default */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_7windows_1uid2user(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8platform_7windows_1uid2user = {"uid2user", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_7windows_1uid2user, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8platform_7windows_1uid2user(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_uid = 0; PyObject *__pyx_v_default = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("uid2user (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_uid,&__pyx_n_s_default,0}; /* "borg/platform/windows.pyx":18 * * @lru_cache(maxsize=None) * def uid2user(uid, default=None): # <<<<<<<<<<<<<< * return default * */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_uid)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 17, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_default); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 17, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "uid2user") < 0)) __PYX_ERR(0, 17, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_uid = values[0]; __pyx_v_default = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("uid2user", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 17, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.windows.uid2user", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_7windows_uid2user(__pyx_self, __pyx_v_uid, __pyx_v_default); /* "borg/platform/windows.pyx":17 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def uid2user(uid, default=None): * return default */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8platform_7windows_uid2user(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_uid, PyObject *__pyx_v_default) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("uid2user", 1); /* "borg/platform/windows.pyx":19 * @lru_cache(maxsize=None) * def uid2user(uid, default=None): * return default # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_default); __pyx_r = __pyx_v_default; goto __pyx_L0; /* "borg/platform/windows.pyx":17 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def uid2user(uid, default=None): * return default */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/windows.pyx":22 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def user2uid(user, default=None): * return default */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_7windows_3user2uid(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8platform_7windows_3user2uid = {"user2uid", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_7windows_3user2uid, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8platform_7windows_3user2uid(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_user = 0; PyObject *__pyx_v_default = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("user2uid (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_user,&__pyx_n_s_default,0}; /* "borg/platform/windows.pyx":23 * * @lru_cache(maxsize=None) * def user2uid(user, default=None): # <<<<<<<<<<<<<< * return default * */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_user)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 22, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_default); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 22, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "user2uid") < 0)) __PYX_ERR(0, 22, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_user = values[0]; __pyx_v_default = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("user2uid", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 22, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.windows.user2uid", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_7windows_2user2uid(__pyx_self, __pyx_v_user, __pyx_v_default); /* "borg/platform/windows.pyx":22 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def user2uid(user, default=None): * return default */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8platform_7windows_2user2uid(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_user, PyObject *__pyx_v_default) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("user2uid", 1); /* "borg/platform/windows.pyx":24 * @lru_cache(maxsize=None) * def user2uid(user, default=None): * return default # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_default); __pyx_r = __pyx_v_default; goto __pyx_L0; /* "borg/platform/windows.pyx":22 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def user2uid(user, default=None): * return default */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/windows.pyx":27 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def gid2group(gid, default=None): * return default */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_7windows_5gid2group(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8platform_7windows_5gid2group = {"gid2group", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_7windows_5gid2group, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8platform_7windows_5gid2group(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_gid = 0; PyObject *__pyx_v_default = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gid2group (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gid,&__pyx_n_s_default,0}; /* "borg/platform/windows.pyx":28 * * @lru_cache(maxsize=None) * def gid2group(gid, default=None): # <<<<<<<<<<<<<< * return default * */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gid)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 27, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_default); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 27, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "gid2group") < 0)) __PYX_ERR(0, 27, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_gid = values[0]; __pyx_v_default = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("gid2group", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 27, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.windows.gid2group", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_7windows_4gid2group(__pyx_self, __pyx_v_gid, __pyx_v_default); /* "borg/platform/windows.pyx":27 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def gid2group(gid, default=None): * return default */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8platform_7windows_4gid2group(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_gid, PyObject *__pyx_v_default) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gid2group", 1); /* "borg/platform/windows.pyx":29 * @lru_cache(maxsize=None) * def gid2group(gid, default=None): * return default # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_default); __pyx_r = __pyx_v_default; goto __pyx_L0; /* "borg/platform/windows.pyx":27 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def gid2group(gid, default=None): * return default */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/windows.pyx":32 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def group2gid(group, default=None): * return default */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_7windows_7group2gid(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4borg_8platform_7windows_7group2gid = {"group2gid", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_7windows_7group2gid, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4borg_8platform_7windows_7group2gid(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_group = 0; PyObject *__pyx_v_default = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("group2gid (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_group,&__pyx_n_s_default,0}; /* "borg/platform/windows.pyx":33 * * @lru_cache(maxsize=None) * def group2gid(group, default=None): # <<<<<<<<<<<<<< * return default * */ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_group)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_default); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "group2gid") < 0)) __PYX_ERR(0, 32, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_group = values[0]; __pyx_v_default = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("group2gid", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 32, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.windows.group2gid", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_7windows_6group2gid(__pyx_self, __pyx_v_group, __pyx_v_default); /* "borg/platform/windows.pyx":32 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def group2gid(group, default=None): * return default */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8platform_7windows_6group2gid(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_group, PyObject *__pyx_v_default) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("group2gid", 1); /* "borg/platform/windows.pyx":34 * @lru_cache(maxsize=None) * def group2gid(group, default=None): * return default # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_default); __pyx_r = __pyx_v_default; goto __pyx_L0; /* "borg/platform/windows.pyx":32 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def group2gid(group, default=None): * return default */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/windows.pyx":37 * * * def getosusername(): # <<<<<<<<<<<<<< * """Return the os user name.""" * return os.getlogin() */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_7windows_9getosusername(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_8platform_7windows_8getosusername, "Return the os user name."); static PyMethodDef __pyx_mdef_4borg_8platform_7windows_9getosusername = {"getosusername", (PyCFunction)__pyx_pw_4borg_8platform_7windows_9getosusername, METH_NOARGS, __pyx_doc_4borg_8platform_7windows_8getosusername}; static PyObject *__pyx_pw_4borg_8platform_7windows_9getosusername(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getosusername (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_4borg_8platform_7windows_8getosusername(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8platform_7windows_8getosusername(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getosusername", 1); /* "borg/platform/windows.pyx":39 * def getosusername(): * """Return the os user name.""" * return os.getlogin() # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_getlogin); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "borg/platform/windows.pyx":37 * * * def getosusername(): # <<<<<<<<<<<<<< * """Return the os user name.""" * return os.getlogin() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("borg.platform.windows.getosusername", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/windows.pyx":42 * * * def process_alive(host, pid, thread): # <<<<<<<<<<<<<< * """ * Check if the (host, pid, thread_id) combination corresponds to a potentially alive process. */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_7windows_11process_alive(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_8platform_7windows_10process_alive, "\n Check if the (host, pid, thread_id) combination corresponds to a potentially alive process.\n "); static PyMethodDef __pyx_mdef_4borg_8platform_7windows_11process_alive = {"process_alive", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_7windows_11process_alive, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_8platform_7windows_10process_alive}; static PyObject *__pyx_pw_4borg_8platform_7windows_11process_alive(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_host = 0; PyObject *__pyx_v_pid = 0; CYTHON_UNUSED PyObject *__pyx_v_thread = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("process_alive (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_host,&__pyx_n_s_pid,&__pyx_n_s_thread,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_host)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 42, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pid)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 42, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("process_alive", 1, 3, 3, 1); __PYX_ERR(0, 42, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_thread)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 42, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("process_alive", 1, 3, 3, 2); __PYX_ERR(0, 42, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "process_alive") < 0)) __PYX_ERR(0, 42, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_host = values[0]; __pyx_v_pid = values[1]; __pyx_v_thread = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("process_alive", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 42, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.windows.process_alive", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_7windows_10process_alive(__pyx_self, __pyx_v_host, __pyx_v_pid, __pyx_v_thread); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8platform_7windows_10process_alive(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_host, PyObject *__pyx_v_pid, CYTHON_UNUSED PyObject *__pyx_v_thread) { HANDLE __pyx_v_handle; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; DWORD __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("process_alive", 1); /* "borg/platform/windows.pyx":46 * Check if the (host, pid, thread_id) combination corresponds to a potentially alive process. * """ * if host.split('@')[0].lower() != platform.node().lower(): # <<<<<<<<<<<<<< * # Not running on the same node, assume running. * return True */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_host, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_platform); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_node); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_lower); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_7) { /* "borg/platform/windows.pyx":48 * if host.split('@')[0].lower() != platform.node().lower(): * # Not running on the same node, assume running. * return True # <<<<<<<<<<<<<< * * # If the process can be opened, the process is alive. */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "borg/platform/windows.pyx":46 * Check if the (host, pid, thread_id) combination corresponds to a potentially alive process. * """ * if host.split('@')[0].lower() != platform.node().lower(): # <<<<<<<<<<<<<< * # Not running on the same node, assume running. * return True */ } /* "borg/platform/windows.pyx":51 * * # If the process can be opened, the process is alive. * handle = OpenProcess(PROCESS_QUERY_INFORMATION, False, pid) # <<<<<<<<<<<<<< * if handle != NULL: * CloseHandle(handle) */ __pyx_t_8 = __Pyx_PyInt_As_DWORD(__pyx_v_pid); if (unlikely((__pyx_t_8 == ((DWORD)-1)) && PyErr_Occurred())) __PYX_ERR(0, 51, __pyx_L1_error) __pyx_v_handle = OpenProcess(PROCESS_QUERY_INFORMATION, 0, __pyx_t_8); /* "borg/platform/windows.pyx":52 * # If the process can be opened, the process is alive. * handle = OpenProcess(PROCESS_QUERY_INFORMATION, False, pid) * if handle != NULL: # <<<<<<<<<<<<<< * CloseHandle(handle) * return True */ __pyx_t_7 = (__pyx_v_handle != NULL); if (__pyx_t_7) { /* "borg/platform/windows.pyx":53 * handle = OpenProcess(PROCESS_QUERY_INFORMATION, False, pid) * if handle != NULL: * CloseHandle(handle) # <<<<<<<<<<<<<< * return True * return False */ (void)(CloseHandle(__pyx_v_handle)); /* "borg/platform/windows.pyx":54 * if handle != NULL: * CloseHandle(handle) * return True # <<<<<<<<<<<<<< * return False * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "borg/platform/windows.pyx":52 * # If the process can be opened, the process is alive. * handle = OpenProcess(PROCESS_QUERY_INFORMATION, False, pid) * if handle != NULL: # <<<<<<<<<<<<<< * CloseHandle(handle) * return True */ } /* "borg/platform/windows.pyx":55 * CloseHandle(handle) * return True * return False # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "borg/platform/windows.pyx":42 * * * def process_alive(host, pid, thread): # <<<<<<<<<<<<<< * """ * Check if the (host, pid, thread_id) combination corresponds to a potentially alive process. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("borg.platform.windows.process_alive", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "borg/platform/windows.pyx":58 * * * def local_pid_alive(pid): # <<<<<<<<<<<<<< * """Return whether *pid* is alive.""" * raise NotImplementedError */ /* Python wrapper */ static PyObject *__pyx_pw_4borg_8platform_7windows_13local_pid_alive(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4borg_8platform_7windows_12local_pid_alive, "Return whether *pid* is alive."); static PyMethodDef __pyx_mdef_4borg_8platform_7windows_13local_pid_alive = {"local_pid_alive", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4borg_8platform_7windows_13local_pid_alive, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4borg_8platform_7windows_12local_pid_alive}; static PyObject *__pyx_pw_4borg_8platform_7windows_13local_pid_alive(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_pid = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("local_pid_alive (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pid,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pid)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 58, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "local_pid_alive") < 0)) __PYX_ERR(0, 58, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_pid = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("local_pid_alive", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 58, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("borg.platform.windows.local_pid_alive", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4borg_8platform_7windows_12local_pid_alive(__pyx_self, __pyx_v_pid); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4borg_8platform_7windows_12local_pid_alive(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_pid) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("local_pid_alive", 1); /* "borg/platform/windows.pyx":60 * def local_pid_alive(pid): * """Return whether *pid* is alive.""" * raise NotImplementedError # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(0, 60, __pyx_L1_error) /* "borg/platform/windows.pyx":58 * * * def local_pid_alive(pid): # <<<<<<<<<<<<<< * """Return whether *pid* is alive.""" * raise NotImplementedError */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("borg.platform.windows.local_pid_alive", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 0}, {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1}, {&__pyx_n_s__18, __pyx_k__18, sizeof(__pyx_k__18), 0, 0, 1, 1}, {&__pyx_n_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 1}, {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_borg_platform_windows, __pyx_k_borg_platform_windows, sizeof(__pyx_k_borg_platform_windows), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1}, {&__pyx_n_s_functools, __pyx_k_functools, sizeof(__pyx_k_functools), 0, 0, 1, 1}, {&__pyx_n_s_getlogin, __pyx_k_getlogin, sizeof(__pyx_k_getlogin), 0, 0, 1, 1}, {&__pyx_n_s_getosusername, __pyx_k_getosusername, sizeof(__pyx_k_getosusername), 0, 0, 1, 1}, {&__pyx_n_s_gid, __pyx_k_gid, sizeof(__pyx_k_gid), 0, 0, 1, 1}, {&__pyx_n_s_gid2group, __pyx_k_gid2group, sizeof(__pyx_k_gid2group), 0, 0, 1, 1}, {&__pyx_n_s_group, __pyx_k_group, sizeof(__pyx_k_group), 0, 0, 1, 1}, {&__pyx_n_s_group2gid, __pyx_k_group2gid, sizeof(__pyx_k_group2gid), 0, 0, 1, 1}, {&__pyx_n_s_handle, __pyx_k_handle, sizeof(__pyx_k_handle), 0, 0, 1, 1}, {&__pyx_n_s_host, __pyx_k_host, sizeof(__pyx_k_host), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_n_s_local_pid_alive, __pyx_k_local_pid_alive, sizeof(__pyx_k_local_pid_alive), 0, 0, 1, 1}, {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1}, {&__pyx_n_s_lru_cache, __pyx_k_lru_cache, sizeof(__pyx_k_lru_cache), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_maxsize, __pyx_k_maxsize, sizeof(__pyx_k_maxsize), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_node, __pyx_k_node, sizeof(__pyx_k_node), 0, 0, 1, 1}, {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, {&__pyx_n_s_pid, __pyx_k_pid, sizeof(__pyx_k_pid), 0, 0, 1, 1}, {&__pyx_n_s_platform, __pyx_k_platform, sizeof(__pyx_k_platform), 0, 0, 1, 1}, {&__pyx_n_s_process_alive, __pyx_k_process_alive, sizeof(__pyx_k_process_alive), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1}, {&__pyx_kp_s_src_borg_platform_windows_pyx, __pyx_k_src_borg_platform_windows_pyx, sizeof(__pyx_k_src_borg_platform_windows_pyx), 0, 0, 1, 0}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_thread, __pyx_k_thread, sizeof(__pyx_k_thread), 0, 0, 1, 1}, {&__pyx_n_s_uid, __pyx_k_uid, sizeof(__pyx_k_uid), 0, 0, 1, 1}, {&__pyx_n_s_uid2user, __pyx_k_uid2user, sizeof(__pyx_k_uid2user), 0, 0, 1, 1}, {&__pyx_n_s_user, __pyx_k_user, sizeof(__pyx_k_user), 0, 0, 1, 1}, {&__pyx_n_s_user2uid, __pyx_k_user2uid, sizeof(__pyx_k_user2uid), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 60, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "borg/platform/windows.pyx":17 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def uid2user(uid, default=None): * return default */ __pyx_tuple__4 = PyTuple_Pack(2, __pyx_n_s_uid, __pyx_n_s_default); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_windows_pyx, __pyx_n_s_uid2user, 17, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 17, __pyx_L1_error) __pyx_tuple__6 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); /* "borg/platform/windows.pyx":22 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def user2uid(user, default=None): * return default */ __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_user, __pyx_n_s_default); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_windows_pyx, __pyx_n_s_user2uid, 22, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 22, __pyx_L1_error) /* "borg/platform/windows.pyx":27 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def gid2group(gid, default=None): * return default */ __pyx_tuple__9 = PyTuple_Pack(2, __pyx_n_s_gid, __pyx_n_s_default); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_windows_pyx, __pyx_n_s_gid2group, 27, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 27, __pyx_L1_error) /* "borg/platform/windows.pyx":32 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def group2gid(group, default=None): * return default */ __pyx_tuple__11 = PyTuple_Pack(2, __pyx_n_s_group, __pyx_n_s_default); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_windows_pyx, __pyx_n_s_group2gid, 32, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 32, __pyx_L1_error) /* "borg/platform/windows.pyx":37 * * * def getosusername(): # <<<<<<<<<<<<<< * """Return the os user name.""" * return os.getlogin() */ __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_windows_pyx, __pyx_n_s_getosusername, 37, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 37, __pyx_L1_error) /* "borg/platform/windows.pyx":42 * * * def process_alive(host, pid, thread): # <<<<<<<<<<<<<< * """ * Check if the (host, pid, thread_id) combination corresponds to a potentially alive process. */ __pyx_tuple__14 = PyTuple_Pack(4, __pyx_n_s_host, __pyx_n_s_pid, __pyx_n_s_thread, __pyx_n_s_handle); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_windows_pyx, __pyx_n_s_process_alive, 42, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 42, __pyx_L1_error) /* "borg/platform/windows.pyx":58 * * * def local_pid_alive(pid): # <<<<<<<<<<<<<< * """Return whether *pid* is alive.""" * raise NotImplementedError */ __pyx_tuple__16 = PyTuple_Pack(1, __pyx_n_s_pid); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_platform_windows_pyx, __pyx_n_s_local_pid_alive, 58, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_windows(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_windows}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "windows", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initwindows(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initwindows(void) #else __Pyx_PyMODINIT_FUNC PyInit_windows(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_windows(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_windows(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'windows' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("windows", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "windows" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_windows(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_borg__platform__windows) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "borg.platform.windows")) { if (unlikely((PyDict_SetItemString(modules, "borg.platform.windows", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); (void)__Pyx_modinit_type_init_code(); (void)__Pyx_modinit_type_import_code(); (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "borg/platform/windows.pyx":1 * import os # <<<<<<<<<<<<<< * import platform * from functools import lru_cache */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_os, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/windows.pyx":2 * import os * import platform # <<<<<<<<<<<<<< * from functools import lru_cache * */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_platform, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_platform, __pyx_t_2) < 0) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/windows.pyx":3 * import os * import platform * from functools import lru_cache # <<<<<<<<<<<<<< * * */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_lru_cache); __Pyx_GIVEREF(__pyx_n_s_lru_cache); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_lru_cache)) __PYX_ERR(0, 3, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_functools, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_lru_cache); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_lru_cache, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/windows.pyx":17 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def uid2user(uid, default=None): * return default */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_lru_cache); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_maxsize, Py_None) < 0) __PYX_ERR(0, 17, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/windows.pyx":18 * * @lru_cache(maxsize=None) * def uid2user(uid, default=None): # <<<<<<<<<<<<<< * return default * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_7windows_1uid2user, 0, __pyx_n_s_uid2user, NULL, __pyx_n_s_borg_platform_windows, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__6); /* "borg/platform/windows.pyx":17 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def uid2user(uid, default=None): * return default */ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_uid2user, __pyx_t_3) < 0) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/windows.pyx":22 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def user2uid(user, default=None): * return default */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_lru_cache); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_maxsize, Py_None) < 0) __PYX_ERR(0, 22, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/windows.pyx":23 * * @lru_cache(maxsize=None) * def user2uid(user, default=None): # <<<<<<<<<<<<<< * return default * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_7windows_3user2uid, 0, __pyx_n_s_user2uid, NULL, __pyx_n_s_borg_platform_windows, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__6); /* "borg/platform/windows.pyx":22 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def user2uid(user, default=None): * return default */ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_user2uid, __pyx_t_3) < 0) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/windows.pyx":27 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def gid2group(gid, default=None): * return default */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_lru_cache); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_maxsize, Py_None) < 0) __PYX_ERR(0, 27, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/windows.pyx":28 * * @lru_cache(maxsize=None) * def gid2group(gid, default=None): # <<<<<<<<<<<<<< * return default * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_7windows_5gid2group, 0, __pyx_n_s_gid2group, NULL, __pyx_n_s_borg_platform_windows, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__6); /* "borg/platform/windows.pyx":27 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def gid2group(gid, default=None): * return default */ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_gid2group, __pyx_t_3) < 0) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/windows.pyx":32 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def group2gid(group, default=None): * return default */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_lru_cache); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_maxsize, Py_None) < 0) __PYX_ERR(0, 32, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "borg/platform/windows.pyx":33 * * @lru_cache(maxsize=None) * def group2gid(group, default=None): # <<<<<<<<<<<<<< * return default * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_7windows_7group2gid, 0, __pyx_n_s_group2gid, NULL, __pyx_n_s_borg_platform_windows, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__6); /* "borg/platform/windows.pyx":32 * * * @lru_cache(maxsize=None) # <<<<<<<<<<<<<< * def group2gid(group, default=None): * return default */ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_group2gid, __pyx_t_3) < 0) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/windows.pyx":37 * * * def getosusername(): # <<<<<<<<<<<<<< * """Return the os user name.""" * return os.getlogin() */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_7windows_9getosusername, 0, __pyx_n_s_getosusername, NULL, __pyx_n_s_borg_platform_windows, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_getosusername, __pyx_t_3) < 0) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/windows.pyx":42 * * * def process_alive(host, pid, thread): # <<<<<<<<<<<<<< * """ * Check if the (host, pid, thread_id) combination corresponds to a potentially alive process. */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_7windows_11process_alive, 0, __pyx_n_s_process_alive, NULL, __pyx_n_s_borg_platform_windows, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_process_alive, __pyx_t_3) < 0) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/windows.pyx":58 * * * def local_pid_alive(pid): # <<<<<<<<<<<<<< * """Return whether *pid* is alive.""" * raise NotImplementedError */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_8platform_7windows_13local_pid_alive, 0, __pyx_n_s_local_pid_alive, NULL, __pyx_n_s_borg_platform_windows, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_local_pid_alive, __pyx_t_3) < 0) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "borg/platform/windows.pyx":1 * import os # <<<<<<<<<<<<<< * import platform * from functools import lru_cache */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init borg.platform.windows", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init borg.platform.windows"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* GetItemInt */ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (unlikely(!j)) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_subscript) { PyObject *r, *key = PyInt_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); return r; } if (likely(sm && sm->sq_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return sm->sq_item(o, i); } } #else if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s__2; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__3); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE DWORD __Pyx_PyInt_As_DWORD(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DWORD neg_one = (DWORD) -1, const_zero = (DWORD) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(DWORD) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(DWORD, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (DWORD) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(DWORD, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(DWORD) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DWORD, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DWORD) >= 2 * PyLong_SHIFT)) { return (DWORD) (((((DWORD)digits[1]) << PyLong_SHIFT) | (DWORD)digits[0])); } } break; case 3: if ((8 * sizeof(DWORD) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DWORD, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DWORD) >= 3 * PyLong_SHIFT)) { return (DWORD) (((((((DWORD)digits[2]) << PyLong_SHIFT) | (DWORD)digits[1]) << PyLong_SHIFT) | (DWORD)digits[0])); } } break; case 4: if ((8 * sizeof(DWORD) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DWORD, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DWORD) >= 4 * PyLong_SHIFT)) { return (DWORD) (((((((((DWORD)digits[3]) << PyLong_SHIFT) | (DWORD)digits[2]) << PyLong_SHIFT) | (DWORD)digits[1]) << PyLong_SHIFT) | (DWORD)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (DWORD) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(DWORD) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(DWORD, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(DWORD) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(DWORD, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(DWORD, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(DWORD) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DWORD, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DWORD) - 1 > 2 * PyLong_SHIFT)) { return (DWORD) (((DWORD)-1)*(((((DWORD)digits[1]) << PyLong_SHIFT) | (DWORD)digits[0]))); } } break; case 2: if ((8 * sizeof(DWORD) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DWORD, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DWORD) - 1 > 2 * PyLong_SHIFT)) { return (DWORD) ((((((DWORD)digits[1]) << PyLong_SHIFT) | (DWORD)digits[0]))); } } break; case -3: if ((8 * sizeof(DWORD) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DWORD, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DWORD) - 1 > 3 * PyLong_SHIFT)) { return (DWORD) (((DWORD)-1)*(((((((DWORD)digits[2]) << PyLong_SHIFT) | (DWORD)digits[1]) << PyLong_SHIFT) | (DWORD)digits[0]))); } } break; case 3: if ((8 * sizeof(DWORD) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DWORD, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DWORD) - 1 > 3 * PyLong_SHIFT)) { return (DWORD) ((((((((DWORD)digits[2]) << PyLong_SHIFT) | (DWORD)digits[1]) << PyLong_SHIFT) | (DWORD)digits[0]))); } } break; case -4: if ((8 * sizeof(DWORD) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DWORD, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DWORD) - 1 > 4 * PyLong_SHIFT)) { return (DWORD) (((DWORD)-1)*(((((((((DWORD)digits[3]) << PyLong_SHIFT) | (DWORD)digits[2]) << PyLong_SHIFT) | (DWORD)digits[1]) << PyLong_SHIFT) | (DWORD)digits[0]))); } } break; case 4: if ((8 * sizeof(DWORD) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(DWORD, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(DWORD) - 1 > 4 * PyLong_SHIFT)) { return (DWORD) ((((((((((DWORD)digits[3]) << PyLong_SHIFT) | (DWORD)digits[2]) << PyLong_SHIFT) | (DWORD)digits[1]) << PyLong_SHIFT) | (DWORD)digits[0]))); } } break; } } #endif if ((sizeof(DWORD) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(DWORD, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(DWORD) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(DWORD, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { DWORD val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (DWORD) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (DWORD) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (DWORD) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (DWORD) -1; } else { stepval = __Pyx_NewRef(v); } val = (DWORD) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(DWORD) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((DWORD) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(DWORD) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((DWORD) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((DWORD) 1) << (sizeof(DWORD) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (DWORD) -1; } } else { DWORD val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (DWORD) -1; val = __Pyx_PyInt_As_DWORD(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to DWORD"); return (DWORD) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to DWORD"); return (DWORD) -1; } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__18); } return name; } #endif /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (long) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (long) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = __Pyx_NewRef(v); } val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int ret = -1; #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; long idigit; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (unlikely(!PyLong_CheckExact(v))) { PyObject *tmp = v; v = PyNumber_Long(v); assert(PyLong_CheckExact(v)); Py_DECREF(tmp); if (unlikely(!v)) return (int) -1; } #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(x) == 0) return (int) 0; is_negative = Py_SIZE(x) < 0; #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; is_negative = result == 1; } #endif if (is_unsigned && unlikely(is_negative)) { goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = __Pyx_NewRef(v); } val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 if (Py_SIZE(stepval) == 0) goto unpacking_done; #endif } idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 unpacking_done: #endif if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif Py_DECREF(v); if (likely(!ret)) return val; } return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/platform/windows.pyx0000644000076500000240000000251214641074756020026 0ustar00twstaffimport os import platform from functools import lru_cache cdef extern from 'windows.h': ctypedef void* HANDLE ctypedef int BOOL ctypedef unsigned long DWORD BOOL CloseHandle(HANDLE hObject) HANDLE OpenProcess(DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dbProcessId) cdef extern int PROCESS_QUERY_INFORMATION @lru_cache(maxsize=None) def uid2user(uid, default=None): return default @lru_cache(maxsize=None) def user2uid(user, default=None): return default @lru_cache(maxsize=None) def gid2group(gid, default=None): return default @lru_cache(maxsize=None) def group2gid(group, default=None): return default def getosusername(): """Return the os user name.""" return os.getlogin() def process_alive(host, pid, thread): """ Check if the (host, pid, thread_id) combination corresponds to a potentially alive process. """ if host.split('@')[0].lower() != platform.node().lower(): # Not running on the same node, assume running. return True # If the process can be opened, the process is alive. handle = OpenProcess(PROCESS_QUERY_INFORMATION, False, pid) if handle != NULL: CloseHandle(handle) return True return False def local_pid_alive(pid): """Return whether *pid* is alive.""" raise NotImplementedError ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/platform/xattr.py0000644000076500000240000000551214641074756017311 0ustar00twstaffimport errno import os from ..helpers import Buffer try: ENOATTR = errno.ENOATTR except AttributeError: # on some platforms, ENOATTR is missing, use ENODATA there ENOATTR = errno.ENODATA buffer = Buffer(bytearray, limit=2**24) def split_string0(buf): """split a list of zero-terminated strings into python not-zero-terminated bytes""" if isinstance(buf, bytearray): buf = bytes(buf) # use a bytes object, so we return a list of bytes objects return buf.split(b'\0')[:-1] def split_lstring(buf): """split a list of length-prefixed strings into python not-length-prefixed bytes""" result = [] mv = memoryview(buf) while mv: length = mv[0] result.append(bytes(mv[1:1 + length])) mv = mv[1 + length:] return result class BufferTooSmallError(Exception): """the buffer given to a xattr function was too small for the result.""" def _check(rv, path=None, detect_buffer_too_small=False): from . import get_errno if rv < 0: e = get_errno() if detect_buffer_too_small and e == errno.ERANGE: # listxattr and getxattr signal with ERANGE that they need a bigger result buffer. # setxattr signals this way that e.g. a xattr key name is too long / inacceptable. raise BufferTooSmallError else: try: msg = os.strerror(e) except ValueError: msg = '' if isinstance(path, int): path = '' % path raise OSError(e, msg, path) if detect_buffer_too_small and rv >= len(buffer): # freebsd does not error with ERANGE if the buffer is too small, # it just fills the buffer, truncates and returns. # so, we play safe and just assume that result is truncated if # it happens to be a full buffer. raise BufferTooSmallError return rv def _listxattr_inner(func, path): assert isinstance(path, (bytes, int)) size = len(buffer) while True: buf = buffer.get(size) try: n = _check(func(path, buf, size), path, detect_buffer_too_small=True) except BufferTooSmallError: size *= 2 else: return n, buf def _getxattr_inner(func, path, name): assert isinstance(path, (bytes, int)) assert isinstance(name, bytes) size = len(buffer) while True: buf = buffer.get(size) try: n = _check(func(path, name, buf, size), path, detect_buffer_too_small=True) except BufferTooSmallError: size *= 2 else: return n, buf def _setxattr_inner(func, path, name, value): assert isinstance(path, (bytes, int)) assert isinstance(name, bytes) assert isinstance(value, bytes) _check(func(path, name, value, len(value)), path, detect_buffer_too_small=False) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/platformflags.py0000644000076500000240000000047014641074756017162 0ustar00twstaff""" Flags for Platform-specific APIs. Use these Flags instead of sys.platform.startswith('') or try/except. """ import sys is_win32 = sys.platform.startswith('win32') is_linux = sys.platform.startswith('linux') is_freebsd = sys.platform.startswith('freebsd') is_darwin = sys.platform.startswith('darwin') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/remote.py0000644000076500000240000016172414641074756015626 0ustar00twstaffimport errno import functools import inspect import json import logging import os import select import shlex import shutil import struct import sys import tempfile import textwrap import time import traceback from subprocess import Popen, PIPE from . import __version__ from .compress import Compressor from .constants import * # NOQA from .helpers import Error, ErrorWithTraceback, IntegrityError from .helpers import bin_to_hex from .helpers import get_base_dir from .helpers import get_limited_unpacker from .helpers import replace_placeholders from .helpers import sysinfo from .helpers import format_file_size from .helpers import safe_unlink from .helpers import prepare_subprocess_env, ignore_sigint from .locking import LockTimeout, NotLocked, NotMyLock, LockFailed from .logger import create_logger, setup_logging from .helpers import msgpack from .repository import Repository from .version import parse_version, format_version from .algorithms.checksums import xxh64 from .helpers.datastruct import EfficientCollectionQueue logger = create_logger(__name__) RPC_PROTOCOL_VERSION = 2 BORG_VERSION = parse_version(__version__) MSGID, MSG, ARGS, RESULT = b'i', b'm', b'a', b'r' MAX_INFLIGHT = 100 RATELIMIT_PERIOD = 0.1 def os_write(fd, data): """os.write wrapper so we do not lose data for partial writes.""" # TODO: this issue is fixed in cygwin since at least 2.8.0, remove this # wrapper / workaround when this version is considered ancient. # This is happening frequently on cygwin due to its small pipe buffer size of only 64kiB # and also due to its different blocking pipe behaviour compared to Linux/*BSD. # Neither Linux nor *BSD ever do partial writes on blocking pipes, unless interrupted by a # signal, in which case serve() would terminate. amount = remaining = len(data) while remaining: count = os.write(fd, data) remaining -= count if not remaining: break data = data[count:] time.sleep(count * 1e-09) return amount class ConnectionClosed(Error): """Connection closed by remote host""" exit_mcode = 80 class ConnectionClosedWithHint(ConnectionClosed): """Connection closed by remote host. {}""" exit_mcode = 81 class PathNotAllowed(Error): """Repository path not allowed: {}""" exit_mcode = 83 class InvalidRPCMethod(Error): """RPC method {} is not valid""" exit_mcode = 82 class UnexpectedRPCDataFormatFromClient(Error): """Borg {}: Got unexpected RPC data format from client.""" exit_mcode = 85 class UnexpectedRPCDataFormatFromServer(Error): """Got unexpected RPC data format from server:\n{}""" exit_mcode = 86 def __init__(self, data): try: data = data.decode()[:128] except UnicodeDecodeError: data = data[:128] data = ['%02X' % byte for byte in data] data = textwrap.fill(' '.join(data), 16 * 3) super().__init__(data) class ConnectionBrokenWithHint(Error): """Connection to remote host is broken. {}""" exit_mcode = 87 # Protocol compatibility: # In general the server is responsible for rejecting too old clients and the client it responsible for rejecting # too old servers. This ensures that the knowledge what is compatible is always held by the newer component. # # The server can do checks for the client version in RepositoryServer.negotiate. If the client_data is 2 then # client is in the version range [0.29.0, 1.0.x] inclusive. For newer clients client_data is a dict which contains # client_version. # # For the client the return of the negotiate method is either 2 if the server is in the version range [0.29.0, 1.0.x] # inclusive, or it is a dict which includes the server version. # # All method calls on the remote repository object must be allowlisted in RepositoryServer.rpc_methods and have api # stubs in RemoteRepository. The @api decorator on these stubs is used to set server version requirements. # # Method parameters are identified only by name and never by position. Unknown parameters are ignored by the server side. # If a new parameter is important and may not be ignored, on the client a parameter specific version requirement needs # to be added. # When parameters are removed, they need to be preserved as defaulted parameters on the client stubs so that older # servers still get compatible input. compatMap = { 'check': ('repair', 'save_space', ), 'commit': ('save_space', ), 'rollback': (), 'destroy': (), '__len__': (), 'list': ('limit', 'marker', ), 'put': ('id', 'data', ), 'get': ('id', ), 'delete': ('id', ), 'save_key': ('keydata', ), 'load_key': (), 'break_lock': (), 'negotiate': ('client_data', ), 'open': ('path', 'create', 'lock_wait', 'lock', 'exclusive', 'append_only', ), 'get_free_nonce': (), 'commit_nonce_reservation': ('next_unreserved', 'start_nonce', ), } def decode_keys(d): return {k.decode(): d[k] for k in d} class RepositoryServer: # pragma: no cover rpc_methods = ( '__len__', 'check', 'commit', 'delete', 'destroy', 'get', 'list', 'scan', 'negotiate', 'open', 'put', 'rollback', 'save_key', 'load_key', 'break_lock', 'get_free_nonce', 'commit_nonce_reservation', 'inject_exception', ) def __init__(self, restrict_to_paths, restrict_to_repositories, append_only, storage_quota): self.repository = None self.restrict_to_paths = restrict_to_paths self.restrict_to_repositories = restrict_to_repositories # This flag is parsed from the serve command line via Archiver.do_serve, # i.e. it reflects local system policy and generally ranks higher than # whatever the client wants, except when initializing a new repository # (see RepositoryServer.open below). self.append_only = append_only self.storage_quota = storage_quota self.client_version = parse_version('1.0.8') # fallback version if client is too old to send version information def positional_to_named(self, method, argv): """Translate from positional protocol to named protocol.""" try: return {name: argv[pos] for pos, name in enumerate(compatMap[method])} except IndexError: if method == 'open' and len(argv) == 4: # borg clients < 1.0.7 use open() with 4 args mapping = compatMap[method][:4] else: raise return {name: argv[pos] for pos, name in enumerate(mapping)} def filter_args(self, f, kwargs): """Remove unknown named parameters from call, because client did (implicitly) say it's ok.""" known = set(inspect.signature(f).parameters) return {name: kwargs[name] for name in kwargs if name in known} def serve(self): stdin_fd = sys.stdin.fileno() stdout_fd = sys.stdout.fileno() stderr_fd = sys.stdout.fileno() os.set_blocking(stdin_fd, False) os.set_blocking(stdout_fd, True) os.set_blocking(stderr_fd, True) unpacker = get_limited_unpacker('server') while True: r, w, es = select.select([stdin_fd], [], [], 10) if r: data = os.read(stdin_fd, BUFSIZE) if not data: if self.repository is not None: self.repository.close() else: os_write(stderr_fd, 'Borg {}: Got connection close before repository was opened.\n' .format(__version__).encode()) return unpacker.feed(data) for unpacked in unpacker: if isinstance(unpacked, dict): dictFormat = True msgid = unpacked[MSGID] method = unpacked[MSG].decode() args = decode_keys(unpacked[ARGS]) elif isinstance(unpacked, tuple) and len(unpacked) == 4: dictFormat = False # The first field 'type' was always 1 and has always been ignored _, msgid, method, args = unpacked method = method.decode() args = self.positional_to_named(method, args) else: if self.repository is not None: self.repository.close() raise UnexpectedRPCDataFormatFromClient(__version__) try: if method not in self.rpc_methods: raise InvalidRPCMethod(method) try: f = getattr(self, method) except AttributeError: f = getattr(self.repository, method) args = self.filter_args(f, args) res = f(**args) except BaseException as e: if dictFormat: ex_short = traceback.format_exception_only(e.__class__, e) ex_full = traceback.format_exception(*sys.exc_info()) ex_trace = True if isinstance(e, Error): ex_short = [e.get_message()] ex_trace = e.traceback if isinstance(e, (Repository.DoesNotExist, Repository.AlreadyExists, PathNotAllowed)): # These exceptions are reconstructed on the client end in RemoteRepository.call_many(), # and will be handled just like locally raised exceptions. Suppress the remote traceback # for these, except ErrorWithTraceback, which should always display a traceback. pass else: logging.debug('\n'.join(ex_full)) try: msg = msgpack.packb({MSGID: msgid, b'exception_class': e.__class__.__name__, b'exception_args': e.args, b'exception_full': ex_full, b'exception_short': ex_short, b'exception_trace': ex_trace, b'sysinfo': sysinfo()}) except TypeError: msg = msgpack.packb({MSGID: msgid, b'exception_class': e.__class__.__name__, b'exception_args': [x if isinstance(x, (str, bytes, int)) else None for x in e.args], b'exception_full': ex_full, b'exception_short': ex_short, b'exception_trace': ex_trace, b'sysinfo': sysinfo()}) os_write(stdout_fd, msg) else: if isinstance(e, (Repository.DoesNotExist, Repository.AlreadyExists, PathNotAllowed)): # These exceptions are reconstructed on the client end in RemoteRepository.call_many(), # and will be handled just like locally raised exceptions. Suppress the remote traceback # for these, except ErrorWithTraceback, which should always display a traceback. pass else: if isinstance(e, Error): tb_log_level = logging.ERROR if e.traceback else logging.DEBUG msg = e.get_message() else: tb_log_level = logging.ERROR msg = '%s Exception in RPC call' % e.__class__.__name__ tb = f'{traceback.format_exc()}\n{sysinfo()}' logging.error(msg) logging.log(tb_log_level, tb) exc = 'Remote Exception (see remote log for the traceback)' os_write(stdout_fd, msgpack.packb((1, msgid, e.__class__.__name__, exc))) else: if dictFormat: os_write(stdout_fd, msgpack.packb({MSGID: msgid, RESULT: res})) else: os_write(stdout_fd, msgpack.packb((1, msgid, None, res))) if es: self.repository.close() return def negotiate(self, client_data): # old format used in 1.0.x if client_data == RPC_PROTOCOL_VERSION: return RPC_PROTOCOL_VERSION # clients since 1.1.0b3 use a dict as client_data # clients since 1.1.0b6 support json log format from server if isinstance(client_data, dict): self.client_version = client_data[b'client_version'] level = logging.getLevelName(logging.getLogger('').level) setup_logging(is_serve=True, json=True, level=level) logger.debug('Initialized logging system for JSON-based protocol') else: self.client_version = BORG_VERSION # seems to be newer than current version (no known old format) # not a known old format, send newest negotiate this version knows return {'server_version': BORG_VERSION} def _resolve_path(self, path): if isinstance(path, bytes): path = os.fsdecode(path) # Leading slash is always present with URI (ssh://), but not with short-form (who@host:path). if path.startswith('/~/'): # /~/x = path x relative to home dir path = os.path.join(get_base_dir(), path[3:]) elif path.startswith('~/'): path = os.path.join(get_base_dir(), path[2:]) elif path.startswith('/~'): # /~username/x = relative to "user" home dir path = os.path.expanduser(path[1:]) elif path.startswith('~'): path = os.path.expanduser(path) elif path.startswith('/./'): # /./x = path x relative to cwd path = path[3:] return os.path.realpath(path) def open(self, path, create=False, lock_wait=None, lock=True, exclusive=None, append_only=False, make_parent_dirs=False): logging.debug('Resolving repository path %r', path) path = self._resolve_path(path) logging.debug('Resolved repository path to %r', path) path_with_sep = os.path.join(path, '') # make sure there is a trailing slash (os.sep) if self.restrict_to_paths: # if --restrict-to-path P is given, we make sure that we only operate in/below path P. # for the prefix check, it is important that the compared paths both have trailing slashes, # so that a path /foobar will NOT be accepted with --restrict-to-path /foo option. for restrict_to_path in self.restrict_to_paths: restrict_to_path_with_sep = os.path.join(os.path.realpath(restrict_to_path), '') # trailing slash if path_with_sep.startswith(restrict_to_path_with_sep): break else: raise PathNotAllowed(path) if self.restrict_to_repositories: for restrict_to_repository in self.restrict_to_repositories: restrict_to_repository_with_sep = os.path.join(os.path.realpath(restrict_to_repository), '') if restrict_to_repository_with_sep == path_with_sep: break else: raise PathNotAllowed(path) # "borg init" on "borg serve --append-only" (=self.append_only) does not create an append only repo, # while "borg init --append-only" (=append_only) does, regardless of the --append-only (self.append_only) # flag for serve. append_only = (not create and self.append_only) or append_only self.repository = Repository(path, create, lock_wait=lock_wait, lock=lock, append_only=append_only, storage_quota=self.storage_quota, exclusive=exclusive, make_parent_dirs=make_parent_dirs) self.repository.__enter__() # clean exit handled by serve() method return self.repository.id def inject_exception(self, kind): kind = kind.decode() s1 = 'test string' s2 = 'test string2' if kind == 'DoesNotExist': raise Repository.DoesNotExist(s1) elif kind == 'AlreadyExists': raise Repository.AlreadyExists(s1) elif kind == 'CheckNeeded': raise Repository.CheckNeeded(s1) elif kind == 'IntegrityError': raise IntegrityError(s1) elif kind == 'PathNotAllowed': raise PathNotAllowed('foo') elif kind == 'ObjectNotFound': raise Repository.ObjectNotFound(s1, s2) elif kind == 'InvalidRPCMethod': raise InvalidRPCMethod(s1) elif kind == 'divide': 0 // 0 class SleepingBandwidthLimiter: def __init__(self, limit): if limit: self.ratelimit = int(limit * RATELIMIT_PERIOD) self.ratelimit_last = time.monotonic() self.ratelimit_quota = self.ratelimit else: self.ratelimit = None def write(self, fd, to_send): if self.ratelimit: now = time.monotonic() if self.ratelimit_last + RATELIMIT_PERIOD <= now: self.ratelimit_quota += self.ratelimit if self.ratelimit_quota > 2 * self.ratelimit: self.ratelimit_quota = 2 * self.ratelimit self.ratelimit_last = now if self.ratelimit_quota == 0: tosleep = self.ratelimit_last + RATELIMIT_PERIOD - now time.sleep(tosleep) self.ratelimit_quota += self.ratelimit self.ratelimit_last = time.monotonic() if len(to_send) > self.ratelimit_quota: to_send = to_send[:self.ratelimit_quota] try: written = os.write(fd, to_send) except BrokenPipeError: raise ConnectionBrokenWithHint("Broken Pipe") from None if self.ratelimit: self.ratelimit_quota -= written return written def api(*, since, **kwargs_decorator): """Check version requirements and use self.call to do the remote method call. specifies the version in which borg introduced this method. Calling this method when connected to an older version will fail without transmitting anything to the server. Further kwargs can be used to encode version specific restrictions: is the value resulting in the behaviour before introducing the new parameter. If a previous hardcoded behaviour is parameterized in a version, this allows calls that use the previously hardcoded behaviour to pass through and generates an error if another behaviour is requested by the client. E.g. when 'append_only' was introduced in 1.0.7 the previous behaviour was what now is append_only=False. Thus @api(..., append_only={'since': parse_version('1.0.7'), 'previously': False}) allows calls with append_only=False for all version but rejects calls using append_only=True on versions older than 1.0.7. is a flag to set the behaviour if an old version is called the new way. If set to True, the method is called without the (not yet supported) parameter (this should be done if that is the more desirable behaviour). If False, an exception is generated. E.g. before 'threshold' was introduced in 1.2.0a8, a hardcoded threshold of 0.1 was used in commit(). """ def decorator(f): @functools.wraps(f) def do_rpc(self, *args, **kwargs): sig = inspect.signature(f) bound_args = sig.bind(self, *args, **kwargs) named = {} # Arguments for the remote process extra = {} # Arguments for the local process for name, param in sig.parameters.items(): if name == 'self': continue if name in bound_args.arguments: if name == 'wait': extra[name] = bound_args.arguments[name] else: named[name] = bound_args.arguments[name] else: if param.default is not param.empty: named[name] = param.default if self.server_version < since: raise self.RPCServerOutdated(f.__name__, format_version(since)) for name, restriction in kwargs_decorator.items(): if restriction['since'] <= self.server_version: continue if 'previously' in restriction and named[name] == restriction['previously']: continue if restriction.get('dontcare', False): continue raise self.RPCServerOutdated(f"{f.__name__} {name}={named[name]!s}", format_version(restriction['since'])) return self.call(f.__name__, named, **extra) return do_rpc return decorator class RemoteRepository: extra_test_args = [] class RPCError(Exception): def __init__(self, unpacked): # for borg < 1.1: unpacked only has b'exception_class' as key # for borg 1.1+: unpacked has keys: b'exception_args', b'exception_full', b'exception_short', b'sysinfo' self.unpacked = unpacked def get_message(self): if b'exception_short' in self.unpacked: return b'\n'.join(self.unpacked[b'exception_short']).decode() else: return self.exception_class @property def traceback(self): return self.unpacked.get(b'exception_trace', True) @property def exception_class(self): return self.unpacked[b'exception_class'].decode() @property def exception_full(self): if b'exception_full' in self.unpacked: return b'\n'.join(self.unpacked[b'exception_full']).decode() else: return self.get_message() + '\nRemote Exception (see remote log for the traceback)' @property def sysinfo(self): if b'sysinfo' in self.unpacked: return self.unpacked[b'sysinfo'].decode() else: return '' class RPCServerOutdated(Error): """Borg server is too old for {}. Required version {}""" exit_mcode = 84 @property def method(self): return self.args[0] @property def required_version(self): return self.args[1] # If compatibility with 1.0.x is not longer needed, replace all checks of this with True and simplify the code dictFormat = False # outside of __init__ for testing of legacy free protocol def __init__(self, location, create=False, exclusive=False, lock_wait=None, lock=True, append_only=False, make_parent_dirs=False, args=None): self.location = self._location = location self.preload_ids = [] self.msgid = 0 self.rx_bytes = 0 self.tx_bytes = 0 self.to_send = EfficientCollectionQueue(1024 * 1024, bytes) self.stderr_received = b'' # incomplete stderr line bytes received (no \n yet) self.chunkid_to_msgids = {} self.ignore_responses = set() self.responses = {} self.async_responses = {} self.shutdown_time = None self.ratelimit = SleepingBandwidthLimiter(args.upload_ratelimit * 1024 if args and args.upload_ratelimit else 0) self.upload_buffer_size_limit = args.upload_buffer * 1024 * 1024 if args and args.upload_buffer else 0 self.unpacker = get_limited_unpacker('client') self.server_version = parse_version('1.0.8') # fallback version if server is too old to send version information self.p = None self._args = args testing = location.host == '__testsuite__' # when testing, we invoke and talk to a borg process directly (no ssh). # when not testing, we invoke the system-installed ssh binary to talk to a remote borg. env = prepare_subprocess_env(system=not testing) borg_cmd = self.borg_cmd(args, testing) if not testing: borg_cmd = self.ssh_cmd(location) + borg_cmd logger.debug('SSH command line: %s', borg_cmd) # we do not want the ssh getting killed by Ctrl-C/SIGINT because it is needed for clean shutdown of borg. # borg's SIGINT handler tries to write a checkpoint and requires the remote repo connection. self.p = Popen(borg_cmd, bufsize=0, stdin=PIPE, stdout=PIPE, stderr=PIPE, env=env, preexec_fn=ignore_sigint) self.stdin_fd = self.p.stdin.fileno() self.stdout_fd = self.p.stdout.fileno() self.stderr_fd = self.p.stderr.fileno() os.set_blocking(self.stdin_fd, False) os.set_blocking(self.stdout_fd, False) os.set_blocking(self.stderr_fd, False) self.r_fds = [self.stdout_fd, self.stderr_fd] self.x_fds = [self.stdin_fd, self.stdout_fd, self.stderr_fd] try: try: version = self.call('negotiate', {'client_data': { b'client_version': BORG_VERSION, }}) except ConnectionClosed: raise ConnectionClosedWithHint('Is borg working on the server?') from None if version == RPC_PROTOCOL_VERSION: self.dictFormat = False elif isinstance(version, dict) and b'server_version' in version: self.dictFormat = True self.server_version = version[b'server_version'] else: raise Exception('Server insisted on using unsupported protocol version %s' % version) def do_open(): self.id = self.open(path=self.location.path, create=create, lock_wait=lock_wait, lock=lock, exclusive=exclusive, append_only=append_only, make_parent_dirs=make_parent_dirs) if self.dictFormat: do_open() else: # Ugly detection of versions prior to 1.0.7: If open throws it has to be 1.0.6 or lower try: do_open() except self.RPCError as err: if err.exception_class != 'TypeError': raise msg = """\ Please note: If you see a TypeError complaining about the number of positional arguments given to open(), you can ignore it if it comes from a borg version < 1.0.7. This TypeError is a cosmetic side effect of the compatibility code borg clients >= 1.0.7 have to support older borg servers. This problem will go away as soon as the server has been upgraded to 1.0.7+. """ # emit this msg in the same way as the 'Remote: ...' lines that show the remote TypeError sys.stderr.write(msg) self.server_version = parse_version('1.0.6') compatMap['open'] = ('path', 'create', 'lock_wait', 'lock', ) # try again with corrected version and compatMap do_open() except Exception: self.close() raise def __del__(self): if len(self.responses): logging.debug('still %d cached responses left in RemoteRepository' % (len(self.responses),)) if self.p: self.close() assert False, 'cleanup happened in Repository.__del__' def __repr__(self): return f'<{self.__class__.__name__} {self.location.canonical_path()}>' def __enter__(self): return self def __exit__(self, exc_type, exc_val, exc_tb): try: if exc_type is not None: self.shutdown_time = time.monotonic() + 30 self.rollback() finally: # in any case, we want to cleanly close the repo, even if the # rollback can not succeed (e.g. because the connection was # already closed) and raised another exception: logger.debug('RemoteRepository: %s bytes sent, %s bytes received, %d messages sent', format_file_size(self.tx_bytes), format_file_size(self.rx_bytes), self.msgid) self.close() @property def id_str(self): return bin_to_hex(self.id) def borg_cmd(self, args, testing): """return a borg serve command line""" # give some args/options to 'borg serve' process as they were given to us opts = [] if args is not None: root_logger = logging.getLogger() if root_logger.isEnabledFor(logging.DEBUG): opts.append('--debug') elif root_logger.isEnabledFor(logging.INFO): opts.append('--info') elif root_logger.isEnabledFor(logging.WARNING): pass # warning is default elif root_logger.isEnabledFor(logging.ERROR): opts.append('--error') elif root_logger.isEnabledFor(logging.CRITICAL): opts.append('--critical') else: raise ValueError('log level missing, fix this code') # Tell the remote server about debug topics it may need to consider. # Note that debug topics are usable for "spew" or "trace" logs which would # be too plentiful to transfer for normal use, so the server doesn't send # them unless explicitly enabled. # # Needless to say, if you do --debug-topic=repository.compaction, for example, # with a 1.0.x server it won't work, because the server does not recognize the # option. # # This is not considered a problem, since this is a debugging feature that # should not be used for regular use. for topic in args.debug_topics: if '.' not in topic: topic = 'borg.debug.' + topic if 'repository' in topic: opts.append('--debug-topic=%s' % topic) if 'storage_quota' in args and args.storage_quota: opts.append('--storage-quota=%s' % args.storage_quota) env_vars = [] if testing: return env_vars + [sys.executable, '-m', 'borg.archiver', 'serve'] + opts + self.extra_test_args else: # pragma: no cover remote_path = args.remote_path or os.environ.get('BORG_REMOTE_PATH', 'borg') remote_path = replace_placeholders(remote_path) return env_vars + [remote_path, 'serve'] + opts def ssh_cmd(self, location): """return a ssh command line that can be prefixed to a borg command line""" rsh = self._args.rsh or os.environ.get('BORG_RSH', 'ssh') args = shlex.split(rsh) if location.port: args += ['-p', str(location.port)] if location.user: args.append(f'{location.user}@{location.host}') else: args.append('%s' % location.host) return args def named_to_positional(self, method, kwargs): return [kwargs[name] for name in compatMap[method]] def call(self, cmd, args, **kw): for resp in self.call_many(cmd, [args], **kw): return resp def call_many(self, cmd, calls, wait=True, is_preloaded=False, async_wait=True): if not calls and cmd != 'async_responses': return def send_buffer(): if self.to_send: try: written = self.ratelimit.write(self.stdin_fd, self.to_send.peek_front()) self.tx_bytes += written self.to_send.pop_front(written) except OSError as e: # io.write might raise EAGAIN even though select indicates # that the fd should be writable. # EWOULDBLOCK is added for defensive programming sake. if e.errno not in [errno.EAGAIN, errno.EWOULDBLOCK]: raise def pop_preload_msgid(chunkid): msgid = self.chunkid_to_msgids[chunkid].pop(0) if not self.chunkid_to_msgids[chunkid]: del self.chunkid_to_msgids[chunkid] return msgid def handle_error(unpacked): error = unpacked[b'exception_class'].decode() old_server = b'exception_args' not in unpacked args = unpacked.get(b'exception_args') if error == 'Error': raise Error(args[0].decode()) elif error == 'ErrorWithTraceback': raise ErrorWithTraceback(args[0].decode()) elif error == 'DoesNotExist': raise Repository.DoesNotExist(self.location.processed) elif error == 'AlreadyExists': raise Repository.AlreadyExists(self.location.processed) elif error == 'CheckNeeded': raise Repository.CheckNeeded(self.location.processed) elif error == 'IntegrityError': if old_server: raise IntegrityError('(not available)') else: raise IntegrityError(args[0].decode()) elif error == 'AtticRepository': if old_server: raise Repository.AtticRepository('(not available)') else: raise Repository.AtticRepository(args[0].decode()) elif error == 'PathNotAllowed': if old_server: raise PathNotAllowed('(unknown)') else: raise PathNotAllowed(args[0].decode()) elif error == 'PathPermissionDenied': raise Repository.PathPermissionDenied(args[0].decode()) elif error == 'ParentPathDoesNotExist': raise Repository.ParentPathDoesNotExist(args[0].decode()) elif error == 'ObjectNotFound': if old_server: raise Repository.ObjectNotFound('(not available)', self.location.processed) else: raise Repository.ObjectNotFound(args[0].decode(), self.location.processed) elif error == 'InvalidRPCMethod': if old_server: raise InvalidRPCMethod('(not available)') else: raise InvalidRPCMethod(args[0].decode()) elif error == 'LockTimeout': if old_server: raise LockTimeout('(not available)') else: raise LockTimeout(args[0].decode()) elif error == 'LockFailed': if old_server: raise LockFailed('(not available)', '') else: raise LockFailed(args[0].decode(), args[1].decode()) elif error == 'NotLocked': if old_server: raise NotLocked('(not available)') else: raise NotLocked(args[0].decode()) elif error == 'NotMyLock': if old_server: raise NotMyLock('(not available)') else: raise NotMyLock(args[0].decode()) else: raise self.RPCError(unpacked) calls = list(calls) waiting_for = [] maximum_to_send = 0 if wait else self.upload_buffer_size_limit send_buffer() # Try to send data, as some cases (async_response) will never try to send data otherwise. while wait or calls: if self.shutdown_time and time.monotonic() > self.shutdown_time: # we are shutting this RemoteRepository down already, make sure we do not waste # a lot of time in case a lot of async stuff is coming in or remote is gone or slow. logger.debug('shutdown_time reached, shutting down with %d waiting_for and %d async_responses.', len(waiting_for), len(self.async_responses)) return while waiting_for: try: unpacked = self.responses.pop(waiting_for[0]) waiting_for.pop(0) if b'exception_class' in unpacked: handle_error(unpacked) else: yield unpacked[RESULT] if not waiting_for and not calls: return except KeyError: break if cmd == 'async_responses': while True: try: msgid, unpacked = self.async_responses.popitem() except KeyError: # there is nothing left what we already have received if async_wait and self.ignore_responses: # but do not return if we shall wait and there is something left to wait for: break else: return else: if b'exception_class' in unpacked: handle_error(unpacked) else: yield unpacked[RESULT] if self.to_send or ((calls or self.preload_ids) and len(waiting_for) < MAX_INFLIGHT): w_fds = [self.stdin_fd] else: w_fds = [] r, w, x = select.select(self.r_fds, w_fds, self.x_fds, 1) if x: raise Exception('FD exception occurred') for fd in r: if fd is self.stdout_fd: data = os.read(fd, BUFSIZE) if not data: raise ConnectionClosed() self.rx_bytes += len(data) self.unpacker.feed(data) for unpacked in self.unpacker: if isinstance(unpacked, dict): msgid = unpacked[MSGID] elif isinstance(unpacked, tuple) and len(unpacked) == 4: # The first field 'type' was always 1 and has always been ignored _, msgid, error, res = unpacked if error: # ignore res, because it is only a fixed string anyway. unpacked = {MSGID: msgid, b'exception_class': error} else: unpacked = {MSGID: msgid, RESULT: res} else: raise UnexpectedRPCDataFormatFromServer(data) if msgid in self.ignore_responses: self.ignore_responses.remove(msgid) # async methods never return values, but may raise exceptions. if b'exception_class' in unpacked: self.async_responses[msgid] = unpacked else: # we currently do not have async result values except "None", # so we do not add them into async_responses. if unpacked[RESULT] is not None: self.async_responses[msgid] = unpacked else: self.responses[msgid] = unpacked elif fd is self.stderr_fd: data = os.read(fd, 32768) if not data: raise ConnectionClosed() self.rx_bytes += len(data) # deal with incomplete lines (may appear due to block buffering) if self.stderr_received: data = self.stderr_received + data self.stderr_received = b'' lines = data.splitlines(keepends=True) if lines and not lines[-1].endswith((b'\r', b'\n')): self.stderr_received = lines.pop() # now we have complete lines in and any partial line in self.stderr_received. for line in lines: handle_remote_line(line.decode()) # decode late, avoid partial utf-8 sequences if w: while (len(self.to_send) <= maximum_to_send) and (calls or self.preload_ids) and len(waiting_for) < MAX_INFLIGHT: if calls: if is_preloaded: assert cmd == 'get', "is_preload is only supported for 'get'" if calls[0]['id'] in self.chunkid_to_msgids: waiting_for.append(pop_preload_msgid(calls.pop(0)['id'])) else: args = calls.pop(0) if cmd == 'get' and args['id'] in self.chunkid_to_msgids: waiting_for.append(pop_preload_msgid(args['id'])) else: self.msgid += 1 waiting_for.append(self.msgid) if self.dictFormat: self.to_send.push_back(msgpack.packb({MSGID: self.msgid, MSG: cmd, ARGS: args})) else: self.to_send.push_back(msgpack.packb((1, self.msgid, cmd, self.named_to_positional(cmd, args)))) if not self.to_send and self.preload_ids: chunk_id = self.preload_ids.pop(0) args = {'id': chunk_id} self.msgid += 1 self.chunkid_to_msgids.setdefault(chunk_id, []).append(self.msgid) if self.dictFormat: self.to_send.push_back(msgpack.packb({MSGID: self.msgid, MSG: 'get', ARGS: args})) else: self.to_send.push_back(msgpack.packb((1, self.msgid, 'get', self.named_to_positional('get', args)))) send_buffer() self.ignore_responses |= set(waiting_for) # we lose order here @api(since=parse_version('1.0.0'), append_only={'since': parse_version('1.0.7'), 'previously': False}, make_parent_dirs={'since': parse_version('1.1.9'), 'previously': False}) def open(self, path, create=False, lock_wait=None, lock=True, exclusive=False, append_only=False, make_parent_dirs=False): """actual remoting is done via self.call in the @api decorator""" @api(since=parse_version('1.0.0'), max_duration={'since': parse_version('1.2.0a4'), 'previously': 0}) def check(self, repair=False, save_space=False, max_duration=0): """actual remoting is done via self.call in the @api decorator""" @api(since=parse_version('1.0.0'), compact={'since': parse_version('1.2.0a0'), 'previously': True, 'dontcare': True}, threshold={'since': parse_version('1.2.0a8'), 'previously': 0.1, 'dontcare': True}, cleanup_commits={'since': parse_version('1.2.0a0'), 'previously': False, 'dontcare': True}) def commit(self, save_space=False, compact=True, threshold=0.1, cleanup_commits=False): """actual remoting is done via self.call in the @api decorator""" @api(since=parse_version('1.0.0')) def rollback(self): """actual remoting is done via self.call in the @api decorator""" @api(since=parse_version('1.0.0')) def destroy(self): """actual remoting is done via self.call in the @api decorator""" @api(since=parse_version('1.0.0')) def __len__(self): """actual remoting is done via self.call in the @api decorator""" @api(since=parse_version('1.0.0')) def list(self, limit=None, marker=None): """actual remoting is done via self.call in the @api decorator""" @api(since=parse_version('1.1.0b3')) def scan(self, limit=None, marker=None): """actual remoting is done via self.call in the @api decorator""" def get(self, id): for resp in self.get_many([id]): return resp def get_many(self, ids, is_preloaded=False): yield from self.call_many('get', [{'id': id} for id in ids], is_preloaded=is_preloaded) @api(since=parse_version('1.0.0')) def put(self, id, data, wait=True): """actual remoting is done via self.call in the @api decorator""" @api(since=parse_version('1.0.0')) def delete(self, id, wait=True): """actual remoting is done via self.call in the @api decorator""" @api(since=parse_version('1.0.0')) def save_key(self, keydata): """actual remoting is done via self.call in the @api decorator""" @api(since=parse_version('1.0.0')) def load_key(self): """actual remoting is done via self.call in the @api decorator""" @api(since=parse_version('1.0.0')) def get_free_nonce(self): """actual remoting is done via self.call in the @api decorator""" @api(since=parse_version('1.0.0')) def commit_nonce_reservation(self, next_unreserved, start_nonce): """actual remoting is done via self.call in the @api decorator""" @api(since=parse_version('1.0.0')) def break_lock(self): """actual remoting is done via self.call in the @api decorator""" def close(self): if self.p: self.p.stdin.close() self.p.stdout.close() self.p.wait() self.p = None def async_response(self, wait=True): for resp in self.call_many('async_responses', calls=[], wait=True, async_wait=wait): return resp def preload(self, ids): self.preload_ids += ids def handle_remote_line(line): """ Handle a remote log line. This function is remarkably complex because it handles multiple wire formats. """ assert line.endswith(('\r', '\n')) if line.startswith('{'): # This format is used by Borg since 1.1.0b6 for new-protocol clients. # It is the same format that is exposed by --log-json. msg = json.loads(line) if msg['type'] not in ('progress_message', 'progress_percent', 'log_message'): logger.warning('Dropped remote log message with unknown type %r: %s', msg['type'], line) return if msg['type'] == 'log_message': # Re-emit log messages on the same level as the remote to get correct log suppression and verbosity. level = getattr(logging, msg['levelname'], logging.CRITICAL) assert isinstance(level, int) target_logger = logging.getLogger(msg['name']) msg['message'] = 'Remote: ' + msg['message'] # In JSON mode, we manually check whether the log message should be propagated. if logging.getLogger('borg').json and level >= target_logger.getEffectiveLevel(): sys.stderr.write(json.dumps(msg) + '\n') else: target_logger.log(level, '%s', msg['message']) elif msg['type'].startswith('progress_'): # Progress messages are a bit more complex. # First of all, we check whether progress output is enabled. This is signalled # through the effective level of the borg.output.progress logger # (also see ProgressIndicatorBase in borg.helpers). progress_logger = logging.getLogger('borg.output.progress') if progress_logger.getEffectiveLevel() == logging.INFO: # When progress output is enabled, we check whether the client is in # --log-json mode, as signalled by the "json" attribute on the "borg" logger. if logging.getLogger('borg').json: # In --log-json mode we re-emit the progress JSON line as sent by the server, # with the message, if any, prefixed with "Remote: ". if 'message' in msg: msg['message'] = 'Remote: ' + msg['message'] sys.stderr.write(json.dumps(msg) + '\n') elif 'message' in msg: # In text log mode we write only the message to stderr and terminate with \r # (carriage return, i.e. move the write cursor back to the beginning of the line) # so that the next message, progress or not, overwrites it. This mirrors the behaviour # of local progress displays. sys.stderr.write('Remote: ' + msg['message'] + '\r') elif line.startswith('$LOG '): # This format is used by borg serve 0.xx, 1.0.x and 1.1.0b1..b5. # It prefixed log lines with $LOG as a marker, followed by the log level # and optionally a logger name, then "Remote:" as a separator followed by the original # message. _, level, msg = line.split(' ', 2) level = getattr(logging, level, logging.CRITICAL) # str -> int if msg.startswith('Remote:'): # server format: '$LOG Remote: ' logging.log(level, msg.rstrip()) else: # server format '$LOG Remote: ' logname, msg = msg.split(' ', 1) logging.getLogger(logname).log(level, msg.rstrip()) else: # Plain 1.0.x and older format - re-emit to stderr (mirroring what the 1.0.x # client did) or as a generic log message. # We don't know what priority the line had. if logging.getLogger('borg').json: logging.getLogger('').warning('Remote: ' + line.strip()) else: # In non-JSON mode we circumvent logging to preserve carriage returns (\r) # which are generated by remote progress displays. sys.stderr.write('Remote: ' + line) class RepositoryNoCache: """A not caching Repository wrapper, passes through to repository. Just to have same API (including the context manager) as RepositoryCache. *transform* is a callable taking two arguments, key and raw repository data. The return value is returned from get()/get_many(). By default, the raw repository data is returned. """ def __init__(self, repository, transform=None): self.repository = repository self.transform = transform or (lambda key, data: data) def close(self): pass def __enter__(self): return self def __exit__(self, exc_type, exc_val, exc_tb): self.close() def get(self, key): return next(self.get_many([key], cache=False)) def get_many(self, keys, cache=True): for key, data in zip(keys, self.repository.get_many(keys)): yield self.transform(key, data) def log_instrumentation(self): pass class RepositoryCache(RepositoryNoCache): """ A caching Repository wrapper. Caches Repository GET operations locally. *pack* and *unpack* complement *transform* of the base class. *pack* receives the output of *transform* and should return bytes, which are stored in the cache. *unpack* receives these bytes and should return the initial data (as returned by *transform*). """ def __init__(self, repository, pack=None, unpack=None, transform=None): super().__init__(repository, transform) self.pack = pack or (lambda data: data) self.unpack = unpack or (lambda data: data) self.cache = set() self.basedir = tempfile.mkdtemp(prefix='borg-cache-') self.query_size_limit() self.size = 0 # Instrumentation self.hits = 0 self.misses = 0 self.slow_misses = 0 self.slow_lat = 0.0 self.evictions = 0 self.enospc = 0 def query_size_limit(self): available_space = shutil.disk_usage(self.basedir).free self.size_limit = int(min(available_space * 0.25, 2**31)) def key_filename(self, key): return os.path.join(self.basedir, bin_to_hex(key)) def backoff(self): self.query_size_limit() target_size = int(0.9 * self.size_limit) while self.size > target_size and self.cache: key = self.cache.pop() file = self.key_filename(key) self.size -= os.stat(file).st_size os.unlink(file) self.evictions += 1 def add_entry(self, key, data, cache): transformed = self.transform(key, data) if not cache: return transformed packed = self.pack(transformed) file = self.key_filename(key) try: with open(file, 'wb') as fd: fd.write(packed) except OSError as os_error: try: safe_unlink(file) except FileNotFoundError: pass # open() could have failed as well if os_error.errno == errno.ENOSPC: self.enospc += 1 self.backoff() else: raise else: self.size += len(packed) self.cache.add(key) if self.size > self.size_limit: self.backoff() return transformed def log_instrumentation(self): logger.debug('RepositoryCache: current items %d, size %s / %s, %d hits, %d misses, %d slow misses (+%.1fs), ' '%d evictions, %d ENOSPC hit', len(self.cache), format_file_size(self.size), format_file_size(self.size_limit), self.hits, self.misses, self.slow_misses, self.slow_lat, self.evictions, self.enospc) def close(self): self.log_instrumentation() self.cache.clear() shutil.rmtree(self.basedir) def get_many(self, keys, cache=True): unknown_keys = [key for key in keys if key not in self.cache] repository_iterator = zip(unknown_keys, self.repository.get_many(unknown_keys)) for key in keys: if key in self.cache: file = self.key_filename(key) with open(file, 'rb') as fd: self.hits += 1 yield self.unpack(fd.read()) else: for key_, data in repository_iterator: if key_ == key: transformed = self.add_entry(key, data, cache) self.misses += 1 yield transformed break else: # slow path: eviction during this get_many removed this key from the cache t0 = time.perf_counter() data = self.repository.get(key) self.slow_lat += time.perf_counter() - t0 transformed = self.add_entry(key, data, cache) self.slow_misses += 1 yield transformed # Consume any pending requests for _ in repository_iterator: pass def cache_if_remote(repository, *, decrypted_cache=False, pack=None, unpack=None, transform=None, force_cache=False): """ Return a Repository(No)Cache for *repository*. If *decrypted_cache* is a key object, then get and get_many will return a tuple (csize, plaintext) instead of the actual data in the repository. The cache will store decrypted data, which increases CPU efficiency (by avoiding repeatedly decrypting and more importantly MAC and ID checking cached objects). Internally, objects are compressed with LZ4. """ if decrypted_cache and (pack or unpack or transform): raise ValueError('decrypted_cache and pack/unpack/transform are incompatible') elif decrypted_cache: key = decrypted_cache # 32 bit csize, 64 bit (8 byte) xxh64 cache_struct = struct.Struct('=I8s') compressor = Compressor('lz4') def pack(data): csize, decrypted = data compressed = compressor.compress(decrypted) return cache_struct.pack(csize, xxh64(compressed)) + compressed def unpack(data): data = memoryview(data) csize, checksum = cache_struct.unpack(data[:cache_struct.size]) compressed = data[cache_struct.size:] if checksum != xxh64(compressed): raise IntegrityError('detected corrupted data in metadata cache') return csize, compressor.decompress(compressed) def transform(id_, data): csize = len(data) decrypted = key.decrypt(id_, data) return csize, decrypted if isinstance(repository, RemoteRepository) or force_cache: return RepositoryCache(repository, pack, unpack, transform) else: return RepositoryNoCache(repository, transform) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/repository.py0000644000076500000240000024354614641074756016555 0ustar00twstaffimport errno import mmap import os import shutil import stat import struct import time from collections import defaultdict from configparser import ConfigParser from functools import partial from itertools import islice from .constants import * # NOQA from .hashindex import NSIndex from .helpers import Error, ErrorWithTraceback, IntegrityError, format_file_size, parse_file_size from .helpers import Location from .helpers import ProgressIndicatorPercent from .helpers import bin_to_hex, hex_to_bin from .helpers import secure_erase, safe_unlink from .helpers import Manifest from .helpers import msgpack from .helpers import utcnow from .locking import Lock, LockError, LockErrorT from .logger import create_logger from .lrucache import LRUCache from .platform import SaveFile, SyncFile, sync_dir, safe_fadvise from .algorithms.checksums import crc32 from .crypto.file_integrity import IntegrityCheckedFile, FileIntegrityError logger = create_logger(__name__) MAGIC = b'BORG_SEG' MAGIC_LEN = len(MAGIC) ATTIC_MAGIC = b'ATTICSEG' assert len(ATTIC_MAGIC) == MAGIC_LEN TAG_PUT = 0 TAG_DELETE = 1 TAG_COMMIT = 2 # Highest ID usable as TAG_* value # # Code may expect not to find any tags exceeding this value. In particular, # in order to speed up `borg check --repair`, any tag greater than MAX_TAG_ID # is assumed to be corrupted. When increasing this value, in order to add more # tags, keep in mind that old versions of Borg accessing a new repository # may not be able to handle the new tags. MAX_TAG_ID = 15 FreeSpace = partial(defaultdict, int) class Repository: """ Filesystem based transactional key value store Transactionality is achieved by using a log (aka journal) to record changes. The log is a series of numbered files called segments. Each segment is a series of log entries. The segment number together with the offset of each entry relative to its segment start establishes an ordering of the log entries. This is the "definition" of time for the purposes of the log. Log entries are either PUT, DELETE or COMMIT. A COMMIT is always the final log entry in a segment and marks all data from the beginning of the log until the segment ending with the COMMIT as committed and consistent. The segment number of a segment ending with a COMMIT is called the transaction ID of that commit, and a segment ending with a COMMIT is called committed. When reading from a repository it is first checked whether the last segment is committed. If it is not, then all segments after the last committed segment are deleted; they contain log entries whose consistency is not established by a COMMIT. Note that the COMMIT can't establish consistency by itself, but only manages to do so with proper support from the platform (including the hardware). See platform.base.SyncFile for details. A PUT inserts a key-value pair. The value is stored in the log entry, hence the repository implements full data logging, meaning that all data is consistent, not just metadata (which is common in file systems). A DELETE marks a key as deleted. For a given key only the last entry regarding the key, which is called current (all other entries are called superseded), is relevant: If there is no entry or the last entry is a DELETE then the key does not exist. Otherwise the last PUT defines the value of the key. By superseding a PUT (with either another PUT or a DELETE) the log entry becomes obsolete. A segment containing such obsolete entries is called sparse, while a segment containing no such entries is called compact. Sparse segments can be compacted and thereby disk space freed. This destroys the transaction for which the superseded entries where current. On disk layout: dir/README dir/config dir/data// dir/index.X dir/hints.X File system interaction ----------------------- LoggedIO generally tries to rely on common behaviours across transactional file systems. Segments that are deleted are truncated first, which avoids problems if the FS needs to allocate space to delete the dirent of the segment. This mostly affects CoW file systems, traditional journaling file systems have a fairly good grip on this problem. Note that deletion, i.e. unlink(2), is atomic on every file system that uses inode reference counts, which includes pretty much all of them. To remove a dirent the inodes refcount has to be decreased, but you can't decrease the refcount before removing the dirent nor can you decrease the refcount after removing the dirent. File systems solve this with a lock, and by ensuring it all stays within the same FS transaction. Truncation is generally not atomic in itself, and combining truncate(2) and unlink(2) is of course never guaranteed to be atomic. Truncation in a classic extent-based FS is done in roughly two phases, first the extents are removed then the inode is updated. (In practice this is of course way more complex). LoggedIO gracefully handles truncate/unlink splits as long as the truncate resulted in a zero length file. Zero length segments are considered to not exist, while LoggedIO.cleanup() will still get rid of them. """ class AlreadyExists(Error): """A repository already exists at {}.""" exit_mcode = 10 class AtticRepository(Error): """Attic repository detected. Please run "borg upgrade {}".""" exit_mcode = 11 class CheckNeeded(ErrorWithTraceback): """Inconsistency detected. Please run "borg check {}".""" exit_mcode = 12 class DoesNotExist(Error): """Repository {} does not exist.""" exit_mcode = 13 class InsufficientFreeSpaceError(Error): """Insufficient free space to complete transaction (required: {}, available: {}).""" exit_mcode = 14 class InvalidRepository(Error): """{} is not a valid repository. Check repo config.""" exit_mcode = 15 class InvalidRepositoryConfig(Error): """{} does not have a valid configuration. Check repo config [{}].""" exit_mcode = 16 class ObjectNotFound(ErrorWithTraceback): """Object with key {} not found in repository {}.""" exit_mcode = 17 def __init__(self, id, repo): if isinstance(id, bytes): id = bin_to_hex(id) super().__init__(id, repo) class ParentPathDoesNotExist(Error): """The parent path of the repo directory [{}] does not exist.""" exit_mcode = 18 class PathAlreadyExists(Error): """There is already something at {}.""" exit_mcode = 19 class StorageQuotaExceeded(Error): """The storage quota ({}) has been exceeded ({}). Try deleting some archives.""" exit_mcode = 20 class PathPermissionDenied(Error): """Permission denied to {}.""" exit_mcode = 21 def __init__(self, path, create=False, exclusive=False, lock_wait=None, lock=True, append_only=False, storage_quota=None, check_segment_magic=True, make_parent_dirs=False): self.path = os.path.abspath(path) self._location = Location('file://%s' % self.path) self.io = None # type: LoggedIO self.lock = None self.index = None # This is an index of shadowed log entries during this transaction. Consider the following sequence: # segment_n PUT A, segment_x DELETE A # After the "DELETE A" in segment_x the shadow index will contain "A -> [n]". # .delete() is updating this index, it is persisted into "hints" file and is later used by .compact_segments(). # We need the entries in the shadow_index to not accidentally drop the "DELETE A" when we compact segment_x # only (and we do not compact segment_n), because DELETE A is still needed then because PUT A will be still # there. Otherwise chunk A would reappear although it was previously deleted. self.shadow_index = {} self._active_txn = False self.lock_wait = lock_wait self.do_lock = lock self.do_create = create self.created = False self.exclusive = exclusive self.append_only = append_only self.storage_quota = storage_quota self.storage_quota_use = 0 self.transaction_doomed = None self.check_segment_magic = check_segment_magic self.make_parent_dirs = make_parent_dirs def __del__(self): if self.lock: self.close() assert False, "cleanup happened in Repository.__del__" def __repr__(self): return f'<{self.__class__.__name__} {self.path}>' def __enter__(self): if self.do_create: self.do_create = False self.create(self.path) self.created = True self.open(self.path, bool(self.exclusive), lock_wait=self.lock_wait, lock=self.do_lock) return self def __exit__(self, exc_type, exc_val, exc_tb): if exc_type is not None: no_space_left_on_device = exc_type is OSError and exc_val.errno == errno.ENOSPC # The ENOSPC could have originated somewhere else besides the Repository. The cleanup is always safe, unless # EIO or FS corruption ensues, which is why we specifically check for ENOSPC. if self._active_txn and no_space_left_on_device: logger.warning('No space left on device, cleaning up partial transaction to free space.') cleanup = True else: cleanup = False self._rollback(cleanup=cleanup) self.close() @property def id_str(self): return bin_to_hex(self.id) @staticmethod def is_repository(path): """Check whether there is already a Borg repository at *path*.""" try: # Use binary mode to avoid troubles if a README contains some stuff not in our locale with open(os.path.join(path, 'README'), 'rb') as fd: # Read only the first ~100 bytes (if any), in case some README file we stumble upon is large. readme_head = fd.read(100) # The first comparison captures our current variant (REPOSITORY_README), the second comparison # is an older variant of the README file (used by 1.0.x). return b'Borg Backup repository' in readme_head or b'Borg repository' in readme_head except OSError: # Ignore FileNotFound, PermissionError, ... return False def check_can_create_repository(self, path): """ Raise an exception if a repository already exists at *path* or any parent directory. Checking parent directories is done for two reasons: (1) It's just a weird thing to do, and usually not intended. A Borg using the "parent" repository may be confused, or we may accidentally put stuff into the "data/" or "data//" directories. (2) When implementing repository quotas (which we currently don't), it's important to prohibit folks from creating quota-free repositories. Since no one can create a repository within another repository, user's can only use the quota'd repository, when their --restrict-to-path points at the user's repository. """ try: st = os.stat(path) except FileNotFoundError: pass # nothing there! except PermissionError: raise self.PathPermissionDenied(path) from None else: # there is something already there! if self.is_repository(path): raise self.AlreadyExists(path) if not stat.S_ISDIR(st.st_mode): raise self.PathAlreadyExists(path) try: files = os.listdir(path) except PermissionError: raise self.PathPermissionDenied(path) from None else: if files: # a dir, but not empty raise self.PathAlreadyExists(path) else: # an empty directory is acceptable for us. pass while True: # Check all parent directories for Borg's repository README previous_path = path # Thus, path = previous_path/.. path = os.path.abspath(os.path.join(previous_path, os.pardir)) if path == previous_path: # We reached the root of the directory hierarchy (/.. = / and C:\.. = C:\). break if self.is_repository(path): raise self.AlreadyExists(path) def create(self, path): """Create a new empty repository at `path` """ self.check_can_create_repository(path) if self.make_parent_dirs: parent_path = os.path.join(path, os.pardir) os.makedirs(parent_path, exist_ok=True) if not os.path.exists(path): try: os.mkdir(path) except FileNotFoundError as err: raise self.ParentPathDoesNotExist(path) from err with open(os.path.join(path, 'README'), 'w') as fd: fd.write(REPOSITORY_README) os.mkdir(os.path.join(path, 'data')) config = ConfigParser(interpolation=None) config.add_section('repository') config.set('repository', 'version', '1') config.set('repository', 'segments_per_dir', str(DEFAULT_SEGMENTS_PER_DIR)) config.set('repository', 'max_segment_size', str(DEFAULT_MAX_SEGMENT_SIZE)) config.set('repository', 'append_only', str(int(self.append_only))) if self.storage_quota: config.set('repository', 'storage_quota', str(self.storage_quota)) else: config.set('repository', 'storage_quota', '0') config.set('repository', 'additional_free_space', '0') config.set('repository', 'id', bin_to_hex(os.urandom(32))) self.save_config(path, config) def save_config(self, path, config): config_path = os.path.join(path, 'config') old_config_path = os.path.join(path, 'config.old') if os.path.isfile(old_config_path): logger.warning("Old config file not securely erased on previous config update") secure_erase(old_config_path, avoid_collateral_damage=True) if os.path.isfile(config_path): link_error_msg = ("Failed to securely erase old repository config file (hardlinks not supported). " "Old repokey data, if any, might persist on physical storage.") try: os.link(config_path, old_config_path) except OSError as e: if e.errno in (errno.EMLINK, errno.ENOSYS, errno.EPERM, errno.EACCES, errno.ENOTSUP, errno.EIO): logger.warning(link_error_msg) else: raise except AttributeError: # some python ports have no os.link, see #4901 logger.warning(link_error_msg) try: with SaveFile(config_path) as fd: config.write(fd) except PermissionError as e: # error is only a problem if we even had a lock if self.do_lock: raise logger.warning("%s: Failed writing to '%s'. This is expected when working on " "read-only repositories." % (e.strerror, e.filename)) if os.path.isfile(old_config_path): secure_erase(old_config_path, avoid_collateral_damage=True) def save_key(self, keydata): assert self.config keydata = keydata.decode('utf-8') # remote repo: msgpack issue #99, getting bytes self.config.set('repository', 'key', keydata) self.save_config(self.path, self.config) def load_key(self): keydata = self.config.get('repository', 'key', fallback='').strip() # note: if we return an empty string, it means there is no repo key return keydata.encode('utf-8') # remote repo: msgpack issue #99, returning bytes def get_free_nonce(self): if self.do_lock and not self.lock.got_exclusive_lock(): raise AssertionError("bug in code, exclusive lock should exist here") nonce_path = os.path.join(self.path, 'nonce') try: with open(nonce_path) as fd: nonce_hex = fd.read().strip() except FileNotFoundError: return None else: try: nonce_bytes = hex_to_bin(nonce_hex, length=8) except ValueError as e: raise Error(f"Repository has an invalid nonce file: {e}") from None return int.from_bytes(nonce_bytes, byteorder='big') def commit_nonce_reservation(self, next_unreserved, start_nonce): if self.do_lock and not self.lock.got_exclusive_lock(): raise AssertionError("bug in code, exclusive lock should exist here") if self.get_free_nonce() != start_nonce: raise Exception("nonce space reservation with mismatched previous state") nonce_path = os.path.join(self.path, 'nonce') try: with SaveFile(nonce_path, binary=False) as fd: fd.write(bin_to_hex(next_unreserved.to_bytes(8, byteorder='big'))) except PermissionError as e: # error is only a problem if we even had a lock if self.do_lock: raise logger.warning("%s: Failed writing to '%s'. This is expected when working on " "read-only repositories." % (e.strerror, e.filename)) def destroy(self): """Destroy the repository at `self.path` """ if self.append_only: raise ValueError(self.path + " is in append-only mode") self.close() os.remove(os.path.join(self.path, 'config')) # kill config first shutil.rmtree(self.path) def get_index_transaction_id(self): indices = sorted(int(fn[6:]) for fn in os.listdir(self.path) if fn.startswith('index.') and fn[6:].isdigit() and os.stat(os.path.join(self.path, fn)).st_size != 0) if indices: return indices[-1] else: return None def check_transaction(self): index_transaction_id = self.get_index_transaction_id() segments_transaction_id = self.io.get_segments_transaction_id() if index_transaction_id is not None and segments_transaction_id is None: # we have a transaction id from the index, but we did not find *any* # commit in the segment files (thus no segments transaction id). # this can happen if a lot of segment files are lost, e.g. due to a # filesystem or hardware malfunction. it means we have no identifiable # valid (committed) state of the repo which we could use. msg = '%s" - although likely this is "beyond repair' % self.path # dirty hack raise self.CheckNeeded(msg) # Attempt to automatically rebuild index if we crashed between commit # tag write and index save if index_transaction_id != segments_transaction_id: if index_transaction_id is not None and index_transaction_id > segments_transaction_id: replay_from = None else: replay_from = index_transaction_id self.replay_segments(replay_from, segments_transaction_id) def get_transaction_id(self): self.check_transaction() return self.get_index_transaction_id() def break_lock(self): Lock(os.path.join(self.path, 'lock')).break_lock() def migrate_lock(self, old_id, new_id): # note: only needed for local repos if self.lock is not None: self.lock.migrate_lock(old_id, new_id) def open(self, path, exclusive, lock_wait=None, lock=True): self.path = path try: st = os.stat(path) except FileNotFoundError: raise self.DoesNotExist(path) if not stat.S_ISDIR(st.st_mode): raise self.InvalidRepository(path) if lock: self.lock = Lock(os.path.join(path, 'lock'), exclusive, timeout=lock_wait).acquire() else: self.lock = None self.config = ConfigParser(interpolation=None) try: with open(os.path.join(self.path, 'config')) as fd: self.config.read_file(fd) except FileNotFoundError: self.close() raise self.InvalidRepository(self.path) if 'repository' not in self.config.sections(): self.close() raise self.InvalidRepositoryConfig(path, 'no repository section found') repo_version = self.config.getint('repository', 'version') if repo_version != 1: self.close() raise self.InvalidRepositoryConfig( path, 'repository version %d is not supported by this borg version' % repo_version ) self.max_segment_size = parse_file_size(self.config.get('repository', 'max_segment_size')) if self.max_segment_size >= MAX_SEGMENT_SIZE_LIMIT: self.close() raise self.InvalidRepositoryConfig(path, 'max_segment_size >= %d' % MAX_SEGMENT_SIZE_LIMIT) # issue 3592 self.segments_per_dir = self.config.getint('repository', 'segments_per_dir') self.additional_free_space = parse_file_size(self.config.get('repository', 'additional_free_space', fallback=0)) # append_only can be set in the constructor # it shouldn't be overridden (True -> False) here self.append_only = self.append_only or self.config.getboolean('repository', 'append_only', fallback=False) if self.storage_quota is None: # self.storage_quota is None => no explicit storage_quota was specified, use repository setting. self.storage_quota = parse_file_size(self.config.get('repository', 'storage_quota', fallback=0)) self.id = hex_to_bin(self.config.get('repository', 'id').strip(), length=32) self.io = LoggedIO(self.path, self.max_segment_size, self.segments_per_dir) if self.check_segment_magic: # read a segment and check whether we are dealing with a non-upgraded Attic repository segment = self.io.get_latest_segment() if segment is not None and self.io.get_segment_magic(segment) == ATTIC_MAGIC: self.close() raise self.AtticRepository(path) def close(self): if self.lock: if self.io: self.io.close() self.io = None self.lock.release() self.lock = None def commit(self, save_space=False, compact=True, threshold=0.1, cleanup_commits=False): """Commit transaction """ # save_space is not used anymore, but stays for RPC/API compatibility. if self.transaction_doomed: exception = self.transaction_doomed self.rollback() raise exception self.check_free_space() self.log_storage_quota() segment = self.io.write_commit() self.segments.setdefault(segment, 0) self.compact[segment] += LoggedIO.header_fmt.size if compact and not self.append_only: if cleanup_commits: # due to bug #2850, there might be a lot of commit-only segment files. # this is for a one-time cleanup of these 17byte files. for segment, filename in self.io.segment_iterator(): if os.path.getsize(filename) == 17: self.segments[segment] = 0 self.compact[segment] = LoggedIO.header_fmt.size self.compact_segments(threshold) self.write_index() self.rollback() def _read_integrity(self, transaction_id, key): integrity_file = 'integrity.%d' % transaction_id integrity_path = os.path.join(self.path, integrity_file) try: with open(integrity_path, 'rb') as fd: integrity = msgpack.unpack(fd) except FileNotFoundError: return if integrity.get(b'version') != 2: logger.warning('Unknown integrity data version %r in %s', integrity.get(b'version'), integrity_file) return return integrity[key].decode() def open_index(self, transaction_id, auto_recover=True): if transaction_id is None: return NSIndex() index_path = os.path.join(self.path, 'index.%d' % transaction_id) integrity_data = self._read_integrity(transaction_id, b'index') try: with IntegrityCheckedFile(index_path, write=False, integrity_data=integrity_data) as fd: return NSIndex.read(fd) except (ValueError, OSError, FileIntegrityError) as exc: logger.warning('Repository index missing or corrupted, trying to recover from: %s', exc) os.unlink(index_path) if not auto_recover: raise self.prepare_txn(self.get_transaction_id()) # don't leave an open transaction around self.commit(compact=False) return self.open_index(self.get_transaction_id()) def prepare_txn(self, transaction_id, do_cleanup=True): self._active_txn = True if self.do_lock and not self.lock.got_exclusive_lock(): if self.exclusive is not None: # self.exclusive is either True or False, thus a new client is active here. # if it is False and we get here, the caller did not use exclusive=True although # it is needed for a write operation. if it is True and we get here, something else # went very wrong, because we should have a exclusive lock, but we don't. raise AssertionError("bug in code, exclusive lock should exist here") # if we are here, this is an old client talking to a new server (expecting lock upgrade). # or we are replaying segments and might need a lock upgrade for that. try: self.lock.upgrade() except (LockError, LockErrorT): # if upgrading the lock to exclusive fails, we do not have an # active transaction. this is important for "serve" mode, where # the repository instance lives on - even if exceptions happened. self._active_txn = False raise if not self.index or transaction_id is None: try: self.index = self.open_index(transaction_id, auto_recover=False) except (ValueError, OSError, FileIntegrityError) as exc: logger.warning('Checking repository transaction due to previous error: %s', exc) self.check_transaction() self.index = self.open_index(transaction_id, auto_recover=False) if transaction_id is None: self.segments = {} # XXX bad name: usage_count_of_segment_x = self.segments[x] self.compact = FreeSpace() # XXX bad name: freeable_space_of_segment_x = self.compact[x] self.storage_quota_use = 0 self.shadow_index.clear() else: if do_cleanup: self.io.cleanup(transaction_id) hints_path = os.path.join(self.path, 'hints.%d' % transaction_id) index_path = os.path.join(self.path, 'index.%d' % transaction_id) integrity_data = self._read_integrity(transaction_id, b'hints') try: with IntegrityCheckedFile(hints_path, write=False, integrity_data=integrity_data) as fd: hints = msgpack.unpack(fd) except (msgpack.UnpackException, FileNotFoundError, FileIntegrityError) as e: logger.warning('Repository hints file missing or corrupted, trying to recover: %s', e) if not isinstance(e, FileNotFoundError): os.unlink(hints_path) # index must exist at this point os.unlink(index_path) self.check_transaction() self.prepare_txn(transaction_id) return if hints[b'version'] == 1: logger.debug('Upgrading from v1 hints.%d', transaction_id) self.segments = hints[b'segments'] self.compact = FreeSpace() self.storage_quota_use = 0 self.shadow_index = {} for segment in sorted(hints[b'compact']): logger.debug('Rebuilding sparse info for segment %d', segment) self._rebuild_sparse(segment) logger.debug('Upgrade to v2 hints complete') elif hints[b'version'] != 2: raise ValueError('Unknown hints file version: %d' % hints[b'version']) else: self.segments = hints[b'segments'] self.compact = FreeSpace(hints[b'compact']) self.storage_quota_use = hints.get(b'storage_quota_use', 0) self.shadow_index = hints.get(b'shadow_index', {}) self.log_storage_quota() # Drop uncommitted segments in the shadow index for key, shadowed_segments in self.shadow_index.items(): for segment in list(shadowed_segments): if segment > transaction_id: shadowed_segments.remove(segment) def write_index(self): def flush_and_sync(fd): fd.flush() os.fsync(fd.fileno()) def rename_tmp(file): os.replace(file + ".tmp", file) hints = { b'version': 2, b'segments': self.segments, b'compact': self.compact, b'storage_quota_use': self.storage_quota_use, b'shadow_index': self.shadow_index, } integrity = { # Integrity version started at 2, the current hints version. # Thus, integrity version == hints version, for now. b'version': 2, } transaction_id = self.io.get_segments_transaction_id() assert transaction_id is not None # Log transaction in append-only mode if self.append_only: with open(os.path.join(self.path, 'transactions'), 'a') as log: print('transaction %d, UTC time %s' % ( transaction_id, utcnow().strftime(ISO_FORMAT)), file=log) # Write hints file hints_name = 'hints.%d' % transaction_id hints_file = os.path.join(self.path, hints_name) with IntegrityCheckedFile(hints_file + '.tmp', filename=hints_name, write=True) as fd: msgpack.pack(hints, fd) flush_and_sync(fd) integrity[b'hints'] = fd.integrity_data # Write repository index index_name = 'index.%d' % transaction_id index_file = os.path.join(self.path, index_name) with IntegrityCheckedFile(index_file + '.tmp', filename=index_name, write=True) as fd: # XXX: Consider using SyncFile for index write-outs. self.index.write(fd) flush_and_sync(fd) integrity[b'index'] = fd.integrity_data # Write integrity file, containing checksums of the hints and index files integrity_name = 'integrity.%d' % transaction_id integrity_file = os.path.join(self.path, integrity_name) with open(integrity_file + '.tmp', 'wb') as fd: msgpack.pack(integrity, fd) flush_and_sync(fd) # Rename the integrity file first rename_tmp(integrity_file) sync_dir(self.path) # Rename the others after the integrity file is hypothetically on disk rename_tmp(hints_file) rename_tmp(index_file) sync_dir(self.path) # Remove old auxiliary files current = '.%d' % transaction_id for name in os.listdir(self.path): if not name.startswith(('index.', 'hints.', 'integrity.')): continue if name.endswith(current): continue os.unlink(os.path.join(self.path, name)) self.index = None def check_free_space(self): """Pre-commit check for sufficient free space to actually perform the commit.""" # As a baseline we take four times the current (on-disk) index size. # At this point the index may only be updated by compaction, which won't resize it. # We still apply a factor of four so that a later, separate invocation can free space # (journaling all deletes for all chunks is one index size) or still make minor additions # (which may grow the index up to twice its current size). # Note that in a subsequent operation the committed index is still on-disk, therefore we # arrive at index_size * (1 + 2 + 1). # In that order: journaled deletes (1), hashtable growth (2), persisted index (1). required_free_space = self.index.size() * 4 # Conservatively estimate hints file size: # 10 bytes for each segment-refcount pair, 10 bytes for each segment-space pair # Assume maximum of 5 bytes per integer. Segment numbers will usually be packed more densely (1-3 bytes), # as will refcounts and free space integers. For 5 MiB segments this estimate is good to ~20 PB repo size. # Add 4K to generously account for constant format overhead. hints_size = len(self.segments) * 10 + len(self.compact) * 10 + 4096 required_free_space += hints_size required_free_space += self.additional_free_space if not self.append_only: full_segment_size = self.max_segment_size + MAX_OBJECT_SIZE if len(self.compact) < 10: # This is mostly for the test suite to avoid overestimated free space needs. This can be annoying # if TMP is a small-ish tmpfs. compact_working_space = 0 for segment, free in self.compact.items(): try: compact_working_space += self.io.segment_size(segment) - free except FileNotFoundError: # looks like self.compact is referring to a non-existent segment file, ignore it. pass logger.debug('check_free_space: few segments, not requiring a full free segment') compact_working_space = min(compact_working_space, full_segment_size) logger.debug('check_free_space: calculated working space for compact as %d bytes', compact_working_space) required_free_space += compact_working_space else: # Keep one full worst-case segment free in non-append-only mode required_free_space += full_segment_size try: free_space = shutil.disk_usage(self.path).free except OSError as os_error: logger.warning('Failed to check free space before committing: ' + str(os_error)) return logger.debug(f'check_free_space: required bytes {required_free_space}, free bytes {free_space}') if free_space < required_free_space: if self.created: logger.error('Not enough free space to initialize repository at this location.') self.destroy() else: self._rollback(cleanup=True) formatted_required = format_file_size(required_free_space) formatted_free = format_file_size(free_space) raise self.InsufficientFreeSpaceError(formatted_required, formatted_free) def log_storage_quota(self): if self.storage_quota: logger.info('Storage quota: %s out of %s used.', format_file_size(self.storage_quota_use), format_file_size(self.storage_quota)) def compact_segments(self, threshold): """Compact sparse segments by copying data into new segments """ if not self.compact: logger.debug('nothing to do: compact empty') return quota_use_before = self.storage_quota_use index_transaction_id = self.get_index_transaction_id() segments = self.segments unused = [] # list of segments, that are not used anymore def complete_xfer(intermediate=True): # complete the current transfer (when some target segment is full) nonlocal unused # commit the new, compact, used segments segment = self.io.write_commit(intermediate=intermediate) self.segments.setdefault(segment, 0) self.compact[segment] += LoggedIO.header_fmt.size logger.debug('complete_xfer: wrote %scommit at segment %d', 'intermediate ' if intermediate else '', segment) # get rid of the old, sparse, unused segments. free space. for segment in unused: logger.debug('complete_xfer: deleting unused segment %d', segment) count = self.segments.pop(segment) assert count == 0, 'Corrupted segment reference count - corrupted index or hints' self.io.delete_segment(segment) del self.compact[segment] unused = [] logger.debug('Compaction started (threshold is %i%%).', threshold * 100) pi = ProgressIndicatorPercent(total=len(self.compact), msg='Compacting segments %3.0f%%', step=1, msgid='repository.compact_segments') for segment, freeable_space in sorted(self.compact.items()): if not self.io.segment_exists(segment): logger.warning('segment %d not found, but listed in compaction data', segment) del self.compact[segment] pi.show() continue segment_size = self.io.segment_size(segment) freeable_ratio = 1.0 * freeable_space / segment_size # we want to compact if: # - we can free a considerable relative amount of space (freeable_ratio over some threshold) if not (freeable_ratio > threshold): logger.debug('not compacting segment %d (maybe freeable: %2.2f%% [%d bytes])', segment, freeable_ratio * 100.0, freeable_space) pi.show() continue segments.setdefault(segment, 0) logger.debug('compacting segment %d with usage count %d (maybe freeable: %2.2f%% [%d bytes])', segment, segments[segment], freeable_ratio * 100.0, freeable_space) for tag, key, offset, data in self.io.iter_objects(segment, include_data=True): if tag == TAG_COMMIT: continue in_index = self.index.get(key) is_index_object = in_index == (segment, offset) if tag == TAG_PUT and is_index_object: try: new_segment, offset = self.io.write_put(key, data, raise_full=True) except LoggedIO.SegmentFull: complete_xfer() new_segment, offset = self.io.write_put(key, data) self.index[key] = new_segment, offset segments.setdefault(new_segment, 0) segments[new_segment] += 1 segments[segment] -= 1 elif tag == TAG_PUT and not is_index_object: # If this is a PUT shadowed by a later tag, then it will be gone when this segment is deleted after # this loop. Therefore it is removed from the shadow index. try: self.shadow_index[key].remove(segment) except (KeyError, ValueError): # do not remove entry with empty shadowed_segments list here, # it is needed for shadowed_put_exists code (see below)! pass self.storage_quota_use -= len(data) + self.io.put_header_fmt.size elif tag == TAG_DELETE and not in_index: # If the shadow index doesn't contain this key, then we can't say if there's a shadowed older tag, # therefore we do not drop the delete, but write it to a current segment. key_not_in_shadow_index = key not in self.shadow_index # If the key is in the shadow index and there is any segment with an older PUT of this # key, we have a shadowed put. shadowed_put_exists = key_not_in_shadow_index or any( shadowed < segment for shadowed in self.shadow_index[key]) delete_is_not_stable = index_transaction_id is None or segment > index_transaction_id if shadowed_put_exists or delete_is_not_stable: # (introduced in 6425d16aa84be1eaaf88) # This is needed to avoid object un-deletion if we crash between the commit and the deletion # of old segments in complete_xfer(). # # However, this only happens if the crash also affects the FS to the effect that file deletions # did not materialize consistently after journal recovery. If they always materialize in-order # then this is not a problem, because the old segment containing a deleted object would be deleted # before the segment containing the delete. # # Consider the following series of operations if we would not do this, ie. this entire if: # would be removed. # Columns are segments, lines are different keys (line 1 = some key, line 2 = some other key) # Legend: P=TAG_PUT, D=TAG_DELETE, c=commit, i=index is written for latest commit # # Segment | 1 | 2 | 3 # --------+-------+-----+------ # Key 1 | P | D | # Key 2 | P | | P # commits | c i | c | c i # --------+-------+-----+------ # ^- compact_segments starts # ^- complete_xfer commits, after that complete_xfer deletes # segments 1 and 2 (and then the index would be written). # # Now we crash. But only segment 2 gets deleted, while segment 1 is still around. Now key 1 # is suddenly undeleted (because the delete in segment 2 is now missing). # Again, note the requirement here. We delete these in the correct order that this doesn't happen, # and only if the FS materialization of these deletes is reordered or parts dropped this can happen. # In this case it doesn't cause outright corruption, 'just' an index count mismatch, which will be # fixed by borg-check --repair. # # Note that in this check the index state is the proxy for a "most definitely settled" repository state, # ie. the assumption is that *all* operations on segments <= index state are completed and stable. try: new_segment, size = self.io.write_delete(key, raise_full=True) except LoggedIO.SegmentFull: complete_xfer() new_segment, size = self.io.write_delete(key) self.compact[new_segment] += size segments.setdefault(new_segment, 0) else: logger.debug('dropping DEL for id %s - seg %d, iti %r, knisi %r, spe %r, dins %r, si %r', bin_to_hex(key), segment, index_transaction_id, key_not_in_shadow_index, shadowed_put_exists, delete_is_not_stable, self.shadow_index.get(key)) # we did not keep the delete tag for key (see if-branch) if not self.shadow_index[key]: # shadowed segments list is empty -> remove it del self.shadow_index[key] assert segments[segment] == 0, 'Corrupted segment reference count - corrupted index or hints' unused.append(segment) pi.show() pi.finish() complete_xfer(intermediate=False) self.io.clear_empty_dirs() quota_use_after = self.storage_quota_use logger.info('compaction freed about %s repository space.', format_file_size(quota_use_before - quota_use_after)) logger.debug('compaction completed.') def replay_segments(self, index_transaction_id, segments_transaction_id): # fake an old client, so that in case we do not have an exclusive lock yet, prepare_txn will upgrade the lock: remember_exclusive = self.exclusive self.exclusive = None self.prepare_txn(index_transaction_id, do_cleanup=False) try: segment_count = sum(1 for _ in self.io.segment_iterator()) pi = ProgressIndicatorPercent(total=segment_count, msg='Replaying segments %3.0f%%', msgid='repository.replay_segments') for i, (segment, filename) in enumerate(self.io.segment_iterator()): pi.show(i) if index_transaction_id is not None and segment <= index_transaction_id: continue if segment > segments_transaction_id: break objects = self.io.iter_objects(segment) self._update_index(segment, objects) pi.finish() self.write_index() finally: self.exclusive = remember_exclusive self.rollback() def _update_index(self, segment, objects, report=None): """some code shared between replay_segments and check""" self.segments[segment] = 0 for tag, key, offset, size in objects: if tag == TAG_PUT: try: # If this PUT supersedes an older PUT, mark the old segment for compaction and count the free space s, _ = self.index[key] self.compact[s] += size self.segments[s] -= 1 self.shadow_index.setdefault(key, []).append(s) except KeyError: pass self.index[key] = segment, offset self.segments[segment] += 1 self.storage_quota_use += size # note: size already includes the put_header_fmt overhead elif tag == TAG_DELETE: try: # if the deleted PUT is not in the index, there is nothing to clean up s, offset = self.index.pop(key) except KeyError: pass else: if self.io.segment_exists(s): # the old index is not necessarily valid for this transaction (e.g. compaction); if the segment # is already gone, then it was already compacted. self.segments[s] -= 1 size = self.io.read(s, offset, key, read_data=False) self.compact[s] += size self.shadow_index.setdefault(key, []).append(s) elif tag == TAG_COMMIT: continue else: msg = f'Unexpected tag {tag} in segment {segment}' if report is None: raise self.CheckNeeded(msg) else: report(msg) if self.segments[segment] == 0: self.compact[segment] = self.io.segment_size(segment) def _rebuild_sparse(self, segment): """Rebuild sparse bytes count for a single segment relative to the current index.""" try: segment_size = self.io.segment_size(segment) except FileNotFoundError: # segment does not exist any more, remove it from the mappings # note: no need to self.compact.pop(segment), as we start from empty mapping. self.segments.pop(segment) return if self.segments[segment] == 0: self.compact[segment] = segment_size return self.compact[segment] = 0 for tag, key, offset, size in self.io.iter_objects(segment, read_data=False): if tag == TAG_PUT: if self.index.get(key, (-1, -1)) != (segment, offset): # This PUT is superseded later self.compact[segment] += size elif tag == TAG_DELETE: # The outcome of the DELETE has been recorded in the PUT branch already self.compact[segment] += size def check(self, repair=False, save_space=False, max_duration=0): """Check repository consistency This method verifies all segment checksums and makes sure the index is consistent with the data stored in the segments. """ if self.append_only and repair: raise ValueError(self.path + " is in append-only mode") error_found = False def report_error(msg, *args): nonlocal error_found error_found = True logger.error(msg, *args) logger.info('Starting repository check') assert not self._active_txn try: transaction_id = self.get_transaction_id() current_index = self.open_index(transaction_id) logger.debug('Read committed index of transaction %d', transaction_id) except Exception as exc: transaction_id = self.io.get_segments_transaction_id() current_index = None logger.debug('Failed to read committed index (%s)', exc) if transaction_id is None: logger.debug('No segments transaction found') transaction_id = self.get_index_transaction_id() if transaction_id is None: logger.debug('No index transaction found, trying latest segment') transaction_id = self.io.get_latest_segment() if transaction_id is None: report_error('This repository contains no valid data.') return False if repair: self.io.cleanup(transaction_id) segments_transaction_id = self.io.get_segments_transaction_id() logger.debug('Segment transaction is %s', segments_transaction_id) logger.debug('Determined transaction is %s', transaction_id) self.prepare_txn(None) # self.index, self.compact, self.segments, self.shadow_index all empty now! segment_count = sum(1 for _ in self.io.segment_iterator()) logger.debug('Found %d segments', segment_count) partial = bool(max_duration) assert not (repair and partial) mode = 'partial' if partial else 'full' if partial: # continue a past partial check (if any) or start one from beginning last_segment_checked = self.config.getint('repository', 'last_segment_checked', fallback=-1) logger.info('skipping to segments >= %d', last_segment_checked + 1) else: # start from the beginning and also forget about any potential past partial checks last_segment_checked = -1 self.config.remove_option('repository', 'last_segment_checked') self.save_config(self.path, self.config) t_start = time.monotonic() pi = ProgressIndicatorPercent(total=segment_count, msg='Checking segments %3.1f%%', step=0.1, msgid='repository.check') segment = -1 # avoid uninitialized variable if there are no segment files at all for i, (segment, filename) in enumerate(self.io.segment_iterator()): pi.show(i) if segment <= last_segment_checked: continue if segment > transaction_id: continue logger.debug('checking segment file %s...', filename) try: objects = list(self.io.iter_objects(segment)) except IntegrityError as err: report_error(str(err)) objects = [] if repair: self.io.recover_segment(segment, filename) objects = list(self.io.iter_objects(segment)) if not partial: self._update_index(segment, objects, report_error) if partial and time.monotonic() > t_start + max_duration: logger.info('finished partial segment check, last segment checked is %d', segment) self.config.set('repository', 'last_segment_checked', str(segment)) self.save_config(self.path, self.config) break else: logger.info('finished segment check at segment %d', segment) self.config.remove_option('repository', 'last_segment_checked') self.save_config(self.path, self.config) pi.finish() # self.index, self.segments, self.compact now reflect the state of the segment files up to # We might need to add a commit tag if no committed segment is found if repair and segments_transaction_id is None: report_error(f'Adding commit tag to segment {transaction_id}') self.io.segment = transaction_id + 1 self.io.write_commit() if not partial: logger.info('Starting repository index check') if current_index and not repair: # current_index = "as found on disk" # self.index = "as rebuilt in-memory from segments" if len(current_index) != len(self.index): report_error('Index object count mismatch.') report_error('committed index: %d objects', len(current_index)) report_error('rebuilt index: %d objects', len(self.index)) else: logger.info('Index object count match.') line_format = 'ID: %-64s rebuilt index: %-16s committed index: %-16s' not_found = '' for key, value in self.index.iteritems(): current_value = current_index.get(key, not_found) if current_value != value: report_error(line_format, bin_to_hex(key), value, current_value) for key, current_value in current_index.iteritems(): if key in self.index: continue value = self.index.get(key, not_found) if current_value != value: report_error(line_format, bin_to_hex(key), value, current_value) if repair: self.write_index() self.rollback() if error_found: if repair: logger.info('Finished %s repository check, errors found and repaired.', mode) else: logger.error('Finished %s repository check, errors found.', mode) else: logger.info('Finished %s repository check, no problems found.', mode) return not error_found or repair def scan_low_level(self, segment=None, offset=None): """Very low level scan over all segment file entries. It does NOT care about what's committed and what not. It does NOT care whether an object might be deleted or superseded later. It just yields anything it finds in the segment files. This is intended as a last-resort way to get access to all repo contents of damaged repos, when there is uncommitted, but valuable data in there... When segment or segment+offset is given, limit processing to this location only. """ for current_segment, filename in self.io.segment_iterator(segment=segment): if segment is not None and current_segment > segment: break try: for tag, key, current_offset, data in self.io.iter_objects(segment=current_segment, offset=offset or 0, include_data=True): if offset is not None and current_offset > offset: break yield key, data, tag, current_segment, current_offset except IntegrityError as err: logger.error('Segment %d (%s) has IntegrityError(s) [%s] - skipping.' % ( current_segment, filename, str(err))) def _rollback(self, *, cleanup): """ """ if cleanup: self.io.cleanup(self.io.get_segments_transaction_id()) self.index = None self._active_txn = False self.transaction_doomed = None def rollback(self): # note: when used in remote mode, this is time limited, see RemoteRepository.shutdown_time. self._rollback(cleanup=False) def __len__(self): if not self.index: self.index = self.open_index(self.get_transaction_id()) return len(self.index) def __contains__(self, id): if not self.index: self.index = self.open_index(self.get_transaction_id()) return id in self.index def list(self, limit=None, marker=None): """ list IDs starting from after id - in index (pseudo-random) order. """ if not self.index: self.index = self.open_index(self.get_transaction_id()) return [id_ for id_, _ in islice(self.index.iteritems(marker=marker), limit)] def scan(self, limit=None, marker=None): """ list IDs starting from after id - in on-disk order, so that a client fetching data in this order does linear reads and reuses stuff from disk cache. We rely on repository.check() has run already (either now or some time before) and that: - if we are called from a borg check command, self.index is a valid, fresh, in-sync repo index. - if we are called from elsewhere, either self.index or the on-disk index is valid and in-sync. - the repository segments are valid (no CRC errors). if we encounter CRC errors in segment entry headers, rest of segment is skipped. """ if limit is not None and limit < 1: raise ValueError('please use limit > 0 or limit = None') if not self.index: transaction_id = self.get_transaction_id() self.index = self.open_index(transaction_id) at_start = marker is None # smallest valid seg is 0, smallest valid offs is 8 start_segment, start_offset = (0, 0) if at_start else self.index[marker] result = [] for segment, filename in self.io.segment_iterator(start_segment): obj_iterator = self.io.iter_objects(segment, start_offset, read_data=False, include_data=False) while True: try: tag, id, offset, size = next(obj_iterator) except (StopIteration, IntegrityError): # either end-of-segment or an error - we can not seek to objects at # higher offsets than one that has an error in the header fields break if start_offset > 0: # we are using a marker and the marker points to the last object we have already # returned in the previous scan() call - thus, we need to skip this one object. # also, for the next segment, we need to start at offset 0. start_offset = 0 continue if tag == TAG_PUT and (segment, offset) == self.index.get(id): # we have found an existing and current object result.append(id) if len(result) == limit: return result return result def get(self, id): if not self.index: self.index = self.open_index(self.get_transaction_id()) try: segment, offset = self.index[id] return self.io.read(segment, offset, id) except KeyError: raise self.ObjectNotFound(id, self.path) from None def get_many(self, ids, is_preloaded=False): for id_ in ids: yield self.get(id_) def put(self, id, data, wait=True): """put a repo object Note: when doing calls with wait=False this gets async and caller must deal with async results / exceptions later. """ if not self._active_txn: self.prepare_txn(self.get_transaction_id()) try: segment, offset = self.index[id] except KeyError: pass else: # this put call supersedes a previous put to same id. # it is essential to do a delete first to get correct quota bookkeeping # and also a correctly updated shadow_index, so that the compaction code # does not wrongly resurrect an old PUT by dropping a DEL that is still needed. self._delete(id, segment, offset) segment, offset = self.io.write_put(id, data) self.storage_quota_use += len(data) + self.io.put_header_fmt.size self.segments.setdefault(segment, 0) self.segments[segment] += 1 self.index[id] = segment, offset if self.storage_quota and self.storage_quota_use > self.storage_quota: self.transaction_doomed = self.StorageQuotaExceeded( format_file_size(self.storage_quota), format_file_size(self.storage_quota_use)) raise self.transaction_doomed def delete(self, id, wait=True): """delete a repo object Note: when doing calls with wait=False this gets async and caller must deal with async results / exceptions later. """ if not self._active_txn: self.prepare_txn(self.get_transaction_id()) try: segment, offset = self.index.pop(id) except KeyError: raise self.ObjectNotFound(id, self.path) from None self._delete(id, segment, offset) def _delete(self, id, segment, offset): # common code used by put and delete # because we'll write a DEL tag to the repository, we must update the shadow index. # this is always true, no matter whether we are called from put() or delete(). # the compaction code needs this to not drop DEL tags if they are still required # to keep a PUT in an earlier segment in the "effectively deleted" state. self.shadow_index.setdefault(id, []).append(segment) self.segments[segment] -= 1 size = self.io.read(segment, offset, id, read_data=False) self.compact[segment] += size segment, size = self.io.write_delete(id) self.compact[segment] += size self.segments.setdefault(segment, 0) def async_response(self, wait=True): """Get one async result (only applies to remote repositories). async commands (== calls with wait=False, e.g. delete and put) have no results, but may raise exceptions. These async exceptions must get collected later via async_response() calls. Repeat the call until it returns None. The previous calls might either return one (non-None) result or raise an exception. If wait=True is given and there are outstanding responses, it will wait for them to arrive. With wait=False, it will only return already received responses. """ def preload(self, ids): """Preload objects (only applies to remote repositories) """ class LoggedIO: class SegmentFull(Exception): """raised when a segment is full, before opening next""" header_fmt = struct.Struct(' transaction_id: self.delete_segment(segment) count += 1 else: break logger.debug('Cleaned up %d uncommitted segment files (== everything after segment %d).', count, transaction_id) def is_committed_segment(self, segment): """Check if segment ends with a COMMIT_TAG tag """ try: iterator = self.iter_objects(segment) except IntegrityError: return False with open(self.segment_filename(segment), 'rb') as fd: try: fd.seek(-self.header_fmt.size, os.SEEK_END) except OSError as e: # return False if segment file is empty or too small if e.errno == errno.EINVAL: return False raise e if fd.read(self.header_fmt.size) != self.COMMIT: return False seen_commit = False while True: try: tag, key, offset, _ = next(iterator) except IntegrityError: return False except StopIteration: break if tag == TAG_COMMIT: seen_commit = True continue if seen_commit: return False return seen_commit def segment_filename(self, segment): return os.path.join(self.path, 'data', str(segment // self.segments_per_dir), str(segment)) def get_write_fd(self, no_new=False, want_new=False, raise_full=False): if not no_new and (want_new or self.offset and self.offset > self.limit): if raise_full: raise self.SegmentFull self.close_segment() if not self._write_fd: if self.segment % self.segments_per_dir == 0: dirname = os.path.join(self.path, 'data', str(self.segment // self.segments_per_dir)) if not os.path.exists(dirname): os.mkdir(dirname) sync_dir(os.path.join(self.path, 'data')) self._write_fd = SyncFile(self.segment_filename(self.segment), binary=True) self._write_fd.write(MAGIC) self.offset = MAGIC_LEN if self.segment in self.fds: # we may have a cached fd for a segment file we already deleted and # we are writing now a new segment file to same file name. get rid of # of the cached fd that still refers to the old file, so it will later # get repopulated (on demand) with a fd that refers to the new file. del self.fds[self.segment] return self._write_fd def get_fd(self, segment): # note: get_fd() returns a fd with undefined file pointer position, # so callers must always seek() to desired position afterwards. now = time.monotonic() def open_fd(): fd = open(self.segment_filename(segment), 'rb') self.fds[segment] = (now, fd) return fd def clean_old(): # we regularly get rid of all old FDs here: if now - self._fds_cleaned > FD_MAX_AGE // 8: self._fds_cleaned = now for k, ts_fd in list(self.fds.items()): ts, fd = ts_fd if now - ts > FD_MAX_AGE: # we do not want to touch long-unused file handles to # avoid ESTALE issues (e.g. on network filesystems). del self.fds[k] clean_old() try: ts, fd = self.fds[segment] except KeyError: fd = open_fd() else: # we only have fresh enough stuff here. # update the timestamp of the lru cache entry. self.fds.upd(segment, (now, fd)) return fd def close_segment(self): # set self._write_fd to None early to guard against reentry from error handling code paths: fd, self._write_fd = self._write_fd, None if fd is not None: self.segment += 1 self.offset = 0 fd.close() def delete_segment(self, segment): if segment in self.fds: del self.fds[segment] try: safe_unlink(self.segment_filename(segment)) except FileNotFoundError: pass def clear_empty_dirs(self): """Delete empty segment dirs, i.e those with no segment files. """ data_dir = os.path.join(self.path, 'data') segment_dirs = self.get_segment_dirs(data_dir) for segment_dir in segment_dirs: try: # os.rmdir will only delete the directory if it is empty # so we don't need to explicitly check for emptiness first. os.rmdir(segment_dir) except OSError: # OSError is raised by os.rmdir if directory is not empty. This is expected. # Its subclass FileNotFoundError may be raised if the directory already does not exist. Ignorable. pass sync_dir(data_dir) def segment_exists(self, segment): filename = self.segment_filename(segment) # When deleting segments, they are first truncated. If truncate(2) and unlink(2) are split # across FS transactions, then logically deleted segments will show up as truncated. return os.path.exists(filename) and os.path.getsize(filename) def segment_size(self, segment): return os.path.getsize(self.segment_filename(segment)) def get_segment_magic(self, segment): fd = self.get_fd(segment) fd.seek(0) return fd.read(MAGIC_LEN) def iter_objects(self, segment, offset=0, include_data=False, read_data=True): """ Return object iterator for *segment*. If read_data is False then include_data must be False as well. Integrity checks are skipped: all data obtained from the iterator must be considered informational. The iterator returns four-tuples of (tag, key, offset, data|size). """ fd = self.get_fd(segment) fd.seek(offset) if offset == 0: # we are touching this segment for the first time, check the MAGIC. # Repository.scan() calls us with segment > 0 when it continues an ongoing iteration # from a marker position - but then we have checked the magic before already. if fd.read(MAGIC_LEN) != MAGIC: raise IntegrityError(f'Invalid segment magic [segment {segment}, offset {0}]') offset = MAGIC_LEN header = fd.read(self.header_fmt.size) while header: size, tag, key, data = self._read(fd, self.header_fmt, header, segment, offset, (TAG_PUT, TAG_DELETE, TAG_COMMIT), read_data=read_data) if include_data: yield tag, key, offset, data else: yield tag, key, offset, size offset += size # we must get the fd via get_fd() here again as we yielded to our caller and it might # have triggered closing of the fd we had before (e.g. by calling io.read() for # different segment(s)). # by calling get_fd() here again we also make our fd "recently used" so it likely # does not get kicked out of self.fds LRUcache. fd = self.get_fd(segment) fd.seek(offset) header = fd.read(self.header_fmt.size) def recover_segment(self, segment, filename): logger.info('attempting to recover ' + filename) if segment in self.fds: del self.fds[segment] if os.path.getsize(filename) < MAGIC_LEN + self.header_fmt.size: # this is either a zero-byte file (which would crash mmap() below) or otherwise # just too small to be a valid non-empty segment file, so do a shortcut here: with SaveFile(filename, binary=True) as fd: fd.write(MAGIC) return with SaveFile(filename, binary=True) as dst_fd: with open(filename, 'rb') as src_fd: # note: file must not be 0 size or mmap() will crash. with mmap.mmap(src_fd.fileno(), 0, access=mmap.ACCESS_READ) as mm: # memoryview context manager is problematic, see https://bugs.python.org/issue35686 data = memoryview(mm) d = data try: dst_fd.write(MAGIC) while len(d) >= self.header_fmt.size: crc, size, tag = self.header_fmt.unpack(d[:self.header_fmt.size]) if size > MAX_OBJECT_SIZE or tag > MAX_TAG_ID or size < self.header_fmt.size \ or size > len(d) or crc32(d[4:size]) & 0xffffffff != crc: d = d[1:] continue dst_fd.write(d[:size]) d = d[size:] finally: del d data.release() def read(self, segment, offset, id, read_data=True): """ Read entry from *segment* at *offset* with *id*. If read_data is False the size of the entry is returned instead and integrity checks are skipped. The return value should thus be considered informational. """ if segment == self.segment and self._write_fd: self._write_fd.sync() fd = self.get_fd(segment) fd.seek(offset) header = fd.read(self.put_header_fmt.size) size, tag, key, data = self._read(fd, self.put_header_fmt, header, segment, offset, (TAG_PUT, ), read_data) if id != key: raise IntegrityError('Invalid segment entry header, is not for wanted id [segment {}, offset {}]'.format( segment, offset)) return data if read_data else size def _read(self, fd, fmt, header, segment, offset, acceptable_tags, read_data=True): # some code shared by read() and iter_objects() # See comment on MAX_TAG_ID for details assert max(acceptable_tags) <= MAX_TAG_ID, 'Exceeding MAX_TAG_ID will break backwards compatibility' try: hdr_tuple = fmt.unpack(header) except struct.error as err: raise IntegrityError('Invalid segment entry header [segment {}, offset {}]: {}'.format( segment, offset, err)) from None if fmt is self.put_header_fmt: crc, size, tag, key = hdr_tuple elif fmt is self.header_fmt: crc, size, tag = hdr_tuple key = None else: raise TypeError("_read called with unsupported format") if size > MAX_OBJECT_SIZE: # if you get this on an archive made with borg < 1.0.7 and millions of files and # you need to restore it, you can disable this check by using "if False:" above. raise IntegrityError('Invalid segment entry size {} - too big [segment {}, offset {}]'.format( size, segment, offset)) if size < fmt.size: raise IntegrityError('Invalid segment entry size {} - too small [segment {}, offset {}]'.format( size, segment, offset)) length = size - fmt.size if read_data: data = fd.read(length) if len(data) != length: raise IntegrityError('Segment entry data short read [segment {}, offset {}]: expected {}, got {} bytes'.format( segment, offset, length, len(data))) if crc32(data, crc32(memoryview(header)[4:])) & 0xffffffff != crc: raise IntegrityError('Segment entry checksum mismatch [segment {}, offset {}]'.format( segment, offset)) if key is None and tag in (TAG_PUT, TAG_DELETE): key, data = data[:32], data[32:] else: if key is None and tag in (TAG_PUT, TAG_DELETE): key = fd.read(32) length -= 32 if len(key) != 32: raise IntegrityError('Segment entry key short read [segment {}, offset {}]: expected {}, got {} bytes'.format( segment, offset, 32, len(key))) oldpos = fd.tell() seeked = fd.seek(length, os.SEEK_CUR) - oldpos data = None if seeked != length: raise IntegrityError('Segment entry data short seek [segment {}, offset {}]: expected {}, got {} bytes'.format( segment, offset, length, seeked)) if tag not in acceptable_tags: raise IntegrityError('Invalid segment entry header, did not get acceptable tag [segment {}, offset {}]'.format( segment, offset)) return size, tag, key, data def write_put(self, id, data, raise_full=False): data_size = len(data) if data_size > MAX_DATA_SIZE: # this would push the segment entry size beyond MAX_OBJECT_SIZE. raise IntegrityError(f'More than allowed put data [{data_size} > {MAX_DATA_SIZE}]') fd = self.get_write_fd(want_new=(id == Manifest.MANIFEST_ID), raise_full=raise_full) size = data_size + self.put_header_fmt.size offset = self.offset header = self.header_no_crc_fmt.pack(size, TAG_PUT) crc = self.crc_fmt.pack(crc32(data, crc32(id, crc32(header))) & 0xffffffff) fd.write(b''.join((crc, header, id, data))) self.offset += size return self.segment, offset def write_delete(self, id, raise_full=False): fd = self.get_write_fd(want_new=(id == Manifest.MANIFEST_ID), raise_full=raise_full) header = self.header_no_crc_fmt.pack(self.put_header_fmt.size, TAG_DELETE) crc = self.crc_fmt.pack(crc32(id, crc32(header)) & 0xffffffff) fd.write(b''.join((crc, header, id))) self.offset += self.put_header_fmt.size return self.segment, self.put_header_fmt.size def write_commit(self, intermediate=False): # Intermediate commits go directly into the current segment - this makes checking their validity more # expensive, but is faster and reduces clobber. Final commits go into a new segment. fd = self.get_write_fd(want_new=not intermediate, no_new=intermediate) if intermediate: fd.sync() header = self.header_no_crc_fmt.pack(self.header_fmt.size, TAG_COMMIT) crc = self.crc_fmt.pack(crc32(header) & 0xffffffff) fd.write(b''.join((crc, header))) self.close_segment() return self.segment - 1 # close_segment() increments it assert LoggedIO.put_header_fmt.size == 41 # see constants.MAX_OBJECT_SIZE ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/selftest.py0000644000076500000240000000707114641074756016156 0ustar00twstaff# Note: these tests are part of the self test, do not use or import pytest functionality here. # See borg.selftest for details. If you add/remove test methods, update SELFTEST_COUNT """ Self testing module =================== The selftest() function runs a small test suite of relatively fast tests that are meant to discover issues with the way Borg was compiled or packaged and also bugs in Borg itself. These tests are a subset of the borg/testsuite and are run with Pythons built-in unittest, hence none of the tests used for this can or should be ported to py.test currently. To assert that self test discovery works correctly the number of tests is kept in the SELFTEST_COUNT variable. SELFTEST_COUNT must be updated if new tests are added or removed to or from any of the tests used here. """ import os import sys import time from unittest import TestResult, TestSuite, defaultTestLoader from .testsuite.hashindex import HashIndexDataTestCase, HashIndexRefcountingTestCase, HashIndexTestCase from .testsuite.crypto import CryptoTestCase from .testsuite.chunker import ChunkerTestCase SELFTEST_CASES = [ HashIndexDataTestCase, HashIndexRefcountingTestCase, HashIndexTestCase, CryptoTestCase, ChunkerTestCase, ] SELFTEST_COUNT = 33 class SelfTestResult(TestResult): def __init__(self): super().__init__() self.successes = [] def addSuccess(self, test): super().addSuccess(test) self.successes.append(test) def test_name(self, test): return test.shortDescription() or str(test) def log_results(self, logger): for test, failure in self.errors + self.failures + self.unexpectedSuccesses: logger.error('self test %s FAILED:\n%s', self.test_name(test), failure) for test, reason in self.skipped: logger.warning('self test %s skipped: %s', self.test_name(test), reason) def successful_test_count(self): return len(self.successes) def selftest(logger): if os.environ.get('BORG_SELFTEST') == 'disabled': logger.debug("borg selftest disabled via BORG_SELFTEST env variable") return selftest_started = time.perf_counter() result = SelfTestResult() test_suite = TestSuite() for test_case in SELFTEST_CASES: module = sys.modules[test_case.__module__] # a normal borg user does not have pytest installed, we must not require it in the test modules used here. # note: this only detects the usual toplevel import assert 'pytest' not in dir(module), "pytest must not be imported in %s" % module.__name__ test_suite.addTest(defaultTestLoader.loadTestsFromTestCase(test_case)) test_suite.run(result) result.log_results(logger) successful_tests = result.successful_test_count() count_mismatch = successful_tests != SELFTEST_COUNT if result.wasSuccessful() and count_mismatch: # only print this if all tests succeeded logger.error("self test count (%d != %d) mismatch, either test discovery is broken or a test was added " "without updating borg.selftest", successful_tests, SELFTEST_COUNT) if not result.wasSuccessful() or count_mismatch: logger.error("self test failed\n" "Could be a bug either in Borg, the package / distribution you use, your OS or your hardware.") sys.exit(2) assert False, "sanity assertion failed: ran beyond sys.exit()" selftest_elapsed = time.perf_counter() - selftest_started logger.debug("%d self tests completed in %.2f seconds", successful_tests, selftest_elapsed) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/shellpattern.py0000644000076500000240000000440214641074756017025 0ustar00twstaffimport os import re def translate(pat, match_end=r"\Z"): """Translate a shell-style pattern to a regular expression. The pattern may include ``**`` ( stands for the platform-specific path separator; "/" on POSIX systems) for matching zero or more directory levels and "*" for matching zero or more arbitrary characters with the exception of any path separator. Wrap meta-characters in brackets for a literal match (i.e. "[?]" to match the literal character "?"). Using match_end=regex one can give a regular expression that is used to match after the regex that is generated from the pattern. The default is to match the end of the string. This function is derived from the "fnmatch" module distributed with the Python standard library. Copyright (C) 2001-2016 Python Software Foundation. All rights reserved. TODO: support {alt1,alt2} shell-style alternatives """ sep = os.path.sep n = len(pat) i = 0 res = "" while i < n: c = pat[i] i += 1 if c == "*": if i + 1 < n and pat[i] == "*" and pat[i + 1] == sep: # **/ == wildcard for 0+ full (relative) directory names with trailing slashes; the forward slash stands # for the platform-specific path separator res += fr"(?:[^\{sep}]*\{sep})*" i += 2 else: # * == wildcard for name parts (does not cross path separator) res += r"[^\%s]*" % sep elif c == "?": # ? == any single character excluding path separator res += r"[^\%s]" % sep elif c == "[": j = i if j < n and pat[j] == "!": j += 1 if j < n and pat[j] == "]": j += 1 while j < n and pat[j] != "]": j += 1 if j >= n: res += "\\[" else: stuff = pat[i:j].replace("\\", "\\\\") i = j + 1 if stuff[0] == "!": stuff = "^" + stuff[1:] elif stuff[0] == "^": stuff = "\\" + stuff res += "[%s]" % stuff else: res += re.escape(c) return "(?ms)" + res + match_end ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1719958149.847142 borgbackup-1.4.0/src/borg/testsuite/0000755000076500000240000000000014641075206015766 5ustar00twstaff././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/testsuite/__init__.py0000644000076500000240000003426114641074756020116 0ustar00twstafffrom contextlib import contextmanager import filecmp import functools import os try: import posix except ImportError: posix = None import re import stat import sys import sysconfig import tempfile import time import uuid import unittest from ..xattr import get_all from ..platform import get_flags from ..helpers import umount from ..helpers import EXIT_SUCCESS, EXIT_WARNING, EXIT_ERROR from .. import platform # Note: this is used by borg.selftest, do not use or import py.test functionality here. from ..fuse_impl import llfuse, has_pyfuse3, has_llfuse # Does this version of llfuse support ns precision? have_fuse_mtime_ns = hasattr(llfuse.EntryAttributes, 'st_mtime_ns') if llfuse else False try: from pytest import raises except: # noqa raises = None has_lchflags = hasattr(os, 'lchflags') or sys.platform.startswith('linux') try: with tempfile.NamedTemporaryFile() as file: platform.set_flags(file.name, stat.UF_NODUMP) except OSError: has_lchflags = False # The mtime get/set precision varies on different OS and Python versions if posix and 'HAVE_FUTIMENS' in getattr(posix, '_have_functions', []): st_mtime_ns_round = 0 # 1ns resolution elif 'HAVE_UTIMES' in sysconfig.get_config_vars(): st_mtime_ns_round = -3 # 1us resolution else: st_mtime_ns_round = -9 # 1s resolution if sys.platform.startswith('netbsd'): st_mtime_ns_round = -4 # 10us - strange: only >1 microsecond resolution here? def same_ts_ns(ts_ns1, ts_ns2): """compare 2 timestamps (both in nanoseconds) whether they are (roughly) equal""" diff_ts = int(abs(ts_ns1 - ts_ns2)) diff_max = 10 ** (-st_mtime_ns_round) return diff_ts <= diff_max @contextmanager def unopened_tempfile(): with tempfile.TemporaryDirectory() as tempdir: yield os.path.join(tempdir, "file") @functools.lru_cache def are_symlinks_supported(): with unopened_tempfile() as filepath: try: os.symlink('somewhere', filepath) if os.stat(filepath, follow_symlinks=False) and os.readlink(filepath) == 'somewhere': return True except OSError: pass return False @functools.lru_cache def are_hardlinks_supported(): if not hasattr(os, 'link'): # some pythons do not have os.link return False with unopened_tempfile() as file1path, unopened_tempfile() as file2path: open(file1path, 'w').close() try: os.link(file1path, file2path) stat1 = os.stat(file1path) stat2 = os.stat(file2path) if stat1.st_nlink == stat2.st_nlink == 2 and stat1.st_ino == stat2.st_ino: return True except OSError: pass return False @functools.lru_cache def are_fifos_supported(): with unopened_tempfile() as filepath: try: os.mkfifo(filepath) return True except OSError: pass except NotImplementedError: pass except AttributeError: pass return False @functools.lru_cache def is_utime_fully_supported(): with unopened_tempfile() as filepath: # Some filesystems (such as SSHFS) don't support utime on symlinks if are_symlinks_supported(): os.symlink('something', filepath) else: open(filepath, 'w').close() try: os.utime(filepath, (1000, 2000), follow_symlinks=False) new_stats = os.stat(filepath, follow_symlinks=False) if new_stats.st_atime == 1000 and new_stats.st_mtime == 2000: return True except OSError: pass except NotImplementedError: pass return False @functools.lru_cache def is_birthtime_fully_supported(): if not hasattr(os.stat_result, 'st_birthtime'): return False with unopened_tempfile() as filepath: # Some filesystems (such as SSHFS) don't support utime on symlinks if are_symlinks_supported(): os.symlink('something', filepath) else: open(filepath, 'w').close() try: birthtime, mtime, atime = 946598400, 946684800, 946771200 os.utime(filepath, (atime, birthtime), follow_symlinks=False) os.utime(filepath, (atime, mtime), follow_symlinks=False) new_stats = os.stat(filepath, follow_symlinks=False) if new_stats.st_birthtime == birthtime and new_stats.st_mtime == mtime and new_stats.st_atime == atime: return True except OSError: pass except NotImplementedError: pass return False def no_selinux(x): # selinux fails our FUSE tests, thus ignore selinux xattrs SELINUX_KEY = b'security.selinux' if isinstance(x, dict): return {k: v for k, v in x.items() if k != SELINUX_KEY} if isinstance(x, list): return [k for k in x if k != SELINUX_KEY] class BaseTestCase(unittest.TestCase): """ """ assert_in = unittest.TestCase.assertIn assert_not_in = unittest.TestCase.assertNotIn assert_equal = unittest.TestCase.assertEqual assert_not_equal = unittest.TestCase.assertNotEqual if raises: assert_raises = staticmethod(raises) else: assert_raises = unittest.TestCase.assertRaises @contextmanager def assert_creates_file(self, path): assert not os.path.exists(path), f'{path} should not exist' yield assert os.path.exists(path), f'{path} should exist' def assert_dirs_equal(self, dir1, dir2, **kwargs): diff = filecmp.dircmp(dir1, dir2) self._assert_dirs_equal_cmp(diff, **kwargs) def assert_line_exists(self, lines, expected_regexpr): assert any(re.search(expected_regexpr, line) for line in lines), f"no match for {expected_regexpr} in {lines}" def _assert_dirs_equal_cmp(self, diff, ignore_flags=False, ignore_xattrs=False, ignore_ns=False): self.assert_equal(diff.left_only, []) self.assert_equal(diff.right_only, []) self.assert_equal(diff.diff_files, []) self.assert_equal(diff.funny_files, []) for filename in diff.common: path1 = os.path.join(diff.left, filename) path2 = os.path.join(diff.right, filename) s1 = os.stat(path1, follow_symlinks=False) s2 = os.stat(path2, follow_symlinks=False) # Assume path2 is on FUSE if st_dev is different fuse = s1.st_dev != s2.st_dev attrs = ['st_uid', 'st_gid', 'st_rdev'] if not fuse or not os.path.isdir(path1): # dir nlink is always 1 on our FUSE filesystem attrs.append('st_nlink') d1 = [filename] + [getattr(s1, a) for a in attrs] d2 = [filename] + [getattr(s2, a) for a in attrs] d1.insert(1, oct(s1.st_mode)) d2.insert(1, oct(s2.st_mode)) if not ignore_flags: d1.append(get_flags(path1, s1)) d2.append(get_flags(path2, s2)) # ignore st_rdev if file is not a block/char device, fixes #203 if not stat.S_ISCHR(s1.st_mode) and not stat.S_ISBLK(s1.st_mode): d1[4] = None if not stat.S_ISCHR(s2.st_mode) and not stat.S_ISBLK(s2.st_mode): d2[4] = None # If utime isn't fully supported, borg can't set mtime. # Therefore, we shouldn't test it in that case. if is_utime_fully_supported(): # Older versions of llfuse do not support ns precision properly if ignore_ns: d1.append(int(s1.st_mtime_ns / 1e9)) d2.append(int(s2.st_mtime_ns / 1e9)) elif fuse and not have_fuse_mtime_ns: d1.append(round(s1.st_mtime_ns, -4)) d2.append(round(s2.st_mtime_ns, -4)) else: d1.append(round(s1.st_mtime_ns, st_mtime_ns_round)) d2.append(round(s2.st_mtime_ns, st_mtime_ns_round)) if not ignore_xattrs: d1.append(no_selinux(get_all(path1, follow_symlinks=False))) d2.append(no_selinux(get_all(path2, follow_symlinks=False))) self.assert_equal(d1, d2) for sub_diff in diff.subdirs.values(): self._assert_dirs_equal_cmp(sub_diff, ignore_flags=ignore_flags, ignore_xattrs=ignore_xattrs, ignore_ns=ignore_ns) @contextmanager def fuse_mount(self, location, mountpoint=None, *options, fork=True, os_fork=False, **kwargs): # For a successful mount, `fork = True` is required for # the borg mount daemon to work properly or the tests # will just freeze. Therefore, if argument `fork` is not # specified, the default value is `True`, regardless of # `FORK_DEFAULT`. However, leaving the possibility to run # the command with `fork = False` is still necessary for # testing for mount failures, for example attempting to # mount a read-only repo. # `os_fork = True` is needed for testing (the absence of) # a race condition of the Lock during lock migration when # borg mount (local repo) is daemonizing (#4953). This is another # example where we need `fork = False`, because the test case # needs an OS fork, not a spawning of the fuse mount. # `fork = False` is implied if `os_fork = True`. if mountpoint is None: mountpoint = tempfile.mkdtemp() else: os.mkdir(mountpoint) args = ['mount', location, mountpoint] + list(options) if os_fork: # Do not spawn, but actually (OS) fork. if os.fork() == 0: # The child process. # Decouple from parent and fork again. # Otherwise, it becomes a zombie and pretends to be alive. os.setsid() if os.fork() > 0: os._exit(0) # The grandchild process. try: self.cmd(*args, fork=False, **kwargs) # borg mount not spawning. finally: # This should never be reached, since it daemonizes, # and the grandchild process exits before cmd() returns. # However, just in case... print('Fatal: borg mount did not daemonize properly. Force exiting.', file=sys.stderr, flush=True) os._exit(0) else: self.cmd(*args, fork=fork, **kwargs) if kwargs.get('exit_code', EXIT_SUCCESS) == EXIT_ERROR: # If argument `exit_code = EXIT_ERROR`, then this call # is testing the behavior of an unsuccessful mount and # we must not continue, as there is no mount to work # with. The test itself has already failed or succeeded # with the call to `self.cmd`, above. yield return self.wait_for_mountstate(mountpoint, mounted=True) yield umount(mountpoint) self.wait_for_mountstate(mountpoint, mounted=False) os.rmdir(mountpoint) # Give the daemon some time to exit time.sleep(0.2) def wait_for_mountstate(self, mountpoint, *, mounted, timeout=5): """Wait until a path meets specified mount point status""" timeout += time.time() while timeout > time.time(): if os.path.ismount(mountpoint) == mounted: return time.sleep(0.1) message = 'Waiting for {} of {}'.format('mount' if mounted else 'umount', mountpoint) raise TimeoutError(message) @contextmanager def read_only(self, path): """Some paths need to be made read-only for testing If the tests are executed inside a fakeroot environment, the changes from chmod won't affect the real permissions of that folder. This issue is circumvented by temporarily disabling fakeroot with `LD_PRELOAD=`. Using chmod to remove write permissions is not enough if the tests are running with root privileges. Instead, the folder is rendered immutable with chattr or chflags, respectively. """ if sys.platform.startswith('linux'): cmd_immutable = 'chattr +i "%s"' % path cmd_mutable = 'chattr -i "%s"' % path elif sys.platform.startswith(('darwin', 'freebsd', 'netbsd', 'openbsd')): cmd_immutable = 'chflags uchg "%s"' % path cmd_mutable = 'chflags nouchg "%s"' % path elif sys.platform.startswith('sunos'): # openindiana cmd_immutable = 'chmod S+vimmutable "%s"' % path cmd_mutable = 'chmod S-vimmutable "%s"' % path else: message = 'Testing read-only repos is not supported on platform %s' % sys.platform self.skipTest(message) try: os.system('LD_PRELOAD= chmod -R ugo-w "%s"' % path) os.system(cmd_immutable) yield finally: # Restore permissions to ensure clean-up doesn't fail os.system(cmd_mutable) os.system('LD_PRELOAD= chmod -R ugo+w "%s"' % path) class changedir: def __init__(self, dir): self.dir = dir def __enter__(self): self.old = os.getcwd() os.chdir(self.dir) def __exit__(self, *args, **kw): os.chdir(self.old) class environment_variable: def __init__(self, **values): self.values = values self.old_values = {} def __enter__(self): for k, v in self.values.items(): self.old_values[k] = os.environ.get(k) if v is None: os.environ.pop(k, None) else: os.environ[k] = v def __exit__(self, *args, **kw): for k, v in self.old_values.items(): if v is None: os.environ.pop(k, None) else: os.environ[k] = v class FakeInputs: """Simulate multiple user inputs, can be used as input() replacement""" def __init__(self, inputs): self.inputs = inputs def __call__(self, prompt=None): if prompt is not None: print(prompt, end='') try: return self.inputs.pop(0) except IndexError: raise EOFError from None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/testsuite/archive.py0000644000076500000240000002742714641074756020006 0ustar00twstaffimport json from collections import OrderedDict from datetime import datetime, timezone from io import StringIO from unittest.mock import Mock import pytest from . import BaseTestCase from ..crypto.key import PlaintextKey from ..archive import Archive, CacheChunkBuffer, RobustUnpacker, valid_msgpacked_dict, ITEM_KEYS, Statistics from ..archive import BackupOSError, backup_io, backup_io_iter, get_item_uid_gid from ..helpers import Manifest from ..helpers import msgpack from ..item import Item, ArchiveItem from ..platform import uid2user, gid2group @pytest.fixture() def stats(): stats = Statistics() stats.update(20, 10, unique=True) return stats def test_stats_basic(stats): assert stats.osize == 20 assert stats.csize == stats.usize == 10 stats.update(20, 10, unique=False) assert stats.osize == 40 assert stats.csize == 20 assert stats.usize == 10 def tests_stats_progress(stats, monkeypatch, columns=80): monkeypatch.setenv('COLUMNS', str(columns)) out = StringIO() stats.show_progress(stream=out) s = '20 B O 10 B C 10 B D 0 N ' buf = ' ' * (columns - len(s)) assert out.getvalue() == s + buf + "\r" out = StringIO() stats.update(10**3, 0, unique=False) stats.show_progress(item=Item(path='foo'), final=False, stream=out) s = '1.02 kB O 10 B C 10 B D 0 N foo' buf = ' ' * (columns - len(s)) assert out.getvalue() == s + buf + "\r" out = StringIO() stats.show_progress(item=Item(path='foo'*40), final=False, stream=out) s = '1.02 kB O 10 B C 10 B D 0 N foofoofoofoofoofoofoofo...oofoofoofoofoofoofoofoofoo' buf = ' ' * (columns - len(s)) assert out.getvalue() == s + buf + "\r" def test_stats_format(stats): assert str(stats) == """\ This archive: 20 B 10 B 10 B""" s = f"{stats.osize_fmt}" assert s == "20 B" # kind of redundant, but id is variable so we can't match reliably assert repr(stats) == f'' def test_stats_progress_json(stats): stats.output_json = True out = StringIO() stats.show_progress(item=Item(path='foo'), stream=out) result = json.loads(out.getvalue()) assert result['type'] == 'archive_progress' assert isinstance(result['time'], float) assert result['finished'] is False assert result['path'] == 'foo' assert result['original_size'] == 20 assert result['compressed_size'] == 10 assert result['deduplicated_size'] == 10 assert result['nfiles'] == 0 # this counter gets updated elsewhere out = StringIO() stats.show_progress(stream=out, final=True) result = json.loads(out.getvalue()) assert result['type'] == 'archive_progress' assert isinstance(result['time'], float) assert result['finished'] is True # see #6570 assert 'path' not in result assert 'original_size' not in result assert 'compressed_size' not in result assert 'deduplicated_size' not in result assert 'nfiles' not in result class MockCache: class MockRepo: def async_response(self, wait=True): pass def __init__(self): self.objects = {} self.repository = self.MockRepo() def add_chunk(self, id, chunk, stats=None, wait=True): self.objects[id] = chunk return id, len(chunk), len(chunk) class ArchiveTimestampTestCase(BaseTestCase): def _test_timestamp_parsing(self, isoformat, expected): repository = Mock() key = PlaintextKey(repository) manifest = Manifest(repository, key) a = Archive(repository, key, manifest, 'test', create=True) a.metadata = ArchiveItem(time=isoformat) self.assert_equal(a.ts, expected) def test_with_microseconds(self): self._test_timestamp_parsing( '1970-01-01T00:00:01.000001', datetime(1970, 1, 1, 0, 0, 1, 1, timezone.utc)) def test_without_microseconds(self): self._test_timestamp_parsing( '1970-01-01T00:00:01', datetime(1970, 1, 1, 0, 0, 1, 0, timezone.utc)) class ChunkBufferTestCase(BaseTestCase): def test(self): data = [Item(path='p1'), Item(path='p2')] cache = MockCache() key = PlaintextKey(None) chunks = CacheChunkBuffer(cache, key, None) for d in data: chunks.add(d) chunks.flush() chunks.flush(flush=True) self.assert_equal(len(chunks.chunks), 2) unpacker = msgpack.Unpacker() for id in chunks.chunks: unpacker.feed(cache.objects[id]) self.assert_equal(data, [Item(internal_dict=d) for d in unpacker]) def test_partial(self): big = "0123456789abcdefghijklmnopqrstuvwxyz" * 25000 data = [Item(path='full', source=big), Item(path='partial', source=big)] cache = MockCache() key = PlaintextKey(None) chunks = CacheChunkBuffer(cache, key, None) for d in data: chunks.add(d) chunks.flush(flush=False) # the code is expected to leave the last partial chunk in the buffer self.assert_equal(len(chunks.chunks), 3) assert chunks.buffer.tell() > 0 # now really flush chunks.flush(flush=True) self.assert_equal(len(chunks.chunks), 4) assert chunks.buffer.tell() == 0 unpacker = msgpack.Unpacker() for id in chunks.chunks: unpacker.feed(cache.objects[id]) self.assert_equal(data, [Item(internal_dict=d) for d in unpacker]) class RobustUnpackerTestCase(BaseTestCase): def make_chunks(self, items): return b''.join(msgpack.packb({'path': item}) for item in items) def _validator(self, value): return isinstance(value, dict) and value.get(b'path') in (b'foo', b'bar', b'boo', b'baz') def process(self, input): unpacker = RobustUnpacker(validator=self._validator, item_keys=ITEM_KEYS) result = [] for should_sync, chunks in input: if should_sync: unpacker.resync() for data in chunks: unpacker.feed(data) for item in unpacker: result.append(item) return result def test_extra_garbage_no_sync(self): chunks = [(False, [self.make_chunks([b'foo', b'bar'])]), (False, [b'garbage'] + [self.make_chunks([b'boo', b'baz'])])] result = self.process(chunks) self.assert_equal(result, [ {b'path': b'foo'}, {b'path': b'bar'}, 103, 97, 114, 98, 97, 103, 101, {b'path': b'boo'}, {b'path': b'baz'}]) def split(self, left, length): parts = [] while left: parts.append(left[:length]) left = left[length:] return parts def test_correct_stream(self): chunks = self.split(self.make_chunks([b'foo', b'bar', b'boo', b'baz']), 2) input = [(False, chunks)] result = self.process(input) self.assert_equal(result, [{b'path': b'foo'}, {b'path': b'bar'}, {b'path': b'boo'}, {b'path': b'baz'}]) def test_missing_chunk(self): chunks = self.split(self.make_chunks([b'foo', b'bar', b'boo', b'baz']), 4) input = [(False, chunks[:3]), (True, chunks[4:])] result = self.process(input) self.assert_equal(result, [{b'path': b'foo'}, {b'path': b'boo'}, {b'path': b'baz'}]) def test_corrupt_chunk(self): chunks = self.split(self.make_chunks([b'foo', b'bar', b'boo', b'baz']), 4) input = [(False, chunks[:3]), (True, [b'gar', b'bage'] + chunks[3:])] result = self.process(input) self.assert_equal(result, [{b'path': b'foo'}, {b'path': b'boo'}, {b'path': b'baz'}]) @pytest.fixture def item_keys_serialized(): return [msgpack.packb(name) for name in ITEM_KEYS] @pytest.mark.parametrize('packed', [b'', b'x', b'foobar', ] + [msgpack.packb(o) for o in ( [None, 0, 0.0, False, '', {}, [], ()] + [42, 23.42, True, b'foobar', {b'foo': b'bar'}, [b'foo', b'bar'], (b'foo', b'bar')] )]) def test_invalid_msgpacked_item(packed, item_keys_serialized): assert not valid_msgpacked_dict(packed, item_keys_serialized) # pytest-xdist requires always same order for the keys and dicts: IK = sorted(list(ITEM_KEYS)) @pytest.mark.parametrize('packed', [msgpack.packb(o) for o in [ {b'path': b'/a/b/c'}, # small (different msgpack mapping type!) OrderedDict((k, b'') for k in IK), # as big (key count) as it gets OrderedDict((k, b'x' * 1000) for k in IK), # as big (key count and volume) as it gets ]], ids=["minimal", "empty-values", "long-values"]) def test_valid_msgpacked_items(packed, item_keys_serialized): assert valid_msgpacked_dict(packed, item_keys_serialized) def test_key_length_msgpacked_items(): key = b'x' * 32 # 31 bytes is the limit for fixstr msgpack type data = {key: b''} item_keys_serialized = [msgpack.packb(key), ] assert valid_msgpacked_dict(msgpack.packb(data), item_keys_serialized) def test_backup_io(): with pytest.raises(BackupOSError): with backup_io: raise OSError(123) def test_backup_io_iter(): class Iterator: def __init__(self, exc): self.exc = exc def __next__(self): raise self.exc() oserror_iterator = Iterator(OSError) with pytest.raises(BackupOSError): for _ in backup_io_iter(oserror_iterator): pass normal_iterator = Iterator(StopIteration) for _ in backup_io_iter(normal_iterator): assert False, 'StopIteration handled incorrectly' def test_get_item_uid_gid(): # test requires that: # - a name for user 0 and group 0 exists, usually root:root or root:wheel. # - a system user/group udoesnotexist:gdoesnotexist does NOT exist. user0, group0 = uid2user(0), gid2group(0) # this is intentionally a "strange" item, with not matching ids/names. item = Item(path='filename', uid=1, gid=2, user=user0, group=group0) uid, gid = get_item_uid_gid(item, numeric=False) # these are found via a name-to-id lookup assert uid == 0 assert gid == 0 uid, gid = get_item_uid_gid(item, numeric=True) # these are directly taken from the item.uid and .gid assert uid == 1 assert gid == 2 uid, gid = get_item_uid_gid(item, numeric=False, uid_forced=3, gid_forced=4) # these are enforced (not from item metadata) assert uid == 3 assert gid == 4 # item metadata broken, has negative ids. item = Item(path='filename', uid=-1, gid=-2, user=user0, group=group0) uid, gid = get_item_uid_gid(item, numeric=True) # use the uid/gid defaults (which both default to 0). assert uid == 0 assert gid == 0 uid, gid = get_item_uid_gid(item, numeric=True, uid_default=5, gid_default=6) # use the uid/gid defaults (as given). assert uid == 5 assert gid == 6 # item metadata broken, has negative ids and non-existing user/group names. item = Item(path='filename', uid=-3, gid=-4, user='udoesnotexist', group='gdoesnotexist') uid, gid = get_item_uid_gid(item, numeric=False) # use the uid/gid defaults (which both default to 0). assert uid == 0 assert gid == 0 uid, gid = get_item_uid_gid(item, numeric=True, uid_default=7, gid_default=8) # use the uid/gid defaults (as given). assert uid == 7 assert gid == 8 # item metadata has valid uid/gid, but non-existing user/group names. item = Item(path='filename', uid=9, gid=10, user='udoesnotexist', group='gdoesnotexist') uid, gid = get_item_uid_gid(item, numeric=False) # because user/group name does not exist here, use valid numeric ids from item metadata. assert uid == 9 assert gid == 10 uid, gid = get_item_uid_gid(item, numeric=False, uid_default=11, gid_default=12) # because item uid/gid seems valid, do not use the given uid/gid defaults assert uid == 9 assert gid == 10 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/testsuite/archiver.py0000644000076500000240000076362714641074756020201 0ustar00twstaffimport argparse import binascii import errno import io import json import logging import os import pstats import random import re import shutil import socket import stat import subprocess import sys import tempfile import time import unittest from configparser import ConfigParser from datetime import datetime from datetime import timezone from datetime import timedelta from hashlib import sha256 from io import BytesIO, StringIO from unittest.mock import patch import pytest import borg import borg.helpers.errors from .. import xattr, helpers, platform from ..archive import Archive, ChunkBuffer from ..archiver import Archiver, parse_storage_quota, PURE_PYTHON_MSGPACK_WARNING from ..cache import Cache, LocalCache from ..chunker import has_seek_hole from ..constants import * # NOQA from ..crypto.low_level import bytes_to_long, num_cipher_blocks from ..crypto.key import KeyfileKeyBase, RepoKey, KeyfileKey, Passphrase, TAMRequiredError, ArchiveTAMRequiredError from ..crypto.keymanager import RepoIdMismatch, NotABorgKeyFile from ..crypto.file_integrity import FileIntegrityError from ..helpers import Location, get_security_dir from ..helpers import Manifest, MandatoryFeatureUnsupported, ArchiveInfo from ..helpers import init_ec_warnings from ..helpers import EXIT_SUCCESS, EXIT_WARNING, EXIT_ERROR, Error, CancelledByUser, RTError, CommandError from ..helpers import bin_to_hex, hex_to_bin from ..helpers import MAX_S from ..helpers import msgpack from ..helpers import flags_noatime, flags_normal from ..helpers import utcnow from ..nanorst import RstToTextLazy, rst_to_terminal from ..patterns import IECommand, PatternMatcher, parse_pattern from ..item import Item, ItemDiff, chunks_contents_equal from ..locking import LockFailed from ..logger import setup_logging from ..remote import RemoteRepository, PathNotAllowed from ..repository import Repository from . import has_lchflags, llfuse from . import BaseTestCase, changedir, environment_variable, no_selinux, same_ts_ns from . import are_symlinks_supported, are_hardlinks_supported, are_fifos_supported, is_utime_fully_supported, is_birthtime_fully_supported from .platform import fakeroot_detected, is_darwin, is_win32 from .upgrader import make_attic_repo from . import key src_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) def exec_cmd(*args, archiver=None, fork=False, exe=None, input=b'', binary_output=False, **kw): if fork: try: if exe is None: borg = (sys.executable, '-m', 'borg.archiver') elif isinstance(exe, str): borg = (exe, ) elif not isinstance(exe, tuple): raise ValueError('exe must be None, a tuple or a str') output = subprocess.check_output(borg + args, stderr=subprocess.STDOUT, input=input) ret = 0 except subprocess.CalledProcessError as e: output = e.output ret = e.returncode except SystemExit as e: # possibly raised by argparse output = '' ret = e.code if binary_output: return ret, output else: return ret, os.fsdecode(output) else: stdin, stdout, stderr = sys.stdin, sys.stdout, sys.stderr try: sys.stdin = StringIO(input.decode()) sys.stdin.buffer = BytesIO(input) output = BytesIO() # Always use utf-8 here, to simply .decode() below output_text = sys.stdout = sys.stderr = io.TextIOWrapper(output, encoding='utf-8') if archiver is None: archiver = Archiver() archiver.prerun_checks = lambda *args: None init_ec_warnings() try: args = archiver.parse_args(list(args)) # argparse parsing may raise SystemExit when the command line is bad or # actions that abort early (eg. --help) where given. Catch this and return # the error code as-if we invoked a Borg binary. except SystemExit as e: output_text.flush() return e.code, output.getvalue() if binary_output else output.getvalue().decode() ret = archiver.run(args) output_text.flush() return ret, output.getvalue() if binary_output else output.getvalue().decode() finally: sys.stdin, sys.stdout, sys.stderr = stdin, stdout, stderr def have_gnutar(): if not shutil.which('tar'): return False popen = subprocess.Popen(['tar', '--version'], stdout=subprocess.PIPE) stdout, stderr = popen.communicate() return b'GNU tar' in stdout # check if the binary "borg.exe" is available (for local testing a symlink to virtualenv/bin/borg should do) try: exec_cmd('help', exe='borg.exe', fork=True) BORG_EXES = ['python', 'binary', ] except FileNotFoundError: BORG_EXES = ['python', ] @pytest.fixture(params=BORG_EXES) def cmd(request): if request.param == 'python': exe = None elif request.param == 'binary': exe = 'borg.exe' else: raise ValueError("param must be 'python' or 'binary'") def exec_fn(*args, **kw): return exec_cmd(*args, exe=exe, fork=True, **kw) return exec_fn def test_return_codes(cmd, tmpdir): repo = tmpdir.mkdir('repo') input = tmpdir.mkdir('input') output = tmpdir.mkdir('output') input.join('test_file').write('content') rc, out = cmd('init', '--encryption=none', '%s' % str(repo)) assert rc == EXIT_SUCCESS rc, out = cmd('create', '%s::archive' % repo, str(input)) assert rc == EXIT_SUCCESS with changedir(str(output)): rc, out = cmd('extract', '%s::archive' % repo) assert rc == EXIT_SUCCESS rc, out = cmd('extract', '%s::archive' % repo, 'does/not/match') assert rc == EXIT_WARNING # pattern did not match rc, out = cmd('create', '%s::archive' % repo, str(input)) assert rc == EXIT_ERROR # duplicate archive name """ test_disk_full is very slow and not recommended to be included in daily testing. for this test, an empty, writable 16MB filesystem mounted on DF_MOUNT is required. for speed and other reasons, it is recommended that the underlying block device is in RAM, not a magnetic or flash disk. assuming /tmp is a tmpfs (in memory filesystem), one can use this: dd if=/dev/zero of=/tmp/borg-disk bs=16M count=1 mkfs.ext4 /tmp/borg-disk mkdir /tmp/borg-mount sudo mount /tmp/borg-disk /tmp/borg-mount if the directory does not exist, the test will be skipped. """ DF_MOUNT = '/tmp/borg-mount' @pytest.mark.skipif(not os.path.exists(DF_MOUNT), reason="needs a 16MB fs mounted on %s" % DF_MOUNT) def test_disk_full(cmd): def make_files(dir, count, size, rnd=True): shutil.rmtree(dir, ignore_errors=True) os.mkdir(dir) if rnd: count = random.randint(1, count) if size > 1: size = random.randint(1, size) for i in range(count): fn = os.path.join(dir, "file%03d" % i) with open(fn, 'wb') as f: data = os.urandom(size) f.write(data) with environment_variable(BORG_CHECK_I_KNOW_WHAT_I_AM_DOING='YES'): mount = DF_MOUNT assert os.path.exists(mount) repo = os.path.join(mount, 'repo') input = os.path.join(mount, 'input') reserve = os.path.join(mount, 'reserve') for j in range(100): shutil.rmtree(repo, ignore_errors=True) shutil.rmtree(input, ignore_errors=True) # keep some space and some inodes in reserve that we can free up later: make_files(reserve, 80, 100000, rnd=False) rc, out = cmd('init', repo) if rc != EXIT_SUCCESS: print('init', rc, out) assert rc == EXIT_SUCCESS try: success, i = True, 0 while success: i += 1 try: make_files(input, 20, 200000) except OSError as err: if err.errno == errno.ENOSPC: # already out of space break raise try: rc, out = cmd('create', '%s::test%03d' % (repo, i), input) success = rc == EXIT_SUCCESS if not success: print('create', rc, out) finally: # make sure repo is not locked shutil.rmtree(os.path.join(repo, 'lock.exclusive'), ignore_errors=True) os.remove(os.path.join(repo, 'lock.roster')) finally: # now some error happened, likely we are out of disk space. # free some space so we can expect borg to be able to work normally: shutil.rmtree(reserve, ignore_errors=True) rc, out = cmd('list', repo) if rc != EXIT_SUCCESS: print('list', rc, out) rc, out = cmd('check', '--repair', repo) if rc != EXIT_SUCCESS: print('check', rc, out) assert rc == EXIT_SUCCESS class ArchiverTestCaseBase(BaseTestCase): EXE = None # python source based FORK_DEFAULT = False prefix = '' def setUp(self): os.environ['BORG_CHECK_I_KNOW_WHAT_I_AM_DOING'] = 'YES' os.environ['BORG_DELETE_I_KNOW_WHAT_I_AM_DOING'] = 'YES' os.environ['BORG_PASSPHRASE'] = 'waytooeasyonlyfortests' os.environ['BORG_SELFTEST'] = 'disabled' self.archiver = not self.FORK_DEFAULT and Archiver() or None self.tmpdir = tempfile.mkdtemp() self.repository_path = os.path.join(self.tmpdir, 'repository') self.repository_location = self.prefix + self.repository_path self.input_path = os.path.join(self.tmpdir, 'input') self.output_path = os.path.join(self.tmpdir, 'output') self.keys_path = os.path.join(self.tmpdir, 'keys') self.cache_path = os.path.join(self.tmpdir, 'cache') self.exclude_file_path = os.path.join(self.tmpdir, 'excludes') self.patterns_file_path = os.path.join(self.tmpdir, 'patterns') os.environ['BORG_KEYS_DIR'] = self.keys_path os.environ['BORG_CACHE_DIR'] = self.cache_path os.mkdir(self.input_path) os.chmod(self.input_path, 0o777) # avoid troubles with fakeroot / FUSE os.mkdir(self.output_path) os.mkdir(self.keys_path) os.mkdir(self.cache_path) with open(self.exclude_file_path, 'wb') as fd: fd.write(b'input/file2\n# A comment line, then a blank line\n\n') with open(self.patterns_file_path, 'wb') as fd: fd.write(b'+input/file_important\n- input/file*\n# A comment line, then a blank line\n\n') self._old_wd = os.getcwd() os.chdir(self.tmpdir) def tearDown(self): os.chdir(self._old_wd) # note: ignore_errors=True as workaround for issue #862 shutil.rmtree(self.tmpdir, ignore_errors=True) setup_logging() def cmd(self, *args, **kw): exit_code = kw.pop('exit_code', 0) fork = kw.pop('fork', None) binary_output = kw.get('binary_output', False) if fork is None: fork = self.FORK_DEFAULT ret, output = exec_cmd(*args, fork=fork, exe=self.EXE, archiver=self.archiver, **kw) if ret != exit_code: print(output) self.assert_equal(ret, exit_code) # if tests are run with the pure-python msgpack, there will be warnings about # this in the output, which would make a lot of tests fail. pp_msg = PURE_PYTHON_MSGPACK_WARNING.encode() if binary_output else PURE_PYTHON_MSGPACK_WARNING empty = b'' if binary_output else '' output = empty.join(line for line in output.splitlines(keepends=True) if pp_msg not in line) return output def create_src_archive(self, name): self.cmd('create', '--compression=lz4', self.repository_location + '::' + name, src_dir) def open_archive(self, name): repository = Repository(self.repository_path, exclusive=True) with repository: manifest, key = Manifest.load(repository, Manifest.NO_OPERATION_CHECK) archive = Archive(repository, key, manifest, name) return archive, repository def open_repository(self): return Repository(self.repository_path, exclusive=True) def create_regular_file(self, name, size=0, contents=None): assert not (size != 0 and contents and len(contents) != size), 'size and contents do not match' filename = os.path.join(self.input_path, name) if not os.path.exists(os.path.dirname(filename)): os.makedirs(os.path.dirname(filename)) with open(filename, 'wb') as fd: if contents is None: contents = b'X' * size fd.write(contents) def create_test_files(self, create_hardlinks=True): """Create a minimal test case including all supported file types Args: create_hardlinks: whether to create a sample hardlink. When set to False, the hardlink file will not be created at all. """ # File self.create_regular_file('file1', size=1024 * 80) self.create_regular_file('flagfile', size=1024) # Directory self.create_regular_file('dir2/file2', size=1024 * 80) # File mode os.chmod('input/file1', 0o4755) # Hard link if create_hardlinks and are_hardlinks_supported(): os.link(os.path.join(self.input_path, 'file1'), os.path.join(self.input_path, 'hardlink')) # Symlink if are_symlinks_supported(): os.symlink('somewhere', os.path.join(self.input_path, 'link1')) self.create_regular_file('fusexattr', size=1) if not xattr.XATTR_FAKEROOT and xattr.is_enabled(self.input_path): fn = os.fsencode(os.path.join(self.input_path, 'fusexattr')) # ironically, due to the way how fakeroot works, comparing FUSE file xattrs to orig file xattrs # will FAIL if fakeroot supports xattrs, thus we only set the xattr if XATTR_FAKEROOT is False. # This is because fakeroot with xattr-support does not propagate xattrs of the underlying file # into "fakeroot space". Because the xattrs exposed by borgfs are these of an underlying file # (from fakeroots point of view) they are invisible to the test process inside the fakeroot. xattr.setxattr(fn, b'user.foo', b'bar') xattr.setxattr(fn, b'user.empty', b'') # XXX this always fails for me # ubuntu 14.04, on a TMP dir filesystem with user_xattr, using fakeroot # same for newer ubuntu and centos. # if this is supported just on specific platform, platform should be checked first, # so that the test setup for all tests using it does not fail here always for others. # xattr.setxattr(os.path.join(self.input_path, 'link1'), b'user.foo_symlink', b'bar_symlink', follow_symlinks=False) # FIFO node if are_fifos_supported(): os.mkfifo(os.path.join(self.input_path, 'fifo1')) if has_lchflags: platform.set_flags(os.path.join(self.input_path, 'flagfile'), stat.UF_NODUMP) try: # Block device os.mknod('input/bdev', 0o600 | stat.S_IFBLK, os.makedev(10, 20)) # Char device os.mknod('input/cdev', 0o600 | stat.S_IFCHR, os.makedev(30, 40)) # File mode os.chmod('input/dir2', 0o555) # if we take away write perms, we need root to remove contents # File owner os.chown('input/file1', 100, 200) # raises OSError invalid argument on cygwin have_root = True # we have (fake)root except PermissionError: have_root = False except OSError as e: # Note: ENOSYS "Function not implemented" happens as non-root on Win 10 Linux Subsystem. if e.errno not in (errno.EINVAL, errno.ENOSYS): raise have_root = False time.sleep(1) # "empty" must have newer timestamp than other files self.create_regular_file('empty', size=0) return have_root class ArchiverTestCase(ArchiverTestCaseBase): requires_hardlinks = pytest.mark.skipif(not are_hardlinks_supported(), reason='hardlinks not supported') def get_security_dir(self): repository_id = bin_to_hex(self._extract_repository_id(self.repository_path)) return get_security_dir(repository_id) def test_basic_functionality(self): have_root = self.create_test_files() # fork required to test show-rc output output = self.cmd('init', '--encryption=repokey', '--show-version', '--show-rc', self.repository_location, fork=True) self.assert_in('borgbackup version', output) self.assert_in('terminating with success status, rc 0', output) self.cmd('create', '--exclude-nodump', self.repository_location + '::test', 'input') output = self.cmd('create', '--exclude-nodump', '--stats', self.repository_location + '::test.2', 'input') self.assert_in('Archive name: test.2', output) self.assert_in('This archive: ', output) with changedir('output'): self.cmd('extract', self.repository_location + '::test') list_output = self.cmd('list', '--short', self.repository_location) self.assert_in('test', list_output) self.assert_in('test.2', list_output) expected = [ 'input', 'input/bdev', 'input/cdev', 'input/dir2', 'input/dir2/file2', 'input/empty', 'input/file1', 'input/flagfile', ] if are_fifos_supported(): expected.append('input/fifo1') if are_symlinks_supported(): expected.append('input/link1') if are_hardlinks_supported(): expected.append('input/hardlink') if not have_root: # we could not create these device files without (fake)root expected.remove('input/bdev') expected.remove('input/cdev') if has_lchflags: # remove the file we did not backup, so input and output become equal expected.remove('input/flagfile') # this file is UF_NODUMP os.remove(os.path.join('input', 'flagfile')) list_output = self.cmd('list', '--short', self.repository_location + '::test') for name in expected: self.assert_in(name, list_output) self.assert_dirs_equal('input', 'output/input') info_output = self.cmd('info', self.repository_location + '::test') item_count = 4 if has_lchflags else 5 # one file is UF_NODUMP self.assert_in('Number of files: %d' % item_count, info_output) shutil.rmtree(self.cache_path) info_output2 = self.cmd('info', self.repository_location + '::test') def filter(output): # filter for interesting "info" output, ignore cache rebuilding related stuff prefixes = ['Name:', 'Fingerprint:', 'Number of files:', 'This archive:', 'All archives:', 'Chunk index:', ] result = [] for line in output.splitlines(): for prefix in prefixes: if line.startswith(prefix): result.append(line) return '\n'.join(result) # the interesting parts of info_output2 and info_output should be same self.assert_equal(filter(info_output), filter(info_output2)) @requires_hardlinks def test_create_duplicate_root(self): # setup for #5603 path_a = os.path.join(self.input_path, 'a') path_b = os.path.join(self.input_path, 'b') os.mkdir(path_a) os.mkdir(path_b) hl_a = os.path.join(path_a, 'hardlink') hl_b = os.path.join(path_b, 'hardlink') self.create_regular_file(hl_a, contents=b'123456') os.link(hl_a, hl_b) self.cmd('init', '--encryption=none', self.repository_location) self.cmd('create', self.repository_location + '::test', 'input', 'input') # give input twice! # test if created archive has 'input' contents twice: archive_list = self.cmd('list', '--json-lines', self.repository_location + '::test') paths = [json.loads(line)['path'] for line in archive_list.split('\n') if line] # we have all fs items exactly once! assert sorted(paths) == ['input', 'input/a', 'input/a/hardlink', 'input/b', 'input/b/hardlink'] def test_init_parent_dirs(self): parent_path = os.path.join(self.tmpdir, 'parent1', 'parent2') repository_path = os.path.join(parent_path, 'repository') repository_location = self.prefix + repository_path with pytest.raises(Repository.ParentPathDoesNotExist): # normal borg init does NOT create missing parent dirs self.cmd('init', '--encryption=none', repository_location) # but if told so, it does: self.cmd('init', '--encryption=none', '--make-parent-dirs', repository_location) assert os.path.exists(parent_path) def test_create_unreadable_parent(self): parent_dir = os.path.join(self.input_path, 'parent') root_dir = os.path.join(self.input_path, 'parent', 'root') os.mkdir(parent_dir) os.mkdir(root_dir) os.chmod(parent_dir, 0o111) # --x--x--x == parent dir traversable, but not readable self.cmd('init', '--encryption=none', self.repository_location) # issue #7746: we *can* read root_dir and we *can* traverse parent_dir, so this should work: self.cmd('create', self.repository_location + '::test', root_dir) def test_unix_socket(self): self.cmd('init', '--encryption=repokey', self.repository_location) try: sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) sock.bind(os.path.join(self.input_path, 'unix-socket')) except PermissionError as err: if err.errno == errno.EPERM: pytest.skip('unix sockets disabled or not supported') elif err.errno == errno.EACCES: pytest.skip('permission denied to create unix sockets') self.cmd('create', self.repository_location + '::test', 'input') sock.close() with changedir('output'): self.cmd('extract', self.repository_location + '::test') assert not os.path.exists('input/unix-socket') @pytest.mark.skipif(not are_symlinks_supported(), reason='symlinks not supported') def test_symlink_extract(self): self.create_test_files() self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', self.repository_location + '::test', 'input') with changedir('output'): self.cmd('extract', self.repository_location + '::test') assert os.readlink('input/link1') == 'somewhere' @pytest.mark.skipif(not is_utime_fully_supported(), reason='cannot properly setup and execute test without utime') def test_directory_timestamps1(self): self.create_test_files() self.cmd('init', '--encryption=repokey', self.repository_location) # default file archiving order (internal recursion) self.cmd('create', self.repository_location + '::test', 'input') with changedir('output'): self.cmd('extract', self.repository_location + '::test') # extracting a file inside a directory touches the directory mtime assert os.path.exists('output/input/dir2/file2') # make sure borg fixes the directory mtime after touching it sti = os.stat('input/dir2') sto = os.stat('output/input/dir2') assert same_ts_ns(sti.st_mtime_ns, sto.st_mtime_ns) @pytest.mark.skipif(not is_utime_fully_supported(), reason='cannot properly setup and execute test without utime') def test_directory_timestamps2(self): self.create_test_files() self.cmd('init', '--encryption=repokey', self.repository_location) # given order, dir first, file second flist_dir_first = b"input/dir2\ninput/dir2/file2\n" self.cmd('create', '--paths-from-stdin', self.repository_location + '::test', input=flist_dir_first) with changedir('output'): self.cmd('extract', self.repository_location + '::test') # extracting a file inside a directory touches the directory mtime assert os.path.exists('output/input/dir2/file2') # make sure borg fixes the directory mtime after touching it sti = os.stat('input/dir2') sto = os.stat('output/input/dir2') assert same_ts_ns(sti.st_mtime_ns, sto.st_mtime_ns) @pytest.mark.skipif(not is_utime_fully_supported(), reason='cannot properly setup and execute test without utime') def test_directory_timestamps3(self): self.create_test_files() self.cmd('init', '--encryption=repokey', self.repository_location) # given order, file first, dir second flist_file_first = b"input/dir2/file2\ninput/dir2\n" self.cmd('create', '--paths-from-stdin', self.repository_location + '::test', input=flist_file_first) with changedir('output'): self.cmd('extract', self.repository_location + '::test') # extracting a file inside a directory touches the directory mtime assert os.path.exists('output/input/dir2/file2') # make sure borg fixes the directory mtime after touching it sti = os.stat('input/dir2') sto = os.stat('output/input/dir2') assert same_ts_ns(sti.st_mtime_ns, sto.st_mtime_ns) @pytest.mark.skipif(not is_utime_fully_supported(), reason='cannot properly setup and execute test without utime') def test_atime(self): def has_noatime(some_file): atime_before = os.stat(some_file).st_atime_ns try: with open(os.open(some_file, flags_noatime)) as file: file.read() except PermissionError: return False else: atime_after = os.stat(some_file).st_atime_ns noatime_used = flags_noatime != flags_normal return noatime_used and same_ts_ns(atime_before, atime_after) self.create_test_files() atime, mtime = 123456780, 234567890 have_noatime = has_noatime('input/file1') os.utime('input/file1', (atime, mtime)) self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', '--atime', self.repository_location + '::test', 'input') with changedir('output'): self.cmd('extract', self.repository_location + '::test') sti = os.stat('input/file1') sto = os.stat('output/input/file1') assert same_ts_ns(sti.st_mtime_ns, sto.st_mtime_ns) assert same_ts_ns(sto.st_mtime_ns, mtime * 1e9) if have_noatime: assert same_ts_ns(sti.st_atime_ns, sto.st_atime_ns) assert same_ts_ns(sto.st_atime_ns, atime * 1e9) else: # it touched the input file's atime while backing it up assert same_ts_ns(sto.st_atime_ns, atime * 1e9) @pytest.mark.skipif(not is_utime_fully_supported(), reason='cannot properly setup and execute test without utime') @pytest.mark.skipif(not is_birthtime_fully_supported(), reason='cannot properly setup and execute test without birthtime') def test_birthtime(self): self.create_test_files() birthtime, mtime, atime = 946598400, 946684800, 946771200 os.utime('input/file1', (atime, birthtime)) os.utime('input/file1', (atime, mtime)) self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', self.repository_location + '::test', 'input') with changedir('output'): self.cmd('extract', self.repository_location + '::test') sti = os.stat('input/file1') sto = os.stat('output/input/file1') assert same_ts_ns(sti.st_birthtime * 1e9, sto.st_birthtime * 1e9) assert same_ts_ns(sto.st_birthtime * 1e9, birthtime * 1e9) assert same_ts_ns(sti.st_mtime_ns, sto.st_mtime_ns) assert same_ts_ns(sto.st_mtime_ns, mtime * 1e9) @pytest.mark.skipif(not is_utime_fully_supported(), reason='cannot properly setup and execute test without utime') @pytest.mark.skipif(not is_birthtime_fully_supported(), reason='cannot properly setup and execute test without birthtime') def test_nobirthtime(self): self.create_test_files() birthtime, mtime, atime = 946598400, 946684800, 946771200 os.utime('input/file1', (atime, birthtime)) os.utime('input/file1', (atime, mtime)) self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', '--nobirthtime', self.repository_location + '::test', 'input') with changedir('output'): self.cmd('extract', self.repository_location + '::test') sti = os.stat('input/file1') sto = os.stat('output/input/file1') assert same_ts_ns(sti.st_birthtime * 1e9, birthtime * 1e9) assert same_ts_ns(sto.st_birthtime * 1e9, mtime * 1e9) assert same_ts_ns(sti.st_mtime_ns, sto.st_mtime_ns) assert same_ts_ns(sto.st_mtime_ns, mtime * 1e9) def _extract_repository_id(self, path): with Repository(self.repository_path) as repository: return repository.id def _set_repository_id(self, path, id): config = ConfigParser(interpolation=None) config.read(os.path.join(path, 'config')) config.set('repository', 'id', bin_to_hex(id)) with open(os.path.join(path, 'config'), 'w') as fd: config.write(fd) with Repository(self.repository_path) as repository: return repository.id def test_sparse_file(self): def is_sparse(fn, total_size, hole_size): st = os.stat(fn) assert st.st_size == total_size sparse = True if sparse and hasattr(st, 'st_blocks') and st.st_blocks * 512 >= st.st_size: sparse = False if sparse and has_seek_hole: with open(fn, 'rb') as fd: # only check if the first hole is as expected, because the 2nd hole check # is problematic on xfs due to its "dynamic speculative EOF preallocation try: if fd.seek(0, os.SEEK_HOLE) != 0: sparse = False if fd.seek(0, os.SEEK_DATA) != hole_size: sparse = False except OSError: # OS/FS does not really support SEEK_HOLE/SEEK_DATA sparse = False return sparse filename = os.path.join(self.input_path, 'sparse') content = b'foobar' hole_size = 5 * (1 << CHUNK_MAX_EXP) # 5 full chunker buffers total_size = hole_size + len(content) + hole_size with open(filename, 'wb') as fd: # create a file that has a hole at the beginning and end (if the # OS and filesystem supports sparse files) fd.seek(hole_size, 1) fd.write(content) fd.seek(hole_size, 1) pos = fd.tell() fd.truncate(pos) # we first check if we could create a sparse input file: sparse_support = is_sparse(filename, total_size, hole_size) if sparse_support: # we could create a sparse input file, so creating a backup of it and # extracting it again (as sparse) should also work: self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', self.repository_location + '::test', 'input') with changedir(self.output_path): self.cmd('extract', '--sparse', self.repository_location + '::test') self.assert_dirs_equal('input', 'output/input') filename = os.path.join(self.output_path, 'input', 'sparse') with open(filename, 'rb') as fd: # check if file contents are as expected self.assert_equal(fd.read(hole_size), b'\0' * hole_size) self.assert_equal(fd.read(len(content)), content) self.assert_equal(fd.read(hole_size), b'\0' * hole_size) assert is_sparse(filename, total_size, hole_size) def test_unusual_filenames(self): filenames = ['normal', 'with some blanks', '(with_parens)', ] for filename in filenames: filename = os.path.join(self.input_path, filename) with open(filename, 'wb'): pass self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', self.repository_location + '::test', 'input') for filename in filenames: with changedir('output'): self.cmd('extract', self.repository_location + '::test', os.path.join('input', filename)) assert os.path.exists(os.path.join('output', 'input', filename)) def test_repository_swap_detection(self): self.create_test_files() os.environ['BORG_PASSPHRASE'] = 'passphrase' self.cmd('init', '--encryption=repokey', self.repository_location) repository_id = self._extract_repository_id(self.repository_path) self.cmd('create', self.repository_location + '::test', 'input') shutil.rmtree(self.repository_path) self.cmd('init', '--encryption=none', self.repository_location) self._set_repository_id(self.repository_path, repository_id) self.assert_equal(repository_id, self._extract_repository_id(self.repository_path)) if self.FORK_DEFAULT: self.cmd('create', self.repository_location + '::test.2', 'input', exit_code=EXIT_ERROR) else: with pytest.raises(Cache.EncryptionMethodMismatch): self.cmd('create', self.repository_location + '::test.2', 'input') def test_repository_swap_detection2(self): self.create_test_files() self.cmd('init', '--encryption=none', self.repository_location + '_unencrypted') os.environ['BORG_PASSPHRASE'] = 'passphrase' self.cmd('init', '--encryption=repokey', self.repository_location + '_encrypted') self.cmd('create', self.repository_location + '_encrypted::test', 'input') shutil.rmtree(self.repository_path + '_encrypted') os.rename(self.repository_path + '_unencrypted', self.repository_path + '_encrypted') if self.FORK_DEFAULT: self.cmd('create', self.repository_location + '_encrypted::test.2', 'input', exit_code=EXIT_ERROR) else: with pytest.raises(Cache.RepositoryAccessAborted): self.cmd('create', self.repository_location + '_encrypted::test.2', 'input') def test_repository_swap_detection_no_cache(self): self.create_test_files() os.environ['BORG_PASSPHRASE'] = 'passphrase' self.cmd('init', '--encryption=repokey', self.repository_location) repository_id = self._extract_repository_id(self.repository_path) self.cmd('create', self.repository_location + '::test', 'input') shutil.rmtree(self.repository_path) self.cmd('init', '--encryption=none', self.repository_location) self._set_repository_id(self.repository_path, repository_id) self.assert_equal(repository_id, self._extract_repository_id(self.repository_path)) self.cmd('delete', '--cache-only', self.repository_location) if self.FORK_DEFAULT: self.cmd('create', self.repository_location + '::test.2', 'input', exit_code=EXIT_ERROR) else: with pytest.raises(Cache.EncryptionMethodMismatch): self.cmd('create', self.repository_location + '::test.2', 'input') def test_repository_swap_detection2_no_cache(self): self.create_test_files() self.cmd('init', '--encryption=none', self.repository_location + '_unencrypted') os.environ['BORG_PASSPHRASE'] = 'passphrase' self.cmd('init', '--encryption=repokey', self.repository_location + '_encrypted') self.cmd('create', self.repository_location + '_encrypted::test', 'input') self.cmd('delete', '--cache-only', self.repository_location + '_unencrypted') self.cmd('delete', '--cache-only', self.repository_location + '_encrypted') shutil.rmtree(self.repository_path + '_encrypted') os.rename(self.repository_path + '_unencrypted', self.repository_path + '_encrypted') if self.FORK_DEFAULT: self.cmd('create', self.repository_location + '_encrypted::test.2', 'input', exit_code=EXIT_ERROR) else: with pytest.raises(Cache.RepositoryAccessAborted): self.cmd('create', self.repository_location + '_encrypted::test.2', 'input') def test_repository_swap_detection_repokey_blank_passphrase(self): # Check that a repokey repo with a blank passphrase is considered like a plaintext repo. self.create_test_files() # User initializes her repository with her passphrase self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', self.repository_location + '::test', 'input') # Attacker replaces it with her own repository, which is encrypted but has no passphrase set shutil.rmtree(self.repository_path) with environment_variable(BORG_PASSPHRASE=''): self.cmd('init', '--encryption=repokey', self.repository_location) # Delete cache & security database, AKA switch to user perspective self.cmd('delete', '--cache-only', self.repository_location) shutil.rmtree(self.get_security_dir()) with environment_variable(BORG_PASSPHRASE=None): # This is the part were the user would be tricked, e.g. she assumes that BORG_PASSPHRASE # is set, while it isn't. Previously this raised no warning, # since the repository is, technically, encrypted. if self.FORK_DEFAULT: self.cmd('create', self.repository_location + '::test.2', 'input', exit_code=EXIT_ERROR) else: with pytest.raises(Cache.CacheInitAbortedError): self.cmd('create', self.repository_location + '::test.2', 'input') def test_repository_move(self): self.cmd('init', '--encryption=repokey', self.repository_location) security_dir = self.get_security_dir() os.rename(self.repository_path, self.repository_path + '_new') with environment_variable(BORG_RELOCATED_REPO_ACCESS_IS_OK='yes'): self.cmd('info', self.repository_location + '_new') with open(os.path.join(security_dir, 'location')) as fd: location = fd.read() assert location == Location(self.repository_location + '_new').canonical_path() # Needs no confirmation anymore self.cmd('info', self.repository_location + '_new') shutil.rmtree(self.cache_path) self.cmd('info', self.repository_location + '_new') shutil.rmtree(security_dir) self.cmd('info', self.repository_location + '_new') for file in ('location', 'key-type', 'manifest-timestamp'): assert os.path.exists(os.path.join(security_dir, file)) def test_security_dir_compat(self): self.cmd('init', '--encryption=repokey', self.repository_location) with open(os.path.join(self.get_security_dir(), 'location'), 'w') as fd: fd.write('something outdated') # This is fine, because the cache still has the correct information. security_dir and cache can disagree # if older versions are used to confirm a renamed repository. self.cmd('info', self.repository_location) def test_unknown_unencrypted(self): self.cmd('init', '--encryption=none', self.repository_location) # Ok: repository is known self.cmd('info', self.repository_location) # Ok: repository is still known (through security_dir) shutil.rmtree(self.cache_path) self.cmd('info', self.repository_location) # Needs confirmation: cache and security dir both gone (eg. another host or rm -rf ~) shutil.rmtree(self.cache_path) shutil.rmtree(self.get_security_dir()) if self.FORK_DEFAULT: self.cmd('info', self.repository_location, exit_code=EXIT_ERROR) else: with pytest.raises(Cache.CacheInitAbortedError): self.cmd('info', self.repository_location) with environment_variable(BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK='yes'): self.cmd('info', self.repository_location) def test_strip_components(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.create_regular_file('dir/file') self.cmd('create', self.repository_location + '::test', 'input') with changedir('output'): self.cmd('extract', self.repository_location + '::test', '--strip-components', '3') assert not os.path.exists('file') with self.assert_creates_file('file'): self.cmd('extract', self.repository_location + '::test', '--strip-components', '2') with self.assert_creates_file('dir/file'): self.cmd('extract', self.repository_location + '::test', '--strip-components', '1') with self.assert_creates_file('input/dir/file'): self.cmd('extract', self.repository_location + '::test', '--strip-components', '0') def _extract_hardlinks_setup(self): os.mkdir(os.path.join(self.input_path, 'dir1')) os.mkdir(os.path.join(self.input_path, 'dir1/subdir')) self.create_regular_file('source', contents=b'123456') os.link(os.path.join(self.input_path, 'source'), os.path.join(self.input_path, 'abba')) os.link(os.path.join(self.input_path, 'source'), os.path.join(self.input_path, 'dir1/hardlink')) os.link(os.path.join(self.input_path, 'source'), os.path.join(self.input_path, 'dir1/subdir/hardlink')) self.create_regular_file('dir1/source2') os.link(os.path.join(self.input_path, 'dir1/source2'), os.path.join(self.input_path, 'dir1/aaaa')) self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', self.repository_location + '::test', 'input') @requires_hardlinks @unittest.skipUnless(llfuse, 'llfuse not installed') def test_fuse_mount_hardlinks(self): self._extract_hardlinks_setup() mountpoint = os.path.join(self.tmpdir, 'mountpoint') # we need to get rid of permissions checking because fakeroot causes issues with it. # On all platforms, borg defaults to "default_permissions" and we need to get rid of it via "ignore_permissions". # On macOS (darwin), we additionally need "defer_permissions" to switch off the checks in osxfuse. if sys.platform == 'darwin': ignore_perms = ['-o', 'ignore_permissions,defer_permissions'] else: ignore_perms = ['-o', 'ignore_permissions'] with self.fuse_mount(self.repository_location + '::test', mountpoint, '--strip-components=2', *ignore_perms), \ changedir(mountpoint): assert os.stat('hardlink').st_nlink == 2 assert os.stat('subdir/hardlink').st_nlink == 2 assert open('subdir/hardlink', 'rb').read() == b'123456' assert os.stat('aaaa').st_nlink == 2 assert os.stat('source2').st_nlink == 2 with self.fuse_mount(self.repository_location + '::test', mountpoint, 'input/dir1', *ignore_perms), \ changedir(mountpoint): assert os.stat('input/dir1/hardlink').st_nlink == 2 assert os.stat('input/dir1/subdir/hardlink').st_nlink == 2 assert open('input/dir1/subdir/hardlink', 'rb').read() == b'123456' assert os.stat('input/dir1/aaaa').st_nlink == 2 assert os.stat('input/dir1/source2').st_nlink == 2 with self.fuse_mount(self.repository_location + '::test', mountpoint, *ignore_perms), \ changedir(mountpoint): assert os.stat('input/source').st_nlink == 4 assert os.stat('input/abba').st_nlink == 4 assert os.stat('input/dir1/hardlink').st_nlink == 4 assert os.stat('input/dir1/subdir/hardlink').st_nlink == 4 assert open('input/dir1/subdir/hardlink', 'rb').read() == b'123456' @requires_hardlinks def test_extract_hardlinks1(self): self._extract_hardlinks_setup() with changedir('output'): self.cmd('extract', self.repository_location + '::test') assert os.stat('input/source').st_nlink == 4 assert os.stat('input/abba').st_nlink == 4 assert os.stat('input/dir1/hardlink').st_nlink == 4 assert os.stat('input/dir1/subdir/hardlink').st_nlink == 4 assert open('input/dir1/subdir/hardlink', 'rb').read() == b'123456' @requires_hardlinks def test_extract_hardlinks2(self): self._extract_hardlinks_setup() with changedir('output'): self.cmd('extract', self.repository_location + '::test', '--strip-components', '2') assert os.stat('hardlink').st_nlink == 2 assert os.stat('subdir/hardlink').st_nlink == 2 assert open('subdir/hardlink', 'rb').read() == b'123456' assert os.stat('aaaa').st_nlink == 2 assert os.stat('source2').st_nlink == 2 with changedir('output'): self.cmd('extract', self.repository_location + '::test', 'input/dir1') assert os.stat('input/dir1/hardlink').st_nlink == 2 assert os.stat('input/dir1/subdir/hardlink').st_nlink == 2 assert open('input/dir1/subdir/hardlink', 'rb').read() == b'123456' assert os.stat('input/dir1/aaaa').st_nlink == 2 assert os.stat('input/dir1/source2').st_nlink == 2 @requires_hardlinks def test_extract_hardlinks_twice(self): # setup for #5603 path_a = os.path.join(self.input_path, 'a') path_b = os.path.join(self.input_path, 'b') os.mkdir(path_a) os.mkdir(path_b) hl_a = os.path.join(path_a, 'hardlink') hl_b = os.path.join(path_b, 'hardlink') self.create_regular_file(hl_a, contents=b'123456') os.link(hl_a, hl_b) self.cmd('init', '--encryption=none', self.repository_location) self.cmd('create', self.repository_location + '::test', 'input', 'input') # give input twice! # now test extraction with changedir('output'): self.cmd('extract', self.repository_location + '::test') # if issue #5603 happens, extraction gives rc == 1 (triggering AssertionError) and warnings like: # input/a/hardlink: link: [Errno 2] No such file or directory: 'input/a/hardlink' -> 'input/a/hardlink' # input/b/hardlink: link: [Errno 2] No such file or directory: 'input/a/hardlink' -> 'input/b/hardlink' # otherwise, when fixed, the hardlinks should be there and have a link count of 2 assert os.stat('input/a/hardlink').st_nlink == 2 assert os.stat('input/b/hardlink').st_nlink == 2 def test_extract_include_exclude(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.create_regular_file('file1', size=1024 * 80) self.create_regular_file('file2', size=1024 * 80) self.create_regular_file('file3', size=1024 * 80) self.create_regular_file('file4', size=1024 * 80) self.cmd('create', '--exclude=input/file4', self.repository_location + '::test', 'input') with changedir('output'): self.cmd('extract', self.repository_location + '::test', 'input/file1', ) self.assert_equal(sorted(os.listdir('output/input')), ['file1']) with changedir('output'): self.cmd('extract', '--exclude=input/file2', self.repository_location + '::test') self.assert_equal(sorted(os.listdir('output/input')), ['file1', 'file3']) with changedir('output'): self.cmd('extract', '--exclude-from=' + self.exclude_file_path, self.repository_location + '::test') self.assert_equal(sorted(os.listdir('output/input')), ['file1', 'file3']) def test_extract_include_exclude_regex(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.create_regular_file('file1', size=1024 * 80) self.create_regular_file('file2', size=1024 * 80) self.create_regular_file('file3', size=1024 * 80) self.create_regular_file('file4', size=1024 * 80) self.create_regular_file('file333', size=1024 * 80) # Create with regular expression exclusion for file4 self.cmd('create', '--exclude=re:input/file4$', self.repository_location + '::test', 'input') with changedir('output'): self.cmd('extract', self.repository_location + '::test') self.assert_equal(sorted(os.listdir('output/input')), ['file1', 'file2', 'file3', 'file333']) shutil.rmtree('output/input') # Extract with regular expression exclusion with changedir('output'): self.cmd('extract', '--exclude=re:file3+', self.repository_location + '::test') self.assert_equal(sorted(os.listdir('output/input')), ['file1', 'file2']) shutil.rmtree('output/input') # Combine --exclude with fnmatch and regular expression with changedir('output'): self.cmd('extract', '--exclude=input/file2', '--exclude=re:file[01]', self.repository_location + '::test') self.assert_equal(sorted(os.listdir('output/input')), ['file3', 'file333']) shutil.rmtree('output/input') # Combine --exclude-from and regular expression exclusion with changedir('output'): self.cmd('extract', '--exclude-from=' + self.exclude_file_path, '--exclude=re:file1', '--exclude=re:file(\\d)\\1\\1$', self.repository_location + '::test') self.assert_equal(sorted(os.listdir('output/input')), ['file3']) def test_extract_include_exclude_regex_from_file(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.create_regular_file('file1', size=1024 * 80) self.create_regular_file('file2', size=1024 * 80) self.create_regular_file('file3', size=1024 * 80) self.create_regular_file('file4', size=1024 * 80) self.create_regular_file('file333', size=1024 * 80) self.create_regular_file('aa:something', size=1024 * 80) # Create while excluding using mixed pattern styles with open(self.exclude_file_path, 'wb') as fd: fd.write(b're:input/file4$\n') fd.write(b'fm:*aa:*thing\n') self.cmd('create', '--exclude-from=' + self.exclude_file_path, self.repository_location + '::test', 'input') with changedir('output'): self.cmd('extract', self.repository_location + '::test') self.assert_equal(sorted(os.listdir('output/input')), ['file1', 'file2', 'file3', 'file333']) shutil.rmtree('output/input') # Exclude using regular expression with open(self.exclude_file_path, 'wb') as fd: fd.write(b're:file3+\n') with changedir('output'): self.cmd('extract', '--exclude-from=' + self.exclude_file_path, self.repository_location + '::test') self.assert_equal(sorted(os.listdir('output/input')), ['file1', 'file2']) shutil.rmtree('output/input') # Mixed exclude pattern styles with open(self.exclude_file_path, 'wb') as fd: fd.write(b're:file(\\d)\\1\\1$\n') fd.write(b'fm:nothingwillmatchthis\n') fd.write(b'*/file1\n') fd.write(b're:file2$\n') with changedir('output'): self.cmd('extract', '--exclude-from=' + self.exclude_file_path, self.repository_location + '::test') self.assert_equal(sorted(os.listdir('output/input')), ['file3']) def test_extract_with_pattern(self): self.cmd("init", '--encryption=repokey', self.repository_location) self.create_regular_file("file1", size=1024 * 80) self.create_regular_file("file2", size=1024 * 80) self.create_regular_file("file3", size=1024 * 80) self.create_regular_file("file4", size=1024 * 80) self.create_regular_file("file333", size=1024 * 80) self.cmd("create", self.repository_location + "::test", "input") # Extract everything with regular expression with changedir("output"): self.cmd("extract", self.repository_location + "::test", "re:.*") self.assert_equal(sorted(os.listdir("output/input")), ["file1", "file2", "file3", "file333", "file4"]) shutil.rmtree("output/input") # Extract with pattern while also excluding files with changedir("output"): self.cmd("extract", "--exclude=re:file[34]$", self.repository_location + "::test", r"re:file\d$") self.assert_equal(sorted(os.listdir("output/input")), ["file1", "file2"]) shutil.rmtree("output/input") # Combine --exclude with pattern for extraction with changedir("output"): self.cmd("extract", "--exclude=input/file1", self.repository_location + "::test", "re:file[12]$") self.assert_equal(sorted(os.listdir("output/input")), ["file2"]) shutil.rmtree("output/input") # Multiple pattern with changedir("output"): self.cmd("extract", self.repository_location + "::test", "fm:input/file1", "fm:*file33*", "input/file2") self.assert_equal(sorted(os.listdir("output/input")), ["file1", "file2", "file333"]) def test_extract_list_output(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.create_regular_file('file', size=1024 * 80) self.cmd('create', self.repository_location + '::test', 'input') with changedir('output'): output = self.cmd('extract', self.repository_location + '::test') self.assert_not_in("input/file", output) shutil.rmtree('output/input') with changedir('output'): output = self.cmd('extract', '--info', self.repository_location + '::test') self.assert_not_in("input/file", output) shutil.rmtree('output/input') with changedir('output'): output = self.cmd('extract', '--list', self.repository_location + '::test') self.assert_in("input/file", output) shutil.rmtree('output/input') with changedir('output'): output = self.cmd('extract', '--list', '--info', self.repository_location + '::test') self.assert_in("input/file", output) def test_extract_progress(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.create_regular_file('file', size=1024 * 80) self.cmd('create', self.repository_location + '::test', 'input') with changedir('output'): output = self.cmd('extract', self.repository_location + '::test', '--progress') assert 'Extracting:' in output def _create_test_caches(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.create_regular_file('file1', size=1024 * 80) self.create_regular_file('cache1/%s' % CACHE_TAG_NAME, contents=CACHE_TAG_CONTENTS + b' extra stuff') self.create_regular_file('cache2/%s' % CACHE_TAG_NAME, contents=b'invalid signature') os.mkdir('input/cache3') if are_hardlinks_supported(): os.link('input/cache1/%s' % CACHE_TAG_NAME, 'input/cache3/%s' % CACHE_TAG_NAME) else: self.create_regular_file('cache3/%s' % CACHE_TAG_NAME, contents=CACHE_TAG_CONTENTS + b' extra stuff') def test_create_stdin(self): self.cmd('init', '--encryption=repokey', self.repository_location) input_data = b'\x00foo\n\nbar\n \n' self.cmd('create', self.repository_location + '::test', '-', input=input_data) item = json.loads(self.cmd('list', '--json-lines', self.repository_location + '::test')) assert item['uid'] == 0 assert item['gid'] == 0 assert item['size'] == len(input_data) assert item['path'] == 'stdin' extracted_data = self.cmd('extract', '--stdout', self.repository_location + '::test', binary_output=True) assert extracted_data == input_data def test_create_content_from_command(self): self.cmd('init', '--encryption=repokey', self.repository_location) input_data = 'some test content' name = 'a/b/c' self.cmd('create', '--stdin-name', name, '--content-from-command', self.repository_location + '::test', '--', 'echo', input_data) item = json.loads(self.cmd('list', '--json-lines', self.repository_location + '::test')) assert item['uid'] == 0 assert item['gid'] == 0 assert item['size'] == len(input_data) + 1 # `echo` adds newline assert item['path'] == name extracted_data = self.cmd('extract', '--stdout', self.repository_location + '::test') assert extracted_data == input_data + '\n' def test_create_content_from_command_with_failed_command(self): self.cmd('init', '--encryption=repokey', self.repository_location) if self.FORK_DEFAULT: output = self.cmd('create', '--content-from-command', self.repository_location + '::test', '--', 'sh', '-c', 'exit 73;', exit_code=2) assert output.endswith("Command 'sh' exited with status 73\n") else: with pytest.raises(CommandError): self.cmd('create', '--content-from-command', self.repository_location + '::test', '--', 'sh', '-c', 'exit 73;') archive_list = json.loads(self.cmd('list', '--json', self.repository_location)) assert archive_list['archives'] == [] def test_create_content_from_command_missing_command(self): self.cmd('init', '--encryption=repokey', self.repository_location) output = self.cmd('create', '--content-from-command', self.repository_location + '::test', exit_code=2) assert output.endswith('No command given.\n') def test_create_paths_from_stdin(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.create_regular_file("file1", size=1024 * 80) self.create_regular_file("dir1/file2", size=1024 * 80) self.create_regular_file("dir1/file3", size=1024 * 80) self.create_regular_file("file4", size=1024 * 80) input_data = b'input/file1\0input/dir1\0input/file4' self.cmd('create', '--paths-from-stdin', '--paths-delimiter', '\\0', self.repository_location + '::test', input=input_data) archive_list = self.cmd('list', '--json-lines', self.repository_location + '::test') paths = [json.loads(line)['path'] for line in archive_list.split('\n') if line] assert paths == ['input/file1', 'input/dir1', 'input/file4'] def test_create_paths_from_command(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.create_regular_file("file1", size=1024 * 80) self.create_regular_file("file2", size=1024 * 80) self.create_regular_file("file3", size=1024 * 80) self.create_regular_file("file4", size=1024 * 80) input_data = 'input/file1\ninput/file2\ninput/file3' self.cmd('create', '--paths-from-command', self.repository_location + '::test', '--', 'echo', input_data) archive_list = self.cmd('list', '--json-lines', self.repository_location + '::test') paths = [json.loads(line)['path'] for line in archive_list.split('\n') if line] assert paths == ['input/file1', 'input/file2', 'input/file3'] def test_create_paths_from_command_with_failed_command(self): self.cmd('init', '--encryption=repokey', self.repository_location) if self.FORK_DEFAULT: output = self.cmd('create', '--paths-from-command', self.repository_location + '::test', '--', 'sh', '-c', 'exit 73;', exit_code=2) assert output.endswith("Command 'sh' exited with status 73\n") else: with pytest.raises(CommandError): self.cmd('create', '--paths-from-command', self.repository_location + '::test', '--', 'sh', '-c', 'exit 73;') archive_list = json.loads(self.cmd('list', '--json', self.repository_location)) assert archive_list['archives'] == [] def test_create_paths_from_command_missing_command(self): self.cmd('init', '--encryption=repokey', self.repository_location) output = self.cmd('create', '--paths-from-command', self.repository_location + '::test', exit_code=2) assert output.endswith('No command given.\n') def test_create_without_root(self): """test create without a root""" self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', self.repository_location + '::test', exit_code=2) def test_create_pattern_root(self): """test create with only a root pattern""" self.cmd('init', '--encryption=repokey', self.repository_location) self.create_regular_file('file1', size=1024 * 80) self.create_regular_file('file2', size=1024 * 80) output = self.cmd('create', '-v', '--list', '--pattern=R input', self.repository_location + '::test') self.assert_in("A input/file1", output) self.assert_in("A input/file2", output) def test_create_pattern(self): """test file patterns during create""" self.cmd('init', '--encryption=repokey', self.repository_location) self.create_regular_file('file1', size=1024 * 80) self.create_regular_file('file2', size=1024 * 80) self.create_regular_file('file_important', size=1024 * 80) output = self.cmd('create', '-v', '--list', '--pattern=+input/file_important', '--pattern=-input/file*', self.repository_location + '::test', 'input') self.assert_in("A input/file_important", output) self.assert_in('x input/file1', output) self.assert_in('x input/file2', output) def test_create_pattern_file(self): """test file patterns during create""" self.cmd('init', '--encryption=repokey', self.repository_location) self.create_regular_file('file1', size=1024 * 80) self.create_regular_file('file2', size=1024 * 80) self.create_regular_file('otherfile', size=1024 * 80) self.create_regular_file('file_important', size=1024 * 80) output = self.cmd('create', '-v', '--list', '--pattern=-input/otherfile', '--patterns-from=' + self.patterns_file_path, self.repository_location + '::test', 'input') self.assert_in("A input/file_important", output) self.assert_in('x input/file1', output) self.assert_in('x input/file2', output) self.assert_in('x input/otherfile', output) def test_create_pattern_exclude_folder_but_recurse(self): """test when patterns exclude a parent folder, but include a child""" self.patterns_file_path2 = os.path.join(self.tmpdir, 'patterns2') with open(self.patterns_file_path2, 'wb') as fd: fd.write(b'+ input/x/b\n- input/x*\n') self.cmd('init', '--encryption=repokey', self.repository_location) self.create_regular_file('x/a/foo_a', size=1024 * 80) self.create_regular_file('x/b/foo_b', size=1024 * 80) self.create_regular_file('y/foo_y', size=1024 * 80) output = self.cmd('create', '-v', '--list', '--patterns-from=' + self.patterns_file_path2, self.repository_location + '::test', 'input') self.assert_in('x input/x/a/foo_a', output) self.assert_in("A input/x/b/foo_b", output) self.assert_in('A input/y/foo_y', output) def test_create_pattern_exclude_folder_no_recurse(self): """test when patterns exclude a parent folder and, but include a child""" self.patterns_file_path2 = os.path.join(self.tmpdir, 'patterns2') with open(self.patterns_file_path2, 'wb') as fd: fd.write(b'+ input/x/b\n! input/x*\n') self.cmd('init', '--encryption=repokey', self.repository_location) self.create_regular_file('x/a/foo_a', size=1024 * 80) self.create_regular_file('x/b/foo_b', size=1024 * 80) self.create_regular_file('y/foo_y', size=1024 * 80) output = self.cmd('create', '-v', '--list', '--patterns-from=' + self.patterns_file_path2, self.repository_location + '::test', 'input') self.assert_not_in('input/x/a/foo_a', output) self.assert_not_in('input/x/a', output) self.assert_in('A input/y/foo_y', output) def test_create_pattern_intermediate_folders_first(self): """test that intermediate folders appear first when patterns exclude a parent folder but include a child""" self.patterns_file_path2 = os.path.join(self.tmpdir, 'patterns2') with open(self.patterns_file_path2, 'wb') as fd: fd.write(b'+ input/x/a\n+ input/x/b\n- input/x*\n') self.cmd('init', '--encryption=repokey', self.repository_location) self.create_regular_file('x/a/foo_a', size=1024 * 80) self.create_regular_file('x/b/foo_b', size=1024 * 80) with changedir('input'): self.cmd('create', '--patterns-from=' + self.patterns_file_path2, self.repository_location + '::test', '.') # list the archive and verify that the "intermediate" folders appear before # their contents out = self.cmd('list', '--format', '{type} {path}{NL}', self.repository_location + '::test') out_list = out.splitlines() self.assert_in('d x/a', out_list) self.assert_in('d x/b', out_list) assert out_list.index('d x/a') < out_list.index('- x/a/foo_a') assert out_list.index('d x/b') < out_list.index('- x/b/foo_b') def test_create_no_cache_sync(self): self.create_test_files() self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('delete', '--cache-only', self.repository_location) create_json = json.loads(self.cmd('create', '--no-cache-sync', self.repository_location + '::test', 'input', '--json', '--error')) # ignore experimental warning info_json = json.loads(self.cmd('info', self.repository_location + '::test', '--json')) create_stats = create_json['cache']['stats'] info_stats = info_json['cache']['stats'] assert create_stats == info_stats self.cmd('delete', '--cache-only', self.repository_location) self.cmd('create', '--no-cache-sync', self.repository_location + '::test2', 'input') self.cmd('info', self.repository_location) self.cmd('check', self.repository_location) def test_extract_pattern_opt(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.create_regular_file('file1', size=1024 * 80) self.create_regular_file('file2', size=1024 * 80) self.create_regular_file('file_important', size=1024 * 80) self.cmd('create', self.repository_location + '::test', 'input') with changedir('output'): self.cmd('extract', '--pattern=+input/file_important', '--pattern=-input/file*', self.repository_location + '::test') self.assert_equal(sorted(os.listdir('output/input')), ['file_important']) def _assert_test_caches(self): with changedir('output'): self.cmd('extract', self.repository_location + '::test') self.assert_equal(sorted(os.listdir('output/input')), ['cache2', 'file1']) self.assert_equal(sorted(os.listdir('output/input/cache2')), [CACHE_TAG_NAME]) def test_exclude_caches(self): self._create_test_caches() self.cmd('create', '--exclude-caches', self.repository_location + '::test', 'input') self._assert_test_caches() def test_recreate_exclude_caches(self): self._create_test_caches() self.cmd('create', self.repository_location + '::test', 'input') self.cmd('recreate', '--exclude-caches', self.repository_location + '::test') self._assert_test_caches() def _create_test_tagged(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.create_regular_file('file1', size=1024 * 80) self.create_regular_file('tagged1/.NOBACKUP') self.create_regular_file('tagged2/00-NOBACKUP') self.create_regular_file('tagged3/.NOBACKUP/file2', size=1024) def _assert_test_tagged(self): with changedir('output'): self.cmd('extract', self.repository_location + '::test') self.assert_equal(sorted(os.listdir('output/input')), ['file1']) def test_exclude_tagged(self): self._create_test_tagged() self.cmd('create', '--exclude-if-present', '.NOBACKUP', '--exclude-if-present', '00-NOBACKUP', self.repository_location + '::test', 'input') self._assert_test_tagged() def test_recreate_exclude_tagged(self): self._create_test_tagged() self.cmd('create', self.repository_location + '::test', 'input') self.cmd('recreate', '--exclude-if-present', '.NOBACKUP', '--exclude-if-present', '00-NOBACKUP', self.repository_location + '::test') self._assert_test_tagged() def _create_test_keep_tagged(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.create_regular_file('file0', size=1024) self.create_regular_file('tagged1/.NOBACKUP1') self.create_regular_file('tagged1/file1', size=1024) self.create_regular_file('tagged2/.NOBACKUP2/subfile1', size=1024) self.create_regular_file('tagged2/file2', size=1024) self.create_regular_file('tagged3/%s' % CACHE_TAG_NAME, contents=CACHE_TAG_CONTENTS + b' extra stuff') self.create_regular_file('tagged3/file3', size=1024) self.create_regular_file('taggedall/.NOBACKUP1') self.create_regular_file('taggedall/.NOBACKUP2/subfile1', size=1024) self.create_regular_file('taggedall/%s' % CACHE_TAG_NAME, contents=CACHE_TAG_CONTENTS + b' extra stuff') self.create_regular_file('taggedall/file4', size=1024) def _assert_test_keep_tagged(self): with changedir('output'): self.cmd('extract', self.repository_location + '::test') self.assert_equal(sorted(os.listdir('output/input')), ['file0', 'tagged1', 'tagged2', 'tagged3', 'taggedall']) self.assert_equal(os.listdir('output/input/tagged1'), ['.NOBACKUP1']) self.assert_equal(os.listdir('output/input/tagged2'), ['.NOBACKUP2']) self.assert_equal(os.listdir('output/input/tagged3'), [CACHE_TAG_NAME]) self.assert_equal(sorted(os.listdir('output/input/taggedall')), ['.NOBACKUP1', '.NOBACKUP2', CACHE_TAG_NAME, ]) def test_exclude_keep_tagged(self): self._create_test_keep_tagged() self.cmd('create', '--exclude-if-present', '.NOBACKUP1', '--exclude-if-present', '.NOBACKUP2', '--exclude-caches', '--keep-exclude-tags', self.repository_location + '::test', 'input') self._assert_test_keep_tagged() def test_recreate_exclude_keep_tagged(self): self._create_test_keep_tagged() self.cmd('create', self.repository_location + '::test', 'input') self.cmd('recreate', '--exclude-if-present', '.NOBACKUP1', '--exclude-if-present', '.NOBACKUP2', '--exclude-caches', '--keep-exclude-tags', self.repository_location + '::test') self._assert_test_keep_tagged() @pytest.mark.skipif(not are_hardlinks_supported(), reason='hardlinks not supported') def test_recreate_hardlinked_tags(self): # test for issue #4911 self.cmd('init', '--encryption=none', self.repository_location) self.create_regular_file('file1', contents=CACHE_TAG_CONTENTS) # "wrong" filename, but correct tag contents os.mkdir(os.path.join(self.input_path, 'subdir')) # to make sure the tag is encountered *after* file1 os.link(os.path.join(self.input_path, 'file1'), os.path.join(self.input_path, 'subdir', CACHE_TAG_NAME)) # correct tag name, hardlink to file1 self.cmd('create', self.repository_location + '::test', 'input') # in the "test" archive, we now have, in this order: # - a regular file item for "file1" # - a hardlink item for "CACHEDIR.TAG" referring back to file1 for its contents self.cmd('recreate', '--exclude-caches', '--keep-exclude-tags', self.repository_location + '::test') # if issue #4911 is present, the recreate will crash with a KeyError for "input/file1" @pytest.mark.skipif(not xattr.XATTR_FAKEROOT, reason='Linux capabilities test, requires fakeroot >= 1.20.2') def test_extract_capabilities(self): fchown = os.fchown # We need to manually patch chown to get the behaviour Linux has, since fakeroot does not # accurately model the interaction of chown(2) and Linux capabilities, i.e. it does not remove them. def patched_fchown(fd, uid, gid): xattr.setxattr(fd, b'security.capability', b'', follow_symlinks=False) fchown(fd, uid, gid) # The capability descriptor used here is valid and taken from a /usr/bin/ping capabilities = b'\x01\x00\x00\x02\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' self.create_regular_file('file') xattr.setxattr(b'input/file', b'security.capability', capabilities) self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', self.repository_location + '::test', 'input') with changedir('output'): with patch.object(os, 'fchown', patched_fchown): self.cmd('extract', self.repository_location + '::test') assert xattr.getxattr(b'input/file', b'security.capability') == capabilities @pytest.mark.skipif(not xattr.XATTR_FAKEROOT, reason='xattr not supported on this system or on this version of ' 'fakeroot') def test_extract_xattrs_errors(self): def patched_setxattr_E2BIG(*args, **kwargs): raise OSError(errno.E2BIG, 'E2BIG') def patched_setxattr_ENOSPC(*args, **kwargs): raise OSError(errno.ENOSPC, 'ENOSPC') def patched_setxattr_EACCES(*args, **kwargs): raise OSError(errno.EACCES, 'EACCES') self.create_regular_file('file') xattr.setxattr(b'input/file', b'user.attribute', b'value') self.cmd('init', self.repository_location, '-e' 'none') self.cmd('create', self.repository_location + '::test', 'input') with changedir('output'): input_abspath = os.path.abspath('input/file') with patch.object(xattr, 'setxattr', patched_setxattr_E2BIG): out = self.cmd('extract', self.repository_location + '::test', exit_code=EXIT_WARNING) assert 'when setting extended attribute user.attribute: too big for this filesystem' in out os.remove(input_abspath) with patch.object(xattr, 'setxattr', patched_setxattr_ENOSPC): out = self.cmd('extract', self.repository_location + '::test', exit_code=EXIT_WARNING) assert 'when setting extended attribute user.attribute: fs full or xattr too big?' in out os.remove(input_abspath) with patch.object(xattr, 'setxattr', patched_setxattr_EACCES): out = self.cmd('extract', self.repository_location + '::test', exit_code=EXIT_WARNING) assert 'when setting extended attribute user.attribute:' in out assert os.path.isfile(input_abspath) @pytest.mark.skipif(not is_darwin, reason='only for macOS') def test_extract_xattrs_resourcefork(self): self.create_regular_file('file') self.cmd('init', self.repository_location, '-e' 'none') input_path = os.path.abspath('input/file') xa_key, xa_value = b'com.apple.ResourceFork', b'whatshouldbehere' # issue #7234 xattr.setxattr(input_path.encode(), xa_key, xa_value) birthtime_expected = os.stat(input_path).st_birthtime mtime_expected = os.stat(input_path).st_mtime_ns # atime_expected = os.stat(input_path).st_atime_ns self.cmd('create', self.repository_location + '::test', 'input') with changedir('output'): self.cmd('extract', self.repository_location + '::test') extracted_path = os.path.abspath('input/file') birthtime_extracted = os.stat(extracted_path).st_birthtime mtime_extracted = os.stat(extracted_path).st_mtime_ns # atime_extracted = os.stat(extracted_path).st_atime_ns xa_value_extracted = xattr.getxattr(extracted_path.encode(), xa_key) assert xa_value_extracted == xa_value assert same_ts_ns(birthtime_extracted * 1e9, birthtime_expected * 1e9) assert same_ts_ns(mtime_extracted, mtime_expected) # assert same_ts_ns(atime_extracted, atime_expected) # still broken, but not really important. def test_path_normalization(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.create_regular_file('dir1/dir2/file', size=1024 * 80) with changedir('input/dir1/dir2'): self.cmd('create', self.repository_location + '::test', '../../../input/dir1/../dir1/dir2/..') output = self.cmd('list', self.repository_location + '::test') self.assert_not_in('..', output) self.assert_in(' input/dir1/dir2/file', output) def test_exclude_normalization(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.create_regular_file('file1', size=1024 * 80) self.create_regular_file('file2', size=1024 * 80) with changedir('input'): self.cmd('create', '--exclude=file1', self.repository_location + '::test1', '.') with changedir('output'): self.cmd('extract', self.repository_location + '::test1') self.assert_equal(sorted(os.listdir('output')), ['file2']) with changedir('input'): self.cmd('create', '--exclude=./file1', self.repository_location + '::test2', '.') with changedir('output'): self.cmd('extract', self.repository_location + '::test2') self.assert_equal(sorted(os.listdir('output')), ['file2']) self.cmd('create', '--exclude=input/./file1', self.repository_location + '::test3', 'input') with changedir('output'): self.cmd('extract', self.repository_location + '::test3') self.assert_equal(sorted(os.listdir('output/input')), ['file2']) def test_repeated_files(self): self.create_regular_file('file1', size=1024 * 80) self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', self.repository_location + '::test', 'input', 'input') def test_overwrite(self): self.create_regular_file('file1', size=1024 * 80) self.create_regular_file('dir2/file2', size=1024 * 80) self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', self.repository_location + '::test', 'input') # Overwriting regular files and directories should be supported os.mkdir('output/input') os.mkdir('output/input/file1') os.mkdir('output/input/dir2') with changedir('output'): self.cmd('extract', self.repository_location + '::test') self.assert_dirs_equal('input', 'output/input') # But non-empty dirs should fail os.unlink('output/input/file1') os.mkdir('output/input/file1') os.mkdir('output/input/file1/dir') with changedir('output'): self.cmd('extract', self.repository_location + '::test', exit_code=1) def test_rename(self): self.create_regular_file('file1', size=1024 * 80) self.create_regular_file('dir2/file2', size=1024 * 80) self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', self.repository_location + '::test', 'input') self.cmd('create', self.repository_location + '::test.2', 'input') self.cmd('extract', '--dry-run', self.repository_location + '::test') self.cmd('extract', '--dry-run', self.repository_location + '::test.2') self.cmd('rename', self.repository_location + '::test', 'test.3') self.cmd('extract', '--dry-run', self.repository_location + '::test.2') self.cmd('rename', self.repository_location + '::test.2', 'test.4') self.cmd('extract', '--dry-run', self.repository_location + '::test.3') self.cmd('extract', '--dry-run', self.repository_location + '::test.4') # Make sure both archives have been renamed with Repository(self.repository_path) as repository: manifest, key = Manifest.load(repository, Manifest.NO_OPERATION_CHECK) self.assert_equal(len(manifest.archives), 2) self.assert_in('test.3', manifest.archives) self.assert_in('test.4', manifest.archives) def test_info(self): self.create_regular_file('file1', size=1024 * 80) self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', self.repository_location + '::test', 'input') info_repo = self.cmd('info', self.repository_location) assert 'All archives:' in info_repo info_archive = self.cmd('info', self.repository_location + '::test') assert 'Archive name: test\n' in info_archive info_archive = self.cmd('info', '--first', '1', self.repository_location) assert 'Archive name: test\n' in info_archive def test_info_json(self): self.create_regular_file('file1', size=1024 * 80) self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', self.repository_location + '::test', 'input') info_repo = json.loads(self.cmd('info', '--json', self.repository_location)) repository = info_repo['repository'] assert len(repository['id']) == 64 assert 'last_modified' in repository assert datetime.strptime(repository['last_modified'], ISO_FORMAT) # must not raise assert info_repo['encryption']['mode'] == 'repokey' assert 'keyfile' not in info_repo['encryption'] cache = info_repo['cache'] stats = cache['stats'] assert all(isinstance(o, int) for o in stats.values()) assert all(key in stats for key in ('total_chunks', 'total_csize', 'total_size', 'total_unique_chunks', 'unique_csize', 'unique_size')) info_archive = json.loads(self.cmd('info', '--json', self.repository_location + '::test')) assert info_repo['repository'] == info_archive['repository'] assert info_repo['cache'] == info_archive['cache'] archives = info_archive['archives'] assert len(archives) == 1 archive = archives[0] assert archive['name'] == 'test' assert isinstance(archive['command_line'], list) assert isinstance(archive['duration'], float) assert len(archive['id']) == 64 assert 'stats' in archive assert datetime.strptime(archive['start'], ISO_FORMAT) assert datetime.strptime(archive['end'], ISO_FORMAT) def test_info_json_of_empty_archive(self): """See https://github.com/borgbackup/borg/issues/6120""" self.cmd('init', '--encryption=repokey', self.repository_location) info_repo = json.loads(self.cmd('info', '--json', '--first=1', self.repository_location)) assert info_repo["archives"] == [] info_repo = json.loads(self.cmd('info', '--json', '--last=1', self.repository_location)) assert info_repo["archives"] == [] def test_comment(self): self.create_regular_file('file1', size=1024 * 80) self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', self.repository_location + '::test1', 'input') self.cmd('create', '--comment', 'this is the comment', self.repository_location + '::test2', 'input') self.cmd('create', '--comment', '"deleted" comment', self.repository_location + '::test3', 'input') self.cmd('create', '--comment', 'preserved comment', self.repository_location + '::test4', 'input') assert 'Comment: \n' in self.cmd('info', self.repository_location + '::test1') assert 'Comment: this is the comment' in self.cmd('info', self.repository_location + '::test2') self.cmd('recreate', self.repository_location + '::test1', '--comment', 'added comment') self.cmd('recreate', self.repository_location + '::test2', '--comment', 'modified comment') self.cmd('recreate', self.repository_location + '::test3', '--comment', '') self.cmd('recreate', self.repository_location + '::test4', '12345') assert 'Comment: added comment' in self.cmd('info', self.repository_location + '::test1') assert 'Comment: modified comment' in self.cmd('info', self.repository_location + '::test2') assert 'Comment: \n' in self.cmd('info', self.repository_location + '::test3') assert 'Comment: preserved comment' in self.cmd('info', self.repository_location + '::test4') def test_delete(self): self.create_regular_file('file1', size=1024 * 80) self.create_regular_file('dir2/file2', size=1024 * 80) self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', self.repository_location + '::test', 'input') self.cmd('create', self.repository_location + '::test.2', 'input') self.cmd('create', self.repository_location + '::test.3', 'input') self.cmd('create', self.repository_location + '::another_test.1', 'input') self.cmd('create', self.repository_location + '::another_test.2', 'input') self.cmd('extract', '--dry-run', self.repository_location + '::test') self.cmd('extract', '--dry-run', self.repository_location + '::test.2') self.cmd('delete', '--glob-archives', 'another_*', self.repository_location) self.cmd('delete', '--last', '1', self.repository_location) self.cmd('delete', self.repository_location + '::test') self.cmd('extract', '--dry-run', self.repository_location + '::test.2') output = self.cmd('delete', '--stats', self.repository_location + '::test.2') self.assert_in('Deleted data:', output) # Make sure all data except the manifest has been deleted with Repository(self.repository_path) as repository: self.assert_equal(len(repository), 1) def test_delete_multiple(self): self.create_regular_file('file1', size=1024 * 80) self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', self.repository_location + '::test1', 'input') self.cmd('create', self.repository_location + '::test2', 'input') self.cmd('create', self.repository_location + '::test3', 'input') self.cmd('delete', self.repository_location + '::test1', 'test2') self.cmd('extract', '--dry-run', self.repository_location + '::test3') self.cmd('delete', self.repository_location, 'test3') assert not self.cmd('list', self.repository_location) def test_delete_repo(self): self.create_regular_file('file1', size=1024 * 80) self.create_regular_file('dir2/file2', size=1024 * 80) self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', self.repository_location + '::test', 'input') self.cmd('create', self.repository_location + '::test.2', 'input') os.environ['BORG_DELETE_I_KNOW_WHAT_I_AM_DOING'] = 'no' if self.FORK_DEFAULT: self.cmd('delete', self.repository_location, exit_code=2) else: with pytest.raises(CancelledByUser): self.cmd('delete', self.repository_location) assert os.path.exists(self.repository_path) os.environ['BORG_DELETE_I_KNOW_WHAT_I_AM_DOING'] = 'YES' self.cmd('delete', self.repository_location) # Make sure the repo is gone self.assertFalse(os.path.exists(self.repository_path)) def test_delete_force(self): self.cmd('init', '--encryption=none', self.repository_location) self.create_src_archive('test') with Repository(self.repository_path, exclusive=True) as repository: manifest, key = Manifest.load(repository, Manifest.NO_OPERATION_CHECK) archive = Archive(repository, key, manifest, 'test') for item in archive.iter_items(): if item.path.endswith('testsuite/archiver.py'): repository.delete(item.chunks[-1].id) break else: assert False # missed the file repository.commit(compact=False) output = self.cmd('delete', '--force', self.repository_location + '::test') self.assert_in('deleted archive was corrupted', output) self.cmd('check', '--repair', self.repository_location) output = self.cmd('list', self.repository_location) self.assert_not_in('test', output) def test_delete_double_force(self): self.cmd('init', '--encryption=none', self.repository_location) self.create_src_archive('test') with Repository(self.repository_path, exclusive=True) as repository: manifest, key = Manifest.load(repository, Manifest.NO_OPERATION_CHECK) archive = Archive(repository, key, manifest, 'test') id = archive.metadata.items[0] repository.put(id, b'corrupted items metadata stream chunk') repository.commit(compact=False) self.cmd('delete', '--force', '--force', self.repository_location + '::test') self.cmd('check', '--repair', self.repository_location) output = self.cmd('list', self.repository_location) self.assert_not_in('test', output) def test_corrupted_repository(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.create_src_archive('test') self.cmd('extract', '--dry-run', self.repository_location + '::test') output = self.cmd('check', '--show-version', self.repository_location) self.assert_in('borgbackup version', output) # implied output even without --info given self.assert_not_in('Starting repository check', output) # --info not given for root logger name = sorted(os.listdir(os.path.join(self.tmpdir, 'repository', 'data', '0')), reverse=True)[1] with open(os.path.join(self.tmpdir, 'repository', 'data', '0', name), 'r+b') as fd: fd.seek(100) fd.write(b'XXXX') output = self.cmd('check', '--info', self.repository_location, exit_code=1) self.assert_in('Starting repository check', output) # --info given for root logger def test_readonly_check(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.create_src_archive('test') with self.read_only(self.repository_path): # verify that command normally doesn't work with read-only repo if self.FORK_DEFAULT: self.cmd('check', '--verify-data', self.repository_location, exit_code=EXIT_ERROR) else: with pytest.raises((LockFailed, RemoteRepository.RPCError)) as excinfo: self.cmd('check', '--verify-data', self.repository_location) if isinstance(excinfo.value, RemoteRepository.RPCError): assert excinfo.value.exception_class == 'LockFailed' # verify that command works with read-only repo when using --bypass-lock self.cmd('check', '--verify-data', self.repository_location, '--bypass-lock') def test_readonly_diff(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.create_src_archive('a') self.create_src_archive('b') with self.read_only(self.repository_path): # verify that command normally doesn't work with read-only repo if self.FORK_DEFAULT: self.cmd('diff', '%s::a' % self.repository_location, 'b', exit_code=EXIT_ERROR) else: with pytest.raises((LockFailed, RemoteRepository.RPCError)) as excinfo: self.cmd('diff', '%s::a' % self.repository_location, 'b') if isinstance(excinfo.value, RemoteRepository.RPCError): assert excinfo.value.exception_class == 'LockFailed' # verify that command works with read-only repo when using --bypass-lock self.cmd('diff', '%s::a' % self.repository_location, 'b', '--bypass-lock') def test_readonly_export_tar(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.create_src_archive('test') with self.read_only(self.repository_path): # verify that command normally doesn't work with read-only repo if self.FORK_DEFAULT: self.cmd('export-tar', '%s::test' % self.repository_location, 'test.tar', exit_code=EXIT_ERROR) else: with pytest.raises((LockFailed, RemoteRepository.RPCError)) as excinfo: self.cmd('export-tar', '%s::test' % self.repository_location, 'test.tar') if isinstance(excinfo.value, RemoteRepository.RPCError): assert excinfo.value.exception_class == 'LockFailed' # verify that command works with read-only repo when using --bypass-lock self.cmd('export-tar', '%s::test' % self.repository_location, 'test.tar', '--bypass-lock') def test_readonly_extract(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.create_src_archive('test') with self.read_only(self.repository_path): # verify that command normally doesn't work with read-only repo if self.FORK_DEFAULT: self.cmd('extract', '%s::test' % self.repository_location, exit_code=EXIT_ERROR) else: with pytest.raises((LockFailed, RemoteRepository.RPCError)) as excinfo: self.cmd('extract', '%s::test' % self.repository_location) if isinstance(excinfo.value, RemoteRepository.RPCError): assert excinfo.value.exception_class == 'LockFailed' # verify that command works with read-only repo when using --bypass-lock self.cmd('extract', '%s::test' % self.repository_location, '--bypass-lock') def test_readonly_info(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.create_src_archive('test') with self.read_only(self.repository_path): # verify that command normally doesn't work with read-only repo if self.FORK_DEFAULT: self.cmd('info', self.repository_location, exit_code=EXIT_ERROR) else: with pytest.raises((LockFailed, RemoteRepository.RPCError)) as excinfo: self.cmd('info', self.repository_location) if isinstance(excinfo.value, RemoteRepository.RPCError): assert excinfo.value.exception_class == 'LockFailed' # verify that command works with read-only repo when using --bypass-lock self.cmd('info', self.repository_location, '--bypass-lock') def test_readonly_list(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.create_src_archive('test') with self.read_only(self.repository_path): # verify that command normally doesn't work with read-only repo if self.FORK_DEFAULT: self.cmd('list', self.repository_location, exit_code=EXIT_ERROR) else: with pytest.raises((LockFailed, RemoteRepository.RPCError)) as excinfo: self.cmd('list', self.repository_location) if isinstance(excinfo.value, RemoteRepository.RPCError): assert excinfo.value.exception_class == 'LockFailed' # verify that command works with read-only repo when using --bypass-lock self.cmd('list', self.repository_location, '--bypass-lock') @unittest.skipUnless(llfuse, 'llfuse not installed') def test_readonly_mount(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.create_src_archive('test') with self.read_only(self.repository_path): # verify that command normally doesn't work with read-only repo if self.FORK_DEFAULT: with self.fuse_mount(self.repository_location, exit_code=EXIT_ERROR): pass else: with pytest.raises((LockFailed, RemoteRepository.RPCError)) as excinfo: # self.fuse_mount always assumes fork=True, so for this test we have to manually set fork=False with self.fuse_mount(self.repository_location, fork=False): pass if isinstance(excinfo.value, RemoteRepository.RPCError): assert excinfo.value.exception_class == 'LockFailed' # verify that command works with read-only repo when using --bypass-lock with self.fuse_mount(self.repository_location, None, '--bypass-lock'): pass @pytest.mark.skipif('BORG_TESTS_IGNORE_MODES' in os.environ, reason='modes unreliable') def test_umask(self): self.create_regular_file('file1', size=1024 * 80) self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', self.repository_location + '::test', 'input') mode = os.stat(self.repository_path).st_mode self.assertEqual(stat.S_IMODE(mode), 0o700) def test_create_dry_run(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', '--dry-run', self.repository_location + '::test', 'input') # Make sure no archive has been created with Repository(self.repository_path) as repository: manifest, key = Manifest.load(repository, Manifest.NO_OPERATION_CHECK) self.assert_equal(len(manifest.archives), 0) def add_unknown_feature(self, operation): with Repository(self.repository_path, exclusive=True) as repository: manifest, key = Manifest.load(repository, Manifest.NO_OPERATION_CHECK) manifest.config[b'feature_flags'] = {operation.value.encode(): {b'mandatory': [b'unknown-feature']}} manifest.write() repository.commit(compact=False) def cmd_raises_unknown_feature(self, args): if self.FORK_DEFAULT: self.cmd(*args, exit_code=EXIT_ERROR) else: with pytest.raises(MandatoryFeatureUnsupported) as excinfo: self.cmd(*args) assert excinfo.value.args == (['unknown-feature'],) def test_unknown_feature_on_create(self): print(self.cmd('init', '--encryption=repokey', self.repository_location)) self.add_unknown_feature(Manifest.Operation.WRITE) self.cmd_raises_unknown_feature(['create', self.repository_location + '::test', 'input']) def test_unknown_feature_on_cache_sync(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('delete', '--cache-only', self.repository_location) self.add_unknown_feature(Manifest.Operation.READ) self.cmd_raises_unknown_feature(['create', self.repository_location + '::test', 'input']) def test_unknown_feature_on_change_passphrase(self): print(self.cmd('init', '--encryption=repokey', self.repository_location)) self.add_unknown_feature(Manifest.Operation.CHECK) self.cmd_raises_unknown_feature(['key', 'change-passphrase', self.repository_location]) def test_unknown_feature_on_read(self): print(self.cmd('init', '--encryption=repokey', self.repository_location)) self.cmd('create', self.repository_location + '::test', 'input') self.add_unknown_feature(Manifest.Operation.READ) with changedir('output'): self.cmd_raises_unknown_feature(['extract', self.repository_location + '::test']) self.cmd_raises_unknown_feature(['list', self.repository_location]) self.cmd_raises_unknown_feature(['info', self.repository_location + '::test']) def test_unknown_feature_on_rename(self): print(self.cmd('init', '--encryption=repokey', self.repository_location)) self.cmd('create', self.repository_location + '::test', 'input') self.add_unknown_feature(Manifest.Operation.CHECK) self.cmd_raises_unknown_feature(['rename', self.repository_location + '::test', 'other']) def test_unknown_feature_on_delete(self): print(self.cmd('init', '--encryption=repokey', self.repository_location)) self.cmd('create', self.repository_location + '::test', 'input') self.add_unknown_feature(Manifest.Operation.DELETE) # delete of an archive raises self.cmd_raises_unknown_feature(['delete', self.repository_location + '::test']) self.cmd_raises_unknown_feature(['prune', '--keep-daily=3', self.repository_location]) # delete of the whole repository ignores features self.cmd('delete', self.repository_location) @unittest.skipUnless(llfuse, 'llfuse not installed') def test_unknown_feature_on_mount(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', self.repository_location + '::test', 'input') self.add_unknown_feature(Manifest.Operation.READ) mountpoint = os.path.join(self.tmpdir, 'mountpoint') os.mkdir(mountpoint) # XXX this might hang if it doesn't raise an error self.cmd_raises_unknown_feature(['mount', self.repository_location + '::test', mountpoint]) @pytest.mark.allow_cache_wipe def test_unknown_mandatory_feature_in_cache(self): remote_repo = bool(self.prefix) print(self.cmd('init', '--encryption=repokey', self.repository_location)) with Repository(self.repository_path, exclusive=True) as repository: if remote_repo: repository._location = Location(self.repository_location) manifest, key = Manifest.load(repository, Manifest.NO_OPERATION_CHECK) with Cache(repository, key, manifest) as cache: cache.begin_txn() cache.cache_config.mandatory_features = {'unknown-feature'} cache.commit() if self.FORK_DEFAULT: self.cmd('create', self.repository_location + '::test', 'input') else: called = False wipe_cache_safe = LocalCache.wipe_cache def wipe_wrapper(*args): nonlocal called called = True wipe_cache_safe(*args) with patch.object(LocalCache, 'wipe_cache', wipe_wrapper): self.cmd('create', self.repository_location + '::test', 'input') assert called with Repository(self.repository_path, exclusive=True) as repository: if remote_repo: repository._location = Location(self.repository_location) manifest, key = Manifest.load(repository, Manifest.NO_OPERATION_CHECK) with Cache(repository, key, manifest) as cache: assert cache.cache_config.mandatory_features == set() def test_progress_on(self): self.create_regular_file('file1', size=1024 * 80) self.cmd('init', '--encryption=repokey', self.repository_location) output = self.cmd('create', '--progress', self.repository_location + '::test4', 'input') self.assert_in("\r", output) def test_progress_off(self): self.create_regular_file('file1', size=1024 * 80) self.cmd('init', '--encryption=repokey', self.repository_location) output = self.cmd('create', self.repository_location + '::test5', 'input') self.assert_not_in("\r", output) def test_file_status(self): """test that various file status show expected results clearly incomplete: only tests for the weird "unchanged" status for now""" self.create_regular_file('file1', size=1024 * 80) time.sleep(1) # file2 must have newer timestamps than file1 self.create_regular_file('file2', size=1024 * 80) self.cmd('init', '--encryption=repokey', self.repository_location) output = self.cmd('create', '--list', self.repository_location + '::test', 'input') self.assert_in("A input/file1", output) self.assert_in("A input/file2", output) # should find first file as unmodified output = self.cmd('create', '--list', self.repository_location + '::test1', 'input') self.assert_in("U input/file1", output) # this is expected, although surprising, for why, see: # https://borgbackup.readthedocs.org/en/latest/faq.html#i-am-seeing-a-added-status-for-a-unchanged-file self.assert_in("A input/file2", output) def test_file_status_cs_cache_mode(self): """test that a changed file with faked "previous" mtime still gets backed up in ctime,size cache_mode""" self.create_regular_file('file1', contents=b'123') time.sleep(1) # file2 must have newer timestamps than file1 self.create_regular_file('file2', size=10) self.cmd('init', '--encryption=repokey', self.repository_location) output = self.cmd('create', '--list', '--files-cache=ctime,size', self.repository_location + '::test1', 'input') # modify file1, but cheat with the mtime (and atime) and also keep same size: st = os.stat('input/file1') self.create_regular_file('file1', contents=b'321') os.utime('input/file1', ns=(st.st_atime_ns, st.st_mtime_ns)) # this mode uses ctime for change detection, so it should find file1 as modified output = self.cmd('create', '--list', '--files-cache=ctime,size', self.repository_location + '::test2', 'input') self.assert_in("M input/file1", output) def test_file_status_ms_cache_mode(self): """test that a chmod'ed file with no content changes does not get chunked again in mtime,size cache_mode""" self.create_regular_file('file1', size=10) time.sleep(1) # file2 must have newer timestamps than file1 self.create_regular_file('file2', size=10) self.cmd('init', '--encryption=repokey', self.repository_location) output = self.cmd('create', '--list', '--files-cache=mtime,size', self.repository_location + '::test1', 'input') # change mode of file1, no content change: st = os.stat('input/file1') os.chmod('input/file1', st.st_mode ^ stat.S_IRWXO) # this triggers a ctime change, but mtime is unchanged # this mode uses mtime for change detection, so it should find file1 as unmodified output = self.cmd('create', '--list', '--files-cache=mtime,size', self.repository_location + '::test2', 'input') self.assert_in("U input/file1", output) def test_file_status_rc_cache_mode(self): """test that files get rechunked unconditionally in rechunk,ctime cache mode""" self.create_regular_file('file1', size=10) time.sleep(1) # file2 must have newer timestamps than file1 self.create_regular_file('file2', size=10) self.cmd('init', '--encryption=repokey', self.repository_location) output = self.cmd('create', '--list', '--files-cache=rechunk,ctime', self.repository_location + '::test1', 'input') # no changes here, but this mode rechunks unconditionally output = self.cmd('create', '--list', '--files-cache=rechunk,ctime', self.repository_location + '::test2', 'input') self.assert_in("A input/file1", output) def test_file_status_excluded(self): """test that excluded paths are listed""" self.create_regular_file('file1', size=1024 * 80) time.sleep(1) # file2 must have newer timestamps than file1 self.create_regular_file('file2', size=1024 * 80) if has_lchflags: self.create_regular_file('file3', size=1024 * 80) platform.set_flags(os.path.join(self.input_path, 'file3'), stat.UF_NODUMP) self.cmd('init', '--encryption=repokey', self.repository_location) output = self.cmd('create', '--list', '--exclude-nodump', self.repository_location + '::test', 'input') self.assert_in("A input/file1", output) self.assert_in("A input/file2", output) if has_lchflags: self.assert_in("x input/file3", output) # should find second file as excluded output = self.cmd('create', '--list', '--exclude-nodump', self.repository_location + '::test1', 'input', '--exclude', '*/file2') self.assert_in("U input/file1", output) self.assert_in("x input/file2", output) if has_lchflags: self.assert_in("x input/file3", output) def test_create_json(self): self.create_regular_file('file1', size=1024 * 80) self.cmd('init', '--encryption=repokey', self.repository_location) create_info = json.loads(self.cmd('create', '--json', self.repository_location + '::test', 'input')) # The usual keys assert 'encryption' in create_info assert 'repository' in create_info assert 'cache' in create_info assert 'last_modified' in create_info['repository'] archive = create_info['archive'] assert archive['name'] == 'test' assert isinstance(archive['command_line'], list) assert isinstance(archive['duration'], float) assert len(archive['id']) == 64 assert 'stats' in archive def test_create_topical(self): self.create_regular_file('file1', size=1024 * 80) time.sleep(1) # file2 must have newer timestamps than file1 self.create_regular_file('file2', size=1024 * 80) self.cmd('init', '--encryption=repokey', self.repository_location) # no listing by default output = self.cmd('create', self.repository_location + '::test', 'input') self.assert_not_in('file1', output) # shouldn't be listed even if unchanged output = self.cmd('create', self.repository_location + '::test0', 'input') self.assert_not_in('file1', output) # should list the file as unchanged output = self.cmd('create', '--list', '--filter=U', self.repository_location + '::test1', 'input') self.assert_in('file1', output) # should *not* list the file as changed output = self.cmd('create', '--list', '--filter=AM', self.repository_location + '::test2', 'input') self.assert_not_in('file1', output) # change the file self.create_regular_file('file1', size=1024 * 100) # should list the file as changed output = self.cmd('create', '--list', '--filter=AM', self.repository_location + '::test3', 'input') self.assert_in('file1', output) @pytest.mark.skipif(not are_fifos_supported(), reason='FIFOs not supported') def test_create_read_special_symlink(self): from threading import Thread def fifo_feeder(fifo_fn, data): fd = os.open(fifo_fn, os.O_WRONLY) try: os.write(fd, data) finally: os.close(fd) self.cmd('init', '--encryption=repokey', self.repository_location) archive = self.repository_location + '::test' data = b'foobar' * 1000 fifo_fn = os.path.join(self.input_path, 'fifo') link_fn = os.path.join(self.input_path, 'link_fifo') os.mkfifo(fifo_fn) os.symlink(fifo_fn, link_fn) t = Thread(target=fifo_feeder, args=(fifo_fn, data)) t.start() try: self.cmd('create', '--read-special', archive, 'input/link_fifo') finally: t.join() with changedir('output'): self.cmd('extract', archive) fifo_fn = 'input/link_fifo' with open(fifo_fn, 'rb') as f: extracted_data = f.read() assert extracted_data == data def test_create_read_special_broken_symlink(self): os.symlink('somewhere does not exist', os.path.join(self.input_path, 'link')) self.cmd('init', '--encryption=repokey', self.repository_location) archive = self.repository_location + '::test' self.cmd('create', '--read-special', archive, 'input') output = self.cmd('list', archive) assert 'input/link -> somewhere does not exist' in output def test_create_dotslash_hack(self): os.makedirs(os.path.join(self.input_path, 'first', 'secondA', 'thirdA')) os.makedirs(os.path.join(self.input_path, 'first', 'secondB', 'thirdB')) self.cmd('init', '--encryption=none', self.repository_location) archive = self.repository_location + '::test' self.cmd('create', archive, 'input/first/./') # hack! output = self.cmd('list', archive) # dir levels left of slashdot (= input, first) not in archive: assert 'input' not in output assert 'input/first' not in output assert 'input/first/secondA' not in output assert 'input/first/secondA/thirdA' not in output assert 'input/first/secondB' not in output assert 'input/first/secondB/thirdB' not in output assert 'first' not in output assert 'first/secondA' not in output assert 'first/secondA/thirdA' not in output assert 'first/secondB' not in output assert 'first/secondB/thirdB' not in output # dir levels right of slashdot are in archive: assert 'secondA' in output assert 'secondA/thirdA' in output assert 'secondB' in output assert 'secondB/thirdB' in output # def test_cmdline_compatibility(self): # self.create_regular_file('file1', size=1024 * 80) # self.cmd('init', '--encryption=repokey', self.repository_location) # self.cmd('create', self.repository_location + '::test', 'input') # output = self.cmd('foo', self.repository_location, '--old') # self.assert_in('"--old" has been deprecated. Use "--new" instead', output) def test_prune_repository(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', self.repository_location + '::test1', src_dir) self.cmd('create', self.repository_location + '::test2', src_dir) # these are not really a checkpoints, but they look like some: self.cmd('create', self.repository_location + '::test3.checkpoint', src_dir) self.cmd('create', self.repository_location + '::test3.checkpoint.1', src_dir) self.cmd('create', self.repository_location + '::test4.checkpoint', src_dir) output = self.cmd('prune', '--list', '--dry-run', self.repository_location, '--keep-daily=1') assert re.search(r'Would prune:\s+test1', output) # must keep the latest non-checkpoint archive: assert re.search(r'Keeping archive \(rule: daily #1\):\s+test2', output) # must keep the latest checkpoint archive: assert re.search(r'Keeping checkpoint archive:\s+test4.checkpoint', output) output = self.cmd('list', '--consider-checkpoints', self.repository_location) self.assert_in('test1', output) self.assert_in('test2', output) self.assert_in('test3.checkpoint', output) self.assert_in('test3.checkpoint.1', output) self.assert_in('test4.checkpoint', output) self.cmd('prune', self.repository_location, '--keep-daily=1') output = self.cmd('list', '--consider-checkpoints', self.repository_location) self.assert_not_in('test1', output) # the latest non-checkpoint archive must be still there: self.assert_in('test2', output) # only the latest checkpoint archive must still be there: self.assert_not_in('test3.checkpoint', output) self.assert_not_in('test3.checkpoint.1', output) self.assert_in('test4.checkpoint', output) # now we supersede the latest checkpoint by a successful backup: self.cmd('create', self.repository_location + '::test5', src_dir) self.cmd('prune', self.repository_location, '--keep-daily=2') output = self.cmd('list', '--consider-checkpoints', self.repository_location) # all checkpoints should be gone now: self.assert_not_in('checkpoint', output) # the latest archive must be still there self.assert_in('test5', output) # Given a date and time in local tz, create a UTC timestamp string suitable # for create --timestamp command line option def _to_utc_timestamp(self, year, month, day, hour, minute, second): dtime = datetime(year, month, day, hour, minute, second, 0).astimezone() # local time with local timezone return dtime.astimezone(timezone.utc).strftime("%Y-%m-%dT%H:%M:%S") def _create_archive_ts(self, name, y, m, d, H=0, M=0, S=0): loc = self.repository_location + '::' + name self.cmd('create', '--timestamp', self._to_utc_timestamp(y, m, d, H, M, S), loc, src_dir) # This test must match docs/misc/prune-example.txt def test_prune_repository_example(self): self.cmd('init', '--encryption=repokey', self.repository_location) # Archives that will be kept, per the example # Oldest archive self._create_archive_ts('test01', 2015, 1, 1) # 6 monthly archives self._create_archive_ts('test02', 2015, 6, 30) self._create_archive_ts('test03', 2015, 7, 31) self._create_archive_ts('test04', 2015, 8, 31) self._create_archive_ts('test05', 2015, 9, 30) self._create_archive_ts('test06', 2015, 10, 31) self._create_archive_ts('test07', 2015, 11, 30) # 14 daily archives self._create_archive_ts('test08', 2015, 12, 17) self._create_archive_ts('test09', 2015, 12, 18) self._create_archive_ts('test10', 2015, 12, 20) self._create_archive_ts('test11', 2015, 12, 21) self._create_archive_ts('test12', 2015, 12, 22) self._create_archive_ts('test13', 2015, 12, 23) self._create_archive_ts('test14', 2015, 12, 24) self._create_archive_ts('test15', 2015, 12, 25) self._create_archive_ts('test16', 2015, 12, 26) self._create_archive_ts('test17', 2015, 12, 27) self._create_archive_ts('test18', 2015, 12, 28) self._create_archive_ts('test19', 2015, 12, 29) self._create_archive_ts('test20', 2015, 12, 30) self._create_archive_ts('test21', 2015, 12, 31) # Additional archives that would be pruned # The second backup of the year self._create_archive_ts('test22', 2015, 1, 2) # The next older monthly backup self._create_archive_ts('test23', 2015, 5, 31) # The next older daily backup self._create_archive_ts('test24', 2015, 12, 16) output = self.cmd('prune', '--list', '--dry-run', self.repository_location, '--keep-daily=14', '--keep-monthly=6', '--keep-yearly=1') # Prune second backup of the year assert re.search(r'Would prune:\s+test22', output) # Prune next older monthly and daily backups assert re.search(r'Would prune:\s+test23', output) assert re.search(r'Would prune:\s+test24', output) # Must keep the other 21 backups # Yearly is kept as oldest archive assert re.search(r'Keeping archive \(rule: yearly\[oldest\] #1\):\s+test01', output) for i in range(1, 7): assert re.search(r'Keeping archive \(rule: monthly #' + str(i) + r'\):\s+test' + ("%02d" % (8-i)), output) for i in range(1, 15): assert re.search(r'Keeping archive \(rule: daily #' + str(i) + r'\):\s+test' + ("%02d" % (22-i)), output) output = self.cmd('list', self.repository_location) # Nothing pruned after dry run for i in range(1, 25): self.assert_in('test%02d' % i, output) self.cmd('prune', self.repository_location, '--keep-daily=14', '--keep-monthly=6', '--keep-yearly=1') output = self.cmd('list', self.repository_location) # All matching backups plus oldest kept for i in range(1, 22): self.assert_in('test%02d' % i, output) # Other backups have been pruned for i in range(22, 25): self.assert_not_in('test%02d' % i, output) # With an initial and daily backup, prune daily until oldest is replaced by a monthly backup def test_prune_retain_and_expire_oldest(self): self.cmd('init', '--encryption=repokey', self.repository_location) # Initial backup self._create_archive_ts('original_archive', 2020, 9, 1, 11, 15) # Archive and prune daily for 30 days for i in range(1, 31): self._create_archive_ts('september%02d' % i, 2020, 9, i, 12) self.cmd('prune', self.repository_location, '--keep-daily=7', '--keep-monthly=1') # Archive and prune 6 days into the next month for i in range(1, 7): self._create_archive_ts('october%02d' % i, 2020, 10, i, 12) self.cmd('prune', self.repository_location, '--keep-daily=7', '--keep-monthly=1') # Oldest backup is still retained output = self.cmd('prune', '--list', '--dry-run', self.repository_location, '--keep-daily=7', '--keep-monthly=1') assert re.search(r'Keeping archive \(rule: monthly\[oldest\] #1' + r'\):\s+original_archive', output) # Archive one more day and prune. self._create_archive_ts('october07', 2020, 10, 7, 12) self.cmd('prune', self.repository_location, '--keep-daily=7', '--keep-monthly=1') # Last day of previous month is retained as monthly, and oldest is expired. output = self.cmd('prune', '--list', '--dry-run', self.repository_location, '--keep-daily=7', '--keep-monthly=1') assert re.search(r'Keeping archive \(rule: monthly #1\):\s+september30', output) self.assert_not_in('original_archive', output) def test_prune_repository_save_space(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', self.repository_location + '::test1', src_dir) self.cmd('create', self.repository_location + '::test2', src_dir) output = self.cmd('prune', '--list', '--dry-run', self.repository_location, '--keep-daily=1') assert re.search(r'Keeping archive \(rule: daily #1\):\s+test2', output) assert re.search(r'Would prune:\s+test1', output) output = self.cmd('list', self.repository_location) self.assert_in('test1', output) self.assert_in('test2', output) self.cmd('prune', '--save-space', self.repository_location, '--keep-daily=1') output = self.cmd('list', self.repository_location) self.assert_not_in('test1', output) self.assert_in('test2', output) def test_prune_repository_prefix(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', self.repository_location + '::foo-2015-08-12-10:00', src_dir) self.cmd('create', self.repository_location + '::foo-2015-08-12-20:00', src_dir) self.cmd('create', self.repository_location + '::bar-2015-08-12-10:00', src_dir) self.cmd('create', self.repository_location + '::bar-2015-08-12-20:00', src_dir) output = self.cmd('prune', '--list', '--dry-run', self.repository_location, '--keep-daily=1', '--prefix=foo-') assert re.search(r'Keeping archive \(rule: daily #1\):\s+foo-2015-08-12-20:00', output) assert re.search(r'Would prune:\s+foo-2015-08-12-10:00', output) output = self.cmd('list', self.repository_location) self.assert_in('foo-2015-08-12-10:00', output) self.assert_in('foo-2015-08-12-20:00', output) self.assert_in('bar-2015-08-12-10:00', output) self.assert_in('bar-2015-08-12-20:00', output) self.cmd('prune', self.repository_location, '--keep-daily=1', '--prefix=foo-') output = self.cmd('list', self.repository_location) self.assert_not_in('foo-2015-08-12-10:00', output) self.assert_in('foo-2015-08-12-20:00', output) self.assert_in('bar-2015-08-12-10:00', output) self.assert_in('bar-2015-08-12-20:00', output) def test_prune_repository_glob(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', self.repository_location + '::2015-08-12-10:00-foo', src_dir) self.cmd('create', self.repository_location + '::2015-08-12-20:00-foo', src_dir) self.cmd('create', self.repository_location + '::2015-08-12-10:00-bar', src_dir) self.cmd('create', self.repository_location + '::2015-08-12-20:00-bar', src_dir) output = self.cmd('prune', '--list', '--dry-run', self.repository_location, '--keep-daily=1', '--glob-archives=2015-*-foo') assert re.search(r'Keeping archive \(rule: daily #1\):\s+2015-08-12-20:00-foo', output) assert re.search(r'Would prune:\s+2015-08-12-10:00-foo', output) output = self.cmd('list', self.repository_location) self.assert_in('2015-08-12-10:00-foo', output) self.assert_in('2015-08-12-20:00-foo', output) self.assert_in('2015-08-12-10:00-bar', output) self.assert_in('2015-08-12-20:00-bar', output) self.cmd('prune', self.repository_location, '--keep-daily=1', '--glob-archives=2015-*-foo') output = self.cmd('list', self.repository_location) self.assert_not_in('2015-08-12-10:00-foo', output) self.assert_in('2015-08-12-20:00-foo', output) self.assert_in('2015-08-12-10:00-bar', output) self.assert_in('2015-08-12-20:00-bar', output) def test_list_glob(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', self.repository_location + '::test-1', src_dir) self.cmd('create', self.repository_location + '::something-else-than-test-1', src_dir) self.cmd('create', self.repository_location + '::test-2', src_dir) output = self.cmd('list', '--glob-archives=test-*', self.repository_location) self.assert_in('test-1', output) self.assert_in('test-2', output) self.assert_not_in('something-else', output) def test_list_format(self): self.cmd('init', '--encryption=repokey', self.repository_location) test_archive = self.repository_location + '::test' self.cmd('create', test_archive, src_dir) output_1 = self.cmd('list', test_archive) output_2 = self.cmd('list', '--format', '{mode} {user:6} {group:6} {size:8d} {mtime} {path}{extra}{NEWLINE}', test_archive) output_3 = self.cmd('list', '--format', '{mtime:%s} {path}{NL}', test_archive) self.assertEqual(output_1, output_2) self.assertNotEqual(output_1, output_3) def test_list_repository_format(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', '--comment', 'comment 1', self.repository_location + '::test-1', src_dir) self.cmd('create', '--comment', 'comment 2', self.repository_location + '::test-2', src_dir) output_1 = self.cmd('list', self.repository_location) output_2 = self.cmd('list', '--format', '{archive:<36} {time} [{id}]{NL}', self.repository_location) self.assertEqual(output_1, output_2) output_1 = self.cmd('list', '--short', self.repository_location) self.assertEqual(output_1, 'test-1\ntest-2\n') output_1 = self.cmd('list', '--format', '{barchive}/', self.repository_location) self.assertEqual(output_1, 'test-1/test-2/') output_3 = self.cmd('list', '--format', '{name} {comment}{NL}', self.repository_location) self.assert_in('test-1 comment 1\n', output_3) self.assert_in('test-2 comment 2\n', output_3) def test_list_hash(self): self.create_regular_file('empty_file', size=0) self.create_regular_file('amb', contents=b'a' * 1000000) self.cmd('init', '--encryption=repokey', self.repository_location) test_archive = self.repository_location + '::test' self.cmd('create', test_archive, 'input') output = self.cmd('list', '--format', '{sha256} {path}{NL}', test_archive) assert "cdc76e5c9914fb9281a1c7e284d73e67f1809a48a497200e046d39ccc7112cd0 input/amb" in output assert "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 input/empty_file" in output def test_list_consider_checkpoints(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', self.repository_location + '::test1', src_dir) # these are not really a checkpoints, but they look like some: self.cmd('create', self.repository_location + '::test2.checkpoint', src_dir) self.cmd('create', self.repository_location + '::test3.checkpoint.1', src_dir) output = self.cmd('list', self.repository_location) assert "test1" in output assert "test2.checkpoint" not in output assert "test3.checkpoint.1" not in output output = self.cmd('list', '--consider-checkpoints', self.repository_location) assert "test1" in output assert "test2.checkpoint" in output assert "test3.checkpoint.1" in output def test_list_chunk_counts(self): self.create_regular_file('empty_file', size=0) self.create_regular_file('two_chunks') with open(os.path.join(self.input_path, 'two_chunks'), 'wb') as fd: fd.write(b'abba' * 2000000) fd.write(b'baab' * 2000000) self.cmd('init', '--encryption=repokey', self.repository_location) test_archive = self.repository_location + '::test' self.cmd('create', test_archive, 'input') output = self.cmd('list', '--format', '{num_chunks} {unique_chunks} {path}{NL}', test_archive) assert "0 0 input/empty_file" in output assert "2 2 input/two_chunks" in output def test_list_size(self): self.create_regular_file('compressible_file', size=10000) self.cmd('init', '--encryption=repokey', self.repository_location) test_archive = self.repository_location + '::test' self.cmd('create', '-C', 'lz4', test_archive, 'input') output = self.cmd('list', '--format', '{size} {csize} {dsize} {dcsize} {path}{NL}', test_archive) size, csize, dsize, dcsize, path = output.split("\n")[1].split(" ") assert int(csize) < int(size) assert int(dcsize) < int(dsize) assert int(dsize) <= int(size) assert int(dcsize) <= int(csize) def test_list_json(self): self.create_regular_file('file1', size=1024 * 80) self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', self.repository_location + '::test', 'input') list_repo = json.loads(self.cmd('list', '--json', self.repository_location)) repository = list_repo['repository'] assert len(repository['id']) == 64 assert datetime.strptime(repository['last_modified'], ISO_FORMAT) # must not raise assert list_repo['encryption']['mode'] == 'repokey' assert 'keyfile' not in list_repo['encryption'] archive0 = list_repo['archives'][0] assert datetime.strptime(archive0['time'], ISO_FORMAT) # must not raise list_archive = self.cmd('list', '--json-lines', self.repository_location + '::test') items = [json.loads(s) for s in list_archive.splitlines()] assert len(items) == 2 file1 = items[1] assert file1['path'] == 'input/file1' assert file1['size'] == 81920 assert datetime.strptime(file1['mtime'], ISO_FORMAT) # must not raise list_archive = self.cmd('list', '--json-lines', '--format={sha256}', self.repository_location + '::test') items = [json.loads(s) for s in list_archive.splitlines()] assert len(items) == 2 file1 = items[1] assert file1['path'] == 'input/file1' assert file1['sha256'] == 'b2915eb69f260d8d3c25249195f2c8f4f716ea82ec760ae929732c0262442b2b' def test_list_json_args(self): self.cmd('init', '--encryption=repokey', self.repository_location) if self.FORK_DEFAULT: self.cmd('list', '--json-lines', self.repository_location, exit_code=2) else: with pytest.raises(CommandError): self.cmd('list', '--json-lines', self.repository_location) if self.FORK_DEFAULT: self.cmd('list', '--json', self.repository_location + '::archive', exit_code=2) else: with pytest.raises(CommandError): self.cmd('list', '--json', self.repository_location + '::archive') def test_log_json(self): self.create_test_files() self.cmd('init', '--encryption=repokey', self.repository_location) log = self.cmd('create', '--log-json', self.repository_location + '::test', 'input', '--list', '--debug') messages = {} # type -> message, one of each kind for line in log.splitlines(): msg = json.loads(line) messages[msg['type']] = msg file_status = messages['file_status'] assert 'status' in file_status assert file_status['path'].startswith('input') log_message = messages['log_message'] assert isinstance(log_message['time'], float) assert log_message['levelname'] == 'DEBUG' # there should only be DEBUG messages assert isinstance(log_message['message'], str) def test_debug_profile(self): self.create_test_files() self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', self.repository_location + '::test', 'input', '--debug-profile=create.prof') self.cmd('debug', 'convert-profile', 'create.prof', 'create.pyprof') stats = pstats.Stats('create.pyprof') stats.strip_dirs() stats.sort_stats('cumtime') self.cmd('create', self.repository_location + '::test2', 'input', '--debug-profile=create.pyprof') stats = pstats.Stats('create.pyprof') # Only do this on trusted data! stats.strip_dirs() stats.sort_stats('cumtime') def test_common_options(self): self.create_test_files() self.cmd('init', '--encryption=repokey', self.repository_location) log = self.cmd('--debug', 'create', self.repository_location + '::test', 'input') assert 'security: read previous location' in log def _get_sizes(self, compression, compressible, size=10000): if compressible: contents = b'X' * size else: contents = os.urandom(size) self.create_regular_file('file', contents=contents) self.cmd('init', '--encryption=none', self.repository_location) archive = self.repository_location + '::test' self.cmd('create', '-C', compression, archive, 'input') output = self.cmd('list', '--format', '{size} {csize} {path}{NL}', archive) size, csize, path = output.split("\n")[1].split(" ") return int(size), int(csize) def test_compression_none_compressible(self): size, csize = self._get_sizes('none', compressible=True) assert csize == size + 3 def test_compression_none_uncompressible(self): size, csize = self._get_sizes('none', compressible=False) assert csize == size + 3 def test_compression_zlib_compressible(self): size, csize = self._get_sizes('zlib', compressible=True) assert csize < size * 0.1 def test_compression_zlib_uncompressible(self): size, csize = self._get_sizes('zlib', compressible=False) assert csize >= size def test_compression_lz4_compressible(self): size, csize = self._get_sizes('lz4', compressible=True) assert csize < size * 0.1 def test_compression_lz4_uncompressible(self): size, csize = self._get_sizes('lz4', compressible=False) assert csize == size + 3 # same as compression 'none' def test_compression_lzma_compressible(self): size, csize = self._get_sizes('lzma', compressible=True) assert csize < size * 0.1 def test_compression_lzma_uncompressible(self): size, csize = self._get_sizes('lzma', compressible=False) assert csize == size + 3 # same as compression 'none' def test_compression_zstd_compressible(self): size, csize = self._get_sizes('zstd', compressible=True) assert csize < size * 0.1 def test_compression_zstd_uncompressible(self): size, csize = self._get_sizes('zstd', compressible=False) assert csize == size + 3 # same as compression 'none' def test_compression_auto_compressible(self): # this is testing whether the "auto" meta-compressor behaves as expected: # - it checks whether the data is compressible (detector is the lz4 compressor) # - as the data is compressible, it runs the "expensive" zlib compression on it # - it returns whatever is shortest, either the lz4 compressed data or the zlib compressed data. auto_size, auto_csize = self._get_sizes('auto,zlib', compressible=True) self.cmd('delete', self.repository_location) zlib_size, zlib_csize = self._get_sizes('zlib', compressible=True) self.cmd('delete', self.repository_location) lz4_size, lz4_csize = self._get_sizes('lz4', compressible=True) assert auto_size == zlib_size == lz4_size assert auto_csize < auto_size * 0.1 # it did compress! smallest_csize = min(zlib_csize, lz4_csize) assert auto_csize == smallest_csize def test_compression_auto_uncompressible(self): # this is testing whether the "auto" meta-compressor chooses the "none" compression (storing the # data "as is" with just the 3 bytes header) if all else would result in something bigger. size, csize = self._get_sizes('auto,zlib', compressible=False) assert csize >= size assert csize == size + 3 # same as compression 'none' def test_change_passphrase(self): self.cmd('init', '--encryption=repokey', self.repository_location) os.environ['BORG_NEW_PASSPHRASE'] = 'newpassphrase' # here we have both BORG_PASSPHRASE and BORG_NEW_PASSPHRASE set: self.cmd('key', 'change-passphrase', self.repository_location) os.environ['BORG_PASSPHRASE'] = 'newpassphrase' self.cmd('list', self.repository_location) def test_break_lock(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('break-lock', self.repository_location) def test_usage(self): self.cmd() self.cmd('-h') def test_help(self): assert 'Borg' in self.cmd('help') assert 'patterns' in self.cmd('help', 'patterns') assert 'Initialize' in self.cmd('help', 'init') assert 'positional arguments' not in self.cmd('help', 'init', '--epilog-only') assert 'This command initializes' not in self.cmd('help', 'init', '--usage-only') @unittest.skipUnless(llfuse, 'llfuse not installed') def test_fuse(self): def has_noatime(some_file): atime_before = os.stat(some_file).st_atime_ns try: os.close(os.open(some_file, flags_noatime)) except PermissionError: return False else: atime_after = os.stat(some_file).st_atime_ns noatime_used = flags_noatime != flags_normal return noatime_used and same_ts_ns(atime_before, atime_after) self.cmd('init', '--encryption=repokey', self.repository_location) self.create_test_files() have_noatime = has_noatime('input/file1') self.cmd('create', '--exclude-nodump', '--atime', self.repository_location + '::archive', 'input') self.cmd('create', '--exclude-nodump', '--atime', self.repository_location + '::archive2', 'input') if has_lchflags: # remove the file we did not backup, so input and output become equal os.remove(os.path.join('input', 'flagfile')) mountpoint = os.path.join(self.tmpdir, 'mountpoint') # mount the whole repository, archive contents shall show up in archivename subdirs of mountpoint: with self.fuse_mount(self.repository_location, mountpoint): # flags are not supported by the FUSE mount # we also ignore xattrs here, they are tested separately self.assert_dirs_equal(self.input_path, os.path.join(mountpoint, 'archive', 'input'), ignore_flags=True, ignore_xattrs=True) self.assert_dirs_equal(self.input_path, os.path.join(mountpoint, 'archive2', 'input'), ignore_flags=True, ignore_xattrs=True) # mount only 1 archive, its contents shall show up directly in mountpoint: with self.fuse_mount(self.repository_location + '::archive', mountpoint): self.assert_dirs_equal(self.input_path, os.path.join(mountpoint, 'input'), ignore_flags=True, ignore_xattrs=True) # regular file in_fn = 'input/file1' out_fn = os.path.join(mountpoint, 'input', 'file1') # stat sti1 = os.stat(in_fn) sto1 = os.stat(out_fn) assert sti1.st_mode == sto1.st_mode assert sti1.st_uid == sto1.st_uid assert sti1.st_gid == sto1.st_gid assert sti1.st_size == sto1.st_size if have_noatime: assert same_ts_ns(sti1.st_atime * 1e9, sto1.st_atime * 1e9) assert same_ts_ns(sti1.st_ctime * 1e9, sto1.st_ctime * 1e9) assert same_ts_ns(sti1.st_mtime * 1e9, sto1.st_mtime * 1e9) if are_hardlinks_supported(): # note: there is another hardlink to this, see below assert sti1.st_nlink == sto1.st_nlink == 2 # read with open(in_fn, 'rb') as in_f, open(out_fn, 'rb') as out_f: assert in_f.read() == out_f.read() # hardlink (to 'input/file1') if are_hardlinks_supported(): in_fn = 'input/hardlink' out_fn = os.path.join(mountpoint, 'input', 'hardlink') sti2 = os.stat(in_fn) sto2 = os.stat(out_fn) assert sti2.st_nlink == sto2.st_nlink == 2 assert sto1.st_ino == sto2.st_ino # symlink if are_symlinks_supported(): in_fn = 'input/link1' out_fn = os.path.join(mountpoint, 'input', 'link1') sti = os.stat(in_fn, follow_symlinks=False) sto = os.stat(out_fn, follow_symlinks=False) assert sti.st_size == len('somewhere') assert sto.st_size == len('somewhere') assert stat.S_ISLNK(sti.st_mode) assert stat.S_ISLNK(sto.st_mode) assert os.readlink(in_fn) == os.readlink(out_fn) # FIFO if are_fifos_supported(): out_fn = os.path.join(mountpoint, 'input', 'fifo1') sto = os.stat(out_fn) assert stat.S_ISFIFO(sto.st_mode) # list/read xattrs try: in_fn = 'input/fusexattr' out_fn = os.fsencode(os.path.join(mountpoint, 'input', 'fusexattr')) if not xattr.XATTR_FAKEROOT and xattr.is_enabled(self.input_path): assert sorted(no_selinux(xattr.listxattr(out_fn))) == [b'user.empty', b'user.foo', ] assert xattr.getxattr(out_fn, b'user.foo') == b'bar' assert xattr.getxattr(out_fn, b'user.empty') == b'' else: assert no_selinux(xattr.listxattr(out_fn)) == [] try: xattr.getxattr(out_fn, b'user.foo') except OSError as e: assert e.errno == llfuse.ENOATTR else: assert False, "expected OSError(ENOATTR), but no error was raised" except OSError as err: if sys.platform.startswith(('nothing_here_now', )) and err.errno == errno.ENOTSUP: # some systems have no xattr support on FUSE pass else: raise @unittest.skipUnless(llfuse, 'llfuse not installed') def test_fuse_versions_view(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.create_regular_file('test', contents=b'first') if are_hardlinks_supported(): self.create_regular_file('hardlink1', contents=b'123456') os.link('input/hardlink1', 'input/hardlink2') os.link('input/hardlink1', 'input/hardlink3') self.cmd('create', self.repository_location + '::archive1', 'input') self.create_regular_file('test', contents=b'second') self.cmd('create', self.repository_location + '::archive2', 'input') mountpoint = os.path.join(self.tmpdir, 'mountpoint') # mount the whole repository, archive contents shall show up in versioned view: with self.fuse_mount(self.repository_location, mountpoint, '-o', 'versions'): path = os.path.join(mountpoint, 'input', 'test') # filename shows up as directory ... files = os.listdir(path) assert all(f.startswith('test.') for f in files) # ... with files test.xxxxx in there assert {b'first', b'second'} == {open(os.path.join(path, f), 'rb').read() for f in files} if are_hardlinks_supported(): hl1 = os.path.join(mountpoint, 'input', 'hardlink1', 'hardlink1.00001') hl2 = os.path.join(mountpoint, 'input', 'hardlink2', 'hardlink2.00001') hl3 = os.path.join(mountpoint, 'input', 'hardlink3', 'hardlink3.00001') assert os.stat(hl1).st_ino == os.stat(hl2).st_ino == os.stat(hl3).st_ino assert open(hl3, 'rb').read() == b'123456' # similar again, but exclude the hardlink master: with self.fuse_mount(self.repository_location, mountpoint, '-o', 'versions', '-e', 'input/hardlink1'): if are_hardlinks_supported(): hl2 = os.path.join(mountpoint, 'input', 'hardlink2', 'hardlink2.00001') hl3 = os.path.join(mountpoint, 'input', 'hardlink3', 'hardlink3.00001') assert os.stat(hl2).st_ino == os.stat(hl3).st_ino assert open(hl3, 'rb').read() == b'123456' @unittest.skipUnless(llfuse, 'llfuse not installed') def test_fuse_allow_damaged_files(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.create_src_archive('archive') # Get rid of a chunk and repair it archive, repository = self.open_archive('archive') with repository: for item in archive.iter_items(): if item.path.endswith('testsuite/archiver.py'): repository.delete(item.chunks[-1].id) path = item.path # store full path for later break else: assert False # missed the file repository.commit(compact=False) self.cmd('check', '--repair', self.repository_location, exit_code=0) mountpoint = os.path.join(self.tmpdir, 'mountpoint') with self.fuse_mount(self.repository_location + '::archive', mountpoint): with pytest.raises(OSError) as excinfo: open(os.path.join(mountpoint, path)) assert excinfo.value.errno == errno.EIO with self.fuse_mount(self.repository_location + '::archive', mountpoint, '-o', 'allow_damaged_files'): open(os.path.join(mountpoint, path)).close() @unittest.skipUnless(llfuse, 'llfuse not installed') def test_fuse_mount_options(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.create_src_archive('arch11') self.create_src_archive('arch12') self.create_src_archive('arch21') self.create_src_archive('arch22') mountpoint = os.path.join(self.tmpdir, 'mountpoint') with self.fuse_mount(self.repository_location, mountpoint, '--first=2', '--sort=name'): assert sorted(os.listdir(os.path.join(mountpoint))) == ['arch11', 'arch12'] with self.fuse_mount(self.repository_location, mountpoint, '--last=2', '--sort=name'): assert sorted(os.listdir(os.path.join(mountpoint))) == ['arch21', 'arch22'] with self.fuse_mount(self.repository_location, mountpoint, '--glob-archives=arch1*'): assert sorted(os.listdir(os.path.join(mountpoint))) == ['arch11', 'arch12'] with self.fuse_mount(self.repository_location, mountpoint, '--glob-archives=arch2*'): assert sorted(os.listdir(os.path.join(mountpoint))) == ['arch21', 'arch22'] with self.fuse_mount(self.repository_location, mountpoint, '--glob-archives=arch*'): assert sorted(os.listdir(os.path.join(mountpoint))) == ['arch11', 'arch12', 'arch21', 'arch22'] with self.fuse_mount(self.repository_location, mountpoint, '--glob-archives=nope*'): assert sorted(os.listdir(os.path.join(mountpoint))) == [] @unittest.skipUnless(llfuse, 'llfuse not installed') def test_migrate_lock_alive(self): """Both old_id and new_id must not be stale during lock migration / daemonization.""" from functools import wraps import pickle import traceback # Check results are communicated from the borg mount background process # to the pytest process by means of a serialized dict object stored in this file. assert_data_file = os.path.join(self.tmpdir, 'migrate_lock_assert_data.pickle') # Decorates Lock.migrate_lock() with process_alive() checks before and after. # (We don't want to mix testing code into runtime.) def write_assert_data(migrate_lock): @wraps(migrate_lock) def wrapper(self, old_id, new_id): wrapper.num_calls += 1 assert_data = { 'num_calls': wrapper.num_calls, 'old_id': old_id, 'new_id': new_id, 'before': { 'old_id_alive': platform.process_alive(*old_id), 'new_id_alive': platform.process_alive(*new_id)}, 'exception': None, 'exception.extr_tb': None, 'after': { 'old_id_alive': None, 'new_id_alive': None}} try: with open(assert_data_file, 'wb') as _out: pickle.dump(assert_data, _out) except: pass try: return migrate_lock(self, old_id, new_id) except BaseException as e: assert_data['exception'] = e assert_data['exception.extr_tb'] = traceback.extract_tb(e.__traceback__) finally: assert_data['after'].update({ 'old_id_alive': platform.process_alive(*old_id), 'new_id_alive': platform.process_alive(*new_id)}) try: with open(assert_data_file, 'wb') as _out: pickle.dump(assert_data, _out) except: pass wrapper.num_calls = 0 return wrapper # Decorate borg.locking.Lock.migrate_lock = write_assert_data(borg.locking.Lock.migrate_lock) try: self.cmd('init', '--encryption=none', self.repository_location) self.create_src_archive('arch') mountpoint = os.path.join(self.tmpdir, 'mountpoint') # In order that the decoration is kept for the borg mount process, we must not spawn, but actually fork; # not to be confused with the forking in borg.helpers.daemonize() which is done as well. with self.fuse_mount(self.repository_location, mountpoint, os_fork=True): pass with open(assert_data_file, 'rb') as _in: assert_data = pickle.load(_in) print(f'\nLock.migrate_lock(): assert_data = {assert_data!r}.', file=sys.stderr, flush=True) exception = assert_data['exception'] if exception is not None: extracted_tb = assert_data['exception.extr_tb'] print( 'Lock.migrate_lock() raised an exception:\n', 'Traceback (most recent call last):\n', *traceback.format_list(extracted_tb), *traceback.format_exception(exception.__class__, exception, None), sep='', end='', file=sys.stderr, flush=True) assert assert_data['num_calls'] == 1, "Lock.migrate_lock() must be called exactly once." assert exception is None, "Lock.migrate_lock() may not raise an exception." assert_data_before = assert_data['before'] assert assert_data_before['old_id_alive'], "old_id must be alive (=must not be stale) when calling Lock.migrate_lock()." assert assert_data_before['new_id_alive'], "new_id must be alive (=must not be stale) when calling Lock.migrate_lock()." assert_data_after = assert_data['after'] assert assert_data_after['old_id_alive'], "old_id must be alive (=must not be stale) when Lock.migrate_lock() has returned." assert assert_data_after['new_id_alive'], "new_id must be alive (=must not be stale) when Lock.migrate_lock() has returned." finally: # Undecorate borg.locking.Lock.migrate_lock = borg.locking.Lock.migrate_lock.__wrapped__ def verify_aes_counter_uniqueness(self, method): seen = set() # Chunks already seen used = set() # counter values already used def verify_uniqueness(): with Repository(self.repository_path) as repository: for id, _ in repository.open_index(repository.get_transaction_id()).iteritems(): data = repository.get(id) hash = sha256(data).digest() if hash not in seen: seen.add(hash) num_blocks = num_cipher_blocks(len(data) - 41) nonce = bytes_to_long(data[33:41]) for counter in range(nonce, nonce + num_blocks): self.assert_not_in(counter, used) used.add(counter) self.create_test_files() os.environ['BORG_PASSPHRASE'] = 'passphrase' self.cmd('init', '--encryption=' + method, self.repository_location) verify_uniqueness() self.cmd('create', self.repository_location + '::test', 'input') verify_uniqueness() self.cmd('create', self.repository_location + '::test.2', 'input') verify_uniqueness() self.cmd('delete', self.repository_location + '::test.2') verify_uniqueness() def test_aes_counter_uniqueness_keyfile(self): self.verify_aes_counter_uniqueness('keyfile') def test_aes_counter_uniqueness_passphrase(self): self.verify_aes_counter_uniqueness('repokey') def test_debug_dump_archive_items(self): self.create_test_files() self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', self.repository_location + '::test', 'input') with changedir('output'): output = self.cmd('debug', 'dump-archive-items', self.repository_location + '::test') output_dir = sorted(os.listdir('output')) assert len(output_dir) > 0 and output_dir[0].startswith('000000_') assert 'Done.' in output def test_debug_dump_repo_objs(self): self.create_test_files() self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', self.repository_location + '::test', 'input') with changedir('output'): output = self.cmd('debug', 'dump-repo-objs', self.repository_location) output_dir = sorted(os.listdir('output')) assert len(output_dir) > 0 and output_dir[0].startswith('00000000_') assert 'Done.' in output def test_debug_put_get_delete_obj(self): self.cmd('init', '--encryption=repokey', self.repository_location) data = b'some data' self.create_regular_file('file', contents=data) output = self.cmd('debug', 'id-hash', self.repository_location, 'input/file') id_hash = output.strip() output = self.cmd('debug', 'put-obj', self.repository_location, id_hash, 'input/file') assert id_hash in output output = self.cmd('debug', 'get-obj', self.repository_location, id_hash, 'output/file') assert id_hash in output with open('output/file', 'rb') as f: data_read = f.read() assert data == data_read output = self.cmd('debug', 'delete-obj', self.repository_location, id_hash) assert "deleted" in output output = self.cmd('debug', 'delete-obj', self.repository_location, id_hash) assert "not found" in output output = self.cmd('debug', 'delete-obj', self.repository_location, 'invalid') assert "is invalid" in output def test_init_interrupt(self): def raise_eof(*args): raise EOFError with patch.object(KeyfileKeyBase, 'create', raise_eof): if self.FORK_DEFAULT: self.cmd('init', '--encryption=repokey', self.repository_location, exit_code=2) else: with pytest.raises(CancelledByUser): self.cmd('init', '--encryption=repokey', self.repository_location) assert not os.path.exists(self.repository_location) def test_init_requires_encryption_option(self): self.cmd('init', self.repository_location, exit_code=2) def test_init_nested_repositories(self): self.cmd('init', '--encryption=repokey', self.repository_location) if self.FORK_DEFAULT: self.cmd('init', '--encryption=repokey', self.repository_location + '/nested', exit_code=2) else: with pytest.raises(Repository.AlreadyExists): self.cmd('init', '--encryption=repokey', self.repository_location + '/nested') def test_init_refuse_to_overwrite_keyfile(self): """BORG_KEY_FILE=something borg init should quit if "something" already exists. See https://github.com/borgbackup/borg/pull/6046""" keyfile = os.path.join(self.tmpdir, 'keyfile') with environment_variable(BORG_KEY_FILE=keyfile): self.cmd('init', '--encryption=keyfile', self.repository_location + '0') with open(keyfile) as file: before = file.read() arg = ('init', '--encryption=keyfile', self.repository_location + '1') if self.FORK_DEFAULT: self.cmd(*arg, exit_code=2) else: with pytest.raises(borg.helpers.errors.Error): self.cmd(*arg) with open(keyfile) as file: after = file.read() assert before == after def check_cache(self): # First run a regular borg check self.cmd('check', self.repository_location) # Then check that the cache on disk matches exactly what's in the repo. with self.open_repository() as repository: manifest, key = Manifest.load(repository, Manifest.NO_OPERATION_CHECK) with Cache(repository, key, manifest, sync=False) as cache: original_chunks = cache.chunks Cache.destroy(repository) with Cache(repository, key, manifest) as cache: correct_chunks = cache.chunks assert original_chunks is not correct_chunks seen = set() for id, (refcount, size, csize) in correct_chunks.iteritems(): o_refcount, o_size, o_csize = original_chunks[id] assert refcount == o_refcount assert size == o_size assert csize == o_csize seen.add(id) for id, (refcount, size, csize) in original_chunks.iteritems(): assert id in seen def test_check_cache(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', self.repository_location + '::test', 'input') with self.open_repository() as repository: manifest, key = Manifest.load(repository, Manifest.NO_OPERATION_CHECK) with Cache(repository, key, manifest, sync=False) as cache: cache.begin_txn() cache.chunks.incref(list(cache.chunks.iteritems())[0][0]) cache.commit() with pytest.raises(AssertionError): self.check_cache() def test_recreate_target_rc(self): self.cmd('init', '--encryption=repokey', self.repository_location) if self.FORK_DEFAULT: output = self.cmd('recreate', self.repository_location, '--target=asdf', exit_code=2) assert 'Need to specify single archive' in output else: with pytest.raises(CommandError): self.cmd('recreate', self.repository_location, '--target=asdf') def test_recreate_target(self): self.create_test_files() self.cmd('init', '--encryption=repokey', self.repository_location) self.check_cache() archive = self.repository_location + '::test0' self.cmd('create', archive, 'input') self.check_cache() original_archive = self.cmd('list', self.repository_location) self.cmd('recreate', archive, 'input/dir2', '-e', 'input/dir2/file3', '--target=new-archive') self.check_cache() archives = self.cmd('list', self.repository_location) assert original_archive in archives assert 'new-archive' in archives archive = self.repository_location + '::new-archive' listing = self.cmd('list', '--short', archive) assert 'file1' not in listing assert 'dir2/file2' in listing assert 'dir2/file3' not in listing def test_recreate_basic(self): self.create_test_files() self.create_regular_file('dir2/file3', size=1024 * 80) self.cmd('init', '--encryption=repokey', self.repository_location) archive = self.repository_location + '::test0' self.cmd('create', archive, 'input') self.cmd('recreate', archive, 'input/dir2', '-e', 'input/dir2/file3') self.check_cache() listing = self.cmd('list', '--short', archive) assert 'file1' not in listing assert 'dir2/file2' in listing assert 'dir2/file3' not in listing @pytest.mark.skipif(not are_hardlinks_supported(), reason='hardlinks not supported') def test_recreate_subtree_hardlinks(self): # This is essentially the same problem set as in test_extract_hardlinks self._extract_hardlinks_setup() self.cmd('create', self.repository_location + '::test2', 'input') self.cmd('recreate', self.repository_location + '::test', 'input/dir1') self.check_cache() with changedir('output'): self.cmd('extract', self.repository_location + '::test') assert os.stat('input/dir1/hardlink').st_nlink == 2 assert os.stat('input/dir1/subdir/hardlink').st_nlink == 2 assert os.stat('input/dir1/aaaa').st_nlink == 2 assert os.stat('input/dir1/source2').st_nlink == 2 with changedir('output'): self.cmd('extract', self.repository_location + '::test2') assert os.stat('input/dir1/hardlink').st_nlink == 4 def test_recreate_rechunkify(self): with open(os.path.join(self.input_path, 'large_file'), 'wb') as fd: fd.write(b'a' * 280) fd.write(b'b' * 280) self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', '--chunker-params', '7,9,8,128', self.repository_location + '::test1', 'input') self.cmd('create', self.repository_location + '::test2', 'input', '--files-cache=disabled') list = self.cmd('list', self.repository_location + '::test1', 'input/large_file', '--format', '{num_chunks} {unique_chunks}') num_chunks, unique_chunks = map(int, list.split(' ')) # test1 and test2 do not deduplicate assert num_chunks == unique_chunks self.cmd('recreate', self.repository_location, '--chunker-params', 'default') self.check_cache() # test1 and test2 do deduplicate after recreate assert int(self.cmd('list', self.repository_location + '::test1', 'input/large_file', '--format={size}')) assert not int(self.cmd('list', self.repository_location + '::test1', 'input/large_file', '--format', '{unique_chunks}')) def test_recreate_fixed_rechunkify(self): with open(os.path.join(self.input_path, 'file'), 'wb') as fd: fd.write(b'a' * 8192) self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', '--chunker-params', '7,9,8,128', self.repository_location + '::test', 'input') output = self.cmd('list', self.repository_location + '::test', 'input/file', '--format', '{num_chunks}') num_chunks = int(output) assert num_chunks > 2 self.cmd('recreate', self.repository_location, '--chunker-params', 'fixed,4096') output = self.cmd('list', self.repository_location + '::test', 'input/file', '--format', '{num_chunks}') num_chunks = int(output) assert num_chunks == 2 def test_recreate_no_rechunkify(self): with open(os.path.join(self.input_path, 'file'), 'wb') as fd: fd.write(b'a' * 8192) self.cmd('init', '--encryption=repokey', self.repository_location) # first create an archive with non-default chunker params: self.cmd('create', '--chunker-params', '7,9,8,128', self.repository_location + '::test', 'input') output = self.cmd('list', self.repository_location + '::test', 'input/file', '--format', '{num_chunks}') num_chunks = int(output) # now recreate the archive and do NOT specify chunker params: output = self.cmd('recreate', '--debug', '--exclude', 'filename_never_matches', self.repository_location + '::test') assert 'Rechunking' not in output # we did not give --chunker-params, so it must not rechunk! output = self.cmd('list', self.repository_location + '::test', 'input/file', '--format', '{num_chunks}') num_chunks_after_recreate = int(output) assert num_chunks == num_chunks_after_recreate def test_recreate_recompress(self): self.create_regular_file('compressible', size=10000) self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', self.repository_location + '::test', 'input', '-C', 'none') file_list = self.cmd('list', self.repository_location + '::test', 'input/compressible', '--format', '{size} {csize} {sha256}') size, csize, sha256_before = file_list.split(' ') assert int(csize) >= int(size) # >= due to metadata overhead self.cmd('recreate', self.repository_location, '-C', 'lz4', '--recompress') self.check_cache() file_list = self.cmd('list', self.repository_location + '::test', 'input/compressible', '--format', '{size} {csize} {sha256}') size, csize, sha256_after = file_list.split(' ') assert int(csize) < int(size) assert sha256_before == sha256_after def test_recreate_timestamp(self): local_timezone = datetime.now(timezone(timedelta(0))).astimezone().tzinfo self.create_test_files() self.cmd('init', '--encryption=repokey', self.repository_location) archive = self.repository_location + '::test0' self.cmd('create', archive, 'input') self.cmd('recreate', '--timestamp', "1970-01-02T00:00:00", '--comment', 'test', archive) info = self.cmd('info', archive).splitlines() dtime = datetime(1970, 1, 2) + local_timezone.utcoffset(None) s_time = dtime.strftime("%Y-%m-%d") assert any([re.search(r'Time \(start\).+ %s' % s_time, item) for item in info]) assert any([re.search(r'Time \(end\).+ %s' % s_time, item) for item in info]) def test_recreate_dry_run(self): self.create_regular_file('compressible', size=10000) self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', self.repository_location + '::test', 'input') archives_before = self.cmd('list', self.repository_location + '::test') self.cmd('recreate', self.repository_location, '-n', '-e', 'input/compressible') self.check_cache() archives_after = self.cmd('list', self.repository_location + '::test') assert archives_after == archives_before def test_recreate_skips_nothing_to_do(self): self.create_regular_file('file1', size=1024 * 80) self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', self.repository_location + '::test', 'input') info_before = self.cmd('info', self.repository_location + '::test') self.cmd('recreate', self.repository_location, '--chunker-params', 'default') self.check_cache() info_after = self.cmd('info', self.repository_location + '::test') assert info_before == info_after # includes archive ID def test_with_lock(self): self.cmd('init', '--encryption=repokey', self.repository_location) lock_path = os.path.join(self.repository_path, 'lock.exclusive') cmd = 'python3', '-c', 'import os, sys; sys.exit(42 if os.path.exists("%s") else 23)' % lock_path self.cmd('with-lock', self.repository_location, *cmd, fork=True, exit_code=42) def test_with_lock_non_existent_command(self): self.cmd('init', '--encryption=repokey', self.repository_location) cmd = ['non_existent_command', ] self.cmd('with-lock', self.repository_location, *cmd, fork=True, exit_code=EXIT_ERROR) def test_recreate_list_output(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.create_regular_file('file1', size=0) self.create_regular_file('file2', size=0) self.create_regular_file('file3', size=0) self.create_regular_file('file4', size=0) self.create_regular_file('file5', size=0) self.cmd('create', self.repository_location + '::test', 'input') output = self.cmd('recreate', '--list', '--info', self.repository_location + '::test', '-e', 'input/file2') self.check_cache() self.assert_in("input/file1", output) self.assert_in("x input/file2", output) output = self.cmd('recreate', '--list', self.repository_location + '::test', '-e', 'input/file3') self.check_cache() self.assert_in("input/file1", output) self.assert_in("x input/file3", output) output = self.cmd('recreate', self.repository_location + '::test', '-e', 'input/file4') self.check_cache() self.assert_not_in("input/file1", output) self.assert_not_in("x input/file4", output) output = self.cmd('recreate', '--info', self.repository_location + '::test', '-e', 'input/file5') self.check_cache() self.assert_not_in("input/file1", output) self.assert_not_in("x input/file5", output) def test_bad_filters(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', self.repository_location + '::test', 'input') self.cmd('delete', '--first', '1', '--last', '1', self.repository_location, fork=True, exit_code=2) def test_key_export_keyfile(self): export_file = self.output_path + '/exported' self.cmd('init', self.repository_location, '--encryption', 'keyfile') repo_id = self._extract_repository_id(self.repository_path) self.cmd('key', 'export', self.repository_location, export_file) with open(export_file) as fd: export_contents = fd.read() assert export_contents.startswith('BORG_KEY ' + bin_to_hex(repo_id) + '\n') key_file = self.keys_path + '/' + os.listdir(self.keys_path)[0] with open(key_file) as fd: key_contents = fd.read() assert key_contents == export_contents os.unlink(key_file) self.cmd('key', 'import', self.repository_location, export_file) with open(key_file) as fd: key_contents2 = fd.read() assert key_contents2 == key_contents def test_key_import_keyfile_with_borg_key_file(self): self.cmd('init', self.repository_location, '--encryption', 'keyfile') exported_key_file = os.path.join(self.output_path, 'exported') self.cmd('key', 'export', self.repository_location, exported_key_file) key_file = os.path.join(self.keys_path, os.listdir(self.keys_path)[0]) with open(key_file) as fd: key_contents = fd.read() os.unlink(key_file) imported_key_file = os.path.join(self.output_path, 'imported') with environment_variable(BORG_KEY_FILE=imported_key_file): self.cmd('key', 'import', self.repository_location, exported_key_file) assert not os.path.isfile(key_file), '"borg key import" should respect BORG_KEY_FILE' with open(imported_key_file) as fd: imported_key_contents = fd.read() assert imported_key_contents == key_contents def test_key_export_repokey(self): export_file = self.output_path + '/exported' self.cmd('init', self.repository_location, '--encryption', 'repokey') repo_id = self._extract_repository_id(self.repository_path) self.cmd('key', 'export', self.repository_location, export_file) with open(export_file) as fd: export_contents = fd.read() assert export_contents.startswith('BORG_KEY ' + bin_to_hex(repo_id) + '\n') with Repository(self.repository_path) as repository: repo_key = RepoKey(repository) repo_key.load(None, Passphrase.env_passphrase()) backup_key = KeyfileKey(key.TestKey.MockRepository()) backup_key.load(export_file, Passphrase.env_passphrase()) assert repo_key.enc_key == backup_key.enc_key with Repository(self.repository_path) as repository: repository.save_key(b'') self.cmd('key', 'import', self.repository_location, export_file) with Repository(self.repository_path) as repository: repo_key2 = RepoKey(repository) repo_key2.load(None, Passphrase.env_passphrase()) assert repo_key2.enc_key == repo_key2.enc_key def test_key_export_qr(self): export_file = self.output_path + '/exported.html' self.cmd('init', self.repository_location, '--encryption', 'repokey') repo_id = self._extract_repository_id(self.repository_path) self.cmd('key', 'export', '--qr-html', self.repository_location, export_file) with open(export_file, encoding='utf-8') as fd: export_contents = fd.read() assert bin_to_hex(repo_id) in export_contents assert export_contents.startswith('') assert export_contents.endswith('\n') def test_key_export_directory(self): export_directory = self.output_path + '/exported' os.mkdir(export_directory) self.cmd('init', self.repository_location, '--encryption', 'repokey') if self.FORK_DEFAULT: self.cmd('key', 'export', self.repository_location, export_directory, exit_code=EXIT_ERROR) else: with pytest.raises(CommandError): self.cmd('key', 'export', self.repository_location, export_directory) def test_key_import_errors(self): export_file = self.output_path + '/exported' self.cmd('init', self.repository_location, '--encryption', 'keyfile') if self.FORK_DEFAULT: self.cmd('key', 'import', self.repository_location, export_file, exit_code=EXIT_ERROR) else: with pytest.raises(CommandError): self.cmd('key', 'import', self.repository_location, export_file) with open(export_file, 'w') as fd: fd.write('something not a key\n') if self.FORK_DEFAULT: self.cmd('key', 'import', self.repository_location, export_file, exit_code=2) else: with pytest.raises(NotABorgKeyFile): self.cmd('key', 'import', self.repository_location, export_file) with open(export_file, 'w') as fd: fd.write('BORG_KEY a0a0a0\n') if self.FORK_DEFAULT: self.cmd('key', 'import', self.repository_location, export_file, exit_code=2) else: with pytest.raises(RepoIdMismatch): self.cmd('key', 'import', self.repository_location, export_file) def test_key_export_paperkey(self): repo_id = 'e294423506da4e1ea76e8dcdf1a3919624ae3ae496fddf905610c351d3f09239' export_file = self.output_path + '/exported' self.cmd('init', self.repository_location, '--encryption', 'keyfile') self._set_repository_id(self.repository_path, hex_to_bin(repo_id)) key_file = self.keys_path + '/' + os.listdir(self.keys_path)[0] with open(key_file, 'w') as fd: fd.write(KeyfileKey.FILE_ID + ' ' + repo_id + '\n') fd.write(binascii.b2a_base64(b'abcdefghijklmnopqrstu').decode()) self.cmd('key', 'export', '--paper', self.repository_location, export_file) with open(export_file) as fd: export_contents = fd.read() assert export_contents == """To restore key use borg key import --paper /path/to/repo BORG PAPER KEY v1 id: 2 / e29442 3506da 4e1ea7 / 25f62a 5a3d41 - 02 1: 616263 646566 676869 6a6b6c 6d6e6f 707172 - 6d 2: 737475 - 88 """ def test_key_import_paperkey(self): repo_id = 'e294423506da4e1ea76e8dcdf1a3919624ae3ae496fddf905610c351d3f09239' self.cmd('init', self.repository_location, '--encryption', 'keyfile') self._set_repository_id(self.repository_path, hex_to_bin(repo_id)) key_file = self.keys_path + '/' + os.listdir(self.keys_path)[0] with open(key_file, 'w') as fd: fd.write(KeyfileKey.FILE_ID + ' ' + repo_id + '\n') fd.write(binascii.b2a_base64(b'abcdefghijklmnopqrstu').decode()) typed_input = ( b'2 / e29442 3506da 4e1ea7 / 25f62a 5a3d41 02\n' # Forgot to type "-" b'2 / e29442 3506da 4e1ea7 25f62a 5a3d41 - 02\n' # Forgot to type second "/" b'2 / e29442 3506da 4e1ea7 / 25f62a 5a3d42 - 02\n' # Typo (..42 not ..41) b'2 / e29442 3506da 4e1ea7 / 25f62a 5a3d41 - 02\n' # Correct! Congratulations b'616263 646566 676869 6a6b6c 6d6e6f 707172 - 6d\n' b'\n\n' # Abort [yN] => N b'737475 88\n' # missing "-" b'73747i - 88\n' # typo b'73747 - 88\n' # missing nibble b'73 74 75 - 89\n' # line checksum mismatch b'00a1 - 88\n' # line hash collision - overall hash mismatch, have to start over b'2 / e29442 3506da 4e1ea7 / 25f62a 5a3d41 - 02\n' b'616263 646566 676869 6a6b6c 6d6e6f 707172 - 6d\n' b'73 74 75 - 88\n' ) # In case that this has to change, here is a quick way to find a colliding line hash: # # from hashlib import sha256 # hash_fn = lambda x: sha256(b'\x00\x02' + x).hexdigest()[:2] # for i in range(1000): # if hash_fn(i.to_bytes(2, byteorder='big')) == '88': # 88 = line hash # print(i.to_bytes(2, 'big')) # break self.cmd('key', 'import', '--paper', self.repository_location, input=typed_input) # Test abort paths typed_input = b'\ny\n' self.cmd('key', 'import', '--paper', self.repository_location, input=typed_input) typed_input = b'2 / e29442 3506da 4e1ea7 / 25f62a 5a3d41 - 02\n\ny\n' self.cmd('key', 'import', '--paper', self.repository_location, input=typed_input) def test_debug_dump_manifest(self): self.create_regular_file('file1', size=1024 * 80) self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', self.repository_location + '::test', 'input') dump_file = self.output_path + '/dump' output = self.cmd('debug', 'dump-manifest', self.repository_location, dump_file) assert output == "" with open(dump_file) as f: result = json.load(f) assert 'archives' in result assert 'config' in result assert 'item_keys' in result assert 'timestamp' in result assert 'version' in result def test_debug_dump_archive(self): self.create_regular_file('file1', size=1024 * 80) self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', self.repository_location + '::test', 'input') dump_file = self.output_path + '/dump' output = self.cmd('debug', 'dump-archive', self.repository_location + "::test", dump_file) assert output == "" with open(dump_file) as f: result = json.load(f) assert '_name' in result assert '_manifest_entry' in result assert '_meta' in result assert '_items' in result def test_debug_refcount_obj(self): self.cmd('init', '--encryption=repokey', self.repository_location) output = self.cmd('debug', 'refcount-obj', self.repository_location, '0' * 64).strip() assert output == 'object 0000000000000000000000000000000000000000000000000000000000000000 not found [info from chunks cache].' create_json = json.loads(self.cmd('create', '--json', self.repository_location + '::test', 'input')) archive_id = create_json['archive']['id'] output = self.cmd('debug', 'refcount-obj', self.repository_location, archive_id).strip() assert output == 'object ' + archive_id + ' has 1 referrers [info from chunks cache].' # Invalid IDs do not abort or return an error output = self.cmd('debug', 'refcount-obj', self.repository_location, '124', 'xyza').strip() assert output == 'object id 124 is invalid.\nobject id xyza is invalid.' def test_debug_info(self): output = self.cmd('debug', 'info') assert 'CRC implementation' in output assert 'Python' in output def test_benchmark_crud(self): self.cmd('init', '--encryption=repokey', self.repository_location) with environment_variable(_BORG_BENCHMARK_CRUD_TEST='YES'): self.cmd('benchmark', 'crud', self.repository_location, self.input_path) def test_config(self): self.create_test_files() os.unlink('input/flagfile') self.cmd('init', '--encryption=repokey', self.repository_location) output = self.cmd('config', '--list', self.repository_location) self.assert_in('[repository]', output) self.assert_in('version', output) self.assert_in('segments_per_dir', output) self.assert_in('storage_quota', output) self.assert_in('append_only', output) self.assert_in('additional_free_space', output) self.assert_in('id', output) self.assert_not_in('last_segment_checked', output) if self.FORK_DEFAULT: output = self.cmd('config', self.repository_location, 'last_segment_checked', exit_code=2) self.assert_in('No option ', output) else: with pytest.raises(Error): self.cmd('config', self.repository_location, 'last_segment_checked') self.cmd('config', self.repository_location, 'last_segment_checked', '123') output = self.cmd('config', self.repository_location, 'last_segment_checked') assert output == '123' + '\n' output = self.cmd('config', '--list', self.repository_location) self.assert_in('last_segment_checked', output) self.cmd('config', '--delete', self.repository_location, 'last_segment_checked') for cfg_key, cfg_value in [ ('additional_free_space', '2G'), ('repository.append_only', '1'), ]: output = self.cmd('config', self.repository_location, cfg_key) assert output == '0' + '\n' self.cmd('config', self.repository_location, cfg_key, cfg_value) output = self.cmd('config', self.repository_location, cfg_key) assert output == cfg_value + '\n' self.cmd('config', '--delete', self.repository_location, cfg_key) if self.FORK_DEFAULT: self.cmd('config', self.repository_location, cfg_key, exit_code=2) else: with pytest.raises(Error): self.cmd('config', self.repository_location, cfg_key) self.cmd('config', '--list', '--delete', self.repository_location, exit_code=2) if self.FORK_DEFAULT: self.cmd('config', self.repository_location, exit_code=2) else: with pytest.raises(CommandError): self.cmd('config', self.repository_location) if self.FORK_DEFAULT: self.cmd('config', self.repository_location, 'invalid-option', exit_code=2) else: with pytest.raises(Error): self.cmd('config', self.repository_location, 'invalid-option') requires_gnutar = pytest.mark.skipif(not have_gnutar(), reason='GNU tar must be installed for this test.') requires_gzip = pytest.mark.skipif(not shutil.which('gzip'), reason='gzip must be installed for this test.') @requires_gnutar def test_export_tar(self): self.create_test_files() os.unlink('input/flagfile') self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', self.repository_location + '::test', 'input') self.cmd('export-tar', self.repository_location + '::test', 'simple.tar', '--progress') with changedir('output'): # This probably assumes GNU tar. Note -p switch to extract permissions regardless of umask. subprocess.check_call(['tar', 'xpf', '../simple.tar', '--warning=no-timestamp']) self.assert_dirs_equal('input', 'output/input', ignore_flags=True, ignore_xattrs=True, ignore_ns=True) @requires_gnutar @requires_gzip def test_export_tar_gz(self): if not shutil.which('gzip'): pytest.skip('gzip is not installed') self.create_test_files() os.unlink('input/flagfile') self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', self.repository_location + '::test', 'input') list = self.cmd('export-tar', self.repository_location + '::test', 'simple.tar.gz', '--list') assert 'input/file1\n' in list assert 'input/dir2\n' in list with changedir('output'): subprocess.check_call(['tar', 'xpf', '../simple.tar.gz', '--warning=no-timestamp']) self.assert_dirs_equal('input', 'output/input', ignore_flags=True, ignore_xattrs=True, ignore_ns=True) @requires_gnutar def test_export_tar_strip_components(self): if not shutil.which('gzip'): pytest.skip('gzip is not installed') self.create_test_files() os.unlink('input/flagfile') self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', self.repository_location + '::test', 'input') list = self.cmd('export-tar', self.repository_location + '::test', 'simple.tar', '--strip-components=1', '--list') # --list's path are those before processing with --strip-components assert 'input/file1\n' in list assert 'input/dir2\n' in list with changedir('output'): subprocess.check_call(['tar', 'xpf', '../simple.tar', '--warning=no-timestamp']) self.assert_dirs_equal('input', 'output/', ignore_flags=True, ignore_xattrs=True, ignore_ns=True) @requires_hardlinks @requires_gnutar def test_export_tar_strip_components_links(self): self._extract_hardlinks_setup() self.cmd('export-tar', self.repository_location + '::test', 'output.tar', '--strip-components=2') with changedir('output'): subprocess.check_call(['tar', 'xpf', '../output.tar', '--warning=no-timestamp']) assert os.stat('hardlink').st_nlink == 2 assert os.stat('subdir/hardlink').st_nlink == 2 assert os.stat('aaaa').st_nlink == 2 assert os.stat('source2').st_nlink == 2 @requires_hardlinks @requires_gnutar def test_extract_hardlinks_tar(self): self._extract_hardlinks_setup() self.cmd('export-tar', self.repository_location + '::test', 'output.tar', 'input/dir1') with changedir('output'): subprocess.check_call(['tar', 'xpf', '../output.tar', '--warning=no-timestamp']) assert os.stat('input/dir1/hardlink').st_nlink == 2 assert os.stat('input/dir1/subdir/hardlink').st_nlink == 2 assert os.stat('input/dir1/aaaa').st_nlink == 2 assert os.stat('input/dir1/source2').st_nlink == 2 def test_import_tar(self): self.create_test_files() os.unlink('input/flagfile') self.cmd('init', '--encryption=none', self.repository_location) self.cmd('create', self.repository_location + '::src', 'input') self.cmd('export-tar', self.repository_location + '::src', 'simple.tar') self.cmd('import-tar', self.repository_location + '::dst', 'simple.tar') with changedir(self.output_path): self.cmd('extract', self.repository_location + '::dst') self.assert_dirs_equal('input', 'output/input', ignore_ns=True, ignore_xattrs=True) @requires_gzip def test_import_tar_gz(self): if not shutil.which('gzip'): pytest.skip('gzip is not installed') self.create_test_files() os.unlink('input/flagfile') self.cmd('init', '--encryption=none', self.repository_location) self.cmd('create', self.repository_location + '::src', 'input') self.cmd('export-tar', self.repository_location + '::src', 'simple.tgz') self.cmd('import-tar', self.repository_location + '::dst', 'simple.tgz') with changedir(self.output_path): self.cmd('extract', self.repository_location + '::dst') self.assert_dirs_equal('input', 'output/input', ignore_ns=True, ignore_xattrs=True) @requires_gnutar def test_import_concatenated_tar_with_ignore_zeros(self): # file1 has a hardlink reference to it, but we put it in a separate # tarball, breaking the link during import-tar. It could be any other # file though, so we won't take chances and just avoid hardlinks. self.create_test_files(create_hardlinks=False) os.unlink('input/flagfile') with changedir('input'): subprocess.check_call(['tar', 'cf', 'file1.tar', 'file1']) subprocess.check_call(['tar', 'cf', 'the_rest.tar', '--exclude', 'file1*', '.']) with open('concatenated.tar', 'wb') as concatenated: with open('file1.tar', 'rb') as file1: concatenated.write(file1.read()) # Clean up for assert_dirs_equal. os.unlink('file1.tar') with open('the_rest.tar', 'rb') as the_rest: concatenated.write(the_rest.read()) # Clean up for assert_dirs_equal. os.unlink('the_rest.tar') self.cmd('init', '--encryption=none', self.repository_location) self.cmd('import-tar', '--ignore-zeros', self.repository_location + '::dst', 'input/concatenated.tar') os.unlink('input/concatenated.tar') with changedir(self.output_path): self.cmd('extract', self.repository_location + '::dst') self.assert_dirs_equal('input', 'output', ignore_ns=True, ignore_xattrs=True) @requires_gnutar def test_import_concatenated_tar_without_ignore_zeros(self): self.create_test_files() os.unlink('input/flagfile') with changedir('input'): subprocess.check_call(['tar', 'cf', 'file1.tar', 'file1']) subprocess.check_call(['tar', 'cf', 'the_rest.tar', '--exclude', 'file1*', '.']) with open('concatenated.tar', 'wb') as concatenated: with open('file1.tar', 'rb') as file1: concatenated.write(file1.read()) with open('the_rest.tar', 'rb') as the_rest: concatenated.write(the_rest.read()) self.cmd('init', '--encryption=none', self.repository_location) self.cmd('import-tar', self.repository_location + '::dst', 'input/concatenated.tar') with changedir(self.output_path): self.cmd('extract', self.repository_location + '::dst') # Negative test -- assert that only file1 has been extracted, and the_rest has been ignored # due to zero-filled block marker. self.assert_equal(os.listdir('output'), ['file1']) def test_detect_attic_repo(self): path = make_attic_repo(self.repository_path) cmds = [ ['create', path + '::test', self.tmpdir], ['extract', path + '::test'], ['check', path], ['rename', path + '::test', 'newname'], ['list', path], ['delete', path], ['prune', path], ['info', path + '::test'], ['key', 'export', path, 'exported'], ['key', 'import', path, 'import'], ['key', 'change-passphrase', path], ['break-lock', path], ] for args in cmds: output = self.cmd(*args, fork=True, exit_code=2) assert 'Attic repository detected.' in output # derived from test_extract_xattrs_errors() @pytest.mark.skipif(not xattr.XATTR_FAKEROOT, reason='xattr not supported on this system or on this version of ' 'fakeroot') def test_do_not_fail_when_percent_is_in_xattr_name(self): """https://github.com/borgbackup/borg/issues/6063""" def patched_setxattr_EACCES(*args, **kwargs): raise OSError(errno.EACCES, 'EACCES') self.create_regular_file('file') xattr.setxattr(b'input/file', b'user.attribute%p', b'value') self.cmd('init', self.repository_location, '-e' 'none') self.cmd('create', self.repository_location + '::test', 'input') with changedir('output'): with patch.object(xattr, 'setxattr', patched_setxattr_EACCES): self.cmd('extract', self.repository_location + '::test', exit_code=EXIT_WARNING) # derived from test_extract_xattrs_errors() @pytest.mark.skipif(not xattr.XATTR_FAKEROOT, reason='xattr not supported on this system or on this version of ' 'fakeroot') def test_do_not_fail_when_percent_is_in_file_name(self): """https://github.com/borgbackup/borg/issues/6063""" def patched_setxattr_EACCES(*args, **kwargs): raise OSError(errno.EACCES, 'EACCES') os.makedirs(os.path.join(self.input_path, 'dir%p')) xattr.setxattr(b'input/dir%p', b'user.attribute', b'value') self.cmd('init', self.repository_location, '-e' 'none') self.cmd('create', self.repository_location + '::test', 'input') with changedir('output'): with patch.object(xattr, 'setxattr', patched_setxattr_EACCES): self.cmd('extract', self.repository_location + '::test', exit_code=EXIT_WARNING) def test_do_not_mention_archive_if_you_can_not_find_repo(self): """https://github.com/borgbackup/borg/issues/6014""" archive = self.repository_location + '-this-repository-does-not-exist' + '::test' output = self.cmd('info', archive, exit_code=2, fork=True) self.assert_in('this-repository-does-not-exist', output) self.assert_not_in('this-repository-does-not-exist::test', output) def test_can_read_repo_even_if_nonce_is_deleted(self): """Nonce is only used for encrypting new data. It should be possible to retrieve the data from an archive even if both the client and the server forget the nonce""" self.create_regular_file('file1', contents=b'Hello, borg') self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', self.repository_location + '::test', 'input') # Oops! We have removed the repo-side memory of the nonce! # See https://github.com/borgbackup/borg/issues/5858 os.remove(os.path.join(self.repository_path, 'nonce')) # Oops! The client has lost the nonce too! os.remove(os.path.join(self.get_security_dir(), 'nonce')) # The repo should still be readable repo_info = self.cmd('info', self.repository_location) assert 'All archives:' in repo_info repo_list = self.cmd('list', self.repository_location) assert 'test' in repo_list # The archive should still be readable archive_info = self.cmd('info', self.repository_location + '::test') assert 'Archive name: test\n' in archive_info archive_list = self.cmd('list', self.repository_location + '::test') assert 'file1' in archive_list # Extracting the archive should work with changedir('output'): self.cmd('extract', self.repository_location + '::test') self.assert_dirs_equal('input', 'output/input') def test_recovery_from_deleted_repo_nonce(self): """We should be able to recover if path/to/repo/nonce is deleted. The nonce is stored in two places: in the repo and in $HOME. The nonce in the repo is only needed when multiple clients use the same repo. Otherwise we can just use our own copy of the nonce. """ self.create_regular_file('file1', contents=b'Hello, borg') self.cmd('init', '--encryption=repokey', self.repository_location) self.cmd('create', self.repository_location + '::test', 'input') # Oops! We have removed the repo-side memory of the nonce! # See https://github.com/borgbackup/borg/issues/5858 nonce = os.path.join(self.repository_path, 'nonce') os.remove(nonce) self.cmd('create', self.repository_location + '::test2', 'input') assert os.path.exists(nonce) @unittest.skipUnless('binary' in BORG_EXES, 'no borg.exe available') class ArchiverTestCaseBinary(ArchiverTestCase): EXE = 'borg.exe' FORK_DEFAULT = True @unittest.skip('does not raise Exception, but sets rc==2') def test_init_parent_dirs(self): pass @unittest.skip('patches objects') def test_init_interrupt(self): pass @unittest.skip('patches objects') def test_extract_capabilities(self): pass @unittest.skip('patches objects') def test_extract_xattrs_errors(self): pass @unittest.skip('test_basic_functionality seems incompatible with fakeroot and/or the binary.') def test_basic_functionality(self): pass @unittest.skip('test_overwrite seems incompatible with fakeroot and/or the binary.') def test_overwrite(self): pass def test_fuse(self): if fakeroot_detected(): unittest.skip('test_fuse with the binary is not compatible with fakeroot') else: super().test_fuse() @unittest.skip('patches objects') def test_do_not_fail_when_percent_is_in_xattr_name(self): pass @unittest.skip('patches objects') def test_do_not_fail_when_percent_is_in_file_name(self): pass class ArchiverCheckTestCase(ArchiverTestCaseBase): def setUp(self): super().setUp() with patch.object(ChunkBuffer, 'BUFFER_SIZE', 10): self.cmd('init', '--encryption=repokey', self.repository_location) self.create_src_archive('archive1') self.create_src_archive('archive2') def test_check_usage(self): output = self.cmd('check', '-v', '--progress', self.repository_location, exit_code=0) self.assert_in('Starting repository check', output) self.assert_in('Starting archive consistency check', output) self.assert_in('Checking segments', output) # reset logging to new process default to avoid need for fork=True on next check logging.getLogger('borg.output.progress').setLevel(logging.NOTSET) output = self.cmd('check', '-v', '--repository-only', self.repository_location, exit_code=0) self.assert_in('Starting repository check', output) self.assert_not_in('Starting archive consistency check', output) self.assert_not_in('Checking segments', output) output = self.cmd('check', '-v', '--archives-only', self.repository_location, exit_code=0) self.assert_not_in('Starting repository check', output) self.assert_in('Starting archive consistency check', output) output = self.cmd('check', '-v', '--archives-only', '--glob-archives=archive2', self.repository_location, exit_code=0) self.assert_not_in('archive1', output) output = self.cmd('check', '-v', '--archives-only', '--first=1', self.repository_location, exit_code=0) self.assert_in('archive1', output) self.assert_not_in('archive2', output) output = self.cmd('check', '-v', '--archives-only', '--last=1', self.repository_location, exit_code=0) self.assert_not_in('archive1', output) self.assert_in('archive2', output) def test_missing_file_chunk(self): archive, repository = self.open_archive('archive1') with repository: for item in archive.iter_items(): if item.path.endswith('testsuite/archiver.py'): valid_chunks = item.chunks killed_chunk = valid_chunks[-1] repository.delete(killed_chunk.id) break else: self.fail('should not happen') repository.commit(compact=False) self.cmd('check', self.repository_location, exit_code=1) output = self.cmd('check', '--repair', self.repository_location, exit_code=0) self.assert_in('New missing file chunk detected', output) self.cmd('check', self.repository_location, exit_code=0) output = self.cmd('list', '--format={health}#{path}{LF}', self.repository_location + '::archive1', exit_code=0) self.assert_in('broken#', output) # check that the file in the old archives has now a different chunk list without the killed chunk for archive_name in ('archive1', 'archive2'): archive, repository = self.open_archive(archive_name) with repository: for item in archive.iter_items(): if item.path.endswith('testsuite/archiver.py'): self.assert_not_equal(valid_chunks, item.chunks) self.assert_not_in(killed_chunk, item.chunks) break else: self.fail('should not happen') # do a fresh backup (that will include the killed chunk) with patch.object(ChunkBuffer, 'BUFFER_SIZE', 10): self.create_src_archive('archive3') # check should be able to heal the file now: output = self.cmd('check', '-v', '--repair', self.repository_location, exit_code=0) self.assert_in('Healed previously missing file chunk', output) self.assert_in('testsuite/archiver.py: Completely healed previously damaged file!', output) # check that the file in the old archives has the correct chunks again for archive_name in ('archive1', 'archive2'): archive, repository = self.open_archive(archive_name) with repository: for item in archive.iter_items(): if item.path.endswith('testsuite/archiver.py'): self.assert_equal(valid_chunks, item.chunks) break else: self.fail('should not happen') # list is also all-healthy again output = self.cmd('list', '--format={health}#{path}{LF}', self.repository_location + '::archive1', exit_code=0) self.assert_not_in('broken#', output) def test_missing_archive_item_chunk(self): archive, repository = self.open_archive('archive1') with repository: repository.delete(archive.metadata.items[0]) repository.commit(compact=False) self.cmd('check', self.repository_location, exit_code=1) self.cmd('check', '--repair', self.repository_location, exit_code=0) self.cmd('check', self.repository_location, exit_code=0) def test_missing_archive_metadata(self): archive, repository = self.open_archive('archive1') with repository: repository.delete(archive.id) repository.commit(compact=False) self.cmd('check', self.repository_location, exit_code=1) self.cmd('check', '--repair', self.repository_location, exit_code=0) self.cmd('check', self.repository_location, exit_code=0) def test_missing_manifest(self): archive, repository = self.open_archive('archive1') with repository: repository.delete(Manifest.MANIFEST_ID) repository.commit(compact=False) self.cmd('check', self.repository_location, exit_code=1) output = self.cmd('check', '-v', '--repair', self.repository_location, exit_code=0) self.assert_in('archive1', output) self.assert_in('archive2', output) self.cmd('check', self.repository_location, exit_code=0) def test_corrupted_manifest(self): archive, repository = self.open_archive('archive1') with repository: manifest = repository.get(Manifest.MANIFEST_ID) corrupted_manifest = manifest + b'corrupted!' repository.put(Manifest.MANIFEST_ID, corrupted_manifest) repository.commit(compact=False) self.cmd('check', self.repository_location, exit_code=1) output = self.cmd('check', '-v', '--repair', self.repository_location, exit_code=0) self.assert_in('archive1', output) self.assert_in('archive2', output) self.cmd('check', self.repository_location, exit_code=0) def test_manifest_rebuild_corrupted_chunk(self): archive, repository = self.open_archive('archive1') with repository: manifest = repository.get(Manifest.MANIFEST_ID) corrupted_manifest = manifest + b'corrupted!' repository.put(Manifest.MANIFEST_ID, corrupted_manifest) chunk = repository.get(archive.id) corrupted_chunk = chunk + b'corrupted!' repository.put(archive.id, corrupted_chunk) repository.commit(compact=False) self.cmd('check', self.repository_location, exit_code=1) output = self.cmd('check', '-v', '--repair', self.repository_location, exit_code=0) self.assert_in('archive2', output) self.cmd('check', self.repository_location, exit_code=0) def test_manifest_rebuild_duplicate_archive(self): archive, repository = self.open_archive('archive1') key = archive.key with repository: manifest = repository.get(Manifest.MANIFEST_ID) corrupted_manifest = manifest + b'corrupted!' repository.put(Manifest.MANIFEST_ID, corrupted_manifest) archive_dict = { 'cmdline': [], 'items': [], 'hostname': 'foo', 'username': 'bar', 'name': 'archive1', 'time': '2016-12-15T18:49:51.849711', 'version': 1, } archive = key.pack_and_authenticate_metadata(archive_dict, context=b'archive') archive_id = key.id_hash(archive) repository.put(archive_id, key.encrypt(archive)) repository.commit(compact=False) self.cmd('check', self.repository_location, exit_code=1) self.cmd('check', '--repair', self.repository_location, exit_code=0) output = self.cmd('list', self.repository_location) self.assert_in('archive1', output) self.assert_in('archive1.1', output) self.assert_in('archive2', output) def test_extra_chunks(self): self.cmd('check', self.repository_location, exit_code=0) with Repository(self.repository_location, exclusive=True) as repository: repository.put(b'01234567890123456789012345678901', b'xxxx') repository.commit(compact=False) self.cmd('check', self.repository_location, exit_code=1) self.cmd('check', self.repository_location, exit_code=1) self.cmd('check', '--repair', self.repository_location, exit_code=0) self.cmd('check', self.repository_location, exit_code=0) self.cmd('extract', '--dry-run', self.repository_location + '::archive1', exit_code=0) def _test_verify_data(self, *init_args): shutil.rmtree(self.repository_path) self.cmd('init', self.repository_location, *init_args) self.create_src_archive('archive1') archive, repository = self.open_archive('archive1') with repository: for item in archive.iter_items(): if item.path.endswith('testsuite/archiver.py'): chunk = item.chunks[-1] data = repository.get(chunk.id) + b'1234' repository.put(chunk.id, data) break repository.commit(compact=False) self.cmd('check', self.repository_location, exit_code=0) output = self.cmd('check', '--verify-data', self.repository_location, exit_code=1) assert bin_to_hex(chunk.id) + ', integrity error' in output # repair (heal is tested in another test) output = self.cmd('check', '--repair', '--verify-data', self.repository_location, exit_code=0) assert bin_to_hex(chunk.id) + ', integrity error' in output assert 'testsuite/archiver.py: New missing file chunk detected' in output def test_verify_data(self): self._test_verify_data('--encryption', 'repokey') def test_verify_data_unencrypted(self): self._test_verify_data('--encryption', 'none') def test_empty_repository(self): with Repository(self.repository_location, exclusive=True) as repository: for id_ in repository.list(): repository.delete(id_) repository.commit(compact=False) self.cmd('check', self.repository_location, exit_code=1) def test_attic013_acl_bug(self): # Attic up to release 0.13 contained a bug where every item unintentionally received # a b'acl'=None key-value pair. # This bug can still live on in Borg repositories (through borg upgrade). class Attic013Item: def as_dict(self): return { # These are required b'path': '1234', b'mtime': 0, b'mode': 0, b'user': b'0', b'group': b'0', b'uid': 0, b'gid': 0, # acl is the offending key. b'acl': None, } archive, repository = self.open_archive('archive1') with repository: manifest, key = Manifest.load(repository, Manifest.NO_OPERATION_CHECK) with Cache(repository, key, manifest) as cache: archive = Archive(repository, key, manifest, '0.13', cache=cache, create=True) archive.items_buffer.add(Attic013Item()) archive.save() self.cmd('check', self.repository_location, exit_code=0) self.cmd('list', self.repository_location + '::0.13', exit_code=0) class ManifestAuthenticationTest(ArchiverTestCaseBase): def spoof_manifest(self, repository): with repository: _, key = Manifest.load(repository, Manifest.NO_OPERATION_CHECK) repository.put(Manifest.MANIFEST_ID, key.encrypt(msgpack.packb({ 'version': 1, 'archives': {}, 'config': {}, 'timestamp': (utcnow() + timedelta(days=1)).strftime(ISO_FORMAT), }))) repository.commit(compact=False) def test_fresh_init_tam_required(self): self.cmd('init', '--encryption=repokey', self.repository_location) repository = Repository(self.repository_path, exclusive=True) with repository: manifest, key = Manifest.load(repository, Manifest.NO_OPERATION_CHECK) repository.put(Manifest.MANIFEST_ID, key.encrypt(msgpack.packb({ 'version': 1, 'archives': {}, 'timestamp': (utcnow() + timedelta(days=1)).strftime(ISO_FORMAT), }))) repository.commit(compact=False) with pytest.raises(TAMRequiredError): self.cmd('list', self.repository_location) def test_not_required(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.create_src_archive('archive1234') repository = Repository(self.repository_path, exclusive=True) with repository: shutil.rmtree(get_security_dir(bin_to_hex(repository.id))) _, key = Manifest.load(repository, Manifest.NO_OPERATION_CHECK) key.tam_required = False key.change_passphrase(key._passphrase) manifest = msgpack.unpackb(key.decrypt(None, repository.get(Manifest.MANIFEST_ID))) del manifest[b'tam'] repository.put(Manifest.MANIFEST_ID, key.encrypt(msgpack.packb(manifest))) repository.commit(compact=False) output = self.cmd('list', '--debug', self.repository_location) assert 'archive1234' in output assert 'Manifest TAM not found and not required' in output # Run upgrade self.cmd('upgrade', '--tam', self.repository_location) # Manifest must be authenticated now output = self.cmd('list', '--debug', self.repository_location) assert 'archive1234' in output assert 'TAM-verified manifest' in output # Try to spoof / modify pre-1.0.9 self.spoof_manifest(repository) # Fails with pytest.raises(TAMRequiredError): self.cmd('list', self.repository_location) # Force upgrade self.cmd('upgrade', '--tam', '--force', self.repository_location) self.cmd('list', self.repository_location) def test_disable(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.create_src_archive('archive1234') self.cmd('upgrade', '--disable-tam', self.repository_location) repository = Repository(self.repository_path, exclusive=True) self.spoof_manifest(repository) assert not self.cmd('list', self.repository_location) def test_disable2(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.create_src_archive('archive1234') repository = Repository(self.repository_path, exclusive=True) self.spoof_manifest(repository) self.cmd('upgrade', '--disable-tam', self.repository_location) assert not self.cmd('list', self.repository_location) class ArchiveAuthenticationTest(ArchiverTestCaseBase): def write_archive_without_tam(self, repository, archive_name): manifest, key = Manifest.load(repository, Manifest.NO_OPERATION_CHECK) archive_data = msgpack.packb({ 'version': 1, 'name': archive_name, 'items': [], 'cmdline': '', 'hostname': '', 'username': '', 'time': utcnow().strftime(ISO_FORMAT), }) archive_id = key.id_hash(archive_data) repository.put(archive_id, key.encrypt(archive_data)) manifest.archives[archive_name] = (archive_id, datetime.now()) manifest.write() repository.commit(compact=False) def test_upgrade_archives_tam(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.create_src_archive('archive_tam') repository = Repository(self.repository_path, exclusive=True) with repository: self.write_archive_without_tam(repository, "archive_no_tam") output = self.cmd('list', '--format="{name} tam:{tam}{NL}"', self.repository_location) assert 'archive_tam tam:verified' in output # good assert 'archive_no_tam tam:none' in output # could be borg < 1.0.9 archive or fake self.cmd('upgrade', '--archives-tam', self.repository_location) output = self.cmd('list', '--format="{name} tam:{tam}{NL}"', self.repository_location) assert 'archive_tam tam:verified' in output # still good assert 'archive_no_tam tam:verified' in output # previously TAM-less archives got a TAM now def test_check_rebuild_manifest(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.create_src_archive('archive_tam') repository = Repository(self.repository_path, exclusive=True) with repository: self.write_archive_without_tam(repository, "archive_no_tam") repository.delete(Manifest.MANIFEST_ID) # kill manifest, so check has to rebuild it repository.commit(compact=False) self.cmd('check', '--repair', self.repository_location) output = self.cmd('list', '--format="{name} tam:{tam}{NL}"', self.repository_location) assert 'archive_tam tam:verified' in output # TAM-verified archive is in rebuilt manifest assert 'archive_no_tam' not in output # check got rid of untrusted not TAM-verified archive def test_check_rebuild_refcounts(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.create_src_archive('archive_tam') archive_id_pre_check = self.cmd('list', '--format="{name} {id}{NL}"', self.repository_location) repository = Repository(self.repository_path, exclusive=True) with repository: self.write_archive_without_tam(repository, "archive_no_tam") output = self.cmd('list', '--format="{name} tam:{tam}{NL}"', self.repository_location) assert 'archive_tam tam:verified' in output # good assert 'archive_no_tam tam:none' in output # could be borg < 1.0.9 archive or fake self.cmd('check', '--repair', self.repository_location) output = self.cmd('list', '--format="{name} tam:{tam}{NL}"', self.repository_location) assert 'archive_tam tam:verified' in output # TAM-verified archive still there assert 'archive_no_tam' not in output # check got rid of untrusted not TAM-verified archive archive_id_post_check = self.cmd('list', '--format="{name} {id}{NL}"', self.repository_location) assert archive_id_post_check == archive_id_pre_check # rebuild_refcounts didn't change archive_tam archive id class RemoteArchiverTestCase(ArchiverTestCase): prefix = '__testsuite__:' def open_repository(self): return RemoteRepository(Location(self.repository_location)) def test_remote_repo_restrict_to_path(self): # restricted to repo directory itself: with patch.object(RemoteRepository, 'extra_test_args', ['--restrict-to-path', self.repository_path]): self.cmd('init', '--encryption=repokey', self.repository_location) # restricted to repo directory itself, fail for other directories with same prefix: with patch.object(RemoteRepository, 'extra_test_args', ['--restrict-to-path', self.repository_path]): with pytest.raises(PathNotAllowed): self.cmd('init', '--encryption=repokey', self.repository_location + '_0') # restricted to a completely different path: with patch.object(RemoteRepository, 'extra_test_args', ['--restrict-to-path', '/foo']): with pytest.raises(PathNotAllowed): self.cmd('init', '--encryption=repokey', self.repository_location + '_1') path_prefix = os.path.dirname(self.repository_path) # restrict to repo directory's parent directory: with patch.object(RemoteRepository, 'extra_test_args', ['--restrict-to-path', path_prefix]): self.cmd('init', '--encryption=repokey', self.repository_location + '_2') # restrict to repo directory's parent directory and another directory: with patch.object(RemoteRepository, 'extra_test_args', ['--restrict-to-path', '/foo', '--restrict-to-path', path_prefix]): self.cmd('init', '--encryption=repokey', self.repository_location + '_3') def test_remote_repo_restrict_to_repository(self): # restricted to repo directory itself: with patch.object(RemoteRepository, 'extra_test_args', ['--restrict-to-repository', self.repository_path]): self.cmd('init', '--encryption=repokey', self.repository_location) parent_path = os.path.join(self.repository_path, '..') with patch.object(RemoteRepository, 'extra_test_args', ['--restrict-to-repository', parent_path]): with pytest.raises(PathNotAllowed): self.cmd('init', '--encryption=repokey', self.repository_location) @unittest.skip('only works locally') def test_debug_put_get_delete_obj(self): pass @unittest.skip('only works locally') def test_config(self): pass @unittest.skip('only works locally') def test_migrate_lock_alive(self): pass def test_remote_repo_strip_components_doesnt_leak(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.create_regular_file('dir/file', contents=b"test file contents 1") self.create_regular_file('dir/file2', contents=b"test file contents 2") self.create_regular_file('skipped-file1', contents=b"test file contents 3") self.create_regular_file('skipped-file2', contents=b"test file contents 4") self.create_regular_file('skipped-file3', contents=b"test file contents 5") self.cmd('create', self.repository_location + '::test', 'input') marker = 'cached responses left in RemoteRepository' with changedir('output'): res = self.cmd('extract', "--debug", self.repository_location + '::test', '--strip-components', '3') assert marker not in res with self.assert_creates_file('file'): res = self.cmd('extract', "--debug", self.repository_location + '::test', '--strip-components', '2') assert marker not in res with self.assert_creates_file('dir/file'): res = self.cmd('extract', "--debug", self.repository_location + '::test', '--strip-components', '1') assert marker not in res with self.assert_creates_file('input/dir/file'): res = self.cmd('extract', "--debug", self.repository_location + '::test', '--strip-components', '0') assert marker not in res class ArchiverCorruptionTestCase(ArchiverTestCaseBase): def setUp(self): super().setUp() self.create_test_files() self.cmd('init', '--encryption=repokey', self.repository_location) self.cache_path = json.loads(self.cmd('info', self.repository_location, '--json'))['cache']['path'] def corrupt(self, file, amount=1): with open(file, 'r+b') as fd: fd.seek(-amount, io.SEEK_END) corrupted = bytes(255-c for c in fd.read(amount)) fd.seek(-amount, io.SEEK_END) fd.write(corrupted) def test_cache_chunks(self): self.corrupt(os.path.join(self.cache_path, 'chunks')) if self.FORK_DEFAULT: out = self.cmd('info', self.repository_location, exit_code=2) assert 'failed integrity check' in out else: with pytest.raises(FileIntegrityError): self.cmd('info', self.repository_location) def test_cache_files(self): self.cmd('create', self.repository_location + '::test', 'input') self.corrupt(os.path.join(self.cache_path, 'files')) out = self.cmd('create', self.repository_location + '::test1', 'input') # borg warns about the corrupt files cache, but then continues without files cache. assert 'files cache is corrupted' in out def test_chunks_archive(self): self.cmd('create', self.repository_location + '::test1', 'input') # Find ID of test1 so we can corrupt it later :) target_id = self.cmd('list', self.repository_location, '--format={id}{LF}').strip() self.cmd('create', self.repository_location + '::test2', 'input') # Force cache sync, creating archive chunks of test1 and test2 in chunks.archive.d self.cmd('delete', '--cache-only', self.repository_location) self.cmd('info', self.repository_location, '--json') chunks_archive = os.path.join(self.cache_path, 'chunks.archive.d') assert len(os.listdir(chunks_archive)) == 4 # two archives, one chunks cache and one .integrity file each self.corrupt(os.path.join(chunks_archive, target_id + '.compact')) # Trigger cache sync by changing the manifest ID in the cache config config_path = os.path.join(self.cache_path, 'config') config = ConfigParser(interpolation=None) config.read(config_path) config.set('cache', 'manifest', bin_to_hex(bytes(32))) with open(config_path, 'w') as fd: config.write(fd) # Cache sync notices corrupted archive chunks, but automatically recovers. out = self.cmd('create', '-v', self.repository_location + '::test3', 'input', exit_code=1) assert 'Reading cached archive chunk index for test1' in out assert 'Cached archive chunk index of test1 is corrupted' in out assert 'Fetching and building archive index for test1' in out def test_old_version_interfered(self): # Modify the main manifest ID without touching the manifest ID in the integrity section. # This happens if a version without integrity checking modifies the cache. config_path = os.path.join(self.cache_path, 'config') config = ConfigParser(interpolation=None) config.read(config_path) config.set('cache', 'manifest', bin_to_hex(bytes(32))) with open(config_path, 'w') as fd: config.write(fd) out = self.cmd('info', self.repository_location) assert 'Cache integrity data not available: old Borg version modified the cache.' in out class DiffArchiverTestCase(ArchiverTestCaseBase): def test_basic_functionality(self): # Setup files for the first snapshot self.create_regular_file('empty', size=0) self.create_regular_file('file_unchanged', size=128) self.create_regular_file('file_removed', size=256) self.create_regular_file('file_removed2', size=512) self.create_regular_file('file_replaced', size=1024) os.mkdir('input/dir_replaced_with_file') os.chmod('input/dir_replaced_with_file', stat.S_IFDIR | 0o755) os.mkdir('input/dir_removed') if are_symlinks_supported(): os.mkdir('input/dir_replaced_with_link') os.symlink('input/dir_replaced_with_file', 'input/link_changed') os.symlink('input/file_unchanged', 'input/link_removed') os.symlink('input/file_removed2', 'input/link_target_removed') os.symlink('input/empty', 'input/link_target_contents_changed') os.symlink('input/empty', 'input/link_replaced_by_file') if are_hardlinks_supported(): os.link('input/file_replaced', 'input/hardlink_target_replaced') os.link('input/empty', 'input/hardlink_contents_changed') os.link('input/file_removed', 'input/hardlink_removed') os.link('input/file_removed2', 'input/hardlink_target_removed') self.cmd('init', '--encryption=repokey', self.repository_location) # Create the first snapshot self.cmd('create', self.repository_location + '::test0', 'input') # Setup files for the second snapshot self.create_regular_file('file_added', size=2048) self.create_regular_file('file_empty_added', size=0) os.unlink('input/file_replaced') self.create_regular_file('file_replaced', contents=b'0' * 4096) os.unlink('input/file_removed') os.unlink('input/file_removed2') os.rmdir('input/dir_replaced_with_file') self.create_regular_file('dir_replaced_with_file', size=8192) os.chmod('input/dir_replaced_with_file', stat.S_IFREG | 0o755) os.mkdir('input/dir_added') os.rmdir('input/dir_removed') if are_symlinks_supported(): os.rmdir('input/dir_replaced_with_link') os.symlink('input/dir_added', 'input/dir_replaced_with_link') os.unlink('input/link_changed') os.symlink('input/dir_added', 'input/link_changed') os.symlink('input/dir_added', 'input/link_added') os.unlink('input/link_replaced_by_file') self.create_regular_file('link_replaced_by_file', size=16384) os.unlink('input/link_removed') if are_hardlinks_supported(): os.unlink('input/hardlink_removed') os.link('input/file_added', 'input/hardlink_added') with open('input/empty', 'ab') as fd: fd.write(b'appended_data') # Create the second snapshot self.cmd('create', self.repository_location + '::test1a', 'input') self.cmd('create', '--chunker-params', '16,18,17,4095', self.repository_location + '::test1b', 'input') def do_asserts(output, can_compare_ids, content_only=False): # File contents changed (deleted and replaced with a new file) change = 'B' if can_compare_ids else '{:<19}'.format('modified') lines = output.splitlines() assert 'file_replaced' in output # added to debug #3494 self.assert_line_exists(lines, f"{change}.*input/file_replaced") # File unchanged assert 'input/file_unchanged' not in output # Directory replaced with a regular file if "BORG_TESTS_IGNORE_MODES" not in os.environ and not is_win32 and not content_only: self.assert_line_exists(lines, "drwxr-xr-x -> -rwxr-xr-x.*input/dir_replaced_with_file") # Basic directory cases assert 'added directory input/dir_added' in output assert 'removed directory input/dir_removed' in output if are_symlinks_supported(): # Basic symlink cases self.assert_line_exists(lines, "changed link.*input/link_changed") self.assert_line_exists(lines, "added link.*input/link_added") self.assert_line_exists(lines, "removed link.*input/link_removed") # Symlink replacing or being replaced assert 'input/dir_replaced_with_link' in output assert 'input/link_replaced_by_file' in output # Symlink target removed. Should not affect the symlink at all. assert 'input/link_target_removed' not in output # The inode has two links and the file contents changed. Borg # should notice the changes in both links. However, the symlink # pointing to the file is not changed. change = '0 B' if can_compare_ids else '{:<19}'.format('modified') self.assert_line_exists(lines, f"{change}.*input/empty") if are_hardlinks_supported(): self.assert_line_exists(lines, f"{change}.*input/hardlink_contents_changed") if are_symlinks_supported(): assert 'input/link_target_contents_changed' not in output # Added a new file and a hard link to it. Both links to the same # inode should appear as separate files. assert 'added 2.05 kB input/file_added' in output if are_hardlinks_supported(): assert 'added 2.05 kB input/hardlink_added' in output # check if a diff between non-existent and empty new file is found assert 'added 0 B input/file_empty_added' in output # The inode has two links and both of them are deleted. They should # appear as two deleted files. assert 'removed 256 B input/file_removed' in output if are_hardlinks_supported(): assert 'removed 256 B input/hardlink_removed' in output if are_hardlinks_supported() and content_only: # Another link (marked previously as the source in borg) to the # same inode was removed. This should only change the ctime since removing # the link would result in the decrementation of the inode's hard-link count. assert "input/hardlink_target_removed" not in output # Another link (marked previously as the source in borg) to the # same inode was replaced with a new regular file. This should only change # its ctime. This should not be reflected in the output if content-only is set assert "input/hardlink_target_replaced" not in output def do_json_asserts(output, can_compare_ids, content_only=False): def get_changes(filename, data): chgsets = [j['changes'] for j in data if j['path'] == filename] assert len(chgsets) < 2 # return a flattened list of changes for given filename return [chg for chgset in chgsets for chg in chgset] # convert output to list of dicts joutput = [json.loads(line) for line in output.split('\n') if line] # File contents changed (deleted and replaced with a new file) expected = {'type': 'modified', 'added': 4096, 'removed': 1024} if can_compare_ids else {'type': 'modified'} assert expected in get_changes('input/file_replaced', joutput) # File unchanged assert not any(get_changes('input/file_unchanged', joutput)) # Directory replaced with a regular file if 'BORG_TESTS_IGNORE_MODES' not in os.environ and not content_only: assert {'type': 'mode', 'old_mode': 'drwxr-xr-x', 'new_mode': '-rwxr-xr-x'} in \ get_changes('input/dir_replaced_with_file', joutput) # Basic directory cases assert {'type': 'added directory'} in get_changes('input/dir_added', joutput) assert {'type': 'removed directory'} in get_changes('input/dir_removed', joutput) if are_symlinks_supported(): # Basic symlink cases assert {'type': 'changed link'} in get_changes('input/link_changed', joutput) assert {'type': 'added link'} in get_changes('input/link_added', joutput) assert {'type': 'removed link'} in get_changes('input/link_removed', joutput) # Symlink replacing or being replaced if not content_only: assert any( chg["type"] == "mode" and chg["new_mode"].startswith("l") for chg in get_changes("input/dir_replaced_with_link", joutput) ), get_changes("input/dir_replaced_with_link", joutput) assert any( chg["type"] == "mode" and chg["old_mode"].startswith("l") for chg in get_changes("input/link_replaced_by_file", joutput) ), get_changes("input/link_replaced_by_file", joutput) # Symlink target removed. Should not affect the symlink at all. assert not any(get_changes('input/link_target_removed', joutput)) # The inode has two links and the file contents changed. Borg # should notice the changes in both links. However, the symlink # pointing to the file is not changed. expected = {'type': 'modified', 'added': 13, 'removed': 0} if can_compare_ids else {'type': 'modified'} assert expected in get_changes('input/empty', joutput) if are_hardlinks_supported(): assert expected in get_changes('input/hardlink_contents_changed', joutput) if are_symlinks_supported(): assert not any(get_changes('input/link_target_contents_changed', joutput)) # Added a new file and a hard link to it. Both links to the same # inode should appear as separate files. assert {'type': 'added', 'size': 2048} in get_changes('input/file_added', joutput) if are_hardlinks_supported(): assert {'type': 'added', 'size': 2048} in get_changes('input/hardlink_added', joutput) # check if a diff between non-existent and empty new file is found assert {'type': 'added', 'size': 0} in get_changes('input/file_empty_added', joutput) # The inode has two links and both of them are deleted. They should # appear as two deleted files. assert {'type': 'removed', 'size': 256} in get_changes('input/file_removed', joutput) if are_hardlinks_supported(): assert {'type': 'removed', 'size': 256} in get_changes('input/hardlink_removed', joutput) if are_hardlinks_supported() and content_only: # Another link (marked previously as the source in borg) to the # same inode was removed. This should only change the ctime since removing # the link would result in the decrementation of the inode's hard-link count. assert not any(get_changes("input/hardlink_target_removed", joutput)) # Another link (marked previously as the source in borg) to the # same inode was replaced with a new regular file. This should only change # its ctime. This should not be reflected in the output if content-only is set assert not any(get_changes("input/hardlink_target_replaced", joutput)) output = self.cmd("diff", self.repository_location + "::test0", "test1a") do_asserts(output, True) output = self.cmd("diff", self.repository_location + "::test0", "test1b", "--content-only") do_asserts(output, False, content_only=True) output = self.cmd("diff", self.repository_location + "::test0", "test1a", "--json-lines") do_json_asserts(output, True) output = self.cmd("diff", self.repository_location + "::test0", "test1a", "--json-lines", "--content-only") do_json_asserts(output, True, content_only=True) def test_sort_option(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.create_regular_file('a_file_removed', size=8) self.create_regular_file('f_file_removed', size=16) self.create_regular_file('c_file_changed', size=32) self.create_regular_file('e_file_changed', size=64) self.cmd('create', self.repository_location + '::test0', 'input') os.unlink('input/a_file_removed') os.unlink('input/f_file_removed') os.unlink('input/c_file_changed') os.unlink('input/e_file_changed') self.create_regular_file('c_file_changed', size=512) self.create_regular_file('e_file_changed', size=1024) self.create_regular_file('b_file_added', size=128) self.create_regular_file('d_file_added', size=256) self.cmd('create', self.repository_location + '::test1', 'input') output = self.cmd('diff', '--sort', self.repository_location + '::test0', 'test1', '--content-only') expected = [ 'a_file_removed', 'b_file_added', 'c_file_changed', 'd_file_added', 'e_file_changed', 'f_file_removed', ] assert all(x in line for x, line in zip(expected, output.splitlines())) def test_time_diffs(self): self.cmd('init', '--encryption=repokey', self.repository_location) self.create_regular_file("test_file", size=10) self.cmd('create', self.repository_location + '::archive1', 'input') time.sleep(0.1) os.unlink("input/test_file") if is_win32: # Sleeping for 15s because Windows doesn't refresh ctime if file is deleted and recreated within 15 seconds. time.sleep(15) elif is_darwin: time.sleep(1) # HFS has a 1s timestamp granularity self.create_regular_file("test_file", size=15) self.cmd('create', self.repository_location + '::archive2', 'input') output = self.cmd("diff", self.repository_location + "::archive1", "archive2") self.assert_in("mtime", output) self.assert_in("ctime", output) # Should show up on windows as well since it is a new file. if is_darwin: time.sleep(1) # HFS has a 1s timestamp granularity os.chmod("input/test_file", 0o777) self.cmd('create', self.repository_location + '::archive3', 'input') output = self.cmd("diff", self.repository_location + "::archive2", "archive3") self.assert_not_in("mtime", output) # Checking platform because ctime should not be shown on windows since it wasn't recreated. if not is_win32: self.assert_in("ctime", output) else: self.assert_not_in("ctime", output) def test_get_args(): archiver = Archiver() # everything normal: # first param is argv as produced by ssh forced command, # second param is like from SSH_ORIGINAL_COMMAND env variable args = archiver.get_args(['borg', 'serve', '--umask=0027', '--restrict-to-path=/p1', '--restrict-to-path=/p2', ], 'borg serve --info') assert args.func == archiver.do_serve assert args.restrict_to_paths == ['/p1', '/p2'] assert args.umask == 0o027 assert args.log_level == 'info' # similar, but with --restrict-to-repository args = archiver.get_args(['borg', 'serve', '--restrict-to-repository=/r1', '--restrict-to-repository=/r2', ], 'borg serve --info --umask=0027') assert args.restrict_to_repositories == ['/r1', '/r2'] # trying to cheat - break out of path restriction args = archiver.get_args(['borg', 'serve', '--restrict-to-path=/p1', '--restrict-to-path=/p2', ], 'borg serve --restrict-to-path=/') assert args.restrict_to_paths == ['/p1', '/p2'] # trying to cheat - break out of repository restriction args = archiver.get_args(['borg', 'serve', '--restrict-to-repository=/r1', '--restrict-to-repository=/r2', ], 'borg serve --restrict-to-repository=/') assert args.restrict_to_repositories == ['/r1', '/r2'] # trying to cheat - break below repository restriction args = archiver.get_args(['borg', 'serve', '--restrict-to-repository=/r1', '--restrict-to-repository=/r2', ], 'borg serve --restrict-to-repository=/r1/below') assert args.restrict_to_repositories == ['/r1', '/r2'] # trying to cheat - try to execute different subcommand args = archiver.get_args(['borg', 'serve', '--restrict-to-path=/p1', '--restrict-to-path=/p2', ], 'borg init --encryption=repokey /') assert args.func == archiver.do_serve # Check that environment variables in the forced command don't cause issues. If the command # were not forced, environment variables would be interpreted by the shell, but this does not # happen for forced commands - we get the verbatim command line and need to deal with env vars. args = archiver.get_args(['borg', 'serve', ], 'BORG_FOO=bar borg serve --info') assert args.func == archiver.do_serve def test_chunk_content_equal(): def ccc(a, b): chunks_a = [data for data in a] chunks_b = [data for data in b] compare1 = chunks_contents_equal(iter(chunks_a), iter(chunks_b)) compare2 = chunks_contents_equal(iter(chunks_b), iter(chunks_a)) assert compare1 == compare2 return compare1 assert ccc([ b'1234', b'567A', b'bC' ], [ b'1', b'23', b'4567A', b'b', b'C' ]) # one iterator exhausted before the other assert not ccc([ b'12345', ], [ b'1234', b'56' ]) # content mismatch assert not ccc([ b'1234', b'65' ], [ b'1234', b'56' ]) # first is the prefix of second assert not ccc([ b'1234', b'56' ], [ b'1234', b'565' ]) class TestBuildFilter: @staticmethod def peek_and_store_hardlink_masters(item, matched): pass def test_basic(self): matcher = PatternMatcher() matcher.add([parse_pattern('included')], IECommand.Include) filter = Archiver.build_filter(matcher, self.peek_and_store_hardlink_masters, 0) assert filter(Item(path='included')) assert filter(Item(path='included/file')) assert not filter(Item(path='something else')) def test_empty(self): matcher = PatternMatcher(fallback=True) filter = Archiver.build_filter(matcher, self.peek_and_store_hardlink_masters, 0) assert filter(Item(path='anything')) def test_strip_components(self): matcher = PatternMatcher(fallback=True) filter = Archiver.build_filter(matcher, self.peek_and_store_hardlink_masters, strip_components=1) assert not filter(Item(path='shallow')) assert not filter(Item(path='shallow/')) # can this even happen? paths are normalized... assert filter(Item(path='deep enough/file')) assert filter(Item(path='something/dir/file')) class TestCommonOptions: @staticmethod def define_common_options(add_common_option): add_common_option('-h', '--help', action='help', help='show this help message and exit') add_common_option('--critical', dest='log_level', help='foo', action='store_const', const='critical', default='warning') add_common_option('--error', dest='log_level', help='foo', action='store_const', const='error', default='warning') add_common_option('--append', dest='append', help='foo', action='append', metavar='TOPIC', default=[]) add_common_option('-p', '--progress', dest='progress', action='store_true', help='foo') add_common_option('--lock-wait', dest='lock_wait', type=int, metavar='N', default=1, help='(default: %(default)d).') @pytest.fixture def basic_parser(self): parser = argparse.ArgumentParser(prog='test', description='test parser', add_help=False) parser.common_options = Archiver.CommonOptions(self.define_common_options, suffix_precedence=('_level0', '_level1')) return parser @pytest.fixture def subparsers(self, basic_parser): return basic_parser.add_subparsers(title='required arguments', metavar='') @pytest.fixture def parser(self, basic_parser): basic_parser.common_options.add_common_group(basic_parser, '_level0', provide_defaults=True) return basic_parser @pytest.fixture def common_parser(self, parser): common_parser = argparse.ArgumentParser(add_help=False, prog='test') parser.common_options.add_common_group(common_parser, '_level1') return common_parser @pytest.fixture def parse_vars_from_line(self, parser, subparsers, common_parser): subparser = subparsers.add_parser('subcommand', parents=[common_parser], add_help=False, description='foo', epilog='bar', help='baz', formatter_class=argparse.RawDescriptionHelpFormatter) subparser.set_defaults(func=1234) subparser.add_argument('--append-only', dest='append_only', action='store_true') def parse_vars_from_line(*line): print(line) args = parser.parse_args(line) parser.common_options.resolve(args) return vars(args) return parse_vars_from_line def test_simple(self, parse_vars_from_line): assert parse_vars_from_line('--error') == { 'append': [], 'lock_wait': 1, 'log_level': 'error', 'progress': False } assert parse_vars_from_line('--error', 'subcommand', '--critical') == { 'append': [], 'lock_wait': 1, 'log_level': 'critical', 'progress': False, 'append_only': False, 'func': 1234, } with pytest.raises(SystemExit): parse_vars_from_line('--append-only', 'subcommand') assert parse_vars_from_line('--append=foo', '--append', 'bar', 'subcommand', '--append', 'baz') == { 'append': ['foo', 'bar', 'baz'], 'lock_wait': 1, 'log_level': 'warning', 'progress': False, 'append_only': False, 'func': 1234, } @pytest.mark.parametrize('position', ('before', 'after', 'both')) @pytest.mark.parametrize('flag,args_key,args_value', ( ('-p', 'progress', True), ('--lock-wait=3', 'lock_wait', 3), )) def test_flag_position_independence(self, parse_vars_from_line, position, flag, args_key, args_value): line = [] if position in ('before', 'both'): line.append(flag) line.append('subcommand') if position in ('after', 'both'): line.append(flag) result = { 'append': [], 'lock_wait': 1, 'log_level': 'warning', 'progress': False, 'append_only': False, 'func': 1234, } result[args_key] = args_value assert parse_vars_from_line(*line) == result def test_parse_storage_quota(): assert parse_storage_quota('50M') == 50 * 1000**2 with pytest.raises(argparse.ArgumentTypeError): parse_storage_quota('5M') def get_all_parsers(): """ Return dict mapping command to parser. """ parser = Archiver(prog='borg').build_parser() borgfs_parser = Archiver(prog='borgfs').build_parser() parsers = {} def discover_level(prefix, parser, Archiver, extra_choices=None): choices = {} for action in parser._actions: if action.choices is not None and 'SubParsersAction' in str(action.__class__): for cmd, parser in action.choices.items(): choices[prefix + cmd] = parser if extra_choices is not None: choices.update(extra_choices) if prefix and not choices: return for command, parser in sorted(choices.items()): discover_level(command + " ", parser, Archiver) parsers[command] = parser discover_level("", parser, Archiver, {'borgfs': borgfs_parser}) return parsers @pytest.mark.parametrize('command, parser', list(get_all_parsers().items())) def test_help_formatting(command, parser): if isinstance(parser.epilog, RstToTextLazy): assert parser.epilog.rst @pytest.mark.parametrize('topic', list(Archiver.helptext.keys())) def test_help_formatting_helptexts(topic): helptext = Archiver.helptext[topic] assert str(rst_to_terminal(helptext)) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/testsuite/attic.tar.gz0000644000076500000240000000540614641074756020237 0ustar00twstaff 6Y S"hNŒ}D]0ɾd_dFeddsReDgġҊն"EVS0c:VhSA;JN~+q3dW9&9Kfν7nGyBQ$+w^yITdQ=T*EajaαF_2 I K`s,8\\i$p}H0ZVRTͣ^I5]e^L #ɊGUT]xکԙj^/9S}L[,*kZu6uzsSkTIu]ᆖgtE1FQj(=NJjQ]܉6_G* \յѺlk1^ipSOkYz:4 FTSBN&@,)!Eq7:ޖ^_IƋ͍q}:mJ;9kP* 5EТhN%5av;׹xuQ E=5Qw?_HiBfdMuT,v@F.j 9_mE@n,B:#\4TWq;¹-^j"Z&!TI>fuTBmmtǚ@` T6/BC7/{k<~xJ ?&'Ne\3Ui@,:2+  F:uUxwYhd@^$f9{l7EzCG8@ݻHEuFu_%/ P7MuC8@;H_n 7}pä/ Pn$n. fP fuҗOKC9C9C9C9C9C9C9C9CO3.Gc\`psH_ ү7-$}x|-7hq q!"}s|ۦ: >ȷ\ o's[Eȷ/ 9C9C9C9C9C9C9C9C9;8q^B7%\H HH \r}=@;}\7-7\o?@s4{m'|'|?C9C9C9C9C9C9C10spl58+d#ϼ"3 EDERu<ŕmN~ .cH*m?-f:"H°s QIA2;}+K*&}gl#_E,T˵ގGN_$ Tդ*y7zߴ$`xDo/ ׍nͥ%tDU$;|$`byD0tﺒqMߞ}$`42$P}/ x|ǰ8@ mAfKөa-xf0n4a-? Vۂo,]w VۂIRj[3|Vۂ/\Td#tTt/[QP=ۨ;ͦ?E@yd-ӏJ/=F@ON@ۯEtz;ͺ-AzXY؂ ]t@wN8Jt7>%mާÛu-XW@_XuTtzsӏ5y/z~g<?a G|*>~*:=h7c3/Ѕtu7ӇNK@kU:Hi֥m}ΝgeHtzۍw-ni*|˴ۂoÛu^-h='~ Ngy7EUު˩5;X.*:}ͷQyػ"*:S[?dӡ/Wh?;zU*@:4w+: O:stx+@8|[%oֹ`S*^]O@W_x:p9 N??Tt8sN^ܗޠ;TtYy *:}_ ՏҝέaNna *?V9`^Y tu;[Ãtx/vE@_㛏Qk_sdſ5././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/testsuite/benchmark.py0000644000076500000240000000557014641074756020312 0ustar00twstaff""" Do benchmarks using pytest-benchmark. Usage: py.test --benchmark-only """ import os import pytest from .archiver import changedir, cmd from ..constants import zeros @pytest.fixture def repo_url(request, tmpdir, monkeypatch): monkeypatch.setenv('BORG_PASSPHRASE', '123456') monkeypatch.setenv('BORG_CHECK_I_KNOW_WHAT_I_AM_DOING', 'YES') monkeypatch.setenv('BORG_DELETE_I_KNOW_WHAT_I_AM_DOING', 'YES') monkeypatch.setenv('BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK', 'yes') monkeypatch.setenv('BORG_KEYS_DIR', str(tmpdir.join('keys'))) monkeypatch.setenv('BORG_CACHE_DIR', str(tmpdir.join('cache'))) yield str(tmpdir.join('repository')) tmpdir.remove(rec=1) @pytest.fixture(params=["none", "repokey"]) def repo(request, cmd, repo_url): cmd('init', '--encryption', request.param, repo_url) return repo_url @pytest.fixture(scope='session', params=["zeros", "random"]) def testdata(request, tmpdir_factory): count, size = 10, 1000*1000 assert size <= len(zeros) p = tmpdir_factory.mktemp('data') data_type = request.param if data_type == 'zeros': # do not use a binary zero (\0) to avoid sparse detection def data(size): return memoryview(zeros)[:size] elif data_type == 'random': def data(size): return os.urandom(size) else: raise ValueError("data_type must be 'random' or 'zeros'.") for i in range(count): with open(str(p.join(str(i))), "wb") as f: f.write(data(size)) yield str(p) p.remove(rec=1) @pytest.fixture(params=['none', 'lz4']) def archive(request, cmd, repo, testdata): archive_url = repo + '::test' cmd('create', '--compression', request.param, archive_url, testdata) return archive_url def test_create_none(benchmark, cmd, repo, testdata): result, out = benchmark.pedantic(cmd, ('create', '--compression', 'none', repo + '::test', testdata)) assert result == 0 def test_create_lz4(benchmark, cmd, repo, testdata): result, out = benchmark.pedantic(cmd, ('create', '--compression', 'lz4', repo + '::test', testdata)) assert result == 0 def test_extract(benchmark, cmd, archive, tmpdir): with changedir(str(tmpdir)): result, out = benchmark.pedantic(cmd, ('extract', archive)) assert result == 0 def test_delete(benchmark, cmd, archive): result, out = benchmark.pedantic(cmd, ('delete', archive)) assert result == 0 def test_list(benchmark, cmd, archive): result, out = benchmark(cmd, 'list', archive) assert result == 0 def test_info(benchmark, cmd, archive): result, out = benchmark(cmd, 'info', archive) assert result == 0 def test_check(benchmark, cmd, archive): repo = archive.split('::')[0] result, out = benchmark(cmd, 'check', repo) assert result == 0 def test_help(benchmark, cmd): result, out = benchmark(cmd, 'help') assert result == 0 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/testsuite/cache.py0000644000076500000240000002205614641074756017421 0ustar00twstaffimport io import os.path from ..helpers.msgpack import packb import pytest from .hashindex import H from .key import TestKey from ..archive import Statistics from ..cache import AdHocCache from ..compress import CompressionSpec from ..crypto.key import RepoKey from ..hashindex import ChunkIndex, CacheSynchronizer from ..helpers import Manifest from ..repository import Repository class TestCacheSynchronizer: @pytest.fixture def index(self): return ChunkIndex() @pytest.fixture def sync(self, index): return CacheSynchronizer(index) def test_no_chunks(self, index, sync): data = packb({ 'foo': 'bar', 'baz': 1234, 'bar': 5678, 'user': 'chunks', 'chunks': [] }) sync.feed(data) assert not len(index) def test_simple(self, index, sync): data = packb({ 'foo': 'bar', 'baz': 1234, 'bar': 5678, 'user': 'chunks', 'chunks': [ (H(1), 1, 2), (H(2), 2, 3), ] }) sync.feed(data) assert len(index) == 2 assert index[H(1)] == (1, 1, 2) assert index[H(2)] == (1, 2, 3) def test_multiple(self, index, sync): data = packb({ 'foo': 'bar', 'baz': 1234, 'bar': 5678, 'user': 'chunks', 'chunks': [ (H(1), 1, 2), (H(2), 2, 3), ] }) data += packb({ 'xattrs': { 'security.foo': 'bar', 'chunks': '123456', }, 'stuff': [ (1, 2, 3), ] }) data += packb({ 'xattrs': { 'security.foo': 'bar', 'chunks': '123456', }, 'chunks': [ (H(1), 1, 2), (H(2), 2, 3), ], 'stuff': [ (1, 2, 3), ] }) data += packb({ 'chunks': [ (H(3), 1, 2), ], }) data += packb({ 'chunks': [ (H(1), 1, 2), ], }) part1 = data[:70] part2 = data[70:120] part3 = data[120:] sync.feed(part1) sync.feed(part2) sync.feed(part3) assert len(index) == 3 assert index[H(1)] == (3, 1, 2) assert index[H(2)] == (2, 2, 3) assert index[H(3)] == (1, 1, 2) @pytest.mark.parametrize('elem,error', ( ({1: 2}, 'Unexpected object: map'), (bytes(213), [ 'Unexpected bytes in chunks structure', # structure 2/3 'Incorrect key length']), # structure 3/3 (1, 'Unexpected object: integer'), (1.0, 'Unexpected object: double'), (True, 'Unexpected object: true'), (False, 'Unexpected object: false'), (None, 'Unexpected object: nil'), ), ids=["map", "bytes", "int", "double", "true", "false", "none"]) @pytest.mark.parametrize('structure', ( lambda elem: {'chunks': elem}, lambda elem: {'chunks': [elem]}, lambda elem: {'chunks': [(elem, 1, 2)]}, )) def test_corrupted(self, sync, structure, elem, error): packed = packb(structure(elem)) with pytest.raises(ValueError) as excinfo: sync.feed(packed) if isinstance(error, str): error = [error] possible_errors = ['cache_sync_feed failed: ' + error for error in error] assert str(excinfo.value) in possible_errors @pytest.mark.parametrize('data,error', ( # Incorrect tuple length ({'chunks': [(bytes(32), 2, 3, 4)]}, 'Invalid chunk list entry length'), ({'chunks': [(bytes(32), 2)]}, 'Invalid chunk list entry length'), # Incorrect types ({'chunks': [(1, 2, 3)]}, 'Unexpected object: integer'), ({'chunks': [(1, bytes(32), 2)]}, 'Unexpected object: integer'), ({'chunks': [(bytes(32), 1.0, 2)]}, 'Unexpected object: double'), )) def test_corrupted_ancillary(self, index, sync, data, error): packed = packb(data) with pytest.raises(ValueError) as excinfo: sync.feed(packed) assert str(excinfo.value) == 'cache_sync_feed failed: ' + error def make_index_with_refcount(self, refcount): index_data = io.BytesIO() index_data.write(b'BORG_IDX') # num_entries index_data.write((1).to_bytes(4, 'little')) # num_buckets index_data.write((1).to_bytes(4, 'little')) # key_size index_data.write((32).to_bytes(1, 'little')) # value_size index_data.write((3 * 4).to_bytes(1, 'little')) index_data.write(H(0)) index_data.write(refcount.to_bytes(4, 'little')) index_data.write((1234).to_bytes(4, 'little')) index_data.write((5678).to_bytes(4, 'little')) index_data.seek(0) index = ChunkIndex.read(index_data) return index def test_corrupted_refcount(self): index = self.make_index_with_refcount(ChunkIndex.MAX_VALUE + 1) sync = CacheSynchronizer(index) data = packb({ 'chunks': [ (H(0), 1, 2), ] }) with pytest.raises(ValueError) as excinfo: sync.feed(data) assert str(excinfo.value) == 'cache_sync_feed failed: invalid reference count' def test_refcount_max_value(self): index = self.make_index_with_refcount(ChunkIndex.MAX_VALUE) sync = CacheSynchronizer(index) data = packb({ 'chunks': [ (H(0), 1, 2), ] }) sync.feed(data) assert index[H(0)] == (ChunkIndex.MAX_VALUE, 1234, 5678) def test_refcount_one_below_max_value(self): index = self.make_index_with_refcount(ChunkIndex.MAX_VALUE - 1) sync = CacheSynchronizer(index) data = packb({ 'chunks': [ (H(0), 1, 2), ] }) sync.feed(data) # Incremented to maximum assert index[H(0)] == (ChunkIndex.MAX_VALUE, 1234, 5678) sync.feed(data) assert index[H(0)] == (ChunkIndex.MAX_VALUE, 1234, 5678) class TestAdHocCache: @pytest.fixture def repository(self, tmpdir): self.repository_location = os.path.join(str(tmpdir), 'repository') with Repository(self.repository_location, exclusive=True, create=True) as repository: repository.put(H(1), b'1234') repository.put(Manifest.MANIFEST_ID, b'5678') yield repository @pytest.fixture def key(self, repository, monkeypatch): monkeypatch.setenv('BORG_PASSPHRASE', 'test') key = RepoKey.create(repository, TestKey.MockArgs()) key.compressor = CompressionSpec('none').compressor return key @pytest.fixture def manifest(self, repository, key): Manifest(key, repository).write() return Manifest.load(repository, key=key, operations=Manifest.NO_OPERATION_CHECK)[0] @pytest.fixture def cache(self, repository, key, manifest): return AdHocCache(repository, key, manifest) def test_does_not_contain_manifest(self, cache): assert not cache.seen_chunk(Manifest.MANIFEST_ID) def test_does_not_delete_existing_chunks(self, repository, cache): assert cache.seen_chunk(H(1)) == ChunkIndex.MAX_VALUE cache.chunk_decref(H(1), Statistics()) assert repository.get(H(1)) == b'1234' def test_does_not_overwrite(self, cache): with pytest.raises(AssertionError): cache.add_chunk(H(1), b'5678', Statistics(), overwrite=True) def test_seen_chunk_add_chunk_size(self, cache): assert cache.add_chunk(H(1), b'5678', Statistics()) == (H(1), 4, 0) def test_deletes_chunks_during_lifetime(self, cache, repository): """E.g. checkpoint archives""" cache.add_chunk(H(5), b'1010', Statistics()) assert cache.seen_chunk(H(5)) == 1 cache.chunk_decref(H(5), Statistics()) assert not cache.seen_chunk(H(5)) with pytest.raises(Repository.ObjectNotFound): repository.get(H(5)) def test_files_cache(self, cache): assert cache.file_known_and_unchanged(b'foo', bytes(32), None) == (False, None) assert cache.cache_mode == 'd' assert cache.files is None def test_txn(self, cache): assert not cache._txn_active cache.seen_chunk(H(5)) assert cache._txn_active assert cache.chunks cache.rollback() assert not cache._txn_active assert not hasattr(cache, 'chunks') def test_incref_after_add_chunk(self, cache): assert cache.add_chunk(H(3), b'5678', Statistics()) == (H(3), 4, 47) assert cache.chunk_incref(H(3), Statistics()) == (H(3), 4, 47) def test_existing_incref_after_add_chunk(self, cache): """This case occurs with part files, see Archive.chunk_file.""" assert cache.add_chunk(H(1), b'5678', Statistics()) == (H(1), 4, 0) assert cache.chunk_incref(H(1), Statistics()) == (H(1), 4, 0) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/testsuite/checksums.py0000644000076500000240000000324314641074756020340 0ustar00twstaffimport os import zlib import pytest from ..algorithms import checksums from ..helpers import bin_to_hex, hex_to_bin crc32_implementations = [checksums.crc32_slice_by_8] if checksums.have_clmul: crc32_implementations.append(checksums.crc32_clmul) @pytest.mark.parametrize('implementation', crc32_implementations) def test_crc32(implementation): # This includes many critical values, like misc. length and misc. aligned start addresses. data = os.urandom(300) mv = memoryview(data) initial_crc = 0x12345678 for start in range(0, 4): # 4B / int32 alignment, head processing for length in [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 127, 128, 129, 130, 131, 132, 133, 134, 135, 255, 256, 257, ]: d = mv[start:start+length] assert zlib.crc32(d, initial_crc) == implementation(d, initial_crc) def test_xxh64(): assert bin_to_hex(checksums.xxh64(b'test', 123)) == '2b81b9401bef86cf' assert bin_to_hex(checksums.xxh64(b'test')) == '4fdcca5ddb678139' assert bin_to_hex(checksums.xxh64(hex_to_bin( '6f663f01c118abdea553373d5eae44e7dac3b6829b46b9bbeff202b6c592c22d724' 'fb3d25a347cca6c5b8f20d567e4bb04b9cfa85d17f691590f9a9d32e8ccc9102e9d' 'cf8a7e6716280cd642ce48d03fdf114c9f57c20d9472bb0f81c147645e6fa3d331'))) == '35d5d2f545d9511a' def test_streaming_xxh64(): hasher = checksums.StreamingXXH64(123) hasher.update(b'te') hasher.update(b'st') assert bin_to_hex(hasher.digest()) == hasher.hexdigest() == '2b81b9401bef86cf' ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/testsuite/chunker.py0000644000076500000240000001412414641074756020012 0ustar00twstaff# Note: these tests are part of the self test, do not use or import pytest functionality here. # See borg.selftest for details. If you add/remove test methods, update SELFTEST_COUNT from io import BytesIO from ..chunker import ChunkerFixed, Chunker, get_chunker, buzhash, buzhash_update from ..constants import * # NOQA from . import BaseTestCase def cf(chunks): """chunk filter""" # this is to simplify testing: either return the data piece (bytes) or the hole length (int). def _cf(chunk): if chunk.meta['allocation'] == CH_DATA: assert len(chunk.data) == chunk.meta['size'] return bytes(chunk.data) # make sure we have bytes, not memoryview if chunk.meta['allocation'] in (CH_HOLE, CH_ALLOC): assert chunk.data is None return chunk.meta['size'] assert False, "unexpected allocation value" return [_cf(chunk) for chunk in chunks] class ChunkerFixedTestCase(BaseTestCase): def test_chunkify_just_blocks(self): data = b'foobar' * 1500 chunker = ChunkerFixed(4096) parts = cf(chunker.chunkify(BytesIO(data))) self.assert_equal(parts, [data[0:4096], data[4096:8192], data[8192:]]) def test_chunkify_header_and_blocks(self): data = b'foobar' * 1500 chunker = ChunkerFixed(4096, 123) parts = cf(chunker.chunkify(BytesIO(data))) self.assert_equal(parts, [data[0:123], data[123:123+4096], data[123+4096:123+8192], data[123+8192:]]) def test_chunkify_just_blocks_fmap_complete(self): data = b'foobar' * 1500 chunker = ChunkerFixed(4096) fmap = [ (0, 4096, True), (4096, 8192, True), (8192, 99999999, True), ] parts = cf(chunker.chunkify(BytesIO(data), fmap=fmap)) self.assert_equal(parts, [data[0:4096], data[4096:8192], data[8192:]]) def test_chunkify_header_and_blocks_fmap_complete(self): data = b'foobar' * 1500 chunker = ChunkerFixed(4096, 123) fmap = [ (0, 123, True), (123, 4096, True), (123+4096, 4096, True), (123+8192, 4096, True), ] parts = cf(chunker.chunkify(BytesIO(data), fmap=fmap)) self.assert_equal(parts, [data[0:123], data[123:123+4096], data[123+4096:123+8192], data[123+8192:]]) def test_chunkify_header_and_blocks_fmap_zeros(self): data = b'H' * 123 + b'_' * 4096 + b'X' * 4096 + b'_' * 4096 chunker = ChunkerFixed(4096, 123) fmap = [ (0, 123, True), (123, 4096, False), (123+4096, 4096, True), (123+8192, 4096, False), ] parts = cf(chunker.chunkify(BytesIO(data), fmap=fmap)) # because we marked the '_' ranges as holes, we will get hole ranges instead! self.assert_equal(parts, [data[0:123], 4096, data[123+4096:123+8192], 4096]) def test_chunkify_header_and_blocks_fmap_partial(self): data = b'H' * 123 + b'_' * 4096 + b'X' * 4096 + b'_' * 4096 chunker = ChunkerFixed(4096, 123) fmap = [ (0, 123, True), # (123, 4096, False), (123+4096, 4096, True), # (123+8192, 4096, False), ] parts = cf(chunker.chunkify(BytesIO(data), fmap=fmap)) # because we left out the '_' ranges from the fmap, we will not get them at all! self.assert_equal(parts, [data[0:123], data[123+4096:123+8192]]) class ChunkerTestCase(BaseTestCase): def test_chunkify(self): data = b'0' * int(1.5 * (1 << CHUNK_MAX_EXP)) + b'Y' parts = cf(Chunker(0, 1, CHUNK_MAX_EXP, 2, 2).chunkify(BytesIO(data))) self.assert_equal(len(parts), 2) self.assert_equal(b''.join(parts), data) self.assert_equal(cf(Chunker(0, 1, CHUNK_MAX_EXP, 2, 2).chunkify(BytesIO(b''))), []) self.assert_equal(cf(Chunker(0, 1, CHUNK_MAX_EXP, 2, 2).chunkify(BytesIO(b'foobarboobaz' * 3))), [b'fooba', b'rboobaz', b'fooba', b'rboobaz', b'fooba', b'rboobaz']) self.assert_equal(cf(Chunker(1, 1, CHUNK_MAX_EXP, 2, 2).chunkify(BytesIO(b'foobarboobaz' * 3))), [b'fo', b'obarb', b'oob', b'azf', b'oobarb', b'oob', b'azf', b'oobarb', b'oobaz']) self.assert_equal(cf(Chunker(2, 1, CHUNK_MAX_EXP, 2, 2).chunkify(BytesIO(b'foobarboobaz' * 3))), [b'foob', b'ar', b'boobazfoob', b'ar', b'boobazfoob', b'ar', b'boobaz']) self.assert_equal(cf(Chunker(0, 2, CHUNK_MAX_EXP, 2, 3).chunkify(BytesIO(b'foobarboobaz' * 3))), [b'foobarboobaz' * 3]) self.assert_equal(cf(Chunker(1, 2, CHUNK_MAX_EXP, 2, 3).chunkify(BytesIO(b'foobarboobaz' * 3))), [b'foobar', b'boobazfo', b'obar', b'boobazfo', b'obar', b'boobaz']) self.assert_equal(cf(Chunker(2, 2, CHUNK_MAX_EXP, 2, 3).chunkify(BytesIO(b'foobarboobaz' * 3))), [b'foob', b'arboobaz', b'foob', b'arboobaz', b'foob', b'arboobaz']) self.assert_equal(cf(Chunker(0, 3, CHUNK_MAX_EXP, 2, 3).chunkify(BytesIO(b'foobarboobaz' * 3))), [b'foobarboobaz' * 3]) self.assert_equal(cf(Chunker(1, 3, CHUNK_MAX_EXP, 2, 3).chunkify(BytesIO(b'foobarboobaz' * 3))), [b'foobarbo', b'obazfoobar', b'boobazfo', b'obarboobaz']) self.assert_equal(cf(Chunker(2, 3, CHUNK_MAX_EXP, 2, 3).chunkify(BytesIO(b'foobarboobaz' * 3))), [b'foobarboobaz', b'foobarboobaz', b'foobarboobaz']) def test_buzhash(self): self.assert_equal(buzhash(b'abcdefghijklmnop', 0), 3795437769) self.assert_equal(buzhash(b'abcdefghijklmnop', 1), 3795400502) self.assert_equal(buzhash(b'abcdefghijklmnop', 1), buzhash_update(buzhash(b'Xabcdefghijklmno', 1), ord('X'), ord('p'), 16, 1)) # Test with more than 31 bytes to make sure our barrel_shift macro works correctly self.assert_equal(buzhash(b'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz', 0), 566521248) def test_small_reads(self): class SmallReadFile: input = b'a' * (20 + 1) def read(self, nbytes): self.input = self.input[:-1] return self.input[:1] chunker = get_chunker(*CHUNKER_PARAMS, seed=0) reconstructed = b''.join(cf(chunker.chunkify(SmallReadFile()))) assert reconstructed == b'a' * 20 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/testsuite/chunker_pytest.py0000644000076500000240000001245214641074756021424 0ustar00twstafffrom io import BytesIO import os import tempfile import pytest from .chunker import cf from ..chunker import Chunker, ChunkerFixed, sparsemap, has_seek_hole from ..constants import * # NOQA BS = 4096 # fs block size # some sparse files. X = content blocks, _ = sparse blocks. # X__XXX____ map_sparse1 = [ (0 * BS, 1 * BS, True), (1 * BS, 2 * BS, False), (3 * BS, 3 * BS, True), (6 * BS, 4 * BS, False), ] # _XX___XXXX map_sparse2 = [ (0 * BS, 1 * BS, False), (1 * BS, 2 * BS, True), (3 * BS, 3 * BS, False), (6 * BS, 4 * BS, True), ] # XXX map_notsparse = [(0 * BS, 3 * BS, True), ] # ___ map_onlysparse = [(0 * BS, 3 * BS, False), ] def make_sparsefile(fname, sparsemap, header_size=0): with open(fname, 'wb') as fd: total = 0 if header_size: fd.write(b'H' * header_size) total += header_size for offset, size, is_data in sparsemap: if is_data: fd.write(b'X' * size) else: fd.seek(size, os.SEEK_CUR) total += size fd.truncate(total) assert os.path.getsize(fname) == total def make_content(sparsemap, header_size=0): result = [] total = 0 if header_size: result.append(b'H' * header_size) total += header_size for offset, size, is_data in sparsemap: if is_data: result.append(b'X' * size) # bytes! else: result.append(size) # int! total += size return result def fs_supports_sparse(): if not has_seek_hole: return False with tempfile.TemporaryDirectory() as tmpdir: fn = os.path.join(tmpdir, 'test_sparse') make_sparsefile(fn, [(0, BS, False), (BS, BS, True)]) with open(fn, 'rb') as f: try: offset_hole = f.seek(0, os.SEEK_HOLE) offset_data = f.seek(0, os.SEEK_DATA) except OSError: # no sparse support if these seeks do not work return False return offset_hole == 0 and offset_data == BS @pytest.mark.skipif(not fs_supports_sparse(), reason='fs does not support sparse files') @pytest.mark.parametrize("fname, sparse_map", [ ('sparse1', map_sparse1), ('sparse2', map_sparse2), ('onlysparse', map_onlysparse), ('notsparse', map_notsparse), ]) def test_sparsemap(tmpdir, fname, sparse_map): def get_sparsemap_fh(fname): fh = os.open(fname, flags=os.O_RDONLY) try: return list(sparsemap(fh=fh)) finally: os.close(fh) def get_sparsemap_fd(fname): with open(fname, 'rb') as fd: return list(sparsemap(fd=fd)) fn = str(tmpdir / fname) make_sparsefile(fn, sparse_map) assert get_sparsemap_fh(fn) == sparse_map assert get_sparsemap_fd(fn) == sparse_map @pytest.mark.skipif(not fs_supports_sparse(), reason='fs does not support sparse files') @pytest.mark.parametrize("fname, sparse_map, header_size, sparse", [ ('sparse1', map_sparse1, 0, False), ('sparse1', map_sparse1, 0, True), ('sparse1', map_sparse1, BS, False), ('sparse1', map_sparse1, BS, True), ('sparse2', map_sparse2, 0, False), ('sparse2', map_sparse2, 0, True), ('sparse2', map_sparse2, BS, False), ('sparse2', map_sparse2, BS, True), ('onlysparse', map_onlysparse, 0, False), ('onlysparse', map_onlysparse, 0, True), ('onlysparse', map_onlysparse, BS, False), ('onlysparse', map_onlysparse, BS, True), ('notsparse', map_notsparse, 0, False), ('notsparse', map_notsparse, 0, True), ('notsparse', map_notsparse, BS, False), ('notsparse', map_notsparse, BS, True), ]) def test_chunkify_sparse(tmpdir, fname, sparse_map, header_size, sparse): def get_chunks(fname, sparse, header_size): chunker = ChunkerFixed(4096, header_size=header_size, sparse=sparse) with open(fname, 'rb') as fd: return cf(chunker.chunkify(fd)) fn = str(tmpdir / fname) make_sparsefile(fn, sparse_map, header_size=header_size) get_chunks(fn, sparse=sparse, header_size=header_size) == make_content(sparse_map, header_size=header_size) def test_buzhash_chunksize_distribution(): data = os.urandom(1048576) min_exp, max_exp, mask = 10, 16, 14 # chunk size target 16kiB, clip at 1kiB and 64kiB chunker = Chunker(0, min_exp, max_exp, mask, 4095) f = BytesIO(data) chunks = cf(chunker.chunkify(f)) del chunks[-1] # get rid of the last chunk, it can be smaller than 2**min_exp chunk_sizes = [len(chunk) for chunk in chunks] chunks_count = len(chunks) min_chunksize_observed = min(chunk_sizes) max_chunksize_observed = max(chunk_sizes) min_count = sum(int(size == 2 ** min_exp) for size in chunk_sizes) max_count = sum(int(size == 2 ** max_exp) for size in chunk_sizes) print(f"count: {chunks_count} min: {min_chunksize_observed} max: {max_chunksize_observed} " f"min count: {min_count} max count: {max_count}") # usually there will about 64 chunks assert 32 < chunks_count < 128 # chunks always must be between min and max (clipping must work): assert min_chunksize_observed >= 2 ** min_exp assert max_chunksize_observed <= 2 ** max_exp # most chunks should be cut due to buzhash triggering, not due to clipping at min/max size: assert min_count < 10 assert max_count < 10 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/testsuite/chunker_slow.py0000644000076500000240000000302414641074756021053 0ustar00twstafffrom io import BytesIO from .chunker import cf from ..chunker import Chunker from ..crypto.low_level import blake2b_256 from ..constants import * # NOQA from ..helpers import hex_to_bin from . import BaseTestCase class ChunkerRegressionTestCase(BaseTestCase): def test_chunkpoints_unchanged(self): def twist(size): x = 1 a = bytearray(size) for i in range(size): x = (x * 1103515245 + 12345) & 0x7FFFFFFF a[i] = x & 0xFF return a data = twist(100000) runs = [] for winsize in (65, 129, HASH_WINDOW_SIZE, 7351): for minexp in (4, 6, 7, 11, 12): for maxexp in (15, 17): if minexp >= maxexp: continue for maskbits in (4, 7, 10, 12): for seed in (1849058162, 1234567653): fh = BytesIO(data) chunker = Chunker(seed, minexp, maxexp, maskbits, winsize) chunks = [blake2b_256(b'', c) for c in cf(chunker.chunkify(fh, -1))] runs.append(blake2b_256(b'', b''.join(chunks))) # The "correct" hash below matches the existing chunker behavior. # Future chunker optimisations must not change this, or existing repos will bloat. overall_hash = blake2b_256(b'', b''.join(runs)) self.assert_equal(overall_hash, hex_to_bin("b559b0ac8df8daaa221201d018815114241ea5c6609d98913cd2246a702af4e3")) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/testsuite/compress.py0000644000076500000240000002134614641074756020212 0ustar00twstaffimport argparse import os import zlib try: import lzma except ImportError: lzma = None import pytest from ..compress import get_compressor, Compressor, CompressionSpec, CNONE, ZLIB, LZ4, LZMA, ZSTD, Auto buffer = bytes(2**16) data = b'fooooooooobaaaaaaaar' * 10 params = dict(name='zlib', level=6) def test_get_compressor(): c = get_compressor(name='none') assert isinstance(c, CNONE) c = get_compressor(name='lz4') assert isinstance(c, LZ4) c = get_compressor(name='zlib') assert isinstance(c, ZLIB) with pytest.raises(KeyError): get_compressor(name='foobar') def test_cnull(): c = get_compressor(name='none') cdata = c.compress(data) assert len(cdata) > len(data) assert data in cdata # it's not compressed and just in there 1:1 assert data == c.decompress(cdata) assert data == Compressor(**params).decompress(cdata) # autodetect def test_lz4(): c = get_compressor(name='lz4') cdata = c.compress(data) assert len(cdata) < len(data) assert data == c.decompress(cdata) assert data == Compressor(**params).decompress(cdata) # autodetect def test_lz4_buffer_allocation(monkeypatch): # disable fallback to no compression on incompressible data monkeypatch.setattr(LZ4, 'decide', lambda always_compress: LZ4) # test with a rather huge data object to see if buffer allocation / resizing works data = os.urandom(5 * 2**20) * 10 # 50MiB badly compressible data assert len(data) == 50 * 2**20 c = Compressor('lz4') cdata = c.compress(data) assert len(cdata) > len(data) assert data == c.decompress(cdata) def test_zlib(): c = get_compressor(name='zlib') cdata = c.compress(data) assert len(cdata) < len(data) assert data == c.decompress(cdata) assert data == Compressor(**params).decompress(cdata) # autodetect def test_lzma(): if lzma is None: pytest.skip("No lzma support found.") c = get_compressor(name='lzma') cdata = c.compress(data) assert len(cdata) < len(data) assert data == c.decompress(cdata) assert data == Compressor(**params).decompress(cdata) # autodetect def test_zstd(): c = get_compressor(name='zstd') cdata = c.compress(data) assert len(cdata) < len(data) assert data == c.decompress(cdata) assert data == Compressor(**params).decompress(cdata) # autodetect def test_autodetect_invalid(): with pytest.raises(ValueError): Compressor(**params).decompress(b'\xff\xfftotalcrap') with pytest.raises(ValueError): Compressor(**params).decompress(b'\x08\x00notreallyzlib') def test_zlib_compat(): # for compatibility reasons, we do not add an extra header for zlib, # nor do we expect one when decompressing / autodetecting for level in range(10): c = get_compressor(name='zlib', level=level) cdata1 = c.compress(data) cdata2 = zlib.compress(data, level) assert cdata1 == cdata2 data2 = c.decompress(cdata2) assert data == data2 data2 = Compressor(**params).decompress(cdata2) assert data == data2 def test_compressor(): params_list = [ dict(name='none'), dict(name='lz4'), dict(name='zstd', level=1), dict(name='zstd', level=3), # avoiding high zstd levels, memory needs unclear dict(name='zlib', level=0), dict(name='zlib', level=6), dict(name='zlib', level=9), ] if lzma: params_list += [ dict(name='lzma', level=0), dict(name='lzma', level=6), # we do not test lzma on level 9 because of the huge memory needs ] for params in params_list: c = Compressor(**params) assert data == c.decompress(c.compress(data)) def test_auto(): compressor_auto_zlib = CompressionSpec('auto,zlib,9').compressor compressor_lz4 = CompressionSpec('lz4').compressor compressor_zlib = CompressionSpec('zlib,9').compressor data = bytes(500) compressed_auto_zlib = compressor_auto_zlib.compress(data) compressed_lz4 = compressor_lz4.compress(data) compressed_zlib = compressor_zlib.compress(data) ratio = len(compressed_zlib) / len(compressed_lz4) assert Compressor.detect(compressed_auto_zlib) == ZLIB if ratio < 0.99 else LZ4 data = b'\x00\xb8\xa3\xa2-O\xe1i\xb6\x12\x03\xc21\xf3\x8a\xf78\\\x01\xa5b\x07\x95\xbeE\xf8\xa3\x9ahm\xb1~' compressed = compressor_auto_zlib.compress(data) assert Compressor.detect(compressed) == CNONE def test_obfuscate(): compressor = CompressionSpec('obfuscate,1,none').compressor data = bytes(10000) compressed = compressor.compress(data) # 2 id bytes compression, 2 id bytes obfuscator. 4 length bytes assert len(data) + 8 <= len(compressed) <= len(data) * 101 + 8 # compressing 100 times the same data should give at least 50 different result sizes assert len({len(compressor.compress(data)) for i in range(100)}) > 50 cs = CompressionSpec('obfuscate,2,lz4') assert isinstance(cs.inner.compressor, LZ4) compressor = cs.compressor data = bytes(10000) compressed = compressor.compress(data) # 2 id bytes compression, 2 id bytes obfuscator. 4 length bytes min_compress, max_compress = 0.2, 0.001 # estimate compression factor outer boundaries assert max_compress * len(data) + 8 <= len(compressed) <= min_compress * len(data) * 1001 + 8 # compressing 100 times the same data should give multiple different result sizes assert len({len(compressor.compress(data)) for i in range(100)}) > 10 cs = CompressionSpec('obfuscate,6,zstd,3') assert isinstance(cs.inner.compressor, ZSTD) compressor = cs.compressor data = bytes(10000) compressed = compressor.compress(data) # 2 id bytes compression, 2 id bytes obfuscator. 4 length bytes min_compress, max_compress = 0.2, 0.001 # estimate compression factor outer boundaries assert max_compress * len(data) + 8 <= len(compressed) <= min_compress * len(data) * 10000001 + 8 # compressing 100 times the same data should give multiple different result sizes assert len({len(compressor.compress(data)) for i in range(100)}) > 90 cs = CompressionSpec('obfuscate,2,auto,zstd,10') assert isinstance(cs.inner.compressor, Auto) compressor = cs.compressor data = bytes(10000) compressed = compressor.compress(data) # 2 id bytes compression, 2 id bytes obfuscator. 4 length bytes min_compress, max_compress = 0.2, 0.001 # estimate compression factor outer boundaries assert max_compress * len(data) + 8 <= len(compressed) <= min_compress * len(data) * 1001 + 8 # compressing 100 times the same data should give multiple different result sizes assert len({len(compressor.compress(data)) for i in range(100)}) > 10 cs = CompressionSpec('obfuscate,110,none') assert isinstance(cs.inner.compressor, CNONE) compressor = cs.compressor data = bytes(1000) compressed = compressor.compress(data) # N blocks + 2 id bytes obfuscator. 4 length bytes # The 'none' compressor also adds 2 id bytes assert 6 + 2 + 1000 <= len(compressed) <= 6 + 2 + 1000 + 1024 data = bytes(1100) compressed = compressor.compress(data) # N blocks + 2 id bytes obfuscator. 4 length bytes # The 'none' compressor also adds 2 id bytes assert 6 + 2 + 1100 <= len(compressed) <= 6 + 2 + 1100 + 1024 def test_compression_specs(): with pytest.raises(argparse.ArgumentTypeError): CompressionSpec('') assert isinstance(CompressionSpec('none').compressor, CNONE) assert isinstance(CompressionSpec('lz4').compressor, LZ4) zlib = CompressionSpec('zlib').compressor assert isinstance(zlib, ZLIB) assert zlib.level == 6 zlib = CompressionSpec('zlib,0').compressor assert isinstance(zlib, ZLIB) assert zlib.level == 0 zlib = CompressionSpec('zlib,9').compressor assert isinstance(zlib, ZLIB) assert zlib.level == 9 with pytest.raises(argparse.ArgumentTypeError): CompressionSpec('zlib,9,invalid') lzma = CompressionSpec('lzma').compressor assert isinstance(lzma, LZMA) assert lzma.level == 6 lzma = CompressionSpec('lzma,0').compressor assert isinstance(lzma, LZMA) assert lzma.level == 0 lzma = CompressionSpec('lzma,9').compressor assert isinstance(lzma, LZMA) assert lzma.level == 9 zstd = CompressionSpec('zstd').compressor assert isinstance(zstd, ZSTD) assert zstd.level == 3 zstd = CompressionSpec('zstd,1').compressor assert isinstance(zstd, ZSTD) assert zstd.level == 1 zstd = CompressionSpec('zstd,22').compressor assert isinstance(zstd, ZSTD) assert zstd.level == 22 with pytest.raises(argparse.ArgumentTypeError): CompressionSpec('lzma,9,invalid') with pytest.raises(argparse.ArgumentTypeError): CompressionSpec('invalid') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/testsuite/conftest.py0000644000076500000240000000552514641074756020205 0ustar00twstaffimport os import pytest # IMPORTANT keep this above all other borg imports to avoid inconsistent values # for `from borg.constants import PBKDF2_ITERATIONS` (or star import) usages before # this is executed from borg import constants # no fixture-based monkey-patching since star-imports are used for the constants module constants.PBKDF2_ITERATIONS = 1 # needed to get pretty assertion failures in unit tests: if hasattr(pytest, 'register_assert_rewrite'): pytest.register_assert_rewrite('borg.testsuite') import borg.cache # noqa: E402 from borg.logger import setup_logging # noqa: E402 # Ensure that the loggers exist for all tests setup_logging() from borg.testsuite import has_lchflags, has_llfuse, has_pyfuse3 # noqa: E402 from borg.testsuite import are_symlinks_supported, are_hardlinks_supported, is_utime_fully_supported # noqa: E402 from borg.testsuite.platform import fakeroot_detected # noqa: E402 @pytest.fixture(autouse=True) def clean_env(tmpdir_factory, monkeypatch): # avoid that we access / modify the user's normal .config / .cache directory: monkeypatch.setenv('XDG_CONFIG_HOME', str(tmpdir_factory.mktemp('xdg-config-home'))) monkeypatch.setenv('XDG_CACHE_HOME', str(tmpdir_factory.mktemp('xdg-cache-home'))) # also avoid to use anything from the outside environment: keys = [key for key in os.environ if key.startswith('BORG_') and key not in ('BORG_FUSE_IMPL', )] for key in keys: monkeypatch.delenv(key, raising=False) def pytest_report_header(config, start_path): tests = { "BSD flags": has_lchflags, "fuse2": has_llfuse, "fuse3": has_pyfuse3, "root": not fakeroot_detected(), "symlinks": are_symlinks_supported(), "hardlinks": are_hardlinks_supported(), "atime/mtime": is_utime_fully_supported(), "modes": "BORG_TESTS_IGNORE_MODES" not in os.environ } enabled = [] disabled = [] for test in tests: if tests[test]: enabled.append(test) else: disabled.append(test) output = "Tests enabled: " + ", ".join(enabled) + "\n" output += "Tests disabled: " + ", ".join(disabled) return output class DefaultPatches: def __init__(self, request): self.org_cache_wipe_cache = borg.cache.LocalCache.wipe_cache def wipe_should_not_be_called(*a, **kw): raise AssertionError("Cache wipe was triggered, if this is part of the test add " "@pytest.mark.allow_cache_wipe") if 'allow_cache_wipe' not in request.keywords: borg.cache.LocalCache.wipe_cache = wipe_should_not_be_called request.addfinalizer(self.undo) def undo(self): borg.cache.LocalCache.wipe_cache = self.org_cache_wipe_cache @pytest.fixture(autouse=True) def default_patches(request): return DefaultPatches(request) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/testsuite/crypto.py0000644000076500000240000001525114641074756017675 0ustar00twstaff# Note: these tests are part of the self test, do not use or import pytest functionality here. # See borg.selftest for details. If you add/remove test methods, update SELFTEST_COUNT from ..crypto.low_level import AES256_CTR_HMAC_SHA256, UNENCRYPTED, IntegrityError from ..crypto.low_level import bytes_to_long, bytes_to_int, long_to_bytes from ..crypto.low_level import hkdf_hmac_sha512 from ..helpers import bin_to_hex from . import BaseTestCase class CryptoTestCase(BaseTestCase): def test_bytes_to_int(self): self.assert_equal(bytes_to_int(b'\0\0\0\1'), 1) def test_bytes_to_long(self): self.assert_equal(bytes_to_long(b'\0\0\0\0\0\0\0\1'), 1) self.assert_equal(long_to_bytes(1), b'\0\0\0\0\0\0\0\1') def test_UNENCRYPTED(self): iv = b'' # any IV is ok, it just must be set and not None data = b'data' header = b'header' cs = UNENCRYPTED(None, None, iv, header_len=6) envelope = cs.encrypt(data, header=header) self.assert_equal(envelope, header + data) got_data = cs.decrypt(envelope) self.assert_equal(got_data, data) def test_AES256_CTR_HMAC_SHA256(self): # this tests the layout as in attic / borg < 1.2 (1 type byte, no aad) mac_key = b'Y' * 32 enc_key = b'X' * 32 iv = 0 data = b'foo' * 10 header = b'\x42' # encrypt-then-mac cs = AES256_CTR_HMAC_SHA256(mac_key, enc_key, iv, header_len=1, aad_offset=1) hdr_mac_iv_cdata = cs.encrypt(data, header=header) hdr = hdr_mac_iv_cdata[0:1] mac = hdr_mac_iv_cdata[1:33] iv = hdr_mac_iv_cdata[33:41] cdata = hdr_mac_iv_cdata[41:] self.assert_equal(bin_to_hex(hdr), '42') self.assert_equal(bin_to_hex(mac), 'af90b488b0cc4a8f768fe2d6814fa65aec66b148135e54f7d4d29a27f22f57a8') self.assert_equal(bin_to_hex(iv), '0000000000000000') self.assert_equal(bin_to_hex(cdata), 'c6efb702de12498f34a2c2bbc8149e759996d08bf6dc5c610aefc0c3a466') self.assert_equal(cs.next_iv(), 2) # auth-then-decrypt cs = AES256_CTR_HMAC_SHA256(mac_key, enc_key, header_len=len(header), aad_offset=1) pdata = cs.decrypt(hdr_mac_iv_cdata) self.assert_equal(data, pdata) self.assert_equal(cs.next_iv(), 2) # auth-failure due to corruption (corrupted data) cs = AES256_CTR_HMAC_SHA256(mac_key, enc_key, header_len=len(header), aad_offset=1) hdr_mac_iv_cdata_corrupted = hdr_mac_iv_cdata[:41] + b'\0' + hdr_mac_iv_cdata[42:] self.assert_raises(IntegrityError, lambda: cs.decrypt(hdr_mac_iv_cdata_corrupted)) def test_AES256_CTR_HMAC_SHA256_aad(self): mac_key = b'Y' * 32 enc_key = b'X' * 32 iv = 0 data = b'foo' * 10 header = b'\x12\x34\x56' # encrypt-then-mac cs = AES256_CTR_HMAC_SHA256(mac_key, enc_key, iv, header_len=3, aad_offset=1) hdr_mac_iv_cdata = cs.encrypt(data, header=header) hdr = hdr_mac_iv_cdata[0:3] mac = hdr_mac_iv_cdata[3:35] iv = hdr_mac_iv_cdata[35:43] cdata = hdr_mac_iv_cdata[43:] self.assert_equal(bin_to_hex(hdr), '123456') self.assert_equal(bin_to_hex(mac), '7659a915d9927072ef130258052351a17ef882692893c3850dd798c03d2dd138') self.assert_equal(bin_to_hex(iv), '0000000000000000') self.assert_equal(bin_to_hex(cdata), 'c6efb702de12498f34a2c2bbc8149e759996d08bf6dc5c610aefc0c3a466') self.assert_equal(cs.next_iv(), 2) # auth-then-decrypt cs = AES256_CTR_HMAC_SHA256(mac_key, enc_key, header_len=len(header), aad_offset=1) pdata = cs.decrypt(hdr_mac_iv_cdata) self.assert_equal(data, pdata) self.assert_equal(cs.next_iv(), 2) # auth-failure due to corruption (corrupted aad) cs = AES256_CTR_HMAC_SHA256(mac_key, enc_key, header_len=len(header), aad_offset=1) hdr_mac_iv_cdata_corrupted = hdr_mac_iv_cdata[:1] + b'\0' + hdr_mac_iv_cdata[2:] self.assert_raises(IntegrityError, lambda: cs.decrypt(hdr_mac_iv_cdata_corrupted)) # These test vectors come from https://www.kullo.net/blog/hkdf-sha-512-test-vectors/ # who claims to have verified these against independent Python and C++ implementations. def test_hkdf_hmac_sha512(self): ikm = b'\x0b' * 22 salt = bytes.fromhex('000102030405060708090a0b0c') info = bytes.fromhex('f0f1f2f3f4f5f6f7f8f9') l = 42 okm = hkdf_hmac_sha512(ikm, salt, info, l) assert okm == bytes.fromhex('832390086cda71fb47625bb5ceb168e4c8e26a1a16ed34d9fc7fe92c1481579338da362cb8d9f925d7cb') def test_hkdf_hmac_sha512_2(self): ikm = bytes.fromhex('000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f2021222324252627' '28292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f') salt = bytes.fromhex('606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868' '788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeaf') info = bytes.fromhex('b0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7' 'd8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff') l = 82 okm = hkdf_hmac_sha512(ikm, salt, info, l) assert okm == bytes.fromhex('ce6c97192805b346e6161e821ed165673b84f400a2b514b2fe23d84cd189ddf1b695b48cbd1c838844' '1137b3ce28f16aa64ba33ba466b24df6cfcb021ecff235f6a2056ce3af1de44d572097a8505d9e7a93') def test_hkdf_hmac_sha512_3(self): ikm = bytes.fromhex('0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b') salt = None info = b'' l = 42 okm = hkdf_hmac_sha512(ikm, salt, info, l) assert okm == bytes.fromhex('f5fa02b18298a72a8c23898a8703472c6eb179dc204c03425c970e3b164bf90fff22d04836d0e2343bac') def test_hkdf_hmac_sha512_4(self): ikm = bytes.fromhex('0b0b0b0b0b0b0b0b0b0b0b') salt = bytes.fromhex('000102030405060708090a0b0c') info = bytes.fromhex('f0f1f2f3f4f5f6f7f8f9') l = 42 okm = hkdf_hmac_sha512(ikm, salt, info, l) assert okm == bytes.fromhex('7413e8997e020610fbf6823f2ce14bff01875db1ca55f68cfcf3954dc8aff53559bd5e3028b080f7c068') def test_hkdf_hmac_sha512_5(self): ikm = bytes.fromhex('0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c') salt = None info = b'' l = 42 okm = hkdf_hmac_sha512(ikm, salt, info, l) assert okm == bytes.fromhex('1407d46013d98bc6decefcfee55f0f90b0c7f63d68eb1a80eaf07e953cfc0a3a5240a155d6e4daa965bb') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/testsuite/efficient_collection_queue.py0000644000076500000240000000310614641074756023724 0ustar00twstaffimport pytest from ..helpers.datastruct import EfficientCollectionQueue class TestEfficientQueue: def test_base_usage(self): queue = EfficientCollectionQueue(100, bytes) assert queue.peek_front() == b'' queue.push_back(b'1234') assert queue.peek_front() == b'1234' assert len(queue) == 4 assert queue queue.pop_front(4) assert queue.peek_front() == b'' assert len(queue) == 0 assert not queue def test_usage_with_arrays(self): queue = EfficientCollectionQueue(100, list) assert queue.peek_front() == [] queue.push_back([1, 2, 3, 4]) assert queue.peek_front() == [1, 2, 3, 4] assert len(queue) == 4 assert queue queue.pop_front(4) assert queue.peek_front() == [] assert len(queue) == 0 assert not queue def test_chunking(self): queue = EfficientCollectionQueue(2, bytes) queue.push_back(b'1') queue.push_back(b'23') queue.push_back(b'4567') assert len(queue) == 7 assert queue.peek_front() == b'12' queue.pop_front(3) assert queue.peek_front() == b'4' queue.pop_front(1) assert queue.peek_front() == b'56' queue.pop_front(2) assert len(queue) == 1 assert queue with pytest.raises(EfficientCollectionQueue.SizeUnderflow): queue.pop_front(2) assert queue.peek_front() == b'7' queue.pop_front(1) assert queue.peek_front() == b'' assert len(queue) == 0 assert not queue ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/testsuite/file_integrity.py0000644000076500000240000001422714641074756021374 0ustar00twstaffimport pytest from ..crypto.file_integrity import IntegrityCheckedFile, DetachedIntegrityCheckedFile, FileIntegrityError class TestReadIntegrityFile: def test_no_integrity(self, tmpdir): protected_file = tmpdir.join('file') protected_file.write('1234') assert DetachedIntegrityCheckedFile.read_integrity_file(str(protected_file)) is None def test_truncated_integrity(self, tmpdir): protected_file = tmpdir.join('file') protected_file.write('1234') tmpdir.join('file.integrity').write('') with pytest.raises(FileIntegrityError): DetachedIntegrityCheckedFile.read_integrity_file(str(protected_file)) def test_unknown_algorithm(self, tmpdir): protected_file = tmpdir.join('file') protected_file.write('1234') tmpdir.join('file.integrity').write('{"algorithm": "HMAC_SERIOUSHASH", "digests": "1234"}') assert DetachedIntegrityCheckedFile.read_integrity_file(str(protected_file)) is None @pytest.mark.parametrize('json', ( '{"ALGORITHM": "HMAC_SERIOUSHASH", "digests": "1234"}', '[]', '1234.5', '"A string"', 'Invalid JSON', )) def test_malformed(self, tmpdir, json): protected_file = tmpdir.join('file') protected_file.write('1234') tmpdir.join('file.integrity').write(json) with pytest.raises(FileIntegrityError): DetachedIntegrityCheckedFile.read_integrity_file(str(protected_file)) class TestDetachedIntegrityCheckedFile: @pytest.fixture def integrity_protected_file(self, tmpdir): path = str(tmpdir.join('file')) with DetachedIntegrityCheckedFile(path, write=True) as fd: fd.write(b'foo and bar') return path def test_simple(self, tmpdir, integrity_protected_file): assert tmpdir.join('file').check(file=True) assert tmpdir.join('file.integrity').check(file=True) with DetachedIntegrityCheckedFile(integrity_protected_file, write=False) as fd: assert fd.read() == b'foo and bar' def test_corrupted_file(self, integrity_protected_file): with open(integrity_protected_file, 'ab') as fd: fd.write(b' extra data') with pytest.raises(FileIntegrityError): with DetachedIntegrityCheckedFile(integrity_protected_file, write=False) as fd: assert fd.read() == b'foo and bar extra data' def test_corrupted_file_partial_read(self, integrity_protected_file): with open(integrity_protected_file, 'ab') as fd: fd.write(b' extra data') with pytest.raises(FileIntegrityError): with DetachedIntegrityCheckedFile(integrity_protected_file, write=False) as fd: data = b'foo and bar' assert fd.read(len(data)) == data @pytest.mark.parametrize('new_name', ( 'different_file', 'different_file.different_ext', )) def test_renamed_file(self, tmpdir, integrity_protected_file, new_name): new_path = tmpdir.join(new_name) tmpdir.join('file').move(new_path) tmpdir.join('file.integrity').move(new_path + '.integrity') with pytest.raises(FileIntegrityError): with DetachedIntegrityCheckedFile(str(new_path), write=False) as fd: assert fd.read() == b'foo and bar' def test_moved_file(self, tmpdir, integrity_protected_file): new_dir = tmpdir.mkdir('another_directory') tmpdir.join('file').move(new_dir.join('file')) tmpdir.join('file.integrity').move(new_dir.join('file.integrity')) new_path = str(new_dir.join('file')) with DetachedIntegrityCheckedFile(new_path, write=False) as fd: assert fd.read() == b'foo and bar' def test_no_integrity(self, tmpdir, integrity_protected_file): tmpdir.join('file.integrity').remove() with DetachedIntegrityCheckedFile(integrity_protected_file, write=False) as fd: assert fd.read() == b'foo and bar' class TestDetachedIntegrityCheckedFileParts: @pytest.fixture def integrity_protected_file(self, tmpdir): path = str(tmpdir.join('file')) with DetachedIntegrityCheckedFile(path, write=True) as fd: fd.write(b'foo and bar') fd.hash_part('foopart') fd.write(b' other data') return path def test_simple(self, integrity_protected_file): with DetachedIntegrityCheckedFile(integrity_protected_file, write=False) as fd: data1 = b'foo and bar' assert fd.read(len(data1)) == data1 fd.hash_part('foopart') assert fd.read() == b' other data' def test_wrong_part_name(self, integrity_protected_file): with pytest.raises(FileIntegrityError): # Because some hash_part failed, the final digest will fail as well - again - even if we catch # the failing hash_part. This is intentional: (1) it makes the code simpler (2) it's a good fail-safe # against overly broad exception handling. with DetachedIntegrityCheckedFile(integrity_protected_file, write=False) as fd: data1 = b'foo and bar' assert fd.read(len(data1)) == data1 with pytest.raises(FileIntegrityError): # This specific bit raises it directly fd.hash_part('barpart') # Still explodes in the end. @pytest.mark.parametrize('partial_read', (False, True)) def test_part_independence(self, integrity_protected_file, partial_read): with open(integrity_protected_file, 'ab') as fd: fd.write(b'some extra stuff that does not belong') with pytest.raises(FileIntegrityError): with DetachedIntegrityCheckedFile(integrity_protected_file, write=False) as fd: data1 = b'foo and bar' try: assert fd.read(len(data1)) == data1 fd.hash_part('foopart') except FileIntegrityError: assert False, 'This part must not raise, since this part is still valid.' if not partial_read: fd.read() # But overall it explodes with the final digest. Neat, eh? ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/testsuite/hashindex.py0000644000076500000240000005025514641074756020333 0ustar00twstaff# Note: these tests are part of the self test, do not use or import pytest functionality here. # See borg.selftest for details. If you add/remove test methods, update SELFTEST_COUNT import base64 import hashlib import io import os import tempfile import zlib from ..hashindex import NSIndex, ChunkIndex, ChunkIndexEntry from .. import hashindex from ..crypto.file_integrity import IntegrityCheckedFile, FileIntegrityError from . import BaseTestCase, unopened_tempfile def H(x): # make some 32byte long thing that depends on x return bytes('%-0.32d' % x, 'ascii') def H2(x): # like H(x), but with pseudo-random distribution of the output value return hashlib.sha256(H(x)).digest() class HashIndexTestCase(BaseTestCase): def _generic_test(self, cls, make_value, sha): idx = cls() self.assert_equal(len(idx), 0) # Test set for x in range(100): idx[H(x)] = make_value(x) self.assert_equal(len(idx), 100) for x in range(100): self.assert_equal(idx[H(x)], make_value(x)) # Test update for x in range(100): idx[H(x)] = make_value(x * 2) self.assert_equal(len(idx), 100) for x in range(100): self.assert_equal(idx[H(x)], make_value(x * 2)) # Test delete for x in range(50): del idx[H(x)] # Test some keys still in there for x in range(50, 100): assert H(x) in idx # Test some keys not there any more for x in range(50): assert H(x) not in idx # Test delete non-existing key for x in range(50): self.assert_raises(KeyError, idx.__delitem__, H(x)) self.assert_equal(len(idx), 50) with unopened_tempfile() as filepath: idx.write(filepath) del idx # Verify file contents with open(filepath, 'rb') as fd: self.assert_equal(hashlib.sha256(fd.read()).hexdigest(), sha) # Make sure we can open the file idx = cls.read(filepath) self.assert_equal(len(idx), 50) for x in range(50, 100): self.assert_equal(idx[H(x)], make_value(x * 2)) idx.clear() self.assert_equal(len(idx), 0) idx.write(filepath) del idx self.assert_equal(len(cls.read(filepath)), 0) idx = cls() # Test setdefault - set non-existing key idx.setdefault(H(0), make_value(42)) assert H(0) in idx assert idx[H(0)] == make_value(42) # Test setdefault - do not set existing key idx.setdefault(H(0), make_value(23)) assert H(0) in idx assert idx[H(0)] == make_value(42) # Test setdefault - get-like return value, key not present assert idx.setdefault(H(1), make_value(23)) == make_value(23) # Test setdefault - get-like return value, key present assert idx.setdefault(H(0), make_value(23)) == make_value(42) # clean up setdefault test del idx def test_nsindex(self): self._generic_test(NSIndex, lambda x: (x, x), '85f72b036c692c8266e4f51ccf0cff2147204282b5e316ae508d30a448d88fef') def test_chunkindex(self): self._generic_test(ChunkIndex, lambda x: (x, x, x), 'c83fdf33755fc37879285f2ecfc5d1f63b97577494902126b6fb6f3e4d852488') def test_resize(self): n = 2000 # Must be >= MIN_BUCKETS with unopened_tempfile() as filepath: idx = NSIndex() idx.write(filepath) initial_size = os.path.getsize(filepath) self.assert_equal(len(idx), 0) for x in range(n): idx[H(x)] = x, x idx.write(filepath) assert initial_size < os.path.getsize(filepath) for x in range(n): del idx[H(x)] self.assert_equal(len(idx), 0) idx.write(filepath) self.assert_equal(initial_size, os.path.getsize(filepath)) def test_iteritems(self): idx = NSIndex() for x in range(100): idx[H(x)] = x, x iterator = idx.iteritems() all = list(iterator) self.assert_equal(len(all), 100) # iterator is already exhausted by list(): self.assert_raises(StopIteration, next, iterator) second_half = list(idx.iteritems(marker=all[49][0])) self.assert_equal(len(second_half), 50) self.assert_equal(second_half, all[50:]) def test_chunkindex_merge(self): idx1 = ChunkIndex() idx1[H(1)] = 1, 100, 100 idx1[H(2)] = 2, 200, 200 idx1[H(3)] = 3, 300, 300 # no H(4) entry idx2 = ChunkIndex() idx2[H(1)] = 4, 100, 100 idx2[H(2)] = 5, 200, 200 # no H(3) entry idx2[H(4)] = 6, 400, 400 idx1.merge(idx2) assert idx1[H(1)] == (5, 100, 100) assert idx1[H(2)] == (7, 200, 200) assert idx1[H(3)] == (3, 300, 300) assert idx1[H(4)] == (6, 400, 400) def test_chunkindex_summarize(self): idx = ChunkIndex() idx[H(1)] = 1, 1000, 100 idx[H(2)] = 2, 2000, 200 idx[H(3)] = 3, 3000, 300 size, csize, unique_size, unique_csize, unique_chunks, chunks = idx.summarize() assert size == 1000 + 2 * 2000 + 3 * 3000 assert csize == 100 + 2 * 200 + 3 * 300 assert unique_size == 1000 + 2000 + 3000 assert unique_csize == 100 + 200 + 300 assert chunks == 1 + 2 + 3 assert unique_chunks == 3 class HashIndexExtraTestCase(BaseTestCase): """These tests are separate because they should not become part of the selftest. """ def test_chunk_indexer(self): # see _hashindex.c hash_sizes, we want to be close to the max. load # because interesting errors happen there. key_count = int(65537 * ChunkIndex.MAX_LOAD_FACTOR) - 10 index = ChunkIndex(key_count) all_keys = [hashlib.sha256(H(k)).digest() for k in range(key_count)] # we're gonna delete 1/3 of all_keys, so let's split them 2/3 and 1/3: keys, to_delete_keys = all_keys[0:(2*key_count//3)], all_keys[(2*key_count//3):] for i, key in enumerate(keys): index[key] = (i, i, i) for i, key in enumerate(to_delete_keys): index[key] = (i, i, i) for key in to_delete_keys: del index[key] for i, key in enumerate(keys): assert index[key] == (i, i, i) for key in to_delete_keys: assert index.get(key) is None # now delete every key still in the index for key in keys: del index[key] # the index should now be empty assert list(index.iteritems()) == [] class HashIndexSizeTestCase(BaseTestCase): def test_size_on_disk(self): idx = ChunkIndex() assert idx.size() == 18 + 1031 * (32 + 3 * 4) def test_size_on_disk_accurate(self): idx = ChunkIndex() for i in range(1234): idx[H(i)] = i, i**2, i**3 with unopened_tempfile() as filepath: idx.write(filepath) size = os.path.getsize(filepath) assert idx.size() == size class HashIndexRefcountingTestCase(BaseTestCase): def test_chunkindex_limit(self): idx = ChunkIndex() idx[H(1)] = ChunkIndex.MAX_VALUE - 1, 1, 2 # 5 is arbitrary, any number of incref/decrefs shouldn't move it once it's limited for i in range(5): # first incref to move it to the limit refcount, *_ = idx.incref(H(1)) assert refcount == ChunkIndex.MAX_VALUE for i in range(5): refcount, *_ = idx.decref(H(1)) assert refcount == ChunkIndex.MAX_VALUE def _merge(self, refcounta, refcountb): def merge(refcount1, refcount2): idx1 = ChunkIndex() idx1[H(1)] = refcount1, 1, 2 idx2 = ChunkIndex() idx2[H(1)] = refcount2, 1, 2 idx1.merge(idx2) refcount, *_ = idx1[H(1)] return refcount result = merge(refcounta, refcountb) # check for commutativity assert result == merge(refcountb, refcounta) return result def test_chunkindex_merge_limit1(self): # Check that it does *not* limit at MAX_VALUE - 1 # (MAX_VALUE is odd) half = ChunkIndex.MAX_VALUE // 2 assert self._merge(half, half) == ChunkIndex.MAX_VALUE - 1 def test_chunkindex_merge_limit2(self): # 3000000000 + 2000000000 > MAX_VALUE assert self._merge(3000000000, 2000000000) == ChunkIndex.MAX_VALUE def test_chunkindex_merge_limit3(self): # Crossover point: both addition and limit semantics will yield the same result half = ChunkIndex.MAX_VALUE // 2 assert self._merge(half + 1, half) == ChunkIndex.MAX_VALUE def test_chunkindex_merge_limit4(self): # Beyond crossover, result of addition would be 2**31 half = ChunkIndex.MAX_VALUE // 2 assert self._merge(half + 2, half) == ChunkIndex.MAX_VALUE assert self._merge(half + 1, half + 1) == ChunkIndex.MAX_VALUE def test_chunkindex_add(self): idx1 = ChunkIndex() idx1.add(H(1), 5, 6, 7) assert idx1[H(1)] == (5, 6, 7) idx1.add(H(1), 1, 2, 3) assert idx1[H(1)] == (6, 2, 3) def test_incref_limit(self): idx1 = ChunkIndex() idx1[H(1)] = (ChunkIndex.MAX_VALUE, 6, 7) idx1.incref(H(1)) refcount, *_ = idx1[H(1)] assert refcount == ChunkIndex.MAX_VALUE def test_decref_limit(self): idx1 = ChunkIndex() idx1[H(1)] = ChunkIndex.MAX_VALUE, 6, 7 idx1.decref(H(1)) refcount, *_ = idx1[H(1)] assert refcount == ChunkIndex.MAX_VALUE def test_decref_zero(self): idx1 = ChunkIndex() idx1[H(1)] = 0, 0, 0 with self.assert_raises(AssertionError): idx1.decref(H(1)) def test_incref_decref(self): idx1 = ChunkIndex() idx1.add(H(1), 5, 6, 7) assert idx1[H(1)] == (5, 6, 7) idx1.incref(H(1)) assert idx1[H(1)] == (6, 6, 7) idx1.decref(H(1)) assert idx1[H(1)] == (5, 6, 7) def test_setitem_raises(self): idx1 = ChunkIndex() with self.assert_raises(AssertionError): idx1[H(1)] = ChunkIndex.MAX_VALUE + 1, 0, 0 def test_keyerror(self): idx = ChunkIndex() with self.assert_raises(KeyError): idx.incref(H(1)) with self.assert_raises(KeyError): idx.decref(H(1)) with self.assert_raises(KeyError): idx[H(1)] with self.assert_raises(OverflowError): idx.add(H(1), -1, 0, 0) class HashIndexDataTestCase(BaseTestCase): # This bytestring was created with 1.0-maint at c2f9533 HASHINDEX = b'eJzt0L0NgmAUhtHLT0LDEI6AuAEhMVYmVnSuYefC7AB3Aj9KNedJbnfyFne6P67P27w0EdG1Eac+Cm1ZybAsy7Isy7Isy7Isy7I' \ b'sy7Isy7Isy7Isy7Isy7Isy7Isy7Isy7Isy7Isy7Isy7Isy7Isy7Isy7Isy7Isy7Isy7Isy7Isy7Isy7Isy7Isy7LsL9nhc+cqTZ' \ b'3XlO2Ys++Du5fX+l1/YFmWZVmWZVmWZVmWZVmWZVmWZVmWZVmWZVmWZVmWZVmWZVmWZVmWZVmWZVmWZVmWZVn2/+0O2rYccw==' def _serialize_hashindex(self, idx): with tempfile.TemporaryDirectory() as tempdir: file = os.path.join(tempdir, 'idx') idx.write(file) with open(file, 'rb') as f: return self._pack(f.read()) def _deserialize_hashindex(self, bytestring): with tempfile.TemporaryDirectory() as tempdir: file = os.path.join(tempdir, 'idx') with open(file, 'wb') as f: f.write(self._unpack(bytestring)) return ChunkIndex.read(file) def _pack(self, bytestring): return base64.b64encode(zlib.compress(bytestring)) def _unpack(self, bytestring): return zlib.decompress(base64.b64decode(bytestring)) def test_identical_creation(self): idx1 = ChunkIndex() idx1[H(1)] = 1, 2, 3 idx1[H(2)] = 2**31 - 1, 0, 0 idx1[H(3)] = 4294962296, 0, 0 # 4294962296 is -5000 interpreted as an uint32_t serialized = self._serialize_hashindex(idx1) assert self._unpack(serialized) == self._unpack(self.HASHINDEX) def test_read_known_good(self): idx1 = self._deserialize_hashindex(self.HASHINDEX) assert idx1[H(1)] == (1, 2, 3) assert idx1[H(2)] == (2**31 - 1, 0, 0) assert idx1[H(3)] == (4294962296, 0, 0) idx2 = ChunkIndex() idx2[H(3)] = 2**32 - 123456, 6, 7 idx1.merge(idx2) assert idx1[H(3)] == (ChunkIndex.MAX_VALUE, 6, 7) class HashIndexIntegrityTestCase(HashIndexDataTestCase): def write_integrity_checked_index(self, tempdir): idx = self._deserialize_hashindex(self.HASHINDEX) file = os.path.join(tempdir, 'idx') with IntegrityCheckedFile(path=file, write=True) as fd: idx.write(fd) integrity_data = fd.integrity_data assert 'final' in integrity_data assert 'HashHeader' in integrity_data return file, integrity_data def test_integrity_checked_file(self): with tempfile.TemporaryDirectory() as tempdir: file, integrity_data = self.write_integrity_checked_index(tempdir) with open(file, 'r+b') as fd: fd.write(b'Foo') with self.assert_raises(FileIntegrityError): with IntegrityCheckedFile(path=file, write=False, integrity_data=integrity_data) as fd: ChunkIndex.read(fd) class HashIndexCompactTestCase(HashIndexDataTestCase): def index(self, num_entries, num_buckets): index_data = io.BytesIO() index_data.write(b'BORG_IDX') # num_entries index_data.write(num_entries.to_bytes(4, 'little')) # num_buckets index_data.write(num_buckets.to_bytes(4, 'little')) # key_size index_data.write((32).to_bytes(1, 'little')) # value_size index_data.write((3 * 4).to_bytes(1, 'little')) self.index_data = index_data def index_from_data(self): self.index_data.seek(0) index = ChunkIndex.read(self.index_data) return index def index_to_data(self, index): data = io.BytesIO() index.write(data) return data.getvalue() def index_from_data_compact_to_data(self): index = self.index_from_data() index.compact() compact_index = self.index_to_data(index) return compact_index def write_entry(self, key, *values): self.index_data.write(key) for value in values: self.index_data.write(value.to_bytes(4, 'little')) def write_empty(self, key): self.write_entry(key, 0xffffffff, 0, 0) def write_deleted(self, key): self.write_entry(key, 0xfffffffe, 0, 0) def test_simple(self): self.index(num_entries=3, num_buckets=6) self.write_entry(H2(0), 1, 2, 3) self.write_deleted(H2(1)) self.write_empty(H2(2)) self.write_entry(H2(3), 5, 6, 7) self.write_entry(H2(4), 8, 9, 10) self.write_empty(H2(5)) compact_index = self.index_from_data_compact_to_data() self.index(num_entries=3, num_buckets=3) self.write_entry(H2(0), 1, 2, 3) self.write_entry(H2(3), 5, 6, 7) self.write_entry(H2(4), 8, 9, 10) assert compact_index == self.index_data.getvalue() def test_first_empty(self): self.index(num_entries=3, num_buckets=6) self.write_deleted(H2(1)) self.write_entry(H2(0), 1, 2, 3) self.write_empty(H2(2)) self.write_entry(H2(3), 5, 6, 7) self.write_entry(H2(4), 8, 9, 10) self.write_empty(H2(5)) compact_index = self.index_from_data_compact_to_data() self.index(num_entries=3, num_buckets=3) self.write_entry(H2(0), 1, 2, 3) self.write_entry(H2(3), 5, 6, 7) self.write_entry(H2(4), 8, 9, 10) assert compact_index == self.index_data.getvalue() def test_last_used(self): self.index(num_entries=3, num_buckets=6) self.write_deleted(H2(1)) self.write_entry(H2(0), 1, 2, 3) self.write_empty(H2(2)) self.write_entry(H2(3), 5, 6, 7) self.write_empty(H2(5)) self.write_entry(H2(4), 8, 9, 10) compact_index = self.index_from_data_compact_to_data() self.index(num_entries=3, num_buckets=3) self.write_entry(H2(0), 1, 2, 3) self.write_entry(H2(3), 5, 6, 7) self.write_entry(H2(4), 8, 9, 10) assert compact_index == self.index_data.getvalue() def test_too_few_empty_slots(self): self.index(num_entries=3, num_buckets=6) self.write_deleted(H2(1)) self.write_entry(H2(0), 1, 2, 3) self.write_entry(H2(3), 5, 6, 7) self.write_empty(H2(2)) self.write_empty(H2(5)) self.write_entry(H2(4), 8, 9, 10) compact_index = self.index_from_data_compact_to_data() self.index(num_entries=3, num_buckets=3) self.write_entry(H2(0), 1, 2, 3) self.write_entry(H2(3), 5, 6, 7) self.write_entry(H2(4), 8, 9, 10) assert compact_index == self.index_data.getvalue() def test_empty(self): self.index(num_entries=0, num_buckets=6) self.write_deleted(H2(1)) self.write_empty(H2(0)) self.write_deleted(H2(3)) self.write_empty(H2(2)) self.write_empty(H2(5)) self.write_deleted(H2(4)) compact_index = self.index_from_data_compact_to_data() self.index(num_entries=0, num_buckets=0) assert compact_index == self.index_data.getvalue() def test_merge(self): master = ChunkIndex() idx1 = ChunkIndex() idx1[H(1)] = 1, 100, 100 idx1[H(2)] = 2, 200, 200 idx1[H(3)] = 3, 300, 300 idx1.compact() assert idx1.size() == 18 + 3 * (32 + 3 * 4) master.merge(idx1) assert master[H(1)] == (1, 100, 100) assert master[H(2)] == (2, 200, 200) assert master[H(3)] == (3, 300, 300) class NSIndexTestCase(BaseTestCase): def test_nsindex_segment_limit(self): idx = NSIndex() with self.assert_raises(AssertionError): idx[H(1)] = NSIndex.MAX_VALUE + 1, 0 assert H(1) not in idx idx[H(2)] = NSIndex.MAX_VALUE, 0 assert H(2) in idx class AllIndexTestCase(BaseTestCase): def test_max_load_factor(self): assert NSIndex.MAX_LOAD_FACTOR < 1.0 assert ChunkIndex.MAX_LOAD_FACTOR < 1.0 class IndexCorruptionTestCase(BaseTestCase): def test_bug_4829(self): from struct import pack def HH(x, y): # make some 32byte long thing that depends on x and y. # same x will mean a collision in the hashtable as bucket index is computed from # first 4 bytes. giving a specific x targets bucket index x. # y is to create different keys and does not go into the bucket index calculation. # so, same x + different y --> collision return pack('= 100 b3 = buffer.get() assert b3 is b2 # still same buffer (200) buffer.resize(100, init=True) assert len(buffer) == 100 # except on init b4 = buffer.get() assert b4 is not b3 # new, smaller buffer def test_limit(self): buffer = Buffer(bytearray, size=100, limit=200) buffer.resize(200) assert len(buffer) == 200 with pytest.raises(Buffer.MemoryLimitExceeded): buffer.resize(201) assert len(buffer) == 200 def test_get(self): buffer = Buffer(bytearray, size=100, limit=200) b1 = buffer.get(50) assert len(b1) >= 50 # == 100 b2 = buffer.get(100) assert len(b2) >= 100 # == 100 assert b2 is b1 # did not need resizing yet b3 = buffer.get(200) assert len(b3) == 200 assert b3 is not b2 # new, resized buffer with pytest.raises(Buffer.MemoryLimitExceeded): buffer.get(201) # beyond limit assert len(buffer) == 200 def test_yes_input(): inputs = list(TRUISH) input = FakeInputs(inputs) for i in inputs: assert yes(input=input) inputs = list(FALSISH) input = FakeInputs(inputs) for i in inputs: assert not yes(input=input) def test_yes_input_defaults(): inputs = list(DEFAULTISH) input = FakeInputs(inputs) for i in inputs: assert yes(default=True, input=input) input = FakeInputs(inputs) for i in inputs: assert not yes(default=False, input=input) def test_yes_input_custom(): input = FakeInputs(['YES', 'SURE', 'NOPE', ]) assert yes(truish=('YES', ), input=input) assert yes(truish=('SURE', ), input=input) assert not yes(falsish=('NOPE', ), input=input) def test_yes_env(monkeypatch): for value in TRUISH: monkeypatch.setenv('OVERRIDE_THIS', value) assert yes(env_var_override='OVERRIDE_THIS') for value in FALSISH: monkeypatch.setenv('OVERRIDE_THIS', value) assert not yes(env_var_override='OVERRIDE_THIS') def test_yes_env_default(monkeypatch): for value in DEFAULTISH: monkeypatch.setenv('OVERRIDE_THIS', value) assert yes(env_var_override='OVERRIDE_THIS', default=True) assert not yes(env_var_override='OVERRIDE_THIS', default=False) def test_yes_defaults(): input = FakeInputs(['invalid', '', ' ']) assert not yes(input=input) # default=False assert not yes(input=input) assert not yes(input=input) input = FakeInputs(['invalid', '', ' ']) assert yes(default=True, input=input) assert yes(default=True, input=input) assert yes(default=True, input=input) input = FakeInputs([]) assert yes(default=True, input=input) assert not yes(default=False, input=input) with pytest.raises(ValueError): yes(default=None) def test_yes_retry(): input = FakeInputs(['foo', 'bar', TRUISH[0], ]) assert yes(retry_msg='Retry: ', input=input) input = FakeInputs(['foo', 'bar', FALSISH[0], ]) assert not yes(retry_msg='Retry: ', input=input) def test_yes_no_retry(): input = FakeInputs(['foo', 'bar', TRUISH[0], ]) assert not yes(retry=False, default=False, input=input) input = FakeInputs(['foo', 'bar', FALSISH[0], ]) assert yes(retry=False, default=True, input=input) def test_yes_output(capfd): input = FakeInputs(['invalid', 'y', 'n']) assert yes(msg='intro-msg', false_msg='false-msg', true_msg='true-msg', retry_msg='retry-msg', input=input) out, err = capfd.readouterr() assert out == '' assert 'intro-msg' in err assert 'retry-msg' in err assert 'true-msg' in err assert not yes(msg='intro-msg', false_msg='false-msg', true_msg='true-msg', retry_msg='retry-msg', input=input) out, err = capfd.readouterr() assert out == '' assert 'intro-msg' in err assert 'retry-msg' not in err assert 'false-msg' in err def test_yes_env_output(capfd, monkeypatch): env_var = 'OVERRIDE_SOMETHING' monkeypatch.setenv(env_var, 'yes') assert yes(env_var_override=env_var) out, err = capfd.readouterr() assert out == '' assert env_var in err assert 'yes' in err def test_progress_percentage_sameline(capfd, monkeypatch): # run the test as if it was in a 4x1 terminal monkeypatch.setenv('COLUMNS', '4') monkeypatch.setenv('LINES', '1') pi = ProgressIndicatorPercent(1000, step=5, start=0, msg="%3.0f%%") pi.logger.setLevel('INFO') pi.show(0) out, err = capfd.readouterr() assert err == ' 0%\r' pi.show(420) pi.show(680) out, err = capfd.readouterr() assert err == ' 42%\r 68%\r' pi.show(1000) out, err = capfd.readouterr() assert err == '100%\r' pi.finish() out, err = capfd.readouterr() assert err == ' ' * 4 + '\r' @pytest.mark.skipif(is_win32, reason='no working swidth() implementation on this platform') def test_progress_percentage_widechars(capfd, monkeypatch): st = 'スター・トレック' # 'startrek' :-) assert swidth(st) == 16 path = '/カーク船長です。' # 'Captain Kirk' assert swidth(path) == 17 spaces = ' ' * 4 # to avoid usage of '...' width = len('100%') + 1 + swidth(st) + 1 + swidth(path) + swidth(spaces) monkeypatch.setenv('COLUMNS', str(width)) monkeypatch.setenv('LINES', '1') pi = ProgressIndicatorPercent(100, step=5, start=0, msg=f'%3.0f%% {st} %s') pi.logger.setLevel('INFO') pi.show(0, info=[path]) out, err = capfd.readouterr() assert err == f' 0% {st} {path}{spaces}\r' pi.show(100, info=[path]) out, err = capfd.readouterr() assert err == f'100% {st} {path}{spaces}\r' pi.finish() out, err = capfd.readouterr() assert err == ' ' * width + '\r' def test_progress_percentage_step(capfd, monkeypatch): # run the test as if it was in a 4x1 terminal monkeypatch.setenv('COLUMNS', '4') monkeypatch.setenv('LINES', '1') pi = ProgressIndicatorPercent(100, step=2, start=0, msg="%3.0f%%") pi.logger.setLevel('INFO') pi.show() out, err = capfd.readouterr() assert err == ' 0%\r' pi.show() out, err = capfd.readouterr() assert err == '' # no output at 1% as we have step == 2 pi.show() out, err = capfd.readouterr() assert err == ' 2%\r' def test_progress_percentage_quiet(capfd): pi = ProgressIndicatorPercent(1000, step=5, start=0, msg="%3.0f%%") pi.logger.setLevel('WARN') pi.show(0) out, err = capfd.readouterr() assert err == '' pi.show(1000) out, err = capfd.readouterr() assert err == '' pi.finish() out, err = capfd.readouterr() assert err == '' def test_progress_endless(capfd): pi = ProgressIndicatorEndless(step=1, file=sys.stderr) pi.show() out, err = capfd.readouterr() assert err == '.' pi.show() out, err = capfd.readouterr() assert err == '.' pi.finish() out, err = capfd.readouterr() assert err == '\n' def test_progress_endless_step(capfd): pi = ProgressIndicatorEndless(step=2, file=sys.stderr) pi.show() out, err = capfd.readouterr() assert err == '' # no output here as we have step == 2 pi.show() out, err = capfd.readouterr() assert err == '.' pi.show() out, err = capfd.readouterr() assert err == '' # no output here as we have step == 2 pi.show() out, err = capfd.readouterr() assert err == '.' def test_partial_format(): assert partial_format('{space:10}', {'space': ' '}) == ' ' * 10 assert partial_format('{foobar}', {'bar': 'wrong', 'foobar': 'correct'}) == 'correct' assert partial_format('{unknown_key}', {}) == '{unknown_key}' assert partial_format('{key}{{escaped_key}}', {}) == '{key}{{escaped_key}}' assert partial_format('{{escaped_key}}', {'escaped_key': 1234}) == '{{escaped_key}}' def test_chunk_file_wrapper(): cfw = ChunkIteratorFileWrapper(iter([b'abc', b'def'])) assert cfw.read(2) == b'ab' assert cfw.read(50) == b'cdef' assert cfw.exhausted cfw = ChunkIteratorFileWrapper(iter([])) assert cfw.read(2) == b'' assert cfw.exhausted def test_chunkit(): it = chunkit('abcdefg', 3) assert next(it) == ['a', 'b', 'c'] assert next(it) == ['d', 'e', 'f'] assert next(it) == ['g'] with pytest.raises(StopIteration): next(it) with pytest.raises(StopIteration): next(it) it = chunkit('ab', 3) assert list(it) == [['a', 'b']] it = chunkit('', 3) assert list(it) == [] def test_clean_lines(): conf = """\ #comment data1 #data1 data2 data3 """.splitlines(keepends=True) assert list(clean_lines(conf)) == ['data1 #data1', 'data2', 'data3', ] assert list(clean_lines(conf, lstrip=False)) == ['data1 #data1', 'data2', ' data3', ] assert list(clean_lines(conf, rstrip=False)) == ['data1 #data1\n', 'data2\n', 'data3\n', ] assert list(clean_lines(conf, remove_empty=False)) == ['data1 #data1', 'data2', '', 'data3', ] assert list(clean_lines(conf, remove_comments=False)) == ['#comment', 'data1 #data1', 'data2', 'data3', ] def test_format_line(): data = dict(foo='bar baz') assert format_line('', data) == '' assert format_line('{foo}', data) == 'bar baz' assert format_line('foo{foo}foo', data) == 'foobar bazfoo' def test_format_line_erroneous(): data = dict() with pytest.raises(PlaceholderError): assert format_line('{invalid}', data) with pytest.raises(PlaceholderError): assert format_line('{}', data) with pytest.raises(PlaceholderError): assert format_line('{now!r}', data) with pytest.raises(PlaceholderError): assert format_line('{now.__class__.__module__.__builtins__}', data) def test_replace_placeholders(): now = datetime.now() assert " " not in replace_placeholders('{now}') assert int(replace_placeholders('{now:%Y}')) == now.year def test_override_placeholders(): assert replace_placeholders('{uuid4}', overrides={'uuid4': "overridden"}) == "overridden" def working_swidth(): return platform.swidth('선') == 2 @pytest.mark.skipif(not working_swidth(), reason='swidth() is not supported / active') def test_swidth_slice(): string = '나윤선나윤선나윤선나윤선나윤선' assert swidth_slice(string, 1) == '' assert swidth_slice(string, -1) == '' assert swidth_slice(string, 4) == '나윤' assert swidth_slice(string, -4) == '윤선' @pytest.mark.skipif(not working_swidth(), reason='swidth() is not supported / active') def test_swidth_slice_mixed_characters(): string = '나윤a선나윤선나윤선나윤선나윤선' assert swidth_slice(string, 5) == '나윤a' assert swidth_slice(string, 6) == '나윤a' def utcfromtimestamp(timestamp): """Returns a naive datetime instance representing the timestamp in the UTC timezone""" return datetime.fromtimestamp(timestamp, timezone.utc).replace(tzinfo=None) def test_safe_timestamps(): if SUPPORT_32BIT_PLATFORMS: # ns fit into int64 assert safe_ns(2 ** 64) <= 2 ** 63 - 1 assert safe_ns(-1) == 0 # s fit into int32 assert safe_s(2 ** 64) <= 2 ** 31 - 1 assert safe_s(-1) == 0 # datetime won't fall over its y10k problem beyond_y10k = 2 ** 100 with pytest.raises(OverflowError): utcfromtimestamp(beyond_y10k) assert utcfromtimestamp(safe_s(beyond_y10k)) > datetime(2038, 1, 1) assert utcfromtimestamp(safe_ns(beyond_y10k) / 1000000000) > datetime(2038, 1, 1) else: # ns fit into int64 assert safe_ns(2 ** 64) <= 2 ** 63 - 1 assert safe_ns(-1) == 0 # s are so that their ns conversion fits into int64 assert safe_s(2 ** 64) * 1000000000 <= 2 ** 63 - 1 assert safe_s(-1) == 0 # datetime won't fall over its y10k problem beyond_y10k = 2 ** 100 with pytest.raises(OverflowError): utcfromtimestamp(beyond_y10k) assert utcfromtimestamp(safe_s(beyond_y10k)) > datetime(2262, 1, 1) assert utcfromtimestamp(safe_ns(beyond_y10k) / 1000000000) > datetime(2262, 1, 1) class TestPopenWithErrorHandling: @pytest.mark.skipif(not shutil.which('test'), reason='"test" binary is needed') def test_simple(self): proc = popen_with_error_handling('test 1') assert proc.wait() == 0 @pytest.mark.skipif(shutil.which('borg-foobar-test-notexist'), reason='"borg-foobar-test-notexist" binary exists (somehow?)') def test_not_found(self): proc = popen_with_error_handling('borg-foobar-test-notexist 1234') assert proc is None @pytest.mark.parametrize('cmd', ( 'mismatched "quote', 'foo --bar="baz', '' )) def test_bad_syntax(self, cmd): proc = popen_with_error_handling(cmd) assert proc is None def test_shell(self): with pytest.raises(AssertionError): popen_with_error_handling('', shell=True) def test_dash_open(): assert dash_open('-', 'r') is sys.stdin assert dash_open('-', 'w') is sys.stdout assert dash_open('-', 'rb') is sys.stdin.buffer assert dash_open('-', 'wb') is sys.stdout.buffer def test_iter_separated(): # newline and utf-8 sep, items = '\n', ['foo', 'bar/baz', 'αáčő'] fd = StringIO(sep.join(items)) assert list(iter_separated(fd)) == items # null and bogus ending sep, items = '\0', ['foo/bar', 'baz', 'spam'] fd = StringIO(sep.join(items) + '\0') assert list(iter_separated(fd, sep=sep)) == ['foo/bar', 'baz', 'spam'] # multichar sep, items = 'SEP', ['foo/bar', 'baz', 'spam'] fd = StringIO(sep.join(items)) assert list(iter_separated(fd, sep=sep)) == items # bytes sep, items = b'\n', [b'foo', b'blop\t', b'gr\xe4ezi'] fd = BytesIO(sep.join(items)) assert list(iter_separated(fd)) == items def test_eval_escapes(): assert eval_escapes('\\n\\0\\x23') == '\n\0#' assert eval_escapes('äç\\n') == 'äç\n' @pytest.mark.parametrize('ec_range,ec_class', ( # inclusive range start, exclusive range end ((0, 1), "success"), ((1, 2), "warning"), ((2, 3), "error"), ((EXIT_ERROR_BASE, EXIT_WARNING_BASE), "error"), ((EXIT_WARNING_BASE, EXIT_SIGNAL_BASE), "warning"), ((EXIT_SIGNAL_BASE, 256), "signal"), )) def test_classify_ec(ec_range, ec_class): for ec in range(*ec_range): classify_ec(ec) == ec_class def test_ec_invalid(): with pytest.raises(ValueError): classify_ec(666) with pytest.raises(ValueError): classify_ec(-1) with pytest.raises(TypeError): classify_ec(None) @pytest.mark.parametrize('ec1,ec2,ec_max', ( # same for modern / legacy (EXIT_SUCCESS, EXIT_SUCCESS, EXIT_SUCCESS), (EXIT_SUCCESS, EXIT_SIGNAL_BASE, EXIT_SIGNAL_BASE), # legacy exit codes (EXIT_SUCCESS, EXIT_WARNING, EXIT_WARNING), (EXIT_SUCCESS, EXIT_ERROR, EXIT_ERROR), (EXIT_WARNING, EXIT_SUCCESS, EXIT_WARNING), (EXIT_WARNING, EXIT_WARNING, EXIT_WARNING), (EXIT_WARNING, EXIT_ERROR, EXIT_ERROR), (EXIT_WARNING, EXIT_SIGNAL_BASE, EXIT_SIGNAL_BASE), (EXIT_ERROR, EXIT_SUCCESS, EXIT_ERROR), (EXIT_ERROR, EXIT_WARNING, EXIT_ERROR), (EXIT_ERROR, EXIT_ERROR, EXIT_ERROR), (EXIT_ERROR, EXIT_SIGNAL_BASE, EXIT_SIGNAL_BASE), # some modern codes (EXIT_SUCCESS, EXIT_WARNING_BASE, EXIT_WARNING_BASE), (EXIT_SUCCESS, EXIT_ERROR_BASE, EXIT_ERROR_BASE), (EXIT_WARNING_BASE, EXIT_SUCCESS, EXIT_WARNING_BASE), (EXIT_WARNING_BASE+1, EXIT_WARNING_BASE+2, EXIT_WARNING_BASE+1), (EXIT_WARNING_BASE, EXIT_ERROR_BASE, EXIT_ERROR_BASE), (EXIT_WARNING_BASE, EXIT_SIGNAL_BASE, EXIT_SIGNAL_BASE), (EXIT_ERROR_BASE, EXIT_SUCCESS, EXIT_ERROR_BASE), (EXIT_ERROR_BASE, EXIT_WARNING_BASE, EXIT_ERROR_BASE), (EXIT_ERROR_BASE+1, EXIT_ERROR_BASE+2, EXIT_ERROR_BASE+1), (EXIT_ERROR_BASE, EXIT_SIGNAL_BASE, EXIT_SIGNAL_BASE), )) def test_max_ec(ec1, ec2, ec_max): assert max_ec(ec1, ec2) == ec_max ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/testsuite/item.py0000644000076500000240000001075714641074756017321 0ustar00twstaffimport pytest from ..cache import ChunkListEntry from ..item import Item from ..helpers import StableDict def test_item_empty(): item = Item() assert item.as_dict() == {} assert 'path' not in item with pytest.raises(ValueError): 'invalid-key' in item with pytest.raises(TypeError): b'path' in item with pytest.raises(TypeError): 42 in item assert item.get('mode') is None assert item.get('mode', 0o666) == 0o666 with pytest.raises(ValueError): item.get('invalid-key') with pytest.raises(TypeError): item.get(b'mode') with pytest.raises(TypeError): item.get(42) with pytest.raises(AttributeError): item.path with pytest.raises(AttributeError): del item.path def test_item_from_dict(): # does not matter whether we get str or bytes keys item = Item({b'path': '/a/b/c', b'mode': 0o666}) assert item.path == '/a/b/c' assert item.mode == 0o666 assert 'path' in item # does not matter whether we get str or bytes keys item = Item({'path': '/a/b/c', 'mode': 0o666}) assert item.path == '/a/b/c' assert item.mode == 0o666 assert 'mode' in item # invalid - no dict with pytest.raises(TypeError): Item(42) # invalid - no bytes/str key with pytest.raises(TypeError): Item({42: 23}) # invalid - unknown key with pytest.raises(ValueError): Item({'foobar': 'baz'}) def test_item_from_kw(): item = Item(path='/a/b/c', mode=0o666) assert item.path == '/a/b/c' assert item.mode == 0o666 def test_item_int_property(): item = Item() item.mode = 0o666 assert item.mode == 0o666 assert item.as_dict() == {'mode': 0o666} del item.mode assert item.as_dict() == {} with pytest.raises(TypeError): item.mode = "invalid" def test_item_bigint_property(): item = Item() small, big = 42, 2 ** 65 item.atime = small assert item.atime == small assert item.as_dict() == {'atime': small} item.atime = big assert item.atime == big assert item.as_dict() == {'atime': b'\0' * 8 + b'\x02'} def test_item_user_group_none(): item = Item() item.user = None assert item.user is None item.group = None assert item.group is None def test_item_se_str_property(): # start simple item = Item() item.path = '/a/b/c' assert item.path == '/a/b/c' assert item.as_dict() == {'path': b'/a/b/c'} del item.path assert item.as_dict() == {} with pytest.raises(TypeError): item.path = 42 # non-utf-8 path, needing surrogate-escaping for latin-1 u-umlaut item = Item(internal_dict={'path': b'/a/\xfc/c'}) assert item.path == '/a/\udcfc/c' # getting a surrogate-escaped representation assert item.as_dict() == {'path': b'/a/\xfc/c'} del item.path assert 'path' not in item item.path = '/a/\udcfc/c' # setting using a surrogate-escaped representation assert item.as_dict() == {'path': b'/a/\xfc/c'} def test_item_list_property(): item = Item() item.chunks = [] assert item.chunks == [] item.chunks.append(0) assert item.chunks == [0] item.chunks.append(1) assert item.chunks == [0, 1] assert item.as_dict() == {'chunks': [0, 1]} def test_item_dict_property(): item = Item() item.xattrs = StableDict() assert item.xattrs == StableDict() item.xattrs['foo'] = 'bar' assert item.xattrs['foo'] == 'bar' item.xattrs['bar'] = 'baz' assert item.xattrs == StableDict({'foo': 'bar', 'bar': 'baz'}) assert item.as_dict() == {'xattrs': {'foo': 'bar', 'bar': 'baz'}} def test_unknown_property(): # we do not want the user to be able to set unknown attributes - # they won't get into the .as_dict() result dictionary. # also they might be just typos of known attributes. item = Item() with pytest.raises(AttributeError): item.unknown_attribute = None def test_item_file_size(): item = Item(mode=0o100666, chunks=[ ChunkListEntry(csize=1, size=1000, id=None), ChunkListEntry(csize=1, size=2000, id=None), ]) assert item.get_size() == 3000 with pytest.raises(AssertionError): item.get_size(compressed=True, memorize=True) assert item.get_size(compressed=True) == 2 item.get_size(memorize=True) assert item.size == 3000 def test_item_file_size_no_chunks(): item = Item(mode=0o100666) assert item.get_size() == 0 def test_item_optr(): item = Item() assert Item.from_optr(item.to_optr()) is item ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/testsuite/key.py0000644000076500000240000004734714641074756017160 0ustar00twstaffimport getpass import os.path import re import tempfile import pytest from ..crypto.key import Passphrase, PasswordRetriesExceeded from ..crypto.key import PlaintextKey, PassphraseKey, AuthenticatedKey, RepoKey, KeyfileKey, \ Blake2KeyfileKey, Blake2RepoKey, Blake2AuthenticatedKey from ..crypto.key import ID_HMAC_SHA_256, ID_BLAKE2b_256 from ..crypto.key import TAMRequiredError, TAMInvalid, TAMUnsupportedSuiteError, UnsupportedManifestError from ..crypto.key import ArchiveTAMInvalid from ..crypto.key import identify_key from ..crypto.low_level import bytes_to_long from ..crypto.low_level import IntegrityError as IntegrityErrorBase from ..helpers import IntegrityError from ..helpers import Location from ..helpers import StableDict from ..helpers import get_security_dir from ..helpers import msgpack from ..helpers import hex_to_bin, bin_to_hex class TestKey: class MockArgs: location = Location(tempfile.mkstemp()[1]) keyfile2_key_file = """ BORG_KEY 0000000000000000000000000000000000000000000000000000000000000000 hqppdGVyYXRpb25zzgABhqCkaGFzaNoAIMyonNI+7Cjv0qHi0AOBM6bLGxACJhfgzVD2oq bIS9SFqWFsZ29yaXRobaZzaGEyNTakc2FsdNoAINNK5qqJc1JWSUjACwFEWGTdM7Nd0a5l 1uBGPEb+9XM9p3ZlcnNpb24BpGRhdGHaANAYDT5yfPpU099oBJwMomsxouKyx/OG4QIXK2 hQCG2L2L/9PUu4WIuKvGrsXoP7syemujNfcZws5jLp2UPva4PkQhQsrF1RYDEMLh2eF9Ol rwtkThq1tnh7KjWMG9Ijt7/aoQtq0zDYP/xaFF8XXSJxiyP5zjH5+spB6RL0oQHvbsliSh /cXJq7jrqmrJ1phd6dg4SHAM/i+hubadZoS6m25OQzYAW09wZD/phG8OVa698Z5ed3HTaT SmrtgJL3EoOKgUI9d6BLE4dJdBqntifo""".strip() keyfile2_cdata = hex_to_bin(re.sub(r'\W', '', """ 0055f161493fcfc16276e8c31493c4641e1eb19a79d0326fad0291e5a9c98e5933 00000000000003e8d21eaf9b86c297a8cd56432e1915bb """)) keyfile2_id = hex_to_bin('c3fbf14bc001ebcc3cd86e696c13482ed071740927cd7cbe1b01b4bfcee49314') keyfile_blake2_key_file = """ BORG_KEY 0000000000000000000000000000000000000000000000000000000000000000 hqlhbGdvcml0aG2mc2hhMjU2pGRhdGHaAZBu680Do3CmfWzeMCwe48KJi3Vps9mEDy7MKF TastsEhiAd1RQMuxfZpklkLeddMMWk+aPtFiURRFb02JLXV5cKRC1o2ZDdiNa0nao+o6+i gUjjsea9TAu25t3vxh8uQWs5BuKRLBRr0nUgrSd0IYMUgn+iVbLJRzCCssvxsklkwQxN3F Y+MvBnn8kUXSeoSoQ2l0fBHzq94Y7LMOm/owMam5URnE8/UEc6ZXBrbyX4EXxDtUqJcs+D i451thtlGdigDLpvf9nyK66mjiCpPCTCgtlzq0Pe1jcdhnsUYLg+qWzXZ7e2opEZoC6XxS 3DIuBOxG3Odqj9IKB+6/kl94vz98awPWFSpYcLZVWu7sIP38ZkUK+ad5MHTo/LvTuZdFnd iqKzZIDUJl3Zl1WGmP/0xVOmfIlznkCZy4d3SMuujwIcqQ5kDvwDRPpdhBBk+UWQY5vFXk kR1NBNLSTyhAzu3fiUmFl0qZ+UWPRkGAEBy/NuoEibrWwab8BX97cATyvnmOqYkU9PT0C6 l2l9E4bPpGhhc2jaACDnIa8KgKv84/b5sjaMgSZeIVkuKSLJy2NN8zoH8lnd36ppdGVyYX Rpb25zzgABhqCkc2FsdNoAIEJLlLh7q74j3q53856H5GgzA1HH+aW5bA/as544+PGkp3Zl cnNpb24B""".strip() keyfile_blake2_cdata = bytes.fromhex('04fdf9475cf2323c0ba7a99ddc011064f2e7d039f539f2e448' '0e6f5fc6ff9993d604040404040404098c8cee1c6db8c28947') # Verified against b2sum. Entire string passed to BLAKE2, including the padded 64 byte key contained in # keyfile_blake2_key_file above is # 19280471de95185ec27ecb6fc9edbb4f4db26974c315ede1cd505fab4250ce7cd0d081ea66946c # 95f0db934d5f616921efbd869257e8ded2bd9bd93d7f07b1a30000000000000000000000000000 # 000000000000000000000000000000000000000000000000000000000000000000000000000000 # 00000000000000000000007061796c6f6164 # p a y l o a d keyfile_blake2_id = bytes.fromhex('d8bc68e961c79f99be39061589e5179b2113cd9226e07b08ddd4a1fef7ce93fb') @pytest.fixture def keys_dir(self, request, monkeypatch, tmpdir): monkeypatch.setenv('BORG_KEYS_DIR', str(tmpdir)) return tmpdir @pytest.fixture(params=( PlaintextKey, AuthenticatedKey, KeyfileKey, RepoKey, AuthenticatedKey, Blake2KeyfileKey, Blake2RepoKey, Blake2AuthenticatedKey, )) def key(self, request, monkeypatch): monkeypatch.setenv('BORG_PASSPHRASE', 'test') return request.param.create(self.MockRepository(), self.MockArgs()) class MockRepository: class _Location: raw = processed = '/some/place' def canonical_path(self): return self.processed _location = _Location() id = bytes(32) id_str = bin_to_hex(id) def get_free_nonce(self): return None def commit_nonce_reservation(self, next_unreserved, start_nonce): pass def save_key(self, data): self.key_data = data def load_key(self): return self.key_data def test_plaintext(self): key = PlaintextKey.create(None, None) chunk = b'foo' assert bin_to_hex(key.id_hash(chunk)) == '2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae' assert chunk == key.decrypt(key.id_hash(chunk), key.encrypt(chunk)) def test_keyfile(self, monkeypatch, keys_dir): monkeypatch.setenv('BORG_PASSPHRASE', 'test') key = KeyfileKey.create(self.MockRepository(), self.MockArgs()) assert key.cipher.next_iv() == 0 manifest = key.encrypt(b'ABC') assert key.cipher.extract_iv(manifest) == 0 manifest2 = key.encrypt(b'ABC') assert manifest != manifest2 assert key.decrypt(None, manifest) == key.decrypt(None, manifest2) assert key.cipher.extract_iv(manifest2) == 1 iv = key.cipher.extract_iv(manifest) key2 = KeyfileKey.detect(self.MockRepository(), manifest) assert key2.cipher.next_iv() >= iv + key2.cipher.block_count(len(manifest) - KeyfileKey.PAYLOAD_OVERHEAD) # Key data sanity check assert len({key2.id_key, key2.enc_key, key2.enc_hmac_key}) == 3 assert key2.chunk_seed != 0 chunk = b'foo' assert chunk == key2.decrypt(key.id_hash(chunk), key.encrypt(chunk)) def test_keyfile_nonce_rollback_protection(self, monkeypatch, keys_dir): monkeypatch.setenv('BORG_PASSPHRASE', 'test') repository = self.MockRepository() with open(os.path.join(get_security_dir(repository.id_str), 'nonce'), "w") as fd: fd.write("0000000000002000") key = KeyfileKey.create(repository, self.MockArgs()) data = key.encrypt(b'ABC') assert key.cipher.extract_iv(data) == 0x2000 assert key.decrypt(None, data) == b'ABC' def test_keyfile_kfenv(self, tmpdir, monkeypatch): keyfile = tmpdir.join('keyfile') monkeypatch.setenv('BORG_KEY_FILE', str(keyfile)) monkeypatch.setenv('BORG_PASSPHRASE', 'testkf') assert not keyfile.exists() key = KeyfileKey.create(self.MockRepository(), self.MockArgs()) assert keyfile.exists() chunk = b'ABC' chunk_id = key.id_hash(chunk) chunk_cdata = key.encrypt(chunk) key = KeyfileKey.detect(self.MockRepository(), chunk_cdata) assert chunk == key.decrypt(chunk_id, chunk_cdata) keyfile.remove() with pytest.raises(FileNotFoundError): KeyfileKey.detect(self.MockRepository(), chunk_cdata) def test_keyfile2(self, monkeypatch, keys_dir): with keys_dir.join('keyfile').open('w') as fd: fd.write(self.keyfile2_key_file) monkeypatch.setenv('BORG_PASSPHRASE', 'passphrase') key = KeyfileKey.detect(self.MockRepository(), self.keyfile2_cdata) assert key.decrypt(self.keyfile2_id, self.keyfile2_cdata) == b'payload' def test_keyfile2_kfenv(self, tmpdir, monkeypatch): keyfile = tmpdir.join('keyfile') with keyfile.open('w') as fd: fd.write(self.keyfile2_key_file) monkeypatch.setenv('BORG_KEY_FILE', str(keyfile)) monkeypatch.setenv('BORG_PASSPHRASE', 'passphrase') key = KeyfileKey.detect(self.MockRepository(), self.keyfile2_cdata) assert key.decrypt(self.keyfile2_id, self.keyfile2_cdata) == b'payload' def test_keyfile_blake2(self, monkeypatch, keys_dir): with keys_dir.join('keyfile').open('w') as fd: fd.write(self.keyfile_blake2_key_file) monkeypatch.setenv('BORG_PASSPHRASE', 'passphrase') key = Blake2KeyfileKey.detect(self.MockRepository(), self.keyfile_blake2_cdata) assert key.decrypt(self.keyfile_blake2_id, self.keyfile_blake2_cdata) == b'payload' def test_passphrase(self, keys_dir, monkeypatch): monkeypatch.setenv('BORG_PASSPHRASE', 'test') key = PassphraseKey.create(self.MockRepository(), None) assert key.cipher.next_iv() == 0 assert bin_to_hex(key.id_key) == '793b0717f9d8fb01c751a487e9b827897ceea62409870600013fbc6b4d8d7ca6' assert bin_to_hex(key.enc_hmac_key) == 'b885a05d329a086627412a6142aaeb9f6c54ab7950f996dd65587251f6bc0901' assert bin_to_hex(key.enc_key) == '2ff3654c6daf7381dbbe718d2b20b4f1ea1e34caa6cc65f6bb3ac376b93fed2a' assert key.chunk_seed == -775740477 manifest = key.encrypt(b'ABC') assert key.cipher.extract_iv(manifest) == 0 manifest2 = key.encrypt(b'ABC') assert manifest != manifest2 assert key.decrypt(None, manifest) == key.decrypt(None, manifest2) assert key.cipher.extract_iv(manifest2) == 1 iv = key.cipher.extract_iv(manifest) key2 = PassphraseKey.detect(self.MockRepository(), manifest) assert key2.cipher.next_iv() == iv + key2.cipher.block_count(len(manifest)) assert key.id_key == key2.id_key assert key.enc_hmac_key == key2.enc_hmac_key assert key.enc_key == key2.enc_key assert key.chunk_seed == key2.chunk_seed chunk = b'foo' assert bin_to_hex(key.id_hash(chunk)) == '818217cf07d37efad3860766dcdf1d21e401650fed2d76ed1d797d3aae925990' assert chunk == key2.decrypt(key2.id_hash(chunk), key.encrypt(chunk)) def _corrupt_byte(self, key, data, offset): data = bytearray(data) data[offset] ^= 1 with pytest.raises(IntegrityErrorBase): key.decrypt(b'', data) def test_decrypt_integrity(self, monkeypatch, keys_dir): with keys_dir.join('keyfile').open('w') as fd: fd.write(self.keyfile2_key_file) monkeypatch.setenv('BORG_PASSPHRASE', 'passphrase') key = KeyfileKey.detect(self.MockRepository(), self.keyfile2_cdata) data = self.keyfile2_cdata for i in range(len(data)): self._corrupt_byte(key, data, i) with pytest.raises(IntegrityError): data = bytearray(self.keyfile2_cdata) id = bytearray(key.id_hash(data)) # corrupt chunk id id[12] = 0 key.decrypt(id, data) def test_roundtrip(self, key): repository = key.repository plaintext = b'foo' encrypted = key.encrypt(plaintext) identified_key_class = identify_key(encrypted) assert identified_key_class == key.__class__ loaded_key = identified_key_class.detect(repository, encrypted) decrypted = loaded_key.decrypt(None, encrypted) assert decrypted == plaintext def test_decrypt_decompress(self, key): plaintext = b'123456789' encrypted = key.encrypt(plaintext) assert key.decrypt(None, encrypted, decompress=False) != plaintext assert key.decrypt(None, encrypted) == plaintext def test_assert_id(self, key): plaintext = b'123456789' id = key.id_hash(plaintext) key.assert_id(id, plaintext) id_changed = bytearray(id) id_changed[0] ^= 1 with pytest.raises(IntegrityError): key.assert_id(id_changed, plaintext) plaintext_changed = plaintext + b'1' with pytest.raises(IntegrityError): key.assert_id(id, plaintext_changed) def test_authenticated_encrypt(self, monkeypatch): monkeypatch.setenv('BORG_PASSPHRASE', 'test') key = AuthenticatedKey.create(self.MockRepository(), self.MockArgs()) assert AuthenticatedKey.id_hash is ID_HMAC_SHA_256.id_hash assert len(key.id_key) == 32 plaintext = b'123456789' authenticated = key.encrypt(plaintext) # 0x07 is the key TYPE, \x0000 identifies no compression. assert authenticated == b'\x07\x00\x00' + plaintext def test_blake2_authenticated_encrypt(self, monkeypatch): monkeypatch.setenv('BORG_PASSPHRASE', 'test') key = Blake2AuthenticatedKey.create(self.MockRepository(), self.MockArgs()) assert Blake2AuthenticatedKey.id_hash is ID_BLAKE2b_256.id_hash assert len(key.id_key) == 128 plaintext = b'123456789' authenticated = key.encrypt(plaintext) # 0x06 is the key TYPE, 0x0000 identifies no compression. assert authenticated == b'\x06\x00\x00' + plaintext class TestPassphrase: def test_passphrase_new_verification(self, capsys, monkeypatch): monkeypatch.setattr(getpass, 'getpass', lambda prompt: "12aöäü") monkeypatch.setenv('BORG_DISPLAY_PASSPHRASE', 'no') Passphrase.new() out, err = capsys.readouterr() assert "12" not in out assert "12" not in err monkeypatch.setenv('BORG_DISPLAY_PASSPHRASE', 'yes') passphrase = Passphrase.new() out, err = capsys.readouterr() assert "313261c3b6c3a4c3bc" not in out assert "313261c3b6c3a4c3bc" in err assert passphrase == "12aöäü" monkeypatch.setattr(getpass, 'getpass', lambda prompt: "1234/@=") Passphrase.new() out, err = capsys.readouterr() assert "1234/@=" not in out assert "1234/@=" in err def test_passphrase_new_empty(self, capsys, monkeypatch): monkeypatch.delenv('BORG_PASSPHRASE', False) monkeypatch.setattr(getpass, 'getpass', lambda prompt: "") with pytest.raises(PasswordRetriesExceeded): Passphrase.new(allow_empty=False) out, err = capsys.readouterr() assert "must not be blank" in err def test_passphrase_new_retries(self, monkeypatch): monkeypatch.delenv('BORG_PASSPHRASE', False) ascending_numbers = iter(range(20)) monkeypatch.setattr(getpass, 'getpass', lambda prompt: str(next(ascending_numbers))) with pytest.raises(PasswordRetriesExceeded): Passphrase.new() def test_passphrase_repr(self): assert "secret" not in repr(Passphrase("secret")) class TestTAM: @pytest.fixture def key(self, monkeypatch): monkeypatch.setenv('BORG_PASSPHRASE', 'test') return KeyfileKey.create(TestKey.MockRepository(), TestKey.MockArgs()) def test_unpack_future(self, key): blob = b'\xc1\xc1\xc1\xc1foobar' with pytest.raises(UnsupportedManifestError): key.unpack_and_verify_manifest(blob) blob = b'\xc1\xc1\xc1' with pytest.raises(msgpack.UnpackException): key.unpack_and_verify_manifest(blob) def test_missing_when_required(self, key): blob = msgpack.packb({}) with pytest.raises(TAMRequiredError): key.unpack_and_verify_manifest(blob) with pytest.raises(TAMRequiredError): key.unpack_and_verify_archive(blob) def test_missing(self, key): blob = msgpack.packb({}) key.tam_required = False unpacked, verified = key.unpack_and_verify_manifest(blob) assert unpacked == {} assert not verified unpacked, verified, _ = key.unpack_and_verify_archive(blob) assert unpacked == {} assert not verified def test_unknown_type_when_required(self, key): blob = msgpack.packb({ 'tam': { 'type': 'HMAC_VOLLBIT', }, }) with pytest.raises(TAMUnsupportedSuiteError): key.unpack_and_verify_manifest(blob) with pytest.raises(TAMUnsupportedSuiteError): key.unpack_and_verify_archive(blob) def test_unknown_type(self, key): blob = msgpack.packb({ 'tam': { 'type': 'HMAC_VOLLBIT', }, }) key.tam_required = False unpacked, verified = key.unpack_and_verify_manifest(blob) assert unpacked == {} assert not verified unpacked, verified, _ = key.unpack_and_verify_archive(blob) assert unpacked == {} assert not verified @pytest.mark.parametrize('tam, exc', ( ({}, TAMUnsupportedSuiteError), ({'type': b'\xff'}, TAMUnsupportedSuiteError), (None, TAMInvalid), (1234, TAMInvalid), )) def test_invalid_manifest(self, key, tam, exc): blob = msgpack.packb({ 'tam': tam, }) with pytest.raises(exc): key.unpack_and_verify_manifest(blob) @pytest.mark.parametrize('tam, exc', ( ({}, TAMUnsupportedSuiteError), ({'type': b'\xff'}, TAMUnsupportedSuiteError), (None, ArchiveTAMInvalid), (1234, ArchiveTAMInvalid), )) def test_invalid_archive(self, key, tam, exc): blob = msgpack.packb({ 'tam': tam, }) with pytest.raises(exc): key.unpack_and_verify_archive(blob) @pytest.mark.parametrize('hmac, salt', ( ({}, bytes(64)), (bytes(64), {}), (None, bytes(64)), (bytes(64), None), ), ids=["ed-b64", "b64-ed", "n-b64", "b64-n"]) def test_wrong_types(self, key, hmac, salt): data = { 'tam': { 'type': 'HKDF_HMAC_SHA512', 'hmac': hmac, 'salt': salt }, } tam = data['tam'] if hmac is None: del tam['hmac'] if salt is None: del tam['salt'] blob = msgpack.packb(data) with pytest.raises(TAMInvalid): key.unpack_and_verify_manifest(blob) with pytest.raises(ArchiveTAMInvalid): key.unpack_and_verify_archive(blob) def test_round_trip_manifest(self, key): data = {'foo': 'bar'} blob = key.pack_and_authenticate_metadata(data, context=b"manifest") assert blob.startswith(b'\x82') unpacked = msgpack.unpackb(blob) assert unpacked[b'tam'][b'type'] == b'HKDF_HMAC_SHA512' unpacked, verified = key.unpack_and_verify_manifest(blob) assert verified assert unpacked[b'foo'] == b'bar' assert b'tam' not in unpacked def test_round_trip_archive(self, key): data = {'foo': 'bar'} blob = key.pack_and_authenticate_metadata(data, context=b"archive") assert blob.startswith(b'\x82') unpacked = msgpack.unpackb(blob) assert unpacked[b'tam'][b'type'] == b'HKDF_HMAC_SHA512' unpacked, verified, _ = key.unpack_and_verify_archive(blob) assert verified assert unpacked[b'foo'] == b'bar' assert b'tam' not in unpacked @pytest.mark.parametrize('which', (b'hmac', b'salt')) def test_tampered_manifest(self, key, which): data = {'foo': 'bar'} blob = key.pack_and_authenticate_metadata(data, context=b"manifest") assert blob.startswith(b'\x82') unpacked = msgpack.unpackb(blob, object_hook=StableDict) assert len(unpacked[b'tam'][which]) == 64 unpacked[b'tam'][which] = unpacked[b'tam'][which][0:32] + bytes(32) assert len(unpacked[b'tam'][which]) == 64 blob = msgpack.packb(unpacked) with pytest.raises(TAMInvalid): key.unpack_and_verify_manifest(blob) @pytest.mark.parametrize('which', (b'hmac', b'salt')) def test_tampered_archive(self, key, which): data = {'foo': 'bar'} blob = key.pack_and_authenticate_metadata(data, context=b"archive") assert blob.startswith(b'\x82') unpacked = msgpack.unpackb(blob, object_hook=StableDict) assert len(unpacked[b'tam'][which]) == 64 unpacked[b'tam'][which] = unpacked[b'tam'][which][0:32] + bytes(32) assert len(unpacked[b'tam'][which]) == 64 blob = msgpack.packb(unpacked) with pytest.raises(ArchiveTAMInvalid): key.unpack_and_verify_archive(blob) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/testsuite/locking.py0000644000076500000240000003262714641074756020011 0ustar00twstaffimport random import time from threading import Thread, Lock as ThreadingLock from traceback import format_exc import pytest from ..helpers import daemonize from ..platform import get_process_id, process_alive from ..locking import TimeoutTimer, ExclusiveLock, Lock, LockRoster, \ ADD, REMOVE, SHARED, EXCLUSIVE, LockTimeout, NotLocked, NotMyLock ID1 = "foo", 1, 1 ID2 = "bar", 2, 2 RACE_TEST_NUM_THREADS = 40 RACE_TEST_DURATION = 0.4 # seconds @pytest.fixture() def free_pid(): """Return a free PID not used by any process (naturally this is racy)""" host, pid, tid = get_process_id() while True: # PIDs are often restricted to a small range. On Linux the range >32k is by default not used. pid = random.randint(33000, 65000) if not process_alive(host, pid, tid): return pid class TestTimeoutTimer: def test_timeout(self): timeout = 0.5 t = TimeoutTimer(timeout).start() assert not t.timed_out() time.sleep(timeout * 1.5) assert t.timed_out() def test_notimeout_sleep(self): timeout, sleep = None, 0.5 t = TimeoutTimer(timeout, sleep).start() assert not t.timed_out_or_sleep() assert time.time() >= t.start_time + 1 * sleep assert not t.timed_out_or_sleep() assert time.time() >= t.start_time + 2 * sleep @pytest.fixture() def lockpath(tmpdir): return str(tmpdir.join('lock')) class TestExclusiveLock: def test_checks(self, lockpath): with ExclusiveLock(lockpath, timeout=1) as lock: assert lock.is_locked() and lock.by_me() def test_acquire_break_reacquire(self, lockpath): lock = ExclusiveLock(lockpath, id=ID1).acquire() lock.break_lock() with ExclusiveLock(lockpath, id=ID2): pass def test_timeout(self, lockpath): with ExclusiveLock(lockpath, id=ID1): with pytest.raises(LockTimeout): ExclusiveLock(lockpath, id=ID2, timeout=0.1).acquire() def test_kill_stale(self, lockpath, free_pid): host, pid, tid = our_id = get_process_id() dead_id = host, free_pid, tid cant_know_if_dead_id = 'foo.bar.example.net', 1, 2 dead_lock = ExclusiveLock(lockpath, id=dead_id).acquire() with ExclusiveLock(lockpath, id=our_id): with pytest.raises(NotMyLock): dead_lock.release() with pytest.raises(NotLocked): dead_lock.release() with ExclusiveLock(lockpath, id=cant_know_if_dead_id): with pytest.raises(LockTimeout): ExclusiveLock(lockpath, id=our_id, timeout=0.1).acquire() def test_migrate_lock(self, lockpath): old_id, new_id = ID1, ID2 assert old_id[1] != new_id[1] # different PIDs (like when doing daemonize()) lock = ExclusiveLock(lockpath, id=old_id).acquire() assert lock.id == old_id # lock is for old id / PID old_unique_name = lock.unique_name assert lock.by_me() # we have the lock lock.migrate_lock(old_id, new_id) # fix the lock assert lock.id == new_id # lock corresponds to the new id / PID new_unique_name = lock.unique_name assert lock.by_me() # we still have the lock assert old_unique_name != new_unique_name # locking filename is different now def test_race_condition(self, lockpath): class SynchronizedCounter: def __init__(self, count=0): self.lock = ThreadingLock() self.count = count self.maxcount = count def value(self): with self.lock: return self.count def maxvalue(self): with self.lock: return self.maxcount def incr(self): with self.lock: self.count += 1 if self.count > self.maxcount: self.maxcount = self.count return self.count def decr(self): with self.lock: self.count -= 1 return self.count def print_locked(msg): with print_lock: print(msg) def acquire_release_loop(id, timeout, thread_id, lock_owner_counter, exception_counter, print_lock, last_thread=None): print_locked("Thread %2d: Starting acquire_release_loop(id=%s, timeout=%d); lockpath=%s" % (thread_id, id, timeout, lockpath)) timer = TimeoutTimer(timeout, -1).start() cycle = 0 while not timer.timed_out(): cycle += 1 try: with ExclusiveLock(lockpath, id=id, timeout=timeout/20, sleep=-1): # This timeout is only for not exceeding the given timeout by more than 5%. With sleep<0 it's constantly polling anyway. lock_owner_count = lock_owner_counter.incr() print_locked("Thread %2d: Acquired the lock. It's my %d. loop cycle. I am the %d. who has the lock concurrently." % (thread_id, cycle, lock_owner_count)) time.sleep(0.005) lock_owner_count = lock_owner_counter.decr() print_locked("Thread %2d: Releasing the lock, finishing my %d. loop cycle. Currently, %d colleagues still have the lock." % (thread_id, cycle, lock_owner_count)) except LockTimeout: print_locked("Thread %2d: Got LockTimeout, finishing my %d. loop cycle." % (thread_id, cycle)) except: exception_count = exception_counter.incr() e = format_exc() print_locked("Thread %2d: Exception thrown, finishing my %d. loop cycle. It's the %d. exception seen until now: %s" % (thread_id, cycle, exception_count, e)) print_locked("Thread %2d: Loop timed out--terminating after %d loop cycles." % (thread_id, cycle)) if last_thread is not None: # joining its predecessor, if any last_thread.join() print('') lock_owner_counter = SynchronizedCounter() exception_counter = SynchronizedCounter() print_lock = ThreadingLock() thread = None host_id, process_id = "differenthost", 1234 for thread_id in range(RACE_TEST_NUM_THREADS): thread = Thread(target=acquire_release_loop, args=((host_id, process_id, thread_id), RACE_TEST_DURATION, thread_id, lock_owner_counter, exception_counter, print_lock, thread)) thread.start() thread.join() # joining the last thread assert lock_owner_counter.maxvalue() > 0, 'Never gained the lock? Something went wrong here...' assert lock_owner_counter.maxvalue() <= 1, "Maximal number of concurrent lock holders was %d. So exclusivity is broken." % (lock_owner_counter.maxvalue()) assert exception_counter.value() == 0, "ExclusiveLock threw %d exceptions due to unclean concurrency handling." % (exception_counter.value()) class TestLock: def test_shared(self, lockpath): lock1 = Lock(lockpath, exclusive=False, id=ID1).acquire() lock2 = Lock(lockpath, exclusive=False, id=ID2).acquire() assert len(lock1._roster.get(SHARED)) == 2 assert len(lock1._roster.get(EXCLUSIVE)) == 0 assert not lock1._roster.empty(SHARED, EXCLUSIVE) assert lock1._roster.empty(EXCLUSIVE) lock1.release() lock2.release() def test_exclusive(self, lockpath): with Lock(lockpath, exclusive=True, id=ID1) as lock: assert len(lock._roster.get(SHARED)) == 0 assert len(lock._roster.get(EXCLUSIVE)) == 1 assert not lock._roster.empty(SHARED, EXCLUSIVE) def test_upgrade(self, lockpath): with Lock(lockpath, exclusive=False) as lock: lock.upgrade() lock.upgrade() # NOP assert len(lock._roster.get(SHARED)) == 0 assert len(lock._roster.get(EXCLUSIVE)) == 1 assert not lock._roster.empty(SHARED, EXCLUSIVE) def test_downgrade(self, lockpath): with Lock(lockpath, exclusive=True) as lock: lock.downgrade() lock.downgrade() # NOP assert len(lock._roster.get(SHARED)) == 1 assert len(lock._roster.get(EXCLUSIVE)) == 0 def test_got_exclusive_lock(self, lockpath): lock = Lock(lockpath, exclusive=True, id=ID1) assert not lock.got_exclusive_lock() lock.acquire() assert lock.got_exclusive_lock() lock.release() assert not lock.got_exclusive_lock() def test_break(self, lockpath): lock = Lock(lockpath, exclusive=True, id=ID1).acquire() lock.break_lock() assert len(lock._roster.get(SHARED)) == 0 assert len(lock._roster.get(EXCLUSIVE)) == 0 with Lock(lockpath, exclusive=True, id=ID2): pass def test_timeout(self, lockpath): with Lock(lockpath, exclusive=False, id=ID1): with pytest.raises(LockTimeout): Lock(lockpath, exclusive=True, id=ID2, timeout=0.1).acquire() with Lock(lockpath, exclusive=True, id=ID1): with pytest.raises(LockTimeout): Lock(lockpath, exclusive=False, id=ID2, timeout=0.1).acquire() with Lock(lockpath, exclusive=True, id=ID1): with pytest.raises(LockTimeout): Lock(lockpath, exclusive=True, id=ID2, timeout=0.1).acquire() def test_kill_stale(self, lockpath, free_pid): host, pid, tid = our_id = get_process_id() dead_id = host, free_pid, tid cant_know_if_dead_id = 'foo.bar.example.net', 1, 2 dead_lock = Lock(lockpath, id=dead_id, exclusive=True).acquire() roster = dead_lock._roster with Lock(lockpath, id=our_id): assert roster.get(EXCLUSIVE) == set() assert roster.get(SHARED) == {our_id} assert roster.get(EXCLUSIVE) == set() assert roster.get(SHARED) == set() with pytest.raises(NotLocked): dead_lock.release() with Lock(lockpath, id=cant_know_if_dead_id, exclusive=True): with pytest.raises(LockTimeout): Lock(lockpath, id=our_id, timeout=0.1).acquire() def test_migrate_lock(self, lockpath): old_id, new_id = ID1, ID2 assert old_id[1] != new_id[1] # different PIDs (like when doing daemonize()) lock = Lock(lockpath, id=old_id, exclusive=True).acquire() assert lock.id == old_id lock.migrate_lock(old_id, new_id) # fix the lock assert lock.id == new_id lock.release() lock = Lock(lockpath, id=old_id, exclusive=False).acquire() assert lock.id == old_id lock.migrate_lock(old_id, new_id) # fix the lock assert lock.id == new_id lock.release() @pytest.fixture() def rosterpath(tmpdir): return str(tmpdir.join('roster')) class TestLockRoster: def test_empty(self, rosterpath): roster = LockRoster(rosterpath) empty = roster.load() roster.save(empty) assert empty == {} def test_modify_get(self, rosterpath): roster1 = LockRoster(rosterpath, id=ID1) assert roster1.get(SHARED) == set() roster1.modify(SHARED, ADD) assert roster1.get(SHARED) == {ID1, } roster2 = LockRoster(rosterpath, id=ID2) roster2.modify(SHARED, ADD) assert roster2.get(SHARED) == {ID1, ID2, } roster1 = LockRoster(rosterpath, id=ID1) roster1.modify(SHARED, REMOVE) assert roster1.get(SHARED) == {ID2, } roster2 = LockRoster(rosterpath, id=ID2) roster2.modify(SHARED, REMOVE) assert roster2.get(SHARED) == set() def test_kill_stale(self, rosterpath, free_pid): host, pid, tid = our_id = get_process_id() dead_id = host, free_pid, tid # put a dead local process lock into roster roster1 = LockRoster(rosterpath, id=dead_id) roster1.kill_stale_locks = False assert roster1.get(SHARED) == set() roster1.modify(SHARED, ADD) assert roster1.get(SHARED) == {dead_id} # put a unknown-state remote process lock into roster cant_know_if_dead_id = 'foo.bar.example.net', 1, 2 roster1 = LockRoster(rosterpath, id=cant_know_if_dead_id) roster1.kill_stale_locks = False assert roster1.get(SHARED) == {dead_id} roster1.modify(SHARED, ADD) assert roster1.get(SHARED) == {dead_id, cant_know_if_dead_id} killer_roster = LockRoster(rosterpath) # Active kill_stale_locks here - does it kill the dead_id lock? assert killer_roster.get(SHARED) == {cant_know_if_dead_id} killer_roster.modify(SHARED, ADD) assert killer_roster.get(SHARED) == {our_id, cant_know_if_dead_id} other_killer_roster = LockRoster(rosterpath) # Active kill_stale_locks here - must not kill our_id lock since we're alive. assert other_killer_roster.get(SHARED) == {our_id, cant_know_if_dead_id} def test_migrate_lock(self, rosterpath): old_id, new_id = ID1, ID2 assert old_id[1] != new_id[1] # different PIDs (like when doing daemonize()) roster = LockRoster(rosterpath, id=old_id) assert roster.id == old_id roster.modify(SHARED, ADD) assert roster.get(SHARED) == {old_id} roster.migrate_lock(SHARED, old_id, new_id) # fix the lock assert roster.id == new_id assert roster.get(SHARED) == {new_id} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/testsuite/logger.py0000644000076500000240000000304714641074756017634 0ustar00twstaffimport logging from io import StringIO import pytest from ..logger import find_parent_module, create_logger, setup_logging logger = create_logger() @pytest.fixture() def io_logger(): io = StringIO() handler = setup_logging(stream=io, env_var=None) handler.setFormatter(logging.Formatter('%(name)s: %(message)s')) logger.setLevel(logging.DEBUG) return io def test_setup_logging(io_logger): logger.info('hello world') assert io_logger.getvalue() == "borg.testsuite.logger: hello world\n" def test_multiple_loggers(io_logger): logger = logging.getLogger(__name__) logger.info('hello world 1') assert io_logger.getvalue() == "borg.testsuite.logger: hello world 1\n" logger = logging.getLogger('borg.testsuite.logger') logger.info('hello world 2') assert io_logger.getvalue() == "borg.testsuite.logger: hello world 1\nborg.testsuite.logger: hello world 2\n" io_logger.truncate(0) io_logger.seek(0) logger = logging.getLogger('borg.testsuite.logger') logger.info('hello world 2') assert io_logger.getvalue() == "borg.testsuite.logger: hello world 2\n" def test_parent_module(): assert find_parent_module() == __name__ def test_lazy_logger(): # just calling all the methods of the proxy logger.setLevel(logging.DEBUG) logger.debug("debug") logger.info("info") logger.warning("warning") logger.error("error") logger.critical("critical") logger.log(logging.INFO, "info") try: raise Exception except Exception: logger.exception("exception") ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/testsuite/lrucache.py0000644000076500000240000000262614641074756020145 0ustar00twstafffrom tempfile import TemporaryFile import pytest from ..lrucache import LRUCache class TestLRUCache: def test_lrucache(self): c = LRUCache(2, dispose=lambda _: None) assert len(c) == 0 assert c.items() == set() for i, x in enumerate('abc'): c[x] = i assert len(c) == 2 assert c.items() == {('b', 1), ('c', 2)} assert 'a' not in c assert 'b' in c with pytest.raises(KeyError): c['a'] assert c.get('a') is None assert c.get('a', 'foo') == 'foo' assert c['b'] == 1 assert c.get('b') == 1 assert c['c'] == 2 c['d'] = 3 assert len(c) == 2 assert c['c'] == 2 assert c['d'] == 3 del c['c'] assert len(c) == 1 with pytest.raises(KeyError): c['c'] assert c['d'] == 3 c.clear() assert c.items() == set() def test_dispose(self): c = LRUCache(2, dispose=lambda f: f.close()) f1 = TemporaryFile() f2 = TemporaryFile() f3 = TemporaryFile() c[1] = f1 c[2] = f2 assert not f2.closed c[3] = f3 assert 1 not in c assert f1.closed assert 2 in c assert not f2.closed del c[2] assert 2 not in c assert f2.closed c.clear() assert c.items() == set() assert f3.closed ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/testsuite/nanorst.py0000644000076500000240000000176014641074756020041 0ustar00twstaffimport pytest from ..nanorst import rst_to_text def test_inline(): assert rst_to_text('*foo* and ``bar``.') == 'foo and bar.' def test_inline_spread(): assert rst_to_text('*foo and bar, thusly\nfoobar*.') == 'foo and bar, thusly\nfoobar.' def test_comment_inline(): assert rst_to_text('Foo and Bar\n.. foo\nbar') == 'Foo and Bar\n.. foo\nbar' def test_inline_escape(): assert rst_to_text('Such as "\\*" characters.') == 'Such as "*" characters.' def test_comment(): assert rst_to_text('Foo and Bar\n\n.. foo\nbar') == 'Foo and Bar\n\nbar' def test_directive_note(): assert rst_to_text('.. note::\n Note this and that') == 'Note:\n Note this and that' def test_ref(): references = { 'foo': 'baz' } assert rst_to_text('See :ref:`fo\no`.', references=references) == 'See baz.' def test_undefined_ref(): with pytest.raises(ValueError) as exc_info: rst_to_text('See :ref:`foo`.') assert 'Undefined reference' in str(exc_info.value) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/testsuite/nonces.py0000644000076500000240000001603014641074756017636 0ustar00twstaffimport os.path import pytest from ..crypto import nonces from ..crypto.nonces import NonceManager from ..crypto.key import bin_to_hex from ..helpers import get_security_dir from ..remote import InvalidRPCMethod class TestNonceManager: class MockRepository: class _Location: orig = '/some/place' _location = _Location() id = bytes(32) id_str = bin_to_hex(id) def get_free_nonce(self): return self.next_free def commit_nonce_reservation(self, next_unreserved, start_nonce): assert start_nonce == self.next_free self.next_free = next_unreserved class MockOldRepository(MockRepository): def get_free_nonce(self): raise InvalidRPCMethod("") def commit_nonce_reservation(self, next_unreserved, start_nonce): pytest.fail("commit_nonce_reservation should never be called on an old repository") def setUp(self): self.repository = None def cache_nonce(self): with open(os.path.join(get_security_dir(self.repository.id_str), 'nonce')) as fd: return fd.read() def set_cache_nonce(self, nonce): with open(os.path.join(get_security_dir(self.repository.id_str), 'nonce'), "w") as fd: assert fd.write(nonce) def test_empty_cache_and_old_server(self, monkeypatch): monkeypatch.setattr(nonces, 'NONCE_SPACE_RESERVATION', 0x20) self.repository = self.MockOldRepository() manager = NonceManager(self.repository, 0x2000) next_nonce = manager.ensure_reservation(0x2000, 19) assert next_nonce == 0x2000 assert self.cache_nonce() == "0000000000002033" def test_empty_cache(self, monkeypatch): monkeypatch.setattr(nonces, 'NONCE_SPACE_RESERVATION', 0x20) self.repository = self.MockRepository() self.repository.next_free = 0x2000 manager = NonceManager(self.repository, 0x2000) next_nonce = manager.ensure_reservation(0x2000, 19) assert next_nonce == 0x2000 assert self.cache_nonce() == "0000000000002033" def test_empty_nonce(self, monkeypatch): monkeypatch.setattr(nonces, 'NONCE_SPACE_RESERVATION', 0x20) self.repository = self.MockRepository() self.repository.next_free = None manager = NonceManager(self.repository, 0x2000) next_nonce = manager.ensure_reservation(0x2000, 19) assert next_nonce == 0x2000 assert self.cache_nonce() == "0000000000002033" assert self.repository.next_free == 0x2033 # enough space in reservation next_nonce = manager.ensure_reservation(0x2013, 13) assert next_nonce == 0x2013 assert self.cache_nonce() == "0000000000002033" assert self.repository.next_free == 0x2033 # just barely enough space in reservation next_nonce = manager.ensure_reservation(0x2020, 19) assert next_nonce == 0x2020 assert self.cache_nonce() == "0000000000002033" assert self.repository.next_free == 0x2033 # no space in reservation next_nonce = manager.ensure_reservation(0x2033, 16) assert next_nonce == 0x2033 assert self.cache_nonce() == "0000000000002063" assert self.repository.next_free == 0x2063 # spans reservation boundary next_nonce = manager.ensure_reservation(0x2043, 64) assert next_nonce == 0x2063 assert self.cache_nonce() == "00000000000020c3" assert self.repository.next_free == 0x20c3 def test_sync_nonce(self, monkeypatch): monkeypatch.setattr(nonces, 'NONCE_SPACE_RESERVATION', 0x20) self.repository = self.MockRepository() self.repository.next_free = 0x2000 self.set_cache_nonce("0000000000002000") manager = NonceManager(self.repository, 0x2000) next_nonce = manager.ensure_reservation(0x2000, 19) assert next_nonce == 0x2000 assert self.cache_nonce() == "0000000000002033" assert self.repository.next_free == 0x2033 def test_server_just_upgraded(self, monkeypatch): monkeypatch.setattr(nonces, 'NONCE_SPACE_RESERVATION', 0x20) self.repository = self.MockRepository() self.repository.next_free = None self.set_cache_nonce("0000000000002000") manager = NonceManager(self.repository, 0x2000) next_nonce = manager.ensure_reservation(0x2000, 19) assert next_nonce == 0x2000 assert self.cache_nonce() == "0000000000002033" assert self.repository.next_free == 0x2033 def test_transaction_abort_no_cache(self, monkeypatch): monkeypatch.setattr(nonces, 'NONCE_SPACE_RESERVATION', 0x20) self.repository = self.MockRepository() self.repository.next_free = 0x2000 manager = NonceManager(self.repository, 0x2000) next_nonce = manager.ensure_reservation(0x1000, 19) assert next_nonce == 0x2000 assert self.cache_nonce() == "0000000000002033" assert self.repository.next_free == 0x2033 def test_transaction_abort_old_server(self, monkeypatch): monkeypatch.setattr(nonces, 'NONCE_SPACE_RESERVATION', 0x20) self.repository = self.MockOldRepository() self.set_cache_nonce("0000000000002000") manager = NonceManager(self.repository, 0x2000) next_nonce = manager.ensure_reservation(0x1000, 19) assert next_nonce == 0x2000 assert self.cache_nonce() == "0000000000002033" def test_transaction_abort_on_other_client(self, monkeypatch): monkeypatch.setattr(nonces, 'NONCE_SPACE_RESERVATION', 0x20) self.repository = self.MockRepository() self.repository.next_free = 0x2000 self.set_cache_nonce("0000000000001000") manager = NonceManager(self.repository, 0x2000) next_nonce = manager.ensure_reservation(0x1000, 19) assert next_nonce == 0x2000 assert self.cache_nonce() == "0000000000002033" assert self.repository.next_free == 0x2033 def test_interleaved(self, monkeypatch): monkeypatch.setattr(nonces, 'NONCE_SPACE_RESERVATION', 0x20) self.repository = self.MockRepository() self.repository.next_free = 0x2000 self.set_cache_nonce("0000000000002000") manager = NonceManager(self.repository, 0x2000) next_nonce = manager.ensure_reservation(0x2000, 19) assert next_nonce == 0x2000 assert self.cache_nonce() == "0000000000002033" assert self.repository.next_free == 0x2033 # somehow the clients unlocks, another client reserves and this client relocks self.repository.next_free = 0x4000 # enough space in reservation next_nonce = manager.ensure_reservation(0x2013, 12) assert next_nonce == 0x2013 assert self.cache_nonce() == "0000000000002033" assert self.repository.next_free == 0x4000 # spans reservation boundary next_nonce = manager.ensure_reservation(0x201f, 21) assert next_nonce == 0x4000 assert self.cache_nonce() == "0000000000004035" assert self.repository.next_free == 0x4035 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/testsuite/patterns.py0000644000076500000240000004173414641074756020222 0ustar00twstaffimport argparse import io import os.path import sys import pytest from ..patterns import PathFullPattern, PathPrefixPattern, FnmatchPattern, ShellPattern, RegexPattern from ..patterns import load_exclude_file, load_pattern_file from ..patterns import parse_pattern, PatternMatcher def check_patterns(files, pattern, expected): """Utility for testing patterns. """ assert all([f == os.path.normpath(f) for f in files]), "Pattern matchers expect normalized input paths" matched = [f for f in files if pattern.match(f)] assert matched == (files if expected is None else expected) @pytest.mark.parametrize("pattern, expected", [ # "None" means all files, i.e. all match the given pattern ("/", []), ("/home", ["home"]), ("/home///", ["home"]), ("/./home", ["home"]), ("/home/user", ["home/user"]), ("/home/user2", ["home/user2"]), ("/home/user/.bashrc", ["home/user/.bashrc"]), ]) def test_patterns_full(pattern, expected): files = ["home", "home/user", "home/user2", "home/user/.bashrc", ] check_patterns(files, PathFullPattern(pattern), expected) @pytest.mark.parametrize("pattern, expected", [ # "None" means all files, i.e. all match the given pattern ("", []), ("relative", []), ("relative/path/", ["relative/path"]), ("relative/path", ["relative/path"]), ]) def test_patterns_full_relative(pattern, expected): files = ["relative/path", "relative/path2", ] check_patterns(files, PathFullPattern(pattern), expected) @pytest.mark.parametrize("pattern, expected", [ # "None" means all files, i.e. all match the given pattern ("/", None), ("/./", None), ("", []), ("/home/u", []), ("/home/user", ["home/user/.profile", "home/user/.bashrc"]), ("/etc", ["etc/server/config", "etc/server/hosts"]), ("///etc//////", ["etc/server/config", "etc/server/hosts"]), ("/./home//..//home/user2", ["home/user2/.profile", "home/user2/public_html/index.html"]), ("/srv", ["srv/messages", "srv/dmesg"]), ]) def test_patterns_prefix(pattern, expected): files = [ "etc/server/config", "etc/server/hosts", "home", "home/user/.profile", "home/user/.bashrc", "home/user2/.profile", "home/user2/public_html/index.html", "srv/messages", "srv/dmesg", ] check_patterns(files, PathPrefixPattern(pattern), expected) @pytest.mark.parametrize("pattern, expected", [ # "None" means all files, i.e. all match the given pattern ("", []), ("foo", []), ("relative", ["relative/path1", "relative/two"]), ("more", ["more/relative"]), ]) def test_patterns_prefix_relative(pattern, expected): files = ["relative/path1", "relative/two", "more/relative"] check_patterns(files, PathPrefixPattern(pattern), expected) @pytest.mark.parametrize("pattern, expected", [ # "None" means all files, i.e. all match the given pattern ("/*", None), ("/./*", None), ("*", None), ("*/*", ["etc/server/config", "etc/server/hosts", "home/user/.profile", "home/user/.bashrc", "home/user2/.profile", "home/user2/public_html/index.html", "srv/messages", "srv/dmesg", "home/foo/.thumbnails", "home/foo/bar/.thumbnails"]), ("*///*", ["etc/server/config", "etc/server/hosts", "home/user/.profile", "home/user/.bashrc", "home/user2/.profile", "home/user2/public_html/index.html", "srv/messages", "srv/dmesg", "home/foo/.thumbnails", "home/foo/bar/.thumbnails"]), ("/home/u", []), ("/home/*", ["home/user/.profile", "home/user/.bashrc", "home/user2/.profile", "home/user2/public_html/index.html", "home/foo/.thumbnails", "home/foo/bar/.thumbnails"]), ("/home/user/*", ["home/user/.profile", "home/user/.bashrc"]), ("/etc/*", ["etc/server/config", "etc/server/hosts"]), ("*/.pr????e", ["home/user/.profile", "home/user2/.profile"]), ("///etc//////*", ["etc/server/config", "etc/server/hosts"]), ("/./home//..//home/user2/*", ["home/user2/.profile", "home/user2/public_html/index.html"]), ("/srv*", ["srv/messages", "srv/dmesg"]), ("/home/*/.thumbnails", ["home/foo/.thumbnails", "home/foo/bar/.thumbnails"]), ]) def test_patterns_fnmatch(pattern, expected): files = [ "etc/server/config", "etc/server/hosts", "home", "home/user/.profile", "home/user/.bashrc", "home/user2/.profile", "home/user2/public_html/index.html", "srv/messages", "srv/dmesg", "home/foo/.thumbnails", "home/foo/bar/.thumbnails", ] check_patterns(files, FnmatchPattern(pattern), expected) @pytest.mark.parametrize("pattern, expected", [ # "None" means all files, i.e. all match the given pattern ("*", None), ("**/*", None), ("/**/*", None), ("/./*", None), ("*/*", ["etc/server/config", "etc/server/hosts", "home/user/.profile", "home/user/.bashrc", "home/user2/.profile", "home/user2/public_html/index.html", "srv/messages", "srv/dmesg", "srv2/blafasel", "home/foo/.thumbnails", "home/foo/bar/.thumbnails"]), ("*///*", ["etc/server/config", "etc/server/hosts", "home/user/.profile", "home/user/.bashrc", "home/user2/.profile", "home/user2/public_html/index.html", "srv/messages", "srv/dmesg", "srv2/blafasel", "home/foo/.thumbnails", "home/foo/bar/.thumbnails"]), ("/home/u", []), ("/home/*", ["home/user/.profile", "home/user/.bashrc", "home/user2/.profile", "home/user2/public_html/index.html", "home/foo/.thumbnails", "home/foo/bar/.thumbnails"]), ("/home/user/*", ["home/user/.profile", "home/user/.bashrc"]), ("/etc/*/*", ["etc/server/config", "etc/server/hosts"]), ("/etc/**/*", ["etc/server/config", "etc/server/hosts"]), ("/etc/**/*/*", ["etc/server/config", "etc/server/hosts"]), ("*/.pr????e", []), ("**/.pr????e", ["home/user/.profile", "home/user2/.profile"]), ("///etc//////*", ["etc/server/config", "etc/server/hosts"]), ("/./home//..//home/user2/", ["home/user2/.profile", "home/user2/public_html/index.html"]), ("/./home//..//home/user2/**/*", ["home/user2/.profile", "home/user2/public_html/index.html"]), ("/srv*/", ["srv/messages", "srv/dmesg", "srv2/blafasel"]), ("/srv*", ["srv", "srv/messages", "srv/dmesg", "srv2", "srv2/blafasel"]), ("/srv/*", ["srv/messages", "srv/dmesg"]), ("/srv2/**", ["srv2", "srv2/blafasel"]), ("/srv2/**/", ["srv2/blafasel"]), ("/home/*/.thumbnails", ["home/foo/.thumbnails"]), ("/home/*/*/.thumbnails", ["home/foo/bar/.thumbnails"]), ]) def test_patterns_shell(pattern, expected): files = [ "etc/server/config", "etc/server/hosts", "home", "home/user/.profile", "home/user/.bashrc", "home/user2/.profile", "home/user2/public_html/index.html", "srv", "srv/messages", "srv/dmesg", "srv2", "srv2/blafasel", "home/foo/.thumbnails", "home/foo/bar/.thumbnails", ] check_patterns(files, ShellPattern(pattern), expected) @pytest.mark.parametrize("pattern, expected", [ # "None" means all files, i.e. all match the given pattern ("", None), (".*", None), ("^/", None), ("^abc$", []), ("^[^/]", []), ("^(?!/srv|/foo|/opt)", ["/home", "/home/user/.profile", "/home/user/.bashrc", "/home/user2/.profile", "/home/user2/public_html/index.html", "/home/foo/.thumbnails", "/home/foo/bar/.thumbnails", ]), ]) def test_patterns_regex(pattern, expected): files = [ '/srv/data', '/foo/bar', '/home', '/home/user/.profile', '/home/user/.bashrc', '/home/user2/.profile', '/home/user2/public_html/index.html', '/opt/log/messages.txt', '/opt/log/dmesg.txt', "/home/foo/.thumbnails", "/home/foo/bar/.thumbnails", ] obj = RegexPattern(pattern) assert str(obj) == pattern assert obj.pattern == pattern check_patterns(files, obj, expected) def test_regex_pattern(): # The forward slash must match the platform-specific path separator assert RegexPattern("^/$").match("/") assert RegexPattern("^/$").match(os.path.sep) assert not RegexPattern(r"^\\$").match("/") def use_normalized_unicode(): return sys.platform in ("darwin",) def _make_test_patterns(pattern): return [PathPrefixPattern(pattern), FnmatchPattern(pattern), RegexPattern(f"^{pattern}/foo$"), ShellPattern(pattern), ] @pytest.mark.parametrize("pattern", _make_test_patterns("b\N{LATIN SMALL LETTER A WITH ACUTE}")) def test_composed_unicode_pattern(pattern): assert pattern.match("b\N{LATIN SMALL LETTER A WITH ACUTE}/foo") assert pattern.match("ba\N{COMBINING ACUTE ACCENT}/foo") == use_normalized_unicode() @pytest.mark.parametrize("pattern", _make_test_patterns("ba\N{COMBINING ACUTE ACCENT}")) def test_decomposed_unicode_pattern(pattern): assert pattern.match("b\N{LATIN SMALL LETTER A WITH ACUTE}/foo") == use_normalized_unicode() assert pattern.match("ba\N{COMBINING ACUTE ACCENT}/foo") @pytest.mark.parametrize("pattern", _make_test_patterns(str(b"ba\x80", "latin1"))) def test_invalid_unicode_pattern(pattern): assert not pattern.match("ba/foo") assert pattern.match(str(b"ba\x80/foo", "latin1")) @pytest.mark.parametrize("lines, expected", [ # "None" means all files, i.e. none excluded ([], None), (["# Comment only"], None), (["*"], []), (["# Comment", "*/something00.txt", " *whitespace* ", # Whitespace before comment " #/ws*", # Empty line "", "# EOF"], ["more/data", "home", " #/wsfoobar"]), ([r"re:.*"], []), ([r"re:\s"], ["data/something00.txt", "more/data", "home"]), ([r"re:(.)(\1)"], ["more/data", "home", "\tstart/whitespace", "whitespace/end\t"]), (["", "", "", "# This is a test with mixed pattern styles", # Case-insensitive pattern r"re:(?i)BAR|ME$", "", "*whitespace*", "fm:*/something00*"], ["more/data"]), ([r" re:^\s "], ["data/something00.txt", "more/data", "home", "whitespace/end\t"]), ([r" re:\s$ "], ["data/something00.txt", "more/data", "home", " #/wsfoobar", "\tstart/whitespace"]), (["pp:./"], None), # leading slash is removed (["pp:/"], []), (["pp:aaabbb"], None), (["pp:/data", "pp: #/", "pp:\tstart", "pp:/whitespace"], ["more/data", "home"]), (["/nomatch", "/more/*"], ['data/something00.txt', 'home', ' #/wsfoobar', '\tstart/whitespace', 'whitespace/end\t']), # the order of exclude patterns shouldn't matter (["/more/*", "/nomatch"], ['data/something00.txt', 'home', ' #/wsfoobar', '\tstart/whitespace', 'whitespace/end\t']), ]) def test_exclude_patterns_from_file(tmpdir, lines, expected): files = [ 'data/something00.txt', 'more/data', 'home', ' #/wsfoobar', '\tstart/whitespace', 'whitespace/end\t', ] def evaluate(filename): patterns = [] load_exclude_file(open(filename), patterns) matcher = PatternMatcher(fallback=True) matcher.add_inclexcl(patterns) return [path for path in files if matcher.match(path)] exclfile = tmpdir.join("exclude.txt") with exclfile.open("wt") as fh: fh.write("\n".join(lines)) assert evaluate(str(exclfile)) == (files if expected is None else expected) @pytest.mark.parametrize("lines, expected_roots, expected_numpatterns", [ # "None" means all files, i.e. none excluded ([], [], 0), (["# Comment only"], [], 0), (["- *"], [], 1), (["+fm:*/something00.txt", "-/data"], [], 2), (["R /"], ["/"], 0), (["R /", "# comment"], ["/"], 0), (["# comment", "- /data", "R /home"], ["/home"], 1), ]) def test_load_patterns_from_file(tmpdir, lines, expected_roots, expected_numpatterns): def evaluate(filename): roots = [] inclexclpatterns = [] load_pattern_file(open(filename), roots, inclexclpatterns) return roots, len(inclexclpatterns) patternfile = tmpdir.join("patterns.txt") with patternfile.open("wt") as fh: fh.write("\n".join(lines)) roots, numpatterns = evaluate(str(patternfile)) assert roots == expected_roots assert numpatterns == expected_numpatterns def test_switch_patterns_style(): patterns = """\ +0_initial_default_is_shell p fm +1_fnmatch P re +2_regex +3_more_regex P pp +4_pathprefix p fm p sh +5_shell """ pattern_file = io.StringIO(patterns) roots, patterns = [], [] load_pattern_file(pattern_file, roots, patterns) assert len(patterns) == 6 assert isinstance(patterns[0].val, ShellPattern) assert isinstance(patterns[1].val, FnmatchPattern) assert isinstance(patterns[2].val, RegexPattern) assert isinstance(patterns[3].val, RegexPattern) assert isinstance(patterns[4].val, PathPrefixPattern) assert isinstance(patterns[5].val, ShellPattern) @pytest.mark.parametrize("lines", [ (["X /data"]), # illegal pattern type prefix (["/data"]), # need a pattern type prefix ]) def test_load_invalid_patterns_from_file(tmpdir, lines): patternfile = tmpdir.join("patterns.txt") with patternfile.open("wt") as fh: fh.write("\n".join(lines)) filename = str(patternfile) with pytest.raises(argparse.ArgumentTypeError): roots = [] inclexclpatterns = [] load_pattern_file(open(filename), roots, inclexclpatterns) @pytest.mark.parametrize("lines, expected", [ # "None" means all files, i.e. none excluded ([], None), (["# Comment only"], None), (["- *"], []), # default match type is sh: for patterns -> * doesn't match a / (["-*/something0?.txt"], ['data', 'data/subdir/something01.txt', 'home', 'home/leo', 'home/leo/t', 'home/other']), (["-fm:*/something00.txt"], ['data', 'data/subdir/something01.txt', 'home', 'home/leo', 'home/leo/t', 'home/other']), (["-fm:*/something0?.txt"], ["data", 'home', 'home/leo', 'home/leo/t', 'home/other']), (["+/*/something0?.txt", "-/data"], ["data/something00.txt", 'home', 'home/leo', 'home/leo/t', 'home/other']), (["+fm:*/something00.txt", "-/data"], ["data/something00.txt", 'home', 'home/leo', 'home/leo/t', 'home/other']), # include /home/leo and exclude the rest of /home: (["+/home/leo", "-/home/*"], ['data', 'data/something00.txt', 'data/subdir/something01.txt', 'home', 'home/leo', 'home/leo/t']), # wrong order, /home/leo is already excluded by -/home/*: (["-/home/*", "+/home/leo"], ['data', 'data/something00.txt', 'data/subdir/something01.txt', 'home']), (["+fm:/home/leo", "-/home/"], ['data', 'data/something00.txt', 'data/subdir/something01.txt', 'home', 'home/leo', 'home/leo/t']), ]) def test_inclexcl_patterns_from_file(tmpdir, lines, expected): files = [ 'data', 'data/something00.txt', 'data/subdir/something01.txt', 'home', 'home/leo', 'home/leo/t', 'home/other' ] def evaluate(filename): matcher = PatternMatcher(fallback=True) roots = [] inclexclpatterns = [] load_pattern_file(open(filename), roots, inclexclpatterns) matcher.add_inclexcl(inclexclpatterns) return [path for path in files if matcher.match(path)] patternfile = tmpdir.join("patterns.txt") with patternfile.open("wt") as fh: fh.write("\n".join(lines)) assert evaluate(str(patternfile)) == (files if expected is None else expected) @pytest.mark.parametrize("pattern, cls", [ ("", FnmatchPattern), # Default style ("*", FnmatchPattern), ("/data/*", FnmatchPattern), # fnmatch style ("fm:", FnmatchPattern), ("fm:*", FnmatchPattern), ("fm:/data/*", FnmatchPattern), ("fm:fm:/data/*", FnmatchPattern), # Regular expression ("re:", RegexPattern), ("re:.*", RegexPattern), ("re:^/something/", RegexPattern), ("re:re:^/something/", RegexPattern), # Path prefix ("pp:", PathPrefixPattern), ("pp:/", PathPrefixPattern), ("pp:/data/", PathPrefixPattern), ("pp:pp:/data/", PathPrefixPattern), # Shell-pattern style ("sh:", ShellPattern), ("sh:*", ShellPattern), ("sh:/data/*", ShellPattern), ("sh:sh:/data/*", ShellPattern), ]) def test_parse_pattern(pattern, cls): assert isinstance(parse_pattern(pattern), cls) @pytest.mark.parametrize("pattern", ["aa:", "fo:*", "00:", "x1:abc"]) def test_parse_pattern_error(pattern): with pytest.raises(ValueError): parse_pattern(pattern) def test_pattern_matcher(): pm = PatternMatcher() assert pm.fallback is None for i in ["", "foo", "bar"]: assert pm.match(i) is None # add extra entries to aid in testing for target in ["A", "B", "Empty", "FileNotFound"]: pm.is_include_cmd[target] = target pm.add([RegexPattern("^a")], "A") pm.add([RegexPattern("^b"), RegexPattern("^z")], "B") pm.add([RegexPattern("^$")], "Empty") pm.fallback = "FileNotFound" assert pm.match("") == "Empty" assert pm.match("aaa") == "A" assert pm.match("bbb") == "B" assert pm.match("ccc") == "FileNotFound" assert pm.match("xyz") == "FileNotFound" assert pm.match("z") == "B" assert PatternMatcher(fallback="hey!").fallback == "hey!" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/testsuite/platform.py0000644000076500000240000002670614641074756020210 0ustar00twstaffimport errno import functools import os import shutil import sys import tempfile import unittest from ..platformflags import is_win32, is_linux, is_freebsd, is_darwin from ..platform import acl_get, acl_set, swidth from ..platform import get_process_id, process_alive from . import BaseTestCase, unopened_tempfile from .locking import free_pid def fakeroot_detected(): return 'FAKEROOTKEY' in os.environ def user_exists(username): if not is_win32: import pwd try: pwd.getpwnam(username) return True except (KeyError, ValueError): pass return False @functools.lru_cache def are_acls_working(): with unopened_tempfile() as filepath: open(filepath, 'w').close() try: if is_darwin: acl_key = 'acl_extended' acl_value = b'!#acl 1\nuser:FFFFEEEE-DDDD-CCCC-BBBB-AAAA00000000:root:0:allow:read\n' elif is_linux: acl_key = 'acl_access' acl_value = b'user::rw-\ngroup::r--\nmask::rw-\nother::---\nuser:root:rw-:9999\ngroup:root:rw-:9999\n' elif is_freebsd: acl_key = 'acl_access' acl_value = b'user::rw-\ngroup::r--\nmask::rw-\nother::---\nuser:root:rw-\ngroup:wheel:rw-\n' else: return False # ACLs unsupported on this platform. write_acl = {acl_key: acl_value} acl_set(filepath, write_acl) read_acl = {} acl_get(filepath, read_acl, os.stat(filepath)) acl = read_acl.get(acl_key, None) if acl is not None: if is_darwin: check_for = b'root:0:allow:read' elif is_linux: check_for = b'user::rw-' elif is_freebsd: check_for = b'user::rw-' else: return False # ACLs unsupported on this platform. if check_for in acl: return True except PermissionError: pass except OSError as e: if e.errno not in (errno.ENOTSUP, ): raise return False @unittest.skipUnless(is_linux, 'linux only test') @unittest.skipIf(fakeroot_detected(), 'not compatible with fakeroot') class PlatformLinuxTestCase(BaseTestCase): def setUp(self): self.tmpdir = tempfile.mkdtemp() def tearDown(self): shutil.rmtree(self.tmpdir) def get_acl(self, path, numeric_ids=False): item = {} acl_get(path, item, os.stat(path), numeric_ids=numeric_ids) return item def set_acl(self, path, access=None, default=None, numeric_ids=False): item = {'acl_access': access, 'acl_default': default} acl_set(path, item, numeric_ids=numeric_ids) @unittest.skipIf(not are_acls_working(), 'ACLs do not work') def test_access_acl(self): file = tempfile.NamedTemporaryFile() self.assert_equal(self.get_acl(file.name), {}) self.set_acl(file.name, access=b'user::rw-\ngroup::r--\nmask::rw-\nother::---\nuser:root:rw-:9999\ngroup:root:rw-:9999\n', numeric_ids=False) self.assert_in(b'user:root:rw-:0', self.get_acl(file.name)['acl_access']) self.assert_in(b'group:root:rw-:0', self.get_acl(file.name)['acl_access']) self.assert_in(b'user:0:rw-:0', self.get_acl(file.name, numeric_ids=True)['acl_access']) file2 = tempfile.NamedTemporaryFile() self.set_acl(file2.name, access=b'user::rw-\ngroup::r--\nmask::rw-\nother::---\nuser:root:rw-:9999\ngroup:root:rw-:9999\n', numeric_ids=True) self.assert_in(b'user:9999:rw-:9999', self.get_acl(file2.name)['acl_access']) self.assert_in(b'group:9999:rw-:9999', self.get_acl(file2.name)['acl_access']) @unittest.skipIf(not are_acls_working(), 'ACLs do not work') def test_default_acl(self): ACCESS_ACL = b'user::rw-\nuser:root:rw-:0\nuser:9999:r--:9999\ngroup::r--\ngroup:root:r--:0\ngroup:9999:r--:9999\nmask::rw-\nother::r--' DEFAULT_ACL = b'user::rw-\nuser:root:r--:0\nuser:8888:r--:8888\ngroup::r--\ngroup:root:r--:0\ngroup:8888:r--:8888\nmask::rw-\nother::r--' self.assert_equal(self.get_acl(self.tmpdir), {}) self.set_acl(self.tmpdir, access=ACCESS_ACL, default=DEFAULT_ACL) self.assert_equal(self.get_acl(self.tmpdir)['acl_access'], ACCESS_ACL) self.assert_equal(self.get_acl(self.tmpdir)['acl_default'], DEFAULT_ACL) @unittest.skipIf(not user_exists('übel'), 'requires übel user') @unittest.skipIf(not are_acls_working(), 'ACLs do not work') def test_non_ascii_acl(self): # Testing non-ascii ACL processing to see whether our code is robust. # I have no idea whether non-ascii ACLs are allowed by the standard, # but in practice they seem to be out there and must not make our code explode. file = tempfile.NamedTemporaryFile() self.assert_equal(self.get_acl(file.name), {}) nothing_special = b'user::rw-\ngroup::r--\nmask::rw-\nother::---\n' # TODO: can this be tested without having an existing system user übel with uid 666 gid 666? user_entry = 'user:übel:rw-:666'.encode() user_entry_numeric = b'user:666:rw-:666' group_entry = 'group:übel:rw-:666'.encode() group_entry_numeric = b'group:666:rw-:666' acl = b'\n'.join([nothing_special, user_entry, group_entry]) self.set_acl(file.name, access=acl, numeric_ids=False) acl_access = self.get_acl(file.name, numeric_ids=False)['acl_access'] self.assert_in(user_entry, acl_access) self.assert_in(group_entry, acl_access) acl_access_numeric = self.get_acl(file.name, numeric_ids=True)['acl_access'] self.assert_in(user_entry_numeric, acl_access_numeric) self.assert_in(group_entry_numeric, acl_access_numeric) file2 = tempfile.NamedTemporaryFile() self.set_acl(file2.name, access=acl, numeric_ids=True) acl_access = self.get_acl(file2.name, numeric_ids=False)['acl_access'] self.assert_in(user_entry, acl_access) self.assert_in(group_entry, acl_access) acl_access_numeric = self.get_acl(file.name, numeric_ids=True)['acl_access'] self.assert_in(user_entry_numeric, acl_access_numeric) self.assert_in(group_entry_numeric, acl_access_numeric) def test_utils(self): from ..platform.linux import acl_use_local_uid_gid self.assert_equal(acl_use_local_uid_gid(b'user:nonexistent1234:rw-:1234'), b'user:1234:rw-') self.assert_equal(acl_use_local_uid_gid(b'group:nonexistent1234:rw-:1234'), b'group:1234:rw-') self.assert_equal(acl_use_local_uid_gid(b'user:root:rw-:0'), b'user:0:rw-') self.assert_equal(acl_use_local_uid_gid(b'group:root:rw-:0'), b'group:0:rw-') @unittest.skipUnless(is_freebsd, 'freebsd only test') class PlatformFreeBSDTestCase(BaseTestCase): def setUp(self): self.tmpdir = tempfile.mkdtemp() def tearDown(self): shutil.rmtree(self.tmpdir) def get_acl(self, path, numeric_ids=False): item = {} acl_get(path, item, os.stat(path), numeric_ids=numeric_ids) return item def set_acl(self, path, access=None, default=None, numeric_ids=False): item = {'acl_access': access, 'acl_default': default} acl_set(path, item, numeric_ids=numeric_ids) @unittest.skipIf(not are_acls_working(), 'ACLs do not work') def test_access_acl(self): file = tempfile.NamedTemporaryFile() self.assert_equal(self.get_acl(file.name), {}) self.set_acl(file.name, access=b'user::rw-\ngroup::r--\nmask::rw-\nother::---\nuser:root:rw-\ngroup:wheel:rw-\n', numeric_ids=False) self.assert_in(b'user:root:rw-', self.get_acl(file.name)['acl_access']) self.assert_in(b'group:wheel:rw-', self.get_acl(file.name)['acl_access']) self.assert_in(b'user:0:rw-', self.get_acl(file.name, numeric_ids=True)['acl_access']) file2 = tempfile.NamedTemporaryFile() self.set_acl(file2.name, access=b'user::rw-\ngroup::r--\nmask::rw-\nother::---\nuser:root:rw-\ngroup:wheel:rw-\n', numeric_ids=True) self.assert_in(b'user::rw-', self.get_acl(file2.name)['acl_access']) self.assert_in(b'group::r--', self.get_acl(file2.name)['acl_access']) @unittest.skipIf(not are_acls_working(), 'ACLs do not work') def test_default_acl(self): ACCESS_ACL = b'user::rw-\nuser:root:rw-\nuser:9999:r--\ngroup::r--\ngroup:wheel:r--\ngroup:9999:r--\nmask::rw-\nother::r--\n' DEFAULT_ACL = b'user::rw-\nuser:root:r--\nuser:8888:r--\ngroup::r--\ngroup:wheel:r--\ngroup:8888:r--\nmask::rw-\nother::r--\n' self.assert_equal(self.get_acl(self.tmpdir), {}) self.set_acl(self.tmpdir, access=ACCESS_ACL, default=DEFAULT_ACL) self.assert_equal(self.get_acl(self.tmpdir)['acl_access'], ACCESS_ACL) self.assert_equal(self.get_acl(self.tmpdir)['acl_default'], DEFAULT_ACL) @unittest.skipUnless(is_darwin, 'macOS only test') @unittest.skipIf(fakeroot_detected(), 'not compatible with fakeroot') class PlatformDarwinTestCase(BaseTestCase): def setUp(self): self.tmpdir = tempfile.mkdtemp() def tearDown(self): shutil.rmtree(self.tmpdir) def get_acl(self, path, numeric_ids=False): item = {} acl_get(path, item, os.stat(path), numeric_ids=numeric_ids) return item def set_acl(self, path, acl, numeric_ids=False): item = {'acl_extended': acl} acl_set(path, item, numeric_ids=numeric_ids) @unittest.skipIf(not are_acls_working(), 'ACLs do not work') def test_extended_acl(self): file = tempfile.NamedTemporaryFile() file2 = tempfile.NamedTemporaryFile() self.assert_equal(self.get_acl(file.name), {}) self.set_acl(file.name, b'!#acl 1\ngroup:ABCDEFAB-CDEF-ABCD-EFAB-CDEF00000000:staff:0:allow:read\nuser:FFFFEEEE-DDDD-CCCC-BBBB-AAAA00000000:root:0:allow:read\n', numeric_ids=False) self.assert_in(b'group:ABCDEFAB-CDEF-ABCD-EFAB-CDEF00000014:staff:20:allow:read', self.get_acl(file.name)['acl_extended']) self.assert_in(b'user:FFFFEEEE-DDDD-CCCC-BBBB-AAAA00000000:root:0:allow:read', self.get_acl(file.name)['acl_extended']) self.set_acl(file2.name, b'!#acl 1\ngroup:ABCDEFAB-CDEF-ABCD-EFAB-CDEF00000000:staff:0:allow:read\nuser:FFFFEEEE-DDDD-CCCC-BBBB-AAAA00000000:root:0:allow:read\n', numeric_ids=True) self.assert_in(b'group:ABCDEFAB-CDEF-ABCD-EFAB-CDEF00000000:wheel:0:allow:read', self.get_acl(file2.name)['acl_extended']) self.assert_in(b'group:ABCDEFAB-CDEF-ABCD-EFAB-CDEF00000000::0:allow:read', self.get_acl(file2.name, numeric_ids=True)['acl_extended']) @unittest.skipUnless(sys.platform.startswith(('linux', 'freebsd', 'darwin')), 'POSIX only tests') class PlatformPosixTestCase(BaseTestCase): def test_swidth_ascii(self): self.assert_equal(swidth("borg"), 4) def test_swidth_cjk(self): self.assert_equal(swidth("バックアップ"), 6 * 2) def test_swidth_mixed(self): self.assert_equal(swidth("borgバックアップ"), 4 + 6 * 2) def test_process_alive(free_pid): id = get_process_id() assert process_alive(*id) host, pid, tid = id assert process_alive(host + 'abc', pid, tid) assert process_alive(host, pid, tid + 1) assert not process_alive(host, free_pid, tid) def test_process_id(): hostname, pid, tid = get_process_id() assert isinstance(hostname, str) assert isinstance(pid, int) assert isinstance(tid, int) assert len(hostname) > 0 assert pid > 0 assert get_process_id() == (hostname, pid, tid) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/testsuite/remote.py0000644000076500000240000001443414641074756017652 0ustar00twstaffimport errno import os import io import time from unittest.mock import patch import pytest from ..remote import SleepingBandwidthLimiter, RepositoryCache, cache_if_remote from ..repository import Repository from ..crypto.key import PlaintextKey from ..compress import CompressionSpec from ..helpers import IntegrityError from .hashindex import H from .key import TestKey class TestSleepingBandwidthLimiter: def expect_write(self, fd, data): self.expected_fd = fd self.expected_data = data def check_write(self, fd, data): assert fd == self.expected_fd assert data == self.expected_data return len(data) def test_write_unlimited(self, monkeypatch): monkeypatch.setattr(os, "write", self.check_write) it = SleepingBandwidthLimiter(0) self.expect_write(5, b"test") it.write(5, b"test") def test_write(self, monkeypatch): monkeypatch.setattr(os, "write", self.check_write) monkeypatch.setattr(time, "monotonic", lambda: now) monkeypatch.setattr(time, "sleep", lambda x: None) now = 100 it = SleepingBandwidthLimiter(100) # all fits self.expect_write(5, b"test") it.write(5, b"test") # only partial write self.expect_write(5, b"123456") it.write(5, b"1234567890") # sleeps self.expect_write(5, b"123456") it.write(5, b"123456") # long time interval between writes now += 10 self.expect_write(5, b"1") it.write(5, b"1") # long time interval between writes, filling up quota now += 10 self.expect_write(5, b"1") it.write(5, b"1") # long time interval between writes, filling up quota to clip to maximum now += 10 self.expect_write(5, b"1") it.write(5, b"1") class TestRepositoryCache: @pytest.fixture def repository(self, tmpdir): self.repository_location = os.path.join(str(tmpdir), 'repository') with Repository(self.repository_location, exclusive=True, create=True) as repository: repository.put(H(1), b'1234') repository.put(H(2), b'5678') repository.put(H(3), bytes(100)) yield repository @pytest.fixture def cache(self, repository): return RepositoryCache(repository) def test_simple(self, cache: RepositoryCache): # Single get()s are not cached, since they are used for unique objects like archives. assert cache.get(H(1)) == b'1234' assert cache.misses == 1 assert cache.hits == 0 assert list(cache.get_many([H(1)])) == [b'1234'] assert cache.misses == 2 assert cache.hits == 0 assert list(cache.get_many([H(1)])) == [b'1234'] assert cache.misses == 2 assert cache.hits == 1 assert cache.get(H(1)) == b'1234' assert cache.misses == 2 assert cache.hits == 2 def test_backoff(self, cache: RepositoryCache): def query_size_limit(): cache.size_limit = 0 assert list(cache.get_many([H(1), H(2)])) == [b'1234', b'5678'] assert cache.misses == 2 assert cache.evictions == 0 iterator = cache.get_many([H(1), H(3), H(2)]) assert next(iterator) == b'1234' # Force cache to back off qsl = cache.query_size_limit cache.query_size_limit = query_size_limit cache.backoff() cache.query_size_limit = qsl # Evicted H(1) and H(2) assert cache.evictions == 2 assert H(1) not in cache.cache assert H(2) not in cache.cache assert next(iterator) == bytes(100) assert cache.slow_misses == 0 # Since H(2) was in the cache when we called get_many(), but has # been evicted during iterating the generator, it will be a slow miss. assert next(iterator) == b'5678' assert cache.slow_misses == 1 def test_enospc(self, cache: RepositoryCache): class enospc_open: def __init__(self, *args): pass def __enter__(self): return self def __exit__(self, exc_type, exc_val, exc_tb): pass def write(self, data): raise OSError(errno.ENOSPC, 'foo') def truncate(self, n=None): pass iterator = cache.get_many([H(1), H(2), H(3)]) assert next(iterator) == b'1234' with patch('builtins.open', enospc_open): assert next(iterator) == b'5678' assert cache.enospc == 1 # We didn't patch query_size_limit which would set size_limit to some low # value, so nothing was actually evicted. assert cache.evictions == 0 assert next(iterator) == bytes(100) @pytest.fixture def key(self, repository, monkeypatch): monkeypatch.setenv('BORG_PASSPHRASE', 'test') key = PlaintextKey.create(repository, TestKey.MockArgs()) key.compressor = CompressionSpec('none').compressor return key def _put_encrypted_object(self, key, repository, data): id_ = key.id_hash(data) repository.put(id_, key.encrypt(data)) return id_ @pytest.fixture def H1(self, key, repository): return self._put_encrypted_object(key, repository, b'1234') @pytest.fixture def H2(self, key, repository): return self._put_encrypted_object(key, repository, b'5678') @pytest.fixture def H3(self, key, repository): return self._put_encrypted_object(key, repository, bytes(100)) @pytest.fixture def decrypted_cache(self, key, repository): return cache_if_remote(repository, decrypted_cache=key, force_cache=True) def test_cache_corruption(self, decrypted_cache: RepositoryCache, H1, H2, H3): list(decrypted_cache.get_many([H1, H2, H3])) iterator = decrypted_cache.get_many([H1, H2, H3]) assert next(iterator) == (7, b'1234') with open(decrypted_cache.key_filename(H2), 'a+b') as fd: fd.seek(-1, io.SEEK_END) corrupted = (int.from_bytes(fd.read(), 'little') ^ 2).to_bytes(1, 'little') fd.seek(-1, io.SEEK_END) fd.write(corrupted) fd.truncate() with pytest.raises(IntegrityError): assert next(iterator) == (7, b'5678') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/testsuite/repository.py0000644000076500000240000013647614641074756020611 0ustar00twstaffimport io import logging import os import shutil import sys import tempfile from unittest.mock import patch import pytest from ..hashindex import NSIndex from ..helpers import Location from ..helpers import IntegrityError from ..helpers import msgpack from ..locking import Lock, LockFailed from ..remote import RemoteRepository, InvalidRPCMethod, PathNotAllowed, ConnectionClosedWithHint, handle_remote_line from ..repository import Repository, LoggedIO, MAGIC, MAX_DATA_SIZE, TAG_DELETE, TAG_PUT, TAG_COMMIT from . import BaseTestCase from .hashindex import H UNSPECIFIED = object() # for default values where we can't use None class RepositoryTestCaseBase(BaseTestCase): key_size = 32 exclusive = True def open(self, create=False, exclusive=UNSPECIFIED): if exclusive is UNSPECIFIED: exclusive = self.exclusive return Repository(os.path.join(self.tmppath, 'repository'), exclusive=exclusive, create=create) def setUp(self): self.tmppath = tempfile.mkdtemp() self.repository = self.open(create=True) self.repository.__enter__() def tearDown(self): self.repository.__exit__(None, None, None) shutil.rmtree(self.tmppath) def reopen(self, exclusive=UNSPECIFIED): self.repository.__exit__(None, None, None) self.repository = self.open(exclusive=exclusive) self.repository.__enter__() def add_keys(self): self.repository.put(H(0), b'foo') self.repository.put(H(1), b'bar') self.repository.put(H(3), b'bar') self.repository.commit(compact=False) self.repository.put(H(1), b'bar2') self.repository.put(H(2), b'boo') self.repository.delete(H(3)) def repo_dump(self, label=None): label = label + ': ' if label is not None else '' H_trans = {H(i): i for i in range(10)} H_trans[None] = -1 # key == None appears in commits tag_trans = {TAG_PUT: 'put', TAG_DELETE: 'del', TAG_COMMIT: 'comm'} for segment, fn in self.repository.io.segment_iterator(): for tag, key, offset, size in self.repository.io.iter_objects(segment): print("%s%s H(%d) -> %s[%d..+%d]" % (label, tag_trans[tag], H_trans[key], fn, offset, size)) print() class RepositoryTestCase(RepositoryTestCaseBase): def test1(self): for x in range(100): self.repository.put(H(x), b'SOMEDATA') key50 = H(50) self.assert_equal(self.repository.get(key50), b'SOMEDATA') self.repository.delete(key50) self.assert_raises(Repository.ObjectNotFound, lambda: self.repository.get(key50)) self.repository.commit(compact=False) self.repository.close() with self.open() as repository2: self.assert_raises(Repository.ObjectNotFound, lambda: repository2.get(key50)) for x in range(100): if x == 50: continue self.assert_equal(repository2.get(H(x)), b'SOMEDATA') def test2(self): """Test multiple sequential transactions """ self.repository.put(H(0), b'foo') self.repository.put(H(1), b'foo') self.repository.commit(compact=False) self.repository.delete(H(0)) self.repository.put(H(1), b'bar') self.repository.commit(compact=False) self.assert_equal(self.repository.get(H(1)), b'bar') def test_consistency(self): """Test cache consistency """ self.repository.put(H(0), b'foo') self.assert_equal(self.repository.get(H(0)), b'foo') self.repository.put(H(0), b'foo2') self.assert_equal(self.repository.get(H(0)), b'foo2') self.repository.put(H(0), b'bar') self.assert_equal(self.repository.get(H(0)), b'bar') self.repository.delete(H(0)) self.assert_raises(Repository.ObjectNotFound, lambda: self.repository.get(H(0))) def test_consistency2(self): """Test cache consistency2 """ self.repository.put(H(0), b'foo') self.assert_equal(self.repository.get(H(0)), b'foo') self.repository.commit(compact=False) self.repository.put(H(0), b'foo2') self.assert_equal(self.repository.get(H(0)), b'foo2') self.repository.rollback() self.assert_equal(self.repository.get(H(0)), b'foo') def test_overwrite_in_same_transaction(self): """Test cache consistency2 """ self.repository.put(H(0), b'foo') self.repository.put(H(0), b'foo2') self.repository.commit(compact=False) self.assert_equal(self.repository.get(H(0)), b'foo2') def test_single_kind_transactions(self): # put self.repository.put(H(0), b'foo') self.repository.commit(compact=False) self.repository.close() # replace self.repository = self.open() with self.repository: self.repository.put(H(0), b'bar') self.repository.commit(compact=False) # delete self.repository = self.open() with self.repository: self.repository.delete(H(0)) self.repository.commit(compact=False) def test_list(self): for x in range(100): self.repository.put(H(x), b'SOMEDATA') self.repository.commit(compact=False) all = self.repository.list() self.assert_equal(len(all), 100) first_half = self.repository.list(limit=50) self.assert_equal(len(first_half), 50) self.assert_equal(first_half, all[:50]) second_half = self.repository.list(marker=first_half[-1]) self.assert_equal(len(second_half), 50) self.assert_equal(second_half, all[50:]) self.assert_equal(len(self.repository.list(limit=50)), 50) def test_scan(self): for x in range(100): self.repository.put(H(x), b'SOMEDATA') self.repository.commit(compact=False) all = self.repository.scan() assert len(all) == 100 first_half = self.repository.scan(limit=50) assert len(first_half) == 50 assert first_half == all[:50] second_half = self.repository.scan(marker=first_half[-1]) assert len(second_half) == 50 assert second_half == all[50:] assert len(self.repository.scan(limit=50)) == 50 # check result order == on-disk order (which is hash order) for x in range(100): assert all[x] == H(x) def test_max_data_size(self): max_data = b'x' * MAX_DATA_SIZE self.repository.put(H(0), max_data) self.assert_equal(self.repository.get(H(0)), max_data) self.assert_raises(IntegrityError, lambda: self.repository.put(H(1), max_data + b'x')) class LocalRepositoryTestCase(RepositoryTestCaseBase): # test case that doesn't work with remote repositories def _assert_sparse(self): # The superseded 123456... PUT assert self.repository.compact[0] == 41 + 9 # a COMMIT assert self.repository.compact[1] == 9 # The DELETE issued by the superseding PUT (or issued directly) assert self.repository.compact[2] == 41 self.repository._rebuild_sparse(0) assert self.repository.compact[0] == 41 + 9 def test_sparse1(self): self.repository.put(H(0), b'foo') self.repository.put(H(1), b'123456789') self.repository.commit(compact=False) self.repository.put(H(1), b'bar') self._assert_sparse() def test_sparse2(self): self.repository.put(H(0), b'foo') self.repository.put(H(1), b'123456789') self.repository.commit(compact=False) self.repository.delete(H(1)) self._assert_sparse() def test_sparse_delete(self): self.repository.put(H(0), b'1245') self.repository.delete(H(0)) self.repository.io._write_fd.sync() # The on-line tracking works on a per-object basis... assert self.repository.compact[0] == 41 + 41 + 4 self.repository._rebuild_sparse(0) # ...while _rebuild_sparse can mark whole segments as completely sparse (which then includes the segment magic) assert self.repository.compact[0] == 41 + 41 + 4 + len(MAGIC) self.repository.commit(compact=True) assert 0 not in [segment for segment, _ in self.repository.io.segment_iterator()] def test_uncommitted_garbage(self): # uncommitted garbage should be no problem, it is cleaned up automatically. # we just have to be careful with invalidation of cached FDs in LoggedIO. self.repository.put(H(0), b'foo') self.repository.commit(compact=False) # write some crap to a uncommitted segment file last_segment = self.repository.io.get_latest_segment() with open(self.repository.io.segment_filename(last_segment + 1), 'wb') as f: f.write(MAGIC + b'crapcrapcrap') self.repository.close() # usually, opening the repo and starting a transaction should trigger a cleanup. self.repository = self.open() with self.repository: self.repository.put(H(0), b'bar') # this may trigger compact_segments() self.repository.commit(compact=True) # the point here is that nothing blows up with an exception. class RepositoryCommitTestCase(RepositoryTestCaseBase): def test_replay_of_missing_index(self): self.add_keys() for name in os.listdir(self.repository.path): if name.startswith('index.'): os.unlink(os.path.join(self.repository.path, name)) self.reopen() self.assert_equal(len(self.repository), 3) self.assert_equal(self.repository.check(), True) def test_crash_before_compact_segments(self): self.add_keys() self.repository.compact_segments = None try: self.repository.commit(compact=True) except TypeError: pass self.reopen() self.assert_equal(len(self.repository), 3) self.assert_equal(self.repository.check(), True) def test_crash_before_write_index(self): self.add_keys() self.repository.write_index = None try: self.repository.commit(compact=False) except TypeError: pass self.reopen() self.assert_equal(len(self.repository), 3) self.assert_equal(self.repository.check(), True) def test_replay_lock_upgrade_old(self): self.add_keys() for name in os.listdir(self.repository.path): if name.startswith('index.'): os.unlink(os.path.join(self.repository.path, name)) with patch.object(Lock, 'upgrade', side_effect=LockFailed) as upgrade: self.reopen(exclusive=None) # simulate old client that always does lock upgrades with self.repository: # the repo is only locked by a shared read lock, but to replay segments, # we need an exclusive write lock - check if the lock gets upgraded. self.assert_raises(LockFailed, lambda: len(self.repository)) upgrade.assert_called_once_with() def test_replay_lock_upgrade(self): self.add_keys() for name in os.listdir(self.repository.path): if name.startswith('index.'): os.unlink(os.path.join(self.repository.path, name)) with patch.object(Lock, 'upgrade', side_effect=LockFailed) as upgrade: self.reopen(exclusive=False) # current client usually does not do lock upgrade, except for replay with self.repository: # the repo is only locked by a shared read lock, but to replay segments, # we need an exclusive write lock - check if the lock gets upgraded. self.assert_raises(LockFailed, lambda: len(self.repository)) upgrade.assert_called_once_with() def test_crash_before_deleting_compacted_segments(self): self.add_keys() self.repository.io.delete_segment = None try: self.repository.commit(compact=False) except TypeError: pass self.reopen() self.assert_equal(len(self.repository), 3) self.assert_equal(self.repository.check(), True) self.assert_equal(len(self.repository), 3) def test_ignores_commit_tag_in_data(self): self.repository.put(H(0), LoggedIO.COMMIT) self.reopen() io = self.repository.io assert not io.is_committed_segment(io.get_latest_segment()) def test_moved_deletes_are_tracked(self): self.repository.put(H(1), b'1') self.repository.put(H(2), b'2') self.repository.commit(compact=False) self.repo_dump('p1 p2 c') self.repository.delete(H(1)) self.repository.commit(compact=True) self.repo_dump('d1 cc') last_segment = self.repository.io.get_latest_segment() - 1 num_deletes = 0 for tag, key, offset, size in self.repository.io.iter_objects(last_segment): if tag == TAG_DELETE: assert key == H(1) num_deletes += 1 assert num_deletes == 1 assert last_segment in self.repository.compact self.repository.put(H(3), b'3') self.repository.commit(compact=True) self.repo_dump('p3 cc') assert last_segment not in self.repository.compact assert not self.repository.io.segment_exists(last_segment) for segment, _ in self.repository.io.segment_iterator(): for tag, key, offset, size in self.repository.io.iter_objects(segment): assert tag != TAG_DELETE assert key != H(1) # after compaction, there should be no empty shadowed_segments lists left over. # we have no put or del any more for H(1), so we lost knowledge about H(1). assert H(1) not in self.repository.shadow_index def test_shadowed_entries_are_preserved1(self): # this tests the shadowing-by-del behaviour get_latest_segment = self.repository.io.get_latest_segment self.repository.put(H(1), b'1') # This is the segment with our original PUT of interest put_segment = get_latest_segment() self.repository.commit(compact=False) # We now delete H(1), and force this segment to not be compacted, which can happen # if it's not sparse enough (symbolized by H(2) here). self.repository.delete(H(1)) self.repository.put(H(2), b'1') delete_segment = get_latest_segment() # We pretend these are mostly dense (not sparse) and won't be compacted del self.repository.compact[put_segment] del self.repository.compact[delete_segment] self.repository.commit(compact=True) # Now we perform an unrelated operation on the segment containing the DELETE, # causing it to be compacted. self.repository.delete(H(2)) self.repository.commit(compact=True) assert self.repository.io.segment_exists(put_segment) assert not self.repository.io.segment_exists(delete_segment) # Basic case, since the index survived this must be ok assert H(1) not in self.repository # Nuke index, force replay os.unlink(os.path.join(self.repository.path, 'index.%d' % get_latest_segment())) # Must not reappear assert H(1) not in self.repository def test_shadowed_entries_are_preserved2(self): # this tests the shadowing-by-double-put behaviour, see issue #5661 # assume this repo state: # seg1: PUT H1 # seg2: COMMIT # seg3: DEL H1, PUT H1, DEL H1, PUT H2 # seg4: COMMIT # Note how due to the final DEL H1 in seg3, H1 is effectively deleted. # # compaction of only seg3: # PUT H1 gets dropped because it is not needed any more. # DEL H1 must be kept, because there is still a PUT H1 in seg1 which must not # "reappear" in the index if the index gets rebuilt. get_latest_segment = self.repository.io.get_latest_segment self.repository.put(H(1), b'1') # This is the segment with our original PUT of interest put_segment = get_latest_segment() self.repository.commit(compact=False) # We now put H(1) again (which implicitly does DEL(H(1)) followed by PUT(H(1), ...)), # delete H(1) afterwards, and force this segment to not be compacted, which can happen # if it's not sparse enough (symbolized by H(2) here). self.repository.put(H(1), b'1') self.repository.delete(H(1)) self.repository.put(H(2), b'1') delete_segment = get_latest_segment() # We pretend these are mostly dense (not sparse) and won't be compacted del self.repository.compact[put_segment] del self.repository.compact[delete_segment] self.repository.commit(compact=True) # Now we perform an unrelated operation on the segment containing the DELETE, # causing it to be compacted. self.repository.delete(H(2)) self.repository.commit(compact=True) assert self.repository.io.segment_exists(put_segment) assert not self.repository.io.segment_exists(delete_segment) # Basic case, since the index survived this must be ok assert H(1) not in self.repository # Nuke index, force replay os.unlink(os.path.join(self.repository.path, 'index.%d' % get_latest_segment())) # Must not reappear assert H(1) not in self.repository def test_shadow_index_rollback(self): self.repository.put(H(1), b'1') self.repository.delete(H(1)) assert self.repository.shadow_index[H(1)] == [0] self.repository.commit(compact=True) self.repo_dump('p1 d1 cc') # note how an empty list means that nothing is shadowed for sure assert self.repository.shadow_index[H(1)] == [] # because the delete is considered unstable self.repository.put(H(1), b'1') self.repository.delete(H(1)) self.repo_dump('p1 d1') # 0 put/delete; 1 commit; 2 compacted; 3 commit; 4 put/delete assert self.repository.shadow_index[H(1)] == [4] self.repository.rollback() self.repo_dump('r') self.repository.put(H(2), b'1') # After the rollback segment 4 shouldn't be considered anymore assert self.repository.shadow_index[H(1)] == [] # because the delete is considered unstable class RepositoryAppendOnlyTestCase(RepositoryTestCaseBase): def open(self, create=False): return Repository(os.path.join(self.tmppath, 'repository'), exclusive=True, create=create, append_only=True) def test_destroy_append_only(self): # Can't destroy append only repo (via the API) with self.assert_raises(ValueError): self.repository.destroy() assert self.repository.append_only def test_append_only(self): def segments_in_repository(): return len(list(self.repository.io.segment_iterator())) self.repository.put(H(0), b'foo') self.repository.commit(compact=False) self.repository.append_only = False assert segments_in_repository() == 2 self.repository.put(H(0), b'foo') self.repository.commit(compact=True) # normal: compact squashes the data together, only one segment assert segments_in_repository() == 2 self.repository.append_only = True assert segments_in_repository() == 2 self.repository.put(H(0), b'foo') self.repository.commit(compact=False) # append only: does not compact, only new segments written assert segments_in_repository() == 4 class RepositoryFreeSpaceTestCase(RepositoryTestCaseBase): def test_additional_free_space(self): self.add_keys() self.repository.config.set('repository', 'additional_free_space', '1000T') self.repository.save_key(b'shortcut to save_config') self.reopen() self.repository.put(H(0), b'foobar') with pytest.raises(Repository.InsufficientFreeSpaceError): self.repository.commit(compact=False) assert os.path.exists(self.repository.path) def test_create_free_space(self): self.repository.additional_free_space = 1e20 with pytest.raises(Repository.InsufficientFreeSpaceError): self.add_keys() assert not os.path.exists(self.repository.path) class QuotaTestCase(RepositoryTestCaseBase): def test_tracking(self): assert self.repository.storage_quota_use == 0 self.repository.put(H(1), bytes(1234)) assert self.repository.storage_quota_use == 1234 + 41 self.repository.put(H(2), bytes(5678)) assert self.repository.storage_quota_use == 1234 + 5678 + 2 * 41 self.repository.delete(H(1)) assert self.repository.storage_quota_use == 1234 + 5678 + 2 * 41 # we have not compacted yet self.repository.commit(compact=False) assert self.repository.storage_quota_use == 1234 + 5678 + 2 * 41 # we have not compacted yet self.reopen() # Open new transaction; hints and thus quota data is not loaded unless needed. self.repository.put(H(3), b'') self.repository.delete(H(3)) assert self.repository.storage_quota_use == 1234 + 5678 + 3 * 41 # we have not compacted yet self.repository.commit(compact=True) assert self.repository.storage_quota_use == 5678 + 41 def test_exceed_quota(self): assert self.repository.storage_quota_use == 0 self.repository.storage_quota = 50 self.repository.put(H(1), b'') assert self.repository.storage_quota_use == 41 self.repository.commit(compact=False) with pytest.raises(Repository.StorageQuotaExceeded): self.repository.put(H(2), b'') assert self.repository.storage_quota_use == 82 with pytest.raises(Repository.StorageQuotaExceeded): self.repository.commit(compact=False) assert self.repository.storage_quota_use == 82 self.reopen() self.repository.storage_quota = 100 # Open new transaction; hints and thus quota data is not loaded unless needed. self.repository.put(H(1), b'') assert self.repository.storage_quota_use == 82 # we have 2 puts for H(1) here and not yet compacted. self.repository.commit(compact=True) assert self.repository.storage_quota_use == 41 # now we have compacted. class NonceReservation(RepositoryTestCaseBase): def test_get_free_nonce_asserts(self): self.reopen(exclusive=False) with pytest.raises(AssertionError): with self.repository: self.repository.get_free_nonce() def test_get_free_nonce(self): with self.repository: assert self.repository.get_free_nonce() is None with open(os.path.join(self.repository.path, "nonce"), "w") as fd: fd.write("0000000000000000") assert self.repository.get_free_nonce() == 0 with open(os.path.join(self.repository.path, "nonce"), "w") as fd: fd.write("5000000000000000") assert self.repository.get_free_nonce() == 0x5000000000000000 def test_commit_nonce_reservation_asserts(self): self.reopen(exclusive=False) with pytest.raises(AssertionError): with self.repository: self.repository.commit_nonce_reservation(0x200, 0x100) def test_commit_nonce_reservation(self): with self.repository: with pytest.raises(Exception): self.repository.commit_nonce_reservation(0x200, 15) self.repository.commit_nonce_reservation(0x200, None) with open(os.path.join(self.repository.path, "nonce")) as fd: assert fd.read() == "0000000000000200" with pytest.raises(Exception): self.repository.commit_nonce_reservation(0x200, 15) self.repository.commit_nonce_reservation(0x400, 0x200) with open(os.path.join(self.repository.path, "nonce")) as fd: assert fd.read() == "0000000000000400" class RepositoryAuxiliaryCorruptionTestCase(RepositoryTestCaseBase): def setUp(self): super().setUp() self.repository.put(H(0), b'foo') self.repository.commit(compact=False) self.repository.close() def do_commit(self): with self.repository: self.repository.put(H(0), b'fox') self.repository.commit(compact=False) def test_corrupted_hints(self): with open(os.path.join(self.repository.path, 'hints.1'), 'ab') as fd: fd.write(b'123456789') self.do_commit() def test_deleted_hints(self): os.unlink(os.path.join(self.repository.path, 'hints.1')) self.do_commit() def test_deleted_index(self): os.unlink(os.path.join(self.repository.path, 'index.1')) self.do_commit() def test_unreadable_hints(self): hints = os.path.join(self.repository.path, 'hints.1') os.unlink(hints) os.mkdir(hints) with self.assert_raises(OSError): self.do_commit() def test_index(self): with open(os.path.join(self.repository.path, 'index.1'), 'wb') as fd: fd.write(b'123456789') self.do_commit() def test_index_outside_transaction(self): with open(os.path.join(self.repository.path, 'index.1'), 'wb') as fd: fd.write(b'123456789') with self.repository: assert len(self.repository) == 1 def _corrupt_index(self): # HashIndex is able to detect incorrect headers and file lengths, # but on its own it can't tell if the data is correct. index_path = os.path.join(self.repository.path, 'index.1') with open(index_path, 'r+b') as fd: index_data = fd.read() # Flip one bit in a key stored in the index corrupted_key = (int.from_bytes(H(0), 'little') ^ 1).to_bytes(32, 'little') corrupted_index_data = index_data.replace(H(0), corrupted_key) assert corrupted_index_data != index_data assert len(corrupted_index_data) == len(index_data) fd.seek(0) fd.write(corrupted_index_data) def test_index_corrupted(self): # HashIndex is able to detect incorrect headers and file lengths, # but on its own it can't tell if the data itself is correct. self._corrupt_index() with self.repository: # Data corruption is detected due to mismatching checksums # and fixed by rebuilding the index. assert len(self.repository) == 1 assert self.repository.get(H(0)) == b'foo' def test_index_corrupted_without_integrity(self): self._corrupt_index() integrity_path = os.path.join(self.repository.path, 'integrity.1') os.unlink(integrity_path) with self.repository: # Since the corrupted key is not noticed, the repository still thinks # it contains one key... assert len(self.repository) == 1 with pytest.raises(Repository.ObjectNotFound): # ... but the real, uncorrupted key is not found in the corrupted index. self.repository.get(H(0)) def test_unreadable_index(self): index = os.path.join(self.repository.path, 'index.1') os.unlink(index) os.mkdir(index) with self.assert_raises(OSError): self.do_commit() def test_unknown_integrity_version(self): # For now an unknown integrity data version is ignored and not an error. integrity_path = os.path.join(self.repository.path, 'integrity.1') with open(integrity_path, 'r+b') as fd: msgpack.pack({ # Borg only understands version 2 b'version': 4.7, }, fd) fd.truncate() with self.repository: # No issues accessing the repository assert len(self.repository) == 1 assert self.repository.get(H(0)) == b'foo' def _subtly_corrupted_hints_setup(self): with self.repository: self.repository.append_only = True assert len(self.repository) == 1 assert self.repository.get(H(0)) == b'foo' self.repository.put(H(1), b'bar') self.repository.put(H(2), b'baz') self.repository.commit(compact=False) self.repository.put(H(2), b'bazz') self.repository.commit(compact=False) hints_path = os.path.join(self.repository.path, 'hints.5') with open(hints_path, 'r+b') as fd: hints = msgpack.unpack(fd) fd.seek(0) # Corrupt segment refcount assert hints[b'segments'][2] == 1 hints[b'segments'][2] = 0 msgpack.pack(hints, fd) fd.truncate() def test_subtly_corrupted_hints(self): self._subtly_corrupted_hints_setup() with self.repository: self.repository.append_only = False self.repository.put(H(3), b'1234') # Do a compaction run. Succeeds, since the failed checksum prompted a rebuild of the index+hints. self.repository.commit(compact=True) assert len(self.repository) == 4 assert self.repository.get(H(0)) == b'foo' assert self.repository.get(H(1)) == b'bar' assert self.repository.get(H(2)) == b'bazz' def test_subtly_corrupted_hints_without_integrity(self): self._subtly_corrupted_hints_setup() integrity_path = os.path.join(self.repository.path, 'integrity.5') os.unlink(integrity_path) with self.repository: self.repository.append_only = False self.repository.put(H(3), b'1234') # Do a compaction run. Fails, since the corrupted refcount was not detected and leads to an assertion failure. with pytest.raises(AssertionError) as exc_info: self.repository.commit(compact=True) assert 'Corrupted segment reference count' in str(exc_info.value) class RepositoryCheckTestCase(RepositoryTestCaseBase): def list_indices(self): return [name for name in os.listdir(os.path.join(self.tmppath, 'repository')) if name.startswith('index.')] def check(self, repair=False, status=True): self.assert_equal(self.repository.check(repair=repair), status) # Make sure no tmp files are left behind self.assert_equal([name for name in os.listdir(os.path.join(self.tmppath, 'repository')) if 'tmp' in name], [], 'Found tmp files') def get_objects(self, *ids): for id_ in ids: self.repository.get(H(id_)) def add_objects(self, segments): for ids in segments: for id_ in ids: self.repository.put(H(id_), b'data') self.repository.commit(compact=False) def get_head(self): return sorted(int(n) for n in os.listdir(os.path.join(self.tmppath, 'repository', 'data', '0')) if n.isdigit())[-1] def open_index(self): return NSIndex.read(os.path.join(self.tmppath, 'repository', f'index.{self.get_head()}')) def corrupt_object(self, id_): idx = self.open_index() segment, offset = idx[H(id_)] with open(os.path.join(self.tmppath, 'repository', 'data', '0', str(segment)), 'r+b') as fd: fd.seek(offset) fd.write(b'BOOM') def delete_segment(self, segment): self.repository.io.delete_segment(segment) def delete_index(self): os.unlink(os.path.join(self.tmppath, 'repository', f'index.{self.get_head()}')) def rename_index(self, new_name): os.rename(os.path.join(self.tmppath, 'repository', f'index.{self.get_head()}'), os.path.join(self.tmppath, 'repository', new_name)) def list_objects(self): return {int(key) for key in self.repository.list()} def test_repair_corrupted_segment(self): self.add_objects([[1, 2, 3], [4, 5], [6]]) self.assert_equal({1, 2, 3, 4, 5, 6}, self.list_objects()) self.check(status=True) self.corrupt_object(5) self.assert_raises(IntegrityError, lambda: self.get_objects(5)) self.repository.rollback() # Make sure a regular check does not repair anything self.check(status=False) self.check(status=False) # Make sure a repair actually repairs the repo self.check(repair=True, status=True) self.get_objects(4) self.check(status=True) self.assert_equal({1, 2, 3, 4, 6}, self.list_objects()) def test_repair_missing_segment(self): self.add_objects([[1, 2, 3], [4, 5, 6]]) self.assert_equal({1, 2, 3, 4, 5, 6}, self.list_objects()) self.check(status=True) self.delete_segment(2) self.repository.rollback() self.check(repair=True, status=True) self.assert_equal({1, 2, 3}, self.list_objects()) def test_repair_missing_commit_segment(self): self.add_objects([[1, 2, 3], [4, 5, 6]]) self.delete_segment(3) self.assert_raises(Repository.ObjectNotFound, lambda: self.get_objects(4)) self.assert_equal({1, 2, 3}, self.list_objects()) def test_repair_corrupted_commit_segment(self): self.add_objects([[1, 2, 3], [4, 5, 6]]) with open(os.path.join(self.tmppath, 'repository', 'data', '0', '3'), 'r+b') as fd: fd.seek(-1, os.SEEK_END) fd.write(b'X') self.assert_raises(Repository.ObjectNotFound, lambda: self.get_objects(4)) self.check(status=True) self.get_objects(3) self.assert_equal({1, 2, 3}, self.list_objects()) def test_repair_no_commits(self): self.add_objects([[1, 2, 3]]) with open(os.path.join(self.tmppath, 'repository', 'data', '0', '1'), 'r+b') as fd: fd.seek(-1, os.SEEK_END) fd.write(b'X') self.assert_raises(Repository.CheckNeeded, lambda: self.get_objects(4)) self.check(status=False) self.check(status=False) self.assert_equal(self.list_indices(), ['index.1']) self.check(repair=True, status=True) self.assert_equal(self.list_indices(), ['index.2']) self.check(status=True) self.get_objects(3) self.assert_equal({1, 2, 3}, self.list_objects()) def test_repair_missing_index(self): self.add_objects([[1, 2, 3], [4, 5, 6]]) self.delete_index() self.check(status=True) self.get_objects(4) self.assert_equal({1, 2, 3, 4, 5, 6}, self.list_objects()) def test_repair_index_too_new(self): self.add_objects([[1, 2, 3], [4, 5, 6]]) self.assert_equal(self.list_indices(), ['index.3']) self.rename_index('index.100') self.check(status=True) self.assert_equal(self.list_indices(), ['index.3']) self.get_objects(4) self.assert_equal({1, 2, 3, 4, 5, 6}, self.list_objects()) def test_crash_before_compact(self): self.repository.put(H(0), b'data') self.repository.put(H(0), b'data2') # Simulate a crash before compact with patch.object(Repository, 'compact_segments') as compact: self.repository.commit(compact=True) compact.assert_called_once_with(0.1) self.reopen() self.check(repair=True) self.assert_equal(self.repository.get(H(0)), b'data2') class RepositoryHintsTestCase(RepositoryTestCaseBase): def test_hints_persistence(self): self.repository.put(H(0), b'data') self.repository.delete(H(0)) self.repository.commit(compact=False) shadow_index_expected = self.repository.shadow_index compact_expected = self.repository.compact segments_expected = self.repository.segments # close and re-open the repository (create fresh Repository instance) to # check whether hints were persisted to / reloaded from disk self.reopen() # see also do_compact() self.repository.put(H(42), b'foobar') # this will call prepare_txn() and load the hints data # check if hints persistence worked: self.assert_equal(shadow_index_expected, self.repository.shadow_index) self.assert_equal(compact_expected, self.repository.compact) del self.repository.segments[2] # ignore the segment created by put(H(42), ...) self.assert_equal(segments_expected, self.repository.segments) self.reopen() self.assert_equal(self.repository.check(repair=True), True) self.reopen() self.repository.put(H(42), b'foobar') # this will call prepare_txn() and load the hints data self.assert_equal(shadow_index_expected, self.repository.shadow_index) # sizes do not match, with vs. without header? # self.assert_equal(compact_expected, self.repository.compact) del self.repository.segments[2] # ignore the segment created by put(H(42), ...) self.assert_equal(segments_expected, self.repository.segments) def test_hints_behaviour(self): self.repository.put(H(0), b'data') self.assert_equal(self.repository.shadow_index, {}) assert len(self.repository.compact) == 0 self.repository.delete(H(0)) self.repository.commit(compact=False) # now there should be an entry for H(0) in shadow_index self.assert_in(H(0), self.repository.shadow_index) self.assert_equal(len(self.repository.shadow_index[H(0)]), 1) self.assert_in(0, self.repository.compact) # segment 0 can be compacted self.repository.put(H(42), b'foobar') # see also do_compact() self.repository.commit(compact=True, threshold=0.0) # compact completely! # nothing to compact any more! no info left about stuff that does not exist any more: self.assert_not_in(H(0), self.repository.shadow_index) # segment 0 was compacted away, no info about it left: self.assert_not_in(0, self.repository.compact) self.assert_not_in(0, self.repository.segments) class RemoteRepositoryTestCase(RepositoryTestCase): repository = None # type: RemoteRepository def open(self, create=False): return RemoteRepository(Location('__testsuite__:' + os.path.join(self.tmppath, 'repository')), exclusive=True, create=create) def _get_mock_args(self): class MockArgs: remote_path = 'borg' umask = 0o077 debug_topics = [] rsh = None def __contains__(self, item): # To behave like argparse.Namespace return hasattr(self, item) return MockArgs() def test_invalid_rpc(self): self.assert_raises(InvalidRPCMethod, lambda: self.repository.call('__init__', {})) def test_rpc_exception_transport(self): s1 = 'test string' try: self.repository.call('inject_exception', {'kind': 'DoesNotExist'}) except Repository.DoesNotExist as e: assert len(e.args) == 1 assert e.args[0] == self.repository.location.processed try: self.repository.call('inject_exception', {'kind': 'AlreadyExists'}) except Repository.AlreadyExists as e: assert len(e.args) == 1 assert e.args[0] == self.repository.location.processed try: self.repository.call('inject_exception', {'kind': 'CheckNeeded'}) except Repository.CheckNeeded as e: assert len(e.args) == 1 assert e.args[0] == self.repository.location.processed try: self.repository.call('inject_exception', {'kind': 'IntegrityError'}) except IntegrityError as e: assert len(e.args) == 1 assert e.args[0] == s1 try: self.repository.call('inject_exception', {'kind': 'PathNotAllowed'}) except PathNotAllowed as e: assert len(e.args) == 1 assert e.args[0] == 'foo' try: self.repository.call('inject_exception', {'kind': 'ObjectNotFound'}) except Repository.ObjectNotFound as e: assert len(e.args) == 2 assert e.args[0] == s1 assert e.args[1] == self.repository.location.processed try: self.repository.call('inject_exception', {'kind': 'InvalidRPCMethod'}) except InvalidRPCMethod as e: assert len(e.args) == 1 assert e.args[0] == s1 try: self.repository.call('inject_exception', {'kind': 'divide'}) except RemoteRepository.RPCError as e: assert e.unpacked assert e.get_message() == 'ZeroDivisionError: integer division or modulo by zero\n' assert e.exception_class == 'ZeroDivisionError' assert len(e.exception_full) > 0 def test_ssh_cmd(self): args = self._get_mock_args() self.repository._args = args assert self.repository.ssh_cmd(Location('example.com:foo')) == ['ssh', 'example.com'] assert self.repository.ssh_cmd(Location('ssh://example.com/foo')) == ['ssh', 'example.com'] assert self.repository.ssh_cmd(Location('ssh://user@example.com/foo')) == ['ssh', 'user@example.com'] assert self.repository.ssh_cmd(Location('ssh://user@example.com:1234/foo')) == ['ssh', '-p', '1234', 'user@example.com'] os.environ['BORG_RSH'] = 'ssh --foo' assert self.repository.ssh_cmd(Location('example.com:foo')) == ['ssh', '--foo', 'example.com'] def test_borg_cmd(self): assert self.repository.borg_cmd(None, testing=True) == [sys.executable, '-m', 'borg.archiver', 'serve'] args = self._get_mock_args() # XXX without next line we get spurious test fails when using pytest-xdist, root cause unknown: logging.getLogger().setLevel(logging.INFO) # note: test logger is on info log level, so --info gets added automagically assert self.repository.borg_cmd(args, testing=False) == ['borg', 'serve', '--info'] args.remote_path = 'borg-0.28.2' assert self.repository.borg_cmd(args, testing=False) == ['borg-0.28.2', 'serve', '--info'] args.debug_topics = ['something_client_side', 'repository_compaction'] assert self.repository.borg_cmd(args, testing=False) == ['borg-0.28.2', 'serve', '--info', '--debug-topic=borg.debug.repository_compaction'] args = self._get_mock_args() args.storage_quota = 0 assert self.repository.borg_cmd(args, testing=False) == ['borg', 'serve', '--info'] args.storage_quota = 314159265 assert self.repository.borg_cmd(args, testing=False) == ['borg', 'serve', '--info', '--storage-quota=314159265'] args.rsh = 'ssh -i foo' self.repository._args = args assert self.repository.ssh_cmd(Location('example.com:foo')) == ['ssh', '-i', 'foo', 'example.com'] class RemoteLegacyFree(RepositoryTestCaseBase): # Keep testing this so we can someday safely remove the legacy tuple format. def open(self, create=False): with patch.object(RemoteRepository, 'dictFormat', True): return RemoteRepository(Location('__testsuite__:' + os.path.join(self.tmppath, 'repository')), exclusive=True, create=create) def test_legacy_free(self): # put self.repository.put(H(0), b'foo') self.repository.commit(compact=False) self.repository.close() # replace self.repository = self.open() with self.repository: self.repository.put(H(0), b'bar') self.repository.commit(compact=False) # delete self.repository = self.open() with self.repository: self.repository.delete(H(0)) self.repository.commit(compact=False) class RemoteRepositoryCheckTestCase(RepositoryCheckTestCase): def open(self, create=False): return RemoteRepository(Location('__testsuite__:' + os.path.join(self.tmppath, 'repository')), exclusive=True, create=create) def test_crash_before_compact(self): # skip this test, we can't mock-patch a Repository class in another process! pass def test_repair_missing_commit_segment(self): # skip this test, files in RemoteRepository cannot be deleted pass def test_repair_missing_segment(self): # skip this test, files in RemoteRepository cannot be deleted pass class RemoteLoggerTestCase(BaseTestCase): def setUp(self): self.stream = io.StringIO() self.handler = logging.StreamHandler(self.stream) logging.getLogger().handlers[:] = [self.handler] logging.getLogger('borg.repository').handlers[:] = [] logging.getLogger('borg.repository.foo').handlers[:] = [] # capture stderr sys.stderr.flush() self.old_stderr = sys.stderr self.stderr = sys.stderr = io.StringIO() def tearDown(self): sys.stderr = self.old_stderr def test_stderr_messages(self): handle_remote_line("unstructured stderr message\n") self.assert_equal(self.stream.getvalue(), '') # stderr messages don't get an implicit newline self.assert_equal(self.stderr.getvalue(), 'Remote: unstructured stderr message\n') def test_stderr_progress_messages(self): handle_remote_line("unstructured stderr progress message\r") self.assert_equal(self.stream.getvalue(), '') # stderr messages don't get an implicit newline self.assert_equal(self.stderr.getvalue(), 'Remote: unstructured stderr progress message\r') def test_pre11_format_messages(self): self.handler.setLevel(logging.DEBUG) logging.getLogger().setLevel(logging.DEBUG) handle_remote_line("$LOG INFO Remote: borg < 1.1 format message\n") self.assert_equal(self.stream.getvalue(), 'Remote: borg < 1.1 format message\n') self.assert_equal(self.stderr.getvalue(), '') def test_post11_format_messages(self): self.handler.setLevel(logging.DEBUG) logging.getLogger().setLevel(logging.DEBUG) handle_remote_line("$LOG INFO borg.repository Remote: borg >= 1.1 format message\n") self.assert_equal(self.stream.getvalue(), 'Remote: borg >= 1.1 format message\n') self.assert_equal(self.stderr.getvalue(), '') def test_remote_messages_screened(self): # default borg config for root logger self.handler.setLevel(logging.WARNING) logging.getLogger().setLevel(logging.WARNING) handle_remote_line("$LOG INFO borg.repository Remote: new format info message\n") self.assert_equal(self.stream.getvalue(), '') self.assert_equal(self.stderr.getvalue(), '') def test_info_to_correct_local_child(self): logging.getLogger('borg.repository').setLevel(logging.INFO) logging.getLogger('borg.repository.foo').setLevel(logging.INFO) # default borg config for root logger self.handler.setLevel(logging.WARNING) logging.getLogger().setLevel(logging.WARNING) child_stream = io.StringIO() child_handler = logging.StreamHandler(child_stream) child_handler.setLevel(logging.INFO) logging.getLogger('borg.repository').handlers[:] = [child_handler] foo_stream = io.StringIO() foo_handler = logging.StreamHandler(foo_stream) foo_handler.setLevel(logging.INFO) logging.getLogger('borg.repository.foo').handlers[:] = [foo_handler] handle_remote_line("$LOG INFO borg.repository Remote: new format child message\n") self.assert_equal(foo_stream.getvalue(), '') self.assert_equal(child_stream.getvalue(), 'Remote: new format child message\n') self.assert_equal(self.stream.getvalue(), '') self.assert_equal(self.stderr.getvalue(), '') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/testsuite/shellpattern.py0000644000076500000240000000614114641074756021060 0ustar00twstaffimport re import pytest from .. import shellpattern def check(path, pattern): compiled = re.compile(shellpattern.translate(pattern)) return bool(compiled.match(path)) @pytest.mark.parametrize("path, patterns", [ # Literal string ("foo/bar", ["foo/bar"]), ("foo\\bar", ["foo\\bar"]), # Non-ASCII ("foo/c/\u0152/e/bar", ["foo/*/\u0152/*/bar", "*/*/\u0152/*/*", "**/\u0152/*/*"]), ("\u00e4\u00f6\u00dc", ["???", "*", "\u00e4\u00f6\u00dc", "[\u00e4][\u00f6][\u00dc]"]), # Question mark ("foo", ["fo?"]), ("foo", ["f?o"]), ("foo", ["f??"]), ("foo", ["?oo"]), ("foo", ["?o?"]), ("foo", ["??o"]), ("foo", ["???"]), # Single asterisk ("", ["*"]), ("foo", ["*", "**", "***"]), ("foo", ["foo*"]), ("foobar", ["foo*"]), ("foobar", ["foo*bar"]), ("foobarbaz", ["foo*baz"]), ("bar", ["*bar"]), ("foobar", ["*bar"]), ("foo/bar", ["foo/*bar"]), ("foo/bar", ["foo/*ar"]), ("foo/bar", ["foo/*r"]), ("foo/bar", ["foo/*"]), ("foo/bar", ["foo*/bar"]), ("foo/bar", ["fo*/bar"]), ("foo/bar", ["f*/bar"]), ("foo/bar", ["*/bar"]), # Double asterisk (matches 0..n directory layers) ("foo/bar", ["foo/**/bar"]), ("foo/1/bar", ["foo/**/bar"]), ("foo/1/22/333/bar", ["foo/**/bar"]), ("foo/", ["foo/**/"]), ("foo/1/", ["foo/**/"]), ("foo/1/22/333/", ["foo/**/"]), ("bar", ["**/bar"]), ("1/bar", ["**/bar"]), ("1/22/333/bar", ["**/bar"]), ("foo/bar/baz", ["foo/**/*"]), # Set ("foo1", ["foo[12]"]), ("foo2", ["foo[12]"]), ("foo2/bar", ["foo[12]/*"]), ("f??f", ["f??f", "f[?][?]f"]), ("foo]", ["foo[]]"]), # Inverted set ("foo3", ["foo[!12]"]), ("foo^", ["foo[^!]"]), ("foo!", ["foo[^!]"]), ]) def test_match(path, patterns): for p in patterns: assert check(path, p) @pytest.mark.parametrize("path, patterns", [ ("", ["?", "[]"]), ("foo", ["foo?"]), ("foo", ["?foo"]), ("foo", ["f?oo"]), # do not match path separator ("foo/ar", ["foo?ar"]), # do not match/cross over os.path.sep ("foo/bar", ["*"]), ("foo/bar", ["foo*bar"]), ("foo/bar", ["foo*ar"]), ("foo/bar", ["fo*bar"]), ("foo/bar", ["fo*ar"]), # Double asterisk ("foobar", ["foo/**/bar"]), # Two asterisks without slash do not match directory separator ("foo/bar", ["**"]), # Double asterisk not matching filename ("foo/bar", ["**/"]), # Set ("foo3", ["foo[12]"]), # Inverted set ("foo1", ["foo[!12]"]), ("foo2", ["foo[!12]"]), ]) def test_mismatch(path, patterns): for p in patterns: assert not check(path, p) def test_match_end(): regex = shellpattern.translate("*-home") # default is match_end == string end assert re.match(regex, '2017-07-03-home') assert not re.match(regex, '2017-07-03-home.checkpoint') match_end = r'(%s)?\Z' % r'\.checkpoint(\.\d+)?' # with/without checkpoint ending regex = shellpattern.translate("*-home", match_end=match_end) assert re.match(regex, '2017-07-03-home') assert re.match(regex, '2017-07-03-home.checkpoint') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/testsuite/upgrader.py0000644000076500000240000001536414641074756020173 0ustar00twstaffimport os import tarfile import pytest from ..constants import * # NOQA from ..crypto.key import KeyfileKey from ..upgrader import AtticRepositoryUpgrader, AtticKeyfileKey from ..helpers import get_keys_dir from ..repository import Repository from . import are_hardlinks_supported # tar with a repo and repo keyfile from attic ATTIC_TAR = os.path.join(os.path.dirname(__file__), 'attic.tar.gz') def untar(tarfname, path, what): """ extract tar archive to , all stuff starting with . return path to . """ def files(members): for tarinfo in members: if tarinfo.name.startswith(what): yield tarinfo with tarfile.open(tarfname, 'r') as tf: tf.extractall(path, members=files(tf)) return os.path.join(path, what) def repo_valid(path): """ utility function to check if borg can open a repository :param path: the path to the repository :returns: if borg can check the repository """ with Repository(str(path), exclusive=True, create=False) as repository: # can't check raises() because check() handles the error return repository.check() def key_valid(path): """ check that the new keyfile is alright :param path: the path to the key file :returns: if the file starts with the borg magic string """ keyfile = os.path.join(get_keys_dir(), os.path.basename(path)) with open(keyfile) as f: return f.read().startswith(KeyfileKey.FILE_ID) def make_attic_repo(dir): """ create an attic repo with some stuff in it :param dir: path to the repository to be created :returns: path to attic repository """ # there is some stuff in that repo, copied from `RepositoryTestCase.test1` return untar(ATTIC_TAR, str(dir), 'repo') @pytest.fixture() def attic_repo(tmpdir): return make_attic_repo(tmpdir) @pytest.fixture(params=[True, False]) def inplace(request): return request.param def test_convert_segments(attic_repo, inplace): """test segment conversion this will load the given attic repository, list all the segments then convert them one at a time. we need to close the repo before conversion otherwise we have errors from borg :param attic_repo: a populated attic repository (fixture) """ repo_path = attic_repo with pytest.raises(Repository.AtticRepository): repo_valid(repo_path) repository = AtticRepositoryUpgrader(repo_path, create=False) with repository: segments = [filename for i, filename in repository.io.segment_iterator()] repository.convert_segments(segments, dryrun=False, inplace=inplace) repository.convert_cache(dryrun=False) assert repo_valid(repo_path) @pytest.fixture() def attic_key_file(tmpdir, monkeypatch): """ create an attic key file from the given repo, in the keys subdirectory of the given tmpdir :param tmpdir: a temporary directory (a builtin fixture) :returns: path to key file """ keys_dir = untar(ATTIC_TAR, str(tmpdir), 'keys') # we use the repo dir for the created keyfile, because we do # not want to clutter existing keyfiles monkeypatch.setenv('ATTIC_KEYS_DIR', keys_dir) # we use the same directory for the converted files, which # will clutter the previously created one, which we don't care # about anyways. in real runs, the original key will be retained. monkeypatch.setenv('BORG_KEYS_DIR', keys_dir) monkeypatch.setenv('ATTIC_PASSPHRASE', 'test') return os.path.join(keys_dir, 'repo') def test_keys(attic_repo, attic_key_file): """test key conversion test that we can convert the given key to a properly formatted borg key. assumes that the ATTIC_KEYS_DIR and BORG_KEYS_DIR have been properly populated by the attic_key_file fixture. :param attic_repo: path to an attic repository (fixture defined above) :param attic_key_file: path to an attic key file (fixture defined above) """ keyfile_path = attic_key_file assert not key_valid(keyfile_path) # not upgraded yet with AtticRepositoryUpgrader(attic_repo, create=False) as repository: keyfile = AtticKeyfileKey.find_key_file(repository) AtticRepositoryUpgrader.convert_keyfiles(keyfile, dryrun=False) assert key_valid(keyfile_path) @pytest.mark.skipif(not are_hardlinks_supported(), reason='hardlinks not supported') def test_convert_all(attic_repo, attic_key_file, inplace): """test all conversion steps this runs everything. mostly redundant test, since everything is done above. yet we expect a NotImplementedError because we do not convert caches yet. :param attic_repo: path to an attic repository (fixture defined above) :param attic_key_file: path to an attic key file (fixture defined above) """ repo_path = attic_repo with pytest.raises(Repository.AtticRepository): repo_valid(repo_path) def stat_segment(path): return os.stat(os.path.join(path, 'data', '0', '0')) def first_inode(path): return stat_segment(path).st_ino orig_inode = first_inode(repo_path) with AtticRepositoryUpgrader(repo_path, create=False) as repository: # replicate command dispatch, partly os.umask(UMASK_DEFAULT) backup = repository.upgrade(dryrun=False, inplace=inplace) # note: uses hardlinks internally if inplace: assert backup is None assert first_inode(repository.path) == orig_inode else: assert backup assert first_inode(repository.path) != first_inode(backup) # i have seen cases where the copied tree has world-readable # permissions, which is wrong if 'BORG_TESTS_IGNORE_MODES' not in os.environ: assert stat_segment(backup).st_mode & UMASK_DEFAULT == 0 assert key_valid(attic_key_file) assert repo_valid(repo_path) @pytest.mark.skipif(not are_hardlinks_supported(), reason='hardlinks not supported') def test_hardlink(tmpdir, inplace): """test that we handle hard links properly that is, if we are in "inplace" mode, hardlinks should *not* change (ie. we write to the file directly, so we do not rewrite the whole file, and we do not re-create the file). if we are *not* in inplace mode, then the inode should change, as we are supposed to leave the original inode alone.""" a = str(tmpdir.join('a')) with open(a, 'wb') as tmp: tmp.write(b'aXXX') b = str(tmpdir.join('b')) os.link(a, b) AtticRepositoryUpgrader.header_replace(b, b'a', b'b', inplace=inplace) if not inplace: assert os.stat(a).st_ino != os.stat(b).st_ino else: assert os.stat(a).st_ino == os.stat(b).st_ino with open(b, 'rb') as tmp: assert tmp.read() == b'bXXX' ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/testsuite/version.py0000644000076500000240000000340714641074756020042 0ustar00twstaffimport pytest from ..version import parse_version, format_version @pytest.mark.parametrize("version_str, version_tuple", [ # setuptools < 8.0 uses "-" ('1.0.0a1.dev204-g8866961.d20170606', (1, 0, 0, -4, 1)), ('1.0.0a1.dev204-g8866961', (1, 0, 0, -4, 1)), ('1.0.0-d20170606', (1, 0, 0, -1)), # setuptools >= 8.0 uses "+" ('1.0.0a1.dev204+g8866961.d20170606', (1, 0, 0, -4, 1)), ('1.0.0a1.dev204+g8866961', (1, 0, 0, -4, 1)), ('1.0.0+d20170606', (1, 0, 0, -1)), # pre-release versions: ('1.0.0a1', (1, 0, 0, -4, 1)), ('1.0.0a2', (1, 0, 0, -4, 2)), ('1.0.0b3', (1, 0, 0, -3, 3)), ('1.0.0rc4', (1, 0, 0, -2, 4)), # release versions: ('0.0.0', (0, 0, 0, -1)), ('0.0.11', (0, 0, 11, -1)), ('0.11.0', (0, 11, 0, -1)), ('11.0.0', (11, 0, 0, -1)), ]) def test_parse_version(version_str, version_tuple): assert parse_version(version_str) == version_tuple def test_parse_version_invalid(): with pytest.raises(ValueError): assert parse_version('') # we require x.y.z versions with pytest.raises(ValueError): assert parse_version('1') # we require x.y.z versions with pytest.raises(ValueError): assert parse_version('1.2') # we require x.y.z versions with pytest.raises(ValueError): assert parse_version('crap') @pytest.mark.parametrize("version_str, version_tuple", [ ('1.0.0a1', (1, 0, 0, -4, 1)), ('1.0.0', (1, 0, 0, -1)), ('1.0.0a2', (1, 0, 0, -4, 2)), ('1.0.0b3', (1, 0, 0, -3, 3)), ('1.0.0rc4', (1, 0, 0, -2, 4)), ('0.0.0', (0, 0, 0, -1)), ('0.0.11', (0, 0, 11, -1)), ('0.11.0', (0, 11, 0, -1)), ('11.0.0', (11, 0, 0, -1)), ]) def test_format_version(version_str, version_tuple): assert format_version(version_tuple) == version_str ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/testsuite/xattr.py0000644000076500000240000000640514641074756017520 0ustar00twstaffimport os import tempfile import unittest import pytest from ..platform.xattr import buffer, split_lstring from ..xattr import is_enabled, getxattr, setxattr, listxattr from ..platformflags import is_linux from . import BaseTestCase @unittest.skipUnless(is_enabled(), 'xattr not enabled on filesystem') class XattrTestCase(BaseTestCase): def setUp(self): self.tmpfile = tempfile.NamedTemporaryFile() self.symlink = self.tmpfile.name + '.symlink' os.symlink(self.tmpfile.name, self.symlink) def tearDown(self): os.unlink(self.symlink) def assert_equal_se(self, is_x, want_x): # check 2 xattr lists for equality, but ignore security.selinux attr is_x = set(is_x) - {b'security.selinux'} want_x = set(want_x) self.assert_equal(is_x, want_x) def test(self): tmp_fn = os.fsencode(self.tmpfile.name) tmp_lfn = os.fsencode(self.symlink) tmp_fd = self.tmpfile.fileno() self.assert_equal_se(listxattr(tmp_fn), []) self.assert_equal_se(listxattr(tmp_fd), []) self.assert_equal_se(listxattr(tmp_lfn), []) setxattr(tmp_fn, b'user.foo', b'bar') setxattr(tmp_fd, b'user.bar', b'foo') setxattr(tmp_fn, b'user.empty', b'') if not is_linux: # linux does not allow setting user.* xattrs on symlinks setxattr(tmp_lfn, b'user.linkxattr', b'baz') self.assert_equal_se(listxattr(tmp_fn), [b'user.foo', b'user.bar', b'user.empty']) self.assert_equal_se(listxattr(tmp_fd), [b'user.foo', b'user.bar', b'user.empty']) self.assert_equal_se(listxattr(tmp_lfn, follow_symlinks=True), [b'user.foo', b'user.bar', b'user.empty']) if not is_linux: self.assert_equal_se(listxattr(tmp_lfn), [b'user.linkxattr']) self.assert_equal(getxattr(tmp_fn, b'user.foo'), b'bar') self.assert_equal(getxattr(tmp_fd, b'user.foo'), b'bar') self.assert_equal(getxattr(tmp_lfn, b'user.foo', follow_symlinks=True), b'bar') if not is_linux: self.assert_equal(getxattr(tmp_lfn, b'user.linkxattr'), b'baz') self.assert_equal(getxattr(tmp_fn, b'user.empty'), b'') def test_listxattr_buffer_growth(self): tmp_fn = os.fsencode(self.tmpfile.name) # make it work even with ext4, which imposes rather low limits buffer.resize(size=64, init=True) # xattr raw key list will be > 64 keys = [b'user.attr%d' % i for i in range(20)] for key in keys: setxattr(tmp_fn, key, b'x') got_keys = listxattr(tmp_fn) self.assert_equal_se(got_keys, keys) assert len(buffer) > 64 def test_getxattr_buffer_growth(self): tmp_fn = os.fsencode(self.tmpfile.name) # make it work even with ext4, which imposes rather low limits buffer.resize(size=64, init=True) value = b'x' * 126 setxattr(tmp_fn, b'user.big', value) got_value = getxattr(tmp_fn, b'user.big') self.assert_equal(value, got_value) self.assert_equal(len(buffer), 128) @pytest.mark.parametrize('lstring, splitted', ( (b'', []), (b'\x00', [b'']), (b'\x01a', [b'a']), (b'\x01a\x02cd', [b'a', b'cd']), )) def test_split_lstring(lstring, splitted): assert split_lstring(lstring) == splitted ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/upgrader.py0000644000076500000240000003236314641074756016140 0ustar00twstaffimport datetime import os import shutil import time from .crypto.key import KeyfileKey, KeyfileNotFoundError from .constants import REPOSITORY_README from .helpers import ProgressIndicatorPercent from .helpers import get_base_dir, get_keys_dir, get_cache_dir from .locking import Lock from .logger import create_logger from .repository import Repository, MAGIC logger = create_logger(__name__) ATTIC_MAGIC = b'ATTICSEG' class AtticRepositoryUpgrader(Repository): def __init__(self, *args, **kw): kw['lock'] = False # do not create borg lock files (now) in attic repo kw['check_segment_magic'] = False # skip the Attic check when upgrading super().__init__(*args, **kw) def upgrade(self, dryrun=True, inplace=False, progress=False): """convert an attic repository to a borg repository those are the files that need to be upgraded here, from most important to least important: segments, key files, and various caches, the latter being optional, as they will be rebuilt if missing. we nevertheless do the order in reverse, as we prefer to do the fast stuff first, to improve interactivity. """ with self: backup = None if not inplace: backup = f'{self.path}.before-upgrade-{datetime.datetime.now():%Y-%m-%d-%H:%M:%S}' logger.info('making a hardlink copy in %s', backup) if not dryrun: shutil.copytree(self.path, backup, copy_function=os.link) logger.info("opening attic repository with borg and converting") # now lock the repo, after we have made the copy self.lock = Lock(os.path.join(self.path, 'lock'), exclusive=True, timeout=1.0).acquire() segments = [filename for i, filename in self.io.segment_iterator()] try: keyfile = self.find_attic_keyfile() except KeyfileNotFoundError: logger.warning("no key file found for repository") else: self.convert_keyfiles(keyfile, dryrun) # partial open: just hold on to the lock self.lock = Lock(os.path.join(self.path, 'lock'), exclusive=True).acquire() try: self.convert_cache(dryrun) self.convert_repo_index(dryrun=dryrun, inplace=inplace) self.convert_segments(segments, dryrun=dryrun, inplace=inplace, progress=progress) self.borg_readme() finally: self.lock.release() self.lock = None return backup def borg_readme(self): readme = os.path.join(self.path, 'README') os.remove(readme) with open(readme, 'w') as fd: fd.write(REPOSITORY_README) @staticmethod def convert_segments(segments, dryrun=True, inplace=False, progress=False): """convert repository segments from attic to borg replacement pattern is `s/ATTICSEG/BORG_SEG/` in files in `$ATTIC_REPO/data/**`. luckily the magic string length didn't change so we can just replace the 8 first bytes of all regular files in there.""" logger.info("converting %d segments..." % len(segments)) segment_count = len(segments) pi = ProgressIndicatorPercent(total=segment_count, msg="Converting segments %3.0f%%", msgid='upgrade.convert_segments') for i, filename in enumerate(segments): if progress: pi.show(i) if dryrun: time.sleep(0.001) else: AtticRepositoryUpgrader.header_replace(filename, ATTIC_MAGIC, MAGIC, inplace=inplace) if progress: pi.finish() @staticmethod def header_replace(filename, old_magic, new_magic, inplace=True): with open(filename, 'r+b') as segment: segment.seek(0) # only write if necessary if segment.read(len(old_magic)) == old_magic: if inplace: segment.seek(0) segment.write(new_magic) else: # rename the hardlink and rewrite the file. this works # because the file is still open. so even though the file # is renamed, we can still read it until it is closed. os.rename(filename, filename + '.tmp') with open(filename, 'wb') as new_segment: new_segment.write(new_magic) new_segment.write(segment.read()) # the little dance with the .tmp file is necessary # because Windows won't allow overwriting an open file. os.unlink(filename + '.tmp') def find_attic_keyfile(self): """find the attic keyfiles the keyfiles are loaded by `KeyfileKey.find_key_file()`. that finds the keys with the right identifier for the repo. this is expected to look into $HOME/.attic/keys or $ATTIC_KEYS_DIR for key files matching the given Borg repository. it is expected to raise an exception (KeyfileNotFoundError) if no key is found. whether that exception is from Borg or Attic is unclear. this is split in a separate function in case we want to use the attic code here directly, instead of our local implementation.""" return AtticKeyfileKey.find_key_file(self) @staticmethod def convert_keyfiles(keyfile, dryrun): """convert key files from attic to borg replacement pattern is `s/ATTIC KEY/BORG_KEY/` in `get_keys_dir()`, that is `$ATTIC_KEYS_DIR` or `$HOME/.attic/keys`, and moved to `$BORG_KEYS_DIR` or `$HOME/.config/borg/keys`. no need to decrypt to convert. we need to rewrite the whole key file because magic string length changed, but that's not a problem because the keyfiles are small (compared to, say, all the segments).""" logger.info("converting keyfile %s" % keyfile) with open(keyfile) as f: data = f.read() data = data.replace(AtticKeyfileKey.FILE_ID, KeyfileKey.FILE_ID, 1) keyfile = os.path.join(get_keys_dir(), os.path.basename(keyfile)) logger.info("writing borg keyfile to %s" % keyfile) if not dryrun: with open(keyfile, 'w') as f: f.write(data) def convert_repo_index(self, dryrun, inplace): """convert some repo files those are all hash indexes, so we need to `s/ATTICIDX/BORG_IDX/` in a few locations: * the repository index (in `$ATTIC_REPO/index.%d`, where `%d` is the `Repository.get_index_transaction_id()`), which we should probably update, with a lock, see `Repository.open()`, which i'm not sure we should use because it may write data on `Repository.close()`... """ transaction_id = self.get_index_transaction_id() if transaction_id is None: logger.warning('no index file found for repository %s' % self.path) else: index = os.path.join(self.path, 'index.%d' % transaction_id) logger.info("converting repo index %s" % index) if not dryrun: AtticRepositoryUpgrader.header_replace(index, b'ATTICIDX', b'BORG_IDX', inplace=inplace) def convert_cache(self, dryrun): """convert caches from attic to borg those are all hash indexes, so we need to `s/ATTICIDX/BORG_IDX/` in a few locations: * the `files` and `chunks` cache (in `$ATTIC_CACHE_DIR` or `$HOME/.cache/attic//`), which we could just drop, but if we'd want to convert, we could open it with the `Cache.open()`, edit in place and then `Cache.close()` to make sure we have locking right """ # copy of attic's get_cache_dir() attic_cache_dir = os.environ.get('ATTIC_CACHE_DIR', os.path.join(get_base_dir(), '.cache', 'attic')) attic_cache_dir = os.path.join(attic_cache_dir, self.id_str) borg_cache_dir = os.path.join(get_cache_dir(), self.id_str) def copy_cache_file(path): """copy the given attic cache path into the borg directory does nothing if dryrun is True. also expects attic_cache_dir and borg_cache_dir to be set in the parent scope, to the directories path including the repository identifier. :params path: the basename of the cache file to copy (example: "files" or "chunks") as a string :returns: the borg file that was created or None if no Attic cache file was found. """ attic_file = os.path.join(attic_cache_dir, path) if os.path.exists(attic_file): borg_file = os.path.join(borg_cache_dir, path) if os.path.exists(borg_file): logger.warning("borg cache file already exists in %s, not copying from Attic", borg_file) else: logger.info(f"copying attic cache file from {attic_file} to {borg_file}") if not dryrun: shutil.copyfile(attic_file, borg_file) return borg_file else: logger.warning(f"no {path} cache file found in {attic_file}") return None # XXX: untested, because generating cache files is a PITA, see # Archiver.do_create() for proof if os.path.exists(attic_cache_dir): if not os.path.exists(borg_cache_dir): os.makedirs(borg_cache_dir) # file that we don't have a header to convert, just copy for cache in ['config', 'files']: copy_cache_file(cache) # we need to convert the headers of those files, copy first for cache in ['chunks']: cache = copy_cache_file(cache) logger.info("converting cache %s" % cache) if not dryrun: AtticRepositoryUpgrader.header_replace(cache, b'ATTICIDX', b'BORG_IDX') class AtticKeyfileKey(KeyfileKey): """backwards compatible Attic key file parser""" FILE_ID = 'ATTIC KEY' # verbatim copy from attic @staticmethod def get_keys_dir(): """Determine where to repository keys and cache""" return os.environ.get('ATTIC_KEYS_DIR', os.path.join(get_base_dir(), '.attic', 'keys')) @classmethod def find_key_file(cls, repository): """copy of attic's `find_key_file`_ this has two small modifications: 1. it uses the above `get_keys_dir`_ instead of the global one, assumed to be borg's 2. it uses `repository.path`_ instead of `repository._location.canonical_path`_ because we can't assume the repository has been opened by the archiver yet """ get_keys_dir = cls.get_keys_dir keys_dir = get_keys_dir() if not os.path.exists(keys_dir): raise KeyfileNotFoundError(repository.path, keys_dir) for name in os.listdir(keys_dir): filename = os.path.join(keys_dir, name) with open(filename) as fd: line = fd.readline().strip() if line and line.startswith(cls.FILE_ID) and line[10:] == repository.id_str: return filename raise KeyfileNotFoundError(repository.path, keys_dir) class BorgRepositoryUpgrader(Repository): def upgrade(self, dryrun=True, inplace=False, progress=False): """convert an old borg repository to a current borg repository """ logger.info("converting borg 0.xx to borg current") with self: try: keyfile = self.find_borg0xx_keyfile() except KeyfileNotFoundError: logger.warning("no key file found for repository") else: self.move_keyfiles(keyfile, dryrun) def find_borg0xx_keyfile(self): return Borg0xxKeyfileKey.find_key_file(self) def move_keyfiles(self, keyfile, dryrun): filename = os.path.basename(keyfile) new_keyfile = os.path.join(get_keys_dir(), filename) try: os.rename(keyfile, new_keyfile) except FileExistsError: # likely the attic -> borg upgrader already put it in the final location pass class Borg0xxKeyfileKey(KeyfileKey): """backwards compatible borg 0.xx key file parser""" @staticmethod def get_keys_dir(): return os.environ.get('BORG_KEYS_DIR', os.path.join(get_base_dir(), '.borg', 'keys')) @classmethod def find_key_file(cls, repository): get_keys_dir = cls.get_keys_dir keys_dir = get_keys_dir() if not os.path.exists(keys_dir): raise KeyfileNotFoundError(repository.path, keys_dir) for name in os.listdir(keys_dir): filename = os.path.join(keys_dir, name) with open(filename) as fd: line = fd.readline().strip() if line and line.startswith(cls.FILE_ID) and line[len(cls.FILE_ID) + 1:] == repository.id_str: return filename raise KeyfileNotFoundError(repository.path, keys_dir) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/version.py0000644000076500000240000000343314641074756016010 0ustar00twstaffimport re def parse_version(version): """ Simplistic parser for setuptools_scm versions. Supports final versions and alpha ('a'), beta ('b') and release candidate ('rc') versions. It does not try to parse anything else than that, even if there is more in the version string. Output is a version tuple containing integers. It ends with one or two elements that ensure that relational operators yield correct relations for alpha, beta and rc versions, too. For final versions the last element is a -1. For prerelease versions the last two elements are a smaller negative number and the number of e.g. the beta. This version format is part of the remote protocol, don‘t change in breaking ways. """ version_re = r""" (?P\d+)\.(?P\d+)\.(?P\d+) # version, e.g. 1.2.33 (?P(?Pa|b|rc)(?P\d+))? # optional prerelease, e.g. a1 or b2 or rc33 """ m = re.match(version_re, version, re.VERBOSE) if m is None: raise ValueError('Invalid version string %s' % version) gd = m.groupdict() version = [int(gd['major']), int(gd['minor']), int(gd['patch'])] if m.lastgroup == 'prerelease': p_type = {'a': -4, 'b': -3, 'rc': -2}[gd['ptype']] p_num = int(gd['pnum']) version += [p_type, p_num] else: version += [-1] return tuple(version) def format_version(version): """a reverse for parse_version (obviously without the dropped information)""" f = [] it = iter(version) while True: part = next(it) if part >= 0: f.append(str(part)) elif part == -1: break else: f[-1] = f[-1] + {-2: 'rc', -3: 'b', -4: 'a'}[part] + str(next(it)) break return '.'.join(f) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/src/borg/xattr.py0000644000076500000240000001354414641074756015471 0ustar00twstaff"""A basic extended attributes (xattr) implementation for Linux, FreeBSD and macOS.""" import errno import os import re import subprocess import sys import tempfile from packaging.version import parse as parse_version from .helpers import prepare_subprocess_env from .logger import create_logger logger = create_logger() from .platform import listxattr, getxattr, setxattr, ENOATTR # If we are running with fakeroot on Linux, then use the xattr functions of fakeroot. This is needed by # the 'test_extract_capabilities' test, but also allows xattrs to work with fakeroot on Linux in normal use. # TODO: Check whether fakeroot supports xattrs on all platforms supported below. # TODO: If that's the case then we can make Borg fakeroot-xattr-compatible on these as well. XATTR_FAKEROOT = False if sys.platform.startswith('linux'): LD_PRELOAD = os.environ.get('LD_PRELOAD', '') preloads = re.split("[ :]", LD_PRELOAD) for preload in preloads: if preload.startswith("libfakeroot"): env = prepare_subprocess_env(system=True) fakeroot_output = subprocess.check_output(['fakeroot', '-v'], env=env) fakeroot_version = parse_version(fakeroot_output.decode('ascii').split()[-1]) if fakeroot_version >= parse_version("1.20.2"): # 1.20.2 has been confirmed to have xattr support # 1.18.2 has been confirmed not to have xattr support # Versions in-between are unknown XATTR_FAKEROOT = True break def is_enabled(path=None): """Determine if xattr is enabled on the filesystem """ with tempfile.NamedTemporaryFile(dir=path, prefix='borg-tmp') as f: fd = f.fileno() name, value = b'user.name', b'value' try: setxattr(fd, name, value) except OSError: return False try: names = listxattr(fd) except OSError: return False if name not in names: return False return getxattr(fd, name) == value def get_all(path, follow_symlinks=False): """ Return all extended attributes on *path* as a mapping. *path* can either be a path (str or bytes) or an open file descriptor (int). *follow_symlinks* indicates whether symlinks should be followed and only applies when *path* is not an open file descriptor. The returned mapping maps xattr names (bytes) to values (bytes or None). None indicates, as a xattr value, an empty value, i.e. a value of length zero. """ if isinstance(path, str): path = os.fsencode(path) result = {} try: names = listxattr(path, follow_symlinks=follow_symlinks) for name in names: try: # xattr name is a bytes object, we directly use it. # if we get an empty xattr value (b''), we store None into the result dict - # borg always did it like that... result[name] = getxattr(path, name, follow_symlinks=follow_symlinks) or None except OSError as e: # note: platform.xattr._check has already made a nice exception e with errno, msg, path/fd if e.errno in (ENOATTR, ): # errors we just ignore silently # ENOATTR: a race has happened: xattr names were deleted after list. pass else: # all others: warn, skip this single xattr name, continue processing other xattrs # EPERM: we were not permitted to read this attribute # EINVAL: maybe xattr name is invalid or other issue, #6988 logger.warning('when getting extended attribute %s: %s', name.decode(errors='replace'), str(e)) except OSError as e: if e.errno in (errno.ENOTSUP, errno.EPERM): # if xattrs are not supported on the filesystem, we give up. # EPERM might be raised by listxattr. pass else: raise return result def set_all(path, xattrs, follow_symlinks=False): """ Set all extended attributes on *path* from a mapping. *path* can either be a path (str or bytes) or an open file descriptor (int). *follow_symlinks* indicates whether symlinks should be followed and only applies when *path* is not an open file descriptor. *xattrs* is mapping maps xattr names (bytes) to values (bytes or None). None indicates, as a xattr value, an empty value, i.e. a value of length zero. Return warning status (True means a non-fatal exception has happened and was dealt with). """ if isinstance(path, str): path = os.fsencode(path) warning = False for k, v in xattrs.items(): try: # the key k is a bytes object due to msgpack unpacking it as such. # if we have a None value, it means "empty", so give b'' to setxattr in that case: setxattr(path, k, v or b'', follow_symlinks=follow_symlinks) except OSError as e: # note: platform.xattr._check has already made a nice exception e with errno, msg, path/fd warning = True if e.errno == errno.E2BIG: err_str = 'too big for this filesystem (%s)' % str(e) elif e.errno == errno.ENOSPC: # ext4 reports ENOSPC when trying to set an xattr with >4kiB while ext4 can only support 4kiB xattrs # (in this case, this is NOT a "disk full" error, just a ext4 limitation). err_str = 'fs full or xattr too big? [xattr len = %d] (%s)' % (len(v), str(e)) else: # generic handler # EACCES: permission denied to set this specific xattr (this may happen related to security.* keys) # EPERM: operation not permitted err_str = str(e) logger.warning('when setting extended attribute %s: %s', k.decode(errors='replace'), err_str) return warning ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1719958149.847942 borgbackup-1.4.0/src/borgbackup.egg-info/0000755000076500000240000000000014641075206016615 5ustar00twstaff././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719958149.0 borgbackup-1.4.0/src/borgbackup.egg-info/PKG-INFO0000644000076500000240000002034214641075205017712 0ustar00twstaffMetadata-Version: 2.1 Name: borgbackup Version: 1.4.0 Summary: Deduplicated, encrypted, authenticated and compressed backups Author: The Borg Collective (see AUTHORS file) Maintainer-email: Thomas Waldmann License: BSD Project-URL: Homepage, https://borgbackup.org/ Project-URL: Bug Tracker, https://github.com/borgbackup/borg/issues Project-URL: Documentation, https://borgbackup.readthedocs.io/ Project-URL: Repository, https://github.com/borgbackup/borg Project-URL: Changelog, https://github.com/borgbackup/borg/blob/1.4-maint/docs/changes.rst Keywords: backup,borgbackup Classifier: Development Status :: 4 - Beta Classifier: Environment :: Console Classifier: Intended Audience :: System Administrators Classifier: License :: OSI Approved :: BSD License Classifier: Operating System :: POSIX :: BSD :: FreeBSD Classifier: Operating System :: POSIX :: BSD :: OpenBSD Classifier: Operating System :: POSIX :: BSD :: NetBSD Classifier: Operating System :: MacOS :: MacOS X Classifier: Operating System :: POSIX :: Linux Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: 3.12 Classifier: Topic :: Security :: Cryptography Classifier: Topic :: System :: Archiving :: Backup Requires-Python: >=3.9 License-File: LICENSE License-File: AUTHORS Requires-Dist: msgpack<=1.1.0,>=1.0.3 Requires-Dist: packaging Provides-Extra: llfuse Requires-Dist: llfuse>=1.3.8; extra == "llfuse" Provides-Extra: pyfuse3 Requires-Dist: pyfuse3>=3.1.1; extra == "pyfuse3" Provides-Extra: nofuse What is BorgBackup? ------------------- BorgBackup (short: Borg) is a deduplicating backup program. Optionally, it supports compression and authenticated encryption. The main goal of Borg is to provide an efficient and secure way to backup data. The data deduplication technique used makes Borg suitable for daily backups since only changes are stored. The authenticated encryption technique makes it suitable for backups to not fully trusted targets. See the `installation manual`_ or, if you have already downloaded Borg, ``docs/installation.rst`` to get started with Borg. There is also an `offline documentation`_ available, in multiple formats. .. _installation manual: https://borgbackup.readthedocs.org/en/stable/installation.html .. _offline documentation: https://readthedocs.org/projects/borgbackup/downloads Main features ~~~~~~~~~~~~~ **Space efficient storage** Deduplication based on content-defined chunking is used to reduce the number of bytes stored: each file is split into a number of variable length chunks and only chunks that have never been seen before are added to the repository. A chunk is considered duplicate if its id_hash value is identical. A cryptographically strong hash or MAC function is used as id_hash, e.g. (hmac-)sha256. To deduplicate, all the chunks in the same repository are considered, no matter whether they come from different machines, from previous backups, from the same backup or even from the same single file. Compared to other deduplication approaches, this method does NOT depend on: * file/directory names staying the same: So you can move your stuff around without killing the deduplication, even between machines sharing a repo. * complete files or time stamps staying the same: If a big file changes a little, only a few new chunks need to be stored - this is great for VMs or raw disks. * The absolute position of a data chunk inside a file: Stuff may get shifted and will still be found by the deduplication algorithm. **Speed** * performance-critical code (chunking, compression, encryption) is implemented in C/Cython * local caching of files/chunks index data * quick detection of unmodified files **Data encryption** All data can be protected using 256-bit AES encryption, data integrity and authenticity is verified using HMAC-SHA256. Data is encrypted clientside. **Obfuscation** Optionally, borg can actively obfuscate e.g. the size of files / chunks to make fingerprinting attacks more difficult. **Compression** All data can be optionally compressed: * lz4 (super fast, low compression) * zstd (wide range from high speed and low compression to high compression and lower speed) * zlib (medium speed and compression) * lzma (low speed, high compression) **Off-site backups** Borg can store data on any remote host accessible over SSH. If Borg is installed on the remote host, big performance gains can be achieved compared to using a network filesystem (sshfs, nfs, ...). **Backups mountable as filesystems** Backup archives are mountable as userspace filesystems for easy interactive backup examination and restores (e.g. by using a regular file manager). **Easy installation on multiple platforms** We offer single-file binaries that do not require installing anything - you can just run them on these platforms: * Linux * Mac OS X * FreeBSD * OpenBSD and NetBSD (no xattrs/ACLs support or binaries yet) * Cygwin (experimental, no binaries yet) * Linux Subsystem of Windows 10 (experimental) **Free and Open Source Software** * security and functionality can be audited independently * licensed under the BSD (3-clause) license, see `License`_ for the complete license Easy to use ~~~~~~~~~~~ Initialize a new backup repository (see ``borg init --help`` for encryption options):: $ borg init -e repokey /path/to/repo Create a backup archive:: $ borg create /path/to/repo::Saturday1 ~/Documents Now doing another backup, just to show off the great deduplication:: $ borg create -v --stats /path/to/repo::Saturday2 ~/Documents ----------------------------------------------------------------------------- Archive name: Saturday2 Archive fingerprint: 622b7c53c... Time (start): Sat, 2016-02-27 14:48:13 Time (end): Sat, 2016-02-27 14:48:14 Duration: 0.88 seconds Number of files: 163 ----------------------------------------------------------------------------- Original size Compressed size Deduplicated size This archive: 6.85 MB 6.85 MB 30.79 kB <-- ! All archives: 13.69 MB 13.71 MB 6.88 MB Unique chunks Total chunks Chunk index: 167 330 ----------------------------------------------------------------------------- For a graphical frontend refer to our complementary project `BorgWeb `_. Helping, Donations and Bounties, becoming a Patron -------------------------------------------------- Your help is always welcome! Spread the word, give feedback, help with documentation, testing or development. You can also give monetary support to the project, see there for details: https://www.borgbackup.org/support/fund.html Links ----- * `Main Web Site `_ * `Releases `_, `PyPI packages `_ and `ChangeLog `_ * `Offline Documentation `_ * `GitHub `_ and `Issue Tracker `_. * `Web-Chat (IRC) `_ and `Mailing List `_ * `License `_ * `Security contact `_ Compatibility notes ------------------- EXPECT THAT WE WILL BREAK COMPATIBILITY REPEATEDLY WHEN MAJOR RELEASE NUMBER CHANGES (like when going from 0.x.y to 1.0.0 or from 1.x.y to 2.0.0). NOT RELEASED DEVELOPMENT VERSIONS HAVE UNKNOWN COMPATIBILITY PROPERTIES. THIS IS SOFTWARE IN DEVELOPMENT, DECIDE YOURSELF WHETHER IT FITS YOUR NEEDS. Security issues should be reported to the `Security contact`_ (or see ``docs/support.rst`` in the source distribution). ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719958149.0 borgbackup-1.4.0/src/borgbackup.egg-info/SOURCES.txt0000644000076500000240000002074114641075205020504 0ustar00twstaff.coveragerc .pre-commit-config.yaml .readthedocs.yaml AUTHORS Brewfile CHANGES.rst LICENSE MANIFEST.in README.rst README_WINDOWS.rst SECURITY.md pyproject.toml setup.py tox.ini docs/Makefile docs/authors.rst docs/book.rst docs/changes.rst docs/conf.py docs/deployment.rst docs/development.rst docs/faq.rst docs/global.rst.inc docs/index.rst docs/installation.rst docs/internals.rst docs/introduction.rst docs/man_intro.rst docs/quickstart.rst docs/quickstart_example.rst.inc docs/support.rst docs/usage.rst docs/usage_general.rst.inc docs/3rd_party/README docs/3rd_party/lz4/LICENSE docs/3rd_party/zstd/LICENSE docs/_static/Makefile docs/_static/favicon.ico docs/_static/logo.pdf docs/_static/logo.png docs/_static/logo.svg docs/_static/logo_font.txt docs/_templates/globaltoc.html docs/_templates/logo-text.html docs/borg_theme/css/borg.css docs/deployment/automated-local.rst docs/deployment/central-backup-server.rst docs/deployment/hosting-repositories.rst docs/deployment/image-backup.rst docs/deployment/non-root-user.rst docs/deployment/pull-backup.rst docs/internals/compaction.png docs/internals/compaction.vsd docs/internals/data-structures.rst docs/internals/encryption.png docs/internals/encryption.vsd docs/internals/frontends.rst docs/internals/object-graph.png docs/internals/object-graph.vsd docs/internals/security.rst docs/internals/structure.png docs/internals/structure.vsd docs/man/borg-benchmark-crud.1 docs/man/borg-benchmark.1 docs/man/borg-break-lock.1 docs/man/borg-change-passphrase.1 docs/man/borg-check.1 docs/man/borg-common.1 docs/man/borg-compact.1 docs/man/borg-compression.1 docs/man/borg-config.1 docs/man/borg-create.1 docs/man/borg-delete.1 docs/man/borg-diff.1 docs/man/borg-export-tar.1 docs/man/borg-extract.1 docs/man/borg-import-tar.1 docs/man/borg-info.1 docs/man/borg-init.1 docs/man/borg-key-change-passphrase.1 docs/man/borg-key-export.1 docs/man/borg-key-import.1 docs/man/borg-key-migrate-to-repokey.1 docs/man/borg-key.1 docs/man/borg-list.1 docs/man/borg-mount.1 docs/man/borg-patterns.1 docs/man/borg-placeholders.1 docs/man/borg-prune.1 docs/man/borg-recreate.1 docs/man/borg-rename.1 docs/man/borg-serve.1 docs/man/borg-umount.1 docs/man/borg-upgrade.1 docs/man/borg-version.1 docs/man/borg-with-lock.1 docs/man/borg.1 docs/man/borgfs.1 docs/misc/benchmark-crud.txt docs/misc/borg-data-flow.png docs/misc/borg-data-flow.vsd docs/misc/create_chunker-params.txt docs/misc/internals-picture.txt docs/misc/logging.conf docs/misc/prune-example.txt docs/misc/asciinema/README docs/misc/asciinema/Vagrantfile docs/misc/asciinema/advanced.json docs/misc/asciinema/advanced.tcl docs/misc/asciinema/basic.json docs/misc/asciinema/basic.tcl docs/misc/asciinema/install.json docs/misc/asciinema/install.tcl docs/misc/asciinema/sample-wallpapers.txt docs/usage/benchmark.rst docs/usage/benchmark_crud.rst.inc docs/usage/borgfs.rst docs/usage/borgfs.rst.inc docs/usage/break-lock.rst.inc docs/usage/change-passphrase.rst.inc docs/usage/check.rst docs/usage/check.rst.inc docs/usage/common-options.rst.inc docs/usage/compact.rst docs/usage/compact.rst.inc docs/usage/config.rst docs/usage/config.rst.inc docs/usage/create.rst docs/usage/create.rst.inc docs/usage/debug.rst docs/usage/delete.rst docs/usage/delete.rst.inc docs/usage/diff.rst docs/usage/diff.rst.inc docs/usage/export-tar.rst.inc docs/usage/extract.rst docs/usage/extract.rst.inc docs/usage/general.rst docs/usage/help.rst docs/usage/help.rst.inc docs/usage/import-tar.rst.inc docs/usage/info.rst docs/usage/info.rst.inc docs/usage/init.rst docs/usage/init.rst.inc docs/usage/key.rst docs/usage/key_change-passphrase.rst.inc docs/usage/key_export.rst.inc docs/usage/key_import.rst.inc docs/usage/key_migrate-to-repokey.rst.inc docs/usage/list.rst docs/usage/list.rst.inc docs/usage/lock.rst docs/usage/mount.rst docs/usage/mount.rst.inc docs/usage/notes.rst docs/usage/prune.rst docs/usage/prune.rst.inc docs/usage/recreate.rst docs/usage/recreate.rst.inc docs/usage/rename.rst docs/usage/rename.rst.inc docs/usage/serve.rst docs/usage/serve.rst.inc docs/usage/tar.rst docs/usage/umount.rst.inc docs/usage/upgrade.rst docs/usage/upgrade.rst.inc docs/usage/usage_general.rst.inc docs/usage/version.rst docs/usage/version.rst.inc docs/usage/with-lock.rst.inc docs/usage/general/date-time.rst.inc docs/usage/general/environment.rst.inc docs/usage/general/file-metadata.rst.inc docs/usage/general/file-systems.rst.inc docs/usage/general/logging.rst.inc docs/usage/general/positional-arguments.rst.inc docs/usage/general/repository-locations.rst.inc docs/usage/general/repository-urls.rst.inc docs/usage/general/resources.rst.inc docs/usage/general/return-codes.rst.inc docs/usage/general/units.rst.inc requirements.d/development.lock.txt requirements.d/development.txt requirements.d/docs.txt scripts/borg.exe.spec scripts/errorlist.py scripts/fetch-binaries scripts/glibc_check.py scripts/hash_sizes.py scripts/make.py scripts/msys2-build scripts/msys2-install-deps scripts/sdist-sign scripts/sign-binaries scripts/upload-pypi scripts/fuzz-cache-sync/HOWTO scripts/fuzz-cache-sync/main.c scripts/fuzz-cache-sync/testcase_dir/test_simple scripts/shell_completions/bash/borg scripts/shell_completions/fish/borg.fish scripts/shell_completions/zsh/_borg src/borg/__init__.py src/borg/__main__.py src/borg/_chunker.c src/borg/_endian.h src/borg/_hashindex.c src/borg/_item.c src/borg/_version.py src/borg/archive.py src/borg/archiver.py src/borg/cache.py src/borg/chunker.c src/borg/chunker.pyx src/borg/compress.c src/borg/compress.pyx src/borg/constants.py src/borg/fuse.py src/borg/fuse_impl.py src/borg/hashindex.c src/borg/hashindex.pyx src/borg/item.c src/borg/item.pyx src/borg/locking.py src/borg/logger.py src/borg/lrucache.py src/borg/nanorst.py src/borg/paperkey.html src/borg/patterns.py src/borg/platformflags.py src/borg/remote.py src/borg/repository.py src/borg/selftest.py src/borg/shellpattern.py src/borg/upgrader.py src/borg/version.py src/borg/xattr.py src/borg/algorithms/__init__.py src/borg/algorithms/checksums.c src/borg/algorithms/checksums.pyx src/borg/algorithms/crc32_clmul.c src/borg/algorithms/crc32_dispatch.c src/borg/algorithms/crc32_slice_by_8.c src/borg/cache_sync/cache_sync.c src/borg/cache_sync/sysdep.h src/borg/cache_sync/unpack.h src/borg/cache_sync/unpack_define.h src/borg/cache_sync/unpack_template.h src/borg/crypto/__init__.py src/borg/crypto/_crypto_helpers.c src/borg/crypto/_crypto_helpers.h src/borg/crypto/file_integrity.py src/borg/crypto/key.py src/borg/crypto/keymanager.py src/borg/crypto/low_level.c src/borg/crypto/low_level.pyx src/borg/crypto/nonces.py src/borg/helpers/__init__.py src/borg/helpers/checks.py src/borg/helpers/datastruct.py src/borg/helpers/errors.py src/borg/helpers/fs.py src/borg/helpers/manifest.py src/borg/helpers/misc.py src/borg/helpers/msgpack.py src/borg/helpers/parseformat.py src/borg/helpers/process.py src/borg/helpers/progress.py src/borg/helpers/time.py src/borg/helpers/yes.py src/borg/platform/__init__.py src/borg/platform/base.py src/borg/platform/darwin.c src/borg/platform/darwin.pyx src/borg/platform/freebsd.c src/borg/platform/freebsd.pyx src/borg/platform/linux.c src/borg/platform/linux.pyx src/borg/platform/posix.c src/borg/platform/posix.pyx src/borg/platform/syncfilerange.c src/borg/platform/syncfilerange.pyx src/borg/platform/windows.c src/borg/platform/windows.pyx src/borg/platform/xattr.py src/borg/testsuite/__init__.py src/borg/testsuite/archive.py src/borg/testsuite/archiver.py src/borg/testsuite/attic.tar.gz src/borg/testsuite/benchmark.py src/borg/testsuite/cache.py src/borg/testsuite/checksums.py src/borg/testsuite/chunker.py src/borg/testsuite/chunker_pytest.py src/borg/testsuite/chunker_slow.py src/borg/testsuite/compress.py src/borg/testsuite/conftest.py src/borg/testsuite/crypto.py src/borg/testsuite/efficient_collection_queue.py src/borg/testsuite/file_integrity.py src/borg/testsuite/hashindex.py src/borg/testsuite/hashindex_stress.py src/borg/testsuite/helpers.py src/borg/testsuite/item.py src/borg/testsuite/key.py src/borg/testsuite/locking.py src/borg/testsuite/logger.py src/borg/testsuite/lrucache.py src/borg/testsuite/nanorst.py src/borg/testsuite/nonces.py src/borg/testsuite/patterns.py src/borg/testsuite/platform.py src/borg/testsuite/remote.py src/borg/testsuite/repository.py src/borg/testsuite/shellpattern.py src/borg/testsuite/upgrader.py src/borg/testsuite/version.py src/borg/testsuite/xattr.py src/borgbackup.egg-info/PKG-INFO src/borgbackup.egg-info/SOURCES.txt src/borgbackup.egg-info/dependency_links.txt src/borgbackup.egg-info/entry_points.txt src/borgbackup.egg-info/requires.txt src/borgbackup.egg-info/top_level.txt././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719958149.0 borgbackup-1.4.0/src/borgbackup.egg-info/dependency_links.txt0000644000076500000240000000000114641075205022662 0ustar00twstaff ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719958149.0 borgbackup-1.4.0/src/borgbackup.egg-info/entry_points.txt0000644000076500000240000000011014641075205022102 0ustar00twstaff[console_scripts] borg = borg.archiver:main borgfs = borg.archiver:main ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719958149.0 borgbackup-1.4.0/src/borgbackup.egg-info/requires.txt0000644000076500000240000000013514641075205021213 0ustar00twstaffmsgpack<=1.1.0,>=1.0.3 packaging [llfuse] llfuse>=1.3.8 [nofuse] [pyfuse3] pyfuse3>=3.1.1 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719958149.0 borgbackup-1.4.0/src/borgbackup.egg-info/top_level.txt0000644000076500000240000000000514641075205021341 0ustar00twstaffborg ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719957998.0 borgbackup-1.4.0/tox.ini0000644000076500000240000000135014641074756013540 0ustar00twstaff# tox configuration - if you change anything here, run this to verify: # fakeroot -u tox --recreate [tox] envlist = py{39,310,311,312}-{none,fuse2,fuse3} requires = pkgconfig cython wheel setuptools_scm [testenv] setenv = fuse2: BORG_FUSE_IMPL=llfuse fuse3: BORG_FUSE_IMPL=pyfuse3 deps = fuse2: llfuse fuse3: pyfuse3 -rrequirements.d/development.txt commands = py.test -v -n {env:XDISTN:1} -rs --cov=borg --cov-config=.coveragerc --benchmark-skip --pyargs {posargs:borg.testsuite} # fakeroot -u needs some env vars: passenv = * [testenv:.pkg] passenv = * # needed by tox4, so env vars are visible for building borg [testenv:ruff] skip_sdist=true skip_install=true changedir = deps = ruff commands = ruff check .